diff options
Diffstat (limited to 'runtime/interpreter')
-rw-r--r-- | runtime/interpreter/interpreter_common.cc | 2 | ||||
-rw-r--r-- | runtime/interpreter/interpreter_switch_impl-inl.h | 11 | ||||
-rw-r--r-- | runtime/interpreter/mterp/mterp.cc | 8 | ||||
-rw-r--r-- | runtime/interpreter/unstarted_runtime.cc | 16 |
4 files changed, 15 insertions, 22 deletions
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc index d84225e998..4e08e8c85b 100644 --- a/runtime/interpreter/interpreter_common.cc +++ b/runtime/interpreter/interpreter_common.cc @@ -1799,7 +1799,7 @@ bool DoFilledNewArray(const Instruction* inst, } return false; } - ObjPtr<mirror::Object> new_array = mirror::Array::Alloc<true>( + ObjPtr<mirror::Object> new_array = mirror::Array::Alloc( self, array_class, length, diff --git a/runtime/interpreter/interpreter_switch_impl-inl.h b/runtime/interpreter/interpreter_switch_impl-inl.h index 247fbb7f2f..1a88f1b47d 100644 --- a/runtime/interpreter/interpreter_switch_impl-inl.h +++ b/runtime/interpreter/interpreter_switch_impl-inl.h @@ -797,14 +797,11 @@ class InstructionHandler { false, do_access_check); if (LIKELY(c != nullptr)) { + gc::AllocatorType allocator_type = Runtime::Current()->GetHeap()->GetCurrentAllocator(); if (UNLIKELY(c->IsStringClass())) { - gc::AllocatorType allocator_type = Runtime::Current()->GetHeap()->GetCurrentAllocator(); - obj = mirror::String::AllocEmptyString<true>(self, allocator_type); + obj = mirror::String::AllocEmptyString(self, allocator_type); } else { - obj = AllocObjectFromCode<true>( - c.Ptr(), - self, - Runtime::Current()->GetHeap()->GetCurrentAllocator()); + obj = AllocObjectFromCode(c, self, allocator_type); } } if (UNLIKELY(obj == nullptr)) { @@ -825,7 +822,7 @@ class InstructionHandler { ALWAYS_INLINE void NEW_ARRAY() REQUIRES_SHARED(Locks::mutator_lock_) { int32_t length = shadow_frame.GetVReg(inst->VRegB_22c(inst_data)); - ObjPtr<mirror::Object> obj = AllocArrayFromCode<do_access_check, true>( + ObjPtr<mirror::Object> obj = AllocArrayFromCode<do_access_check>( dex::TypeIndex(inst->VRegC_22c()), length, shadow_frame.GetMethod(), diff --git a/runtime/interpreter/mterp/mterp.cc b/runtime/interpreter/mterp/mterp.cc index d4a192679c..80ebf21b40 100644 --- a/runtime/interpreter/mterp/mterp.cc +++ b/runtime/interpreter/mterp/mterp.cc @@ -457,11 +457,9 @@ extern "C" size_t MterpNewInstance(ShadowFrame* shadow_frame, Thread* self, uint if (LIKELY(c != nullptr)) { if (UNLIKELY(c->IsStringClass())) { gc::AllocatorType allocator_type = Runtime::Current()->GetHeap()->GetCurrentAllocator(); - obj = mirror::String::AllocEmptyString<true>(self, allocator_type); + obj = mirror::String::AllocEmptyString(self, allocator_type); } else { - obj = AllocObjectFromCode<true>(c, - self, - Runtime::Current()->GetHeap()->GetCurrentAllocator()); + obj = AllocObjectFromCode(c, self, Runtime::Current()->GetHeap()->GetCurrentAllocator()); } } if (UNLIKELY(obj == nullptr)) { @@ -523,7 +521,7 @@ extern "C" size_t MterpNewArray(ShadowFrame* shadow_frame, REQUIRES_SHARED(Locks::mutator_lock_) { const Instruction* inst = Instruction::At(dex_pc_ptr); int32_t length = shadow_frame->GetVReg(inst->VRegB_22c(inst_data)); - ObjPtr<mirror::Object> obj = AllocArrayFromCode<false, true>( + ObjPtr<mirror::Object> obj = AllocArrayFromCode</*kAccessCheck=*/ false>( dex::TypeIndex(inst->VRegC_22c()), length, shadow_frame->GetMethod(), self, Runtime::Current()->GetHeap()->GetCurrentAllocator()); if (UNLIKELY(obj == nullptr)) { diff --git a/runtime/interpreter/unstarted_runtime.cc b/runtime/interpreter/unstarted_runtime.cc index 9b905eeaed..727cf2f2e8 100644 --- a/runtime/interpreter/unstarted_runtime.cc +++ b/runtime/interpreter/unstarted_runtime.cc @@ -1358,7 +1358,8 @@ void UnstartedRuntime::UnstartedStringFactoryNewStringFromChars( hs.NewHandle(shadow_frame->GetVRegReference(arg_offset + 2)->AsCharArray())); Runtime* runtime = Runtime::Current(); gc::AllocatorType allocator = runtime->GetHeap()->GetCurrentAllocator(); - result->SetL(mirror::String::AllocFromCharArray<true>(self, char_count, h_char_array, offset, allocator)); + result->SetL( + mirror::String::AllocFromCharArray(self, char_count, h_char_array, offset, allocator)); } // This allows creating the new style of String objects during compilation. @@ -1373,8 +1374,8 @@ void UnstartedRuntime::UnstartedStringFactoryNewStringFromString( Handle<mirror::String> h_string(hs.NewHandle(to_copy)); Runtime* runtime = Runtime::Current(); gc::AllocatorType allocator = runtime->GetHeap()->GetCurrentAllocator(); - result->SetL(mirror::String::AllocFromString<true>(self, h_string->GetLength(), h_string, 0, - allocator)); + result->SetL( + mirror::String::AllocFromString(self, h_string->GetLength(), h_string, 0, allocator)); } void UnstartedRuntime::UnstartedStringFastSubstring( @@ -1390,7 +1391,7 @@ void UnstartedRuntime::UnstartedStringFastSubstring( DCHECK_LE(start + length, h_string->GetLength()); Runtime* runtime = Runtime::Current(); gc::AllocatorType allocator = runtime->GetHeap()->GetCurrentAllocator(); - result->SetL(mirror::String::AllocFromString<true>(self, length, h_string, start, allocator)); + result->SetL(mirror::String::AllocFromString(self, length, h_string, start, allocator)); } // This allows getting the char array for new style of String objects during compilation. @@ -1720,11 +1721,8 @@ void UnstartedRuntime::UnstartedJNIVMRuntimeNewUnpaddedArray( runtime->GetClassLinker()->FindArrayClass(self, element_class->AsClass()); DCHECK(array_class != nullptr); gc::AllocatorType allocator = runtime->GetHeap()->GetCurrentAllocator(); - result->SetL(mirror::Array::Alloc<true, true>(self, - array_class, - length, - array_class->GetComponentSizeShift(), - allocator)); + result->SetL(mirror::Array::Alloc</*kIsInstrumented=*/ true, /*kFillUsable=*/ true>( + self, array_class, length, array_class->GetComponentSizeShift(), allocator)); } void UnstartedRuntime::UnstartedJNIVMStackGetCallingClassLoader( |