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

Unified Diff: src/asmjs/asm-typer.cc

Issue 2377903002: [wasm] [asm.js] Fix various asm.js issues. (Closed)
Patch Set: Created 4 years, 3 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 | src/asmjs/asm-wasm-builder.cc » ('j') | test/mjsunit/wasm/asm-wasm-i32.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/asmjs/asm-typer.cc
diff --git a/src/asmjs/asm-typer.cc b/src/asmjs/asm-typer.cc
index 76cdf25456dcdbc578459a9e929ee8e884fa50d3..eeac9e752b43b2ade25e964e3b5d41d6873efc18 100644
--- a/src/asmjs/asm-typer.cc
+++ b/src/asmjs/asm-typer.cc
@@ -1513,7 +1513,7 @@ AsmType* AsmTyper::ValidateCompareOperation(CompareOperation* cmp) {
}
namespace {
-bool IsNegate(BinaryOperation* binop) {
+bool IsInvert(BinaryOperation* binop) {
if (binop->op() != Token::BIT_XOR) {
return false;
}
@@ -1528,7 +1528,7 @@ bool IsNegate(BinaryOperation* binop) {
}
bool IsUnaryMinus(BinaryOperation* binop) {
- // *VIOLATION* The parser replaces uses of +x with x*1.0.
+ // *VIOLATION* The parser replaces uses of -x with x*-1.
if (binop->op() != Token::MUL) {
return false;
}
@@ -1574,7 +1574,7 @@ AsmType* AsmTyper::ValidateBinaryOperation(BinaryOperation* expr) {
}
if (IsUnaryMinus(expr)) {
- // *VIOLATION* the parser converts -x to x * -1.0.
+ // *VIOLATION* the parser converts -x to x * -1.
AsmType* left_type;
RECURSE(left_type = ValidateExpression(expr->left()));
SetTypeOf(expr->right(), left_type);
@@ -1599,11 +1599,11 @@ AsmType* AsmTyper::ValidateBinaryOperation(BinaryOperation* expr) {
case Token::BIT_AND:
return ValidateBitwiseANDExpression(expr);
case Token::BIT_XOR:
- if (IsNegate(expr)) {
+ if (IsInvert(expr)) {
auto* left = expr->left();
auto* left_as_binop = left->AsBinaryOperation();
- if (left_as_binop != nullptr && IsNegate(left_as_binop)) {
+ if (left_as_binop != nullptr && IsInvert(left_as_binop)) {
// This is the special ~~ operator.
AsmType* left_type;
RECURSE(left_type = ValidateExpression(left_as_binop->left()));
« no previous file with comments | « no previous file | src/asmjs/asm-wasm-builder.cc » ('j') | test/mjsunit/wasm/asm-wasm-i32.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698