Skip to content

Commit 16c9348

Browse files
committed
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 <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Michael Dawson <[email protected]> PR-URL: #54077 Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
1 parent dc4e702 commit 16c9348

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
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.6',
39+
'v8_embedder_string': '-node.7',
4040

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

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

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

867867
transition_target = map.object()->FindElementsKindTransitionedMap(
868-
isolate(),
869-
MapHandlesSpan(possible_transition_targets.begin(),
870-
possible_transition_targets.end()),
871-
ConcurrencyMode::kConcurrent);
868+
isolate(), possible_transition_targets, ConcurrencyMode::kConcurrent);
872869
}
873870

874871
if (transition_target.is_null()) {

deps/v8/src/ic/ic.cc

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

378-
void IC::ConfigureVectorState(Handle<Name> name, MapHandlesSpan maps,
378+
void IC::ConfigureVectorState(Handle<Name> name, MapHandles const& maps,
379379
MaybeObjectHandles* handlers) {
380380
DCHECK(!IsGlobalIC());
381381
std::vector<MapAndHandler> maps_and_handlers;
@@ -741,9 +741,10 @@ bool IC::IsTransitionOfMonomorphicTarget(Tagged<Map> source_map,
741741
source_map->elements_kind(), target_elements_kind);
742742
Tagged<Map> transitioned_map;
743743
if (more_general_transition) {
744-
Handle<Map> single_map[1] = {handle(target_map, isolate_)};
744+
MapHandles map_list;
745+
map_list.push_back(handle(target_map, isolate_));
745746
transitioned_map = source_map->FindElementsKindTransitionedMap(
746-
isolate(), single_map, ConcurrencyMode::kSynchronous);
747+
isolate(), map_list, ConcurrencyMode::kSynchronous);
747748
}
748749
return transitioned_map == target_map;
749750
}
@@ -1245,10 +1246,7 @@ void KeyedLoadIC::UpdateLoadElement(Handle<HeapObject> receiver,
12451246
} else if (target_receiver_maps.size() == 1) {
12461247
ConfigureVectorState(Handle<Name>(), target_receiver_maps[0], handlers[0]);
12471248
} else {
1248-
ConfigureVectorState(Handle<Name>(),
1249-
MapHandlesSpan(target_receiver_maps.begin(),
1250-
target_receiver_maps.end()),
1251-
&handlers);
1249+
ConfigureVectorState(Handle<Name>(), target_receiver_maps, &handlers);
12521250
}
12531251
}
12541252

@@ -1447,9 +1445,7 @@ void KeyedLoadIC::LoadElementPolymorphicHandlers(
14471445
// generate an elements kind transition for this kind of receivers.
14481446
if (receiver_map->is_stable()) {
14491447
Tagged<Map> tmap = receiver_map->FindElementsKindTransitionedMap(
1450-
isolate(),
1451-
MapHandlesSpan(receiver_maps->begin(), receiver_maps->end()),
1452-
ConcurrencyMode::kSynchronous);
1448+
isolate(), *receiver_maps, ConcurrencyMode::kSynchronous);
14531449
if (!tmap.is_null()) {
14541450
receiver_map->NotifyLeafMapLayoutChange(isolate());
14551451
}
@@ -2478,9 +2474,7 @@ void KeyedStoreIC::StoreElementPolymorphicHandlers(
24782474
} else {
24792475
{
24802476
Tagged<Map> tmap = receiver_map->FindElementsKindTransitionedMap(
2481-
isolate(),
2482-
MapHandlesSpan(receiver_maps.begin(), receiver_maps.end()),
2483-
ConcurrencyMode::kSynchronous);
2477+
isolate(), receiver_maps, ConcurrencyMode::kSynchronous);
24842478
if (!tmap.is_null()) {
24852479
if (receiver_map->is_stable()) {
24862480
receiver_map->NotifyLeafMapLayoutChange(isolate());

deps/v8/src/ic/ic.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class IC {
8888
void ConfigureVectorState(Handle<Name> name, DirectHandle<Map> map,
8989
const MaybeObjectHandle& handler);
9090
// Configure the vector for POLYMORPHIC.
91-
void ConfigureVectorState(Handle<Name> name, MapHandlesSpan maps,
91+
void ConfigureVectorState(Handle<Name> name, MapHandles const& maps,
9292
MaybeObjectHandles* handlers);
9393
void ConfigureVectorState(
9494
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
@@ -922,15 +922,16 @@ Handle<Map> Map::GetDerivedMap(Isolate* isolate, Handle<Map> from,
922922
prototype);
923923
}
924924

925-
static bool ContainsMap(MapHandlesSpan maps, Tagged<Map> map) {
925+
static bool ContainsMap(MapHandles const& maps, Tagged<Map> map) {
926926
DCHECK(!map.is_null());
927927
for (Handle<Map> current : maps) {
928928
if (!current.is_null() && *current == map) return true;
929929
}
930930
return false;
931931
}
932932

933-
static bool HasElementsKind(MapHandlesSpan maps, ElementsKind elements_kind) {
933+
static bool HasElementsKind(MapHandles const& maps,
934+
ElementsKind elements_kind) {
934935
for (Handle<Map> current : maps) {
935936
if (!current.is_null() && current->elements_kind() == elements_kind)
936937
return true;
@@ -939,7 +940,7 @@ static bool HasElementsKind(MapHandlesSpan maps, ElementsKind elements_kind) {
939940
}
940941

941942
Tagged<Map> Map::FindElementsKindTransitionedMap(Isolate* isolate,
942-
MapHandlesSpan candidates,
943+
MapHandles const& candidates,
943944
ConcurrencyMode cmode) {
944945
DisallowGarbageCollection no_gc;
945946

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"
@@ -138,7 +137,6 @@ enum class ObjectFields {
138137
};
139138

140139
using MapHandles = std::vector<Handle<Map>>;
141-
using MapHandlesSpan = v8::MemorySpan<Handle<Map>>;
142140

143141
#include "torque-generated/src/objects/map-tq.inc"
144142

@@ -851,7 +849,7 @@ class Map : public TorqueGeneratedMap<Map, HeapObject> {
851849
// elements_kind that's found in |candidates|, or |nullptr| if no match is
852850
// found at all.
853851
V8_EXPORT_PRIVATE Tagged<Map> FindElementsKindTransitionedMap(
854-
Isolate* isolate, MapHandlesSpan candidates, ConcurrencyMode cmode);
852+
Isolate* isolate, MapHandles const& candidates, ConcurrencyMode cmode);
855853

856854
inline bool CanTransition() const;
857855

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,8 @@ static void TestReconfigureElementsKind_GeneralizeFieldInPlace(
18411841
// Ensure Map::FindElementsKindTransitionedMap() is able to find the
18421842
// transitioned map.
18431843
{
1844-
Handle<Map> map_list[1]{updated_map};
1844+
MapHandles map_list;
1845+
map_list.push_back(updated_map);
18451846
Tagged<Map> transitioned_map = map2->FindElementsKindTransitionedMap(
18461847
isolate, map_list, ConcurrencyMode::kSynchronous);
18471848
CHECK_EQ(*updated_map, transitioned_map);

0 commit comments

Comments
 (0)