Branch: Tag:

2001-06-29

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

optimized assignments to global variables

Rev: src/docode.c:1.123

5:   \*/   /**/   #include "global.h" - RCSID("$Id: docode.c,v 1.122 2001/06/23 21:52:09 hubbe Exp $"); + RCSID("$Id: docode.c,v 1.123 2001/06/29 19:48:22 hubbe Exp $");   #include "las.h"   #include "program.h"   #include "pike_types.h"
782:    }    break;    +  case F_EXTERNAL: +  /* Check that it is in this context */ +  if(Pike_compiler ->new_program->id == CDR(n)->u.integer.a) +  { +  /* Check that it is a variable */ +  if(IDENTIFIER_IS_VARIABLE( ID_FROM_INT(Pike_compiler->new_program, CDR(n)->u.integer.b)->identifier_flags)) +  { +  code_expression(CAR(n), 0, "RHS"); +  emit1(flags & DO_POP ? F_ASSIGN_GLOBAL_AND_POP:F_ASSIGN_GLOBAL, +  CDR(n)->u.integer.b); +  break; +  } +  } +  /* fall through */ +     default:    normal_assign:    tmp1=do_docode(CDR(n),DO_LVALUE);