Skip to content

test(Clava-JS): cover the per-class join point wrap cache - #272

Open
lm-sousa wants to merge 1 commit into
dir-fixesfrom
t3/optimize-joinpoint-wrap
Open

lm-sousa wants to merge 1 commit into
dir-fixesfrom
t3/optimize-joinpoint-wrap

Conversation

@lm-sousa

@lm-sousa lm-sousa commented Nov 1, 2026

Copy link
Copy Markdown
Member

specs-feup/lara-framework#121 makes wrapJoinPoint cache its per-object classification by Java class, which makes it about 300x faster and the Clava-JS suite about 23% faster. It also returns non-join-point Java objects as-is instead of throwing. Clava has the real join point classes, so the cache is tested here.

The new WrapJoinPoint.test.ts:

  • Wraps every join point and reachable type of a varied C++ AST (316 join points, 54 Java classes), first with an empty cache and then with a full one. Each result is compared with a per-object mapper lookup, which is what the old code did.
  • Checks the assumption the cache depends on: each Java class has one join point type.
  • Checks that object and function mappers registered after the cache is filled take effect, and that a missing-mapper error is not cached.
  • Checks that $file.file, getKeyType and getValue("location") return Java objects as-is, where they used to throw. getValue still converts lists and join points.

Assertions compare classes, never join points. When vitest prints a join point in a failure message it runs the getters through node-java, which can abort the test worker.

Needs specs-feup/lara-framework#121 (same branch name, resolved by CI). Stacked on #266.


Changes made by Claude Opus 5.5 (claude-opus-5-5) via Claude Code.

Wraps every join point and reachable type of a varied C++ AST with a
cold and a warm cache and compares each result with a per-instance
mapper lookup. Also checks that each Java class has one join point
type, that mappers registered after the cache is warm take effect,
that a missing mapper error is not cached, and that other Java values
(File, Class, SourceRange) are returned as-is.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T03:13:39.433166Z cb3ff54 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lm-sousa
lm-sousa added this pull request to stack #256 November 1, 2026 03:13
@sonarqubecloud

sonarqubecloud Bot commented Nov 1, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant