Skip to content

Initial work on the new JavaScript port#4677

Draft
shai-almog wants to merge 61 commits intomasterfrom
javascript-port-initial-work
Draft

Initial work on the new JavaScript port#4677
shai-almog wants to merge 61 commits intomasterfrom
javascript-port-initial-work

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented Mar 31, 2026

Android screenshot updates

Compared 37 screenshots: 36 matched, 1 updated.

  • Sheet — updated screenshot. Screenshot differs (320x640 px, bit depth 8).

    Sheet
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as Sheet.png in workflow artifacts.

Native Android coverage

  • 📊 Line coverage: 7.82% (4120/52674 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 6.12% (20323/331828), branch 2.92% (935/32004), complexity 3.66% (1122/30656), method 6.44% (922/14319), class 10.58% (201/1899)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 944.000 ms
Base64 CN1 encode 926.000 ms
Base64 encode ratio (CN1/native) 0.981x (1.9% faster)
Base64 native decode 904.000 ms
Base64 CN1 decode 445.000 ms
Base64 decode ratio (CN1/native) 0.492x (50.8% faster)

@shai-almog shai-almog force-pushed the javascript-port-initial-work branch from bfdfa3c to 771920d Compare March 31, 2026 04:08
@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented Mar 31, 2026

iOS screenshot updates

Compared 37 screenshots: 36 matched, 1 updated.

  • Sheet — updated screenshot. Screenshot differs (1179x2556 px, bit depth 8).

    Sheet
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as Sheet.png in workflow artifacts.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 265 seconds

Detailed Performance Metrics

Metric Duration
Simulator Boot 79000 ms
Simulator Boot (Run) 1000 ms
App Install 19000 ms
App Launch 7000 ms
Test Execution 188000 ms
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1434.000 ms
Base64 CN1 encode 2365.000 ms
Base64 encode ratio (CN1/native) 1.649x (64.9% slower)
Base64 native decode 841.000 ms
Base64 CN1 decode 1654.000 ms
Base64 decode ratio (CN1/native) 1.967x (96.7% slower)

@shai-almog shai-almog force-pushed the javascript-port-initial-work branch from 771920d to 7b7456c Compare March 31, 2026 14:20
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • Tests: 441 total, 0 failed, 2 skipped

Benchmark Results

  • Execution Time: 10411 ms

  • Hotspots (Top 20 sampled methods):

    • 22.22% java.lang.String.indexOf (412 samples)
    • 19.96% com.codename1.tools.translator.Parser.isMethodUsed (370 samples)
    • 12.14% com.codename1.tools.translator.Parser.addToConstantPool (225 samples)
    • 11.00% java.util.ArrayList.indexOf (204 samples)
    • 3.94% java.lang.Object.hashCode (73 samples)
    • 2.97% java.lang.System.identityHashCode (55 samples)
    • 2.16% com.codename1.tools.translator.BytecodeMethod.equals (40 samples)
    • 1.56% com.codename1.tools.translator.ByteCodeClass.markDependent (29 samples)
    • 1.51% com.codename1.tools.translator.ByteCodeClass.calcUsedByNative (28 samples)
    • 1.40% com.codename1.tools.translator.ByteCodeClass.fillVirtualMethodTable (26 samples)
    • 1.13% com.codename1.tools.translator.BytecodeMethod.optimize (21 samples)
    • 0.86% com.codename1.tools.translator.Parser.cullMethods (16 samples)
    • 0.81% com.codename1.tools.translator.BytecodeMethod.isMethodUsedByNative (15 samples)
    • 0.70% java.util.ArrayList$Itr.next (13 samples)
    • 0.65% java.util.TreeMap.getEntry (12 samples)
    • 0.65% com.codename1.tools.translator.ByteCodeClass.isDefaultInterfaceMethod (12 samples)
    • 0.65% java.lang.StringCoding.encode (12 samples)
    • 0.65% com.codename1.tools.translator.Parser.generateClassAndMethodIndexHeader (12 samples)
    • 0.59% java.lang.StringBuilder.append (11 samples)
    • 0.59% com.codename1.tools.translator.Parser.getClassByName (11 samples)
  • ⚠️ Coverage report not generated.

Static Analysis

  • ✅ SpotBugs: no findings (report was not generated by the build).
  • ⚠️ PMD report not generated.
  • ⚠️ Checkstyle report not generated.

Generated automatically by the PR CI workflow.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Cloudflare Preview

@shai-almog shai-almog force-pushed the javascript-port-initial-work branch 12 times, most recently from 00a257b to 3701252 Compare April 3, 2026 12:17
shai-almog and others added 12 commits April 6, 2026 21:30
…remove bogus file (#4719)

- Add port.js shim for CodenameOneImplementation.initImpl to handle
  getClass().getName() failures in ParparVM JS translation
- Simplify ParparVMBootstrap.bootstrap() to match JavaScriptPortBootstrap
  (remove intermediate hasNativeTheme/installNativeTheme calls)
- Remove bogus root-level ParparVMBootstrap.java with incorrect imports
- Update STATUS.md with fix descriptions

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/450e96a0-a954-4d81-b2c3-4743d2b2bbe3

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
@shai-almog shai-almog force-pushed the javascript-port-initial-work branch from 4256e8b to acd6641 Compare April 10, 2026 06:08
@shai-almog shai-almog force-pushed the javascript-port-initial-work branch from a607e0b to 2382137 Compare April 11, 2026 10:43
shai-almog and others added 7 commits April 11, 2026 15:51
…4736)

* Fix Worker-to-main-thread console forwarding for CN1SS output

printToConsole() and emitDiagLine() now forward output via
postMessage so that Playwright page.on('console') captures
System.out.println and CN1SS chunk data from the Worker.

browser_bridge.js detects cn1Started from Worker log messages.
Playwright script exits early on CN1SS:SUITE:FINISHED.

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/ba4cf2eb-f26f-49de-b5cf-33d60b64f177

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>

* Address code review feedback: log postMessage errors, reduce indexOf calls, extract constant

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/ba4cf2eb-f26f-49de-b5cf-33d60b64f177

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>

* Fix HashMap.computeHashCode shim and guard Worker console forwarding

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/6ffc979b-aaf8-4808-8569-22d9a67a303f

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>

* Add Uint8ClampedArray.create() bindings and fix indexed get/set priority for typed arrays

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/86e83ee8-794d-45d7-8666-cca8d2701acc

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>

* Skip translated screenshot method to avoid canvasToBlob hang; add Uint8ClampedArray to inferFn

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/ede5220b-d007-4fb6-860a-248673dd964b

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>

* Fix fatal crash on truncated PNG in ProcessScreenshots missing_expected path

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/1b48d3ec-861d-4865-ae07-ead8d898cd3c

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>

* Tolerate bootstrap_placeholder decode failures and downgrade minority failures to warnings

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/ae5b0454-7080-4003-9dfb-eed23a6b9843

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>

* Capture main-thread canvas for JS screenshots instead of blank worker OffscreenCanvas

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/b7fa2e59-a288-4ae6-9bea-d304c7f0bda8

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>

* Remove emitFallbackScreenshotChunk that creates duplicate broken screenshot streams on iOS/Android

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/7d97f49d-a86e-44a0-b878-6a1bd7be1140

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants