From: user5857@newsgrouper.org.invalid   
      
   Thomas Koenig posted:   
      
   > Anton Ertl schrieb:   
   > > void engine(char *source)   
   > > {   
   > > void *insts[] = {&&add, &&load, &&ip, ...};   
   > >   
   > > void **ip=compile_to_vm_code(source,insts);   
   > >   
   > > goto *ip++;   
   > >   
   > > add:   
   > > ...   
   > > goto *ip++;   
   >   
   > One problem with assigned GOTO is data flow analysis for a comiler.   
   >   
   > Compilers typically break down structured control flow into GOTO   
   > and then perform analysis. A label whose address is assigned   
   > anywhere in the program unit to a variable must be considered to   
   > be reachable by any GOTO to said variable, so any variable in that   
   > piece of code must be in a known place (i.e. memory). If it   
   > is kept in a register in some places that could jump to that   
   > particular label, the contents of that register must be stored   
   > to memory before the jump is executed. Alternatively, memory   
   > allocation must make sure that the same register is always used.   
   >   
   > This was probably less of a problem when assigned goto was invented   
   > (I assume this was for FORTRAN 66)   
      
   I think FORTRAN 66 inherited from FORTRAN II or even FORTRAN (1),   
   it was available in WATFOR and WATFIV.   
      
   > when few varibles were kept in   
   > registers, and register allocation was in its infancy. Now, this is   
   > a much bigger impediment to optimization.   
   >   
   > In other words, assigned goto confuses both programmers and   
   > compilers.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|