use of org.codehaus.groovy.classgen.asm.MethodCallerMultiAdapter in project groovy-core by groovy.
the class AsmClassGenerator method visitAttributeExpression.
public void visitAttributeExpression(AttributeExpression expression) {
Expression objectExpression = expression.getObjectExpression();
MethodCallerMultiAdapter adapter;
OperandStack operandStack = controller.getOperandStack();
int mark = operandStack.getStackLength() - 1;
if (controller.getCompileStack().isLHS()) {
adapter = setField;
if (isGroovyObject(objectExpression))
adapter = setGroovyObjectField;
if (usesSuper(expression))
adapter = setFieldOnSuper;
} else {
adapter = getField;
if (isGroovyObject(objectExpression))
adapter = getGroovyObjectField;
if (usesSuper(expression))
adapter = getFieldOnSuper;
}
visitAttributeOrProperty(expression, adapter);
if (!controller.getCompileStack().isLHS()) {
controller.getAssertionWriter().record(expression.getProperty());
} else {
operandStack.remove(operandStack.getStackLength() - mark);
}
}
use of org.codehaus.groovy.classgen.asm.MethodCallerMultiAdapter in project groovy-core by groovy.
the class AsmClassGenerator method visitPropertyExpression.
public void visitPropertyExpression(PropertyExpression expression) {
Expression objectExpression = expression.getObjectExpression();
OperandStack operandStack = controller.getOperandStack();
int mark = operandStack.getStackLength() - 1;
MethodCallerMultiAdapter adapter;
if (controller.getCompileStack().isLHS()) {
//operandStack.box();
adapter = setProperty;
if (isGroovyObject(objectExpression))
adapter = setGroovyObjectProperty;
if (isThisOrSuperInStaticContext(objectExpression))
adapter = setProperty;
} else {
adapter = getProperty;
if (isGroovyObject(objectExpression))
adapter = getGroovyObjectProperty;
if (isThisOrSuperInStaticContext(objectExpression))
adapter = getProperty;
}
visitAttributeOrProperty(expression, adapter);
if (controller.getCompileStack().isLHS()) {
// remove surplus values
operandStack.remove(operandStack.getStackLength() - mark);
} else {
controller.getAssertionWriter().record(expression.getProperty());
}
}
use of org.codehaus.groovy.classgen.asm.MethodCallerMultiAdapter in project groovy by apache.
the class AsmClassGenerator method visitAttributeExpression.
public void visitAttributeExpression(AttributeExpression expression) {
Expression objectExpression = expression.getObjectExpression();
MethodCallerMultiAdapter adapter;
OperandStack operandStack = controller.getOperandStack();
int mark = operandStack.getStackLength() - 1;
if (controller.getCompileStack().isLHS()) {
adapter = setField;
if (isGroovyObject(objectExpression))
adapter = setGroovyObjectField;
if (usesSuper(expression))
adapter = setFieldOnSuper;
} else {
adapter = getField;
if (isGroovyObject(objectExpression))
adapter = getGroovyObjectField;
if (usesSuper(expression))
adapter = getFieldOnSuper;
}
visitAttributeOrProperty(expression, adapter);
if (!controller.getCompileStack().isLHS()) {
controller.getAssertionWriter().record(expression.getProperty());
} else {
operandStack.remove(operandStack.getStackLength() - mark);
}
}
use of org.codehaus.groovy.classgen.asm.MethodCallerMultiAdapter in project groovy by apache.
the class AsmClassGenerator method visitPropertyExpression.
public void visitPropertyExpression(PropertyExpression expression) {
Expression objectExpression = expression.getObjectExpression();
OperandStack operandStack = controller.getOperandStack();
int mark = operandStack.getStackLength() - 1;
MethodCallerMultiAdapter adapter;
if (controller.getCompileStack().isLHS()) {
//operandStack.box();
adapter = setProperty;
if (isGroovyObject(objectExpression))
adapter = setGroovyObjectProperty;
if (isThisOrSuperInStaticContext(objectExpression))
adapter = setProperty;
} else {
adapter = getProperty;
if (isGroovyObject(objectExpression))
adapter = getGroovyObjectProperty;
if (isThisOrSuperInStaticContext(objectExpression))
adapter = getProperty;
}
visitAttributeOrProperty(expression, adapter);
if (controller.getCompileStack().isLHS()) {
// remove surplus values
operandStack.remove(operandStack.getStackLength() - mark);
} else {
controller.getAssertionWriter().record(expression.getProperty());
}
}
Aggregations