Last Comment Bug 669969 - Make TypeObject a GC thing
: Make TypeObject a GC thing
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: x86 Mac OS X
-- normal with 1 vote (vote)
: ---
Assigned To: Brian Hackett (:bhackett)
: Jason Orendorff [:jorendorff]
Depends on: 684348
Blocks: TypeInference 669815 680951
  Show dependency treegraph
Reported: 2011-07-07 11:50 PDT by Brian Hackett (:bhackett)
Modified: 2012-01-28 20:39 PST (History)
9 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (209.33 KB, patch)
2011-07-21 07:39 PDT, Brian Hackett (:bhackett)
no flags Details | Diff | Splinter Review

Description User image Brian Hackett (:bhackett) 2011-07-07 11:50:28 PDT
We need to check whether type objects are marked over and over during GC, regardless of how many type objects there actually are.  TypeObjects are currently malloc'ed individually and store their mark bits as a field, which has the potential for lots of fragmentation and cache misses.
Comment 1 User image Brian Hackett (:bhackett) 2011-07-21 07:39:48 PDT
Created attachment 547397 [details] [diff] [review]

Make TypeObject a GC thing, and do some other refactoring:

- Allow singleton type objects (representing exactly one JS object) to be destroyed on each GC (in addition to being lazily constructed, as last week's refactoring did) if the conservative GC does not find a pointer to them, and allocate their data from the analysis pool rather than via malloc.

- Track per-allocation-site type objects in a per-compartment hashtable (similar to what we do for JSON/singleton type info).  This cuts the size of TypeObject significantly, and removes a mostly-unused pointer from JSScript.  Allocation of such objects may slow down, the fix for that is to inline creation of objects, arrays etc. in the jitcode.  This also removes the quadratic behavior seen with scripts containing tons of object/array initializers.

Another tests-pass push (at least in the shell), still need to see how this affects memory.
Comment 2 User image Brian Hackett (:bhackett) 2011-07-21 07:40:46 PDT
Comment 3 User image Paul Wright 2012-01-28 18:59:46 PST
Can this be closed?

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