Branch: Tag:

2001-04-14

2001-04-14 09:44:22 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

Jumbopatch:

Saved 8 bytes per object (for objects that do not use their parent scope),
fixed some memory leaks and
first implementation of constant objects (Gmp.Bignum, Math.Matrix and Image.Colour)

Rev: src/backend.cmod:1.14
Rev: src/builtin.cmod:1.27
Rev: src/builtin_functions.c:1.362
Rev: src/docode.c:1.111
Rev: src/encode.c:1.98
Rev: src/gc.c:1.149
Rev: src/interpret.c:1.191
Rev: src/las.c:1.251
Rev: src/main.c:1.123
Rev: src/modules/Gmp/mpz_glue.c:1.93
Rev: src/modules/Image/colors.c:1.49
Rev: src/modules/Math/math_matrix.c:1.22
Rev: src/modules/Oracle/oracle.c:1.56
Rev: src/modules/files/socket.c:1.54
Rev: src/object.c:1.169
Rev: src/object.h:1.62
Rev: src/program.c:1.314
Rev: src/program.h:1.125
Rev: src/threads.h:1.114
Rev: src/version.h:1.273

25:   #include "version.h"   #include "bignum.h"    - RCSID("$Id: encode.c,v 1.97 2001/04/10 09:51:42 hubbe Exp $"); + RCSID("$Id: encode.c,v 1.98 2001/04/14 09:44:19 hubbe Exp $");      /* #define ENCODE_DEBUG */   
797:    pop_stack();    code_number(p->flags,data);    code_number(p->storage_needed,data); +  code_number(p->xstorage,data); +  code_number(p->parent_info_storage,data); +     code_number(p->alignment_needed,data);    code_number(p->timestamp.tv_sec,data);    code_number(p->timestamp.tv_usec,data);    -  +  if(p->parent) +  ref_push_program(p->parent); +  else +  push_int(0); +  encode_value2(Pike_sp-1,data); +  pop_stack(); +    #define FOO(X,Y,Z) \    code_number( p->num_##Z, data);   #include "program_areas.h"
1435:    {    struct pike_type *t;    -  /* FIXME: Should check that num is 0 here. */ -  +     decode_type(t, data);    check_type_string(t);    push_type_value(t);
1708:    p->flags &= ~(PROGRAM_FINISHED | PROGRAM_OPTIMIZED);    p->flags |= PROGRAM_AVOID_CHECK;    decode_number(p->storage_needed,data); +  decode_number(p->xstorage,data); +  decode_number(p->parent_info_storage,data);    decode_number(p->alignment_needed,data);    decode_number(p->timestamp.tv_sec,data);    decode_number(p->timestamp.tv_usec,data);    -  +  decode_value2(data); +  switch(Pike_sp[-1].type) +  { +  case T_INT: +  p->parent=0; +  break; +  case T_PROGRAM: +  p->parent=Pike_sp[-1].u.program; +  break; +  case T_FUNCTION: +  p->parent=program_from_svalue(Pike_sp-1); +  break; +  default: +  Pike_error("Program decode failed!\n"); +  } +  if(p->parent) add_ref(p->parent); +  pop_stack(); +    #define FOO(X,Y,Z) \    decode_number( p->num_##Z, data);   #include "program_areas.h"