| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/instruction-selector.h" | 5 #include "src/compiler/instruction-selector.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "src/base/adapters.h" | 9 #include "src/base/adapters.h" |
| 10 #include "src/compiler/instruction-selector-impl.h" | 10 #include "src/compiler/instruction-selector-impl.h" |
| (...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 case IrOpcode::kFloat64Min: | 1131 case IrOpcode::kFloat64Min: |
| 1132 return MarkAsFloat64(node), VisitFloat64Min(node); | 1132 return MarkAsFloat64(node), VisitFloat64Min(node); |
| 1133 case IrOpcode::kFloat64Max: | 1133 case IrOpcode::kFloat64Max: |
| 1134 return MarkAsFloat64(node), VisitFloat64Max(node); | 1134 return MarkAsFloat64(node), VisitFloat64Max(node); |
| 1135 case IrOpcode::kFloat64Abs: | 1135 case IrOpcode::kFloat64Abs: |
| 1136 return MarkAsFloat64(node), VisitFloat64Abs(node); | 1136 return MarkAsFloat64(node), VisitFloat64Abs(node); |
| 1137 case IrOpcode::kFloat64Atan: | 1137 case IrOpcode::kFloat64Atan: |
| 1138 return MarkAsFloat64(node), VisitFloat64Atan(node); | 1138 return MarkAsFloat64(node), VisitFloat64Atan(node); |
| 1139 case IrOpcode::kFloat64Atan2: | 1139 case IrOpcode::kFloat64Atan2: |
| 1140 return MarkAsFloat64(node), VisitFloat64Atan2(node); | 1140 return MarkAsFloat64(node), VisitFloat64Atan2(node); |
| 1141 case IrOpcode::kFloat64Atanh: |
| 1142 return MarkAsFloat64(node), VisitFloat64Atanh(node); |
| 1141 case IrOpcode::kFloat64Exp: | 1143 case IrOpcode::kFloat64Exp: |
| 1142 return MarkAsFloat64(node), VisitFloat64Exp(node); | 1144 return MarkAsFloat64(node), VisitFloat64Exp(node); |
| 1145 case IrOpcode::kFloat64Expm1: |
| 1146 return MarkAsFloat64(node), VisitFloat64Expm1(node); |
| 1143 case IrOpcode::kFloat64Log: | 1147 case IrOpcode::kFloat64Log: |
| 1144 return MarkAsFloat64(node), VisitFloat64Log(node); | 1148 return MarkAsFloat64(node), VisitFloat64Log(node); |
| 1145 case IrOpcode::kFloat64Log1p: | 1149 case IrOpcode::kFloat64Log1p: |
| 1146 return MarkAsFloat64(node), VisitFloat64Log1p(node); | 1150 return MarkAsFloat64(node), VisitFloat64Log1p(node); |
| 1147 case IrOpcode::kFloat64Log2: | 1151 case IrOpcode::kFloat64Log2: |
| 1148 return MarkAsFloat64(node), VisitFloat64Log2(node); | 1152 return MarkAsFloat64(node), VisitFloat64Log2(node); |
| 1149 case IrOpcode::kFloat64Log10: | 1153 case IrOpcode::kFloat64Log10: |
| 1150 return MarkAsFloat64(node), VisitFloat64Log10(node); | 1154 return MarkAsFloat64(node), VisitFloat64Log10(node); |
| 1155 case IrOpcode::kFloat64Cbrt: |
| 1156 return MarkAsFloat64(node), VisitFloat64Cbrt(node); |
| 1151 case IrOpcode::kFloat64Sqrt: | 1157 case IrOpcode::kFloat64Sqrt: |
| 1152 return MarkAsFloat64(node), VisitFloat64Sqrt(node); | 1158 return MarkAsFloat64(node), VisitFloat64Sqrt(node); |
| 1153 case IrOpcode::kFloat64Equal: | 1159 case IrOpcode::kFloat64Equal: |
| 1154 return VisitFloat64Equal(node); | 1160 return VisitFloat64Equal(node); |
| 1155 case IrOpcode::kFloat64LessThan: | 1161 case IrOpcode::kFloat64LessThan: |
| 1156 return VisitFloat64LessThan(node); | 1162 return VisitFloat64LessThan(node); |
| 1157 case IrOpcode::kFloat64LessThanOrEqual: | 1163 case IrOpcode::kFloat64LessThanOrEqual: |
| 1158 return VisitFloat64LessThanOrEqual(node); | 1164 return VisitFloat64LessThanOrEqual(node); |
| 1159 case IrOpcode::kFloat32RoundDown: | 1165 case IrOpcode::kFloat32RoundDown: |
| 1160 return MarkAsFloat32(node), VisitFloat32RoundDown(node); | 1166 return MarkAsFloat32(node), VisitFloat32RoundDown(node); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1254 } | 1260 } |
| 1255 | 1261 |
| 1256 void InstructionSelector::VisitFloat64Atan(Node* node) { | 1262 void InstructionSelector::VisitFloat64Atan(Node* node) { |
| 1257 VisitFloat64Ieee754Unop(node, kIeee754Float64Atan); | 1263 VisitFloat64Ieee754Unop(node, kIeee754Float64Atan); |
| 1258 } | 1264 } |
| 1259 | 1265 |
| 1260 void InstructionSelector::VisitFloat64Atan2(Node* node) { | 1266 void InstructionSelector::VisitFloat64Atan2(Node* node) { |
| 1261 VisitFloat64Ieee754Binop(node, kIeee754Float64Atan2); | 1267 VisitFloat64Ieee754Binop(node, kIeee754Float64Atan2); |
| 1262 } | 1268 } |
| 1263 | 1269 |
| 1270 void InstructionSelector::VisitFloat64Atanh(Node* node) { |
| 1271 VisitFloat64Ieee754Unop(node, kIeee754Float64Atanh); |
| 1272 } |
| 1273 |
| 1264 void InstructionSelector::VisitFloat64Exp(Node* node) { | 1274 void InstructionSelector::VisitFloat64Exp(Node* node) { |
| 1265 VisitFloat64Ieee754Unop(node, kIeee754Float64Exp); | 1275 VisitFloat64Ieee754Unop(node, kIeee754Float64Exp); |
| 1266 } | 1276 } |
| 1267 | 1277 |
| 1278 void InstructionSelector::VisitFloat64Expm1(Node* node) { |
| 1279 VisitFloat64Ieee754Unop(node, kIeee754Float64Expm1); |
| 1280 } |
| 1281 |
| 1268 void InstructionSelector::VisitFloat64Log(Node* node) { | 1282 void InstructionSelector::VisitFloat64Log(Node* node) { |
| 1269 VisitFloat64Ieee754Unop(node, kIeee754Float64Log); | 1283 VisitFloat64Ieee754Unop(node, kIeee754Float64Log); |
| 1270 } | 1284 } |
| 1271 | 1285 |
| 1272 void InstructionSelector::VisitFloat64Log1p(Node* node) { | 1286 void InstructionSelector::VisitFloat64Log1p(Node* node) { |
| 1273 VisitFloat64Ieee754Unop(node, kIeee754Float64Log1p); | 1287 VisitFloat64Ieee754Unop(node, kIeee754Float64Log1p); |
| 1274 } | 1288 } |
| 1275 | 1289 |
| 1276 void InstructionSelector::VisitFloat64Log2(Node* node) { | 1290 void InstructionSelector::VisitFloat64Log2(Node* node) { |
| 1277 VisitFloat64Ieee754Unop(node, kIeee754Float64Log2); | 1291 VisitFloat64Ieee754Unop(node, kIeee754Float64Log2); |
| 1278 } | 1292 } |
| 1279 | 1293 |
| 1280 void InstructionSelector::VisitFloat64Log10(Node* node) { | 1294 void InstructionSelector::VisitFloat64Log10(Node* node) { |
| 1281 VisitFloat64Ieee754Unop(node, kIeee754Float64Log10); | 1295 VisitFloat64Ieee754Unop(node, kIeee754Float64Log10); |
| 1282 } | 1296 } |
| 1283 | 1297 |
| 1298 void InstructionSelector::VisitFloat64Cbrt(Node* node) { |
| 1299 VisitFloat64Ieee754Unop(node, kIeee754Float64Cbrt); |
| 1300 } |
| 1301 |
| 1284 void InstructionSelector::EmitTableSwitch(const SwitchInfo& sw, | 1302 void InstructionSelector::EmitTableSwitch(const SwitchInfo& sw, |
| 1285 InstructionOperand& index_operand) { | 1303 InstructionOperand& index_operand) { |
| 1286 OperandGenerator g(this); | 1304 OperandGenerator g(this); |
| 1287 size_t input_count = 2 + sw.value_range; | 1305 size_t input_count = 2 + sw.value_range; |
| 1288 auto* inputs = zone()->NewArray<InstructionOperand>(input_count); | 1306 auto* inputs = zone()->NewArray<InstructionOperand>(input_count); |
| 1289 inputs[0] = index_operand; | 1307 inputs[0] = index_operand; |
| 1290 InstructionOperand default_operand = g.Label(sw.default_branch); | 1308 InstructionOperand default_operand = g.Label(sw.default_branch); |
| 1291 std::fill(&inputs[1], &inputs[input_count], default_operand); | 1309 std::fill(&inputs[1], &inputs[input_count], default_operand); |
| 1292 for (size_t index = 0; index < sw.case_count; ++index) { | 1310 for (size_t index = 0; index < sw.case_count; ++index) { |
| 1293 size_t value = sw.case_values[index] - sw.min_value; | 1311 size_t value = sw.case_values[index] - sw.min_value; |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1895 return new (instruction_zone()) FrameStateDescriptor( | 1913 return new (instruction_zone()) FrameStateDescriptor( |
| 1896 instruction_zone(), state_info.type(), state_info.bailout_id(), | 1914 instruction_zone(), state_info.type(), state_info.bailout_id(), |
| 1897 state_info.state_combine(), parameters, locals, stack, | 1915 state_info.state_combine(), parameters, locals, stack, |
| 1898 state_info.shared_info(), outer_state); | 1916 state_info.shared_info(), outer_state); |
| 1899 } | 1917 } |
| 1900 | 1918 |
| 1901 | 1919 |
| 1902 } // namespace compiler | 1920 } // namespace compiler |
| 1903 } // namespace internal | 1921 } // namespace internal |
| 1904 } // namespace v8 | 1922 } // namespace v8 |
| OLD | NEW |