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

Unified Diff: test/cctest/compiler/test-run-machops.cc

Issue 2874713003: [turbofan] Reland of `Add alignment parameter to StackSlot operator` (Closed)
Patch Set: Fix failures with control flow integrity bots Created 3 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 | « src/compiler/x87/instruction-selector-x87.cc ('k') | test/unittests/compiler/int64-lowering-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-machops.cc
diff --git a/test/cctest/compiler/test-run-machops.cc b/test/cctest/compiler/test-run-machops.cc
index 2092dc9c63631b4494444263245d2db4c33f7c3b..3da6b261d781afd70d91c71e433e17fad9cd9cc5 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -6739,6 +6739,34 @@ TEST(ParentFramePointer) {
CHECK_EQ(1, r.Call(1));
}
+#if V8_HOST_ARCH_MIPS || V8_HOST_ARCH_MIPS64
+
+TEST(StackSlotAlignment) {
+ RawMachineAssemblerTester<int32_t> r;
+ RawMachineLabel tlabel;
+ RawMachineLabel flabel;
+ RawMachineLabel merge;
+
+ int alignments[] = {4, 8, 16};
+ int alignment_count = arraysize(alignments);
+
+ Node* alignment_counter = r.Int32Constant(0);
+ for (int i = 0; i < alignment_count; i++) {
+ for (int j = 0; j < 5; j++) {
+ Node* stack_slot =
+ r.StackSlot(MachineRepresentation::kWord32, alignments[i]);
+ alignment_counter = r.Int32Add(
+ alignment_counter,
+ r.Word32And(stack_slot, r.Int32Constant(alignments[i] - 1)));
+ }
+ }
+
+ r.Return(alignment_counter);
+ CHECK_EQ(0, r.Call(1));
+}
+
+#endif // V8_HOST_ARCH_MIPS || V8_HOST_ARCH_MIPS64
+
#if V8_TARGET_ARCH_64_BIT
TEST(Regression5923) {
« no previous file with comments | « src/compiler/x87/instruction-selector-x87.cc ('k') | test/unittests/compiler/int64-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698