161 */
162 @Fold
163 public static int threadExceptionOopOffset(@InjectedParameter GraalHotSpotVMConfig config) {
164 return config.threadExceptionOopOffset;
165 }
166
167 public static final LocationIdentity EXCEPTION_PC_LOCATION = NamedLocationIdentity.mutable("ExceptionPc");
168
169 @Fold
170 public static int threadExceptionPcOffset(@InjectedParameter GraalHotSpotVMConfig config) {
171 return config.threadExceptionPcOffset;
172 }
173
174 public static final LocationIdentity TLAB_TOP_LOCATION = NamedLocationIdentity.mutable("TlabTop");
175
176 @Fold
177 public static int threadTlabTopOffset(@InjectedParameter GraalHotSpotVMConfig config) {
178 return config.threadTlabTopOffset();
179 }
180
181 public static final LocationIdentity TLAB_END_LOCATION = NamedLocationIdentity.mutable("TlabEnd");
182
183 @Fold
184 static int threadTlabEndOffset(@InjectedParameter GraalHotSpotVMConfig config) {
185 return config.threadTlabEndOffset();
186 }
187
188 public static final LocationIdentity TLAB_START_LOCATION = NamedLocationIdentity.mutable("TlabStart");
189
190 @Fold
191 static int threadTlabStartOffset(@InjectedParameter GraalHotSpotVMConfig config) {
192 return config.threadTlabStartOffset();
193 }
194
195 public static final LocationIdentity PENDING_EXCEPTION_LOCATION = NamedLocationIdentity.mutable("PendingException");
196
197 /**
198 * @see GraalHotSpotVMConfig#pendingExceptionOffset
199 */
200 @Fold
201 static int threadPendingExceptionOffset(@InjectedParameter GraalHotSpotVMConfig config) {
202 return config.pendingExceptionOffset;
203 }
204
205 public static final LocationIdentity PENDING_DEOPTIMIZATION_LOCATION = NamedLocationIdentity.mutable("PendingDeoptimization");
228
229 public static Word readExceptionPc(Word thread) {
230 return thread.readWord(threadExceptionPcOffset(INJECTED_VMCONFIG), EXCEPTION_PC_LOCATION);
231 }
232
233 /**
234 * @see GraalHotSpotVMConfig#threadExceptionOopOffset
235 */
236 public static void writeExceptionOop(Word thread, Object value) {
237 thread.writeObject(threadExceptionOopOffset(INJECTED_VMCONFIG), value, EXCEPTION_OOP_LOCATION);
238 }
239
240 public static void writeExceptionPc(Word thread, Word value) {
241 thread.writeWord(threadExceptionPcOffset(INJECTED_VMCONFIG), value, EXCEPTION_PC_LOCATION);
242 }
243
244 public static Word readTlabTop(Word thread) {
245 return thread.readWord(threadTlabTopOffset(INJECTED_VMCONFIG), TLAB_TOP_LOCATION);
246 }
247
248 public static Word readTlabEnd(Word thread) {
249 return thread.readWord(threadTlabEndOffset(INJECTED_VMCONFIG), TLAB_END_LOCATION);
250 }
251
252 public static Word readTlabStart(Word thread) {
253 return thread.readWord(threadTlabStartOffset(INJECTED_VMCONFIG), TLAB_START_LOCATION);
254 }
255
256 public static void writeTlabTop(Word thread, Word top) {
257 thread.writeWord(threadTlabTopOffset(INJECTED_VMCONFIG), top, TLAB_TOP_LOCATION);
258 }
259
260 @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_NONVIRTUAL", justification = "foldable method parameters are injected")
261 public static void initializeTlab(Word thread, Word start, Word end) {
262 thread.writeWord(threadTlabStartOffset(INJECTED_VMCONFIG), start, TLAB_START_LOCATION);
263 thread.writeWord(threadTlabTopOffset(INJECTED_VMCONFIG), start, TLAB_TOP_LOCATION);
264 thread.writeWord(threadTlabEndOffset(INJECTED_VMCONFIG), end, TLAB_END_LOCATION);
265 }
266
267 /**
268 * Clears the pending exception for the given thread.
269 *
270 * @return the pending exception, or null if there was none
271 */
272 @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_NONVIRTUAL", justification = "foldable method parameters are injected")
273 public static Object clearPendingException(Word thread) {
274 Object result = thread.readObject(threadPendingExceptionOffset(INJECTED_VMCONFIG), PENDING_EXCEPTION_LOCATION);
275 thread.writeObject(threadPendingExceptionOffset(INJECTED_VMCONFIG), null, PENDING_EXCEPTION_LOCATION);
276 return result;
277 }
278
279 /**
280 * Reads the pending deoptimization value for the given thread.
281 *
282 * @return {@code true} if there was a pending deoptimization
283 */
284 public static int readPendingDeoptimization(Word thread) {
|
161 */
162 @Fold
163 public static int threadExceptionOopOffset(@InjectedParameter GraalHotSpotVMConfig config) {
164 return config.threadExceptionOopOffset;
165 }
166
167 public static final LocationIdentity EXCEPTION_PC_LOCATION = NamedLocationIdentity.mutable("ExceptionPc");
168
169 @Fold
170 public static int threadExceptionPcOffset(@InjectedParameter GraalHotSpotVMConfig config) {
171 return config.threadExceptionPcOffset;
172 }
173
174 public static final LocationIdentity TLAB_TOP_LOCATION = NamedLocationIdentity.mutable("TlabTop");
175
176 @Fold
177 public static int threadTlabTopOffset(@InjectedParameter GraalHotSpotVMConfig config) {
178 return config.threadTlabTopOffset();
179 }
180
181 public static final LocationIdentity TLAB_FAST_PATH_END_LOCATION = NamedLocationIdentity.mutable("TlabFastPathEnd");
182
183 @Fold
184 static int threadTlabFastPathEndOffset(@InjectedParameter GraalHotSpotVMConfig config) {
185 return config.threadTlabFastPathEndOffset();
186 }
187
188 public static final LocationIdentity TLAB_START_LOCATION = NamedLocationIdentity.mutable("TlabStart");
189
190 @Fold
191 static int threadTlabStartOffset(@InjectedParameter GraalHotSpotVMConfig config) {
192 return config.threadTlabStartOffset();
193 }
194
195 public static final LocationIdentity PENDING_EXCEPTION_LOCATION = NamedLocationIdentity.mutable("PendingException");
196
197 /**
198 * @see GraalHotSpotVMConfig#pendingExceptionOffset
199 */
200 @Fold
201 static int threadPendingExceptionOffset(@InjectedParameter GraalHotSpotVMConfig config) {
202 return config.pendingExceptionOffset;
203 }
204
205 public static final LocationIdentity PENDING_DEOPTIMIZATION_LOCATION = NamedLocationIdentity.mutable("PendingDeoptimization");
228
229 public static Word readExceptionPc(Word thread) {
230 return thread.readWord(threadExceptionPcOffset(INJECTED_VMCONFIG), EXCEPTION_PC_LOCATION);
231 }
232
233 /**
234 * @see GraalHotSpotVMConfig#threadExceptionOopOffset
235 */
236 public static void writeExceptionOop(Word thread, Object value) {
237 thread.writeObject(threadExceptionOopOffset(INJECTED_VMCONFIG), value, EXCEPTION_OOP_LOCATION);
238 }
239
240 public static void writeExceptionPc(Word thread, Word value) {
241 thread.writeWord(threadExceptionPcOffset(INJECTED_VMCONFIG), value, EXCEPTION_PC_LOCATION);
242 }
243
244 public static Word readTlabTop(Word thread) {
245 return thread.readWord(threadTlabTopOffset(INJECTED_VMCONFIG), TLAB_TOP_LOCATION);
246 }
247
248 public static Word readTlabFastPathEnd(Word thread) {
249 return thread.readWord(threadTlabFastPathEndOffset(INJECTED_VMCONFIG), TLAB_FAST_PATH_END_LOCATION);
250 }
251
252 public static Word readTlabStart(Word thread) {
253 return thread.readWord(threadTlabStartOffset(INJECTED_VMCONFIG), TLAB_START_LOCATION);
254 }
255
256 public static void writeTlabTop(Word thread, Word top) {
257 thread.writeWord(threadTlabTopOffset(INJECTED_VMCONFIG), top, TLAB_TOP_LOCATION);
258 }
259
260 @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_NONVIRTUAL", justification = "foldable method parameters are injected")
261 public static void initializeTlab(Word thread, Word start, Word end) {
262 thread.writeWord(threadTlabStartOffset(INJECTED_VMCONFIG), start, TLAB_START_LOCATION);
263 thread.writeWord(threadTlabTopOffset(INJECTED_VMCONFIG), start, TLAB_TOP_LOCATION);
264 thread.writeWord(threadTlabFastPathEndOffset(INJECTED_VMCONFIG), end, TLAB_FAST_PATH_END_LOCATION);
265 }
266
267 /**
268 * Clears the pending exception for the given thread.
269 *
270 * @return the pending exception, or null if there was none
271 */
272 @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_NONVIRTUAL", justification = "foldable method parameters are injected")
273 public static Object clearPendingException(Word thread) {
274 Object result = thread.readObject(threadPendingExceptionOffset(INJECTED_VMCONFIG), PENDING_EXCEPTION_LOCATION);
275 thread.writeObject(threadPendingExceptionOffset(INJECTED_VMCONFIG), null, PENDING_EXCEPTION_LOCATION);
276 return result;
277 }
278
279 /**
280 * Reads the pending deoptimization value for the given thread.
281 *
282 * @return {@code true} if there was a pending deoptimization
283 */
284 public static int readPendingDeoptimization(Word thread) {
|