Index: runtime/vm/isolate.cc |
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc |
index d0fa2bf580b75618591044edf97f09ca804cfb51..c9bb01c1e349bb680c2e455ca3f5cc392dd559f6 100644 |
--- a/runtime/vm/isolate.cc |
+++ b/runtime/vm/isolate.cc |
@@ -450,20 +450,24 @@ bool IsolateMessageHandler::HandleMessage(Message* message) { |
void IsolateMessageHandler::NotifyPauseOnStart() { |
- StartIsolateScope start_isolate(isolate()); |
- StackZone zone(I); |
- HandleScope handle_scope(I); |
- ServiceEvent pause_event(isolate(), ServiceEvent::kPauseStart); |
- Service::HandleEvent(&pause_event); |
+ if (Service::NeedsDebugEvents()) { |
+ StartIsolateScope start_isolate(isolate()); |
+ StackZone zone(I); |
+ HandleScope handle_scope(I); |
+ ServiceEvent pause_event(isolate(), ServiceEvent::kPauseStart); |
+ Service::HandleEvent(&pause_event); |
+ } |
} |
void IsolateMessageHandler::NotifyPauseOnExit() { |
- StartIsolateScope start_isolate(isolate()); |
- StackZone zone(I); |
- HandleScope handle_scope(I); |
- ServiceEvent pause_event(isolate(), ServiceEvent::kPauseExit); |
- Service::HandleEvent(&pause_event); |
+ if (Service::NeedsDebugEvents()) { |
+ StartIsolateScope start_isolate(isolate()); |
+ StackZone zone(I); |
+ HandleScope handle_scope(I); |
+ ServiceEvent pause_event(isolate(), ServiceEvent::kPauseExit); |
+ Service::HandleEvent(&pause_event); |
+ } |
} |