< prev index next >

src/hotspot/share/oops/cpCache.hpp

Print this page

        

*** 134,152 **** friend class ConstantPool; friend class InterpreterRuntime; private: volatile intx _indices; // constant pool index & rewrite bytecodes ! volatile Metadata* _f1; // entry specific metadata field volatile intx _f2; // entry specific int/metadata field volatile intx _flags; // flags void set_bytecode_1(Bytecodes::Code code); void set_bytecode_2(Bytecodes::Code code); void set_f1(Metadata* f1) { ! Metadata* existing_f1 = (Metadata*)_f1; // read once assert(existing_f1 == NULL || existing_f1 == f1, "illegal field change"); _f1 = f1; } void release_set_f1(Metadata* f1); void set_f2(intx f2) { --- 134,152 ---- friend class ConstantPool; friend class InterpreterRuntime; private: volatile intx _indices; // constant pool index & rewrite bytecodes ! Metadata* volatile _f1; // entry specific metadata field volatile intx _f2; // entry specific int/metadata field volatile intx _flags; // flags void set_bytecode_1(Bytecodes::Code code); void set_bytecode_2(Bytecodes::Code code); void set_f1(Metadata* f1) { ! Metadata* existing_f1 = _f1; // read once assert(existing_f1 == NULL || existing_f1 == f1, "illegal field change"); _f1 = f1; } void release_set_f1(Metadata* f1); void set_f2(intx f2) {
*** 330,344 **** return false; // default: not resolved } // Accessors int indices() const { return _indices; } ! int indices_ord() const { return (intx)OrderAccess::load_ptr_acquire(&_indices); } int constant_pool_index() const { return (indices() & cp_index_mask); } Bytecodes::Code bytecode_1() const { return Bytecodes::cast((indices_ord() >> bytecode_1_shift) & bytecode_1_mask); } Bytecodes::Code bytecode_2() const { return Bytecodes::cast((indices_ord() >> bytecode_2_shift) & bytecode_2_mask); } ! Metadata* f1_ord() const { return (Metadata *)OrderAccess::load_ptr_acquire(&_f1); } Method* f1_as_method() const { Metadata* f1 = f1_ord(); assert(f1 == NULL || f1->is_method(), ""); return (Method*)f1; } Klass* f1_as_klass() const { Metadata* f1 = f1_ord(); assert(f1 == NULL || f1->is_klass(), ""); return (Klass*)f1; } // Use the accessor f1() to acquire _f1's value. This is needed for // example in BytecodeInterpreter::run(), where is_f1_null() is // called to check if an invokedynamic call is resolved. This load --- 330,344 ---- return false; // default: not resolved } // Accessors int indices() const { return _indices; } ! int indices_ord() const { return OrderAccess::load_acquire(&_indices); } int constant_pool_index() const { return (indices() & cp_index_mask); } Bytecodes::Code bytecode_1() const { return Bytecodes::cast((indices_ord() >> bytecode_1_shift) & bytecode_1_mask); } Bytecodes::Code bytecode_2() const { return Bytecodes::cast((indices_ord() >> bytecode_2_shift) & bytecode_2_mask); } ! Metadata* f1_ord() const { return (Metadata *)OrderAccess::load_acquire(&_f1); } Method* f1_as_method() const { Metadata* f1 = f1_ord(); assert(f1 == NULL || f1->is_method(), ""); return (Method*)f1; } Klass* f1_as_klass() const { Metadata* f1 = f1_ord(); assert(f1 == NULL || f1->is_klass(), ""); return (Klass*)f1; } // Use the accessor f1() to acquire _f1's value. This is needed for // example in BytecodeInterpreter::run(), where is_f1_null() is // called to check if an invokedynamic call is resolved. This load
< prev index next >