(In reply to Jan de Mooij [:jandem] from comment #3) (Posting the comment I wrote before your last comment appeared) At the moment we have the situation where we ensure globals from all on-stack realms get marked. With this change that would also mark the lexical environment. So I think we don't need a barrier as long is it's a realm we have entered. Can we assert that? Is the lexical environment still logically part of the global but stored externally or is it part of the realm now? If it's the former HeapPtr is fine but we need a comment about why it's OK to skip the global read barrier when reading the lexical environment. If it's the latter it would be better as ReadBarriered and traced from Realm::traceRoots() as we do for the global (also with unbarrieredGet() to read). In general I prefer ReadBarriered for weak pointers for documentation even if we always skip the barrier.
Bug 1541810 Comment 5 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
(In reply to Jan de Mooij [:jandem] from comment #3) (Posting the comment I wrote before I saw your last comment) At the moment we have the situation where we ensure globals from all on-stack realms get marked. With this change that would also mark the lexical environment. So I think we don't need a barrier as long is it's a realm we have entered. Can we assert that? Is the lexical environment still logically part of the global but stored externally or is it part of the realm now? If it's the former HeapPtr is fine but we need a comment about why it's OK to skip the global read barrier when reading the lexical environment. If it's the latter it would be better as ReadBarriered and traced from Realm::traceRoots() as we do for the global (also with unbarrieredGet() to read). In general I prefer ReadBarriered for weak pointers for documentation even if we always skip the barrier.