| 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. |
| 65 ASSERT(!func.IsNull()); | 66 ASSERT(!func.IsNull()); |
| 66 isolate->object_store()->set_receive_port_create_function(func); | 67 isolate->object_store()->set_receive_port_create_function(func); |
| 67 } | 68 } |
| 68 const Array& args = Array::Handle(isolate, Array::New(kNumArguments)); | 69 const Array& args = Array::Handle(isolate, Array::New(kNumArguments)); |
| 69 args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id))); | 70 args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id))); |
| 70 const Object& result = | 71 const Object& result = |
| 71 Object::Handle(isolate, DartEntry::InvokeFunction(func, args)); | 72 Object::Handle(isolate, DartEntry::InvokeFunction(func, args)); |
| 72 if (!result.IsError()) { | 73 if (!result.IsError()) { |
| 73 PortMap::SetLive(port_id); | 74 PortMap::SetLive(port_id); |
| 74 } | 75 } |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 | 296 |
| 296 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { | 297 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { |
| 297 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); | 298 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); |
| 298 if (port.IsError()) { | 299 if (port.IsError()) { |
| 299 Exceptions::PropagateError(Error::Cast(port)); | 300 Exceptions::PropagateError(Error::Cast(port)); |
| 300 } | 301 } |
| 301 return port.raw(); | 302 return port.raw(); |
| 302 } | 303 } |
| 303 | 304 |
| 304 } // namespace dart | 305 } // namespace dart |
| OLD | NEW |