当前位置: 首页>>代码示例>>Java>>正文


Java GeneratorAdapter.visitLineNumber方法代码示例

本文整理汇总了Java中org.objectweb.asm.commons.GeneratorAdapter.visitLineNumber方法的典型用法代码示例。如果您正苦于以下问题:Java GeneratorAdapter.visitLineNumber方法的具体用法?Java GeneratorAdapter.visitLineNumber怎么用?Java GeneratorAdapter.visitLineNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.objectweb.asm.commons.GeneratorAdapter的用法示例。


在下文中一共展示了GeneratorAdapter.visitLineNumber方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: emit

import org.objectweb.asm.commons.GeneratorAdapter; //导入方法依赖的package包/类
public void emit(C context, ObjExpr objx, GeneratorAdapter gen){
	if(targetClass != null && field != null)
		{
		target.emit(C.EXPRESSION, objx, gen);
		gen.visitLineNumber(line, gen.mark());
		gen.checkCast(getType(targetClass));
		gen.getField(getType(targetClass), fieldName, Type.getType(field.getType()));
		//if(context != C.STATEMENT)
		HostExpr.emitBoxReturn(objx, gen, field.getType());
		if(context == C.STATEMENT)
			{
			gen.pop();
			}
		}
	else
		{
		target.emit(C.EXPRESSION, objx, gen);
		gen.visitLineNumber(line, gen.mark());
		gen.push(fieldName);
		gen.push(requireField);
		gen.invokeStatic(REFLECTOR_TYPE, invokeNoArgInstanceMember);
		if(context == C.STATEMENT)
			gen.pop();
		}
}
 
开发者ID:mrange,项目名称:fsharpadvent2016,代码行数:26,代码来源:Compiler.java

示例2: emitAssign

import org.objectweb.asm.commons.GeneratorAdapter; //导入方法依赖的package包/类
public void emitAssign(C context, ObjExpr objx, GeneratorAdapter gen,
                       Expr val){
	if(targetClass != null && field != null)
		{
		target.emit(C.EXPRESSION, objx, gen);
		gen.checkCast(getType(targetClass));
		val.emit(C.EXPRESSION, objx, gen);
		gen.visitLineNumber(line, gen.mark());
		gen.dupX1();
		HostExpr.emitUnboxArg(objx, gen, field.getType());
		gen.putField(getType(targetClass), fieldName, Type.getType(field.getType()));
		}
	else
		{
		target.emit(C.EXPRESSION, objx, gen);
		gen.push(fieldName);
		val.emit(C.EXPRESSION, objx, gen);
		gen.visitLineNumber(line, gen.mark());
		gen.invokeStatic(REFLECTOR_TYPE, setInstanceFieldMethod);
		}
	if(context == C.STATEMENT)
		gen.pop();
}
 
开发者ID:mrange,项目名称:fsharpadvent2016,代码行数:24,代码来源:Compiler.java

示例3: emitArgsAndCall

import org.objectweb.asm.commons.GeneratorAdapter; //导入方法依赖的package包/类
void emitArgsAndCall(int firstArgToEmit, C context, ObjExpr objx, GeneratorAdapter gen){
	for(int i = firstArgToEmit; i < Math.min(MAX_POSITIONAL_ARITY, args.count()); i++)
		{
		Expr e = (Expr) args.nth(i);
		e.emit(C.EXPRESSION, objx, gen);
		}
	if(args.count() > MAX_POSITIONAL_ARITY)
		{
		PersistentVector restArgs = PersistentVector.EMPTY;
		for(int i = MAX_POSITIONAL_ARITY; i < args.count(); i++)
			{
			restArgs = restArgs.cons(args.nth(i));
			}
		MethodExpr.emitArgsAsArray(restArgs, objx, gen);
		}
	gen.visitLineNumber(line, gen.mark());

	if(context == C.RETURN)
		{
		ObjMethod method = (ObjMethod) METHOD.deref();
		method.emitClearLocals(gen);
		}

	gen.invokeInterface(IFN_TYPE, new Method("invoke", OBJECT_TYPE, ARG_TYPES[Math.min(MAX_POSITIONAL_ARITY + 1,
	                                                                                   args.count())]));
}
 
开发者ID:skejserjensen,项目名称:eclojure,代码行数:27,代码来源:Compiler.java

示例4: emitUnboxed

import org.objectweb.asm.commons.GeneratorAdapter; //导入方法依赖的package包/类
public void emitUnboxed(C context, ObjExpr objx, GeneratorAdapter gen){
	if(targetClass != null && field != null)
		{
		target.emit(C.EXPRESSION, objx, gen);
		gen.visitLineNumber(line, gen.mark());
		gen.checkCast(getType(targetClass));
		gen.getField(getType(targetClass), fieldName, Type.getType(field.getType()));
		}
	else
		throw new UnsupportedOperationException("Unboxed emit of unknown member");
}
 
开发者ID:mrange,项目名称:fsharpadvent2016,代码行数:12,代码来源:Compiler.java

示例5: doEmit

import org.objectweb.asm.commons.GeneratorAdapter; //导入方法依赖的package包/类
public void doEmit(C context, ObjExpr objx, GeneratorAdapter gen, boolean emitUnboxed){
	Label nullLabel = gen.newLabel();
	Label falseLabel = gen.newLabel();
	Label endLabel = gen.newLabel();

	gen.visitLineNumber(line, gen.mark());

	if(testExpr instanceof StaticMethodExpr && ((StaticMethodExpr)testExpr).canEmitIntrinsicPredicate())
		{
		((StaticMethodExpr) testExpr).emitIntrinsicPredicate(C.EXPRESSION, objx, gen, falseLabel);
		}
	else if(maybePrimitiveType(testExpr) == boolean.class)
		{
		((MaybePrimitiveExpr) testExpr).emitUnboxed(C.EXPRESSION, objx, gen);
		gen.ifZCmp(gen.EQ, falseLabel);
		}
	else
		{
		testExpr.emit(C.EXPRESSION, objx, gen);
		gen.dup();
		gen.ifNull(nullLabel);
		gen.getStatic(BOOLEAN_OBJECT_TYPE, "FALSE", BOOLEAN_OBJECT_TYPE);
		gen.visitJumpInsn(IF_ACMPEQ, falseLabel);
		}
	if(emitUnboxed)
		((MaybePrimitiveExpr)thenExpr).emitUnboxed(context, objx, gen);
	else
		thenExpr.emit(context, objx, gen);
	gen.goTo(endLabel);
	gen.mark(nullLabel);
	gen.pop();
	gen.mark(falseLabel);
	if(emitUnboxed)
		((MaybePrimitiveExpr)elseExpr).emitUnboxed(context, objx, gen);
	else
		elseExpr.emit(context, objx, gen);
	gen.mark(endLabel);
}
 
开发者ID:mrange,项目名称:fsharpadvent2016,代码行数:39,代码来源:Compiler.java


注:本文中的org.objectweb.asm.commons.GeneratorAdapter.visitLineNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。