Closed Bug 1525331 Opened 5 years ago Closed 5 years ago

ParseNode::pn_type should be const

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: khyperia, Assigned: khyperia)

Details

Attachments

(2 files)

We shouldn't be doing in-place mutations of parsenodes. It's spooky and bad and prevents a lot of improvements to code.

Next steps after making pn_type const is to remove the ParseNode union and rather store fields on the ParseNode classes themselves. We then would be able to have variable-sized allocations, which will likely at least offset any losses introduced in this patch due to allocating more in the constant folder.

Tacked on the Next steps described in the first comment, just to keep things rolling. Feel free to review only the first patch and I can pull the second patch into its own bug.

Pushed by ahauck@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/aba804ffb8e8
Make ParseNode::pn_type const. r=jorendorff
https://hg.mozilla.org/integration/autoland/rev/a226aae4349f
Move fields from union to individual subclasses. r=jorendorff
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: