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

Unified Diff: runtime/vm/code_generator.cc

Issue 1344993002: Refactor isolate interrupts to use OOB messages instead of interrupt bits. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code review 2 Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/observatory/tests/service/pause_idle_isolate_test.dart ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index e8b1f6fefafc728dc303f657444d89e63fe33b85..00694f1417c927fd2d5df1de0a03f9fc3be56d11 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -709,13 +709,22 @@ DEFINE_RUNTIME_ENTRY(BreakpointRuntimeHandler, 0) {
ASSERT(caller_frame != NULL);
const Code& orig_stub = Code::Handle(
isolate->debugger()->GetPatchedStubAddress(caller_frame->pc()));
- isolate->debugger()->SignalBpReached();
+ const Error& error = Error::Handle(isolate->debugger()->SignalBpReached());
+ if (!error.IsNull()) {
+ Exceptions::PropagateError(error);
+ UNREACHABLE();
+ }
arguments.SetReturn(orig_stub);
}
DEFINE_RUNTIME_ENTRY(SingleStepHandler, 0) {
- isolate->debugger()->DebuggerStepCallback();
+ const Error& error =
+ Error::Handle(isolate->debugger()->DebuggerStepCallback());
+ if (!error.IsNull()) {
+ Exceptions::PropagateError(error);
+ UNREACHABLE();
+ }
}
@@ -1347,40 +1356,10 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) {
}
}
- uword interrupt_bits = isolate->GetAndClearInterrupts();
- if ((interrupt_bits & Isolate::kVMInterrupt) != 0) {
- isolate->thread_registry()->CheckSafepoint();
- if (isolate->store_buffer()->Overflowed()) {
- if (FLAG_verbose_gc) {
- OS::PrintErr("Scavenge scheduled by store buffer overflow.\n");
- }
- isolate->heap()->CollectGarbage(Heap::kNew);
- }
- }
- if ((interrupt_bits & Isolate::kMessageInterrupt) != 0) {
- bool ok = isolate->message_handler()->HandleOOBMessages();
- if (!ok) {
- // False result from HandleOOBMessages signals that the isolate should
- // be terminating.
- const String& msg = String::Handle(String::New("isolate terminated"));
- const UnwindError& error = UnwindError::Handle(UnwindError::New(msg));
- Exceptions::PropagateError(error);
- UNREACHABLE();
- }
- }
- if ((interrupt_bits & Isolate::kApiInterrupt) != 0) {
- // Signal isolate interrupt event.
- Debugger::SignalIsolateInterrupted();
-
- Dart_IsolateInterruptCallback callback = isolate->InterruptCallback();
- if (callback != NULL) {
- if ((*callback)()) {
- return;
- } else {
- // TODO(turnidge): Unwind the stack.
- UNIMPLEMENTED();
- }
- }
+ const Error& error = Error::Handle(isolate->HandleInterrupts());
+ if (!error.IsNull()) {
+ Exceptions::PropagateError(error);
+ UNREACHABLE();
}
if ((stack_overflow_flags & Isolate::kOsrRequest) != 0) {
« no previous file with comments | « runtime/observatory/tests/service/pause_idle_isolate_test.dart ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698