Jason Gloudon wrote:
On Tue, Jan 21, 2003 at 08:21:42PM +0100, Leopold Toetsch wrote:# #!/usr/bin/perl -w # my $i= 5; # LAB: # $i++; # eval("goto LAB if ($i==6)");Ok. Having inter_cs call DO_OP just seems more involved than it has to be.
Yep.
How about a single self-contained inter-segment jump instruction. Since the compiler knows when a branch is non-local it can always break a non-local conditional branch into a conditional local branch to a non-local branch instruction.
This would mean to rewrite the branch target to point to a location after the end of the current sub (or end of program).
if i, non_local1
would become
if i, taken1
...
end/ret # whatever
taken1: inter_cs_jump non_local1
...
Yep. Seems really much simpler. I'll try this approach.
Thanks for your input,
leo