At 8:47 PM -0500 2/23/02, Bryan C. Warnock wrote:
>On Saturday 23 February 2002 20:31, Dan Sugalski wrote:
>>  Well, what I was thinking was we could have a section that marked all
>>  the legitimate jump destinations. We could then vet this destination
>>  table at load time for safe interpreters to make sure that the
>>  destinations really were proper places to jump (i.e. real opcodes)
>>  and then have the branch/jump ops vet their destination against the
>>  valid destination table rather than checking every time to make sure
>>  it's OK.
>>
>>  Might not be worth it, of course.
>
>That's (potentially) an awfully big table.  But maybe I'm missing the point.
>If we're not trusting the bytecode to be safe, and this table is part of the
>bytecode, how do we know the table is safe?

We vet the table at load time to make sure it's safe. That way we 
avoid the cost of checking that the destination is valid for every 
opcode branch and jump. Otherwise we need to check that the 
destination of a branch is actually an opcode. (To avoid jumping into 
data and suchlike things)
-- 
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                       teddy bears get drunk

Reply via email to