Branch: Tag:

2014-12-04

2014-12-04 19:26:29 by Per Hedbor <ph@opera.com>

Removed some more unused code in encode.c.

Try to force noinline on the decode_error function.

466:    }   }    - static void zap_unfinished_program(struct program *p) - { -  int e; -  debug_malloc_touch(p); -  if(p->flags & PROGRAM_FIXED) return; /* allow natural zapping */ -  debug_malloc_touch(p); -  if(p->parent) -  { -  free_program(p->parent); -  p->parent=0; -  } -  for(e=0;e<p->num_constants;e++) -  { -  free_svalue(& p->constants[e].sval); -  mark_free_svalue (&p->constants[e].sval); -  } -  -  for(e=0;e<p->num_inherits;e++) -  { -  if(p->inherits[e].parent) -  { -  free_object(p->inherits[e].parent); -  p->inherits[e].parent=0; -  } -  if(e) -  { -  if(p->inherits[e].prog) -  { -  free_program(p->inherits[e].prog); -  p->inherits[e].prog=0; -  } -  } -  } - } -  +    /* force_encode == 0: Maybe dump the thing later, and only a forward    * reference here (applies to programs only).    *
2054:      static DECLSPEC(noreturn) void decode_error (    struct decode_data *data, struct svalue *decoding, const char *msg, ...) -  ATTRIBUTE((noreturn)); +  ATTRIBUTE((noinline,noreturn));      static DECLSPEC(noreturn) void decode_error (    struct decode_data *data, struct svalue *decoding, const char *msg, ...)
2065:    struct object *o = fast_clone_object (decode_error_program);    struct decode_error_struct *dec =    (struct decode_error_struct *) (o->storage + decode_error_offset); -  struct generic_error_struct *gen = -  (struct generic_error_struct *) get_storage (o, generic_error_program); +  struct generic_error_struct *gen = get_storage (o, generic_error_program);       ASSERT_THREAD_SWAPPED_IN();   
2450:    free_object(placeholder);   }    - static int init_placeholder(struct object *placeholder); +     -  +    #define SETUP_DECODE_MEMOBJ(TYPE, U, VAR, ALLOCATE,SCOUR) do { \    struct svalue *tmpptr; \    struct svalue tmp; \
4164:   #endif   }    - /* Placed after to prevent inlining */ - static int init_placeholder(struct object *placeholder) - { -  JMP_BUF rec; -  /* Initialize the placeholder. */ -  if(SETJMP(rec)) -  { -  dmalloc_touch_svalue(&throw_value); -  call_handle_error(); -  zap_placeholder(placeholder); -  UNSETJMP(rec); -  return 1; -  }else{ -  call_pike_initializers(placeholder,0); -  UNSETJMP(rec); -  return 0; -  } - } -  -  -  +    static struct decode_data *current_decode = NULL;      static void free_decode_data (struct decode_data *data, int delay,