Open sivagao opened 8 years ago
翻译自How does NodeJS work? Browser Virtual Machine V8 V8 Templates
翻译自How does NodeJS work?
Function Template
Object Template
By now, we learned how to expose C++ methods\structures to JavaScript. We will now learn how to run JavaScript code in those modified contexts. It’s simple. Just compile and run principle.
Modularity
Let’s start with NativeModule first.
Another thing is Module loader implementation.
Function Template
Object Template
By now, we learned how to expose C++ methods\structures to JavaScript. We will now learn how to run JavaScript code in those modified contexts. It’s simple. Just compile and run principle.
V8 Compile && Run JavaScript
C++ -> V8 Templates -> Run JavaScript -> ?
Modularity
C++ Module Loader
JavaScript Module Loader
Let’s start with NativeModule first.
Another thing is Module loader implementation.
NodeJS Runtime Library?
Event Loop