}
return false;
}
private boolean compileTrivialCall(String name, DynamicMethod method, int generation, BodyCompiler context, boolean expr) {
Node simpleBody = null;
if (method instanceof InterpretedMethod) {
InterpretedMethod target = (InterpretedMethod)method;
simpleBody = target.getBodyNode();
while (simpleBody instanceof NewlineNode) simpleBody = ((NewlineNode)simpleBody).getNextNode();
}
if (method instanceof DefaultMethod) {
DefaultMethod target = (DefaultMethod)method;
simpleBody = target.getBodyNode();
while (simpleBody instanceof NewlineNode) simpleBody = ((NewlineNode)simpleBody).getNextNode();
}
if (method instanceof JittedMethod) {
DefaultMethod target = (DefaultMethod)((JittedMethod)method).getRealMethod();
simpleBody = target.getBodyNode();
while (simpleBody instanceof NewlineNode) simpleBody = ((NewlineNode)simpleBody).getNextNode();
}
if (simpleBody != null) {
switch (simpleBody.getNodeType()) {
case SELFNODE:
case INSTVARNODE:
case NILNODE:
case FIXNUMNODE:
case FLOATNODE:
case STRNODE:
case BIGNUMNODE:
case FALSENODE:
case TRUENODE:
case SYMBOLNODE:
case XSTRNODE:
final Node simpleBodyFinal = simpleBody;
context.getInvocationCompiler().invokeTrivial(name, generation, new CompilerCallback() {
public void call(BodyCompiler context) {
compile(simpleBodyFinal, context, true);
}
});