Commit 66234a4d authored by Jakob Gruber's avatar Jakob Gruber Committed by V8 LUCI CQ

[compiler] AssumeMemoryFence in FeedbackCellRef::value

Drive-by: simplifications and avoid a repeated concurrent read.

Bug: v8:7790,v8:12157
Change-Id: I460c44853a78bcd9a1427e62a92994ff8602dbed
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3133148
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76640}
parent 76adfd1c
......@@ -1052,7 +1052,7 @@ BytecodeGraphBuilder::BytecodeGraphBuilder(
shared_info_(shared_info),
bytecode_array_(shared_info.GetBytecodeArray()),
feedback_cell_(feedback_cell),
feedback_vector_(feedback_cell.value()->AsFeedbackVector()),
feedback_vector_(feedback_cell.value().value()),
invocation_frequency_(invocation_frequency),
type_hint_lowering_(
broker, jsgraph, feedback_vector_,
......
......@@ -2176,7 +2176,7 @@ base::Optional<FeedbackVectorRef> FeedbackCellRef::value() const {
DCHECK(data_->should_access_heap());
Object value = object()->value(kAcquireLoad);
if (!value.IsFeedbackVector()) return base::nullopt;
return TryMakeRef(broker(), FeedbackVector::cast(value));
return MakeRefAssumeMemoryFence(broker(), FeedbackVector::cast(value));
}
base::Optional<ObjectRef> MapRef::GetStrongValue(
......@@ -2659,10 +2659,9 @@ base::Optional<ObjectRef> DescriptorArrayRef::GetStrongValue(
base::Optional<SharedFunctionInfoRef> FeedbackCellRef::shared_function_info()
const {
if (value()) {
return value()->shared_function_info();
}
return base::nullopt;
base::Optional<FeedbackVectorRef> feedback_vector = value();
if (!feedback_vector.has_value()) return {};
return feedback_vector->shared_function_info();
}
SharedFunctionInfoRef FeedbackVectorRef::shared_function_info() const {
......
......@@ -1707,10 +1707,7 @@ Reduction JSTypedLowering::ReduceJSCall(Node* node) {
shared = ccp.shared_info(broker());
} else if (target->opcode() == IrOpcode::kCheckClosure) {
FeedbackCellRef cell = MakeRef(broker(), FeedbackCellOf(target->op()));
base::Optional<FeedbackVectorRef> feedback_vector = cell.value();
if (feedback_vector.has_value()) {
shared = feedback_vector->shared_function_info();
}
shared = cell.shared_function_info();
}
if (shared.has_value()) {
......
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