pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:4710:       /* First check for markers. */    switch(a?a->type:PIKE_T_UNKNOWN) {    case T_ASSIGN:    {    int marker;    tmp = low_type_binop(PT_BINOP_AND, a->cdr, b, remap,    aflags, bflags, remap_flags);       marker = alloc_remap_marker(remap, CAR_TO_INT(a), remap_flags); +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "$%d = ", marker); +  simple_describe_type(tmp); +  fprintf(stderr, "\n"); +  simple_describe_remap_state(remap); +  }    /* Marker value */    store_marker(remap, marker, tmp, remap_flags);       if (op != PT_BINOP_AND) {    if ((op == PT_BINOP_MINUS) && !tmp) {    tmp = a->cdr;    if (tmp) add_ref(tmp);    } else if ((op == PT_BINOP_MINUS) && (tmp == a->cdr)) {    free_type(tmp);    tmp = NULL;    } else {    free_type(tmp);    tmp = low_type_binop(op, a->cdr, b, remap,    aflags, bflags, remap_flags);    }    }    -  +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "$%d = ", marker | 0x100); +  simple_describe_type(tmp); +  fprintf(stderr, " (backpatch value)\n"); +  simple_describe_remap_state(remap); +  }    /* Value to backpatch. */    store_marker(remap, marker | 0x100, tmp, remap_flags);       if (!tmp) return NULL;       type_stack_mark();    push_finished_type(tmp);    push_assign_type(marker);    free_type(tmp);    return pop_unfinished_type();
pike.git/src/pike_types.cmod:4748:    }    switch(b?b->type:PIKE_T_UNKNOWN) {    case T_ASSIGN:    {    int marker;    tmp = low_type_binop(PT_BINOP_AND, a, b->cdr, remap,    aflags, bflags, remap_flags);       marker = alloc_remap_marker(remap, CAR_TO_INT(b),    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS); +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "$%d = ", marker); +  simple_describe_type(tmp); +  fprintf(stderr, "\n"); +  simple_describe_remap_state(remap); +  }    /* Marker value */    store_marker(remap, marker, tmp,    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS);       if (op != PT_BINOP_AND) {    if ((op == PT_BINOP_MINUS) && !tmp) {    tmp = a;    if (tmp) add_ref(tmp);    } else if ((op == PT_BINOP_MINUS) && (tmp == a)) {    free_type(tmp);    tmp = NULL;    } else {    free_type(tmp);    tmp = low_type_binop(op, a, b->cdr, remap,    aflags, bflags, remap_flags);    }    }    -  +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "$%d = ", marker | 0x100); +  simple_describe_type(tmp); +  fprintf(stderr, " (backpatch value)\n"); +  simple_describe_remap_state(remap); +  }    /* Value to backpatch. */    store_marker(remap, marker | 0x100, tmp,    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS);       /* NB: We can only keep the marker assignment in the PT_BINOP_AND    * case.    *    * See also the b->type == '0'..'9' case further below.    */    if ((op == PT_BINOP_AND) && tmp) {
pike.git/src/pike_types.cmod:5002:    * A - (B | C) == (A - B) - C    * rather than    * A - (B | C) == (A - B) & (A - C)    *    * A | (B | C) == (A | B) | C    * rather than    * A | (B | C) == (A | B) | (A | C)    */    tmp2 = remap_markers(b->cdr, remap,    remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS); +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "tmp: "); +  simple_describe_type(tmp); +  fprintf(stderr, "\ntmp2: "); +  simple_describe_type(tmp2); +  fprintf(stderr, "\nop: 0x%04x\n", op); +  }    ret = low_type_binop(op, tmp, tmp2, NULL, aflags, bflags, 0); -  +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "tmp op tmp2: "); +  simple_describe_type(ret); +  fprintf(stderr, "\n"); +  }    if (orig_markers) {    do_free_mapping(remap->markers[marker_set]);    remap->markers[marker_set] = orig_markers;    }    free_type(tmp);    free_type(tmp2);    return ret;    }    /* op secondary    * 0 0000 0 0000
pike.git/src/pike_types.cmod:6185:    break;    }    }    if (i < nbounds) {    push_int_type(bound, bounds[i]-1);    } else {    push_int_type(bound, MAX_INT32);    }    }    +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "bounds: "); +  for (i = 0; i < nbounds; i++) { +  fprintf(stderr, "%s%d[0b%d%d]", i?", ":"", bounds[i], +  (ab[i]>>1) & 1, ab[i] & 1); +  } +  fprintf(stderr, "\n"); +  if (!peek_stack_mark()) { +  fprintf(stderr, "==> NULL\n"); +  } +  } +     nbounds = peek_stack_mark();    if (!nbounds) {    pop_stack_mark();    return NULL;    }       if ((op == PT_BINOP_MINUS) && (aflags & PT_FLAG_CMP_INSEPARABLE)) {    if ((nbounds != 1) || (peek_type_stack() != a)) {    compiler_discard_type();    return NULL;    }    }       /* NB: Loop starts at 1! */    for (i = 1; i < nbounds; i++) {    push_type(T_OR);    } -  +  +  if (remap_flags & PT_FLAG_REMAP_TRACE) { +  fprintf(stderr, "==> "); +  simple_describe_type(peek_type_stack()); +  fprintf(stderr, "\n"); +  } +     return pop_unfinished_type();    }       case T_ARRAY:    case T_MAPPING:    case T_STRING:    /* FIXME: Handle PT_FLAG_CMP_INSEPARABLE. */    /* FIXME: The recursive op should probably be inverted. */    tmp = low_type_binop(op, a->car, b->car, remap,    0, 0, remap_flags);