diff options
author | chriseth <c@ethdev.com> | 2016-11-11 21:11:07 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-11-16 21:37:19 +0800 |
commit | 0335ed4cb476ece63224a96c8ab660116ff08c3a (patch) | |
tree | 6579706bb8da1e8b84e05dc95775bfca5076cc7c /libevmasm/Assembly.h | |
parent | 22b4d1b29a17c6a6360d6d6e42860bd621a7bfd3 (diff) | |
download | dexon-solidity-0335ed4cb476ece63224a96c8ab660116ff08c3a.tar.gz dexon-solidity-0335ed4cb476ece63224a96c8ab660116ff08c3a.tar.zst dexon-solidity-0335ed4cb476ece63224a96c8ab660116ff08c3a.zip |
Simple peephole optimizer that is activated even if not requested.
Diffstat (limited to 'libevmasm/Assembly.h')
-rw-r--r-- | libevmasm/Assembly.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libevmasm/Assembly.h b/libevmasm/Assembly.h index 3ce82cce..f3c56610 100644 --- a/libevmasm/Assembly.h +++ b/libevmasm/Assembly.h @@ -101,6 +101,7 @@ public: /// execution gas usage is optimised. @a _isCreation should be true for the top-level assembly. /// @a _runs specifes an estimate on how often each opcode in this assembly will be executed, /// i.e. use a small value to optimise for size and a large value to optimise for runtime. + /// If @a _enable is not set, will perform some simple peephole optimizations. Assembly& optimise(bool _enable, bool _isCreation = true, size_t _runs = 200); Json::Value stream( std::ostream& _out, @@ -112,7 +113,7 @@ 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(bool _isCreation, size_t _runs); + std::map<u256, u256> optimiseInternal(bool _enable, bool _isCreation, size_t _runs); std::string locationFromSources(StringMap const& _sourceCodes, SourceLocation const& _location) const; void donePath() { if (m_totalDeposit != INT_MAX && m_totalDeposit != m_deposit) BOOST_THROW_EXCEPTION(InvalidDeposit()); } |