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 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 ASSERT(array_cid != kIllegalCid); | 1224 ASSERT(array_cid != kIllegalCid); |
1225 | 1225 |
1226 Definition* array = receiver; | 1226 Definition* array = receiver; |
1227 Definition* index = call->ArgumentAt(1); | 1227 Definition* index = call->ArgumentAt(1); |
1228 Definition* stored_value = call->ArgumentAt(2); | 1228 Definition* stored_value = call->ArgumentAt(2); |
1229 | 1229 |
1230 *entry = new(Z) TargetEntryInstr(flow_graph()->allocate_block_id(), | 1230 *entry = new(Z) TargetEntryInstr(flow_graph()->allocate_block_id(), |
1231 call->GetBlock()->try_index()); | 1231 call->GetBlock()->try_index()); |
1232 (*entry)->InheritDeoptTarget(Z, call); | 1232 (*entry)->InheritDeoptTarget(Z, call); |
1233 Instruction* cursor = *entry; | 1233 Instruction* cursor = *entry; |
1234 if (I->TypeChecksEnabled()) { | 1234 if (I->flags().type_checks()) { |
1235 // Only type check for the value. A type check for the index is not | 1235 // Only type check for the value. A type check for the index is not |
1236 // needed here because we insert a deoptimizing smi-check for the case | 1236 // needed here because we insert a deoptimizing smi-check for the case |
1237 // the index is not a smi. | 1237 // the index is not a smi. |
1238 const AbstractType& value_type = | 1238 const AbstractType& value_type = |
1239 AbstractType::ZoneHandle(Z, target.ParameterTypeAt(2)); | 1239 AbstractType::ZoneHandle(Z, target.ParameterTypeAt(2)); |
1240 Definition* instantiator = NULL; | 1240 Definition* instantiator = NULL; |
1241 Definition* type_args = NULL; | 1241 Definition* type_args = NULL; |
1242 switch (array_cid) { | 1242 switch (array_cid) { |
1243 case kArrayCid: | 1243 case kArrayCid: |
1244 case kGrowableObjectArrayCid: { | 1244 case kGrowableObjectArrayCid: { |
(...skipping 3318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4563 if (!instr->can_pack_into_smi()) | 4563 if (!instr->can_pack_into_smi()) |
4564 instr->set_representation(kUnboxedMint); | 4564 instr->set_representation(kUnboxedMint); |
4565 #endif | 4565 #endif |
4566 } | 4566 } |
4567 | 4567 |
4568 | 4568 |
4569 bool FlowGraphOptimizer::TryInlineInstanceSetter(InstanceCallInstr* instr, | 4569 bool FlowGraphOptimizer::TryInlineInstanceSetter(InstanceCallInstr* instr, |
4570 const ICData& unary_ic_data) { | 4570 const ICData& unary_ic_data) { |
4571 ASSERT((unary_ic_data.NumberOfChecks() > 0) && | 4571 ASSERT((unary_ic_data.NumberOfChecks() > 0) && |
4572 (unary_ic_data.NumArgsTested() == 1)); | 4572 (unary_ic_data.NumArgsTested() == 1)); |
4573 if (I->TypeChecksEnabled()) { | 4573 if (I->flags().type_checks()) { |
4574 // Checked mode setters are inlined like normal methods by conventional | 4574 // Checked mode setters are inlined like normal methods by conventional |
4575 // inlining. | 4575 // inlining. |
4576 return false; | 4576 return false; |
4577 } | 4577 } |
4578 | 4578 |
4579 ASSERT(instr->HasICData()); | 4579 ASSERT(instr->HasICData()); |
4580 if (unary_ic_data.NumberOfChecks() == 0) { | 4580 if (unary_ic_data.NumberOfChecks() == 0) { |
4581 // No type feedback collected. | 4581 // No type feedback collected. |
4582 return false; | 4582 return false; |
4583 } | 4583 } |
(...skipping 4083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8667 | 8667 |
8668 // Insert materializations at environment uses. | 8668 // Insert materializations at environment uses. |
8669 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 8669 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
8670 CreateMaterializationAt( | 8670 CreateMaterializationAt( |
8671 exits_collector_.exits()[i], alloc, *slots); | 8671 exits_collector_.exits()[i], alloc, *slots); |
8672 } | 8672 } |
8673 } | 8673 } |
8674 | 8674 |
8675 | 8675 |
8676 } // namespace dart | 8676 } // namespace dart |
OLD | NEW |