| 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/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 for (intptr_t i = 0; i < class_ids.length(); i++) { | 134 for (intptr_t i = 0; i < class_ids.length(); i++) { |
| 135 if (class_ids[i] == kDynamicCid) { | 135 if (class_ids[i] == kDynamicCid) { |
| 136 // Not all cid-s known. | 136 // Not all cid-s known. |
| 137 return false; | 137 return false; |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 ArgumentsDescriptor args_desc( | 141 const Array& args_desc_array = Array::Handle( |
| 142 Array::Handle(ArgumentsDescriptor::New(call->ArgumentCount(), | 142 ArgumentsDescriptor::New(call->ArgumentCount(), call->argument_names())); |
| 143 call->argument_names()))); | 143 ArgumentsDescriptor args_desc(args_desc_array); |
| 144 const Class& receiver_class = Class::Handle( | 144 const Class& receiver_class = Class::Handle( |
| 145 Isolate::Current()->class_table()->At(class_ids[0])); | 145 Isolate::Current()->class_table()->At(class_ids[0])); |
| 146 const Function& function = Function::Handle( | 146 const Function& function = Function::Handle( |
| 147 Resolver::ResolveDynamicForReceiverClass( | 147 Resolver::ResolveDynamicForReceiverClass( |
| 148 receiver_class, | 148 receiver_class, |
| 149 call->function_name(), | 149 call->function_name(), |
| 150 args_desc)); | 150 args_desc)); |
| 151 if (function.IsNull()) { | 151 if (function.IsNull()) { |
| 152 return false; | 152 return false; |
| 153 } | 153 } |
| 154 // Create new ICData, do not modify the one attached to the instruction | 154 // Create new ICData, do not modify the one attached to the instruction |
| 155 // since it is attached to the assembly instruction itself. | 155 // since it is attached to the assembly instruction itself. |
| 156 // TODO(srdjan): Prevent modification of ICData object that is | 156 // TODO(srdjan): Prevent modification of ICData object that is |
| 157 // referenced in assembly code. | 157 // referenced in assembly code. |
| 158 ICData& ic_data = ICData::ZoneHandle(ICData::New( | 158 ICData& ic_data = ICData::ZoneHandle(ICData::New( |
| 159 flow_graph_->parsed_function().function(), | 159 flow_graph_->parsed_function().function(), |
| 160 call->function_name(), | 160 call->function_name(), |
| 161 Object::empty_array(), // Dummy argument descriptor. | 161 args_desc_array, |
| 162 call->deopt_id(), | 162 call->deopt_id(), |
| 163 class_ids.length())); | 163 class_ids.length())); |
| 164 if (class_ids.length() > 1) { | 164 if (class_ids.length() > 1) { |
| 165 ic_data.AddCheck(class_ids, function); | 165 ic_data.AddCheck(class_ids, function); |
| 166 } else { | 166 } else { |
| 167 ASSERT(class_ids.length() == 1); | 167 ASSERT(class_ids.length() == 1); |
| 168 ic_data.AddReceiverCheck(class_ids[0], function); | 168 ic_data.AddReceiverCheck(class_ids[0], function); |
| 169 } | 169 } |
| 170 call->set_ic_data(&ic_data); | 170 call->set_ic_data(&ic_data); |
| 171 return true; | 171 return true; |
| (...skipping 8966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9138 } | 9138 } |
| 9139 | 9139 |
| 9140 // Insert materializations at environment uses. | 9140 // Insert materializations at environment uses. |
| 9141 for (intptr_t i = 0; i < exits.length(); i++) { | 9141 for (intptr_t i = 0; i < exits.length(); i++) { |
| 9142 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *slots); | 9142 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *slots); |
| 9143 } | 9143 } |
| 9144 } | 9144 } |
| 9145 | 9145 |
| 9146 | 9146 |
| 9147 } // namespace dart | 9147 } // namespace dart |
| OLD | NEW |