diff --git a/src/hotspot/share/code/nmethod.cpp b/src/hotspot/share/code/nmethod.cpp index 5ec7f71b826..f2304e35c24 100644 --- a/src/hotspot/share/code/nmethod.cpp +++ b/src/hotspot/share/code/nmethod.cpp @@ -1462,14 +1462,14 @@ oop nmethod::oop_at(int index) const { if (index == 0) { return NULL; } - return NativeAccess::oop_load(oop_addr_at(index)); + return NMethodAccess::oop_load(oop_addr_at(index)); } oop nmethod::oop_at_phantom(int index) const { if (index == 0) { return NULL; } - return NativeAccess::oop_load(oop_addr_at(index)); + return NMethodAccess::oop_load(oop_addr_at(index)); } // diff --git a/src/hotspot/share/oops/access.hpp b/src/hotspot/share/oops/access.hpp index 732a3406cc0..983f7d8d793 100644 --- a/src/hotspot/share/oops/access.hpp +++ b/src/hotspot/share/oops/access.hpp @@ -271,20 +271,25 @@ public: }; // Helper for performing raw accesses (knows only of memory ordering -// atomicity decorators as well as compressed oops) +// atomicity decorators as well as compressed oops). template class RawAccess: public Access {}; // Helper for performing normal accesses on the heap. These accesses -// may resolve an accessor on a GC barrier set +// may resolve an accessor on a GC barrier set. template class HeapAccess: public Access {}; // Helper for performing normal accesses in roots. These accesses -// may resolve an accessor on a GC barrier set +// may resolve an accessor on a GC barrier set. template class NativeAccess: public Access {}; +// Helper for performing accesses in nmethods. These accesses +// may resolve an accessor on a GC barrier set. +template +class NMethodAccess: public Access {}; + // Helper for array access. template class ArrayAccess: public HeapAccess { @@ -362,6 +367,7 @@ void Access::verify_decorators() { const DecoratorSet location_decorators = decorators & IN_DECORATOR_MASK; STATIC_ASSERT(location_decorators == 0 || ( // make sure location decorators are disjoint if set (location_decorators ^ IN_NATIVE) == 0 || + (location_decorators ^ IN_NMETHOD) == 0 || (location_decorators ^ IN_HEAP) == 0 )); } diff --git a/src/hotspot/share/oops/accessDecorators.hpp b/src/hotspot/share/oops/accessDecorators.hpp index 9b571e0e297..d6f0f59c5d9 100644 --- a/src/hotspot/share/oops/accessDecorators.hpp +++ b/src/hotspot/share/oops/accessDecorators.hpp @@ -172,9 +172,11 @@ const DecoratorSet ON_DECORATOR_MASK = ON_STRONG_OOP_REF | ON_WEAK_OOP_REF | // * IN_HEAP: The access is performed in the heap. Many barriers such as card marking will // be omitted if this decorator is not set. // * IN_NATIVE: The access is performed in an off-heap data structure. +// * IN_NMETHOD: The access is performed inside of an nmethod. const DecoratorSet IN_HEAP = UCONST64(1) << 18; const DecoratorSet IN_NATIVE = UCONST64(1) << 19; -const DecoratorSet IN_DECORATOR_MASK = IN_HEAP | IN_NATIVE; +const DecoratorSet IN_NMETHOD = UCONST64(1) << 20; +const DecoratorSet IN_DECORATOR_MASK = IN_HEAP | IN_NATIVE | IN_NMETHOD; // == Boolean Flag Decorators == // * IS_ARRAY: The access is performed on a heap allocated array. This is sometimes a special case @@ -182,9 +184,9 @@ const DecoratorSet IN_DECORATOR_MASK = IN_HEAP | IN_NATIVE; // * IS_DEST_UNINITIALIZED: This property can be important to e.g. SATB barriers by // marking that the previous value is uninitialized nonsense rather than a real value. // * IS_NOT_NULL: This property can make certain barriers faster such as compressing oops. -const DecoratorSet IS_ARRAY = UCONST64(1) << 20; -const DecoratorSet IS_DEST_UNINITIALIZED = UCONST64(1) << 21; -const DecoratorSet IS_NOT_NULL = UCONST64(1) << 22; +const DecoratorSet IS_ARRAY = UCONST64(1) << 21; +const DecoratorSet IS_DEST_UNINITIALIZED = UCONST64(1) << 22; +const DecoratorSet IS_NOT_NULL = UCONST64(1) << 23; // == Arraycopy Decorators == // * ARRAYCOPY_CHECKCAST: This property means that the class of the objects in source @@ -196,11 +198,11 @@ const DecoratorSet IS_NOT_NULL = UCONST64(1) << 22; // * ARRAYCOPY_ARRAYOF: The copy is in the arrayof form. // * ARRAYCOPY_ATOMIC: The accesses have to be atomic over the size of its elements. // * ARRAYCOPY_ALIGNED: The accesses have to be aligned on a HeapWord. -const DecoratorSet ARRAYCOPY_CHECKCAST = UCONST64(1) << 23; -const DecoratorSet ARRAYCOPY_DISJOINT = UCONST64(1) << 24; -const DecoratorSet ARRAYCOPY_ARRAYOF = UCONST64(1) << 25; -const DecoratorSet ARRAYCOPY_ATOMIC = UCONST64(1) << 26; -const DecoratorSet ARRAYCOPY_ALIGNED = UCONST64(1) << 27; +const DecoratorSet ARRAYCOPY_CHECKCAST = UCONST64(1) << 24; +const DecoratorSet ARRAYCOPY_DISJOINT = UCONST64(1) << 25; +const DecoratorSet ARRAYCOPY_ARRAYOF = UCONST64(1) << 26; +const DecoratorSet ARRAYCOPY_ATOMIC = UCONST64(1) << 27; +const DecoratorSet ARRAYCOPY_ALIGNED = UCONST64(1) << 28; const DecoratorSet ARRAYCOPY_DECORATOR_MASK = ARRAYCOPY_CHECKCAST | ARRAYCOPY_DISJOINT | ARRAYCOPY_DISJOINT | ARRAYCOPY_ARRAYOF | ARRAYCOPY_ATOMIC | ARRAYCOPY_ALIGNED; @@ -209,11 +211,11 @@ const DecoratorSet ARRAYCOPY_DECORATOR_MASK = ARRAYCOPY_CHECKCAST | ARRAYC // * ACCESS_READ: Indicate that the resolved object is accessed read-only. This allows the GC // backend to use weaker and more efficient barriers. // * ACCESS_WRITE: Indicate that the resolved object is used for write access. -const DecoratorSet ACCESS_READ = UCONST64(1) << 28; -const DecoratorSet ACCESS_WRITE = UCONST64(1) << 29; +const DecoratorSet ACCESS_READ = UCONST64(1) << 29; +const DecoratorSet ACCESS_WRITE = UCONST64(1) << 30; // Keep track of the last decorator. -const DecoratorSet DECORATOR_LAST = UCONST64(1) << 29; +const DecoratorSet DECORATOR_LAST = UCONST64(1) << 30; namespace AccessInternal { // This class adds implied decorators that follow according to decorator rules.