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

Unified Diff: test/cctest/compiler/test-scheduler.cc

Issue 522873002: Removal of the deoptimization block from Turbofan (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Change constant capitalization 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-schedule.cc ('k') | test/compiler-unittests/instruction-selector-unittest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-scheduler.cc
diff --git a/test/cctest/compiler/test-scheduler.cc b/test/cctest/compiler/test-scheduler.cc
index 157bdc2afdc451e6f02d5d60ce1426b681371237..5f72c17aa5af3cfa7225b497189f5a6288c6848d 100644
--- a/test/cctest/compiler/test-scheduler.cc
+++ b/test/cctest/compiler/test-scheduler.cc
@@ -1637,142 +1637,6 @@ TEST(BuildScheduleSimpleLoopWithCodeMotion) {
#if V8_TURBOFAN_TARGET
-// So we can get a real JS function.
-static Handle<JSFunction> Compile(const char* source) {
- Isolate* isolate = CcTest::i_isolate();
- Handle<String> source_code = isolate->factory()
- ->NewStringFromUtf8(CStrVector(source))
- .ToHandleChecked();
- Handle<SharedFunctionInfo> shared_function = Compiler::CompileScript(
- source_code, Handle<String>(), 0, 0, false,
- Handle<Context>(isolate->native_context()), NULL, NULL,
- v8::ScriptCompiler::kNoCompileOptions, NOT_NATIVES_CODE);
- return isolate->factory()->NewFunctionFromSharedFunctionInfo(
- shared_function, isolate->native_context());
-}
-
-
-TEST(BuildScheduleTrivialLazyDeoptCall) {
- FLAG_turbo_deoptimization = true;
-
- HandleAndZoneScope scope;
- Isolate* isolate = scope.main_isolate();
- Graph graph(scope.main_zone());
- CommonOperatorBuilder common(scope.main_zone());
- JSOperatorBuilder js_builder(scope.main_zone());
-
- InitializedHandleScope handles;
- Handle<JSFunction> function = Compile("m()");
- CompilationInfoWithZone info(function);
- Linkage linkage(&info);
-
- // Manually transcribed code for:
- // function turbo_fan_test() {
- // m();
- // }
- // where m can lazy deopt (so it has a deopt block associated with it).
-
-
- // Start //
- // ^ //
- // | (EC) //
- // | //
- // /------> Call <--------------\ //
- // / ^ ^ \ //
- // / | | \ undef //
- // / / \ \ ^ //
- // (E) | (C) / \ (C) \ (E) | //
- // | Continuation LazyDeoptimization | | //
- // \___ ^ ^ / | //
- // \ | | ______/ Framestate //
- // undef \ | (VC) | (C) / ^ //
- // \ \ | | / / //
- // Return Deoptimization ----------/ //
- // ^ ^ //
- // \ / //
- // (C) \ / (C) //
- // \ / //
- // Merge //
- // ^ //
- // | //
- // End //
-
- Handle<Object> undef_object =
- Handle<Object>(isolate->heap()->undefined_value(), isolate);
- PrintableUnique<Object> undef_constant =
- PrintableUnique<Object>::CreateUninitialized(scope.main_zone(),
- undef_object);
-
- Node* undef_node = graph.NewNode(common.HeapConstant(undef_constant));
-
- Node* start_node = graph.NewNode(common.Start(0));
-
- CallDescriptor* descriptor = linkage.GetJSCallDescriptor(0);
- Node* call_node = graph.NewNode(common.Call(descriptor),
- undef_node, // function
- undef_node, // context
- start_node, // effect
- start_node); // control
-
- Node* cont_node = graph.NewNode(common.Continuation(), call_node);
- Node* lazy_deopt_node = graph.NewNode(common.LazyDeoptimization(), call_node);
-
- Node* parameters = graph.NewNode(common.StateValues(1), undef_node);
- Node* locals = graph.NewNode(common.StateValues(0));
- Node* stack = graph.NewNode(common.StateValues(0));
-
- Node* state_node = graph.NewNode(common.FrameState(BailoutId(1234)),
- parameters, locals, stack);
-
- Node* return_node = graph.NewNode(common.Return(),
- undef_node, // return value
- call_node, // effect
- cont_node); // control
- Node* deoptimization_node = graph.NewNode(common.Deoptimize(),
- state_node, // deopt environment
- call_node, // effect
- lazy_deopt_node); // control
-
- Node* merge_node =
- graph.NewNode(common.Merge(2), return_node, deoptimization_node);
-
- Node* end_node = graph.NewNode(common.End(), merge_node);
-
- graph.SetStart(start_node);
- graph.SetEnd(end_node);
-
- Schedule* schedule = ComputeAndVerifySchedule(12, &graph);
-
- // Tests:
- // Continuation and deopt have basic blocks.
- BasicBlock* cont_block = schedule->block(cont_node);
- BasicBlock* deopt_block = schedule->block(lazy_deopt_node);
- BasicBlock* call_block = schedule->block(call_node);
- CHECK_NE(NULL, cont_block);
- CHECK_NE(NULL, deopt_block);
- CHECK_NE(NULL, call_block);
- // The basic blocks are different.
- CHECK_NE(cont_block, deopt_block);
- CHECK_NE(cont_block, call_block);
- CHECK_NE(deopt_block, call_block);
- // The call node finishes its own basic block.
- CHECK_EQ(BasicBlock::kCall, call_block->control_);
- CHECK_EQ(call_node, call_block->control_input_);
- // The lazy deopt block is deferred.
- CHECK(deopt_block->deferred_);
- CHECK(!call_block->deferred_);
- CHECK(!cont_block->deferred_);
- // The lazy deopt block contains framestate + bailout (and nothing else).
- CHECK_EQ(deoptimization_node, deopt_block->control_input_);
- CHECK_EQ(5, static_cast<int>(deopt_block->nodes_.size()));
- CHECK_EQ(lazy_deopt_node, deopt_block->nodes_[0]);
- CHECK_EQ(IrOpcode::kStateValues, deopt_block->nodes_[1]->op()->opcode());
- CHECK_EQ(IrOpcode::kStateValues, deopt_block->nodes_[2]->op()->opcode());
- CHECK_EQ(IrOpcode::kStateValues, deopt_block->nodes_[3]->op()->opcode());
- CHECK_EQ(state_node, deopt_block->nodes_[4]);
-}
-
-
static Node* CreateDiamond(Graph* graph, CommonOperatorBuilder* common,
Node* cond) {
Node* tv = graph->NewNode(common->Int32Constant(6));
« no previous file with comments | « test/cctest/compiler/test-schedule.cc ('k') | test/compiler-unittests/instruction-selector-unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698