diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-28 06:28:49 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-25 17:42:36 +0800 |
commit | 70e89a5dac5d2a1c4ec01f6ccbcf660809c81c4c (patch) | |
tree | f3669a9ccf5e009bfd706463f60561d2ad61da09 /libevmasm/Assembly.h | |
parent | de5c702cc690dbfc51d9e7203328d81c6ede13b4 (diff) | |
download | dexon-solidity-70e89a5dac5d2a1c4ec01f6ccbcf660809c81c4c.tar dexon-solidity-70e89a5dac5d2a1c4ec01f6ccbcf660809c81c4c.tar.gz dexon-solidity-70e89a5dac5d2a1c4ec01f6ccbcf660809c81c4c.tar.bz2 dexon-solidity-70e89a5dac5d2a1c4ec01f6ccbcf660809c81c4c.tar.lz dexon-solidity-70e89a5dac5d2a1c4ec01f6ccbcf660809c81c4c.tar.xz dexon-solidity-70e89a5dac5d2a1c4ec01f6ccbcf660809c81c4c.tar.zst dexon-solidity-70e89a5dac5d2a1c4ec01f6ccbcf660809c81c4c.zip |
Introduce JumpdestRemover optimisation step
Diffstat (limited to 'libevmasm/Assembly.h')
-rw-r--r-- | libevmasm/Assembly.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libevmasm/Assembly.h b/libevmasm/Assembly.h index 451b4ea0..680cb1af 100644 --- a/libevmasm/Assembly.h +++ b/libevmasm/Assembly.h @@ -100,6 +100,7 @@ public: struct OptimiserSettings { bool isCreation = false; + bool runJumpdestRemover = false; bool runPeephole = false; bool runDeduplicate = false; bool runCSE = false; @@ -110,7 +111,7 @@ public: }; /// Execute optimisation passes as defined by @a _settings and return the optimised assembly. - Assembly& optimise(OptimiserSettings _settings); + Assembly& optimise(OptimiserSettings const& _settings); /// Modify (if @a _enable is set) and return the current assembly such that creation and /// execution gas usage is optimised. @a _isCreation should be true for the top-level assembly. @@ -128,8 +129,9 @@ public: protected: /// Does the same operations as @a optimise, but should only be applied to a sub and - /// returns the replaced tags. - std::map<u256, u256> optimiseInternal(OptimiserSettings _settings); + /// returns the replaced tags. Also takes an argument containing the tags of this assembly + /// that are referenced in a super-assembly. + std::map<u256, u256> optimiseInternal(OptimiserSettings const& _settings, std::set<size_t> const& _tagsReferencedFromOutside); unsigned bytesRequired(unsigned subTagSize) const; |