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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 function_name, | 67 function_name, |
68 kNumArguments, | 68 kNumArguments, |
69 Object::empty_array(), | 69 Object::empty_array(), |
70 Resolver::kIsQualified); | 70 Resolver::kIsQualified); |
71 ASSERT(!func.IsNull()); | 71 ASSERT(!func.IsNull()); |
72 isolate->object_store()->set_receive_port_create_function(func); | 72 isolate->object_store()->set_receive_port_create_function(func); |
73 } | 73 } |
74 const Array& args = Array::Handle(isolate, Array::New(kNumArguments)); | 74 const Array& args = Array::Handle(isolate, Array::New(kNumArguments)); |
75 args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id))); | 75 args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id))); |
76 const Object& result = | 76 const Object& result = |
77 Object::Handle(isolate, DartEntry::InvokeStatic(func, args)); | 77 Object::Handle(isolate, DartEntry::InvokeFunction(func, args)); |
78 if (!result.IsError()) { | 78 if (!result.IsError()) { |
79 PortMap::SetLive(port_id); | 79 PortMap::SetLive(port_id); |
80 } | 80 } |
81 return result.raw(); | 81 return result.raw(); |
82 } | 82 } |
83 | 83 |
84 | 84 |
85 static void ShutdownIsolate(uword parameter) { | 85 static void ShutdownIsolate(uword parameter) { |
86 Isolate* isolate = reinterpret_cast<Isolate*>(parameter); | 86 Isolate* isolate = reinterpret_cast<Isolate*>(parameter); |
87 { | 87 { |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 result = state->ResolveFunction(); | 367 result = state->ResolveFunction(); |
368 delete state; | 368 delete state; |
369 state = NULL; | 369 state = NULL; |
370 if (result.IsError()) { | 370 if (result.IsError()) { |
371 StoreError(isolate, result); | 371 StoreError(isolate, result); |
372 return false; | 372 return false; |
373 } | 373 } |
374 ASSERT(result.IsFunction()); | 374 ASSERT(result.IsFunction()); |
375 Function& func = Function::Handle(isolate); | 375 Function& func = Function::Handle(isolate); |
376 func ^= result.raw(); | 376 func ^= result.raw(); |
377 result = DartEntry::InvokeStatic(func, Object::empty_array()); | 377 result = DartEntry::InvokeFunction(func, Object::empty_array()); |
378 if (result.IsError()) { | 378 if (result.IsError()) { |
379 StoreError(isolate, result); | 379 StoreError(isolate, result); |
380 return false; | 380 return false; |
381 } | 381 } |
382 } | 382 } |
383 return true; | 383 return true; |
384 } | 384 } |
385 | 385 |
386 | 386 |
387 static RawObject* Spawn(NativeArguments* arguments, SpawnState* state) { | 387 static RawObject* Spawn(NativeArguments* arguments, SpawnState* state) { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 | 486 |
487 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { | 487 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { |
488 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); | 488 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); |
489 if (port.IsError()) { | 489 if (port.IsError()) { |
490 Exceptions::PropagateError(Error::Cast(port)); | 490 Exceptions::PropagateError(Error::Cast(port)); |
491 } | 491 } |
492 return port.raw(); | 492 return port.raw(); |
493 } | 493 } |
494 | 494 |
495 } // namespace dart | 495 } // namespace dart |
OLD | NEW |