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

Unified Diff: src/code-stub-assembler.cc

Issue 1997223002: [stubs] Enforce correct index representation on 64-bit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index 9307b87b4bd756e12bedfac35bf5bd65d85acdb2..e45e66d40069f63bf06c1ee365b9f3bc47253de5 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -1565,13 +1565,16 @@ compiler::Node* CodeStubAssembler::ElementOffsetFromIndex(Node* index_node,
if (constant_index) {
return IntPtrConstant(base_size + element_size * index);
}
+ if (Is64() && mode == INTEGER_PARAMETERS) {
+ index_node = ChangeInt32ToInt64(index_node);
+ }
if (base_size == 0) {
return (element_size_shift >= 0)
? WordShl(index_node, IntPtrConstant(element_size_shift))
: WordShr(index_node, IntPtrConstant(-element_size_shift));
}
return IntPtrAdd(
- Int32Constant(base_size),
+ IntPtrConstant(base_size),
(element_size_shift >= 0)
? WordShl(index_node, IntPtrConstant(element_size_shift))
: WordShr(index_node, IntPtrConstant(-element_size_shift)));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698