Open
Description
Right now, JIT creates code on demand, but it looks everything up on the fly.
As an example:
function turnOn() { "jit"
digitalWrite(LED1,1);
}
roughly translates to:
- Look up
digitalWrite
- Look up
LED1
- call
digitalWrite
with LED1 and 1
or.....
function draw() { "jit"
g.drawLine(0,0,100,100);
}
roughly translates to:
- Look up
g
- Look up
drawLine
ong
- call
drawLine
withthis=g,0,0,100,100
I think it's probably safe to assume that in both cases we could look the relevant thing up at JIT time and if it is built into the interpreter (or it's defined const
), we could just use it direct?
edit: sometimes code does overload an old implementation (eg maybe g.drawLine may be patched with a fixed version) but as long as that is done before JIT parses the function we'd be fine
It should translate to a pretty drastic speed improvement.