diff --git a/src/hotspot/share/interpreter/interpreterRuntime.cpp b/src/hotspot/share/interpreter/interpreterRuntime.cpp index c9598c1f17d..f14aeae3859 100644 --- a/src/hotspot/share/interpreter/interpreterRuntime.cpp +++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp @@ -802,8 +802,10 @@ void InterpreterRuntime::resolve_get_put(Bytecodes::Code bytecode, int field_ind } ResolvedFieldEntry* entry = pool->resolved_field_entry_at(field_index); - entry->set_flags(info.access_flags().is_final(), info.access_flags().is_volatile(), - info.is_flat(), info.is_null_free_inline_type(), + entry->set_flags(info.access_flags().is_volatile(), + info.access_flags().is_final(), + info.is_flat(), + info.is_null_free_inline_type(), info.has_null_marker()); entry->fill_in(info.field_holder(), info.offset(), diff --git a/src/hotspot/share/oops/resolvedFieldEntry.hpp b/src/hotspot/share/oops/resolvedFieldEntry.hpp index 76356ca9274..a187fe7f3ce 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 @@ -91,18 +90,18 @@ class ResolvedFieldEntry { }; // Getters - InstanceKlass* field_holder() const { return _field_holder; } - int field_offset() const { return _field_offset; } - u2 field_index() const { return _field_index; } - u2 constant_pool_index() const { return _cpool_index; } - u1 tos_state() const { return _tos_state; } - u1 get_code() const { return AtomicAccess::load_acquire(&_get_code); } - u1 put_code() const { return AtomicAccess::load_acquire(&_put_code); } - bool is_final() const { return (_flags & (1 << is_final_shift)) != 0; } - bool is_volatile () const { return (_flags & (1 << is_volatile_shift)) != 0; } - bool is_flat() const { return (_flags & (1 << is_flat_shift)) != 0; } + InstanceKlass* field_holder() const { return _field_holder; } + int field_offset() const { return _field_offset; } + u2 field_index() const { return _field_index; } + u2 constant_pool_index() const { return _cpool_index; } + u1 tos_state() const { return _tos_state; } + u1 get_code() const { return AtomicAccess::load_acquire(&_get_code); } + u1 put_code() const { return AtomicAccess::load_acquire(&_put_code); } + bool is_volatile () const { return (_flags & (1 << is_volatile_shift)) != 0; } + bool is_final() const { return (_flags & (1 << is_final_shift)) != 0; } + bool is_flat() const { return (_flags & (1 << is_flat_shift)) != 0; } bool is_null_free_inline_type() const { return (_flags & (1 << is_null_free_inline_type_shift)) != 0; } - bool has_null_marker() const { return (_flags & (1 << has_null_marker_shift)) != 0; } + bool has_null_marker() const { return (_flags & (1 << has_null_marker_shift)) != 0; } bool is_resolved(Bytecodes::Code code) const { switch(code) { case Bytecodes::_getstatic: @@ -120,15 +119,20 @@ class ResolvedFieldEntry { // Printing void print_on(outputStream* st) const; - void set_flags(bool is_final_flag, bool is_volatile_flag, bool is_flat_flag, bool is_null_free_inline_type_flag, + void set_flags(bool is_volatile_flag, + bool is_final_flag, + bool is_flat_flag, + bool is_null_free_inline_type_flag, bool has_null_marker_flag) { - u1 new_flags = ((is_final_flag ? 1 : 0) << is_final_shift) | static_cast(is_volatile_flag) | - ((is_flat_flag ? 1 : 0) << is_flat_shift) | - ((is_null_free_inline_type_flag ? 1 : 0) << is_null_free_inline_type_shift) | - ((has_null_marker_flag ? 1 : 0) << has_null_marker_shift); + int new_flags = + ((is_volatile_flag ? 1 : 0) << is_volatile_shift) | + ((is_final_flag ? 1 : 0) << is_final_shift) | + ((is_flat_flag ? 1 : 0) << is_flat_shift) | + ((is_null_free_inline_type_flag ? 1 : 0) << is_null_free_inline_type_shift) | + ((has_null_marker_flag ? 1 : 0) << has_null_marker_shift); _flags = checked_cast(new_flags); - assert(is_final() == is_final_flag, "Must be"); assert(is_volatile() == is_volatile_flag, "Must be"); + assert(is_final() == is_final_flag, "Must be"); assert(is_flat() == is_flat_flag, "Must be"); assert(is_null_free_inline_type() == is_null_free_inline_type_flag, "Must be"); assert(has_null_marker() == has_null_marker_flag, "Must be");