aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerUtils.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-02-15 08:02:38 +0800
committerChristian <c@ethdev.com>2015-02-17 02:25:27 +0800
commitd630a67812900036ba4aa7bfd47f07c7adddb247 (patch)
tree5796f5b5229fb6f9c4d66663cb53a29826ea6158 /CompilerUtils.h
parent1f6e3651362bdcdaa39773156875c36053d5f6be (diff)
downloaddexon-solidity-d630a67812900036ba4aa7bfd47f07c7adddb247.tar.gz
dexon-solidity-d630a67812900036ba4aa7bfd47f07c7adddb247.tar.zst
dexon-solidity-d630a67812900036ba4aa7bfd47f07c7adddb247.zip
loadFromMemoryDynamic
Diffstat (limited to 'CompilerUtils.h')
-rw-r--r--CompilerUtils.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/CompilerUtils.h b/CompilerUtils.h
index 89973b6b..5369d3bf 100644
--- a/CompilerUtils.h
+++ b/CompilerUtils.h
@@ -40,10 +40,13 @@ public:
/// @param _type data type to load
/// @param _fromCalldata if true, load from calldata, not from memory
/// @param _padToWordBoundaries if true, assume the data is padded to word (32 byte) boundaries
- /// @returns the number of bytes consumed in memory (can be different from _bytes if
- /// _padToWordBoundaries is true)
+ /// @returns the number of bytes consumed in memory.
unsigned loadFromMemory(unsigned _offset, Type const& _type = IntegerType(256),
bool _fromCalldata = false, bool _padToWordBoundaries = false);
+ /// Dynamic version of @see loadFromMemory, expects the memory offset on the stack.
+ /// Stack pre: memory_offset
+ /// Stack post: value... (memory_offset+length)
+ void loadFromMemoryDynamic(Type const& _type, bool _fromCalldata = false, bool _padToWordBoundaries = true);
/// Stores data from stack in memory.
/// @param _offset offset in memory
/// @param _type type of the data on the stack
@@ -92,6 +95,8 @@ public:
private:
/// Prepares the given type for storing in memory by shifting it if necessary.
unsigned prepareMemoryStore(Type const& _type, bool _padToWordBoundaries) const;
+ /// Loads type from memory assuming memory offset is on stack top.
+ unsigned loadFromMemoryHelper(Type const& _type, bool _fromCalldata, bool _padToWordBoundaries);
/// Appends a loop that clears a sequence of storage slots (excluding end).
/// Stack pre: end_ref start_ref
/// Stack post: end_ref