|
|
@ -27,8 +27,8 @@ public class CreateConstantArray { |
|
|
|
public static boolean transform(InstructionContainer ic, |
|
|
|
public static boolean transform(InstructionContainer ic, |
|
|
|
StructuredBlock last) { |
|
|
|
StructuredBlock last) { |
|
|
|
/* Situation: |
|
|
|
/* Situation: |
|
|
|
* PUSH new Array[] |
|
|
|
* PUSH new Array[] // or a constant array operator.
|
|
|
|
* DUP |
|
|
|
* DUP // duplicate array reference
|
|
|
|
* PUSH index |
|
|
|
* PUSH index |
|
|
|
* PUSH value |
|
|
|
* PUSH value |
|
|
|
* stack_2[stack_1] = stack_0 |
|
|
|
* stack_2[stack_1] = stack_0 |
|
|
@ -67,8 +67,7 @@ public class CreateConstantArray { |
|
|
|
|
|
|
|
|
|
|
|
if (!indexOp.getType().isOfType(Type.tUInt) |
|
|
|
if (!indexOp.getType().isOfType(Type.tUInt) |
|
|
|
|| dup.type != SpecialBlock.DUP |
|
|
|
|| dup.type != SpecialBlock.DUP |
|
|
|
|| dup.depth != 0 |
|
|
|
|| dup.depth != 0 || dup.count != 1 |
|
|
|
|| dup.count != store.getLValueType().stackSize() |
|
|
|
|
|
|
|
|| !(sequBlock.subBlocks[0] instanceof InstructionBlock)) |
|
|
|
|| !(sequBlock.subBlocks[0] instanceof InstructionBlock)) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|