GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — deps: V8: cherry-pick 7f5daed62d47 · nodejs/node@d4a530e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • common.gypi
  • deps/v8
    • src/runtime
      • runtime-test.cc
      • runtime.h
    • test/mjsunit/harmony
      • symbol-as-weakmap-key.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎common.gypi‎

Copy file name to clipboardExpand all lines: common.gypi
+1-1Lines changed: 1 addition & 1 deletion
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.29',
39+
'v8_embedder_string': '-node.30',
4040

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

Collapse file

‎deps/v8/src/runtime/runtime-test.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/runtime/runtime-test.cc
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "src/logging/counters.h"
2828
#include "src/objects/heap-object-inl.h"
2929
#include "src/objects/js-array-inl.h"
30+
#include "src/objects/js-collection-inl.h"
3031
#include "src/objects/js-function-inl.h"
3132
#include "src/objects/js-regexp-inl.h"
3233
#include "src/objects/managed-inl.h"
@@ -1730,5 +1731,14 @@ RUNTIME_FUNCTION(Runtime_SharedGC) {
17301731
return ReadOnlyRoots(isolate).undefined_value();
17311732
}
17321733

1734+
RUNTIME_FUNCTION(Runtime_GetWeakCollectionSize) {
1735+
HandleScope scope(isolate);
1736+
DCHECK_EQ(1, args.length());
1737+
Handle<JSWeakCollection> collection = args.at<JSWeakCollection>(0);
1738+
1739+
return Smi::FromInt(
1740+
EphemeronHashTable::cast(collection->table()).NumberOfElements());
1741+
}
1742+
17331743
} // namespace internal
17341744
} // namespace v8
Collapse file

‎deps/v8/src/runtime/runtime.h‎

Copy file name to clipboardExpand all lines: deps/v8/src/runtime/runtime.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ namespace internal {
498498
F(GetInitializerFunction, 1, 1) \
499499
F(GetOptimizationStatus, 1, 1) \
500500
F(GetUndetectable, 0, 1) \
501+
F(GetWeakCollectionSize, 1, 1) \
501502
F(GlobalPrint, 1, 1) \
502503
F(HasDictionaryElements, 1, 1) \
503504
F(HasDoubleElements, 1, 1) \
Collapse file

‎deps/v8/test/mjsunit/harmony/symbol-as-weakmap-key.js‎

Copy file name to clipboardExpand all lines: deps/v8/test/mjsunit/harmony/symbol-as-weakmap-key.js
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// Flags: --harmony-symbol-as-weakmap-key --expose-gc
5+
// Flags: --harmony-symbol-as-weakmap-key --expose-gc --allow-natives-syntax --noincremental-marking
66

77
(function TestWeakMapWithNonRegisteredSymbolKey() {
88
const key = Symbol('123');
@@ -28,16 +28,17 @@
2828
const outerKey = Symbol('234');
2929
const outerValue = 1;
3030
map.set(outerKey, outerValue);
31-
{
31+
(function () {
3232
const innerKey = Symbol('123');
3333
const innerValue = 1;
3434
map.set(innerKey, innerValue);
3535
assertTrue(map.has(innerKey));
3636
assertSame(innerValue, map.get(innerKey));
37-
}
37+
})();
3838
gc();
3939
assertTrue(map.has(outerKey));
4040
assertSame(outerValue, map.get(outerKey));
41+
assertEquals(1, %GetWeakCollectionSize(map));
4142
})();
4243

4344
(function TestWeakMapWithRegisteredSymbolKey() {
@@ -74,13 +75,14 @@
7475
const set = new WeakSet();
7576
const outerKey = Symbol('234');
7677
set.add(outerKey);
77-
{
78+
(function () {
7879
const innerKey = Symbol('123');
7980
set.add(innerKey);
8081
assertTrue(set.has(innerKey));
81-
}
82-
gc();
82+
})();
8383
assertTrue(set.has(outerKey));
84+
gc();
85+
assertEquals(1, %GetWeakCollectionSize(set));
8486
})();
8587

8688
(function TestWeakSetWithRegisteredSymbolKey() {

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.