WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
21609
Make MessagePorts protect their peers across heaps
https://bugs.webkit.org/show_bug.cgi?id=21609
Summary
Make MessagePorts protect their peers across heaps
Alexey Proskuryakov
Reported
2008-10-15 05:15:06 PDT
Each MessagePort needs to GC protect its entangled one, because even if the latter does not have a reachable wrapper, a message dispatched via the former will have a reference to it when dispatched. This already works in the case when both wrappers are in the same JS heap, but as MessagePorts will be used for cross-thread communication, a different mechanism is needed.
Attachments
proposed patch
(11.16 KB, patch)
2008-10-15 05:28 PDT
,
Alexey Proskuryakov
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2008-10-15 05:28:43 PDT
Created
attachment 24358
[details]
proposed patch Unfortunately, this introduces knowledge about bindings into the implementation MessagePort object. Also, I do not quite understand how this will work in presence of other bindings (currently, an ObjC binding is a stub, but it exists nonetheless).
Darin Adler
Comment 2
2008-10-15 09:10:09 PDT
Comment on
attachment 24358
[details]
proposed patch + objects in the heap, makin git possible to implement cross-heap dependencies. Misplaces space here "makin git". + void markCrossHeapDependentObjectsForDocument(JSGlobalData& globalData, Document* doc) I'm slightly annoyed that we sometimes use references and other times pointers for JSGlobalData. Which style do you think is preferred? I also prefer document as the name for a document argument rather than doc. It's a shame that m_jsWrapperIsKnownInaccessible is such a long name, but not correct grammar. The "known inaccessible" part isn't good grammar. I don't have a better name to suggest, but I think it's worth pondering a little more. Maybe just "KnownToBeInaccessible"? + bool jsWrapperIsKnownInaccessible() { return m_jsWrapperIsKnownInaccessible; } Should be const? + JSGlobalObject* globalObject = m_globalData->head; + do { + globalObject->markCrossHeapDependentObjects(); + globalObject = globalObject->next(); + } while (globalObject != m_globalData->head); The loop is just complicated enough that I think it should either be in its own function, or paragraphed separately from the other marking work. r=me
Alexey Proskuryakov
Comment 3
2008-10-16 01:03:59 PDT
Committed revision 37631. (In reply to
comment #2
)
> I'm slightly annoyed that we sometimes use references and other times pointers > for JSGlobalData. Which style do you think is preferred?
I prefer references for things that can never be NULL. But that's hardly our prevailing style.
> It's a shame that m_jsWrapperIsKnownInaccessible is such a long name, but not > correct grammar.
I went with m_jsWrapperIsInaccessible.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug