Last Comment Bug 746238 - pack TypeCallsite and TypeCompartment better
: pack TypeCallsite and TypeCompartment better
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla15
Assigned To: Nathan Froyd [:froydnj]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-17 11:00 PDT by Nathan Froyd [:froydnj]
Modified: 2012-05-04 13:39 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (3.41 KB, patch)
2012-04-17 11:03 PDT, Nathan Froyd [:froydnj]
bhackett1024: review+
Details | Diff | Review

Description Nathan Froyd [:froydnj] 2012-04-17 11:00:44 PDT
TypeCallsite is laid out like so:

    JSScript *script;
    jsbytecode *pc;

    /* Whether this is a 'NEW' call. */
    bool isNew;

    /* Types of each argument to the call. */
    TypeSet **argumentTypes;
    unsigned argumentCount;

    /* Types of the this variable. */
    TypeSet *thisTypes;

    /* Type set receiving the return value of this call. */
    TypeSet *returnTypes;

which, on 64-bit hosts, introduces padding after 'isNew' and 'argumentCount'.  TypeCompartment (which has many more members and comments, so I'm not going to quote it here) has similar problems and can even be slimmed down on 32-bit hosts as well.  Patch coming up.
Comment 1 Nathan Froyd [:froydnj] 2012-04-17 11:03:37 PDT
Created attachment 615794 [details] [diff] [review]
patch

The changes for TypeCallsite are trivial.

The changes for TypeCompartment are a little more complex, as I was attempting to keep the /* Constraint solving worklist structures */ block together, while packing the booleans together for maximum effect.
Comment 3 :Ehsan Akhgari (busy, don't ask for review please) 2012-05-04 13:39:18 PDT
https://hg.mozilla.org/mozilla-central/rev/de945dddcadf

Note You need to log in before you can comment on or make changes to this bug.