aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/CompilerUtils.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-09-21 22:56:16 +0800
committerGitHub <noreply@github.com>2017-09-21 22:56:16 +0800
commitbdeb9e52a2211510644fb53df93fb98258b40a65 (patch)
treed8fb917e7dc27b937cb4505029bbc3c8c1bc1a67 /libsolidity/codegen/CompilerUtils.h
parentd7661dd97460250b4e1127b9e7ea91e116143780 (diff)
parenta14fc5ffa1f03d5aa312396a39633d720b04c90a (diff)
downloaddexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar
dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.gz
dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.bz2
dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.lz
dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.xz
dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.zst
dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.zip
Merge pull request #2947 from ethereum/develop
Merge develop into release for 0.4.17.
Diffstat (limited to 'libsolidity/codegen/CompilerUtils.h')
-rw-r--r--libsolidity/codegen/CompilerUtils.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h
index 18b70250..5e45699b 100644
--- a/libsolidity/codegen/CompilerUtils.h
+++ b/libsolidity/codegen/CompilerUtils.h
@@ -38,14 +38,20 @@ public:
/// Stores the initial value of the free-memory-pointer at its position;
void initialiseFreeMemoryPointer();
/// Copies the free memory pointer to the stack.
+ /// Stack pre:
+ /// Stack post: <mem_start>
void fetchFreeMemoryPointer();
/// Stores the free memory pointer from the stack.
+ /// Stack pre: <mem_end>
+ /// Stack post:
void storeFreeMemoryPointer();
/// Allocates a number of bytes in memory as given on the stack.
/// Stack pre: <size>
/// Stack post: <mem_start>
void allocateMemory();
/// Appends code that transforms memptr to (memptr - free_memptr) memptr
+ /// Stack pre: <mem_end>
+ /// Stack post: <size> <mem_start>
void toSizeAfterFreeMemoryPointer();
/// Loads data from memory to the stack.
@@ -105,6 +111,8 @@ public:
/// Special case of @a encodeToMemory which assumes that everything is padded to words
/// and dynamic data is not copied in place (i.e. a proper ABI encoding).
+ /// Stack pre: <value0> <value1> ... <valueN-1> <head_start>
+ /// Stack post: <mem_ptr>
void abiEncode(
TypePointers const& _givenTypes,
TypePointers const& _targetTypes,
@@ -185,9 +193,13 @@ public:
static unsigned sizeOnStack(std::vector<std::shared_ptr<Type const>> const& _variableTypes);
/// Helper function to shift top value on the stack to the left.
+ /// Stack pre: <value> <shift_by_bits>
+ /// Stack post: <shifted_value>
void leftShiftNumberOnStack(unsigned _bits);
/// Helper function to shift top value on the stack to the right.
+ /// Stack pre: <value> <shift_by_bits>
+ /// Stack post: <shifted_value>
void rightShiftNumberOnStack(unsigned _bits, bool _isSigned = false);
/// Appends code that computes tha Keccak-256 hash of the topmost stack element of 32 byte type.