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

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

Issue 515723004: Deoptimize context value in Turbofan (and Crankshaft). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix tests. Created 6 years, 4 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 | « test/cctest/compiler/test-scheduler.cc ('k') | test/mjsunit/debug-clearbreakpointgroup.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/compiler-unittests/instruction-selector-unittest.cc
diff --git a/test/compiler-unittests/instruction-selector-unittest.cc b/test/compiler-unittests/instruction-selector-unittest.cc
index 1cf46f8728717d01f73d615ac72dfc930529a1d6..6d6d6bbba57ebc667cb48eda90842dc1ffff7bfc 100644
--- a/test/compiler-unittests/instruction-selector-unittest.cc
+++ b/test/compiler-unittests/instruction-selector-unittest.cc
@@ -338,9 +338,10 @@ TARGET_TEST_F(InstructionSelectorTest, CallJSFunctionWithDeopt) {
Node* parameters = m.NewNode(m.common()->StateValues(1), m.Int32Constant(1));
Node* locals = m.NewNode(m.common()->StateValues(0));
Node* stack = m.NewNode(m.common()->StateValues(0));
+ Node* context_sentinel = m.Int32Constant(0);
- Node* state_node =
- m.NewNode(m.common()->FrameState(bailout_id), parameters, locals, stack);
+ Node* state_node = m.NewNode(m.common()->FrameState(bailout_id), parameters,
+ locals, stack, context_sentinel);
m.Deoptimize(state_node);
Stream s = m.Build(kAllExceptNopInstructions);
@@ -376,8 +377,10 @@ TARGET_TEST_F(InstructionSelectorTest, CallFunctionStubWithDeopt) {
Node* parameters = m.NewNode(m.common()->StateValues(1), m.Int32Constant(43));
Node* locals = m.NewNode(m.common()->StateValues(1), m.Int32Constant(44));
Node* stack = m.NewNode(m.common()->StateValues(1), m.Int32Constant(45));
- Node* frame_state_before = m.NewNode(
- m.common()->FrameState(bailout_id_before), parameters, locals, stack);
+ Node* context_sentinel = m.Int32Constant(0);
+ Node* frame_state_before =
+ m.NewNode(m.common()->FrameState(bailout_id_before), parameters, locals,
+ stack, context_sentinel);
StreamBuilder::Label deopt, cont;
// Build the call.
@@ -397,8 +400,9 @@ TARGET_TEST_F(InstructionSelectorTest, CallFunctionStubWithDeopt) {
Node* stack_after =
m.NewNode(m.common()->StateValues(2), m.Int32Constant(55), call);
- Node* frame_state_after = m.NewNode(m.common()->FrameState(bailout_id_after),
- parameters, locals, stack_after);
+ Node* frame_state_after =
+ m.NewNode(m.common()->FrameState(bailout_id_after), parameters, locals,
+ stack_after, context_sentinel);
m.Deoptimize(frame_state_after);
Stream s = m.Build(kAllExceptNopInstructions);
@@ -417,7 +421,7 @@ TARGET_TEST_F(InstructionSelectorTest, CallFunctionStubWithDeopt) {
size_t num_operands =
1 + // Code object.
1 +
- 3 + // Frame state deopt id + one input for each value in frame state.
+ 4 + // Frame state deopt id + one input for each value in frame state.
1 + // Function.
1 + // Context.
2; // Continuation and deoptimization block labels.
@@ -434,24 +438,25 @@ TARGET_TEST_F(InstructionSelectorTest, CallFunctionStubWithDeopt) {
EXPECT_EQ(1, desc_before->locals_count());
EXPECT_EQ(1, desc_before->stack_count());
EXPECT_EQ(43, s.ToInt32(call_instr->InputAt(2)));
- EXPECT_EQ(44, s.ToInt32(call_instr->InputAt(3)));
- EXPECT_EQ(45, s.ToInt32(call_instr->InputAt(4)));
+ EXPECT_EQ(0, s.ToInt32(call_instr->InputAt(3)));
+ EXPECT_EQ(44, s.ToInt32(call_instr->InputAt(4)));
+ EXPECT_EQ(45, s.ToInt32(call_instr->InputAt(5)));
// Function.
- EXPECT_EQ(function_node->id(), s.ToVreg(call_instr->InputAt(5)));
+ EXPECT_EQ(function_node->id(), s.ToVreg(call_instr->InputAt(6)));
// Context.
- EXPECT_EQ(context->id(), s.ToVreg(call_instr->InputAt(6)));
+ EXPECT_EQ(context->id(), s.ToVreg(call_instr->InputAt(7)));
// Continuation.
- EXPECT_EQ(cont.block()->id(), s.ToInt32(call_instr->InputAt(7)));
+ EXPECT_EQ(cont.block()->id(), s.ToInt32(call_instr->InputAt(8)));
// Deoptimization.
- EXPECT_EQ(deopt.block()->id(), s.ToInt32(call_instr->InputAt(8)));
+ EXPECT_EQ(deopt.block()->id(), s.ToInt32(call_instr->InputAt(9)));
EXPECT_EQ(kArchRet, s[index++]->arch_opcode());
// Check the deoptimize instruction.
const Instruction* deopt_instr = s[index++];
EXPECT_EQ(kArchDeoptimize, deopt_instr->arch_opcode());
- ASSERT_EQ(5U, deopt_instr->InputCount());
+ ASSERT_EQ(6U, deopt_instr->InputCount());
int32_t deopt_id_after = s.ToInt32(deopt_instr->InputAt(0));
FrameStateDescriptor* desc_after = s.GetDeoptimizationEntry(deopt_id_after);
EXPECT_EQ(bailout_id_after, desc_after->bailout_id());
@@ -460,9 +465,10 @@ TARGET_TEST_F(InstructionSelectorTest, CallFunctionStubWithDeopt) {
EXPECT_EQ(2, desc_after->stack_count());
// Parameter value from the frame state.
EXPECT_EQ(43, s.ToInt32(deopt_instr->InputAt(1)));
- EXPECT_EQ(44, s.ToInt32(deopt_instr->InputAt(2)));
- EXPECT_EQ(55, s.ToInt32(deopt_instr->InputAt(3)));
- EXPECT_EQ(call->id(), s.ToVreg(deopt_instr->InputAt(4)));
+ EXPECT_EQ(0, s.ToInt32(deopt_instr->InputAt(2)));
+ EXPECT_EQ(44, s.ToInt32(deopt_instr->InputAt(3)));
+ EXPECT_EQ(55, s.ToInt32(deopt_instr->InputAt(4)));
+ EXPECT_EQ(call->id(), s.ToVreg(deopt_instr->InputAt(5)));
EXPECT_EQ(index, s.size());
}
« no previous file with comments | « test/cctest/compiler/test-scheduler.cc ('k') | test/mjsunit/debug-clearbreakpointgroup.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698