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) { ...@@ -150,11 +150,6 @@ void JSGenericLowering::LowerJSStrictEqual(Node* node) {
namespace { namespace {
bool ShouldUseMegamorphicLoadBuiltin(FeedbackSource const& source, bool ShouldUseMegamorphicLoadBuiltin(FeedbackSource const& source,
JSHeapBroker* broker) { 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); ProcessedFeedback const& feedback = broker->GetFeedback(source);
if (feedback.kind() == ProcessedFeedback::kElementAccess) { if (feedback.kind() == ProcessedFeedback::kElementAccess) {
......
...@@ -4422,25 +4422,27 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForCall( ...@@ -4422,25 +4422,27 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForCall(
} }
BinaryOperationHint JSHeapBroker::GetFeedbackForBinaryOperation( BinaryOperationHint JSHeapBroker::GetFeedbackForBinaryOperation(
FeedbackSource const& source) const { FeedbackSource const& source) {
if (!FLAG_concurrent_inlining) return ReadFeedbackForBinaryOperation(source); ProcessedFeedback const& feedback =
ProcessedFeedback const& feedback = GetFeedback(source); FLAG_concurrent_inlining ? GetFeedback(source)
: ProcessFeedbackForBinaryOperation(source);
return feedback.IsInsufficient() ? BinaryOperationHint::kNone return feedback.IsInsufficient() ? BinaryOperationHint::kNone
: feedback.AsBinaryOperation().value(); : feedback.AsBinaryOperation().value();
} }
CompareOperationHint JSHeapBroker::GetFeedbackForCompareOperation( CompareOperationHint JSHeapBroker::GetFeedbackForCompareOperation(
FeedbackSource const& source) const { FeedbackSource const& source) {
if (!FLAG_concurrent_inlining) return ReadFeedbackForCompareOperation(source); ProcessedFeedback const& feedback =
ProcessedFeedback const& feedback = GetFeedback(source); FLAG_concurrent_inlining ? GetFeedback(source)
: ProcessFeedbackForCompareOperation(source);
return feedback.IsInsufficient() ? CompareOperationHint::kNone return feedback.IsInsufficient() ? CompareOperationHint::kNone
: feedback.AsCompareOperation().value(); : feedback.AsCompareOperation().value();
} }
ForInHint JSHeapBroker::GetFeedbackForForIn( ForInHint JSHeapBroker::GetFeedbackForForIn(FeedbackSource const& source) {
FeedbackSource const& source) const { ProcessedFeedback const& feedback = FLAG_concurrent_inlining
if (!FLAG_concurrent_inlining) return ReadFeedbackForForIn(source); ? GetFeedback(source)
ProcessedFeedback const& feedback = GetFeedback(source); : ProcessFeedbackForForIn(source);
return feedback.IsInsufficient() ? ForInHint::kNone return feedback.IsInsufficient() ? ForInHint::kNone
: feedback.AsForIn().value(); : feedback.AsForIn().value();
} }
...@@ -4450,25 +4452,25 @@ ProcessedFeedback const& JSHeapBroker::GetFeedbackForPropertyAccess( ...@@ -4450,25 +4452,25 @@ ProcessedFeedback const& JSHeapBroker::GetFeedbackForPropertyAccess(
base::Optional<NameRef> static_name) { base::Optional<NameRef> static_name) {
return FLAG_concurrent_inlining return FLAG_concurrent_inlining
? GetFeedback(source) ? GetFeedback(source)
: ReadFeedbackForPropertyAccess(source, mode, static_name); : ProcessFeedbackForPropertyAccess(source, mode, static_name);
} }
ProcessedFeedback const& JSHeapBroker::GetFeedbackForInstanceOf( ProcessedFeedback const& JSHeapBroker::GetFeedbackForInstanceOf(
FeedbackSource const& source) { FeedbackSource const& source) {
return FLAG_concurrent_inlining ? GetFeedback(source) return FLAG_concurrent_inlining ? GetFeedback(source)
: ReadFeedbackForInstanceOf(source); : ProcessFeedbackForInstanceOf(source);
} }
ProcessedFeedback const& JSHeapBroker::GetFeedbackForCall( ProcessedFeedback const& JSHeapBroker::GetFeedbackForCall(
FeedbackSource const& source) { FeedbackSource const& source) {
return FLAG_concurrent_inlining ? GetFeedback(source) return FLAG_concurrent_inlining ? GetFeedback(source)
: ReadFeedbackForCall(source); : ProcessFeedbackForCall(source);
} }
ProcessedFeedback const& JSHeapBroker::GetFeedbackForGlobalAccess( ProcessedFeedback const& JSHeapBroker::GetFeedbackForGlobalAccess(
FeedbackSource const& source) { FeedbackSource const& source) {
return FLAG_concurrent_inlining ? GetFeedback(source) return FLAG_concurrent_inlining ? GetFeedback(source)
: ReadFeedbackForGlobalAccess(source); : ProcessFeedbackForGlobalAccess(source);
} }
ProcessedFeedback const& JSHeapBroker::ProcessFeedbackForBinaryOperation( ProcessedFeedback const& JSHeapBroker::ProcessFeedbackForBinaryOperation(
......
...@@ -115,10 +115,10 @@ class V8_EXPORT_PRIVATE JSHeapBroker { ...@@ -115,10 +115,10 @@ class V8_EXPORT_PRIVATE JSHeapBroker {
// Binary, comparison and for-in hints can be fully expressed via // Binary, comparison and for-in hints can be fully expressed via
// an enum. Insufficient feedback is signaled by <Hint enum>::kNone. // an enum. Insufficient feedback is signaled by <Hint enum>::kNone.
BinaryOperationHint GetFeedbackForBinaryOperation( BinaryOperationHint GetFeedbackForBinaryOperation(
FeedbackSource const& source) const; FeedbackSource const& source);
CompareOperationHint GetFeedbackForCompareOperation( CompareOperationHint GetFeedbackForCompareOperation(
FeedbackSource const& source) const; FeedbackSource const& source);
ForInHint GetFeedbackForForIn(FeedbackSource const& source) const; ForInHint GetFeedbackForForIn(FeedbackSource const& source);
ProcessedFeedback const& GetFeedbackForCall(FeedbackSource const& source); ProcessedFeedback const& GetFeedbackForCall(FeedbackSource const& source);
ProcessedFeedback const& GetFeedbackForGlobalAccess( ProcessedFeedback const& GetFeedbackForGlobalAccess(
......
...@@ -121,11 +121,21 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) { ...@@ -121,11 +121,21 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
} }
break; 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: { case IrOpcode::kJSStoreNamed: {
if (!FLAG_concurrent_inlining) { if (!FLAG_concurrent_inlining) {
NamedAccess const& p = NamedAccessOf(node->op()); NamedAccess const& p = NamedAccessOf(node->op());
NameRef(broker(), p.name()); NameRef name(broker(), p.name());
} }
break; break;
} }
...@@ -172,7 +182,17 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) { ...@@ -172,7 +182,17 @@ Reduction JSHeapCopyReducer::Reduce(Node* node) {
} }
break; 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: default:
break; 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