context.isConstantBranch(setup, isConstant, isMethod, none, name);
break;
}
case CALLNODE:
{
final CallNode iVisited = (CallNode) node;
Object isnull = context.getNewEnding();
Object ending = context.getNewEnding();
compileGetDefinition(iVisited.getReceiverNode(), context);
context.ifNull(isnull);
context.rescue(new BranchCallback() {
public void branch(BodyCompiler context) {
compile(iVisited.getReceiverNode(), context); //[IRubyObject]
context.duplicateCurrentValue(); //[IRubyObject, IRubyObject]
context.metaclass(); //[IRubyObject, RubyClass]
context.duplicateCurrentValue(); //[IRubyObject, RubyClass, RubyClass]
context.getVisibilityFor(iVisited.getName()); //[IRubyObject, RubyClass, Visibility]
context.duplicateCurrentValue(); //[IRubyObject, RubyClass, Visibility, Visibility]
final Object isfalse = context.getNewEnding();
Object isreal = context.getNewEnding();
Object ending = context.getNewEnding();
context.isPrivate(isfalse, 3); //[IRubyObject, RubyClass, Visibility]
context.isNotProtected(isreal, 1); //[IRubyObject, RubyClass]
context.selfIsKindOf(isreal); //[IRubyObject]
context.consumeCurrentValue();
context.go(isfalse);
context.setEnding(isreal); //[]
context.isMethodBound(iVisited.getName(), new BranchCallback() {
public void branch(BodyCompiler context) {
compileGetArgumentDefinition(iVisited.getArgsNode(), context, "method");
}
},
new BranchCallback() {
public void branch(BodyCompiler context) {
context.go(isfalse);
}
});
context.go(ending);
context.setEnding(isfalse);
context.pushNull();
context.setEnding(ending);
}
}, JumpException.class,
new BranchCallback() {
public void branch(BodyCompiler context) {
context.pushNull();
}
}, String.class);
// context.swapValues();
//context.consumeCurrentValue();
context.go(ending);
context.setEnding(isnull);
context.pushNull();
context.setEnding(ending);
break;
}
case CLASSVARNODE:
{
ClassVarNode iVisited = (ClassVarNode) node;
final Object ending = context.getNewEnding();
final Object failure = context.getNewEnding();
final Object singleton = context.getNewEnding();
Object second = context.getNewEnding();
Object third = context.getNewEnding();
context.loadCurrentModule(); //[RubyClass]
context.duplicateCurrentValue(); //[RubyClass, RubyClass]
context.ifNotNull(second); //[RubyClass]
context.consumeCurrentValue(); //[]
context.loadSelf(); //[self]
context.metaclass(); //[RubyClass]
context.duplicateCurrentValue(); //[RubyClass, RubyClass]
context.isClassVarDefined(iVisited.getName(),
new BranchCallback() {
public void branch(BodyCompiler context) {
context.consumeCurrentValue();
context.pushString("class variable");
context.go(ending);
}
},
new BranchCallback() {
public void branch(BodyCompiler context) {
}
});
context.setEnding(second); //[RubyClass]
context.duplicateCurrentValue();
context.isClassVarDefined(iVisited.getName(),
new BranchCallback() {
public void branch(BodyCompiler context) {
context.consumeCurrentValue();
context.pushString("class variable");
context.go(ending);
}
},
new BranchCallback() {
public void branch(BodyCompiler context) {
}
});
context.setEnding(third); //[RubyClass]
context.duplicateCurrentValue(); //[RubyClass, RubyClass]
context.ifSingleton(singleton); //[RubyClass]
context.consumeCurrentValue();//[]
context.go(failure);
context.setEnding(singleton);
context.attached();//[RubyClass]
context.notIsModuleAndClassVarDefined(iVisited.getName(), failure); //[]
context.pushString("class variable");
context.go(ending);
context.setEnding(failure);
context.pushNull();
context.setEnding(ending);
}
break;
case ZSUPERNODE:
{
Object fail = context.getNewEnding();
Object fail2 = context.getNewEnding();
Object fail_easy = context.getNewEnding();
Object ending = context.getNewEnding();
context.getFrameName(); //[String]
context.duplicateCurrentValue(); //[String, String]
context.ifNull(fail); //[String]
context.getFrameKlazz(); //[String, RubyClass]
context.duplicateCurrentValue(); //[String, RubyClass, RubyClass]
context.ifNull(fail2); //[String, RubyClass]
context.superClass();
context.ifNotSuperMethodBound(fail_easy);
context.pushString("super");
context.go(ending);
context.setEnding(fail2);
context.consumeCurrentValue();
context.setEnding(fail);
context.consumeCurrentValue();
context.setEnding(fail_easy);
context.pushNull();
context.setEnding(ending);
}
break;
case SUPERNODE:
{
Object fail = context.getNewEnding();
Object fail2 = context.getNewEnding();
Object fail_easy = context.getNewEnding();
Object ending = context.getNewEnding();
context.getFrameName(); //[String]
context.duplicateCurrentValue(); //[String, String]
context.ifNull(fail); //[String]
context.getFrameKlazz(); //[String, RubyClass]
context.duplicateCurrentValue(); //[String, RubyClass, RubyClass]
context.ifNull(fail2); //[String, RubyClass]
context.superClass();
context.ifNotSuperMethodBound(fail_easy);
compileGetArgumentDefinition(((SuperNode) node).getArgsNode(), context, "super");
context.go(ending);
context.setEnding(fail2);
context.consumeCurrentValue();
context.setEnding(fail);
context.consumeCurrentValue();
context.setEnding(fail_easy);
context.pushNull();
context.setEnding(ending);
break;
}
case ATTRASSIGNNODE:
{
final AttrAssignNode iVisited = (AttrAssignNode) node;
Object isnull = context.getNewEnding();
Object ending = context.getNewEnding();
compileGetDefinition(iVisited.getReceiverNode(), context);
context.ifNull(isnull);
context.rescue(new BranchCallback() {
public void branch(BodyCompiler context) {
compile(iVisited.getReceiverNode(), context); //[IRubyObject]
context.duplicateCurrentValue(); //[IRubyObject, IRubyObject]
context.metaclass(); //[IRubyObject, RubyClass]
context.duplicateCurrentValue(); //[IRubyObject, RubyClass, RubyClass]
context.getVisibilityFor(iVisited.getName()); //[IRubyObject, RubyClass, Visibility]
context.duplicateCurrentValue(); //[IRubyObject, RubyClass, Visibility, Visibility]
final Object isfalse = context.getNewEnding();
Object isreal = context.getNewEnding();
Object ending = context.getNewEnding();
context.isPrivate(isfalse, 3); //[IRubyObject, RubyClass, Visibility]
context.isNotProtected(isreal, 1); //[IRubyObject, RubyClass]
context.selfIsKindOf(isreal); //[IRubyObject]
context.consumeCurrentValue();
context.go(isfalse);
context.setEnding(isreal); //[]
context.isMethodBound(iVisited.getName(), new BranchCallback() {
public void branch(BodyCompiler context) {
compileGetArgumentDefinition(iVisited.getArgsNode(), context, "assignment");
}
},
new BranchCallback() {
public void branch(BodyCompiler context) {