Repository navigation
Enable refcounting arbitrary DOM types - #4057
Merged
Merged
Conversation
|
Critic review: https://critic.hoppipolla.co.uk/r/3237 This is an external review system which you may optionally use for the code review of your pull request. In order to help critic track your changes, please do not make in-place history rewrites (e.g. via |
This was referenced Nov 24, 2014
Member
Author
Member
|
Note: #4173 kind of obsoletes the lint. It currently doesn't check that the first field is a reflector (just that the first field is another DOM struct OR it just contains a reflector), but it's a short fix. Should I incorporate the improvement to reflector checking in that PR? |
…ble safe, asynchronous/cross-task references to pinned objects.
…ng with the ScriptMsg. This ensures that the main-thread Worker object is rooted for as long as there are events in flight or being processed.
bors-servo
pushed a commit
that referenced
this pull request
Dec 29, 2014
This replaces the specialized TrustedXHRAddress and TrustedWorkerAddress code that was used for the same purpose. A non-zero refcount pins the given DOM object's reflector and prevents it from being GCed even when there are no other outstanding references visible to SpiderMonkey. This will enable us to implement asynchronous operations that refer to particular DOM objects (such as "queue a task to fire a simple event named load at the iframe element" from the spec) safely and conveniently, and paves the way for things like asynchronous network responses. Some concerns about the resulting size of XHR progress messages have been expressed, but I believe optimizations to reduce that can be implemented in subsequent PRs. r? @Ms2ger - note in particular the changes to the worker lifetime code. I couldn't figure out how to achieve an identical lifetime to the previous addref/release pairing, and I also was having trouble figuring out why the existing setup was safe. The new implementation now holds the main script task Worker object alive via the TrustedWorkerAddress field in the dedicated worker global scope, which is a significant difference.
mukilan
added a commit
to mukilan/servo
that referenced
this pull request
Jan 4, 2015
As noted in servo#4057, this commit optimizes the size of Trusted<T> so that XHR progress messages do not have to be too heavy, considering that a large number of progress messages will be generated. This commit also replaces the mutex based reference counting with one based on atomic integer operations.
mukilan
added a commit
to mukilan/servo
that referenced
this pull request
Jan 5, 2015
As noted in servo#4057, this commit optimizes the size of Trusted<T> so that XHR progress messages do not have to be too heavy, considering that a large number of progress messages will be generated. This commit also replaces the mutex based reference counting with one based on atomic integer operations.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This replaces the specialized TrustedXHRAddress and TrustedWorkerAddress code that was used for the same purpose. A non-zero refcount pins the given DOM object's reflector and prevents it from being GCed even when there are no other outstanding references visible to SpiderMonkey. This will enable us to implement asynchronous operations that refer to particular DOM objects (such as "queue a task to fire a simple event named load at the iframe element" from the spec) safely and conveniently, and paves the way for things like asynchronous network responses.
Some concerns about the resulting size of XHR progress messages have been expressed, but I believe optimizations to reduce that can be implemented in subsequent PRs.
r? @Ms2ger - note in particular the changes to the worker lifetime code. I couldn't figure out how to achieve an identical lifetime to the previous addref/release pairing, and I also was having trouble figuring out why the existing setup was safe. The new implementation now holds the main script task Worker object alive via the TrustedWorkerAddress field in the dedicated worker global scope, which is a significant difference.