Closed Bug 1619001 Opened 5 years ago Closed 5 years ago

Defer Allocation of RegExp objects in BinAST parsing

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: mgaudet, Assigned: anba)

References

Details

Attachments

(26 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

BinAST parsing still eagerly allocates its RegExp objects

We should change this to defer the same way the regular parser does

Blocks: 1619002

(There's some complexity here about how to get this to work with the binast format)

Priority: -- → P2
Assignee: nobody → andrebargull
Status: NEW → ASSIGNED
  • Remove asObjectBox because it is never called.
  • Remove isObjectBox because it always returns true after the last part.

Depends on D65967

This change allows us to verify that the ObjectBox version of newRegExp() is
indeed only needed for BinAST and makes it possible to remove its support code
from the non-BinAST parser in the next part.

Depends on D65968

After the last part, newObjectBox() is only called for the BinAST parser,
which allows us to move the method into BinASTParserBase. And then we can
remove the remaining non-BinAST parser related newObjectBox functionality.

Depends on D65969

TraceListNode is now only used for JSFunctions via FunctionBox.

Depends on D65973

Change ParserSharedBase::traceListHead_ and TraceListNode::traceLink to use
FunctionBox* in preparation to collapse TraceListNode and ObjectBox into
FunctionBox.

Depends on D65977

This code became obsolete after part 6.

Depends on D65984

Both functions are no longer used after the last part.

Depends on D65986

Most of the current code uses function(), so keep that method for now, even
though that's slightly inconsistent with the field name and with hasObject().

Depends on D65989

Update the #includes after the code changes from the previous parts. The updated
includes are based on IWYU, but aren't exhaustive, for example not all
transitive includes were changed to explicit includes.

Depends on D65993

RegExpLiteral::create is guaranteed to return a new object on each
invocation, so we no longer have to call CloneRegExpObject.

Drive-by fix:
Add missing OOM handling when creating a BigInt value.

Depends on D65996

Pushed by btara@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d4a68e391c2d Part 1: Remove no longer used BigIntBox. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/11f296810eaa Part 2: Remove asObjectBox and isObjectBox. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/eb3bc1449e37 Part 3: Restrict ObjectBox version of newRegExp() to BinAST. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/f6406ceba600 Part 4: Move newObjectBox to BinASTParserBase. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/d6b9d858b31a Part 5: Use deferred allocation for RegExp objects in BinAST. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/9ba489ab3a92 Part 6: Remove ObjectBox wrapper for RegExp. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/ff17235a8f7e Part 7: Remove unused template parameter from SyntaxParseHandler::newRegExp. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/7e60b70fdbd5 Part 8: Remove TraceListNode::NodeType. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/9a90ee5c0bfa Part 9: Remove unnecessary friend class declaration from TraceListNode. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/b4d0b2a3cd0d Part 10: Change GCThingList::append to take a FunctionBox instead of an ObjectBox. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/13b6b98884d7 Part 11: Remove some unnecessary forward/type declarations. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/406c2c828807 Part 12: Change ParserSharedBase::traceListHead_ and TraceListNode::traceLink to use FunctionBox pointers. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/0189e180adc9 Part 13: Move TraceList from TraceListNode into FunctionBox and devirtualise FunctionBox::trace. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/47fea0306941 Part 14: Collapse TraceListNode into ObjectBox. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/161e40eb6917 Part 15: Store JSObject* instead of Cell* in ObjectBox. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/5b69b3fcddc6 Part 16: Remove ObjectBox variant from RegExpLiteral. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/0d0e74c683f9 Part 17: Change ObjectBox::emitLink to use FunctionBox*. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/d9d7a349efb5 Part 18: Remove asFunctionBox and isFunctionBox. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/f39eabd355c6 Part 19: Collapse ObjectBox into FunctionBox. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/ec8d746c8e8d Part 20: Remove FunctionBox::object() in favour of FunctionBox::function(). r=mgaudet https://hg.mozilla.org/integration/autoland/rev/cd057dbb1648 Part 21: Store FunctionBox::object_ as a JSFunction*. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/1d905835c68f Part 22: Move FunctionBox methods into the proper cpp file. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/fd93c6fcf0f9 Part 23: Append underscore to FunctionBox' link pointers for consistency with other members. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/c3282893b4a8 Part 24: Update includes for frontend/{ParseNode,SharedContext}. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/1a1150770311 Part 25: Rename {BigInt,RegExp}Literal::getOrCreate to 'create' to match its new semantics. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/be95fe89099f Part 26: Remove RegExp cloning in Reflect.parse. r=mgaudet
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: