• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java OopHandle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中sun.jvm.hotspot.debugger.OopHandle的典型用法代码示例。如果您正苦于以下问题:Java OopHandle类的具体用法?Java OopHandle怎么用?Java OopHandle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OopHandle类属于sun.jvm.hotspot.debugger包,在下文中一共展示了OopHandle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: thisObject

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
public ObjectReference thisObject() {
    validateStackFrame();
    MethodImpl currentMethod = (MethodImpl)location.method();
    if (currentMethod.isStatic() || currentMethod.isNative()) {
        return null;
    }
    if (thisObject == null) {
        StackValueCollection values = saFrame.getLocals();
        if (Assert.ASSERTS_ENABLED) {
            Assert.that(values.size() > 0, "this is missing");
        }
        // 'this' at index 0.
        if (values.get(0).getType() == BasicType.getTConflict()) {
          return null;
        }
        OopHandle handle = values.oopHandleAt(0);
        ObjectHeap heap = vm.saObjectHeap();
        thisObject = vm.objectMirror(heap.newOop(handle));
    }
    return thisObject;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:22,代码来源:StackFrameImpl.java


示例2: probeForObject

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
/**
 * Walk backwards to find the start of the object at probeAddress, but don't walk past the bottom
 * of the live region.
 */
private Oop probeForObject(Address probeAddress, Address bottom) {
  OopHandle cur = probeAddress.andWithMask(~(heapWordSize - 1)).addOffsetToAsOopHandle(0);
  while (cur.greaterThanOrEqual(bottom)) {
    Oop oop = objectHeap.newOopIfPossible(cur, bottom);
    if (oop != null) {
      if (cur.addOffsetToAsOopHandle(oop.getObjectSize()).greaterThan(probeAddress)) {
        return oop; // original address was within the nearest object
      } else {
        // declare this a "miss" even though we might not have walked far enough, and we just
        // stumbled on some spurious data that looked like an Oop header, but the size is busted
        return null;
      }
    }
    cur = cur.addOffsetToAsOopHandle(-heapWordSize);
  }
  return null; // not found
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:22,代码来源:StatisticalHeapDumper.java


示例3: printStringValue

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
private static void printStringValue(PrintStream tty, StackValueCollection values, int slot) {
    OopHandle strOopHandle = values.oopHandleAt(slot);
    if (stringValueArrayField != null) {
        OopHandle valueOopHandle = null;
        if (compressedOopsEnabled) {
            valueOopHandle = strOopHandle.getCompOopHandleAt(stringValueArrayField.getOffset());
        } else {
            valueOopHandle = strOopHandle.getOopHandleAt(stringValueArrayField.getOffset());
        }
        StringBuilder sb = new StringBuilder();
        int length = valueOopHandle.getJIntAt(arrayLengthOffset);
        for (int i = 0; i < length; i++) {
            long offset = charArrayBaseOffset + i * charSize;
            sb.append(valueOopHandle.getJCharAt(offset));
        }
        tty.print(String.format("%-30s %s",
                      sb.toString(),
                      String.class.getName()));
    } else {
        tty.print(String.format("%-30s %s",
                    strOopHandle + " (address)",
                    String.class.getName()));
    }
}
 
开发者ID:serkan-ozal,项目名称:jemstone,代码行数:25,代码来源:HotSpotSAStackTracerWorkerHelper.java


示例4: thisObject

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
public ObjectReference thisObject() {
    validateStackFrame();
    MethodImpl currentMethod = (MethodImpl)location.method();
    if (currentMethod.isStatic() || currentMethod.isNative()) {
        return null;
    }
    if (thisObject == null) {
        StackValueCollection values = saFrame.getLocals();
        if (Assert.ASSERTS_ENABLED) {
            Assert.that(values.size() > 0, "this is missing");
        }
        // 'this' at index 0.
        OopHandle handle = values.oopHandleAt(0);
        ObjectHeap heap = vm.saObjectHeap();
        thisObject = vm.objectMirror(heap.newOop(handle));
    }
    return thisObject;
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:19,代码来源:StackFrameImpl.java


示例5: lookupOop

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
/** From the SymbolLookup interface via Debugger and JVMDebugger */
public synchronized OopHandle lookupOop(String objectName, String symbol) {
    Address addr = lookup(objectName, symbol);
    if (addr == null) {
        return null;
    }
    return addr.addOffsetToAsOopHandle(0);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:9,代码来源:BsdDebuggerLocal.java


示例6: writeGlobalJNIHandle

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
protected void writeGlobalJNIHandle(Address handleAddr) throws IOException {
  OopHandle oopHandle = handleAddr.getOopHandleAt(0);
  Oop oop = objectHeap.newOop(oopHandle);
  // exclude JNI handles of hotspot internal objects
  if (oop != null && isJavaVisible(oop)) {
    out.writeByte((byte) HPROF_GC_ROOT_JNI_GLOBAL);
    writeObjectID(oop);
    // use JNIHandle address as ID
    writeObjectID(getAddressValue(handleAddr));
  }
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:12,代码来源:HeapHprofBinWriter.java


示例7: writeObjectArray

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
protected void writeObjectArray(ObjArray array) throws IOException {
  out.writeByte((byte) HPROF_GC_OBJ_ARRAY_DUMP);
  writeObjectID(array);
  out.writeInt(DUMMY_STACK_TRACE_ID);
  out.writeInt((int) array.getLength());
  writeObjectIDForKlass(array.getKlass());
  final int length = (int) array.getLength();
  for (int index = 0; index < length; index++) {
    OopHandle handle = array.getOopHandleAt(index);
    writeObjectID(getAddressValue(handle));
  }
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:13,代码来源:HeapHprofBinWriter.java


示例8: isInternalKlassPointer

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
private boolean isInternalKlassPointer(Address address, Address bottom, long offset) {
  OopHandle classOop = address.addOffsetToAsOopHandle(-offset);
  if (VM.getVM().isCompressedKlassPointersEnabled()) {
    classOop = classOop.addOffsetToAsOopHandle(oopCompressedKlass.getOffset());
  } else {
    classOop = classOop.addOffsetToAsOopHandle(oopKlass.getOffset());
  }

  if (classOop.greaterThanOrEqual(bottom)) {
    Address classKlass;
    if (VM.getVM().isCompressedKlassPointersEnabled()) {
      classKlass = classOop.getCompKlassAddressAt(oopCompressedKlass.getOffset());
    } else {
      classKlass = classOop.getAddressAt(oopKlass.getOffset());
    }

    if (classKlass == null) {
      return false;
    }

    try {
      Address vtbl = classKlass.getAddressAt(0);
      return instanceMirrorKlassVtbl.equals(vtbl);
    } catch (UnmappedAddressException e) {
      return false;
    }
  }
  return false;
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:30,代码来源:FastObjectHeap.java


示例9: newOop

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
@Override
public Oop newOop(OopHandle handle) {
  if (handle == null) {
    return null;
  }

  Address klassAddress;
  if (VM.getVM().isCompressedKlassPointersEnabled()) {
    klassAddress = handle.getCompKlassAddressAt(oopCompressedKlass.getOffset());
  } else {
    klassAddress = handle.getAddressAt(oopKlass.getOffset());
  }

  int layoutHelper = klassAddress.getJIntAt(klassLayoutHelper.getOffset());
  int tag = layoutHelper >> Klass.LH_ARRAY_TAG_SHIFT;

  if (tag == Klass.LH_ARRAY_TAG_OBJ_VALUE) {
    // object array
    Klass bottomKlass = getKlassAtAddress(objArrayBottomKlass.getValue(klassAddress));
    return new FastObjArray(handle, this, new FastObjArrayKlass(klassAddress, bottomKlass));
  } else if (tag == Klass.LH_ARRAY_TAG_TYPE_VALUE) {
    // primitive array
    return new FastTypeArray(handle, this, new TypeArrayKlass(klassAddress));
  } else {
    Symbol name = Symbol.create(klassAddress.getAddressAt(klassName.getOffset()));
    if (javaLangClass.equals(name)) {
      // instance of java.lang.Class, which has special handling for static members
      return new FastInstance(handle, this, new FastInstanceMirrorKlass(klassAddress));
    } else {
      // instance of anything else. we don't handle InstanceRefKlass or InstanceClassLoaderKlass
      // because they contain no extra logic
      return new FastInstance(handle, this, new FastInstanceKlass(klassAddress));
    }
  }
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:36,代码来源:FastObjectHeap.java


示例10: getSlotValue

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
private ValueImpl getSlotValue(StackValueCollection values,
                   BasicType variableType, int ss) {
    ValueImpl valueImpl = null;
    OopHandle handle = null;
    ObjectHeap heap = vm.saObjectHeap();
    if (variableType == BasicType.T_BOOLEAN) {
        valueImpl = (BooleanValueImpl) vm.mirrorOf(values.booleanAt(ss));
    } else if (variableType == BasicType.T_CHAR) {
        valueImpl = (CharValueImpl) vm.mirrorOf(values.charAt(ss));
    } else if (variableType == BasicType.T_FLOAT) {
        valueImpl = (FloatValueImpl) vm.mirrorOf(values.floatAt(ss));
    } else if (variableType == BasicType.T_DOUBLE) {
        valueImpl = (DoubleValueImpl) vm.mirrorOf(values.doubleAt(ss));
    } else if (variableType == BasicType.T_BYTE) {
        valueImpl = (ByteValueImpl) vm.mirrorOf(values.byteAt(ss));
    } else if (variableType == BasicType.T_SHORT) {
        valueImpl = (ShortValueImpl) vm.mirrorOf(values.shortAt(ss));
    } else if (variableType == BasicType.T_INT) {
        valueImpl = (IntegerValueImpl) vm.mirrorOf(values.intAt(ss));
    } else if (variableType == BasicType.T_LONG) {
        valueImpl = (LongValueImpl) vm.mirrorOf(values.longAt(ss));
    } else if (variableType == BasicType.T_OBJECT) {
        // we may have an [Ljava/lang/Object; - i.e., Object[] with the
        // elements themselves may be arrays because every array is an Object.
        handle = values.oopHandleAt(ss);
        valueImpl = (ObjectReferenceImpl) vm.objectMirror(heap.newOop(handle));
    } else if (variableType == BasicType.T_ARRAY) {
        handle = values.oopHandleAt(ss);
        valueImpl = vm.arrayMirror((Array)heap.newOop(handle));
    } else if (variableType == BasicType.T_VOID) {
        valueImpl = new VoidValueImpl(vm);
    } else {
        throw new RuntimeException("Should not read here");
    }

    return valueImpl;
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:38,代码来源:StackFrameImpl.java


示例11: getSlotValue

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
private ValueImpl getSlotValue(StackValueCollection values,
                   BasicType variableType, int ss) {
    ValueImpl valueImpl = null;
    OopHandle handle = null;
    ObjectHeap heap = vm.saObjectHeap();
    if (values.get(ss).getType() == BasicType.getTConflict()) {
      // Dead locals, so just represent them as a zero of the appropriate type
      if (variableType == BasicType.T_BOOLEAN) {
        valueImpl = (BooleanValueImpl) vm.mirrorOf(false);
      } else if (variableType == BasicType.T_CHAR) {
        valueImpl = (CharValueImpl) vm.mirrorOf((char)0);
      } else if (variableType == BasicType.T_FLOAT) {
        valueImpl = (FloatValueImpl) vm.mirrorOf((float)0);
      } else if (variableType == BasicType.T_DOUBLE) {
        valueImpl = (DoubleValueImpl) vm.mirrorOf((double)0);
      } else if (variableType == BasicType.T_BYTE) {
        valueImpl = (ByteValueImpl) vm.mirrorOf((byte)0);
      } else if (variableType == BasicType.T_SHORT) {
        valueImpl = (ShortValueImpl) vm.mirrorOf((short)0);
      } else if (variableType == BasicType.T_INT) {
        valueImpl = (IntegerValueImpl) vm.mirrorOf((int)0);
      } else if (variableType == BasicType.T_LONG) {
        valueImpl = (LongValueImpl) vm.mirrorOf((long)0);
      } else if (variableType == BasicType.T_OBJECT) {
        // we may have an [Ljava/lang/Object; - i.e., Object[] with the
        // elements themselves may be arrays because every array is an Object.
        handle = null;
        valueImpl = (ObjectReferenceImpl) vm.objectMirror(heap.newOop(handle));
      } else if (variableType == BasicType.T_ARRAY) {
        handle = null;
        valueImpl = vm.arrayMirror((Array)heap.newOop(handle));
      } else if (variableType == BasicType.T_VOID) {
        valueImpl = new VoidValueImpl(vm);
      } else {
        throw new RuntimeException("Should not read here");
      }
    } else {
      if (variableType == BasicType.T_BOOLEAN) {
        valueImpl = (BooleanValueImpl) vm.mirrorOf(values.booleanAt(ss));
      } else if (variableType == BasicType.T_CHAR) {
        valueImpl = (CharValueImpl) vm.mirrorOf(values.charAt(ss));
      } else if (variableType == BasicType.T_FLOAT) {
        valueImpl = (FloatValueImpl) vm.mirrorOf(values.floatAt(ss));
      } else if (variableType == BasicType.T_DOUBLE) {
        valueImpl = (DoubleValueImpl) vm.mirrorOf(values.doubleAt(ss));
      } else if (variableType == BasicType.T_BYTE) {
        valueImpl = (ByteValueImpl) vm.mirrorOf(values.byteAt(ss));
      } else if (variableType == BasicType.T_SHORT) {
        valueImpl = (ShortValueImpl) vm.mirrorOf(values.shortAt(ss));
      } else if (variableType == BasicType.T_INT) {
        valueImpl = (IntegerValueImpl) vm.mirrorOf(values.intAt(ss));
      } else if (variableType == BasicType.T_LONG) {
        valueImpl = (LongValueImpl) vm.mirrorOf(values.longAt(ss));
      } else if (variableType == BasicType.T_OBJECT) {
        // we may have an [Ljava/lang/Object; - i.e., Object[] with the
        // elements themselves may be arrays because every array is an Object.
        handle = values.oopHandleAt(ss);
        valueImpl = (ObjectReferenceImpl) vm.objectMirror(heap.newOop(handle));
      } else if (variableType == BasicType.T_ARRAY) {
        handle = values.oopHandleAt(ss);
        valueImpl = vm.arrayMirror((Array)heap.newOop(handle));
      } else if (variableType == BasicType.T_VOID) {
        valueImpl = new VoidValueImpl(vm);
      } else {
        throw new RuntimeException("Should not read here");
      }
    }

    return valueImpl;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:71,代码来源:StackFrameImpl.java


示例12: FastTypeArray

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
public FastTypeArray(OopHandle handle, ObjectHeap heap, TypeArrayKlass klass) {
  super(handle, heap);
  this.klass = klass;
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:5,代码来源:FastTypeArray.java


示例13: FastObjArray

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
public FastObjArray(OopHandle handle, ObjectHeap heap, ObjArrayKlass klass) {
  super(handle, heap);
  this.klass = klass;
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:5,代码来源:FastObjArray.java


示例14: FastInstance

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
public FastInstance(OopHandle handle, ObjectHeap heap, InstanceKlass klass) {
  super(handle, heap);
  this.klass = klass;
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:5,代码来源:FastInstance.java


示例15: lookupOop

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
@Override
public OopHandle lookupOop(String objectName, String symbol) {
  Address addr = this.lookup(objectName, symbol);
  return addr == null?null:addr.addOffsetToAsOopHandle(0L);
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:6,代码来源:SelfDebugger.java


示例16: getOopHandleAt

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
public OopHandle getOopHandleAt(long offset) throws UnalignedAddressException, UnmappedAddressException,
    NotInHeapException {
  return this.debugger.readOopHandle(this.addr + offset);
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:5,代码来源:SelfAddress.java


示例17: getCompOopHandleAt

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
public OopHandle getCompOopHandleAt(long offset) throws UnalignedAddressException, UnmappedAddressException, NotInHeapException {
  return this.debugger.readCompOopHandle(this.addr + offset);
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:4,代码来源:SelfAddress.java


示例18: setOopHandleAt

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
public void setOopHandleAt(long offset, OopHandle value) throws UnmappedAddressException, UnalignedAddressException {
  throw new DebuggerException("Unimplemented");
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:4,代码来源:SelfAddress.java


示例19: addOffsetToAsOopHandle

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
public OopHandle addOffsetToAsOopHandle(long offset) throws UnsupportedOperationException {
  long value = this.addr + offset;
  return value == 0L?null:new SelfOopHandle(this.debugger, value);
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:5,代码来源:SelfAddress.java


示例20: writeObjectIDForKlass

import sun.jvm.hotspot.debugger.OopHandle; //导入依赖的package包/类
private void writeObjectIDForKlass(Klass klass) throws IOException {
  OopHandle handle = klass != null ? klassJavaMirrorField.getValueAsOopHandle(klass) : null;
  long address = getAddressValue(handle);
  writeObjectID(address);
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:6,代码来源:HeapHprofBinWriter.java



注:本文中的sun.jvm.hotspot.debugger.OopHandle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PersistentPropertyAccessor类代码示例发布时间:2022-05-22
下一篇:
Java Axis2ConfigurationContextObserver类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap