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

Java Assert类代码示例

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

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



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

示例1: resolveTypes

import sun.jvm.hotspot.utilities.Assert; //导入依赖的package包/类
/** Supports lazy instantiation and references between types and
    symbols via insertion using arbitrary Object keys that are
    wrapped by LazyTypes. Once the database has been fully
    constructed and all types are present, one should call
    resolveTypes(), which will resolve all LazyTypes down to
    concrete types (and signal an error if some lazy types were
    unresolved). */
public void beginConstruction() {
  if (Assert.ASSERTS_ENABLED) {
    Assert.that(state == INITIALIZED_STATE, "wrong state");
  }
  state   = CONSTRUCTION_STATE;

  // Types
  lazyTypeMap  = new HashMap();
  types        = new ArrayList();

  // Symbols
  lazySymMap   = new HashMap();
  blocks       = new ArrayList();
  nameToSymMap = new HashMap();

  // Line numbers
  lineNumbers  = new BasicLineNumberMapping();
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:26,代码来源:BasicCDebugInfoDataBase.java


示例2: resolveSym

import sun.jvm.hotspot.utilities.Assert; //导入依赖的package包/类
/** Intended only to be usd by the BasicSym implementation. */
public Sym resolveSym(Sym containingSymbol, Sym targetSym, ResolveListener listener, String detail) {
  if (targetSym == null) return null;
  BasicSym basicTargetSym = (BasicSym) targetSym;
  if (Assert.ASSERTS_ENABLED) {
    Assert.that(state == CONSTRUCTION_STATE, "wrong state");
  }
  if (basicTargetSym.isLazy()) {
    BasicSym resolved = (BasicSym) lazySymMap.get(((LazyBlockSym) targetSym).getKey());
    // FIXME: would like to have an assert here that the target is
    // non-null, but apparently have bugs here
    if (resolved == null) {
      listener.resolveFailed(containingSymbol, (LazyBlockSym) targetSym, detail);
      return targetSym;
    }
    if (resolved.isLazy()) {
      listener.resolveFailed(containingSymbol, (LazyBlockSym) targetSym, detail);
    }
    return resolved;
  }
  return targetSym;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:23,代码来源:BasicCDebugInfoDataBase.java


示例3: getDebugInfoDataBase

import sun.jvm.hotspot.utilities.Assert; //导入依赖的package包/类
public CDebugInfoDataBase getDebugInfoDataBase() throws DebuggerException {
  if (db != null) {
    return db;
  }

  // Try to parse
  if (dbg == null) {
    return null; // Need WindbgDebugger
  }

  if (Assert.ASSERTS_ENABLED) {
    Assert.that(fullPathName != null, "Need full path name to build debug info database");
  }

  db = new WindbgCDebugInfoBuilder(dbg).buildDataBase(fullPathName, addr);
  return db;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:18,代码来源:DLL.java


示例4: getOrigBytecodeAt

import sun.jvm.hotspot.utilities.Assert; //导入依赖的package包/类
/** Fetch the original non-breakpoint bytecode at the specified
    bci. It is required that there is currently a bytecode at this
    bci. */
public int getOrigBytecodeAt(int bci) {
  BreakpointInfo bp = getMethodHolder().getBreakpoints();
  for (; bp != null; bp = bp.getNext()) {
    if (bp.match(this, bci)) {
      return bp.getOrigBytecode();
    }
  }
  System.err.println("Requested bci " + bci);
  for (; bp != null; bp = bp.getNext()) {
    System.err.println("Breakpoint at bci " + bp.getBCI() + ", bytecode " +
                       bp.getOrigBytecode());
  }
  Assert.that(false, "Should not reach here");
  return -1; // not reached
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:19,代码来源:Method.java


示例5: thisObject

import sun.jvm.hotspot.utilities.Assert; //导入依赖的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


示例6: createVirtualMachineForCorefile

import sun.jvm.hotspot.utilities.Assert; //导入依赖的package包/类
static public VirtualMachineImpl createVirtualMachineForCorefile(VirtualMachineManager mgr,
                                                                 String javaExecutableName,
                                                                 String coreFileName,
                                                                 int sequenceNumber)
    throws Exception {
    if (Assert.ASSERTS_ENABLED) {
        Assert.that(coreFileName != null, "SA VirtualMachineImpl: core filename = null is not yet implemented");
    }
    if (Assert.ASSERTS_ENABLED) {
        Assert.that(javaExecutableName != null, "SA VirtualMachineImpl: java executable = null is not yet implemented");
    }

    VirtualMachineImpl myvm = new VirtualMachineImpl(mgr, sequenceNumber);
    try {
        myvm.saAgent.attach(javaExecutableName, coreFileName);
        myvm.init();
    } catch (Exception ee) {
        myvm.saAgent.detach();
        throw ee;
    }
    return myvm;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:23,代码来源:VirtualMachineImpl.java


示例7: createVirtualMachineForServer

import sun.jvm.hotspot.utilities.Assert; //导入依赖的package包/类
static public VirtualMachineImpl createVirtualMachineForServer(VirtualMachineManager mgr,
                                                            String server,
                                                            int sequenceNumber)
    throws Exception {
    if (Assert.ASSERTS_ENABLED) {
        Assert.that(server != null, "SA VirtualMachineImpl: DebugServer = null is not yet implemented");
    }

    VirtualMachineImpl myvm = new VirtualMachineImpl(mgr, sequenceNumber);
    try {
        myvm.saAgent.attach(server);
        myvm.init();
    } catch (Exception ee) {
        myvm.saAgent.detach();
        throw ee;
    }
    return myvm;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:19,代码来源:VirtualMachineImpl.java


示例8: addLiveRegions

import sun.jvm.hotspot.utilities.Assert; //导入依赖的package包/类
private void addLiveRegions(String name, List input, List output) {
  Iterator itr = input.iterator();

  while(itr.hasNext()) {
    MemRegion reg = (MemRegion)itr.next();
    Address top = reg.end();
    Address bottom = reg.start();
    if(Assert.ASSERTS_ENABLED) {
      Assert.that(top != null, "top address in a live region should not be null");
    }

    if(Assert.ASSERTS_ENABLED) {
      Assert.that(bottom != null, "bottom address in a live region should not be null");
    }

    output.add(top);
    output.add(bottom);
  }

}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:21,代码来源:FastObjectHeap.java


示例9: getDebugInfoDataBase

import sun.jvm.hotspot.utilities.Assert; //导入依赖的package包/类
public CDebugInfoDataBase getDebugInfoDataBase() throws DebuggerException {
  if (db != null) {
    return db;
  }

  // Try to parse
  if (dbg == null) {
    return null; // Need Win32Debugger
  }

  if (Assert.ASSERTS_ENABLED) {
    Assert.that(fullPathName != null, "Need full path name to build debug info database");
  }

  db = new Win32CDebugInfoBuilder(dbg).buildDataBase(fullPathName, addr);
  return db;
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:18,代码来源:DLL.java


示例10: getFloatTypeCode

import sun.jvm.hotspot.utilities.Assert; //导入依赖的package包/类
static String getFloatTypeCode(int dataType) {
    String result = null;
    switch(dataType) {
        case RTLDT_FL_SINGLE:
            result = "s";
            break;

        case RTLDT_FL_DOUBLE:
            result = "d";
            break;

        case RTLDT_FL_QUAD:
            result = "q";
            break;

        default:
            if (Assert.ASSERTS_ENABLED)
                Assert.that(false, "should not reach here");
    }
    return result;
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:22,代码来源:V9CMoveDecoder.java


示例11: getNumber

import sun.jvm.hotspot.utilities.Assert; //导入依赖的package包/类
public int getNumber(int width) {
    switch (width) {
    case SINGLE_PRECISION:
        Assert.that(number < 32, "bad single-prec fp register");
        return number;

    case DOUBLE_PRECISION:
        Assert.that(number < 64 && (number & 1) == 0, "bad double-prec fp register");
        return number & 0x1e | (number & 0x20) >> 5;

    case QUAD_PRECISION:
        Assert.that(number < 64 && (number & 3) == 0, "bad quad-prec fp register");
        return number & 0x1c | (number & 0x20) >> 5;
    }
    throw new RuntimeException("Invalid floating point width supplied");
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:17,代码来源:SPARCFloatRegister.java


示例12: thisObject

import sun.jvm.hotspot.utilities.Assert; //导入依赖的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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java REMOVE3Response类代码示例发布时间:2022-05-22
下一篇:
Java Export类代码示例发布时间: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