Execute a method dispatch with direct access and return the appropriate MMethodDef

  • vtable Pointer to the internal virtual table of the class
  • absolute_offset Absolute offset from the beginning of the virtual table

Property definitions

nitc $ VirtualMachine :: method_dispatch_sst
	# Execute a method dispatch with direct access and return the appropriate `MMethodDef`
	# * `vtable` Pointer to the internal virtual table of the class
	# * `absolute_offset` Absolute offset from the beginning of the virtual table
	fun method_dispatch_sst(vtable: Pointer, absolute_offset: Int): MMethodDef `{
		// pointer+2 is the position where methods are
		// Add the offset of property and get the method implementation
		MMethodDef propdef = (MMethodDef)((long int *)vtable)[absolute_offset];

		return propdef;
	`}
src/vm/virtual_machine.nit:275,2--284,3