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

[turbofan] Gather feedback in advance in non-concurrent mode

Bug: chromium:998802
Change-Id: I243c00b367ffd1c5c54ca6930681b1b1d3317b26
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1773273
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63492}
parent a5d85ba5
......@@ -150,11 +150,6 @@ void JSGenericLowering::LowerJSStrictEqual(Node* node) {
namespace {
bool ShouldUseMegamorphicLoadBuiltin(FeedbackSource const& source,
JSHeapBroker* broker) {
if (!FLAG_concurrent_inlining) {
// TODO(mslekova): This temporary patch might result in a performance
// issue. Remove it once the flag is no longer relevant.
return false;
}
ProcessedFeedback const& feedback = broker->GetFeedback(source);
if (feedback.kind() == ProcessedFeedback::kElementAccess) {
......
......@@ -4422,25 +4422,27 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForCall(
}
BinaryOperationHint JSHeapBroker::GetFeedbackForBinaryOperation(
FeedbackSource const& source) const {
if (!FLAG_concurrent_inlining) return ReadFeedbackForBinaryOperation(source);
ProcessedFeedback const& feedback = GetFeedback(source);
FeedbackSource const& source) {
ProcessedFeedback const& feedback =
FLAG_concurrent_inlining ? GetFeedback(source)
: ProcessFeedbackForBinaryOperation(source);
return feedback.IsInsufficient() ? BinaryOperationHint::kNone
: feedback.AsBinaryOperation().value();
}
CompareOperationHint JSHeapBroker::GetFeedbackForCompareOperation(
FeedbackSource const& source) const {
if (!FLAG_concurrent_inlining) return ReadFeedbackForCompareOperation(source);
ProcessedFeedback const& feedback = GetFeedback(source);
FeedbackSource const& source) {
ProcessedFeedback const& feedback =
FLAG_concurrent_inlining ? GetFeedback(source)
: ProcessFeedbackForCompareOperation(source);
return feedback.IsInsufficient() ? CompareOperationHint::kNone
: feedback.AsCompareOperation().value();
}
ForInHint JSHeapBroker::GetFeedbackForForIn(
FeedbackSource const& source) const {
if (!FLAG_concurrent_inlining) return ReadFeedbackForForIn(source);
ProcessedFeedback const& feedback = GetFeedback(source);
ForInHint JSHeapBroker::GetFeedbackForForIn(FeedbackSource const& source) {
ProcessedFeedback const& feedback = FLAG_concurrent_inlining
? GetFeedback(source)
: ProcessFeedbackForForIn(source);
return feedback.IsInsufficient() ? ForInHint::kNone
: feedback.AsForIn().value();
}
......@@ -4450,25 +4452,25 @@ ProcessedFeedback const& JSHeapBroker::GetFeedbackForPropertyAccess(
base::Optional<NameRef> static_name) {
return FLAG_concurrent_inlining
? GetFeedback(source)
: ReadFeedbackForPropertyAccess(source, mode, static_name);
: ProcessFeedbackForPropertyAccess(source, mode, static_name);
}
ProcessedFeedback const& JSHeapBroker::GetFeedbackForInstanceOf(
FeedbackSource const& source) {
return FLAG_concurrent_inlining ? GetFeedback(source)
: ReadFeedbackForInstanceOf(source);
: ProcessFeedbackForInstanceOf(source);
}
ProcessedFeedback const& JSHeapBroker::GetFeedbackForCall(
FeedbackSource const& source) {
return FLAG_concurrent_inlining ? GetFeedback(source)
: ReadFeedbackForCall(source);
: ProcessFeedbackForCall(source);
}
ProcessedFeedback const& JSHeapBroker::GetFeedbackForGlobalAccess(
FeedbackSource const& source) {
return FLAG_concurrent_inlining ? GetFeedback(source)
: ReadFeedbackForGlobalAccess(source);
: ProcessFeedbackForGlobalAccess(source);
}
ProcessedFeedback const& JSHeapBroker::ProcessFeedbackForBinaryOperation(
......
......@@ -115,10 +115,10 @@ class V8_EXPORT_PRIVATE JSHeapBroker {
// Binary, comparison and for-in hints can be fully expressed via
// an enum. Insufficient feedback is signaled by <Hint enum>::kNone.
BinaryOperationHint GetFeedbackForBinaryOperation(
FeedbackSource const& source) const;
FeedbackSource const& source);
CompareOperationHint GetFeedbackForCompareOperation(
FeedbackSource const& source) const;
ForInHint GetFeedbackForForIn(FeedbackSource const& source) const;
FeedbackSource const& source);
ForInHint GetFeedbackForForIn(FeedbackSource const& source);
ProcessedFeedback const& GetFeedbackForCall(FeedbackSource const& source);
ProcessedFeedback const& GetFeedbackForGlobalAccess(
......
......@@ -121,11 +121,21 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
}
break;
}
case IrOpcode::kJSLoadNamed:
case IrOpcode::kJSLoadNamed: {
if (!FLAG_concurrent_inlining) {
NamedAccess const& p = NamedAccessOf(node->op());
NameRef name(broker(), p.name());
if (p.feedback().IsValid()) {
broker()->ProcessFeedbackForPropertyAccess(p.feedback(),
AccessMode::kLoad, name);
}
}
break;
}
case IrOpcode::kJSStoreNamed: {
if (!FLAG_concurrent_inlining) {
NamedAccess const& p = NamedAccessOf(node->op());
NameRef(broker(), p.name());
NameRef name(broker(), p.name());
}
break;
}
......@@ -172,7 +182,17 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
}
break;
}
case IrOpcode::kJSLoadProperty: {
if (!FLAG_concurrent_inlining) {
PropertyAccess const& p = PropertyAccessOf(node->op());
AccessMode access_mode = AccessMode::kLoad;
if (p.feedback().IsValid()) {
broker()->ProcessFeedbackForPropertyAccess(p.feedback(), access_mode,
base::nullopt);
}
}
break;
}
default:
break;
}
......
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