aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm/Assembly.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-26 21:51:20 +0800
committerGitHub <noreply@github.com>2018-09-26 21:51:20 +0800
commit2c860b7d7403fdec27442b617e9d01e610d06502 (patch)
treeb66230e6af617bfbdbe7548b51ad7c8618419e29 /libevmasm/Assembly.cpp
parent0f59284a3d606b5139f4d5ccb932d3b582854c3c (diff)
parent913ddf158f46b66b58bd8e60105edfe6aad89188 (diff)
downloaddexon-solidity-2c860b7d7403fdec27442b617e9d01e610d06502.tar
dexon-solidity-2c860b7d7403fdec27442b617e9d01e610d06502.tar.gz
dexon-solidity-2c860b7d7403fdec27442b617e9d01e610d06502.tar.bz2
dexon-solidity-2c860b7d7403fdec27442b617e9d01e610d06502.tar.lz
dexon-solidity-2c860b7d7403fdec27442b617e9d01e610d06502.tar.xz
dexon-solidity-2c860b7d7403fdec27442b617e9d01e610d06502.tar.zst
dexon-solidity-2c860b7d7403fdec27442b617e9d01e610d06502.zip
Merge pull request #5094 from ethereum/evmasm-grouping
Group LLL only assembly features in libevmasm
Diffstat (limited to 'libevmasm/Assembly.cpp')
-rw-r--r--libevmasm/Assembly.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp
index e49e675d..63452f36 100644
--- a/libevmasm/Assembly.cpp
+++ b/libevmasm/Assembly.cpp
@@ -69,6 +69,21 @@ void Assembly::append(Assembly const& _a, int _deposit)
append(Instruction::POP);
}
+AssemblyItem const& Assembly::append(AssemblyItem const& _i)
+{
+ assertThrow(m_deposit >= 0, AssemblyException, "Stack underflow.");
+ m_deposit += _i.deposit();
+ m_items.push_back(_i);
+ if (m_items.back().location().isEmpty() && !m_currentSourceLocation.isEmpty())
+ m_items.back().setLocation(m_currentSourceLocation);
+ return back();
+}
+
+void Assembly::injectStart(AssemblyItem const& _i)
+{
+ m_items.insert(m_items.begin(), _i);
+}
+
unsigned Assembly::bytesRequired(unsigned subTagSize) const
{
for (unsigned tagSize = subTagSize; true; ++tagSize)
@@ -323,16 +338,6 @@ Json::Value Assembly::assemblyJSON(StringMap const& _sourceCodes) const
return root;
}
-AssemblyItem const& Assembly::append(AssemblyItem const& _i)
-{
- assertThrow(m_deposit >= 0, AssemblyException, "Stack underflow.");
- m_deposit += _i.deposit();
- m_items.push_back(_i);
- if (m_items.back().location().isEmpty() && !m_currentSourceLocation.isEmpty())
- m_items.back().setLocation(m_currentSourceLocation);
- return back();
-}
-
AssemblyItem Assembly::namedTag(string const& _name)
{
assertThrow(!_name.empty(), AssemblyException, "Empty named tag.");
@@ -348,11 +353,6 @@ AssemblyItem Assembly::newPushLibraryAddress(string const& _identifier)
return AssemblyItem(PushLibraryAddress, h);
}
-void Assembly::injectStart(AssemblyItem const& _i)
-{
- m_items.insert(m_items.begin(), _i);
-}
-
Assembly& Assembly::optimise(bool _enable, EVMVersion _evmVersion, bool _isCreation, size_t _runs)
{
OptimiserSettings settings;