Branch: Tag:

2008-06-28

2008-06-28 03:25:51 by Martin Stjernholm <mast@lysator.liu.se>

Don't flush the instruction cache over and over again for the same area in
eval_low when machine code is used. This should speed up constant evaluation
a bit (benchmarks run about 8% faster overall for ia32).

Rev: src/las.c:1.421
Rev: src/program.c:1.723
Rev: src/program.h:1.254

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: las.c,v 1.420 2008/06/28 01:26:36 mast Exp $ + || $Id: las.c,v 1.421 2008/06/28 03:25:51 mast Exp $   */      #include "global.h"
5164:    struct svalue *save_sp = Pike_sp;    ptrdiff_t ret;    struct program *prog = Pike_compiler->new_program; +  struct program *malloc_prog = Pike_compiler->malloc_size_program;   #ifdef PIKE_USE_MACHINE_CODE    size_t num_relocations;   #endif /* PIKE_USE_MACHINE_CODE */
5199:    foo.counter=10000;    foo.yes=0;    -  make_program_executable(prog); +  if (prog->num_program > malloc_prog->total_size) { +  char *start = (char *) (prog->program + malloc_prog->total_size); +  size_t len = (malloc_prog->num_program - malloc_prog->total_size) * +  sizeof (prog->program[0]); +  make_area_executable (start, len); +  malloc_prog->total_size = malloc_prog->num_program; +  }       tmp_callback=add_to_callback(&evaluator_callbacks,    check_evaluation_time,