JSStackFrame Evisceration: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This would leave sizeof(JSStackFrame) == 6 words.
This leaves sizeof(JSStackFrame) == 10 words (11 on 32-bit), but we only need to initialize 4 of those words on the common call path; the rest can be lazily (or never) initialized.
 
=== Members to remove ===
 
Sorted in estimated order of benefit / difficulty:
Sorted in estimated order of benefit / difficulty:


Line 7: Line 10:
| '''Size (wks)'''  
| '''Size (wks)'''  
| '''Assignee'''
| '''Assignee'''
| '''Note'''
|-
|-
| [https://bugzilla.mozilla.org/show_bug.cgi?id=539144 argc/argv]
| X[https://bugzilla.mozilla.org/show_bug.cgi?id=539144 argc/argv/fun/script/thisv]
| 1
| 3
| lw
| lw
| Requires StackSegment [https://bugzilla.mozilla.org/show_bug.cgi?id=579183 changes].
|-
| X[https://bugzilla.mozilla.org/show_bug.cgi?id=595073 ncode]
| 3
|
| Merge it with savedPC in method-jit.  Requires building map HW PC --> bytecode (which we sortof already heave
|-
|-
| [https://bugzilla.mozilla.org/show_bug.cgi?id=557375 thisv] (depends on argv)
| [https://bugzilla.mozilla.org/show_bug.cgi?id=593882 scopeChain]
| .5
| .5
| lw
|
|-
|-
| fun, script (depend on thisv)
| X[https://bugzilla.mozilla.org/show_bug.cgi?id=577708 displaySave]
| .5
| 1
| lw
| cdleary
| Remove display optimization for great justice!
|-
|-
| ncode (merge with savedPC)
| XhookData
| .1
| .1
| dvander
| lw
| Lazily initialize using JSStackFrame::flags.  Included in bug 539144.
|-
|-
| displaySave - remove display optimization
| X[https://bugzilla.mozilla.org/show_bug.cgi?id=546848 annotation]
| 1
| 3
| cdleary
| sayrer
| Trivial if we can remove callers in nsScriptSecurityManager. Alas, that is not trivial, so this is going to take a while.  For now, we lazily initialize which gives practically all the benefit.
|-
|-
| hookData (just use js::Invoke and use a local variable)
| X[https://bugzilla.mozilla.org/show_bug.cgi?id=540675 callerVersion]
| .5
| .5
|  
| cdleary
| Mostly the challenge is just understanding the actual use case.
|-
|-
| [https://bugzilla.mozilla.org/show_bug.cgi?id=540675 callerVersion]
| X[https://bugzilla.mozilla.org/show_bug.cgi?id=535912 blockChain]
| .5
|
| -
| [https://bugzilla.mozilla.org/show_bug.cgi?id=535912 blockChain]
| 1
| 1
|  
| wmmcloskey
| A bit tricky
|-
|-
| [https://bugzilla.mozilla.org/show_bug.cgi?id=550639 rval]
| [https://bugzilla.mozilla.org/show_bug.cgi?id=595073 rval]
| 1
| 1
|
|
| Lazily initialize with a JSStackFrame::flags bit and avoid ever writing in the hot JM call/return paths.
|-
|-
| annotation
| X[https://bugzilla.mozilla.org/show_bug.cgi?id=586358 imacpc]
| ? (0, once we can drop the callers of JS_{Get,Set}FrameAnnotation in nsScriptSecurityManager.cpp)
|
|-
| imacpc (use some side stack, or push a jsval (like JSOP_GOSUB)
| 1
| 1
|
| cdleary
| Leave uninitialized in call path and use JSStackFrame::flags to indicate whether there is or is not an imacpc.
|}
|}
== Remove from call path ==
*PIC for fast natives calls
*PIC/fast path for interpreted inline call
*Remove empty script check (not just a predictable branch)

Latest revision as of 17:47, 30 September 2010

This leaves sizeof(JSStackFrame) == 10 words (11 on 32-bit), but we only need to initialize 4 of those words on the common call path; the rest can be lazily (or never) initialized.

Members to remove

Sorted in estimated order of benefit / difficulty:

Task Size (wks) Assignee Note
Xargc/argv/fun/script/thisv 3 lw Requires StackSegment changes.
Xncode 3 Merge it with savedPC in method-jit. Requires building map HW PC --> bytecode (which we sortof already heave
scopeChain .5
XdisplaySave 1 cdleary Remove display optimization for great justice!
XhookData .1 lw Lazily initialize using JSStackFrame::flags. Included in bug 539144.
Xannotation 3 sayrer Trivial if we can remove callers in nsScriptSecurityManager. Alas, that is not trivial, so this is going to take a while. For now, we lazily initialize which gives practically all the benefit.
XcallerVersion .5 cdleary Mostly the challenge is just understanding the actual use case.
XblockChain 1 wmmcloskey A bit tricky
rval 1 Lazily initialize with a JSStackFrame::flags bit and avoid ever writing in the hot JM call/return paths.
Ximacpc 1 cdleary Leave uninitialized in call path and use JSStackFrame::flags to indicate whether there is or is not an imacpc.