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, "markWord"); |
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, "markWord"); |
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 /** |
443 public final int frameInterpreterFrameSenderSpOffset = getConstant("frame::interpreter_frame_sender_sp_offset", Integer.class, intRequiredOnAMD64); |
418 public final int frameInterpreterFrameSenderSpOffset = getConstant("frame::interpreter_frame_sender_sp_offset", Integer.class, intRequiredOnAMD64); |
444 public final int frameInterpreterFrameLastSpOffset = getConstant("frame::interpreter_frame_last_sp_offset", Integer.class, intRequiredOnAMD64); |
419 public final int frameInterpreterFrameLastSpOffset = getConstant("frame::interpreter_frame_last_sp_offset", Integer.class, intRequiredOnAMD64); |
445 |
420 |
446 public final int osThreadInterruptedOffset = getFieldOffset("OSThread::_interrupted", Integer.class, "jint"); |
421 public final int osThreadInterruptedOffset = getFieldOffset("OSThread::_interrupted", Integer.class, "jint"); |
447 |
422 |
448 public final long markWordHashShift = getConstant("markWord::hash_shift", Long.class); |
423 public final long markWordHashShift = getConstant(markWordField("hash_shift"), Long.class); |
449 |
424 |
450 public final int biasedLockMaskInPlace = getConstant("markWord::biased_lock_mask_in_place", Integer.class); |
425 public final int biasedLockMaskInPlace = getConstant(markWordField("biased_lock_mask_in_place"), Integer.class); |
451 public final int ageMaskInPlace = getConstant("markWord::age_mask_in_place", Integer.class); |
426 public final int ageMaskInPlace = getConstant(markWordField("age_mask_in_place"), Integer.class); |
452 public final int epochMaskInPlace = getConstant("markWord::epoch_mask_in_place", Integer.class); |
427 public final int epochMaskInPlace = getConstant(markWordField("epoch_mask_in_place"), Integer.class); |
453 public final long markWordHashMask = getConstant("markWord::hash_mask", Long.class); |
428 public final long markWordHashMask = getConstant(markWordField("hash_mask"), Long.class); |
454 public final long markWordHashMaskInPlace = getConstant("markWord::hash_mask_in_place", Long.class); |
429 public final long markWordHashMaskInPlace = getConstant(markWordField("hash_mask_in_place"), Long.class); |
455 |
430 |
456 public final int unlockedMask = getConstant("markWord::unlocked_value", Integer.class); |
431 public final int unlockedMask = getConstant(markWordField("unlocked_value"), Integer.class); |
457 public final int monitorMask = getConstant("markWord::monitor_value", Integer.class, -1); |
432 public final int monitorMask = getConstant(markWordField("monitor_value"), Integer.class, -1); |
458 public final int biasedLockPattern = getConstant("markWord::biased_lock_pattern", Integer.class); |
433 public final int biasedLockPattern = getConstant(markWordField("biased_lock_pattern"), Integer.class); |
459 |
434 |
460 // This field has no type in vmStructs.cpp |
435 // This field has no type in vmStructs.cpp |
461 public final int objectMonitorOwner = getFieldOffset("ObjectMonitor::_owner", Integer.class, null, -1); |
436 public final int objectMonitorOwner = getFieldOffset("ObjectMonitor::_owner", Integer.class, null, -1); |
462 public final int objectMonitorRecursions = getFieldOffset("ObjectMonitor::_recursions", Integer.class, "intptr_t", -1); |
437 public final int objectMonitorRecursions = getFieldOffset("ObjectMonitor::_recursions", Integer.class, "intptr_t", -1); |
463 public final int objectMonitorCxq = getFieldOffset("ObjectMonitor::_cxq", Integer.class, "ObjectWaiter*", -1); |
438 public final int objectMonitorCxq = getFieldOffset("ObjectMonitor::_cxq", Integer.class, "ObjectWaiter*", -1); |
464 public final int objectMonitorEntryList = getFieldOffset("ObjectMonitor::_EntryList", Integer.class, "ObjectWaiter*", -1); |
439 public final int objectMonitorEntryList = getFieldOffset("ObjectMonitor::_EntryList", Integer.class, "ObjectWaiter*", -1); |
465 public final int objectMonitorSucc = getFieldOffset("ObjectMonitor::_succ", Integer.class, "Thread*", -1); |
440 public final int objectMonitorSucc = getFieldOffset("ObjectMonitor::_succ", Integer.class, "Thread*", -1); |
466 |
441 |
467 public final int markWordNoHashInPlace = getConstant("markWord::no_hash_in_place", Integer.class); |
442 public final int markWordNoHashInPlace = getConstant(markWordField("no_hash_in_place"), Integer.class); |
468 public final int markWordNoLockInPlace = getConstant("markWord::no_lock_in_place", Integer.class); |
443 public final int markWordNoLockInPlace = getConstant(markWordField("no_lock_in_place"), Integer.class); |
469 |
444 |
470 /** |
445 /** |
471 * See {@code markWord::prototype()}. |
446 * See {@code markOopDesc::prototype()}/{@code markWord::prototype()}. |
472 */ |
447 */ |
473 public long arrayPrototypeMarkWord() { |
448 public long arrayPrototypeMarkWord() { |
474 return markWordNoHashInPlace | markWordNoLockInPlace; |
449 return markWordNoHashInPlace | markWordNoLockInPlace; |
475 } |
450 } |
476 |
451 |
477 /** |
452 /** |
478 * See {@code markWord::copy_set_hash()}. |
453 * See {@code markOopDesc::copy_set_hash()}/{@code markWord::copy_set_hash()}. |
479 */ |
454 */ |
480 public long tlabIntArrayMarkWord() { |
455 public long tlabIntArrayMarkWord() { |
481 long tmp = arrayPrototypeMarkWord() & (~markWordHashMaskInPlace); |
456 long tmp = arrayPrototypeMarkWord() & (~markWordHashMaskInPlace); |
482 tmp |= ((0x2 & markWordHashMask) << markWordHashShift); |
457 tmp |= ((0x2 & markWordHashMask) << markWordHashShift); |
483 return tmp; |
458 return tmp; |
484 } |
459 } |
485 |
460 |
|
461 private String markWordField(String simpleName) { |
|
462 return versioned.markWordClassName + "::" + simpleName; |
|
463 } |
|
464 |
486 /** |
465 /** |
487 * Mark word right shift to get identity hash code. |
466 * Mark word right shift to get identity hash code. |
488 */ |
467 */ |
489 public final int identityHashCodeShift = getConstant("markWord::hash_shift", Integer.class); |
468 public final int identityHashCodeShift = getConstant(markWordField("hash_shift"), Integer.class); |
490 |
469 |
491 /** |
470 /** |
492 * Identity hash code value when uninitialized. |
471 * Identity hash code value when uninitialized. |
493 */ |
472 */ |
494 public final int uninitializedIdentityHashCodeValue = getConstant("markWord::no_hash", Integer.class); |
473 public final int uninitializedIdentityHashCodeValue = getConstant(markWordField("no_hash"), Integer.class); |
495 |
474 |
496 public final int methodAccessFlagsOffset = getFieldOffset("Method::_access_flags", Integer.class, "AccessFlags"); |
475 public final int methodAccessFlagsOffset = getFieldOffset("Method::_access_flags", Integer.class, "AccessFlags"); |
497 public final int methodConstMethodOffset = getFieldOffset("Method::_constMethod", Integer.class, "ConstMethod*"); |
476 public final int methodConstMethodOffset = getFieldOffset("Method::_constMethod", Integer.class, "ConstMethod*"); |
498 public final int methodIntrinsicIdOffset = versioned.methodIntrinsicIdOffset; |
477 public final int methodIntrinsicIdOffset = versioned.methodIntrinsicIdOffset; |
499 public final int methodFlagsOffset = versioned.methodFlagsOffset; |
478 public final int methodFlagsOffset = versioned.methodFlagsOffset; |
563 |
542 |
564 public final int klassOffset = getFieldValue("java_lang_Class::_klass_offset", Integer.class, "int"); |
543 public final int klassOffset = getFieldValue("java_lang_Class::_klass_offset", Integer.class, "int"); |
565 public final int arrayKlassOffset = getFieldValue("java_lang_Class::_array_klass_offset", Integer.class, "int"); |
544 public final int arrayKlassOffset = getFieldValue("java_lang_Class::_array_klass_offset", Integer.class, "int"); |
566 |
545 |
567 public final int basicLockSize = getFieldValue("CompilerToVM::Data::sizeof_BasicLock", Integer.class, "int"); |
546 public final int basicLockSize = getFieldValue("CompilerToVM::Data::sizeof_BasicLock", Integer.class, "int"); |
568 public final int basicLockDisplacedHeaderOffset = getFieldOffset("BasicLock::_displaced_header", Integer.class, "markWord"); |
547 public final int basicLockDisplacedHeaderOffset = getFieldOffset("BasicLock::_displaced_header", Integer.class, markWord); |
569 |
548 |
570 public final int threadPollingPageOffset = getFieldOffset("Thread::_polling_page", Integer.class, "address", -1); |
549 public final int threadPollingPageOffset = getFieldOffset("Thread::_polling_page", Integer.class, "address", -1); |
571 public final int threadAllocatedBytesOffset = getFieldOffset("Thread::_allocated_bytes", Integer.class, "jlong"); |
550 public final int threadAllocatedBytesOffset = getFieldOffset("Thread::_allocated_bytes", Integer.class, "jlong"); |
572 |
551 |
573 public final int tlabRefillWasteIncrement = getFlag("TLABWasteIncrement", Integer.class); |
552 public final int tlabRefillWasteIncrement = getFlag("TLABWasteIncrement", Integer.class); |
619 } |
598 } |
620 |
599 |
621 public final int tlabAlignmentReserve = getFieldValue("CompilerToVM::Data::ThreadLocalAllocBuffer_alignment_reserve", Integer.class, "size_t"); |
600 public final int tlabAlignmentReserve = getFieldValue("CompilerToVM::Data::ThreadLocalAllocBuffer_alignment_reserve", Integer.class, "size_t"); |
622 |
601 |
623 public final boolean tlabStats = getFlag("TLABStats", Boolean.class); |
602 public final boolean tlabStats = getFlag("TLABStats", Boolean.class); |
|
603 |
|
604 // We set 0x10 as default value to disable DC ZVA if this field is not present in HotSpot. |
|
605 // ARMv8-A architecture reference manual D12.2.35 Data Cache Zero ID register says: |
|
606 // * BS, bits [3:0] indicate log2 of the DC ZVA block size in (4-byte) words. |
|
607 // * DZP, bit [4] of indicates whether use of DC ZVA instruction is prohibited. |
|
608 public final int psrInfoDczidValue = getFieldValue("VM_Version::_psr_info.dczid_el0", Integer.class, "uint32_t", 0x10); |
624 |
609 |
625 // FIXME This is only temporary until the GC code is changed. |
610 // FIXME This is only temporary until the GC code is changed. |
626 public final boolean inlineContiguousAllocationSupported = getFieldValue("CompilerToVM::Data::_supports_inline_contig_alloc", Boolean.class); |
611 public final boolean inlineContiguousAllocationSupported = getFieldValue("CompilerToVM::Data::_supports_inline_contig_alloc", Boolean.class); |
627 public final long heapEndAddress = getFieldValue("CompilerToVM::Data::_heap_end_addr", Long.class, "HeapWord**"); |
612 public final long heapEndAddress = getFieldValue("CompilerToVM::Data::_heap_end_addr", Long.class, "HeapWord**"); |
628 public final long heapTopAddress = versioned.heapTopAddress; |
613 public final long heapTopAddress = versioned.heapTopAddress; |