user6872780
user6872780

Reputation:

What does it mean that v8 compiles js code to native machine code?

How does v8 load and execute the native machine code it generates?

Upvotes: 0

Views: 254

Answers (1)

camillobruni
camillobruni

Reputation: 2318

Basically V8 creates a byte array containing the native instructions. It then copies the data into an executable memory region from which point on you can directly jump/call to it.

See FinalizeCode within the compiler which sets up a new Code object.

As for calling, you'll find the detailed frame description in frame-constants.h where you want

Upvotes: 1

Related Questions