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 "vm/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1204 ASSERT(lib.raw() == Library::CollectionLibrary()); | 1204 ASSERT(lib.raw() == Library::CollectionLibrary()); |
1205 | 1205 |
1206 cls = Class::New<LinkedHashMap>(); | 1206 cls = Class::New<LinkedHashMap>(); |
1207 object_store->set_linked_hash_map_class(cls); | 1207 object_store->set_linked_hash_map_class(cls); |
1208 cls.set_type_arguments_field_offset(LinkedHashMap::type_arguments_offset()); | 1208 cls.set_type_arguments_field_offset(LinkedHashMap::type_arguments_offset()); |
1209 cls.set_num_type_arguments(2); | 1209 cls.set_num_type_arguments(2); |
1210 cls.set_num_own_type_arguments(2); | 1210 cls.set_num_own_type_arguments(2); |
1211 RegisterPrivateClass(cls, Symbols::_LinkedHashMap(), lib); | 1211 RegisterPrivateClass(cls, Symbols::_LinkedHashMap(), lib); |
1212 pending_classes.Add(cls); | 1212 pending_classes.Add(cls); |
1213 | 1213 |
1214 // Pre-register the developer library so we can place the vm class | 1214 // Pre-register the profiler library so we can place the vm class |
1215 // UserTag there rather than the core library. | 1215 // UserTag there rather than the core library. |
1216 lib = Library::LookupLibrary(Symbols::DartDeveloper()); | 1216 lib = Library::LookupLibrary(Symbols::DartProfiler()); |
1217 if (lib.IsNull()) { | 1217 if (lib.IsNull()) { |
1218 lib = Library::NewLibraryHelper(Symbols::DartDeveloper(), true); | 1218 lib = Library::NewLibraryHelper(Symbols::DartProfiler(), true); |
1219 lib.SetLoadRequested(); | 1219 lib.SetLoadRequested(); |
1220 lib.Register(); | 1220 lib.Register(); |
1221 object_store->set_bootstrap_library(ObjectStore::kDeveloper, lib); | 1221 object_store->set_bootstrap_library(ObjectStore::kProfiler, lib); |
1222 } | 1222 } |
1223 ASSERT(!lib.IsNull()); | 1223 ASSERT(!lib.IsNull()); |
1224 ASSERT(lib.raw() == Library::DeveloperLibrary()); | 1224 ASSERT(lib.raw() == Library::ProfilerLibrary()); |
1225 | 1225 |
1226 lib = Library::LookupLibrary(Symbols::DartDeveloper()); | 1226 lib = Library::LookupLibrary(Symbols::DartProfiler()); |
1227 ASSERT(!lib.IsNull()); | 1227 ASSERT(!lib.IsNull()); |
1228 cls = Class::New<UserTag>(); | 1228 cls = Class::New<UserTag>(); |
1229 RegisterPrivateClass(cls, Symbols::_UserTag(), lib); | 1229 RegisterPrivateClass(cls, Symbols::_UserTag(), lib); |
1230 pending_classes.Add(cls); | 1230 pending_classes.Add(cls); |
1231 | 1231 |
1232 // Setup some default native field classes which can be extended for | 1232 // Setup some default native field classes which can be extended for |
1233 // specifying native fields in dart classes. | 1233 // specifying native fields in dart classes. |
1234 Library::InitNativeWrappersLibrary(isolate); | 1234 Library::InitNativeWrappersLibrary(isolate); |
1235 ASSERT(object_store->native_wrappers_library() != Library::null()); | 1235 ASSERT(object_store->native_wrappers_library() != Library::null()); |
1236 | 1236 |
(...skipping 8619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9856 RawLibrary* Library::MirrorsLibrary() { | 9856 RawLibrary* Library::MirrorsLibrary() { |
9857 return Isolate::Current()->object_store()->mirrors_library(); | 9857 return Isolate::Current()->object_store()->mirrors_library(); |
9858 } | 9858 } |
9859 | 9859 |
9860 | 9860 |
9861 RawLibrary* Library::NativeWrappersLibrary() { | 9861 RawLibrary* Library::NativeWrappersLibrary() { |
9862 return Isolate::Current()->object_store()->native_wrappers_library(); | 9862 return Isolate::Current()->object_store()->native_wrappers_library(); |
9863 } | 9863 } |
9864 | 9864 |
9865 | 9865 |
| 9866 RawLibrary* Library::ProfilerLibrary() { |
| 9867 return Isolate::Current()->object_store()->profiler_library(); |
| 9868 } |
| 9869 |
| 9870 |
9866 RawLibrary* Library::TypedDataLibrary() { | 9871 RawLibrary* Library::TypedDataLibrary() { |
9867 return Isolate::Current()->object_store()->typed_data_library(); | 9872 return Isolate::Current()->object_store()->typed_data_library(); |
9868 } | 9873 } |
9869 | 9874 |
9870 | 9875 |
9871 const char* Library::ToCString() const { | 9876 const char* Library::ToCString() const { |
9872 const char* kFormat = "Library:'%s'"; | 9877 const char* kFormat = "Library:'%s'"; |
9873 const String& name = String::Handle(url()); | 9878 const String& name = String::Handle(url()); |
9874 intptr_t len = OS::SNPrint(NULL, 0, kFormat, name.ToCString()) + 1; | 9879 intptr_t len = OS::SNPrint(NULL, 0, kFormat, name.ToCString()) + 1; |
9875 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 9880 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10469 CORE_INTEGER_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); | 10474 CORE_INTEGER_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); |
10470 | 10475 |
10471 all_libs.Add(&Library::ZoneHandle(Library::MathLibrary())); | 10476 all_libs.Add(&Library::ZoneHandle(Library::MathLibrary())); |
10472 all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary())); | 10477 all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary())); |
10473 OTHER_RECOGNIZED_LIST(CHECK_FINGERPRINTS); | 10478 OTHER_RECOGNIZED_LIST(CHECK_FINGERPRINTS); |
10474 INLINE_WHITE_LIST(CHECK_FINGERPRINTS); | 10479 INLINE_WHITE_LIST(CHECK_FINGERPRINTS); |
10475 INLINE_BLACK_LIST(CHECK_FINGERPRINTS); | 10480 INLINE_BLACK_LIST(CHECK_FINGERPRINTS); |
10476 POLYMORPHIC_TARGET_LIST(CHECK_FINGERPRINTS); | 10481 POLYMORPHIC_TARGET_LIST(CHECK_FINGERPRINTS); |
10477 | 10482 |
10478 all_libs.Clear(); | 10483 all_libs.Clear(); |
10479 all_libs.Add(&Library::ZoneHandle(Library::DeveloperLibrary())); | |
10480 DEVELOPER_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); | |
10481 | |
10482 all_libs.Clear(); | |
10483 all_libs.Add(&Library::ZoneHandle(Library::MathLibrary())); | 10484 all_libs.Add(&Library::ZoneHandle(Library::MathLibrary())); |
10484 MATH_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); | 10485 MATH_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); |
10485 | 10486 |
10486 all_libs.Clear(); | 10487 all_libs.Clear(); |
| 10488 all_libs.Add(&Library::ZoneHandle(Library::ProfilerLibrary())); |
| 10489 PROFILER_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); |
| 10490 |
| 10491 all_libs.Clear(); |
10487 all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary())); | 10492 all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary())); |
10488 TYPED_DATA_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); | 10493 TYPED_DATA_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); |
10489 | 10494 |
10490 #undef CHECK_FINGERPRINTS | 10495 #undef CHECK_FINGERPRINTS |
10491 | 10496 |
10492 Class& cls = Class::Handle(); | 10497 Class& cls = Class::Handle(); |
10493 | 10498 |
10494 #define CHECK_FACTORY_FINGERPRINTS(factory_symbol, cid, fp) \ | 10499 #define CHECK_FACTORY_FINGERPRINTS(factory_symbol, cid, fp) \ |
10495 cls = Isolate::Current()->class_table()->At(cid); \ | 10500 cls = Isolate::Current()->class_table()->At(cid); \ |
10496 func = cls.LookupFunctionAllowPrivate(Symbols::factory_symbol()); \ | 10501 func = cls.LookupFunctionAllowPrivate(Symbols::factory_symbol()); \ |
(...skipping 10203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20700 return tag_label.ToCString(); | 20705 return tag_label.ToCString(); |
20701 } | 20706 } |
20702 | 20707 |
20703 | 20708 |
20704 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20709 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
20705 Instance::PrintJSONImpl(stream, ref); | 20710 Instance::PrintJSONImpl(stream, ref); |
20706 } | 20711 } |
20707 | 20712 |
20708 | 20713 |
20709 } // namespace dart | 20714 } // namespace dart |
OLD | NEW |