| 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 "lib/mirrors.h" | 5 #include "lib/mirrors.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/bootstrap_natives.h" | 8 #include "vm/bootstrap_natives.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 str = lib.url(); | 350 str = lib.url(); |
| 351 const char* censored_libraries[] = { | 351 const char* censored_libraries[] = { |
| 352 "dart:_builtin", "dart:_blink", "dart:_vmservice", NULL, | 352 "dart:_builtin", "dart:_blink", "dart:_vmservice", NULL, |
| 353 }; | 353 }; |
| 354 for (intptr_t i = 0; censored_libraries[i] != NULL; i++) { | 354 for (intptr_t i = 0; censored_libraries[i] != NULL; i++) { |
| 355 if (str.Equals(censored_libraries[i])) { | 355 if (str.Equals(censored_libraries[i])) { |
| 356 // Censored library (grumble). | 356 // Censored library (grumble). |
| 357 return Instance::null(); | 357 return Instance::null(); |
| 358 } | 358 } |
| 359 } | 359 } |
| 360 if (str.Equals("dart:io")) { | |
| 361 // Hack around dart:io being loaded into non-service isolates in Dartium. | |
| 362 Isolate* isolate = thread->isolate(); | |
| 363 const GrowableObjectArray& libraries = | |
| 364 GrowableObjectArray::Handle(zone, isolate->object_store()->libraries()); | |
| 365 Library& other_lib = Library::Handle(zone); | |
| 366 String& other_uri = String::Handle(zone); | |
| 367 for (intptr_t i = 0; i < libraries.Length(); i++) { | |
| 368 other_lib ^= libraries.At(i); | |
| 369 other_uri = other_lib.url(); | |
| 370 if (other_uri.Equals("dart:html")) { | |
| 371 return Instance::null(); | |
| 372 } | |
| 373 } | |
| 374 } | |
| 375 args.SetAt(2, str); | 360 args.SetAt(2, str); |
| 376 return CreateMirror(Symbols::_LocalLibraryMirror(), args); | 361 return CreateMirror(Symbols::_LocalLibraryMirror(), args); |
| 377 } | 362 } |
| 378 | 363 |
| 379 static RawInstance* CreateCombinatorMirror(const Object& identifiers, | 364 static RawInstance* CreateCombinatorMirror(const Object& identifiers, |
| 380 bool is_show) { | 365 bool is_show) { |
| 381 const Array& args = Array::Handle(Array::New(2)); | 366 const Array& args = Array::Handle(Array::New(2)); |
| 382 args.SetAt(0, identifiers); | 367 args.SetAt(0, identifiers); |
| 383 args.SetAt(1, Bool::Get(is_show)); | 368 args.SetAt(1, Bool::Get(is_show)); |
| 384 return CreateMirror(Symbols::_LocalCombinatorMirror(), args); | 369 return CreateMirror(Symbols::_LocalCombinatorMirror(), args); |
| (...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2042 | 2027 |
| 2043 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { | 2028 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { |
| 2044 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); | 2029 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
| 2045 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); | 2030 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
| 2046 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); | 2031 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); |
| 2047 } | 2032 } |
| 2048 | 2033 |
| 2049 #endif // !DART_PRECOMPILED_RUNTIME | 2034 #endif // !DART_PRECOMPILED_RUNTIME |
| 2050 | 2035 |
| 2051 } // namespace dart | 2036 } // namespace dart |
| OLD | NEW |