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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/wasm/asm-wasm-builder.h" | 7 #include "src/wasm/asm-wasm-builder.h" |
8 #include "src/wasm/wasm-macro-gen.h" | 8 #include "src/wasm/wasm-macro-gen.h" |
9 #include "src/wasm/wasm-opcodes.h" | 9 #include "src/wasm/wasm-opcodes.h" |
10 | 10 |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 return MatchShr(expr); | 647 return MatchShr(expr); |
648 case Token::BIT_XOR: | 648 case Token::BIT_XOR: |
649 return MatchXor(expr); | 649 return MatchXor(expr); |
650 case Token::MUL: | 650 case Token::MUL: |
651 return MatchMul(expr); | 651 return MatchMul(expr); |
652 default: | 652 default: |
653 return kNone; | 653 return kNone; |
654 } | 654 } |
655 } | 655 } |
656 | 656 |
| 657 // Work around Mul + Div being defined in PPC assembler. |
| 658 #ifdef Mul |
| 659 #undef Mul |
| 660 #endif |
| 661 #ifdef Div |
| 662 #undef Div |
| 663 #endif |
| 664 |
657 #define NON_SIGNED_BINOP(op) \ | 665 #define NON_SIGNED_BINOP(op) \ |
658 static WasmOpcode opcodes[] = { \ | 666 static WasmOpcode opcodes[] = { \ |
659 kExprI32##op, \ | 667 kExprI32##op, \ |
660 kExprI32##op, \ | 668 kExprI32##op, \ |
661 kExprF32##op, \ | 669 kExprF32##op, \ |
662 kExprF64##op \ | 670 kExprF64##op \ |
663 } | 671 } |
664 | 672 |
665 #define SIGNED_BINOP(op) \ | 673 #define SIGNED_BINOP(op) \ |
666 static WasmOpcode opcodes[] = { \ | 674 static WasmOpcode opcodes[] = { \ |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 // that zone in constructor may be thrown away once wasm module is written. | 1000 // that zone in constructor may be thrown away once wasm module is written. |
993 WasmModuleIndex* AsmWasmBuilder::Run() { | 1001 WasmModuleIndex* AsmWasmBuilder::Run() { |
994 AsmWasmBuilderImpl impl(isolate_, zone_, literal_); | 1002 AsmWasmBuilderImpl impl(isolate_, zone_, literal_); |
995 impl.Compile(); | 1003 impl.Compile(); |
996 WasmModuleWriter* writer = impl.builder_->Build(zone_); | 1004 WasmModuleWriter* writer = impl.builder_->Build(zone_); |
997 return writer->WriteTo(zone_); | 1005 return writer->WriteTo(zone_); |
998 } | 1006 } |
999 } // namespace wasm | 1007 } // namespace wasm |
1000 } // namespace internal | 1008 } // namespace internal |
1001 } // namespace v8 | 1009 } // namespace v8 |
OLD | NEW |