r/learnjavascript • u/Upstairs-Concert5800 • 11m ago
Intercepting property access (e.g., navigator.bluetooth / Object.property) directly in V8
Hey everyone,
I'm working on my master's thesis and diving into V8 internals. I want to know if there's a clean way to intercept (or log/trace) property reads on an object directly inside V8 — for example, navigator.bluetooth or basically any Object.property access.
After reading a few V8 articles (like https://v8.dev/blog/fast-properties), it seems unlikely that all of this funnels through a single C++ function, given how differently properties are represented and resolved (in-object/fast properties, dictionary mode, interceptors, accessors, ICs, JIT tiers, etc.).
Before I go any deeper down this rabbit hole, is intercepting all property accesses in one central V8 spot even realistic, or am I basically throwing peas at a wall?
Thanks for any tips!