Skip to content

[100%] Phase 2: VarHandle accessor generator #4185

@evanchooly

Description

@evanchooly

Parent: #4179
Blocked by: #4184

Goal

Create a Gizmo-based generator that produces PropertyAccessor implementations using VarHandle instead of synthetic __read/__write methods. This enables runtime code generation without modifying entity class bytecode.

Details

See Phase 2 in planning doc

Tasks

  • Create VarHandleAccessorGenerator (Gizmo-based, generates VarHandle field accessors)
  • Support method-based properties via MethodHandle for getter/setter
  • Handle primitive boxing/unboxing in the Object bridge methods
  • Update PropertyFinder with runtimeMode parameter (skip entity modification, use VarHandle path)
  • Update CritterGizmoGenerator with optional runtime mode
  • Write tests covering String, int, long, boolean, List, and other field types

Progress Tracking

phase_percentage = (completed_tasks / 6) * 100, rounded to nearest integer
gh issue edit 4185 --repo MorphiaOrg/morphia --title "[XX%] Phase 2: VarHandle accessor generator"

parent_percentage = (total_completed_tasks_across_all_phases / 53) * 100, rounded to nearest integer
gh issue edit 4179 --repo MorphiaOrg/morphia --title "[XX%] Integrate critter-core into morphia-core"

When all tasks are complete (100%), close this issue and check its box in #4179.

Metadata

Metadata

Assignees

No one assigned

    Labels

    critterCritter bytecode generation integrationenhancement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions