comparison jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @ 22672:1bbd4a7c274b

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