Skip to content

Conversation

@shai-almog
Copy link
Collaborator

Summary

  • register BytecodeMethod instances with the dependency graph only after descriptor parsing completes
  • guard BytecodeMethod equality and hashing against null inputs and uninitialized return types to prevent constructor-time errors

Testing

  • mvn -pl ByteCodeTranslator -am install -DskipTests
  • mvn -pl tests -Dtest=HeavyLoadBenchmarkTest test (fails: JavaAPI.jar not found at vm/tests/vm/JavaAPI/dist/JavaAPI.jar)

Codex Task

@github-actions
Copy link

github-actions bot commented Dec 18, 2025

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • Tests: 103 total, 0 failed, 0 skipped

Benchmark Results

  • Execution Time: 8808 ms

  • Hotspots (Top 20 sampled methods):

    • 25.75% java.lang.String.indexOf (393 samples)
    • 19.20% com.codename1.tools.translator.Parser.isMethodUsed (293 samples)
    • 10.62% java.util.ArrayList.indexOf (162 samples)
    • 5.50% java.lang.Object.hashCode (84 samples)
    • 4.72% com.codename1.tools.translator.ByteCodeClass.markDependent (72 samples)
    • 3.80% com.codename1.tools.translator.BytecodeMethod.addToConstantPool (58 samples)
    • 3.54% com.codename1.tools.translator.ByteCodeClass.calcUsedByNative (54 samples)
    • 2.95% java.lang.System.identityHashCode (45 samples)
    • 2.10% com.codename1.tools.translator.Parser.addToConstantPool (32 samples)
    • 1.97% com.codename1.tools.translator.Parser.generateClassAndMethodIndexHeader (30 samples)
    • 1.83% com.codename1.tools.translator.BytecodeMethod.optimize (28 samples)
    • 1.38% com.codename1.tools.translator.BytecodeMethod.equals (21 samples)
    • 1.38% java.lang.StringBuilder.append (21 samples)
    • 1.18% com.codename1.tools.translator.Parser.cullMethods (18 samples)
    • 0.92% com.codename1.tools.translator.BytecodeMethod.appendMethodC (14 samples)
    • 0.66% java.io.FileInputStream.open0 (10 samples)
    • 0.59% java.util.TreeMap.getEntry (9 samples)
    • 0.59% java.io.FileOutputStream.open0 (9 samples)
    • 0.52% java.io.FileOutputStream.writeBytes (8 samples)
    • 0.52% java.lang.StringCoding$StringEncoder.encode (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

github-actions bot commented Dec 18, 2025

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 38 to 41
public class MethodDependencyGraph {
private final Map<String, Set<BytecodeMethod>> callersByLookupSignature = new HashMap<String, Set<BytecodeMethod>>();
private final Map<BytecodeMethod, Set<String>> methodToCalls = new HashMap<BytecodeMethod, Set<String>>();
private final Map<String, Set<BytecodeMethod>> methodsByClass = new HashMap<String, Set<BytecodeMethod>>();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep dependency graph keys class-qualified

MethodDependencyGraph stores caller edges in a HashMap keyed by BytecodeMethod (MethodDependencyGraph.java:40), but BytecodeMethod.equals/hashCode (BytecodeMethod.java:981‑1023) purposely ignore the declaring class. Two methods in different classes with the same name/descriptor therefore collapse to the same key: the second registration overwrites the first, and removeMethod/removeClass will strip call edges for both. When getCallers() is then used to drive elimination, live methods can be treated as unused because their remaining callers were dropped. The graph needs class-qualified keys or identity-based keys to keep per-class methods distinct.

Useful? React with 👍 / 👎.

@shai-almog
Copy link
Collaborator Author

shai-almog commented Dec 18, 2025

iOS screenshot updates

Compared 30 screenshots: 24 matched, 5 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-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: 319 seconds
  • Compilation Time: 65 seconds

@shai-almog shai-almog merged commit d33315b into master Dec 19, 2025
9 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