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

Issue 8851008: Add support for interrupting an isolate in the vm. Interrupts are (Closed)

Created:
9 years ago by turnidge
Modified:
9 years ago
Reviewers:
srdjan, siva, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org, tobyr
Visibility:
Public.

Description

Add support for interrupting an isolate in the vm. Interrupts are implemented by extending the existing support for stack overflow checking in the vm. When an interrupt is scheduled for an isolate, we overwrite the isolate's stack limit with a value guaranteed to cause a stack overflow. We support multiple kinds of interrupts, encoded in the low bits of the stack limit. Add Dart_InterruptIsolate and Dart_InterruptIsolateCallback to the dart embedding api to allow the embedder to request and handle interrupts. Add EXPECT_SUBSTRING(needle, haystack) testing macro. Committed: https://code.google.com/p/dart/source/detail?r=2529

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 2

Patch Set 6 : '' #

Total comments: 18

Patch Set 7 : '' #

Patch Set 8 : '' #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+318 lines, -74 lines) Patch
M runtime/bin/gen_snapshot.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M runtime/bin/main.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M runtime/bin/run_vm_tests.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -2 lines 0 comments Download
M runtime/include/dart_api.h View 1 2 3 4 5 6 7 6 chunks +40 lines, -6 lines 1 comment Download
M runtime/tests/vm/vm.status View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/vm/assert.h View 1 2 3 4 5 6 7 3 chunks +18 lines, -0 lines 0 comments Download
M runtime/vm/code_generator.cc View 1 2 3 4 5 6 7 1 chunk +25 lines, -6 lines 0 comments Download
M runtime/vm/code_generator_ia32.cc View 1 2 3 4 5 6 7 4 chunks +14 lines, -4 lines 0 comments Download
M runtime/vm/dart.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/dart.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -2 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 4 5 6 7 3 chunks +13 lines, -4 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 2 3 4 5 6 7 3 chunks +121 lines, -1 line 3 comments Download
M runtime/vm/isolate.h View 1 2 3 4 5 6 7 5 chunks +27 lines, -7 lines 0 comments Download
M runtime/vm/isolate.cc View 1 2 3 4 5 6 7 5 chunks +46 lines, -1 line 1 comment Download
M runtime/vm/opt_code_generator_ia32.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -3 lines 0 comments Download
M runtime/vm/stub_code.h View 1 2 3 4 5 6 7 1 chunk +0 lines, -1 line 0 comments Download
M runtime/vm/stub_code_arm.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -5 lines 0 comments Download
M runtime/vm/stub_code_ia32.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -24 lines 0 comments Download
M runtime/vm/stub_code_x64.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -5 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
turnidge
There is still a TODO in code_generator_ia32.cc about a bunch of nops I added.
9 years ago (2011-12-07 19:38:14 UTC) #1
srdjan
DBC http://codereview.chromium.org/8851008/diff/21002/runtime/vm/assert.h File runtime/vm/assert.h (right): http://codereview.chromium.org/8851008/diff/21002/runtime/vm/assert.h#newcode52 runtime/vm/assert.h:52: void Substring(const E& needle, const A& haystack); IsSubstring?
9 years ago (2011-12-12 22:12:50 UTC) #2
turnidge
http://codereview.chromium.org/8851008/diff/21002/runtime/vm/assert.h File runtime/vm/assert.h (right): http://codereview.chromium.org/8851008/diff/21002/runtime/vm/assert.h#newcode52 runtime/vm/assert.h:52: void Substring(const E& needle, const A& haystack); On 2011/12/12 ...
9 years ago (2011-12-12 22:20:32 UTC) #3
Ivan Posva
First set of comments. -Ivan http://codereview.chromium.org/8851008/diff/24001/runtime/include/dart_api.h File runtime/include/dart_api.h (right): http://codereview.chromium.org/8851008/diff/24001/runtime/include/dart_api.h#newcode260 runtime/include/dart_api.h:260: typedef bool (*Dart_IsolateInterruptCallback)(); Should ...
9 years ago (2011-12-14 23:59:50 UTC) #4
Ivan Posva
http://codereview.chromium.org/8851008/diff/24001/runtime/vm/isolate.cc File runtime/vm/isolate.cc (right): http://codereview.chromium.org/8851008/diff/24001/runtime/vm/isolate.cc#newcode159 runtime/vm/isolate.cc:159: stack_limit_ = limit; This will blow away pending interrupts. ...
9 years ago (2011-12-15 19:12:19 UTC) #5
turnidge
Hi Ivan -- Please take another look. http://codereview.chromium.org/8851008/diff/24001/runtime/include/dart_api.h File runtime/include/dart_api.h (right): http://codereview.chromium.org/8851008/diff/24001/runtime/include/dart_api.h#newcode260 runtime/include/dart_api.h:260: typedef bool ...
9 years ago (2011-12-15 21:30:06 UTC) #6
siva
9 years ago (2011-12-17 00:05:38 UTC) #7
DBC

http://codereview.chromium.org/8851008/diff/41001/runtime/include/dart_api.h
File runtime/include/dart_api.h (right):

http://codereview.chromium.org/8851008/diff/41001/runtime/include/dart_api.h#...
runtime/include/dart_api.h:416: * Dart_IsolateInterruptCallback).
If Dart_ShutdownIsolate is called by an isolate that has a pending interrupt the
isolate will still be shutdown, Maybe we should make that explicit here.

http://codereview.chromium.org/8851008/diff/41001/runtime/vm/dart_api_impl_te...
File runtime/vm/dart_api_impl_test.cc (right):

http://codereview.chromium.org/8851008/diff/41001/runtime/vm/dart_api_impl_te...
runtime/vm/dart_api_impl_test.cc:2936: sync = new Monitor();
Where is 'sync' deleted?
Should be done at the end of this function.

http://codereview.chromium.org/8851008/diff/41001/runtime/vm/dart_api_impl_te...
runtime/vm/dart_api_impl_test.cc:2954: OS::Sleep(5);
These sleeps make the test a little non deterministic right, because the other
thread might not be scheduled and we might end up calling Dart_InterruptIsolate
even before the previous interrupt was serviced.

http://codereview.chromium.org/8851008/diff/41001/runtime/vm/dart_api_impl_te...
runtime/vm/dart_api_impl_test.cc:2969: OS::Sleep(20);
Why is this sleep necessary, won't the other thread just exit independently?

http://codereview.chromium.org/8851008/diff/41001/runtime/vm/isolate.cc
File runtime/vm/isolate.cc (right):

http://codereview.chromium.org/8851008/diff/41001/runtime/vm/isolate.cc#newco...
runtime/vm/isolate.cc:158: void Isolate::SetStackLimit(uword limit) {
ASSERT(limit != (~static_cast<uword>(0) & ~kInterruptsMask));

Powered by Google App Engine
This is Rietveld 408576698