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

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

Issue 1675903002: fix int type coercion in asm to wasm (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@indirectFunctions
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 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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