Closed
Bug 432487
Opened 16 years ago
Closed 16 years ago
IL should be shared between multiple MethodEnv's of the same Function
Categories
(Tamarin Graveyard :: Tracing Virtual Machine, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: edwsmith, Assigned: stejohns)
References
Details
Attachments
(2 files, 1 obsolete file)
36.12 KB,
patch
|
edwsmith
:
review+
|
Details | Diff | Splinter Review |
7.94 KB,
patch
|
edwsmith
:
review+
|
Details | Diff | Splinter Review |
Each MethodEnv captures a scope chain for an underlying function. IL is currently (wrongly) associated with MethodEnv rather than the underlying code, so we end up duplicating IL for the function. This is unbounded duplication. Tracing magnifies the problem because if the functions call a hot subroutine, the many closures look like many call sites, causing much inlining, or if the subroutine has a loop, high fan-out on the path exiting the loop back to the caller. ESC on TT demonstrates this problem with Hashtable.read() calling eqfn() to compare strings
Reporter | ||
Updated•16 years ago
|
Priority: -- → P1
Reporter | ||
Updated•16 years ago
|
Assignee: nobody → edwsmith
Reporter | ||
Updated•16 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•16 years ago
|
||
What if we could have multiple instances of the same MethodEnv-with-different-scope just share pointers to the same IL? If they all refer to the same underlying code then it should be identical code (and if not then they need different IL chunks anyway) I guess the issue is how to do that sharing; if we are always verified at least once before MethodEnv::cloneWithNewScope is called then it should be easy-peasy... but I don't think that is the case.
Assignee | ||
Comment 2•16 years ago
|
||
Stealing this, I see a simple way to deal with it
Assignee: edwsmith → stejohns
Status: ASSIGNED → NEW
Reporter | ||
Comment 3•16 years ago
|
||
This code is stale, but addresses this bug. highlights: * lots of int->int32_t noise * optimize emit_LIT to use DUP or OVER when possible * specializations of get/set/findprop * got rid of the "gmi" entry point, everything is in ckargs * ops that take a nameid take a nameoff instead (offset into abc), one less thing to do at runtime * get rid of everCalled() * added OP_getouterscope
Attachment #326604 -
Flags: review?(stejohns)
Reporter | ||
Updated•16 years ago
|
Attachment #326604 -
Flags: review?(stejohns)
Assignee | ||
Comment 4•16 years ago
|
||
This encompasses part of your patch, but not all. Included: * The basic IL-sharing fix, improved a bit to remove two more pointers from MethodEnv (storing 'em in AbcEnv is better since they won't ever be replicated, IMHO) * optimize emit_LIT to use DUP or OVER when possible * got rid of the "gmi" entry point, everything is in ckargs * get rid of everCalled() Not included: * lots of int->int32_t noise * specializations of get/set/findprop * ops that take a nameid take a nameoff instead (offset into abc), one less thing to do at runtime * added OP_getouterscope This gives a modest but measurable speed improvement on sunspider tests, probably due to increased efficiency of closures with this code.
Attachment #326604 -
Attachment is obsolete: true
Attachment #326828 -
Flags: review?(edwsmith)
Assignee | ||
Updated•16 years ago
|
Attachment #326828 -
Attachment is patch: true
Assignee | ||
Comment 5•16 years ago
|
||
Here's another patch (additive to previous one) to adapt the pending-const-speedup as well. This uses a new-and-improved technique different from the one in Edwin's initial patch.
Attachment #326975 -
Flags: review?(edwsmith)
Reporter | ||
Updated•16 years ago
|
Attachment #326975 -
Flags: review?(edwsmith) → review+
Reporter | ||
Updated•16 years ago
|
Attachment #326828 -
Flags: review?(edwsmith) → review+
Assignee | ||
Comment 6•16 years ago
|
||
pushed as changeset: 442:0e2c25c2537a
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•