Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
Do V8 execute Byte code produced by the interpreter or binary code produced by the turbofan compiler?

I am confused about how v8 works and how it execute js code.

I understand that v8 first parse the code and create AST then take this AST introducing it to the interpreter as input and produce byte code then this byte code introduced to turbofan compiler that converts this intermediate code to machine code that computer understands.

I am reading an article about this topic which is good but it turned out that something is confusing to me

  1. Execution Phase: The byte code is executed by using the Memory heap and the Call Stack of the V8 engine’s runtime environment

I thought that machine code is the one that get executed otherwise why we need to create that code if the byte code is the one that is executed??

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

(V8 developer here.)

To confirm what @Bergi said in his comments: bytecode primarily serves the purpose of being executed by the interpreter, and that is in fact all that's needed to execute JavaScript. V8 (nowadays) doesn't compile all functions to machine code, only those that run hot enough for optimized compilation to (likely) be worth the time investment. As a particular detail of the implementation, the optimizing compiler uses the bytecode as input, which gives bytecode a secondary purpose; but that's really just a detail that could have been solved differently, such as by parsing the original source to an AST again when the optimizing compiler kicks in, which is how V8 used to do it until a couple of years ago.

(The article you linked to does mention most of these concepts, but I agree that it's written somewhat confusingly, and I'd disagree with some of its characterizations. See v8.dev/blog for official descriptions of how things work.)

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!