[TIMOB-27887] Android: Support WebAssembly in V8
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-11-20T16:15:13.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.3.0 |
Components | Android |
Labels | n/a |
Reporter | Christopher Williams |
Assignee | Gary Mathews |
Created | 2020-05-07T15:43:56.000+0000 |
Updated | 2020-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:
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.
[~gmathews], I think the solution is to build V8 with the following command line argument...
...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/9WmKSbcWBAAJv8_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
titanium_mobile: https://github.com/appcelerator/titanium_mobile/pull/11849
merged to 9_3_X for 9.3.0 target
FR Passed, Tested using the test cases from: https://github.com/appcelerator/titanium_mobile/pull/11849. *Test Environment*
*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