Index: runtime/vm/isolate.cc |
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc |
index e526d446cd92f969cac4a13e20dfe512b22b9a70..40159cf9d80a7ddcdc6b3e1e0f3850e803d53236 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); |
+ } |
} |