Branch: Tag:

2001-09-29

2001-09-29 06:19:28 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

reworked trampolines to cause less circular references, solves [bug 1937]

Rev: src/apply_low.h:1.4
Rev: src/docode.c:1.134
Rev: src/interpret_functions.h:1.95
Rev: src/language.yacc:1.262
Rev: src/las.c:1.269
Rev: src/las.h:1.53
Rev: src/pike_types.h:1.73
Rev: src/program.c:1.378

112:   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.261 2001/09/28 00:01:45 hubbe Exp $"); + RCSID("$Id: language.yacc,v 1.262 2001/09/29 06:19:27 hubbe Exp $");   #ifdef HAVE_MEMORY_H   #include <memory.h>   #endif
1872:    ID_STATIC | ID_PRIVATE | ID_INLINE);       if(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED) { -  $$ = mktrampolinenode(f); +  $$ = mktrampolinenode(f, Pike_compiler->compiler_frame->previous);    } else {    $$ = mkidentifiernode(f);    }
1943:       name=make_shared_string(buf);    +  if(Pike_compiler->compiler_pass > 1) +  { +  id=isidentifier(name); +  }else{    id=define_function(name,    type,    0,    IDENTIFIER_PIKE_FUNCTION,    0,    OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND); -  +  }    n=0; - #if 0 +     if(Pike_compiler->compiler_pass > 1 &&    (i=ID_FROM_INT(Pike_compiler->new_program, id))) -  if(!(i->identifier_flags & IDENTIFIER_SCOPED)) +  { +  if(i->identifier_flags & IDENTIFIER_SCOPED) +  n = mktrampolinenode(id, Pike_compiler->compiler_frame->previous); +  else    n = mkidentifiernode(id); - #endif +  }       low_add_local_name(Pike_compiler->compiler_frame->previous,    $1->u.sval.u.string, type, n);
2004:    if(Pike_compiler->compiler_frame->lexical_scope &    (SCOPE_SCOPE_USED | SCOPE_SCOPED))    { -  $$ = mknode(F_ASSIGN, mktrampolinenode($<number>3), -  mklocalnode(localid,0)); +  $$ = mktrampolinenode($<number>3,Pike_compiler->compiler_frame);    }else{ -  $$ = mknode(F_ASSIGN, mkidentifiernode($<number>3), -  mklocalnode(localid,0)); +  $$ = mkidentifiernode($<number>3);    }    }    }
2081:       name=make_shared_string(buf);    -  +  if(Pike_compiler->compiler_pass > 1) +  { +  id=isidentifier(name); +  }else{    id=define_function(name,    type,    0,    IDENTIFIER_PIKE_FUNCTION,    0,    OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND); -  +  }    n=0; - #if 0 +     if(Pike_compiler->compiler_pass > 1 &&    (i=ID_FROM_INT(Pike_compiler->new_program, id))) -  if(!(i->identifier_flags & IDENTIFIER_SCOPED)) +  { +  if(i->identifier_flags & IDENTIFIER_SCOPED) +  n = mktrampolinenode(id, Pike_compiler->compiler_frame->previous); +  else    n = mkidentifiernode(id); - #endif +  }       low_add_local_name(Pike_compiler->compiler_frame->previous,    $2->u.sval.u.string, type, n);
2144:    if(Pike_compiler->compiler_frame->lexical_scope &    (SCOPE_SCOPE_USED | SCOPE_SCOPED))    { -  $$ = mknode(F_ASSIGN, mktrampolinenode($<number>5), -  mklocalnode(localid,0)); +  $$ = mktrampolinenode($<number>5,Pike_compiler->compiler_frame);    }else{ -  $$ = mknode(F_ASSIGN, mkidentifiernode($<number>5), -  mklocalnode(localid,0)); +  $$ = mkidentifiernode($<number>5);    }    }    }
3015:    ID_STATIC | ID_PRIVATE | ID_INLINE);       if(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED) { -  $$ = mktrampolinenode(f); +  $$ = mktrampolinenode(f,Pike_compiler->compiler_frame->previous);    } else {    $$ = mkidentifiernode(f);    }