|
|
@ -38,41 +38,37 @@ public class CreateConstantArray { |
|
|
|
|
|
|
|
|
|
|
|
SequentialBlock sequBlock = (SequentialBlock) last.outer; |
|
|
|
SequentialBlock sequBlock = (SequentialBlock) last.outer; |
|
|
|
|
|
|
|
|
|
|
|
if (!(ic.getInstruction() instanceof ArrayStoreOperator) |
|
|
|
Operator storeOp = ic.getInstruction().getOperator(); |
|
|
|
|| !(sequBlock.subBlocks[0] instanceof InstructionBlock) |
|
|
|
if (!(ic.getInstruction() instanceof ComplexExpression) |
|
|
|
|| !(sequBlock.outer instanceof SequentialBlock)) |
|
|
|
|| !(ic.getInstruction().getOperator() |
|
|
|
return false; |
|
|
|
instanceof ArrayStoreOperator) |
|
|
|
ArrayStoreOperator store |
|
|
|
|| ic.getInstruction().getOperandCount() != 1 |
|
|
|
= (ArrayStoreOperator) ic.getInstruction(); |
|
|
|
|| !(sequBlock.subBlocks[0] instanceof SpecialBlock) |
|
|
|
InstructionBlock ib = (InstructionBlock)sequBlock.subBlocks[0]; |
|
|
|
|
|
|
|
sequBlock = (SequentialBlock) sequBlock.outer; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!(sequBlock.subBlocks[0] instanceof InstructionBlock) |
|
|
|
|
|
|
|
|| !(sequBlock.outer instanceof SequentialBlock)) |
|
|
|
|| !(sequBlock.outer instanceof SequentialBlock)) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
Expression expr = ib.getInstruction(); |
|
|
|
ComplexExpression storeExpr |
|
|
|
ib = (InstructionBlock)sequBlock.subBlocks[0]; |
|
|
|
= (ComplexExpression) ic.getInstruction(); |
|
|
|
sequBlock = (SequentialBlock) sequBlock.outer; |
|
|
|
ArrayStoreOperator store |
|
|
|
|
|
|
|
= (ArrayStoreOperator) storeExpr.getOperator(); |
|
|
|
|
|
|
|
|
|
|
|
if (expr.getOperandCount() > 0 |
|
|
|
Expression[] storeSub = storeExpr.getSubExpressions(); |
|
|
|
|| !(ib.getInstruction() instanceof ConstOperator) |
|
|
|
if (!(storeSub[0] instanceof NopOperator) |
|
|
|
|| !(sequBlock.subBlocks[0] instanceof SpecialBlock) |
|
|
|
|| !(storeSub[1] instanceof ConstOperator)) |
|
|
|
|| !(sequBlock.outer instanceof SequentialBlock)) |
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
ConstOperator indexOp = (ConstOperator) ib.getInstruction(); |
|
|
|
Expression expr = storeSub[2]; |
|
|
|
|
|
|
|
ConstOperator indexOp = (ConstOperator) storeSub[1]; |
|
|
|
SpecialBlock dup = (SpecialBlock) sequBlock.subBlocks[0]; |
|
|
|
SpecialBlock dup = (SpecialBlock) sequBlock.subBlocks[0]; |
|
|
|
sequBlock = (SequentialBlock) sequBlock.outer; |
|
|
|
sequBlock = (SequentialBlock) sequBlock.outer; |
|
|
|
|
|
|
|
|
|
|
|
if (!indexOp.getType().isOfType(Type.tUInt) |
|
|
|
if (dup.type != SpecialBlock.DUP |
|
|
|
|| dup.type != SpecialBlock.DUP |
|
|
|
|
|
|
|
|| dup.depth != 0 || dup.count != 1 |
|
|
|
|| dup.depth != 0 || dup.count != 1 |
|
|
|
|| !(sequBlock.subBlocks[0] instanceof InstructionBlock)) |
|
|
|
|| !(sequBlock.subBlocks[0] instanceof InstructionBlock)) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
int index = Integer.parseInt(indexOp.getValue()); |
|
|
|
int index = Integer.parseInt(indexOp.getValue()); |
|
|
|
ib = (InstructionBlock)sequBlock.subBlocks[0]; |
|
|
|
InstructionBlock ib = (InstructionBlock)sequBlock.subBlocks[0]; |
|
|
|
|
|
|
|
|
|
|
|
if (ib.getInstruction() instanceof ComplexExpression |
|
|
|
if (ib.getInstruction() instanceof ComplexExpression |
|
|
|
&& (ib.getInstruction().getOperator() |
|
|
|
&& (ib.getInstruction().getOperator() |
|
|
|