I'm looking for a way to run the Javascript code on android by using V8 engine with different options. Just like on PC: run the test with --always-opt option ./d8 --always-opt test.js
Now, I have cross-compiled v8 and execute d8 on android. But it seems impossible to run V8 with options in mobile devices. Is there any way to do that?
Thanks a lot.
If you use the adb shell
command to run d8 on Android, you should be able to set flags just like on any other platform. If that's not what you're doing, then please be more specific about your setup.
Also, note that --always-opt
is almost guaranteed to be a bad idea, as it significantly lowers performance (contrary to what you might expect based on the flag's name alone). The way virtual machines for dynamic languages work, they need type feedback in order to be able to optimize anything; trying to optimize before type feedback is available is counter-productive.