diff options
author | chriseth <c@ethdev.com> | 2016-11-11 01:16:21 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-11-16 21:37:18 +0800 |
commit | e543bd34c0b4884b5a27555f698f50af6a1c0b81 (patch) | |
tree | ef2c12e4767a3d38603323212face114213ca4b4 /libevmasm/Assembly.h | |
parent | ee3efa67a8d3eb4077786fd745c1925a916419f5 (diff) | |
download | dexon-solidity-e543bd34c0b4884b5a27555f698f50af6a1c0b81.tar.gz dexon-solidity-e543bd34c0b4884b5a27555f698f50af6a1c0b81.tar.zst dexon-solidity-e543bd34c0b4884b5a27555f698f50af6a1c0b81.zip |
Stored combined creation and runtime tags.
Includes a change to Assembly to allow tags from sub-assemblies to be
used.
Sorry, this get a bit bigger than I thought.
Diffstat (limited to 'libevmasm/Assembly.h')
-rw-r--r-- | libevmasm/Assembly.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libevmasm/Assembly.h b/libevmasm/Assembly.h index dae1e1da..0ae81e1d 100644 --- a/libevmasm/Assembly.h +++ b/libevmasm/Assembly.h @@ -53,7 +53,6 @@ public: AssemblyItem newPushSubSize(u256 const& _subId) { return AssemblyItem(PushSubSize, _subId); } AssemblyItem newPushLibraryAddress(std::string const& _identifier); - AssemblyItem append() { return append(newTag()); } void append(Assembly const& _a); void append(Assembly const& _a, int _deposit); AssemblyItem const& append(AssemblyItem const& _i); @@ -110,6 +109,10 @@ public: ) const; 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::string locationFromSources(StringMap const& _sourceCodes, SourceLocation const& _location) const; void donePath() { if (m_totalDeposit != INT_MAX && m_totalDeposit != m_deposit) BOOST_THROW_EXCEPTION(InvalidDeposit()); } unsigned bytesRequired() const; @@ -129,6 +132,7 @@ protected: std::map<h256, std::string> m_libraries; ///< Identifiers of libraries to be linked. mutable LinkerObject m_assembledObject; + mutable std::vector<size_t> m_tagPositionsInBytecode; int m_deposit = 0; int m_baseDeposit = 0; |