2 levels of Slate

Todd Fleming todd at flemingcnc.com
Sun Nov 7 21:51:42 PST 2004


Right now, Slate code has 2 levels: VM and user. Methods in the VM 
level, after generation into machine language and loaded into an OS 
process, have necessary assumptions about certain slot offsets and the 
addresses of other methods contained in the VM level. For example, the 
machine code for "i@(Interpreter pointer) returnFrom: n" knows the 
address of "i@(Interpreter pointer) applyUnwindBlockFrom: 
lexicalContext" and the offset of  the unwindBlock slot within 
LexicalContext. Methods in the user level have no such knowledge; they 
have to search for roles and slots. Compiled code at the VM level is 
fast, but it is static; you can't modify VM methods at runtime or change 
the layout of objects at runtime in a way that violate the assumptions 
made by these methods. Compiled code at the user level is a lot more 
flexible, but may not be fast enough for some operations, such as 
rendering curved areas to a bitmap.

Right now, the line between VM and non-VM is defined by what gets 
compiled into C. C is going away; Slate will generate its VM directly 
into machine code (or, at least that's what I think you guys are doing). 
Eventually, if I understand correctly, Slate will also compile 
user-level code into machine languate (JIT?). At this stage, will there 
still be a hard line between these two levels, or will it start to 
blurr? Will the whole VM still live in an executable, or will part of it 
live in the image?

Todd




More information about the Slate mailing list