OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
8 | 8 |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
11 #include "vm/compiler.h" | 11 #include "vm/compiler.h" |
12 #include "vm/dart.h" | 12 #include "vm/dart.h" |
13 #include "vm/dart_api_impl.h" | 13 #include "vm/dart_api_impl.h" |
14 #include "vm/dart_api_message.h" | 14 #include "vm/dart_api_message.h" |
15 #include "vm/dart_api_state.h" | 15 #include "vm/dart_api_state.h" |
16 #include "vm/dart_entry.h" | 16 #include "vm/dart_entry.h" |
17 #include "vm/debugger.h" | 17 #include "vm/debugger.h" |
18 #include "vm/debuginfo.h" | 18 #include "vm/debuginfo.h" |
19 #include "vm/exceptions.h" | 19 #include "vm/exceptions.h" |
20 #include "vm/flags.h" | 20 #include "vm/flags.h" |
21 #include "vm/growable_array.h" | 21 #include "vm/growable_array.h" |
22 #include "vm/lockers.h" | 22 #include "vm/lockers.h" |
23 #include "vm/message.h" | 23 #include "vm/message.h" |
24 #include "vm/message_handler.h" | 24 #include "vm/message_handler.h" |
25 #include "vm/native_entry.h" | 25 #include "vm/native_entry.h" |
26 #include "vm/object.h" | 26 #include "vm/object.h" |
27 #include "vm/object_store.h" | 27 #include "vm/object_store.h" |
28 #include "vm/os_thread.h" | 28 #include "vm/os_thread.h" |
| 29 #include "vm/os.h" |
29 #include "vm/port.h" | 30 #include "vm/port.h" |
30 #include "vm/precompiler.h" | 31 #include "vm/precompiler.h" |
31 #include "vm/profiler.h" | 32 #include "vm/profiler.h" |
32 #include "vm/resolver.h" | 33 #include "vm/resolver.h" |
33 #include "vm/reusable_handles.h" | 34 #include "vm/reusable_handles.h" |
34 #include "vm/service_event.h" | 35 #include "vm/service_event.h" |
35 #include "vm/service_isolate.h" | 36 #include "vm/service_isolate.h" |
36 #include "vm/service.h" | 37 #include "vm/service.h" |
37 #include "vm/stack_frame.h" | 38 #include "vm/stack_frame.h" |
38 #include "vm/symbols.h" | 39 #include "vm/symbols.h" |
(...skipping 5621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5660 if (bytes_length < 0) { | 5661 if (bytes_length < 0) { |
5661 return Api::NewError("%s expects argument 'bytes_length' to be >= 0.", | 5662 return Api::NewError("%s expects argument 'bytes_length' to be >= 0.", |
5662 CURRENT_FUNC); | 5663 CURRENT_FUNC); |
5663 } | 5664 } |
5664 Service::SendEmbedderEvent(I, stream_id, event_kind, | 5665 Service::SendEmbedderEvent(I, stream_id, event_kind, |
5665 bytes, bytes_length); | 5666 bytes, bytes_length); |
5666 return Api::Success(); | 5667 return Api::Success(); |
5667 } | 5668 } |
5668 | 5669 |
5669 | 5670 |
| 5671 DART_EXPORT int64_t Dart_TimelineGetMicros() { |
| 5672 return OS::GetCurrentTraceMicros(); |
| 5673 } |
| 5674 |
| 5675 |
5670 DART_EXPORT void Dart_TimelineSetRecordedStreams(int64_t stream_mask) { | 5676 DART_EXPORT void Dart_TimelineSetRecordedStreams(int64_t stream_mask) { |
5671 Isolate* isolate = Isolate::Current(); | 5677 Isolate* isolate = Isolate::Current(); |
5672 CHECK_ISOLATE(isolate); | 5678 CHECK_ISOLATE(isolate); |
5673 isolate->GetAPIStream()->set_enabled( | 5679 isolate->GetAPIStream()->set_enabled( |
5674 (stream_mask & DART_TIMELINE_STREAM_API) != 0); | 5680 (stream_mask & DART_TIMELINE_STREAM_API) != 0); |
5675 isolate->GetCompilerStream()->set_enabled( | 5681 isolate->GetCompilerStream()->set_enabled( |
5676 (stream_mask & DART_TIMELINE_STREAM_COMPILER) != 0); | 5682 (stream_mask & DART_TIMELINE_STREAM_COMPILER) != 0); |
5677 isolate->GetEmbedderStream()->set_enabled( | 5683 isolate->GetEmbedderStream()->set_enabled( |
5678 (stream_mask & DART_TIMELINE_STREAM_EMBEDDER) != 0); | 5684 (stream_mask & DART_TIMELINE_STREAM_EMBEDDER) != 0); |
5679 isolate->GetGCStream()->set_enabled( | 5685 isolate->GetGCStream()->set_enabled( |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5998 ApiReallocate); | 6004 ApiReallocate); |
5999 writer.WriteFullSnapshot(); | 6005 writer.WriteFullSnapshot(); |
6000 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize(); | 6006 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize(); |
6001 *isolate_snapshot_size = writer.IsolateSnapshotSize(); | 6007 *isolate_snapshot_size = writer.IsolateSnapshotSize(); |
6002 *instructions_snapshot_size = writer.InstructionsSnapshotSize(); | 6008 *instructions_snapshot_size = writer.InstructionsSnapshotSize(); |
6003 | 6009 |
6004 return Api::Success(); | 6010 return Api::Success(); |
6005 } | 6011 } |
6006 | 6012 |
6007 } // namespace dart | 6013 } // namespace dart |
OLD | NEW |