104 size += (int) strlen(nmethod_mirror_name) + 1;
105 }
106 return size;
107 }
108
109 int size() {
110 return compute_size(name());
111 }
112
113 // Copy the contents of this object into data which is normally the storage allocated in the nmethod.
114 void copy(JVMCINMethodData* data);
115
116 // Adds `speculation` to the failed speculations list.
117 void add_failed_speculation(nmethod* nm, jlong speculation);
118
119 // Gets the JVMCI name of the nmethod (which may be null).
120 const char* name() { return _has_name ? (char*)(((address) this) + sizeof(JVMCINMethodData)) : nullptr; }
121
122 // Clears the HotSpotNmethod.address field in the mirror. If nm
123 // is dead, the HotSpotNmethod.entryPoint field is also cleared.
124 void invalidate_nmethod_mirror(nmethod* nm);
125
126 // Gets the mirror from nm's oops table.
127 oop get_nmethod_mirror(nmethod* nm);
128
129 // Sets the mirror in nm's oops table.
130 void set_nmethod_mirror(nmethod* nm, oop mirror);
131
132 int nmethod_entry_patch_offset() {
133 return _nmethod_entry_patch_offset;
134 }
135 };
136
137 // A top level class that represents an initialized JVMCI runtime.
138 // There is one instance of this class per HotSpotJVMCIRuntime object.
139 class JVMCIRuntime: public CHeapObj<mtJVMCI> {
140 friend class JVMCI;
141 friend class JavaVMRefsInitialization;
142 public:
143 // Constants describing whether JVMCI wants to be able to adjust the compilation
144 // level selected for a method by the VM compilation policy and if so, based on
|
104 size += (int) strlen(nmethod_mirror_name) + 1;
105 }
106 return size;
107 }
108
109 int size() {
110 return compute_size(name());
111 }
112
113 // Copy the contents of this object into data which is normally the storage allocated in the nmethod.
114 void copy(JVMCINMethodData* data);
115
116 // Adds `speculation` to the failed speculations list.
117 void add_failed_speculation(nmethod* nm, jlong speculation);
118
119 // Gets the JVMCI name of the nmethod (which may be null).
120 const char* name() { return _has_name ? (char*)(((address) this) + sizeof(JVMCINMethodData)) : nullptr; }
121
122 // Clears the HotSpotNmethod.address field in the mirror. If nm
123 // is dead, the HotSpotNmethod.entryPoint field is also cleared.
124 void invalidate_nmethod_mirror(nmethod* nm, nmethod::InvalidationReason invalidation_reason);
125
126 // Gets the mirror from nm's oops table.
127 oop get_nmethod_mirror(nmethod* nm);
128
129 // Sets the mirror in nm's oops table.
130 void set_nmethod_mirror(nmethod* nm, oop mirror);
131
132 int nmethod_entry_patch_offset() {
133 return _nmethod_entry_patch_offset;
134 }
135 };
136
137 // A top level class that represents an initialized JVMCI runtime.
138 // There is one instance of this class per HotSpotJVMCIRuntime object.
139 class JVMCIRuntime: public CHeapObj<mtJVMCI> {
140 friend class JVMCI;
141 friend class JavaVMRefsInitialization;
142 public:
143 // Constants describing whether JVMCI wants to be able to adjust the compilation
144 // level selected for a method by the VM compilation policy and if so, based on
|