Commit 3623415e authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[maglev] Canonicalise function handle created for compilation unit

Additionally, pass the JSFunctionRef directly for inlined functions'
compilation units.

Bug: v8:7700
Change-Id: Ibdc738c8a9790f8ac45e6a0fd55facdf638562f9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3599480
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80088}
parent da1408ab
......@@ -13,12 +13,19 @@ namespace v8 {
namespace internal {
namespace maglev {
MaglevCompilationUnit::MaglevCompilationUnit(MaglevCompilationInfo* info,
Handle<JSFunction> function)
: MaglevCompilationUnit(
info, nullptr,
MakeRef(info->broker(),
info->broker()->CanonicalPersistentHandle(function))) {}
MaglevCompilationUnit::MaglevCompilationUnit(
MaglevCompilationInfo* info, const MaglevCompilationUnit* caller,
Handle<JSFunction> function)
compiler::JSFunctionRef function)
: info_(info),
caller_(caller),
function_(MakeRef(broker(), function)),
function_(function),
shared_function_info_(function_.shared()),
bytecode_(shared_function_info_.GetBytecodeArray()),
feedback_(
......
......@@ -24,18 +24,21 @@ class MaglevCompilationUnit : public ZoneObject {
public:
static MaglevCompilationUnit* New(Zone* zone, MaglevCompilationInfo* info,
Handle<JSFunction> function) {
return zone->New<MaglevCompilationUnit>(info, nullptr, function);
return zone->New<MaglevCompilationUnit>(info, function);
}
static MaglevCompilationUnit* NewInner(Zone* zone,
const MaglevCompilationUnit* caller,
Handle<JSFunction> function) {
compiler::JSFunctionRef function) {
return zone->New<MaglevCompilationUnit>(caller->info(), caller, function);
}
MaglevCompilationUnit(MaglevCompilationInfo* info,
const MaglevCompilationUnit* caller,
Handle<JSFunction> function);
MaglevCompilationUnit(MaglevCompilationInfo* info,
const MaglevCompilationUnit* caller,
compiler::JSFunctionRef function);
MaglevCompilationInfo* info() const { return info_; }
const MaglevCompilationUnit* caller() const { return caller_; }
compiler::JSHeapBroker* broker() const;
......
......@@ -631,8 +631,8 @@ void MaglevGraphBuilder::InlineCallFromRegisters(
// Create a new compilation unit and graph builder for the inlined
// function.
MaglevCompilationUnit* inner_unit = MaglevCompilationUnit::NewInner(
zone(), compilation_unit_, function.object());
MaglevCompilationUnit* inner_unit =
MaglevCompilationUnit::NewInner(zone(), compilation_unit_, function);
MaglevGraphBuilder inner_graph_builder(local_isolate_, inner_unit, graph_,
this);
......
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