Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27887] Android: Support WebAssembly in V8

GitHub Issuen/a
TypeNew Feature
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2020-11-20T16:15:13.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.3.0
ComponentsAndroid
Labelsn/a
ReporterChristopher Williams
AssigneeGary Mathews
Created2020-05-07T15:43:56.000+0000
Updated2020-11-20T16:15:13.000+0000

Description

I tried to use protobufjs npm package, and found on a simulator session that it crashed when trying to load WebAssembly baked into the long.js code here: https://github.com/dcodeIO/long.js/blob/master/src/long.js#L16 Here's the output:
[ERROR] v8:
[ERROR] v8:
[ERROR] v8: #
[ERROR] v8: # Fatal error in , line 0
[ERROR] v8: #
[ERROR] v8: WebAssembly is not supported in no-embed builds. no-embed builds are deprecated. See
[ERROR] v8:  - https://groups.google.com/d/msg/v8-users/9F53xqBjpkI/9WmKSbcWBAAJ
[ERROR] v8:  - https://crbug.com/v8/8519
[ERROR] v8:  - https://crbug.com/v8/8531
[ERROR] v8:
[ERROR] v8: #
[ERROR] v8: #
[ERROR] v8: #
[ERROR] v8: #FailureMessage Object: 0xffd4aea0
[INFO]  v8: # 00xc6501835
[INFO]  v8: # 10xc64f856a
[INFO]  v8: # 20xc6a805fa
[INFO]  v8: # 30xc6a82ec1
[INFO]  v8: # 40xc6a8abd3
[INFO]  v8: # 50xc6a8ab3b
[INFO]  v8: # 60xc6a5e7ba
[INFO]  v8: # 70xc6a8853b
[INFO]  v8: # 80xc6ab0bb6
[INFO]  v8: # 90xc65819cf
[INFO]  v8: #100xc6580b8c
[INFO]  v8: #110xc6580500
[INFO]  v8: #120xc6580221
[INFO]  v8: #130xc5e02add
[INFO]  v8:

Comments

  1. Christopher Williams 2020-05-07

    I should note that even if we can't support WebAssembly, we should not crash, but throw an Error so that the fallback code could run.
  2. Joshua Quick 2020-05-20

    [~gmathews], I think the solution is to build V8 with the following command line argument...
       v8_enable_embedded_builtins=true
       
    ...in our shell script below. This script currently sets this argument to false. https://github.com/appcelerator/v8_titanium/blob/master/build_v8.sh This is based on the info I've read here... https://groups.google.com/forum/#!msg/v8-users/9F53xqBjpkI/9WmKSbcWBAAJ
  3. Gary Mathews 2020-05-27

    v8_titanium: https://github.com/appcelerator/v8_titanium/pull/52 v8_snapshot: https://github.com/appcelerator/v8_snapshot/commit/47a7b0ede1c548b24b8efb6aff4e562cb5f5c1a7 titanium_mobile: https://github.com/appcelerator/titanium_mobile/pull/11736
  4. Gary Mathews 2020-07-28

    titanium_mobile: https://github.com/appcelerator/titanium_mobile/pull/11849
  5. Christopher Williams 2020-08-17

    merged to 9_3_X for 9.3.0 target
  6. Samir Mohammed 2020-09-22

    FR Passed, Tested using the test cases from: https://github.com/appcelerator/titanium_mobile/pull/11849. *Test Environment*
       MacOS Big Sur: 11.0 Beta 7
       Java Version: 1.8.0_242
       Android NDK: 21.3.6528147
       Node.js: 12.18.1
       ""NPM":"5.0.0","CLI":"8.1.1""
       Pixel Xl (10)
  7. Samir Mohammed 2020-11-20

    *Closing ticket*. New Feature verified in SDK version 9.3.0.v20201119063936. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/11849

JSON Source