Chromium Code Reviews
DescriptionSafepoint interface and unit tests.
Add infrastructure to enable all threads in an isolate to rendezvous at GC-safe points, and exercise it through unit tests.
* Use existing interrupt mechanism for Dart threads, but a cooperative approach for non-Dart threads (concurrent compiler, etc.): they must periodically call CheckSafepoint (may block).
* Add unit tests to exercise and verify various scenarios: organizing the rendezvous from helper/main thread, with/without Dart code executing, etc.
The next step is to use this interface in old-space allocation and garbage collection, respectively, to allow helper threads to perform allocations that potentially trigger GC (needed for concurrent compiler).
Limitations:
* A thread that is executing a long-running native function is currently not considered at a safepoint, and will delay the rendezvous until it returns to Dart or indirectly calls CheckSafepoint. In a future CL, we can use the saved stack pointer to detect and support this case, and intercept the thread if/when it re-enters Dart or the VM.
BUG=
R=iposva@google.com
Committed: https://github.com/dart-lang/sdk/commit/500eb6d79dd95eb4e34c52c4fb076570093892b3
Patch Set 1 #Patch Set 2 : All tests. #Patch Set 3 : Fix race at exit. #Patch Set 4 : Ready for review. #
Total comments: 16
Patch Set 5 : Address comments. #
Total comments: 2
Patch Set 6 : Add comment about overflow. #
Total comments: 2
Messages
Total messages: 10 (2 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||