aboutsummaryrefslogtreecommitdiffstats
path: root/libjulia/backends/evm/AbstractAssembly.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-05-25 00:34:19 +0800
committerchriseth <chris@ethereum.org>2017-06-08 21:52:44 +0800
commit97cc968a133247e729ed1d189d35ef2b7b53b3d4 (patch)
treec2aa552abea75a732e36e0c6b357ea879f35de54 /libjulia/backends/evm/AbstractAssembly.h
parent21e0b69dcb189fb52ac4e38959801582e02ca8fd (diff)
downloaddexon-solidity-97cc968a133247e729ed1d189d35ef2b7b53b3d4.tar.gz
dexon-solidity-97cc968a133247e729ed1d189d35ef2b7b53b3d4.tar.zst
dexon-solidity-97cc968a133247e729ed1d189d35ef2b7b53b3d4.zip
Initial EVM1.5 assembly implementation.
Diffstat (limited to 'libjulia/backends/evm/AbstractAssembly.h')
-rw-r--r--libjulia/backends/evm/AbstractAssembly.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/libjulia/backends/evm/AbstractAssembly.h b/libjulia/backends/evm/AbstractAssembly.h
index de31be28..ba2c8e20 100644
--- a/libjulia/backends/evm/AbstractAssembly.h
+++ b/libjulia/backends/evm/AbstractAssembly.h
@@ -41,6 +41,9 @@ struct Identifier;
namespace julia
{
+///
+/// Assembly class that abstracts both the libevmasm assembly and the new julia evm assembly.
+///
class AbstractAssembly
{
public:
@@ -66,6 +69,21 @@ public:
/// Append a reference to a to-be-linked symobl.
/// Currently, we assume that the value is always a 20 byte number.
virtual void appendLinkerSymbol(std::string const& _name) = 0;
+
+ /// Append a jump instruction.
+ /// @param _stackDiffAfter the stack adjustment after this instruction.
+ virtual void appendJump(int _stackDiffAfter) = 0;
+
+ /// Append a jump-to-immediate operation.
+ virtual void appendJumpTo(LabelID _label, int _stackDiffAfter = 0) = 0;
+ /// Append a jump-to-if-immediate operation.
+ virtual void appendJumpToIf(LabelID _label) = 0;
+ /// Start a subroutine.
+ virtual void appendBeginsub(LabelID _label, int _arguments) = 0;
+ /// Call a subroutine.
+ virtual void appendJumpsub(LabelID _label, int _arguments, int _returns) = 0;
+ /// Return from a subroutine.
+ virtual void appendReturnsub(int _returns) = 0;
};
enum class IdentifierContext { LValue, RValue };
@@ -74,7 +92,7 @@ enum class IdentifierContext { LValue, RValue };
/// to inline assembly (not used in standalone assembly mode).
struct ExternalIdentifierAccess
{
- using Resolver = std::function<size_t(solidity::assembly::Identifier const&, IdentifierContext)>;
+ using Resolver = std::function<size_t(solidity::assembly::Identifier const&, IdentifierContext, bool /*_crossesFunctionBoundary*/)>;
/// Resolve a an external reference given by the identifier in the given context.
/// @returns the size of the value (number of stack slots) or size_t(-1) if not found.
Resolver resolve;