mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Updating gas costs and cmdline tests.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user