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 (Dart::snapshot_kind() == Snapshot::kAppAOT) { | 343 if (Snapshot::IncludesCode(Dart::snapshot_kind())) { |
344 const Array& args = Array::Handle(Array::New(1)); | 344 const Array& args = Array::Handle(Array::New(1)); |
345 args.SetAt( | 345 args.SetAt(0, String::Handle(String::New( |
346 0, String::Handle(String::New( | 346 "Isolate.spawnUri not supported under precompilation"))); |
347 "Isolate.spawnUri not supported when using AOT compilation"))); | |
348 Exceptions::ThrowByType(Exceptions::kUnsupported, args); | 347 Exceptions::ThrowByType(Exceptions::kUnsupported, args); |
349 UNREACHABLE(); | 348 UNREACHABLE(); |
350 } | 349 } |
351 | 350 |
352 // Canonicalize the uri with respect to the current isolate. | 351 // Canonicalize the uri with respect to the current isolate. |
353 const Library& root_lib = | 352 const Library& root_lib = |
354 Library::Handle(isolate->object_store()->root_library()); | 353 Library::Handle(isolate->object_store()->root_library()); |
355 char* error = NULL; | 354 char* error = NULL; |
356 const char* canonical_uri = CanonicalizeUri(thread, root_lib, uri, &error); | 355 const char* canonical_uri = CanonicalizeUri(thread, root_lib, uri, &error); |
357 if (canonical_uri == NULL) { | 356 if (canonical_uri == NULL) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 uint8_t* data = NULL; | 433 uint8_t* data = NULL; |
435 MessageWriter writer(&data, &malloc_allocator, &malloc_deallocator, false); | 434 MessageWriter writer(&data, &malloc_allocator, &malloc_deallocator, false); |
436 writer.WriteMessage(msg); | 435 writer.WriteMessage(msg); |
437 | 436 |
438 PortMap::PostMessage(new Message(port.Id(), data, writer.BytesWritten(), | 437 PortMap::PostMessage(new Message(port.Id(), data, writer.BytesWritten(), |
439 Message::kOOBPriority)); | 438 Message::kOOBPriority)); |
440 return Object::null(); | 439 return Object::null(); |
441 } | 440 } |
442 | 441 |
443 } // namespace dart | 442 } // namespace dart |
OLD | NEW |