Skip to content
joshua edited this page Feb 20, 2018 · 8 revisions

This is an introductory tutorial to the quirks of V8 development.

Motivation

For a long time I have been working with v8 and JSCore, embedding both of them in Android, and JSCore on iOS. Many things I learned came by exploring Chromium source code, lots of experimentation and the needs coming from the products I've been working on.

I will focus primarily on Android. While most of the concepts will apply to other OS's, the setup won't. It is my expectation to learn while I go deep into the tutorial series to embed v8 in other systems as smoothly as on Android.

Index

  • v8 Compilation.

  • Android project setup.

  • First 1O1 Android sample, initialisation.

  • Core concepts

    • Isolate, Context, Scope, Handles, Global, etc.
    • Absence of loop.
    • v8 Strings and Utf8Value
  • Defining objects in v8 I

    • FunctionTemplate
    • ObjectTemplate
    • Setting Constructor
    • Prototype
    • Inheritance
  • Defining objects in v8 II

    • Properties and property attributes
    • Indexed properties
    • Methods
    • Naming objects
    • Naming prototypes
  • Defining objects in v8 III

    • Internal fields
    • v8 to Native object pointers
    • Wrapping
    • Per Isolate Data
    • FunctionTemplates as Global
  • JNI

    • Initialization
    • Attaching VM
    • Isolate and threading
  • Exception handling

    • TryCatch
    • Isolate's AddMessageListener
  • A more Advanced sample

    • Defining a Global template
    • Adding a loop
    • A sample RequestAnimationFrame
    • Calling a javascript functions from Native
  • Garbage Collection

    • Preventing objects collection. Persistent and Eternal.
    • Freeing native companions
    • Isolate destruction
    • Wrapper Class Id
    • Context destruction
  • Inspector integration

    • Inspector Client
    • Channel
    • Debugging Session
    • Dev tools integration
Clone this wiki locally