Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 21 additions & 23 deletions src/hotspot/cpu/aarch64/templateTable_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2796,21 +2796,20 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ push(atos);
__ b(Done);
} else {
Label is_flat, rewrite_inline;
__ test_field_is_flat(flags, noreg /*temp*/, is_flat);
Label is_flat;
__ test_field_is_flat(flags, noreg /* temp */, is_flat);
__ load_heap_oop(r0, field, rscratch1, rscratch2);
__ push(atos);
if (rc == may_rewrite) {
patch_bytecode(Bytecodes::_fast_agetfield, bc, r1);
}
__ b(Done);
__ bind(is_flat);
// field is flat (null-free or nullable with a null-marker)
__ mov(r0, obj);
__ read_flat_field(cache, field_index, off, inline_klass /* temp */, r0);
__ verify_oop(r0);
__ push(atos);
__ bind(rewrite_inline);
// field is flat (null-free or nullable with a null-marker)
__ mov(r0, obj);
__ read_flat_field(cache, field_index, off, inline_klass /* temp */, r0);
__ verify_oop(r0);
__ push(atos);
if (rc == may_rewrite) {
patch_bytecode(Bytecodes::_fast_vgetfield, bc, r1);
}
Expand Down Expand Up @@ -2979,7 +2978,6 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
const Register off = r19;
const Register flags = r6;
const Register bc = r4;
const Register inline_klass = r5;

resolve_cache_and_index_for_field(byte_no, cache, index);
jvmti_post_field_mod(cache, index, is_static);
Expand Down Expand Up @@ -3037,7 +3035,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr

// atos
{
if (!Arguments::is_valhalla_enabled()) {
if (!Arguments::is_valhalla_enabled()) {
__ pop(atos);
if (!is_static) pop_and_check_object(obj);
// Store into the field
Expand All @@ -3047,19 +3045,19 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
patch_bytecode(Bytecodes::_fast_aputfield, bc, r1, true, byte_no);
}
__ b(Done);
} else { // Valhalla
} else { // Valhalla
__ pop(atos);
if (is_static) {
Label is_nullable;
__ test_field_is_not_null_free_inline_type(flags, noreg /* temp */, is_nullable);
__ null_check(r0); // FIXME JDK-8341120
__ bind(is_nullable);
do_oop_store(_masm, field, r0, IN_HEAP);
__ b(Done);
__ test_field_is_not_null_free_inline_type(flags, noreg /* temp */, is_nullable);
__ null_check(r0); // FIXME JDK-8341120
__ bind(is_nullable);
do_oop_store(_masm, field, r0, IN_HEAP);
__ b(Done);
} else {
Label null_free_reference, is_flat, rewrite_inline;
__ test_field_is_flat(flags, noreg /*temp*/, is_flat);
__ test_field_is_null_free_inline_type(flags, noreg /*temp*/, null_free_reference);
__ test_field_is_flat(flags, noreg /* temp */, is_flat);
__ test_field_is_null_free_inline_type(flags, noreg /* temp */, null_free_reference);
pop_and_check_object(obj);
// Store into the field
// Clobbers: r10, r11, r3
Expand All @@ -3078,14 +3076,14 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
__ b(rewrite_inline);
__ bind(is_flat);
pop_and_check_object(r7);
__ write_flat_field(cache, off, r3, r6, r7);
__ write_flat_field(cache, off, index, flags, r7);
__ bind(rewrite_inline);
if (rc == may_rewrite) {
patch_bytecode(Bytecodes::_fast_vputfield, bc, r19, true, byte_no);
}
__ b(Done);
}
} // Valhalla
} // Valhalla
}

__ bind(notObj);
Expand Down Expand Up @@ -3224,7 +3222,7 @@ void TemplateTable::jvmti_post_fast_field_mod() {
// to do it for every data type, we use the saved values as the
// jvalue object.
switch (bytecode()) { // load values into the jvalue object
case Bytecodes::_fast_vputfield: //fall through
case Bytecodes::_fast_vputfield: // fall through
case Bytecodes::_fast_aputfield: __ push_ptr(r0); break;
case Bytecodes::_fast_bputfield: // fall through
case Bytecodes::_fast_zputfield: // fall through
Expand All @@ -3251,7 +3249,7 @@ void TemplateTable::jvmti_post_fast_field_mod() {
r19, c_rarg2, c_rarg3);

switch (bytecode()) { // restore tos values
case Bytecodes::_fast_vputfield: //fall through
case Bytecodes::_fast_vputfield: // fall through
case Bytecodes::_fast_aputfield: __ pop_ptr(r0); break;
case Bytecodes::_fast_bputfield: // fall through
case Bytecodes::_fast_zputfield: // fall through
Expand Down Expand Up @@ -3301,7 +3299,7 @@ void TemplateTable::fast_storefield(TosState state)
switch (bytecode()) {
case Bytecodes::_fast_vputfield:
{
Label is_flat, has_null_marker, done;
Label is_flat, done;
__ test_field_is_flat(r5, noreg /* temp */, is_flat);
__ null_check(r0);
do_oop_store(_masm, field, r0, IN_HEAP);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/interpreter/interpreterRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ JRT_ENTRY(void, InterpreterRuntime::write_flat_field(JavaThread* current, oopDes
InstanceKlass* holder = entry->field_holder();
InlineLayoutInfo* li = holder->inline_layout_info_adr(entry->field_index());
InlineKlass* vk = li->klass();
vk->write_value_to_addr(val_h(), ((char*)(oopDesc*)obj_h()) + entry->field_offset(), li->kind(), true, CHECK);
vk->write_value_to_addr(val_h(), ((char*)(oopDesc*)obj_h()) + entry->field_offset(), li->kind(), CHECK);
JRT_END

JRT_ENTRY(void, InterpreterRuntime::newarray(JavaThread* current, BasicType type, jint size))
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/share/interpreter/templateTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ void TemplateTable::jsr() {
// Implementation of TemplateTable: Debugging

void TemplateTable::transition(TosState tos_in, TosState tos_out) {
assert(_desc->tos_in() == tos_in,
"inconsistent tos_in information");
assert(_desc->tos_in() == tos_in , "inconsistent tos_in information");
assert(_desc->tos_out() == tos_out, "inconsistent tos_out information");
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/oops/flatArrayOop.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ inline void flatArrayOopDesc::obj_at_put(int index, oop value, TRAPS) {
} else if(is_null_free_array()) {
THROW_MSG(vmSymbols::java_lang_NullPointerException(), "Cannot store null in a null-restricted array");
}
vk->write_value_to_addr(value, value_at_addr(index, faklass->layout_helper()), faklass->layout_kind(), true, CHECK);
vk->write_value_to_addr(value, value_at_addr(index, faklass->layout_helper()), faklass->layout_kind(), CHECK);
}

#endif // SHARE_VM_OOPS_FLATARRAYOOP_INLINE_HPP
7 changes: 3 additions & 4 deletions src/hotspot/share/oops/inlineKlass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ void InlineKlass::copy_payload_to_addr(void* src, void* dst, LayoutKind lk, bool
assert(lk != LayoutKind::REFERENCE && lk != LayoutKind::UNKNOWN, "Sanity check");
switch(lk) {
case LayoutKind::NULLABLE_ATOMIC_FLAT: {
if (is_payload_marked_as_null((address)src)) {
if (is_payload_marked_as_null((address)src)) {
if (!contains_oops()) {
mark_payload_as_null((address)dst);
return;
Expand All @@ -210,7 +210,6 @@ void InlineKlass::copy_payload_to_addr(void* src, void* dst, LayoutKind lk, bool
}
} else {
// Copy has to be performed, even if this is an empty value, because of the null marker
mark_payload_as_non_null((address)src);
if (dest_is_initialized) {
HeapAccess<>::value_copy(src, dst, this, lk);
} else {
Expand Down Expand Up @@ -263,7 +262,7 @@ oop InlineKlass::read_payload_from_addr(const oop src, size_t offset, LayoutKind
}
}

void InlineKlass::write_value_to_addr(oop src, void* dst, LayoutKind lk, bool dest_is_initialized, TRAPS) {
void InlineKlass::write_value_to_addr(oop src, void* dst, LayoutKind lk, TRAPS) {
void* src_addr = nullptr;
if (src == nullptr) {
if (!LayoutKindHelper::is_nullable_flat(lk)) {
Expand All @@ -287,7 +286,7 @@ void InlineKlass::write_value_to_addr(oop src, void* dst, LayoutKind lk, bool de
mark_payload_as_non_null((address)src_addr);
}
}
copy_payload_to_addr(src_addr, dst, lk, dest_is_initialized);
copy_payload_to_addr(src_addr, dst, lk, true /* dest_is_initialized */);
}

// Arrays of...
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/oops/inlineKlass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class InlineKlass: public InstanceKlass {
// of a null marker). Reminder: the BUFFERED layout, used in values buffered in heap,
// is compatible with all the other layouts.

void write_value_to_addr(oop src, void* dst, LayoutKind lk, bool dest_is_initialized, TRAPS);
void write_value_to_addr(oop src, void* dst, LayoutKind lk, TRAPS);
oop read_payload_from_addr(const oop src, size_t offset, LayoutKind lk, TRAPS);
void copy_payload_to_addr(void* src, void* dst, LayoutKind lk, bool dest_is_initialized);

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/oops/layoutKind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
// null marker). The reset value instance is needed because the VM needs an instance guaranteed to
// always be filled with zeros, and the default value could have its null marker set to non-zero if
// it is used as a source to update a NULLABLE_ATOMIC_FLAT field.
// BUFFERED: this layout is only used in heap buffered instances of a value class. It is computed to be compatible
// to be compatible in size and alignment with all other flat layouts supported by the value class.
// BUFFERED: This layout is only used in heap buffered instances of a value class. It is computed to be compatible
// in size and alignment with all other flat layouts supported by the value class.
//
//
// IMPORTANT: The REFERENCE layout must always be associated with the numerical value zero, because the implementation
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/oops/resolvedFieldEntry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class ResolvedFieldEntry {
ResolvedFieldEntry(0) {}

// Bit shift to get flags
// Note: Only two flags exists at the moment but more could be added
enum {
is_volatile_shift = 0,
is_final_shift = 1, // unused
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_C(Klass* array_type, int len, oopDe
if (array_type->is_null_free_array_klass() && !h_init_val.is_null()) {
// Null-free arrays need to be initialized
for (int i = 0; i < len; i++) {
vk->write_value_to_addr(h_init_val(), ((flatArrayOop)result)->value_at_addr(i, fak->layout_helper()), fak->layout_kind(), true, CHECK);
vk->write_value_to_addr(h_init_val(), ((flatArrayOop)result)->value_at_addr(i, fak->layout_helper()), fak->layout_kind(), CHECK);
}
}
} else if (array_type->is_typeArray_klass()) {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/prims/jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1969,7 +1969,7 @@ JNI_ENTRY_NO_PRESERVE(void, jni_SetObjectField(JNIEnv *env, jobject obj, jfieldI
InlineLayoutInfo* li = holder->inline_layout_info_adr(fd.index());
InlineKlass* vklass = li->klass();
oop v = JNIHandles::resolve(value);
vklass->write_value_to_addr(v, ((char*)(oopDesc*)o) + offset, li->kind(), true, CHECK);
vklass->write_value_to_addr(v, ((char*)(oopDesc*)o) + offset, li->kind(), CHECK);
}
log_debug_if_final_instance_field(thread, "SetObjectField", InstanceKlass::cast(k), offset);
HOTSPOT_JNI_SETOBJECTFIELD_RETURN();
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/prims/unsafe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ UNSAFE_ENTRY(void, Unsafe_PutFlatValue(JNIEnv *env, jobject unsafe, jobject obj,
assert_and_log_unsafe_value_access(base, offset, vk);
LayoutKind lk = (LayoutKind)layoutKind;
oop v = JNIHandles::resolve(value);
vk->write_value_to_addr(v, ((char*)(oopDesc*)base) + offset, lk, true, CHECK);
vk->write_value_to_addr(v, ((char*)(oopDesc*)base) + offset, lk, CHECK);
} UNSAFE_END

UNSAFE_ENTRY(jobject, Unsafe_MakePrivateBuffer(JNIEnv *env, jobject unsafe, jobject value)) {
Expand Down