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

Side by Side Diff: test/unittests/compiler/x64/instruction-selector-x64-unittest.cc

Issue 989203002: [x86] Faster/shorter code for stack checks. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "test/unittests/compiler/instruction-selector-unittest.h" 5 #include "test/unittests/compiler/instruction-selector-unittest.h"
6 6
7 #include "src/compiler/node-matchers.h" 7 #include "src/compiler/node-matchers.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 EXPECT_EQ(kSSEFloat64Sub, s[2]->arch_opcode()); 1023 EXPECT_EQ(kSSEFloat64Sub, s[2]->arch_opcode());
1024 EXPECT_EQ(kSSEFloat64Div, s[3]->arch_opcode()); 1024 EXPECT_EQ(kSSEFloat64Div, s[3]->arch_opcode());
1025 } 1025 }
1026 } 1026 }
1027 1027
1028 1028
1029 // ----------------------------------------------------------------------------- 1029 // -----------------------------------------------------------------------------
1030 // Miscellaneous. 1030 // Miscellaneous.
1031 1031
1032 1032
1033 TEST_F(InstructionSelectorTest, Uint64LessThanWithLoadAndLoadStackPointer) {
1034 StreamBuilder m(this, kMachBool);
1035 Node* const sl = m.Load(
1036 kMachPtr,
1037 m.ExternalConstant(ExternalReference::address_of_stack_limit(isolate())));
1038 Node* const sp = m.LoadStackPointer();
1039 Node* const n = m.Uint64LessThan(sl, sp);
1040 m.Return(n);
1041 Stream s = m.Build();
1042 ASSERT_EQ(1U, s.size());
1043 EXPECT_EQ(kX64StackCheck, s[0]->arch_opcode());
1044 ASSERT_EQ(0U, s[0]->InputCount());
1045 ASSERT_EQ(1U, s[0]->OutputCount());
1046 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
1047 EXPECT_EQ(kFlags_set, s[0]->flags_mode());
1048 EXPECT_EQ(kUnsignedGreaterThan, s[0]->flags_condition());
1049 }
1050
1051
1033 TEST_F(InstructionSelectorTest, Word64ShlWithChangeInt32ToInt64) { 1052 TEST_F(InstructionSelectorTest, Word64ShlWithChangeInt32ToInt64) {
1034 TRACED_FORRANGE(int64_t, x, 32, 63) { 1053 TRACED_FORRANGE(int64_t, x, 32, 63) {
1035 StreamBuilder m(this, kMachInt64, kMachInt32); 1054 StreamBuilder m(this, kMachInt64, kMachInt32);
1036 Node* const p0 = m.Parameter(0); 1055 Node* const p0 = m.Parameter(0);
1037 Node* const n = m.Word64Shl(m.ChangeInt32ToInt64(p0), m.Int64Constant(x)); 1056 Node* const n = m.Word64Shl(m.ChangeInt32ToInt64(p0), m.Int64Constant(x));
1038 m.Return(n); 1057 m.Return(n);
1039 Stream s = m.Build(); 1058 Stream s = m.Build();
1040 ASSERT_EQ(1U, s.size()); 1059 ASSERT_EQ(1U, s.size());
1041 EXPECT_EQ(kX64Shl, s[0]->arch_opcode()); 1060 EXPECT_EQ(kX64Shl, s[0]->arch_opcode());
1042 ASSERT_EQ(2U, s[0]->InputCount()); 1061 ASSERT_EQ(2U, s[0]->InputCount());
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 ASSERT_EQ(1U, s[0]->InputCount()); 1142 ASSERT_EQ(1U, s[0]->InputCount());
1124 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); 1143 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
1125 ASSERT_EQ(1U, s[0]->OutputCount()); 1144 ASSERT_EQ(1U, s[0]->OutputCount());
1126 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); 1145 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
1127 } 1146 }
1128 } 1147 }
1129 1148
1130 } // namespace compiler 1149 } // namespace compiler
1131 } // namespace internal 1150 } // namespace internal
1132 } // namespace v8 1151 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698