| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/class_finalizer.h" | 5 #include "vm/class_finalizer.h" |
| 6 | 6 |
| 7 #include "vm/code_generator.h" | 7 #include "vm/code_generator.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/hash_table.h" | 9 #include "vm/hash_table.h" |
| 10 #include "vm/heap.h" | 10 #include "vm/heap.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // First resolve all superclasses. | 146 // First resolve all superclasses. |
| 147 for (intptr_t i = 0; i < class_array.Length(); i++) { | 147 for (intptr_t i = 0; i < class_array.Length(); i++) { |
| 148 cls ^= class_array.At(i); | 148 cls ^= class_array.At(i); |
| 149 GrowableArray<intptr_t> visited_interfaces; | 149 GrowableArray<intptr_t> visited_interfaces; |
| 150 ResolveSuperTypeAndInterfaces(cls, &visited_interfaces); | 150 ResolveSuperTypeAndInterfaces(cls, &visited_interfaces); |
| 151 } | 151 } |
| 152 // Finalize all classes. | 152 // Finalize all classes. |
| 153 for (intptr_t i = 0; i < class_array.Length(); i++) { | 153 for (intptr_t i = 0; i < class_array.Length(); i++) { |
| 154 cls ^= class_array.At(i); | 154 cls ^= class_array.At(i); |
| 155 FinalizeTypesInClass(cls); | 155 FinalizeTypesInClass(cls); |
| 156 // Classes compiled from Dart sources are finalized more lazily, classes | 156 } |
| 157 // compiled from Kernel binaries can be finalized now (and should be, | 157 |
| 158 // since we will not revisit them). | 158 // Classes compiled from Dart sources are finalized more lazily, classes |
| 159 if (from_kernel) { | 159 // compiled from Kernel binaries can be finalized now (and should be, |
| 160 // since we will not revisit them). |
| 161 if (from_kernel) { |
| 162 for (intptr_t i = 0; i < class_array.Length(); i++) { |
| 163 cls ^= class_array.At(i); |
| 160 FinalizeClass(cls); | 164 FinalizeClass(cls); |
| 161 } | 165 } |
| 162 } | 166 } |
| 167 |
| 163 if (FLAG_print_classes) { | 168 if (FLAG_print_classes) { |
| 164 for (intptr_t i = 0; i < class_array.Length(); i++) { | 169 for (intptr_t i = 0; i < class_array.Length(); i++) { |
| 165 cls ^= class_array.At(i); | 170 cls ^= class_array.At(i); |
| 166 PrintClassInformation(cls); | 171 PrintClassInformation(cls); |
| 167 } | 172 } |
| 168 } | 173 } |
| 169 // Clear pending classes array. | 174 // Clear pending classes array. |
| 170 class_array = GrowableObjectArray::New(); | 175 class_array = GrowableObjectArray::New(); |
| 171 object_store->set_pending_classes(class_array); | 176 object_store->set_pending_classes(class_array); |
| 172 VerifyImplicitFieldOffsets(); // Verification after an error may fail. | 177 VerifyImplicitFieldOffsets(); // Verification after an error may fail. |
| (...skipping 3539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3712 ProgramVisitor::VisitFunctions(&function_visitor); | 3717 ProgramVisitor::VisitFunctions(&function_visitor); |
| 3713 | 3718 |
| 3714 class ClearCodeClassVisitor : public ClassVisitor { | 3719 class ClearCodeClassVisitor : public ClassVisitor { |
| 3715 void Visit(const Class& cls) { cls.DisableAllocationStub(); } | 3720 void Visit(const Class& cls) { cls.DisableAllocationStub(); } |
| 3716 }; | 3721 }; |
| 3717 ClearCodeClassVisitor class_visitor; | 3722 ClearCodeClassVisitor class_visitor; |
| 3718 ProgramVisitor::VisitClasses(&class_visitor); | 3723 ProgramVisitor::VisitClasses(&class_visitor); |
| 3719 } | 3724 } |
| 3720 | 3725 |
| 3721 } // namespace dart | 3726 } // namespace dart |
| OLD | NEW |