Embedding V8 in the Real World
summary
NativeScript embeds V8 on Android via JNI, generated metadata and JavaScript proxy objects so Java methods map to JS calls, with marshaling for primitives and proxies for objects. Worker threads use V8 isolates as worker threads (not contexts), allowing parallel JS execution. Startup time drops from about two seconds to near zero using custom startup snapshots, though snapshots require lazy wrappers around native API access and can break with third‑party code. Implementation notes include proxy callbacks, constructor/field getters, and GC synchronization between V8 and ART.
AI-written summary · about
chapters (11)
- 0:00Introduction to JS engines
- 3:42NativeScript and V8
- 5:11Bridging JS and Native
- 8:15Runtime architecture
- 11:02Metadata and marshaling
- 12:44Callback mechanics
- 16:13JNI and data conversion
- 18:45Multithreading in JS
- 23:14V8 isolates and contexts
- 24:48Startup optimization
- 30:19Conclusion and Q&A
related talks
43mEmbedding V8 in the real world
26mEmbedding V8 in the real world
28mThe Hidden Features from V8 to Boost Your React Native Apps
17mV8 engine, JS Code Interpretation, and Execution
26mnative.js: JavaScript in your native mobile apps
35mA Friend in needs a Js indeed
28mWhat's Happening in V8?
47mAn Introduction to NativeScript
