Interpreter Execution

Godmar Back gback at cs.utah.edu
Tue Nov 23 07:20:30 PST 1999


> 
> 
> Hi!
> I am trying to understand the Kaffe source code. Could any one please
> tell me whether any of the Bytecodes need multiple iterations of the
> Interpreter loop? (for loop in
>  runVirtualMachine(...))
> Also, when WIDE instruction is encountered, is the Instruction that
> follows, executed then and there??
> Thanks in Advance.
> Sudheer
> 

Such questions can be best answered by looking at the code:
Search for "WIDE" in kaffe/kaffevm/kaffe.def and you'll see the answer
right there:

define_insn(WIDE)
{
        /* Move PC to widened instruction */
        pc = npc;
        npc = pc + insnLen[getopcode()] + 1;

        switch(getopcode()) {
        default:
                ABORT();

        define_insn(ILOAD)
        {
                /*
                 * ..., -> ..., local variable
                 */
                check_pcidx (0);
                idx = (uint16)((getpc(0) << 8) | getpc(1));

                check_local_int(idx);

                push(1);
                move_int(stack(0), local(idx));
        }

....


	- Godmar



More information about the kaffe mailing list