Commit c5c92848 authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[nci] Don't use megamorphic load builtins for NCI

Megamorphic load builtins are a performance optimization when current
feedback is megamorphic. We can't make this assumption for shared NCI
code though, since feedback in other native contexts may *not* be
megamorphic, and we'd thus miss out on necessary feedback collection.

Bug: v8:8888
Change-Id: I2adc5ef9a6b021b35cf26f975c79228d556bf94f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2546694
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71264}
parent 3edf5433
...@@ -234,8 +234,19 @@ void JSGenericLowering::LowerJSStrictEqual(Node* node) { ...@@ -234,8 +234,19 @@ void JSGenericLowering::LowerJSStrictEqual(Node* node) {
} }
namespace { namespace {
// The megamorphic load builtin can be used as a performance optimization in
// some cases - unlike the full builtin, the megamorphic builtin does fewer
// checks and does not collect feedback.
bool ShouldUseMegamorphicLoadBuiltin(FeedbackSource const& source, bool ShouldUseMegamorphicLoadBuiltin(FeedbackSource const& source,
JSHeapBroker* broker) { JSHeapBroker* broker) {
if (broker->is_native_context_independent()) {
// The decision to use the megamorphic load builtin is made based on
// current feedback, and is thus context-dependent. It cannot be used when
// generating NCI code.
return false;
}
ProcessedFeedback const& feedback = broker->GetFeedback(source); ProcessedFeedback const& feedback = broker->GetFeedback(source);
if (feedback.kind() == ProcessedFeedback::kElementAccess) { if (feedback.kind() == ProcessedFeedback::kElementAccess) {
......
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