Commit f9c40859 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[TurboFan] Use temporary zone for effect linearization schedule.

Also move phi NodeVector in TryCloneBranch to temporary zone.

BUG=chromium:700364

Change-Id: Id19d51dae63ed5a6f5dccbba77a19b3663fd325e
Reviewed-on: https://chromium-review.googlesource.com/456285Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43962}
parent 0a7d3138
......@@ -148,8 +148,8 @@ void RemoveRegionNode(Node* node) {
node->Kill();
}
void TryCloneBranch(Node* node, BasicBlock* block, Graph* graph,
CommonOperatorBuilder* common,
void TryCloneBranch(Node* node, BasicBlock* block, Zone* temp_zone,
Graph* graph, CommonOperatorBuilder* common,
BlockEffectControlMap* block_effects,
SourcePositionTable* source_positions) {
DCHECK_EQ(IrOpcode::kBranch, node->opcode());
......@@ -216,7 +216,7 @@ void TryCloneBranch(Node* node, BasicBlock* block, Graph* graph,
// Grab the IfTrue/IfFalse projections of the Branch.
BranchMatcher matcher(branch);
// Check/collect other Phi/EffectPhi nodes hanging off the Merge.
NodeVector phis(graph->zone());
NodeVector phis(temp_zone);
for (Node* const use : merge->uses()) {
if (use == branch || use == cond) continue;
// We cannot currently deal with non-Phi/EffectPhi nodes hanging off the
......@@ -456,8 +456,8 @@ void EffectControlLinearizer::Run() {
case BasicBlock::kBranch:
ProcessNode(block->control_input(), &frame_state, &effect, &control);
TryCloneBranch(block->control_input(), block, graph(), common(),
&block_effects, source_positions_);
TryCloneBranch(block->control_input(), block, temp_zone(), graph(),
common(), &block_effects, source_positions_);
break;
}
......
......@@ -1074,7 +1074,7 @@ struct EffectControlLinearizationPhase {
// effects (such as changing representation to tagged or
// 'floating' allocation regions.)
Schedule* schedule = Scheduler::ComputeSchedule(temp_zone, data->graph(),
Scheduler::kNoFlags);
Scheduler::kTempSchedule);
if (FLAG_turbo_verify) ScheduleVerifier::Run(schedule);
TraceSchedule(data->info(), schedule);
......
......@@ -37,8 +37,10 @@ Scheduler::Scheduler(Zone* zone, Graph* graph, Schedule* schedule, Flags flags)
Schedule* Scheduler::ComputeSchedule(Zone* zone, Graph* graph, Flags flags) {
Schedule* schedule = new (graph->zone())
Schedule(graph->zone(), static_cast<size_t>(graph->NodeCount()));
Zone* schedule_zone =
(flags & Scheduler::kTempSchedule) ? zone : graph->zone();
Schedule* schedule = new (schedule_zone)
Schedule(schedule_zone, static_cast<size_t>(graph->NodeCount()));
Scheduler scheduler(zone, graph, schedule, flags);
scheduler.BuildCFG();
......
......@@ -29,12 +29,12 @@ class SpecialRPONumberer;
class V8_EXPORT_PRIVATE Scheduler {
public:
// Flags that control the mode of operation.
enum Flag { kNoFlags = 0u, kSplitNodes = 1u << 1 };
enum Flag { kNoFlags = 0u, kSplitNodes = 1u << 1, kTempSchedule = 1u << 2 };
typedef base::Flags<Flag> Flags;
// The complete scheduling algorithm. Creates a new schedule and places all
// nodes from the graph into it.
static Schedule* ComputeSchedule(Zone* zone, Graph* graph, Flags flags);
static Schedule* ComputeSchedule(Zone* temp_zone, Graph* graph, Flags flags);
// Compute the RPO of blocks in an existing schedule.
static BasicBlockVector* ComputeSpecialRPO(Zone* zone, Schedule* schedule);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment