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 6647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9106 } | 9115 } |
9107 } | 9116 } |
9108 } | 9117 } |
9109 return false; | 9118 return false; |
9110 } | 9119 } |
9111 | 9120 |
9112 | 9121 |
9113 void LibraryPrefix::AddImport(const Namespace& import) const { | 9122 void LibraryPrefix::AddImport(const Namespace& import) const { |
9114 intptr_t num_current_imports = num_imports(); | 9123 intptr_t num_current_imports = num_imports(); |
9115 | 9124 |
| 9125 // Prefixes with deferred libraries can only contain one library. |
| 9126 ASSERT((num_current_imports == 0) || !is_deferred_load()); |
| 9127 |
9116 // The library needs to be added to the list. | 9128 // The library needs to be added to the list. |
9117 Array& imports = Array::Handle(this->imports()); | 9129 Array& imports = Array::Handle(this->imports()); |
9118 const intptr_t length = (imports.IsNull()) ? 0 : imports.Length(); | 9130 const intptr_t length = (imports.IsNull()) ? 0 : imports.Length(); |
9119 // Grow the list if it is full. | 9131 // Grow the list if it is full. |
9120 if (num_current_imports >= length) { | 9132 if (num_current_imports >= length) { |
9121 const intptr_t new_length = length + kIncrementSize; | 9133 const intptr_t new_length = length + kIncrementSize; |
9122 imports = Array::Grow(imports, new_length, Heap::kOld); | 9134 imports = Array::Grow(imports, new_length, Heap::kOld); |
9123 set_imports(imports); | 9135 set_imports(imports); |
9124 } | 9136 } |
9125 imports.SetAt(num_current_imports, import); | 9137 imports.SetAt(num_current_imports, import); |
9126 set_num_imports(num_current_imports + 1); | 9138 set_num_imports(num_current_imports + 1); |
9127 } | 9139 } |
9128 | 9140 |
9129 | 9141 |
9130 RawObject* LibraryPrefix::LookupObject(const String& name) const { | 9142 RawObject* LibraryPrefix::LookupObject(const String& name) const { |
| 9143 if (!is_loaded()) { |
| 9144 return Object::null(); |
| 9145 } |
9131 Array& imports = Array::Handle(this->imports()); | 9146 Array& imports = Array::Handle(this->imports()); |
9132 Object& obj = Object::Handle(); | 9147 Object& obj = Object::Handle(); |
9133 Namespace& import = Namespace::Handle(); | 9148 Namespace& import = Namespace::Handle(); |
9134 Library& import_lib = Library::Handle(); | 9149 Library& import_lib = Library::Handle(); |
9135 String& import_lib_url = String::Handle(); | 9150 String& import_lib_url = String::Handle(); |
9136 String& first_import_lib_url = String::Handle(); | 9151 String& first_import_lib_url = String::Handle(); |
9137 Object& found_obj = Object::Handle(); | 9152 Object& found_obj = Object::Handle(); |
9138 for (intptr_t i = 0; i < num_imports(); i++) { | 9153 for (intptr_t i = 0; i < num_imports(); i++) { |
9139 import ^= imports.At(i); | 9154 import ^= imports.At(i); |
9140 obj = import.Lookup(name); | 9155 obj = import.Lookup(name); |
(...skipping 26 matching lines...) Expand all Loading... |
9167 | 9182 |
9168 RawClass* LibraryPrefix::LookupClass(const String& class_name) const { | 9183 RawClass* LibraryPrefix::LookupClass(const String& class_name) const { |
9169 const Object& obj = Object::Handle(LookupObject(class_name)); | 9184 const Object& obj = Object::Handle(LookupObject(class_name)); |
9170 if (obj.IsClass()) { | 9185 if (obj.IsClass()) { |
9171 return Class::Cast(obj).raw(); | 9186 return Class::Cast(obj).raw(); |
9172 } | 9187 } |
9173 return Class::null(); | 9188 return Class::null(); |
9174 } | 9189 } |
9175 | 9190 |
9176 | 9191 |
| 9192 void LibraryPrefix::set_is_loaded() const { |
| 9193 raw_ptr()->is_loaded_ = true; |
| 9194 } |
| 9195 |
| 9196 |
| 9197 void LibraryPrefix::LoadLibrary() const { |
| 9198 // Non-deferred prefixes are loaded. |
| 9199 ASSERT(is_deferred_load() || is_loaded()); |
| 9200 if (is_loaded()) { |
| 9201 return; |
| 9202 } |
| 9203 InvalidateDependentCode(); |
| 9204 set_is_loaded(); |
| 9205 } |
| 9206 |
| 9207 |
| 9208 RawArray* LibraryPrefix::dependent_code() const { |
| 9209 return raw_ptr()->dependent_code_; |
| 9210 } |
| 9211 |
| 9212 |
| 9213 void LibraryPrefix::set_dependent_code(const Array& array) const { |
| 9214 StorePointer(&raw_ptr()->dependent_code_, array.raw()); |
| 9215 } |
| 9216 |
| 9217 |
| 9218 class PrefixDependentArray : public WeakCodeReferences { |
| 9219 public: |
| 9220 explicit PrefixDependentArray(const LibraryPrefix& prefix) |
| 9221 : WeakCodeReferences(Array::Handle(prefix.dependent_code())), |
| 9222 prefix_(prefix) {} |
| 9223 |
| 9224 virtual void UpdateArrayTo(const Array& value) { |
| 9225 prefix_.set_dependent_code(value); |
| 9226 } |
| 9227 |
| 9228 virtual void ReportDeoptimization(const Code& code) { |
| 9229 // This gets called when the code object is on the stack |
| 9230 // while nuking code that depends on a prefix. We don't expect |
| 9231 // this to happen, so make sure we die loudly if we find |
| 9232 // ourselves here. |
| 9233 UNIMPLEMENTED(); |
| 9234 } |
| 9235 |
| 9236 virtual void ReportSwitchingCode(const Code& code) { |
| 9237 if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) { |
| 9238 OS::PrintErr("Prefix '%s': deleting code for function '%s'\n", |
| 9239 String::Handle(prefix_.name()).ToCString(), |
| 9240 Function::Handle(code.function()).ToCString()); |
| 9241 } |
| 9242 } |
| 9243 |
| 9244 private: |
| 9245 const LibraryPrefix& prefix_; |
| 9246 DISALLOW_COPY_AND_ASSIGN(PrefixDependentArray); |
| 9247 }; |
| 9248 |
| 9249 |
| 9250 void LibraryPrefix::RegisterDependentCode(const Code& code) const { |
| 9251 ASSERT(is_deferred_load()); |
| 9252 ASSERT(!is_loaded()); |
| 9253 PrefixDependentArray a(*this); |
| 9254 a.Register(code); |
| 9255 } |
| 9256 |
| 9257 |
| 9258 void LibraryPrefix::InvalidateDependentCode() const { |
| 9259 PrefixDependentArray a(*this); |
| 9260 a.DisableCode(); |
| 9261 } |
| 9262 |
| 9263 |
9177 RawLibraryPrefix* LibraryPrefix::New() { | 9264 RawLibraryPrefix* LibraryPrefix::New() { |
9178 ASSERT(Object::library_prefix_class() != Class::null()); | 9265 ASSERT(Isolate::Current()->object_store()->library_prefix_class() != |
| 9266 Class::null()); |
9179 RawObject* raw = Object::Allocate(LibraryPrefix::kClassId, | 9267 RawObject* raw = Object::Allocate(LibraryPrefix::kClassId, |
9180 LibraryPrefix::InstanceSize(), | 9268 LibraryPrefix::InstanceSize(), |
9181 Heap::kOld); | 9269 Heap::kOld); |
9182 return reinterpret_cast<RawLibraryPrefix*>(raw); | 9270 return reinterpret_cast<RawLibraryPrefix*>(raw); |
9183 } | 9271 } |
9184 | 9272 |
9185 | 9273 |
9186 RawLibraryPrefix* LibraryPrefix::New(const String& name, | 9274 RawLibraryPrefix* LibraryPrefix::New(const String& name, |
9187 const Namespace& import) { | 9275 const Namespace& import, |
| 9276 bool deferred_load) { |
9188 const LibraryPrefix& result = LibraryPrefix::Handle(LibraryPrefix::New()); | 9277 const LibraryPrefix& result = LibraryPrefix::Handle(LibraryPrefix::New()); |
9189 result.set_name(name); | 9278 result.set_name(name); |
9190 result.set_num_imports(0); | 9279 result.set_num_imports(0); |
| 9280 result.raw_ptr()->is_deferred_load_ = deferred_load; |
| 9281 result.raw_ptr()->is_loaded_ = !deferred_load; |
9191 result.set_imports(Array::Handle(Array::New(kInitialSize))); | 9282 result.set_imports(Array::Handle(Array::New(kInitialSize))); |
9192 result.AddImport(import); | 9283 result.AddImport(import); |
| 9284 result.set_dependent_code(Object::null_array()); |
9193 return result.raw(); | 9285 return result.raw(); |
9194 } | 9286 } |
9195 | 9287 |
9196 | 9288 |
9197 void LibraryPrefix::set_name(const String& value) const { | 9289 void LibraryPrefix::set_name(const String& value) const { |
9198 ASSERT(value.IsSymbol()); | 9290 ASSERT(value.IsSymbol()); |
9199 StorePointer(&raw_ptr()->name_, value.raw()); | 9291 StorePointer(&raw_ptr()->name_, value.raw()); |
9200 } | 9292 } |
9201 | 9293 |
9202 | 9294 |
(...skipping 8796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17999 return "_MirrorReference"; | 18091 return "_MirrorReference"; |
18000 } | 18092 } |
18001 | 18093 |
18002 | 18094 |
18003 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 18095 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
18004 Instance::PrintToJSONStream(stream, ref); | 18096 Instance::PrintToJSONStream(stream, ref); |
18005 } | 18097 } |
18006 | 18098 |
18007 | 18099 |
18008 } // namespace dart | 18100 } // namespace dart |
OLD | NEW |