Skip to content

Document Virtual Methods Dispatch - Value 5 #76

@LSantha

Description

@LSantha

Virtual Methods Dispatch

Document the Virtual Methods Dispatch JNode concept in the wiki.

Value: 5

Concept Summary

Method dispatch system for virtual, interface, and static methods. Virtual Methods Dispatch provides the infrastructure for method call handling, including vtable, IMT, and CompiledIMT mechanisms for efficient method resolution.

Key Files

  • core/src/core/org/jnode/vm/classmgr/VirtualMethods.java
  • core/src/core/org/jnode/vm/classmgr/vtable.java

Occurrences

~300 references in virtual methods package

Wiki Status

Partially covered (Virtual-Methods.md)

Bridges

Virtual methods, JIT compiler, Method dispatch

Instructions

Skill to Use

Use the [[update-wiki|update-wiki skill]] (load with skill({ name: "update-wiki" })) for understanding JNode internals.

Context Research

Study VirtualMethods.java and vtable.java to understand method dispatch. Review how vtables, IMTs, and CompiledIMTs work and how they enable efficient method resolution. Research how the JIT compiler uses dispatch tables forInlining and optimization.

Update index.md

  • Pages table: Add entry for Virtual-Methods.md
  • Concepts → Pages table: Add "Virtual Methods Dispatch" mapping to [[Virtual-Methods]]
  • Source Path → Pages table: Add mappings for core/src/core/org/jnode/vm/classmgr/
  • Task Routing table: Add relevant task route(s)

Task Routing Suggestions

  1. Method dispatch debugging: Understanding dispatch is key for method issues
  2. JIT optimization: Dispatch affects inlining and optimization decisions
  3. Interface call performance: IMT provides efficient interface dispatch

Wiki Page Structure

# Virtual Methods Dispatch

> Method dispatch system for virtual, interface, and static methods.

## Overview
2-3 paragraph explanation of Virtual Methods Dispatch, how method calls are resolved, and how dispatch tables enable efficient invoke virtual/interface/static.

## Key Components
| Class / File | Role |
|---|---|
| `core/src/core/org/jnode/vm/classmgr/VirtualMethods.java` | Virtual method dispatch |
| `core/src/core/org/jnode/vm/classmgr/vtable.java` | vtable implementation |

## How It Works
Explanation of how virtual method dispatch works, how vtables are built, how IMT enables interface dispatch, and how dispatch is optimized by the JIT.

## Gotchas & Non-Obvious Behavior
- Dispatch table structure affects performance
- Interface dispatch can be optimized with CompiledIMT
- Inlining decisions depend on dispatch characteristics

## Related Pages
- [[vtable]]
- [[IMT]]
- [[CompiledIMT]]

Related Concepts: Virtual methods, vtable, IMT, CompiledIMT, Method dispatch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions