use of org.candle.decompiler.intermediate.expression.ArrayCreation in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method visitANEWARRAY.
/**
* Decompiles "new object array" operations.
*/
public void visitANEWARRAY(ANEWARRAY instruction) {
Type type = instruction.getType(context.getMethodGen().getConstantPool());
Expression count = context.getExpressions().pop();
ArrayCreation nai = null;
if (context.getCurrentInstruction().getNext().getInstruction() instanceof DUP) {
nai = new NewConstantArrayInstance(context.getCurrentInstruction(), type, count);
} else {
nai = new ArrayCreation(context.getCurrentInstruction(), type, count);
}
context.getExpressions().push(nai);
}
use of org.candle.decompiler.intermediate.expression.ArrayCreation in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method visitMULTIANEWARRAY.
/**
* Decompiles "new multi-dimentional array" operations.
*/
public void visitMULTIANEWARRAY(MULTIANEWARRAY instruction) {
Type type = instruction.getType(context.getMethodGen().getConstantPool());
LinkedList<Expression> counts = new LinkedList<Expression>();
int provided = instruction.getDimensions();
for (int i = 0; i < provided; i++) {
counts.addFirst(context.getExpressions().pop());
}
ArrayCreation nai = new ArrayCreation(context.getCurrentInstruction(), type, counts);
context.getExpressions().push(nai);
}
use of org.candle.decompiler.intermediate.expression.ArrayCreation in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method visitNEWARRAY.
/**
* Decompiles "new primitive array" operations.
*/
public void visitNEWARRAY(NEWARRAY instruction) {
// first, check to see if the next instruction is a DUP. If so,
// this is probably a constant array value.
Expression count = context.getExpressions().pop();
ArrayCreation nai = null;
if (context.getCurrentInstruction().getNext().getInstruction() instanceof DUP) {
nai = new NewConstantArrayInstance(context.getCurrentInstruction(), instruction.getType(), count);
} else {
nai = new ArrayCreation(context.getCurrentInstruction(), instruction.getType(), count);
}
context.getExpressions().push(nai);
}
Aggregations