Generic Javascript to Java bridge

When embedding v8, one of the pain points is how to call Java/Kotlin code from Javascript. It is not just a matter of setting a FunctionCallbackInfo<Value>, but also of dealing with JNI. While there are really impressive exercises for automating JNI code calls, these are only valid suitable when you know your JNI needs upfront,Continue reading “Generic Javascript to Java bridge”

Squeezing v8 startup time

On my day to day job, v8 in present most of the time. One philosophical foundation of our product is startup time, and all time taken from startup to the first frame drawn must be lowered as much as possible. This startup time is composed of many different steps, from GL context initialization, to scriptContinue reading “Squeezing v8 startup time”

Change object default toString value in Javascript

For any javascript object, e.g.: A call obj.toString() will by default yield: [object Object] . Some other objects, like the browser Window object, will yield: [object Window] if printed on dev tools. We can force a value different than [object Object] by executing this: Now, obj will be identified as: Tagging special objects has never been easier than this. Addendum The native side of things would lookContinue reading “Change object default toString value in Javascript”