Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Issue 1259223005: Safepoint interface and unit tests. (Closed)

Created:
5 years, 4 months ago by koda
Modified:
5 years, 4 months ago
Reviewers:
zra, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Safepoint 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+364 lines, -30 lines) Patch
M runtime/vm/code_generator.cc View 1 2 3 4 2 chunks +8 lines, -4 lines 0 comments Download
M runtime/vm/isolate.h View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/store_buffer.h View 1 2 3 4 2 chunks +3 lines, -4 lines 0 comments Download
M runtime/vm/store_buffer.cc View 1 2 3 4 2 chunks +10 lines, -12 lines 0 comments Download
M runtime/vm/thread_registry.h View 1 2 3 4 6 chunks +51 lines, -8 lines 0 comments Download
A runtime/vm/thread_registry.cc View 1 2 3 4 5 1 chunk +82 lines, -0 lines 0 comments Download
M runtime/vm/thread_test.cc View 1 2 3 4 1 chunk +207 lines, -0 lines 2 comments Download
M runtime/vm/vm_sources.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
koda
5 years, 4 months ago (2015-07-29 17:56:50 UTC) #2
Ivan Posva
https://codereview.chromium.org/1259223005/diff/60001/runtime/vm/code_generator.cc File runtime/vm/code_generator.cc (right): https://codereview.chromium.org/1259223005/diff/60001/runtime/vm/code_generator.cc#newcode1304 runtime/vm/code_generator.cc:1304: isolate->thread_registry()->CheckSafepoint(); Regardless of the interrupt reason we should check ...
5 years, 4 months ago (2015-07-31 20:28:10 UTC) #3
koda
Also fixed unit test (done -> total_done + local_done) as discussed offline. PTAL https://codereview.chromium.org/1259223005/diff/60001/runtime/vm/code_generator.cc File ...
5 years, 4 months ago (2015-07-31 22:40:44 UTC) #4
Ivan Posva
https://codereview.chromium.org/1259223005/diff/80001/runtime/vm/isolate.h File runtime/vm/isolate.h (right): https://codereview.chromium.org/1259223005/diff/80001/runtime/vm/isolate.h#newcode330 runtime/vm/isolate.h:330: kVMInterrupt = 0x4, // Internal VM checks: safepoints, store ...
5 years, 4 months ago (2015-07-31 23:40:16 UTC) #5
Ivan Posva
Now with official LGTM -ip
5 years, 4 months ago (2015-08-01 00:06:50 UTC) #6
koda
Committed patchset #6 (id:100001) manually as 500eb6d79dd95eb4e34c52c4fb076570093892b3 (presubmit successful).
5 years, 4 months ago (2015-08-01 02:53:19 UTC) #7
zra
https://codereview.chromium.org/1259223005/diff/100001/runtime/vm/thread_test.cc File runtime/vm/thread_test.cc (right): https://codereview.chromium.org/1259223005/diff/100001/runtime/vm/thread_test.cc#newcode259 runtime/vm/thread_test.cc:259: Zone* zone = thread->zone(); DBC Extra indent.
5 years, 4 months ago (2015-08-01 03:28:22 UTC) #9
koda
5 years, 4 months ago (2015-08-01 06:06:52 UTC) #10
Message was sent while issue was closed.
https://codereview.chromium.org/1259223005/diff/100001/runtime/vm/thread_test.cc
File runtime/vm/thread_test.cc (right):

https://codereview.chromium.org/1259223005/diff/100001/runtime/vm/thread_test...
runtime/vm/thread_test.cc:259: Zone* zone = thread->zone();
On 2015/08/01 03:28:22, zra wrote:
> DBC
> 
> Extra indent.

Done in follow up CL.

Powered by Google App Engine
This is Rietveld 408576698