Index: runtime/lib/developer.cc |
diff --git a/runtime/lib/developer.cc b/runtime/lib/developer.cc |
index ead1de126a4dbf794a2913358b4f6021b64186bb..e47e8effdfd5b13433a3cf72c77d4baf6e9ae9c1 100644 |
--- a/runtime/lib/developer.cc |
+++ b/runtime/lib/developer.cc |
@@ -8,6 +8,7 @@ |
#include "vm/debugger.h" |
#include "vm/exceptions.h" |
+#include "vm/flags.h" |
#include "vm/native_entry.h" |
#include "vm/object.h" |
#include "vm/object_store.h" |
@@ -21,7 +22,7 @@ DEFINE_NATIVE_ENTRY(Developer_debugger, 2) { |
GET_NON_NULL_NATIVE_ARGUMENT(Bool, when, arguments->NativeArgAt(0)); |
GET_NATIVE_ARGUMENT(String, msg, arguments->NativeArgAt(1)); |
Debugger* debugger = isolate->debugger(); |
- if (!debugger) { |
+ if (!FLAG_support_debugger || !debugger) { |
return when.raw(); |
} |
if (when.value()) { |
@@ -33,12 +34,17 @@ DEFINE_NATIVE_ENTRY(Developer_debugger, 2) { |
DEFINE_NATIVE_ENTRY(Developer_inspect, 1) { |
GET_NATIVE_ARGUMENT(Instance, inspectee, arguments->NativeArgAt(0)); |
- Service::SendInspectEvent(isolate, inspectee); |
+ if (FLAG_support_service) { |
+ Service::SendInspectEvent(isolate, inspectee); |
+ } |
return inspectee.raw(); |
} |
DEFINE_NATIVE_ENTRY(Developer_log, 8) { |
+ if (!FLAG_support_service) { |
+ return Object::null(); |
+ } |
GET_NON_NULL_NATIVE_ARGUMENT(String, message, arguments->NativeArgAt(0)); |
GET_NON_NULL_NATIVE_ARGUMENT(Integer, timestamp, arguments->NativeArgAt(1)); |
GET_NON_NULL_NATIVE_ARGUMENT(Integer, sequence, arguments->NativeArgAt(2)); |
@@ -61,6 +67,9 @@ DEFINE_NATIVE_ENTRY(Developer_log, 8) { |
DEFINE_NATIVE_ENTRY(Developer_postEvent, 2) { |
+ if (!FLAG_support_service) { |
+ return Object::null(); |
+ } |
GET_NON_NULL_NATIVE_ARGUMENT(String, event_kind, arguments->NativeArgAt(0)); |
GET_NON_NULL_NATIVE_ARGUMENT(String, event_data, arguments->NativeArgAt(1)); |
Service::SendExtensionEvent(isolate, event_kind, event_data); |
@@ -69,12 +78,18 @@ DEFINE_NATIVE_ENTRY(Developer_postEvent, 2) { |
DEFINE_NATIVE_ENTRY(Developer_lookupExtension, 1) { |
+ if (!FLAG_support_service) { |
+ return Object::null(); |
+ } |
GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(0)); |
return isolate->LookupServiceExtensionHandler(name); |
} |
DEFINE_NATIVE_ENTRY(Developer_registerExtension, 2) { |
+ if (!FLAG_support_service) { |
+ return Object::null(); |
+ } |
GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(0)); |
GET_NON_NULL_NATIVE_ARGUMENT(Instance, handler, arguments->NativeArgAt(1)); |
isolate->RegisterServiceExtensionHandler(name, handler); |