Skip to content

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Make GC assertion failures easier to identify in unsymbolicated iOS simulator crash reports by emitting distinctive assertion messages.
  • Preserve the defensive, non-crashing behavior on physical devices by keeping log-and-skip semantics there.

Description

  • Add the CN1_GC_ASSERT helper macro that on TARGET_OS_SIMULATOR calls __assert_rtn with a custom message, on device becomes a no-op (arguments consumed), and on non-Apple builds falls back to CODENAME_ONE_ASSERT.
  • Replace the previous CODENAME_ONE_ASSERT checks in codenameOneGCMark (stack entry validation) and codenameOneGCSweep (object GC mark check) with CN1_GC_ASSERT and add device-side NSLog+continue handling where appropriate.
  • Use distinct identifiers for each assertion to aid post-mortem analysis: "CN1_GC_STACK_ENTRY_TYPE" for stack-entry validation and "CN1_GC_INVALID_MARK" for invalid GC marks.

Testing

  • No automated tests were run for this change.

Codex Task

@github-actions
Copy link

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • Tests: 171 total, 0 failed, 2 skipped

Benchmark Results

  • Execution Time: 9657 ms

  • Hotspots (Top 20 sampled methods):

    • 23.51% java.lang.String.indexOf (401 samples)
    • 17.41% com.codename1.tools.translator.Parser.isMethodUsed (297 samples)
    • 14.24% com.codename1.tools.translator.Parser.addToConstantPool (243 samples)
    • 10.08% java.util.ArrayList.indexOf (172 samples)
    • 4.22% java.lang.Object.hashCode (72 samples)
    • 3.46% com.codename1.tools.translator.ByteCodeClass.calcUsedByNative (59 samples)
    • 2.81% com.codename1.tools.translator.ByteCodeClass.fillVirtualMethodTable (48 samples)
    • 2.58% java.lang.System.identityHashCode (44 samples)
    • 1.23% java.lang.StringBuilder.append (21 samples)
    • 1.11% com.codename1.tools.translator.Parser.cullMethods (19 samples)
    • 1.11% com.codename1.tools.translator.BytecodeMethod.optimize (19 samples)
    • 1.11% com.codename1.tools.translator.Parser.generateClassAndMethodIndexHeader (19 samples)
    • 0.94% java.io.FileOutputStream.writeBytes (16 samples)
    • 0.82% java.io.FileOutputStream.open0 (14 samples)
    • 0.82% com.codename1.tools.translator.ByteCodeClass.markDependent (14 samples)
    • 0.76% java.lang.StringCoding$StringEncoder.encode (13 samples)
    • 0.64% com.codename1.tools.translator.BytecodeMethod.equals (11 samples)
    • 0.64% com.codename1.tools.translator.ByteCodeClass.isDefaultInterfaceMethod (11 samples)
    • 0.59% java.io.FileInputStream.open0 (10 samples)
    • 0.53% java.util.ArrayList$Itr.next (9 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

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Collaborator Author

shai-almog commented Jan 17, 2026

iOS screenshot updates

Compared 29 screenshots: 22 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: 295 seconds
  • Compilation Time: 72 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 24971 ms
Extract Extensions 21 ms
Google Services Setup 1 ms
Scan Classes 396 ms
Extract Libs 822 ms
Inject Build Hints 36 ms
Generate Unit Tests 5 ms
Generate Stubs 923 ms
Compile Stubs 1896 ms
Generate Icons 794 ms
Prepare ParparVM 116 ms
ParparVM Execution 176031 ms
Post-VM Setup 100 ms
CocoaPods 4087 ms
Finalize 16 ms
Total Time 210216 msMaven Overhead : 85000 ms
CocoaPods Install (Script) 1000 ms
Simulator Boot (Run) 44000 ms
App Install 11000 ms
App Launch 5000 ms
Test Execution 134000 ms

@shai-almog shai-almog merged commit 8bb7522 into master Jan 17, 2026
11 checks passed
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