Skip to content

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Prevent an assertion crash when the VM call stack is exhausted by throwing a proper StackOverflowError so Java code can catch and recover.
  • Provide the missing java.lang.StackOverflowError class so the VM can instantiate and throw the error.
  • Add an integration test to validate that a stack overflow is thrown and that the VM can continue execution after it is caught.

Description

  • Added vm/JavaAPI/src/java/lang/StackOverflowError.java implementing java.lang.VirtualMachineError.
  • Updated vm/ByteCodeTranslator/src/nativeMethods.m to include the StackOverflowError header and change initMethodStack to check callStackOffset and call throwException(threadStateData, __NEW_INSTANCE_java_lang_StackOverflowError(threadStateData)) and return instead of asserting.
  • Added vm/tests/src/test/java/com/codename1/tools/translator/StackOverflowIntegrationTest.java, a native integration test that compiles a small app which triggers a stack overflow, verifies the StackOverflowError was thrown/caught (STACK_OVERFLOW_OK) and that normal execution (a recursive sum) still works after recovery (RECOVERY_OK:7).

Testing

  • No automated tests were executed as part of this change.
  • A new automated integration test StackOverflowIntegrationTest was added under vm/tests and will run as part of the VM test suite when the test goals are invoked.
  • The change is limited to VM native code, the JavaAPI, and an integration test; CI or a local Maven test run should be used to validate the new test in the full environment.

Codex Task

@github-actions
Copy link

github-actions bot commented Jan 25, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Collaborator Author

shai-almog commented Jan 25, 2026

iOS screenshot updates

Compared 30 screenshots: 22 matched, 7 updated, 1 missing reference.

  • BrowserComponent — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

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

  • graphics-draw-arc — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-arc
    Preview info: JPEG preview quality 20; JPEG preview quality 20; downscaled to 603x1311.
    Full-resolution PNG saved as graphics-draw-arc.png in workflow artifacts.

  • graphics-draw-gradient — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-gradient
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 844x1835.
    Full-resolution PNG saved as graphics-draw-gradient.png in workflow artifacts.

  • graphics-draw-round-rect — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots/graphics-draw-round-rect.png.

    graphics-draw-round-rect
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 844x1835.
    Full-resolution PNG saved as graphics-draw-round-rect.png in workflow artifacts.

  • graphics-draw-string — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-string
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 422x918.
    Full-resolution PNG saved as graphics-draw-string.png in workflow artifacts.

  • graphics-draw-string-decorated — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-string-decorated
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 603x1311.
    Full-resolution PNG saved as graphics-draw-string-decorated.png in workflow artifacts.

  • graphics-fill-arc — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-fill-arc
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 844x1835.
    Full-resolution PNG saved as graphics-fill-arc.png in workflow artifacts.

  • kotlin — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

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

Benchmark Results

  • VM Translation Time: 316 seconds
  • Compilation Time: 297 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 23437 ms
Extract Extensions 14 ms
Google Services Setup 3 ms
Scan Classes 753 ms
Extract Libs 508 ms
Inject Build Hints 29 ms
Generate Unit Tests 2 ms
Generate Stubs 780 ms
Compile Stubs 1741 ms
Generate Icons 778 ms
Prepare ParparVM 124 ms
ParparVM Execution 193864 ms
Post-VM Setup 388 ms
CocoaPods 5377 ms
Finalize 58 ms
Total Time 227857 msMaven Overhead : 89000 ms
CocoaPods Install (Script) 2000 ms
Simulator Boot 98000 ms
Simulator Boot (Run) 10000 ms
App Install 17000 ms
App Launch 14000 ms
Test Execution 206000 ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants