Add default argument kIsInstrumented=true.
kIsInstrumented=false is reserved for use by specialized
entrypoints which are used only when we can ensure that
the code is not instrumented. So add the default argument
to simplify all other callers.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I3419795794fec9a1733ab3ad698b6415dbac679d
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index d84225e..4e08e8c 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -1799,7 +1799,7 @@
}
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 247fbb7..1a88f1b 100644
--- a/runtime/interpreter/interpreter_switch_impl-inl.h
+++ b/runtime/interpreter/interpreter_switch_impl-inl.h
@@ -797,14 +797,11 @@
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 @@
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 d4a1926..80ebf21 100644
--- a/runtime/interpreter/mterp/mterp.cc
+++ b/runtime/interpreter/mterp/mterp.cc
@@ -457,11 +457,9 @@
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 @@
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 9b905ee..727cf2f 100644
--- a/runtime/interpreter/unstarted_runtime.cc
+++ b/runtime/interpreter/unstarted_runtime.cc
@@ -1358,7 +1358,8 @@
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 @@
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 @@
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 @@
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(