| 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/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 if (all_cids_known) { | 219 if (all_cids_known) { |
| 220 const Class& receiver_class = Class::Handle(Z, | 220 const Class& receiver_class = Class::Handle(Z, |
| 221 isolate()->class_table()->At(class_ids[0])); | 221 isolate()->class_table()->At(class_ids[0])); |
| 222 if (!receiver_class.is_finalized()) { | 222 if (!receiver_class.is_finalized()) { |
| 223 // Do not eagerly finalize classes. ResolveDynamicForReceiverClass can | 223 // Do not eagerly finalize classes. ResolveDynamicForReceiverClass can |
| 224 // cause class finalization, since callee's receiver class may not be | 224 // cause class finalization, since callee's receiver class may not be |
| 225 // finalized yet. | 225 // finalized yet. |
| 226 return false; | 226 return false; |
| 227 } | 227 } |
| 228 // Do not run the optimization below if in background compilation since |
| 229 // resolution of method extractor functions may create new signature |
| 230 // classes. |
| 231 // TODO(regis): Remove test for background compilation once signature |
| 232 // classes are not generated any longer. |
| 233 if (!thread()->IsMutatorThread()) { |
| 234 return false; |
| 235 } |
| 228 const Array& args_desc_array = Array::Handle(Z, | 236 const Array& args_desc_array = Array::Handle(Z, |
| 229 ArgumentsDescriptor::New(call->ArgumentCount(), | 237 ArgumentsDescriptor::New(call->ArgumentCount(), |
| 230 call->argument_names())); | 238 call->argument_names())); |
| 231 ArgumentsDescriptor args_desc(args_desc_array); | 239 ArgumentsDescriptor args_desc(args_desc_array); |
| 232 const Function& function = Function::Handle(Z, | 240 const Function& function = Function::Handle(Z, |
| 233 Resolver::ResolveDynamicForReceiverClass( | 241 Resolver::ResolveDynamicForReceiverClass( |
| 234 receiver_class, | 242 receiver_class, |
| 235 call->function_name(), | 243 call->function_name(), |
| 236 args_desc)); | 244 args_desc)); |
| 237 if (function.IsNull()) { | 245 if (function.IsNull()) { |
| (...skipping 8612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8850 | 8858 |
| 8851 // Insert materializations at environment uses. | 8859 // Insert materializations at environment uses. |
| 8852 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 8860 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
| 8853 CreateMaterializationAt( | 8861 CreateMaterializationAt( |
| 8854 exits_collector_.exits()[i], alloc, *slots); | 8862 exits_collector_.exits()[i], alloc, *slots); |
| 8855 } | 8863 } |
| 8856 } | 8864 } |
| 8857 | 8865 |
| 8858 | 8866 |
| 8859 } // namespace dart | 8867 } // namespace dart |
| OLD | NEW |