Skip to content

JIT: support field access for codon jitclass(4/4)#817

Open
LeeLee26 wants to merge 4 commits into
exaloop:developfrom
LeeLee26:user/leelee/support-for-jitclass4
Open

JIT: support field access for codon jitclass(4/4)#817
LeeLee26 wants to merge 4 commits into
exaloop:developfrom
LeeLee26:user/leelee/support-for-jitclass4

Conversation

@LeeLee26
Copy link
Copy Markdown

@LeeLee26 LeeLee26 commented May 22, 2026

Description: This PR implements the Field access part mentioned in RFC: Native-backed Python Classes for Codon JIT via codon.jitclass.

Details: Field access is implemented through generated getter and setter methods instead of direct memory access. During class rewriting, each annotated field gets a pair of native methods:

_codon_jitclass_get_<field>()
_codon_jitclass_set_<field>(value)

Python attribute reads and writes are handled by JITField descriptors and lowered into calls to these generated methods. This lets field access reuse the same method-dispatch pipeline, wrapper cache, Python/Codon conversion logic, and safety checks as ordinary method calls.

PR Stack:

  1. JIT: add JITCallable to wrap JIT callable functions(1/4) #813
  2. JIT: add jitclass for native codon jit class(2/4) #816
  3. JIT: add stale jit context detection(3/4) #814
  4. JIT: support field access for codon jitclass(4/4) #817

@cla-bot cla-bot Bot added the cla-signed label May 22, 2026
@LeeLee26 LeeLee26 changed the title JIT: support field access for codon jitclass JIT: support field access for codon jitclass(4/4) May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant