From 7a083d34dd17dd535c030234b3aa2087217ed8bc Mon Sep 17 00:00:00 2001 From: trocher Date: Fri, 8 Mar 2024 19:25:21 +0100 Subject: [PATCH 1/2] fix: unique symbol name (#3848) `STORE()` unique symbol name is computed as `_freshname(_freshname(f"{op}_"))` instead of `_freshname(f"{op}_")` after 5825e12735. This commit fixes this. --- vyper/codegen/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vyper/codegen/core.py b/vyper/codegen/core.py index 4f1da7253a..ecf05d1a49 100644 --- a/vyper/codegen/core.py +++ b/vyper/codegen/core.py @@ -670,7 +670,7 @@ def STORE(ptr: IRnode, val: IRnode) -> IRnode: if ptr.location in (MEMORY, IMMUTABLES): return IRnode.from_list(store) - return IRnode.from_list(ensure_eval_once(_freshname(f"{op}_"), store)) + return IRnode.from_list(ensure_eval_once(f"{op}_", store)) # Unwrap location From cf37ec2761732ca7b09003deeaab1398710f5346 Mon Sep 17 00:00:00 2001 From: Harry Kalogirou Date: Fri, 8 Mar 2024 22:53:03 +0200 Subject: [PATCH 2/2] feat[ir]: emit `djump` in dense selector table (#3849) emit the possible jump targets in the dense selector table for the venom pipeline to pick up. --- vyper/codegen/module.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vyper/codegen/module.py b/vyper/codegen/module.py index 251deeac83..1844569138 100644 --- a/vyper/codegen/module.py +++ b/vyper/codegen/module.py @@ -229,7 +229,9 @@ def _selector_section_dense(external_functions, module_t): error_msg="bad calldatasize or callvalue", ) x.append(check_entry_conditions) - x.append(["jump", function_label]) + jump_targets = [func.args[0].value for func in function_irs] + jump_instr = IRnode.from_list(["djump", function_label, *jump_targets]) + x.append(jump_instr) selector_section.append(b1.resolve(x)) bucket_headers = ["data", "BUCKET_HEADERS"]