OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/bootstrap_natives.h" | 5 #include "vm/bootstrap_natives.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 | 8 |
9 #include "vm/native_entry.h" | 9 #include "vm/native_entry.h" |
10 #include "vm/object.h" | 10 #include "vm/object.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 DEFINE_NATIVE_ENTRY(Timeline_getNextAsyncId, 0) { | 25 DEFINE_NATIVE_ENTRY(Timeline_getNextAsyncId, 0) { |
26 TimelineEventRecorder* recorder = Timeline::recorder(); | 26 TimelineEventRecorder* recorder = Timeline::recorder(); |
27 if (recorder == NULL) { | 27 if (recorder == NULL) { |
28 return Integer::New(0); | 28 return Integer::New(0); |
29 } | 29 } |
30 return Integer::New(recorder->GetNextAsyncId()); | 30 return Integer::New(recorder->GetNextAsyncId()); |
31 } | 31 } |
32 | 32 |
33 | 33 |
34 DEFINE_NATIVE_ENTRY(Timeline_getTraceClock, 0) { | 34 DEFINE_NATIVE_ENTRY(Timeline_getTraceClock, 0) { |
35 return Integer::New(OS::GetCurrentTraceMicros(), Heap::kNew, true); | 35 return Integer::New(OS::GetCurrentMonotonicMicros(), Heap::kNew, true); |
36 } | 36 } |
37 | 37 |
38 | 38 |
39 DEFINE_NATIVE_ENTRY(Timeline_reportTaskEvent, 6) { | 39 DEFINE_NATIVE_ENTRY(Timeline_reportTaskEvent, 6) { |
40 GET_NON_NULL_NATIVE_ARGUMENT(Integer, start, arguments->NativeArgAt(0)); | 40 GET_NON_NULL_NATIVE_ARGUMENT(Integer, start, arguments->NativeArgAt(0)); |
41 GET_NON_NULL_NATIVE_ARGUMENT(Integer, id, arguments->NativeArgAt(1)); | 41 GET_NON_NULL_NATIVE_ARGUMENT(Integer, id, arguments->NativeArgAt(1)); |
42 GET_NON_NULL_NATIVE_ARGUMENT(String, phase, arguments->NativeArgAt(2)); | 42 GET_NON_NULL_NATIVE_ARGUMENT(String, phase, arguments->NativeArgAt(2)); |
43 GET_NON_NULL_NATIVE_ARGUMENT(String, category, arguments->NativeArgAt(3)); | 43 GET_NON_NULL_NATIVE_ARGUMENT(String, category, arguments->NativeArgAt(3)); |
44 GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(4)); | 44 GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(4)); |
45 GET_NON_NULL_NATIVE_ARGUMENT(String, args, arguments->NativeArgAt(5)); | 45 GET_NON_NULL_NATIVE_ARGUMENT(String, args, arguments->NativeArgAt(5)); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 return Object::null(); | 168 return Object::null(); |
169 } | 169 } |
170 // json was allocated in the zone and a copy will be stored in event. | 170 // json was allocated in the zone and a copy will be stored in event. |
171 event->SerializedJSON(json); | 171 event->SerializedJSON(json); |
172 event->Complete(); | 172 event->Complete(); |
173 | 173 |
174 return Object::null(); | 174 return Object::null(); |
175 } | 175 } |
176 | 176 |
177 } // namespace dart | 177 } // namespace dart |
OLD | NEW |