comparison jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @ 23679:b5557b757040

fix HotSpotVMConfig startup performance (JDK-8159167)
author Doug Simon <doug.simon@oracle.com>
date Wed, 15 Jun 2016 00:00:41 +0200
parents eb166b568645
children 9861ec1f28c9
comparison
equal deleted inserted replaced
23678:e86a0b0ba969 23679:b5557b757040
21 * questions. 21 * questions.
22 */ 22 */
23 package jdk.vm.ci.hotspot; 23 package jdk.vm.ci.hotspot;
24 24
25 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; 25 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
26 import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
27 26
28 import java.lang.reflect.Field; 27 import java.lang.reflect.Field;
29 import java.lang.reflect.Modifier; 28 import java.lang.reflect.Modifier;
30 import java.util.HashMap;
31 import java.util.Iterator;
32
33 import jdk.vm.ci.common.JVMCIError;
34 import jdk.vm.ci.hotspotvmconfig.HotSpotVMConstant;
35 import jdk.vm.ci.hotspotvmconfig.HotSpotVMField;
36 import jdk.vm.ci.hotspotvmconfig.HotSpotVMFlag;
37 import jdk.vm.ci.hotspotvmconfig.HotSpotVMType;
38 import jdk.vm.ci.hotspotvmconfig.HotSpotVMValue;
39 import sun.misc.Unsafe;
40 29
41 /** 30 /**
42 * Used to access native configuration details. 31 * Used to access native configuration details.
43 * 32 *
44 * All non-static, public fields in this class are so that they can be compiled as constants. 33 * All non-static, public fields in this class are so that they can be compiled as constants.
45 */ 34 */
46 public class HotSpotVMConfig { 35 class HotSpotVMConfig extends HotSpotVMConfigAccess {
47
48 /**
49 * Determines if the current architecture is included in a given architecture set specification.
50 *
51 * @param currentArch
52 * @param archsSpecification specifies a set of architectures. A zero length value implies all
53 * architectures.
54 */
55 private static boolean isRequired(String currentArch, String[] archsSpecification) {
56 if (archsSpecification.length == 0) {
57 return true;
58 }
59 for (String arch : archsSpecification) {
60 if (arch.equals(currentArch)) {
61 return true;
62 }
63 }
64 return false;
65 }
66 36
67 /** 37 /**
68 * Gets the configuration associated with the singleton {@link HotSpotJVMCIRuntime}. 38 * Gets the configuration associated with the singleton {@link HotSpotJVMCIRuntime}.
69 */ 39 */
70 public static HotSpotVMConfig config() { 40 public static HotSpotVMConfig config() {
71 return runtime().getConfig(); 41 return runtime().getConfig();
72 } 42 }
73 43
44 private final String osArch = getHostArchitectureName();
45
46 @SuppressWarnings("try")
47 HotSpotVMConfig(HotSpotVMConfigStore store) {
48 super(store);
49
50 assert check();
51 assert HotSpotVMConfigVerifier.check();
52 }
53
74 @Override 54 @Override
75 public String toString() { 55 public String toString() {
76 return getClass().getSimpleName(); 56 return getClass().getSimpleName();
77 }
78
79 HotSpotVMConfig(CompilerToVM compilerToVm) {
80 compilerToVm.initializeConfiguration(this);
81 assert verifyInitialization();
82
83 oopEncoding = new CompressEncoding(narrowOopBase, narrowOopShift, logMinObjAlignment());
84 klassEncoding = new CompressEncoding(narrowKlassBase, narrowKlassShift, logKlassAlignment);
85
86 codeCacheLowBound = UNSAFE.getAddress(codeCacheHeap + codeHeapMemoryOffset + virtualSpaceLowBoundaryOffset);
87 codeCacheHighBound = UNSAFE.getAddress(codeCacheHeap + codeHeapMemoryOffset + virtualSpaceHighBoundaryOffset);
88
89 final long barrierSetAddress = UNSAFE.getAddress(universeCollectedHeap + collectedHeapBarrierSetOffset);
90 final int kind = UNSAFE.getInt(barrierSetAddress + barrierSetKindOffset);
91 if ((kind == barrierSetCardTableModRef) || (kind == barrierSetCardTableExtension) || (kind == barrierSetG1SATBCT) || (kind == barrierSetG1SATBCTLogging)) {
92 final long base = UNSAFE.getAddress(barrierSetAddress + cardTableModRefBSByteMapBaseOffset);
93 assert base != 0 : "unexpected byte_map_base: " + base;
94 cardtableStartAddress = base;
95 cardtableShift = cardTableModRefBSCardShift;
96 } else if ((kind == barrierSetModRef) || (kind == barrierSetOther)) {
97 // No post barriers
98 cardtableStartAddress = 0;
99 cardtableShift = 0;
100 } else {
101 cardtableStartAddress = -1;
102 cardtableShift = -1;
103 }
104
105 inlineCacheMissStub = inlineCacheMissBlob + UNSAFE.getInt(inlineCacheMissBlob + codeBlobCodeOffsetOffset);
106
107 assert check();
108 assert HotSpotVMConfigVerifier.check();
109 }
110
111 /**
112 * Reads a {@code '\0'} terminated C string from native memory and converts it to a
113 * {@link String}.
114 *
115 * @return a Java string
116 */
117 static String readCString(Unsafe unsafe, long address) {
118 if (address == 0) {
119 return null;
120 }
121 StringBuilder sb = new StringBuilder();
122 for (int i = 0;; i++) {
123 char c = (char) unsafe.getByte(address + i);
124 if (c == 0) {
125 break;
126 }
127 sb.append(c);
128 }
129 return sb.toString();
130 }
131
132 /**
133 * Check that the initialization produces the same result as the values captured through
134 * vmStructs.
135 */
136 private boolean verifyInitialization() {
137 /** These fields are set in {@link CompilerToVM#initializeConfiguration}. */
138 assert gHotSpotVMStructs != 0;
139 assert gHotSpotVMTypes != 0;
140 assert gHotSpotVMIntConstants != 0;
141 assert gHotSpotVMLongConstants != 0;
142
143 // Fill the VM fields hash map.
144 HashMap<String, VMFields.Field> vmFields = new HashMap<>();
145 for (VMFields.Field e : new VMFields(gHotSpotVMStructs)) {
146 vmFields.put(e.getName(), e);
147 }
148
149 // Fill the VM types hash map.
150 HashMap<String, VMTypes.Type> vmTypes = new HashMap<>();
151 for (VMTypes.Type e : new VMTypes(gHotSpotVMTypes)) {
152 vmTypes.put(e.getTypeName(), e);
153 }
154
155 // Fill the VM constants hash map.
156 HashMap<String, AbstractConstant> vmConstants = new HashMap<>();
157 for (AbstractConstant e : new VMIntConstants(gHotSpotVMIntConstants)) {
158 vmConstants.put(e.getName(), e);
159 }
160 for (AbstractConstant e : new VMLongConstants(gHotSpotVMLongConstants)) {
161 vmConstants.put(e.getName(), e);
162 }
163
164 // Fill the flags hash map.
165 HashMap<String, Flags.Flag> flags = new HashMap<>();
166 for (Flags.Flag e : new Flags(vmFields, vmTypes)) {
167 flags.put(e.getName(), e);
168 }
169
170 String currentArch = getHostArchitectureName();
171
172 for (Field f : HotSpotVMConfig.class.getDeclaredFields()) {
173 if (f.isAnnotationPresent(HotSpotVMField.class)) {
174 HotSpotVMField annotation = f.getAnnotation(HotSpotVMField.class);
175 String name = annotation.name();
176 String type = annotation.type();
177 VMFields.Field entry = vmFields.get(name);
178 if (entry == null) {
179 if (!isRequired(currentArch, annotation.archs())) {
180 continue;
181 }
182 throw new IllegalArgumentException("field not found: " + name);
183 }
184
185 // Make sure the native type is still the type we expect.
186 if (!type.equals("")) {
187 if (!type.equals(entry.getTypeString())) {
188 throw new IllegalArgumentException("compiler expects type " + type + " but field " + name + " is of type " + entry.getTypeString());
189 }
190 }
191
192 switch (annotation.get()) {
193 case OFFSET:
194 checkField(f, entry.getOffset());
195 break;
196 case ADDRESS:
197 checkField(f, entry.getAddress());
198 break;
199 case VALUE:
200 checkField(f, entry.getValue());
201 break;
202 default:
203 throw new JVMCIError("unknown kind %s", annotation.get());
204 }
205 } else if (f.isAnnotationPresent(HotSpotVMType.class)) {
206 HotSpotVMType annotation = f.getAnnotation(HotSpotVMType.class);
207 String name = annotation.name();
208 VMTypes.Type entry = vmTypes.get(name);
209 if (entry == null) {
210 throw new IllegalArgumentException("type not found: " + name);
211 }
212 switch (annotation.get()) {
213 case SIZE:
214 checkField(f, entry.getSize());
215 break;
216 default:
217 throw new JVMCIError("unknown kind %s", annotation.get());
218 }
219 } else if (f.isAnnotationPresent(HotSpotVMConstant.class)) {
220 HotSpotVMConstant annotation = f.getAnnotation(HotSpotVMConstant.class);
221 String name = annotation.name();
222 AbstractConstant entry = vmConstants.get(name);
223 if (entry == null) {
224 if (!isRequired(currentArch, annotation.archs())) {
225 continue;
226 }
227 throw new IllegalArgumentException("constant not found: " + name);
228 }
229 checkField(f, entry.getValue());
230 } else if (f.isAnnotationPresent(HotSpotVMFlag.class)) {
231 HotSpotVMFlag annotation = f.getAnnotation(HotSpotVMFlag.class);
232 String name = annotation.name();
233 Flags.Flag entry = flags.get(name);
234 if (entry == null) {
235 if (annotation.optional() || !isRequired(currentArch, annotation.archs())) {
236 continue;
237 }
238 throw new IllegalArgumentException("flag not found: " + name);
239
240 }
241 checkField(f, entry.getValue());
242 }
243 }
244 return true;
245 }
246
247 private final CompressEncoding oopEncoding;
248 private final CompressEncoding klassEncoding;
249
250 public CompressEncoding getOopEncoding() {
251 return oopEncoding;
252 }
253
254 public CompressEncoding getKlassEncoding() {
255 return klassEncoding;
256 }
257
258 private void checkField(Field field, Object value) {
259 try {
260 Class<?> fieldType = field.getType();
261 if (fieldType == boolean.class) {
262 if (value instanceof String) {
263 assert field.getBoolean(this) == Boolean.valueOf((String) value) : field + " " + value + " " + field.getBoolean(this);
264 } else if (value instanceof Boolean) {
265 assert field.getBoolean(this) == (boolean) value : field + " " + value + " " + field.getBoolean(this);
266 } else if (value instanceof Long) {
267 assert field.getBoolean(this) == (((long) value) != 0) : field + " " + value + " " + field.getBoolean(this);
268 } else {
269 throw new JVMCIError(value.getClass().getSimpleName());
270 }
271 } else if (fieldType == int.class) {
272 if (value instanceof Integer) {
273 assert field.getInt(this) == (int) value : field + " " + value + " " + field.getInt(this);
274 } else if (value instanceof Long) {
275 assert field.getInt(this) == (int) (long) value : field + " " + value + " " + field.getInt(this);
276 } else {
277 throw new JVMCIError(value.getClass().getSimpleName());
278 }
279 } else if (fieldType == long.class) {
280 assert field.getLong(this) == (long) value : field + " " + value + " " + field.getLong(this);
281 } else {
282 throw new JVMCIError(field.toString());
283 }
284 } catch (IllegalAccessException e) {
285 throw new JVMCIError("%s: %s", field, e);
286 }
287 } 57 }
288 58
289 /** 59 /**
290 * Gets the host architecture name for the purpose of finding the corresponding 60 * Gets the host architecture name for the purpose of finding the corresponding
291 * {@linkplain HotSpotJVMCIBackendFactory backend}. 61 * {@linkplain HotSpotJVMCIBackendFactory backend}.
301 break; 71 break;
302 } 72 }
303 return arch; 73 return arch;
304 } 74 }
305 75
306 /** 76 private final Integer amd64RequiredInt = osArch.equals("amd64") ? null : 0;
307 * VMStructEntry (see vmStructs.hpp). 77 // private final Integer sparcRequiredInt = osArch.equals("sparc") ? null : 0;
308 */
309 @HotSpotVMValue(expression = "gHotSpotVMStructs", get = HotSpotVMValue.Type.ADDRESS) @Stable private long gHotSpotVMStructs;
310 @HotSpotVMValue(expression = "gHotSpotVMStructEntryTypeNameOffset") @Stable private long gHotSpotVMStructEntryTypeNameOffset;
311 @HotSpotVMValue(expression = "gHotSpotVMStructEntryFieldNameOffset") @Stable private long gHotSpotVMStructEntryFieldNameOffset;
312 @HotSpotVMValue(expression = "gHotSpotVMStructEntryTypeStringOffset") @Stable private long gHotSpotVMStructEntryTypeStringOffset;
313 @HotSpotVMValue(expression = "gHotSpotVMStructEntryIsStaticOffset") @Stable private long gHotSpotVMStructEntryIsStaticOffset;
314 @HotSpotVMValue(expression = "gHotSpotVMStructEntryOffsetOffset") @Stable private long gHotSpotVMStructEntryOffsetOffset;
315 @HotSpotVMValue(expression = "gHotSpotVMStructEntryAddressOffset") @Stable private long gHotSpotVMStructEntryAddressOffset;
316 @HotSpotVMValue(expression = "gHotSpotVMStructEntryArrayStride") @Stable private long gHotSpotVMStructEntryArrayStride;
317
318 class VMFields implements Iterable<VMFields.Field> {
319
320 private long address;
321
322 VMFields(long address) {
323 this.address = address;
324 }
325
326 public Iterator<VMFields.Field> iterator() {
327 return new Iterator<VMFields.Field>() {
328
329 private int index = 0;
330
331 private Field current() {
332 return new Field(address + gHotSpotVMStructEntryArrayStride * index);
333 }
334
335 /**
336 * The last entry is identified by a NULL fieldName.
337 */
338 public boolean hasNext() {
339 Field entry = current();
340 return entry.getFieldName() != null;
341 }
342
343 public Field next() {
344 Field entry = current();
345 index++;
346 return entry;
347 }
348 };
349 }
350
351 class Field {
352
353 private long entryAddress;
354
355 Field(long address) {
356 this.entryAddress = address;
357 }
358
359 public String getTypeName() {
360 long typeNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryTypeNameOffset);
361 return readCString(UNSAFE, typeNameAddress);
362 }
363
364 public String getFieldName() {
365 long fieldNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryFieldNameOffset);
366 return readCString(UNSAFE, fieldNameAddress);
367 }
368
369 public String getTypeString() {
370 long typeStringAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryTypeStringOffset);
371 return readCString(UNSAFE, typeStringAddress);
372 }
373
374 public boolean isStatic() {
375 return UNSAFE.getInt(entryAddress + gHotSpotVMStructEntryIsStaticOffset) != 0;
376 }
377
378 public long getOffset() {
379 return UNSAFE.getLong(entryAddress + gHotSpotVMStructEntryOffsetOffset);
380 }
381
382 public long getAddress() {
383 return UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryAddressOffset);
384 }
385
386 public String getName() {
387 String typeName = getTypeName();
388 String fieldName = getFieldName();
389 return typeName + "::" + fieldName;
390 }
391
392 public long getValue() {
393 String type = getTypeString();
394 switch (type) {
395 case "int":
396 return UNSAFE.getInt(getAddress());
397 case "address":
398 case "intptr_t":
399 return UNSAFE.getAddress(getAddress());
400 default:
401 // All foo* types are addresses.
402 if (type.endsWith("*")) {
403 return UNSAFE.getAddress(getAddress());
404 }
405 throw new JVMCIError(type);
406 }
407 }
408
409 @Override
410 public String toString() {
411 return String.format("Field[typeName=%s, fieldName=%s, typeString=%s, isStatic=%b, offset=%d, address=0x%x]", getTypeName(), getFieldName(), getTypeString(), isStatic(), getOffset(),
412 getAddress());
413 }
414 }
415 }
416
417 /**
418 * VMTypeEntry (see vmStructs.hpp).
419 */
420 @HotSpotVMValue(expression = "gHotSpotVMTypes", get = HotSpotVMValue.Type.ADDRESS) @Stable private long gHotSpotVMTypes;
421 @HotSpotVMValue(expression = "gHotSpotVMTypeEntryTypeNameOffset") @Stable private long gHotSpotVMTypeEntryTypeNameOffset;
422 @HotSpotVMValue(expression = "gHotSpotVMTypeEntrySuperclassNameOffset") @Stable private long gHotSpotVMTypeEntrySuperclassNameOffset;
423 @HotSpotVMValue(expression = "gHotSpotVMTypeEntryIsOopTypeOffset") @Stable private long gHotSpotVMTypeEntryIsOopTypeOffset;
424 @HotSpotVMValue(expression = "gHotSpotVMTypeEntryIsIntegerTypeOffset") @Stable private long gHotSpotVMTypeEntryIsIntegerTypeOffset;
425 @HotSpotVMValue(expression = "gHotSpotVMTypeEntryIsUnsignedOffset") @Stable private long gHotSpotVMTypeEntryIsUnsignedOffset;
426 @HotSpotVMValue(expression = "gHotSpotVMTypeEntrySizeOffset") @Stable private long gHotSpotVMTypeEntrySizeOffset;
427 @HotSpotVMValue(expression = "gHotSpotVMTypeEntryArrayStride") @Stable private long gHotSpotVMTypeEntryArrayStride;
428
429 class VMTypes implements Iterable<VMTypes.Type> {
430
431 private long address;
432
433 VMTypes(long address) {
434 this.address = address;
435 }
436
437 public Iterator<VMTypes.Type> iterator() {
438 return new Iterator<VMTypes.Type>() {
439
440 private int index = 0;
441
442 private Type current() {
443 return new Type(address + gHotSpotVMTypeEntryArrayStride * index);
444 }
445
446 /**
447 * The last entry is identified by a NULL type name.
448 */
449 public boolean hasNext() {
450 Type entry = current();
451 return entry.getTypeName() != null;
452 }
453
454 public Type next() {
455 Type entry = current();
456 index++;
457 return entry;
458 }
459 };
460 }
461
462 class Type {
463
464 private long entryAddress;
465
466 Type(long address) {
467 this.entryAddress = address;
468 }
469
470 public String getTypeName() {
471 long typeNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMTypeEntryTypeNameOffset);
472 return readCString(UNSAFE, typeNameAddress);
473 }
474
475 public String getSuperclassName() {
476 long superclassNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMTypeEntrySuperclassNameOffset);
477 return readCString(UNSAFE, superclassNameAddress);
478 }
479
480 public boolean isOopType() {
481 return UNSAFE.getInt(entryAddress + gHotSpotVMTypeEntryIsOopTypeOffset) != 0;
482 }
483
484 public boolean isIntegerType() {
485 return UNSAFE.getInt(entryAddress + gHotSpotVMTypeEntryIsIntegerTypeOffset) != 0;
486 }
487
488 public boolean isUnsigned() {
489 return UNSAFE.getInt(entryAddress + gHotSpotVMTypeEntryIsUnsignedOffset) != 0;
490 }
491
492 public long getSize() {
493 return UNSAFE.getLong(entryAddress + gHotSpotVMTypeEntrySizeOffset);
494 }
495
496 @Override
497 public String toString() {
498 return String.format("Type[typeName=%s, superclassName=%s, isOopType=%b, isIntegerType=%b, isUnsigned=%b, size=%d]", getTypeName(), getSuperclassName(), isOopType(), isIntegerType(),
499 isUnsigned(), getSize());
500 }
501 }
502 }
503
504 public abstract class AbstractConstant {
505
506 protected long address;
507 protected long nameOffset;
508 protected long valueOffset;
509
510 AbstractConstant(long address, long nameOffset, long valueOffset) {
511 this.address = address;
512 this.nameOffset = nameOffset;
513 this.valueOffset = valueOffset;
514 }
515
516 public String getName() {
517 long nameAddress = UNSAFE.getAddress(address + nameOffset);
518 return readCString(UNSAFE, nameAddress);
519 }
520
521 public abstract long getValue();
522 }
523
524 /**
525 * VMIntConstantEntry (see vmStructs.hpp).
526 */
527 @HotSpotVMValue(expression = "gHotSpotVMIntConstants", get = HotSpotVMValue.Type.ADDRESS) @Stable private long gHotSpotVMIntConstants;
528 @HotSpotVMValue(expression = "gHotSpotVMIntConstantEntryNameOffset") @Stable private long gHotSpotVMIntConstantEntryNameOffset;
529 @HotSpotVMValue(expression = "gHotSpotVMIntConstantEntryValueOffset") @Stable private long gHotSpotVMIntConstantEntryValueOffset;
530 @HotSpotVMValue(expression = "gHotSpotVMIntConstantEntryArrayStride") @Stable private long gHotSpotVMIntConstantEntryArrayStride;
531
532 class VMIntConstants implements Iterable<VMIntConstants.Constant> {
533
534 private long address;
535
536 VMIntConstants(long address) {
537 this.address = address;
538 }
539
540 public Iterator<VMIntConstants.Constant> iterator() {
541 return new Iterator<VMIntConstants.Constant>() {
542
543 private int index = 0;
544
545 private Constant current() {
546 return new Constant(address + gHotSpotVMIntConstantEntryArrayStride * index);
547 }
548
549 /**
550 * The last entry is identified by a NULL name.
551 */
552 public boolean hasNext() {
553 Constant entry = current();
554 return entry.getName() != null;
555 }
556
557 public Constant next() {
558 Constant entry = current();
559 index++;
560 return entry;
561 }
562 };
563 }
564
565 class Constant extends AbstractConstant {
566
567 Constant(long address) {
568 super(address, gHotSpotVMIntConstantEntryNameOffset, gHotSpotVMIntConstantEntryValueOffset);
569 }
570
571 @Override
572 public long getValue() {
573 return UNSAFE.getInt(address + valueOffset);
574 }
575
576 @Override
577 public String toString() {
578 return String.format("IntConstant[name=%s, value=%d (0x%x)]", getName(), getValue(), getValue());
579 }
580 }
581 }
582
583 /**
584 * VMLongConstantEntry (see vmStructs.hpp).
585 */
586 @HotSpotVMValue(expression = "gHotSpotVMLongConstants", get = HotSpotVMValue.Type.ADDRESS) @Stable private long gHotSpotVMLongConstants;
587 @HotSpotVMValue(expression = "gHotSpotVMLongConstantEntryNameOffset") @Stable private long gHotSpotVMLongConstantEntryNameOffset;
588 @HotSpotVMValue(expression = "gHotSpotVMLongConstantEntryValueOffset") @Stable private long gHotSpotVMLongConstantEntryValueOffset;
589 @HotSpotVMValue(expression = "gHotSpotVMLongConstantEntryArrayStride") @Stable private long gHotSpotVMLongConstantEntryArrayStride;
590
591 class VMLongConstants implements Iterable<VMLongConstants.Constant> {
592
593 private long address;
594
595 VMLongConstants(long address) {
596 this.address = address;
597 }
598
599 public Iterator<VMLongConstants.Constant> iterator() {
600 return new Iterator<VMLongConstants.Constant>() {
601
602 private int index = 0;
603
604 private Constant currentEntry() {
605 return new Constant(address + gHotSpotVMLongConstantEntryArrayStride * index);
606 }
607
608 /**
609 * The last entry is identified by a NULL name.
610 */
611 public boolean hasNext() {
612 Constant entry = currentEntry();
613 return entry.getName() != null;
614 }
615
616 public Constant next() {
617 Constant entry = currentEntry();
618 index++;
619 return entry;
620 }
621 };
622 }
623
624 class Constant extends AbstractConstant {
625
626 Constant(long address) {
627 super(address, gHotSpotVMLongConstantEntryNameOffset, gHotSpotVMLongConstantEntryValueOffset);
628 }
629
630 @Override
631 public long getValue() {
632 return UNSAFE.getLong(address + valueOffset);
633 }
634
635 @Override
636 public String toString() {
637 return String.format("LongConstant[name=%s, value=%d (0x%x)]", getName(), getValue(), getValue());
638 }
639 }
640 }
641
642 class Flags implements Iterable<Flags.Flag> {
643
644 private long address;
645 private long entrySize;
646 private long typeOffset;
647 private long nameOffset;
648 private long addrOffset;
649
650 Flags(HashMap<String, VMFields.Field> vmStructs, HashMap<String, VMTypes.Type> vmTypes) {
651 address = vmStructs.get("Flag::flags").getValue();
652 entrySize = vmTypes.get("Flag").getSize();
653 typeOffset = vmStructs.get("Flag::_type").getOffset();
654 nameOffset = vmStructs.get("Flag::_name").getOffset();
655 addrOffset = vmStructs.get("Flag::_addr").getOffset();
656
657 assert vmTypes.get("bool").getSize() == Byte.BYTES;
658 assert vmTypes.get("intx").getSize() == Long.BYTES;
659 assert vmTypes.get("uintx").getSize() == Long.BYTES;
660 }
661
662 public Iterator<Flags.Flag> iterator() {
663 return new Iterator<Flags.Flag>() {
664
665 private int index = 0;
666
667 private Flag current() {
668 return new Flag(address + entrySize * index);
669 }
670
671 /**
672 * The last entry is identified by a NULL name.
673 */
674 public boolean hasNext() {
675 Flag entry = current();
676 return entry.getName() != null;
677 }
678
679 public Flag next() {
680 Flag entry = current();
681 index++;
682 return entry;
683 }
684 };
685 }
686
687 class Flag {
688
689 private long entryAddress;
690
691 Flag(long address) {
692 this.entryAddress = address;
693 }
694
695 public String getType() {
696 long typeAddress = UNSAFE.getAddress(entryAddress + typeOffset);
697 return readCString(UNSAFE, typeAddress);
698 }
699
700 public String getName() {
701 long nameAddress = UNSAFE.getAddress(entryAddress + nameOffset);
702 return readCString(UNSAFE, nameAddress);
703 }
704
705 public long getAddr() {
706 return UNSAFE.getAddress(entryAddress + addrOffset);
707 }
708
709 public Object getValue() {
710 switch (getType()) {
711 case "bool":
712 return Boolean.valueOf(UNSAFE.getByte(getAddr()) != 0);
713 case "intx":
714 case "uintx":
715 case "uint64_t":
716 return Long.valueOf(UNSAFE.getLong(getAddr()));
717 case "double":
718 return Double.valueOf(UNSAFE.getDouble(getAddr()));
719 case "ccstr":
720 case "ccstrlist":
721 return readCString(UNSAFE, getAddr());
722 default:
723 throw new JVMCIError(getType());
724 }
725 }
726
727 @Override
728 public String toString() {
729 return String.format("Flag[type=%s, name=%s, value=%s]", getType(), getName(), getValue());
730 }
731 }
732 }
733 78
734 // os information, register layout, code generation, ... 79 // os information, register layout, code generation, ...
735 @HotSpotVMValue(expression = "DEBUG_ONLY(1) NOT_DEBUG(0)") @Stable public boolean cAssertions; 80 // public final boolean cAssertions = getConstant("ASSERT", Boolean.class);
736 public final boolean windowsOs = System.getProperty("os.name", "").startsWith("Windows"); 81 public final boolean windowsOs = System.getProperty("os.name", "").startsWith("Windows");
737 public final boolean linuxOs = System.getProperty("os.name", "").startsWith("Linux"); 82 public final boolean linuxOs = System.getProperty("os.name", "").startsWith("Linux");
738 83
739 @HotSpotVMFlag(name = "CodeEntryAlignment") @Stable public int codeEntryAlignment; 84 // public final int codeEntryAlignment = getFlag("CodeEntryAlignment", Integer.class);
740 @HotSpotVMFlag(name = "VerifyOops") @Stable public boolean verifyOops; 85 // public final boolean verifyOops = getFlag("VerifyOops", Boolean.class);
741 @HotSpotVMFlag(name = "CITime") @Stable public boolean ciTime; 86 // public final boolean ciTime = getFlag("CITime", Boolean.class);
742 @HotSpotVMFlag(name = "CITimeEach") @Stable public boolean ciTimeEach; 87 // public final boolean ciTimeEach = getFlag("CITimeEach", Boolean.class);
743 @HotSpotVMFlag(name = "CompileTheWorldStartAt", optional = true) @Stable public int compileTheWorldStartAt; 88 // public final int compileTheWorldStartAt = getFlag("CompileTheWorldStartAt", Integer.class, 1);
744 @HotSpotVMFlag(name = "CompileTheWorldStopAt", optional = true) @Stable public int compileTheWorldStopAt; 89 // public final int compileTheWorldStopAt = getFlag("CompileTheWorldStopAt", Integer.class,
745 @HotSpotVMFlag(name = "DontCompileHugeMethods") @Stable public boolean dontCompileHugeMethods; 90 // Integer.MAX_VALUE);
746 @HotSpotVMFlag(name = "HugeMethodLimit") @Stable public int hugeMethodLimit; 91 // public final boolean dontCompileHugeMethods = getFlag("DontCompileHugeMethods", Boolean.class);
747 @HotSpotVMFlag(name = "PrintInlining") @Stable public boolean printInlining; 92 // public final int hugeMethodLimit = getFlag("HugeMethodLimit", Integer.class);
748 @HotSpotVMFlag(name = "Inline") @Stable public boolean inline; 93 // public final boolean printInlining = getFlag("PrintInlining", Boolean.class);
749 @HotSpotVMFlag(name = "JVMCIUseFastLocking") @Stable public boolean useFastLocking; 94 // public final boolean inline = getFlag("Inline", Boolean.class);
750 @HotSpotVMFlag(name = "ForceUnreachable") @Stable public boolean forceUnreachable; 95 // public final boolean useFastLocking = getFlag("JVMCIUseFastLocking", Boolean.class);
751 @HotSpotVMFlag(name = "FoldStableValues") @Stable public boolean foldStableValues; 96 // public final boolean forceUnreachable = getFlag("ForceUnreachable", Boolean.class);
752 97 // public final boolean foldStableValues = getFlag("FoldStableValues", Boolean.class);
753 @HotSpotVMFlag(name = "UseTLAB") @Stable public boolean useTLAB; 98
754 @HotSpotVMFlag(name = "UseBiasedLocking") @Stable public boolean useBiasedLocking; 99 // public final boolean useTLAB = getFlag("UseTLAB", Boolean.class);
755 @HotSpotVMFlag(name = "UsePopCountInstruction") @Stable public boolean usePopCountInstruction; 100 // public final boolean useBiasedLocking = getFlag("UseBiasedLocking", Boolean.class);
756 @HotSpotVMFlag(name = "UseCountLeadingZerosInstruction", archs = {"amd64"}) @Stable public boolean useCountLeadingZerosInstruction; 101 // public final boolean usePopCountInstruction = getFlag("UsePopCountInstruction", Boolean.class);
757 @HotSpotVMFlag(name = "UseCountTrailingZerosInstruction", archs = {"amd64"}) @Stable public boolean useCountTrailingZerosInstruction; 102 // public final boolean useAESIntrinsics = getFlag("UseAESIntrinsics", Boolean.class);
758 @HotSpotVMFlag(name = "UseAESIntrinsics") @Stable public boolean useAESIntrinsics; 103 // public final boolean useCRC32Intrinsics = getFlag("UseCRC32Intrinsics", Boolean.class);
759 @HotSpotVMFlag(name = "UseCRC32Intrinsics") @Stable public boolean useCRC32Intrinsics; 104 // public final boolean useG1GC = getFlag("UseG1GC", Boolean.class);
760 @HotSpotVMFlag(name = "UseG1GC") @Stable public boolean useG1GC; 105 // public final boolean useCMSGC = getFlag("UseConcMarkSweepGC", Boolean.class);
761 @HotSpotVMFlag(name = "UseConcMarkSweepGC") @Stable public boolean useCMSGC; 106
762 107 // public final int allocatePrefetchStyle = getFlag("AllocatePrefetchStyle", Integer.class);
763 @HotSpotVMFlag(name = "AllocatePrefetchStyle") @Stable public int allocatePrefetchStyle; 108 // public final int allocatePrefetchInstr = getFlag("AllocatePrefetchInstr", Integer.class);
764 @HotSpotVMFlag(name = "AllocatePrefetchInstr") @Stable public int allocatePrefetchInstr; 109 // public final int allocatePrefetchLines = getFlag("AllocatePrefetchLines", Integer.class);
765 @HotSpotVMFlag(name = "AllocatePrefetchLines") @Stable public int allocatePrefetchLines; 110 // public final int allocateInstancePrefetchLines = getFlag("AllocateInstancePrefetchLines",
766 @HotSpotVMFlag(name = "AllocateInstancePrefetchLines") @Stable public int allocateInstancePrefetchLines; 111 // Integer.class);
767 @HotSpotVMFlag(name = "AllocatePrefetchStepSize") @Stable public int allocatePrefetchStepSize; 112 // public final int allocatePrefetchStepSize = getFlag("AllocatePrefetchStepSize", Integer.class);
768 @HotSpotVMFlag(name = "AllocatePrefetchDistance") @Stable public int allocatePrefetchDistance; 113 // public final int allocatePrefetchDistance = getFlag("AllocatePrefetchDistance", Integer.class);
769 114
770 @HotSpotVMFlag(name = "FlightRecorder", optional = true) @Stable public boolean flightRecorder; 115 // public final boolean flightRecorder = getFlag("FightRecorder", Boolean.class, false);
771 116
772 @HotSpotVMField(name = "Universe::_collectedHeap", type = "CollectedHeap*", get = HotSpotVMField.Type.VALUE) @Stable private long universeCollectedHeap; 117 // private final long universeCollectedHeap = getFieldValue("Universe::_collectedHeap", Long.class,
773 @HotSpotVMField(name = "CollectedHeap::_total_collections", type = "unsigned int", get = HotSpotVMField.Type.OFFSET) @Stable private int collectedHeapTotalCollectionsOffset; 118 // "CollectedHeap*");
774 119 // private final int collectedHeapTotalCollectionsOffset =
775 public long gcTotalCollectionsAddress() { 120 // getFieldOffset("CollectedHeap::_total_collections", Integer.class, "unsigned int");
776 return universeCollectedHeap + collectedHeapTotalCollectionsOffset; 121 //
777 } 122 // public long gcTotalCollectionsAddress() {
778 123 // return universeCollectedHeap + collectedHeapTotalCollectionsOffset;
779 @HotSpotVMFlag(name = "ReduceInitialCardMarks") @Stable public boolean useDeferredInitBarriers; 124 // }
125 //
126 // public final boolean useDeferredInitBarriers = getFlag("ReduceInitialCardMarks", Boolean.class);
780 127
781 // Compressed Oops related values. 128 // Compressed Oops related values.
782 @HotSpotVMFlag(name = "UseCompressedOops") @Stable public boolean useCompressedOops; 129 public final boolean useCompressedOops = getFlag("UseCompressedOops", Boolean.class);
783 @HotSpotVMFlag(name = "UseCompressedClassPointers") @Stable public boolean useCompressedClassPointers; 130 public final boolean useCompressedClassPointers = getFlag("UseCompressedClassPointers", Boolean.class);
784 131
785 @HotSpotVMField(name = "Universe::_narrow_oop._base", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long narrowOopBase; 132 // public final long narrowOopBase = getFieldValue("CompilerToVM::Data::Universe_narrow_oop_base",
786 @HotSpotVMField(name = "Universe::_narrow_oop._shift", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int narrowOopShift; 133 // Long.class, "address");
787 @HotSpotVMFlag(name = "ObjectAlignmentInBytes") @Stable public int objectAlignment; 134 // public final int narrowOopShift = getFieldValue("CompilerToVM::Data::Universe_narrow_oop_shift",
788 135 // Integer.class, "int");
789 public int logMinObjAlignment() { 136 public final int objectAlignment = getFlag("ObjectAlignmentInBytes", Integer.class);
790 return (int) (Math.log(objectAlignment) / Math.log(2)); 137
791 } 138 // public int logMinObjAlignment() {
792 139 // return (int) (Math.log(objectAlignment) / Math.log(2));
793 @HotSpotVMField(name = "Universe::_narrow_klass._base", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long narrowKlassBase; 140 // }
794 @HotSpotVMField(name = "Universe::_narrow_klass._shift", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int narrowKlassShift; 141
795 @HotSpotVMConstant(name = "LogKlassAlignmentInBytes") @Stable public int logKlassAlignment; 142 // public final int narrowKlassSize = getTypeSize("narrowKlass");
796 143 // public final long narrowKlassBase =
797 // CPU capabilities 144 // getFieldValue("CompilerToVM::Data::Universe_narrow_klass_base", Long.class, "address");
798 @HotSpotVMFlag(name = "UseSSE") @Stable public int useSSE; 145 // public final int narrowKlassShift =
799 @HotSpotVMFlag(name = "UseAVX", archs = {"amd64"}) @Stable public int useAVX; 146 // getFieldValue("CompilerToVM::Data::Universe_narrow_klass_shift", Integer.class, "int");
800 147 // public final int logKlassAlignment = getConstant("LogKlassAlignmentInBytes", Integer.class);
801 // X86 specific values 148
802 @HotSpotVMField(name = "VM_Version::_cpuFeatures", type = "int", get = HotSpotVMField.Type.VALUE, archs = {"amd64"}) @Stable public int x86CPUFeatures; 149 // public final int stackShadowPages = getFlag("StackShadowPages", Integer.class);
803 @HotSpotVMConstant(name = "VM_Version::CPU_CX8", archs = {"amd64"}) @Stable public int cpuCX8; 150 // public final boolean useStackBanging = getFlag("UseStackBanging", Boolean.class);
804 @HotSpotVMConstant(name = "VM_Version::CPU_CMOV", archs = {"amd64"}) @Stable public int cpuCMOV; 151 // public final int stackBias = getConstant("STACK_BIAS", Integer.class);
805 @HotSpotVMConstant(name = "VM_Version::CPU_FXSR", archs = {"amd64"}) @Stable public int cpuFXSR; 152 // public final int vmPageSize = getFieldValue("CompilerToVM::Data::vm_page_size", Integer.class,
806 @HotSpotVMConstant(name = "VM_Version::CPU_HT", archs = {"amd64"}) @Stable public int cpuHT; 153 // "int");
807 @HotSpotVMConstant(name = "VM_Version::CPU_MMX", archs = {"amd64"}) @Stable public int cpuMMX; 154
808 @HotSpotVMConstant(name = "VM_Version::CPU_3DNOW_PREFETCH", archs = {"amd64"}) @Stable public int cpu3DNOWPREFETCH; 155 // public final int markOffset = getFieldOffset("oopDesc::_mark", Integer.class, "markOop");
809 @HotSpotVMConstant(name = "VM_Version::CPU_SSE", archs = {"amd64"}) @Stable public int cpuSSE; 156 // public final int hubOffset = getFieldOffset("oopDesc::_metadata._klass", Integer.class,
810 @HotSpotVMConstant(name = "VM_Version::CPU_SSE2", archs = {"amd64"}) @Stable public int cpuSSE2; 157 // "Klass*");
811 @HotSpotVMConstant(name = "VM_Version::CPU_SSE3", archs = {"amd64"}) @Stable public int cpuSSE3; 158
812 @HotSpotVMConstant(name = "VM_Version::CPU_SSSE3", archs = {"amd64"}) @Stable public int cpuSSSE3; 159 public final int prototypeMarkWordOffset = getFieldOffset("Klass::_prototype_header", Integer.class, "markOop");
813 @HotSpotVMConstant(name = "VM_Version::CPU_SSE4A", archs = {"amd64"}) @Stable public int cpuSSE4A; 160 public final int subklassOffset = getFieldOffset("Klass::_subklass", Integer.class, "Klass*");
814 @HotSpotVMConstant(name = "VM_Version::CPU_SSE4_1", archs = {"amd64"}) @Stable public int cpuSSE41; 161 public final int nextSiblingOffset = getFieldOffset("Klass::_next_sibling", Integer.class, "Klass*");
815 @HotSpotVMConstant(name = "VM_Version::CPU_SSE4_2", archs = {"amd64"}) @Stable public int cpuSSE42; 162 public final int superCheckOffsetOffset = getFieldOffset("Klass::_super_check_offset", Integer.class, "juint");
816 @HotSpotVMConstant(name = "VM_Version::CPU_POPCNT", archs = {"amd64"}) @Stable public int cpuPOPCNT; 163 public final int secondarySuperCacheOffset = getFieldOffset("Klass::_secondary_super_cache", Integer.class, "Klass*");
817 @HotSpotVMConstant(name = "VM_Version::CPU_LZCNT", archs = {"amd64"}) @Stable public int cpuLZCNT; 164 public final int secondarySupersOffset = getFieldOffset("Klass::_secondary_supers", Integer.class, "Array<Klass*>*");
818 @HotSpotVMConstant(name = "VM_Version::CPU_TSC", archs = {"amd64"}) @Stable public int cpuTSC;
819 @HotSpotVMConstant(name = "VM_Version::CPU_TSCINV", archs = {"amd64"}) @Stable public int cpuTSCINV;
820 @HotSpotVMConstant(name = "VM_Version::CPU_AVX", archs = {"amd64"}) @Stable public int cpuAVX;
821 @HotSpotVMConstant(name = "VM_Version::CPU_AVX2", archs = {"amd64"}) @Stable public int cpuAVX2;
822 @HotSpotVMConstant(name = "VM_Version::CPU_AES", archs = {"amd64"}) @Stable public int cpuAES;
823 @HotSpotVMConstant(name = "VM_Version::CPU_ERMS", archs = {"amd64"}) @Stable public int cpuERMS;
824 @HotSpotVMConstant(name = "VM_Version::CPU_CLMUL", archs = {"amd64"}) @Stable public int cpuCLMUL;
825 @HotSpotVMConstant(name = "VM_Version::CPU_BMI1", archs = {"amd64"}) @Stable public int cpuBMI1;
826
827 // SPARC specific values
828 @HotSpotVMField(name = "VM_Version::_features", type = "int", get = HotSpotVMField.Type.VALUE, archs = {"sparc"}) @Stable public int sparcFeatures;
829 @HotSpotVMConstant(name = "VM_Version::vis3_instructions_m", archs = {"sparc"}) @Stable public int vis3Instructions;
830 @HotSpotVMConstant(name = "VM_Version::vis2_instructions_m", archs = {"sparc"}) @Stable public int vis2Instructions;
831 @HotSpotVMConstant(name = "VM_Version::vis1_instructions_m", archs = {"sparc"}) @Stable public int vis1Instructions;
832 @HotSpotVMConstant(name = "VM_Version::cbcond_instructions_m", archs = {"sparc"}) @Stable public int cbcondInstructions;
833 @HotSpotVMConstant(name = "VM_Version::v8_instructions_m", archs = {"sparc"}) @Stable public int v8Instructions;
834 @HotSpotVMConstant(name = "VM_Version::hardware_mul32_m", archs = {"sparc"}) @Stable public int hardwareMul32;
835 @HotSpotVMConstant(name = "VM_Version::hardware_div32_m", archs = {"sparc"}) @Stable public int hardwareDiv32;
836 @HotSpotVMConstant(name = "VM_Version::hardware_fsmuld_m", archs = {"sparc"}) @Stable public int hardwareFsmuld;
837 @HotSpotVMConstant(name = "VM_Version::hardware_popc_m", archs = {"sparc"}) @Stable public int hardwarePopc;
838 @HotSpotVMConstant(name = "VM_Version::v9_instructions_m", archs = {"sparc"}) @Stable public int v9Instructions;
839 @HotSpotVMConstant(name = "VM_Version::sun4v_m", archs = {"sparc"}) @Stable public int sun4v;
840 @HotSpotVMConstant(name = "VM_Version::blk_init_instructions_m", archs = {"sparc"}) @Stable public int blkInitInstructions;
841 @HotSpotVMConstant(name = "VM_Version::fmaf_instructions_m", archs = {"sparc"}) @Stable public int fmafInstructions;
842 @HotSpotVMConstant(name = "VM_Version::fmau_instructions_m", archs = {"sparc"}) @Stable public int fmauInstructions;
843 @HotSpotVMConstant(name = "VM_Version::sparc64_family_m", archs = {"sparc"}) @Stable public int sparc64Family;
844 @HotSpotVMConstant(name = "VM_Version::M_family_m", archs = {"sparc"}) @Stable public int mFamily;
845 @HotSpotVMConstant(name = "VM_Version::T_family_m", archs = {"sparc"}) @Stable public int tFamily;
846 @HotSpotVMConstant(name = "VM_Version::T1_model_m", archs = {"sparc"}) @Stable public int t1Model;
847 @HotSpotVMConstant(name = "VM_Version::sparc5_instructions_m", archs = {"sparc"}) @Stable public int sparc5Instructions;
848 @HotSpotVMConstant(name = "VM_Version::aes_instructions_m", archs = {"sparc"}) @Stable public int aesInstructions;
849 @HotSpotVMConstant(name = "VM_Version::sha1_instruction_m", archs = {"sparc"}) @Stable public int sha1Instruction;
850 @HotSpotVMConstant(name = "VM_Version::sha256_instruction_m", archs = {"sparc"}) @Stable public int sha256Instruction;
851 @HotSpotVMConstant(name = "VM_Version::sha512_instruction_m", archs = {"sparc"}) @Stable public int sha512Instruction;
852
853 @HotSpotVMFlag(name = "UseBlockZeroing", archs = {"sparc"}) @Stable public boolean useBlockZeroing;
854 @HotSpotVMFlag(name = "BlockZeroingLowLimit", archs = {"sparc"}) @Stable public int blockZeroingLowLimit;
855
856 @HotSpotVMFlag(name = "StackShadowPages") @Stable public int stackShadowPages;
857 @HotSpotVMFlag(name = "UseStackBanging") @Stable public boolean useStackBanging;
858 @HotSpotVMConstant(name = "STACK_BIAS") @Stable public int stackBias;
859 @HotSpotVMValue(expression = "os::vm_page_size()") @Stable public int vmPageSize;
860
861 // offsets, ...
862 @HotSpotVMField(name = "oopDesc::_mark", type = "markOop", get = HotSpotVMField.Type.OFFSET) @Stable public int markOffset;
863 @HotSpotVMField(name = "oopDesc::_metadata._klass", type = "Klass*", get = HotSpotVMField.Type.OFFSET) @Stable public int hubOffset;
864
865 @HotSpotVMField(name = "Klass::_prototype_header", type = "markOop", get = HotSpotVMField.Type.OFFSET) @Stable public int prototypeMarkWordOffset;
866 @HotSpotVMField(name = "Klass::_subklass", type = "Klass*", get = HotSpotVMField.Type.OFFSET) @Stable public int subklassOffset;
867 @HotSpotVMField(name = "Klass::_next_sibling", type = "Klass*", get = HotSpotVMField.Type.OFFSET) @Stable public int nextSiblingOffset;
868 @HotSpotVMField(name = "Klass::_super_check_offset", type = "juint", get = HotSpotVMField.Type.OFFSET) @Stable public int superCheckOffsetOffset;
869 @HotSpotVMField(name = "Klass::_secondary_super_cache", type = "Klass*", get = HotSpotVMField.Type.OFFSET) @Stable public int secondarySuperCacheOffset;
870 @HotSpotVMField(name = "Klass::_secondary_supers", type = "Array<Klass*>*", get = HotSpotVMField.Type.OFFSET) @Stable public int secondarySupersOffset;
871 165
872 /** 166 /**
873 * The offset of the _java_mirror field (of type {@link Class}) in a Klass. 167 * The offset of the _java_mirror field (of type {@link Class}) in a Klass.
874 */ 168 */
875 @HotSpotVMField(name = "Klass::_java_mirror", type = "oop", get = HotSpotVMField.Type.OFFSET) @Stable public int classMirrorOffset; 169 public final int classMirrorOffset = getFieldOffset("Klass::_java_mirror", Integer.class, "oop");
876 170
877 @HotSpotVMField(name = "Klass::_super", type = "Klass*", get = HotSpotVMField.Type.OFFSET) @Stable public int klassSuperKlassOffset; 171 public final int klassSuperKlassOffset = getFieldOffset("Klass::_super", Integer.class, "Klass*");
878 @HotSpotVMField(name = "Klass::_modifier_flags", type = "jint", get = HotSpotVMField.Type.OFFSET) @Stable public int klassModifierFlagsOffset; 172 public final int klassModifierFlagsOffset = getFieldOffset("Klass::_modifier_flags", Integer.class, "jint");
879 @HotSpotVMField(name = "Klass::_access_flags", type = "AccessFlags", get = HotSpotVMField.Type.OFFSET) @Stable public int klassAccessFlagsOffset; 173 public final int klassAccessFlagsOffset = getFieldOffset("Klass::_access_flags", Integer.class, "AccessFlags");
880 @HotSpotVMField(name = "Klass::_layout_helper", type = "jint", get = HotSpotVMField.Type.OFFSET) @Stable public int klassLayoutHelperOffset; 174 public final int klassLayoutHelperOffset = getFieldOffset("Klass::_layout_helper", Integer.class, "jint");
881 @HotSpotVMField(name = "Klass::_name", type = "Symbol*", get = HotSpotVMField.Type.OFFSET) @Stable public int klassNameOffset; 175 public final int klassNameOffset = getFieldOffset("Klass::_name", Integer.class, "Symbol*");
882 176
883 @HotSpotVMConstant(name = "Klass::_lh_neutral_value") @Stable public int klassLayoutHelperNeutralValue; 177 public final int klassLayoutHelperNeutralValue = getConstant("Klass::_lh_neutral_value", Integer.class);
884 @HotSpotVMConstant(name = "Klass::_lh_instance_slow_path_bit") @Stable public int klassLayoutHelperInstanceSlowPathBit; 178 public final int klassLayoutHelperInstanceSlowPathBit = getConstant("Klass::_lh_instance_slow_path_bit", Integer.class);
885 @HotSpotVMConstant(name = "Klass::_lh_log2_element_size_shift") @Stable public int layoutHelperLog2ElementSizeShift; 179 public final int layoutHelperLog2ElementSizeShift = getConstant("Klass::_lh_log2_element_size_shift", Integer.class);
886 @HotSpotVMConstant(name = "Klass::_lh_log2_element_size_mask") @Stable public int layoutHelperLog2ElementSizeMask; 180 public final int layoutHelperLog2ElementSizeMask = getConstant("Klass::_lh_log2_element_size_mask", Integer.class);
887 @HotSpotVMConstant(name = "Klass::_lh_element_type_shift") @Stable public int layoutHelperElementTypeShift; 181 public final int layoutHelperElementTypeShift = getConstant("Klass::_lh_element_type_shift", Integer.class);
888 @HotSpotVMConstant(name = "Klass::_lh_element_type_mask") @Stable public int layoutHelperElementTypeMask; 182 public final int layoutHelperElementTypeMask = getConstant("Klass::_lh_element_type_mask", Integer.class);
889 @HotSpotVMConstant(name = "Klass::_lh_header_size_shift") @Stable public int layoutHelperHeaderSizeShift; 183 public final int layoutHelperHeaderSizeShift = getConstant("Klass::_lh_header_size_shift", Integer.class);
890 @HotSpotVMConstant(name = "Klass::_lh_header_size_mask") @Stable public int layoutHelperHeaderSizeMask; 184 public final int layoutHelperHeaderSizeMask = getConstant("Klass::_lh_header_size_mask", Integer.class);
891 @HotSpotVMConstant(name = "Klass::_lh_array_tag_shift") @Stable public int layoutHelperArrayTagShift; 185 public final int layoutHelperArrayTagShift = getConstant("Klass::_lh_array_tag_shift", Integer.class);
892 @HotSpotVMConstant(name = "Klass::_lh_array_tag_type_value") @Stable public int layoutHelperArrayTagTypeValue; 186 public final int layoutHelperArrayTagTypeValue = getConstant("Klass::_lh_array_tag_type_value", Integer.class);
893 @HotSpotVMConstant(name = "Klass::_lh_array_tag_obj_value") @Stable public int layoutHelperArrayTagObjectValue; 187 public final int layoutHelperArrayTagObjectValue = getConstant("Klass::_lh_array_tag_obj_value", Integer.class);
894 188
895 /** 189 /**
896 * This filters out the bit that differentiates a type array from an object array. 190 * This filters out the bit that differentiates a type array from an object array.
897 */ 191 */
898 public int layoutHelperElementTypePrimitiveInPlace() { 192 public int layoutHelperElementTypePrimitiveInPlace() {
899 return (layoutHelperArrayTagTypeValue & ~layoutHelperArrayTagObjectValue) << layoutHelperArrayTagShift; 193 return (layoutHelperArrayTagTypeValue & ~layoutHelperArrayTagObjectValue) << layoutHelperArrayTagShift;
900 } 194 }
901 195
902 /** 196 // /**
903 * Bit pattern in the klass layout helper that can be used to identify arrays. 197 // * Bit pattern in the klass layout helper that can be used to identify arrays.
904 */ 198 // */
905 public final int arrayKlassLayoutHelperIdentifier = 0x80000000; 199 // public final int arrayKlassLayoutHelperIdentifier = 0x80000000;
906 200
907 @HotSpotVMField(name = "ArrayKlass::_component_mirror", type = "oop", get = HotSpotVMField.Type.OFFSET) @Stable int arrayKlassComponentMirrorOffset; 201 final int arrayKlassComponentMirrorOffset = getFieldOffset("ArrayKlass::_component_mirror", Integer.class, "oop");
908 202
909 @HotSpotVMType(name = "vtableEntry", get = HotSpotVMType.Type.SIZE) @Stable public int vtableEntrySize; 203 final int vtableEntrySize = getTypeSize("vtableEntry");
910 @HotSpotVMField(name = "vtableEntry::_method", type = "Method*", get = HotSpotVMField.Type.OFFSET) @Stable public int vtableEntryMethodOffset; 204 public final int vtableEntryMethodOffset = getFieldOffset("vtableEntry::_method", Integer.class, "Method*");
911 @HotSpotVMValue(expression = "InstanceKlass::vtable_start_offset() * HeapWordSize") @Stable public int instanceKlassVtableStartOffset; 205
912 @HotSpotVMValue(expression = "InstanceKlass::vtable_length_offset() * HeapWordSize") @Stable public int instanceKlassVtableLengthOffset; 206 // public final int arrayOopDescSize = getTypeSize("arrayOopDesc");
913 @HotSpotVMValue(expression = "Universe::base_vtable_size() / vtableEntry::size()") @Stable public int baseVtableLength; 207
914 208 // /**
915 /** 209 // * The offset of the array length word in an array object's header.
916 * The offset of the array length word in an array object's header. 210 // *
917 */ 211 // * See {@code arrayOopDesc::length_offset_in_bytes()}.
918 @HotSpotVMValue(expression = "arrayOopDesc::length_offset_in_bytes()") @Stable private int arrayLengthOffset; 212 // */
919 213 // public final int arrayOopDescLengthOffset() {
920 /** 214 // return useCompressedClassPointers ? hubOffset + narrowKlassSize : arrayOopDescSize;
921 * The offset of the array length word in an array object's header. 215 // }
922 * 216
923 * See {@code arrayOopDesc::length_offset_in_bytes()}. 217 public final int arrayU1LengthOffset = getFieldOffset("Array<int>::_length", Integer.class, "int");
924 */ 218 public final int arrayU1DataOffset = getFieldOffset("Array<u1>::_data", Integer.class);
925 public final int arrayOopDescLengthOffset() { 219 public final int arrayU2DataOffset = getFieldOffset("Array<u2>::_data", Integer.class);
926 return arrayLengthOffset; 220 public final int metaspaceArrayLengthOffset = getFieldOffset("Array<Klass*>::_length", Integer.class, "int");
927 } 221 public final int metaspaceArrayBaseOffset = getFieldOffset("Array<Klass*>::_data[0]", Integer.class, "Klass*");
928 222
929 @HotSpotVMField(name = "Array<int>::_length", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int arrayU1LengthOffset; 223 public final int instanceKlassSourceFileNameIndexOffset = getFieldOffset("InstanceKlass::_source_file_name_index", Integer.class, "u2");
930 @HotSpotVMField(name = "Array<u1>::_data", type = "", get = HotSpotVMField.Type.OFFSET) @Stable public int arrayU1DataOffset; 224 public final int instanceKlassInitStateOffset = getFieldOffset("InstanceKlass::_init_state", Integer.class, "u1");
931 @HotSpotVMField(name = "Array<u2>::_data", type = "", get = HotSpotVMField.Type.OFFSET) @Stable public int arrayU2DataOffset; 225 public final int instanceKlassConstantsOffset = getFieldOffset("InstanceKlass::_constants", Integer.class, "ConstantPool*");
932 @HotSpotVMField(name = "Array<Klass*>::_length", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int metaspaceArrayLengthOffset; 226 public final int instanceKlassFieldsOffset = getFieldOffset("InstanceKlass::_fields", Integer.class, "Array<u2>*");
933 @HotSpotVMField(name = "Array<Klass*>::_data[0]", type = "Klass*", get = HotSpotVMField.Type.OFFSET) @Stable public int metaspaceArrayBaseOffset; 227
934 228 public final int instanceKlassStateLinked = getConstant("InstanceKlass::linked", Integer.class);
935 @HotSpotVMField(name = "InstanceKlass::_source_file_name_index", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassSourceFileNameIndexOffset; 229 public final int instanceKlassStateFullyInitialized = getConstant("InstanceKlass::fully_initialized", Integer.class);
936 @HotSpotVMField(name = "InstanceKlass::_init_state", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassInitStateOffset; 230
937 @HotSpotVMField(name = "InstanceKlass::_constants", type = "ConstantPool*", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassConstantsOffset; 231 public final int arrayClassElementOffset = getFieldOffset("ObjArrayKlass::_element_klass", Integer.class, "Klass*");
938 @HotSpotVMField(name = "InstanceKlass::_fields", type = "Array<u2>*", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassFieldsOffset; 232
939 233 public final int fieldInfoAccessFlagsOffset = getConstant("FieldInfo::access_flags_offset", Integer.class);
940 @HotSpotVMConstant(name = "InstanceKlass::linked") @Stable public int instanceKlassStateLinked; 234 public final int fieldInfoNameIndexOffset = getConstant("FieldInfo::name_index_offset", Integer.class);
941 @HotSpotVMConstant(name = "InstanceKlass::fully_initialized") @Stable public int instanceKlassStateFullyInitialized; 235 public final int fieldInfoSignatureIndexOffset = getConstant("FieldInfo::signature_index_offset", Integer.class);
942 236 public final int fieldInfoInitvalIndexOffset = getConstant("FieldInfo::initval_index_offset", Integer.class);
943 @HotSpotVMField(name = "ObjArrayKlass::_element_klass", type = "Klass*", get = HotSpotVMField.Type.OFFSET) @Stable public int arrayClassElementOffset; 237 public final int fieldInfoLowPackedOffset = getConstant("FieldInfo::low_packed_offset", Integer.class);
944 238 public final int fieldInfoHighPackedOffset = getConstant("FieldInfo::high_packed_offset", Integer.class);
945 @HotSpotVMConstant(name = "FieldInfo::access_flags_offset") @Stable public int fieldInfoAccessFlagsOffset; 239 public final int fieldInfoFieldSlots = getConstant("FieldInfo::field_slots", Integer.class);
946 @HotSpotVMConstant(name = "FieldInfo::name_index_offset") @Stable public int fieldInfoNameIndexOffset; 240
947 @HotSpotVMConstant(name = "FieldInfo::signature_index_offset") @Stable public int fieldInfoSignatureIndexOffset; 241 public final int fieldInfoTagSize = getConstant("FIELDINFO_TAG_SIZE", Integer.class);
948 @HotSpotVMConstant(name = "FieldInfo::initval_index_offset") @Stable public int fieldInfoInitvalIndexOffset; 242
949 @HotSpotVMConstant(name = "FieldInfo::low_packed_offset") @Stable public int fieldInfoLowPackedOffset; 243 public final int jvmAccFieldInternal = getConstant("JVM_ACC_FIELD_INTERNAL", Integer.class);
950 @HotSpotVMConstant(name = "FieldInfo::high_packed_offset") @Stable public int fieldInfoHighPackedOffset; 244 public final int jvmAccFieldStable = getConstant("JVM_ACC_FIELD_STABLE", Integer.class);
951 @HotSpotVMConstant(name = "FieldInfo::field_slots") @Stable public int fieldInfoFieldSlots; 245 public final int jvmAccFieldHasGenericSignature = getConstant("JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE", Integer.class);
952 246 public final int jvmAccWrittenFlags = getConstant("JVM_ACC_WRITTEN_FLAGS", Integer.class);
953 @HotSpotVMConstant(name = "FIELDINFO_TAG_SIZE") @Stable public int fieldInfoTagSize; 247 public final int jvmAccIsCloneable = getConstant("JVM_ACC_IS_CLONEABLE", Integer.class);
954 248
955 @HotSpotVMConstant(name = "JVM_ACC_FIELD_INTERNAL") @Stable public int jvmAccFieldInternal; 249 // public final int threadTlabOffset = getFieldOffset("Thread::_tlab", Integer.class,
956 @HotSpotVMConstant(name = "JVM_ACC_FIELD_STABLE") @Stable public int jvmAccFieldStable; 250 // "ThreadLocalAllocBuffer");
957 @HotSpotVMConstant(name = "JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE") @Stable public int jvmAccFieldHasGenericSignature; 251
958 @HotSpotVMConstant(name = "JVM_ACC_WRITTEN_FLAGS") @Stable public int jvmAccWrittenFlags; 252 // public final int javaThreadAnchorOffset = getFieldOffset("JavaThread::_anchor", Integer.class,
959 @HotSpotVMConstant(name = "JVM_ACC_IS_CLONEABLE") @Stable public int jvmAccIsCloneable; 253 // "JavaFrameAnchor");
960 254 // public final int threadObjectOffset = getFieldOffset("JavaThread::_threadObj", Integer.class,
961 @HotSpotVMField(name = "Thread::_tlab", type = "ThreadLocalAllocBuffer", get = HotSpotVMField.Type.OFFSET) @Stable public int threadTlabOffset; 255 // "oop");
962 256 // public final int osThreadOffset = getFieldOffset("JavaThread::_osthread", Integer.class,
963 @HotSpotVMField(name = "JavaThread::_anchor", type = "JavaFrameAnchor", get = HotSpotVMField.Type.OFFSET) @Stable public int javaThreadAnchorOffset; 257 // "OSThread*");
964 @HotSpotVMField(name = "JavaThread::_threadObj", type = "oop", get = HotSpotVMField.Type.OFFSET) @Stable public int threadObjectOffset; 258 // public final int javaThreadDirtyCardQueueOffset = getFieldOffset("JavaThread::_dirty_card_queue",
965 @HotSpotVMField(name = "JavaThread::_osthread", type = "OSThread*", get = HotSpotVMField.Type.OFFSET) @Stable public int osThreadOffset; 259 // Integer.class, "DirtyCardQueue");
966 @HotSpotVMField(name = "JavaThread::_dirty_card_queue", type = "DirtyCardQueue", get = HotSpotVMField.Type.OFFSET) @Stable public int javaThreadDirtyCardQueueOffset; 260 // public final int threadIsMethodHandleReturnOffset =
967 @HotSpotVMField(name = "JavaThread::_is_method_handle_return", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int threadIsMethodHandleReturnOffset; 261 // getFieldOffset("JavaThread::_is_method_handle_return", Integer.class, "int");
968 @HotSpotVMField(name = "JavaThread::_satb_mark_queue", type = "ObjPtrQueue", get = HotSpotVMField.Type.OFFSET) @Stable public int javaThreadSatbMarkQueueOffset; 262 // public final int javaThreadSatbMarkQueueOffset = getFieldOffset("JavaThread::_satb_mark_queue",
969 @HotSpotVMField(name = "JavaThread::_vm_result", type = "oop", get = HotSpotVMField.Type.OFFSET) @Stable public int threadObjectResultOffset; 263 // Integer.class, "ObjPtrQueue");
970 @HotSpotVMValue(expression = "in_bytes(JavaThread::jvmci_counters_offset())") @Stable public int jvmciCountersThreadOffset; 264 // public final int threadObjectResultOffset = getFieldOffset("JavaThread::_vm_result",
971 265 // Integer.class, "oop");
972 /** 266 // public final int jvmciCountersThreadOffset = getFieldOffset("JavaThread::_jvmci_counters",
973 * An invalid value for {@link #rtldDefault}. 267 // Integer.class, "jlong*");
974 */ 268
975 public static final long INVALID_RTLD_DEFAULT_HANDLE = 0xDEADFACE; 269 // /**
976 270 // * This field is used to pass exception objects into and out of the runtime system during
977 /** 271 // * exception handling for compiled code.
978 * Address of the library lookup routine. The C signature of this routine is: 272 // */
979 * 273 // public final int threadExceptionOopOffset = getFieldOffset("JavaThread::_exception_oop",
980 * <pre> 274 // Integer.class, "oop");
981 * void* (const char *filename, char *ebuf, int ebuflen) 275 // public final int threadExceptionPcOffset = getFieldOffset("JavaThread::_exception_pc",
982 * </pre> 276 // Integer.class, "address");
983 */ 277 // public final int pendingExceptionOffset = getFieldOffset("ThreadShadow::_pending_exception",
984 @HotSpotVMValue(expression = "os::dll_load", get = HotSpotVMValue.Type.ADDRESS) @Stable public long dllLoad; 278 // Integer.class, "oop");
985 279 //
986 /** 280 // public final int pendingDeoptimizationOffset =
987 * Address of the library lookup routine. The C signature of this routine is: 281 // getFieldOffset("JavaThread::_pending_deoptimization", Integer.class, "int");
988 * 282 // public final int pendingFailedSpeculationOffset =
989 * <pre> 283 // getFieldOffset("JavaThread::_pending_failed_speculation", Integer.class, "oop");
990 * void* (void* handle, const char* name) 284 // public final int pendingTransferToInterpreterOffset =
991 * </pre> 285 // getFieldOffset("JavaThread::_pending_transfer_to_interpreter", Integer.class, "bool");
992 */ 286 //
993 @HotSpotVMValue(expression = "os::dll_lookup", get = HotSpotVMValue.Type.ADDRESS) @Stable public long dllLookup; 287 // private final int javaFrameAnchorLastJavaSpOffset =
994 288 // getFieldOffset("JavaFrameAnchor::_last_Java_sp", Integer.class, "intptr_t*");
995 /** 289 // private final int javaFrameAnchorLastJavaPcOffset =
996 * A pseudo-handle which when used as the first argument to {@link #dllLookup} means lookup will 290 // getFieldOffset("JavaFrameAnchor::_last_Java_pc", Integer.class, "address");
997 * return the first occurrence of the desired symbol using the default library search order. If 291 // private final int javaFrameAnchorLastJavaFpOffset =
998 * this field is {@value #INVALID_RTLD_DEFAULT_HANDLE}, then this capability is not supported on 292 // getFieldOffset("JavaFrameAnchor::_last_Java_fp", Integer.class, "intptr_t*",
999 * the current platform. 293 // osArch.equals("aarch64") || osArch.equals("amd64") ? null : Integer.MAX_VALUE);
1000 */ 294 // private final int javaFrameAnchorFlagsOffset = getFieldOffset("JavaFrameAnchor::_flags",
1001 @HotSpotVMValue(expression = "RTLD_DEFAULT", defines = {"TARGET_OS_FAMILY_bsd", 295 // Integer.class, "int", sparcRequiredInt);
1002 "TARGET_OS_FAMILY_linux"}, get = HotSpotVMValue.Type.ADDRESS) @Stable public long rtldDefault = INVALID_RTLD_DEFAULT_HANDLE; 296
1003 297 // public int threadLastJavaSpOffset() {
1004 /** 298 // return javaThreadAnchorOffset + javaFrameAnchorLastJavaSpOffset;
1005 * This field is used to pass exception objects into and out of the runtime system during 299 // }
1006 * exception handling for compiled code. 300 //
1007 */ 301 // public int threadLastJavaPcOffset() {
1008 @HotSpotVMField(name = "JavaThread::_exception_oop", type = "oop", get = HotSpotVMField.Type.OFFSET) @Stable public int threadExceptionOopOffset; 302 // return javaThreadAnchorOffset + javaFrameAnchorLastJavaPcOffset;
1009 @HotSpotVMField(name = "JavaThread::_exception_pc", type = "address", get = HotSpotVMField.Type.OFFSET) @Stable public int threadExceptionPcOffset; 303 // }
1010 @HotSpotVMField(name = "ThreadShadow::_pending_exception", type = "oop", get = HotSpotVMField.Type.OFFSET) @Stable public int pendingExceptionOffset; 304
1011 305 // /**
1012 @HotSpotVMField(name = "JavaThread::_pending_deoptimization", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int pendingDeoptimizationOffset; 306 // * This value is only valid on AMD64.
1013 @HotSpotVMField(name = "JavaThread::_pending_failed_speculation", type = "oop", get = HotSpotVMField.Type.OFFSET) @Stable public int pendingFailedSpeculationOffset; 307 // */
1014 @HotSpotVMField(name = "JavaThread::_pending_transfer_to_interpreter", type = "bool", get = HotSpotVMField.Type.OFFSET) @Stable public int pendingTransferToInterpreterOffset; 308 // public int threadLastJavaFpOffset() {
1015 309 // // TODO add an assert for AMD64
1016 @HotSpotVMField(name = "JavaFrameAnchor::_last_Java_sp", type = "intptr_t*", get = HotSpotVMField.Type.OFFSET) @Stable private int javaFrameAnchorLastJavaSpOffset; 310 // return javaThreadAnchorOffset + javaFrameAnchorLastJavaFpOffset;
1017 @HotSpotVMField(name = "JavaFrameAnchor::_last_Java_pc", type = "address", get = HotSpotVMField.Type.OFFSET) @Stable private int javaFrameAnchorLastJavaPcOffset; 311 // }
1018 @HotSpotVMField(name = "JavaFrameAnchor::_last_Java_fp", type = "intptr_t*", get = HotSpotVMField.Type.OFFSET, archs = {"amd64"}) @Stable private int javaFrameAnchorLastJavaFpOffset; 312 //
1019 @HotSpotVMField(name = "JavaFrameAnchor::_flags", type = "int", get = HotSpotVMField.Type.OFFSET, archs = {"sparc"}) @Stable private int javaFrameAnchorFlagsOffset; 313 // /**
1020 314 // * This value is only valid on SPARC.
1021 public int threadLastJavaSpOffset() { 315 // */
1022 return javaThreadAnchorOffset + javaFrameAnchorLastJavaSpOffset; 316 // public int threadJavaFrameAnchorFlagsOffset() {
1023 } 317 // // TODO add an assert for SPARC
1024 318 // return javaThreadAnchorOffset + javaFrameAnchorFlagsOffset;
1025 public int threadLastJavaPcOffset() { 319 // }
1026 return javaThreadAnchorOffset + javaFrameAnchorLastJavaPcOffset;
1027 }
1028
1029 /**
1030 * This value is only valid on AMD64.
1031 */
1032 public int threadLastJavaFpOffset() {
1033 // TODO add an assert for AMD64
1034 return javaThreadAnchorOffset + javaFrameAnchorLastJavaFpOffset;
1035 }
1036
1037 /**
1038 * This value is only valid on SPARC.
1039 */
1040 public int threadJavaFrameAnchorFlagsOffset() {
1041 // TODO add an assert for SPARC
1042 return javaThreadAnchorOffset + javaFrameAnchorFlagsOffset;
1043 }
1044 320
1045 // These are only valid on AMD64. 321 // These are only valid on AMD64.
1046 @HotSpotVMConstant(name = "frame::arg_reg_save_area_bytes", archs = {"amd64"}) @Stable public int runtimeCallStackSize; 322 public final int runtimeCallStackSize = getConstant("frame::arg_reg_save_area_bytes", Integer.class, amd64RequiredInt);
1047 @HotSpotVMConstant(name = "frame::interpreter_frame_sender_sp_offset", archs = {"amd64"}) @Stable public int frameInterpreterFrameSenderSpOffset; 323 // public final int frameInterpreterFrameSenderSpOffset =
1048 @HotSpotVMConstant(name = "frame::interpreter_frame_last_sp_offset", archs = {"amd64"}) @Stable public int frameInterpreterFrameLastSpOffset; 324 // getConstant("frame::interpreter_frame_sender_sp_offset", Integer.class, amd64RequiredInt);
1049 325 // public final int frameInterpreterFrameLastSpOffset =
1050 @HotSpotVMField(name = "PtrQueue::_active", type = "bool", get = HotSpotVMField.Type.OFFSET) @Stable public int ptrQueueActiveOffset; 326 // getConstant("frame::interpreter_frame_last_sp_offset", Integer.class, amd64RequiredInt);
1051 @HotSpotVMField(name = "PtrQueue::_buf", type = "void**", get = HotSpotVMField.Type.OFFSET) @Stable public int ptrQueueBufferOffset; 327 //
1052 @HotSpotVMField(name = "PtrQueue::_index", type = "size_t", get = HotSpotVMField.Type.OFFSET) @Stable public int ptrQueueIndexOffset; 328 // public final int ptrQueueActiveOffset = getFieldOffset("PtrQueue::_active", Integer.class,
1053 329 // "bool");
1054 @HotSpotVMField(name = "OSThread::_interrupted", type = "jint", get = HotSpotVMField.Type.OFFSET) @Stable public int osThreadInterruptedOffset; 330 // public final int ptrQueueBufferOffset = getFieldOffset("PtrQueue::_buf", Integer.class,
1055 331 // "void**");
1056 @HotSpotVMConstant(name = "markOopDesc::unlocked_value") @Stable public int unlockedMask; 332 // public final int ptrQueueIndexOffset = getFieldOffset("PtrQueue::_index", Integer.class,
1057 @HotSpotVMConstant(name = "markOopDesc::biased_lock_mask_in_place") @Stable public int biasedLockMaskInPlace; 333 // "size_t");
1058 @HotSpotVMConstant(name = "markOopDesc::age_mask_in_place") @Stable public int ageMaskInPlace; 334 //
1059 @HotSpotVMConstant(name = "markOopDesc::epoch_mask_in_place") @Stable public int epochMaskInPlace; 335 // public final int osThreadInterruptedOffset = getFieldOffset("OSThread::_interrupted",
1060 336 // Integer.class, "jint");
1061 @HotSpotVMConstant(name = "markOopDesc::hash_shift") @Stable public long markOopDescHashShift; 337 //
1062 @HotSpotVMConstant(name = "markOopDesc::hash_mask") @Stable public long markOopDescHashMask; 338 // public final int unlockedMask = getConstant("markOopDesc::unlocked_value", Integer.class);
1063 @HotSpotVMConstant(name = "markOopDesc::hash_mask_in_place") @Stable public long markOopDescHashMaskInPlace; 339 // public final int biasedLockMaskInPlace = getConstant("markOopDesc::biased_lock_mask_in_place",
1064 340 // Integer.class);
1065 @HotSpotVMConstant(name = "markOopDesc::biased_lock_pattern") @Stable public int biasedLockPattern; 341 // public final int ageMaskInPlace = getConstant("markOopDesc::age_mask_in_place", Integer.class);
1066 @HotSpotVMConstant(name = "markOopDesc::no_hash_in_place") @Stable public int markWordNoHashInPlace; 342 // public final int epochMaskInPlace = getConstant("markOopDesc::epoch_mask_in_place",
1067 @HotSpotVMConstant(name = "markOopDesc::no_lock_in_place") @Stable public int markWordNoLockInPlace; 343 // Integer.class);
344
345 // public final long markOopDescHashShift = getConstant("markOopDesc::hash_shift", Long.class);
346 // public final long markOopDescHashMask = getConstant("markOopDesc::hash_mask", Long.class);
347 // public final long markOopDescHashMaskInPlace = getConstant("markOopDesc::hash_mask_in_place",
348 // Long.class);
349 //
350 // public final int biasedLockPattern = getConstant("markOopDesc::biased_lock_pattern",
351 // Integer.class);
352 public final int markWordNoHashInPlace = getConstant("markOopDesc::no_hash_in_place", Integer.class);
353 public final int markWordNoLockInPlace = getConstant("markOopDesc::no_lock_in_place", Integer.class);
1068 354
1069 /** 355 /**
1070 * See markOopDesc::prototype(). 356 * See markOopDesc::prototype().
1071 */ 357 */
1072 public long arrayPrototypeMarkWord() { 358 public long arrayPrototypeMarkWord() {
1073 return markWordNoHashInPlace | markWordNoLockInPlace; 359 return markWordNoHashInPlace | markWordNoLockInPlace;
1074 } 360 }
1075 361
1076 /** 362 // /**
1077 * See markOopDesc::copy_set_hash(). 363 // * See markOopDesc::copy_set_hash().
1078 */ 364 // */
1079 public long tlabIntArrayMarkWord() { 365 // public long tlabIntArrayMarkWord() {
1080 long tmp = arrayPrototypeMarkWord() & (~markOopDescHashMaskInPlace); 366 // long tmp = arrayPrototypeMarkWord() & (~markOopDescHashMaskInPlace);
1081 tmp |= ((0x2 & markOopDescHashMask) << markOopDescHashShift); 367 // tmp |= ((0x2 & markOopDescHashMask) << markOopDescHashShift);
1082 return tmp; 368 // return tmp;
1083 } 369 // }
1084 370
1085 /** 371 // /**
1086 * Mark word right shift to get identity hash code. 372 // * Mark word right shift to get identity hash code.
1087 */ 373 // */
1088 @HotSpotVMConstant(name = "markOopDesc::hash_shift") @Stable public int identityHashCodeShift; 374 // public final int identityHashCodeShift = getConstant("markOopDesc::hash_shift", Integer.class);
1089 375
1090 /** 376 // /**
1091 * Identity hash code value when uninitialized. 377 // * Identity hash code value when uninitialized.
1092 */ 378 // */
1093 @HotSpotVMConstant(name = "markOopDesc::no_hash") @Stable public int uninitializedIdentityHashCodeValue; 379 // public final int uninitializedIdentityHashCodeValue = getConstant("markOopDesc::no_hash",
1094 380 // Integer.class);
1095 @HotSpotVMField(name = "Method::_access_flags", type = "AccessFlags", get = HotSpotVMField.Type.OFFSET) @Stable public int methodAccessFlagsOffset; 381
1096 @HotSpotVMField(name = "Method::_constMethod", type = "ConstMethod*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodConstMethodOffset; 382 public final int methodAccessFlagsOffset = getFieldOffset("Method::_access_flags", Integer.class, "AccessFlags");
1097 @HotSpotVMField(name = "Method::_intrinsic_id", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int methodIntrinsicIdOffset; 383 public final int methodConstMethodOffset = getFieldOffset("Method::_constMethod", Integer.class, "ConstMethod*");
1098 @HotSpotVMField(name = "Method::_flags", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int methodFlagsOffset; 384 public final int methodIntrinsicIdOffset = getFieldOffset("Method::_intrinsic_id", Integer.class, "u1");
1099 @HotSpotVMField(name = "Method::_vtable_index", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodVtableIndexOffset; 385 public final int methodFlagsOffset = getFieldOffset("Method::_flags", Integer.class, "u1");
1100 386 public final int methodVtableIndexOffset = getFieldOffset("Method::_vtable_index", Integer.class, "int");
1101 @HotSpotVMConstant(name = "Method::_jfr_towrite") @Stable public int methodFlagsJfrTowrite; 387
1102 @HotSpotVMConstant(name = "Method::_caller_sensitive") @Stable public int methodFlagsCallerSensitive; 388 // public final int methodFlagsJfrTowrite = getConstant("Method::_jfr_towrite", Integer.class);
1103 @HotSpotVMConstant(name = "Method::_force_inline") @Stable public int methodFlagsForceInline; 389 public final int methodFlagsCallerSensitive = getConstant("Method::_caller_sensitive", Integer.class);
1104 @HotSpotVMConstant(name = "Method::_dont_inline") @Stable public int methodFlagsDontInline; 390 public final int methodFlagsForceInline = getConstant("Method::_force_inline", Integer.class);
1105 @HotSpotVMConstant(name = "Method::_hidden") @Stable public int methodFlagsHidden; 391 public final int methodFlagsDontInline = getConstant("Method::_dont_inline", Integer.class);
1106 @HotSpotVMConstant(name = "Method::nonvirtual_vtable_index") @Stable public int nonvirtualVtableIndex; 392 // public final int methodFlagsHidden = getConstant("Method::_hidden", Integer.class);
1107 @HotSpotVMConstant(name = "Method::invalid_vtable_index") @Stable public int invalidVtableIndex; 393 public final int nonvirtualVtableIndex = getConstant("Method::nonvirtual_vtable_index", Integer.class);
1108 394 public final int invalidVtableIndex = getConstant("Method::invalid_vtable_index", Integer.class);
1109 @HotSpotVMConstant(name = "InvocationEntryBci") @Stable public int invocationEntryBci; 395
1110 396 public final int invocationEntryBci = getConstant("InvocationEntryBci", Integer.class);
1111 @HotSpotVMField(name = "JVMCIEnv::_task", type = "CompileTask*", get = HotSpotVMField.Type.OFFSET) @Stable public int jvmciEnvTaskOffset; 397
1112 @HotSpotVMField(name = "JVMCIEnv::_jvmti_can_hotswap_or_post_breakpoint", type = "bool", get = HotSpotVMField.Type.OFFSET) @Stable public int jvmciEnvJvmtiCanHotswapOrPostBreakpointOffset; 398 // public final int jvmciEnvTaskOffset = getFieldOffset("JVMCIEnv::_task", Integer.class,
1113 @HotSpotVMField(name = "CompileTask::_num_inlined_bytecodes", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int compileTaskNumInlinedBytecodesOffset; 399 // "CompileTask*");
400 // public final int jvmciEnvJvmtiCanHotswapOrPostBreakpointOffset =
401 // getFieldOffset("JVMCIEnv::_jvmti_can_hotswap_or_post_breakpoint", Integer.class, "bool");
402 // public final int compileTaskNumInlinedBytecodesOffset =
403 // getFieldOffset("CompileTask::_num_inlined_bytecodes", Integer.class, "int");
1114 404
1115 /** 405 /**
1116 * Value of Method::extra_stack_entries(). 406 * Value of Method::extra_stack_entries().
1117 */ 407 */
1118 @HotSpotVMValue(expression = "Method::extra_stack_entries()") @Stable public int extraStackEntries; 408 public final int extraStackEntries = getFieldValue("CompilerToVM::Data::Method_extra_stack_entries", Integer.class, "int");
1119 409
1120 @HotSpotVMField(name = "ConstMethod::_constants", type = "ConstantPool*", get = HotSpotVMField.Type.OFFSET) @Stable public int constMethodConstantsOffset; 410 public final int constMethodConstantsOffset = getFieldOffset("ConstMethod::_constants", Integer.class, "ConstantPool*");
1121 @HotSpotVMField(name = "ConstMethod::_flags", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int constMethodFlagsOffset; 411 public final int constMethodFlagsOffset = getFieldOffset("ConstMethod::_flags", Integer.class, "u2");
1122 @HotSpotVMField(name = "ConstMethod::_code_size", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int constMethodCodeSizeOffset; 412 public final int constMethodCodeSizeOffset = getFieldOffset("ConstMethod::_code_size", Integer.class, "u2");
1123 @HotSpotVMField(name = "ConstMethod::_name_index", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int constMethodNameIndexOffset; 413 public final int constMethodNameIndexOffset = getFieldOffset("ConstMethod::_name_index", Integer.class, "u2");
1124 @HotSpotVMField(name = "ConstMethod::_signature_index", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int constMethodSignatureIndexOffset; 414 public final int constMethodSignatureIndexOffset = getFieldOffset("ConstMethod::_signature_index", Integer.class, "u2");
1125 @HotSpotVMField(name = "ConstMethod::_max_stack", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int constMethodMaxStackOffset; 415 public final int constMethodMaxStackOffset = getFieldOffset("ConstMethod::_max_stack", Integer.class, "u2");
1126 @HotSpotVMField(name = "ConstMethod::_max_locals", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int methodMaxLocalsOffset; 416 public final int methodMaxLocalsOffset = getFieldOffset("ConstMethod::_max_locals", Integer.class, "u2");
1127 417
1128 @HotSpotVMConstant(name = "ConstMethod::_has_linenumber_table") @Stable public int constMethodHasLineNumberTable; 418 public final int constMethodHasLineNumberTable = getConstant("ConstMethod::_has_linenumber_table", Integer.class);
1129 @HotSpotVMConstant(name = "ConstMethod::_has_localvariable_table") @Stable public int constMethodHasLocalVariableTable; 419 public final int constMethodHasLocalVariableTable = getConstant("ConstMethod::_has_localvariable_table", Integer.class);
1130 @HotSpotVMConstant(name = "ConstMethod::_has_exception_table") @Stable public int constMethodHasExceptionTable; 420 public final int constMethodHasExceptionTable = getConstant("ConstMethod::_has_exception_table", Integer.class);
1131 421
1132 @HotSpotVMType(name = "ExceptionTableElement", get = HotSpotVMType.Type.SIZE) @Stable public int exceptionTableElementSize; 422 final int exceptionTableElementSize = getTypeSize("ExceptionTableElement");
1133 @HotSpotVMField(name = "ExceptionTableElement::start_pc", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int exceptionTableElementStartPcOffset; 423 public final int exceptionTableElementStartPcOffset = getFieldOffset("ExceptionTableElement::start_pc", Integer.class, "u2");
1134 @HotSpotVMField(name = "ExceptionTableElement::end_pc", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int exceptionTableElementEndPcOffset; 424 public final int exceptionTableElementEndPcOffset = getFieldOffset("ExceptionTableElement::end_pc", Integer.class, "u2");
1135 @HotSpotVMField(name = "ExceptionTableElement::handler_pc", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int exceptionTableElementHandlerPcOffset; 425 public final int exceptionTableElementHandlerPcOffset = getFieldOffset("ExceptionTableElement::handler_pc", Integer.class, "u2");
1136 @HotSpotVMField(name = "ExceptionTableElement::catch_type_index", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int exceptionTableElementCatchTypeIndexOffset; 426 public final int exceptionTableElementCatchTypeIndexOffset = getFieldOffset("ExceptionTableElement::catch_type_index", Integer.class, "u2");
1137 427
1138 @HotSpotVMType(name = "LocalVariableTableElement", get = HotSpotVMType.Type.SIZE) @Stable public int localVariableTableElementSize; 428 final int localVariableTableElementSize = getTypeSize("LocalVariableTableElement");
1139 @HotSpotVMField(name = "LocalVariableTableElement::start_bci", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int localVariableTableElementStartBciOffset; 429 public final int localVariableTableElementStartBciOffset = getFieldOffset("LocalVariableTableElement::start_bci", Integer.class, "u2");
1140 @HotSpotVMField(name = "LocalVariableTableElement::length", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int localVariableTableElementLengthOffset; 430 public final int localVariableTableElementLengthOffset = getFieldOffset("LocalVariableTableElement::length", Integer.class, "u2");
1141 @HotSpotVMField(name = "LocalVariableTableElement::name_cp_index", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int localVariableTableElementNameCpIndexOffset; 431 public final int localVariableTableElementNameCpIndexOffset = getFieldOffset("LocalVariableTableElement::name_cp_index", Integer.class, "u2");
1142 @HotSpotVMField(name = "LocalVariableTableElement::descriptor_cp_index", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int localVariableTableElementDescriptorCpIndexOffset; 432 public final int localVariableTableElementDescriptorCpIndexOffset = getFieldOffset("LocalVariableTableElement::descriptor_cp_index", Integer.class, "u2");
1143 @HotSpotVMField(name = "LocalVariableTableElement::signature_cp_index", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int localVariableTableElementSignatureCpIndexOffset; 433 public final int localVariableTableElementSignatureCpIndexOffset = getFieldOffset("LocalVariableTableElement::signature_cp_index", Integer.class, "u2");
1144 @HotSpotVMField(name = "LocalVariableTableElement::slot", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int localVariableTableElementSlotOffset; 434 public final int localVariableTableElementSlotOffset = getFieldOffset("LocalVariableTableElement::slot", Integer.class, "u2");
1145 435
1146 @HotSpotVMType(name = "ConstantPool", get = HotSpotVMType.Type.SIZE) @Stable public int constantPoolSize; 436 final int constantPoolSize = getTypeSize("ConstantPool");
1147 @HotSpotVMField(name = "ConstantPool::_tags", type = "Array<u1>*", get = HotSpotVMField.Type.OFFSET) @Stable public int constantPoolTagsOffset; 437 public final int constantPoolTagsOffset = getFieldOffset("ConstantPool::_tags", Integer.class, "Array<u1>*");
1148 @HotSpotVMField(name = "ConstantPool::_pool_holder", type = "InstanceKlass*", get = HotSpotVMField.Type.OFFSET) @Stable public int constantPoolHolderOffset; 438 public final int constantPoolHolderOffset = getFieldOffset("ConstantPool::_pool_holder", Integer.class, "InstanceKlass*");
1149 @HotSpotVMField(name = "ConstantPool::_length", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int constantPoolLengthOffset; 439 public final int constantPoolLengthOffset = getFieldOffset("ConstantPool::_length", Integer.class, "int");
1150 440
1151 @HotSpotVMConstant(name = "ConstantPool::CPCACHE_INDEX_TAG") @Stable public int constantPoolCpCacheIndexTag; 441 public final int constantPoolCpCacheIndexTag = getConstant("ConstantPool::CPCACHE_INDEX_TAG", Integer.class);
1152 442
1153 @HotSpotVMConstant(name = "JVM_CONSTANT_Utf8") @Stable public int jvmConstantUtf8; 443 public final int jvmConstantUtf8 = getConstant("JVM_CONSTANT_Utf8", Integer.class);
1154 @HotSpotVMConstant(name = "JVM_CONSTANT_Integer") @Stable public int jvmConstantInteger; 444 public final int jvmConstantInteger = getConstant("JVM_CONSTANT_Integer", Integer.class);
1155 @HotSpotVMConstant(name = "JVM_CONSTANT_Long") @Stable public int jvmConstantLong; 445 public final int jvmConstantLong = getConstant("JVM_CONSTANT_Long", Integer.class);
1156 @HotSpotVMConstant(name = "JVM_CONSTANT_Float") @Stable public int jvmConstantFloat; 446 public final int jvmConstantFloat = getConstant("JVM_CONSTANT_Float", Integer.class);
1157 @HotSpotVMConstant(name = "JVM_CONSTANT_Double") @Stable public int jvmConstantDouble; 447 public final int jvmConstantDouble = getConstant("JVM_CONSTANT_Double", Integer.class);
1158 @HotSpotVMConstant(name = "JVM_CONSTANT_Class") @Stable public int jvmConstantClass; 448 public final int jvmConstantClass = getConstant("JVM_CONSTANT_Class", Integer.class);
1159 @HotSpotVMConstant(name = "JVM_CONSTANT_UnresolvedClass") @Stable public int jvmConstantUnresolvedClass; 449 public final int jvmConstantUnresolvedClass = getConstant("JVM_CONSTANT_UnresolvedClass", Integer.class);
1160 @HotSpotVMConstant(name = "JVM_CONSTANT_UnresolvedClassInError") @Stable public int jvmConstantUnresolvedClassInError; 450 public final int jvmConstantUnresolvedClassInError = getConstant("JVM_CONSTANT_UnresolvedClassInError", Integer.class);
1161 @HotSpotVMConstant(name = "JVM_CONSTANT_String") @Stable public int jvmConstantString; 451 public final int jvmConstantString = getConstant("JVM_CONSTANT_String", Integer.class);
1162 @HotSpotVMConstant(name = "JVM_CONSTANT_Fieldref") @Stable public int jvmConstantFieldref; 452 public final int jvmConstantFieldref = getConstant("JVM_CONSTANT_Fieldref", Integer.class);
1163 @HotSpotVMConstant(name = "JVM_CONSTANT_Methodref") @Stable public int jvmConstantMethodref; 453 public final int jvmConstantMethodref = getConstant("JVM_CONSTANT_Methodref", Integer.class);
1164 @HotSpotVMConstant(name = "JVM_CONSTANT_InterfaceMethodref") @Stable public int jvmConstantInterfaceMethodref; 454 public final int jvmConstantInterfaceMethodref = getConstant("JVM_CONSTANT_InterfaceMethodref", Integer.class);
1165 @HotSpotVMConstant(name = "JVM_CONSTANT_NameAndType") @Stable public int jvmConstantNameAndType; 455 public final int jvmConstantNameAndType = getConstant("JVM_CONSTANT_NameAndType", Integer.class);
1166 @HotSpotVMConstant(name = "JVM_CONSTANT_MethodHandle") @Stable public int jvmConstantMethodHandle; 456 public final int jvmConstantMethodHandle = getConstant("JVM_CONSTANT_MethodHandle", Integer.class);
1167 @HotSpotVMConstant(name = "JVM_CONSTANT_MethodHandleInError") @Stable public int jvmConstantMethodHandleInError; 457 public final int jvmConstantMethodHandleInError = getConstant("JVM_CONSTANT_MethodHandleInError", Integer.class);
1168 @HotSpotVMConstant(name = "JVM_CONSTANT_MethodType") @Stable public int jvmConstantMethodType; 458 public final int jvmConstantMethodType = getConstant("JVM_CONSTANT_MethodType", Integer.class);
1169 @HotSpotVMConstant(name = "JVM_CONSTANT_MethodTypeInError") @Stable public int jvmConstantMethodTypeInError; 459 public final int jvmConstantMethodTypeInError = getConstant("JVM_CONSTANT_MethodTypeInError", Integer.class);
1170 @HotSpotVMConstant(name = "JVM_CONSTANT_InvokeDynamic") @Stable public int jvmConstantInvokeDynamic; 460 public final int jvmConstantInvokeDynamic = getConstant("JVM_CONSTANT_InvokeDynamic", Integer.class);
1171 461
1172 @HotSpotVMConstant(name = "JVM_CONSTANT_ExternalMax") @Stable public int jvmConstantExternalMax; 462 public final int jvmConstantExternalMax = getConstant("JVM_CONSTANT_ExternalMax", Integer.class);
1173 @HotSpotVMConstant(name = "JVM_CONSTANT_InternalMin") @Stable public int jvmConstantInternalMin; 463 public final int jvmConstantInternalMin = getConstant("JVM_CONSTANT_InternalMin", Integer.class);
1174 @HotSpotVMConstant(name = "JVM_CONSTANT_InternalMax") @Stable public int jvmConstantInternalMax; 464 public final int jvmConstantInternalMax = getConstant("JVM_CONSTANT_InternalMax", Integer.class);
1175 465
1176 @HotSpotVMConstant(name = "HeapWordSize") @Stable public int heapWordSize; 466 public final int heapWordSize = getConstant("HeapWordSize", Integer.class);
1177 467
1178 @HotSpotVMType(name = "Symbol*", get = HotSpotVMType.Type.SIZE) @Stable public int symbolPointerSize; 468 final int symbolPointerSize = getTypeSize("Symbol*");
1179 @HotSpotVMField(name = "Symbol::_length", type = "unsigned short", get = HotSpotVMField.Type.OFFSET) @Stable public int symbolLengthOffset; 469 public final int symbolLengthOffset = getFieldOffset("Symbol::_length", Integer.class, "unsigned short");
1180 @HotSpotVMField(name = "Symbol::_body[0]", type = "jbyte", get = HotSpotVMField.Type.OFFSET) @Stable public int symbolBodyOffset; 470 public final int symbolBodyOffset = getFieldOffset("Symbol::_body[0]", Integer.class, "jbyte");
1181 471
1182 @HotSpotVMField(name = "vmSymbols::_symbols[0]", type = "Symbol*", get = HotSpotVMField.Type.ADDRESS) @Stable public long vmSymbolsSymbols; 472 public final long vmSymbolsSymbols = getFieldAddress("vmSymbols::_symbols[0]", "Symbol*");
1183 @HotSpotVMConstant(name = "vmSymbols::FIRST_SID") @Stable public int vmSymbolsFirstSID; 473 public final int vmSymbolsFirstSID = getConstant("vmSymbols::FIRST_SID", Integer.class);
1184 @HotSpotVMConstant(name = "vmSymbols::SID_LIMIT") @Stable public int vmSymbolsSIDLimit; 474 public final int vmSymbolsSIDLimit = getConstant("vmSymbols::SID_LIMIT", Integer.class);
1185 475
1186 @HotSpotVMConstant(name = "JVM_ACC_HAS_FINALIZER") @Stable public int klassHasFinalizerFlag; 476 public final int klassHasFinalizerFlag = getConstant("JVM_ACC_HAS_FINALIZER", Integer.class);
1187 477
1188 // Modifier.SYNTHETIC is not public so we get it via vmStructs. 478 // Modifier.SYNTHETIC is not public so we get it via vmStructs.
1189 @HotSpotVMConstant(name = "JVM_ACC_SYNTHETIC") @Stable public int syntheticFlag; 479 public final int syntheticFlag = getConstant("JVM_ACC_SYNTHETIC", Integer.class);
1190 480
1191 /** 481 // /**
1192 * @see HotSpotResolvedObjectTypeImpl#createField 482 // * @see HotSpotResolvedObjectTypeImpl#createField
1193 */ 483 // */
1194 @HotSpotVMConstant(name = "JVM_RECOGNIZED_FIELD_MODIFIERS") @Stable public int recognizedFieldModifiers; 484 // public final int recognizedFieldModifiers = getConstant("JVM_RECOGNIZED_FIELD_MODIFIERS",
1195 485 // Integer.class);
1196 /** 486
1197 * Bit pattern that represents a non-oop. Neither the high bits nor the low bits of this value 487 // /**
1198 * are allowed to look like (respectively) the high or low bits of a real oop. 488 // * Bit pattern that represents a non-oop. Neither the high bits nor the low bits of this value
1199 */ 489 // * are allowed to look like (respectively) the high or low bits of a real oop.
1200 @HotSpotVMField(name = "Universe::_non_oop_bits", type = "intptr_t", get = HotSpotVMField.Type.VALUE) @Stable public long nonOopBits; 490 // */
1201 491 // public final long nonOopBits = getFieldValue("Universe::_non_oop_bits", Long.class, "intptr_t");
1202 @HotSpotVMField(name = "StubRoutines::_verify_oop_count", type = "jint", get = HotSpotVMField.Type.ADDRESS) @Stable public long verifyOopCounterAddress; 492
1203 @HotSpotVMValue(expression = "Universe::verify_oop_mask()") @Stable public long verifyOopMask; 493 // public final long verifyOopCounterAddress = getFieldAddress("StubRoutines::_verify_oop_count",
1204 @HotSpotVMValue(expression = "Universe::verify_oop_bits()") @Stable public long verifyOopBits; 494 // "jint");
1205 495 // public final long verifyOopMask = getFieldValue("CompilerToVM::Data::Universe_verify_oop_mask",
1206 @HotSpotVMField(name = "CollectedHeap::_barrier_set", type = "BarrierSet*", get = HotSpotVMField.Type.OFFSET) @Stable public int collectedHeapBarrierSetOffset; 496 // Long.class, "uintptr_t");
1207 497 // public final long verifyOopBits = getFieldValue("CompilerToVM::Data::Universe_verify_oop_bits",
1208 @HotSpotVMField(name = "HeapRegion::LogOfHRGrainBytes", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int logOfHRGrainBytes; 498 // Long.class, "uintptr_t");
1209 499 public final int klassVtableStartOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_start_offset", Integer.class, "int");
1210 @HotSpotVMField(name = "BarrierSet::_kind", type = "BarrierSet::Name", get = HotSpotVMField.Type.OFFSET) @Stable private int barrierSetKindOffset; 500 public final int klassVtableLengthOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_length_offset", Integer.class, "int");
1211 @HotSpotVMConstant(name = "BarrierSet::CardTableModRef") @Stable public int barrierSetCardTableModRef; 501 public final int universeBaseVtableSize = getFieldValue("CompilerToVM::Data::Universe_base_vtable_size", Integer.class, "int");
1212 @HotSpotVMConstant(name = "BarrierSet::CardTableExtension") @Stable public int barrierSetCardTableExtension; 502
1213 @HotSpotVMConstant(name = "BarrierSet::G1SATBCT") @Stable public int barrierSetG1SATBCT; 503 public final int baseVtableLength() {
1214 @HotSpotVMConstant(name = "BarrierSet::G1SATBCTLogging") @Stable public int barrierSetG1SATBCTLogging; 504 return universeBaseVtableSize / vtableEntrySize;
1215 @HotSpotVMConstant(name = "BarrierSet::ModRef") @Stable public int barrierSetModRef;
1216 @HotSpotVMConstant(name = "BarrierSet::Other") @Stable public int barrierSetOther;
1217
1218 @HotSpotVMField(name = "CardTableModRefBS::byte_map_base", type = "jbyte*", get = HotSpotVMField.Type.OFFSET) @Stable private int cardTableModRefBSByteMapBaseOffset;
1219 @HotSpotVMConstant(name = "CardTableModRefBS::card_shift") @Stable public int cardTableModRefBSCardShift;
1220
1221 @HotSpotVMValue(expression = "(jbyte)CardTableModRefBS::dirty_card_val()") @Stable public byte dirtyCardValue;
1222 @HotSpotVMValue(expression = "(jbyte)G1SATBCardTableModRefBS::g1_young_card_val()") @Stable public byte g1YoungCardValue;
1223
1224 private final long cardtableStartAddress;
1225 private final int cardtableShift;
1226
1227 public long cardtableStartAddress() {
1228 if (cardtableStartAddress == -1) {
1229 throw JVMCIError.shouldNotReachHere();
1230 }
1231 return cardtableStartAddress;
1232 } 505 }
1233 506 //
1234 public int cardtableShift() { 507 // public final int collectedHeapBarrierSetOffset = getFieldOffset("CollectedHeap::_barrier_set",
1235 if (cardtableShift == -1) { 508 // Integer.class, "BarrierSet*");
1236 throw JVMCIError.shouldNotReachHere(); 509 //
1237 } 510 // public final int logOfHRGrainBytes = getFieldValue("HeapRegion::LogOfHRGrainBytes",
1238 return cardtableShift; 511 // Integer.class, "int");
1239 } 512
1240 513 // public final int barrierSetCardTableModRef = getConstant("BarrierSet::CardTableModRef",
1241 @HotSpotVMField(name = "os::_polling_page", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long safepointPollingAddress; 514 // Integer.class);
515 // public final int barrierSetCardTableExtension = getConstant("BarrierSet::CardTableExtension",
516 // Integer.class);
517 // public final int barrierSetG1SATBCT = getConstant("BarrierSet::G1SATBCT", Integer.class);
518 // public final int barrierSetG1SATBCTLogging = getConstant("BarrierSet::G1SATBCTLogging",
519 // Integer.class);
520 // public final int barrierSetModRef = getConstant("BarrierSet::ModRef", Integer.class);
521 // public final int barrierSetOther = getConstant("BarrierSet::Other", Integer.class);
522 //
523 // public final int cardTableModRefBSCardShift = getConstant("CardTableModRefBS::card_shift",
524 // Integer.class);
525 //
526 // public final byte dirtyCardValue = getFieldValue("CompilerToVM::Data::dirty_card", Byte.class,
527 // "int");
528 // public final byte g1YoungCardValue = getFieldValue("CompilerToVM::Data::g1_young_card",
529 // Byte.class, "int");
530 //
531 // private final long cardtableStartAddress =
532 // getFieldValue("CompilerToVM::Data::cardtable_start_address", Long.class, "jbyte*");
533 // private final int cardtableShift = getFieldValue("CompilerToVM::Data::cardtable_shift",
534 // Integer.class, "int");
535 //
536 // public long cardtableStartAddress() {
537 // return cardtableStartAddress;
538 // }
539 //
540 // public int cardtableShift() {
541 // return cardtableShift;
542 // }
543
544 // public final long safepointPollingAddress = getFieldValue("os::_polling_page", Long.class,
545 // "address");
1242 546
1243 // G1 Collector Related Values. 547 // G1 Collector Related Values.
1244 548
1245 public int g1CardQueueIndexOffset() { 549 // public int g1CardQueueIndexOffset() {
1246 return javaThreadDirtyCardQueueOffset + ptrQueueIndexOffset; 550 // return javaThreadDirtyCardQueueOffset + ptrQueueIndexOffset;
1247 } 551 // }
1248 552 //
1249 public int g1CardQueueBufferOffset() { 553 // public int g1CardQueueBufferOffset() {
1250 return javaThreadDirtyCardQueueOffset + ptrQueueBufferOffset; 554 // return javaThreadDirtyCardQueueOffset + ptrQueueBufferOffset;
1251 } 555 // }
1252 556 //
1253 public int g1SATBQueueMarkingOffset() { 557 // public int g1SATBQueueMarkingOffset() {
1254 return javaThreadSatbMarkQueueOffset + ptrQueueActiveOffset; 558 // return javaThreadSatbMarkQueueOffset + ptrQueueActiveOffset;
1255 } 559 // }
1256 560 //
1257 public int g1SATBQueueIndexOffset() { 561 // public int g1SATBQueueIndexOffset() {
1258 return javaThreadSatbMarkQueueOffset + ptrQueueIndexOffset; 562 // return javaThreadSatbMarkQueueOffset + ptrQueueIndexOffset;
1259 } 563 // }
1260 564 //
1261 public int g1SATBQueueBufferOffset() { 565 // public int g1SATBQueueBufferOffset() {
1262 return javaThreadSatbMarkQueueOffset + ptrQueueBufferOffset; 566 // return javaThreadSatbMarkQueueOffset + ptrQueueBufferOffset;
1263 } 567 // }
1264 568
1265 @HotSpotVMField(name = "java_lang_Class::_klass_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int klassOffset; 569 public final int klassOffset = getFieldValue("java_lang_Class::_klass_offset", Integer.class, "int");
1266 @HotSpotVMField(name = "java_lang_Class::_array_klass_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int arrayKlassOffset; 570 // public final int arrayKlassOffset = getFieldValue("java_lang_Class::_array_klass_offset",
1267 571 // Integer.class, "int");
1268 @HotSpotVMField(name = "Method::_method_data", type = "MethodData*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOffset; 572
1269 @HotSpotVMField(name = "Method::_from_compiled_entry", type = "address", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCompiledEntryOffset; 573 public final int methodDataOffset = getFieldOffset("Method::_method_data", Integer.class, "MethodData*");
1270 @HotSpotVMField(name = "Method::_code", type = "nmethod*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCodeOffset; 574 // public final int methodCompiledEntryOffset = getFieldOffset("Method::_from_compiled_entry",
1271 575 // Integer.class, "address");
1272 @HotSpotVMField(name = "MethodData::_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataSize; 576 public final int methodCodeOffset = getFieldOffset("Method::_code", Integer.class, "nmethod*");
1273 @HotSpotVMField(name = "MethodData::_data_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataDataSize; 577
1274 @HotSpotVMField(name = "MethodData::_data[0]", type = "intptr_t", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOopDataOffset; 578 public final int methodDataSize = getFieldOffset("MethodData::_size", Integer.class, "int");
1275 @HotSpotVMField(name = "MethodData::_trap_hist._array[0]", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOopTrapHistoryOffset; 579 public final int methodDataDataSize = getFieldOffset("MethodData::_data_size", Integer.class, "int");
1276 @HotSpotVMField(name = "MethodData::_jvmci_ir_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataIRSizeOffset; 580 public final int methodDataOopDataOffset = getFieldOffset("MethodData::_data[0]", Integer.class, "intptr_t");
1277 581 public final int methodDataOopTrapHistoryOffset = getFieldOffset("MethodData::_trap_hist._array[0]", Integer.class, "u1");
1278 @HotSpotVMField(name = "nmethod::_verified_entry_point", type = "address", get = HotSpotVMField.Type.OFFSET) @Stable public int nmethodEntryOffset; 582 public final int methodDataIRSizeOffset = getFieldOffset("MethodData::_jvmci_ir_size", Integer.class, "int");
1279 @HotSpotVMField(name = "nmethod::_comp_level", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int nmethodCompLevelOffset; 583
1280 584 // public final int nmethodEntryOffset = getFieldOffset("nmethod::_verified_entry_point",
1281 @HotSpotVMConstant(name = "CompLevel_none") @Stable public int compilationLevelNone; 585 // Integer.class, "address");
1282 @HotSpotVMConstant(name = "CompLevel_simple") @Stable public int compilationLevelSimple; 586 public final int nmethodCompLevelOffset = getFieldOffset("nmethod::_comp_level", Integer.class, "int");
1283 @HotSpotVMConstant(name = "CompLevel_limited_profile") @Stable public int compilationLevelLimitedProfile; 587
1284 @HotSpotVMConstant(name = "CompLevel_full_profile") @Stable public int compilationLevelFullProfile; 588 public final int compilationLevelNone = getConstant("CompLevel_none", Integer.class);
1285 @HotSpotVMConstant(name = "CompLevel_full_optimization") @Stable public int compilationLevelFullOptimization; 589 public final int compilationLevelSimple = getConstant("CompLevel_simple", Integer.class);
1286 590 public final int compilationLevelLimitedProfile = getConstant("CompLevel_limited_profile", Integer.class);
1287 @HotSpotVMConstant(name = "JVMCIRuntime::none") @Stable public int compLevelAdjustmentNone; 591 public final int compilationLevelFullProfile = getConstant("CompLevel_full_profile", Integer.class);
1288 @HotSpotVMConstant(name = "JVMCIRuntime::by_holder") @Stable public int compLevelAdjustmentByHolder; 592 public final int compilationLevelFullOptimization = getConstant("CompLevel_full_optimization", Integer.class);
1289 @HotSpotVMConstant(name = "JVMCIRuntime::by_full_signature") @Stable public int compLevelAdjustmentByFullSignature; 593
594 public final int compLevelAdjustmentNone = getConstant("JVMCIRuntime::none", Integer.class);
595 public final int compLevelAdjustmentByHolder = getConstant("JVMCIRuntime::by_holder", Integer.class);
596 public final int compLevelAdjustmentByFullSignature = getConstant("JVMCIRuntime::by_full_signature", Integer.class);
1290 597
1291 /** 598 /**
1292 * This is the largest stack offset encodeable in an OopMapValue. Offsets larger than this will 599 * This is the largest stack offset encodeable in an OopMapValue. Offsets larger than this will
1293 * throw an exception during code installation. 600 * throw an exception during code installation.
1294 */ 601 */
1295 @HotSpotVMValue(expression = "JVMCIRuntime::max_oop_map_stack_offset") @Stable public int maxOopMapStackOffset; 602 public final int maxOopMapStackOffset = getFieldValue("JVMCIRuntime::max_oop_map_stack_offset", Integer.class, "int");
1296 603
1297 @HotSpotVMType(name = "BasicLock", get = HotSpotVMType.Type.SIZE) @Stable public int basicLockSize; 604 // final int basicLockSize = getTypeSize("BasicLock");
1298 @HotSpotVMField(name = "BasicLock::_displaced_header", type = "markOop", get = HotSpotVMField.Type.OFFSET) @Stable public int basicLockDisplacedHeaderOffset; 605 // public final int basicLockDisplacedHeaderOffset = getFieldOffset("BasicLock::_displaced_header",
1299 606 // Integer.class, "markOop");
1300 @HotSpotVMValue(expression = "Universe::heap()->supports_inline_contig_alloc() ? Universe::heap()->end_addr() : (HeapWord**)-1", get = HotSpotVMValue.Type.ADDRESS) @Stable public long heapEndAddress; 607 //
1301 @HotSpotVMValue(expression = "Universe::heap()->supports_inline_contig_alloc() ? Universe::heap()->top_addr() : (HeapWord**)-1", get = HotSpotVMValue.Type.ADDRESS) @Stable public long heapTopAddress; 608 // public final int threadAllocatedBytesOffset = getFieldOffset("Thread::_allocated_bytes",
1302 609 // Integer.class, "jlong");
1303 @HotSpotVMField(name = "Thread::_allocated_bytes", type = "jlong", get = HotSpotVMField.Type.OFFSET) @Stable public int threadAllocatedBytesOffset; 610 //
1304 611 // public final int tlabRefillWasteIncrement = getFlag("TLABWasteIncrement", Integer.class);
1305 @HotSpotVMFlag(name = "TLABWasteIncrement") @Stable public int tlabRefillWasteIncrement; 612 //
1306 @HotSpotVMValue(expression = "ThreadLocalAllocBuffer::alignment_reserve()") @Stable public int tlabAlignmentReserve; 613 // private final int threadLocalAllocBufferStartOffset =
1307 614 // getFieldOffset("ThreadLocalAllocBuffer::_start", Integer.class, "HeapWord*");
1308 @HotSpotVMField(name = "ThreadLocalAllocBuffer::_start", type = "HeapWord*", get = HotSpotVMField.Type.OFFSET) @Stable private int threadLocalAllocBufferStartOffset; 615 // private final int threadLocalAllocBufferEndOffset =
1309 @HotSpotVMField(name = "ThreadLocalAllocBuffer::_end", type = "HeapWord*", get = HotSpotVMField.Type.OFFSET) @Stable private int threadLocalAllocBufferEndOffset; 616 // getFieldOffset("ThreadLocalAllocBuffer::_end", Integer.class, "HeapWord*");
1310 @HotSpotVMField(name = "ThreadLocalAllocBuffer::_top", type = "HeapWord*", get = HotSpotVMField.Type.OFFSET) @Stable private int threadLocalAllocBufferTopOffset; 617 // private final int threadLocalAllocBufferTopOffset =
1311 @HotSpotVMField(name = "ThreadLocalAllocBuffer::_pf_top", type = "HeapWord*", get = HotSpotVMField.Type.OFFSET) @Stable private int threadLocalAllocBufferPfTopOffset; 618 // getFieldOffset("ThreadLocalAllocBuffer::_top", Integer.class, "HeapWord*");
1312 @HotSpotVMField(name = "ThreadLocalAllocBuffer::_slow_allocations", type = "unsigned", get = HotSpotVMField.Type.OFFSET) @Stable private int threadLocalAllocBufferSlowAllocationsOffset; 619 // private final int threadLocalAllocBufferPfTopOffset =
1313 @HotSpotVMField(name = "ThreadLocalAllocBuffer::_fast_refill_waste", type = "unsigned", get = HotSpotVMField.Type.OFFSET) @Stable private int threadLocalAllocBufferFastRefillWasteOffset; 620 // getFieldOffset("ThreadLocalAllocBuffer::_pf_top", Integer.class, "HeapWord*");
1314 @HotSpotVMField(name = "ThreadLocalAllocBuffer::_number_of_refills", type = "unsigned", get = HotSpotVMField.Type.OFFSET) @Stable private int threadLocalAllocBufferNumberOfRefillsOffset; 621 // private final int threadLocalAllocBufferSlowAllocationsOffset =
1315 @HotSpotVMField(name = "ThreadLocalAllocBuffer::_refill_waste_limit", type = "size_t", get = HotSpotVMField.Type.OFFSET) @Stable private int threadLocalAllocBufferRefillWasteLimitOffset; 622 // getFieldOffset("ThreadLocalAllocBuffer::_slow_allocations", Integer.class, "unsigned");
1316 @HotSpotVMField(name = "ThreadLocalAllocBuffer::_desired_size", type = "size_t", get = HotSpotVMField.Type.OFFSET) @Stable private int threadLocalAllocBufferDesiredSizeOffset; 623 // private final int threadLocalAllocBufferFastRefillWasteOffset =
1317 624 // getFieldOffset("ThreadLocalAllocBuffer::_fast_refill_waste", Integer.class, "unsigned");
1318 public int tlabSlowAllocationsOffset() { 625 // private final int threadLocalAllocBufferNumberOfRefillsOffset =
1319 return threadTlabOffset + threadLocalAllocBufferSlowAllocationsOffset; 626 // getFieldOffset("ThreadLocalAllocBuffer::_number_of_refills", Integer.class, "unsigned");
1320 } 627 // private final int threadLocalAllocBufferRefillWasteLimitOffset =
1321 628 // getFieldOffset("ThreadLocalAllocBuffer::_refill_waste_limit", Integer.class, "size_t");
1322 public int tlabFastRefillWasteOffset() { 629 // private final int threadLocalAllocBufferDesiredSizeOffset =
1323 return threadTlabOffset + threadLocalAllocBufferFastRefillWasteOffset; 630 // getFieldOffset("ThreadLocalAllocBuffer::_desired_size", Integer.class, "size_t");
1324 } 631 //
1325 632 // public int tlabSlowAllocationsOffset() {
1326 public int tlabNumberOfRefillsOffset() { 633 // return threadTlabOffset + threadLocalAllocBufferSlowAllocationsOffset;
1327 return threadTlabOffset + threadLocalAllocBufferNumberOfRefillsOffset; 634 // }
1328 } 635 //
1329 636 // public int tlabFastRefillWasteOffset() {
1330 public int tlabRefillWasteLimitOffset() { 637 // return threadTlabOffset + threadLocalAllocBufferFastRefillWasteOffset;
1331 return threadTlabOffset + threadLocalAllocBufferRefillWasteLimitOffset; 638 // }
1332 } 639 //
1333 640 // public int tlabNumberOfRefillsOffset() {
1334 public int threadTlabSizeOffset() { 641 // return threadTlabOffset + threadLocalAllocBufferNumberOfRefillsOffset;
1335 return threadTlabOffset + threadLocalAllocBufferDesiredSizeOffset; 642 // }
1336 } 643 //
1337 644 // public int tlabRefillWasteLimitOffset() {
1338 public int threadTlabStartOffset() { 645 // return threadTlabOffset + threadLocalAllocBufferRefillWasteLimitOffset;
1339 return threadTlabOffset + threadLocalAllocBufferStartOffset; 646 // }
1340 } 647 //
1341 648 // public int threadTlabSizeOffset() {
1342 public int threadTlabEndOffset() { 649 // return threadTlabOffset + threadLocalAllocBufferDesiredSizeOffset;
1343 return threadTlabOffset + threadLocalAllocBufferEndOffset; 650 // }
1344 } 651 //
1345 652 // public int threadTlabStartOffset() {
1346 public int threadTlabTopOffset() { 653 // return threadTlabOffset + threadLocalAllocBufferStartOffset;
1347 return threadTlabOffset + threadLocalAllocBufferTopOffset; 654 // }
1348 } 655 //
1349 656 // public int threadTlabEndOffset() {
1350 public int threadTlabPfTopOffset() { 657 // return threadTlabOffset + threadLocalAllocBufferEndOffset;
1351 return threadTlabOffset + threadLocalAllocBufferPfTopOffset; 658 // }
1352 } 659 //
1353 660 // public int threadTlabTopOffset() {
1354 @HotSpotVMFlag(name = "TLABStats") @Stable public boolean tlabStats; 661 // return threadTlabOffset + threadLocalAllocBufferTopOffset;
1355 @HotSpotVMValue(expression = " !CMSIncrementalMode && Universe::heap()->supports_inline_contig_alloc()") @Stable public boolean inlineContiguousAllocationSupported; 662 // }
1356 663 //
664 // public int threadTlabPfTopOffset() {
665 // return threadTlabOffset + threadLocalAllocBufferPfTopOffset;
666 // }
667 //
668 // public final int tlabAlignmentReserve =
669 // getFieldValue("CompilerToVM::Data::ThreadLocalAllocBuffer_alignment_reserve", Integer.class,
670 // "size_t");
671 //
672 // public final boolean tlabStats = getFlag("TLABStats", Boolean.class);
673 //
674 // public final boolean inlineContiguousAllocationSupported =
675 // getFieldValue("CompilerToVM::Data::_supports_inline_contig_alloc", Boolean.class);
676 // public final long heapEndAddress = getFieldValue("CompilerToVM::Data::_heap_end_addr",
677 // Long.class, "HeapWord**");
678 // public final long heapTopAddress = getFieldValue("CompilerToVM::Data::_heap_top_addr",
679 // Long.class, "HeapWord**");
680 //
1357 /** 681 /**
1358 * The DataLayout header size is the same as the cell size. 682 * The DataLayout header size is the same as the cell size.
1359 */ 683 */
1360 @HotSpotVMConstant(name = "DataLayout::cell_size") @Stable public int dataLayoutHeaderSize; 684 public final int dataLayoutHeaderSize = getConstant("DataLayout::cell_size", Integer.class);
1361 @HotSpotVMField(name = "DataLayout::_header._struct._tag", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int dataLayoutTagOffset; 685 public final int dataLayoutTagOffset = getFieldOffset("DataLayout::_header._struct._tag", Integer.class, "u1");
1362 @HotSpotVMField(name = "DataLayout::_header._struct._flags", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int dataLayoutFlagsOffset; 686 public final int dataLayoutFlagsOffset = getFieldOffset("DataLayout::_header._struct._flags", Integer.class, "u1");
1363 @HotSpotVMField(name = "DataLayout::_header._struct._bci", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int dataLayoutBCIOffset; 687 public final int dataLayoutBCIOffset = getFieldOffset("DataLayout::_header._struct._bci", Integer.class, "u2");
1364 @HotSpotVMField(name = "DataLayout::_cells[0]", type = "intptr_t", get = HotSpotVMField.Type.OFFSET) @Stable public int dataLayoutCellsOffset; 688 public final int dataLayoutCellsOffset = getFieldOffset("DataLayout::_cells[0]", Integer.class, "intptr_t");
1365 @HotSpotVMConstant(name = "DataLayout::cell_size") @Stable public int dataLayoutCellSize; 689 public final int dataLayoutCellSize = getConstant("DataLayout::cell_size", Integer.class);
1366 690
1367 @HotSpotVMConstant(name = "DataLayout::no_tag") @Stable public int dataLayoutNoTag; 691 public final int dataLayoutNoTag = getConstant("DataLayout::no_tag", Integer.class);
1368 @HotSpotVMConstant(name = "DataLayout::bit_data_tag") @Stable public int dataLayoutBitDataTag; 692 public final int dataLayoutBitDataTag = getConstant("DataLayout::bit_data_tag", Integer.class);
1369 @HotSpotVMConstant(name = "DataLayout::counter_data_tag") @Stable public int dataLayoutCounterDataTag; 693 public final int dataLayoutCounterDataTag = getConstant("DataLayout::counter_data_tag", Integer.class);
1370 @HotSpotVMConstant(name = "DataLayout::jump_data_tag") @Stable public int dataLayoutJumpDataTag; 694 public final int dataLayoutJumpDataTag = getConstant("DataLayout::jump_data_tag", Integer.class);
1371 @HotSpotVMConstant(name = "DataLayout::receiver_type_data_tag") @Stable public int dataLayoutReceiverTypeDataTag; 695 public final int dataLayoutReceiverTypeDataTag = getConstant("DataLayout::receiver_type_data_tag", Integer.class);
1372 @HotSpotVMConstant(name = "DataLayout::virtual_call_data_tag") @Stable public int dataLayoutVirtualCallDataTag; 696 public final int dataLayoutVirtualCallDataTag = getConstant("DataLayout::virtual_call_data_tag", Integer.class);
1373 @HotSpotVMConstant(name = "DataLayout::ret_data_tag") @Stable public int dataLayoutRetDataTag; 697 public final int dataLayoutRetDataTag = getConstant("DataLayout::ret_data_tag", Integer.class);
1374 @HotSpotVMConstant(name = "DataLayout::branch_data_tag") @Stable public int dataLayoutBranchDataTag; 698 public final int dataLayoutBranchDataTag = getConstant("DataLayout::branch_data_tag", Integer.class);
1375 @HotSpotVMConstant(name = "DataLayout::multi_branch_data_tag") @Stable public int dataLayoutMultiBranchDataTag; 699 public final int dataLayoutMultiBranchDataTag = getConstant("DataLayout::multi_branch_data_tag", Integer.class);
1376 @HotSpotVMConstant(name = "DataLayout::arg_info_data_tag") @Stable public int dataLayoutArgInfoDataTag; 700 public final int dataLayoutArgInfoDataTag = getConstant("DataLayout::arg_info_data_tag", Integer.class);
1377 @HotSpotVMConstant(name = "DataLayout::call_type_data_tag") @Stable public int dataLayoutCallTypeDataTag; 701 public final int dataLayoutCallTypeDataTag = getConstant("DataLayout::call_type_data_tag", Integer.class);
1378 @HotSpotVMConstant(name = "DataLayout::virtual_call_type_data_tag") @Stable public int dataLayoutVirtualCallTypeDataTag; 702 public final int dataLayoutVirtualCallTypeDataTag = getConstant("DataLayout::virtual_call_type_data_tag", Integer.class);
1379 @HotSpotVMConstant(name = "DataLayout::parameters_type_data_tag") @Stable public int dataLayoutParametersTypeDataTag; 703 public final int dataLayoutParametersTypeDataTag = getConstant("DataLayout::parameters_type_data_tag", Integer.class);
1380 @HotSpotVMConstant(name = "DataLayout::speculative_trap_data_tag") @Stable public int dataLayoutSpeculativeTrapDataTag; 704 public final int dataLayoutSpeculativeTrapDataTag = getConstant("DataLayout::speculative_trap_data_tag", Integer.class);
1381 705
1382 @HotSpotVMFlag(name = "BciProfileWidth") @Stable public int bciProfileWidth; 706 public final int bciProfileWidth = getFlag("BciProfileWidth", Integer.class);
1383 @HotSpotVMFlag(name = "TypeProfileWidth") @Stable public int typeProfileWidth; 707 public final int typeProfileWidth = getFlag("TypeProfileWidth", Integer.class);
1384 @HotSpotVMFlag(name = "MethodProfileWidth") @Stable public int methodProfileWidth; 708 public final int methodProfileWidth = getFlag("MethodProfileWidth", Integer.class);
1385 709 //
1386 @HotSpotVMField(name = "CodeBlob::_code_offset", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable private int codeBlobCodeOffsetOffset; 710 // public final long handleDeoptStub =
1387 @HotSpotVMField(name = "SharedRuntime::_ic_miss_blob", type = "RuntimeStub*", get = HotSpotVMField.Type.VALUE) @Stable private long inlineCacheMissBlob; 711 // getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_unpack", Long.class, "address");
1388 712 // public final long uncommonTrapStub =
1389 @HotSpotVMValue(expression = "SharedRuntime::deopt_blob()->unpack()", get = HotSpotVMValue.Type.ADDRESS) @Stable public long handleDeoptStub; 713 // getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap", Long.class,
1390 @HotSpotVMValue(expression = "SharedRuntime::deopt_blob()->uncommon_trap()", get = HotSpotVMValue.Type.ADDRESS) @Stable public long uncommonTrapStub; 714 // "address");
1391 715 //
1392 public final long inlineCacheMissStub; 716 // public final long inlineCacheMissStub =
1393 717 // getFieldValue("CompilerToVM::Data::SharedRuntime_ic_miss_stub", Long.class, "address");
1394 @HotSpotVMField(name = "CodeCache::_heap", type = "CodeHeap*", get = HotSpotVMField.Type.VALUE) @Stable private long codeCacheHeap; 718
1395 @HotSpotVMField(name = "CodeHeap::_memory", type = "VirtualSpace", get = HotSpotVMField.Type.OFFSET) @Stable private int codeHeapMemoryOffset; 719 // public final long javaTimeMillisAddress = getAddress("os::javaTimeMillis");
1396 @HotSpotVMField(name = "VirtualSpace::_low_boundary", type = "char*", get = HotSpotVMField.Type.OFFSET) @Stable private int virtualSpaceLowBoundaryOffset; 720 // public final long javaTimeNanosAddress = getAddress("os::javaTimeNanos");
1397 @HotSpotVMField(name = "VirtualSpace::_high_boundary", type = "char*", get = HotSpotVMField.Type.OFFSET) @Stable private int virtualSpaceHighBoundaryOffset; 721 // public final long arithmeticSinAddress = getFieldValue("CompilerToVM::Data::dsin", Long.class,
1398 722 // "address");
1399 public final long codeCacheLowBound; 723 // public final long arithmeticCosAddress = getFieldValue("CompilerToVM::Data::dcos", Long.class,
1400 public final long codeCacheHighBound; 724 // "address");
1401 725 // public final long arithmeticTanAddress = getFieldValue("CompilerToVM::Data::dtan", Long.class,
1402 @HotSpotVMField(name = "StubRoutines::_aescrypt_encryptBlock", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long aescryptEncryptBlockStub; 726 // "address");
1403 @HotSpotVMField(name = "StubRoutines::_aescrypt_decryptBlock", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long aescryptDecryptBlockStub; 727 // public final long arithmeticExpAddress = getFieldValue("CompilerToVM::Data::dexp", Long.class,
1404 @HotSpotVMField(name = "StubRoutines::_cipherBlockChaining_encryptAESCrypt", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long cipherBlockChainingEncryptAESCryptStub; 728 // "address");
1405 @HotSpotVMField(name = "StubRoutines::_cipherBlockChaining_decryptAESCrypt", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long cipherBlockChainingDecryptAESCryptStub; 729 // public final long arithmeticLogAddress = getFieldValue("CompilerToVM::Data::dlog", Long.class,
1406 @HotSpotVMField(name = "StubRoutines::_updateBytesCRC32", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long updateBytesCRC32Stub; 730 // "address");
1407 @HotSpotVMField(name = "StubRoutines::_crc_table_adr", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long crcTableAddress; 731 // public final long arithmeticLog10Address = getFieldValue("CompilerToVM::Data::dlog10",
1408 732 // Long.class, "address");
1409 @HotSpotVMField(name = "StubRoutines::_jbyte_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jbyteArraycopy; 733 // public final long arithmeticPowAddress = getFieldValue("CompilerToVM::Data::dpow", Long.class,
1410 @HotSpotVMField(name = "StubRoutines::_jshort_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jshortArraycopy; 734 // "address");
1411 @HotSpotVMField(name = "StubRoutines::_jint_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jintArraycopy; 735
1412 @HotSpotVMField(name = "StubRoutines::_jlong_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jlongArraycopy; 736 // public final int jvmciCountersSize = getFlag("JVMCICounterSize", Integer.class);
1413 @HotSpotVMField(name = "StubRoutines::_oop_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long oopArraycopy; 737
1414 @HotSpotVMField(name = "StubRoutines::_oop_arraycopy_uninit", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long oopArraycopyUninit; 738 // public final long deoptimizationFetchUnrollInfo =
1415 @HotSpotVMField(name = "StubRoutines::_jbyte_disjoint_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jbyteDisjointArraycopy; 739 // getAddress("Deoptimization::fetch_unroll_info");
1416 @HotSpotVMField(name = "StubRoutines::_jshort_disjoint_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jshortDisjointArraycopy; 740 // public final long deoptimizationUncommonTrap = getAddress("Deoptimization::uncommon_trap");
1417 @HotSpotVMField(name = "StubRoutines::_jint_disjoint_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jintDisjointArraycopy; 741 // public final long deoptimizationUnpackFrames = getAddress("Deoptimization::unpack_frames");
1418 @HotSpotVMField(name = "StubRoutines::_jlong_disjoint_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jlongDisjointArraycopy; 742 //
1419 @HotSpotVMField(name = "StubRoutines::_oop_disjoint_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long oopDisjointArraycopy; 743 public final int deoptReasonNone = getConstant("Deoptimization::Reason_none", Integer.class);
1420 @HotSpotVMField(name = "StubRoutines::_oop_disjoint_arraycopy_uninit", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long oopDisjointArraycopyUninit; 744 public final int deoptReasonNullCheck = getConstant("Deoptimization::Reason_null_check", Integer.class);
1421 @HotSpotVMField(name = "StubRoutines::_arrayof_jbyte_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jbyteAlignedArraycopy; 745 public final int deoptReasonRangeCheck = getConstant("Deoptimization::Reason_range_check", Integer.class);
1422 @HotSpotVMField(name = "StubRoutines::_arrayof_jshort_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jshortAlignedArraycopy; 746 public final int deoptReasonClassCheck = getConstant("Deoptimization::Reason_class_check", Integer.class);
1423 @HotSpotVMField(name = "StubRoutines::_arrayof_jint_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jintAlignedArraycopy; 747 public final int deoptReasonArrayCheck = getConstant("Deoptimization::Reason_array_check", Integer.class);
1424 @HotSpotVMField(name = "StubRoutines::_arrayof_jlong_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jlongAlignedArraycopy; 748 public final int deoptReasonUnreached0 = getConstant("Deoptimization::Reason_unreached0", Integer.class);
1425 @HotSpotVMField(name = "StubRoutines::_arrayof_oop_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long oopAlignedArraycopy; 749 public final int deoptReasonTypeCheckInlining = getConstant("Deoptimization::Reason_type_checked_inlining", Integer.class);
1426 @HotSpotVMField(name = "StubRoutines::_arrayof_oop_arraycopy_uninit", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long oopAlignedArraycopyUninit; 750 public final int deoptReasonOptimizedTypeCheck = getConstant("Deoptimization::Reason_optimized_type_check", Integer.class);
1427 @HotSpotVMField(name = "StubRoutines::_arrayof_jbyte_disjoint_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jbyteAlignedDisjointArraycopy; 751 public final int deoptReasonNotCompiledExceptionHandler = getConstant("Deoptimization::Reason_not_compiled_exception_handler", Integer.class);
1428 @HotSpotVMField(name = "StubRoutines::_arrayof_jshort_disjoint_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jshortAlignedDisjointArraycopy; 752 public final int deoptReasonUnresolved = getConstant("Deoptimization::Reason_unresolved", Integer.class);
1429 @HotSpotVMField(name = "StubRoutines::_arrayof_jint_disjoint_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jintAlignedDisjointArraycopy; 753 public final int deoptReasonJsrMismatch = getConstant("Deoptimization::Reason_jsr_mismatch", Integer.class);
1430 @HotSpotVMField(name = "StubRoutines::_arrayof_jlong_disjoint_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long jlongAlignedDisjointArraycopy; 754 public final int deoptReasonDiv0Check = getConstant("Deoptimization::Reason_div0_check", Integer.class);
1431 @HotSpotVMField(name = "StubRoutines::_arrayof_oop_disjoint_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long oopAlignedDisjointArraycopy; 755 public final int deoptReasonConstraint = getConstant("Deoptimization::Reason_constraint", Integer.class);
1432 @HotSpotVMField(name = "StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long oopAlignedDisjointArraycopyUninit; 756 public final int deoptReasonLoopLimitCheck = getConstant("Deoptimization::Reason_loop_limit_check", Integer.class);
1433 @HotSpotVMField(name = "StubRoutines::_checkcast_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long checkcastArraycopy; 757 public final int deoptReasonAliasing = getConstant("Deoptimization::Reason_aliasing", Integer.class);
1434 @HotSpotVMField(name = "StubRoutines::_checkcast_arraycopy_uninit", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long checkcastArraycopyUninit; 758 public final int deoptReasonTransferToInterpreter = getConstant("Deoptimization::Reason_transfer_to_interpreter", Integer.class);
1435 @HotSpotVMField(name = "StubRoutines::_unsafe_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long unsafeArraycopy; 759 public final int deoptReasonOSROffset = getConstant("Deoptimization::Reason_LIMIT", Integer.class);
1436 @HotSpotVMField(name = "StubRoutines::_generic_arraycopy", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long genericArraycopy; 760
1437 761 public final int deoptActionNone = getConstant("Deoptimization::Action_none", Integer.class);
1438 @HotSpotVMValue(expression = "JVMCIRuntime::new_instance", get = HotSpotVMValue.Type.ADDRESS) @Stable public long newInstanceAddress; 762 public final int deoptActionMaybeRecompile = getConstant("Deoptimization::Action_maybe_recompile", Integer.class);
1439 @HotSpotVMValue(expression = "JVMCIRuntime::new_array", get = HotSpotVMValue.Type.ADDRESS) @Stable public long newArrayAddress; 763 public final int deoptActionReinterpret = getConstant("Deoptimization::Action_reinterpret", Integer.class);
1440 @HotSpotVMValue(expression = "JVMCIRuntime::new_multi_array", get = HotSpotVMValue.Type.ADDRESS) @Stable public long newMultiArrayAddress; 764 public final int deoptActionMakeNotEntrant = getConstant("Deoptimization::Action_make_not_entrant", Integer.class);
1441 @HotSpotVMValue(expression = "JVMCIRuntime::dynamic_new_array", get = HotSpotVMValue.Type.ADDRESS) @Stable public long dynamicNewArrayAddress; 765 public final int deoptActionMakeNotCompilable = getConstant("Deoptimization::Action_make_not_compilable", Integer.class);
1442 @HotSpotVMValue(expression = "JVMCIRuntime::dynamic_new_instance", get = HotSpotVMValue.Type.ADDRESS) @Stable public long dynamicNewInstanceAddress; 766
1443 @HotSpotVMValue(expression = "JVMCIRuntime::thread_is_interrupted", get = HotSpotVMValue.Type.ADDRESS) @Stable public long threadIsInterruptedAddress; 767 public final int deoptimizationActionBits = getConstant("Deoptimization::_action_bits", Integer.class);
1444 @HotSpotVMValue(expression = "JVMCIRuntime::vm_message", signature = "(unsigned char, long, long, long, long)", get = HotSpotVMValue.Type.ADDRESS) @Stable public long vmMessageAddress; 768 public final int deoptimizationReasonBits = getConstant("Deoptimization::_reason_bits", Integer.class);
1445 @HotSpotVMValue(expression = "JVMCIRuntime::identity_hash_code", get = HotSpotVMValue.Type.ADDRESS) @Stable public long identityHashCodeAddress; 769 public final int deoptimizationDebugIdBits = getConstant("Deoptimization::_debug_id_bits", Integer.class);
1446 @HotSpotVMValue(expression = "JVMCIRuntime::exception_handler_for_pc", signature = "(JavaThread*)", get = HotSpotVMValue.Type.ADDRESS) @Stable public long exceptionHandlerForPcAddress; 770 public final int deoptimizationActionShift = getConstant("Deoptimization::_action_shift", Integer.class);
1447 @HotSpotVMValue(expression = "JVMCIRuntime::monitorenter", get = HotSpotVMValue.Type.ADDRESS) @Stable public long monitorenterAddress; 771 public final int deoptimizationReasonShift = getConstant("Deoptimization::_reason_shift", Integer.class);
1448 @HotSpotVMValue(expression = "JVMCIRuntime::monitorexit", get = HotSpotVMValue.Type.ADDRESS) @Stable public long monitorexitAddress; 772 public final int deoptimizationDebugIdShift = getConstant("Deoptimization::_debug_id_shift", Integer.class);
1449 @HotSpotVMValue(expression = "JVMCIRuntime::throw_and_post_jvmti_exception", get = HotSpotVMValue.Type.ADDRESS) @Stable public long throwAndPostJvmtiExceptionAddress; 773 //
1450 @HotSpotVMValue(expression = "JVMCIRuntime::throw_klass_external_name_exception", get = HotSpotVMValue.Type.ADDRESS) @Stable public long throwKlassExternalNameExceptionAddress; 774 // public final int deoptimizationUnpackDeopt = getConstant("Deoptimization::Unpack_deopt",
1451 @HotSpotVMValue(expression = "JVMCIRuntime::throw_class_cast_exception", get = HotSpotVMValue.Type.ADDRESS) @Stable public long throwClassCastExceptionAddress; 775 // Integer.class);
1452 @HotSpotVMValue(expression = "JVMCIRuntime::log_primitive", get = HotSpotVMValue.Type.ADDRESS) @Stable public long logPrimitiveAddress; 776 // public final int deoptimizationUnpackException = getConstant("Deoptimization::Unpack_exception",
1453 @HotSpotVMValue(expression = "JVMCIRuntime::log_object", get = HotSpotVMValue.Type.ADDRESS) @Stable public long logObjectAddress; 777 // Integer.class);
1454 @HotSpotVMValue(expression = "JVMCIRuntime::log_printf", get = HotSpotVMValue.Type.ADDRESS) @Stable public long logPrintfAddress; 778 // public final int deoptimizationUnpackUncommonTrap =
1455 @HotSpotVMValue(expression = "JVMCIRuntime::vm_error", get = HotSpotVMValue.Type.ADDRESS) @Stable public long vmErrorAddress; 779 // getConstant("Deoptimization::Unpack_uncommon_trap", Integer.class);
1456 @HotSpotVMValue(expression = "JVMCIRuntime::load_and_clear_exception", get = HotSpotVMValue.Type.ADDRESS) @Stable public long loadAndClearExceptionAddress; 780 // public final int deoptimizationUnpackReexecute = getConstant("Deoptimization::Unpack_reexecute",
1457 @HotSpotVMValue(expression = "JVMCIRuntime::write_barrier_pre", get = HotSpotVMValue.Type.ADDRESS) @Stable public long writeBarrierPreAddress; 781 // Integer.class);
1458 @HotSpotVMValue(expression = "JVMCIRuntime::write_barrier_post", get = HotSpotVMValue.Type.ADDRESS) @Stable public long writeBarrierPostAddress; 782 //
1459 @HotSpotVMValue(expression = "JVMCIRuntime::validate_object", get = HotSpotVMValue.Type.ADDRESS) @Stable public long validateObject; 783 // public final int deoptimizationUnrollBlockSizeOfDeoptimizedFrameOffset =
1460 784 // getFieldOffset("Deoptimization::UnrollBlock::_size_of_deoptimized_frame", Integer.class, "int");
1461 @HotSpotVMValue(expression = "JVMCIRuntime::test_deoptimize_call_int", get = HotSpotVMValue.Type.ADDRESS) @Stable public long testDeoptimizeCallInt; 785 // public final int deoptimizationUnrollBlockCallerAdjustmentOffset =
1462 786 // getFieldOffset("Deoptimization::UnrollBlock::_caller_adjustment", Integer.class, "int");
1463 @HotSpotVMValue(expression = "SharedRuntime::register_finalizer", get = HotSpotVMValue.Type.ADDRESS) @Stable public long registerFinalizerAddress; 787 // public final int deoptimizationUnrollBlockNumberOfFramesOffset =
1464 @HotSpotVMValue(expression = "SharedRuntime::exception_handler_for_return_address", get = HotSpotVMValue.Type.ADDRESS) @Stable public long exceptionHandlerForReturnAddressAddress; 788 // getFieldOffset("Deoptimization::UnrollBlock::_number_of_frames", Integer.class, "int");
1465 @HotSpotVMValue(expression = "SharedRuntime::OSR_migration_end", get = HotSpotVMValue.Type.ADDRESS) @Stable public long osrMigrationEndAddress; 789 // public final int deoptimizationUnrollBlockTotalFrameSizesOffset =
1466 790 // getFieldOffset("Deoptimization::UnrollBlock::_total_frame_sizes", Integer.class, "int");
1467 @HotSpotVMValue(expression = "os::javaTimeMillis", get = HotSpotVMValue.Type.ADDRESS) @Stable public long javaTimeMillisAddress; 791 // public final int deoptimizationUnrollBlockUnpackKindOffset =
1468 @HotSpotVMValue(expression = "os::javaTimeNanos", get = HotSpotVMValue.Type.ADDRESS) @Stable public long javaTimeNanosAddress; 792 // getFieldOffset("Deoptimization::UnrollBlock::_unpack_kind", Integer.class, "int");
1469 @HotSpotVMValue(expression = "SharedRuntime::dsin", get = HotSpotVMValue.Type.ADDRESS) @Stable public long arithmeticSinAddress; 793 // public final int deoptimizationUnrollBlockFrameSizesOffset =
1470 @HotSpotVMValue(expression = "SharedRuntime::dcos", get = HotSpotVMValue.Type.ADDRESS) @Stable public long arithmeticCosAddress; 794 // getFieldOffset("Deoptimization::UnrollBlock::_frame_sizes", Integer.class, "intptr_t*");
1471 @HotSpotVMValue(expression = "SharedRuntime::dtan", get = HotSpotVMValue.Type.ADDRESS) @Stable public long arithmeticTanAddress; 795 // public final int deoptimizationUnrollBlockFramePcsOffset =
1472 @HotSpotVMValue(expression = "SharedRuntime::dexp", get = HotSpotVMValue.Type.ADDRESS) @Stable public long arithmeticExpAddress; 796 // getFieldOffset("Deoptimization::UnrollBlock::_frame_pcs", Integer.class, "address*");
1473 @HotSpotVMValue(expression = "SharedRuntime::dlog", get = HotSpotVMValue.Type.ADDRESS) @Stable public long arithmeticLogAddress; 797 // public final int deoptimizationUnrollBlockInitialInfoOffset =
1474 @HotSpotVMValue(expression = "SharedRuntime::dlog10", get = HotSpotVMValue.Type.ADDRESS) @Stable public long arithmeticLog10Address; 798 // getFieldOffset("Deoptimization::UnrollBlock::_initial_info", Integer.class, "intptr_t");
1475 @HotSpotVMValue(expression = "SharedRuntime::dpow", get = HotSpotVMValue.Type.ADDRESS) @Stable public long arithmeticPowAddress; 799
1476 800 public final int vmIntrinsicInvokeBasic = getConstant("vmIntrinsics::_invokeBasic", Integer.class);
1477 @HotSpotVMValue(expression = "(jint) JVMCICounterSize") @Stable public int jvmciCountersSize; 801 public final int vmIntrinsicLinkToVirtual = getConstant("vmIntrinsics::_linkToVirtual", Integer.class);
1478 802 public final int vmIntrinsicLinkToStatic = getConstant("vmIntrinsics::_linkToStatic", Integer.class);
1479 @HotSpotVMValue(expression = "Deoptimization::fetch_unroll_info", signature = "(JavaThread*)", get = HotSpotVMValue.Type.ADDRESS) @Stable public long deoptimizationFetchUnrollInfo; 803 public final int vmIntrinsicLinkToSpecial = getConstant("vmIntrinsics::_linkToSpecial", Integer.class);
1480 @HotSpotVMValue(expression = "Deoptimization::uncommon_trap", get = HotSpotVMValue.Type.ADDRESS) @Stable public long deoptimizationUncommonTrap; 804 public final int vmIntrinsicLinkToInterface = getConstant("vmIntrinsics::_linkToInterface", Integer.class);
1481 @HotSpotVMValue(expression = "Deoptimization::unpack_frames", signature = "(JavaThread*, int)", get = HotSpotVMValue.Type.ADDRESS) @Stable public long deoptimizationUnpackFrames; 805
1482 806 public final int codeInstallResultOk = getConstant("JVMCIEnv::ok", Integer.class);
1483 @HotSpotVMConstant(name = "Deoptimization::Reason_none") @Stable public int deoptReasonNone; 807 public final int codeInstallResultDependenciesFailed = getConstant("JVMCIEnv::dependencies_failed", Integer.class);
1484 @HotSpotVMConstant(name = "Deoptimization::Reason_null_check") @Stable public int deoptReasonNullCheck; 808 public final int codeInstallResultDependenciesInvalid = getConstant("JVMCIEnv::dependencies_invalid", Integer.class);
1485 @HotSpotVMConstant(name = "Deoptimization::Reason_range_check") @Stable public int deoptReasonRangeCheck; 809 public final int codeInstallResultCacheFull = getConstant("JVMCIEnv::cache_full", Integer.class);
1486 @HotSpotVMConstant(name = "Deoptimization::Reason_class_check") @Stable public int deoptReasonClassCheck; 810 public final int codeInstallResultCodeTooLarge = getConstant("JVMCIEnv::code_too_large", Integer.class);
1487 @HotSpotVMConstant(name = "Deoptimization::Reason_array_check") @Stable public int deoptReasonArrayCheck;
1488 @HotSpotVMConstant(name = "Deoptimization::Reason_unreached0") @Stable public int deoptReasonUnreached0;
1489 @HotSpotVMConstant(name = "Deoptimization::Reason_type_checked_inlining") @Stable public int deoptReasonTypeCheckInlining;
1490 @HotSpotVMConstant(name = "Deoptimization::Reason_optimized_type_check") @Stable public int deoptReasonOptimizedTypeCheck;
1491 @HotSpotVMConstant(name = "Deoptimization::Reason_not_compiled_exception_handler") @Stable public int deoptReasonNotCompiledExceptionHandler;
1492 @HotSpotVMConstant(name = "Deoptimization::Reason_unresolved") @Stable public int deoptReasonUnresolved;
1493 @HotSpotVMConstant(name = "Deoptimization::Reason_jsr_mismatch") @Stable public int deoptReasonJsrMismatch;
1494 @HotSpotVMConstant(name = "Deoptimization::Reason_div0_check") @Stable public int deoptReasonDiv0Check;
1495 @HotSpotVMConstant(name = "Deoptimization::Reason_constraint") @Stable public int deoptReasonConstraint;
1496 @HotSpotVMConstant(name = "Deoptimization::Reason_loop_limit_check") @Stable public int deoptReasonLoopLimitCheck;
1497 @HotSpotVMConstant(name = "Deoptimization::Reason_aliasing") @Stable public int deoptReasonAliasing;
1498 @HotSpotVMConstant(name = "Deoptimization::Reason_transfer_to_interpreter") @Stable public int deoptReasonTransferToInterpreter;
1499 @HotSpotVMConstant(name = "Deoptimization::Reason_LIMIT") @Stable public int deoptReasonOSROffset;
1500
1501 @HotSpotVMConstant(name = "Deoptimization::Action_none") @Stable public int deoptActionNone;
1502 @HotSpotVMConstant(name = "Deoptimization::Action_maybe_recompile") @Stable public int deoptActionMaybeRecompile;
1503 @HotSpotVMConstant(name = "Deoptimization::Action_reinterpret") @Stable public int deoptActionReinterpret;
1504 @HotSpotVMConstant(name = "Deoptimization::Action_make_not_entrant") @Stable public int deoptActionMakeNotEntrant;
1505 @HotSpotVMConstant(name = "Deoptimization::Action_make_not_compilable") @Stable public int deoptActionMakeNotCompilable;
1506
1507 @HotSpotVMConstant(name = "Deoptimization::_action_bits") @Stable public int deoptimizationActionBits;
1508 @HotSpotVMConstant(name = "Deoptimization::_reason_bits") @Stable public int deoptimizationReasonBits;
1509 @HotSpotVMConstant(name = "Deoptimization::_debug_id_bits") @Stable public int deoptimizationDebugIdBits;
1510 @HotSpotVMConstant(name = "Deoptimization::_action_shift") @Stable public int deoptimizationActionShift;
1511 @HotSpotVMConstant(name = "Deoptimization::_reason_shift") @Stable public int deoptimizationReasonShift;
1512 @HotSpotVMConstant(name = "Deoptimization::_debug_id_shift") @Stable public int deoptimizationDebugIdShift;
1513
1514 @HotSpotVMConstant(name = "Deoptimization::Unpack_deopt") @Stable public int deoptimizationUnpackDeopt;
1515 @HotSpotVMConstant(name = "Deoptimization::Unpack_exception") @Stable public int deoptimizationUnpackException;
1516 @HotSpotVMConstant(name = "Deoptimization::Unpack_uncommon_trap") @Stable public int deoptimizationUnpackUncommonTrap;
1517 @HotSpotVMConstant(name = "Deoptimization::Unpack_reexecute") @Stable public int deoptimizationUnpackReexecute;
1518
1519 @HotSpotVMField(name = "Deoptimization::UnrollBlock::_size_of_deoptimized_frame", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int deoptimizationUnrollBlockSizeOfDeoptimizedFrameOffset;
1520 @HotSpotVMField(name = "Deoptimization::UnrollBlock::_caller_adjustment", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int deoptimizationUnrollBlockCallerAdjustmentOffset;
1521 @HotSpotVMField(name = "Deoptimization::UnrollBlock::_number_of_frames", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int deoptimizationUnrollBlockNumberOfFramesOffset;
1522 @HotSpotVMField(name = "Deoptimization::UnrollBlock::_total_frame_sizes", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int deoptimizationUnrollBlockTotalFrameSizesOffset;
1523 @HotSpotVMField(name = "Deoptimization::UnrollBlock::_unpack_kind", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int deoptimizationUnrollBlockUnpackKindOffset;
1524 @HotSpotVMField(name = "Deoptimization::UnrollBlock::_frame_sizes", type = "intptr_t*", get = HotSpotVMField.Type.OFFSET) @Stable public int deoptimizationUnrollBlockFrameSizesOffset;
1525 @HotSpotVMField(name = "Deoptimization::UnrollBlock::_frame_pcs", type = "address*", get = HotSpotVMField.Type.OFFSET) @Stable public int deoptimizationUnrollBlockFramePcsOffset;
1526 @HotSpotVMField(name = "Deoptimization::UnrollBlock::_initial_info", type = "intptr_t", get = HotSpotVMField.Type.OFFSET) @Stable public int deoptimizationUnrollBlockInitialInfoOffset;
1527
1528 @HotSpotVMConstant(name = "vmIntrinsics::_invokeBasic") @Stable public int vmIntrinsicInvokeBasic;
1529 @HotSpotVMConstant(name = "vmIntrinsics::_linkToVirtual") @Stable public int vmIntrinsicLinkToVirtual;
1530 @HotSpotVMConstant(name = "vmIntrinsics::_linkToStatic") @Stable public int vmIntrinsicLinkToStatic;
1531 @HotSpotVMConstant(name = "vmIntrinsics::_linkToSpecial") @Stable public int vmIntrinsicLinkToSpecial;
1532 @HotSpotVMConstant(name = "vmIntrinsics::_linkToInterface") @Stable public int vmIntrinsicLinkToInterface;
1533
1534 @HotSpotVMConstant(name = "JVMCIEnv::ok") @Stable public int codeInstallResultOk;
1535 @HotSpotVMConstant(name = "JVMCIEnv::dependencies_failed") @Stable public int codeInstallResultDependenciesFailed;
1536 @HotSpotVMConstant(name = "JVMCIEnv::dependencies_invalid") @Stable public int codeInstallResultDependenciesInvalid;
1537 @HotSpotVMConstant(name = "JVMCIEnv::cache_full") @Stable public int codeInstallResultCacheFull;
1538 @HotSpotVMConstant(name = "JVMCIEnv::code_too_large") @Stable public int codeInstallResultCodeTooLarge;
1539 811
1540 public String getCodeInstallResultDescription(int codeInstallResult) { 812 public String getCodeInstallResultDescription(int codeInstallResult) {
1541 if (codeInstallResult == codeInstallResultOk) { 813 if (codeInstallResult == codeInstallResultOk) {
1542 return "ok"; 814 return "ok";
1543 } 815 }
1555 } 827 }
1556 assert false : codeInstallResult; 828 assert false : codeInstallResult;
1557 return "unknown"; 829 return "unknown";
1558 } 830 }
1559 831
1560 @HotSpotVMConstant(name = "CompilerToVM::KLASS_TAG") @Stable public int compilerToVMKlassTag; 832 public final int compilerToVMKlassTag = getConstant("CompilerToVM::KLASS_TAG", Integer.class);
1561 @HotSpotVMConstant(name = "CompilerToVM::SYMBOL_TAG") @Stable public int compilerToVMSymbolTag; 833 public final int compilerToVMSymbolTag = getConstant("CompilerToVM::SYMBOL_TAG", Integer.class);
1562 834
1563 // Checkstyle: stop 835 // Checkstyle: stop
1564 @HotSpotVMConstant(name = "CodeInstaller::VERIFIED_ENTRY") @Stable public int MARKID_VERIFIED_ENTRY; 836 // public final int MARKID_VERIFIED_ENTRY = getConstant("CodeInstaller::VERIFIED_ENTRY",
1565 @HotSpotVMConstant(name = "CodeInstaller::UNVERIFIED_ENTRY") @Stable public int MARKID_UNVERIFIED_ENTRY; 837 // Integer.class);
1566 @HotSpotVMConstant(name = "CodeInstaller::OSR_ENTRY") @Stable public int MARKID_OSR_ENTRY; 838 // public final int MARKID_UNVERIFIED_ENTRY = getConstant("CodeInstaller::UNVERIFIED_ENTRY",
1567 @HotSpotVMConstant(name = "CodeInstaller::EXCEPTION_HANDLER_ENTRY") @Stable public int MARKID_EXCEPTION_HANDLER_ENTRY; 839 // Integer.class);
1568 @HotSpotVMConstant(name = "CodeInstaller::DEOPT_HANDLER_ENTRY") @Stable public int MARKID_DEOPT_HANDLER_ENTRY; 840 // public final int MARKID_OSR_ENTRY = getConstant("CodeInstaller::OSR_ENTRY", Integer.class);
1569 @HotSpotVMConstant(name = "CodeInstaller::INVOKEINTERFACE") @Stable public int MARKID_INVOKEINTERFACE; 841 // public final int MARKID_EXCEPTION_HANDLER_ENTRY =
1570 @HotSpotVMConstant(name = "CodeInstaller::INVOKEVIRTUAL") @Stable public int MARKID_INVOKEVIRTUAL; 842 // getConstant("CodeInstaller::EXCEPTION_HANDLER_ENTRY", Integer.class);
1571 @HotSpotVMConstant(name = "CodeInstaller::INVOKESTATIC") @Stable public int MARKID_INVOKESTATIC; 843 // public final int MARKID_DEOPT_HANDLER_ENTRY = getConstant("CodeInstaller::DEOPT_HANDLER_ENTRY",
1572 @HotSpotVMConstant(name = "CodeInstaller::INVOKESPECIAL") @Stable public int MARKID_INVOKESPECIAL; 844 // Integer.class);
1573 @HotSpotVMConstant(name = "CodeInstaller::INLINE_INVOKE") @Stable public int MARKID_INLINE_INVOKE; 845 // public final int MARKID_INVOKEINTERFACE = getConstant("CodeInstaller::INVOKEINTERFACE",
1574 @HotSpotVMConstant(name = "CodeInstaller::POLL_NEAR") @Stable public int MARKID_POLL_NEAR; 846 // Integer.class);
1575 @HotSpotVMConstant(name = "CodeInstaller::POLL_RETURN_NEAR") @Stable public int MARKID_POLL_RETURN_NEAR; 847 // public final int MARKID_INVOKEVIRTUAL = getConstant("CodeInstaller::INVOKEVIRTUAL",
1576 @HotSpotVMConstant(name = "CodeInstaller::POLL_FAR") @Stable public int MARKID_POLL_FAR; 848 // Integer.class);
1577 @HotSpotVMConstant(name = "CodeInstaller::POLL_RETURN_FAR") @Stable public int MARKID_POLL_RETURN_FAR; 849 // public final int MARKID_INVOKESTATIC = getConstant("CodeInstaller::INVOKESTATIC", Integer.class);
1578 @HotSpotVMConstant(name = "CodeInstaller::CARD_TABLE_SHIFT") @Stable public int MARKID_CARD_TABLE_SHIFT; 850 // public final int MARKID_INVOKESPECIAL = getConstant("CodeInstaller::INVOKESPECIAL",
1579 @HotSpotVMConstant(name = "CodeInstaller::CARD_TABLE_ADDRESS") @Stable public int MARKID_CARD_TABLE_ADDRESS; 851 // Integer.class);
1580 @HotSpotVMConstant(name = "CodeInstaller::INVOKE_INVALID") @Stable public int MARKID_INVOKE_INVALID; 852 // public final int MARKID_INLINE_INVOKE = getConstant("CodeInstaller::INLINE_INVOKE",
1581 853 // Integer.class);
1582 @HotSpotVMConstant(name = "BitData::exception_seen_flag") @Stable public int bitDataExceptionSeenFlag; 854 // public final int MARKID_POLL_NEAR = getConstant("CodeInstaller::POLL_NEAR", Integer.class);
1583 @HotSpotVMConstant(name = "BitData::null_seen_flag") @Stable public int bitDataNullSeenFlag; 855 // public final int MARKID_POLL_RETURN_NEAR = getConstant("CodeInstaller::POLL_RETURN_NEAR",
1584 @HotSpotVMConstant(name = "CounterData::count_off") @Stable public int methodDataCountOffset; 856 // Integer.class);
1585 @HotSpotVMConstant(name = "JumpData::taken_off_set") @Stable public int jumpDataTakenOffset; 857 // public final int MARKID_POLL_FAR = getConstant("CodeInstaller::POLL_FAR", Integer.class);
1586 @HotSpotVMConstant(name = "JumpData::displacement_off_set") @Stable public int jumpDataDisplacementOffset; 858 // public final int MARKID_POLL_RETURN_FAR = getConstant("CodeInstaller::POLL_RETURN_FAR",
1587 @HotSpotVMConstant(name = "ReceiverTypeData::nonprofiled_count_off_set") @Stable public int receiverTypeDataNonprofiledCountOffset; 859 // Integer.class);
1588 @HotSpotVMConstant(name = "ReceiverTypeData::receiver_type_row_cell_count") @Stable public int receiverTypeDataReceiverTypeRowCellCount; 860 // public final int MARKID_CARD_TABLE_SHIFT = getConstant("CodeInstaller::CARD_TABLE_SHIFT",
1589 @HotSpotVMConstant(name = "ReceiverTypeData::receiver0_offset") @Stable public int receiverTypeDataReceiver0Offset; 861 // Integer.class);
1590 @HotSpotVMConstant(name = "ReceiverTypeData::count0_offset") @Stable public int receiverTypeDataCount0Offset; 862 // public final int MARKID_CARD_TABLE_ADDRESS = getConstant("CodeInstaller::CARD_TABLE_ADDRESS",
1591 @HotSpotVMConstant(name = "BranchData::not_taken_off_set") @Stable public int branchDataNotTakenOffset; 863 // Integer.class);
1592 @HotSpotVMConstant(name = "ArrayData::array_len_off_set") @Stable public int arrayDataArrayLenOffset; 864 // public final int MARKID_INVOKE_INVALID = getConstant("CodeInstaller::INVOKE_INVALID",
1593 @HotSpotVMConstant(name = "ArrayData::array_start_off_set") @Stable public int arrayDataArrayStartOffset; 865 // Integer.class);
1594 @HotSpotVMConstant(name = "MultiBranchData::per_case_cell_count") @Stable public int multiBranchDataPerCaseCellCount; 866
867 public final int bitDataExceptionSeenFlag = getConstant("BitData::exception_seen_flag", Integer.class);
868 public final int bitDataNullSeenFlag = getConstant("BitData::null_seen_flag", Integer.class);
869 public final int methodDataCountOffset = getConstant("CounterData::count_off", Integer.class);
870 public final int jumpDataTakenOffset = getConstant("JumpData::taken_off_set", Integer.class);
871 public final int jumpDataDisplacementOffset = getConstant("JumpData::displacement_off_set", Integer.class);
872 public final int receiverTypeDataNonprofiledCountOffset = getConstant("ReceiverTypeData::nonprofiled_count_off_set", Integer.class);
873 public final int receiverTypeDataReceiverTypeRowCellCount = getConstant("ReceiverTypeData::receiver_type_row_cell_count", Integer.class);
874 public final int receiverTypeDataReceiver0Offset = getConstant("ReceiverTypeData::receiver0_offset", Integer.class);
875 public final int receiverTypeDataCount0Offset = getConstant("ReceiverTypeData::count0_offset", Integer.class);
876 public final int branchDataNotTakenOffset = getConstant("BranchData::not_taken_off_set", Integer.class);
877 public final int arrayDataArrayLenOffset = getConstant("ArrayData::array_len_off_set", Integer.class);
878 public final int arrayDataArrayStartOffset = getConstant("ArrayData::array_start_off_set", Integer.class);
879 public final int multiBranchDataPerCaseCellCount = getConstant("MultiBranchData::per_case_cell_count", Integer.class);
1595 880
1596 // Checkstyle: resume 881 // Checkstyle: resume
1597 882
1598 public boolean check() { 883 public boolean check() {
1599 for (Field f : getClass().getDeclaredFields()) { 884 for (Field f : getClass().getDeclaredFields()) {
1601 if (Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers)) { 886 if (Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers)) {
1602 assert Modifier.isFinal(modifiers) || f.getAnnotation(Stable.class) != null : "field should either be final or @Stable: " + f; 887 assert Modifier.isFinal(modifiers) || f.getAnnotation(Stable.class) != null : "field should either be final or @Stable: " + f;
1603 } 888 }
1604 } 889 }
1605 890
1606 assert codeEntryAlignment > 0 : codeEntryAlignment;
1607 assert (layoutHelperArrayTagObjectValue & (1 << (Integer.SIZE - 1))) != 0 : "object array must have first bit set"; 891 assert (layoutHelperArrayTagObjectValue & (1 << (Integer.SIZE - 1))) != 0 : "object array must have first bit set";
1608 assert (layoutHelperArrayTagTypeValue & (1 << (Integer.SIZE - 1))) != 0 : "type array must have first bit set"; 892 assert (layoutHelperArrayTagTypeValue & (1 << (Integer.SIZE - 1))) != 0 : "type array must have first bit set";
1609 893
1610 return true; 894 return true;
1611 } 895 }
1612
1613 /**
1614 * A compact representation of the different encoding strategies for Objects and metadata.
1615 */
1616 public static class CompressEncoding {
1617 public final long base;
1618 public final int shift;
1619 public final int alignment;
1620
1621 CompressEncoding(long base, int shift, int alignment) {
1622 this.base = base;
1623 this.shift = shift;
1624 this.alignment = alignment;
1625 }
1626
1627 public int compress(long ptr) {
1628 if (ptr == 0L) {
1629 return 0;
1630 } else {
1631 return (int) ((ptr - base) >>> shift);
1632 }
1633 }
1634
1635 public long uncompress(int ptr) {
1636 if (ptr == 0) {
1637 return 0L;
1638 } else {
1639 return ((ptr & 0xFFFFFFFFL) << shift) + base;
1640 }
1641 }
1642
1643 @Override
1644 public String toString() {
1645 return "base: " + base + " shift: " + shift + " alignment: " + alignment;
1646 }
1647
1648 @Override
1649 public int hashCode() {
1650 final int prime = 31;
1651 int result = 1;
1652 result = prime * result + alignment;
1653 result = prime * result + (int) (base ^ (base >>> 32));
1654 result = prime * result + shift;
1655 return result;
1656 }
1657
1658 @Override
1659 public boolean equals(Object obj) {
1660 if (obj instanceof CompressEncoding) {
1661 CompressEncoding other = (CompressEncoding) obj;
1662 return alignment == other.alignment && base == other.base && shift == other.shift;
1663 } else {
1664 return false;
1665 }
1666 }
1667 }
1668
1669 /**
1670 * Returns the name of the C/C++ symbol that is associated (via HotSpotVMValue annotation) with
1671 * the HotSpotVMConfig object's field containing {@code value}; returns null if no field holds
1672 * the provided address.
1673 *
1674 * @param value value of the field
1675 * @return C/C++ symbol name or null
1676 */
1677 public String getVMValueCSymbol(long value) {
1678 for (Field f : HotSpotVMConfig.class.getDeclaredFields()) {
1679 if (f.isAnnotationPresent(HotSpotVMValue.class)) {
1680 HotSpotVMValue annotation = f.getAnnotation(HotSpotVMValue.class);
1681
1682 if (annotation.get() == HotSpotVMValue.Type.ADDRESS) {
1683 try {
1684 if (value == f.getLong(this)) {
1685 return (annotation.expression() + annotation.signature());
1686 }
1687 } catch (IllegalArgumentException e1) {
1688 // TODO Auto-generated catch block
1689 e1.printStackTrace();
1690 } catch (IllegalAccessException e1) {
1691 // TODO Auto-generated catch block
1692 e1.printStackTrace();
1693 }
1694 }
1695 }
1696 }
1697 return null;
1698 }
1699
1700 /**
1701 * Returns the name of the C/C++ symbol that is associated (via HotSpotVMField annotation) with
1702 * the HotSpotVMConfig object's field containing {@code value}; returns null if no field holds
1703 * the provided address.
1704 *
1705 * @param value value of the field
1706 * @return C/C++ symbol name or null
1707 */
1708 public String getVMFieldCSymbol(long value) {
1709 for (Field f : HotSpotVMConfig.class.getDeclaredFields()) {
1710 if (f.isAnnotationPresent(HotSpotVMField.class)) {
1711 HotSpotVMField annotation = f.getAnnotation(HotSpotVMField.class);
1712
1713 if (annotation.get() == HotSpotVMField.Type.VALUE) {
1714 try {
1715 if (value == f.getLong(this)) {
1716 return (annotation.name());
1717 }
1718 } catch (IllegalArgumentException e1) {
1719 // TODO Auto-generated catch block
1720 e1.printStackTrace();
1721 } catch (IllegalAccessException e1) {
1722 // TODO Auto-generated catch block
1723 e1.printStackTrace();
1724 }
1725 }
1726 }
1727 }
1728 return null;
1729 }
1730 } 896 }