pike.git
/
src
/
docode.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/docode.c:1243:
} low_insert_label( (INT32)tmp2 ); current_switch.jumptable = prev_switch_jumptable; return adroppings; } case F_MULTI_ASSIGN: if (flags & DO_POP) {
-
emit_multi_assign(
CAR
(n),
CDR
(n), 0);
+
emit_multi_assign(
CDR
(n),
CAR
(n), 0);
return 0; } else { /* Fall back to the normal assign case. */
-
tmp1=do_docode(
CDR
(n),DO_LVALUE);
+
tmp1=do_docode(
CAR
(n),DO_LVALUE);
#ifdef PIKE_DEBUG if(tmp1 & 1) Pike_fatal("Very internal compiler error.\n"); #endif emit1(F_ARRAY_LVALUE, (INT32)(tmp1>>1) ); emit0(F_MARK); PUSH_CLEANUP_FRAME(do_pop_mark, 0);
-
do_docode(
CAR
(n), 0);
+
do_docode(
CDR
(n), 0);
emit_apply_builtin("aggregate"); POP_AND_DONT_CLEANUP; emit0(F_ASSIGN); return 1; } case F_ASSIGN_SELF: /* in assign self we know this: * * car(n) = lvalue * cdr(n)= softcast(apply(efun, arglist(car(n),one more arg))) * * The first argument of the arglist is equal to the lvalue. * * We only want to evaluate car(n) once. */
-
if(
CDR
(n)->token == F_AUTO_MAP_MARKER )
+
if(
CAR
(n)->token == F_AUTO_MAP_MARKER )
yyerror("[*] is not yet supported here\n");
-
return emit_ltosval_call_and_assign(
CDR
(n),
CAAAR
(n),
CDAAR
(n) );
+
return emit_ltosval_call_and_assign(
CAR
(n),
CAADR
(n),
CDADR
(n) );
case F_ASSIGN:
-
if(
CDR
(n)->token == F_AUTO_MAP_MARKER )
+
if(
CAR
(n)->token == F_AUTO_MAP_MARKER )
{ int depth = 0;
-
node *lval =
CDR
(n);
+
node *lval =
CAR
(n);
while( lval->token == F_AUTO_MAP_MARKER ) {
-
lval =
CAR
(lval);
+
lval =
CDR
(lval);
depth++; } do_docode(lval,0); /* note: not lvalue */
-
if(do_docode(
CAR
(n),0)!=1)
+
if(do_docode(
CDR
(n),0)!=1)
yyerror("RHS is void!");
-
if(
CAR
(n)->token == F_AUTO_MAP_MARKER ||
-
CAR
(n)->token == F_AUTO_MAP ||
+
if(
CDR
(n)->token == F_AUTO_MAP_MARKER ||
+
CDR
(n)->token == F_AUTO_MAP ||
/* Well, hello there... ;) */ /* This is what is generated by a[*] += 10 and such. */
-
(
CAR
(n)->token == F_SOFT_CAST &&
-
has_automap(
CAR
(n))))
+
(
CDR
(n)->token == F_SOFT_CAST &&
+
has_automap(
CDR
(n))))
{ emit1(F_ASSIGN_INDICES,depth); } else { emit1(F_ASSIGN_ALL_INDICES,depth); } if( flags & DO_POP ) emit0( F_POP_VALUE ); return !(flags&DO_POP); }
-
switch(
CAR
(n)->token)
+
switch(
CDR
(n)->token)
{ case F_RANGE:
-
if(node_is_eq(
CDR
(n),
CAAR
(n)))
+
if(node_is_eq(
CAR
(n),
CADR
(n)))
{ int num_args; /* tmp1=do_docode(CDR(n),DO_LVALUE); */
-
if(match_types(
CDR
(n)->type, array_type_string) ||
-
match_types(
CDR
(n)->type, string_type_string) ||
-
match_types(
CDR
(n)->type, object_type_string) ||
-
match_types(
CDR
(n)->type, multiset_type_string) ||
-
match_types(
CDR
(n)->type, mapping_type_string))
+
if(match_types(
CAR
(n)->type, array_type_string) ||
+
match_types(
CAR
(n)->type, string_type_string) ||
+
match_types(
CAR
(n)->type, object_type_string) ||
+
match_types(
CAR
(n)->type, multiset_type_string) ||
+
match_types(
CAR
(n)->type, mapping_type_string))
{
-
do_docode(
CDR
(n),DO_LVALUE);
-
num_args = do_docode(
CDAR
(n), 0);
+
do_docode(
CAR
(n),DO_LVALUE);
+
num_args = do_docode(
CDDR
(n), 0);
switch (num_args) { case 0: emit0(F_LTOSVAL_AND_FREE); break; case 1: emit0(F_LTOSVAL2_AND_FREE); break; case 2: emit0(F_LTOSVAL3_AND_FREE); break; #ifdef PIKE_DEBUG default: Pike_fatal("Arglebargle glop-glyf?\n"); #endif } }else{ goto do_not_suboptimize_assign; emit0(F_LTOSVAL);
-
num_args = do_docode(
CDAR
(n), 0);
+
num_args = do_docode(
CDDR
(n), 0);
}
-
if (
CAR
(n)->token == F_RANGE)
-
emit_range (
CAR
(n) DO_IF_DEBUG (COMMA num_args));
+
if (
CDR
(n)->token == F_RANGE)
+
emit_range (
CDR
(n) DO_IF_DEBUG (COMMA num_args));
else
-
emit0(
CAR
(n)->token);
+
emit0(
CDR
(n)->token);
emit0(n->token); return n->token==F_ASSIGN; /* So when is this false? /mast */ } goto do_not_suboptimize_assign; case F_SOFT_CAST: /* a = [type]`oper(a,*) */
-
if(
CAAR
(n)->token == F_APPLY &&
-
is_apply_constant_function_arg0(
CAAR
(n),
CDR
(n) ))
+
if(
CADR
(n)->token == F_APPLY &&
+
is_apply_constant_function_arg0(
CADR
(n),
CAR
(n) ))
return 1; goto do_not_suboptimize_assign; case F_APPLY: /* a = `oper(a,*) */
-
if (is_apply_constant_function_arg0(
CAR
(n),
CDR
(n) ))
+
if (is_apply_constant_function_arg0(
CDR
(n),
CAR
(n) ))
return 1; /* FALL_THROUGH */ default: do_not_suboptimize_assign:
-
switch(
CDR
(n)->token)
+
switch(
CAR
(n)->token)
{ case F_GLOBAL:
-
if(
CDR
(n)->u.integer.b) goto normal_assign;
-
code_expression(
CAR
(n), 0, "RHS");
-
emit_assign_global(
CDR
(n)->u.integer.a, flags & DO_POP );
+
if(
CAR
(n)->u.integer.b) goto normal_assign;
+
code_expression(
CDR
(n), 0, "RHS");
+
emit_assign_global(
CAR
(n)->u.integer.a, flags & DO_POP );
break; case F_LOCAL:
-
if(
CDR
(n)->u.integer.a >=
-
find_local_frame(
CDR
(n)->u.integer.b)->max_number_of_locals)
+
if(
CAR
(n)->u.integer.a >=
+
find_local_frame(
CAR
(n)->u.integer.b)->max_number_of_locals)
yyerror("Illegal to use local variable here.");
-
if(
CDR
(n)->u.integer.b) goto normal_assign;
+
if(
CAR
(n)->u.integer.b) goto normal_assign;
-
if (
CDR
(n)->node_info & OPT_ASSIGNMENT) {
+
if (
CAR
(n)->node_info & OPT_ASSIGNMENT) {
/* Initialize. */ emit0(F_CONST0);
-
emit1(F_ASSIGN_LOCAL_AND_POP,
CDR
(n)->u.integer.a);
+
emit1(F_ASSIGN_LOCAL_AND_POP,
CAR
(n)->u.integer.a);
}
-
code_expression(
CAR
(n), 0, "RHS");
+
code_expression(
CDR
(n), 0, "RHS");
emit1(flags & DO_POP ? F_ASSIGN_LOCAL_AND_POP:F_ASSIGN_LOCAL,
-
CDR
(n)->u.integer.a );
+
CAR
(n)->u.integer.a );
break; case F_GET_SET: { /* Check for the setter function. */ struct program_state *state = Pike_compiler;
-
int program_id =
CDR
(n)->u.integer.a;
+
int program_id =
CAR
(n)->u.integer.a;
int level = 0; while (state && (state->new_program->id != program_id)) { state = state->previous; level++; } if (!state) { yyerror("Lost parent."); } else { struct reference *ref =
-
PTR_FROM_INT(state->new_program,
CDR
(n)->u.integer.b);
+
PTR_FROM_INT(state->new_program,
CAR
(n)->u.integer.b);
struct identifier *id = ID_FROM_PTR(state->new_program, ref); struct inherit *inh = INHERIT_FROM_PTR(state->new_program, ref); int f; #ifdef PIKE_DEBUG if (!IDENTIFIER_IS_VARIABLE(id->identifier_flags) || (id->run_time_type != PIKE_T_GET_SET)) { Pike_fatal("Not a getter/setter in a F_GET_SET node!\n" " identifier_flags: 0x%08x\n"
pike.git/src/docode.c:1427:
#endif /* PIKE_DEBUG */ f = id->func.gs_info.setter; if (f == -1) { yywarning("Variable %S lacks a setter.", id->name); } else if (!level) { f += inh->identifier_level; if (flags & DO_POP) { #ifndef USE_APPLY_N emit0(F_MARK); #endif
-
code_expression(
CAR
(n), 0, "RHS");
+
code_expression(
CDR
(n), 0, "RHS");
} else { code_expression(CAR(n), 0, "RHS"); #ifndef USE_APPLY_N emit0(F_MARK); #endif emit0(F_DUP); } #ifdef USE_APPLY_N emit2(F_CALL_LFUN_N, f, 1); #else emit1(F_CALL_LFUN, f); #endif emit0(F_POP_VALUE); return !(flags & DO_POP); } } } /* FALL_THROUGH */ case F_EXTERNAL: /* Check that it is in this context */
-
if(Pike_compiler ->new_program->id ==
CDR
(n)->u.integer.a)
+
if(Pike_compiler ->new_program->id ==
CAR
(n)->u.integer.a)
{ /* Check that it is a variable */
-
if(
CDR
(n)->u.integer.b != IDREF_MAGIC_THIS &&
-
IDENTIFIER_IS_VARIABLE( ID_FROM_INT(Pike_compiler->new_program,
CDR
(n)->u.integer.b)->identifier_flags))
+
if(
CAR
(n)->u.integer.b != IDREF_MAGIC_THIS &&
+
IDENTIFIER_IS_VARIABLE( ID_FROM_INT(Pike_compiler->new_program,
CAR
(n)->u.integer.b)->identifier_flags))
{
-
code_expression(
CAR
(n), 0, "RHS");
-
emit_assign_global(
CDR
(n)->u.integer.b, flags & DO_POP );
+
code_expression(
CDR
(n), 0, "RHS");
+
emit_assign_global(
CAR
(n)->u.integer.b, flags & DO_POP );
break; } } /* fall through */ default: normal_assign:
-
tmp1=do_docode(
CDR
(n),DO_LVALUE);
-
if(do_docode(
CAR
(n),0)!=1) yyerror("RHS is void!");
+
tmp1=do_docode(
CAR
(n),DO_LVALUE);
+
if(do_docode(
CDR
(n),0)!=1) yyerror("RHS is void!");
emit0(flags & DO_POP ? F_ASSIGN_AND_POP:F_ASSIGN); break; } return flags & DO_POP ? 0 : 1; } case F_LAND: case F_LOR: tmp1=alloc_label(); if(flags & DO_POP)