| 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 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 break; | 857 break; |
| 858 // kExprI64UConvertI32: | 858 // kExprI64UConvertI32: |
| 859 case wasm::kExprI64UConvertI32: | 859 case wasm::kExprI64UConvertI32: |
| 860 op = m->ChangeUint32ToUint64(); | 860 op = m->ChangeUint32ToUint64(); |
| 861 break; | 861 break; |
| 862 // kExprF64ReinterpretI64: | 862 // kExprF64ReinterpretI64: |
| 863 // kExprI64ReinterpretF64: | 863 // kExprI64ReinterpretF64: |
| 864 // kExprI64Clz: | 864 // kExprI64Clz: |
| 865 // kExprI64Ctz: | 865 // kExprI64Ctz: |
| 866 // kExprI64Popcnt: | 866 // kExprI64Popcnt: |
| 867 case wasm::kExprI64Popcnt: { |
| 868 if (m->Word64Popcnt().IsSupported()) { |
| 869 op = m->Word64Popcnt().op(); |
| 870 } else if (m->Is32() && m->Word32Popcnt().IsSupported()) { |
| 871 op = m->Word64PopcntPlaceholder(); |
| 872 } else { |
| 873 return BuildI64Popcnt(input); |
| 874 } |
| 875 break; |
| 876 } |
| 867 // kExprF32SConvertI64: | 877 // kExprF32SConvertI64: |
| 868 case wasm::kExprF32SConvertI64: | 878 case wasm::kExprF32SConvertI64: |
| 869 if (m->Is32()) { | 879 if (m->Is32()) { |
| 870 return BuildF32SConvertI64(input); | 880 return BuildF32SConvertI64(input); |
| 871 } | 881 } |
| 872 op = m->RoundInt64ToFloat32(); | 882 op = m->RoundInt64ToFloat32(); |
| 873 break; | 883 break; |
| 874 // kExprF32UConvertI64: | 884 // kExprF32UConvertI64: |
| 875 case wasm::kExprF32UConvertI64: | 885 case wasm::kExprF32UConvertI64: |
| 876 if (m->Is32()) { | 886 if (m->Is32()) { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 op = m->Word64Ctz().op(); | 959 op = m->Word64Ctz().op(); |
| 950 break; | 960 break; |
| 951 } else if (m->Word64ReverseBits().IsSupported()) { | 961 } else if (m->Word64ReverseBits().IsSupported()) { |
| 952 Node* reversed = graph()->NewNode(m->Word64ReverseBits().op(), input); | 962 Node* reversed = graph()->NewNode(m->Word64ReverseBits().op(), input); |
| 953 Node* result = graph()->NewNode(m->Word64Clz(), reversed); | 963 Node* result = graph()->NewNode(m->Word64Clz(), reversed); |
| 954 return result; | 964 return result; |
| 955 } else { | 965 } else { |
| 956 return BuildI64Ctz(input); | 966 return BuildI64Ctz(input); |
| 957 } | 967 } |
| 958 } | 968 } |
| 959 case wasm::kExprI64Popcnt: { | |
| 960 if (m->Word64Popcnt().IsSupported()) { | |
| 961 op = m->Word64Popcnt().op(); | |
| 962 break; | |
| 963 } else { | |
| 964 return BuildI64Popcnt(input); | |
| 965 } | |
| 966 } | |
| 967 #endif | 969 #endif |
| 968 default: | 970 default: |
| 969 op = UnsupportedOpcode(opcode); | 971 op = UnsupportedOpcode(opcode); |
| 970 } | 972 } |
| 971 return graph()->NewNode(op, input); | 973 return graph()->NewNode(op, input); |
| 972 } | 974 } |
| 973 | 975 |
| 974 | 976 |
| 975 Node* WasmGraphBuilder::Float32Constant(float value) { | 977 Node* WasmGraphBuilder::Float32Constant(float value) { |
| 976 return jsgraph()->Float32Constant(value); | 978 return jsgraph()->Float32Constant(value); |
| (...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2501 static_cast<int>(function.code_end_offset - function.code_start_offset), | 2503 static_cast<int>(function.code_end_offset - function.code_start_offset), |
| 2502 decode_ms, compile_ms); | 2504 decode_ms, compile_ms); |
| 2503 } | 2505 } |
| 2504 return code; | 2506 return code; |
| 2505 } | 2507 } |
| 2506 | 2508 |
| 2507 | 2509 |
| 2508 } // namespace compiler | 2510 } // namespace compiler |
| 2509 } // namespace internal | 2511 } // namespace internal |
| 2510 } // namespace v8 | 2512 } // namespace v8 |
| OLD | NEW |