pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:157:   void compiler_discard_type (void)   {    ptrdiff_t len = pop_stack_mark();    TYPE_STACK_DEBUG("discard_type");    for (;len > 0; len--) {    /* Get rid of excess junk. */    compiler_discard_top_type();    }   }    + static struct pike_type *low_pop_type(void) + { +  TYPE_STACK_DEBUG("low_pop_type"); +  +  return *(Pike_compiler->type_stackp--); + } + #define low_pop_type() ((struct pike_type *)debug_malloc_pass(low_pop_type())) +    struct pike_type *debug_pop_type(void)   {    struct pike_type *t = pop_unfinished_type();    TYPE_STACK_DEBUG("pop_type");    type_stack_mark();    return t;   }      struct pike_type *debug_compiler_pop_type(void)   {
pike.git/src/pike_types.cmod:1029:   #endif /* PIKE_DEBUG */    *Pike_compiler->type_stackp = mk_type(type,    *Pike_compiler->type_stackp,    *(Pike_compiler->type_stackp+1),    PT_COPY_BOTH);    break;    default:    Pike_fatal("Illegal reverse joiner type: %d\n", type);    }   } + #define push_reverse_joiner_type(T) do { \ +  push_reverse_joiner_type(T); \ +  debug_malloc_touch(debug_peek_type_stack()); \ +  } while (0)      static void low_or_pike_types(struct pike_type *t1,    struct pike_type *t2,    int zero_implied);      void debug_push_type(unsigned int type)   {    /* fprintf(stderr, "push_type(%d)\n", type); */       switch(type & PIKE_T_MASK) {
pike.git/src/pike_types.cmod:1067:    } else {    Pike_compiler->type_stackp[-1] = Pike_compiler->type_stackp[0];    }    Pike_compiler->type_stackp--;    return;    }    if (Pike_compiler->type_stackp[0]->type == type) {    /* The top type is the same as our type.    * Split it and join the parts with the other type.    */ -  struct pike_type *top = *(Pike_compiler->type_stackp--); +  struct pike_type *top = low_pop_type();    push_finished_type(top->cdr);    push_type(type);    push_finished_type(top->car);    push_type(type);    free_type(top);    return;    }    if (type == T_OR) { -  struct pike_type *t1 = *(Pike_compiler->type_stackp--); -  struct pike_type *t2 = *(Pike_compiler->type_stackp--); +  struct pike_type *t1 = low_pop_type(); +  struct pike_type *t2 = low_pop_type();    low_or_pike_types(t1, t2, 0);    free_type(t2);    free_type(t1);    return;    }    /* FALLTHRU */    case T_FUNCTION:    case T_MANY:    case T_TUPLE:    case T_MAPPING:
pike.git/src/pike_types.cmod:1664:    }    }    TYPE_STACK_DEBUG("push_type_field");   }      INT32 extract_type_int(char *p)   {    return get_unaligned_be32(p);   }    - static struct pike_type *low_pop_type(void) - { -  TYPE_STACK_DEBUG("low_pop_type"); -  -  return *(Pike_compiler->type_stackp--); - } -  +    struct pike_type *debug_pop_unfinished_type(void)   {    ptrdiff_t len;       len = pop_stack_mark();       if (len != 1) {    Pike_fatal("pop_unfinished_type(): Unexpected len: %"PRINTPTRDIFFT"d\n", len);    }       TYPE_STACK_DEBUG("pop_unfinished_type");    -  return *(Pike_compiler->type_stackp--); +  return low_pop_type();   }      /******/      static struct pike_string *internal_parse_type_string(const char **_s)   {    const unsigned char **s = (const unsigned char **)_s;    const unsigned char *p;    struct string_builder tmp;    while(isspace(**s)) ++*s;
pike.git/src/pike_types.cmod:4425:       if (remap_flags & PT_FLAG_REMAP_TRACE) {    fprintf(stderr, "low_type_binop(0x%04x, ", op);    simple_describe_type(a);    fprintf(stderr, ", ");    simple_describe_type(b);    fprintf(stderr, ", %p, 0x%04x, 0x%04x, 0x%02x)\n",    remap, aflags, bflags, remap_flags);    }    -  ret = lower_type_binop(op, a, b, remap, -  aflags, bflags, remap_flags); +  ret = debug_malloc_pass(lower_type_binop(op, a, b, remap, +  aflags, bflags, remap_flags));       if (remap_flags & PT_FLAG_REMAP_TRACE) {    fprintf(stderr, "ret: ");    simple_describe_type(ret);    fprintf(stderr, "\n");    }      #ifdef PIKE_DEBUG    if ((save_type_stackp != Pike_compiler->type_stackp) ||    (save_mark_stackp != Pike_compiler->pike_type_mark_stackp)) {