1 /*
   2  * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 package jdk.vm.ci.hotspot;
  24 
  25 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
  26 import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
  27 
  28 import jdk.internal.misc.Unsafe;
  29 
  30 /**
  31  * Used to access native configuration details.
  32  *
  33  * All non-static, public fields in this class are so that they can be compiled as constants.
  34  */
  35 class HotSpotVMConfig extends HotSpotVMConfigAccess {
  36 
  37     /**
  38      * Gets the configuration associated with the singleton {@link HotSpotJVMCIRuntime}.
  39      */
  40     static HotSpotVMConfig config() {
  41         return runtime().getConfig();
  42     }
  43 
  44     private final String osArch = getHostArchitectureName();
  45 
  46     HotSpotVMConfig(HotSpotVMConfigStore store) {
  47         super(store);
  48     }
  49 
  50     /**
  51      * Gets the host architecture name for the purpose of finding the corresponding
  52      * {@linkplain HotSpotJVMCIBackendFactory backend}.
  53      */
  54     String getHostArchitectureName() {
  55         String arch = System.getProperty("os.arch");
  56         switch (arch) {
  57             case "x86_64":
  58                 return "amd64";
  59 
  60             case "sparcv9":
  61                 return "sparc";
  62             default:
  63                 return arch;
  64         }
  65     }
  66 
  67     final boolean useDeferredInitBarriers = getFlag("ReduceInitialCardMarks", Boolean.class);
  68 
  69     final boolean useCompressedOops = getFlag("UseCompressedOops", Boolean.class);
  70 
  71     final int prototypeMarkWordOffset = getFieldOffset("Klass::_prototype_header", Integer.class, "markOop");
  72     final int subklassOffset = getFieldOffset("Klass::_subklass", Integer.class, "Klass*");
  73     final int nextSiblingOffset = getFieldOffset("Klass::_next_sibling", Integer.class, "Klass*");
  74     final int superCheckOffsetOffset = getFieldOffset("Klass::_super_check_offset", Integer.class, "juint");
  75     final int secondarySuperCacheOffset = getFieldOffset("Klass::_secondary_super_cache", Integer.class, "Klass*");
  76 
  77     /**
  78      * The offset of the _java_mirror field (of type {@link Class}) in a Klass.
  79      */
  80     final int classMirrorOffset = getFieldOffset("Klass::_java_mirror", Integer.class, "oop");
  81 
  82     final int klassAccessFlagsOffset = getFieldOffset("Klass::_access_flags", Integer.class, "AccessFlags");
  83     final int klassLayoutHelperOffset = getFieldOffset("Klass::_layout_helper", Integer.class, "jint");
  84 
  85     final int klassLayoutHelperNeutralValue = getConstant("Klass::_lh_neutral_value", Integer.class);
  86     final int klassLayoutHelperInstanceSlowPathBit = getConstant("Klass::_lh_instance_slow_path_bit", Integer.class);
  87 
  88     final int vtableEntrySize = getTypeSize("vtableEntry");
  89     final int vtableEntryMethodOffset = getFieldOffset("vtableEntry::_method", Integer.class, "Method*");
  90 
  91     final int instanceKlassSourceFileNameIndexOffset = getFieldOffset("InstanceKlass::_source_file_name_index", Integer.class, "u2");
  92     final int instanceKlassInitStateOffset = getFieldOffset("InstanceKlass::_init_state", Integer.class, "u1");
  93     final int instanceKlassConstantsOffset = getFieldOffset("InstanceKlass::_constants", Integer.class, "ConstantPool*");
  94     final int instanceKlassFieldsOffset = getFieldOffset("InstanceKlass::_fields", Integer.class, "Array<u2>*");
  95     final int klassVtableStartOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_start_offset", Integer.class, "int");
  96     final int klassVtableLengthOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_length_offset", Integer.class, "int");
  97 
  98     final int instanceKlassStateLinked = getConstant("InstanceKlass::linked", Integer.class);
  99     final int instanceKlassStateFullyInitialized = getConstant("InstanceKlass::fully_initialized", Integer.class);
 100 
 101     final int arrayU1LengthOffset = getFieldOffset("Array<int>::_length", Integer.class, "int");
 102     final int arrayU1DataOffset = getFieldOffset("Array<u1>::_data", Integer.class);
 103     final int arrayU2DataOffset = getFieldOffset("Array<u2>::_data", Integer.class);
 104 
 105     final int fieldInfoAccessFlagsOffset = getConstant("FieldInfo::access_flags_offset", Integer.class);
 106     final int fieldInfoNameIndexOffset = getConstant("FieldInfo::name_index_offset", Integer.class);
 107     final int fieldInfoSignatureIndexOffset = getConstant("FieldInfo::signature_index_offset", Integer.class);
 108     final int fieldInfoLowPackedOffset = getConstant("FieldInfo::low_packed_offset", Integer.class);
 109     final int fieldInfoHighPackedOffset = getConstant("FieldInfo::high_packed_offset", Integer.class);
 110     final int fieldInfoFieldSlots = getConstant("FieldInfo::field_slots", Integer.class);
 111 
 112     final int fieldInfoTagSize = getConstant("FIELDINFO_TAG_SIZE", Integer.class);
 113 
 114     final int jvmAccHasFinalizer = getConstant("JVM_ACC_HAS_FINALIZER", Integer.class);
 115     final int jvmAccFieldInternal = getConstant("JVM_ACC_FIELD_INTERNAL", Integer.class);
 116     final int jvmAccFieldStable = getConstant("JVM_ACC_FIELD_STABLE", Integer.class);
 117     final int jvmAccFieldHasGenericSignature = getConstant("JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE", Integer.class);
 118     final int jvmAccIsCloneableFast = getConstant("JVM_ACC_IS_CLONEABLE_FAST", Integer.class);
 119 
 120     // Modifier.SYNTHETIC is not public so we get it via vmStructs.
 121     final int jvmAccSynthetic = getConstant("JVM_ACC_SYNTHETIC", Integer.class);
 122 
 123     // This is only valid on AMD64.
 124     final int runtimeCallStackSize = getConstant("frame::arg_reg_save_area_bytes", Integer.class, osArch.equals("amd64") ? null : 0);
 125 
 126     private final int markWordNoHashInPlace = getConstant("markOopDesc::no_hash_in_place", Integer.class);
 127     private final int markWordNoLockInPlace = getConstant("markOopDesc::no_lock_in_place", Integer.class);
 128 
 129     /**
 130      * See {@code markOopDesc::prototype()}.
 131      */
 132     long arrayPrototypeMarkWord() {
 133         return markWordNoHashInPlace | markWordNoLockInPlace;
 134     }
 135 
 136     final int methodAccessFlagsOffset = getFieldOffset("Method::_access_flags", Integer.class, "AccessFlags");
 137     final int methodConstMethodOffset = getFieldOffset("Method::_constMethod", Integer.class, "ConstMethod*");
 138     final int methodIntrinsicIdOffset = getFieldOffset("Method::_intrinsic_id", Integer.class, "u2");
 139     final int methodFlagsOffset = getFieldOffset("Method::_flags", Integer.class, "u2");
 140     final int methodVtableIndexOffset = getFieldOffset("Method::_vtable_index", Integer.class, "int");
 141 
 142     final int methodDataOffset = getFieldOffset("Method::_method_data", Integer.class, "MethodData*");
 143     final int methodCodeOffset = getFieldOffset("Method::_code", Integer.class, "CompiledMethod*");
 144 
 145     final int methodFlagsCallerSensitive = getConstant("Method::_caller_sensitive", Integer.class);
 146     final int methodFlagsForceInline = getConstant("Method::_force_inline", Integer.class);
 147     final int methodFlagsDontInline = getConstant("Method::_dont_inline", Integer.class);
 148     final int methodFlagsReservedStackAccess = getConstant("Method::_reserved_stack_access", Integer.class);
 149     final int nonvirtualVtableIndex = getConstant("Method::nonvirtual_vtable_index", Integer.class);
 150     final int invalidVtableIndex = getConstant("Method::invalid_vtable_index", Integer.class);
 151 
 152     final int methodDataSize = getFieldOffset("MethodData::_size", Integer.class, "int");
 153     final int methodDataDataSize = getFieldOffset("MethodData::_data_size", Integer.class, "int");
 154     final int methodDataOopDataOffset = getFieldOffset("MethodData::_data[0]", Integer.class, "intptr_t");
 155     final int methodDataOopTrapHistoryOffset = getFieldOffset("MethodData::_trap_hist._array[0]", Integer.class, "u1");
 156     final int methodDataIRSizeOffset = getFieldOffset("MethodData::_jvmci_ir_size", Integer.class, "int");
 157 
 158     final int nmethodCompLevelOffset = getFieldOffset("nmethod::_comp_level", Integer.class, "int");
 159 
 160     final int compilationLevelNone = getConstant("CompLevel_none", Integer.class);
 161     final int compilationLevelSimple = getConstant("CompLevel_simple", Integer.class);
 162     final int compilationLevelLimitedProfile = getConstant("CompLevel_limited_profile", Integer.class);
 163     final int compilationLevelFullProfile = getConstant("CompLevel_full_profile", Integer.class);
 164     final int compilationLevelFullOptimization = getConstant("CompLevel_full_optimization", Integer.class);
 165 
 166     final int compLevelAdjustmentNone = getConstant("JVMCIRuntime::none", Integer.class);
 167     final int compLevelAdjustmentByHolder = getConstant("JVMCIRuntime::by_holder", Integer.class);
 168     final int compLevelAdjustmentByFullSignature = getConstant("JVMCIRuntime::by_full_signature", Integer.class);
 169 
 170     final int invocationEntryBci = getConstant("InvocationEntryBci", Integer.class);
 171 
 172     final int extraStackEntries = getFieldValue("CompilerToVM::Data::Method_extra_stack_entries", Integer.class, "int");
 173 
 174     final int constMethodConstantsOffset = getFieldOffset("ConstMethod::_constants", Integer.class, "ConstantPool*");
 175     final int constMethodFlagsOffset = getFieldOffset("ConstMethod::_flags", Integer.class, "u2");
 176     final int constMethodCodeSizeOffset = getFieldOffset("ConstMethod::_code_size", Integer.class, "u2");
 177     final int constMethodNameIndexOffset = getFieldOffset("ConstMethod::_name_index", Integer.class, "u2");
 178     final int constMethodSignatureIndexOffset = getFieldOffset("ConstMethod::_signature_index", Integer.class, "u2");
 179     final int constMethodMaxStackOffset = getFieldOffset("ConstMethod::_max_stack", Integer.class, "u2");
 180     final int methodMaxLocalsOffset = getFieldOffset("ConstMethod::_max_locals", Integer.class, "u2");
 181 
 182     final int constMethodHasLineNumberTable = getConstant("ConstMethod::_has_linenumber_table", Integer.class);
 183     final int constMethodHasLocalVariableTable = getConstant("ConstMethod::_has_localvariable_table", Integer.class);
 184     final int constMethodHasExceptionTable = getConstant("ConstMethod::_has_exception_table", Integer.class);
 185 
 186     final int exceptionTableElementSize = getTypeSize("ExceptionTableElement");
 187     final int exceptionTableElementStartPcOffset = getFieldOffset("ExceptionTableElement::start_pc", Integer.class, "u2");
 188     final int exceptionTableElementEndPcOffset = getFieldOffset("ExceptionTableElement::end_pc", Integer.class, "u2");
 189     final int exceptionTableElementHandlerPcOffset = getFieldOffset("ExceptionTableElement::handler_pc", Integer.class, "u2");
 190     final int exceptionTableElementCatchTypeIndexOffset = getFieldOffset("ExceptionTableElement::catch_type_index", Integer.class, "u2");
 191 
 192     final int localVariableTableElementSize = getTypeSize("LocalVariableTableElement");
 193     final int localVariableTableElementStartBciOffset = getFieldOffset("LocalVariableTableElement::start_bci", Integer.class, "u2");
 194     final int localVariableTableElementLengthOffset = getFieldOffset("LocalVariableTableElement::length", Integer.class, "u2");
 195     final int localVariableTableElementNameCpIndexOffset = getFieldOffset("LocalVariableTableElement::name_cp_index", Integer.class, "u2");
 196     final int localVariableTableElementDescriptorCpIndexOffset = getFieldOffset("LocalVariableTableElement::descriptor_cp_index", Integer.class, "u2");
 197     final int localVariableTableElementSlotOffset = getFieldOffset("LocalVariableTableElement::slot", Integer.class, "u2");
 198 
 199     final int constantPoolSize = getTypeSize("ConstantPool");
 200     final int constantPoolTagsOffset = getFieldOffset("ConstantPool::_tags", Integer.class, "Array<u1>*");
 201     final int constantPoolHolderOffset = getFieldOffset("ConstantPool::_pool_holder", Integer.class, "InstanceKlass*");
 202     final int constantPoolLengthOffset = getFieldOffset("ConstantPool::_length", Integer.class, "int");
 203 
 204     final int constantPoolCpCacheIndexTag = getConstant("ConstantPool::CPCACHE_INDEX_TAG", Integer.class);
 205 
 206     final int jvmConstantUtf8 = getConstant("JVM_CONSTANT_Utf8", Integer.class);
 207     final int jvmConstantInteger = getConstant("JVM_CONSTANT_Integer", Integer.class);
 208     final int jvmConstantLong = getConstant("JVM_CONSTANT_Long", Integer.class);
 209     final int jvmConstantFloat = getConstant("JVM_CONSTANT_Float", Integer.class);
 210     final int jvmConstantDouble = getConstant("JVM_CONSTANT_Double", Integer.class);
 211     final int jvmConstantClass = getConstant("JVM_CONSTANT_Class", Integer.class);
 212     final int jvmConstantUnresolvedClass = getConstant("JVM_CONSTANT_UnresolvedClass", Integer.class);
 213     final int jvmConstantUnresolvedClassInError = getConstant("JVM_CONSTANT_UnresolvedClassInError", Integer.class);
 214     final int jvmConstantString = getConstant("JVM_CONSTANT_String", Integer.class);
 215     final int jvmConstantFieldref = getConstant("JVM_CONSTANT_Fieldref", Integer.class);
 216     final int jvmConstantMethodref = getConstant("JVM_CONSTANT_Methodref", Integer.class);
 217     final int jvmConstantInterfaceMethodref = getConstant("JVM_CONSTANT_InterfaceMethodref", Integer.class);
 218     final int jvmConstantNameAndType = getConstant("JVM_CONSTANT_NameAndType", Integer.class);
 219     final int jvmConstantMethodHandle = getConstant("JVM_CONSTANT_MethodHandle", Integer.class);
 220     final int jvmConstantMethodHandleInError = getConstant("JVM_CONSTANT_MethodHandleInError", Integer.class);
 221     final int jvmConstantMethodType = getConstant("JVM_CONSTANT_MethodType", Integer.class);
 222     final int jvmConstantMethodTypeInError = getConstant("JVM_CONSTANT_MethodTypeInError", Integer.class);
 223     final int jvmConstantInvokeDynamic = getConstant("JVM_CONSTANT_InvokeDynamic", Integer.class);
 224 
 225     final int jvmConstantExternalMax = getConstant("JVM_CONSTANT_ExternalMax", Integer.class);
 226     final int jvmConstantInternalMin = getConstant("JVM_CONSTANT_InternalMin", Integer.class);
 227     final int jvmConstantInternalMax = getConstant("JVM_CONSTANT_InternalMax", Integer.class);
 228 
 229     final int heapWordSize = getConstant("HeapWordSize", Integer.class);
 230 
 231     final int symbolPointerSize = getTypeSize("Symbol*");
 232 
 233     final long vmSymbolsSymbols = getFieldAddress("vmSymbols::_symbols[0]", "Symbol*");
 234     final int vmSymbolsFirstSID = getConstant("vmSymbols::FIRST_SID", Integer.class);
 235     final int vmSymbolsSIDLimit = getConstant("vmSymbols::SID_LIMIT", Integer.class);
 236 
 237     /**
 238      * Returns the symbol in the {@code vmSymbols} table at position {@code index} as a
 239      * {@link String}.
 240      *
 241      * @param index position in the symbol table
 242      * @return the symbol at position id
 243      */
 244     String symbolAt(int index) {
 245         HotSpotJVMCIRuntimeProvider runtime = runtime();
 246         assert vmSymbolsFirstSID <= index && index < vmSymbolsSIDLimit : "index " + index + " is out of bounds";
 247         assert symbolPointerSize == Unsafe.ADDRESS_SIZE : "the following address read is broken";
 248         int offset = index * symbolPointerSize;
 249         return runtime.getCompilerToVM().getSymbol(UNSAFE.getAddress(vmSymbolsSymbols + offset));
 250     }
 251 
 252     final int universeBaseVtableSize = getFieldValue("CompilerToVM::Data::Universe_base_vtable_size", Integer.class, "int");
 253 
 254     final int baseVtableLength() {
 255         return universeBaseVtableSize / vtableEntrySize;
 256     }
 257 
 258     final int klassOffset = getFieldValue("java_lang_Class::_klass_offset", Integer.class, "int");
 259 
 260     /**
 261      * The DataLayout header size is the same as the cell size.
 262      */
 263     final int dataLayoutHeaderSize = getConstant("DataLayout::cell_size", Integer.class);
 264     final int dataLayoutTagOffset = getFieldOffset("DataLayout::_header._struct._tag", Integer.class, "u1");
 265     final int dataLayoutFlagsOffset = getFieldOffset("DataLayout::_header._struct._flags", Integer.class, "u1");
 266     final int dataLayoutBCIOffset = getFieldOffset("DataLayout::_header._struct._bci", Integer.class, "u2");
 267     final int dataLayoutCellSize = getConstant("DataLayout::cell_size", Integer.class);
 268 
 269     final int dataLayoutNoTag = getConstant("DataLayout::no_tag", Integer.class);
 270     final int dataLayoutBitDataTag = getConstant("DataLayout::bit_data_tag", Integer.class);
 271     final int dataLayoutCounterDataTag = getConstant("DataLayout::counter_data_tag", Integer.class);
 272     final int dataLayoutJumpDataTag = getConstant("DataLayout::jump_data_tag", Integer.class);
 273     final int dataLayoutReceiverTypeDataTag = getConstant("DataLayout::receiver_type_data_tag", Integer.class);
 274     final int dataLayoutVirtualCallDataTag = getConstant("DataLayout::virtual_call_data_tag", Integer.class);
 275     final int dataLayoutRetDataTag = getConstant("DataLayout::ret_data_tag", Integer.class);
 276     final int dataLayoutBranchDataTag = getConstant("DataLayout::branch_data_tag", Integer.class);
 277     final int dataLayoutMultiBranchDataTag = getConstant("DataLayout::multi_branch_data_tag", Integer.class);
 278     final int dataLayoutArgInfoDataTag = getConstant("DataLayout::arg_info_data_tag", Integer.class);
 279     final int dataLayoutCallTypeDataTag = getConstant("DataLayout::call_type_data_tag", Integer.class);
 280     final int dataLayoutVirtualCallTypeDataTag = getConstant("DataLayout::virtual_call_type_data_tag", Integer.class);
 281     final int dataLayoutParametersTypeDataTag = getConstant("DataLayout::parameters_type_data_tag", Integer.class);
 282     final int dataLayoutSpeculativeTrapDataTag = getConstant("DataLayout::speculative_trap_data_tag", Integer.class);
 283 
 284     final int bciProfileWidth = getFlag("BciProfileWidth", Integer.class);
 285     final int typeProfileWidth = getFlag("TypeProfileWidth", Integer.class);
 286     final int methodProfileWidth = getFlag("MethodProfileWidth", Integer.class);
 287 
 288     final int deoptReasonNone = getConstant("Deoptimization::Reason_none", Integer.class);
 289     final int deoptReasonNullCheck = getConstant("Deoptimization::Reason_null_check", Integer.class);
 290     final int deoptReasonRangeCheck = getConstant("Deoptimization::Reason_range_check", Integer.class);
 291     final int deoptReasonClassCheck = getConstant("Deoptimization::Reason_class_check", Integer.class);
 292     final int deoptReasonArrayCheck = getConstant("Deoptimization::Reason_array_check", Integer.class);
 293     final int deoptReasonUnreached0 = getConstant("Deoptimization::Reason_unreached0", Integer.class);
 294     final int deoptReasonTypeCheckInlining = getConstant("Deoptimization::Reason_type_checked_inlining", Integer.class);
 295     final int deoptReasonOptimizedTypeCheck = getConstant("Deoptimization::Reason_optimized_type_check", Integer.class);
 296     final int deoptReasonNotCompiledExceptionHandler = getConstant("Deoptimization::Reason_not_compiled_exception_handler", Integer.class);
 297     final int deoptReasonUnresolved = getConstant("Deoptimization::Reason_unresolved", Integer.class);
 298     final int deoptReasonJsrMismatch = getConstant("Deoptimization::Reason_jsr_mismatch", Integer.class);
 299     final int deoptReasonDiv0Check = getConstant("Deoptimization::Reason_div0_check", Integer.class);
 300     final int deoptReasonConstraint = getConstant("Deoptimization::Reason_constraint", Integer.class);
 301     final int deoptReasonLoopLimitCheck = getConstant("Deoptimization::Reason_loop_limit_check", Integer.class);
 302     final int deoptReasonAliasing = getConstant("Deoptimization::Reason_aliasing", Integer.class);
 303     final int deoptReasonTransferToInterpreter = getConstant("Deoptimization::Reason_transfer_to_interpreter", Integer.class);
 304     final int deoptReasonOSROffset = getConstant("Deoptimization::Reason_LIMIT", Integer.class);
 305 
 306     final int deoptActionNone = getConstant("Deoptimization::Action_none", Integer.class);
 307     final int deoptActionMaybeRecompile = getConstant("Deoptimization::Action_maybe_recompile", Integer.class);
 308     final int deoptActionReinterpret = getConstant("Deoptimization::Action_reinterpret", Integer.class);
 309     final int deoptActionMakeNotEntrant = getConstant("Deoptimization::Action_make_not_entrant", Integer.class);
 310     final int deoptActionMakeNotCompilable = getConstant("Deoptimization::Action_make_not_compilable", Integer.class);
 311 
 312     final int deoptimizationActionBits = getConstant("Deoptimization::_action_bits", Integer.class);
 313     final int deoptimizationReasonBits = getConstant("Deoptimization::_reason_bits", Integer.class);
 314     final int deoptimizationDebugIdBits = getConstant("Deoptimization::_debug_id_bits", Integer.class);
 315     final int deoptimizationActionShift = getConstant("Deoptimization::_action_shift", Integer.class);
 316     final int deoptimizationReasonShift = getConstant("Deoptimization::_reason_shift", Integer.class);
 317     final int deoptimizationDebugIdShift = getConstant("Deoptimization::_debug_id_shift", Integer.class);
 318 
 319     final int vmIntrinsicInvokeBasic = getConstant("vmIntrinsics::_invokeBasic", Integer.class);
 320     final int vmIntrinsicLinkToVirtual = getConstant("vmIntrinsics::_linkToVirtual", Integer.class);
 321     final int vmIntrinsicLinkToStatic = getConstant("vmIntrinsics::_linkToStatic", Integer.class);
 322     final int vmIntrinsicLinkToSpecial = getConstant("vmIntrinsics::_linkToSpecial", Integer.class);
 323     final int vmIntrinsicLinkToInterface = getConstant("vmIntrinsics::_linkToInterface", Integer.class);
 324 
 325     final int codeInstallResultOk = getConstant("JVMCIEnv::ok", Integer.class);
 326     final int codeInstallResultDependenciesFailed = getConstant("JVMCIEnv::dependencies_failed", Integer.class);
 327     final int codeInstallResultDependenciesInvalid = getConstant("JVMCIEnv::dependencies_invalid", Integer.class);
 328     final int codeInstallResultCacheFull = getConstant("JVMCIEnv::cache_full", Integer.class);
 329     final int codeInstallResultCodeTooLarge = getConstant("JVMCIEnv::code_too_large", Integer.class);
 330 
 331     String getCodeInstallResultDescription(int codeInstallResult) {
 332         if (codeInstallResult == codeInstallResultOk) {
 333             return "ok";
 334         }
 335         if (codeInstallResult == codeInstallResultDependenciesFailed) {
 336             return "dependencies failed";
 337         }
 338         if (codeInstallResult == codeInstallResultDependenciesInvalid) {
 339             return "dependencies invalid";
 340         }
 341         if (codeInstallResult == codeInstallResultCacheFull) {
 342             return "code cache is full";
 343         }
 344         if (codeInstallResult == codeInstallResultCodeTooLarge) {
 345             return "code is too large";
 346         }
 347         assert false : codeInstallResult;
 348         return "unknown";
 349     }
 350 
 351     final int bitDataExceptionSeenFlag = getConstant("BitData::exception_seen_flag", Integer.class);
 352     final int bitDataNullSeenFlag = getConstant("BitData::null_seen_flag", Integer.class);
 353     final int methodDataCountOffset = getConstant("CounterData::count_off", Integer.class);
 354     final int jumpDataTakenOffset = getConstant("JumpData::taken_off_set", Integer.class);
 355     final int jumpDataDisplacementOffset = getConstant("JumpData::displacement_off_set", Integer.class);
 356     final int receiverTypeDataNonprofiledCountOffset = getConstant("ReceiverTypeData::nonprofiled_count_off_set", Integer.class);
 357     final int receiverTypeDataReceiverTypeRowCellCount = getConstant("ReceiverTypeData::receiver_type_row_cell_count", Integer.class);
 358     final int receiverTypeDataReceiver0Offset = getConstant("ReceiverTypeData::receiver0_offset", Integer.class);
 359     final int receiverTypeDataCount0Offset = getConstant("ReceiverTypeData::count0_offset", Integer.class);
 360     final int branchDataNotTakenOffset = getConstant("BranchData::not_taken_off_set", Integer.class);
 361     final int arrayDataArrayLenOffset = getConstant("ArrayData::array_len_off_set", Integer.class);
 362     final int arrayDataArrayStartOffset = getConstant("ArrayData::array_start_off_set", Integer.class);
 363     final int multiBranchDataPerCaseCellCount = getConstant("MultiBranchData::per_case_cell_count", Integer.class);
 364 }