本文整理汇总了Java中org.objectweb.asm.commons.CodeSizeEvaluator类的典型用法代码示例。如果您正苦于以下问题:Java CodeSizeEvaluator类的具体用法?Java CodeSizeEvaluator怎么用?Java CodeSizeEvaluator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CodeSizeEvaluator类属于org.objectweb.asm.commons包,在下文中一共展示了CodeSizeEvaluator类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: visitMethod
import org.objectweb.asm.commons.CodeSizeEvaluator; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* In addition, the returned {@link org.objectweb.asm.MethodVisitor}
* will throw an exception if the method is greater than 64K in length.
*/
@Override
public MethodVisitor visitMethod(
final int access,
final String name,
final String desc,
final String signature,
final String[] exceptions) {
MethodVisitor mv =
super.visitMethod(access, name, desc, signature, exceptions);
return new CodeSizeEvaluator(mv) {
@Override
public void visitEnd() {
super.visitEnd();
if (getMaxSize() > 64 * 1024) {
state = State.FAIL_TOO_LONG;
message = "the method " + name + " was too long.";
}
}
};
}
开发者ID:google,项目名称:allocation-instrumenter,代码行数:27,代码来源:VerifyingClassAdapter.java
示例2: getCodeSizeHelper
import org.objectweb.asm.commons.CodeSizeEvaluator; //导入依赖的package包/类
public CodeSizeHelper getCodeSizeHelper() {
ClassNode node = new ClassNode();
node.name = getClassCtx().getClazz().name;
ClassCompilationContext ccc = new ClassCompilationContext(node, true, classCtx.getCompiler());
CodeSizeEvaluator cse = new CodeSizeEvaluator(null);
MethodCompilationContext mcc = new MethodCompilationContext(ccc,
new GeneratorAdapter(cse, access, "method", desc), access, desc);
CodeSizeHelper helper = new CodeSizeHelper();
helper.ctx = mcc;
helper.cse = cse;
return helper;
}
开发者ID:ruediste,项目名称:salta,代码行数:13,代码来源:MethodCompilationContext.java
示例3: clear
import org.objectweb.asm.commons.CodeSizeEvaluator; //导入依赖的package包/类
/**
* Clears this block.
*/
void clear() {
readers.clear();
writers.clear();
parameters.clear();
insns.clear();
varMap.clear();
pushParameters.clear();
sizeEvaluator = new CodeSizeEvaluator(null);
}
开发者ID:tookar,项目名称:jBOP,代码行数:13,代码来源:Block.java
示例4: getLength
import org.objectweb.asm.commons.CodeSizeEvaluator; //导入依赖的package包/类
private int getLength(final MethodNode methodNode) {
final CodeSizeEvaluator codeSizeEvaluator = new CodeSizeEvaluator(null);
methodNode.accept(codeSizeEvaluator);
return codeSizeEvaluator.getMaxSize();
}
开发者ID:tookar,项目名称:jBOP,代码行数:6,代码来源:MethodSplitter.java
注:本文中的org.objectweb.asm.commons.CodeSizeEvaluator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论