private Operand putConstant(Colon3Node node, Operand value) { addInstr(new PutConstInstr(new ObjectClass(), node.getName(), value)); return value; }
private Operand putConstant(Colon3Node node, Operand value) { addInstr(new PutConstInstr(new ObjectClass(), node.getName(), value)); return value; }
public Operand buildColon3(Colon3Node node, IRScope s) { return searchConstInInheritanceHierarchy(s, new ObjectClass(), node.getName()); }
public Operand buildColon3(Colon3Node node) { return searchModuleForConst(new ObjectClass(), node.getName()); }
public Operand buildColon3(Colon3Node node) { return searchModuleForConst(new ObjectClass(), node.getName()); }
public Operand buildColon3(Colon3Node node, IRScope s) { return searchConstInInheritanceHierarchy(s, new ObjectClass(), node.getName()); }
private Operand getContainerFromCPath(Colon3Node cpath) { Operand container; if (cpath instanceof Colon2Node) { Node leftNode = ((Colon2Node) cpath).getLeftNode(); if (leftNode != null) { // Foo::Bar container = build(leftNode); } else { // Only name with no left-side Bar <- Note no :: on left container = findContainerModule(); } } else { //::Bar container = new ObjectClass(); } return container; }
private Operand getContainerFromCPath(Colon3Node cpath) { Operand container; if (cpath instanceof Colon2Node) { Node leftNode = ((Colon2Node) cpath).getLeftNode(); if (leftNode != null) { // Foo::Bar container = build(leftNode); } else { // Only name with no left-side Bar <- Note no :: on left container = findContainerModule(); } } else { //::Bar container = new ObjectClass(); } return container; }
public Operand run(Object[] args) { IRScope s = (IRScope)args[0]; Node n = (Node)args[1]; String name = (String)args[2]; Operand v = (n instanceof Colon2Node) ? build(((Colon2Node)n).getLeftNode(), s) : new ObjectClass(); Variable tmpVar = s.getNewTemporaryVariable(); s.addInstr(new GetDefinedConstantOrMethodInstr(tmpVar, v, new StringLiteral(name))); return tmpVar; } };
public Operand run(Object[] args) { IRScope s = (IRScope)args[0]; Node n = (Node)args[1]; String name = (String)args[2]; Operand v = (n instanceof Colon2Node) ? build(((Colon2Node)n).getLeftNode(), s) : new ObjectClass(); Variable tmpVar = s.getNewTemporaryVariable(); s.addInstr(new GetDefinedConstantOrMethodInstr(tmpVar, v, new StringLiteral(name))); return tmpVar; } };
private Operand buildColon2ForConstAsgnDeclNode(Node lhs, Variable valueResult, boolean constMissing) { Variable leftModule = createTemporaryVariable(); RubySymbol name; if (lhs instanceof Colon2Node) { Colon2Node colon2Node = (Colon2Node) lhs; name = colon2Node.getName(); Operand leftValue = build(colon2Node.getLeftNode()); copy(leftModule, leftValue); } else { // colon3 copy(leftModule, new ObjectClass()); name = ((Colon3Node) lhs).getName(); } addInstr(new SearchModuleForConstInstr(valueResult, leftModule, name, false, constMissing)); return leftModule; }
private Operand buildColon2ForConstAsgnDeclNode(Node lhs, Variable valueResult, boolean constMissing) { Variable leftModule = createTemporaryVariable(); RubySymbol name; if (lhs instanceof Colon2Node) { Colon2Node colon2Node = (Colon2Node) lhs; name = colon2Node.getName(); Operand leftValue = build(colon2Node.getLeftNode()); copy(leftModule, leftValue); } else { // colon3 copy(leftModule, new ObjectClass()); name = ((Colon3Node) lhs).getName(); } addInstr(new SearchModuleForConstInstr(valueResult, leftModule, name, false, constMissing)); return leftModule; }
m.addInstr(new InheritanceSearchConstInstr(excType, new ObjectClass(), "Exception", false)); outputExceptionCheck(m, excType, exc, caughtLabel);
m.addInstr(new InheritanceSearchConstInstr(excType, new ObjectClass(), "Exception", false)); outputExceptionCheck(m, excType, exc, caughtLabel);
addInstr(new InheritanceSearchConstInstr(excType, new ObjectClass(), manager.runtime.newSymbol(CommonByteLists.EXCEPTION))); outputExceptionCheck(excType, exc, caughtLabel);
addInstr(new InheritanceSearchConstInstr(excType, new ObjectClass(), manager.runtime.newSymbol(CommonByteLists.EXCEPTION))); outputExceptionCheck(excType, exc, caughtLabel);
case NTH_REF: return NthRef.decode(this); case NULL_BLOCK: return NullBlock.decode(this); case OBJECT_CLASS: return new ObjectClass(); case RATIONAL: return Rational.decode(this); case REGEXP: return Regexp.decode(this);
case NTH_REF: return NthRef.decode(this); case NULL_BLOCK: return NullBlock.decode(this); case OBJECT_CLASS: return new ObjectClass(); case RATIONAL: return Rational.decode(this); case REGEXP: return Regexp.decode(this);
addInstr(new InheritanceSearchConstInstr(excType, new ObjectClass(), manager.runtime.newSymbol(CommonByteLists.NOT_IMPLEMENTED_ERROR))); Variable exc = addResultInstr(CallInstr.create(scope, createTemporaryVariable(), manager.runtime.newSymbol(CommonByteLists.NEW),
addInstr(new InheritanceSearchConstInstr(excType, new ObjectClass(), manager.runtime.newSymbol(CommonByteLists.NOT_IMPLEMENTED_ERROR))); Variable exc = addResultInstr(CallInstr.create(scope, createTemporaryVariable(), manager.runtime.newSymbol(CommonByteLists.NEW),