pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*   || 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.424 2008/06/28 07:12:22 grubba Exp $ + || $Id: las.c,v 1.425 2008/06/28 11:01:53 mast Exp $   */      #include "global.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"
pike.git/src/las.c:5157:   }      ptrdiff_t eval_low(node *n,int print_error)   {    unsigned INT16 num_strings, num_constants;    unsigned INT32 num_program;    size_t jump;    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 */      #ifdef PIKE_DEBUG    if(l_flag > 3 && n)    {    fprintf(stderr,"Evaluating (tree info=%x):",n->tree_info);    print_tree(n);    }
pike.git/src/las.c:5193:    ret=-1;    if(!Pike_compiler->num_parse_error)    {    struct callback *tmp_callback;    struct timer_oflo foo;       /* This is how long we try to optimize before giving up... */    foo.counter=10000;    foo.yes=0;    -  if (prog->num_program > malloc_prog->total_size) { +    #ifdef PIKE_USE_MACHINE_CODE -  char *start = (char *) (prog->program + malloc_prog->total_size); -  size_t len = (prog->num_program - malloc_prog->total_size) * -  sizeof (prog->program[0]); -  make_area_executable (start, len); +  make_area_executable ((char *) (prog->program + num_program), +  (prog->num_program - num_program) * +  sizeof (prog->program[0]));   #endif -  malloc_prog->total_size = prog->num_program; -  } +        tmp_callback=add_to_callback(&evaluator_callbacks,    check_evaluation_time,    (void *)&foo,0);       if(apply_low_safe_and_stupid(Pike_compiler->fake_object, jump))    {    if(print_error)    /* Generate error message */    if(!Pike_compiler->catch_level)
pike.git/src/las.c:5267: Inside #if defined(PIKE_USE_MACHINE_CODE)
  #ifdef PIKE_USE_MACHINE_CODE    prog->num_relocations = num_relocations;      #ifdef VALGRIND_DISCARD_TRANSLATIONS    /* We won't use this machine code any more... */    VALGRIND_DISCARD_TRANSLATIONS(prog->program + num_program,    (prog->num_program - num_program)*sizeof(PIKE_OPCODE_T));   #endif /* VALGRIND_DISCARD_TRANSLATIONS */   #endif /* PIKE_USE_MACHINE_CODE */    -  malloc_prog->total_size = prog->num_program = num_program; +  prog->num_program = num_program;       return ret;   }      static node *eval(node *n)   {    node *new;    ptrdiff_t args;       if(!is_const(n) || n->node_info & OPT_FLAG_NODE)