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: builtin.cmod,v 1.133 2003/04/27 16:17:33 mast Exp $ + || $Id: builtin.cmod,v 1.134 2003/04/28 00:32:42 mast Exp $   */      #include "global.h"
857:   #ifdef PIKE_DEBUG    if (d_flag>5) {    fprintf(stderr, -  "Failed to find symbol for program 0x%08p\n" +  "Failed to find symbol for program %p\n"    "Parent program info:\n",    func->u.program);    dump_program_tables(func->u.program->parent, 0);
1492:       if (numargs + varargs) {    bf->args = allocate_array_no_init(numargs + varargs, 0); +  bf->args->type_field =    assign_svalues_no_free(bf->args->item, f->locals, numargs, BIT_MIXED);    if (varargs) { -  +  bf->args->type_field |=    assign_svalues_no_free(bf->args->item + numargs,    f->locals[numargs].u.array->item,    varargs, BIT_MIXED);
1501:    }    }    } +  res->type_field = BIT_OBJECT;    /* NOTE: res has already been pushed on the stack. */   }   
2750:    INT32 x,e,tmp,size=0x7fffffff;    struct svalue *tmpargs=Pike_sp - args;    struct array *ret; +  TYPE_FIELD types;       for(e=0;e<args;e++)    {
2776:   #endif       push_array(ret=allocate_array(size)); +  types = 0;       for(x=0;x<size;x++)    {
2799:    apply_svalue(fun,args);    else    low_automap(d+1,depth,fun,real_args,args); -  dmalloc_touch_svalue(Pike_sp-1); -  ITEM(ret)[x]=*--Pike_sp; +  stack_pop_to_no_free (ITEM(ret) + x); +  types |= 1 << ITEM(ret)[x].type;    } -  +  ret->type_field = types;    stack_unlink(args);   }