From: Bruno H. <br...@cl...> - 2004-03-23 14:50:14
|
Sam wrote: > one thing we need is a check in interpret_bytecode_() for the valid > value of a jump. > E.g., > > byteptr += fixnum_to_L(hashvalue); > > should be > > byteptr += fixnum_to_L(hashvalue); > CHECK_BYTEPTR(byteptr); Why do we need such a check? If you trust that the bytecode comes from the compiler, all you need to check is the assemble-LAP function. It is small enough to convince oneself that it is bug free. If you don't trust the bytecode that is read from .fas files or assembled in memory, then you need to 1) change the type of bytecode vector from a simple byte vector to a sealed object with no destructive modification functions, 2) add a bytecode verifier that is invoked when a sealed bytecode vector is constructed. This would be a feature: ability to trust the bytecode that comes from anywhere. Like the JVM does. Especially if later you want to transform bytecode to machine code, it comes in handy to know that the bytecode is OK. Bruno |