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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 return false; | 867 return false; |
868 } | 868 } |
869 | 869 |
870 enum ConvertOperation { kNone, kAsIs, kToInt, kToDouble }; | 870 enum ConvertOperation { kNone, kAsIs, kToInt, kToDouble }; |
871 | 871 |
872 ConvertOperation MatchOr(BinaryOperation* expr) { | 872 ConvertOperation MatchOr(BinaryOperation* expr) { |
873 if (MatchIntBinaryOperation(expr, Token::BIT_OR, 0) && | 873 if (MatchIntBinaryOperation(expr, Token::BIT_OR, 0) && |
874 (TypeOf(expr->left()) == kAstI32)) { | 874 (TypeOf(expr->left()) == kAstI32)) { |
875 return kAsIs; | 875 return kAsIs; |
876 } else { | 876 } else { |
877 UNREACHABLE(); | |
878 return kNone; | 877 return kNone; |
879 } | 878 } |
880 } | 879 } |
881 | 880 |
882 ConvertOperation MatchShr(BinaryOperation* expr) { | 881 ConvertOperation MatchShr(BinaryOperation* expr) { |
883 if (MatchIntBinaryOperation(expr, Token::SHR, 0)) { | 882 if (MatchIntBinaryOperation(expr, Token::SHR, 0)) { |
884 // TODO(titzer): this probably needs to be kToUint | 883 // TODO(titzer): this probably needs to be kToUint |
885 return (TypeOf(expr->left()) == kAstI32) ? kAsIs : kToInt; | 884 return (TypeOf(expr->left()) == kAstI32) ? kAsIs : kToInt; |
886 } else { | 885 } else { |
887 return kNone; | 886 return kNone; |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 // that zone in constructor may be thrown away once wasm module is written. | 1284 // that zone in constructor may be thrown away once wasm module is written. |
1286 WasmModuleIndex* AsmWasmBuilder::Run() { | 1285 WasmModuleIndex* AsmWasmBuilder::Run() { |
1287 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, foreign_); | 1286 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, foreign_); |
1288 impl.Compile(); | 1287 impl.Compile(); |
1289 WasmModuleWriter* writer = impl.builder_->Build(zone_); | 1288 WasmModuleWriter* writer = impl.builder_->Build(zone_); |
1290 return writer->WriteTo(zone_); | 1289 return writer->WriteTo(zone_); |
1291 } | 1290 } |
1292 } // namespace wasm | 1291 } // namespace wasm |
1293 } // namespace internal | 1292 } // namespace internal |
1294 } // namespace v8 | 1293 } // namespace v8 |
OLD | NEW |