diff options
| author | 2016-08-22 21:38:58 +0000 | |
|---|---|---|
| committer | 2016-08-22 21:38:58 +0000 | |
| commit | a8ed36609ac69bb74fa2c229bc56be4eb5a521ca (patch) | |
| tree | 08c125b77c0eb3ae5cecd0841b786def3d5f476e | |
| parent | 0b10387ced51d8ac1495fabe646c570fb1c378a4 (diff) | |
| parent | 03f5a35ec65f9d4c2c404d67d9c46be7cb978c43 (diff) | |
Merge "ART: String DexCache asm fast path for x86_64"
| -rw-r--r-- | runtime/arch/x86_64/quick_entrypoints_x86_64.S | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/runtime/arch/x86_64/quick_entrypoints_x86_64.S b/runtime/arch/x86_64/quick_entrypoints_x86_64.S index 32768b0263..3266d86595 100644 --- a/runtime/arch/x86_64/quick_entrypoints_x86_64.S +++ b/runtime/arch/x86_64/quick_entrypoints_x86_64.S @@ -1330,7 +1330,38 @@ DEFINE_FUNCTION art_quick_alloc_object_initialized_region_tlab ALLOC_OBJECT_TLAB_SLOW_PATH artAllocObjectFromCodeInitializedRegionTLAB END_FUNCTION art_quick_alloc_object_initialized_region_tlab -ONE_ARG_DOWNCALL art_quick_resolve_string, artResolveStringFromCode, RETURN_IF_RESULT_IS_NON_ZERO_OR_DELIVER +DEFINE_FUNCTION art_quick_resolve_string + movq 8(%rsp), %rcx // get referrer + movl ART_METHOD_DECLARING_CLASS_OFFSET(%rcx), %ecx // get declaring class + movq DECLARING_CLASS_DEX_CACHE_STRINGS_OFFSET(%ecx), %rcx // get string dex cache + movq LITERAL(STRING_DEX_CACHE_SIZE_MINUS_ONE), %rdx + andq %rdi, %rdx + shlq LITERAL(STRING_DEX_CACHE_ELEMENT_SIZE_SHIFT), %rdx + addq %rcx, %rdx + movq %rax, %rcx + movq (%rdx), %rdx + movq %rdx, %rax + movl %eax, %eax + shrq LITERAL(32), %rdx + cmp %rdx, %rdi + jne .Lart_quick_resolve_string_slow_path +#ifdef USE_READ_BARRIER + testl LITERAL(LOCK_WORD_MARK_BIT_MASK_SHIFTED), MIRROR_OBJECT_LOCK_WORD_OFFSET(%rax) + jz .Lart_quick_resolve_string_slow_path +#endif + ret + +.Lart_quick_resolve_string_slow_path: + SETUP_SAVE_REFS_ONLY_FRAME + movq %rcx, %rax + // Outgoing argument set up + movq %gs:THREAD_SELF_OFFSET, %rsi // pass Thread::Current() + + call artResolveStringFromCode // artResolveStringFromCode(arg0, referrer, Thread*) + RESTORE_SAVE_REFS_ONLY_FRAME // restore frame up to return address + RETURN_IF_RESULT_IS_NON_ZERO_OR_DELIVER +END_FUNCTION art_quick_resolve_string + ONE_ARG_DOWNCALL art_quick_initialize_static_storage, artInitializeStaticStorageFromCode, RETURN_IF_RESULT_IS_NON_ZERO_OR_DELIVER ONE_ARG_DOWNCALL art_quick_initialize_type, artInitializeTypeFromCode, RETURN_IF_RESULT_IS_NON_ZERO_OR_DELIVER ONE_ARG_DOWNCALL art_quick_initialize_type_and_verify_access, artInitializeTypeAndVerifyAccessFromCode, RETURN_IF_RESULT_IS_NON_ZERO_OR_DELIVER |