コード例 #1
0
 private HeapRegion at(long index) {
   Address arrayAddr = regionsField.getValue(addr);
   // Offset of &_region[index]
   long offset = index * VM.getVM().getAddressSize();
   Address regionAddr = arrayAddr.getAddressAt(offset);
   return (HeapRegion) VMObjectFactory.newObject(HeapRegion.class, regionAddr);
 }
コード例 #2
0
ファイル: Threads.java プロジェクト: netroby/jdk9-dev
  /**
   * NOTE: this returns objects of type JavaThread, CompilerThread, JvmtiAgentThread, and
   * ServiceThread. The latter four are subclasses of the former. Most operations (fetching the top
   * frame, etc.) are only allowed to be performed on a "pure" JavaThread. For this reason, {@link
   * sun.jvm.hotspot.runtime.JavaThread#isJavaThread} has been changed from the definition in the VM
   * (which returns true for all of these thread types) to return true for JavaThreads and false for
   * the three subclasses. FIXME: should reconsider the inheritance hierarchy; see {@link
   * sun.jvm.hotspot.runtime.JavaThread#isJavaThread}.
   */
  public JavaThread first() {
    Address threadAddr = threadListField.getValue();
    if (threadAddr == null) {
      return null;
    }

    return createJavaThreadWrapper(threadAddr);
  }
コード例 #3
0
  public ThreadProxy getThreadProxy(Address addr) {
    // Addr is the address of the JavaThread.
    // Fetch the OSThread (for now and for simplicity, not making a
    // separate "OSThread" class in this package)
    Address osThreadAddr = osThreadField.getValue(addr);
    // Get the address of the _thread_id from the OSThread
    Address threadIdAddr = osThreadAddr.addOffsetTo(osThreadThreadIDField.getOffset());

    JVMDebugger debugger = VM.getVM().getDebugger();
    return debugger.getThreadForIdentifierAddress(threadIdAddr);
  }
コード例 #4
0
  public JNIHandleBlock next() {
    Address handleAddr = nextField.getValue(addr);
    if (handleAddr == null) {
      return null;
    }

    /* the next handle block is valid only if the current block is full */
    if (top() < blockSizeInOops) {
      return null;
    }
    return new JNIHandleBlock(handleAddr);
  }
コード例 #5
0
 public Address getLastJavaFP() {
   return lastJavaFPField.getValue(addr.addOffsetTo(anchorField.getOffset()));
 }
コード例 #6
0
 public String getDescription() {
   return CStringUtilities.getString(descriptionField.getValue(addr));
 }
コード例 #7
0
 public Address getLastJavaFP(Address addr) {
   return lastJavaFPField.getValue(
       addr.addOffsetTo(sun.jvm.hotspot.runtime.JavaThread.getAnchorField().getOffset()));
 }
コード例 #8
0
 /** Breakpoint support (see methods on methodOop for details) */
 public BreakpointInfo getBreakpoints() {
   Address addr = getHandle().getAddressAt(Oop.getHeaderSize() + breakpoints.getOffset());
   return (BreakpointInfo) VMObjectFactory.newObject(BreakpointInfo.class, addr);
 }
コード例 #9
0
 // get associated compiled native method, if available, else return null.
 public NMethod getNativeMethod() {
   Address addr = code.getValue(getAddress());
   return (NMethod) VMObjectFactory.newObject(NMethod.class, addr);
 }
コード例 #10
0
 public MethodCounters getMethodCounters() {
   Address addr = methodCounters.getValue(getAddress());
   return (MethodCounters) VMObjectFactory.newObject(MethodCounters.class, addr);
 }
コード例 #11
0
 public MethodData getMethodData() {
   Address addr = methodData.getValue(getAddress());
   return (MethodData) VMObjectFactory.newObject(MethodData.class, addr);
 }
コード例 #12
0
 // Accessors for declared fields
 public ConstMethod getConstMethod() {
   Address addr = constMethod.getValue(getAddress());
   return (ConstMethod) VMObjectFactory.newObject(ConstMethod.class, addr);
 }
コード例 #13
0
 public StubQueue getCode() {
   Address code = codeField.getValue();
   if (code == null) return null;
   return new StubQueue(code, InterpreterCodelet.class);
 }