JSObjects which were determined to be constant singletons by the parser or were produced by the JSON parser currently have no type information (type objects have unknown properties). This should get fixed; we should use the same type object for singleton/JSON arrays which appear to contain the same type as their element and for singleton/JSON objects with the same shape. The main issue is getting this type information in a way that doesn't hurt parser perf much.
Created attachment 518300 [details] [diff] [review] WIP Picks types for singleton/JSON arrays and objects by waiting for them to be constructed and then changing out the type (and in the latter case, the shape) based on the element type of arrays and final shape of objects. The overhead this adds varies. For large singleton initializers, checking/adding type information adds 3% overhead for a big array of integers, and <2% for a big array of homogenous 4-property structures. The JSON parser is faster, so will have proportionally more overhead. Still needs cleanup and GC handling.
Assignee: general → bhackett1024
Created attachment 518568 [details] [diff] [review] patch http://hg.mozilla.org/projects/jaegermonkey/rev/80c5a1b0d8d6
Attachment #518300 - Attachment is obsolete: true
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Whiteboard: fixed → fixed-in-jaegermonkey
You need to log in before you can comment on or make changes to this bug.