Node for iOS
There were 3 options:
Port V8 to iOS anyway. Given that it does build for OSX, presumably it wouldn't be too hard to get it to compile and run. This would allow everything to work smoothly like it does for Android. The downside is that it would only be suitable for apps deployed outside of the App Store. This is a non-starter, given the goals for the project.
So the magic contained in the
V82JSC directory is option 3. The
v8.h header and its inlines are supported, but none of
the V8 backend is included. The vast majority of V8 API tests now pass, and more than enough to support node.
This was much more work than even I originally anticipated, as the V8 inlines make some important assumptions about the implementation details. I had to replicate those details to get it to all work unchanged. So this required, amongst other things, for me to write my own heap management and garbage collector. Thus, there may well be bugs. Additionally, there are probably a lot of opportunities for optimization. I have not done any profiling yet, so if you see extreme slowness anywhere, please file an issue. Finally, although I implemented perhaps 90% of the V8 API, there are some esoteric functions that I did not implement, because either the test suite did not cover them or node does not use them. Attempts to call those will result in a failed assertion. If any of those become critical, please also file an issue.
The good news is that the footprint is tiny. The
NodeConsole test app weighs in at just 2.3 MB.