Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Side by Side Diff: runtime/lib/vmservice.cc

Issue 2567193002: Added method to IsolateVisitor to check for special isolates (i.e., service / vm isolates) since th… (Closed)
Patch Set: Changed name of IsSpecialIsolate to IsVMInternalIsolate Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/isolate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "vm/dart_api_impl.h" 6 #include "vm/dart_api_impl.h"
7 #include "vm/datastream.h" 7 #include "vm/datastream.h"
8 #include "vm/exceptions.h" 8 #include "vm/exceptions.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // Get function. 44 // Get function.
45 const String& function_name = 45 const String& function_name =
46 String::Handle(String::New("_registerIsolate")); 46 String::Handle(String::New("_registerIsolate"));
47 ASSERT(!function_name.IsNull()); 47 ASSERT(!function_name.IsNull());
48 register_function_ = library.LookupFunctionAllowPrivate(function_name); 48 register_function_ = library.LookupFunctionAllowPrivate(function_name);
49 ASSERT(!register_function_.IsNull()); 49 ASSERT(!register_function_.IsNull());
50 } 50 }
51 51
52 virtual void VisitIsolate(Isolate* isolate) { 52 virtual void VisitIsolate(Isolate* isolate) {
53 ASSERT(ServiceIsolate::IsServiceIsolate(Isolate::Current())); 53 ASSERT(ServiceIsolate::IsServiceIsolate(Isolate::Current()));
54 if (ServiceIsolate::IsServiceIsolateDescendant(isolate) || 54 if (IsVMInternalIsolate(isolate)) {
55 (isolate == Dart::vm_isolate())) {
56 // We do not register the service (and descendants) or the vm-isolate. 55 // We do not register the service (and descendants) or the vm-isolate.
57 return; 56 return;
58 } 57 }
59 // Setup arguments for call. 58 // Setup arguments for call.
60 Dart_Port port_id = isolate->main_port(); 59 Dart_Port port_id = isolate->main_port();
61 const Integer& port_int = Integer::Handle(Integer::New(port_id)); 60 const Integer& port_int = Integer::Handle(Integer::New(port_id));
62 ASSERT(!port_int.IsNull()); 61 ASSERT(!port_int.IsNull());
63 const SendPort& send_port = SendPort::Handle(SendPort::New(port_id)); 62 const SendPort& send_port = SendPort::Handle(SendPort::New(port_id));
64 const String& name = String::Handle(String::New(isolate->name())); 63 const String& name = String::Handle(String::New(isolate->name()));
65 ASSERT(!name.IsNull()); 64 ASSERT(!name.IsNull());
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 ServiceEvent spawn_event(NULL, ServiceEvent::kIsolateSpawn); 465 ServiceEvent spawn_event(NULL, ServiceEvent::kIsolateSpawn);
467 spawn_event.set_spawn_token(&token); 466 spawn_event.set_spawn_token(&token);
468 spawn_event.set_spawn_error(&String::Cast(result)); 467 spawn_event.set_spawn_error(&String::Cast(result));
469 Service::HandleEvent(&spawn_event); 468 Service::HandleEvent(&spawn_event);
470 } 469 }
471 #endif // PRODUCT 470 #endif // PRODUCT
472 return Object::null(); 471 return Object::null();
473 } 472 }
474 473
475 } // namespace dart 474 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698