| 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 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 if (right->raw_value()->AsNumber() == val) { | 775 if (right->raw_value()->AsNumber() == val) { |
| 776 return true; | 776 return true; |
| 777 } | 777 } |
| 778 } | 778 } |
| 779 return false; | 779 return false; |
| 780 } | 780 } |
| 781 | 781 |
| 782 enum ConvertOperation { kNone, kAsIs, kToInt, kToDouble }; | 782 enum ConvertOperation { kNone, kAsIs, kToInt, kToDouble }; |
| 783 | 783 |
| 784 ConvertOperation MatchOr(BinaryOperation* expr) { | 784 ConvertOperation MatchOr(BinaryOperation* expr) { |
| 785 if (MatchIntBinaryOperation(expr, Token::BIT_OR, 0)) { | 785 if (MatchIntBinaryOperation(expr, Token::BIT_OR, 0) && |
| 786 return (TypeOf(expr->left()) == kAstI32) ? kAsIs : kToInt; | 786 (TypeOf(expr->left()) == kAstI32)) { |
| 787 return kAsIs; |
| 787 } else { | 788 } else { |
| 789 UNREACHABLE(); |
| 788 return kNone; | 790 return kNone; |
| 789 } | 791 } |
| 790 } | 792 } |
| 791 | 793 |
| 792 ConvertOperation MatchShr(BinaryOperation* expr) { | 794 ConvertOperation MatchShr(BinaryOperation* expr) { |
| 793 if (MatchIntBinaryOperation(expr, Token::SHR, 0)) { | 795 if (MatchIntBinaryOperation(expr, Token::SHR, 0)) { |
| 794 // TODO(titzer): this probably needs to be kToUint | 796 // TODO(titzer): this probably needs to be kToUint |
| 795 return (TypeOf(expr->left()) == kAstI32) ? kAsIs : kToInt; | 797 return (TypeOf(expr->left()) == kAstI32) ? kAsIs : kToInt; |
| 796 } else { | 798 } else { |
| 797 return kNone; | 799 return kNone; |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 // that zone in constructor may be thrown away once wasm module is written. | 1195 // that zone in constructor may be thrown away once wasm module is written. |
| 1194 WasmModuleIndex* AsmWasmBuilder::Run() { | 1196 WasmModuleIndex* AsmWasmBuilder::Run() { |
| 1195 AsmWasmBuilderImpl impl(isolate_, zone_, literal_); | 1197 AsmWasmBuilderImpl impl(isolate_, zone_, literal_); |
| 1196 impl.Compile(); | 1198 impl.Compile(); |
| 1197 WasmModuleWriter* writer = impl.builder_->Build(zone_); | 1199 WasmModuleWriter* writer = impl.builder_->Build(zone_); |
| 1198 return writer->WriteTo(zone_); | 1200 return writer->WriteTo(zone_); |
| 1199 } | 1201 } |
| 1200 } // namespace wasm | 1202 } // namespace wasm |
| 1201 } // namespace internal | 1203 } // namespace internal |
| 1202 } // namespace v8 | 1204 } // namespace v8 |
| OLD | NEW |