1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-01-08 22:30:48 +00:00

JIT profiler intrypoint improvements

This commit is contained in:
Dave Schmenk 2020-07-01 09:07:40 -07:00
parent 6609aadaaf
commit c652200248

View File

@ -483,54 +483,49 @@ OPXTBL !WORD ZERO,CN,CN,CN,CN,CN,CN,CN ; 00 02
;* ;*
;* JIT PROFILING ENTRY INTO INTERPRETER ;* JIT PROFILING ENTRY INTO INTERPRETER
;* ;*
!AS
JITINTRPX PHP JITINTRPX PHP
PLA PLA
STA PSR STA PSR
SEI SEI
PLA
SEC
SBC #$02 ; POINT TO DEF ENTRY
STA TMPL
PLA
SBC #$00
STA TMPH
LDY #$05
LDA (TMP),Y ; DEC JIT COUNT
DEC
STA (TMP),Y
BEQ RUNJIT
CLC ; SWITCH TO NATIVE MODE CLC ; SWITCH TO NATIVE MODE
XCE XCE
LDY #$03 ; DEC JIT COUNT
LDA (TOS,S),Y
DEC
STA (TOS,S),Y
+ACCMEM16 ; 16 BIT A/M +ACCMEM16 ; 16 BIT A/M
LDY #$3 ; INTERP BYTECODE AS USUAL BEQ RUNJIT
LDA (TMP),Y LDY #$01
LDA (TOS,S),Y
DEY
STA IP STA IP
PLA
STX ESP STX ESP
TSX TSX
STX HWSP STX HWSP
STX ALTRDON STX ALTRDON
LDX #>OPXTBL LDX #>OPXTBL
STX OPPAGE STX OPPAGE
LDY #$00
JMP FETCHOP JMP FETCHOP
; ;
!AS !AL
RUNJIT DEX ; ADD PARAMETER TO DEF ENTRY RUNJIT PLA ; BACK UP DEF ENTRY TO POINT TO JSR
LDA TMPL SEC
PHA ; AND SAVE IT FOR LATER SBC #$0002
STA ESTKL,X
LDA TMPH
PHA PHA
+ACCMEM8 ; 8 BIT A/M
DEX ; ADD PARAMETER TO DEF ENTRY
STA ESTKL,X
XBA
STA ESTKH,X STA ESTKH,X
CLC ; SWITCH TO NATIVE MODE STX ESP
XCE
+ACCMEM16 ; 16 BIT A/M +ACCMEM16 ; 16 BIT A/M
LDA JITCOMP LDA JITCOMP
STA SRC STA SRC
LDY #$03 LDY #$03
LDA (SRC),Y LDA (SRC),Y
STA IP STA IP
STX ESP
TSX TSX
DEX ; TAKE INTO ACCOUNT JSR BELOW DEX ; TAKE INTO ACCOUNT JSR BELOW
DEX DEX
@ -542,9 +537,9 @@ RUNJIT DEX ; ADD PARAMETER TO DEF ENTRY
JSR FETCHOP ; CALL JIT COMPILER JSR FETCHOP ; CALL JIT COMPILER
!AS ; RETURN IN EMULATION MODE !AS ; RETURN IN EMULATION MODE
PLA PLA
STA TMPH
PLA
STA TMPL STA TMPL
PLA
STA TMPH
JMP (TMP) ; RE-CALL ORIGINAL DEF ENTRY JMP (TMP) ; RE-CALL ORIGINAL DEF ENTRY
;********************************************************************* ;*********************************************************************
;* ;*