< prev index next >
src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java
Print this page
*** 21,30 ****
--- 21,33 ----
* questions.
*/
package jdk.vm.ci.hotspot;
import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
+ import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
+
+ import jdk.internal.misc.Unsafe;
/**
* Used to access native configuration details.
*
* All non-static, public fields in this class are so that they can be compiled as constants.
*** 48,64 ****
* Gets the host architecture name for the purpose of finding the corresponding
* {@linkplain HotSpotJVMCIBackendFactory backend}.
*/
String getHostArchitectureName() {
String arch = System.getProperty("os.arch");
! switch (arch) {
! case "x86_64":
arch = "amd64";
! break;
! case "sparcv9":
arch = "sparc";
- break;
}
return arch;
}
final boolean useDeferredInitBarriers = getFlag("ReduceInitialCardMarks", Boolean.class);
--- 51,64 ----
* Gets the host architecture name for the purpose of finding the corresponding
* {@linkplain HotSpotJVMCIBackendFactory backend}.
*/
String getHostArchitectureName() {
String arch = System.getProperty("os.arch");
! if (arch.equals("x86_64")) {
arch = "amd64";
! } else if (arch.equals("sparcv9")) {
arch = "sparc";
}
return arch;
}
final boolean useDeferredInitBarriers = getFlag("ReduceInitialCardMarks", Boolean.class);
*** 229,238 ****
--- 229,253 ----
final long vmSymbolsSymbols = getFieldAddress("vmSymbols::_symbols[0]", "Symbol*");
final int vmSymbolsFirstSID = getConstant("vmSymbols::FIRST_SID", Integer.class);
final int vmSymbolsSIDLimit = getConstant("vmSymbols::SID_LIMIT", Integer.class);
+ /**
+ * Returns the symbol in the {@code vmSymbols} table at position {@code index} as a
+ * {@link String}.
+ *
+ * @param index position in the symbol table
+ * @return the symbol at position id
+ */
+ String symbolAt(int index) {
+ HotSpotJVMCIRuntimeProvider runtime = runtime();
+ assert vmSymbolsFirstSID <= index && index < vmSymbolsSIDLimit : "index " + index + " is out of bounds";
+ assert symbolPointerSize == Unsafe.ADDRESS_SIZE : "the following address read is broken";
+ int offset = index * symbolPointerSize;
+ return runtime.getCompilerToVM().getSymbol(UNSAFE.getAddress(vmSymbolsSymbols + offset));
+ }
+
final int universeBaseVtableSize = getFieldValue("CompilerToVM::Data::Universe_base_vtable_size", Integer.class, "int");
final int baseVtableLength() {
return universeBaseVtableSize / vtableEntrySize;
}
< prev index next >