diff options
author | 2016-10-17 15:46:31 -0700 | |
---|---|---|
committer | 2016-10-17 16:16:50 -0700 | |
commit | bc5a795c0d486c84913d987cad5846ded840cea6 (patch) | |
tree | 90db29a97a21fa15f4cbc5ffbc1f6dd191add49c /runtime/native/java_lang_String.cc | |
parent | 38a4223fcc0493553d9ad324a1dc145869eb663a (diff) |
Move art/native to ObjPtr
Bug: 31113334
Test: test-art-host
Change-Id: I67eb89cf042c762c6dcd5eb8b008b9a28e9b3319
Diffstat (limited to 'runtime/native/java_lang_String.cc')
-rw-r--r-- | runtime/native/java_lang_String.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/native/java_lang_String.cc b/runtime/native/java_lang_String.cc index 5a49c203af..ea266d131d 100644 --- a/runtime/native/java_lang_String.cc +++ b/runtime/native/java_lang_String.cc @@ -57,7 +57,8 @@ static jstring String_concat(JNIEnv* env, jobject java_this, jobject java_string int32_t length_this = string_this->GetLength(); int32_t length_arg = string_arg->GetLength(); if (length_arg > 0 && length_this > 0) { - mirror::String* result = mirror::String::AllocFromStrings(soa.Self(), string_this, string_arg); + ObjPtr<mirror::String> result = + mirror::String::AllocFromStrings(soa.Self(), string_this, string_arg); return soa.AddLocalReference<jstring>(result); } jobject string_original = (length_this == 0) ? java_string_arg : java_this; @@ -76,8 +77,11 @@ static jstring String_fastSubstring(JNIEnv* env, jobject java_this, jint start, StackHandleScope<1> hs(soa.Self()); Handle<mirror::String> string_this(hs.NewHandle(soa.Decode<mirror::String>(java_this))); gc::AllocatorType allocator_type = Runtime::Current()->GetHeap()->GetCurrentAllocator(); - mirror::String* result = mirror::String::AllocFromString<true>(soa.Self(), length, string_this, - start, allocator_type); + ObjPtr<mirror::String> result = mirror::String::AllocFromString<true>(soa.Self(), + length, + string_this, + start, + allocator_type); return soa.AddLocalReference<jstring>(result); } |