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