| 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/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_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 3867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3878 for (int i = 0; i < ic_data.NumberOfChecks(); i++) { | 3878 for (int i = 0; i < ic_data.NumberOfChecks(); i++) { |
| 3879 cls = class_table.At(ic_data.GetReceiverClassIdAt(i)); | 3879 cls = class_table.At(ic_data.GetReceiverClassIdAt(i)); |
| 3880 if (cls.NumTypeArguments() > 0) { | 3880 if (cls.NumTypeArguments() > 0) { |
| 3881 return Bool::null(); | 3881 return Bool::null(); |
| 3882 } | 3882 } |
| 3883 const bool is_subtype = cls.IsSubtypeOf( | 3883 const bool is_subtype = cls.IsSubtypeOf( |
| 3884 TypeArguments::Handle(Z), | 3884 TypeArguments::Handle(Z), |
| 3885 type_class, | 3885 type_class, |
| 3886 TypeArguments::Handle(Z), | 3886 TypeArguments::Handle(Z), |
| 3887 NULL, | 3887 NULL, |
| 3888 NULL, |
| 3888 Heap::kOld); | 3889 Heap::kOld); |
| 3889 results->Add(cls.id()); | 3890 results->Add(cls.id()); |
| 3890 results->Add(is_subtype); | 3891 results->Add(is_subtype); |
| 3891 if (prev.IsNull()) { | 3892 if (prev.IsNull()) { |
| 3892 prev = Bool::Get(is_subtype).raw(); | 3893 prev = Bool::Get(is_subtype).raw(); |
| 3893 } else { | 3894 } else { |
| 3894 if (is_subtype != prev.value()) { | 3895 if (is_subtype != prev.value()) { |
| 3895 results_differ = true; | 3896 results_differ = true; |
| 3896 } | 3897 } |
| 3897 } | 3898 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3972 const AbstractType& type) { | 3973 const AbstractType& type) { |
| 3973 ASSERT(results->length() >= 2); // At least on eentry. | 3974 ASSERT(results->length() >= 2); // At least on eentry. |
| 3974 const ClassTable& class_table = *Isolate::Current()->class_table(); | 3975 const ClassTable& class_table = *Isolate::Current()->class_table(); |
| 3975 if ((*results)[0] != kSmiCid) { | 3976 if ((*results)[0] != kSmiCid) { |
| 3976 const Class& cls = Class::Handle(class_table.At(kSmiCid)); | 3977 const Class& cls = Class::Handle(class_table.At(kSmiCid)); |
| 3977 const Class& type_class = Class::Handle(type.type_class()); | 3978 const Class& type_class = Class::Handle(type.type_class()); |
| 3978 const bool smi_is_subtype = cls.IsSubtypeOf(TypeArguments::Handle(), | 3979 const bool smi_is_subtype = cls.IsSubtypeOf(TypeArguments::Handle(), |
| 3979 type_class, | 3980 type_class, |
| 3980 TypeArguments::Handle(), | 3981 TypeArguments::Handle(), |
| 3981 NULL, | 3982 NULL, |
| 3983 NULL, |
| 3982 Heap::kOld); | 3984 Heap::kOld); |
| 3983 results->Add((*results)[results->length() - 2]); | 3985 results->Add((*results)[results->length() - 2]); |
| 3984 results->Add((*results)[results->length() - 2]); | 3986 results->Add((*results)[results->length() - 2]); |
| 3985 for (intptr_t i = results->length() - 3; i > 1; --i) { | 3987 for (intptr_t i = results->length() - 3; i > 1; --i) { |
| 3986 (*results)[i] = (*results)[i - 2]; | 3988 (*results)[i] = (*results)[i - 2]; |
| 3987 } | 3989 } |
| 3988 (*results)[0] = kSmiCid; | 3990 (*results)[0] = kSmiCid; |
| 3989 (*results)[1] = smi_is_subtype; | 3991 (*results)[1] = smi_is_subtype; |
| 3990 } | 3992 } |
| 3991 | 3993 |
| (...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5045 // the code for this instruction, however, leaving the environment | 5047 // the code for this instruction, however, leaving the environment |
| 5046 // changes code. | 5048 // changes code. |
| 5047 current->RemoveEnvironment(); | 5049 current->RemoveEnvironment(); |
| 5048 } | 5050 } |
| 5049 } | 5051 } |
| 5050 } | 5052 } |
| 5051 } | 5053 } |
| 5052 | 5054 |
| 5053 | 5055 |
| 5054 } // namespace dart | 5056 } // namespace dart |
| OLD | NEW |