Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions vyper/compiler/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from vyper.semantics.types.module import InterfaceT
from vyper.typing import StorageLayout
from vyper.utils import safe_relpath
from vyper.venom.ir_node_to_venom import _pass_via_stack
from vyper.warnings import ContractSizeLimit, vyper_warn


Expand Down Expand Up @@ -258,6 +259,13 @@ def _to_dict(func_t):
ret["source_id"] = func_t.decl_node.module_node.source_id
ret["function_id"] = func_t._function_id

if func_t.is_internal:
pass_via_stack = _pass_via_stack(func_t)
pass_via_stack_list = [
arg for (arg, is_stack_arg) in pass_via_stack.items() if is_stack_arg
]
ret["venom_via_stack"] = pass_via_stack_list

keep_keys = {
"name",
"return_type",
Expand All @@ -272,6 +280,7 @@ def _to_dict(func_t):
"module_path",
"source_id",
"function_id",
"venom_via_stack",
}
ret = {k: v for k, v in ret.items() if k in keep_keys}
return ret
Expand Down
2 changes: 1 addition & 1 deletion vyper/venom/ir_node_to_venom.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def _append_return_args(fn: IRFunction, ofst: int = 0, size: int = 0):
# func_t: ContractFunctionT
@functools.lru_cache(maxsize=1024)
def _pass_via_stack(func_t) -> dict[str, bool]:
# returns a dict which returns True if a given argument (referered to
# returns a dict which returns True if a given argument (referred to
# by name) should be passed via the stack
if not ENABLE_NEW_CALL_CONV:
return {arg.name: False for arg in func_t.arguments}
Expand Down
Loading