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