deps: use std::map in MSVC STL for EphemeronRememberedSet

PR-URL: https://github.com/nodejs/node/pull/58070
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This commit is contained in:
Joyee Cheung 2025-04-28 03:39:11 +02:00 committed by Michaël Zasso
parent c951b76a3b
commit 4d7da6cca1
No known key found for this signature in database
GPG key ID: 770F7A9A5AE15600
2 changed files with 10 additions and 1 deletions

View file

@ -38,7 +38,7 @@
# Reset this number to 0 on major V8 upgrades. # Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8. # Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.5', 'v8_embedder_string': '-node.6',
##### V8 defaults for Node.js ##### ##### V8 defaults for Node.js #####

View file

@ -5,7 +5,11 @@
#ifndef V8_HEAP_EPHEMERON_REMEMBERED_SET_H_ #ifndef V8_HEAP_EPHEMERON_REMEMBERED_SET_H_
#define V8_HEAP_EPHEMERON_REMEMBERED_SET_H_ #define V8_HEAP_EPHEMERON_REMEMBERED_SET_H_
#if defined(_MSVC_STL_VERSION)
#include <map>
#else
#include <unordered_map> #include <unordered_map>
#endif
#include <unordered_set> #include <unordered_set>
#include "src/base/platform/mutex.h" #include "src/base/platform/mutex.h"
@ -26,8 +30,13 @@ class EphemeronRememberedSet final {
kEphemeronTableListSegmentSize>; kEphemeronTableListSegmentSize>;
using IndicesSet = std::unordered_set<int>; using IndicesSet = std::unordered_set<int>;
#if defined(_MSVC_STL_VERSION)
using TableMap = std::map<Tagged<EphemeronHashTable>, IndicesSet,
Object::Comparer>;
#else
using TableMap = std::unordered_map<Tagged<EphemeronHashTable>, IndicesSet, using TableMap = std::unordered_map<Tagged<EphemeronHashTable>, IndicesSet,
Object::Hasher>; Object::Hasher>;
#endif
void RecordEphemeronKeyWrite(Tagged<EphemeronHashTable> table, void RecordEphemeronKeyWrite(Tagged<EphemeronHashTable> table,
Address key_slot); Address key_slot);