Skip to content

Tag: v8

Canvas API implementation

I recently started to learn a bit about how javascript work under the hood, and came to know that (in the context of chrome) v8 engine and web APIs are different. Here’s some questions I have regarding the canvas API specifically: Why do we need to use getImageData() every time we want to access the pix…

Concurrency optimization job in V8

When concurrency optimization is triggered, a new optimization job will be dispatched to a child-thread to complete. How does Runtime know that the optimization job has been completed? I’ve found that in runtime function StackGuard, the optimized code will be set in JSFunction, but I don’t know ho…

Hooking Function Constructor (JavaScript)

Does anyone know of a way to detect when a new function is created? I know you can hook the function class constructor but that will only detect new Function() calls, not function func(){} declarations. I assume the JS engine just creates a default function class when it sees a function declaration instead of…