class_linker: Change allocation of MethodType dex_cache entries.

We allocate them regardless of the value of the runtime flag to
avoid needing changes to the compiler etc. The memory hit can be
mitigated in production systems that don't use MethodHandles by
setting kDexCacheMethodTypeCacheSize to 0.

Also, add DCHECKS in the interpreter to make sure the runtime
never executes an invoke-polymorphic instruction when method handles
are disabled.

Test: make test-art-host
Bug: 30550796
Change-Id: Id4b2065d99dc13625a51037b7d1a9f0ac5ff6121
3 files changed