diff options
| author | 2016-08-22 22:55:18 +0000 | |
|---|---|---|
| committer | 2016-08-22 22:55:18 +0000 | |
| commit | b070ebb9ac9fddbcd57e7050418125d0901f3a0c (patch) | |
| tree | 896a8dc9840fd6aa11babd6b8bbe4bd526428864 | |
| parent | 27c0eb9e6cf8e8e88a6a98ab54d47e312fde7196 (diff) | |
| parent | fcd81d9dbcca488b205dc3427f0995de99d7e1d3 (diff) | |
Merge "ART: String DexCache asm fast path for ARM"
am: fcd81d9dbc
Change-Id: Iee42c72bc6718f97bf2024104b7d1f772970f681
| -rw-r--r-- | runtime/arch/arm/quick_entrypoints_arm.S | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/runtime/arch/arm/quick_entrypoints_arm.S b/runtime/arch/arm/quick_entrypoints_arm.S index 11357b5596..881bebe002 100644 --- a/runtime/arch/arm/quick_entrypoints_arm.S +++ b/runtime/arch/arm/quick_entrypoints_arm.S @@ -1030,11 +1030,37 @@ ENTRY art_quick_set64_instance END art_quick_set64_instance /* - * Entry from managed code to resolve a string, this stub will allocate a String and deliver an - * exception on error. On success the String is returned. R0 holds the string index. The fast - * path check for hit in strings cache has already been performed. + * Entry from managed code to resolve a string, this stub will + * check the dex cache for a matching string (the fast path), and if not found, + * it will allocate a String and deliver an exception on error. + * On success the String is returned. R0 holds the string index. */ -ONE_ARG_DOWNCALL art_quick_resolve_string, artResolveStringFromCode, RETURN_IF_RESULT_IS_NON_ZERO_OR_DELIVER + +ENTRY art_quick_resolve_string + ldr r1, [sp] @ load referrer + ldr r1, [r1, #ART_METHOD_DECLARING_CLASS_OFFSET] @ load declaring class + ldr r1, [r1, #DECLARING_CLASS_DEX_CACHE_STRINGS_OFFSET] @ load string dex cache + ubfx r2, r0, #0, #STRING_DEX_CACHE_HASH_BITS + add r1, r1, r2, LSL #STRING_DEX_CACHE_ELEMENT_SIZE_SHIFT + ldrd r2, r3, [r1] @ load index into r3 and pointer into r2 + cmp r0, r3 + bne .Lart_quick_resolve_string_slow_path +#ifdef USE_READ_BARRIER + ldr r3, [r2, MIRROR_OBJECT_LOCK_WORD_OFFSET] + tst r3, #LOCK_WORD_MARK_BIT_MASK_SHIFTED + beq .Lart_quick_resolve_string_slow_path +#endif + mov r0, r2 + bx lr + +.Lart_quick_resolve_string_slow_path: + SETUP_SAVE_REFS_ONLY_FRAME r2 @ save callee saves in case of GC + mov r1, r9 @ pass Thread::Current + mov r3, sp + bl artResolveStringFromCode @ (uint32_t type_idx, Method* method, Thread*) + RESTORE_SAVE_REFS_ONLY_FRAME + RETURN_IF_RESULT_IS_NON_ZERO_OR_DELIVER +END art_quick_resolve_string // Generate the allocation entrypoints for each allocator. GENERATE_ALLOC_ENTRYPOINTS_FOR_EACH_ALLOCATOR |