Index: runtime/lib/timeline.cc |
diff --git a/runtime/lib/timeline.cc b/runtime/lib/timeline.cc |
index 3d307da94b44cd9b7f9176d57f2c027e85a30bfb..51319d7de03e867460f73383a30d611a4389837c 100644 |
--- a/runtime/lib/timeline.cc |
+++ b/runtime/lib/timeline.cc |
@@ -23,6 +23,9 @@ DEFINE_NATIVE_ENTRY(Timeline_getIsolateNum, 0) { |
DEFINE_NATIVE_ENTRY(Timeline_getNextAsyncId, 0) { |
+ if (!FLAG_support_timeline) { |
+ return Integer::New(0); |
+ } |
TimelineEventRecorder* recorder = Timeline::recorder(); |
if (recorder == NULL) { |
return Integer::New(0); |
@@ -37,6 +40,9 @@ DEFINE_NATIVE_ENTRY(Timeline_getTraceClock, 0) { |
DEFINE_NATIVE_ENTRY(Timeline_reportTaskEvent, 6) { |
+ if (!FLAG_support_timeline) { |
+ return Object::null(); |
+ } |
GET_NON_NULL_NATIVE_ARGUMENT(Integer, start, arguments->NativeArgAt(0)); |
GET_NON_NULL_NATIVE_ARGUMENT(Integer, id, arguments->NativeArgAt(1)); |
GET_NON_NULL_NATIVE_ARGUMENT(String, phase, arguments->NativeArgAt(2)); |
@@ -100,6 +106,9 @@ DEFINE_NATIVE_ENTRY(Timeline_reportTaskEvent, 6) { |
DEFINE_NATIVE_ENTRY(Timeline_reportCompleteEvent, 5) { |
+ if (!FLAG_support_timeline) { |
+ return Object::null(); |
+ } |
GET_NON_NULL_NATIVE_ARGUMENT(Integer, start, arguments->NativeArgAt(0)); |
GET_NON_NULL_NATIVE_ARGUMENT(Integer, end, arguments->NativeArgAt(1)); |
GET_NON_NULL_NATIVE_ARGUMENT(String, category, arguments->NativeArgAt(2)); |
@@ -143,6 +152,9 @@ DEFINE_NATIVE_ENTRY(Timeline_reportCompleteEvent, 5) { |
DEFINE_NATIVE_ENTRY(Timeline_reportInstantEvent, 4) { |
+ if (!FLAG_support_timeline) { |
+ return Object::null(); |
+ } |
GET_NON_NULL_NATIVE_ARGUMENT(Integer, start, arguments->NativeArgAt(0)); |
GET_NON_NULL_NATIVE_ARGUMENT(String, category, arguments->NativeArgAt(1)); |
GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(2)); |