Commit 73996210 authored by Georg Neis's avatar Georg Neis Committed by V8 LUCI CQ

[compiler] Clean up Ref construction

Make code more readable, mainly by using MakeRef & co. and their
overloads.

Bug: v8:7790
Change-Id: Id45a69857a1be106c152615ac6dbc2f8a42fb7e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2874398Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74401}
parent 30d886dd
This diff is collapsed.
......@@ -142,8 +142,7 @@ void JSHeapBroker::SetTargetNativeContextRef(
(mode() == kSerializing &&
target_native_context_->object().equals(native_context) &&
target_native_context_->is_unserialized_heap_object()));
target_native_context_ =
MakeRef(this, CanonicalPersistentHandle(*native_context));
target_native_context_ = MakeRef(this, *native_context);
}
void JSHeapBroker::CollectArrayAndObjectPrototypes() {
......@@ -712,8 +711,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForGlobalAccess(
PropertyCellRef cell =
MakeRef(this, Handle<PropertyCell>::cast(feedback_value));
MakeRef(this,
CanonicalPersistentHandle(
Handle<PropertyCell>::cast(feedback_value)->value(kAcquireLoad)));
Handle<PropertyCell>::cast(feedback_value)->value(kAcquireLoad));
return *zone()->New<GlobalAccessFeedback>(cell, nexus.kind());
}
......
......@@ -2270,10 +2270,9 @@ void SerializerForBackgroundCompilation::ProcessApiCall(
Builtins::kCallFunctionTemplate_CheckAccessAndCompatibleReceiver}) {
ObjectRef(broker(), broker()->isolate()->builtins()->builtin_handle(b));
}
FunctionTemplateInfoRef target_template_info = MakeRef(
broker(),
Handle<FunctionTemplateInfo>::cast(broker()->CanonicalPersistentHandle(
target->function_data(kAcquireLoad))));
FunctionTemplateInfoRef target_template_info =
MakeRef(broker(),
FunctionTemplateInfo::cast(target->function_data(kAcquireLoad)));
if (!target_template_info.has_call_code()) return;
target_template_info.SerializeCallCode();
......@@ -3039,9 +3038,8 @@ SerializerForBackgroundCompilation::ProcessMapForNamedPropertyAccess(
// For JSCallReducer::ReduceCallApiFunction.
Handle<SharedFunctionInfo> sfi = function.shared().object();
if (sfi->IsApiFunction()) {
FunctionTemplateInfoRef fti_ref = MakeRef(
broker(),
broker()->CanonicalPersistentHandle(sfi->get_api_func_data()));
FunctionTemplateInfoRef fti_ref =
MakeRef(broker(), sfi->get_api_func_data());
if (fti_ref.has_call_code()) {
fti_ref.SerializeCallCode();
ProcessReceiverMapForApiCall(fti_ref, receiver_map->object());
......@@ -3055,9 +3053,7 @@ SerializerForBackgroundCompilation::ProcessMapForNamedPropertyAccess(
function.Serialize();
} else {
FunctionTemplateInfoRef fti = MakeRef(
broker(),
Handle<FunctionTemplateInfo>::cast(
broker()->CanonicalPersistentHandle(access_info.constant())));
broker(), FunctionTemplateInfo::cast(*access_info.constant()));
if (fti.has_call_code()) fti.SerializeCallCode();
}
} else if (access_info.IsModuleExport()) {
......
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