Commit 338475d1 authored by Maya Lekova's avatar Maya Lekova Committed by Commit Bot

[turbofan] Fix the serialized function limit

The current value of 200 is fine with the TypeScript run time (less than
8s) as long as the limit is checked at an earlier stage, which was
overlooked in the initial implementation.

Fixed: chromium:1038292
Change-Id: Ia512e709a79450eed631f03129ddbbff65fd81b1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1985992Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65598}
parent f21aeb63
...@@ -2514,6 +2514,11 @@ StringRef JSHeapBroker::GetTypedArrayStringTag(ElementsKind kind) { ...@@ -2514,6 +2514,11 @@ StringRef JSHeapBroker::GetTypedArrayStringTag(ElementsKind kind) {
bool JSHeapBroker::ShouldBeSerializedForCompilation( bool JSHeapBroker::ShouldBeSerializedForCompilation(
const SharedFunctionInfoRef& shared, const FeedbackVectorRef& feedback, const SharedFunctionInfoRef& shared, const FeedbackVectorRef& feedback,
const HintsVector& arguments) const { const HintsVector& arguments) const {
if (serialized_functions_.size() >= kMaxSerializedFunctionsCacheSize) {
TRACE_BROKER_MISSING(this,
"opportunity - serialized functions cache is full.");
return false;
}
SerializedFunction function{shared, feedback}; SerializedFunction function{shared, feedback};
auto matching_functions = serialized_functions_.equal_range(function); auto matching_functions = serialized_functions_.equal_range(function);
return std::find_if(matching_functions.first, matching_functions.second, return std::find_if(matching_functions.first, matching_functions.second,
......
...@@ -266,6 +266,7 @@ class V8_EXPORT_PRIVATE JSHeapBroker { ...@@ -266,6 +266,7 @@ class V8_EXPORT_PRIVATE JSHeapBroker {
}; };
ZoneMultimap<SerializedFunction, HintsVector> serialized_functions_; ZoneMultimap<SerializedFunction, HintsVector> serialized_functions_;
static const size_t kMaxSerializedFunctionsCacheSize = 200;
static const size_t kMinimalRefsBucketCount = 8; // must be power of 2 static const size_t kMinimalRefsBucketCount = 8; // must be power of 2
static const size_t kInitialRefsBucketCount = 1024; // must be power of 2 static const size_t kInitialRefsBucketCount = 1024; // must be power of 2
}; };
......
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