| 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 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 ASSERT(lib.raw() == Library::CollectionLibrary()); | 1201 ASSERT(lib.raw() == Library::CollectionLibrary()); |
| 1202 | 1202 |
| 1203 cls = Class::New<LinkedHashMap>(); | 1203 cls = Class::New<LinkedHashMap>(); |
| 1204 object_store->set_linked_hash_map_class(cls); | 1204 object_store->set_linked_hash_map_class(cls); |
| 1205 cls.set_type_arguments_field_offset(LinkedHashMap::type_arguments_offset()); | 1205 cls.set_type_arguments_field_offset(LinkedHashMap::type_arguments_offset()); |
| 1206 cls.set_num_type_arguments(2); | 1206 cls.set_num_type_arguments(2); |
| 1207 cls.set_num_own_type_arguments(2); | 1207 cls.set_num_own_type_arguments(2); |
| 1208 RegisterPrivateClass(cls, Symbols::_LinkedHashMap(), lib); | 1208 RegisterPrivateClass(cls, Symbols::_LinkedHashMap(), lib); |
| 1209 pending_classes.Add(cls); | 1209 pending_classes.Add(cls); |
| 1210 | 1210 |
| 1211 // Pre-register the profiler library so we can place the vm class | 1211 // Pre-register the developer library so we can place the vm class |
| 1212 // UserTag there rather than the core library. | 1212 // UserTag there rather than the core library. |
| 1213 lib = Library::LookupLibrary(Symbols::DartProfiler()); | 1213 lib = Library::LookupLibrary(Symbols::DartDeveloper()); |
| 1214 if (lib.IsNull()) { | 1214 if (lib.IsNull()) { |
| 1215 lib = Library::NewLibraryHelper(Symbols::DartProfiler(), true); | 1215 lib = Library::NewLibraryHelper(Symbols::DartDeveloper(), true); |
| 1216 lib.SetLoadRequested(); | 1216 lib.SetLoadRequested(); |
| 1217 lib.Register(); | 1217 lib.Register(); |
| 1218 object_store->set_bootstrap_library(ObjectStore::kProfiler, lib); | 1218 object_store->set_bootstrap_library(ObjectStore::kDeveloper, lib); |
| 1219 } | 1219 } |
| 1220 ASSERT(!lib.IsNull()); | 1220 ASSERT(!lib.IsNull()); |
| 1221 ASSERT(lib.raw() == Library::ProfilerLibrary()); | 1221 ASSERT(lib.raw() == Library::DeveloperLibrary()); |
| 1222 | 1222 |
| 1223 lib = Library::LookupLibrary(Symbols::DartProfiler()); | 1223 lib = Library::LookupLibrary(Symbols::DartDeveloper()); |
| 1224 ASSERT(!lib.IsNull()); | 1224 ASSERT(!lib.IsNull()); |
| 1225 cls = Class::New<UserTag>(); | 1225 cls = Class::New<UserTag>(); |
| 1226 RegisterPrivateClass(cls, Symbols::_UserTag(), lib); | 1226 RegisterPrivateClass(cls, Symbols::_UserTag(), lib); |
| 1227 pending_classes.Add(cls); | 1227 pending_classes.Add(cls); |
| 1228 | 1228 |
| 1229 // Setup some default native field classes which can be extended for | 1229 // Setup some default native field classes which can be extended for |
| 1230 // specifying native fields in dart classes. | 1230 // specifying native fields in dart classes. |
| 1231 Library::InitNativeWrappersLibrary(isolate); | 1231 Library::InitNativeWrappersLibrary(isolate); |
| 1232 ASSERT(object_store->native_wrappers_library() != Library::null()); | 1232 ASSERT(object_store->native_wrappers_library() != Library::null()); |
| 1233 | 1233 |
| (...skipping 8626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9860 RawLibrary* Library::MirrorsLibrary() { | 9860 RawLibrary* Library::MirrorsLibrary() { |
| 9861 return Isolate::Current()->object_store()->mirrors_library(); | 9861 return Isolate::Current()->object_store()->mirrors_library(); |
| 9862 } | 9862 } |
| 9863 | 9863 |
| 9864 | 9864 |
| 9865 RawLibrary* Library::NativeWrappersLibrary() { | 9865 RawLibrary* Library::NativeWrappersLibrary() { |
| 9866 return Isolate::Current()->object_store()->native_wrappers_library(); | 9866 return Isolate::Current()->object_store()->native_wrappers_library(); |
| 9867 } | 9867 } |
| 9868 | 9868 |
| 9869 | 9869 |
| 9870 RawLibrary* Library::ProfilerLibrary() { | |
| 9871 return Isolate::Current()->object_store()->profiler_library(); | |
| 9872 } | |
| 9873 | |
| 9874 | |
| 9875 RawLibrary* Library::TypedDataLibrary() { | 9870 RawLibrary* Library::TypedDataLibrary() { |
| 9876 return Isolate::Current()->object_store()->typed_data_library(); | 9871 return Isolate::Current()->object_store()->typed_data_library(); |
| 9877 } | 9872 } |
| 9878 | 9873 |
| 9879 | 9874 |
| 9880 const char* Library::ToCString() const { | 9875 const char* Library::ToCString() const { |
| 9881 const char* kFormat = "Library:'%s'"; | 9876 const char* kFormat = "Library:'%s'"; |
| 9882 const String& name = String::Handle(url()); | 9877 const String& name = String::Handle(url()); |
| 9883 intptr_t len = OS::SNPrint(NULL, 0, kFormat, name.ToCString()) + 1; | 9878 intptr_t len = OS::SNPrint(NULL, 0, kFormat, name.ToCString()) + 1; |
| 9884 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 9879 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10477 CORE_INTEGER_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); | 10472 CORE_INTEGER_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); |
| 10478 | 10473 |
| 10479 all_libs.Add(&Library::ZoneHandle(Library::MathLibrary())); | 10474 all_libs.Add(&Library::ZoneHandle(Library::MathLibrary())); |
| 10480 all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary())); | 10475 all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary())); |
| 10481 OTHER_RECOGNIZED_LIST(CHECK_FINGERPRINTS); | 10476 OTHER_RECOGNIZED_LIST(CHECK_FINGERPRINTS); |
| 10482 INLINE_WHITE_LIST(CHECK_FINGERPRINTS); | 10477 INLINE_WHITE_LIST(CHECK_FINGERPRINTS); |
| 10483 INLINE_BLACK_LIST(CHECK_FINGERPRINTS); | 10478 INLINE_BLACK_LIST(CHECK_FINGERPRINTS); |
| 10484 POLYMORPHIC_TARGET_LIST(CHECK_FINGERPRINTS); | 10479 POLYMORPHIC_TARGET_LIST(CHECK_FINGERPRINTS); |
| 10485 | 10480 |
| 10486 all_libs.Clear(); | 10481 all_libs.Clear(); |
| 10482 all_libs.Add(&Library::ZoneHandle(Library::DeveloperLibrary())); |
| 10483 DEVELOPER_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); |
| 10484 |
| 10485 all_libs.Clear(); |
| 10487 all_libs.Add(&Library::ZoneHandle(Library::MathLibrary())); | 10486 all_libs.Add(&Library::ZoneHandle(Library::MathLibrary())); |
| 10488 MATH_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); | 10487 MATH_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); |
| 10489 | 10488 |
| 10490 all_libs.Clear(); | 10489 all_libs.Clear(); |
| 10491 all_libs.Add(&Library::ZoneHandle(Library::ProfilerLibrary())); | |
| 10492 PROFILER_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); | |
| 10493 | |
| 10494 all_libs.Clear(); | |
| 10495 all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary())); | 10490 all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary())); |
| 10496 TYPED_DATA_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); | 10491 TYPED_DATA_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); |
| 10497 | 10492 |
| 10498 #undef CHECK_FINGERPRINTS | 10493 #undef CHECK_FINGERPRINTS |
| 10499 | 10494 |
| 10500 Class& cls = Class::Handle(); | 10495 Class& cls = Class::Handle(); |
| 10501 | 10496 |
| 10502 #define CHECK_FACTORY_FINGERPRINTS(factory_symbol, cid, fp) \ | 10497 #define CHECK_FACTORY_FINGERPRINTS(factory_symbol, cid, fp) \ |
| 10503 cls = Isolate::Current()->class_table()->At(cid); \ | 10498 cls = Isolate::Current()->class_table()->At(cid); \ |
| 10504 func = cls.LookupFunctionAllowPrivate(Symbols::factory_symbol()); \ | 10499 func = cls.LookupFunctionAllowPrivate(Symbols::factory_symbol()); \ |
| (...skipping 10219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20724 return tag_label.ToCString(); | 20719 return tag_label.ToCString(); |
| 20725 } | 20720 } |
| 20726 | 20721 |
| 20727 | 20722 |
| 20728 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20723 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 20729 Instance::PrintJSONImpl(stream, ref); | 20724 Instance::PrintJSONImpl(stream, ref); |
| 20730 } | 20725 } |
| 20731 | 20726 |
| 20732 | 20727 |
| 20733 } // namespace dart | 20728 } // namespace dart |
| OLD | NEW |