/** {@inheritDoc} */ public FunctorName getDeinternedFunctorName(int name) { return interner.getDeinternedFunctorName(name); }
/** {@inheritDoc} */ public FunctorName getDeinternedFunctorName(int name) { return interner.getDeinternedFunctorName(name); }
/** * Disassembles the arguments to an instruction that takes one functor reference. * * @param codeBuf The code buffer to disassemble from. * @param ip The instruction pointer within the code buffer. * @param instruction The instruction to store the disassembles arguments in. * @param interner The interner to look up function and variable names against. */ private static void disassembleFn(ByteBuffer codeBuf, int ip, WAMInstruction instruction, VariableAndFunctorInterner interner) { int fn = codeBuf.getInt(ip + 1); int f = fn & 0x00ffffff; instruction.fn = interner.getDeinternedFunctorName(f); }
/** * Disassembles the arguments to an instruction that takes one register and one functor reference. * * @param codeBuf The code buffer to disassemble from. * @param ip The instruction pointer within the code buffer. * @param instruction The instruction to store the disassembles arguments in. * @param interner The interner to look up function and variable names against. */ private static void disassembleReg1Fn(ByteBuffer codeBuf, int ip, WAMInstruction instruction, VariableAndFunctorInterner interner) { instruction.mode1 = codeBuf.get(ip + 1); instruction.reg1 = codeBuf.get(ip + 2); int fn = codeBuf.getInt(ip + 3); int f = fn & 0x00ffffff; instruction.fn = interner.getDeinternedFunctorName(f); }
/** * Checks if the term argument to an instruction was a constant. * * @param instruction The instruction to test. * * @return <tt>true</tt> iff the term argument to an instruction was a constant. <tt>false</tt> will be returned if * this information was not recorded, and cannot be determined. */ public boolean isConstant(WAMInstruction instruction) { Integer name = instruction.getFunctorNameReg1(); if (name != null) { FunctorName functorName = interner.getDeinternedFunctorName(name); if (functorName.getArity() == 0) { return true; } } return false; }
FunctorName name = interner.getDeinternedFunctorName(label);
interner.getDeinternedFunctorName(nextFunctor.getName()), nextFunctor); instructions.add(instruction);
FunctorName functorName = interner.getDeinternedFunctorName(next.getFunctorNameReg1()); WAMInstruction unifyConst = new WAMInstruction(UnifyConstant, functorName); shift(unifyConst); FunctorName functorName = interner.getDeinternedFunctorName(next.getFunctorNameReg1()); WAMInstruction setConst = new WAMInstruction(SetConstant, functorName); shift(setConst);