Skip to content

Tag: v8

In V8, what is lazy deoptimization, and how does it happen?

According to V8 source code and turbofan materials, there is a type of deoptimization called lazy deoptimization which is described as follows(v8/src/common/globals.h): Lazy: the code has been marked as dependent on some assumption which is checked elsewhere and can trigger deoptimization the next time the code is executed. However, when observing the execution of ‘v8/test/mjsunit/compiler/deopt-lazy-shape-mutation.js’ with d8, I found that

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 how this function is triggered. Answer When an optimization job is complete, it

Three different `this` behaviours for three different JS engines

I was learning about the this keyword and how it means different things with regards to regular functions vs ES6 arrow functions and function expressions and I came across something odd when trying to run the following code in Chrome, Deno and Node. So I prepared following: Example: Deno output: Node output: Chrome output: According to my understanding of this,

Create big json object js

I am using Nodejs to Create a JSON file from a really large JSON object (1GB). In order to avoid memory problems, I’m using createWriteStream : var writeStream = fs.createWriteStream(‘./output/outPut….