Branch: Tag:

2003-02-16

2003-02-16 04:05:16 by Martin Stjernholm <mast@lysator.liu.se>

Cleaned up and wrote some helpful notes about the lvalue handling.

Rev: src/builtin.cmod:1.120
Rev: src/code/ia32.c:1.24
Rev: src/interpret.c:1.291
Rev: src/interpret_functions.h:1.138
Rev: src/object.c:1.225
Rev: src/pike_types.c:1.207
Rev: src/svalue.c:1.159
Rev: src/svalue.h:1.116

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.c,v 1.290 2003/02/15 17:33:33 grubba Exp $ + || $Id: interpret.c,v 1.291 2003/02/16 03:59:57 mast Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.290 2003/02/15 17:33:33 grubba Exp $"); + RCSID("$Id: interpret.c,v 1.291 2003/02/16 03:59:57 mast Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"
286:    * array[index] : { array, index }    * mapping[index] : { mapping, index }    * multiset[index] : { multiset, index } -  * object[index] : { object, index } -  * local variable : { svalue_pointer, nothing } -  * global variable : { svalue_pointer/short_svalue_pointer, nothing } +  * object[index] : { object, index } (external object indexing) +  * local variable : { svalue pointer (T_SVALUE_PTR), nothing (T_VOID) } +  * global variable : { object, identifier index (T_OBJ_INDEX) } (internal object indexing)    */      void lvalue_to_svalue_no_free(struct svalue *to,struct svalue *lval)
315:    break;    }    -  case T_LVALUE: +  case T_SVALUE_PTR:    assign_svalue_no_free(to, lval->u.lval);    break;    -  case T_SHORT_LVALUE: -  assign_from_short_svalue_no_free(to, lval->u.short_lval, -  (TYPE_T)lval->subtype); -  break; -  +     case T_OBJECT: -  +  if (lval[1].type == T_OBJ_INDEX) +  low_object_index_no_free (to, lval->u.object, lval[1].u.identifier); +  else    object_index_no_free(to, lval->u.object, lval+1);    break;   
383:    }    break;    -  case T_LVALUE: +  case T_SVALUE_PTR:    assign_svalue(lval->u.lval,from);    break;    -  case T_SHORT_LVALUE: -  assign_to_short_svalue(lval->u.short_lval, (TYPE_T)lval->subtype, from); -  break; -  +     case T_OBJECT: -  +  if (lval[1].type == T_OBJ_INDEX) +  object_low_set_index (lval->u.object, lval[1].u.identifier, from); +  else    object_set_index(lval->u.object, lval+1, from);    break;   
431:    case T_ARRAY_LVALUE:    return 0;    -  case T_LVALUE: +  case T_SVALUE_PTR:    if(lval->u.lval->type == t) return & ( lval->u.lval->u );    return 0;    -  case T_SHORT_LVALUE: -  if(lval->subtype == t) return lval->u.short_lval; -  return 0; -  +     case T_OBJECT:    return object_get_item_ptr(lval->u.object,lval+1,t);   
2045:    struct svalue *arg = f->locals + i;       switch (arg->type) { -  case T_LVALUE: -  fputs ("lvalue", stderr); -  break; -  +     case T_INT:    fprintf (stderr, "%ld", (long) arg->u.integer);    break;