You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function arguments are stored on the stack before being moved into the parameter registers. This requires a stack_offset field to be set on each function argument. This would be simple enough if it only had to be set in analyze_call_expression, but there are myriad other places where the analyzer converts a syntactic construct into a new call expression (e.g., list literals turn into a call to venice_list_from_varargs), and in each place you have to remember to set the stack offset for each argument.
It would be better if the stack offsets were allocated in a second pass after generating the AST so that every call expression could be handled in one place. I tried doing this and the issue I ran into is that ast::Symbol looks up its symbol entry when the AST is constructed and stores its own copy, which means that any subsequent updates to the symbol entry's stack offset will be lost.
The text was updated successfully, but these errors were encountered:
Function arguments are stored on the stack before being moved into the parameter registers. This requires a
stack_offset
field to be set on each function argument. This would be simple enough if it only had to be set inanalyze_call_expression
, but there are myriad other places where the analyzer converts a syntactic construct into a new call expression (e.g., list literals turn into a call tovenice_list_from_varargs
), and in each place you have to remember to set the stack offset for each argument.It would be better if the stack offsets were allocated in a second pass after generating the AST so that every call expression could be handled in one place. I tried doing this and the issue I ran into is that
ast::Symbol
looks up its symbol entry when the AST is constructed and stores its own copy, which means that any subsequent updates to the symbol entry's stack offset will be lost.The text was updated successfully, but these errors were encountered: