0

I have modified the GetVariables() method in my gyp_configuration.py file and ensured that the variables dictionary that is returned contains the following key/value pairs:

'javascript_engine': 'v8',
'cobalt_enable_jit': 1,

But I still can't switch JS engine from SpiderMonkey to V8 How could we switch JS engine from SpiderMonkey to V8?

Cobalt version:RC(release candidate) of Cobalt 2019 LTS
build configuration: qa
platform:Linux/ARM
Derrick
  • 3,669
  • 5
  • 35
  • 50
Eric
  • 1
  • Hi there... I'm surprised that this wasn't enough, these changes should have been sufficient. Are you sure that elsewhere in your configuration they are not overridden? As an example, you can look at the linux-x64x11 build which does have V8 enabled: https://cobalt.googlesource.com/cobalt/+/19.lts.1+/src/starboard/linux/x64x11/ Please let me know if you are able to figure out what's wrong, I am curious if we would be able to make it easier to enable V8. – Andrew Top Jul 27 '18 at 21:17
  • I don't know where there's a problem.The function GetVariables() has been modified as follows: – Eric Jul 28 '18 at 02:07
  • def GetVariables(self, configuration): hisi_home = self._GetHisiHome() sysroot = os.path.realpath(os.path.join(hisi_home, 'target')) if not os.path.isdir(sysroot): sys.exit(1) variables = super(HisiPlatformConfig, self).GetVariables(configuration) print(variables) variables.update({ 'clang': 0, 'sysroot': sysroot, 'javascript_engine': 'v8', 'cobalt_enable_jit': 1, }) print(variables) return variables – Eric Jul 28 '18 at 02:08
  • The printed log is as follows: {'cobalt_config': 'qa', 'cobalt_enable_jit': 0, 'use_tsan': 0, 'cobalt_fastbuild': 0, 'enable_vr': 0, 'use_asan': 0, 'javascript_engine': 'mozjs-45', 'custom_media_session_client': 0, 'clang': 0} {'enable_vr': 0, 'use_tsan': 0, 'cobalt_config': 'qa', 'cobalt_enable_jit': 1, 'clang': 0, 'cobalt_fastbuild': 0, 'use_asan': 0, 'javascript_engine': 'v8', 'sysroot': '/opt/hisi-linux/x86-arm/arm-histbv320-linux/target', 'custom_media_session_client': 0} – Eric Jul 28 '18 at 02:08
  • Hi Eric, that seems right to me. Adjusting the returned dictionary of GetVariables() affects the set of variables visible and acted upon by GYP. Here is where the variables are checked: https://cobalt.googlesource.com/cobalt/+/19.lts.1+/src/cobalt/script/engine.gyp#25 , perhaps you can play around with the values there to see if V8 is still being recognized? If so, what is it that indicates to you that you are using SpiderMonkey instead of V8? – Andrew Top Jul 30 '18 at 16:36

0 Answers0