JS Engine
↔ Program to execute JS Source Code, consists of Call Stack, Heap, Callback Queue & Event Loop
aka JavaScript-Engine
Call Stack
where code executed via EC, to track execution order
Heap
unstructured memory pool to store all Objects for app
Value
immutable data saved at Memory Address
JS Compiler
Program to transform JS Code, consists of Baseline Compiler, Optimization Compiler & Monitor
JIT
Mix of Interpretation & Compiled Language, used by modern JS Engine, all code compiled & executed immediately
Interpretation
Programming Language with Interpreter to parse & execute Source Code line by line
Compiler
Program to translate Source Code to Machine Code (or IR)
References
Browser Runtime
↔ JS Runtime Environ with JS Engine, Web API, Callback Queue & Event LoopJavaScript Runtime
↔ Environ (container) to run JS, consists of JS Engine, JS Library & Platform-specific APINode.js Runtime
↔ JS Runtime Environ to execute JS outside Browser via JS Engine with C++ Bindings & Thread PoolConcurrency Model
↔ (mechanism) to achieve Concurrency for JS Engine via Event Loop, Callback Queue & Callback FunctionAST
↔ tree data struct to rep Source Code by organize JS Keywords for JS EngineJS Interpreter
↔ JS Engine Component to check AST forSyntaxError
, handles ASIJIT
↔ Mix of Interpretation & Compiled Language, used by modern JS Engine, all code compiled & executed immediatelyGarbage-Collection
↔ 🧹Algorithm (in JS Engine) to remove old unused Object from Heap MemoryInternalError
↔ Exception when exceed Call Stack size in JS Engine - when something too large || Infinite LoopLexical Environment
↔ current Scope environ where JS Engine read CodegetHeapStatistics()
↔v8
Static Method to print stats for JS EngineSpidermonkey
↔ JS Engine to power Firefox, built in C++