Updating gas costs and cmdline tests.

This commit is contained in:
Djordje Mijovic
2020-12-30 17:48:41 +01:00
parent 047d693ac9
commit 67c92b7f6e
5 changed files with 87 additions and 33 deletions
+11 -11
View File
@@ -87,18 +87,18 @@ object "C_59" {
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
function convert_t_stringliteral_6490_to_t_string() -> converted
function copy_literal_to_memory_64902fd228f7ef267f3b474dd6ef84bae434cf5546eee948e7ca26df3eda1927() -> memPtr
{
let memPtr := mload(64)
let newFreePtr := add(memPtr, 160)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
let memPtr_1 := mload(64)
let newFreePtr := add(memPtr_1, 160)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr_1)) { panic_error_0x41() }
mstore(64, newFreePtr)
converted := memPtr
mstore(memPtr, 100)
mstore(add(memPtr, 32), "longstringlongstringlongstringlo")
mstore(add(memPtr, 64), "ngstringlongstringlongstringlong")
mstore(add(memPtr, 96), "stringlongstringlongstringlongst")
mstore(add(memPtr, 128), "ring")
mstore(memPtr_1, 100)
memPtr := memPtr_1
mstore(add(memPtr_1, 0x20), "longstringlongstringlongstringlo")
mstore(add(memPtr_1, 64), "ngstringlongstringlongstringlong")
mstore(add(memPtr_1, 96), "stringlongstringlongstringlongst")
mstore(add(memPtr_1, 128), "ring")
}
function extract_from_storage_value_dynamict_uint256(slot_value, offset) -> value
{
@@ -120,7 +120,7 @@ object "C_59" {
sstore(slot, or(and(_5, not(mask)), and(shl(shiftBits, _4), mask)))
let _6, _7 := storage_array_index_access$_t_struct$_S_storage(0x02, vloc)
vloc := extract_from_storage_value_dynamict_uint256(sload(_6), _7)
vloc__27_mpos := convert_t_stringliteral_6490_to_t_string()
vloc__27_mpos := copy_literal_to_memory_64902fd228f7ef267f3b474dd6ef84bae434cf5546eee948e7ca26df3eda1927()
}
function panic_error_0x32()
{
@@ -75,6 +75,26 @@ object \"C_11\" {
mstore(64, newFreePtr)
}
function allocate_memory_array_t_string_memory_ptr(length) -> memPtr {
let allocSize := array_allocation_size_t_string_memory_ptr(length)
memPtr := allocateMemory(allocSize)
mstore(memPtr, length)
}
function array_allocation_size_t_string_memory_ptr(length) -> size {
// Make sure we can allocate memory without overflow
if gt(length, 0xffffffffffffffff) { panic_error_0x41() }
// round up
size := and(add(length, 0x1f), not(0x1f))
// add length slot
size := add(size, 0x20)
}
function array_length_t_string_memory_ptr(value) -> length {
length := mload(value)
@@ -87,11 +107,12 @@ object \"C_11\" {
}
function convert_t_stringliteral_9f0adad0a59b05d2e04a1373342b10b9eb16c57c164c8a3bfcbf46dccee39a21_to_t_string_memory_ptr() -> converted {
converted := allocateMemory(64)
mstore(converted, 6)
mstore(add(converted, 32), \"abcabc\")
converted := copy_literal_to_memory_9f0adad0a59b05d2e04a1373342b10b9eb16c57c164c8a3bfcbf46dccee39a21()
}
function copy_literal_to_memory_9f0adad0a59b05d2e04a1373342b10b9eb16c57c164c8a3bfcbf46dccee39a21() -> memPtr {
memPtr := allocate_memory_array_t_string_memory_ptr(6)
store_literal_in_memory_9f0adad0a59b05d2e04a1373342b10b9eb16c57c164c8a3bfcbf46dccee39a21(add(memPtr, 32))
}
function copy_memory_to_memory(src, dst, length) {
@@ -133,6 +154,12 @@ object \"C_11\" {
}
function store_literal_in_memory_9f0adad0a59b05d2e04a1373342b10b9eb16c57c164c8a3bfcbf46dccee39a21(memPtr) {
mstore(add(memPtr, 0), \"abcabc\")
}
function zero_value_for_split_t_string_memory_ptr() -> ret {
ret := 96
}
@@ -75,6 +75,26 @@ object \"C_11\" {
mstore(64, newFreePtr)
}
function allocate_memory_array_t_string_memory_ptr(length) -> memPtr {
let allocSize := array_allocation_size_t_string_memory_ptr(length)
memPtr := allocateMemory(allocSize)
mstore(memPtr, length)
}
function array_allocation_size_t_string_memory_ptr(length) -> size {
// Make sure we can allocate memory without overflow
if gt(length, 0xffffffffffffffff) { panic_error_0x41() }
// round up
size := and(add(length, 0x1f), not(0x1f))
// add length slot
size := add(size, 0x20)
}
function array_length_t_string_memory_ptr(value) -> length {
length := mload(value)
@@ -87,15 +107,12 @@ object \"C_11\" {
}
function convert_t_stringliteral_d6604f85ac07e2b33103a620b3d3d75b0473c7214912beded67b9b624d41c571_to_t_string_memory_ptr() -> converted {
converted := allocateMemory(128)
mstore(converted, 85)
mstore(add(converted, 32), \"abcdabcdcafecafeabcdabcdcafecafe\")
mstore(add(converted, 64), \"ffffzzzzoooo0123456789,.<,>.?:;'\")
mstore(add(converted, 96), \"[{]}|`~!@#$%^&*()-_=+\")
converted := copy_literal_to_memory_d6604f85ac07e2b33103a620b3d3d75b0473c7214912beded67b9b624d41c571()
}
function copy_literal_to_memory_d6604f85ac07e2b33103a620b3d3d75b0473c7214912beded67b9b624d41c571() -> memPtr {
memPtr := allocate_memory_array_t_string_memory_ptr(85)
store_literal_in_memory_d6604f85ac07e2b33103a620b3d3d75b0473c7214912beded67b9b624d41c571(add(memPtr, 32))
}
function copy_memory_to_memory(src, dst, length) {
@@ -137,6 +154,16 @@ object \"C_11\" {
}
function store_literal_in_memory_d6604f85ac07e2b33103a620b3d3d75b0473c7214912beded67b9b624d41c571(memPtr) {
mstore(add(memPtr, 0), \"abcdabcdcafecafeabcdabcdcafecafe\")
mstore(add(memPtr, 32), \"ffffzzzzoooo0123456789,.<,>.?:;'\")
mstore(add(memPtr, 64), \"[{]}|`~!@#$%^&*()-_=+\")
}
function zero_value_for_split_t_string_memory_ptr() -> ret {
ret := 96
}