diff --git a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp index a561914f2be..3c05c35f579 100644 --- a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp @@ -2796,8 +2796,8 @@ 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) { @@ -2805,12 +2805,11 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr } __ 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); } @@ -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); @@ -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 @@ -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 @@ -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); @@ -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 @@ -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 @@ -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); diff --git a/src/hotspot/share/interpreter/interpreterRuntime.cpp b/src/hotspot/share/interpreter/interpreterRuntime.cpp index c9598c1f17d..fd53b753bb5 100644 --- a/src/hotspot/share/interpreter/interpreterRuntime.cpp +++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp @@ -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)) diff --git a/src/hotspot/share/interpreter/templateTable.cpp b/src/hotspot/share/interpreter/templateTable.cpp index 94b6d68dadc..25d4192d9b8 100644 --- a/src/hotspot/share/interpreter/templateTable.cpp +++ b/src/hotspot/share/interpreter/templateTable.cpp @@ -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"); } diff --git a/src/hotspot/share/oops/flatArrayOop.inline.hpp b/src/hotspot/share/oops/flatArrayOop.inline.hpp index 9ed3fb61b3f..5705e070627 100644 --- a/src/hotspot/share/oops/flatArrayOop.inline.hpp +++ b/src/hotspot/share/oops/flatArrayOop.inline.hpp @@ -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 diff --git a/src/hotspot/share/oops/inlineKlass.cpp b/src/hotspot/share/oops/inlineKlass.cpp index 61d894f1483..84c3af8f765 100644 --- a/src/hotspot/share/oops/inlineKlass.cpp +++ b/src/hotspot/share/oops/inlineKlass.cpp @@ -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; @@ -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 { @@ -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)) { @@ -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... diff --git a/src/hotspot/share/oops/inlineKlass.hpp b/src/hotspot/share/oops/inlineKlass.hpp index d107aa2f7d8..702cb7cad18 100644 --- a/src/hotspot/share/oops/inlineKlass.hpp +++ b/src/hotspot/share/oops/inlineKlass.hpp @@ -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); diff --git a/src/hotspot/share/oops/layoutKind.hpp b/src/hotspot/share/oops/layoutKind.hpp index fb108a94632..edae36d169a 100644 --- a/src/hotspot/share/oops/layoutKind.hpp +++ b/src/hotspot/share/oops/layoutKind.hpp @@ -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 diff --git a/src/hotspot/share/oops/resolvedFieldEntry.hpp b/src/hotspot/share/oops/resolvedFieldEntry.hpp index 76356ca9274..dd8d51d1fb9 100644 --- a/src/hotspot/share/oops/resolvedFieldEntry.hpp +++ b/src/hotspot/share/oops/resolvedFieldEntry.hpp @@ -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 diff --git a/src/hotspot/share/opto/runtime.cpp b/src/hotspot/share/opto/runtime.cpp index a4db707c3c0..0b7f30f5d6f 100644 --- a/src/hotspot/share/opto/runtime.cpp +++ b/src/hotspot/share/opto/runtime.cpp @@ -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()) { diff --git a/src/hotspot/share/prims/jni.cpp b/src/hotspot/share/prims/jni.cpp index 54b35519b52..837092e3e44 100644 --- a/src/hotspot/share/prims/jni.cpp +++ b/src/hotspot/share/prims/jni.cpp @@ -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(); diff --git a/src/hotspot/share/prims/unsafe.cpp b/src/hotspot/share/prims/unsafe.cpp index 4e54c3480b5..8252e8dfe26 100644 --- a/src/hotspot/share/prims/unsafe.cpp +++ b/src/hotspot/share/prims/unsafe.cpp @@ -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)) {