Пример #1
0
 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
   Type type = db.lookupType("constantPoolCacheOopDesc");
   constants = new OopField(type.getOopField("_constant_pool"), 0);
   baseOffset = type.getSize();
   Type elType = db.lookupType("ConstantPoolCacheEntry");
   elementSize = elType.getSize();
   length = new CIntField(type.getCIntegerField("_length"), 0);
 }
  private static synchronized void initialize(TypeDataBase db) {
    Type type = db.lookupType("JNIHandleBlock");

    handlesField = type.getField("_handles");
    topField = type.getCIntegerField("_top");
    nextField = type.getAddressField("_next");

    blockSizeInOops = db.lookupIntConstant("JNIHandleBlock::block_size_in_oops").intValue();
  }
Пример #3
0
  private static synchronized void initialize(TypeDataBase db) {
    Type type = db.lookupType("JavaThread");
    osThreadField = type.getAddressField("_osthread");

    Type anchorType = db.lookupType("JavaFrameAnchor");
    lastJavaFPField = anchorType.getAddressField("_last_Java_fp");

    Type osThreadType = db.lookupType("OSThread");
    osThreadThreadIDField = osThreadType.getCIntegerField("_thread_id");
  }
Пример #4
0
 private static void initialize(TypeDataBase db) {
   if (VM.getVM().isServerCompiler()) {
     Type type = db.lookupType("Matcher");
     Field f = type.getField("_regEncode");
     matcherRegEncodeAddr = f.getStaticFieldAddress();
   }
 }
Пример #5
0
  private static void initialize(TypeDataBase db) {
    Type type = db.lookupType("oopDesc");

    if (VM.getVM().isCompressedOopsEnabled()) {
      klassField = type.getNarrowOopField("_metadata._compressed_klass");
    } else {
      klassField = type.getOopField("_metadata._klass");
    }
  }
Пример #6
0
 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
   Type type = db.lookupType("constantPoolOopDesc");
   tags = new OopField(type.getOopField("_tags"), 0);
   cache = new OopField(type.getOopField("_cache"), 0);
   poolHolder = new OopField(type.getOopField("_pool_holder"), 0);
   length = new CIntField(type.getCIntegerField("_length"), 0);
   headerSize = type.getSize();
   elementSize = 0;
 }
  private static synchronized void initialize(TypeDataBase db) {
    Type type = db.lookupType("InterpreterCodelet");

    sizeField = type.getCIntegerField("_size");
    descriptionField = type.getAddressField("_description");
    isSafepointSafeField = type.getJIntField("_is_safepoint_safe");
    bytecodeField = type.getCIntegerField("_bytecode");

    instanceSize = type.getSize();
  }
Пример #8
0
 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
   Type type = db.lookupType("arrayKlass");
   dimension = new CIntField(type.getCIntegerField("_dimension"), Oop.getHeaderSize());
   higherDimension = new OopField(type.getOopField("_higher_dimension"), Oop.getHeaderSize());
   lowerDimension = new OopField(type.getOopField("_lower_dimension"), Oop.getHeaderSize());
   vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), Oop.getHeaderSize());
   allocSize = new CIntField(type.getCIntegerField("_alloc_size"), Oop.getHeaderSize());
   componentMirror = new OopField(type.getOopField("_component_mirror"), Oop.getHeaderSize());
   javaLangCloneableName = null;
   javaLangObjectName = null;
   javaIoSerializableName = null;
 }
Пример #9
0
  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
    Type type = db.lookupType("Method");
    constMethod = type.getAddressField("_constMethod");
    methodData = type.getAddressField("_method_data");
    methodCounters = type.getAddressField("_method_counters");
    methodSize = new CIntField(type.getCIntegerField("_method_size"), 0);
    accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0);
    code = type.getAddressField("_code");
    vtableIndex = new CIntField(type.getCIntegerField("_vtable_index"), 0);
    bytecodeOffset = type.getSize();

    /*
    interpreterEntry           = type.getAddressField("_interpreter_entry");
    fromCompiledCodeEntryPoint = type.getAddressField("_from_compiled_code_entry_point");

    */
    objectInitializerName = null;
    classInitializerName = null;
  }
Пример #10
0
  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
    Type type = db.lookupType("methodOopDesc");
    constMethod = new OopField(type.getOopField("_constMethod"), 0);
    constants = new OopField(type.getOopField("_constants"), 0);
    methodSize = new CIntField(type.getCIntegerField("_method_size"), 0);
    maxStack = new CIntField(type.getCIntegerField("_max_stack"), 0);
    maxLocals = new CIntField(type.getCIntegerField("_max_locals"), 0);
    sizeOfParameters = new CIntField(type.getCIntegerField("_size_of_parameters"), 0);
    accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0);
    code = type.getAddressField("_code");
    vtableIndex = new CIntField(type.getCIntegerField("_vtable_index"), 0);
    if (!VM.getVM().isCore()) {
      invocationCounter = new CIntField(type.getCIntegerField("_invocation_counter"), 0);
    }
    bytecodeOffset = type.getSize();

    /*
    interpreterEntry           = type.getAddressField("_interpreter_entry");
    fromCompiledCodeEntryPoint = type.getAddressField("_from_compiled_code_entry_point");

    */
    objectInitializerName = null;
    classInitializerName = null;
  }
Пример #11
0
  private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
    Type type = db.lookupType("instanceKlass");
    arrayKlasses = new OopField(type.getOopField("_array_klasses"), Oop.getHeaderSize());
    methods = new OopField(type.getOopField("_methods"), Oop.getHeaderSize());
    methodOrdering = new OopField(type.getOopField("_method_ordering"), Oop.getHeaderSize());
    localInterfaces = new OopField(type.getOopField("_local_interfaces"), Oop.getHeaderSize());
    transitiveInterfaces =
        new OopField(type.getOopField("_transitive_interfaces"), Oop.getHeaderSize());
    nofImplementors =
        new CIntField(type.getCIntegerField("_nof_implementors"), Oop.getHeaderSize());
    IMPLEMENTORS_LIMIT = db.lookupIntConstant("instanceKlass::implementors_limit").intValue();
    implementors = new OopField[IMPLEMENTORS_LIMIT];
    for (int i = 0; i < IMPLEMENTORS_LIMIT; i++) {
      long arrayOffset = Oop.getHeaderSize() + (i * db.getAddressSize());
      implementors[i] = new OopField(type.getOopField("_implementors[0]"), arrayOffset);
    }
    fields = new OopField(type.getOopField("_fields"), Oop.getHeaderSize());
    constants = new OopField(type.getOopField("_constants"), Oop.getHeaderSize());
    classLoader = new OopField(type.getOopField("_class_loader"), Oop.getHeaderSize());
    protectionDomain = new OopField(type.getOopField("_protection_domain"), Oop.getHeaderSize());
    signers = new OopField(type.getOopField("_signers"), Oop.getHeaderSize());
    sourceFileName = new OopField(type.getOopField("_source_file_name"), Oop.getHeaderSize());
    sourceDebugExtension =
        new OopField(type.getOopField("_source_debug_extension"), Oop.getHeaderSize());
    innerClasses = new OopField(type.getOopField("_inner_classes"), Oop.getHeaderSize());
    nonstaticFieldSize =
        new CIntField(type.getCIntegerField("_nonstatic_field_size"), Oop.getHeaderSize());
    staticFieldSize =
        new CIntField(type.getCIntegerField("_static_field_size"), Oop.getHeaderSize());
    staticOopFieldSize =
        new CIntField(type.getCIntegerField("_static_oop_field_size"), Oop.getHeaderSize());
    nonstaticOopMapSize =
        new CIntField(type.getCIntegerField("_nonstatic_oop_map_size"), Oop.getHeaderSize());
    isMarkedDependent =
        new CIntField(type.getCIntegerField("_is_marked_dependent"), Oop.getHeaderSize());
    initState = new CIntField(type.getCIntegerField("_init_state"), Oop.getHeaderSize());
    vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), Oop.getHeaderSize());
    itableLen = new CIntField(type.getCIntegerField("_itable_len"), Oop.getHeaderSize());
    breakpoints = type.getAddressField("_breakpoints");
    genericSignature = new OopField(type.getOopField("_generic_signature"), Oop.getHeaderSize());
    majorVersion = new CIntField(type.getCIntegerField("_major_version"), Oop.getHeaderSize());
    minorVersion = new CIntField(type.getCIntegerField("_minor_version"), Oop.getHeaderSize());
    headerSize = alignObjectOffset(Oop.getHeaderSize() + type.getSize());

    // read field offset constants
    ACCESS_FLAGS_OFFSET = db.lookupIntConstant("instanceKlass::access_flags_offset").intValue();
    NAME_INDEX_OFFSET = db.lookupIntConstant("instanceKlass::name_index_offset").intValue();
    SIGNATURE_INDEX_OFFSET =
        db.lookupIntConstant("instanceKlass::signature_index_offset").intValue();
    INITVAL_INDEX_OFFSET = db.lookupIntConstant("instanceKlass::initval_index_offset").intValue();
    LOW_OFFSET = db.lookupIntConstant("instanceKlass::low_offset").intValue();
    HIGH_OFFSET = db.lookupIntConstant("instanceKlass::high_offset").intValue();
    GENERIC_SIGNATURE_INDEX_OFFSET =
        db.lookupIntConstant("instanceKlass::generic_signature_offset").intValue();
    NEXT_OFFSET = db.lookupIntConstant("instanceKlass::next_offset").intValue();
    // read ClassState constants
    CLASS_STATE_UNPARSABLE_BY_GC =
        db.lookupIntConstant("instanceKlass::unparsable_by_gc").intValue();
    CLASS_STATE_ALLOCATED = db.lookupIntConstant("instanceKlass::allocated").intValue();
    CLASS_STATE_LOADED = db.lookupIntConstant("instanceKlass::loaded").intValue();
    CLASS_STATE_LINKED = db.lookupIntConstant("instanceKlass::linked").intValue();
    CLASS_STATE_BEING_INITIALIZED =
        db.lookupIntConstant("instanceKlass::being_initialized").intValue();
    CLASS_STATE_FULLY_INITIALIZED =
        db.lookupIntConstant("instanceKlass::fully_initialized").intValue();
    CLASS_STATE_INITIALIZATION_ERROR =
        db.lookupIntConstant("instanceKlass::initialization_error").intValue();
  }
Пример #12
0
  private static void initialize(TypeDataBase db) {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(!VM.getVM().isCore(), "Debug info not used in core build");
    }

    OFFSET_MASK = db.lookupIntConstant("Location::OFFSET_MASK").intValue();
    OFFSET_SHIFT = db.lookupIntConstant("Location::OFFSET_SHIFT").intValue();
    TYPE_MASK = db.lookupIntConstant("Location::TYPE_MASK").intValue();
    TYPE_SHIFT = db.lookupIntConstant("Location::TYPE_SHIFT").intValue();
    WHERE_MASK = db.lookupIntConstant("Location::WHERE_MASK").intValue();
    WHERE_SHIFT = db.lookupIntConstant("Location::WHERE_SHIFT").intValue();

    // Location::Type constants
    TYPE_NORMAL = db.lookupIntConstant("Location::normal").intValue();
    TYPE_OOP = db.lookupIntConstant("Location::oop").intValue();
    TYPE_NARROWOOP = db.lookupIntConstant("Location::narrowoop").intValue();
    TYPE_INT_IN_LONG = db.lookupIntConstant("Location::int_in_long").intValue();
    TYPE_LNG = db.lookupIntConstant("Location::lng").intValue();
    TYPE_FLOAT_IN_DBL = db.lookupIntConstant("Location::float_in_dbl").intValue();
    TYPE_DBL = db.lookupIntConstant("Location::dbl").intValue();
    TYPE_ADDR = db.lookupIntConstant("Location::addr").intValue();
    TYPE_INVALID = db.lookupIntConstant("Location::invalid").intValue();

    // Location::Where constants
    WHERE_ON_STACK = db.lookupIntConstant("Location::on_stack").intValue();
    WHERE_IN_REGISTER = db.lookupIntConstant("Location::in_register").intValue();
  }
  private static synchronized void initialize(TypeDataBase db) {
    Type type = db.lookupType("JavaFrameAnchor");

    lastJavaFPField = type.getAddressField("_last_Java_fp");
  }
Пример #14
0
 private static void initialize(TypeDataBase db) throws WrongTypeException {
   Type type = db.lookupType("arrayOopDesc");
   typeSize = (int) type.getSize();
 }
Пример #15
0
 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
   Type t = db.lookupType("typeArrayKlass");
   maxLength = new CIntField(t.getCIntegerField("_max_length"), Oop.getHeaderSize());
 }
Пример #16
0
 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
   Type type = db.lookupType("typeArrayOopDesc");
 }
 private static synchronized void initialize(TypeDataBase db) {
   Type type = db.lookupType("PlaceholderEntry");
   loaderField = type.getOopField("_loader");
 }
Пример #18
0
  private static synchronized void initialize(TypeDataBase db) {
    Type type = db.lookupType("Threads");

    threadListField = type.getAddressField("_thread_list");
    numOfThreadsField = type.getCIntegerField("_number_of_threads");

    // Instantiate appropriate platform-specific JavaThreadFactory
    String os = VM.getVM().getOS();
    String cpu = VM.getVM().getCPU();

    access = null;
    // FIXME: find the platform specific PD class by reflection?
    if (os.equals("solaris")) {
      if (cpu.equals("sparc")) {
        access = new SolarisSPARCJavaThreadPDAccess();
      } else if (cpu.equals("x86")) {
        access = new SolarisX86JavaThreadPDAccess();
      } else if (cpu.equals("amd64")) {
        access = new SolarisAMD64JavaThreadPDAccess();
      }
    } else if (os.equals("win32")) {
      if (cpu.equals("x86")) {
        access = new Win32X86JavaThreadPDAccess();
      } else if (cpu.equals("amd64")) {
        access = new Win32AMD64JavaThreadPDAccess();
      }
    } else if (os.equals("linux")) {
      if (cpu.equals("x86")) {
        access = new LinuxX86JavaThreadPDAccess();
      } else if (cpu.equals("amd64")) {
        access = new LinuxAMD64JavaThreadPDAccess();
      } else if (cpu.equals("sparc")) {
        access = new LinuxSPARCJavaThreadPDAccess();
      } else if (cpu.equals("ppc64")) {
        access = new LinuxPPC64JavaThreadPDAccess();
      } else if (cpu.equals("aarch64")) {
        access = new LinuxAARCH64JavaThreadPDAccess();
      } else {
        try {
          access =
              (JavaThreadPDAccess)
                  Class.forName(
                          "sun.jvm.hotspot.runtime.linux_"
                              + cpu.toLowerCase()
                              + ".Linux"
                              + cpu.toUpperCase()
                              + "JavaThreadPDAccess")
                      .newInstance();
        } catch (Exception e) {
          throw new RuntimeException("OS/CPU combination " + os + "/" + cpu + " not yet supported");
        }
      }
    } else if (os.equals("bsd")) {
      if (cpu.equals("x86")) {
        access = new BsdX86JavaThreadPDAccess();
      } else if (cpu.equals("amd64") || cpu.equals("x86_64")) {
        access = new BsdAMD64JavaThreadPDAccess();
      }
    } else if (os.equals("darwin")) {
      if (cpu.equals("amd64") || cpu.equals("x86_64")) {
        access = new BsdAMD64JavaThreadPDAccess();
      }
    }

    if (access == null) {
      throw new RuntimeException("OS/CPU combination " + os + "/" + cpu + " not yet supported");
    }

    virtualConstructor = new VirtualConstructor(db);
    // Add mappings for all known thread types
    virtualConstructor.addMapping("JavaThread", JavaThread.class);
    if (!VM.getVM().isCore()) {
      virtualConstructor.addMapping("CompilerThread", CompilerThread.class);
      virtualConstructor.addMapping("CodeCacheSweeperThread", CodeCacheSweeperThread.class);
    }
    virtualConstructor.addMapping("JvmtiAgentThread", JvmtiAgentThread.class);
    virtualConstructor.addMapping("ServiceThread", ServiceThread.class);
  }
Пример #19
0
  private static synchronized void initialize(TypeDataBase db) {
    Type type = db.lookupType("AbstractInterpreter");

    codeField = type.getAddressField("_code");
  }
  private static synchronized void initialize(TypeDataBase db) {
    Type type = db.lookupType("HeapRegionSeq");

    regionsField = type.getAddressField("_regions");
    lengthField = type.getCIntegerField("_length");
  }
Пример #21
0
 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
   Type type = db.lookupType("objArrayKlass");
   elementKlass = new OopField(type.getOopField("_element_klass"), Oop.getHeaderSize());
   bottomKlass = new OopField(type.getOopField("_bottom_klass"), Oop.getHeaderSize());
 }