3 ms·
What you describe is a non-problem: you can trivially spill upvars to the stack on-demand, as most compilers do, while keeping formal parameters in registers. J
by pcwalton 7y ago
What you describe is a non-problem: you can trivially spill upvars to the stack on-demand, as most compilers do, while keeping formal parameters in registers. Java needs upvars to be final because it doesn't have the concept of "reference to local variable", but that's just a limitation of the JVM, and one easily solved in other runtimes that very much can pass arguments in registers (e.g. .NET).
- tjalfi 7y agoThe Go developers have considered changing to a register-based calling convention[0][1]. I found these tickets a few weeks ago and they explained why the Go developers haven't yet made this change. [0] https://github.com/golang/go/issues/18597 https://github.com/golang/go/issues/18597 [1] https://github.com/golang/go/issues/27539 https://github.com/golang/go/issues/27539
- saagarjha 7y agoInterestingly, one of the suggestions to deal with issues in panic backtraces due to this change is to use DWARF.