Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Side by Side Diff: src/wasm/asm-wasm-builder.cc

Issue 1720773002: Allow bitwise-or aside from type annotations in asm->wasm conversion. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/wasm/asm-wasm.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/wasm/asm-wasm.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698