Branch: Tag:

2000-08-24

2000-08-24 04:04:42 by Fredrik H├╝binette (Hubbe) <hubbe@hubbe.net>

jumbopatch, vtables and parent scopes are now working properly!

Rev: src/Makefile.in:1.207
Rev: src/backend.c:1.56
Rev: src/block_alloc.h:1.24
Rev: src/builtin_functions.c:1.300
Rev: src/compilation.h:1.20
Rev: src/docode.c:1.80
Rev: src/interpret.c:1.166
Rev: src/interpret.h:1.66
Rev: src/interpret_functions.h:1.31
Rev: src/las.c:1.192
Rev: src/main.c:1.100
Rev: src/object.c:1.145
Rev: src/program.c:1.265
Rev: src/program.h:1.105
Rev: src/testsuite.in:1.323
Rev: src/threads.c:1.139

5:   \*/   /**/   #include "global.h" - RCSID("$Id: docode.c,v 1.79 2000/08/16 10:49:19 grubba Exp $"); + RCSID("$Id: docode.c,v 1.80 2000/08/24 04:04:40 hubbe Exp $");   #include "las.h"   #include "program.h"   #include "pike_types.h"
302:    case F_EXTERNAL:    {    int level = 0; -  struct program_state *state = Pike_compiler->previous; +  struct program_state *state = Pike_compiler;    while (state && (state->new_program->id != n->u.integer.a)) {    state = state->previous;    level++;
312:    emit1(F_NUMBER,0);    return 1;    } +  if(level) +  {    if(flags & WANT_LVALUE)    {    emit2(F_EXTERNAL_LVALUE, n->u.integer.b, level);
320:    emit2(F_EXTERNAL, n->u.integer.b, level);    return 1;    } +  }else{ +  if(flags & WANT_LVALUE) +  { +  emit1(F_GLOBAL_LVALUE, n->u.integer.b); +  return 2; +  }else{ +  if(IDENTIFIER_IS_FUNCTION(ID_FROM_INT(state->new_program,n->u.integer.b)->identifier_flags)) +  { +  emit1(F_LFUN, n->u.integer.b); +  }else{ +  emit1(F_GLOBAL, n->u.integer.b);    } -  +  return 1; +  } +  } +  }    break;       case F_UNDEFINED:
508:    CDR(n)->u.integer.a );    break;    +  /* FIXME: Make special case for F_EXTERNAL */    case F_IDENTIFIER:    if(!IDENTIFIER_IS_VARIABLE( ID_FROM_INT(Pike_compiler->new_program, CDR(n)->u.id.number)->identifier_flags))    {
831:    {    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 && +  IDENTIFIER_IS_FUNCTION(ID_FROM_INT(Pike_compiler->new_program, +  CAR(n)->u.integer.b)->identifier_flags)) +  { +  return do_lfun_call(CAR(n)->u.integer.b,CDR(n)); +  }    else    {    struct pike_string *tmp;
1242:    int x=0;    struct object *o;    -  for(o=Pike_compiler->fake_object->parent;o!=n->u.sval.u.object;o=o->parent) +  for(o=Pike_compiler->fake_object;o!=n->u.sval.u.object;o=o->parent)    x++;    emit2(F_EXTERNAL, n->u.sval.subtype, x);    Pike_compiler->new_program->flags |= PROGRAM_USES_PARENT;