OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/wasm-compiler.h" | 5 #include "src/compiler/wasm-compiler.h" |
6 | 6 |
7 #include "src/isolate-inl.h" | 7 #include "src/isolate-inl.h" |
8 | 8 |
9 #include "src/base/platform/elapsed-timer.h" | 9 #include "src/base/platform/elapsed-timer.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 return BuildF32Min(left, right); | 600 return BuildF32Min(left, right); |
601 case wasm::kExprF64Min: | 601 case wasm::kExprF64Min: |
602 return BuildF64Min(left, right); | 602 return BuildF64Min(left, right); |
603 case wasm::kExprF32Max: | 603 case wasm::kExprF32Max: |
604 return BuildF32Max(left, right); | 604 return BuildF32Max(left, right); |
605 case wasm::kExprF64Max: | 605 case wasm::kExprF64Max: |
606 return BuildF64Max(left, right); | 606 return BuildF64Max(left, right); |
607 case wasm::kExprF64Pow: | 607 case wasm::kExprF64Pow: |
608 return BuildF64Pow(left, right); | 608 return BuildF64Pow(left, right); |
609 case wasm::kExprF64Atan2: | 609 case wasm::kExprF64Atan2: |
610 return BuildF64Atan2(left, right); | 610 op = m->Float64Atan2(); |
| 611 break; |
611 case wasm::kExprF64Mod: | 612 case wasm::kExprF64Mod: |
612 return BuildF64Mod(left, right); | 613 return BuildF64Mod(left, right); |
613 case wasm::kExprI32AsmjsDivS: | 614 case wasm::kExprI32AsmjsDivS: |
614 return BuildI32AsmjsDivS(left, right); | 615 return BuildI32AsmjsDivS(left, right); |
615 case wasm::kExprI32AsmjsDivU: | 616 case wasm::kExprI32AsmjsDivU: |
616 return BuildI32AsmjsDivU(left, right); | 617 return BuildI32AsmjsDivU(left, right); |
617 case wasm::kExprI32AsmjsRemS: | 618 case wasm::kExprI32AsmjsRemS: |
618 return BuildI32AsmjsRemS(left, right); | 619 return BuildI32AsmjsRemS(left, right); |
619 case wasm::kExprI32AsmjsRemU: | 620 case wasm::kExprI32AsmjsRemU: |
620 return BuildI32AsmjsRemU(left, right); | 621 return BuildI32AsmjsRemU(left, right); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 return BuildF64NearestInt(input); | 775 return BuildF64NearestInt(input); |
775 op = m->Float64RoundTiesEven().op(); | 776 op = m->Float64RoundTiesEven().op(); |
776 break; | 777 break; |
777 } | 778 } |
778 case wasm::kExprF64Acos: { | 779 case wasm::kExprF64Acos: { |
779 return BuildF64Acos(input); | 780 return BuildF64Acos(input); |
780 } | 781 } |
781 case wasm::kExprF64Asin: { | 782 case wasm::kExprF64Asin: { |
782 return BuildF64Asin(input); | 783 return BuildF64Asin(input); |
783 } | 784 } |
784 case wasm::kExprF64Atan: { | 785 case wasm::kExprF64Atan: |
785 return BuildF64Atan(input); | 786 op = m->Float64Atan(); |
786 } | 787 break; |
787 case wasm::kExprF64Cos: { | 788 case wasm::kExprF64Cos: { |
788 return BuildF64Cos(input); | 789 return BuildF64Cos(input); |
789 } | 790 } |
790 case wasm::kExprF64Sin: { | 791 case wasm::kExprF64Sin: { |
791 return BuildF64Sin(input); | 792 return BuildF64Sin(input); |
792 } | 793 } |
793 case wasm::kExprF64Tan: { | 794 case wasm::kExprF64Tan: { |
794 return BuildF64Tan(input); | 795 return BuildF64Tan(input); |
795 } | 796 } |
796 case wasm::kExprF64Exp: { | 797 case wasm::kExprF64Exp: { |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 return BuildCFuncInstruction(ref, type, input); | 1342 return BuildCFuncInstruction(ref, type, input); |
1342 } | 1343 } |
1343 | 1344 |
1344 Node* WasmGraphBuilder::BuildF64Asin(Node* input) { | 1345 Node* WasmGraphBuilder::BuildF64Asin(Node* input) { |
1345 MachineType type = MachineType::Float64(); | 1346 MachineType type = MachineType::Float64(); |
1346 ExternalReference ref = | 1347 ExternalReference ref = |
1347 ExternalReference::f64_asin_wrapper_function(jsgraph()->isolate()); | 1348 ExternalReference::f64_asin_wrapper_function(jsgraph()->isolate()); |
1348 return BuildCFuncInstruction(ref, type, input); | 1349 return BuildCFuncInstruction(ref, type, input); |
1349 } | 1350 } |
1350 | 1351 |
1351 Node* WasmGraphBuilder::BuildF64Atan(Node* input) { | |
1352 MachineType type = MachineType::Float64(); | |
1353 ExternalReference ref = | |
1354 ExternalReference::f64_atan_wrapper_function(jsgraph()->isolate()); | |
1355 return BuildCFuncInstruction(ref, type, input); | |
1356 } | |
1357 | |
1358 Node* WasmGraphBuilder::BuildF64Cos(Node* input) { | 1352 Node* WasmGraphBuilder::BuildF64Cos(Node* input) { |
1359 MachineType type = MachineType::Float64(); | 1353 MachineType type = MachineType::Float64(); |
1360 ExternalReference ref = | 1354 ExternalReference ref = |
1361 ExternalReference::f64_cos_wrapper_function(jsgraph()->isolate()); | 1355 ExternalReference::f64_cos_wrapper_function(jsgraph()->isolate()); |
1362 return BuildCFuncInstruction(ref, type, input); | 1356 return BuildCFuncInstruction(ref, type, input); |
1363 } | 1357 } |
1364 | 1358 |
1365 Node* WasmGraphBuilder::BuildF64Sin(Node* input) { | 1359 Node* WasmGraphBuilder::BuildF64Sin(Node* input) { |
1366 MachineType type = MachineType::Float64(); | 1360 MachineType type = MachineType::Float64(); |
1367 ExternalReference ref = | 1361 ExternalReference ref = |
1368 ExternalReference::f64_sin_wrapper_function(jsgraph()->isolate()); | 1362 ExternalReference::f64_sin_wrapper_function(jsgraph()->isolate()); |
1369 return BuildCFuncInstruction(ref, type, input); | 1363 return BuildCFuncInstruction(ref, type, input); |
1370 } | 1364 } |
1371 | 1365 |
1372 Node* WasmGraphBuilder::BuildF64Tan(Node* input) { | 1366 Node* WasmGraphBuilder::BuildF64Tan(Node* input) { |
1373 MachineType type = MachineType::Float64(); | 1367 MachineType type = MachineType::Float64(); |
1374 ExternalReference ref = | 1368 ExternalReference ref = |
1375 ExternalReference::f64_tan_wrapper_function(jsgraph()->isolate()); | 1369 ExternalReference::f64_tan_wrapper_function(jsgraph()->isolate()); |
1376 return BuildCFuncInstruction(ref, type, input); | 1370 return BuildCFuncInstruction(ref, type, input); |
1377 } | 1371 } |
1378 | 1372 |
1379 Node* WasmGraphBuilder::BuildF64Exp(Node* input) { | 1373 Node* WasmGraphBuilder::BuildF64Exp(Node* input) { |
1380 MachineType type = MachineType::Float64(); | 1374 MachineType type = MachineType::Float64(); |
1381 ExternalReference ref = | 1375 ExternalReference ref = |
1382 ExternalReference::f64_exp_wrapper_function(jsgraph()->isolate()); | 1376 ExternalReference::f64_exp_wrapper_function(jsgraph()->isolate()); |
1383 return BuildCFuncInstruction(ref, type, input); | 1377 return BuildCFuncInstruction(ref, type, input); |
1384 } | 1378 } |
1385 | 1379 |
1386 Node* WasmGraphBuilder::BuildF64Atan2(Node* left, Node* right) { | |
1387 MachineType type = MachineType::Float64(); | |
1388 ExternalReference ref = | |
1389 ExternalReference::f64_atan2_wrapper_function(jsgraph()->isolate()); | |
1390 return BuildCFuncInstruction(ref, type, left, right); | |
1391 } | |
1392 | |
1393 Node* WasmGraphBuilder::BuildF64Pow(Node* left, Node* right) { | 1380 Node* WasmGraphBuilder::BuildF64Pow(Node* left, Node* right) { |
1394 MachineType type = MachineType::Float64(); | 1381 MachineType type = MachineType::Float64(); |
1395 ExternalReference ref = | 1382 ExternalReference ref = |
1396 ExternalReference::f64_pow_wrapper_function(jsgraph()->isolate()); | 1383 ExternalReference::f64_pow_wrapper_function(jsgraph()->isolate()); |
1397 return BuildCFuncInstruction(ref, type, left, right); | 1384 return BuildCFuncInstruction(ref, type, left, right); |
1398 } | 1385 } |
1399 | 1386 |
1400 Node* WasmGraphBuilder::BuildF64Mod(Node* left, Node* right) { | 1387 Node* WasmGraphBuilder::BuildF64Mod(Node* left, Node* right) { |
1401 MachineType type = MachineType::Float64(); | 1388 MachineType type = MachineType::Float64(); |
1402 ExternalReference ref = | 1389 ExternalReference ref = |
(...skipping 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3297 function_->code_start_offset), | 3284 function_->code_start_offset), |
3298 compile_ms); | 3285 compile_ms); |
3299 } | 3286 } |
3300 | 3287 |
3301 return code; | 3288 return code; |
3302 } | 3289 } |
3303 | 3290 |
3304 } // namespace compiler | 3291 } // namespace compiler |
3305 } // namespace internal | 3292 } // namespace internal |
3306 } // namespace v8 | 3293 } // namespace v8 |
OLD | NEW |