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 c172ffc5bf54 · nodejs/node@43bea6b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • common.gypi
  • deps/v8/src/heap
    • heap.cc
    • heap.h
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
@@ -38,7 +38,7 @@
3838

3939
# Reset this number to 0 on major V8 upgrades.
4040
# Increment by one for each non-official patch applied to deps/v8.
41-
'v8_embedder_string': '-node.13',
41+
'v8_embedder_string': '-node.14',
4242

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

Collapse file

‎deps/v8/src/heap/heap.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/heap/heap.cc
+7-6Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6376,12 +6376,13 @@ void Heap::AddRetainedMaps(DirectHandle<NativeContext> context,
63766376
GlobalHandleVector<Map> maps) {
63776377
Handle<WeakArrayList> array(Cast<WeakArrayList>(context->retained_maps()),
63786378
isolate());
6379-
if (array->IsFull()) {
6379+
int new_maps_size = static_cast<int>(maps.size()) * kRetainMapEntrySize;
6380+
if (array->length() + new_maps_size > array->capacity()) {
63806381
CompactRetainedMaps(*array);
63816382
}
63826383
int cur_length = array->length();
6383-
array = WeakArrayList::EnsureSpace(
6384-
isolate(), array, cur_length + static_cast<int>(maps.size()) * 2);
6384+
array =
6385+
WeakArrayList::EnsureSpace(isolate(), array, cur_length + new_maps_size);
63856386
if (*array != context->retained_maps()) {
63866387
context->set_retained_maps(*array);
63876388
}
@@ -6399,7 +6400,7 @@ void Heap::AddRetainedMaps(DirectHandle<NativeContext> context,
63996400
raw_array->Set(cur_length, MakeWeak(*map));
64006401
raw_array->Set(cur_length + 1,
64016402
Smi::FromInt(v8_flags.retain_maps_for_n_gc));
6402-
cur_length += 2;
6403+
cur_length += kRetainMapEntrySize;
64036404
raw_array->set_length(cur_length);
64046405

64056406
map->set_is_in_retained_map_list(true);
@@ -6411,7 +6412,7 @@ void Heap::CompactRetainedMaps(Tagged<WeakArrayList> retained_maps) {
64116412
int length = retained_maps->length();
64126413
int new_length = 0;
64136414
// This loop compacts the array by removing cleared weak cells.
6414-
for (int i = 0; i < length; i += 2) {
6415+
for (int i = 0; i < length; i += kRetainMapEntrySize) {
64156416
Tagged<MaybeObject> maybe_object = retained_maps->Get(i);
64166417
if (maybe_object.IsCleared()) {
64176418
continue;
@@ -6425,7 +6426,7 @@ void Heap::CompactRetainedMaps(Tagged<WeakArrayList> retained_maps) {
64256426
retained_maps->Set(new_length, maybe_object);
64266427
retained_maps->Set(new_length + 1, age);
64276428
}
6428-
new_length += 2;
6429+
new_length += kRetainMapEntrySize;
64296430
}
64306431
Tagged<HeapObject> undefined = ReadOnlyRoots(this).undefined_value();
64316432
for (int i = new_length; i < length; i++) {
Collapse file

‎deps/v8/src/heap/heap.h‎

Copy file name to clipboardExpand all lines: deps/v8/src/heap/heap.h
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,6 +1830,8 @@ class Heap final {
18301830
void AddToRingBuffer(const char* string);
18311831
void GetFromRingBuffer(char* buffer);
18321832

1833+
static constexpr int kRetainMapEntrySize = 2;
1834+
18331835
void CompactRetainedMaps(Tagged<WeakArrayList> retained_maps);
18341836

18351837
void CollectGarbageOnMemoryPressure();

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.