MCPcopy Index your code
hub / github.com/nodejs/node / print_objects_in_range

Function print_objects_in_range

deps/v8/tools/windbg.js:464–489  ·  view source on GitHub ↗
(start, end)

Source from the content-addressed store, hash-verified

462// This function assumes that pointers to objects are stored at ptr-size aligned
463// boundaries.
464function print_objects_in_range(start, end){
465 if (!Number.isSafeInteger(int(start)) || !Number.isSafeInteger(int(end))) {
466 return;
467 }
468 const ptr_size = pointer_size();
469 if (start < ptr_size || end <= start) return;
470
471 let iters = (end - start) / ptr_size;
472 let cur = start - ptr_size;
473 print(`===============================================`);
474 print(`objects in range ${hex(start)} - ${hex(end)}`);
475 print(`===============================================`);
476 let count = 0;
477 while (cur && cur < end) {
478 let obj = find_object_next(cur, iters);
479 if (obj) {
480 count++;
481 print(`${hex(obj + 1)} : ${hex(poim(obj))}`);
482 iters = (end - cur) / ptr_size;
483 }
484 cur = obj + ptr_size;
485 }
486 print(`===============================================`);
487 print(`found ${count} objects in range ${hex(start)} - ${hex(end)}`)
488 print(`===============================================`);
489}
490
491// This function assumes the pointer fields to be ptr-size aligned.
492function print_objects_tree(root, depth_limit) {

Callers

nothing calls this directly

Calls 6

intFunction · 0.85
pointer_sizeFunction · 0.85
find_object_nextFunction · 0.85
poimFunction · 0.85
printFunction · 0.70
hexFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…