cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
8.58k stars 2k forks source link

[native] Upgrade V8 to v11.6, enable Maglev compiler and test performance #15552

Closed dumganhar closed 1 year ago

dumganhar commented 1 year ago

https://blog.chromium.org/2023/06/how-chrome-achieved-high-scores-on.html

dumganhar commented 1 year ago

Focus on the time cost on main.js.

Tested on Google Pixel 4XL (Android 13)

old : v8 (9.1.269)

   I  15:06:55 [INFO]: evalString((no filename)) cost: 0.132604 ms
2023-07-17 15:06:55.192  6557-6580  Cocos                   com.cocos.perftest380                I  15:06:55 [INFO]: evalString(jsb-adapter/web-adapter.js) cost: 14.837033 ms
2023-07-17 15:06:55.194  6557-6580  Cocos                   com.cocos.perftest380                I  15:06:55 [INFO]: evalString(src/system.bundle.js) cost: 1.427552 ms
2023-07-17 15:06:55.194  6557-6580  Cocos                   com.cocos.perftest380                I  15:06:55 [INFO]: evalString(src/application.js) cost: 0.160416 ms
2023-07-17 15:06:55.485  6557-6580  Cocos                   com.cocos.perftest380                I  15:06:55 [INFO]: evalString(src/cocos-js/cc.js) cost: 276.490548 ms
2023-07-17 15:06:55.590  6557-6580  Cocos                   com.cocos.perftest380                I  15:06:55 [INFO]: evalString(jsb-adapter/engine-adapter.js) cost: 21.568387 ms
2023-07-17 15:06:55.600  6557-6580  Cocos                   com.cocos.perftest380                I  15:06:55 [INFO]: evalString(src/cocos-js/bullet-ef9e0fd1.js) cost: 0.195990 ms
2023-07-17 15:06:55.601  6557-6580  Cocos                   com.cocos.perftest380                I  15:06:55 [INFO]: evalString(src/cocos-js/bullet.asm-ce2ef77e.js) cost: 0.116041 ms
2023-07-17 15:06:55.742  6557-6580  Cocos                   com.cocos.perftest380                I  15:06:55 [INFO]: evalString(assets/internal/index.js) cost: 0.626250 ms
2023-07-17 15:06:55.743  6557-6580  Cocos                   com.cocos.perftest380                I  15:06:55 [INFO]: evalString(main.js) cost: 551.353128 ms
2023-07-17 15:06:55.884  6557-6580  Cocos                   com.cocos.perftest380                I  15:06:55 [INFO]: evalString(src/chunks/bundle.js) cost: 0.269010 ms
2023-07-17 15:06:55.886  6557-6580  Cocos                   com.cocos.perftest380                I  15:06:55 [INFO]: evalString(assets/resources/index.js) cost: 0.232291 ms
2023-07-17 15:06:55.916  6557-6580  Cocos                   com.cocos.perftest380                I  15:06:55 [INFO]: evalString(assets/main/index.js) cost: 27.613388 ms
---------------------------- PROCESS ENDED (6557) for package com.cocos.perftest380 ----------------------------
---------------------------- PROCESS STARTED (6674) for package com.cocos.perftest380 ----------------------------
2023-07-17 15:07:45.590  6674-6697  Cocos                   com.cocos.perftest380                I  15:07:45 [INFO]: evalString((no filename)) cost: 0.210677 ms
2023-07-17 15:07:45.626  6674-6697  Cocos                   com.cocos.perftest380                I  15:07:45 [INFO]: evalString(jsb-adapter/web-adapter.js) cost: 14.645678 ms
2023-07-17 15:07:45.628  6674-6697  Cocos                   com.cocos.perftest380                I  15:07:45 [INFO]: evalString(src/system.bundle.js) cost: 1.449948 ms
2023-07-17 15:07:45.628  6674-6697  Cocos                   com.cocos.perftest380                I  15:07:45 [INFO]: evalString(src/application.js) cost: 0.159115 ms
2023-07-17 15:07:45.919  6674-6697  Cocos                   com.cocos.perftest380                I  15:07:45 [INFO]: evalString(src/cocos-js/cc.js) cost: 276.292580 ms
2023-07-17 15:07:46.022  6674-6697  Cocos                   com.cocos.perftest380                I  15:07:46 [INFO]: evalString(jsb-adapter/engine-adapter.js) cost: 22.321825 ms
2023-07-17 15:07:46.055  6674-6697  Cocos                   com.cocos.perftest380                I  15:07:46 [INFO]: evalString(src/cocos-js/bullet-ef9e0fd1.js) cost: 0.117084 ms
2023-07-17 15:07:46.055  6674-6697  Cocos                   com.cocos.perftest380                I  15:07:46 [INFO]: evalString(src/cocos-js/bullet.asm-ce2ef77e.js) cost: 0.059687 ms
2023-07-17 15:07:46.153  6674-6697  Cocos                   com.cocos.perftest380                I  15:07:46 [INFO]: evalString(assets/internal/index.js) cost: 0.261562 ms
2023-07-17 15:07:46.154  6674-6697  Cocos                   com.cocos.perftest380                I  15:07:46 [INFO]: evalString(main.js) cost: 528.017396 ms
2023-07-17 15:07:46.248  6674-6697  Cocos                   com.cocos.perftest380                I  15:07:46 [INFO]: evalString(src/chunks/bundle.js) cost: 0.280938 ms
2023-07-17 15:07:46.251  6674-6697  Cocos                   com.cocos.perftest380                I  15:07:46 [INFO]: evalString(assets/resources/index.js) cost: 0.778438 ms
2023-07-17 15:07:46.274  6674-6697  Cocos                   com.cocos.perftest380                I  15:07:46 [INFO]: evalString(assets/main/index.js) cost: 18.772918 ms
---------------------------- PROCESS ENDED (6674) for package com.cocos.perftest380 ----------------------------
---------------------------- PROCESS STARTED (6763) for package com.cocos.perftest380 ----------------------------
2023-07-17 15:08:11.973  6763-6786  Cocos                   com.cocos.perftest380                I  15:08:11 [INFO]: evalString((no filename)) cost: 0.091354 ms
2023-07-17 15:08:12.002  6763-6786  Cocos                   com.cocos.perftest380                I  15:08:12 [INFO]: evalString(jsb-adapter/web-adapter.js) cost: 12.556147 ms
2023-07-17 15:08:12.004  6763-6786  Cocos                   com.cocos.perftest380                I  15:08:12 [INFO]: evalString(src/system.bundle.js) cost: 1.206094 ms
2023-07-17 15:08:12.005  6763-6786  Cocos                   com.cocos.perftest380                I  15:08:12 [INFO]: evalString(src/application.js) cost: 0.181302 ms
2023-07-17 15:08:12.251  6763-6786  Cocos                   com.cocos.perftest380                I  15:08:12 [INFO]: evalString(src/cocos-js/cc.js) cost: 234.013669 ms
2023-07-17 15:08:12.335  6763-6786  Cocos                   com.cocos.perftest380                I  15:08:12 [INFO]: evalString(jsb-adapter/engine-adapter.js) cost: 16.745471 ms
2023-07-17 15:08:12.364  6763-6786  Cocos                   com.cocos.perftest380                I  15:08:12 [INFO]: evalString(src/cocos-js/bullet-ef9e0fd1.js) cost: 0.141250 ms
2023-07-17 15:08:12.364  6763-6786  Cocos                   com.cocos.perftest380                I  15:08:12 [INFO]: evalString(src/cocos-js/bullet.asm-ce2ef77e.js) cost: 0.086719 ms
2023-07-17 15:08:12.524  6763-6786  Cocos                   com.cocos.perftest380                I  15:08:12 [INFO]: evalString(assets/internal/index.js) cost: 0.269271 ms
2023-07-17 15:08:12.525  6763-6786  Cocos                   com.cocos.perftest380                I  15:08:12 [INFO]: evalString(main.js) cost: 522.534115 ms
2023-07-17 15:08:12.698  6763-6786  Cocos                   com.cocos.perftest380                I  15:08:12 [INFO]: evalString(src/chunks/bundle.js) cost: 0.264063 ms
2023-07-17 15:08:12.700  6763-6786  Cocos                   com.cocos.perftest380                I  15:08:12 [INFO]: evalString(assets/resources/index.js) cost: 0.211510 ms
2023-07-17 15:08:12.718  6763-6786  Cocos                   com.cocos.perftest380                I  15:08:12 [INFO]: evalString(assets/main/index.js) cost: 15.241460 ms

v8 (11.4.183.27)

    I  15:12:37 [INFO]: v8 11 evalString((no filename)) cost: 0.091145 ms
2023-07-17 15:12:38.026  7260-7281  Cocos                   com.cocos.perftest380                I  15:12:38 [INFO]: v8 11 evalString(jsb-adapter/web-adapter.js) cost: 17.127658 ms
2023-07-17 15:12:38.029  7260-7281  Cocos                   com.cocos.perftest380                I  15:12:38 [INFO]: v8 11 evalString(src/system.bundle.js) cost: 2.773438 ms
2023-07-17 15:12:38.030  7260-7281  Cocos                   com.cocos.perftest380                I  15:12:38 [INFO]: v8 11 evalString(src/application.js) cost: 0.154948 ms
2023-07-17 15:12:38.299  7260-7281  Cocos                   com.cocos.perftest380                I  15:12:38 [INFO]: v8 11 evalString(src/cocos-js/cc.js) cost: 254.769870 ms
2023-07-17 15:12:38.393  7260-7281  Cocos                   com.cocos.perftest380                I  15:12:38 [INFO]: v8 11 evalString(jsb-adapter/engine-adapter.js) cost: 14.940679 ms
2023-07-17 15:12:38.418  7260-7281  Cocos                   com.cocos.perftest380                I  15:12:38 [INFO]: v8 11 evalString(src/cocos-js/bullet-ef9e0fd1.js) cost: 0.215469 ms
2023-07-17 15:12:38.418  7260-7281  Cocos                   com.cocos.perftest380                I  15:12:38 [INFO]: v8 11 evalString(src/cocos-js/bullet.asm-ce2ef77e.js) cost: 0.067865 ms
2023-07-17 15:12:38.442  7260-7281  Cocos                   com.cocos.perftest380                I  15:12:38 [INFO]: v8 11 evalString(assets/internal/index.js) cost: 0.190260 ms
2023-07-17 15:12:38.442  7260-7281  Cocos                   com.cocos.perftest380                I  15:12:38 [INFO]: v8 11 evalString(main.js) cost: 416.104729 ms
2023-07-17 15:12:38.494  7260-7281  Cocos                   com.cocos.perftest380                I  15:12:38 [INFO]: v8 11 evalString(src/chunks/bundle.js) cost: 0.217240 ms
2023-07-17 15:12:38.495  7260-7281  Cocos                   com.cocos.perftest380                I  15:12:38 [INFO]: v8 11 evalString(assets/resources/index.js) cost: 0.134688 ms
2023-07-17 15:12:38.510  7260-7281  Cocos                   com.cocos.perftest380                I  15:12:38 [INFO]: v8 11 evalString(assets/main/index.js) cost: 12.001355 ms
---------------------------- PROCESS ENDED (7260) for package com.cocos.perftest380 ----------------------------
---------------------------- PROCESS STARTED (7464) for package com.cocos.perftest380 ----------------------------
2023-07-17 15:14:28.213  7464-7487  Cocos                   com.cocos.perftest380                I  15:14:28 [INFO]: v8 11 evalString((no filename)) cost: 0.135625 ms
2023-07-17 15:14:28.246  7464-7487  Cocos                   com.cocos.perftest380                I  15:14:28 [INFO]: v8 11 evalString(jsb-adapter/web-adapter.js) cost: 17.931720 ms
2023-07-17 15:14:28.250  7464-7487  Cocos                   com.cocos.perftest380                I  15:14:28 [INFO]: v8 11 evalString(src/system.bundle.js) cost: 3.284376 ms
2023-07-17 15:14:28.251  7464-7487  Cocos                   com.cocos.perftest380                I  15:14:28 [INFO]: v8 11 evalString(src/application.js) cost: 0.176822 ms
2023-07-17 15:14:28.523  7464-7487  Cocos                   com.cocos.perftest380                I  15:14:28 [INFO]: v8 11 evalString(src/cocos-js/cc.js) cost: 258.002109 ms
2023-07-17 15:14:28.619  7464-7487  Cocos                   com.cocos.perftest380                I  15:14:28 [INFO]: v8 11 evalString(jsb-adapter/engine-adapter.js) cost: 15.754376 ms
2023-07-17 15:14:28.641  7464-7487  Cocos                   com.cocos.perftest380                I  15:14:28 [INFO]: v8 11 evalString(src/cocos-js/bullet-ef9e0fd1.js) cost: 0.126563 ms
2023-07-17 15:14:28.641  7464-7487  Cocos                   com.cocos.perftest380                I  15:14:28 [INFO]: v8 11 evalString(src/cocos-js/bullet.asm-ce2ef77e.js) cost: 0.059636 ms
2023-07-17 15:14:28.670  7464-7487  Cocos                   com.cocos.perftest380                I  15:14:28 [INFO]: v8 11 evalString(assets/internal/index.js) cost: 0.196407 ms
2023-07-17 15:14:28.670  7464-7487  Cocos                   com.cocos.perftest380                I  15:14:28 [INFO]: v8 11 evalString(main.js) cost: 423.769521 ms
2023-07-17 15:14:28.728  7464-7487  Cocos                   com.cocos.perftest380                I  15:14:28 [INFO]: v8 11 evalString(src/chunks/bundle.js) cost: 0.215937 ms
2023-07-17 15:14:28.730  7464-7487  Cocos                   com.cocos.perftest380                I  15:14:28 [INFO]: v8 11 evalString(assets/resources/index.js) cost: 0.189011 ms
2023-07-17 15:14:28.745  7464-7487  Cocos                   com.cocos.perftest380                I  15:14:28 [INFO]: v8 11 evalString(assets/main/index.js) cost: 12.657085 ms
---------------------------- PROCESS ENDED (7464) for package com.cocos.perftest380 ----------------------------
---------------------------- PROCESS STARTED (7536) for package com.cocos.perftest380 ----------------------------
2023-07-17 15:14:38.361  7536-7559  Cocos                   com.cocos.perftest380                I  15:14:38 [INFO]: v8 11 evalString((no filename)) cost: 0.166042 ms
2023-07-17 15:14:38.393  7536-7559  Cocos                   com.cocos.perftest380                I  15:14:38 [INFO]: v8 11 evalString(jsb-adapter/web-adapter.js) cost: 17.663960 ms
2023-07-17 15:14:38.397  7536-7559  Cocos                   com.cocos.perftest380                I  15:14:38 [INFO]: v8 11 evalString(src/system.bundle.js) cost: 2.985157 ms
2023-07-17 15:14:38.398  7536-7559  Cocos                   com.cocos.perftest380                I  15:14:38 [INFO]: v8 11 evalString(src/application.js) cost: 0.255521 ms
2023-07-17 15:14:38.676  7536-7559  Cocos                   com.cocos.perftest380                I  15:14:38 [INFO]: v8 11 evalString(src/cocos-js/cc.js) cost: 263.836224 ms
2023-07-17 15:14:38.774  7536-7559  Cocos                   com.cocos.perftest380                I  15:14:38 [INFO]: v8 11 evalString(jsb-adapter/engine-adapter.js) cost: 16.686929 ms
2023-07-17 15:14:38.800  7536-7559  Cocos                   com.cocos.perftest380                I  15:14:38 [INFO]: v8 11 evalString(src/cocos-js/bullet-ef9e0fd1.js) cost: 0.167656 ms
2023-07-17 15:14:38.801  7536-7559  Cocos                   com.cocos.perftest380                I  15:14:38 [INFO]: v8 11 evalString(src/cocos-js/bullet.asm-ce2ef77e.js) cost: 0.087032 ms
2023-07-17 15:14:38.824  7536-7559  Cocos                   com.cocos.perftest380                I  15:14:38 [INFO]: v8 11 evalString(assets/internal/index.js) cost: 0.189062 ms
2023-07-17 15:14:38.824  7536-7559  Cocos                   com.cocos.perftest380                I  15:14:38 [INFO]: v8 11 evalString(main.js) cost: 430.746085 ms
2023-07-17 15:14:38.883  7536-7559  Cocos                   com.cocos.perftest380                I  15:14:38 [INFO]: v8 11 evalString(src/chunks/bundle.js) cost: 0.232604 ms
2023-07-17 15:14:38.884  7536-7559  Cocos                   com.cocos.perftest380                I  15:14:38 [INFO]: v8 11 evalString(assets/resources/index.js) cost: 0.165260 ms
2023-07-17 15:14:38.899  7536-7559  Cocos                   com.cocos.perftest380                I  15:14:38 [INFO]: v8 11 evalString(assets/main/index.js) cost: 12.662293 ms
v8 11.6

2023-09-28 16:08:45.323 10294-10315 Cocos                   com.cocos.perftest380                I  16:08:45 [INFO]: v8 11 evalString((no filename)) cost: 0.091302 ms
2023-09-28 16:08:45.378 10294-10315 Cocos                   com.cocos.perftest380                I  16:08:45 [INFO]: v8 11 evalString(jsb-adapter/web-adapter.js) cost: 18.058595 ms
2023-09-28 16:08:45.381 10294-10315 Cocos                   com.cocos.perftest380                I  16:08:45 [INFO]: v8 11 evalString(src/system.bundle.js) cost: 2.811510 ms
2023-09-28 16:08:45.382 10294-10315 Cocos                   com.cocos.perftest380                I  16:08:45 [INFO]: v8 11 evalString(src/application.js) cost: 0.168698 ms
2023-09-28 16:08:45.655 10294-10315 Cocos                   com.cocos.perftest380                I  16:08:45 [INFO]: v8 11 evalString(src/cocos-js/cc.js) cost: 258.995807 ms
2023-09-28 16:08:45.736 10294-10315 Cocos                   com.cocos.perftest380                I  16:08:45 [INFO]: v8 11 evalString(jsb-adapter/engine-adapter.js) cost: 13.412397 ms
2023-09-28 16:08:45.763 10294-10315 Cocos                   com.cocos.perftest380                I  16:08:45 [INFO]: v8 11 evalString(src/cocos-js/bullet-ef9e0fd1.js) cost: 0.163072 ms
2023-09-28 16:08:45.763 10294-10315 Cocos                   com.cocos.perftest380                I  16:08:45 [INFO]: v8 11 evalString(src/cocos-js/bullet.asm-ce2ef77e.js) cost: 0.052032 ms
2023-09-28 16:08:45.785 10294-10315 Cocos                   com.cocos.perftest380                I  16:08:45 [INFO]: v8 11 evalString(assets/internal/index.js) cost: 0.186406 ms
2023-09-28 16:08:45.785 10294-10315 Cocos                   com.cocos.perftest380                I  16:08:45 [INFO]: v8 11 evalString(main.js) cost: 407.487697 ms
2023-09-28 16:08:45.816 10294-10315 Cocos                   com.cocos.perftest380                I  16:08:45 [INFO]: v8 11 evalString(src/chunks/bundle.js) cost: 0.234687 ms
2023-09-28 16:08:45.817 10294-10315 Cocos                   com.cocos.perftest380                I  16:08:45 [INFO]: v8 11 evalString(assets/resources/index.js) cost: 0.185208 ms
2023-09-28 16:08:45.832 10294-10315 Cocos                   com.cocos.perftest380                I  16:08:45 [INFO]: v8 11 evalString(assets/main/index.js) cost: 12.220522 ms
2023-09-28 16:09:12.947 10294-10315 Cocos                   com.cocos.perftest380                I  16:09:12 [INFO]: v8 11 evalString(/data/user/0/com.cocos.perftest380/files//octane.js) cost: 608.180373 ms

Tested on iPhoneX (iOS 12)

v8 9.1.269

18:01:56 [INFO]: v8 9 evalString((no filename)) cost: 0.110500 ms 18:01:56 [INFO]: v8 9 evalString(jsb-adapter/web-adapter.js) cost: 13.276500 ms 18:01:56 [INFO]: v8 9 evalString(src/system.bundle.js) cost: 2.095292 ms 18:01:56 [INFO]: v8 9 evalString(src/application.js) cost: 0.104000 ms 18:01:56 [INFO]: v8 9 evalString(src/cocos-js/cc.js) cost: 209.370000 ms 18:01:56 [INFO]: v8 9 evalString(jsb-adapter/engine-adapter.js) cost: 14.754834 ms 18:01:56 [INFO]: v8 9 evalString(src/cocos-js/bullet-2deb225b.js) cost: 0.084708 ms 18:01:56 [INFO]: v8 9 evalString(src/cocos-js/bullet.asm-2a74b969.js) cost: 75.391208 ms 18:02:01 [INFO]: v8 9 evalString(assets/internal/index.js) cost: 0.230375 ms 18:02:01 [INFO]: v8 9 evalString(main.js) cost: 5647.396750 ms 18:02:01 [INFO]: v8 9 evalString(src/chunks/bundle.js) cost: 0.175125 ms 18:02:01 [INFO]: v8 9 evalString(assets/resources/index.js) cost: 0.110208 ms 18:02:01 [INFO]: v8 9 evalString(assets/main/index.js) cost: 13.637667 ms

18:02:54 [INFO]: v8 9 evalString((no filename)) cost: 0.088458 ms 18:02:54 [INFO]: v8 9 evalString(jsb-adapter/web-adapter.js) cost: 12.198084 ms 18:02:54 [INFO]: v8 9 evalString(src/system.bundle.js) cost: 2.505791 ms 18:02:54 [INFO]: v8 9 evalString(src/application.js) cost: 0.129250 ms 18:02:55 [INFO]: v8 9 evalString(src/cocos-js/cc.js) cost: 220.746042 ms 18:02:55 [INFO]: v8 9 evalString(jsb-adapter/engine-adapter.js) cost: 15.152208 ms 18:02:55 [INFO]: v8 9 evalString(src/cocos-js/bullet-2deb225b.js) cost: 0.087875 ms 18:02:55 [INFO]: v8 9 evalString(src/cocos-js/bullet.asm-2a74b969.js) cost: 76.529750 ms 18:03:00 [INFO]: v8 9 evalString(assets/internal/index.js) cost: 0.262125 ms 18:03:00 [INFO]: v8 9 evalString(main.js) cost: 5434.819209 ms 18:03:00 [INFO]: v8 9 evalString(src/chunks/bundle.js) cost: 0.170584 ms 18:03:00 [INFO]: v8 9 evalString(assets/resources/index.js) cost: 0.101000 ms 18:03:00 [INFO]: v8 9 evalString(assets/main/index.js) cost: 13.552250 ms

18:03:21 [INFO]: v8 9 evalString((no filename)) cost: 0.088500 ms 18:03:21 [INFO]: v8 9 evalString(jsb-adapter/web-adapter.js) cost: 12.322625 ms 18:03:21 [INFO]: v8 9 evalString(src/system.bundle.js) cost: 2.083791 ms 18:03:21 [INFO]: v8 9 evalString(src/application.js) cost: 0.145667 ms 18:03:21 [INFO]: v8 9 evalString(src/cocos-js/cc.js) cost: 219.849292 ms 18:03:21 [INFO]: v8 9 evalString(jsb-adapter/engine-adapter.js) cost: 14.843375 ms 18:03:22 [INFO]: v8 9 evalString(src/cocos-js/bullet-2deb225b.js) cost: 0.066459 ms 18:03:22 [INFO]: v8 9 evalString(src/cocos-js/bullet.asm-2a74b969.js) cost: 77.619083 ms 18:03:27 [INFO]: v8 9 evalString(assets/internal/index.js) cost: 0.240542 ms 18:03:27 [INFO]: v8 9 evalString(main.js) cost: 5407.501042 ms 18:03:27 [INFO]: v8 9 evalString(src/chunks/bundle.js) cost: 0.168750 ms 18:03:27 [INFO]: v8 9 evalString(assets/resources/index.js) cost: 0.104959 ms 18:03:27 [INFO]: v8 9 evalString(assets/main/index.js) cost: 13.700041 ms

v8 11.4.183.27

18:07:58 [INFO]: v8 11 evalString((no filename)) cost: 0.196875 ms 18:07:58 [INFO]: v8 11 evalString(jsb-adapter/web-adapter.js) cost: 21.936916 ms 18:07:58 [INFO]: v8 11 evalString(src/system.bundle.js) cost: 1.419250 ms 18:07:58 [INFO]: v8 11 evalString(src/application.js) cost: 0.143542 ms 18:07:59 [INFO]: v8 11 evalString(src/cocos-js/cc.js) cost: 214.071500 ms 18:07:59 [INFO]: v8 11 evalString(jsb-adapter/engine-adapter.js) cost: 15.260666 ms 18:07:59 [INFO]: v8 11 evalString(src/cocos-js/bullet-2deb225b.js) cost: 0.087667 ms 18:07:59 [INFO]: v8 11 evalString(src/cocos-js/bullet.asm-2a74b969.js) cost: 74.957917 ms 18:08:04 [INFO]: v8 11 evalString(assets/internal/index.js) cost: 0.265042 ms 18:08:04 [INFO]: v8 11 evalString(main.js) cost: 5895.097208 ms 18:08:05 [INFO]: v8 11 evalString(src/chunks/bundle.js) cost: 0.171375 ms 18:08:05 [INFO]: v8 11 evalString(assets/resources/index.js) cost: 0.131208 ms 18:08:05 [INFO]: v8 11 evalString(assets/main/index.js) cost: 12.959250 ms

18:08:47 [INFO]: v8 11 evalString((no filename)) cost: 0.082375 ms 18:08:47 [INFO]: v8 11 evalString(jsb-adapter/web-adapter.js) cost: 15.399291 ms 18:08:47 [INFO]: v8 11 evalString(src/system.bundle.js) cost: 1.315958 ms 18:08:47 [INFO]: v8 11 evalString(src/application.js) cost: 0.133167 ms 18:08:47 [INFO]: v8 11 evalString(src/cocos-js/cc.js) cost: 212.527000 ms 18:08:47 [INFO]: v8 11 evalString(jsb-adapter/engine-adapter.js) cost: 14.895333 ms 18:08:47 [INFO]: v8 11 evalString(src/cocos-js/bullet-2deb225b.js) cost: 0.077875 ms 18:08:47 [INFO]: v8 11 evalString(src/cocos-js/bullet.asm-2a74b969.js) cost: 74.715416 ms 18:08:52 [INFO]: v8 11 evalString(assets/internal/index.js) cost: 0.284500 ms 18:08:52 [INFO]: v8 11 evalString(main.js) cost: 5465.571917 ms 18:08:53 [INFO]: v8 11 evalString(src/chunks/bundle.js) cost: 0.170875 ms 18:08:53 [INFO]: v8 11 evalString(assets/resources/index.js) cost: 0.097375 ms 18:08:53 [INFO]: v8 11 evalString(assets/main/index.js) cost: 13.137875 ms

18:09:20 [INFO]: v8 11 evalString((no filename)) cost: 0.075333 ms 18:09:20 [INFO]: v8 11 evalString(jsb-adapter/web-adapter.js) cost: 15.130125 ms 18:09:20 [INFO]: v8 11 evalString(src/system.bundle.js) cost: 1.263333 ms 18:09:20 [INFO]: v8 11 evalString(src/application.js) cost: 0.129333 ms 18:09:20 [INFO]: v8 11 evalString(src/cocos-js/cc.js) cost: 211.798416 ms 18:09:21 [INFO]: v8 11 evalString(jsb-adapter/engine-adapter.js) cost: 14.783917 ms 18:09:21 [INFO]: v8 11 evalString(src/cocos-js/bullet-2deb225b.js) cost: 0.076250 ms 18:09:21 [INFO]: v8 11 evalString(src/cocos-js/bullet.asm-2a74b969.js) cost: 74.545667 ms 18:09:26 [INFO]: v8 11 evalString(assets/internal/index.js) cost: 0.265833 ms 18:09:26 [INFO]: v8 11 evalString(main.js) cost: 5433.684542 ms 18:09:26 [INFO]: v8 11 evalString(src/chunks/bundle.js) cost: 0.169792 ms 18:09:26 [INFO]: v8 11 evalString(assets/resources/index.js) cost: 0.104416 ms 18:09:26 [INFO]: v8 11 evalString(assets/main/index.js) cost: 12.804958 ms

v8 11.6

18:10:18 [INFO]: v8 11 evalString((no filename)) cost: 0.084708 ms 18:10:18 [INFO]: v8 11 evalString(jsb-adapter/web-adapter.js) cost: 14.463750 ms 18:10:18 [INFO]: v8 11 evalString(src/system.bundle.js) cost: 1.256750 ms 18:10:18 [INFO]: v8 11 evalString(src/application.js) cost: 0.102833 ms 18:10:18 [INFO]: v8 11 evalString(src/cocos-js/cc.js) cost: 210.887125 ms 18:10:19 [INFO]: v8 11 evalString(jsb-adapter/engine-adapter.js) cost: 14.710250 ms 18:10:19 [INFO]: v8 11 evalString(src/cocos-js/bullet-2deb225b.js) cost: 0.131958 ms 18:10:19 [INFO]: v8 11 evalString(src/cocos-js/bullet.asm-2a74b969.js) cost: 73.798250 ms 18:10:24 [INFO]: v8 11 evalString(assets/internal/index.js) cost: 0.283209 ms 18:10:24 [INFO]: v8 11 evalString(main.js) cost: 5297.990209 ms 18:10:24 [INFO]: v8 11 evalString(src/chunks/bundle.js) cost: 0.221250 ms 18:10:24 [INFO]: v8 11 evalString(assets/resources/index.js) cost: 0.110375 ms 18:10:24 [INFO]: v8 11 evalString(assets/main/index.js) cost: 11.581459 ms

18:11:48 [INFO]: v8 11 evalString((no filename)) cost: 0.073208 ms 18:11:48 [INFO]: v8 11 evalString(jsb-adapter/web-adapter.js) cost: 14.411875 ms 18:11:48 [INFO]: v8 11 evalString(src/system.bundle.js) cost: 1.274833 ms 18:11:48 [INFO]: v8 11 evalString(src/application.js) cost: 0.109833 ms 18:11:49 [INFO]: v8 11 evalString(src/cocos-js/cc.js) cost: 210.599167 ms 18:11:49 [INFO]: v8 11 evalString(jsb-adapter/engine-adapter.js) cost: 14.547959 ms 18:11:49 [INFO]: v8 11 evalString(src/cocos-js/bullet-2deb225b.js) cost: 0.124500 ms 18:11:49 [INFO]: v8 11 evalString(src/cocos-js/bullet.asm-2a74b969.js) cost: 73.037958 ms 18:11:54 [INFO]: v8 11 evalString(assets/internal/index.js) cost: 0.269750 ms 18:11:54 [INFO]: v8 11 evalString(main.js) cost: 5302.631583 ms 18:11:54 [INFO]: v8 11 evalString(src/chunks/bundle.js) cost: 0.230250 ms 18:11:54 [INFO]: v8 11 evalString(assets/resources/index.js) cost: 0.103000 ms 18:11:54 [INFO]: v8 11 evalString(assets/main/index.js) cost: 13.342292 ms

18:12:17 [INFO]: v8 11 evalString((no filename)) cost: 0.076209 ms 18:12:17 [INFO]: v8 11 evalString(jsb-adapter/web-adapter.js) cost: 14.593958 ms 18:12:17 [INFO]: v8 11 evalString(src/system.bundle.js) cost: 1.263000 ms 18:12:17 [INFO]: v8 11 evalString(src/application.js) cost: 0.104292 ms 18:12:17 [INFO]: v8 11 evalString(src/cocos-js/cc.js) cost: 211.184208 ms 18:12:17 [INFO]: v8 11 evalString(jsb-adapter/engine-adapter.js) cost: 14.469750 ms 18:12:17 [INFO]: v8 11 evalString(src/cocos-js/bullet-2deb225b.js) cost: 0.128167 ms 18:12:18 [INFO]: v8 11 evalString(src/cocos-js/bullet.asm-2a74b969.js) cost: 73.294958 ms 18:12:22 [INFO]: v8 11 evalString(assets/internal/index.js) cost: 0.257583 ms 18:12:22 [INFO]: v8 11 evalString(main.js) cost: 5318.014333 ms 18:12:23 [INFO]: v8 11 evalString(src/chunks/bundle.js) cost: 0.216500 ms 18:12:23 [INFO]: v8 11 evalString(assets/resources/index.js) cost: 0.112875 ms 18:12:23 [INFO]: v8 11 evalString(assets/main/index.js) cost: 13.419750 ms

dumganhar commented 1 year ago

Tested on Google Pixel 4XL (Android 13)

JS performance test ( Score higher is better, v8 11.4 is 10% faster than 9.1 , v8 11.6 is 14% faster than 9.1 )

Old (v8 9.1)

Screenshot_20230717-145651

New (v8 11.4)

Screenshot_20230717-144925

New (v8 11.6)

Screenshot_20230928-161519

Tested on iPhoneX (iOS 12)

JS performance test (v8 9.1 -> 11.4: No performance gain, v8 11.6 is 8% faster than 9.1 )

Old (v8 9.1)

IMG_0012

New (v8 11.4)

IMG_0010

New (v8 11.6)

IMG_0002

dumganhar commented 1 year ago

NEED TO UPGRADE ANDROID NDK TO r23, otherwise, we will get link errors.

dumganhar commented 1 year ago

Android shared library increment (compiled with ndk 24.0.8215888):

Architecture (libcocos.so) v8 (9.1.269.0) v8 (11.4.183.27) v8 (11.6.189.22 bulit with ndk r26 clang + r21e sysroot + compile project with r24) v8 (11.6.189.22 bulit with ndk r23c clang + r23c sysroot + compile project with r21e)
armeabi-v7a 16.1 MB 17.8 MB 18.8 MB 18.7 MB
arm64-v8a 23.6 MB 28.9 MB 29.1 MB 28.5 MB
armeabi-v7a (zip compressed) 7.5 MB 8.2 MB 8.5 MB 8.3 MB
arm64-v8a (zip compressed) 8.4 MB 9.9 MB 9.9 MB 9.7 MB

iOS executable increment

Architecture (exe file) v8 (9.1.269.0) v8 (11.4.183.27) v8 (11.6.189.22)
arm64 35.8 MB 33.7 MB 30.9 MB
arm64 (zip compressed) 10.8 MB 9.6 MB 9.1 MB

iOS executable file is smaller , the possible reason is that I built the new v8 with webassembly disabled in arg.gn .

target_os = "ios"
target_cpu = "arm64"
v8_target_cpu = "arm64"
use_thin_lto = false
use_lld = false
clang_use_chrome_plugins = false
chrome_pgo_phase = 0
is_component_build = false
v8_monolithic = true
use_custom_libcxx = false
ios_deployment_target = 11
ios_enable_code_signing = false
is_debug = false
v8_use_external_startup_data = false
is_official_build = true
v8_enable_i18n_support = false
treat_warnings_as_errors = false
symbol_level = 0
v8_enable_webassembly = false // This flag doesn't exist in v9.1
use_cxx17 = true
v8_enable_sandbox = false
v8_enable_pointer_compression = false
dumganhar commented 1 year ago

Need to check whether could run on the minSDKVersion android devices (19) and iOS 11

dumganhar commented 1 year ago

Need to check the memory cost too.

eldn commented 1 year ago

Need to check the memory cost too.

Excellent! Our project is currently considering upgrading the v8 engine on the Android platform. Could you please let me know where I can download your tested, newly compiled "libv8_monolith.a" and "libinspector.a" library files as well as the corresponding new v8 included source and header files? just for pre-test purpose,thank you!

dumganhar commented 1 year ago

@eldn libinspector.a isn't needed. Just one 'libv8_monolith.a' is enough. v8-11.4.zip

engine code patch:

https://github.com/dumganhar/cocos-engine/commit/353ca23f1bf48383767866719d60788fd15b47ef

external code patch:

https://github.com/dumganhar/cocos-engine-external/commit/aa01401b60cf0f360ab1bd834251ef030432cbbc

dumganhar commented 1 year ago

@eldn

performance test code is here: https://github.com/cocos/cocos-benchmark

Refer to : https://github.com/cocos/cocos-benchmark/pull/51

eldn commented 1 year ago

dumganhar/cocos-engine-external@aa01401 Thanks a lot,i really appreciate it

dumganhar commented 1 year ago

Memory cost test with an empty creator project

Tested on Android (Pixel 4XL)

APK files (need to rename .zip to .apk):

32bit-v8_91.zip 32bit-v8-11.4.zip 32bit-v8-116.zip

64bit-v8_91.zip 64bit-v8-11.4.zip 64bit-v8-11.6.zip

Architecture v8 (9.1.269.0) v8 (11.4.183.27) v8 (11.6.189.22)
arm64-v8a 189 MB 185 MB 188 MB
armeabi-v7a 227 MB 223 MB 220 MB

Tested on iOS (iPhoneX iOS 12)

Architecture v8 (9.1.269.0) v8 (11.4.183.27) v8 (11.6.189.22)
arm64 191 MB 185 MB 207 MB

Details on Android by adb shell dumpsys meminfo packagename

v8 11.6.189.22 (arm64-v8a)

** MEMINFO in pid 5733 [com.test.empty64_116] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    28993    28872        0        0    31904    82068    29129    48212
  Dalvik Heap     1330      928        0        0     9980    26766     2190    24576
 Dalvik Other      633      564        0        0     2852
        Stack      648      648        0        0      656
       Ashmem       25        0        0        0      536
      Gfx dev     3264     3264        0        0     3264
    Other dev       16        0       16        0      324
     .so mmap    24852      880    20672        0    59492
    .jar mmap     1191        0        0        0    24348
    .apk mmap      172        0        0        0     1684
    .ttf mmap       47        0        0        0      188
    .dex mmap      437       12      388        0     1032
    .oat mmap      704        0        0        0    12568
    .art mmap     1111      324        0        0    19064
   Other mmap      104       40        0        0     1656
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    37613    37596        0        0    38356
        TOTAL   189596   161584    21076        0   296360   108834    31319    72788

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1252                          29044
         Native Heap:    28872                          31904
                Code:    21968                          99328
               Stack:      648                            656
            Graphics:    91720                          91720
       Private Other:    38200
              System:     6936
             Unknown:                                   43708

           TOTAL PSS:   189596            TOTAL RSS:   296360      TOTAL SWAP (KB):        0

** MEMINFO in pid 5798 [com.test.empty64_116] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    29016    28904        0        0    31912    82324    29125    48254
  Dalvik Heap     1148      764        0        0     9780    26764     2188    24576
 Dalvik Other      671      604        0        0     2880
        Stack      652      652        0        0      660
       Ashmem       25        0        0        0      536
      Gfx dev     3236     3236        0        0     3236
    Other dev       20        0       20        0      328
     .so mmap    24992      892    20912        0    59756
    .jar mmap     1226        0        0        0    24876
    .apk mmap      172        0        0        0     1684
    .ttf mmap       47        0        0        0      188
    .dex mmap      437       12      388        0     1032
    .oat mmap      713        0        0        0    12696
    .art mmap     1167      348       20        0    19228
   Other mmap      104       40        0        0     1656
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    35893    35876        0        0    36636
        TOTAL   187975   159784    21340        0   295540   109088    31313    72830

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1132                          29008
         Native Heap:    28904                          31912
                Code:    22220                         100248
               Stack:      652                            660
            Graphics:    91692                          91692
       Private Other:    36524
              System:     6851
             Unknown:                                   42020

           TOTAL PSS:   187975            TOTAL RSS:   295540      TOTAL SWAP (KB):        0

** MEMINFO in pid 5860 [com.test.empty64_116] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    29000    28876        0        0    31920    82068    29134    48162
  Dalvik Heap     1322      920        0        0     9972    26783     2207    24576
 Dalvik Other      637      568        0        0     2856
        Stack      652      652        0        0      660
       Ashmem       25        0        0        0      536
      Gfx dev     3072     3072        0        0     3072
    Other dev       20        0       20        0      328
     .so mmap    56444    32352    20912        0    90964
    .jar mmap     1222        0        0        0    24684
    .apk mmap      172        0        0        0     1684
    .ttf mmap       47        0        0        0      188
    .dex mmap      437       12      388        0     1032
    .oat mmap      704        0        0        0    12568
    .art mmap     1111      324        0        0    19064
   Other mmap      104       40        0        0     1656
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown     4897     4880        0        0     5644
        TOTAL   188322   160152    21320        0   295284   108851    31341    72738

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1244                          29036
         Native Heap:    28876                          31920
                Code:    53680                         131136
               Stack:      652                            660
            Graphics:    91528                          91528
       Private Other:     5492
              System:     6850
             Unknown:                                   11004

           TOTAL PSS:   188322            TOTAL RSS:   295284      TOTAL SWAP (KB):        0

v8 11.4.183.27 (arm64-v8a)

** MEMINFO in pid 6717 [com.test.empty380] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    27026    26916        0        0    29872    79508    27206    48044
  Dalvik Heap     1143      760        0        0     9772    26762     2186    24576
 Dalvik Other      687      620        0        0     2856
        Stack      628      628        0        0      636
       Ashmem       24        0        0       24      512
      Gfx dev     4100     4100        0        0     4100
    Other dev       20        0       20        0      328
     .so mmap    23967      872    20740        0    57556
    .jar mmap     1162        0        0        0    24516
    .apk mmap      112        0        0        0     1500
    .ttf mmap       18        0        0        0      132
    .dex mmap      433       12      388        0     1012
    .oat mmap      689        0        8        0    13024
    .art mmap     1170      344       28        0    19228
   Other mmap      102       40       12        0     1440
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    36053    36036        0        0    36792
        TOTAL   185790   158784    21196       24   291732   106270    29392    72620

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1132                          29000
         Native Heap:    26916                          29872
                Code:    22036                          97756
               Stack:      628                            636
            Graphics:    92556                          92556
       Private Other:    36712
              System:     5810
             Unknown:                                   41912

           TOTAL PSS:   185790            TOTAL RSS:   291732      TOTAL SWAP (KB):       24

** MEMINFO in pid 6791 [com.test.empty380] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    27653    27532        0        0    30512    79252    27258    47822
  Dalvik Heap     1343      952        0        0     9980    26767     2191    24576
 Dalvik Other      641      572        0        0     2816
        Stack      652      652        0        0      660
       Ashmem       24        0        0       24      512
      Gfx dev     3264     3264        0        0     3264
    Other dev       20        0       20        0      328
     .so mmap    23949      860    20748        0    57316
    .jar mmap     1177        0        0        0    24580
    .apk mmap      112        0        0        0     1500
    .ttf mmap       18        0        0        0      132
    .dex mmap      433       12      388        0     1012
    .oat mmap      685        0        8        0    12968
    .art mmap     1113      324        0        0    19064
   Other mmap      102       40       12        0     1440
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    36585    36568        0        0    37328
        TOTAL   186227   159232    21176       24   291868   106019    29449    72398

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1276                          29044
         Native Heap:    27532                          30512
                Code:    22032                          97524
               Stack:      652                            660
            Graphics:    91720                          91720
       Private Other:    37196
              System:     5819
             Unknown:                                   42408

           TOTAL PSS:   186227            TOTAL RSS:   291868      TOTAL SWAP (KB):       24

** MEMINFO in pid 7015 [com.test.empty380] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    26935    26812        0        0    29808    79508    27255    47890
  Dalvik Heap     1319      928        0        0     9956    26766     2190    24576
 Dalvik Other      641      572        0        0     2816
        Stack      656      656        0        0      664
       Ashmem       24        0        0       24      512
      Gfx dev     3104     3104        0        0     3104
    Other dev       20        0       20        0      328
     .so mmap    23801      860    20580        0    57188
    .jar mmap     1177        0        0        0    24580
    .apk mmap      112        0        0        0     1500
    .ttf mmap       18        0        0        0      132
    .dex mmap      433       12      388        0     1012
    .oat mmap      685        0        8        0    12968
    .art mmap     1113      324        0        0    19064
   Other mmap      102       40       12        0     1440
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    36353    36336        0        0    37092
        TOTAL   184949   158100    21008       24   290620   106274    29445    72466

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1252                          29020
         Native Heap:    26812                          29808
                Code:    21864                          97396
               Stack:      656                            664
            Graphics:    91560                          91560
       Private Other:    36964
              System:     5841
             Unknown:                                   42172

           TOTAL PSS:   184949            TOTAL RSS:   290620      TOTAL SWAP (KB):       24

v8 9.1.269.0 (arm64-v8a)

** MEMINFO in pid 6848 [com.test.empty380_91] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    29550    29428        0        0    32420    82828    29818    46954
  Dalvik Heap     1359      968        0        0     9996    26766     2190    24576
 Dalvik Other      677      608        0        0     2856
        Stack      668      668        0        0      676
       Ashmem       24        0        0       24      512
      Gfx dev     3792     3792        0        0     3792
    Other dev       20        0       20        0      328
     .so mmap    22216      812    19200        0    55528
    .jar mmap     1177        0        0        0    24580
    .apk mmap      113        0        0        0     1504
    .ttf mmap       18        0        0        0      132
    .dex mmap      433       12      388        0     1012
    .oat mmap      685        0        8        0    12968
    .art mmap     1113      324        0        0    19064
   Other mmap      102       40       12        0     1440
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    40301    37352     2932        0    41040
        TOTAL   190704   162460    22560       24   296304   109594    32008    71530

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1292                          29060
         Native Heap:    29428                          32420
                Code:    20436                          95740
               Stack:      668                            676
            Graphics:    92248                          92248
       Private Other:    40948
              System:     5684
             Unknown:                                   46160

           TOTAL PSS:   190704            TOTAL RSS:   296304      TOTAL SWAP (KB):       24

** MEMINFO in pid 6903 [com.test.empty380_91] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    29434    29312        0        0    32316    83584    29991    47117
  Dalvik Heap     1311      920        0        0     9948    26767     2191    24576
 Dalvik Other      637      568        0        0     2816
        Stack      708      708        0        0      716
       Ashmem       24        0        0       24      512
      Gfx dev     2884     2884        0        0     2884
    Other dev       20        0       20        0      328
     .so mmap    22277      812    19264        0    55504
    .jar mmap     1177        0        0        0    24580
    .apk mmap      113        0        0        0     1504
    .ttf mmap       18        0        0        0      132
    .dex mmap      433       12      388        0     1012
    .oat mmap      685        0        8        0    12968
    .art mmap     1113      324        0        0    19064
   Other mmap      102       40       12        0     1440
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    39953    36832     3104        0    40700
        TOTAL   189345   160868    22796       24   294880   110351    32182    71693

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1244                          29012
         Native Heap:    29312                          32316
                Code:    20500                          95716
               Stack:      708                            716
            Graphics:    91340                          91340
       Private Other:    40560
              System:     5681
             Unknown:                                   45780

           TOTAL PSS:   189345            TOTAL RSS:   294880      TOTAL SWAP (KB):       24

** MEMINFO in pid 6959 [com.test.empty380_91] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    28887    28768        0        0    31736    83300    30063    47033
  Dalvik Heap     1323      932        0        0     9960    26765     2189    24576
 Dalvik Other      633      564        0        0     2812
        Stack      712      712        0        0      720
       Ashmem       24        0        0       24      512
      Gfx dev     3128     3128        0        0     3128
    Other dev       24        0       24        0      332
     .so mmap    22149      812    19136        0    55376
    .jar mmap     1152        0        0        0    24260
    .apk mmap      113        0        0        0     1504
    .ttf mmap       18        0        0        0      132
    .dex mmap      433       12      388        0     1012
    .oat mmap      685        0        8        0    12960
    .art mmap     1113      324        0        0    19064
   Other mmap      102       40       12        0     1440
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    39961    36676     3268        0    40704
        TOTAL   188913   160424    22836       24   294108   110065    32252    71609

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1256                          29024
         Native Heap:    28768                          31736
                Code:    20372                          95260
               Stack:      712                            720
            Graphics:    91584                          91584
       Private Other:    40568
              System:     5653
             Unknown:                                   45784

           TOTAL PSS:   188913            TOTAL RSS:   294108      TOTAL SWAP (KB):       24

v8 11.6.189.22 (armeabi-v7a)

** MEMINFO in pid 6056 [com.test.empty32_116] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    27848    27064        0        0    29452    75444    25121    35700
  Dalvik Heap     3763      876        0        0     9600    26746     2170    24576
 Dalvik Other      924      436        0        0     2036
        Stack      549      548        0        0      552
       Ashmem       24        0        0        0      536
      Gfx dev     4084     4084        0        0     4084
    Other dev       20        0       20        0      328
     .so mmap    34951      580    24976        0    51868
    .jar mmap     1291        0        4        0    25092
    .apk mmap      209        0       36        0     1552
    .ttf mmap       38        0        0        0      152
    .dex mmap      503       12      436        0     1008
    .oat mmap     6130        0     2624        0    11232
    .art mmap     4972      296        0        0    14336
   Other mmap      219       36        8        0     1536
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    51913    51784        0        0    52224
        TOTAL   225894   174172    28104        0   294044   102190    27291    60276

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1172                          23936
         Native Heap:    27064                          29452
                Code:    28684                          90920
               Stack:      548                            552
            Graphics:    92540                          92540
       Private Other:    52268
              System:    23618
             Unknown:                                   56644

           TOTAL PSS:   225894            TOTAL RSS:   294044      TOTAL SWAP (KB):        0

** MEMINFO in pid 6114 [com.test.empty32_116] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    27716    26932        0        0    29312    71860    25237    32434
  Dalvik Heap     4011     1112        0        0     9864    26749     2173    24576
 Dalvik Other      886      392        0        0     2004
        Stack      549      548        0        0      552
       Ashmem       24        0        0        0      536
      Gfx dev     3120     3120        0        0     3120
    Other dev       20        0       20        0      328
     .so mmap    30638      572    22344        0    45864
    .jar mmap     1292        0        4        0    24860
    .apk mmap      209        0       36        0     1552
    .ttf mmap       38        0        0        0      152
    .dex mmap      527       12      460        0     1032
    .oat mmap     6098        0     2624        0    11168
    .art mmap     4932      288        0        0    14236
   Other mmap      219       36        8        0     1536
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    51812    51672        0        0    52144
        TOTAL   220547   173140    25496        0   286716    98609    27410    57010

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1400                          24100
         Native Heap:    26932                          29312
                Code:    26068                          84644
               Stack:      548                            552
            Graphics:    91576                          91576
       Private Other:    52112
              System:    21911
             Unknown:                                   56532

           TOTAL PSS:   220547            TOTAL RSS:   286716      TOTAL SWAP (KB):        0

** MEMINFO in pid 6172 [com.test.empty32_116] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    27679    26896        0        0    29276    71860    25236    32271
  Dalvik Heap     3995     1096        0        0     9848    26748     2172    24576
 Dalvik Other      890      400        0        0     2004
        Stack      549      548        0        0      552
       Ashmem       24        0        0        0      536
      Gfx dev     2940     2940        0        0     2940
    Other dev       20        0       20        0      328
     .so mmap    30510      572    22216        0    45736
    .jar mmap     1269        0        8        0    24544
    .apk mmap      209        0       36        0     1552
    .ttf mmap       38        0        0        0      152
    .dex mmap      527       12      460        0     1032
    .oat mmap     6098        0     2624        0    11168
    .art mmap     4932      288        0        0    14236
   Other mmap      219       36        8        0     1536
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    51213    51072        0        0    51548
        TOTAL   219568   172316    25372        0   285444    98608    27408    56847

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1384                          24084
         Native Heap:    26896                          29276
                Code:    25944                          84200
               Stack:      548                            552
            Graphics:    91396                          91396
       Private Other:    51520
              System:    21880
             Unknown:                                   55936

           TOTAL PSS:   219568            TOTAL RSS:   285444      TOTAL SWAP (KB):        0

v8 11.4.183.27 (armeabi-v7a)

** MEMINFO in pid 7712 [com.test.empty32bit_114] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    28410    27644        0        0    29968    71860    26088    31286
  Dalvik Heap     4006     1104        0        0     9856    26749     2173    24576
 Dalvik Other      895      396        0        0     2024
        Stack      564      564        0        0      564
       Ashmem       24        0        0       24      512
      Gfx dev     2976     2976        0        0     2976
    Other dev       20        0       20        0      328
     .so mmap    31980      556    26672        0    43468
    .jar mmap     1279        0       12        0    24484
    .apk mmap      103        0        0        0     1356
    .ttf mmap       16        0        0        0      132
    .dex mmap      523       12      464        0      996
    .oat mmap     7617        0     5964        0    10276
    .art mmap     4932      288        0        0    14236
   Other mmap      178       36       16        0     1204
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    51680    51540        0        0    52012
        TOTAL   223659   173572    33148       24   282848    98609    28261    55862

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1392                          24092
         Native Heap:    27644                          29968
                Code:    33696                          80728
               Stack:      564                            564
            Graphics:    91432                          91432
       Private Other:    51992
              System:    16939
             Unknown:                                   56064

           TOTAL PSS:   223659            TOTAL RSS:   282848      TOTAL SWAP (KB):       24

** MEMINFO in pid 7769 [com.test.empty32bit_114] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    28605    27832        0        0    30172    71860    26088    31237
  Dalvik Heap     4014     1112        0        0     9864    26748     2172    24576
 Dalvik Other      891      392        0        0     2020
        Stack      552      552        0        0      552
       Ashmem       24        0        0       24      512
      Gfx dev     3252     3252        0        0     3252
    Other dev       16        0       16        0      324
     .so mmap    31852      556    26544        0    43340
    .jar mmap     1265        0       12        0    24356
    .apk mmap      103        0        0        0     1356
    .ttf mmap       16        0        0        0      132
    .dex mmap      523       12      464        0      996
    .oat mmap     7613        0     5964        0    10268
    .art mmap     4932      288        0        0    14236
   Other mmap      178       36       16        0     1204
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    51692    51552        0        0    52024
        TOTAL   223984   174040    33016       24   283064    98608    28260    55813

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1400                          24100
         Native Heap:    27832                          30172
                Code:    33568                          80464
               Stack:      552                            552
            Graphics:    91708                          91708
       Private Other:    51996
              System:    16928
             Unknown:                                   56068

           TOTAL PSS:   223984            TOTAL RSS:   283064      TOTAL SWAP (KB):       24

** MEMINFO in pid 7825 [com.test.empty32bit_114] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    28511    27740        0        0    30080    72116    26083    31468
  Dalvik Heap     3998     1096        0        0     9848    26748     2172    24576
 Dalvik Other      893      396        0        0     2020
        Stack      552      552        0        0      552
       Ashmem       24        0        0       24      512
      Gfx dev     2976     2976        0        0     2976
    Other dev       20        0       20        0      328
     .so mmap    31916      556    26608        0    43404
    .jar mmap     1262        0       12        0    24292
    .apk mmap      103        0        0        0     1356
    .ttf mmap       16        0        0        0      132
    .dex mmap      523       12      464        0      996
    .oat mmap     7613        0     5964        0    10268
    .art mmap     4932      288        0        0    14236
   Other mmap      178       36       16        0     1204
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    51576    51436        0        0    51908
        TOTAL   223549   173544    33084       24   282568    98864    28255    56044

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1384                          24084
         Native Heap:    27740                          30080
                Code:    33632                          80464
               Stack:      552                            552
            Graphics:    91432                          91432
       Private Other:    51888
              System:    16921
             Unknown:                                   55956

           TOTAL PSS:   223549            TOTAL RSS:   282568      TOTAL SWAP (KB):       24

v8 9.1.269.0 (armeabi-v7a)

** MEMINFO in pid 7453 [com.test.empty32bit_91] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    29414    28644        0        0    30980    73432    25982    33155
  Dalvik Heap     4010     1108        0        0     9860    26749     2173    24576
 Dalvik Other      891      392        0        0     2020
        Stack      580      580        0        0      580
       Ashmem       24        0        0       24      512
      Gfx dev     3224     3224        0        0     3224
    Other dev       20        0       20        0      328
     .so mmap    31412      528    26132        0    42900
    .jar mmap     1279        0       12        0    24484
    .apk mmap      103        0        0        0     1356
    .ttf mmap       16        0        0        0      132
    .dex mmap      523       12      464        0      996
    .oat mmap     7617        0     5964        0    10276
    .art mmap     4932      288        0        0    14236
   Other mmap      178       36       16        0     1204
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    54800    52460     2200        0    55132
        TOTAL   227479   175728    34808       24   286676   100181    28155    57731

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1396                          24096
         Native Heap:    28644                          30980
                Code:    33128                          80160
               Stack:      580                            580
            Graphics:    91680                          91680
       Private Other:    55108
              System:    16943
             Unknown:                                   59180

           TOTAL PSS:   227479            TOTAL RSS:   286676      TOTAL SWAP (KB):       24

** MEMINFO in pid 7508 [com.test.empty32bit_91] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    29085    28316        0        0    30644    73424    25929    32910
  Dalvik Heap     3990     1088        0        0     9840    26749     2173    24576
 Dalvik Other      891      392        0        0     2020
        Stack      580      580        0        0      580
       Ashmem       24        0        0       24      512
      Gfx dev     3752     3752        0        0     3752
    Other dev       20        0       20        0      328
     .so mmap    31220      528    25940        0    42708
    .jar mmap     1279        0       12        0    24484
    .apk mmap      103        0        0        0     1356
    .ttf mmap       16        0        0        0      132
    .dex mmap      523       12      464        0      996
    .oat mmap     7617        0     5964        0    10276
    .art mmap     4932      288        0        0    14236
   Other mmap      178       36       16        0     1204
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    54992    52372     2480        0    55324
        TOTAL   227658   175820    34896       24   286848   100173    28102    57486

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1376                          24076
         Native Heap:    28316                          30644
                Code:    32936                          79968
               Stack:      580                            580
            Graphics:    92208                          92208
       Private Other:    55300
              System:    16942
             Unknown:                                   59372

           TOTAL PSS:   227658            TOTAL RSS:   286848      TOTAL SWAP (KB):       24

** MEMINFO in pid 7564 [com.test.empty32bit_91] **
                   Pss  Private  Private     Swap      Rss     Heap     Heap     Heap
                 Total    Dirty    Clean    Dirty    Total     Size    Alloc     Free
                ------   ------   ------   ------   ------   ------   ------   ------
  Native Heap    29504    28732        0        0    31072    73436    25975    33098
  Dalvik Heap     4006     1104        0        0     9856    26764     2188    24576
 Dalvik Other      893      396        0        0     2020
        Stack      580      580        0        0      580
       Ashmem       24        0        0       24      512
      Gfx dev     3048     3048        0        0     3048
    Other dev       20        0       20        0      328
     .so mmap    31284      528    26004        0    42772
    .jar mmap     1262        0       12        0    24292
    .apk mmap      103        0        0        0     1356
    .ttf mmap       16        0        0        0      132
    .dex mmap      523       12      464        0      996
    .oat mmap     7613        0     5964        0    10268
    .art mmap     4932      288        0        0    14236
   Other mmap      178       36       16        0     1204
   EGL mtrack    87880    87880        0        0    87880
    GL mtrack      576      576        0        0      576
      Unknown    54652    52032     2480        0    54984
        TOTAL   227094   175212    34960       24   286112   100200    28163    57674

 App Summary
                       Pss(KB)                        Rss(KB)
                        ------                         ------
           Java Heap:     1392                          24092
         Native Heap:    28732                          31072
                Code:    33000                          79832
               Stack:      580                            580
            Graphics:    91504                          91504
       Private Other:    54964
              System:    16922
             Unknown:                                   59032

           TOTAL PSS:   227094            TOTAL RSS:   286112      TOTAL SWAP (KB):       24
dumganhar commented 1 year ago

Another issue of upgrading is that v8 deleted a public API (v8::Isolate::VisitHandlesWithClassIds) that we're using.

https://github.com/v8/v8/commit/4cf204da0a7c59f476bc2ea6622d897f660e22d0

dumganhar commented 1 year ago

Since we're targeting this issue to v3.9, chromium may release 117 at that time. It's better to upgrade to 116. So, delay the sprint.

dumganhar commented 1 year ago

Stable version of 11.6 was released, so it's time to upgrade to 11.6 now.

dumganhar commented 1 year ago

Got warnings while commit large file to github:

remote: warning: File v8-android/armeabi-v7a/libv8_monolith.a is 50.01 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File v8-mac/libv8_monolith.a is 97.13 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File v8-windows/Debug/mksnapshot.exe is 60.22 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File v8-windows/Debug/v8.dll is 56.26 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File v8-oh/arm64-v8a/libv8_monolith.a is 62.01 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File v8-android/arm64-v8a/libv8_monolith.a is 67.74 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File v8-android/x86_64/libv8_monolith.a is 67.69 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File v8-linux/libv8_monolith.a is 95.58 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File v8-ios/libv8_monolith.a is 64.79 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
dumganhar commented 1 year ago

NEED ndk r23 or above, otherwise will trigger the following link errors:

  /home/runner/work/cocos-engine/cocos-engine/native/external/cmake/../android/arm64-v8a/v8/libv8_monolith.a(pipeline.o): In function `v8::internal::compiler::Pipeline::GenerateCodeForWasmFunction(v8::internal::OptimizedCompilationInfo*, v8::internal::wasm::CompilationEnv*, v8::internal::compiler::WasmCompilationData&, v8::internal::compiler::MachineGraph*, v8::internal::compiler::CallDescriptor*, v8::internal::ZoneVector<v8::internal::WasmInliningPosition>*)':
  pipeline.cc:(.text+0x128): undefined reference to `__aarch64_ldadd8_acq_rel'
  /home/runner/work/cocos-engine/cocos-engine/native/external/cmake/../android/arm64-v8a/v8/libv8_monolith.a(pipeline.o): In function `v8::internal::compiler::(anonymous namespace)::TraceSequence(v8::internal::OptimizedCompilationInfo*, v8::internal::compiler::PipelineData*, char const*)':
  pipeline.cc:(.text+0x70): undefined reference to `__aarch64_cas1_acq_rel'
  pipeline.cc:(.text+0x150): undefined reference to `__aarch64_cas1_acq_rel'
  pipeline.cc:(.text+0x198): undefined reference to `__aarch64_cas1_acq_rel'
  pipeline.cc:(.text+0x388): undefined reference to `__aarch64_cas1_acq_rel'
  /home/runner/work/cocos-engine/cocos-engine/native/external/cmake/../android/arm64-v8a/v8/libv8_monolith.a(pipeline.o): In function `v8::internal::compiler::MemoryOptimizationPhase::Run(v8::internal::compiler::PipelineData*, v8::internal::Zone*)':
  pipeline.cc:(.text[_ZN2v88internal8compiler23MemoryOptimizationPhase3RunEPNS1_12PipelineDataEPNS0_4ZoneE]+0x98): undefined reference to `__aarch64_cas1_acq_rel'
  /home/runner/work/cocos-engine/cocos-engine/native/external/cmake/../android/arm64-v8a/v8/libv8_monolith.a(pipeline.o):pipeline.cc:(.text[_ZN2v88internal8compiler23MemoryOptimizationPhase3RunEPNS1_12PipelineDataEPNS0_4ZoneE]+0x178): more undefined references to `__aarch64_cas1_acq_rel' follow
  /home/runner/work/cocos-engine/cocos-engine/native/external/cmake/../android/arm64-v8a/v8/libv8_monolith.a(maglev-code-generator.o): In function `v8::internal::maglev::MaglevCodeGenerator::GenerateDeoptimizationData(v8::internal::LocalIsolate*)':
  maglev-code-generator.cc:(.text+0xf0): undefined reference to `__aarch64_ldadd4_acq_rel'
  /home/runner/work/cocos-engine/cocos-engine/native/external/cmake/../android/arm64-v8a/v8/libv8_monolith.a(effect-control-linearizer.o): In function `v8::internal::compiler::EffectControlLinearizer::LowerAssertType(v8::internal::compiler::Node*)':
  effect-control-linearizer.cc:(.text+0xa8): undefined reference to `__aarch64_cas1_acq_rel'
  effect-control-linearizer.cc:(.text+0xfc): undefined reference to `__aarch64_cas1_acq_rel'
  /home/runner/work/cocos-engine/cocos-engine/native/external/cmake/../android/arm64-v8a/v8/libv8_monolith.a(pipeline-statistics.o): In function `v8::internal::compiler::PipelineStatistics::PipelineStatistics(v8::internal::OptimizedCompilationInfo*, std::__ndk1::shared_ptr<v8::internal::CompilationStatistics>, v8::internal::compiler::ZoneStats*)':
  pipeline-statistics.cc:(.text+0x44): undefined reference to `__aarch64_ldadd8_relax'
  /home/runner/work/cocos-engine/cocos-engine/native/external/cmake/../android/arm64-v8a/v8/libv8_monolith.a(pipeline-statistics.o): In function `v8::internal::compiler::PipelineStatistics::~PipelineStatistics()':
  pipeline-statistics.cc:(.text+0xe0): undefined reference to `__aarch64_ldadd8_acq_rel'
dumganhar commented 1 year ago

If using ndk r21e (llvm 9) to build v8, it will fail:

/home/runner/.setup-ndk/r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -MMD -MF obj/d8/async-hooks-wrapper.o.d -DOFFICIAL_BUILD -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DANDROID -DHAVE_SYS_UIO_H -DANDROID_NDK_VERSION_ROLL=r21e_1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 -DV8_ATOMIC_OBJECT_FIELD_WRITES -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_SHARED_RO_HEAP -DV8_WIN64_UNWINDING_INFO -DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH -DV8_SNAPSHOT_COMPRESSION -DV8_ENABLE_CONTROL_FLOW_INTEGRITY -DV8_SHORT_BUILTIN_CALLS -DV8_EXTERNAL_CODE_SPACE -DV8_ENABLE_MAGLEV -DV8_ENABLE_TURBOFAN -DV8_ENABLE_WEBASSEMBLY -DV8_ALLOCATION_FOLDING -DV8_ALLOCATION_SITE_TRACKING -DV8_USE_ZLIB -DV8_USE_LIBM_TRIG_FUNCTIONS -DV8_ENABLE_MAGLEV_GRAPH_PRINTER -DV8_COMPRESS_POINTERS -DV8_COMPRESS_POINTERS_IN_SHARED_CAGE -DV8_31BIT_SMIS_ON_64BIT_ARCH -DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DEPRECATION_WARNINGS -DCPPGC_CAGED_HEAP -DCPPGC_YOUNG_GENERATION -DCPPGC_POINTER_COMPRESSION -DCPPGC_SLIM_WRITE_BARRIER -DV8_TARGET_ARCH_ARM64 -DV8_HAVE_TARGET_OS -DV8_TARGET_OS_ANDROID -I../.. -Igen -I../../include -Igen/include -Wall -Wextra -Wimplicit-fallthrough -Wextra-semi -Wunreachable-code-aggressive -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-ignored-pragma-optimize -Wno-bitfield-constant-conversion -Wno-deprecated-this-capture -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -ffunction-sections -fno-short-enums -mbranch-protection=standard --target=aarch64-linux-android21 -mno-outline -no-canonical-prefixes -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wmissing-field-initializers -Wunreachable-code -Wno-shadow -Wctad-maybe-unsupported -Wshorten-64-to-32 -Wno-invalid-offsetof -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -std=c++17 -Wno-trigraphs -fno-exceptions -fno-rtti --sysroot=../../../../../.setup-ndk/r21e/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fvisibility-inlines-hidden -c ../../src/d8/async-hooks-wrapper.cc -o obj/d8/async-hooks-wrapper.o
warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
warning: unknown warning option '-Wenum-compare-conditional'; did you mean '-Wenum-compare-switch'? [-Wunknown-warning-option]
In file included from ../../src/d8/async-hooks-wrapper.cc:11:
In file included from ../../src/api/api-inl.h:15:
In file included from ../../src/heap/heap-inl.h:32:
In file included from ../../src/heap/new-spaces-inl.h:12:
In file included from ../../src/heap/paged-spaces-inl.h:13:
In file included from ../../src/objects/objects-inl.h:32:
In file included from ../../src/objects/js-proxy-inl.h:8:
In file included from ../../src/objects/instance-type-inl.h:11:
In file included from ../../src/objects/map-inl.h:9:
In file included from ../../src/objects/api-callbacks-inl.h:13:
In file included from ../../src/objects/js-objects-inl.h:18:
In file included from ../../src/objects/lookup-inl.h:14:
In file included from ../../src/heap/factory-inl.h:13:
In file included from ../../src/execution/isolate-inl.h:9:
In file included from ../../src/objects/contexts-inl.h:17:
../../src/objects/ordered-hash-table-inl.h:210:3: error: member reference type 'Tagged' is not a pointer
  WRITE_BARRIER(*this, entry_offset, value);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/objects/object-macros.h:514:50: note: expanded from macro 'WRITE_BARRIER'
    CombinedWriteBarrier(object, Tagged(object)->RawField(offset), value, \
                                 ~~~~~~~~~~~~~~  ^

After fixing the above error, we got another error while compiling maglev-code-generator.o:

error: fixup value out of range

And it seems to be a compiler bug in android ndk r21.

Reference:

https://bugs.chromium.org/p/v8/issues/detail?id=14221

https://github.com/nodejs/node/commit/cdebfb62869adc70259612a1b27859ffe8ef91ad

https://github.com/v8/v8/commit/0ea52064e75c109dd106782ad2242e09e27b0f63

dumganhar commented 1 year ago

v8 compiled with r23c could be linked successfully if project uses ndk r21e.