| 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/aot_optimizer.h" | 5 #include "vm/aot_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/branch_optimizer.h" | 8 #include "vm/branch_optimizer.h" |
| 9 #include "vm/cha.h" | 9 #include "vm/cha.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1400 // necessary. | 1400 // necessary. |
| 1401 // TODO(srdjan): Do also for other than 'int' type. | 1401 // TODO(srdjan): Do also for other than 'int' type. |
| 1402 static bool TryExpandTestCidsResult(ZoneGrowableArray<intptr_t>* results, | 1402 static bool TryExpandTestCidsResult(ZoneGrowableArray<intptr_t>* results, |
| 1403 const AbstractType& type) { | 1403 const AbstractType& type) { |
| 1404 ASSERT(results->length() >= 2); // At least on entry. | 1404 ASSERT(results->length() >= 2); // At least on entry. |
| 1405 const ClassTable& class_table = *Isolate::Current()->class_table(); | 1405 const ClassTable& class_table = *Isolate::Current()->class_table(); |
| 1406 if ((*results)[0] != kSmiCid) { | 1406 if ((*results)[0] != kSmiCid) { |
| 1407 const Class& cls = Class::Handle(class_table.At(kSmiCid)); | 1407 const Class& cls = Class::Handle(class_table.At(kSmiCid)); |
| 1408 const Class& type_class = Class::Handle(type.type_class()); | 1408 const Class& type_class = Class::Handle(type.type_class()); |
| 1409 const bool smi_is_subtype = | 1409 const bool smi_is_subtype = |
| 1410 cls.IsSubtypeOf(TypeArguments::Handle(), type_class, | 1410 cls.IsSubtypeOf(Object::null_type_arguments(), type_class, |
| 1411 TypeArguments::Handle(), NULL, NULL, Heap::kOld); | 1411 Object::null_type_arguments(), NULL, NULL, Heap::kOld); |
| 1412 results->Add((*results)[results->length() - 2]); | 1412 results->Add((*results)[results->length() - 2]); |
| 1413 results->Add((*results)[results->length() - 2]); | 1413 results->Add((*results)[results->length() - 2]); |
| 1414 for (intptr_t i = results->length() - 3; i > 1; --i) { | 1414 for (intptr_t i = results->length() - 3; i > 1; --i) { |
| 1415 (*results)[i] = (*results)[i - 2]; | 1415 (*results)[i] = (*results)[i - 2]; |
| 1416 } | 1416 } |
| 1417 (*results)[0] = kSmiCid; | 1417 (*results)[0] = kSmiCid; |
| 1418 (*results)[1] = smi_is_subtype; | 1418 (*results)[1] = smi_is_subtype; |
| 1419 } | 1419 } |
| 1420 | 1420 |
| 1421 ASSERT(type.IsInstantiated() && !type.IsMalformedOrMalbounded()); | 1421 ASSERT(type.IsInstantiated() && !type.IsMalformedOrMalbounded()); |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2132 FlowGraph::kEffect); | 2132 FlowGraph::kEffect); |
| 2133 current_iterator()->RemoveCurrentFromGraph(); | 2133 current_iterator()->RemoveCurrentFromGraph(); |
| 2134 } | 2134 } |
| 2135 } | 2135 } |
| 2136 } | 2136 } |
| 2137 } | 2137 } |
| 2138 | 2138 |
| 2139 #endif // DART_PRECOMPILER | 2139 #endif // DART_PRECOMPILER |
| 2140 | 2140 |
| 2141 } // namespace dart | 2141 } // namespace dart |
| OLD | NEW |