Skip to content

Commit

Permalink
Merge pull request #1317 from topos-protocol/more_memcpy_bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nashtare authored Oct 31, 2023
2 parents 6332900 + afd357f commit 3ca1662
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions evm/src/cpu/kernel/asm/core/call.asm
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ call_too_deep:
args_size, %%after, // count, retdest
new_ctx, args_size
)
%jump(memcpy)
%jump(memcpy_bytes)
%%after:
%stack (new_ctx, args_size) ->
(new_ctx, @SEGMENT_CONTEXT_METADATA, @CTX_METADATA_CALLDATA_SIZE, args_size)
Expand All @@ -410,7 +410,7 @@ call_too_deep:
n, %%after, // count, retdest
kexit_info, success
)
%jump(memcpy)
%jump(memcpy_bytes)
%%after:
%endmacro

Expand Down
2 changes: 1 addition & 1 deletion evm/src/cpu/kernel/asm/core/create.asm
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ global create_common:
code_len,
run_constructor,
new_ctx, value, address)
%jump(memcpy)
%jump(memcpy_bytes)

run_constructor:
// stack: new_ctx, value, address, kexit_info
Expand Down
2 changes: 1 addition & 1 deletion evm/src/cpu/kernel/asm/core/create_receipt.asm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ process_receipt_after_type:
PUSH 0 PUSH @SEGMENT_TXN_BLOOM PUSH 0 // Bloom memory address.
%get_trie_data_size PUSH @SEGMENT_TRIE_DATA PUSH 0 // MPT dest address.
// stack: DST, SRC, 256, receipt_ptr, txn_nb, new_cum_gas, txn_nb, num_nibbles, retdest
%memcpy
%memcpy_bytes
// stack: receipt_ptr, txn_nb, new_cum_gas, txn_nb, num_nibbles, retdest
// Update trie data size.
%get_trie_data_size
Expand Down
2 changes: 1 addition & 1 deletion evm/src/cpu/kernel/asm/core/precompiles/id.asm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ global precompile_id:
ctx, @SEGMENT_CALLDATA, 0, // SRC
size, id_contd // count, retdest
)
%jump(memcpy)
%jump(memcpy_bytes)

id_contd:
// stack: kexit_info
Expand Down
2 changes: 1 addition & 1 deletion evm/src/cpu/kernel/asm/core/precompiles/main.asm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ global handle_precompiles_from_eoa:
%stack (calldata_size, new_ctx) -> (calldata_size, new_ctx, calldata_size)
%set_new_ctx_calldata_size
%stack (new_ctx, calldata_size) -> (new_ctx, @SEGMENT_CALLDATA, 0, 0, @SEGMENT_TXN_DATA, 0, calldata_size, handle_precompiles_from_eoa_finish, new_ctx)
%jump(memcpy)
%jump(memcpy_bytes)

handle_precompiles_from_eoa_finish:
%stack (new_ctx, addr, retdest) -> (addr, new_ctx, retdest)
Expand Down
2 changes: 1 addition & 1 deletion evm/src/cpu/kernel/asm/core/precompiles/rip160.asm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ global precompile_rip160:
PUSH @SEGMENT_KERNEL_GENERAL
DUP3

%jump(memcpy)
%jump(memcpy_bytes)

rip160_contd:
// stack: hash, kexit_info
Expand Down
2 changes: 1 addition & 1 deletion evm/src/cpu/kernel/asm/core/precompiles/sha256.asm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ global precompile_sha256:
PUSH @SEGMENT_KERNEL_GENERAL
DUP3

%jump(memcpy)
%jump(memcpy_bytes)

sha256_contd:
// stack: hash, kexit_info
Expand Down
4 changes: 2 additions & 2 deletions evm/src/cpu/kernel/asm/core/process_txn.asm
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ global process_contract_creation_txn:
PUSH 0 // DST.offset
PUSH @SEGMENT_CODE // DST.segment
DUP8 // DST.context = new_ctx
%jump(memcpy)
%jump(memcpy_bytes)

global process_contract_creation_txn_after_code_loaded:
// stack: new_ctx, address, retdest
Expand Down Expand Up @@ -294,7 +294,7 @@ global process_message_txn_code_loaded:
%stack (calldata_size, new_ctx, retdest) -> (calldata_size, new_ctx, calldata_size, retdest)
%set_new_ctx_calldata_size
%stack (new_ctx, calldata_size, retdest) -> (new_ctx, @SEGMENT_CALLDATA, 0, 0, @SEGMENT_TXN_DATA, 0, calldata_size, process_message_txn_code_loaded_finish, new_ctx, retdest)
%jump(memcpy)
%jump(memcpy_bytes)

process_message_txn_code_loaded_finish:
%enter_new_ctx
Expand Down
4 changes: 2 additions & 2 deletions evm/src/cpu/kernel/asm/core/terminate.asm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ return_after_gas:
ctx, @SEGMENT_MAIN_MEMORY, offset, // SRC
size, sys_return_finish, kexit_info // count, retdest, ...
)
%jump(memcpy)
%jump(memcpy_bytes)

sys_return_finish:
// stack: kexit_info
Expand Down Expand Up @@ -145,7 +145,7 @@ revert_after_gas:
ctx, @SEGMENT_MAIN_MEMORY, offset, // SRC
size, sys_revert_finish, kexit_info // count, retdest, ...
)
%jump(memcpy)
%jump(memcpy_bytes)

sys_revert_finish:
%leftover_gas
Expand Down
4 changes: 2 additions & 2 deletions evm/src/cpu/kernel/asm/rlp/encode_rlp_string.asm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ global encode_rlp_string_small:
// stack: pos'', pos', ADDR: 3, len, retdest
%stack (pos2, pos1, ADDR: 3, len, retdest)
-> (0, @SEGMENT_RLP_RAW, pos1, ADDR, len, retdest, pos2)
%jump(memcpy)
%jump(memcpy_bytes)

global encode_rlp_string_small_single_byte:
// stack: pos, ADDR: 3, len, retdest
Expand Down Expand Up @@ -71,7 +71,7 @@ global encode_rlp_string_large_after_writing_len:
// stack: pos''', pos'', ADDR: 3, len, retdest
%stack (pos3, pos2, ADDR: 3, len, retdest)
-> (0, @SEGMENT_RLP_RAW, pos2, ADDR, len, retdest, pos3)
%jump(memcpy)
%jump(memcpy_bytes)

%macro encode_rlp_string
%stack (pos, ADDR: 3, len) -> (pos, ADDR, len, %%after)
Expand Down
2 changes: 1 addition & 1 deletion evm/src/cpu/kernel/asm/transactions/common_decoding.asm
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
PUSH @SEGMENT_TXN_DATA
GET_CONTEXT
// stack: DST, SRC, data_len, %%after, new_pos
%jump(memcpy)
%jump(memcpy_bytes)

%%after:
// stack: new_pos
Expand Down
2 changes: 1 addition & 1 deletion evm/src/cpu/kernel/asm/transactions/type_1.asm
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ after_serializing_txn_data:
al_len,
after_serializing_access_list,
rlp_pos, rlp_start, retdest)
%jump(memcpy)
%jump(memcpy_bytes)
after_serializing_access_list:
// stack: rlp_pos, rlp_start, retdest
%mload_global_metadata(@GLOBAL_METADATA_ACCESS_LIST_RLP_LEN) ADD
Expand Down
2 changes: 1 addition & 1 deletion evm/src/cpu/kernel/asm/transactions/type_2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ after_serializing_txn_data:
al_len,
after_serializing_access_list,
rlp_pos, rlp_start, retdest)
%jump(memcpy)
%jump(memcpy_bytes)
after_serializing_access_list:
// stack: rlp_pos, rlp_start, retdest
%mload_global_metadata(@GLOBAL_METADATA_ACCESS_LIST_RLP_LEN) ADD
Expand Down

0 comments on commit 3ca1662

Please sign in to comment.