diff --git a/vyper/codegen/function_definitions/external_function.py b/vyper/codegen/function_definitions/external_function.py index 6e38fc023f..76156e4ebd 100644 --- a/vyper/codegen/function_definitions/external_function.py +++ b/vyper/codegen/function_definitions/external_function.py @@ -49,7 +49,9 @@ def _register_function_args(func_t: ContractFunctionT, context: Context) -> list return ret -def _generate_kwarg_handlers(func_t: ContractFunctionT, context: Context) -> dict[str, tuple[int, IRnode]]: +def _generate_kwarg_handlers( + func_t: ContractFunctionT, context: Context +) -> dict[str, tuple[int, IRnode]]: # generate kwarg handlers. # since they might come in thru calldata or be default, # allocate them in memory and then fill it in based on calldata or default, diff --git a/vyper/codegen/module.py b/vyper/codegen/module.py index 5a833db72a..a94eab9e3a 100644 --- a/vyper/codegen/module.py +++ b/vyper/codegen/module.py @@ -141,7 +141,7 @@ def _selector_section_dense(external_functions, global_ctx): assert dst >= 0 # XXX: re-enable this in debug mode: - #selector_section.append(["assert", ["eq", "msize", 0]]) + # selector_section.append(["assert", ["eq", "msize", 0]]) selector_section.append(["codecopy", dst, bucket_hdr_location, SZ_BUCKET_HEADER]) @@ -291,7 +291,7 @@ def _selector_section_sparse(external_functions, global_ctx): assert dst >= 0 # XXX: re-enable this in debug mode - #selector_section.append(["assert", ["eq", "msize", 0]]) + # selector_section.append(["assert", ["eq", "msize", 0]]) selector_section.append(["codecopy", dst, bucket_hdr_location, SZ_BUCKET_HEADER]) jumpdest = IRnode.from_list(["mload", 0]) @@ -387,7 +387,7 @@ def generate_ir_for_module(global_ctx: GlobalContext) -> tuple[IRnode, IRnode]: # XXX: AWAITING MCOPY PR # dense vs sparse global overhead is amortized after about 4 methods - dense = False # if core._opt_codesize() and len(external_functions) > 4: + dense = False # if core._opt_codesize() and len(external_functions) > 4: if dense: selector_section = _selector_section_dense(external_functions, global_ctx) else: diff --git a/vyper/ir/compile_ir.py b/vyper/ir/compile_ir.py index ed2f4009b9..0b8c312d2b 100644 --- a/vyper/ir/compile_ir.py +++ b/vyper/ir/compile_ir.py @@ -1067,6 +1067,7 @@ def __init__(self, label): def __repr__(self): return f"DATA {self.label}" + def relocate_segments(assembly): # relocate all data segments to the end, otherwise data could be # interpreted as PUSH instructions and mangle otherwise valid jumpdests