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 b95354290941 · nodejs/node@af9d821

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • common.gypi
  • deps/v8
    • src
      • extensions
        • statistics-extension.cc
      • flags
        • flag-definitions.h
      • init
        • bootstrapper.cc
    • test/mjsunit
      • statistics-extension.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
@@ -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.22',
40+
'v8_embedder_string': '-node.23',
4141

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

Collapse file

‎deps/v8/src/extensions/statistics-extension.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/extensions/statistics-extension.cc
+25-20Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -124,36 +124,41 @@ void StatisticsExtension::GetCounters(
124124

125125
AddNumber64(args.GetIsolate(), result, heap->external_memory(),
126126
"amount_of_external_allocated_memory");
127-
args.GetReturnValue().Set(result);
128127

129-
DisallowGarbageCollection no_gc;
130-
HeapObjectIterator iterator(
131-
reinterpret_cast<Isolate*>(args.GetIsolate())->heap());
132128
int reloc_info_total = 0;
133129
int source_position_table_total = 0;
134-
for (HeapObject obj = iterator.Next(); !obj.is_null();
135-
obj = iterator.Next()) {
136-
Object maybe_source_positions;
137-
if (obj.IsCode()) {
138-
Code code = Code::cast(obj);
139-
reloc_info_total += code.relocation_info().Size();
140-
maybe_source_positions = code.source_position_table();
141-
} else if (obj.IsBytecodeArray()) {
142-
maybe_source_positions =
143-
BytecodeArray::cast(obj).source_position_table(kAcquireLoad);
144-
} else {
145-
continue;
130+
{
131+
HeapObjectIterator iterator(
132+
reinterpret_cast<Isolate*>(args.GetIsolate())->heap());
133+
DCHECK(!AllowGarbageCollection::IsAllowed());
134+
for (HeapObject obj = iterator.Next(); !obj.is_null();
135+
obj = iterator.Next()) {
136+
Object maybe_source_positions;
137+
if (obj.IsCode()) {
138+
Code code = Code::cast(obj);
139+
reloc_info_total += code.relocation_info().Size();
140+
// Baseline code doesn't have source positions since it uses
141+
// interpreter code positions.
142+
if (code.kind() == CodeKind::BASELINE) continue;
143+
maybe_source_positions = code.source_position_table();
144+
} else if (obj.IsBytecodeArray()) {
145+
maybe_source_positions =
146+
BytecodeArray::cast(obj).source_position_table(kAcquireLoad);
147+
} else {
148+
continue;
149+
}
150+
if (!maybe_source_positions.IsByteArray()) continue;
151+
ByteArray source_positions = ByteArray::cast(maybe_source_positions);
152+
if (source_positions.length() == 0) continue;
153+
source_position_table_total += source_positions.Size();
146154
}
147-
if (!maybe_source_positions.IsByteArray()) continue;
148-
ByteArray source_positions = ByteArray::cast(maybe_source_positions);
149-
if (source_positions.length() == 0) continue;
150-
source_position_table_total += source_positions.Size();
151155
}
152156

153157
AddNumber(args.GetIsolate(), result, reloc_info_total,
154158
"reloc_info_total_size");
155159
AddNumber(args.GetIsolate(), result, source_position_table_total,
156160
"source_position_table_total_size");
161+
args.GetReturnValue().Set(result);
157162
}
158163

159164
} // namespace internal
Collapse file

‎deps/v8/src/flags/flag-definitions.h‎

Copy file name to clipboardExpand all lines: deps/v8/src/flags/flag-definitions.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,7 @@ DEFINE_STRING(expose_gc_as, nullptr,
13901390
DEFINE_IMPLICATION(expose_gc_as, expose_gc)
13911391
DEFINE_BOOL(expose_externalize_string, false,
13921392
"expose externalize string extension")
1393+
DEFINE_BOOL(expose_statistics, false, "expose statistics extension")
13931394
DEFINE_BOOL(expose_trigger_failure, false, "expose trigger-failure extension")
13941395
DEFINE_BOOL(expose_ignition_statistics, false,
13951396
"expose ignition-statistics extension (requires building with "
Collapse file

‎deps/v8/src/init/bootstrapper.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/init/bootstrapper.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5089,7 +5089,7 @@ bool Genesis::InstallExtensions(Isolate* isolate,
50895089
InstallExtension(isolate, "v8/gc", &extension_states)) &&
50905090
(!FLAG_expose_externalize_string ||
50915091
InstallExtension(isolate, "v8/externalize", &extension_states)) &&
5092-
(!TracingFlags::is_gc_stats_enabled() ||
5092+
(!(FLAG_expose_statistics || TracingFlags::is_gc_stats_enabled()) ||
50935093
InstallExtension(isolate, "v8/statistics", &extension_states)) &&
50945094
(!FLAG_expose_trigger_failure ||
50955095
InstallExtension(isolate, "v8/trigger-failure", &extension_states)) &&
Collapse file

‎deps/v8/test/mjsunit/statistics-extension.js‎

Copy file name to clipboard
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2022 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Flags: --expose-statistics
6+
7+
assertEquals(typeof getV8Statistics, 'function');
8+
var result = getV8Statistics();
9+
assertEquals(typeof result, 'object');
10+
for (let key of Object.keys(result)) {
11+
assertEquals(typeof result[key], 'number');
12+
}

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.