Closed
Bug 1325075
Opened 8 years ago
Closed 8 years ago
Value::isGCThing is a footgun
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla53
| Tracking | Status | |
|---|---|---|
| firefox53 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
Details
Attachments
(5 files)
|
22.38 KB,
patch
|
jonco
:
review+
baku
:
review+
|
Details | Diff | Splinter Review |
|
752 bytes,
patch
|
jonco
:
review+
|
Details | Diff | Splinter Review |
|
10.48 KB,
patch
|
jonco
:
review+
|
Details | Diff | Splinter Review |
|
54.64 KB,
patch
|
jonco
:
review+
|
Details | Diff | Splinter Review |
|
48.80 KB,
patch
|
Details | Diff | Splinter Review |
Value::isGCThing and Value::isMarkable do almost the same thing, but isGCThing returns true for NullValue. We could remove isGCThing/toGCThing and convert all consumers to isMarkable. After that we can move JSVAL_TAG_NULL before JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET and probably rename isMarkable/isGCThing to isGCThing/toGCThing.
| Assignee | ||
Updated•8 years ago
|
Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
| Assignee | ||
Comment 1•8 years ago
|
||
This converts all isGCThing/toGCThing calls to isMarkable/toMarkablePointer or something else. Most callers actually wanted isMarkable/toMarkablePointer. I renamed isGCThing to isGCThingOrNull and made it private, we'll remove it in a later patch. r? baku for the DOM changes, especially XMLHttpRequestWorker.cpp we discussed on IRC.
Attachment #8821196 -
Flags: review?(jcoppeard)
Attachment #8821196 -
Flags: review?(amarchesini)
| Assignee | ||
Comment 2•8 years ago
|
||
There are only 3 callers of toGCCellPtr, and all of them expect a non-null pointer.
Attachment #8821197 -
Flags: review?(jcoppeard)
| Assignee | ||
Comment 3•8 years ago
|
||
This moves NULL out of the "GCThing set" in Value.h, and removes the private isGCThingOrNull and toGCThingOrNull methods.
Attachment #8821200 -
Flags: review?(jcoppeard)
| Assignee | ||
Comment 4•8 years ago
|
||
Now we can rename isMarkable/toMarkablePointer to isGCThing/toGCThing with no change in behavior.
Attachment #8821201 -
Flags: review?(jcoppeard)
| Assignee | ||
Comment 5•8 years ago
|
||
Here's the combined patch. It's smaller but harder to review. Also, if you prefer isMarkable/toMarkablePointer, I can just drop part 4.
Comment 6•8 years ago
|
||
Comment on attachment 8821196 [details] [diff] [review] Part 1 - Get rid of isGCThing/toGCThing Review of attachment 8821196 [details] [diff] [review]: ----------------------------------------------------------------- r+ for the DOM part
Attachment #8821196 -
Flags: review?(amarchesini) → review+
Updated•8 years ago
|
Attachment #8821196 -
Flags: review?(jcoppeard) → review+
Updated•8 years ago
|
Attachment #8821197 -
Flags: review?(jcoppeard) → review+
Updated•8 years ago
|
Attachment #8821200 -
Flags: review?(jcoppeard) → review+
Comment 7•8 years ago
|
||
Comment on attachment 8821201 [details] [diff] [review] Part 4 - Rename isMarkable/toMarkablePointer Review of attachment 8821201 [details] [diff] [review]: ----------------------------------------------------------------- This all looks great! Thanks for splitting up for easier reviewing.
Attachment #8821201 -
Flags: review?(jcoppeard) → review+
Pushed by jandemooij@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/e5eab325b27f Fix Value::isGCThing footgun, stop returning true for NullValue. r=jonco,baku
Comment 9•8 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/e5eab325b27f
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in
before you can comment on or make changes to this bug.
Description
•