| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/precompiler.h" | 5 #include "vm/precompiler.h" |
| 6 | 6 |
| 7 #include "vm/aot_optimizer.h" | 7 #include "vm/aot_optimizer.h" |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
| 10 #include "vm/branch_optimizer.h" | 10 #include "vm/branch_optimizer.h" |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 } | 957 } |
| 958 } else if (entry.IsField()) { | 958 } else if (entry.IsField()) { |
| 959 // Potential need for field initializer. | 959 // Potential need for field initializer. |
| 960 field ^= entry.raw(); | 960 field ^= entry.raw(); |
| 961 AddField(field); | 961 AddField(field); |
| 962 } else if (entry.IsInstance()) { | 962 } else if (entry.IsInstance()) { |
| 963 // Const object, literal or args descriptor. | 963 // Const object, literal or args descriptor. |
| 964 instance ^= entry.raw(); | 964 instance ^= entry.raw(); |
| 965 if (entry.IsAbstractType()) { | 965 if (entry.IsAbstractType()) { |
| 966 AddType(AbstractType::Cast(entry)); | 966 AddType(AbstractType::Cast(entry)); |
| 967 } else if (entry.IsTypeArguments()) { |
| 968 AddTypeArguments(TypeArguments::Cast(entry)); |
| 967 } else { | 969 } else { |
| 968 AddConstObject(instance); | 970 AddConstObject(instance); |
| 969 } | 971 } |
| 970 } else if (entry.IsFunction()) { | 972 } else if (entry.IsFunction()) { |
| 971 // Local closure function. | 973 // Local closure function. |
| 972 target ^= entry.raw(); | 974 target ^= entry.raw(); |
| 973 AddFunction(target); | 975 AddFunction(target); |
| 974 } else if (entry.IsCode()) { | 976 } else if (entry.IsCode()) { |
| 975 target_code ^= entry.raw(); | 977 target_code ^= entry.raw(); |
| 976 if (target_code.IsAllocationStubCode()) { | 978 if (target_code.IsAllocationStubCode()) { |
| 977 cls ^= target_code.owner(); | 979 cls ^= target_code.owner(); |
| 978 AddInstantiatedClass(cls); | 980 AddInstantiatedClass(cls); |
| 979 } | 981 } |
| 980 } else if (entry.IsTypeArguments()) { | |
| 981 AddTypeArguments(TypeArguments::Cast(entry)); | |
| 982 } | 982 } |
| 983 } | 983 } |
| 984 } | 984 } |
| 985 | 985 |
| 986 const Array& inlined_functions = | 986 const Array& inlined_functions = |
| 987 Array::Handle(Z, code.inlined_id_to_function()); | 987 Array::Handle(Z, code.inlined_id_to_function()); |
| 988 for (intptr_t i = 0; i < inlined_functions.Length(); i++) { | 988 for (intptr_t i = 0; i < inlined_functions.Length(); i++) { |
| 989 target ^= inlined_functions.At(i); | 989 target ^= inlined_functions.At(i); |
| 990 AddTypesOf(target); | 990 AddTypesOf(target); |
| 991 } | 991 } |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 class ConstObjectVisitor : public ObjectPointerVisitor { | 1150 class ConstObjectVisitor : public ObjectPointerVisitor { |
| 1151 public: | 1151 public: |
| 1152 ConstObjectVisitor(Precompiler* precompiler, Isolate* isolate) | 1152 ConstObjectVisitor(Precompiler* precompiler, Isolate* isolate) |
| 1153 : ObjectPointerVisitor(isolate), | 1153 : ObjectPointerVisitor(isolate), |
| 1154 precompiler_(precompiler), | 1154 precompiler_(precompiler), |
| 1155 subinstance_(Object::Handle()) {} | 1155 subinstance_(Object::Handle()) {} |
| 1156 | 1156 |
| 1157 virtual void VisitPointers(RawObject** first, RawObject** last) { | 1157 virtual void VisitPointers(RawObject** first, RawObject** last) { |
| 1158 for (RawObject** current = first; current <= last; current++) { | 1158 for (RawObject** current = first; current <= last; current++) { |
| 1159 subinstance_ = *current; | 1159 subinstance_ = *current; |
| 1160 if (subinstance_.IsInstance()) { | 1160 if (subinstance_.IsInstance() && !subinstance_.IsTypeArguments()) { |
| 1161 precompiler_->AddConstObject(Instance::Cast(subinstance_)); | 1161 precompiler_->AddConstObject(Instance::Cast(subinstance_)); |
| 1162 } | 1162 } |
| 1163 } | 1163 } |
| 1164 subinstance_ = Object::null(); | 1164 subinstance_ = Object::null(); |
| 1165 } | 1165 } |
| 1166 | 1166 |
| 1167 private: | 1167 private: |
| 1168 Precompiler* precompiler_; | 1168 Precompiler* precompiler_; |
| 1169 Object& subinstance_; | 1169 Object& subinstance_; |
| 1170 }; | 1170 }; |
| (...skipping 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3872 } | 3872 } |
| 3873 result[idx++] = NULL; | 3873 result[idx++] = NULL; |
| 3874 renames_map.Release(); | 3874 renames_map.Release(); |
| 3875 | 3875 |
| 3876 return result; | 3876 return result; |
| 3877 } | 3877 } |
| 3878 | 3878 |
| 3879 #endif // DART_PRECOMPILER | 3879 #endif // DART_PRECOMPILER |
| 3880 | 3880 |
| 3881 } // namespace dart | 3881 } // namespace dart |
| OLD | NEW |