public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); _right.translate(classGen, methodGen); il.append(new CHECKCAST(cpg.addClass(_className))); } }
/** * Translates an object of this type to its unboxed representation. */ public void translateUnBox(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); il.append(new CHECKCAST(cpg.addClass(DOUBLE_CLASS))); il.append(new INVOKEVIRTUAL(cpg.addMethodref(DOUBLE_CLASS, DOUBLE_VALUE, DOUBLE_VALUE_SIG))); }
/** * Translates an object of this type to its unboxed representation. */ public void translateUnBox(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); il.append(new CHECKCAST(cpg.addClass(BOOLEAN_CLASS))); il.append(new INVOKEVIRTUAL(cpg.addMethodref(BOOLEAN_CLASS, BOOLEAN_VALUE, BOOLEAN_VALUE_SIG))); }
/** * Translates an object of this type to its unboxed representation. */ public void translateUnBox(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); il.append(new CHECKCAST(cpg.addClass(RUNTIME_NODE_CLASS))); il.append(new GETFIELD(cpg.addFieldref(RUNTIME_NODE_CLASS, NODE_FIELD, NODE_FIELD_SIG))); }
/** * Translates an object of this type to its unboxed representation. */ public void translateUnBox(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); il.append(new CHECKCAST(cpg.addClass(INTEGER_CLASS))); final int index = cpg.addMethodref(INTEGER_CLASS, INT_VALUE, INT_VALUE_SIG); il.append(new INVOKEVIRTUAL(index)); }
/** * Expects an integer on the stack and pushes a boxed integer. * Boxed integers are represented by an instance of * <code>java.lang.Integer</code>. * * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo */ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, ReferenceType type) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); il.append(new NEW(cpg.addClass(INTEGER_CLASS))); il.append(DUP_X1); il.append(SWAP); il.append(new INVOKESPECIAL(cpg.addMethodref(INTEGER_CLASS, "<init>", "(I)V"))); }
/** * Expects a boolean on the stack and pushes a boxed boolean. * Boxed booleans are represented by an instance of * <code>java.lang.Boolean</code>. * * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo */ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, ReferenceType type) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); il.append(new NEW(cpg.addClass(BOOLEAN_CLASS))); il.append(DUP_X1); il.append(SWAP); il.append(new INVOKESPECIAL(cpg.addMethodref(BOOLEAN_CLASS, "<init>", "(Z)V"))); }
/** * Expects a node on the stack and pushes a singleton node-set. Singleton * iterators are already started after construction. * * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo */ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, NodeSetType type) { ConstantPoolGen cpg = classGen.getConstantPool(); InstructionList il = methodGen.getInstructionList(); // Create a new instance of SingletonIterator il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR))); il.append(DUP_X1); il.append(SWAP); final int init = cpg.addMethodref(SINGLETON_ITERATOR, "<init>", "(" + NODE_SIG +")V"); il.append(new INVOKESPECIAL(init)); }
/** * Expects a double on the stack and pushes a boxed double. Boxed * double are represented by an instance of <code>java.lang.Double</code>. * * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo */ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, ReferenceType type) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); il.append(new NEW(cpg.addClass(DOUBLE_CLASS))); il.append(DUP_X2); il.append(DUP_X2); il.append(POP); il.append(new INVOKESPECIAL(cpg.addMethodref(DOUBLE_CLASS, "<init>", "(D)V"))); }
/** * Expects a node on the stack and pushes a boxed node. Boxed nodes * are represented by an instance of <code>org.apache.xalan.xsltc.dom.Node</code>. * * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo */ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, ReferenceType type) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); il.append(new NEW(cpg.addClass(RUNTIME_NODE_CLASS))); il.append(DUP_X1); il.append(SWAP); il.append(new PUSH(cpg, _type)); il.append(new INVOKESPECIAL(cpg.addMethodref(RUNTIME_NODE_CLASS, "<init>", "(II)V"))); }
"toString", "()"+STRING_SIG); il.append(new NEW(cpg.addClass(STRING_BUFFER_CLASS))); il.append(DUP); il.append(new INVOKESPECIAL(initBuffer));
/** * Translate a predicate expression. If non of the optimizations apply * then this translation pushes two references on the stack: a reference * to a newly created filter object and a reference to the predicate's * closure. See class <code>Step</code> for further details. */ public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); if (_nthPositionFilter || _nthDescendant) { _exp.translate(classGen, methodGen); } else if (isNodeValueTest() && (getParent() instanceof Step)) { _value.translate(classGen, methodGen); il.append(new CHECKCAST(cpg.addClass(STRING_CLASS))); il.append(new PUSH(cpg, ((EqualityExpr)_exp).getOp())); } else { translateFilter(classGen, methodGen); } } }
il.append(new NEW(cpg.addClass(_className))); il.append(DUP); il.append(new INVOKESPECIAL(cpg.addMethodref(_className,
+NODE_ITERATOR_SIG +")V"); il.append(new NEW(cpg.addClass(CACHED_NODE_LIST_ITERATOR_CLASS))); il.append(DUP_X1); il.append(SWAP);
il.append(new NEW(cpg.addClass(UNION_ITERATOR_CLASS))); il.append(DUP); il.append(methodGen.loadDOM());
"()"+STRING_SIG); il.append(new NEW(cpg.addClass(STRING_BUFFER_CLASS))); il.append(DUP); il.append(new INVOKESPECIAL(initBuffer));
il.append(new NEW(cpg.addClass(DUP_FILTERED_ITERATOR))); il.append(DUP); pathTemp.setEnd(il.append(new ALOAD(pathTemp.getIndex())));
il.append(new NEW(cpg.addClass(ABSOLUTE_ITERATOR))); il.append(DUP); relPathIterator.setEnd(
il.append(new NEW(cpg.addClass(DFS_CLASS))); il.append(DUP); il.append(new GETSTATIC(cpg.addFieldref(LOCALE_CLASS, "US",
il.append(classGen.loadTranslet()); if (classGen.isExternal()) { il.append(new CHECKCAST(cpg.addClass(className)));