| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 RawClass* Object::patch_class_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 118 RawClass* Object::patch_class_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 119 RawClass* Object::function_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 119 RawClass* Object::function_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 120 RawClass* Object::closure_data_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 120 RawClass* Object::closure_data_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 121 RawClass* Object::redirection_data_class_ = | 121 RawClass* Object::redirection_data_class_ = |
| 122 reinterpret_cast<RawClass*>(RAW_NULL); | 122 reinterpret_cast<RawClass*>(RAW_NULL); |
| 123 RawClass* Object::field_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 123 RawClass* Object::field_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 124 RawClass* Object::literal_token_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 124 RawClass* Object::literal_token_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 125 RawClass* Object::token_stream_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 125 RawClass* Object::token_stream_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 126 RawClass* Object::script_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 126 RawClass* Object::script_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 127 RawClass* Object::library_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 127 RawClass* Object::library_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 128 RawClass* Object::library_prefix_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | |
| 129 RawClass* Object::namespace_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 128 RawClass* Object::namespace_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 130 RawClass* Object::code_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 129 RawClass* Object::code_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 131 RawClass* Object::instructions_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 130 RawClass* Object::instructions_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 132 RawClass* Object::pc_descriptors_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 131 RawClass* Object::pc_descriptors_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 133 RawClass* Object::stackmap_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 132 RawClass* Object::stackmap_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 134 RawClass* Object::var_descriptors_class_ = | 133 RawClass* Object::var_descriptors_class_ = |
| 135 reinterpret_cast<RawClass*>(RAW_NULL); | 134 reinterpret_cast<RawClass*>(RAW_NULL); |
| 136 RawClass* Object::exception_handlers_class_ = | 135 RawClass* Object::exception_handlers_class_ = |
| 137 reinterpret_cast<RawClass*>(RAW_NULL); | 136 reinterpret_cast<RawClass*>(RAW_NULL); |
| 138 RawClass* Object::deopt_info_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 137 RawClass* Object::deopt_info_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 | 561 |
| 563 cls = Class::New<TokenStream>(); | 562 cls = Class::New<TokenStream>(); |
| 564 token_stream_class_ = cls.raw(); | 563 token_stream_class_ = cls.raw(); |
| 565 | 564 |
| 566 cls = Class::New<Script>(); | 565 cls = Class::New<Script>(); |
| 567 script_class_ = cls.raw(); | 566 script_class_ = cls.raw(); |
| 568 | 567 |
| 569 cls = Class::New<Library>(); | 568 cls = Class::New<Library>(); |
| 570 library_class_ = cls.raw(); | 569 library_class_ = cls.raw(); |
| 571 | 570 |
| 572 cls = Class::New<LibraryPrefix>(); | |
| 573 library_prefix_class_ = cls.raw(); | |
| 574 | |
| 575 cls = Class::New<Namespace>(); | 571 cls = Class::New<Namespace>(); |
| 576 namespace_class_ = cls.raw(); | 572 namespace_class_ = cls.raw(); |
| 577 | 573 |
| 578 cls = Class::New<Code>(); | 574 cls = Class::New<Code>(); |
| 579 code_class_ = cls.raw(); | 575 code_class_ = cls.raw(); |
| 580 | 576 |
| 581 cls = Class::New<Instructions>(); | 577 cls = Class::New<Instructions>(); |
| 582 instructions_class_ = cls.raw(); | 578 instructions_class_ = cls.raw(); |
| 583 | 579 |
| 584 cls = Class::New<PcDescriptors>(); | 580 cls = Class::New<PcDescriptors>(); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 SET_CLASS_NAME(type_arguments, TypeArguments); | 759 SET_CLASS_NAME(type_arguments, TypeArguments); |
| 764 SET_CLASS_NAME(patch_class, PatchClass); | 760 SET_CLASS_NAME(patch_class, PatchClass); |
| 765 SET_CLASS_NAME(function, Function); | 761 SET_CLASS_NAME(function, Function); |
| 766 SET_CLASS_NAME(closure_data, ClosureData); | 762 SET_CLASS_NAME(closure_data, ClosureData); |
| 767 SET_CLASS_NAME(redirection_data, RedirectionData); | 763 SET_CLASS_NAME(redirection_data, RedirectionData); |
| 768 SET_CLASS_NAME(field, Field); | 764 SET_CLASS_NAME(field, Field); |
| 769 SET_CLASS_NAME(literal_token, LiteralToken); | 765 SET_CLASS_NAME(literal_token, LiteralToken); |
| 770 SET_CLASS_NAME(token_stream, TokenStream); | 766 SET_CLASS_NAME(token_stream, TokenStream); |
| 771 SET_CLASS_NAME(script, Script); | 767 SET_CLASS_NAME(script, Script); |
| 772 SET_CLASS_NAME(library, LibraryClass); | 768 SET_CLASS_NAME(library, LibraryClass); |
| 773 SET_CLASS_NAME(library_prefix, LibraryPrefix); | |
| 774 SET_CLASS_NAME(namespace, Namespace); | 769 SET_CLASS_NAME(namespace, Namespace); |
| 775 SET_CLASS_NAME(code, Code); | 770 SET_CLASS_NAME(code, Code); |
| 776 SET_CLASS_NAME(instructions, Instructions); | 771 SET_CLASS_NAME(instructions, Instructions); |
| 777 SET_CLASS_NAME(pc_descriptors, PcDescriptors); | 772 SET_CLASS_NAME(pc_descriptors, PcDescriptors); |
| 778 SET_CLASS_NAME(stackmap, Stackmap); | 773 SET_CLASS_NAME(stackmap, Stackmap); |
| 779 SET_CLASS_NAME(var_descriptors, LocalVarDescriptors); | 774 SET_CLASS_NAME(var_descriptors, LocalVarDescriptors); |
| 780 SET_CLASS_NAME(exception_handlers, ExceptionHandlers); | 775 SET_CLASS_NAME(exception_handlers, ExceptionHandlers); |
| 781 SET_CLASS_NAME(deopt_info, DeoptInfo); | 776 SET_CLASS_NAME(deopt_info, DeoptInfo); |
| 782 SET_CLASS_NAME(context, Context); | 777 SET_CLASS_NAME(context, Context); |
| 783 SET_CLASS_NAME(context_scope, ContextScope); | 778 SET_CLASS_NAME(context_scope, ContextScope); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 | 933 |
| 939 cls = Class::New<TypeParameter>(); | 934 cls = Class::New<TypeParameter>(); |
| 940 object_store->set_type_parameter_class(cls); | 935 object_store->set_type_parameter_class(cls); |
| 941 | 936 |
| 942 cls = Class::New<BoundedType>(); | 937 cls = Class::New<BoundedType>(); |
| 943 object_store->set_bounded_type_class(cls); | 938 object_store->set_bounded_type_class(cls); |
| 944 | 939 |
| 945 cls = Class::New<MixinAppType>(); | 940 cls = Class::New<MixinAppType>(); |
| 946 object_store->set_mixin_app_type_class(cls); | 941 object_store->set_mixin_app_type_class(cls); |
| 947 | 942 |
| 943 cls = Class::New<LibraryPrefix>(); |
| 944 object_store->set_library_prefix_class(cls); |
| 945 |
| 948 // Pre-allocate the OneByteString class needed by the symbol table. | 946 // Pre-allocate the OneByteString class needed by the symbol table. |
| 949 cls = Class::NewStringClass(kOneByteStringCid); | 947 cls = Class::NewStringClass(kOneByteStringCid); |
| 950 object_store->set_one_byte_string_class(cls); | 948 object_store->set_one_byte_string_class(cls); |
| 951 | 949 |
| 952 // Pre-allocate the TwoByteString class needed by the symbol table. | 950 // Pre-allocate the TwoByteString class needed by the symbol table. |
| 953 cls = Class::NewStringClass(kTwoByteStringCid); | 951 cls = Class::NewStringClass(kTwoByteStringCid); |
| 954 object_store->set_two_byte_string_class(cls); | 952 object_store->set_two_byte_string_class(cls); |
| 955 | 953 |
| 956 // Setup the symbol table for the symbols created in the isolate. | 954 // Setup the symbol table for the symbols created in the isolate. |
| 957 Symbols::SetupSymbolTable(isolate); | 955 Symbols::SetupSymbolTable(isolate); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 pending_classes.Add(cls); | 1054 pending_classes.Add(cls); |
| 1057 | 1055 |
| 1058 cls = Class::New<Instance>(kNullCid); | 1056 cls = Class::New<Instance>(kNullCid); |
| 1059 object_store->set_null_class(cls); | 1057 object_store->set_null_class(cls); |
| 1060 cls.set_num_type_arguments(0); | 1058 cls.set_num_type_arguments(0); |
| 1061 cls.set_num_own_type_arguments(0); | 1059 cls.set_num_own_type_arguments(0); |
| 1062 cls.set_is_prefinalized(); | 1060 cls.set_is_prefinalized(); |
| 1063 RegisterClass(cls, Symbols::Null(), core_lib); | 1061 RegisterClass(cls, Symbols::Null(), core_lib); |
| 1064 pending_classes.Add(cls); | 1062 pending_classes.Add(cls); |
| 1065 | 1063 |
| 1064 cls = object_store->library_prefix_class(); |
| 1065 ASSERT(!cls.IsNull()); |
| 1066 RegisterPrivateClass(cls, Symbols::_LibraryPrefix(), core_lib); |
| 1067 pending_classes.Add(cls); |
| 1068 |
| 1066 cls = object_store->type_class(); | 1069 cls = object_store->type_class(); |
| 1067 RegisterPrivateClass(cls, Symbols::Type(), core_lib); | 1070 RegisterPrivateClass(cls, Symbols::Type(), core_lib); |
| 1068 pending_classes.Add(cls); | 1071 pending_classes.Add(cls); |
| 1069 | 1072 |
| 1070 cls = object_store->type_ref_class(); | 1073 cls = object_store->type_ref_class(); |
| 1071 RegisterPrivateClass(cls, Symbols::TypeRef(), core_lib); | 1074 RegisterPrivateClass(cls, Symbols::TypeRef(), core_lib); |
| 1072 pending_classes.Add(cls); | 1075 pending_classes.Add(cls); |
| 1073 | 1076 |
| 1074 cls = object_store->type_parameter_class(); | 1077 cls = object_store->type_parameter_class(); |
| 1075 RegisterPrivateClass(cls, Symbols::TypeParameter(), core_lib); | 1078 RegisterPrivateClass(cls, Symbols::TypeParameter(), core_lib); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1330 ObjectStore* object_store = isolate->object_store(); | 1333 ObjectStore* object_store = isolate->object_store(); |
| 1331 | 1334 |
| 1332 Class& cls = Class::Handle(); | 1335 Class& cls = Class::Handle(); |
| 1333 | 1336 |
| 1334 // Set up empty classes in the object store, these will get | 1337 // Set up empty classes in the object store, these will get |
| 1335 // initialized correctly when we read from the snapshot. | 1338 // initialized correctly when we read from the snapshot. |
| 1336 // This is done to allow bootstrapping of reading classes from the snapshot. | 1339 // This is done to allow bootstrapping of reading classes from the snapshot. |
| 1337 cls = Class::New<Instance>(kInstanceCid); | 1340 cls = Class::New<Instance>(kInstanceCid); |
| 1338 object_store->set_object_class(cls); | 1341 object_store->set_object_class(cls); |
| 1339 | 1342 |
| 1343 cls = Class::New<LibraryPrefix>(); |
| 1344 object_store->set_library_prefix_class(cls); |
| 1345 |
| 1340 cls = Class::New<Type>(); | 1346 cls = Class::New<Type>(); |
| 1341 object_store->set_type_class(cls); | 1347 object_store->set_type_class(cls); |
| 1342 | 1348 |
| 1343 cls = Class::New<TypeRef>(); | 1349 cls = Class::New<TypeRef>(); |
| 1344 object_store->set_type_ref_class(cls); | 1350 object_store->set_type_ref_class(cls); |
| 1345 | 1351 |
| 1346 cls = Class::New<TypeParameter>(); | 1352 cls = Class::New<TypeParameter>(); |
| 1347 object_store->set_type_parameter_class(cls); | 1353 object_store->set_type_parameter_class(cls); |
| 1348 | 1354 |
| 1349 cls = Class::New<BoundedType>(); | 1355 cls = Class::New<BoundedType>(); |
| (...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2436 weak_property ^= code_objects.At(i); | 2442 weak_property ^= code_objects.At(i); |
| 2437 code ^= weak_property.key(); | 2443 code ^= weak_property.key(); |
| 2438 if (code.IsNull()) { | 2444 if (code.IsNull()) { |
| 2439 // Code was garbage collected already. | 2445 // Code was garbage collected already. |
| 2440 continue; | 2446 continue; |
| 2441 } | 2447 } |
| 2442 | 2448 |
| 2443 function ^= code.function(); | 2449 function ^= code.function(); |
| 2444 // If function uses dependent code switch it to unoptimized. | 2450 // If function uses dependent code switch it to unoptimized. |
| 2445 if (function.CurrentCode() == code.raw()) { | 2451 if (function.CurrentCode() == code.raw()) { |
| 2446 ASSERT(function.HasOptimizedCode()); | |
| 2447 ReportSwitchingCode(code); | 2452 ReportSwitchingCode(code); |
| 2448 function.SwitchToUnoptimizedCode(); | 2453 if (code.is_optimized()) { |
| 2454 function.SwitchToUnoptimizedCode(); |
| 2455 } else { |
| 2456 function.ClearCode(); |
| 2457 } |
| 2449 } | 2458 } |
| 2450 } | 2459 } |
| 2451 } | 2460 } |
| 2452 | 2461 |
| 2453 private: | 2462 private: |
| 2454 const Array& array_; | 2463 const Array& array_; |
| 2455 DISALLOW_COPY_AND_ASSIGN(WeakCodeReferences); | 2464 DISALLOW_COPY_AND_ASSIGN(WeakCodeReferences); |
| 2456 }; | 2465 }; |
| 2457 | 2466 |
| 2458 | 2467 |
| (...skipping 6686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9145 } | 9154 } |
| 9146 } | 9155 } |
| 9147 } | 9156 } |
| 9148 return false; | 9157 return false; |
| 9149 } | 9158 } |
| 9150 | 9159 |
| 9151 | 9160 |
| 9152 void LibraryPrefix::AddImport(const Namespace& import) const { | 9161 void LibraryPrefix::AddImport(const Namespace& import) const { |
| 9153 intptr_t num_current_imports = num_imports(); | 9162 intptr_t num_current_imports = num_imports(); |
| 9154 | 9163 |
| 9164 // Prefixes with deferred libraries can only contain one library. |
| 9165 ASSERT((num_current_imports == 0) || !is_deferred_load()); |
| 9166 |
| 9155 // The library needs to be added to the list. | 9167 // The library needs to be added to the list. |
| 9156 Array& imports = Array::Handle(this->imports()); | 9168 Array& imports = Array::Handle(this->imports()); |
| 9157 const intptr_t length = (imports.IsNull()) ? 0 : imports.Length(); | 9169 const intptr_t length = (imports.IsNull()) ? 0 : imports.Length(); |
| 9158 // Grow the list if it is full. | 9170 // Grow the list if it is full. |
| 9159 if (num_current_imports >= length) { | 9171 if (num_current_imports >= length) { |
| 9160 const intptr_t new_length = length + kIncrementSize; | 9172 const intptr_t new_length = length + kIncrementSize; |
| 9161 imports = Array::Grow(imports, new_length, Heap::kOld); | 9173 imports = Array::Grow(imports, new_length, Heap::kOld); |
| 9162 set_imports(imports); | 9174 set_imports(imports); |
| 9163 } | 9175 } |
| 9164 imports.SetAt(num_current_imports, import); | 9176 imports.SetAt(num_current_imports, import); |
| 9165 set_num_imports(num_current_imports + 1); | 9177 set_num_imports(num_current_imports + 1); |
| 9166 } | 9178 } |
| 9167 | 9179 |
| 9168 | 9180 |
| 9169 RawObject* LibraryPrefix::LookupObject(const String& name) const { | 9181 RawObject* LibraryPrefix::LookupObject(const String& name) const { |
| 9182 if (!is_loaded()) { |
| 9183 return Object::null(); |
| 9184 } |
| 9170 Array& imports = Array::Handle(this->imports()); | 9185 Array& imports = Array::Handle(this->imports()); |
| 9171 Object& obj = Object::Handle(); | 9186 Object& obj = Object::Handle(); |
| 9172 Namespace& import = Namespace::Handle(); | 9187 Namespace& import = Namespace::Handle(); |
| 9173 Library& import_lib = Library::Handle(); | 9188 Library& import_lib = Library::Handle(); |
| 9174 String& import_lib_url = String::Handle(); | 9189 String& import_lib_url = String::Handle(); |
| 9175 String& first_import_lib_url = String::Handle(); | 9190 String& first_import_lib_url = String::Handle(); |
| 9176 Object& found_obj = Object::Handle(); | 9191 Object& found_obj = Object::Handle(); |
| 9177 for (intptr_t i = 0; i < num_imports(); i++) { | 9192 for (intptr_t i = 0; i < num_imports(); i++) { |
| 9178 import ^= imports.At(i); | 9193 import ^= imports.At(i); |
| 9179 obj = import.Lookup(name); | 9194 obj = import.Lookup(name); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 9206 | 9221 |
| 9207 RawClass* LibraryPrefix::LookupClass(const String& class_name) const { | 9222 RawClass* LibraryPrefix::LookupClass(const String& class_name) const { |
| 9208 const Object& obj = Object::Handle(LookupObject(class_name)); | 9223 const Object& obj = Object::Handle(LookupObject(class_name)); |
| 9209 if (obj.IsClass()) { | 9224 if (obj.IsClass()) { |
| 9210 return Class::Cast(obj).raw(); | 9225 return Class::Cast(obj).raw(); |
| 9211 } | 9226 } |
| 9212 return Class::null(); | 9227 return Class::null(); |
| 9213 } | 9228 } |
| 9214 | 9229 |
| 9215 | 9230 |
| 9231 void LibraryPrefix::set_is_loaded() const { |
| 9232 raw_ptr()->is_loaded_ = true; |
| 9233 } |
| 9234 |
| 9235 |
| 9236 void LibraryPrefix::LoadLibrary() const { |
| 9237 // Non-deferred prefixes are loaded. |
| 9238 ASSERT(is_deferred_load() || is_loaded()); |
| 9239 if (is_loaded()) { |
| 9240 return; |
| 9241 } |
| 9242 InvalidateDependentCode(); |
| 9243 set_is_loaded(); |
| 9244 } |
| 9245 |
| 9246 |
| 9247 RawArray* LibraryPrefix::dependent_code() const { |
| 9248 return raw_ptr()->dependent_code_; |
| 9249 } |
| 9250 |
| 9251 |
| 9252 void LibraryPrefix::set_dependent_code(const Array& array) const { |
| 9253 StorePointer(&raw_ptr()->dependent_code_, array.raw()); |
| 9254 } |
| 9255 |
| 9256 |
| 9257 class PrefixDependentArray : public WeakCodeReferences { |
| 9258 public: |
| 9259 explicit PrefixDependentArray(const LibraryPrefix& prefix) |
| 9260 : WeakCodeReferences(Array::Handle(prefix.dependent_code())), |
| 9261 prefix_(prefix) {} |
| 9262 |
| 9263 virtual void UpdateArrayTo(const Array& value) { |
| 9264 prefix_.set_dependent_code(value); |
| 9265 } |
| 9266 |
| 9267 virtual void ReportDeoptimization(const Code& code) { |
| 9268 // This gets called when the code object is on the stack |
| 9269 // while nuking code that depends on a prefix. We don't expect |
| 9270 // this to happen, so make sure we die loudly if we find |
| 9271 // ourselves here. |
| 9272 UNIMPLEMENTED(); |
| 9273 } |
| 9274 |
| 9275 virtual void ReportSwitchingCode(const Code& code) { |
| 9276 if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) { |
| 9277 OS::PrintErr("Prefix '%s': deleting code for function '%s'\n", |
| 9278 String::Handle(prefix_.name()).ToCString(), |
| 9279 Function::Handle(code.function()).ToCString()); |
| 9280 } |
| 9281 } |
| 9282 |
| 9283 private: |
| 9284 const LibraryPrefix& prefix_; |
| 9285 DISALLOW_COPY_AND_ASSIGN(PrefixDependentArray); |
| 9286 }; |
| 9287 |
| 9288 |
| 9289 void LibraryPrefix::RegisterDependentCode(const Code& code) const { |
| 9290 ASSERT(is_deferred_load()); |
| 9291 ASSERT(!is_loaded()); |
| 9292 PrefixDependentArray a(*this); |
| 9293 a.Register(code); |
| 9294 } |
| 9295 |
| 9296 |
| 9297 void LibraryPrefix::InvalidateDependentCode() const { |
| 9298 PrefixDependentArray a(*this); |
| 9299 a.DisableCode(); |
| 9300 } |
| 9301 |
| 9302 |
| 9216 RawLibraryPrefix* LibraryPrefix::New() { | 9303 RawLibraryPrefix* LibraryPrefix::New() { |
| 9217 ASSERT(Object::library_prefix_class() != Class::null()); | 9304 ASSERT(Isolate::Current()->object_store()->library_prefix_class() != |
| 9305 Class::null()); |
| 9218 RawObject* raw = Object::Allocate(LibraryPrefix::kClassId, | 9306 RawObject* raw = Object::Allocate(LibraryPrefix::kClassId, |
| 9219 LibraryPrefix::InstanceSize(), | 9307 LibraryPrefix::InstanceSize(), |
| 9220 Heap::kOld); | 9308 Heap::kOld); |
| 9221 return reinterpret_cast<RawLibraryPrefix*>(raw); | 9309 return reinterpret_cast<RawLibraryPrefix*>(raw); |
| 9222 } | 9310 } |
| 9223 | 9311 |
| 9224 | 9312 |
| 9225 RawLibraryPrefix* LibraryPrefix::New(const String& name, | 9313 RawLibraryPrefix* LibraryPrefix::New(const String& name, |
| 9226 const Namespace& import) { | 9314 const Namespace& import, |
| 9315 bool deferred_load) { |
| 9227 const LibraryPrefix& result = LibraryPrefix::Handle(LibraryPrefix::New()); | 9316 const LibraryPrefix& result = LibraryPrefix::Handle(LibraryPrefix::New()); |
| 9228 result.set_name(name); | 9317 result.set_name(name); |
| 9229 result.set_num_imports(0); | 9318 result.set_num_imports(0); |
| 9319 result.raw_ptr()->is_deferred_load_ = deferred_load; |
| 9320 result.raw_ptr()->is_loaded_ = !deferred_load; |
| 9230 result.set_imports(Array::Handle(Array::New(kInitialSize))); | 9321 result.set_imports(Array::Handle(Array::New(kInitialSize))); |
| 9231 result.AddImport(import); | 9322 result.AddImport(import); |
| 9323 result.set_dependent_code(Object::null_array()); |
| 9232 return result.raw(); | 9324 return result.raw(); |
| 9233 } | 9325 } |
| 9234 | 9326 |
| 9235 | 9327 |
| 9236 void LibraryPrefix::set_name(const String& value) const { | 9328 void LibraryPrefix::set_name(const String& value) const { |
| 9237 ASSERT(value.IsSymbol()); | 9329 ASSERT(value.IsSymbol()); |
| 9238 StorePointer(&raw_ptr()->name_, value.raw()); | 9330 StorePointer(&raw_ptr()->name_, value.raw()); |
| 9239 } | 9331 } |
| 9240 | 9332 |
| 9241 | 9333 |
| (...skipping 8870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18112 return "_MirrorReference"; | 18204 return "_MirrorReference"; |
| 18113 } | 18205 } |
| 18114 | 18206 |
| 18115 | 18207 |
| 18116 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 18208 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 18117 Instance::PrintToJSONStream(stream, ref); | 18209 Instance::PrintToJSONStream(stream, ref); |
| 18118 } | 18210 } |
| 18119 | 18211 |
| 18120 | 18212 |
| 18121 } // namespace dart | 18213 } // namespace dart |
| OLD | NEW |