Skip to content

Commit 521b629

Browse files
targosRafaelGSS
authored andcommitted
deps: V8: revert CL 5331688
On Windows debug builds, it is not allowed to dereference empty iterators. Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5331688 PR-URL: #52465 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent 3795e97 commit 521b629

File tree

7 files changed

+17
-26
lines changed

7 files changed

+17
-26
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
# Reset this number to 0 on major V8 upgrades.
3939
# Increment by one for each non-official patch applied to deps/v8.
40-
'v8_embedder_string': '-node.8',
40+
'v8_embedder_string': '-node.9',
4141

4242
##### V8 defaults for Node.js #####
4343

deps/v8/src/compiler/js-heap-broker.cc

+1-4
Original file line numberDiff line numberDiff line change
@@ -832,10 +832,7 @@ ElementAccessFeedback const& JSHeapBroker::ProcessFeedbackMapsForElementAccess(
832832
MapUpdaterGuardIfNeeded mumd_scope(this);
833833

834834
transition_target = map.object()->FindElementsKindTransitionedMap(
835-
isolate(),
836-
MapHandlesSpan(possible_transition_targets.begin(),
837-
possible_transition_targets.end()),
838-
ConcurrencyMode::kConcurrent);
835+
isolate(), possible_transition_targets, ConcurrencyMode::kConcurrent);
839836
}
840837

841838
if (transition_target.is_null()) {

deps/v8/src/ic/ic.cc

+7-13
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ void IC::ConfigureVectorState(Handle<Name> name, Handle<Map> map,
374374
OnFeedbackChanged(IsLoadGlobalIC() ? "LoadGlobal" : "Monomorphic");
375375
}
376376

377-
void IC::ConfigureVectorState(Handle<Name> name, MapHandlesSpan maps,
377+
void IC::ConfigureVectorState(Handle<Name> name, MapHandles const& maps,
378378
MaybeObjectHandles* handlers) {
379379
DCHECK(!IsGlobalIC());
380380
std::vector<MapAndHandler> maps_and_handlers;
@@ -740,9 +740,10 @@ bool IC::IsTransitionOfMonomorphicTarget(Tagged<Map> source_map,
740740
source_map->elements_kind(), target_elements_kind);
741741
Tagged<Map> transitioned_map;
742742
if (more_general_transition) {
743-
Handle<Map> single_map[1] = {handle(target_map, isolate_)};
743+
MapHandles map_list;
744+
map_list.push_back(handle(target_map, isolate_));
744745
transitioned_map = source_map->FindElementsKindTransitionedMap(
745-
isolate(), single_map, ConcurrencyMode::kSynchronous);
746+
isolate(), map_list, ConcurrencyMode::kSynchronous);
746747
}
747748
return transitioned_map == target_map;
748749
}
@@ -1241,10 +1242,7 @@ void KeyedLoadIC::UpdateLoadElement(Handle<HeapObject> receiver,
12411242
if (target_receiver_maps.size() == 1) {
12421243
ConfigureVectorState(Handle<Name>(), target_receiver_maps[0], handlers[0]);
12431244
} else {
1244-
ConfigureVectorState(Handle<Name>(),
1245-
MapHandlesSpan(target_receiver_maps.begin(),
1246-
target_receiver_maps.end()),
1247-
&handlers);
1245+
ConfigureVectorState(Handle<Name>(), target_receiver_maps, &handlers);
12481246
}
12491247
}
12501248

@@ -1441,9 +1439,7 @@ void KeyedLoadIC::LoadElementPolymorphicHandlers(
14411439
// generate an elements kind transition for this kind of receivers.
14421440
if (receiver_map->is_stable()) {
14431441
Tagged<Map> tmap = receiver_map->FindElementsKindTransitionedMap(
1444-
isolate(),
1445-
MapHandlesSpan(receiver_maps->begin(), receiver_maps->end()),
1446-
ConcurrencyMode::kSynchronous);
1442+
isolate(), *receiver_maps, ConcurrencyMode::kSynchronous);
14471443
if (!tmap.is_null()) {
14481444
receiver_map->NotifyLeafMapLayoutChange(isolate());
14491445
}
@@ -2470,9 +2466,7 @@ void KeyedStoreIC::StoreElementPolymorphicHandlers(
24702466
} else {
24712467
{
24722468
Tagged<Map> tmap = receiver_map->FindElementsKindTransitionedMap(
2473-
isolate(),
2474-
MapHandlesSpan(receiver_maps.begin(), receiver_maps.end()),
2475-
ConcurrencyMode::kSynchronous);
2469+
isolate(), receiver_maps, ConcurrencyMode::kSynchronous);
24762470
if (!tmap.is_null()) {
24772471
if (receiver_map->is_stable()) {
24782472
receiver_map->NotifyLeafMapLayoutChange(isolate());

deps/v8/src/ic/ic.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class IC {
8787
void ConfigureVectorState(Handle<Name> name, Handle<Map> map,
8888
const MaybeObjectHandle& handler);
8989
// Configure the vector for POLYMORPHIC.
90-
void ConfigureVectorState(Handle<Name> name, MapHandlesSpan maps,
90+
void ConfigureVectorState(Handle<Name> name, MapHandles const& maps,
9191
MaybeObjectHandles* handlers);
9292
void ConfigureVectorState(
9393
Handle<Name> name, std::vector<MapAndHandler> const& maps_and_handlers);

deps/v8/src/objects/map.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -936,15 +936,16 @@ Handle<Map> Map::GetDerivedMap(Isolate* isolate, Handle<Map> from,
936936
prototype);
937937
}
938938

939-
static bool ContainsMap(MapHandlesSpan maps, Tagged<Map> map) {
939+
static bool ContainsMap(MapHandles const& maps, Tagged<Map> map) {
940940
DCHECK(!map.is_null());
941941
for (Handle<Map> current : maps) {
942942
if (!current.is_null() && *current == map) return true;
943943
}
944944
return false;
945945
}
946946

947-
static bool HasElementsKind(MapHandlesSpan maps, ElementsKind elements_kind) {
947+
static bool HasElementsKind(MapHandles const& maps,
948+
ElementsKind elements_kind) {
948949
for (Handle<Map> current : maps) {
949950
if (!current.is_null() && current->elements_kind() == elements_kind)
950951
return true;
@@ -953,7 +954,7 @@ static bool HasElementsKind(MapHandlesSpan maps, ElementsKind elements_kind) {
953954
}
954955

955956
Tagged<Map> Map::FindElementsKindTransitionedMap(Isolate* isolate,
956-
MapHandlesSpan candidates,
957+
MapHandles const& candidates,
957958
ConcurrencyMode cmode) {
958959
DisallowGarbageCollection no_gc;
959960

deps/v8/src/objects/map.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#ifndef V8_OBJECTS_MAP_H_
66
#define V8_OBJECTS_MAP_H_
77

8-
#include "include/v8-memory-span.h"
98
#include "src/base/bit-field.h"
109
#include "src/common/globals.h"
1110
#include "src/objects/code.h"
@@ -136,7 +135,6 @@ enum class ObjectFields {
136135
};
137136

138137
using MapHandles = std::vector<Handle<Map>>;
139-
using MapHandlesSpan = v8::MemorySpan<Handle<Map>>;
140138

141139
#include "torque-generated/src/objects/map-tq.inc"
142140

@@ -846,7 +844,7 @@ class Map : public TorqueGeneratedMap<Map, HeapObject> {
846844
// elements_kind that's found in |candidates|, or |nullptr| if no match is
847845
// found at all.
848846
V8_EXPORT_PRIVATE Tagged<Map> FindElementsKindTransitionedMap(
849-
Isolate* isolate, MapHandlesSpan candidates, ConcurrencyMode cmode);
847+
Isolate* isolate, MapHandles const& candidates, ConcurrencyMode cmode);
850848

851849
inline bool CanTransition() const;
852850

deps/v8/test/cctest/test-field-type-tracking.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,8 @@ static void TestReconfigureElementsKind_GeneralizeFieldInPlace(
18371837
// Ensure Map::FindElementsKindTransitionedMap() is able to find the
18381838
// transitioned map.
18391839
{
1840-
Handle<Map> map_list[1]{updated_map};
1840+
MapHandles map_list;
1841+
map_list.push_back(updated_map);
18411842
Tagged<Map> transitioned_map = map2->FindElementsKindTransitionedMap(
18421843
isolate, map_list, ConcurrencyMode::kSynchronous);
18431844
CHECK_EQ(*updated_map, transitioned_map);

0 commit comments

Comments
 (0)