This diff adds jsr_ic and ret to the interpreter. I don't know if my
way of returning is legal, and I know there's probably issues with 64
bit machines, but it works...and that's the important part :)
Right now it only has a depth of 32 and no bounds checking, but its
enough to get started.
Brian
Index: basic_opcodes.ops
===================================================================
RCS file: /home/perlcvs/parrot/basic_opcodes.ops,v
retrieving revision 1.8
diff -r1.8 basic_opcodes.ops
331a332,345
>
> // JSR
> MANUAL_OP jsr_ic {
> interpreter->call_stack[interpreter->call_sp]=cur_opcode+2;
> interpreter->call_sp++;
> RETURN(P1);
> }
>
> // RET
> MANUAL_OP ret {
> interpreter->call_sp--;
> // probably not legal :)
> return interpreter->call_stack[(interpreter->call_sp)];
> }
Index: interpreter.h
===================================================================
RCS file: /home/perlcvs/parrot/interpreter.h,v
retrieving revision 1.3
diff -r1.3 interpreter.h
31a32,34
>
> unsigned int call_sp;
> unsigned long call_stack[32];
Index: opcode_table
===================================================================
RCS file: /home/perlcvs/parrot/opcode_table,v
retrieving revision 1.9
diff -r1.9 opcode_table
75a76,77
> jsr_ic 1 D
> ret 0