@@ -66,7 +66,6 @@ public class GraalHotSpotVMConfig extends GraalHotSpotVMConfigAccess {
66
66
GraalHotSpotVMConfig (HotSpotVMConfigStore store ) {
67
67
super (store );
68
68
69
- assert narrowKlassShift <= logKlassAlignment : Assertions .errorMessageContext ("narrowKlassShift" , narrowKlassShift , "logKlassAlignment" , logKlassAlignment );
70
69
int logMinObjAlignment = logMinObjAlignment ();
71
70
assert narrowOopShift <= logMinObjAlignment : Assertions .errorMessageContext ("narrowOopShift" , narrowOopShift , "logMinObjAlignment" , logMinObjAlignment );
72
71
oopEncoding = new CompressEncoding (narrowOopBase , narrowOopShift );
@@ -201,6 +200,11 @@ public long gcTotalCollectionsAddress() {
201
200
// Compressed Oops related values.
202
201
public final boolean useCompressedOops = getFlag ("UseCompressedOops" , Boolean .class );
203
202
public final boolean useCompressedClassPointers = getFlag ("UseCompressedClassPointers" , Boolean .class );
203
+ // JDK-8305895 allows storing the compressed class pointer in the upper 22 bits of the mark
204
+ // word. This runtime optimization is guarded by the flag UseCompactObjectHeaders. It depends
205
+ // on compressed class pointers, meaning that if useCompactObjectHeaders is true,
206
+ // useCompressedClassPointers is certainly true.
207
+ public final boolean useCompactObjectHeaders = getFlag ("UseCompactObjectHeaders" , Boolean .class , false , JDK >= 24 );
204
208
205
209
public final long narrowOopBase = getFieldValue ("CompilerToVM::Data::Universe_narrow_oop_base" , Long .class , "address" );
206
210
public final int narrowOopShift = getFieldValue ("CompilerToVM::Data::Universe_narrow_oop_shift" , Integer .class , "int" );
@@ -213,7 +217,6 @@ public final int logMinObjAlignment() {
213
217
public final int narrowKlassSize = getFieldValue ("CompilerToVM::Data::sizeof_narrowKlass" , Integer .class , "int" );
214
218
public final long narrowKlassBase = getFieldValue ("CompilerToVM::Data::Universe_narrow_klass_base" , Long .class , "address" );
215
219
public final int narrowKlassShift = getFieldValue ("CompilerToVM::Data::Universe_narrow_klass_shift" , Integer .class , "int" );
216
- public final int logKlassAlignment = getConstant ("LogKlassAlignmentInBytes" , Integer .class );
217
220
218
221
public final int stackShadowPages = getFlag ("StackShadowPages" , Integer .class );
219
222
public final int vmPageSize = getFieldValue ("CompilerToVM::Data::vm_page_size" , Integer .class , "size_t" );
@@ -255,12 +258,17 @@ public final int logMinObjAlignment() {
255
258
256
259
public final int arrayOopDescSize = getFieldValue ("CompilerToVM::Data::sizeof_arrayOopDesc" , Integer .class , "int" );
257
260
261
+ public final int arrayLengthOffsetInBytes = getFieldValue ("CompilerToVM::Data::arrayOopDesc_length_offset_in_bytes" , Integer .class , "int" , -1 , JDK >= 24 );
262
+
258
263
/**
259
264
* The offset of the array length word in an array object's header.
260
265
* <p>
261
266
* See {@code arrayOopDesc::length_offset_in_bytes()}.
262
267
*/
263
268
public final int arrayOopDescLengthOffset () {
269
+ if (JDK >= 24 ) {
270
+ return arrayLengthOffsetInBytes ;
271
+ }
264
272
return useCompressedClassPointers ? hubOffset + narrowKlassSize : arrayOopDescSize ;
265
273
}
266
274
@@ -294,6 +302,8 @@ public final int arrayOopDescLengthOffset() {
294
302
public final int threadCarrierThreadObjectOffset = getFieldOffset ("JavaThread::_threadObj" , Integer .class , "OopHandle" );
295
303
public final int threadScopedValueCacheOffset = getFieldOffset ("JavaThread::_scopedValueCache" , Integer .class , "OopHandle" );
296
304
305
+ public final int javaThreadLockIDOffset = getFieldOffset ("JavaThread::_lock_id" , Integer .class , "int64_t" , -1 , JDK > 21 );
306
+
297
307
public final int threadIsInVTMSTransitionOffset = getFieldOffset ("JavaThread::_is_in_VTMS_transition" , Integer .class , "bool" );
298
308
public final int threadIsInTmpVTMSTransitionOffset = getFieldOffset ("JavaThread::_is_in_tmp_VTMS_transition" , Integer .class , "bool" , -1 , JDK == 21 );
299
309
public final int threadIsDisableSuspendOffset = getFieldOffset ("JavaThread::_is_disable_suspend" , Integer .class , "bool" , -1 , JDK >= 22 );
@@ -365,37 +375,35 @@ public int threadLastJavaFpOffset() {
365
375
public final int frameInterpreterFrameSenderSpOffset = getConstant ("frame::interpreter_frame_sender_sp_offset" , Integer .class , 0 , osArch .equals ("amd64" ));
366
376
public final int frameInterpreterFrameLastSpOffset = getConstant ("frame::interpreter_frame_last_sp_offset" , Integer .class , 0 , osArch .equals ("amd64" ));
367
377
368
- public final int lockMaskInPlace = getConstant ("markWord::lock_mask_in_place" , Integer .class );
378
+ public final long markWordLockMaskInPlace = getConstant ("markWord::lock_mask_in_place" , Long .class );
379
+ public final long markWordHashMask = getConstant ("markWord::hash_mask" , Long .class );
380
+
381
+ public final long markWordNoHashInPlace = getConstant ("markWord::no_hash_in_place" , Long .class );
382
+ public final long markWordNoLockInPlace = getConstant ("markWord::no_lock_in_place" , Long .class );
383
+
384
+ // Mark word right shift to get identity hash code.
385
+ public final int markWordHashCodeShift = getConstant ("markWord::hash_shift" , Integer .class );
386
+ // Mark word right shift to get compressed klass pointer
387
+ public final int markWordKlassShift = getConstant ("markWord::klass_shift" , Integer .class , 0 , JDK >= 24 );
388
+
389
+ // The following three constants are declared as 64 bits uintptr_t, but known to be 32 bits
369
390
public final int unlockedValue = getConstant ("markWord::unlocked_value" , Integer .class );
370
391
public final int monitorValue = getConstant ("markWord::monitor_value" , Integer .class );
392
+ public final int ageMaskInPlace = getConstant ("markWord::age_mask_in_place" , Integer .class );
393
+ public final int unusedMark = getConstant ("markWord::marked_value" , Integer .class , 3 , JDK > 21 );
394
+ // Identity hash code value when uninitialized.
395
+ public final int uninitializedIdentityHashCodeValue = getConstant ("markWord::no_hash" , Integer .class );
371
396
372
397
// This field has no type in vmStructs.cpp
373
- public final int objectMonitorOwner = getFieldOffset ("ObjectMonitor::_owner" , Integer .class , null );
398
+ public final int objectMonitorOwner = getFieldOffset ("ObjectMonitor::_owner" , Integer .class , JDK > 21 ? "int64_t" : null );
374
399
public final int objectMonitorRecursions = getFieldOffset ("ObjectMonitor::_recursions" , Integer .class , "intptr_t" );
375
400
public final int objectMonitorCxq = getFieldOffset ("ObjectMonitor::_cxq" , Integer .class , "ObjectWaiter*" );
376
401
public final int objectMonitorEntryList = getFieldOffset ("ObjectMonitor::_EntryList" , Integer .class , "ObjectWaiter*" );
377
- public final int objectMonitorSucc = getFieldOffset ("ObjectMonitor::_succ" , Integer .class , "JavaThread*" );
378
-
379
- public final int markWordNoHashInPlace = getConstant ("markWord::no_hash_in_place" , Integer .class );
380
- public final int markWordNoLockInPlace = getConstant ("markWord::no_lock_in_place" , Integer .class );
381
-
382
- public long defaultPrototypeMarkWord () {
383
- return this .markWordNoHashInPlace | this .markWordNoLockInPlace ;
384
- }
385
-
386
- /**
387
- * Mark word right shift to get identity hash code.
388
- */
389
- public final int identityHashCodeShift = getConstant ("markWord::hash_shift" , Integer .class );
402
+ public final int objectMonitorSucc = getFieldOffset ("ObjectMonitor::_succ" , Integer .class , JDK > 21 ? "int64_t" : "JavaThread*" );
390
403
391
404
public final int contEntry = getFieldOffset ("JavaThread::_cont_entry" , Integer .class , "ContinuationEntry*" , -1 , JDK >= 24 );
392
405
public final int pinCount = getFieldOffset ("ContinuationEntry::_pin_count" , Integer .class , "uint32_t" , -1 , JDK >= 24 );
393
406
394
- /**
395
- * Identity hash code value when uninitialized.
396
- */
397
- public final int uninitializedIdentityHashCodeValue = getConstant ("markWord::no_hash" , Integer .class );
398
-
399
407
public final int methodCompiledEntryOffset = getFieldOffset ("Method::_from_compiled_entry" , Integer .class , "address" );
400
408
401
409
public final int compilationLevelFullOptimization = getConstant ("CompLevel_full_optimization" , Integer .class );
0 commit comments