Branch: Tag:

2000-04-20

2000-04-20 02:41:45 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

bye bye accumulator

Rev: bin/mkpeep.pike:1.14
Rev: src/Makefile.in:1.190
Rev: src/array.c:1.67
Rev: src/docode.c:1.68
Rev: src/docode.h:1.9
Rev: src/error.h:1.41
Rev: src/gc.c:1.75
Rev: src/interpret_functions.h:1.10
Rev: src/interpreter.h:1.42
Rev: src/language.yacc:1.180
Rev: src/lex.c:1.74
Rev: src/lex.h:1.15
Rev: src/object.c:1.117
Rev: src/opcodes.c:1.74
Rev: src/operators.c:1.91
Rev: src/peep.c:1.30
Rev: src/peep.h:1.5
Rev: src/peep.in:1.28

1:   /* -  * $Id: interpret_functions.h,v 1.9 2000/04/19 20:20:01 grubba Exp $ +  * $Id: interpret_functions.h,v 1.10 2000/04/20 02:41:44 hubbe Exp $    *    * Opcode definitions for the interpreter.    */
102:   BREAK;       - OPCODE1ACC(F_EXTERNAL,"external") + OPCODE2(F_EXTERNAL,"external")   {    struct inherit *inherit;    struct program *p;
130:       i=o->parent_identifier;    o=o->parent; -  acc+=inherit->parent_offset-1; +  arg2+=inherit->parent_offset-1;    }else{   #ifdef PIKE_DEBUG    if(t_flag>4)
183:    }   #endif /* DEBUG_MALLOC */    -  if(!acc) break; -  --acc; +  if(!arg2) break; +  --arg2;    }       low_object_index_no_free(Pike_sp,
196:   }   BREAK;    -  CASE(F_EXTERNAL_LVALUE); + OPCODE2(F_EXTERNAL_LVALUE,"& external")   {    struct inherit *inherit;    struct program *p;    struct object *o; -  INT32 i,id=GET_ARG(); +  INT32 i,id=arg1;       inherit=&Pike_fp->context;    o=Pike_fp->current_object;
215:    {    i=o->parent_identifier;    o=o->parent; -  accumulator+=inherit->parent_offset-1; +  arg2+=inherit->parent_offset-1;    }else{    i=inherit->parent_identifier;    o=inherit->parent;
229:       inherit=INHERIT_FROM_INT(p, i);    -  if(!accumulator) break; -  accumulator--; +  if(!arg2) break; +  arg2--;    }       ref_push_object(o);
240:    break;    }    + BREAK;    -  +     CASE(F_MARK_AND_LOCAL); *(Pike_mark_sp++)=Pike_sp;    CASE(F_LOCAL);    assign_svalue_no_free(Pike_sp++,Pike_fp->locals+GET_ARG());
254:    print_return_value();   BREAK;    - OPCODE2(F_LOCAL_2_LOCAL, "local=local;") - { -  int tmp=arg1; -  assign_svalue(Pike_fp->locals + tmp, Pike_fp->locals + arg2); - } + OPCODE2(F_LOCAL_2_LOCAL, "local = local") +  assign_svalue(Pike_fp->locals+arg1, Pike_fp->locals+arg2);   BREAK;      OPCODE2(F_LOCAL_2_GLOBAL, "global=local;")
284:   }   BREAK;    - OPCODE2(F_GLOBAL_2_LOCAL, "local=global;") + OPCODE2(F_GLOBAL_2_LOCAL,"global = local")   { -  INT32 tmp = arg1 + Pike_fp->context.identifier_level; -  INT32 tmp2 = arg2; -  free_svalue(Pike_fp->locals + tmp2); -  low_object_index_no_free(Pike_fp->locals + tmp2, +  INT32 tmp=arg1 + Pike_fp->context.identifier_level; +  free_svalue(Pike_fp->locals + arg2); +  low_object_index_no_free(Pike_fp->locals + arg2,    Pike_fp->current_object,    tmp);   }
302:    Pike_sp += 2;   BREAK;    - OPCODE1ACC(F_LEXICAL_LOCAL, "lexical local") + OPCODE2(F_LEXICAL_LOCAL,"lexical local")   { -  struct pike_frame *f = Pike_fp; -  while(acc--) +  struct pike_frame *f=Pike_fp; +  while(arg2--)    {    f=f->scope;    if(!f) error("Lexical scope error.\n");    }    push_svalue(f->locals + arg1);    print_return_value(); -  +  break;   }   BREAK;    - OPCODE1ACC(F_LEXICAL_LOCAL_LVALUE, "& lexical local") +  + OPCODE2(F_LEXICAL_LOCAL_LVALUE,"&lexical local")   { -  struct pike_frame *f = Pike_fp; -  while(acc--) +  struct pike_frame *f=Pike_fp; +  while(arg2--)    { -  f = f->scope; +  f=f->scope;    if(!f) error("Lexical scope error.\n");    } -  Pike_sp[0].type = T_LVALUE; -  Pike_sp[0].u.lval = f->locals+arg1; -  Pike_sp[1].type = T_VOID; -  Pike_sp += 2; +  Pike_sp[0].type=T_LVALUE; +  Pike_sp[0].u.lval=f->locals+arg1; +  Pike_sp[1].type=T_VOID; +  Pike_sp+=2; +  break;   }   BREAK;   
520:   {    struct identifier *i;    INT32 tmp=arg1 + Pike_fp->context.identifier_level; -  +     if(!Pike_fp->current_object->prog)    error("Cannot access global variables in destructed object.\n"); -  +     i=ID_FROM_INT(Pike_fp->current_object->prog, tmp);       if(!IDENTIFIER_IS_VARIABLE(i->identifier_flags))
543:   }   BREAK;    +    OPCODE0(F_INC, "++x")   {    union anything *u=get_pointer_if_this_type(Pike_sp-2, PIKE_T_INT);
655:   }   BREAK;    +    OPCODE0(F_POST_DEC, "x--")   {    union anything *u=get_pointer_if_this_type(Pike_sp-2, PIKE_T_INT);
679:   }   BREAK;    + OPCODE1(F_ASSIGN_LOCAL,"assign local") +  assign_svalue(Pike_fp->locals+arg1,Pike_sp-1); + BREAK; +    OPCODE0(F_ASSIGN, "assign")    assign_lvalue(Pike_sp-3,Pike_sp-1);    free_svalue(Pike_sp-3);
687:    Pike_sp-=2;   BREAK;    + OPCODE2(F_APPLY_ASSIGN_LOCAL_AND_POP,"apply, assign local and pop") +  strict_apply_svalue(Pike_fp->context.prog->constants + arg1, Pike_sp - *--Pike_mark_sp ); +  free_svalue(Pike_fp->locals+arg2); +  Pike_fp->locals[arg2]=Pike_sp[-1]; +  Pike_sp--; + BREAK; +  + OPCODE2(F_APPLY_ASSIGN_LOCAL,"apply, assign local") +  strict_apply_svalue(Pike_fp->context.prog->constants + arg1, Pike_sp - *--Pike_mark_sp ); +  assign_svalue(Pike_fp->locals+arg2,Pike_sp-1); + BREAK; +    OPCODE0(F_ASSIGN_AND_POP, "assign and pop")    assign_lvalue(Pike_sp-3, Pike_sp-1);    pop_n_elems(3);   BREAK;    -  CASE(F_APPLY_ASSIGN_LOCAL); -  strict_apply_svalue(Pike_fp->context.prog->constants + GET_ARG(), Pike_sp - *--Pike_mark_sp ); -  /* Fall through */ +     -  CASE(F_ASSIGN_LOCAL); -  assign_svalue(Pike_fp->locals+GET_ARG(),Pike_sp-1); -  break; -  -  CASE(F_APPLY_ASSIGN_LOCAL_AND_POP); -  strict_apply_svalue(Pike_fp->context.prog->constants + GET_ARG(), Pike_sp - *--Pike_mark_sp ); -  /* Fall through */ -  +     CASE(F_ASSIGN_LOCAL_AND_POP);    instr=GET_ARG();    free_svalue(Pike_fp->locals+instr);
758:   }   BREAK;    +    /* Stack machine stuff */      OPCODE0(F_POP_VALUE, "pop")
1240:    print_return_value();    break;    - OPCODE1ACC(F_MAGIC_INDEX, "::`[]") -  push_magic_index(magic_index_program, acc, arg1); + OPCODE2(F_MAGIC_INDEX, "::`[]") +  push_magic_index(magic_index_program, arg2, arg1);   BREAK;    - OPCODE1ACC(F_MAGIC_SET_INDEX, "::`[]=") -  push_magic_index(magic_set_index_program, acc, arg1); + OPCODE2(F_MAGIC_SET_INDEX, "::`[]=") +  push_magic_index(magic_set_index_program, arg2, arg1);   BREAK;      OPCODE0(F_CAST, "cast")