Skip to content

Commit

Permalink
[maglev] Remove unnecessary DeoptFrameScope in ReduceConstruct
Browse files Browse the repository at this point in the history
... and clear unnecessary checks, since they already hold, for allocation inlining.

Bug: v8:7700, v8:14192
Change-Id: I89eafbc6c2299b48f8356ccb09a82dba2721d8ec
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4694481
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#88996}
  • Loading branch information
victorgomes authored and V8 LUCI CQ committed Jul 18, 2023
1 parent a720b0b commit 81206fd
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/maglev/maglev-graph-builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7386,21 +7386,13 @@ ReduceResult MaglevGraphBuilder::ReduceConstruct(
if (IsDerivedConstructor(sfi.kind())) {
implicit_receiver = GetRootConstant(RootIndex::kTheHoleValue);
} else {
DeoptFrameScope construct(this, BytecodeOffset::ConstructStubCreate(),
target,
GetRootConstant(RootIndex::kTheHoleValue),
construct_arguments_without_receiver);
compiler::OptionalHeapObjectRef maybe_constant;
if (target == new_target &&
(maybe_constant = TryGetConstant(target)) &&
maybe_constant.value().equals(feedback_target) &&
feedback_target.IsJSFunction() &&
feedback_target.AsJSFunction().has_initial_map(broker())) {
compiler::MapRef map =
feedback_target.AsJSFunction().initial_map(broker());
// We do not create a construct stub lazy deopt frame, since
// FastNewObject cannot fail if target is a JSFunction.
if (function.has_initial_map(broker())) {
compiler::MapRef map = function.initial_map(broker());
if (map.GetConstructor(broker()).equals(feedback_target)) {
implicit_receiver = BuildAllocateFastObject(
FastObject(feedback_target.AsJSFunction(), zone(), broker()),
FastObject(function, zone(), broker()),
AllocationType::kYoung);
// TODO(leszeks): Don't eagerly clear the raw allocation, have the
// next side effect clear it.
Expand Down

0 comments on commit 81206fd

Please sign in to comment.