Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

171
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda