Skip to content

Minimum viable virtual methods #459

Description

@vgrichina

My understanding is that it's possible to implement virtual methods in AssemblyScript before GC/reftypes land in WASM:

  • Make compiler emit vtables for classes not marked as @unmanaged
  • Make __memory_allocate take another optional parameter (vtable pointer). This can be stored before returned memory address, so that code expecting same object field offsets as now doesn't break.
  • Use call_indirect for method calls (looking up function index in vtable)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions