206 public final int stackReservedPages = getFlag("StackReservedPages", Integer.class, 0); |
207 public final int stackReservedPages = getFlag("StackReservedPages", Integer.class, 0); |
207 public final boolean useStackBanging = getFlag("UseStackBanging", Boolean.class); |
208 public final boolean useStackBanging = getFlag("UseStackBanging", Boolean.class); |
208 public final int stackBias = getConstant("STACK_BIAS", Integer.class); |
209 public final int stackBias = getConstant("STACK_BIAS", Integer.class); |
209 public final int vmPageSize = getFieldValue("CompilerToVM::Data::vm_page_size", Integer.class, "int"); |
210 public final int vmPageSize = getFieldValue("CompilerToVM::Data::vm_page_size", Integer.class, "int"); |
210 |
211 |
211 public final int markOffset = getFieldOffset("oopDesc::_mark", Integer.class, "markOop"); |
212 public final int markOffset = getFieldOffset("oopDesc::_mark", Integer.class, markWord); |
212 public final int hubOffset = getFieldOffset("oopDesc::_metadata._klass", Integer.class, "Klass*"); |
213 public final int hubOffset = getFieldOffset("oopDesc::_metadata._klass", Integer.class, "Klass*"); |
213 |
214 |
214 public final int prototypeMarkWordOffset = getFieldOffset("Klass::_prototype_header", Integer.class, "markOop"); |
215 public final int prototypeMarkWordOffset = getFieldOffset("Klass::_prototype_header", Integer.class, markWord); |
215 public final int subklassOffset = getFieldOffset("Klass::_subklass", Integer.class, "Klass*"); |
216 public final int subklassOffset = getFieldOffset("Klass::_subklass", Integer.class, "Klass*"); |
216 public final int nextSiblingOffset = getFieldOffset("Klass::_next_sibling", Integer.class, "Klass*"); |
217 public final int nextSiblingOffset = getFieldOffset("Klass::_next_sibling", Integer.class, "Klass*"); |
217 public final int superCheckOffsetOffset = getFieldOffset("Klass::_super_check_offset", Integer.class, "juint"); |
218 public final int superCheckOffsetOffset = getFieldOffset("Klass::_super_check_offset", Integer.class, "juint"); |
218 public final int secondarySuperCacheOffset = getFieldOffset("Klass::_secondary_super_cache", Integer.class, "Klass*"); |
219 public final int secondarySuperCacheOffset = getFieldOffset("Klass::_secondary_super_cache", Integer.class, "Klass*"); |
219 public final int secondarySupersOffset = getFieldOffset("Klass::_secondary_supers", Integer.class, "Array<Klass*>*"); |
220 public final int secondarySupersOffset = getFieldOffset("Klass::_secondary_supers", Integer.class, "Array<Klass*>*"); |
220 |
221 |
221 public final boolean classMirrorIsHandle; |
222 public final boolean classMirrorIsHandle = versioned.classMirrorIsHandle; |
222 public final int classMirrorOffset; |
223 public final int classMirrorOffset = versioned.classMirrorOffset; |
223 { |
|
224 String name = "Klass::_java_mirror"; |
|
225 int offset = -1; |
|
226 boolean isHandle = false; |
|
227 try { |
|
228 offset = getFieldOffset(name, Integer.class, "oop"); |
|
229 } catch (JVMCIError e) { |
|
230 |
|
231 } |
|
232 if (offset == -1) { |
|
233 try { |
|
234 offset = getFieldOffset(name, Integer.class, "jobject"); |
|
235 isHandle = true; |
|
236 } catch (JVMCIError e) { |
|
237 try { |
|
238 // JDK-8186777 |
|
239 offset = getFieldOffset(name, Integer.class, "OopHandle"); |
|
240 isHandle = true; |
|
241 } catch (JVMCIError e2) { |
|
242 } |
|
243 } |
|
244 } |
|
245 if (offset == -1) { |
|
246 throw new JVMCIError("cannot get offset of field " + name + " with type oop, jobject or OopHandle"); |
|
247 } |
|
248 classMirrorOffset = offset; |
|
249 classMirrorIsHandle = isHandle; |
|
250 } |
|
251 |
224 |
252 public final int klassSuperKlassOffset = getFieldOffset("Klass::_super", Integer.class, "Klass*"); |
225 public final int klassSuperKlassOffset = getFieldOffset("Klass::_super", Integer.class, "Klass*"); |
253 public final int klassModifierFlagsOffset = getFieldOffset("Klass::_modifier_flags", Integer.class, "jint"); |
226 public final int klassModifierFlagsOffset = getFieldOffset("Klass::_modifier_flags", Integer.class, "jint"); |
254 public final int klassAccessFlagsOffset = getFieldOffset("Klass::_access_flags", Integer.class, "AccessFlags"); |
227 public final int klassAccessFlagsOffset = getFieldOffset("Klass::_access_flags", Integer.class, "AccessFlags"); |
255 public final int klassLayoutHelperOffset = getFieldOffset("Klass::_layout_helper", Integer.class, "jint"); |
228 public final int klassLayoutHelperOffset = getFieldOffset("Klass::_layout_helper", Integer.class, "jint"); |
274 |
247 |
275 public final int vtableEntrySize = getFieldValue("CompilerToVM::Data::sizeof_vtableEntry", Integer.class, "int"); |
248 public final int vtableEntrySize = getFieldValue("CompilerToVM::Data::sizeof_vtableEntry", Integer.class, "int"); |
276 public final int vtableEntryMethodOffset = getFieldOffset("vtableEntry::_method", Integer.class, "Method*"); |
249 public final int vtableEntryMethodOffset = getFieldOffset("vtableEntry::_method", Integer.class, "Method*"); |
277 |
250 |
278 public final int instanceKlassInitStateOffset = getFieldOffset("InstanceKlass::_init_state", Integer.class, "u1"); |
251 public final int instanceKlassInitStateOffset = getFieldOffset("InstanceKlass::_init_state", Integer.class, "u1"); |
|
252 public final int instanceKlassInitThreadOffset = getFieldOffset("InstanceKlass::_init_thread", Integer.class, "Thread*", -1); |
279 public final int instanceKlassConstantsOffset = getFieldOffset("InstanceKlass::_constants", Integer.class, "ConstantPool*"); |
253 public final int instanceKlassConstantsOffset = getFieldOffset("InstanceKlass::_constants", Integer.class, "ConstantPool*"); |
280 public final int instanceKlassFieldsOffset = getFieldOffset("InstanceKlass::_fields", Integer.class, "Array<u2>*"); |
254 public final int instanceKlassFieldsOffset = getFieldOffset("InstanceKlass::_fields", Integer.class, "Array<u2>*"); |
281 public final int klassVtableStartOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_start_offset", Integer.class, "int"); |
255 public final int klassVtableStartOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_start_offset", Integer.class, "int"); |
282 public final int klassVtableLengthOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_length_offset", Integer.class, "int"); |
256 public final int klassVtableLengthOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_length_offset", Integer.class, "int"); |
283 |
257 |
284 public final int instanceKlassStateLinked = getConstant("InstanceKlass::linked", Integer.class); |
258 public final int instanceKlassStateLinked = getConstant("InstanceKlass::linked", Integer.class); |
|
259 public final int instanceKlassStateBeingInitialized = getConstant("InstanceKlass::being_initialized", Integer.class, -1); |
285 public final int instanceKlassStateFullyInitialized = getConstant("InstanceKlass::fully_initialized", Integer.class); |
260 public final int instanceKlassStateFullyInitialized = getConstant("InstanceKlass::fully_initialized", Integer.class); |
286 |
261 |
287 public final int arrayOopDescSize = getFieldValue("CompilerToVM::Data::sizeof_arrayOopDesc", Integer.class, "int"); |
262 public final int arrayOopDescSize = getFieldValue("CompilerToVM::Data::sizeof_arrayOopDesc", Integer.class, "int"); |
288 |
263 |
289 /** |
264 /** |
342 public final int threadObjectOffset = getFieldOffset("JavaThread::_threadObj", Integer.class, "oop"); |
317 public final int threadObjectOffset = getFieldOffset("JavaThread::_threadObj", Integer.class, "oop"); |
343 public final int osThreadOffset = getFieldOffset("JavaThread::_osthread", Integer.class, "OSThread*"); |
318 public final int osThreadOffset = getFieldOffset("JavaThread::_osthread", Integer.class, "OSThread*"); |
344 public final int threadIsMethodHandleReturnOffset = getFieldOffset("JavaThread::_is_method_handle_return", Integer.class, "int"); |
319 public final int threadIsMethodHandleReturnOffset = getFieldOffset("JavaThread::_is_method_handle_return", Integer.class, "int"); |
345 public final int threadObjectResultOffset = getFieldOffset("JavaThread::_vm_result", Integer.class, "oop"); |
320 public final int threadObjectResultOffset = getFieldOffset("JavaThread::_vm_result", Integer.class, "oop"); |
346 public final int jvmciCountersThreadOffset = getFieldOffset("JavaThread::_jvmci_counters", Integer.class, "jlong*"); |
321 public final int jvmciCountersThreadOffset = getFieldOffset("JavaThread::_jvmci_counters", Integer.class, "jlong*"); |
|
322 public final int doingUnsafeAccessOffset = getFieldOffset("JavaThread::_doing_unsafe_access", Integer.class, "bool", Integer.MAX_VALUE); |
347 public final int javaThreadReservedStackActivationOffset = versioned.javaThreadReservedStackActivationOffset; |
323 public final int javaThreadReservedStackActivationOffset = versioned.javaThreadReservedStackActivationOffset; |
|
324 public final int jniEnvironmentOffset = getFieldOffset("JavaThread::_jni_environment", Integer.class, "JNIEnv", Integer.MIN_VALUE); |
348 |
325 |
349 public boolean requiresReservedStackCheck(List<ResolvedJavaMethod> methods) { |
326 public boolean requiresReservedStackCheck(List<ResolvedJavaMethod> methods) { |
350 if (enableStackReservedZoneAddress != 0 && methods != null) { |
327 if (enableStackReservedZoneAddress != 0 && methods != null) { |
351 for (ResolvedJavaMethod method : methods) { |
328 for (ResolvedJavaMethod method : methods) { |
352 if (((HotSpotResolvedJavaMethod) method).hasReservedStackAccess()) { |
329 if (((HotSpotResolvedJavaMethod) method).hasReservedStackAccess()) { |
442 public final int frameInterpreterFrameSenderSpOffset = getConstant("frame::interpreter_frame_sender_sp_offset", Integer.class, intRequiredOnAMD64); |
419 public final int frameInterpreterFrameSenderSpOffset = getConstant("frame::interpreter_frame_sender_sp_offset", Integer.class, intRequiredOnAMD64); |
443 public final int frameInterpreterFrameLastSpOffset = getConstant("frame::interpreter_frame_last_sp_offset", Integer.class, intRequiredOnAMD64); |
420 public final int frameInterpreterFrameLastSpOffset = getConstant("frame::interpreter_frame_last_sp_offset", Integer.class, intRequiredOnAMD64); |
444 |
421 |
445 public final int osThreadInterruptedOffset = getFieldOffset("OSThread::_interrupted", Integer.class, "jint"); |
422 public final int osThreadInterruptedOffset = getFieldOffset("OSThread::_interrupted", Integer.class, "jint"); |
446 |
423 |
447 public final long markOopDescHashShift = getConstant("markOopDesc::hash_shift", Long.class); |
424 public final long markWordHashShift = getConstant(markWordField("hash_shift"), Long.class); |
448 |
425 |
449 public final int biasedLockMaskInPlace = getConstant("markOopDesc::biased_lock_mask_in_place", Integer.class); |
426 public final int biasedLockMaskInPlace = getConstant(markWordField("biased_lock_mask_in_place"), Integer.class); |
450 public final int ageMaskInPlace = getConstant("markOopDesc::age_mask_in_place", Integer.class); |
427 public final int ageMaskInPlace = getConstant(markWordField("age_mask_in_place"), Integer.class); |
451 public final int epochMaskInPlace = getConstant("markOopDesc::epoch_mask_in_place", Integer.class); |
428 public final int epochMaskInPlace = getConstant(markWordField("epoch_mask_in_place"), Integer.class); |
452 public final long markOopDescHashMask = getConstant("markOopDesc::hash_mask", Long.class); |
429 public final long markWordHashMask = getConstant(markWordField("hash_mask"), Long.class); |
453 public final long markOopDescHashMaskInPlace = getConstant("markOopDesc::hash_mask_in_place", Long.class); |
430 public final long markWordHashMaskInPlace = getConstant(markWordField("hash_mask_in_place"), Long.class); |
454 |
431 |
455 public final int unlockedMask = getConstant("markOopDesc::unlocked_value", Integer.class); |
432 public final int unlockedMask = getConstant(markWordField("unlocked_value"), Integer.class); |
456 public final int monitorMask = getConstant("markOopDesc::monitor_value", Integer.class, -1); |
433 public final int monitorMask = getConstant(markWordField("monitor_value"), Integer.class, -1); |
457 public final int biasedLockPattern = getConstant("markOopDesc::biased_lock_pattern", Integer.class); |
434 public final int biasedLockPattern = getConstant(markWordField("biased_lock_pattern"), Integer.class); |
458 |
435 |
459 // This field has no type in vmStructs.cpp |
436 // This field has no type in vmStructs.cpp |
460 public final int objectMonitorOwner = getFieldOffset("ObjectMonitor::_owner", Integer.class, null, -1); |
437 public final int objectMonitorOwner = getFieldOffset("ObjectMonitor::_owner", Integer.class, null, -1); |
461 public final int objectMonitorRecursions = getFieldOffset("ObjectMonitor::_recursions", Integer.class, "intptr_t", -1); |
438 public final int objectMonitorRecursions = getFieldOffset("ObjectMonitor::_recursions", Integer.class, "intptr_t", -1); |
462 public final int objectMonitorCxq = getFieldOffset("ObjectMonitor::_cxq", Integer.class, "ObjectWaiter*", -1); |
439 public final int objectMonitorCxq = getFieldOffset("ObjectMonitor::_cxq", Integer.class, "ObjectWaiter*", -1); |
463 public final int objectMonitorEntryList = getFieldOffset("ObjectMonitor::_EntryList", Integer.class, "ObjectWaiter*", -1); |
440 public final int objectMonitorEntryList = getFieldOffset("ObjectMonitor::_EntryList", Integer.class, "ObjectWaiter*", -1); |
464 public final int objectMonitorSucc = getFieldOffset("ObjectMonitor::_succ", Integer.class, "Thread*", -1); |
441 public final int objectMonitorSucc = getFieldOffset("ObjectMonitor::_succ", Integer.class, "Thread*", -1); |
465 |
442 |
466 public final int markWordNoHashInPlace = getConstant("markOopDesc::no_hash_in_place", Integer.class); |
443 public final int markWordNoHashInPlace = getConstant(markWordField("no_hash_in_place"), Integer.class); |
467 public final int markWordNoLockInPlace = getConstant("markOopDesc::no_lock_in_place", Integer.class); |
444 public final int markWordNoLockInPlace = getConstant(markWordField("no_lock_in_place"), Integer.class); |
468 |
445 |
469 /** |
446 /** |
470 * See {@code markOopDesc::prototype()}. |
447 * See {@code markOopDesc::prototype()}/{@code markWord::prototype()}. |
471 */ |
448 */ |
472 public long arrayPrototypeMarkWord() { |
449 public long arrayPrototypeMarkWord() { |
473 return markWordNoHashInPlace | markWordNoLockInPlace; |
450 return markWordNoHashInPlace | markWordNoLockInPlace; |
474 } |
451 } |
475 |
452 |
476 /** |
453 /** |
477 * See {@code markOopDesc::copy_set_hash()}. |
454 * See {@code markOopDesc::copy_set_hash()}/{@code markWord::copy_set_hash()}. |
478 */ |
455 */ |
479 public long tlabIntArrayMarkWord() { |
456 public long tlabIntArrayMarkWord() { |
480 long tmp = arrayPrototypeMarkWord() & (~markOopDescHashMaskInPlace); |
457 long tmp = arrayPrototypeMarkWord() & (~markWordHashMaskInPlace); |
481 tmp |= ((0x2 & markOopDescHashMask) << markOopDescHashShift); |
458 tmp |= ((0x2 & markWordHashMask) << markWordHashShift); |
482 return tmp; |
459 return tmp; |
483 } |
460 } |
484 |
461 |
|
462 private String markWordField(String simpleName) { |
|
463 return versioned.markWordClassName + "::" + simpleName; |
|
464 } |
|
465 |
485 /** |
466 /** |
486 * Mark word right shift to get identity hash code. |
467 * Mark word right shift to get identity hash code. |
487 */ |
468 */ |
488 public final int identityHashCodeShift = getConstant("markOopDesc::hash_shift", Integer.class); |
469 public final int identityHashCodeShift = getConstant(markWordField("hash_shift"), Integer.class); |
489 |
470 |
490 /** |
471 /** |
491 * Identity hash code value when uninitialized. |
472 * Identity hash code value when uninitialized. |
492 */ |
473 */ |
493 public final int uninitializedIdentityHashCodeValue = getConstant("markOopDesc::no_hash", Integer.class); |
474 public final int uninitializedIdentityHashCodeValue = getConstant(markWordField("no_hash"), Integer.class); |
494 |
475 |
495 public final int methodAccessFlagsOffset = getFieldOffset("Method::_access_flags", Integer.class, "AccessFlags"); |
476 public final int methodAccessFlagsOffset = getFieldOffset("Method::_access_flags", Integer.class, "AccessFlags"); |
496 public final int methodConstMethodOffset = getFieldOffset("Method::_constMethod", Integer.class, "ConstMethod*"); |
477 public final int methodConstMethodOffset = getFieldOffset("Method::_constMethod", Integer.class, "ConstMethod*"); |
497 public final int methodIntrinsicIdOffset = versioned.methodIntrinsicIdOffset; |
478 public final int methodIntrinsicIdOffset = versioned.methodIntrinsicIdOffset; |
498 public final int methodFlagsOffset = versioned.methodFlagsOffset; |
479 public final int methodFlagsOffset = versioned.methodFlagsOffset; |
562 |
543 |
563 public final int klassOffset = getFieldValue("java_lang_Class::_klass_offset", Integer.class, "int"); |
544 public final int klassOffset = getFieldValue("java_lang_Class::_klass_offset", Integer.class, "int"); |
564 public final int arrayKlassOffset = getFieldValue("java_lang_Class::_array_klass_offset", Integer.class, "int"); |
545 public final int arrayKlassOffset = getFieldValue("java_lang_Class::_array_klass_offset", Integer.class, "int"); |
565 |
546 |
566 public final int basicLockSize = getFieldValue("CompilerToVM::Data::sizeof_BasicLock", Integer.class, "int"); |
547 public final int basicLockSize = getFieldValue("CompilerToVM::Data::sizeof_BasicLock", Integer.class, "int"); |
567 public final int basicLockDisplacedHeaderOffset = getFieldOffset("BasicLock::_displaced_header", Integer.class, "markOop"); |
548 public final int basicLockDisplacedHeaderOffset = getFieldOffset("BasicLock::_displaced_header", Integer.class, markWord); |
568 |
549 |
569 public final int threadPollingPageOffset = getFieldOffset("Thread::_polling_page", Integer.class, "address", -1); |
550 public final int threadPollingPageOffset = getFieldOffset("Thread::_polling_page", Integer.class, "address", -1); |
570 public final int threadAllocatedBytesOffset = getFieldOffset("Thread::_allocated_bytes", Integer.class, "jlong"); |
551 public final int threadAllocatedBytesOffset = getFieldOffset("Thread::_allocated_bytes", Integer.class, "jlong"); |
571 |
552 |
572 public final int tlabRefillWasteIncrement = getFlag("TLABWasteIncrement", Integer.class); |
553 public final int tlabRefillWasteIncrement = getFlag("TLABWasteIncrement", Integer.class); |
618 } |
599 } |
619 |
600 |
620 public final int tlabAlignmentReserve = getFieldValue("CompilerToVM::Data::ThreadLocalAllocBuffer_alignment_reserve", Integer.class, "size_t"); |
601 public final int tlabAlignmentReserve = getFieldValue("CompilerToVM::Data::ThreadLocalAllocBuffer_alignment_reserve", Integer.class, "size_t"); |
621 |
602 |
622 public final boolean tlabStats = getFlag("TLABStats", Boolean.class); |
603 public final boolean tlabStats = getFlag("TLABStats", Boolean.class); |
|
604 |
|
605 // We set 0x10 as default value to disable DC ZVA if this field is not present in HotSpot. |
|
606 // ARMv8-A architecture reference manual D12.2.35 Data Cache Zero ID register says: |
|
607 // * BS, bits [3:0] indicate log2 of the DC ZVA block size in (4-byte) words. |
|
608 // * DZP, bit [4] of indicates whether use of DC ZVA instruction is prohibited. |
|
609 public final int psrInfoDczidValue = getFieldValue("VM_Version::_psr_info.dczid_el0", Integer.class, "uint32_t", 0x10); |
623 |
610 |
624 // FIXME This is only temporary until the GC code is changed. |
611 // FIXME This is only temporary until the GC code is changed. |
625 public final boolean inlineContiguousAllocationSupported = getFieldValue("CompilerToVM::Data::_supports_inline_contig_alloc", Boolean.class); |
612 public final boolean inlineContiguousAllocationSupported = getFieldValue("CompilerToVM::Data::_supports_inline_contig_alloc", Boolean.class); |
626 public final long heapEndAddress = getFieldValue("CompilerToVM::Data::_heap_end_addr", Long.class, "HeapWord**"); |
613 public final long heapEndAddress = getFieldValue("CompilerToVM::Data::_heap_end_addr", Long.class, "HeapWord**"); |
627 public final long heapTopAddress = versioned.heapTopAddress; |
614 public final long heapTopAddress = versioned.heapTopAddress; |