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

Function is_map

deps/v8/tools/windbg.js:374–387  ·  view source on GitHub ↗
(addr)

Source from the content-addressed store, hash-verified

372 Exploring objects
373-----------------------------------------------------------------------------*/
374function is_map(addr) {
375 let address = int(addr);
376 if (!Number.isSafeInteger(address) || address % 2 == 0) return false;
377
378 // the first field in all objects, including maps, is a map pointer, but for
379 // maps the pointer is always the same - the meta map that points to itself.
380 const map_addr = int(poim(address - 1));
381 if (!Number.isSafeInteger(map_addr)) return false;
382
383 const map_map_addr = int(poim(map_addr - 1));
384 if (!Number.isSafeInteger(map_map_addr)) return false;
385
386 return (map_addr === map_map_addr);
387}
388
389function is_likely_object(addr) {
390 let address = int(addr);

Callers 3

is_likely_objectFunction · 0.85
find_object_nearFunction · 0.85
dpFunction · 0.85

Calls 2

intFunction · 0.85
poimFunction · 0.85

Tested by

no test coverage detected