| 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 GET_NATIVE_ARGUMENT(SendPort, onError, arguments->NativeArgAt(6)); | 310 GET_NATIVE_ARGUMENT(SendPort, onError, arguments->NativeArgAt(6)); |
| 311 | 311 |
| 312 GET_NATIVE_ARGUMENT(Bool, fatalErrors, arguments->NativeArgAt(7)); | 312 GET_NATIVE_ARGUMENT(Bool, fatalErrors, arguments->NativeArgAt(7)); |
| 313 GET_NATIVE_ARGUMENT(Bool, checked, arguments->NativeArgAt(8)); | 313 GET_NATIVE_ARGUMENT(Bool, checked, arguments->NativeArgAt(8)); |
| 314 | 314 |
| 315 GET_NATIVE_ARGUMENT(Array, environment, arguments->NativeArgAt(9)); | 315 GET_NATIVE_ARGUMENT(Array, environment, arguments->NativeArgAt(9)); |
| 316 | 316 |
| 317 GET_NATIVE_ARGUMENT(String, package_root, arguments->NativeArgAt(10)); | 317 GET_NATIVE_ARGUMENT(String, package_root, arguments->NativeArgAt(10)); |
| 318 GET_NATIVE_ARGUMENT(Array, packages, arguments->NativeArgAt(11)); | 318 GET_NATIVE_ARGUMENT(Array, packages, arguments->NativeArgAt(11)); |
| 319 | 319 |
| 320 if (Dart::IsRunningPrecompiledCode()) { |
| 321 const Array& args = Array::Handle(Array::New(1)); |
| 322 args.SetAt(0, String::Handle(String::New( |
| 323 "Isolate.spawnUri not supported under precompilation"))); |
| 324 Exceptions::ThrowByType(Exceptions::kUnsupported, args); |
| 325 UNREACHABLE(); |
| 326 } |
| 320 | 327 |
| 321 // Canonicalize the uri with respect to the current isolate. | 328 // Canonicalize the uri with respect to the current isolate. |
| 322 const Library& root_lib = | 329 const Library& root_lib = |
| 323 Library::Handle(isolate->object_store()->root_library()); | 330 Library::Handle(isolate->object_store()->root_library()); |
| 324 char* error = NULL; | 331 char* error = NULL; |
| 325 char* canonical_uri = CanonicalizeUri(thread, root_lib, uri, &error); | 332 char* canonical_uri = CanonicalizeUri(thread, root_lib, uri, &error); |
| 326 if (canonical_uri == NULL) { | 333 if (canonical_uri == NULL) { |
| 327 const String& msg = String::Handle(String::New(error)); | 334 const String& msg = String::Handle(String::New(error)); |
| 328 ThrowIsolateSpawnException(msg); | 335 ThrowIsolateSpawnException(msg); |
| 329 } | 336 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 MessageWriter writer(&data, &allocator, false); | 419 MessageWriter writer(&data, &allocator, false); |
| 413 writer.WriteMessage(msg); | 420 writer.WriteMessage(msg); |
| 414 | 421 |
| 415 PortMap::PostMessage(new Message(port.Id(), | 422 PortMap::PostMessage(new Message(port.Id(), |
| 416 data, writer.BytesWritten(), | 423 data, writer.BytesWritten(), |
| 417 Message::kOOBPriority)); | 424 Message::kOOBPriority)); |
| 418 return Object::null(); | 425 return Object::null(); |
| 419 } | 426 } |
| 420 | 427 |
| 421 } // namespace dart | 428 } // namespace dart |
| OLD | NEW |