Skip to content

Commit

Permalink
Merge pull request #3112 from 0dvictor/arraycopy
Browse files Browse the repository at this point in the history
Style update of jitReferenceArrayCopy on X86
  • Loading branch information
gacholio authored Oct 3, 2018
2 parents 77340f0 + a12e143 commit 51114d4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 33 deletions.
23 changes: 11 additions & 12 deletions runtime/codert_vm/cnathelp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2064,23 +2064,22 @@ old_slow_jitThrowArrayIndexOutOfBounds(J9VMThread *currentThread)
void* J9FASTCALL
impl_jitReferenceArrayCopy(J9VMThread *currentThread, UDATA lengthInBytes)
{
SLOW_JIT_HELPER_PROLOGUE();
JIT_HELPER_PROLOGUE();
void* exception = NULL;
if (-1 != currentThread->javaVM->memoryManagerFunctions->referenceArrayCopy(currentThread,
(J9IndexableObject*)currentThread->floatTemp1,
(J9IndexableObject*)currentThread->floatTemp2,
(fj9object_t*)currentThread->floatTemp3,
(fj9object_t*)currentThread->floatTemp4,
if (-1 != currentThread->javaVM->memoryManagerFunctions->referenceArrayCopy(
currentThread,
(J9IndexableObject*)currentThread->floatTemp1,
(J9IndexableObject*)currentThread->floatTemp2,
(fj9object_t*)currentThread->floatTemp3,
(fj9object_t*)currentThread->floatTemp4,
#if defined(J9VM_GC_COMPRESSED_POINTERS) || !defined(J9VM_ENV_DATA64)
(I_32)(lengthInBytes >> 2)
(I_32)(lengthInBytes >> 2)
#else
(I_32)(lengthInBytes >> 3)
(I_32)(lengthInBytes >> 3)
#endif /* J9VM_INTERP_COMPRESSED_OBJECT_HEADER || !J9VM_ENV_DATA64 */
))
{
exception = (void*)-1;
)) {
exception = (void*)-1;
}
SLOW_JIT_HELPER_EPILOGUE();
return exception;
}

Expand Down
30 changes: 9 additions & 21 deletions runtime/codert_vm/xnathelp.m4
Original file line number Diff line number Diff line change
Expand Up @@ -969,29 +969,17 @@ END_PROC(jitDecompileOnReturnJ)

START_PROC(jitReferenceArrayCopy)
FASTCALL_EXTERN(impl_jitReferenceArrayCopy,2)
pop uword ptr J9TR_VMThread_jitReturnAddress[_rbp]
SWITCH_TO_C_STACK
SAVE_ALL_REGS

mov uword ptr [_rbp+J9TR_VMThread_floatTemp3], _rsi
mov uword ptr [_rbp+J9TR_VMThread_floatTemp4], _rdi
ifdef({ASM_J9VM_ENV_DATA64},{
ifdef({WIN32},{
mov _rdx, _rcx
mov _rcx, _rbp
},{
mov _rsi, _rcx
mov _rdi, _rbp
})
},{
mov _rdx, _rcx
mov _rcx, _rbp
})
call FASTCALL_SYMBOL(impl_jitReferenceArrayCopy,2)
test _rax, _rax
RESTORE_ALL_REGS
SAVE_C_VOLATILE_REGS
mov uword ptr J9TR_VMThread_floatTemp3[_rbp],_rsi
mov uword ptr J9TR_VMThread_floatTemp4[_rbp],_rdi
mov PARM_REG(2),_rcx
mov PARM_REG(1),_rbp
call FASTCALL_SYMBOL(impl_jitReferenceArrayCopy,2)
dnl set ZF if succeed
test _rax,_rax
RESTORE_C_VOLATILE_REGS
SWITCH_TO_JAVA_STACK
push uword ptr J9TR_VMThread_jitReturnAddress[_rbp]
ret
END_PROC(jitReferenceArrayCopy)

Expand Down
2 changes: 2 additions & 0 deletions runtime/oti/xhelpers.m4
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ dnl C linkage (windows and linux)
dnl argument GPRs: none (stdcall) / ECX EDX (fastcall)
dnl preserved: EBX EDI ESI, no XMM

define({PARM_REG},{ifelse($1,1,_rcx,$1,2,_rdx,{ERROR})})

define({_rax},{eax})
define({_rbx},{ebx})
define({_rcx},{ecx})
Expand Down

0 comments on commit 51114d4

Please sign in to comment.