aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm/SemanticInformation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libevmasm/SemanticInformation.cpp')
-rw-r--r--libevmasm/SemanticInformation.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/libevmasm/SemanticInformation.cpp b/libevmasm/SemanticInformation.cpp
index 61a6ccda..03870f7c 100644
--- a/libevmasm/SemanticInformation.cpp
+++ b/libevmasm/SemanticInformation.cpp
@@ -35,6 +35,7 @@ bool SemanticInformation::breaksCSEAnalysisBlock(AssemblyItem const& _item)
default:
case UndefinedItem:
case Tag:
+ case PushDeployTimeAddress:
return true;
case Push:
case PushString:
@@ -153,6 +154,31 @@ bool SemanticInformation::isDeterministic(AssemblyItem const& _item)
}
}
+bool SemanticInformation::movable(Instruction _instruction)
+{
+ // These are not really functional.
+ if (isDupInstruction(_instruction) || isSwapInstruction(_instruction))
+ return false;
+ InstructionInfo info = instructionInfo(_instruction);
+ if (info.sideEffects)
+ return false;
+ switch (_instruction)
+ {
+ case Instruction::KECCAK256:
+ case Instruction::BALANCE:
+ case Instruction::EXTCODESIZE:
+ case Instruction::RETURNDATASIZE:
+ case Instruction::SLOAD:
+ case Instruction::PC:
+ case Instruction::MSIZE:
+ case Instruction::GAS:
+ return false;
+ default:
+ return true;
+ }
+ return true;
+}
+
bool SemanticInformation::invalidatesMemory(Instruction _instruction)
{
switch (_instruction)