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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 static RawInstance* CreateLibraryMirror(Thread* thread, const Library& lib) { | 342 static RawInstance* CreateLibraryMirror(Thread* thread, const Library& lib) { |
343 Zone* zone = thread->zone(); | 343 Zone* zone = thread->zone(); |
344 ASSERT(!lib.IsNull()); | 344 ASSERT(!lib.IsNull()); |
345 const Array& args = Array::Handle(zone, Array::New(3)); | 345 const Array& args = Array::Handle(zone, Array::New(3)); |
346 args.SetAt(0, MirrorReference::Handle(zone, MirrorReference::New(lib))); | 346 args.SetAt(0, MirrorReference::Handle(zone, MirrorReference::New(lib))); |
347 String& str = String::Handle(zone); | 347 String& str = String::Handle(zone); |
348 str = lib.name(); | 348 str = lib.name(); |
349 args.SetAt(1, str); | 349 args.SetAt(1, str); |
350 str = lib.url(); | 350 str = lib.url(); |
351 const char* censored_libraries[] = { | 351 const char* censored_libraries[] = { |
352 "dart:_builtin", "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 args.SetAt(2, str); | 360 args.SetAt(2, str); |
361 return CreateMirror(Symbols::_LocalLibraryMirror(), args); | 361 return CreateMirror(Symbols::_LocalLibraryMirror(), args); |
362 } | 362 } |
(...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2038 | 2038 |
2039 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { | 2039 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { |
2040 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); | 2040 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
2041 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); | 2041 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
2042 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); | 2042 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); |
2043 } | 2043 } |
2044 | 2044 |
2045 #endif // !DART_PRECOMPILED_RUNTIME | 2045 #endif // !DART_PRECOMPILED_RUNTIME |
2046 | 2046 |
2047 } // namespace dart | 2047 } // namespace dart |
OLD | NEW |