Merge TypeScript and ICScript into JitScript
Categories
(Core :: JavaScript Engine: JIT, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(11 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 |
The plan is to do the following:
- Rename TypeScript to JitScript.
- Move it from vm/TypeInference.* to jit/JitScript.{h,cpp}
- Merge ICScript into JitScript. TypeScript and ICScript have the same lifetime already so this should be straight-forward. It will eliminate a malloc/free + extra dereferences + we can do a single bytecode walk instead of two when allocating JitScript.
- Move JIT-related fields currently in JSScript (baseline/ion/etc) to JitScript. This is nice because sizeof(JSScript) matters and it will move some JIT-related code out of vm/
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
Also JSScript::makeTypes => JSScript::createJitScript for consistency with code
elsewhere.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 2•6 years ago
|
||
Some of the TypeInference-related static methods were kept in TypeInference-inl.h and
TypeInference.cpp because of various dependencies. Also, methods like JitScript::MonitorAssign
probably don't belong on JitScript anyway, but for now this seems reasonable.
Depends on D31755
Assignee | ||
Comment 3•6 years ago
|
||
ICScript and JitScript had the same lifetime already, but this eliminates
a malloc/free and some extra dereferences (especially for accessing ICEntries
from Baseline Interpreter code).
This is just the minimal set of changes to make it easier to review. Follow-up
changes should:
-
Move (now) JitScript methods to JitScript.cpp
-
Merge FillBytecodeTypeMap with JitScript::initICEntries so we do just a single
bytecode walk. -
Move JitScript from the js namespace to js::jit.
Depends on D31982
Assignee | ||
Comment 4•6 years ago
|
||
These have been unnecessary since the ICScript introduction: when performing the
arguments analysis we have a JitScript but not a BaselineScript.
Depends on D32103
Assignee | ||
Comment 5•6 years ago
|
||
The destroy() call in JSScript::finalize was moved into DestroyJitScripts for
consistency with BaselineScript and IonScript.
Assignee | ||
Comment 6•6 years ago
|
||
Depends on D32290
Assignee | ||
Comment 7•6 years ago
|
||
Depends on D32292
Assignee | ||
Comment 8•6 years ago
|
||
"Discard" instead of "Release" for consistency with ShouldDiscardBaselineCode.
Depends on D32293
Assignee | ||
Comment 9•6 years ago
|
||
We now do a single pass over the bytecode instead of two.
Register pressure of the combined code might be a bit worse but it also
eliminates some duplication so I think it's worth it.
Assignee | ||
Comment 10•6 years ago
|
||
Depends on D32298
Comment 11•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 13•6 years ago
|
||
JitScript::initICEntriesAndBytecodeTypeMap is still in BaselineIC.cpp because
it depends on things defined there (like FallbackStubAllocator) and I think it's
not unreasonable to keep it there.
Depends on D32299
Comment 14•6 years ago
|
||
Updated•6 years ago
|
Comment 15•6 years ago
|
||
bugherder |
Comment 16•6 years ago
|
||
Comment 17•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 18•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c0f95fe29f8a
https://hg.mozilla.org/mozilla-central/rev/547d1940a27f
https://hg.mozilla.org/mozilla-central/rev/56f1c5f12b84
https://hg.mozilla.org/mozilla-central/rev/5ee66c20f298
https://hg.mozilla.org/mozilla-central/rev/05c094ef90ca
https://hg.mozilla.org/mozilla-central/rev/87aaa29b2fff
https://hg.mozilla.org/mozilla-central/rev/ec5f175f4f2c
Description
•