Closed Bug 1597925 Opened 5 years ago Closed 5 years ago

Moving a HeapPtr asserts the contents are not gray

Categories

(Core :: JavaScript: GC, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(3 files)

This is showing up with the debugger changes in bug 1592116:

https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=276383216&repo=try&lineNumber=25499

We want to assert that we don't assign a HeapPtr with a pointer to a gray GC thing, but I think that moving a HeapPtr should not check this. Also, it shouldn't trigger barriers which it looks like this will do.

Priority: -- → P1

(In reply to Jon Coppeard (:jonco) from comment #0)

Also, it shouldn't trigger barriers which it looks like this will do.

It's triggering barriers on the destination of the move, which is correct.

Summary: Moving a HeapPtr triggers barriers and asserts the contents are not gray → Moving a HeapPtr asserts the contents are not gray
Assignee: nobody → jcoppeard

More use is being made of C++ move semantics recently and this imporves support for moving our GC wrapper types. In this case we don't want to trigger the pre-barrier on the source of the move because we are not modifying the object graph. We also do not want to check that wrapper contents are non gray, because this is valid (it's not valid to create a new heap pointer to a GC thing).

The patch adds a release() method to wrappers that returns the original contents of the wrapper after clearing it, without triggering a pre-barrier. Also it adds setUnchecked() methods to set wrapper contents without the gray marking check.

Depends on D54304

Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2607f7ba81ba
Refactor GC wrapper comparison tests a little r=sfink
https://hg.mozilla.org/integration/autoland/rev/d3e369f6977c
Allow moving wrapped pointer types without triggering pre-barriers or asserting that their contents are not gray r=sfink
https://hg.mozilla.org/integration/autoland/rev/f4a33a4dbfa7
Add post barrier tests for wrapper types which support move construction and move assignement r=sfink
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: