Computes delta for each class

A delta represents the offset for this group of attributes in the object *nb_attributes : number of attributes for each class (classes are linearized from Object to current)

  • return deltas for each class

Property definitions

nitc :: virtual_machine $ MClass :: calculate_delta
	# Computes delta for each class
	# A delta represents the offset for this group of attributes in the object
	# *`nb_attributes` : number of attributes for each class (classes are linearized from Object to current)
	# * return deltas for each class
	private fun calculate_delta(nb_attributes: Array[Int]): Array[Int]
	do
		var deltas = new Array[Int]

		var total = 0
		for nb in nb_attributes do
			deltas.push(total)
			total += nb
		end

		return deltas
	end
src/vm/virtual_machine.nit:643,2--658,4