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.
42
1998
/
11
/
22
11
:
02
:
41
hubbe Exp $");
+
RCSID("$Id: docode.c,v 1.
43
2001
/
02
/
25
18
:
19
:
03
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:444:
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:1081:
return 1; case T_ARRAY: case T_MAPPING: case T_MULTISET: tmp1=store_constant(&(n->u.sval),!(n->tree_info & OPT_EXTERNAL_DEPEND)); 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->ind_types |
+
n->u.sval.u.mapping->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.number >= compiler_frame->max_number_of_locals) yyerror("Illegal to use local variable here."); if(flags & WANT_LVALUE) { emit(F_LOCAL_LVALUE,n->u.number);