Return the attribute value in instance with a direct access (SST)

  • instance is the attributes array of the receiver
  • offset is the absolute offset of this attribute

Property definitions

nitc $ VirtualMachine :: read_attribute_sst
	# Return the attribute value in `instance` with a direct access (SST)
	# * `instance` is the attributes array of the receiver
	# * `offset` is the absolute offset of this attribute
	fun read_attribute_sst(instance: Pointer, offset: Int): Instance `{
		/* We can make a direct access to the attribute value
		   because this attribute is always at the same position
		   for the class of this receiver */
		Instance res = ((Instance *)instance)[offset];

		return res;
	`}
src/vm/virtual_machine.nit:332,2--342,3