OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/bootstrap_natives.h" | 5 #include "vm/bootstrap_natives.h" |
6 | 6 |
7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
9 #include "vm/exceptions.h" | 9 #include "vm/exceptions.h" |
10 #include "vm/heap.h" | 10 #include "vm/heap.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 LibraryPrefix::CheckedHandle(arguments->NativeArgAt(0)); | 371 LibraryPrefix::CheckedHandle(arguments->NativeArgAt(0)); |
372 // Currently all errors are Dart instances, e.g. I/O errors | 372 // Currently all errors are Dart instances, e.g. I/O errors |
373 // created by deferred loading code. LanguageErrors from | 373 // created by deferred loading code. LanguageErrors from |
374 // failed loading or finalization attempts are propagated and result | 374 // failed loading or finalization attempts are propagated and result |
375 // in the isolate's death. | 375 // in the isolate's death. |
376 const Instance& error = Instance::Handle(prefix.LoadError()); | 376 const Instance& error = Instance::Handle(prefix.LoadError()); |
377 return error.raw(); | 377 return error.raw(); |
378 } | 378 } |
379 | 379 |
380 | 380 |
| 381 DEFINE_NATIVE_ENTRY(LibraryPrefix_isLoaded, 1) { |
| 382 const LibraryPrefix& prefix = |
| 383 LibraryPrefix::CheckedHandle(arguments->NativeArgAt(0)); |
| 384 return Bool::Get(prefix.is_loaded()).raw(); |
| 385 } |
| 386 |
| 387 |
381 DEFINE_NATIVE_ENTRY(Internal_inquireIs64Bit, 0) { | 388 DEFINE_NATIVE_ENTRY(Internal_inquireIs64Bit, 0) { |
382 #if defined(ARCH_IS_64_BIT) | 389 #if defined(ARCH_IS_64_BIT) |
383 return Bool::True().raw(); | 390 return Bool::True().raw(); |
384 #else | 391 #else |
385 return Bool::False().raw(); | 392 return Bool::False().raw(); |
386 #endif // defined(ARCH_IS_64_BIT) | 393 #endif // defined(ARCH_IS_64_BIT) |
387 } | 394 } |
388 | 395 |
389 } // namespace dart | 396 } // namespace dart |
OLD | NEW |