How to read the v8 source code?

How to read the v8 source code?

JavaScript runs on many platforms and in different environments. We often forget about the low level infrastructure that makes it work. During this talk we are going to explore how to read the source code of v8. We'll see how to dig into different features of the language and understand how they work. This can give us a very deep understanding and make us a better JavaScript developers.

Eb44761e0fb3a5ec8e23ec28048dd7a5?s=128

Nikolay Stoitsev

August 03, 2018
Tweet

Transcript

  1. Aug 2, 2018 var title = “How to read the

    V8 source code”; var info = { name: “Nikolay Stoitsev”, otherOptional: “Software Engineer at Uber” };
  2. Aug 2, 2018

  3. Aug 2, 2018

  4. Aug 2, 2018 Why reading source code?

  5. Aug 2, 2018 Learning in depth

  6. Aug 2, 2018 How?

  7. Aug 2, 2018 C++ 68.6% JavaScript 29.5% Python 1.4% HTML

    0.2% TypeScript 0.1% C 0.1% Other 0.1%
  8. Aug 2, 2018

  9. Aug 2, 2018 Header File

  10. Aug 2, 2018 Header File

  11. Aug 2, 2018 Header File

  12. Aug 2, 2018 Header File

  13. Aug 2, 2018 Implementation

  14. Aug 2, 2018 Implementation

  15. Aug 2, 2018 .js

  16. Aug 2, 2018 Parser .js AST

  17. Aug 2, 2018 Parser .js AST Ignition Bitecode

  18. Aug 2, 2018 Parser .js AST Ignition Bitecode TurboFan Machine

    code
  19. Aug 2, 2018 Parser .js AST Ignition Bitecode TurboFan Machine

    code Optimizer
  20. Aug 2, 2018 How JavaScript works: Parsing, Abstract Syntax Trees

    (ASTs) + 5 tips on how to minimize parse time
  21. Aug 2, 2018 How JavaScript works: Parsing, Abstract Syntax Trees

    (ASTs) + 5 tips on how to minimize parse time
  22. Aug 2, 2018 First look in ./src

  23. Aug 2, 2018 Parsing code is in ./src/parsing

  24. Aug 2, 2018

  25. Aug 2, 2018 AST Nodes are defined in src/ast/ast.h

  26. Aug 2, 2018 BytecodeGenerator walks the AST and generate bytecode

    for each node
  27. Aug 2, 2018 BytecodeGenerator

  28. Aug 2, 2018 Read the tests!!!

  29. Aug 2, 2018 ./test/webkit

  30. Aug 2, 2018 ./test/webkit/array-reduce.js

  31. Aug 2, 2018 ./test/webkit/function-apply-aliased.js

  32. Aug 2, 2018 Thanks!!!

  33. Aug 2, 2018 Thanks to our Sponsors: