On Tue, Jan 21, 2003 at 08:21:42PM +0100, Leopold Toetsch wrote:

> >>For such a branch, imcc generates this opcode seqence:
> >>
> >>  inter_cs
> >>  if i, ic # or whatever
> 
> >Why do we need branches to go to different code segments ?  
> 
> 
> Because of this nasty piece of little code:
> t/syn/eval_3.imc:
> 
> # #!/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.
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.

For example

if i, nonlocal

... not taken

can be expressed as

if i, TAKEN

... not taken
...

TAKEN: inter_jump nonlocal

-- 
Jason

Reply via email to