TI: Compute types for singleton and JSON objects

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: bhackett, Assigned: bhackett)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-jaegermonkey)

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

7 years ago
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.
(Assignee)

Comment 1

7 years ago
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
(Assignee)

Updated

7 years ago
Whiteboard: fixed
(Assignee)

Updated

7 years ago
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Whiteboard: fixed → fixed-in-jaegermonkey

Updated

7 years ago
Blocks: 640897
You need to log in before you can comment on or make changes to this bug.