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

Unified Diff: src/wasm/asm-wasm-builder.cc

Issue 1574063005: [wasm] Fix double to int conversions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/wasm/asm-wasm.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/asm-wasm-builder.cc
diff --git a/src/wasm/asm-wasm-builder.cc b/src/wasm/asm-wasm-builder.cc
index 4340bddbd3fd455fe3cc462961f7c0f631767386..5e3da290c5dddd9d3fe1cb0da5a8257e384f6793 100644
--- a/src/wasm/asm-wasm-builder.cc
+++ b/src/wasm/asm-wasm-builder.cc
@@ -622,9 +622,7 @@ class AsmWasmBuilderImpl : public AstVisitor {
ConvertOperation MatchOr(BinaryOperation* expr) {
if (MatchIntBinaryOperation(expr, Token::BIT_OR, 0)) {
- DCHECK(TypeOf(expr->left()) == kAstI32);
- DCHECK(TypeOf(expr->right()) == kAstI32);
- return kAsIs;
+ return (TypeOf(expr->left()) == kAstI32) ? kAsIs : kToInt;
ahaas 2016/01/12 13:35:09 Why is this change only required for MatchOr and M
} else {
return kNone;
}
@@ -632,9 +630,8 @@ class AsmWasmBuilderImpl : public AstVisitor {
ConvertOperation MatchShr(BinaryOperation* expr) {
if (MatchIntBinaryOperation(expr, Token::SHR, 0)) {
- DCHECK(TypeOf(expr->left()) == kAstI32);
- DCHECK(TypeOf(expr->right()) == kAstI32);
- return kAsIs;
+ // TODO(titzer): this probably needs to be kToUint
+ return (TypeOf(expr->left()) == kAstI32) ? kAsIs : kToInt;
} else {
return kNone;
}
« 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