pike.git / src / docode.c

version» Context lines:

pike.git/src/docode.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: docode.c,v 1.153 2002/11/12 11:48:23 grubba Exp $ + || $Id: docode.c,v 1.154 2002/11/14 12:36:42 grubba Exp $   */      #include "global.h" - RCSID("$Id: docode.c,v 1.153 2002/11/12 11:48:23 grubba Exp $"); + RCSID("$Id: docode.c,v 1.154 2002/11/14 12:36:42 grubba Exp $");   #include "las.h"   #include "program.h"   #include "pike_types.h"   #include "stralloc.h"   #include "interpret.h"   #include "constants.h"   #include "array.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "pike_memory.h"
pike.git/src/docode.c:424:    return 1;   }      static inline struct compiler_frame *find_local_frame(INT32 depth)   {    struct compiler_frame *f=Pike_compiler->compiler_frame;    while(--depth>=0) f=f->previous;    return f;   }    - int do_lfun_call(int id,node *args) + /* Emit code for a function call to the identifier reference #id, +  * with the arguments specified by args. +  */ + int do_lfun_call(int id, node *args)   {   #if 1 -  if(id == Pike_compiler->compiler_frame->current_function_number) +  struct reference *ref = +  Pike_compiler->new_program->identifier_references + id; +  +  /* NB: The second part handles use of local::fun(). */ +  if((id == Pike_compiler->compiler_frame->current_function_number) || +  ((!ref->inherit_offset) && +  (ref->identifier_offset == +  Pike_compiler->new_program-> +  identifier_references[Pike_compiler->compiler_frame-> +  current_function_number].identifier_offset)))    {    int n=count_args(args);    if(n == Pike_compiler->compiler_frame->num_args)    {    do_docode(args,0); -  if(Pike_compiler->compiler_frame->is_inline) +  if(Pike_compiler->compiler_frame->is_inline || +  (ref->id_flags & ID_INLINE))    { -  Pike_compiler->compiler_frame->recur_label=do_jump(F_RECUR, +  /* Identifier is declared inline/local +  * or in inlining pass. +  */ +  Pike_compiler->compiler_frame-> +  recur_label=do_jump(F_RECUR,    Pike_compiler->compiler_frame->recur_label); -  }else{ +  } else { +  /* Recur if not overloaded. */    emit1(F_COND_RECUR,id); -  Pike_compiler->compiler_frame->recur_label=do_jump(F_POINTER, +  Pike_compiler->compiler_frame-> +  recur_label=do_jump(F_POINTER,    Pike_compiler->compiler_frame->recur_label);    }    return 1;    }    }   #endif       emit0(F_MARK);    PUSH_CLEANUP_FRAME(do_pop_mark, 0);    do_docode(args,0);
pike.git/src/docode.c:1429:    emit1(F_CALL_BUILTIN, DO_NOT_WARN((INT32)tmp1));    POP_AND_DONT_CLEANUP;    }    }    if(n->type == void_type_string)    return 0;       return 1;    }else{    if(CAR(n)->u.sval.u.object == Pike_compiler->fake_object) -  return do_lfun_call(CAR(n)->u.sval.subtype,CDR(n)); +  return do_lfun_call(CAR(n)->u.sval.subtype, CDR(n));    }    }       emit0(F_MARK);    PUSH_CLEANUP_FRAME(do_pop_mark, 0);    do_docode(CDR(n),0);    tmp1=store_constant(& CAR(n)->u.sval,    !(CAR(n)->tree_info & OPT_EXTERNAL_DEPEND),    CAR(n)->name);    emit1(F_APPLY, DO_NOT_WARN((INT32)tmp1));    POP_AND_DONT_CLEANUP;       return 1;    }    else if(CAR(n)->token == F_IDENTIFIER)    { -  return do_lfun_call(CAR(n)->u.id.number,CDR(n)); +  return do_lfun_call(CAR(n)->u.id.number, CDR(n));    }    else if(CAR(n)->token == F_EXTERNAL &&    CAR(n)->u.integer.a == Pike_compiler->new_program->id)    { -  return do_lfun_call(CAR(n)->u.integer.b,CDR(n)); +  return do_lfun_call(CAR(n)->u.integer.b, CDR(n));    }    else if(CAR(n)->token == F_ARROW)    {    emit0(F_MARK);    PUSH_CLEANUP_FRAME(do_pop_mark, 0);    do_docode(CAAR(n),0); /* object */    do_docode(CDR(n),0); /* args */    emit1(F_CALL_OTHER, store_prog_string(CDAR(n)->u.sval.u.string));    POP_AND_DONT_CLEANUP;    return 1;
pike.git/src/docode.c:2185:       init_bytecode();    label_no=1;      #ifdef ALIGN_PIKE_FUNCTION_BEGINNINGS    while( ( (((INT32) PIKE_PC)+2) & (ALIGN_PIKE_JUMPS-1)))    ins_byte(0);   #endif       ret=PIKE_PC; +  /* NOTE: This is no ordinary label... */ +  Pike_compiler->compiler_frame->recur_label=0; +  low_insert_label(0);    emit1(F_BYTE,Pike_compiler->compiler_frame->max_number_of_locals);    emit1(F_BYTE,Pike_compiler->compiler_frame->num_args);    emit0(F_ENTRY);    emit0(F_START_FUNCTION); -  low_insert_label(0); +        if(Pike_compiler->compiler_frame->current_function_number >= 0 &&    (Pike_compiler->new_program->identifier_references[    Pike_compiler->compiler_frame->current_function_number].id_flags &    ID_INLINE))    { -  Pike_compiler->compiler_frame->recur_label=0; +     Pike_compiler->compiler_frame->is_inline=1;    }       DO_CODE_BLOCK(n);       if(Pike_compiler->compiler_frame->recur_label > 0)    {   #ifdef PIKE_DEBUG    if(l_flag)    {