Commit 4253936c authored by Maya Lekova's avatar Maya Lekova Committed by Commit Bot

[turbofan] Clean-up the heap copy reducer phase

Bug: v8:7790
Change-Id: I798555bb6fbbee2ce2a3dc4bb22a84ff881792f0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1784294Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63589}
parent 3aa21bbb
...@@ -27,172 +27,130 @@ JSHeapBroker* JSHeapCopyReducer::broker() { return broker_; } ...@@ -27,172 +27,130 @@ JSHeapBroker* JSHeapCopyReducer::broker() { return broker_; }
Reduction JSHeapCopyReducer::Reduce(Node* node) { Reduction JSHeapCopyReducer::Reduce(Node* node) {
switch (node->opcode()) { switch (node->opcode()) {
case IrOpcode::kHeapConstant: { case IrOpcode::kHeapConstant: {
if (!FLAG_concurrent_inlining) { ObjectRef object(broker(), HeapConstantOf(node->op()));
ObjectRef object(broker(), HeapConstantOf(node->op())); if (object.IsJSFunction()) object.AsJSFunction().Serialize();
if (object.IsJSFunction()) object.AsJSFunction().Serialize(); if (object.IsJSObject()) {
if (object.IsJSObject()) { object.AsJSObject().SerializeObjectCreateMap();
object.AsJSObject().SerializeObjectCreateMap(); }
} if (object.IsSourceTextModule()) {
if (object.IsSourceTextModule()) { object.AsSourceTextModule().Serialize();
object.AsSourceTextModule().Serialize();
}
} }
break; break;
} }
case IrOpcode::kJSCreateArray: { case IrOpcode::kJSCreateArray: {
if (!FLAG_concurrent_inlining) { CreateArrayParameters const& p = CreateArrayParametersOf(node->op());
CreateArrayParameters const& p = CreateArrayParametersOf(node->op()); Handle<AllocationSite> site;
Handle<AllocationSite> site; if (p.site().ToHandle(&site)) AllocationSiteRef(broker(), site);
if (p.site().ToHandle(&site)) AllocationSiteRef(broker(), site);
}
break; break;
} }
case IrOpcode::kJSCreateArguments: { case IrOpcode::kJSCreateArguments: {
if (!FLAG_concurrent_inlining) { Node* const frame_state = NodeProperties::GetFrameStateInput(node);
Node* const frame_state = NodeProperties::GetFrameStateInput(node); FrameStateInfo state_info = FrameStateInfoOf(frame_state->op());
FrameStateInfo state_info = FrameStateInfoOf(frame_state->op()); SharedFunctionInfoRef shared(broker(),
SharedFunctionInfoRef shared( state_info.shared_info().ToHandleChecked());
broker(), state_info.shared_info().ToHandleChecked());
}
break; break;
} }
case IrOpcode::kJSCreateBlockContext: { case IrOpcode::kJSCreateBlockContext: {
if (!FLAG_concurrent_inlining) { ScopeInfoRef(broker(), ScopeInfoOf(node->op()));
ScopeInfoRef(broker(), ScopeInfoOf(node->op()));
}
break; break;
} }
case IrOpcode::kJSCreateBoundFunction: { case IrOpcode::kJSCreateBoundFunction: {
if (!FLAG_concurrent_inlining) { CreateBoundFunctionParameters const& p =
CreateBoundFunctionParameters const& p = CreateBoundFunctionParametersOf(node->op());
CreateBoundFunctionParametersOf(node->op()); MapRef(broker(), p.map());
MapRef(broker(), p.map());
}
break; break;
} }
case IrOpcode::kJSCreateCatchContext: { case IrOpcode::kJSCreateCatchContext: {
if (!FLAG_concurrent_inlining) { ScopeInfoRef(broker(), ScopeInfoOf(node->op()));
ScopeInfoRef(broker(), ScopeInfoOf(node->op()));
}
break; break;
} }
case IrOpcode::kJSCreateClosure: { case IrOpcode::kJSCreateClosure: {
if (!FLAG_concurrent_inlining) { CreateClosureParameters const& p = CreateClosureParametersOf(node->op());
CreateClosureParameters const& p = SharedFunctionInfoRef(broker(), p.shared_info());
CreateClosureParametersOf(node->op()); FeedbackCellRef(broker(), p.feedback_cell());
SharedFunctionInfoRef(broker(), p.shared_info()); HeapObjectRef(broker(), p.code());
FeedbackCellRef(broker(), p.feedback_cell());
HeapObjectRef(broker(), p.code());
}
break; break;
} }
case IrOpcode::kJSCreateEmptyLiteralArray: { case IrOpcode::kJSCreateEmptyLiteralArray: {
if (!FLAG_concurrent_inlining) { FeedbackParameter const& p = FeedbackParameterOf(node->op());
FeedbackParameter const& p = FeedbackParameterOf(node->op()); FeedbackVectorRef(broker(), p.feedback().vector).Serialize();
FeedbackVectorRef(broker(), p.feedback().vector).Serialize();
}
break; break;
} }
case IrOpcode::kJSCreateFunctionContext: { case IrOpcode::kJSCreateFunctionContext: {
if (!FLAG_concurrent_inlining) { CreateFunctionContextParameters const& p =
CreateFunctionContextParameters const& p = CreateFunctionContextParametersOf(node->op());
CreateFunctionContextParametersOf(node->op()); ScopeInfoRef(broker(), p.scope_info());
ScopeInfoRef(broker(), p.scope_info());
}
break; break;
} }
case IrOpcode::kJSCreateLiteralArray: case IrOpcode::kJSCreateLiteralArray:
case IrOpcode::kJSCreateLiteralObject: { case IrOpcode::kJSCreateLiteralObject: {
if (!FLAG_concurrent_inlining) { CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op());
CreateLiteralParameters const& p = FeedbackVectorRef(broker(), p.feedback().vector).Serialize();
CreateLiteralParametersOf(node->op());
FeedbackVectorRef(broker(), p.feedback().vector).Serialize();
}
break; break;
} }
case IrOpcode::kJSCreateLiteralRegExp: { case IrOpcode::kJSCreateLiteralRegExp: {
if (!FLAG_concurrent_inlining) { CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op());
CreateLiteralParameters const& p = FeedbackVectorRef(broker(), p.feedback().vector).Serialize();
CreateLiteralParametersOf(node->op());
FeedbackVectorRef(broker(), p.feedback().vector).Serialize();
}
break; break;
} }
case IrOpcode::kJSCreateWithContext: { case IrOpcode::kJSCreateWithContext: {
if (!FLAG_concurrent_inlining) { ScopeInfoRef(broker(), ScopeInfoOf(node->op()));
ScopeInfoRef(broker(), ScopeInfoOf(node->op()));
}
break; break;
} }
case IrOpcode::kJSLoadNamed: { case IrOpcode::kJSLoadNamed: {
if (!FLAG_concurrent_inlining) { NamedAccess const& p = NamedAccessOf(node->op());
NamedAccess const& p = NamedAccessOf(node->op()); NameRef name(broker(), p.name());
NameRef name(broker(), p.name()); if (p.feedback().IsValid()) {
if (p.feedback().IsValid()) { broker()->ProcessFeedbackForPropertyAccess(p.feedback(),
broker()->ProcessFeedbackForPropertyAccess(p.feedback(), AccessMode::kLoad, name);
AccessMode::kLoad, name);
}
} }
break; break;
} }
case IrOpcode::kJSStoreNamed: { case IrOpcode::kJSStoreNamed: {
if (!FLAG_concurrent_inlining) { NamedAccess const& p = NamedAccessOf(node->op());
NamedAccess const& p = NamedAccessOf(node->op()); NameRef name(broker(), p.name());
NameRef name(broker(), p.name());
}
break; break;
} }
case IrOpcode::kStoreField: case IrOpcode::kStoreField:
case IrOpcode::kLoadField: { case IrOpcode::kLoadField: {
if (!FLAG_concurrent_inlining) { FieldAccess access = FieldAccessOf(node->op());
FieldAccess access = FieldAccessOf(node->op()); Handle<Map> map_handle;
Handle<Map> map_handle; if (access.map.ToHandle(&map_handle)) {
if (access.map.ToHandle(&map_handle)) { MapRef(broker(), map_handle);
MapRef(broker(), map_handle); }
} Handle<Name> name_handle;
Handle<Name> name_handle; if (access.name.ToHandle(&name_handle)) {
if (access.name.ToHandle(&name_handle)) { NameRef(broker(), name_handle);
NameRef(broker(), name_handle);
}
} }
break; break;
} }
case IrOpcode::kMapGuard: { case IrOpcode::kMapGuard: {
if (!FLAG_concurrent_inlining) { ZoneHandleSet<Map> const& maps = MapGuardMapsOf(node->op());
ZoneHandleSet<Map> const& maps = MapGuardMapsOf(node->op()); for (Handle<Map> map : maps) {
for (Handle<Map> map : maps) { MapRef(broker(), map);
MapRef(broker(), map);
}
} }
break; break;
} }
case IrOpcode::kCheckMaps: { case IrOpcode::kCheckMaps: {
if (!FLAG_concurrent_inlining) { ZoneHandleSet<Map> const& maps = CheckMapsParametersOf(node->op()).maps();
ZoneHandleSet<Map> const& maps = for (Handle<Map> map : maps) {
CheckMapsParametersOf(node->op()).maps(); MapRef(broker(), map);
for (Handle<Map> map : maps) {
MapRef(broker(), map);
}
} }
break; break;
} }
case IrOpcode::kCompareMaps: { case IrOpcode::kCompareMaps: {
if (!FLAG_concurrent_inlining) { ZoneHandleSet<Map> const& maps = CompareMapsParametersOf(node->op());
ZoneHandleSet<Map> const& maps = CompareMapsParametersOf(node->op()); for (Handle<Map> map : maps) {
for (Handle<Map> map : maps) { MapRef(broker(), map);
MapRef(broker(), map);
}
} }
break; break;
} }
case IrOpcode::kJSLoadProperty: { case IrOpcode::kJSLoadProperty: {
if (!FLAG_concurrent_inlining) { PropertyAccess const& p = PropertyAccessOf(node->op());
PropertyAccess const& p = PropertyAccessOf(node->op()); AccessMode access_mode = AccessMode::kLoad;
AccessMode access_mode = AccessMode::kLoad; if (p.feedback().IsValid()) {
if (p.feedback().IsValid()) { broker()->ProcessFeedbackForPropertyAccess(p.feedback(), access_mode,
broker()->ProcessFeedbackForPropertyAccess(p.feedback(), access_mode, base::nullopt);
base::nullopt);
}
} }
break; break;
} }
......
...@@ -2208,10 +2208,6 @@ bool PipelineImpl::CreateGraph() { ...@@ -2208,10 +2208,6 @@ bool PipelineImpl::CreateGraph() {
Run<GraphBuilderPhase>(); Run<GraphBuilderPhase>();
RunPrintAndVerify(GraphBuilderPhase::phase_name(), true); RunPrintAndVerify(GraphBuilderPhase::phase_name(), true);
if (FLAG_concurrent_inlining) {
Run<CopyMetadataForConcurrentCompilePhase>();
}
// Perform function context specialization and inlining (if enabled). // Perform function context specialization and inlining (if enabled).
Run<InliningPhase>(); Run<InliningPhase>();
RunPrintAndVerify(InliningPhase::phase_name(), true); RunPrintAndVerify(InliningPhase::phase_name(), true);
......
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