Commit 5aa72daa authored by sigurds's avatar sigurds Committed by Commit bot

[turbofan] Delay initialization in escape analysis

This is also a refactoring of the merge function in
escape analysis.

BUG=v8:4586
LOG=n

Review URL: https://codereview.chromium.org/1654163003

Cr-Commit-Position: refs/heads/master@{#33728}
parent 1b369e96
......@@ -133,6 +133,9 @@ Reduction EscapeAnalysisReducer::ReduceStore(Node* node) {
Reduction EscapeAnalysisReducer::ReduceAllocate(Node* node) {
DCHECK_EQ(node->opcode(), IrOpcode::kAllocate);
if (node->id() < static_cast<NodeId>(fully_reduced_.length())) {
fully_reduced_.Add(node->id());
}
if (escape_analysis()->IsVirtual(node)) {
RelaxEffectsAndControls(node);
counters()->turbo_escape_allocs_replaced()->Increment();
......@@ -147,6 +150,8 @@ Reduction EscapeAnalysisReducer::ReduceFinishRegion(Node* node) {
DCHECK_EQ(node->opcode(), IrOpcode::kFinishRegion);
Node* effect = NodeProperties::GetEffectInput(node, 0);
if (effect->opcode() == IrOpcode::kBeginRegion) {
// We only add it now to remove empty Begin/Finish region pairs
// in the process.
if (node->id() < static_cast<NodeId>(fully_reduced_.length())) {
fully_reduced_.Add(node->id());
}
......@@ -208,6 +213,9 @@ Reduction EscapeAnalysisReducer::ReduceObjectIsSmi(Node* node) {
Reduction EscapeAnalysisReducer::ReduceFrameStateUses(Node* node) {
DCHECK_GE(node->op()->EffectInputCount(), 1);
if (node->id() < static_cast<NodeId>(fully_reduced_.length())) {
fully_reduced_.Add(node->id());
}
bool changed = false;
for (int i = 0; i < node->InputCount(); ++i) {
Node* input = node->InputAt(i);
......
This diff is collapsed.
......@@ -149,8 +149,6 @@ class EscapeAnalysis {
VirtualObject* CopyForModificationAt(VirtualObject* obj, VirtualState* state,
Node* node);
VirtualObject* GetVirtualObject(Node* at, NodeId id);
VirtualObject* ResolveVirtualObject(VirtualState* state, Node* node);
Node* GetReplacementIfSame(ZoneVector<VirtualObject*>& objs);
bool SetEscaped(Node* node);
Node* replacement(NodeId id);
......
......@@ -467,7 +467,6 @@ DEFINE_BOOL(turbo_frame_elision, true, "elide frames in TurboFan")
DEFINE_BOOL(turbo_cache_shared_code, true, "cache context-independent code")
DEFINE_BOOL(turbo_preserve_shared_code, false, "keep context-independent code")
DEFINE_BOOL(turbo_escape, false, "enable escape analysis")
DEFINE_BOOL(trace_turbo_escape, false, "enable tracing in escape analysis")
DEFINE_BOOL(turbo_instruction_scheduling, false,
"enable instruction scheduling in TurboFan")
......@@ -955,6 +954,7 @@ DEFINE_BOOL(print_global_handles, false, "report global handles after GC")
// TurboFan debug-only flags.
DEFINE_BOOL(print_turbo_replay, false,
"print C++ code to recreate TurboFan graphs")
DEFINE_BOOL(trace_turbo_escape, false, "enable tracing in escape analysis")
// objects.cc
DEFINE_BOOL(trace_normalization, false,
......
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