Branch: Tag:

1997-01-27

1997-01-27 01:12:53 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

add on strings optimized, efuns are now stored in a mapping

Rev: src/docode.c:1.8

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: docode.c,v 1.7 1997/01/16 05:00:43 hubbe Exp $"); + RCSID("$Id: docode.c,v 1.8 1997/01/27 01:12:53 hubbe Exp $");   #include "las.h"   #include "program.h"   #include "language.h"
348:    fatal("HELP! FATAL INTERNAL COMPILER ERROR\n");   #endif    -  if(CAR(n)->type->str[0] == T_ARRAY) +  if(match_types(CAR(n)->type,array_type_string) || +  match_types(CAR(n)->type,string_type_string))    {    if(do_docode(CDR(n), 0)!=1)    fatal("Internal compiler error, shit happens\n");
399:    if(node_is_eq(CDR(n),CAAR(n)))    {    tmp1=do_docode(CDR(n),DO_LVALUE); -  if(match_types(CDR(n)->type,array_type_string)) +  if(match_types(CDR(n)->type,array_type_string) || +  match_types(CDR(n)->type,string_type_string))    {    if(do_docode(CDAR(n),DO_NOT_COPY)!=1)    fatal("Infernal compiler error (dumpar core |ver hela mattan).\n");
695:    {    struct pike_string *tmp;    struct efun *fun; +  node *foo;       emit2(F_MARK); -  tmp=make_shared_string("call_function"); -  if(!tmp) yyerror("No call_function efun."); -  fun=lookup_efun(tmp); -  if(!fun) yyerror("No call_function efun."); -  free_string(tmp); -  +     do_docode(CAR(n),0);    do_docode(CDR(n),0); -  tmp1=store_constant(& fun->function, 1); +  +  tmp=findstring("call_function"); +  if(!tmp) yyerror("No call_function efun."); +  if(!find_module_identifier(tmp)) +  { +  yyerror("No call_function efun."); +  }else{ +  tmp1=store_constant(sp-1, 1); +  pop_stack();    emit(F_APPLY, tmp1); -  +  }    return 1;    }