Closed Bug 570955 Opened 14 years ago Closed 6 years ago

VM could optimize activation objects

Categories

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

defect

Tracking

(Not tracked)

RESOLVED WONTFIX
Q2 12 - Cyril

People

(Reporter: edwsmith, Unassigned)

References

Details

(Whiteboard: PACMAN)

ASC creates activation objects eagerly when:
  - there are nested functions
  - there are try catch blocks
  - there are with blocks.

Typically activation objects only escape via OP_newclass or OP_newfunction.  They are either accessed implicitly by getslot/setslot or implicitly via OP_findproperty.

If all property access is identifiable, then
 - some properties could be scalarized if not accessed by OP_findprop* or nested functions
 - if all properties are scalarized then the object doesn't need to exist.
Whiteboard: PACMAN
Blocks: 570944
In some cases we might be able to delay/defer activation object creation, if the object is only accessed along some control flow paths.  need data on whether this is frequent in relevant apps.
Also see the conservative analyzer for REST arguments.  Something like that could work for activation objects.  ASC creates empty activation objects for code with try/catch blocks, and that pattern should be easy to recognize.  (even maybe only running the analyzer for methods with exceptions, to not impact jit time much).

See bug 571468 and dependents for the rest analyzer discussion.
There is an important trivial case: an empty catch block generates an activation object, and this generates noticeable load in Flex startup.
Jeff Dyer has a prototype implementation that deals with the empty catch block case. Handling that case alone speeds up launch time of a Flex app I've been experimenting with by about 2.5%
In case it wasn't clear, Jeff's prototype is in ASC (as opposed to the VM.)
Closure optimization of functions not used for their value: https://bugs.adobe.com/jira/browse/ASC-4122.
Avoiding creating activation objects in the presence of closure creation, when those activation objects are not captured: https://bugs.adobe.com/jira/browse/ASC-4123
Avoiding placing non-captured variables in activation records: https://bugs.adobe.com/jira/browse/ASC-4124
Assignee: nobody → jodyer
Flags: flashplayer-qrb+
Assignee: jodyer → nobody
Flags: flashplayer-injection-
Flags: flashplayer-bug-
Priority: -- → P3
Target Milestone: --- → Q2 12 - Cyril
Blocks: halfmoon
Tamarin is a dead project now. Mass WONTFIX.
Status: NEW → RESOLVED
Closed: 6 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.