| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 ASSERT(!isolate_lib.IsNull()); | 54 ASSERT(!isolate_lib.IsNull()); |
| 55 const String& class_name = | 55 const String& class_name = |
| 56 String::Handle(isolate_lib.PrivateName(Symbols::_ReceivePortImpl())); | 56 String::Handle(isolate_lib.PrivateName(Symbols::_ReceivePortImpl())); |
| 57 const String& function_name = | 57 const String& function_name = |
| 58 String::Handle(isolate_lib.PrivateName(Symbols::_get_or_create())); | 58 String::Handle(isolate_lib.PrivateName(Symbols::_get_or_create())); |
| 59 func = Resolver::ResolveStatic(isolate_lib, | 59 func = Resolver::ResolveStatic(isolate_lib, |
| 60 class_name, | 60 class_name, |
| 61 function_name, | 61 function_name, |
| 62 kNumArguments, | 62 kNumArguments, |
| 63 Object::empty_array(), | 63 Object::empty_array(), |
| 64 Resolver::kIsQualified, | 64 Resolver::kIsQualified); |
| 65 NULL); // No ambiguity error expected. | |
| 66 ASSERT(!func.IsNull()); | 65 ASSERT(!func.IsNull()); |
| 67 isolate->object_store()->set_receive_port_create_function(func); | 66 isolate->object_store()->set_receive_port_create_function(func); |
| 68 } | 67 } |
| 69 const Array& args = Array::Handle(isolate, Array::New(kNumArguments)); | 68 const Array& args = Array::Handle(isolate, Array::New(kNumArguments)); |
| 70 args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id))); | 69 args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id))); |
| 71 const Object& result = | 70 const Object& result = |
| 72 Object::Handle(isolate, DartEntry::InvokeFunction(func, args)); | 71 Object::Handle(isolate, DartEntry::InvokeFunction(func, args)); |
| 73 if (!result.IsError()) { | 72 if (!result.IsError()) { |
| 74 PortMap::SetLive(port_id); | 73 PortMap::SetLive(port_id); |
| 75 } | 74 } |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 | 295 |
| 297 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { | 296 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { |
| 298 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); | 297 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); |
| 299 if (port.IsError()) { | 298 if (port.IsError()) { |
| 300 Exceptions::PropagateError(Error::Cast(port)); | 299 Exceptions::PropagateError(Error::Cast(port)); |
| 301 } | 300 } |
| 302 return port.raw(); | 301 return port.raw(); |
| 303 } | 302 } |
| 304 | 303 |
| 305 } // namespace dart | 304 } // namespace dart |
| OLD | NEW |