Skip to content

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Prevent incorrect "barebone" method classification when methods use local slots beyond argument slots or modify locals via IINC which wasn't accounted for.
  • Avoid silently allowing opcodes that can implicitly throw (divide/remainder) in methods considered barebone.
  • Ensure volatile field code generation uses explicit atomic initialization and explicit acquire/release memory ordering to avoid undefined ordering and initialization issues.

Description

  • Added getVar() to IInc so the local index used by IINC is visible to analysis (vm/.../bytecodes/IInc.java).
  • Tightened BytecodeMethod.checkBarebone() to scan instructions for maximum local index used by VarOp and IInc and reject barebone if that index is >= argument slots (vm/.../BytecodeMethod.java).
  • Removed implicit divide/remainder opcodes from the allowed barebone instruction set to avoid methods that could throw implicitly from being marked barebone (vm/.../BytecodeMethod.java).
  • Modified volatile field codegen to use ATOMIC_VAR_INIT(0) for static volatile initialization and to call atomic_load_explicit(..., memory_order_acquire) / atomic_store_explicit(..., memory_order_release) for static and instance volatile accesses, including GC mark paths and static field marking (vm/.../ByteCodeClass.java).

Testing

  • No automated tests were executed as part of this change.

Codex Task

@github-actions
Copy link

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • Tests: 171 total, 0 failed, 2 skipped

Benchmark Results

  • Execution Time: 9690 ms

  • Hotspots (Top 20 sampled methods):

    • 22.78% java.lang.String.indexOf (384 samples)
    • 18.03% com.codename1.tools.translator.Parser.isMethodUsed (304 samples)
    • 16.37% com.codename1.tools.translator.Parser.addToConstantPool (276 samples)
    • 6.41% java.util.ArrayList.indexOf (108 samples)
    • 4.98% java.lang.Object.hashCode (84 samples)
    • 3.44% com.codename1.tools.translator.ByteCodeClass.calcUsedByNative (58 samples)
    • 2.91% com.codename1.tools.translator.BytecodeMethod.optimize (49 samples)
    • 2.85% java.lang.System.identityHashCode (48 samples)
    • 2.31% com.codename1.tools.translator.ByteCodeClass.fillVirtualMethodTable (39 samples)
    • 1.25% com.codename1.tools.translator.Parser.cullMethods (21 samples)
    • 1.01% com.codename1.tools.translator.Parser.generateClassAndMethodIndexHeader (17 samples)
    • 0.95% com.codename1.tools.translator.BytecodeMethod.equals (16 samples)
    • 0.83% java.io.FileOutputStream.writeBytes (14 samples)
    • 0.83% java.lang.StringBuilder.append (14 samples)
    • 0.65% java.io.UnixFileSystem.getBooleanAttributes0 (11 samples)
    • 0.65% com.codename1.tools.translator.BytecodeMethod.isMethodUsedByNative (11 samples)
    • 0.59% java.util.TreeMap.getEntry (10 samples)
    • 0.59% java.util.ArrayList$Itr.hasNext (10 samples)
    • 0.53% java.io.FileOutputStream.open0 (9 samples)
    • 0.53% com.codename1.tools.translator.Parser.getClassByName (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 18, 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: 412 seconds
  • Compilation Time: 150 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 40824 ms
Extract Extensions 21 ms
Google Services Setup 2 ms
Scan Classes 665 ms
Extract Libs 1201 ms
Inject Build Hints 777 ms
Generate Unit Tests 13 ms
Generate Stubs 1636 ms
Compile Stubs 2917 ms
Generate Icons 1318 ms
Prepare ParparVM 288 ms
ParparVM Execution 238276 ms
Post-VM Setup 164 ms
CocoaPods 7985 ms
Finalize 62 ms
Total Time 296151 msMaven Overhead : 116000 ms
CocoaPods Install (Script) 1000 ms
Simulator Boot (Run) 87000 ms
App Install 17000 ms
App Launch 18000 ms
Test Execution 186000 ms

@shai-almog shai-almog merged commit aad7609 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