pike.git / src / docode.c

version» Context lines:

pike.git/src/docode.c:2577:    }       while (Pike_sp > save_sp) {    do_jump(F_CATCH_AT, Pike_sp[-1].u.integer);    emit0(F_ENTRY);    pop_stack();    }       do_pop(1); /* Pop the return value. */    } +  +  /* Call the resumption callback. */ +  emit1(F_MARK_AND_LOCAL, +  Pike_compiler->compiler_frame->generator_local + 3); +  tmp1 = do_jump(F_BRANCH_AND_POP_WHEN_ZERO, -1); +  emit1(F_LOCAL, +  Pike_compiler->compiler_frame->generator_local + 2); +  emit0(F_CALL_FUNCTION_AND_POP); +  tmp2 = do_jump(F_BRANCH, -1); +  ins_label(tmp1); +  emit0(F_POP_MARK); +  ins_label(tmp2);    }    return 0;    }       case F_SSCANF:    tmp1=do_docode(CAR(n),DO_NOT_COPY);    tmp2=do_docode(CDR(n),DO_NOT_COPY | DO_LVALUE);    emit1(F_SSCANF, (INT32)(tmp1+tmp2));    return 1;   
pike.git/src/docode.c:2980:   /* Used to generate code for functions. */   INT32 do_code_block(node *n, int identifier_flags)   {    struct compilation *c = THIS_COMPILATION;    struct reference *id = NULL;    INT32 entry_point;    INT32 generator_switch = -1, *generator_jumptable = NULL;    int aggregate_cnum = -1;    int save_stack_depth = current_stack_depth;    int save_label_no = label_no; +  int tmp1, tmp2;    current_stack_depth = 0;       if (Pike_compiler->compiler_frame->current_function_number >= 0) {    id = Pike_compiler->new_program->identifier_references +    Pike_compiler->compiler_frame->current_function_number;    }       init_bytecode();    label_no=1;       /* NOTE: This is no ordinary label... */    low_insert_label(0);    emit0(F_ENTRY);    emit0(F_START_FUNCTION);       if (Pike_compiler->compiler_frame->generator_local != -1) {    INT32 e, states;    -  /* Zap any initial junk on the stack. */ +  /* Save the arguments for later. +  * +  * NB: apply_low() ensures that we always have exactly 2 arguments. +  */ +  emit1(F_ASSIGN_LOCAL_AND_POP, +  Pike_compiler->compiler_frame->generator_local + 3); +  emit1(F_ASSIGN_LOCAL_AND_POP, +  Pike_compiler->compiler_frame->generator_local + 2); +  +  /* Zap the arguments to be able to restore the stack. */    emit1(F_MARK_AT, 0);    emit0(F_POP_TO_MARK);       /* Restore the stack content and zap extra references. */    emit1(F_RESTORE_STACK_FROM_LOCAL,    Pike_compiler->compiler_frame->generator_local + 1);       /* Emit the state-machine switch for the generator. */    emit1(F_LOCAL, Pike_compiler->compiler_frame->generator_local);    emit1(F_NUMBER, -1);
pike.git/src/docode.c:3057:       /* Termination state. (-1, default) */    Pike_compiler->compiler_frame->generator_jumptable[    Pike_compiler->compiler_frame->generator_index++] = ins_label(-1);    emit0(F_UNDEFINED);    emit0(F_RETURN);       /* Start. (0) */    Pike_compiler->compiler_frame->generator_jumptable[    Pike_compiler->compiler_frame->generator_index++] = ins_label(-1); +  +  /* Call the resumption callback. */ +  emit1(F_MARK_AND_LOCAL, +  Pike_compiler->compiler_frame->generator_local + 3); +  tmp1 = do_jump(F_BRANCH_AND_POP_WHEN_ZERO, -1); +  emit1(F_LOCAL, +  Pike_compiler->compiler_frame->generator_local + 2); +  emit0(F_CALL_FUNCTION_AND_POP); +  tmp2 = do_jump(F_BRANCH, -1); +  ins_label(tmp1); +  emit0(F_POP_MARK); +  ins_label(tmp2);    } else {    if (Pike_compiler->compiler_frame->num_args) {    emit2(F_FILL_STACK, Pike_compiler->compiler_frame->num_args, 1);    }    emit1(F_MARK_AT, Pike_compiler->compiler_frame->num_args);    if (identifier_flags & IDENTIFIER_VARARGS) {    struct svalue *sval =    simple_mapping_string_lookup(get_builtin_constants(), "aggregate");    if (!sval) {    yyerror("predef::aggregate() is missing.\n");