-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
None
-
None
-
generic
-
generic
When functions need a callee parameter, we emit a signature of the form "Object this, ScriptFunction callee, ...", but then we need to create method handles using permuteArguments() for dyn:call, which quite logically passes (callee, this, ...) (as the receiver of the "dyn:call" is actually the callee).
We could avoid the need for a permuteArguments() if we were to change the order, so that when a function needs a callee, the bytecode method takes "ScriptFunction callee, Object this, ...".
Unfortunately, several places in the code rely on the assumption that local variable 0 is always "this" (note: all generated methods are static, so this has no significance - they are not instance methods). Actually eliminating this assumption might cause the code to be somewhat nicer - we'll see.
We could avoid the need for a permuteArguments() if we were to change the order, so that when a function needs a callee, the bytecode method takes "ScriptFunction callee, Object this, ...".
Unfortunately, several places in the code rely on the assumption that local variable 0 is always "this" (note: all generated methods are static, so this has no significance - they are not instance methods). Actually eliminating this assumption might cause the code to be somewhat nicer - we'll see.
- duplicates
-
JDK-8006943 Fix order of function method arguments to be (callee, thisObject)
- Resolved