1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-03-24 13:35:24 +00:00

Re-org some JIT <-> CMDSYS <-> VM connections

This commit is contained in:
David Schmenk 2018-04-02 09:17:18 -07:00
parent d4f15e3a90
commit 77ca9b2813
5 changed files with 13 additions and 11 deletions

View File

@ -55,8 +55,7 @@ import cmdsys
byte jitsize
byte refcons // Apple /// specific
byte devcons // Apple /// specific
word jitc
word cmdparser
word cmdparser // Apple /// specific
end
//
// CMD exported functions

View File

@ -46,5 +46,7 @@ if *jitcomp
fin
puts("JITC 1.0\n")
*jitcomp = @compiler
cmdsys.jitcount = 44
cmdsys.jitsize = 96
return modkeep
done

View File

@ -58,8 +58,8 @@ word syspath
word syscmdln
word = @execmod, @open, @close, @read, 0 // Mark write() as NULL
byte perr
byte jitcount = 44
byte jitsize = 96
byte jitcount = 0
byte jitsize = 0
//
// Working input buffer overlayed with strings table
//
@ -1029,7 +1029,7 @@ def adddef(isfirst, addr, deflast)#1
if not isfirst
preventry = defentry - t_defentry
defsize = addr - preventry=>bytecodeaddr
if *jitcomp and defsize <= jitsize
if defsize <= jitsize // and *jitcomp
preventry=>interpaddr = $03D6 // JSR $03D6 (JIT INTERP)
preventry->callcount = jitcount // Set JIT countdown
preventry->bytecodesize = defsize // Set size

View File

@ -314,6 +314,8 @@ cmdsys:cmdparser = @shell
// Install JIT compiler
//
puts("JITC 1.0\n")
cmdsys:jitc = @compiler
interpentry = compiler:interpaddr
interpentry = compiler:interpaddr
*jitcomp = @compiler
cmdsys.jitcount = 44
cmdsys.jitsize = 96
done

View File

@ -45,11 +45,10 @@ word syspath
word cmdlnptr
word = @execmod, @open, @close, @read, @write
byte perr
byte jitcount = 45
byte jitsize = 96
byte jitcount = 0
byte jitsize = 0
byte refcons = 0
byte devcons = 0
word jitcomp = 0
word cmdparser
//
// String pool.
@ -1040,7 +1039,7 @@ def adddef(isfirst, ext, addr, deflast)#1
if not isfirst
preventry = defentry - t_defentry
defsize = addr - preventry=>bytecodeaddr
if *jitcomp and defsize <= jitsize
if defsize <= jitsize // and *jitcomp
preventry=>interpaddr = jitinterp // JSR JITINTRP
preventry->callcount = jitcount // Set JIT countdown
preventry->bytecodesize = defsize // Set size