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_native_api.h" | 5 #include "include/dart_native_api.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
9 #include "vm/dart_api_message.h" | 9 #include "vm/dart_api_message.h" |
10 #include "vm/dart_api_state.h" | 10 #include "vm/dart_api_state.h" |
11 #include "vm/message.h" | 11 #include "vm/message.h" |
12 #include "vm/native_message_handler.h" | 12 #include "vm/native_message_handler.h" |
13 #include "vm/port.h" | 13 #include "vm/port.h" |
| 14 #include "vm/thread_interrupter.h" |
14 | 15 |
15 namespace dart { | 16 namespace dart { |
16 | 17 |
17 // --- Message sending/receiving from native code --- | 18 // --- Message sending/receiving from native code --- |
18 | 19 |
19 static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) { | 20 static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) { |
20 void* new_ptr = realloc(reinterpret_cast<void*>(ptr), new_size); | 21 void* new_ptr = realloc(reinterpret_cast<void*>(ptr), new_size); |
21 return reinterpret_cast<uint8_t*>(new_ptr); | 22 return reinterpret_cast<uint8_t*>(new_ptr); |
22 } | 23 } |
23 | 24 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // pprof profiling. Then these symbols should be removed. | 75 // pprof profiling. Then these symbols should be removed. |
75 | 76 |
76 DART_EXPORT void Dart_InitPprofSupport() { } | 77 DART_EXPORT void Dart_InitPprofSupport() { } |
77 | 78 |
78 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size) { | 79 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size) { |
79 *buffer = NULL; | 80 *buffer = NULL; |
80 *buffer_size = 0; | 81 *buffer_size = 0; |
81 } | 82 } |
82 | 83 |
83 | 84 |
| 85 DART_EXPORT void Dart_ShutdownThreadInterrupter() { |
| 86 ThreadInterrupter::Shutdown(); |
| 87 } |
| 88 |
| 89 |
84 // --- Heap Profiler --- | 90 // --- Heap Profiler --- |
85 | 91 |
86 DART_EXPORT Dart_Handle Dart_HeapProfile(Dart_FileWriteCallback callback, | 92 DART_EXPORT Dart_Handle Dart_HeapProfile(Dart_FileWriteCallback callback, |
87 void* stream) { | 93 void* stream) { |
88 Isolate* isolate = Isolate::Current(); | 94 Isolate* isolate = Isolate::Current(); |
89 CHECK_ISOLATE(isolate); | 95 CHECK_ISOLATE(isolate); |
90 if (callback == NULL) { | 96 if (callback == NULL) { |
91 RETURN_NULL_ERROR(callback); | 97 RETURN_NULL_ERROR(callback); |
92 } | 98 } |
93 isolate->heap()->Profile(callback, stream); | 99 isolate->heap()->Profile(callback, stream); |
(...skipping 20 matching lines...) Expand all Loading... |
114 Dart_Handle result = Api::CheckIsolateState(isolate); | 120 Dart_Handle result = Api::CheckIsolateState(isolate); |
115 if (::Dart_IsError(result)) { | 121 if (::Dart_IsError(result)) { |
116 return result; | 122 return result; |
117 } | 123 } |
118 CHECK_CALLBACK_STATE(isolate); | 124 CHECK_CALLBACK_STATE(isolate); |
119 CompileAll(isolate, &result); | 125 CompileAll(isolate, &result); |
120 return result; | 126 return result; |
121 } | 127 } |
122 | 128 |
123 } // namespace dart | 129 } // namespace dart |
OLD | NEW |