1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-01-21 02:33:24 +00:00

Save/Restore JIT code ptr

This commit is contained in:
David Schmenk 2018-04-02 10:02:17 -07:00
parent 77ca9b2813
commit e5e43f58b7

View File

@ -28,6 +28,12 @@ struc t_defentry
byte bytecodesize
end
//
// JIT compiler values
//
const jitcomp = $B7F0
const jitcodeptr = $B7F2
const codemax = $A000
//
// Pedefined functions.
//
predef syscall(cmd,params)#1, call(addr,areg,xreg,yreg,status)#1
@ -1270,16 +1276,18 @@ def loadmod(mod)#1
end
def execmod(modfile)#1
byte moddci[17]
word saveheap, savesym, saveflags
word saveheap, savesym, saveflags, savejit
perr = 1
if stodci(modfile, @moddci)
saveheap = heap
savesym = lastsym
saveflags = systemflags
saveheap = heap
savesym = lastsym
saveflags = systemflags
savejit = *jitcodeptr
if loadmod(@moddci) < modkeep
lastsym = savesym
heap = saveheap
lastsym = savesym
heap = saveheap
*jitcodeptr = savejit
while modid
modid--
seg_release(modseg[modid])