diff options
author | chriseth <c@ethdev.com> | 2015-06-06 06:57:51 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-06-09 16:03:25 +0800 |
commit | 02d57169442d9f5ccf6536341fba1bfe0431473a (patch) | |
tree | db0290340311c2530b3de6064c770a26af96c451 /ExpressionCompiler.h | |
parent | 35ec81971acc31f16253bd1702fb81adbee85f48 (diff) | |
download | dexon-solidity-02d57169442d9f5ccf6536341fba1bfe0431473a.tar.gz dexon-solidity-02d57169442d9f5ccf6536341fba1bfe0431473a.tar.zst dexon-solidity-02d57169442d9f5ccf6536341fba1bfe0431473a.zip |
Use dynamic memory for argument encoding.
Diffstat (limited to 'ExpressionCompiler.h')
-rw-r--r-- | ExpressionCompiler.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/ExpressionCompiler.h b/ExpressionCompiler.h index 174e16d8..90994dfd 100644 --- a/ExpressionCompiler.h +++ b/ExpressionCompiler.h @@ -98,21 +98,28 @@ private: void appendHighBitsCleanup(IntegerType const& _typeOnStack); /// Appends code to call a function of the given type with the given arguments. - void appendExternalFunctionCall(FunctionType const& _functionType, std::vector<ASTPointer<Expression const>> const& _arguments); - /// Appends code that evaluates the given arguments and moves the result to memory encoded as - /// specified by the ABI. The memory offset is expected to be on the stack and is updated by - /// this call. If @a _padToWordBoundaries is set to false, all values are concatenated without - /// padding. If @a _copyDynamicDataInPlace is set, dynamic types is stored (without length) + void appendExternalFunctionCall( + FunctionType const& _functionType, + std::vector<ASTPointer<Expression const>> const& _arguments + ); + /// Copies values (of types @a _givenTypes) given on the stack to a location in memory given + /// at the stack top, encoding them according to the ABI as the given types @a _targetTypes. + /// Removes the values from the stack and leaves the updated memory pointer. + /// Stack pre: <v1> <v2> ... <vn> <memptr> + /// Stack post: <memptr_updated> + /// Does not touch the memory-free pointer. + /// @param _padToWordBoundaries if false, all values are concatenated without padding. + /// @param _copyDynamicDataInPlace if true, dynamic types is stored (without length) /// together with fixed-length data. - void appendArgumentsCopyToMemory( - std::vector<ASTPointer<Expression const>> const& _arguments, - TypePointers const& _types = {}, + void encodeToMemory( + TypePointers const& _givenTypes = {}, + TypePointers const& _targetTypes = {}, bool _padToWordBoundaries = true, - bool _padExceptionIfFourBytes = false, bool _copyDynamicDataInPlace = false ); /// Appends code that moves a stack element of the given type to memory. The memory offset is /// expected below the stack element and is updated by this call. + /// For arrays, this only copies the data part. void appendTypeMoveToMemory(Type const& _type, bool _padToWordBoundaries = true); /// Appends code that evaluates a single expression and moves the result to memory. The memory offset is /// expected to be on the stack and is updated by this call. |