pike.git
/
src
/
docode.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/docode.c:1:
/*\ ||| This file a part of Pike, and is copyright by Fredrik Hubinette ||| Pike is distributed as GPL (General Public License) ||| See the files COPYING and DISCLAIMER for more information. \*/ /**/ #include "global.h"
-
RCSID("$Id: docode.c,v 1.
67
2000
/
03
/
30
08
:
43
:
07
hubbe Exp $");
+
RCSID("$Id: docode.c,v 1.
68
2001
/
02
/
25
18
:
06
:
54
hubbe Exp $");
#include "las.h" #include "program.h" #include "language.h" #include "pike_types.h" #include "stralloc.h" #include "interpret.h" #include "constants.h" #include "array.h" #include "pike_macros.h" #include "error.h" #include "pike_memory.h" #include "svalue.h" #include "main.h" #include "lex.h" #include "builtin_functions.h" #include "peep.h" #include "docode.h" #include "operators.h" #include "object.h"
-
+
#include "mapping.h"
+
#include "multiset.h"
static int do_docode2(node *n,int flags); INT32 current_break=-1; INT32 current_continue=-1; static INT32 current_switch_case; static INT32 current_switch_default; static INT32 current_switch_values_on_stack; static INT32 *current_switch_jumptable =0;
pike.git/src/docode.c:64:
void do_pop(int x) { switch(x) { case 0: return; case 1: emit2(F_POP_VALUE); break; default: emit(F_POP_N_ELEMS,x); break; } }
-
#define DO_CODE_BLOCK(X) do_pop(do_docode((X),DO_NOT_COPY | DO_POP
| DO_DEFER_POP
))
+
#define DO_CODE_BLOCK(X) do_pop(do_docode((X),DO_NOT_COPY | DO_POP))
int do_docode(node *n,INT16 flags) { int i; int save_current_line=lex.current_line; if(!n) return 0; lex.current_line=n->line_number; i=do_docode2(check_node_hash(n), flags); lex.current_line=save_current_line;
pike.git/src/docode.c:483:
case F_RSH: case F_XOR: case F_OR: case F_AND: case F_NOT: case F_COMPL: case F_NEGATE: fatal("Optimizer error.\n"); case F_RANGE:
-
tmp1=do_docode(CAR(n),DO_NOT_COPY);
+
tmp1=do_docode(CAR(n),DO_NOT_COPY
_TOPLEVEL
);
if(do_docode(CDR(n),DO_NOT_COPY)!=2) fatal("Compiler internal error (at %ld).\n",(long)lex.current_line); emit2(n->token); return tmp1; case F_INC: case F_POST_INC: tmp1=do_docode(CAR(n),DO_LVALUE); #ifdef PIKE_DEBUG if(tmp1 != 2)
pike.git/src/docode.c:576:
if(arr->token==F_RANGE) { node **a1=my_get_arg(&_CDR(n),0); node **a2=my_get_arg(&_CDR(n),1); if(a1 && a2 && a2[0]->token==F_CONSTANT && a2[0]->u.sval.type==T_INT && a2[0]->u.sval.type==0x7fffffff && a1[0]->type == int_type_string) {
-
tmp2=do_docode(CAR(arr),DO_NOT_COPY);
+
tmp2=do_docode(CAR(arr),DO_NOT_COPY
_TOPLEVEL
);
do_docode(*a1,DO_NOT_COPY); goto foreach_arg_pushed; } } tmp2=do_docode(CAR(n),DO_NOT_COPY); emit2(F_CONST0); foreach_arg_pushed: #ifdef PIKE_DEBUG /* This is really ugly because there is always a chance that the bug
pike.git/src/docode.c:1204:
case T_ARRAY: case T_MAPPING: case T_MULTISET: tmp1=store_constant(&(n->u.sval), !(n->tree_info & OPT_EXTERNAL_DEPEND), n->name); emit(F_CONSTANT,tmp1); /* copy now or later ? */ if(!(flags & DO_NOT_COPY) && !(n->tree_info & OPT_EXTERNAL_DEPEND))
+
{
+
if(flags & DO_NOT_COPY_TOPLEVEL)
+
{
+
switch(n->u.sval.type)
+
{
+
case T_ARRAY:
+
array_fix_type_field(n->u.sval.u.array);
+
if(n->u.sval.u.array -> type_field & BIT_COMPLEX)
emit2(F_COPY_VALUE);
-
+
break;
+
+
case T_MAPPING:
+
mapping_fix_type_field(n->u.sval.u.mapping);
+
if((n->u.sval.u.mapping->data->ind_types |
+
n->u.sval.u.mapping->data->val_types) & BIT_COMPLEX)
+
emit2(F_COPY_VALUE);
+
break;
+
+
case T_MULTISET:
+
array_fix_type_field(n->u.sval.u.multiset->ind);
+
if(n->u.sval.u.multiset->ind-> type_field & BIT_COMPLEX)
+
emit2(F_COPY_VALUE);
+
break;
+
}
+
}else{
+
emit2(F_COPY_VALUE);
+
}
+
}
+
return 1; } case F_LOCAL: if(n->u.integer.a >= find_local_frame(n->u.integer.b)->max_number_of_locals) yyerror("Illegal to use local variable here."); if(n->u.integer.b)