[interp] Optimize multidimensional array access (mono/mono#16822)
authorVlad Brezae <brezaevlad@gmail.com>
Tue, 17 Sep 2019 07:32:20 +0000 (10:32 +0300)
committerGitHub <noreply@github.com>
Tue, 17 Sep 2019 07:32:20 +0000 (10:32 +0300)
commit230395b64f1886ed496fb48617d2cfea4364930f
treeea58e3c5dcaa099237694ce23d18d9428a2ca79e
parent3dbae3e90dd4a4c5be9e558a3c398c4cb8ad22e7
[interp] Optimize multidimensional array access (mono/mono#16822)

* [interp] Pass rank instead to LDELEMA

It feels more intuitive and uses less computations.

* [interp] Avoid unnecessary type check

Loading element address of array requires type checks only if the elements of the array are references.

* [interp] Avoid using MINT_CALLRUN for Get intrinsic

It is very slow. Use ldelema/ldobj pair instead.

* [interp] Optimize MINT_LDELEMA

* [interp] Rename ldelema_fast to ldelema1

ldelema_fast was handling arrays with a single dimension. Rename it to better suggest this.

* [interp] Avoid using MINT_CALLRUN for Set intrinsic

* [interp] Remove some duplicated and confusing code

* [interp] Fix stack type of MINT_NEWARR result

Commit migrated from https://github.com/mono/mono/commit/aaaa2bdd5e5795dfba689cde110999a9a9225fb2
src/mono/mono/mini/interp/interp.c
src/mono/mono/mini/interp/mintops.def
src/mono/mono/mini/interp/transform.c