From: tkoenig@netcologne.de   
      
   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) 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.   
   --   
   This USENET posting was made without artificial intelligence,   
   artificial impertinence, artificial arrogance, artificial stupidity,   
   artificial flavorings or artificial colorants.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|