Skip to content

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Interface default methods produced concrete implementations in the interface C output but did not always emit corresponding class-level stubs and header declarations for non-interface implementing classes, causing missing-symbol errors at native compile time when code referenced the class-level stub (e.g., for super calls).

Description

  • Added hasMethodInBaseClass, appendDefaultInterfaceStubs, and appendDefaultInterfaceStubHeaders to ByteCodeClass to walk interface hierarchies and emit class-level stubs and header declarations for concrete default interface methods while skipping abstract/static/private methods.
  • Integrated default-interface stub emission into the class C generation and header generation paths by calling the new helpers alongside existing super-stub generation, and changed the logic to only append super stubs when a base class exists.
  • The new logic prevents emitting stubs when a base class already supplies the same implementation to avoid accidental overrides.
  • Updated ParserTest.translatesDefaultInterfaceMethodImplementations to assert that the implementing class C contains the concrete stub symbol and that the implementing class header declares the stub.

Testing

  • Added assertions in vm/tests/src/test/java/com/codename1/tools/translator/ParserTest.java to verify the implementing class emits the concrete stub and header declaration for default interface methods, but no automated test suite was executed for this patch.
  • No CI or unit test runs were performed as part of this change (tests were updated but not run).

Codex Task

@github-actions
Copy link

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • Tests: 171 total, 0 failed, 2 skipped

Benchmark Results

  • Execution Time: 10163 ms

  • Hotspots (Top 20 sampled methods):

    • 21.70% java.lang.String.indexOf (382 samples)
    • 18.24% com.codename1.tools.translator.Parser.isMethodUsed (321 samples)
    • 14.94% com.codename1.tools.translator.Parser.addToConstantPool (263 samples)
    • 8.41% java.util.ArrayList.indexOf (148 samples)
    • 4.43% java.lang.Object.hashCode (78 samples)
    • 3.75% com.codename1.tools.translator.ByteCodeClass.calcUsedByNative (66 samples)
    • 2.78% com.codename1.tools.translator.ByteCodeClass.fillVirtualMethodTable (49 samples)
    • 2.61% java.lang.System.identityHashCode (46 samples)
    • 2.16% com.codename1.tools.translator.BytecodeMethod.optimize (38 samples)
    • 1.25% java.lang.AbstractStringBuilder.append (22 samples)
    • 1.14% java.lang.StringBuilder.append (20 samples)
    • 0.97% com.codename1.tools.translator.Parser.cullMethods (17 samples)
    • 0.97% com.codename1.tools.translator.Parser.generateClassAndMethodIndexHeader (17 samples)
    • 0.91% java.io.FileOutputStream.open0 (16 samples)
    • 0.80% com.codename1.tools.translator.ByteCodeClass.markDependent (14 samples)
    • 0.74% java.io.FileInputStream.open0 (13 samples)
    • 0.57% java.io.FileOutputStream.writeBytes (10 samples)
    • 0.45% com.codename1.tools.translator.ByteCodeField.equals (8 samples)
    • 0.45% com.codename1.tools.translator.BytecodeMethod.equals (8 samples)
    • 0.45% java.util.Hashtable.get (8 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 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: 365 seconds
  • Compilation Time: 100 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 36843 ms
Extract Extensions 24 ms
Google Services Setup 2 ms
Scan Classes 957 ms
Extract Libs 1383 ms
Inject Build Hints 45 ms
Generate Unit Tests 3 ms
Generate Stubs 1217 ms
Compile Stubs 2695 ms
Generate Icons 1432 ms
Prepare ParparVM 222 ms
ParparVM Execution 205529 ms
Post-VM Setup 219 ms
CocoaPods 6933 ms
Finalize 44 ms
Total Time 257553 msMaven Overhead : 108000 ms
CocoaPods Install (Script) 2000 ms
Simulator Boot (Run) 79000 ms
App Install 12000 ms
App Launch 7000 ms
Test Execution 144000 ms

@shai-almog shai-almog merged commit 791c2ef into master Jan 18, 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