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/service_isolate.h" | 5 #include "vm/service_isolate.h" |
6 | 6 |
7 #include "vm/compiler.h" | 7 #include "vm/compiler.h" |
8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 static void SendRootServiceMessage(Dart_NativeArguments args) { | 244 static void SendRootServiceMessage(Dart_NativeArguments args) { |
245 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 245 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
246 Isolate* isolate = arguments->isolate(); | 246 Isolate* isolate = arguments->isolate(); |
247 StackZone stack_zone(isolate); | 247 StackZone stack_zone(isolate); |
248 Zone* zone = stack_zone.GetZone(); // Used by GET_NON_NULL_NATIVE_ARGUMENT. | 248 Zone* zone = stack_zone.GetZone(); // Used by GET_NON_NULL_NATIVE_ARGUMENT. |
249 HANDLESCOPE(isolate); | 249 HANDLESCOPE(isolate); |
250 GET_NON_NULL_NATIVE_ARGUMENT(Array, message, arguments->NativeArgAt(0)); | 250 GET_NON_NULL_NATIVE_ARGUMENT(Array, message, arguments->NativeArgAt(0)); |
251 Service::HandleRootMessage(message); | 251 Service::HandleRootMessage(message); |
252 } | 252 } |
253 | 253 |
254 static void SetEventMask(Dart_NativeArguments args) { | |
255 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | |
256 Isolate* isolate = arguments->isolate(); | |
257 StackZone stack_zone(isolate); | |
258 Zone* zone = stack_zone.GetZone(); // Used by GET_NON_NULL_NATIVE_ARGUMENT. | |
259 HANDLESCOPE(isolate); | |
260 GET_NON_NULL_NATIVE_ARGUMENT(Integer, mask, arguments->NativeArgAt(0)); | |
261 Service::SetEventMask(mask.AsTruncatedUint32Value()); | |
262 } | |
263 | |
264 static void OnStart(Dart_NativeArguments args) { | 254 static void OnStart(Dart_NativeArguments args) { |
265 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 255 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
266 Isolate* isolate = arguments->isolate(); | 256 Isolate* isolate = arguments->isolate(); |
267 StackZone zone(isolate); | 257 StackZone zone(isolate); |
268 HANDLESCOPE(isolate); | 258 HANDLESCOPE(isolate); |
269 { | 259 { |
270 if (FLAG_trace_service) { | 260 if (FLAG_trace_service) { |
271 OS::Print("vm-service: Booting dart:vmservice library.\n"); | 261 OS::Print("vm-service: Booting dart:vmservice library.\n"); |
272 } | 262 } |
273 // Boot the dart:vmservice library. | 263 // Boot the dart:vmservice library. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 int num_arguments; | 304 int num_arguments; |
315 Dart_NativeFunction function; | 305 Dart_NativeFunction function; |
316 }; | 306 }; |
317 | 307 |
318 | 308 |
319 static ServiceNativeEntry _ServiceNativeEntries[] = { | 309 static ServiceNativeEntry _ServiceNativeEntries[] = { |
320 {"VMService_SendIsolateServiceMessage", 2, | 310 {"VMService_SendIsolateServiceMessage", 2, |
321 ServiceIsolateNatives::SendIsolateServiceMessage}, | 311 ServiceIsolateNatives::SendIsolateServiceMessage}, |
322 {"VMService_SendRootServiceMessage", 1, | 312 {"VMService_SendRootServiceMessage", 1, |
323 ServiceIsolateNatives::SendRootServiceMessage}, | 313 ServiceIsolateNatives::SendRootServiceMessage}, |
324 {"VMService_SetEventMask", 1, | |
325 ServiceIsolateNatives::SetEventMask}, | |
326 {"VMService_OnStart", 0, | 314 {"VMService_OnStart", 0, |
327 ServiceIsolateNatives::OnStart }, | 315 ServiceIsolateNatives::OnStart }, |
328 {"VMService_OnExit", 0, | 316 {"VMService_OnExit", 0, |
329 ServiceIsolateNatives::OnExit }, | 317 ServiceIsolateNatives::OnExit }, |
330 }; | 318 }; |
331 | 319 |
332 | 320 |
333 static Dart_NativeFunction ServiceNativeResolver(Dart_Handle name, | 321 static Dart_NativeFunction ServiceNativeResolver(Dart_Handle name, |
334 int num_arguments, | 322 int num_arguments, |
335 bool* auto_setup_scope) { | 323 bool* auto_setup_scope) { |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 return result; | 771 return result; |
784 } | 772 } |
785 Dart_Handle source = GetSource(url_string); | 773 Dart_Handle source = GetSource(url_string); |
786 if (Dart_IsError(source)) { | 774 if (Dart_IsError(source)) { |
787 return source; | 775 return source; |
788 } | 776 } |
789 return Dart_LoadSource(library, url, source, 0, 0); | 777 return Dart_LoadSource(library, url, source, 0, 0); |
790 } | 778 } |
791 | 779 |
792 } // namespace dart | 780 } // namespace dart |
OLD | NEW |