Is cool using call by refernce or call by value parameter passing?
The manual says “formals are bound to actuals” and the method is evaluated. The cool compiler implements call by refernce by just pushing references to the objects onto the stack frame, not making copies of new objects. So, it is implementing call by reference. You should do the same. ——— Here are some hints on variable and method bindings for generating code: // VarBinding and MethodBinding methods // // From the point of view of code generation, there are five distinct // classes of names in a method: // // locals are stored in the temporary area of the stack frame // formal parameters are stored in the actuals are of the frame // self is in the SELF register // attribute is at an offset from the address given by SELF // method address is at an offset from the dispatch table // // See the discussion about frame layout under function_prologue/epilogue. // For the first four categories, there are distinct conventions for generating // code for allocation, reference, and update. F