pike.git
/
src
/
docode.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/docode.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: docode.c,v 1.
183
2004
/
12
/
30
13
:
41
:
08
grubba
Exp $
+
|| $Id: docode.c,v 1.
184
2006
/
02
/
25
04
:
05
:
32
mast
Exp $
*/ #include "global.h" #include "las.h" #include "program.h" #include "pike_types.h" #include "stralloc.h" #include "interpret.h" #include "constants.h" #include "array.h"
pike.git/src/docode.c:193:
return lbl; } #define LBLCACHESIZE 4711 #define CURRENT_INSTR ((long)instrbuf.s.len / (long)sizeof(p_instr)) #define MAX_UNWIND 100 static int lbl_cache[LBLCACHESIZE];
-
int do_branch(INT32 lbl)
+
static
int do_branch(INT32 lbl)
{ if(lbl==-1) { lbl=alloc_label(); }else{ INT32 last,pos=lbl_cache[lbl % LBLCACHESIZE]; if(pos < (last=CURRENT_INSTR) && (CURRENT_INSTR - pos) < MAX_UNWIND) { #define BUF ((p_instr *)instrbuf.s.str) if(BUF[pos].opcode == F_LABEL && BUF[pos].arg == lbl)
pike.git/src/docode.c:224:
} } } } } emit1(F_BRANCH, lbl); return lbl; }
-
void low_insert_label(int lbl)
+
static
void low_insert_label(int lbl)
{ lbl_cache[ lbl % LBLCACHESIZE ] = CURRENT_INSTR; emit1(F_LABEL, lbl); }
-
int ins_label(int lbl)
+
static
int ins_label(int lbl)
{ if(lbl==-1) lbl=alloc_label(); low_insert_label(lbl); return lbl; } void do_pop(int x) { #ifdef PIKE_DEBUG if (x < 0) Pike_fatal("Cannot do pop of %d args.\n", x); #endif switch(x) { case 0: return; case 1: emit0(F_POP_VALUE); break; default: emit1(F_POP_N_ELEMS,x); break; } current_stack_depth -= x; }
-
void do_pop_mark(void *ignored)
+
static
void do_pop_mark(void *ignored)
{ emit0(F_POP_MARK); }
-
void do_pop_to_mark(void *ignored)
+
static
void do_pop_to_mark(void *ignored)
{ emit0(F_POP_TO_MARK); }
-
void do_cleanup_synch_mark(void)
+
static
void do_cleanup_synch_mark(void)
{ if (d_flag > 2) emit0(F_CLEANUP_SYNCH_MARK); }
-
void do_escape_catch(void)
+
static
void do_escape_catch(void)
{ emit0(F_ESCAPE_CATCH); } #define DO_CODE_BLOCK(X) do_pop(do_docode((X),DO_NOT_COPY | DO_POP )) int do_docode(node *n, int flags) { int i; int stack_depth_save = current_stack_depth;
pike.git/src/docode.c:424:
static INLINE struct compiler_frame *find_local_frame(INT32 depth) { struct compiler_frame *f=Pike_compiler->compiler_frame; while(--depth>=0) f=f->previous; return f; } /* Emit code for a function call to the identifier reference #id, * with the arguments specified by args. */
-
int do_lfun_call(int id, node *args)
+
static
int do_lfun_call(int id, node *args)
{ #if 1 struct reference *ref = Pike_compiler->new_program->identifier_references + id; /* Test description: * * * Test if we have a valid current function. * * * Quick check if id is the current function.