Branch: Tag:

2003-04-28

2003-04-28 00:32:44 by Martin Stjernholm <mast@lysator.liu.se>

Improved type fields for arrays.

Rev: src/array.c:1.143
Rev: src/backend.cmod:1.42
Rev: src/builtin.cmod:1.134
Rev: src/builtin_functions.c:1.490
Rev: src/encode.c:1.172
Rev: src/interpret.c:1.304
Rev: src/iterators.cmod:1.41
Rev: src/main.c:1.175
Rev: src/mapping.c:1.166
Rev: src/modules/files/efuns.c:1.127
Rev: src/modules/system/memory.c:1.24
Rev: src/object.c:1.236
Rev: src/opcodes.c:1.145
Rev: src/operators.c:1.177
Rev: src/post_modules/Unicode/unicode_module.cmod:1.7
Rev: src/post_modules/_ADT/circular_list.cmod:1.8
Rev: src/post_modules/_ADT/sequence.cmod:1.8

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: opcodes.c,v 1.144 2003/04/27 17:52:42 mast Exp $ + || $Id: opcodes.c,v 1.145 2003/04/28 00:32:43 mast Exp $   */      #include "global.h"
30:      #define sp Pike_sp    - RCSID("$Id: opcodes.c,v 1.144 2003/04/27 17:52:42 mast Exp $"); + RCSID("$Id: opcodes.c,v 1.145 2003/04/28 00:32:43 mast Exp $");      void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)   {
679:    ref_push_array(a);    }else{    INT32 e; +  TYPE_FIELD types = 0;   #ifdef PIKE_DEBUG    struct svalue *save_sp=sp+1;   #endif
689:    {    push_svalue(tmp->item+e);    o_cast(itype, run_time_itype); -  array_set_index(a,e,sp-1); -  pop_stack(); +  stack_pop_to_no_free (ITEM(a) + e); +  types |= 1 << ITEM(a)[e].type;    } -  +  a->type_field = types;   #ifdef PIKE_DEBUG    if(save_sp!=sp)    Pike_fatal("o_cast left stack droppings.\n");
756:   #else /* PIKE_NEW_MULTISETS */    INT32 e;    struct array *a; +  TYPE_FIELD types = 0;    push_multiset(m=allocate_multiset(a=allocate_array(tmp->size)));       SET_CYCLIC_RET(m);
764:    {    push_svalue(tmp->item+e);    o_cast(itype, run_time_itype); -  array_set_index(a,e,sp-1); -  pop_stack(); +  stack_pop_to_no_free (ITEM(a) + e); +  types |= 1 << ITEM(a)[e].type;    } -  +  a->type_field = types;    order_multiset(m);   #endif