aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/CompilerUtils.h
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-29 20:26:23 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-29 20:36:13 +0800
commit3c24dcfe45f285a209a6f22ef2aff81b69049a89 (patch)
tree8551d44b384dd7ddda2359a08a1e815af0f13eb2 /libsolidity/codegen/CompilerUtils.h
parentb364bd048ffaf233782a23dabd13622431a75aa3 (diff)
downloaddexon-solidity-3c24dcfe45f285a209a6f22ef2aff81b69049a89.tar.gz
dexon-solidity-3c24dcfe45f285a209a6f22ef2aff81b69049a89.tar.zst
dexon-solidity-3c24dcfe45f285a209a6f22ef2aff81b69049a89.zip
Document more of the codegen features
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.