Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Preserving ResolveCacheElem in X9
Browse files Browse the repository at this point in the history
  • Loading branch information
ramarag committed Aug 10, 2016
1 parent 17ced7f commit f9e5306
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/vm/arm64/asmconstants.h
Expand Up @@ -147,5 +147,12 @@ ASMCONSTANTS_C_ASSERT(CONTEXT_Pc == offsetof(T_CONTEXT,Pc))
ASMCONSTANTS_C_ASSERT(SIZEOF__FaultingExceptionFrame == sizeof(FaultingExceptionFrame));
ASMCONSTANTS_C_ASSERT(FaultingExceptionFrame__m_fFilterExecuted == offsetof(FaultingExceptionFrame, m_fFilterExecuted));

#ifndef CROSSGEN_COMPILE
#define ResolveCacheElem__target 0x10
#define ResolveCacheElem__pNext 0x18
ASMCONSTANTS_C_ASSERT(ResolveCacheElem__target == offsetof(ResolveCacheElem, target));
ASMCONSTANTS_C_ASSERT(ResolveCacheElem__pNext == offsetof(ResolveCacheElem, pNext));
#endif // CROSSGEN_COMPILE

#undef ASMCONSTANTS_RUNTIME_ASSERT
#undef ASMCONSTANTS_C_ASSERT
15 changes: 8 additions & 7 deletions src/vm/arm64/asmhelpers.asm
Expand Up @@ -1068,6 +1068,7 @@ FaultingExceptionFrame_FrameOffset SETA SIZEOF__GSCookie
; x12 contains our contract the DispatchToken
; Must be preserved:
; x0 contains the instance object ref that we are making an interface call on
; x9 Must point to a ResolveCacheElem [For Sanity]
; [x1-x7] contains any additional register arguments for the interface method
;
; Loaded from x0
Expand All @@ -1093,7 +1094,7 @@ PROMOTE_CHAIN_FLAG SETA 2
ldr x13, [x0] ; retrieve the MethodTable from the object ref in x0
MainLoop
ldr x9, [x9, #24] ; x9 <= the next entry in the chain
ldr x9, [x9, #ResolveCacheElem__pNext] ; x9 <= the next entry in the chain
cmp x9, #0
beq Fail

Expand All @@ -1106,18 +1107,18 @@ MainLoop
Success
ldr x13, =g_dispatch_cache_chain_success_counter
ldr x9, [x13]
subs x9, x9, #1
str x9, [x13]
ldr x16, [x13]
subs x16, x16, #1
str x16, [x13]
blt Promote

ldr x16, [x9, #16] ; get the ImplTarget
ldr x16, [x9, #ResolveCacheElem__target] ; get the ImplTarget
br x16 ; branch to interface implemenation target
Promote
; Move this entry to head postion of the chain
mov x9, #256
str x9, [x13] ; be quick to reset the counter so we don't get a bunch of contending threads
mov x16, #256
str x16, [x13] ; be quick to reset the counter so we don't get a bunch of contending threads
orr x11, x11, #PROMOTE_CHAIN_FLAG ; set PROMOTE_CHAIN_FLAG

Fail
Expand Down

0 comments on commit f9e5306

Please sign in to comment.