@@ -101,11 +101,14 @@ impl CairoRunner2 {
101
101
// The stack is arranged as if we are at the start of a function call.
102
102
// Input arguments are set as input arguments to the the function.
103
103
//
104
- // --- ARGUMENTS --- RETURN FP RETURN PC
105
- // ┌────┬────┬────┬────┬───────────┬───────────┬ ─ ─ ─ ─ ┐
106
- // │ │ │ │ │ │ │ START FP
107
- // └────┴────┴────┴────┴───────────┴───────────┴ ─ ─ ─ ─ ┘
104
+ // <-------- ARGUMENTS ----
105
+ // ┌────┬────┬────┬────┬────────┬────────┬ ─ ─ ─ ─ ┐
106
+ // ... │ │ │ │ │ RET FP │ RET PC │
107
+ // └────┴────┴────┴────┴────────┴────────┴ ─ ─ ─ ─ ┘
108
+ // INIT FP
108
109
// Note: The size of the cells is not relevant
110
+ //
111
+ // The initial fp variable points to the cell after the return pc.
109
112
110
113
extend_stack_with_builtins ( & mut stack, & builtins, & vm. builtin_runners ) ;
111
114
@@ -122,12 +125,15 @@ impl CairoRunner2 {
122
125
// On standalone, we execute until a fixed address.
123
126
// Input arguments are set as local variables to the current frame.
124
127
//
125
- // ZERO ------ ARGUMENTS ------
126
- // ┌──────┬──────────┬────┬────┬────┐
127
- // │ │ START FP │ │ │ │
128
- // └──────┴──────────┴────┴────┴────┘
128
+ // -------------- ARGUMENTS ------------------>
129
+ // ┌──────┬─────────┬────┬────┬────┬────┬────┬────┐
130
+ // │ ZERO │ │ │ │ │ │ │ │ ...
131
+ // └──────┴─────────┴────┴────┴────┴────┴────┴────┘
132
+ // INIT FP
129
133
// Note: The size of the cells is not relevant
130
134
//
135
+ // The initial fp variable points to the cell after the zero element.
136
+ //
131
137
// The zero element is necessary because the compiler asumes that `fp`
132
138
// is not pointing to the start of a segment - it fails otherwise.
133
139
0 commit comments