Make JSOp an enum class
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: jorendorff, Assigned: jorendorff)
References
Details
Attachments
(5 files)
For now I'll keep JSOP_GETPROP
and so on as aliases for the new names, like JSOp::GetProp
, because this touches enough code already that it might be a pain to land.
But in an immediate follow-up bug I'll do the massive search-and-replace.
Assignee | ||
Comment 1•3 years ago
|
||
Apart from type safety, adding CamelCase names to FOR_EACH_OPCODE will make it easier to keep the Rust frontend up to date now that the integer values of the opcodes have been de-stabilized.
Assignee | ||
Comment 2•3 years ago
|
||
Later we will turn JSOp into an enum class that requires these casts.
In places where we are overwriting a previously written bytecode,
this casts to jsbytecode rather than uint8_t, following the prevailing
style.
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
The change to PendingEdge is OK because this default value is never used; the
field's accessor asserts that *this was created using one of the constructors
that requires an explicit JSOp from the caller.
Depends on D59359
Assignee | ||
Comment 4•3 years ago
|
||
The snake-case identifiers will be handy in Rust. The plan is to write a script
to import FOR_EACH_OPCODE as a similar Rust macro.
Depends on D59361
Assignee | ||
Comment 5•3 years ago
|
||
The new opcode names are like JSOp::InitHiddenProp
. This patch creates
aliases with all of the old names, like JSOP_INITHIDDENPROP
, to keep existing
code working.
Depends on D59362
Pushed by jorendorff@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0774435321f8 Part 1: Add explicit casts between JSOp and uint8_t. r=jandem. https://hg.mozilla.org/integration/autoland/rev/ad9edb807ff5 Part 2: Make JSOP_LIMIT an int constant rather than a JSOp value. r=jandem. https://hg.mozilla.org/integration/autoland/rev/c143928209fb Part 3: Add CamelCase and snake_case identifiers to FOR_EACH_OPCODE. r=jandem. https://hg.mozilla.org/integration/autoland/rev/67fdb2aebe67 Part 4: Convert JSOp to an enum class. r=jandem.
Comment 7•3 years ago
•
|
||
Backed out for build bustages.
Push with failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&revision=67fdb2aebe674b7c1b939ebbef642c8238d832fe&selectedJob=284720016
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=284720016&repo=autoland&lineNumber=26544
Backout: https://hg.mozilla.org/integration/autoland/rev/d2e9558cf7b781521d490318a8c0edd58d327262
Pushed by jorendorff@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/64b7a72f6d92 Part 1: Add explicit casts between JSOp and uint8_t. r=jandem. https://hg.mozilla.org/integration/autoland/rev/790403ad8b09 Part 2: Make JSOP_LIMIT an int constant rather than a JSOp value. r=jandem. https://hg.mozilla.org/integration/autoland/rev/936afc4e9720 Part 3: Add CamelCase and snake_case identifiers to FOR_EACH_OPCODE. r=jandem. https://hg.mozilla.org/integration/autoland/rev/a236919785de Part 4: Convert JSOp to an enum class. r=jandem.
Comment 9•3 years ago
|
||
Backed out 4 changesets (Bug 1608089) for causing build bustages CLOSED TREE
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=284796181&repo=autoland&lineNumber=6497
Comment 10•3 years ago
|
||
Backout by shindli@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2db36e83b324 Backed out 4 changesets for causing build bustages CLOSED TREE
Comment 11•3 years ago
|
||
Pushed by jorendorff@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c9e4623c28c6 Part 1: Add explicit casts between JSOp and uint8_t. r=jandem. https://hg.mozilla.org/integration/autoland/rev/d6e09c1456ae Part 2: Make JSOP_LIMIT an int constant rather than a JSOp value. r=jandem. https://hg.mozilla.org/integration/autoland/rev/41c509c1ee6d Part 3: Add CamelCase and snake_case identifiers to FOR_EACH_OPCODE. r=jandem. https://hg.mozilla.org/integration/autoland/rev/e8eb26db7f29 Part 4: Convert JSOp to an enum class. r=jandem.
Comment 12•3 years ago
|
||
Updated•3 years ago
|
Comment 13•3 years ago
|
||
Pushed by sfink@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1fee2f8a0b01 Fix up gdb prettyprinters for JSOp enum, r=jorendorff
Comment 14•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c9e4623c28c6
https://hg.mozilla.org/mozilla-central/rev/d6e09c1456ae
https://hg.mozilla.org/mozilla-central/rev/41c509c1ee6d
https://hg.mozilla.org/mozilla-central/rev/e8eb26db7f29
Comment 15•3 years ago
|
||
bugherder |
Updated•1 year ago
|
Description
•