summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2018-10-15 14:24:21 +0100
committerVladimir Marko <vmarko@google.com>2018-10-16 10:47:24 +0100
commitb546163926889130354ccdbcccb80c0331c13f3c (patch)
treeb4a3fb30e11e2abc671fb0b4b8098acd8fc49ce2 /compiler/optimizing/code_generator.cc
parent8db807252e1d4d0bab7785be231e20a1e5fd8e74 (diff)
Fix HNewArray with unresolved primitive array type.
And enable test 920-objects that was crashing because of this bug. Test: testrunner.py --host --jit-on-first-use -t 920 Test: testrunner.py --host --optimizing Test: m test-art-host-gtest Bug: 117638896 Change-Id: I47dc893b121c82de537b3147c86d37a6eecf2d62
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r--compiler/optimizing/code_generator.cc19
1 files changed, 6 insertions, 13 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc
index d440cf3e4c..d8e442c642 100644
--- a/compiler/optimizing/code_generator.cc
+++ b/compiler/optimizing/code_generator.cc
@@ -1653,19 +1653,12 @@ void CodeGenerator::EmitJitRoots(uint8_t* code,
EmitJitRootPatches(code, roots_data);
}
-QuickEntrypointEnum CodeGenerator::GetArrayAllocationEntrypoint(Handle<mirror::Class> array_klass) {
- ScopedObjectAccess soa(Thread::Current());
- if (array_klass == nullptr) {
- // This can only happen for non-primitive arrays, as primitive arrays can always
- // be resolved.
- return kQuickAllocArrayResolved32;
- }
-
- switch (array_klass->GetComponentSize()) {
- case 1: return kQuickAllocArrayResolved8;
- case 2: return kQuickAllocArrayResolved16;
- case 4: return kQuickAllocArrayResolved32;
- case 8: return kQuickAllocArrayResolved64;
+QuickEntrypointEnum CodeGenerator::GetArrayAllocationEntrypoint(HNewArray* new_array) {
+ switch (new_array->GetComponentSizeShift()) {
+ case 0: return kQuickAllocArrayResolved8;
+ case 1: return kQuickAllocArrayResolved16;
+ case 2: return kQuickAllocArrayResolved32;
+ case 3: return kQuickAllocArrayResolved64;
}
LOG(FATAL) << "Unreachable";
return kQuickAllocArrayResolved;