OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "platform/assert.h" | 5 #include "platform/assert.h" |
6 #include "vm/bootstrap_natives.h" | 6 #include "vm/bootstrap_natives.h" |
7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
8 #include "vm/dart.h" | 8 #include "vm/dart.h" |
9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 Function& func = | 33 Function& func = |
34 Function::Handle(isolate, | 34 Function::Handle(isolate, |
35 isolate->object_store()->receive_port_create_function()); | 35 isolate->object_store()->receive_port_create_function()); |
36 const int kNumArguments = 1; | 36 const int kNumArguments = 1; |
37 if (func.IsNull()) { | 37 if (func.IsNull()) { |
38 Library& isolate_lib = Library::Handle(Library::IsolateLibrary()); | 38 Library& isolate_lib = Library::Handle(Library::IsolateLibrary()); |
39 ASSERT(!isolate_lib.IsNull()); | 39 ASSERT(!isolate_lib.IsNull()); |
40 const String& class_name = | 40 const String& class_name = |
41 String::Handle(isolate_lib.PrivateName(Symbols::_RawReceivePortImpl())); | 41 String::Handle(isolate_lib.PrivateName(Symbols::_RawReceivePortImpl())); |
42 const String& function_name = | 42 const String& function_name = |
43 String::Handle(isolate_lib.PrivateName(Symbols::_get_or_create())); | 43 String::Handle(isolate_lib.PrivateName(Symbols::_create())); |
44 func = Resolver::ResolveStatic(isolate_lib, | 44 func = Resolver::ResolveStatic(isolate_lib, |
45 class_name, | 45 class_name, |
46 function_name, | 46 function_name, |
47 kNumArguments, | 47 kNumArguments, |
48 Object::empty_array()); | 48 Object::empty_array()); |
49 ASSERT(!func.IsNull()); | 49 ASSERT(!func.IsNull()); |
50 isolate->object_store()->set_receive_port_create_function(func); | 50 isolate->object_store()->set_receive_port_create_function(func); |
51 } | 51 } |
52 const Array& args = Array::Handle(isolate, Array::New(kNumArguments)); | 52 const Array& args = Array::Handle(isolate, Array::New(kNumArguments)); |
53 args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id))); | 53 args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id))); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 244 |
245 // The control port is being accessed as a regular port from Dart code. This | 245 // The control port is being accessed as a regular port from Dart code. This |
246 // is most likely due to the _startIsolate code in dart:isolate. Account for | 246 // is most likely due to the _startIsolate code in dart:isolate. Account for |
247 // this by increasing the number of open control ports. | 247 // this by increasing the number of open control ports. |
248 isolate->message_handler()->increment_control_ports(); | 248 isolate->message_handler()->increment_control_ports(); |
249 | 249 |
250 return port.raw(); | 250 return port.raw(); |
251 } | 251 } |
252 | 252 |
253 } // namespace dart | 253 } // namespace dart |
OLD | NEW |