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

Unified Diff: test/unittests/compiler/instruction-selector-unittest.cc

Issue 1114163005: [turbofan] Fix tail call optimization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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
Index: test/unittests/compiler/instruction-selector-unittest.cc
diff --git a/test/unittests/compiler/instruction-selector-unittest.cc b/test/unittests/compiler/instruction-selector-unittest.cc
index ab2623091ad509755e9282a2d8493651d70280f5..dfdb4c2b1f85bebc47afe1bf934523b20f4f5464 100644
--- a/test/unittests/compiler/instruction-selector-unittest.cc
+++ b/test/unittests/compiler/instruction-selector-unittest.cc
@@ -4,7 +4,6 @@
#include "test/unittests/compiler/instruction-selector-unittest.h"
-#include "src/code-stubs.h"
#include "src/compiler/graph.h"
#include "src/compiler/schedule.h"
#include "src/flags.h"
@@ -593,53 +592,6 @@ TARGET_TEST_F(InstructionSelectorTest,
EXPECT_EQ(index, s.size());
}
-
-// -----------------------------------------------------------------------------
-// Tail calls.
-
-TARGET_TEST_F(InstructionSelectorTest, TailCall) {
- for (int mode = 0; mode < 2; ++mode) {
- bool supports_tail_calls = FLAG_turbo_tail_calls && (mode == 0);
-
- StreamBuilder m(this, kMachAnyTagged);
- Node* start = m.graph()->start();
- Node* undefined = m.UndefinedConstant();
-
- StringLengthStub stub(isolate());
- CallDescriptor* desc = Linkage::GetStubCallDescriptor(
- isolate(), zone(), stub.GetCallInterfaceDescriptor(), 0,
- supports_tail_calls ? CallDescriptor::kSupportsTailCalls
- : CallDescriptor::kNoFlags,
- Operator::kNoProperties);
- Node* stub_node = m.NewNode(m.common()->HeapConstant(
- Unique<Code>::CreateUninitialized(stub.GetCode())));
-
- Node* call = m.NewNode(m.common()->Call(desc), stub_node, undefined,
- undefined, undefined, undefined, undefined);
- call->AppendInput(zone(), start); // effect
- call->AppendInput(zone(), start); // control
-
- m.Return(call);
- Node* ret = *call->uses().begin();
- ret->AppendInput(zone(), call); // effect
- ret->AppendInput(zone(), start); // control
-
- Stream s = m.Build(kAllInstructions);
- if (supports_tail_calls) {
- ASSERT_EQ(3U, s.size());
- EXPECT_EQ(kArchNop, s[0]->arch_opcode());
- EXPECT_EQ(kArchTailCallCodeObject, s[1]->arch_opcode());
- EXPECT_EQ(kArchNop, s[2]->arch_opcode());
- } else {
- ASSERT_EQ(4U, s.size());
- EXPECT_EQ(kArchNop, s[0]->arch_opcode());
- EXPECT_EQ(kArchCallCodeObject, s[1]->arch_opcode());
- EXPECT_EQ(kArchRet, s[2]->arch_opcode());
- EXPECT_EQ(kArchNop, s[3]->arch_opcode());
- }
- }
-}
-
} // namespace compiler
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698