diff options
| author | 2018-10-16 07:44:40 -0700 | |
|---|---|---|
| committer | 2018-10-16 07:44:40 -0700 | |
| commit | bd9a7f2ec93f1621e281cd086e09a9292336f478 (patch) | |
| tree | e3e7bf9fdcc3676e256397a33825d6f67095c7e7 /compiler/optimizing/code_generator.cc | |
| parent | 6c5ba7923c8b8333fc9a0a8ec3ef44d6d55c26ee (diff) | |
| parent | 8677e4bd3a091588c3b8058439f7022edab57f6e (diff) | |
Merge "Fix HNewArray with unresolved primitive array type."
am: 8677e4bd3a
Change-Id: I51b0b7e5ae518585899eae03045f44dc45a45aef
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
| -rw-r--r-- | compiler/optimizing/code_generator.cc | 19 |
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; |