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 2017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2028 } else if (HasOnlyTwoOf(ic_data, kInt32x4Cid)) { | 2028 } else if (HasOnlyTwoOf(ic_data, kInt32x4Cid)) { |
2029 ASSERT(op_kind != Token::kMUL); // Int32x4 doesn't have a multiply op. | 2029 ASSERT(op_kind != Token::kMUL); // Int32x4 doesn't have a multiply op. |
2030 operands_type = kInt32x4Cid; | 2030 operands_type = kInt32x4Cid; |
2031 } else if (HasOnlyTwoOf(ic_data, kFloat64x2Cid)) { | 2031 } else if (HasOnlyTwoOf(ic_data, kFloat64x2Cid)) { |
2032 operands_type = kFloat64x2Cid; | 2032 operands_type = kFloat64x2Cid; |
2033 } else { | 2033 } else { |
2034 return false; | 2034 return false; |
2035 } | 2035 } |
2036 break; | 2036 break; |
2037 case Token::kDIV: | 2037 case Token::kDIV: |
| 2038 if (!FlowGraphCompiler::SupportsHardwareDivision()) return false; |
2038 if (ShouldSpecializeForDouble(ic_data) || | 2039 if (ShouldSpecializeForDouble(ic_data) || |
2039 HasOnlyTwoOf(ic_data, kSmiCid)) { | 2040 HasOnlyTwoOf(ic_data, kSmiCid)) { |
2040 operands_type = kDoubleCid; | 2041 operands_type = kDoubleCid; |
2041 } else if (HasOnlyTwoOf(ic_data, kFloat32x4Cid)) { | 2042 } else if (HasOnlyTwoOf(ic_data, kFloat32x4Cid)) { |
2042 operands_type = kFloat32x4Cid; | 2043 operands_type = kFloat32x4Cid; |
2043 } else if (HasOnlyTwoOf(ic_data, kFloat64x2Cid)) { | 2044 } else if (HasOnlyTwoOf(ic_data, kFloat64x2Cid)) { |
2044 operands_type = kFloat64x2Cid; | 2045 operands_type = kFloat64x2Cid; |
2045 } else { | 2046 } else { |
2046 return false; | 2047 return false; |
2047 } | 2048 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2080 return false; | 2081 return false; |
2081 } | 2082 } |
2082 // Check for smi/mint << smi or smi/mint >> smi. | 2083 // Check for smi/mint << smi or smi/mint >> smi. |
2083 operands_type = kMintCid; | 2084 operands_type = kMintCid; |
2084 } else { | 2085 } else { |
2085 return false; | 2086 return false; |
2086 } | 2087 } |
2087 break; | 2088 break; |
2088 case Token::kMOD: | 2089 case Token::kMOD: |
2089 case Token::kTRUNCDIV: | 2090 case Token::kTRUNCDIV: |
| 2091 if (!FlowGraphCompiler::SupportsHardwareDivision()) return false; |
2090 if (HasOnlyTwoOf(ic_data, kSmiCid)) { | 2092 if (HasOnlyTwoOf(ic_data, kSmiCid)) { |
2091 if (ic_data.HasDeoptReason(ICData::kDeoptBinarySmiOp)) { | 2093 if (ic_data.HasDeoptReason(ICData::kDeoptBinarySmiOp)) { |
2092 return false; | 2094 return false; |
2093 } | 2095 } |
2094 operands_type = kSmiCid; | 2096 operands_type = kSmiCid; |
2095 } else { | 2097 } else { |
2096 return false; | 2098 return false; |
2097 } | 2099 } |
2098 break; | 2100 break; |
2099 default: | 2101 default: |
(...skipping 6509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8609 | 8611 |
8610 // Insert materializations at environment uses. | 8612 // Insert materializations at environment uses. |
8611 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 8613 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
8612 CreateMaterializationAt( | 8614 CreateMaterializationAt( |
8613 exits_collector_.exits()[i], alloc, *slots); | 8615 exits_collector_.exits()[i], alloc, *slots); |
8614 } | 8616 } |
8615 } | 8617 } |
8616 | 8618 |
8617 | 8619 |
8618 } // namespace dart | 8620 } // namespace dart |
OLD | NEW |