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: 23 matched, 6 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.

  • 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: 310 seconds
  • Compilation Time: 159 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 27041 ms
Extract Extensions 14 ms
Google Services Setup 2 ms
Scan Classes 815 ms
Extract Libs 607 ms
Inject Build Hints 30 ms
Generate Unit Tests 2 ms
Generate Stubs 881 ms
Compile Stubs 2270 ms
Generate Icons 1094 ms
Prepare ParparVM 167 ms
ParparVM Execution 183289 ms
Post-VM Setup 94 ms
CocoaPods 4223 ms
Finalize 27 ms
Total Time 220557 msMaven Overhead : 90000 ms
CocoaPods Install (Script) 1000 ms
Simulator Boot 54000 ms
Simulator Boot (Run) 2000 ms
App Install 13000 ms
App Launch 7000 ms
Test Execution 135000 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