public void visitExec(JCExpressionStatement tree) { // Optimize x++ to ++x and x-- to --x. if (tree.expr.tag == JCTree.POSTINC) tree.expr.tag = JCTree.PREINC; else if (tree.expr.tag == JCTree.POSTDEC) tree.expr.tag = JCTree.PREDEC; genExpr(tree.expr, tree.expr.type).drop(); }
public void visitLetExpr(LetExpr tree) { int limit = code.nextreg; genStats(tree.defs, env); result = genExpr(tree.expr, tree.expr.type).load(); code.endScopes(limit); }
public void visitLetExpr(LetExpr tree) { int limit = code.nextreg; genStats(tree.defs, env); result = genExpr(tree.expr, tree.expr.type).load(); code.endScopes(limit); }
public void visitLetExpr(LetExpr tree) { int limit = code.nextreg; genStats(tree.defs, env); result = genExpr(tree.expr, tree.expr.type).load(); code.endScopes(limit); }
public void visitTypeCast(JCTypeCast tree) { result = genExpr(tree.expr, tree.clazz.type).load(); // Additional code is only needed if we cast to a reference type // which is not statically a supertype of the expression's type. // For basic types, the coerce(...) in genExpr(...) will do // the conversion. if (tree.clazz.type.tag > lastBaseTag && types.asSuper(tree.expr.type, tree.clazz.type.tsym) == null) { code.emitop2(checkcast, makeRef(tree.pos(), tree.clazz.type)); } }
public void visitTypeTest(JCInstanceOf tree) { genExpr(tree.expr, tree.expr.type).load(); code.emitop2(instanceof_, makeRef(tree.pos(), tree.clazz.type)); result = items.makeStackItem(syms.booleanType); }
public void visitApply(JCMethodInvocation tree) { // Generate code for method. Item m = genExpr(tree.meth, methodType); // Generate code for all arguments, where the expected types are // the parameters of the method's external type (that is, any implicit // outer instance of a super(...) call appears as first parameter). genArgs(tree.args, TreeInfo.symbol(tree.meth).externalType(types).getParameterTypes()); result = m.invoke(); }
public void visitTypeCast(JCTypeCast tree) { result = genExpr(tree.expr, tree.clazz.type).load(); // Additional code is only needed if we cast to a reference type // which is not statically a supertype of the expression's type. // For basic types, the coerce(...) in genExpr(...) will do // the conversion. if (tree.clazz.type.tag > lastBaseTag && types.asSuper(tree.expr.type, tree.clazz.type.tsym) == null) { code.emitop2(checkcast, makeRef(tree.pos(), tree.clazz.type)); } }
public void visitTypeTest(JCInstanceOf tree) { setTypeAnnotationPositions(tree.pos); genExpr(tree.expr, tree.expr.type).load(); code.emitop2(instanceof_, makeRef(tree.pos(), tree.clazz.type)); result = items.makeStackItem(syms.booleanType); }
public void visitTypeTest(JCInstanceOf tree) { setTypeAnnotationPositions(tree.pos); genExpr(tree.expr, tree.expr.type).load(); code.emitop2(instanceof_, makeRef(tree.pos(), tree.clazz.type)); result = items.makeStackItem(syms.booleanType); }
public void visitTypeCast(JCTypeCast tree) { setTypeAnnotationPositions(tree.pos); result = genExpr(tree.expr, tree.clazz.type).load(); // Additional code is only needed if we cast to a reference type // which is not statically a supertype of the expression's type. // For basic types, the coerce(...) in genExpr(...) will do // the conversion. if (!tree.clazz.type.isPrimitive() && types.asSuper(tree.expr.type, tree.clazz.type.tsym) == null) { code.emitop2(checkcast, makeRef(tree.pos(), tree.clazz.type)); } }
public void visitTypeCast(JCTypeCast tree) { setTypeAnnotationPositions(tree.pos); result = genExpr(tree.expr, tree.clazz.type).load(); // Additional code is only needed if we cast to a reference type // which is not statically a supertype of the expression's type. // For basic types, the coerce(...) in genExpr(...) will do // the conversion. if (!tree.clazz.type.isPrimitive() && types.asSuper(tree.expr.type, tree.clazz.type.tsym) == null) { code.emitop2(checkcast, makeRef(tree.pos(), tree.clazz.type)); } }
public void visitVarDef(JCVariableDecl tree) { VarSymbol v = tree.sym; code.newLocal(v); if (tree.init != null) { checkStringConstant(tree.init.pos(), v.getConstValue()); if (v.getConstValue() == null || varDebugInfo) { genExpr(tree.init, v.erasure(types)).load(); items.makeLocalItem(v).store(); } } checkDimension(tree.pos(), v.type); }
public void visitVarDef(JCVariableDecl tree) { VarSymbol v = tree.sym; code.newLocal(v); if (tree.init != null) { checkStringConstant(tree.init.pos(), v.getConstValue()); if (v.getConstValue() == null || varDebugInfo) { genExpr(tree.init, v.erasure(types)).load(); items.makeLocalItem(v).store(); } } checkDimension(tree.pos(), v.type); }