ParseNode::pn_type should be const

RESOLVED FIXED in Firefox 67

Status

()

enhancement
RESOLVED FIXED
3 months ago
3 months ago

People

(Reporter: khyperia, Assigned: khyperia)

Tracking

unspecified
mozilla67
Points:
---

Firefox Tracking Flags

(firefox67 fixed)

Details

Attachments

(2 attachments)

Assignee

Description

3 months ago

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.

Assignee

Comment 3

3 months ago

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.

Comment 4

3 months ago
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

Comment 5

3 months ago
bugherder
Status: ASSIGNED → RESOLVED
Last Resolved: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.