Branch: Tag:

2004-12-18

2004-12-18 18:07:16 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added opcode F_THIS.

Rev: src/interpret_functions.h:1.179

2:   || 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: interpret_functions.h,v 1.178 2004/12/04 14:07:20 grubba Exp $ + || $Id: interpret_functions.h,v 1.179 2004/12/18 18:07:16 grubba Exp $   */      /*
406:    });   });    -  +    OPCODE2(F_EXTERNAL_LVALUE, "& external", I_UPDATE_SP, {    LOCAL_VAR(struct external_variable_context loc);   
2479:    stack_dup();   });    + OPCODE2(F_THIS, "this", I_UPDATE_SP, { +  LOCAL_VAR(struct external_variable_context loc); +  +  loc.o = Pike_fp->current_object; +  loc.parent_identifier = Pike_fp->fun; +  if (loc.o->prog) +  loc.inherit = INHERIT_FROM_INT(loc.o->prog, loc.parent_identifier); +  find_external_context(&loc, arg1); +  +  DO_IF_DEBUG({ +  TRACE((5,"- Identifier=%d Offset=%d\n", +  arg1, +  loc.inherit->identifier_level)); +  }); +  if (loc.o->prog) { +  ref_push_object_inherit(loc.o, +  (loc.inherit - loc.o->prog->inherits) + arg2); +  } else { +  ref_push_object(loc.o); +  } +  print_return_value(); + }); +    /*   #undef PROG_COUNTER   */