Clean-up type definitions for VMFunctions
Categories
(Core :: JavaScript Engine: JIT, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
(Blocks 1 open bug)
Details
Attachments
(12 files)
Bug 1740053 - Part 1: Remove Handle and MutableHandle specialisations from TypeToDataType. r=jandem!
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
TypeToDataType
has specialisations for handles, which seems dubious becauseTypeToDataType
is only used for return types and we never return handles.- There's quite a bit of repetition in
TypeToDataType
andTypeToArgProperties
forgc::Cell
types. RootType::RootFunction
doesn't seem to be necessary as a distinct type.RootType::RootObject
should work just fine forTypeToRootType<HandleFunction>
.- ...
Assignee | ||
Comment 1•3 years ago
|
||
TypeToDataType
is only used for return types and because neither Handle
nor
MutableHandle
are valid return types, we don't need to provide TypeToDataType
specialisations for these types.
Assignee | ||
Comment 2•3 years ago
|
||
If we default to returning Type_Object
for gc::Cell
pointers, we can avoid some code duplication.
Depends on D130650
Assignee | ||
Comment 3•3 years ago
|
||
This should make it more obvious that this struct is only needed for return types.
Depends on D130651
Assignee | ||
Comment 4•3 years ago
|
||
Similar to the changes in part 2.
Depends on D130652
Assignee | ||
Comment 5•3 years ago
|
||
Depends on D130653
Assignee | ||
Comment 6•3 years ago
|
||
RootFunction
doesn't seem to provide any benefits when compared to using RootObject
.
TraceRoot(JSFunction**)
calls gc::ConvertToBase()
, which casts JSFunction
down
to JSObject
.
Depends on D130654
Assignee | ||
Comment 7•3 years ago
|
||
Depends on D130655
Assignee | ||
Comment 8•3 years ago
|
||
- Add a general specialisation for pointers to pointers (
Type_Pointer
). - Add a general specialisation for MutableHandle (
Type_Handle
).
Depends on D130656
Assignee | ||
Comment 9•3 years ago
|
||
This prevents making a VM function which uses for example JS::BigInt*
as an
out-param. This isn't valid because JS::BigInt*
is already used by other VM
functions as an input parameter.
Depends on D130657
Assignee | ||
Comment 10•3 years ago
|
||
A const pointer can't be an out-param, so when we change the VM functions which
use JS::BigInt*
as the last parameter to instead use const JS::BigInt*
, we
no longer have to worry about conflicts between in- and out-parameters.
Depends on D130658
Assignee | ||
Comment 11•3 years ago
|
||
Similar to the changes in part 10.
Depends on D130659
Assignee | ||
Comment 12•3 years ago
|
||
Type_Object
is also used for non-object types, like strings, symbols, and
bigints. Rename it to Type_Cell
to indicate that also non-objec types are
possible. The name Type_Cell
was chosen to match RootType::RootCell
.
Comment 13•3 years ago
|
||
Updated•3 years ago
|
Comment 14•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/68264fdb6723
https://hg.mozilla.org/mozilla-central/rev/6358f32ec818
https://hg.mozilla.org/mozilla-central/rev/6b78ae6c6381
https://hg.mozilla.org/mozilla-central/rev/4d819830b0f1
https://hg.mozilla.org/mozilla-central/rev/ca48cdb63ce6
https://hg.mozilla.org/mozilla-central/rev/069fd355ef6b
https://hg.mozilla.org/mozilla-central/rev/f628d5ce0d33
https://hg.mozilla.org/mozilla-central/rev/2706136fedf7
https://hg.mozilla.org/mozilla-central/rev/9a9d8e431e4e
https://hg.mozilla.org/mozilla-central/rev/f3300f17ce4e
https://hg.mozilla.org/mozilla-central/rev/31b721186d70
https://hg.mozilla.org/mozilla-central/rev/3731bfaca711
Description
•