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/platform.h" | 9 #include "src/base/platform/platform.h" |
10 | 10 |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 op = UnsupportedOpcode(opcode); | 701 op = UnsupportedOpcode(opcode); |
702 } | 702 } |
703 return graph()->NewNode(op, left, right); | 703 return graph()->NewNode(op, left, right); |
704 } | 704 } |
705 | 705 |
706 | 706 |
707 Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input) { | 707 Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input) { |
708 const Operator* op; | 708 const Operator* op; |
709 MachineOperatorBuilder* m = jsgraph()->machine(); | 709 MachineOperatorBuilder* m = jsgraph()->machine(); |
710 switch (opcode) { | 710 switch (opcode) { |
711 case wasm::kExprBoolNot: | 711 case wasm::kExprI32Eqz: |
712 op = m->Word32Equal(); | 712 op = m->Word32Equal(); |
713 return graph()->NewNode(op, input, jsgraph()->Int32Constant(0)); | 713 return graph()->NewNode(op, input, jsgraph()->Int32Constant(0)); |
714 case wasm::kExprF32Abs: | 714 case wasm::kExprF32Abs: |
715 op = m->Float32Abs(); | 715 op = m->Float32Abs(); |
716 break; | 716 break; |
717 case wasm::kExprF32Neg: | 717 case wasm::kExprF32Neg: |
718 return BuildF32Neg(input); | 718 return BuildF32Neg(input); |
719 case wasm::kExprF32Sqrt: | 719 case wasm::kExprF32Sqrt: |
720 op = m->Float32Sqrt(); | 720 op = m->Float32Sqrt(); |
721 break; | 721 break; |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1689 break; | 1689 break; |
1690 default: | 1690 default: |
1691 UNREACHABLE(); | 1691 UNREACHABLE(); |
1692 return nullptr; | 1692 return nullptr; |
1693 } | 1693 } |
1694 return num; | 1694 return num; |
1695 } | 1695 } |
1696 | 1696 |
1697 | 1697 |
1698 Node* WasmGraphBuilder::Invert(Node* node) { | 1698 Node* WasmGraphBuilder::Invert(Node* node) { |
1699 return Unop(wasm::kExprBoolNot, node); | 1699 return Unop(wasm::kExprI32Eqz, node); |
1700 } | 1700 } |
1701 | 1701 |
1702 | 1702 |
1703 void WasmGraphBuilder::BuildJSToWasmWrapper(Handle<Code> wasm_code, | 1703 void WasmGraphBuilder::BuildJSToWasmWrapper(Handle<Code> wasm_code, |
1704 wasm::FunctionSig* sig) { | 1704 wasm::FunctionSig* sig) { |
1705 int params = static_cast<int>(sig->parameter_count()); | 1705 int params = static_cast<int>(sig->parameter_count()); |
1706 int count = params + 3; | 1706 int count = params + 3; |
1707 Node** args = Buffer(count); | 1707 Node** args = Buffer(count); |
1708 | 1708 |
1709 // Build the start and the JS parameter nodes. | 1709 // Build the start and the JS parameter nodes. |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2263 module_env->module->GetName(function.name_offset)); | 2263 module_env->module->GetName(function.name_offset)); |
2264 } | 2264 } |
2265 | 2265 |
2266 return code; | 2266 return code; |
2267 } | 2267 } |
2268 | 2268 |
2269 | 2269 |
2270 } // namespace compiler | 2270 } // namespace compiler |
2271 } // namespace internal | 2271 } // namespace internal |
2272 } // namespace v8 | 2272 } // namespace v8 |
OLD | NEW |