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 "include/dart_native_api.h" | 5 #include "include/dart_native_api.h" |
6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
7 #include "vm/bootstrap_natives.h" | 7 #include "vm/bootstrap_natives.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/dart.h" | 9 #include "vm/dart.h" |
10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 GET_NATIVE_ARGUMENT(SendPort, onError, arguments->NativeArgAt(6)); | 333 GET_NATIVE_ARGUMENT(SendPort, onError, arguments->NativeArgAt(6)); |
334 | 334 |
335 GET_NATIVE_ARGUMENT(Bool, fatalErrors, arguments->NativeArgAt(7)); | 335 GET_NATIVE_ARGUMENT(Bool, fatalErrors, arguments->NativeArgAt(7)); |
336 GET_NATIVE_ARGUMENT(Bool, checked, arguments->NativeArgAt(8)); | 336 GET_NATIVE_ARGUMENT(Bool, checked, arguments->NativeArgAt(8)); |
337 | 337 |
338 GET_NATIVE_ARGUMENT(Array, environment, arguments->NativeArgAt(9)); | 338 GET_NATIVE_ARGUMENT(Array, environment, arguments->NativeArgAt(9)); |
339 | 339 |
340 GET_NATIVE_ARGUMENT(String, packageRoot, arguments->NativeArgAt(10)); | 340 GET_NATIVE_ARGUMENT(String, packageRoot, arguments->NativeArgAt(10)); |
341 GET_NATIVE_ARGUMENT(String, packageConfig, arguments->NativeArgAt(11)); | 341 GET_NATIVE_ARGUMENT(String, packageConfig, arguments->NativeArgAt(11)); |
342 | 342 |
343 if (Snapshot::IncludesCode(Dart::snapshot_kind())) { | 343 if (Dart::snapshot_kind() == Snapshot::kAppAOT) { |
344 const Array& args = Array::Handle(Array::New(1)); | 344 const Array& args = Array::Handle(Array::New(1)); |
345 args.SetAt(0, String::Handle(String::New( | 345 args.SetAt( |
346 "Isolate.spawnUri not supported under precompilation"))); | 346 0, String::Handle(String::New( |
| 347 "Isolate.spawnUri not supported when using AOT compilation"))); |
347 Exceptions::ThrowByType(Exceptions::kUnsupported, args); | 348 Exceptions::ThrowByType(Exceptions::kUnsupported, args); |
348 UNREACHABLE(); | 349 UNREACHABLE(); |
349 } | 350 } |
350 | 351 |
351 // Canonicalize the uri with respect to the current isolate. | 352 // Canonicalize the uri with respect to the current isolate. |
352 const Library& root_lib = | 353 const Library& root_lib = |
353 Library::Handle(isolate->object_store()->root_library()); | 354 Library::Handle(isolate->object_store()->root_library()); |
354 char* error = NULL; | 355 char* error = NULL; |
355 const char* canonical_uri = CanonicalizeUri(thread, root_lib, uri, &error); | 356 const char* canonical_uri = CanonicalizeUri(thread, root_lib, uri, &error); |
356 if (canonical_uri == NULL) { | 357 if (canonical_uri == NULL) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 uint8_t* data = NULL; | 434 uint8_t* data = NULL; |
434 MessageWriter writer(&data, &malloc_allocator, &malloc_deallocator, false); | 435 MessageWriter writer(&data, &malloc_allocator, &malloc_deallocator, false); |
435 writer.WriteMessage(msg); | 436 writer.WriteMessage(msg); |
436 | 437 |
437 PortMap::PostMessage(new Message(port.Id(), data, writer.BytesWritten(), | 438 PortMap::PostMessage(new Message(port.Id(), data, writer.BytesWritten(), |
438 Message::kOOBPriority)); | 439 Message::kOOBPriority)); |
439 return Object::null(); | 440 return Object::null(); |
440 } | 441 } |
441 | 442 |
442 } // namespace dart | 443 } // namespace dart |
OLD | NEW |