Misleading comment about constant and pre-barriers in WarpGCPtr?
Categories
(Core :: JavaScript Engine: JIT, defect, P3)
Tracking
()
People
(Reporter: anba, Unassigned)
References
(Blocks 1 open bug)
Details
WarpGCPtr has this comment:
// Note: no pre-barrier is needed because this is a constant. No post-barrier
// is needed because the value is always tenured.
const T ptr_;
But const T for a pointer type T means a "constant pointer" and not a "pointer to a constant object", i.e. as currently written it's not possible to reassign ptr_, but it's still possible to change the object ptr_ points to.
Am I misunderstanding the comment or is this a bug?
Comment 1•5 years ago
|
||
(In reply to André Bargull [:anba] from comment #0)
This part is actually what's intended. You need a pre-barrier if you change the pointer to point to a different object because it changes the GC graph, but you don't need one (here) if you change the object.
However, we might need a pre-barrier when we destroy the WarpGCPtr, as this counts as a change to the graph too. If the original edge this WarpGCPtr was created for is guaranteed to still exist then it's not necessary. I don't understand the lifecycle of these enough to say whether that's true or not.
Updated•5 years ago
|
Updated•5 years ago
|
Description
•