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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 case wasm::kExprF64ReinterpretI64: | 816 case wasm::kExprF64ReinterpretI64: |
817 op = m->BitcastInt64ToFloat64(); | 817 op = m->BitcastInt64ToFloat64(); |
818 break; | 818 break; |
819 case wasm::kExprI64ReinterpretF64: | 819 case wasm::kExprI64ReinterpretF64: |
820 op = m->BitcastFloat64ToInt64(); | 820 op = m->BitcastFloat64ToInt64(); |
821 break; | 821 break; |
822 case wasm::kExprI64Clz: | 822 case wasm::kExprI64Clz: |
823 op = m->Word64Clz(); | 823 op = m->Word64Clz(); |
824 break; | 824 break; |
825 case wasm::kExprI64Ctz: { | 825 case wasm::kExprI64Ctz: { |
826 if (m->Word64Ctz().IsSupported()) { | 826 OptionalOperator ctz64 = m->Word64Ctz(); |
827 op = m->Word64Ctz().op(); | 827 if (ctz64.IsSupported()) { |
| 828 op = ctz64.op(); |
828 break; | 829 break; |
829 } else if (m->Is32() && m->Word32Ctz().IsSupported()) { | 830 } else if (m->Is32() && m->Word32Ctz().IsSupported()) { |
830 op = m->Word64CtzPlaceholder(); | 831 op = ctz64.placeholder(); |
831 break; | 832 break; |
832 } else if (m->Word64ReverseBits().IsSupported()) { | 833 } else if (m->Word64ReverseBits().IsSupported()) { |
833 Node* reversed = graph()->NewNode(m->Word64ReverseBits().op(), input); | 834 Node* reversed = graph()->NewNode(m->Word64ReverseBits().op(), input); |
834 Node* result = graph()->NewNode(m->Word64Clz(), reversed); | 835 Node* result = graph()->NewNode(m->Word64Clz(), reversed); |
835 return result; | 836 return result; |
836 } else { | 837 } else { |
837 return BuildI64Ctz(input); | 838 return BuildI64Ctz(input); |
838 } | 839 } |
839 } | 840 } |
840 case wasm::kExprI64Popcnt: { | 841 case wasm::kExprI64Popcnt: { |
841 if (m->Word64Popcnt().IsSupported()) { | 842 OptionalOperator popcnt64 = m->Word64Popcnt(); |
842 op = m->Word64Popcnt().op(); | 843 if (popcnt64.IsSupported()) { |
| 844 op = popcnt64.op(); |
843 } else if (m->Is32() && m->Word32Popcnt().IsSupported()) { | 845 } else if (m->Is32() && m->Word32Popcnt().IsSupported()) { |
844 op = m->Word64PopcntPlaceholder(); | 846 op = popcnt64.placeholder(); |
845 } else { | 847 } else { |
846 return BuildI64Popcnt(input); | 848 return BuildI64Popcnt(input); |
847 } | 849 } |
848 break; | 850 break; |
849 } | 851 } |
850 case wasm::kExprI64Eqz: | 852 case wasm::kExprI64Eqz: |
851 op = m->Word64Equal(); | 853 op = m->Word64Equal(); |
852 return graph()->NewNode(op, input, jsgraph()->Int64Constant(0)); | 854 return graph()->NewNode(op, input, jsgraph()->Int64Constant(0)); |
853 case wasm::kExprF32SConvertI64: | 855 case wasm::kExprF32SConvertI64: |
854 if (m->Is32()) { | 856 if (m->Is32()) { |
(...skipping 2607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3462 function_->code_start_offset), | 3464 function_->code_start_offset), |
3463 compile_ms); | 3465 compile_ms); |
3464 } | 3466 } |
3465 | 3467 |
3466 return code; | 3468 return code; |
3467 } | 3469 } |
3468 | 3470 |
3469 } // namespace compiler | 3471 } // namespace compiler |
3470 } // namespace internal | 3472 } // namespace internal |
3471 } // namespace v8 | 3473 } // namespace v8 |
OLD | NEW |