|
From: <ans...@us...> - 2007-01-14 22:05:19
|
Revision: 3074
http://jnode.svn.sourceforge.net/jnode/?rev=3074&view=rev
Author: ansari82
Date: 2007-01-14 09:06:45 -0800 (Sun, 14 Jan 2007)
Log Message:
-----------
Modified some native code so that it doesn't use ebx/esi, or saves them before use and restores them before returning, as these registers need to be left unmodified for jikes-compiled methods
Modified Paths:
--------------
branches/jikesRVM/core/src/native/x86/vm-ints.asm
branches/jikesRVM/core/src/native/x86/vm.asm
Modified: branches/jikesRVM/core/src/native/x86/vm-ints.asm
===================================================================
--- branches/jikesRVM/core/src/native/x86/vm-ints.asm 2007-01-11 19:32:27 UTC (rev 3073)
+++ branches/jikesRVM/core/src/native/x86/vm-ints.asm 2007-01-14 17:06:45 UTC (rev 3074)
@@ -66,6 +66,8 @@
; Usage: SAVE_MSR_ARRAY array-ref
; array-ref a reference to an MSR[]. Can be null.
%macro SAVE_MSR_ARRAY 1
+ push ebx
+ push esi
mov ASI,%1
test ASI,ASI
jnz %%save ; Arranged this way to optimize branch prediction
@@ -85,14 +87,18 @@
; Go to next position
lea ASI,[ASI+SLOT_SIZE]
dec ebx
- jnz %%loop
+ jnz %%loop
%%end:
+ pop esi
+ pop ebx
%endmacro
; Restore an array of MSR's
; Usage: RESTORE_MSR_ARRAY array-ref
; array-ref a reference to an MSR[]. Can be null.
%macro RESTORE_MSR_ARRAY 1
+ push ebx
+ push esi
mov ASI,%1
test ASI,ASI
jnz %%restore ; Arranged this way to optimize branch prediction
@@ -112,7 +118,9 @@
lea ASI,[ASI+SLOT_SIZE]
dec ebx
jnz %%loop
-%%end:
+%%end:
+ pop esi
+ pop ebx
%endmacro
yieldPointHandler_kernelCode:
@@ -170,16 +178,16 @@
and dword [ADI+VmX86Thread_FXFLAGS_OFS],~VmX86Thread_FXF_USED
; Load fxStatePtr
yieldPointHandler_loadFxStatePtr:
- mov ABX, [ADI+VmX86Thread_FXSTATEPTR_OFS]
- test ABX,ABX
+ mov ACX, [ADI+VmX86Thread_FXSTATEPTR_OFS]
+ test ACX,ACX
jz near yieldPointHandler_fxSaveInit
; We have a valid fxState address in ebx
test dword [cpu_features],FEAT_FXSR
jz yieldPointHandler_fpuSave
- fxsave [ABX]
+ fxsave [ACX]
jmp yieldPointHandler_saveEnd
yieldPointHandler_fpuSave:
- fnsave [ABX]
+ fnsave [ACX]
yieldPointHandler_saveEnd:
; Now call VmScheduler.reschedule (in kernel mode!)
@@ -242,14 +250,14 @@
; Set the new thread parameters
mov CURRENTTHREAD,ADI
; Set the isolatedStatics of the new thread
- mov ABX,[ADI+VmThread_ISOLATEDSTATICS_OFS]
- mov ISOLATEDSTATICS,ABX
+ mov ACX,[ADI+VmThread_ISOLATEDSTATICS_OFS]
+ mov ISOLATEDSTATICS,ACX
; Set the isolatedStaticsTable of the new thread
- mov ABX,[ABX+VmStatics_STATICS_OFS]
- mov ISOLATEDSTATICSTABLE,ABX
+ mov ACX,[ACX+VmStatics_STATICS_OFS]
+ mov ISOLATEDSTATICSTABLE,ACX
; Reload stackend
- mov ABX,[ADI+VmThread_STACKEND_OFS]
- mov STACKEND,ABX
+ mov ACX,[ADI+VmThread_STACKEND_OFS]
+ mov STACKEND,ACX
yieldPointHandler_done:
and THREADSWITCHINDICATOR,~VmProcessor_TSI_SWITCH_ACTIVE
ret
@@ -271,10 +279,10 @@
; Set the fxStatePtr in the thread given in edi.
; The fxStatePtr must be 16-byte aligned
fixFxStatePtr:
- mov ABX,[ADI+VmX86Thread_FXSTATE_OFS]
- add ABX,(VmArray_DATA_OFFSET*SLOT_SIZE) + 15
- and ABX,~0xF;
- mov [ADI+VmX86Thread_FXSTATEPTR_OFS],ABX
+ mov ACX,[ADI+VmX86Thread_FXSTATE_OFS]
+ add ACX,(VmArray_DATA_OFFSET*SLOT_SIZE) + 15
+ and ACX,~0xF;
+ mov [ADI+VmX86Thread_FXSTATEPTR_OFS],ACX
ret
yieldPointHandler_fxSaveInit:
@@ -298,17 +306,17 @@
; Clear CR0.TS
clts
; Restore fx state (if any)
- mov ABX, [ADI+VmX86Thread_FXSTATEPTR_OFS]
- test ABX,ABX
+ mov ACX, [ADI+VmX86Thread_FXSTATEPTR_OFS]
+ test ACX,ACX
jz int_dev_na_ret ; No valid fxStatePtr yet, do not restore
; Increment counter
inc FXRESTORECOUNTER
test dword [cpu_features],FEAT_FXSR
jz int_dev_na_fpuRestore
- fxrstor [ABX]
+ fxrstor [ACX]
ret
int_dev_na_fpuRestore:
- frstor [ABX]
+ frstor [ACX]
int_dev_na_ret:
ret
Modified: branches/jikesRVM/core/src/native/x86/vm.asm
===================================================================
--- branches/jikesRVM/core/src/native/x86/vm.asm 2007-01-11 19:32:27 UTC (rev 3073)
+++ branches/jikesRVM/core/src/native/x86/vm.asm 2007-01-14 17:06:45 UTC (rev 3074)
@@ -60,16 +60,16 @@
mov AAX, vm_findThrowableHandler
INVOKE_JAVA_METHOD
; eax now contains the handler address of the exception, move it to ebx
- mov ABX,AAX
+ mov ACX,AAX
pop ADX ; restore address
pop AAX ; restore exception
vm_athrow_deliver_compiled:
- test ABX,ABX
+ test ACX,ACX
jz vm_athrow_notrace_pop_eip
; Jump to the compiled exception handler
- jmp ABX
+ jmp ACX
vm_athrow_unhandled:
cli
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|