當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。