Merge: Attributes access in nitvm
authorJean Privat <jean@pryen.org>
Sat, 29 Nov 2014 00:59:23 +0000 (19:59 -0500)
committerJean Privat <jean@pryen.org>
Sun, 30 Nov 2014 01:35:32 +0000 (20:35 -0500)
commit29827ae90993e6be78fd3983755ce1c0d2f9860e
tree1bfaa114847d2755def907c9911cd3858b4765af
parent6a4d8aef793c55f0c9e37a81dfb208dbb08d0cdd
parent1864f47d038922397651049ba709c6ab9a4b7827
Merge: Attributes access in nitvm

Accessing attributes in the nitvm is now implemented by a faster mechanism than perfect hashing.

Attribute access is now implemented by two different techniques:
- perfect hashing, slow but multiple-inheritance compatible
- direct access, fast but only compatible with single inheritance

For a given access to an attribute, we try to use direct access if possible, i.e. if this attribute is always at the same position in objects.
If this attribute has multiple position in objects, we need to use perfect hashing.

Non-contractual perfs: the nitvm is now a little faster than before and these two different implementations will allow to work on optimization protocols in the futur.

Pull-Request: #943
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
src/vm.nit