Skip to content
forked from v8/v8

Commit

Permalink
Merged: Squashed multiple commits.
Browse files Browse the repository at this point in the history
Merged: [runtime] Recreate enum cache on map update
Revision: 1c623f9

Merged: [runtime] Don't try to create empty enum cache.
Revision: 5516e06

BUG=chromium:1470668,chromium:1472317
R=tebbi@chromium.org

Change-Id: I31d5491aba663661ba68bb55631747a195ed084e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4788990
Commit-Queue: Samuel Groß <saelo@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/branch-heads/11.6@{v8#32}
Cr-Branched-From: e29c028-refs/heads/11.6.189@{v8#3}
Cr-Branched-From: 95cbef2-refs/heads/main@{#88340}
  • Loading branch information
Samuel Groß authored and V8 LUCI CQ committed Aug 17, 2023
1 parent 97c6f93 commit 09344cd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/objects/map-updater.cc
Expand Up @@ -12,6 +12,7 @@
#include "src/handles/handles.h"
#include "src/heap/parked-scope-inl.h"
#include "src/objects/field-type.h"
#include "src/objects/keys.h"
#include "src/objects/objects-inl.h"
#include "src/objects/objects.h"
#include "src/objects/property-details.h"
Expand Down Expand Up @@ -1037,6 +1038,13 @@ MapUpdater::State MapUpdater::ConstructNewMap() {
// the new descriptors to maintain descriptors sharing invariant.
split_map->ReplaceDescriptors(isolate_, *new_descriptors);

// If the old descriptors had an enum cache, make sure the new ones do too.
if (old_descriptors_->enum_cache().keys().length() > 0 &&
new_map->NumberOfEnumerableProperties() > 0) {
FastKeyAccumulator::InitializeFastPropertyEnumCache(
isolate_, new_map, new_map->NumberOfEnumerableProperties());
}

if (has_integrity_level_transition_) {
target_map_ = new_map;
state_ = kAtIntegrityLevelSource;
Expand Down

0 comments on commit 09344cd

Please sign in to comment.