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

Unified Diff: src/s390/macro-assembler-s390.h

Issue 1822103002: S390:[crankshaft] Sign-ext key before array access (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « src/crankshaft/s390/lithium-codegen-s390.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/s390/macro-assembler-s390.h
diff --git a/src/s390/macro-assembler-s390.h b/src/s390/macro-assembler-s390.h
index 09310c5ea6248c577e776f54fe35d5bf45d78d89..5b38e30a0dfb3a53fa6c8b55cca6e14e89644818 100644
--- a/src/s390/macro-assembler-s390.h
+++ b/src/s390/macro-assembler-s390.h
@@ -1588,6 +1588,12 @@ class MacroAssembler : public Assembler {
if (isSmi) {
SmiToArrayOffset(dst, src, elementSizeLog2);
} else {
+#if V8_TARGET_ARCH_S390X
+ // src (key) is a 32-bit integer. Sign extension ensures
+ // upper 32-bit does not contain garbage before being used to
+ // reference memory.
+ lgfr(src, src);
+#endif
ShiftLeftP(dst, src, Operand(elementSizeLog2));
}
}
« no previous file with comments | « src/crankshaft/s390/lithium-codegen-s390.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698