Closed Bug 512686 Opened 16 years ago Closed 7 years ago

jit-compiled functions with optional args could have more entry points

Categories

(Tamarin Graveyard :: Baseline JIT (CodegenLIR), defect)

x86
Windows Vista
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX
Future

People

(Reporter: edwsmith, Unassigned)

References

Details

(Whiteboard: PACMAN)

In bug 512685, Lars notes: It would be a shame if otherwise early-bindable functions with optional args can't be handled like functions without optional args, ie, with the caller passing the required optional values and using a separate fast entry point. Currently, such functions are jit-compiled with a single entry point that takes argc, then has branchy code in the prologue to initialize just the right number of arguments. when a function is hot and being called from an early bound call-site, argc is constant at the call site. we could instead generate N entry points, for each possible argc, and the call site can invoke the proper one, without passing in argc. For late bound call sites, the dispatcher just has to invoke the right entry point once the target is known. Another possible angle of attack is to generate the optional arguments at the call site, and make a call without passing argc and without initializing optional args in the callee. this only works in AS3 if you cannot override a method and modify its optional arg values (need to double check).
(In reply to comment #0) > this only works in AS3 if you cannot override a > method and modify its optional arg values (need to double check). Sadly, no: class A { function foo(a:int = 0) { return a; } } class B extends A { override function foo(a:int = 1) { return a; } } var a = new A; var b = new B; print(a.foo()); print(b.foo()); compiles, runs, and yields 0 1
Target Milestone: --- → Future
Whiteboard: PACMAN
Component: Virtual Machine → JIT Compiler (NanoJIT)
Flags: flashplayer-qrb+
Flags: flashplayer-injection-
Flags: flashplayer-bug-
Blocks: 511873
Tamarin is a dead project now. Mass WONTFIX.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Tamarin isn't maintained anymore. WONTFIX remaining bugs.
You need to log in before you can comment on or make changes to this bug.