Commit e955efd5 authored by Maya Lekova's avatar Maya Lekova Committed by Commit Bot

[turbofan] Small steps towards brokerization

Remove unnecessary call to Serialize.

Change a Handle cast to a Ref cast.

Add a CHECK to JSHeapBroker::SetFeedback that the source is valid.

Bug: v8:7790
Change-Id: I6a2f10d45456c6b128beff009016009457dc109c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1773248
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63421}
parent 7b147e2d
......@@ -4167,6 +4167,7 @@ NamedAccessFeedback::NamedAccessFeedback(NameRef const& name,
void JSHeapBroker::SetFeedback(FeedbackSource const& source,
ProcessedFeedback const* feedback) {
CHECK(source.IsValid());
auto insertion = feedback_.insert({source, feedback});
CHECK(insertion.second);
}
......
......@@ -985,9 +985,8 @@ Reduction LoadElimination::ReduceStoreField(Node* node,
Type const new_value_type = NodeProperties::GetType(new_value);
if (new_value_type.IsHeapConstant()) {
// Record the new {object} map information.
AllowHandleDereference handle_dereference;
ZoneHandleSet<Map> object_maps(
Handle<Map>::cast(new_value_type.AsHeapConstant()->Value()));
new_value_type.AsHeapConstant()->Ref().AsMap().object());
state = state->SetMaps(object, object_maps, zone());
}
} else {
......
......@@ -380,7 +380,10 @@ base::Optional<MapRef> NodeProperties::GetJSCreateMap(JSHeapBroker* broker,
ObjectRef target = mtarget.Ref(broker);
JSFunctionRef newtarget = mnewtarget.Ref(broker).AsJSFunction();
if (newtarget.map().has_prototype_slot() && newtarget.has_initial_map()) {
if (broker->mode() == JSHeapBroker::kSerializing) newtarget.Serialize();
if (!newtarget.serialized()) {
TRACE_BROKER_MISSING(broker, "initial map on " << newtarget);
return base::nullopt;
}
MapRef initial_map = newtarget.initial_map();
if (initial_map.GetConstructor().equals(target)) {
DCHECK(target.AsJSFunction().map().is_constructor());
......
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