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

Unified Diff: test/cctest/compiler/test-simplified-lowering.cc

Issue 2183043002: [turbofan] Perform element index computation in word64 on 64-bit platforms. (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 | « src/compiler/memory-optimizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-simplified-lowering.cc
diff --git a/test/cctest/compiler/test-simplified-lowering.cc b/test/cctest/compiler/test-simplified-lowering.cc
index 1d4479bbe2a2c795008c07e5c07d40eeb394e82c..45bc1fa7075785d19bcdc0774427997214f0a562 100644
--- a/test/cctest/compiler/test-simplified-lowering.cc
+++ b/test/cctest/compiler/test-simplified-lowering.cc
@@ -1238,23 +1238,38 @@ void CheckFieldAccessArithmetic(FieldAccess access, Node* load_or_store) {
Node* CheckElementAccessArithmetic(ElementAccess access, Node* load_or_store) {
Node* index = load_or_store->InputAt(1);
if (kPointerSize == 8) {
+ Int64BinopMatcher mindex(index);
+ CHECK_EQ(IrOpcode::kInt64Add, mindex.node()->opcode());
+ CHECK(mindex.right().Is(access.header_size - access.tag()));
+
+ const int element_size_shift =
+ ElementSizeLog2Of(access.machine_type.representation());
+ Node* index;
+ if (element_size_shift) {
+ Int64BinopMatcher shl(mindex.left().node());
+ CHECK_EQ(IrOpcode::kWord64Shl, shl.node()->opcode());
+ CHECK(shl.right().Is(element_size_shift));
+ index = shl.left().node();
+ } else {
+ index = mindex.left().node();
+ }
CHECK_EQ(IrOpcode::kChangeUint32ToUint64, index->opcode());
- index = index->InputAt(0);
- }
-
- Int32BinopMatcher mindex(index);
- CHECK_EQ(IrOpcode::kInt32Add, mindex.node()->opcode());
- CHECK(mindex.right().Is(access.header_size - access.tag()));
-
- const int element_size_shift =
- ElementSizeLog2Of(access.machine_type.representation());
- if (element_size_shift) {
- Int32BinopMatcher shl(mindex.left().node());
- CHECK_EQ(IrOpcode::kWord32Shl, shl.node()->opcode());
- CHECK(shl.right().Is(element_size_shift));
- return shl.left().node();
+ return index->InputAt(0);
} else {
- return mindex.left().node();
+ Int32BinopMatcher mindex(index);
+ CHECK_EQ(IrOpcode::kInt32Add, mindex.node()->opcode());
+ CHECK(mindex.right().Is(access.header_size - access.tag()));
+
+ const int element_size_shift =
+ ElementSizeLog2Of(access.machine_type.representation());
+ if (element_size_shift) {
+ Int32BinopMatcher shl(mindex.left().node());
+ CHECK_EQ(IrOpcode::kWord32Shl, shl.node()->opcode());
+ CHECK(shl.right().Is(element_size_shift));
+ return shl.left().node();
+ } else {
+ return mindex.left().node();
+ }
}
}
« no previous file with comments | « src/compiler/memory-optimizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698