comparison graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotVMConfig.java @ 21551:5324104ac4f3

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