nitc :: MClass :: calculate_delta
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)
# 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