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

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

Issue 2138243002: [wasm] allow array access with unsigned indices (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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/regress/regress-618608.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/asmjs/typing-asm.cc
diff --git a/src/asmjs/typing-asm.cc b/src/asmjs/typing-asm.cc
index 01db88aa94ad0acdab6a9d776a97fcf0084a9357..5bba85bbcfd3b6a5fbb3a0fa3ff1d9601b851c47 100644
--- a/src/asmjs/typing-asm.cc
+++ b/src/asmjs/typing-asm.cc
@@ -763,14 +763,14 @@ void AsmTyper::VisitHeapAccess(Property* expr, bool assigning,
// FAIL(right, "call mask must match function table");
// }
// bin->set_bounds(Bounds(cache_.kAsmSigned));
- RECURSE(VisitWithExpectation(expr->key(), cache_.kAsmSigned,
- "must be integer"));
+ RECURSE(VisitWithExpectation(expr->key(), cache_.kAsmUnsigned,
+ "must be unsigned"));
RECURSE(IntersectResult(expr, type));
} else {
Literal* literal = expr->key()->AsLiteral();
if (literal) {
- RECURSE(VisitWithExpectation(literal, cache_.kAsmSigned,
- "array index expected to be integer"));
+ RECURSE(VisitWithExpectation(literal, cache_.kAsmUnsigned,
+ "array index expected to be unsigned"));
} else {
int expected_shift = ElementShiftSize(type);
if (expected_shift == 0) {
@@ -780,7 +780,7 @@ void AsmTyper::VisitHeapAccess(Property* expr, bool assigning,
if (bin == nullptr || bin->op() != Token::SAR) {
FAIL(expr->key(), "expected >> in heap access");
}
- RECURSE(VisitWithExpectation(bin->left(), cache_.kAsmSigned,
+ RECURSE(VisitWithExpectation(bin->left(), cache_.kAsmInt,
bradnelson 2016/07/11 22:40:24 I think this can only be int for int8 / uint8
bradn 2016/07/11 23:02:59 nm, you are correct.
"array index expected to be integer"));
Literal* right = bin->right()->AsLiteral();
if (right == nullptr || right->raw_value()->ContainsDot()) {
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-618608.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698