strstart:
   60|     33|{
   61|     33|    const char *p, *q;
   62|     33|    p = str;
   63|     33|    q = val;
   64|     33|    while (*q != '\0') {
  ------------------
  |  Branch (64:12): [True: 33, False: 0]
  ------------------
   65|     33|        if (*p != *q)
  ------------------
  |  Branch (65:13): [True: 33, False: 0]
  ------------------
   66|     33|            return 0;
   67|      0|        p++;
   68|      0|        q++;
   69|      0|    }
   70|      0|    if (ptr)
  ------------------
  |  Branch (70:9): [True: 0, False: 0]
  ------------------
   71|      0|        *ptr = p;
   72|      0|    return 1;
   73|     33|}
dbuf_init2:
   90|    210|{
   91|    210|    memset(s, 0, sizeof(*s));
   92|    210|    if (!realloc_func)
  ------------------
  |  Branch (92:9): [True: 0, False: 210]
  ------------------
   93|      0|        realloc_func = dbuf_default_realloc;
   94|    210|    s->opaque = opaque;
   95|    210|    s->realloc_func = realloc_func;
   96|    210|}
dbuf_claim:
  105|  1.24k|{
  106|  1.24k|    size_t new_size, size;
  107|  1.24k|    uint8_t *new_buf;
  108|  1.24k|    new_size = s->size + len;
  109|  1.24k|    if (new_size < len)
  ------------------
  |  Branch (109:9): [True: 0, False: 1.24k]
  ------------------
  110|      0|        return -1; /* overflow case */
  111|  1.24k|    if (new_size > s->allocated_size) {
  ------------------
  |  Branch (111:9): [True: 1.18k, False: 58]
  ------------------
  112|  1.18k|        if (s->error)
  ------------------
  |  Branch (112:13): [True: 0, False: 1.18k]
  ------------------
  113|      0|            return -1;
  114|  1.18k|        size = s->allocated_size + (s->allocated_size / 2);
  115|  1.18k|        if (size < s->allocated_size)
  ------------------
  |  Branch (115:13): [True: 0, False: 1.18k]
  ------------------
  116|      0|            return -1; /* overflow case */
  117|  1.18k|        if (size > new_size)
  ------------------
  |  Branch (117:13): [True: 618, False: 564]
  ------------------
  118|    618|            new_size = size;
  119|  1.18k|        new_buf = s->realloc_func(s->opaque, s->buf, new_size);
  120|  1.18k|        if (!new_buf) {
  ------------------
  |  Branch (120:13): [True: 0, False: 1.18k]
  ------------------
  121|      0|            s->error = TRUE;
  122|      0|            return -1;
  123|      0|        }
  124|  1.18k|        s->buf = new_buf;
  125|  1.18k|        s->allocated_size = new_size;
  126|  1.18k|    }
  127|  1.24k|    return 0;
  128|  1.24k|}
dbuf_put:
  131|  1.63k|{
  132|  1.63k|    if (unlikely((s->allocated_size - s->size) < len)) {
  ------------------
  |  |   33|  1.63k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1.16k, False: 476]
  |  |  ------------------
  ------------------
  133|  1.16k|        if (dbuf_claim(s, len))
  ------------------
  |  Branch (133:13): [True: 0, False: 1.16k]
  ------------------
  134|      0|            return -1;
  135|  1.16k|    }
  136|  1.63k|    memcpy_no_ub(s->buf + s->size, data, len);
  137|  1.63k|    s->size += len;
  138|  1.63k|    return 0;
  139|  1.63k|}
__dbuf_putc:
  153|    526|{
  154|    526|    return dbuf_put(s, &c, 1);
  155|    526|}
__dbuf_put_u16:
  158|     98|{
  159|     98|    return dbuf_put(s, (uint8_t *)&val, 2);
  160|     98|}
__dbuf_put_u32:
  163|    206|{
  164|    206|    return dbuf_put(s, (uint8_t *)&val, 4);
  165|    206|}
dbuf_printf:
  179|     47|{
  180|     47|    va_list ap;
  181|     47|    char buf[128];
  182|     47|    int len;
  183|       |
  184|     47|    va_start(ap, fmt);
  185|     47|    len = vsnprintf(buf, sizeof(buf), fmt, ap);
  186|     47|    va_end(ap);
  187|     47|    if (len < 0)
  ------------------
  |  Branch (187:9): [True: 0, False: 47]
  ------------------
  188|      0|        return -1;
  189|     47|    if (len < sizeof(buf)) {
  ------------------
  |  Branch (189:9): [True: 47, False: 0]
  ------------------
  190|       |        /* fast case */
  191|     47|        return dbuf_put(s, (uint8_t *)buf, len);
  192|     47|    } else {
  193|      0|        if (dbuf_claim(s, len + 1))
  ------------------
  |  Branch (193:13): [True: 0, False: 0]
  ------------------
  194|      0|            return -1;
  195|      0|        va_start(ap, fmt);
  196|      0|        vsnprintf((char *)(s->buf + s->size), s->allocated_size - s->size,
  197|      0|                  fmt, ap);
  198|      0|        va_end(ap);
  199|      0|        s->size += len;
  200|      0|    }
  201|      0|    return 0;
  202|     47|}
dbuf_free:
  205|    114|{
  206|       |    /* we test s->buf as a fail safe to avoid crashing if dbuf_free()
  207|       |       is called twice */
  208|    114|    if (s->buf) {
  ------------------
  |  Branch (208:9): [True: 103, False: 11]
  ------------------
  209|    103|        s->realloc_func(s->opaque, s->buf, 0);
  210|    103|    }
  211|    114|    memset(s, 0, sizeof(*s));
  212|    114|}
unicode_to_utf8:
  217|  1.26k|{
  218|  1.26k|    uint8_t *q = buf;
  219|       |
  220|  1.26k|    if (c < 0x80) {
  ------------------
  |  Branch (220:9): [True: 0, False: 1.26k]
  ------------------
  221|      0|        *q++ = c;
  222|  1.26k|    } else {
  223|  1.26k|        if (c < 0x800) {
  ------------------
  |  Branch (223:13): [True: 1.26k, False: 5]
  ------------------
  224|  1.26k|            *q++ = (c >> 6) | 0xc0;
  225|  1.26k|        } else {
  226|      5|            if (c < 0x10000) {
  ------------------
  |  Branch (226:17): [True: 5, False: 0]
  ------------------
  227|      5|                *q++ = (c >> 12) | 0xe0;
  228|      5|            } else {
  229|      0|                if (c < 0x00200000) {
  ------------------
  |  Branch (229:21): [True: 0, False: 0]
  ------------------
  230|      0|                    *q++ = (c >> 18) | 0xf0;
  231|      0|                } else {
  232|      0|                    if (c < 0x04000000) {
  ------------------
  |  Branch (232:25): [True: 0, False: 0]
  ------------------
  233|      0|                        *q++ = (c >> 24) | 0xf8;
  234|      0|                    } else if (c < 0x80000000) {
  ------------------
  |  Branch (234:32): [True: 0, False: 0]
  ------------------
  235|      0|                        *q++ = (c >> 30) | 0xfc;
  236|      0|                        *q++ = ((c >> 24) & 0x3f) | 0x80;
  237|      0|                    } else {
  238|      0|                        return 0;
  239|      0|                    }
  240|      0|                    *q++ = ((c >> 18) & 0x3f) | 0x80;
  241|      0|                }
  242|      0|                *q++ = ((c >> 12) & 0x3f) | 0x80;
  243|      0|            }
  244|      5|            *q++ = ((c >> 6) & 0x3f) | 0x80;
  245|      5|        }
  246|  1.26k|        *q++ = (c & 0x3f) | 0x80;
  247|  1.26k|    }
  248|  1.26k|    return q - buf;
  249|  1.26k|}
unicode_from_utf8:
  262|  3.16k|{
  263|  3.16k|    int l, c, b, i;
  264|       |
  265|  3.16k|    c = *p++;
  266|  3.16k|    if (c < 0x80) {
  ------------------
  |  Branch (266:9): [True: 22, False: 3.13k]
  ------------------
  267|     22|        *pp = p;
  268|     22|        return c;
  269|     22|    }
  270|  3.13k|    switch(c) {
  271|     43|    case 0xc0: case 0xc1: case 0xc2: case 0xc3:
  ------------------
  |  Branch (271:5): [True: 0, False: 3.13k]
  |  Branch (271:16): [True: 0, False: 3.13k]
  |  Branch (271:27): [True: 3, False: 3.13k]
  |  Branch (271:38): [True: 40, False: 3.09k]
  ------------------
  272|     54|    case 0xc4: case 0xc5: case 0xc6: case 0xc7:
  ------------------
  |  Branch (272:5): [True: 0, False: 3.13k]
  |  Branch (272:16): [True: 0, False: 3.13k]
  |  Branch (272:27): [True: 11, False: 3.12k]
  |  Branch (272:38): [True: 0, False: 3.13k]
  ------------------
  273|  2.59k|    case 0xc8: case 0xc9: case 0xca: case 0xcb:
  ------------------
  |  Branch (273:5): [True: 0, False: 3.13k]
  |  Branch (273:16): [True: 0, False: 3.13k]
  |  Branch (273:27): [True: 11, False: 3.12k]
  |  Branch (273:38): [True: 2.53k, False: 604]
  ------------------
  274|  2.69k|    case 0xcc: case 0xcd: case 0xce: case 0xcf:
  ------------------
  |  Branch (274:5): [True: 61, False: 3.07k]
  |  Branch (274:16): [True: 0, False: 3.13k]
  |  Branch (274:27): [True: 0, False: 3.13k]
  |  Branch (274:38): [True: 32, False: 3.10k]
  ------------------
  275|  2.70k|    case 0xd0: case 0xd1: case 0xd2: case 0xd3:
  ------------------
  |  Branch (275:5): [True: 11, False: 3.12k]
  |  Branch (275:16): [True: 0, False: 3.13k]
  |  Branch (275:27): [True: 0, False: 3.13k]
  |  Branch (275:38): [True: 0, False: 3.13k]
  ------------------
  276|  2.71k|    case 0xd4: case 0xd5: case 0xd6: case 0xd7:
  ------------------
  |  Branch (276:5): [True: 0, False: 3.13k]
  |  Branch (276:16): [True: 0, False: 3.13k]
  |  Branch (276:27): [True: 12, False: 3.12k]
  |  Branch (276:38): [True: 0, False: 3.13k]
  ------------------
  277|  2.71k|    case 0xd8: case 0xd9: case 0xda: case 0xdb:
  ------------------
  |  Branch (277:5): [True: 0, False: 3.13k]
  |  Branch (277:16): [True: 2, False: 3.13k]
  |  Branch (277:27): [True: 0, False: 3.13k]
  |  Branch (277:38): [True: 0, False: 3.13k]
  ------------------
  278|  2.73k|    case 0xdc: case 0xdd: case 0xde: case 0xdf:
  ------------------
  |  Branch (278:5): [True: 0, False: 3.13k]
  |  Branch (278:16): [True: 5, False: 3.13k]
  |  Branch (278:27): [True: 0, False: 3.13k]
  |  Branch (278:38): [True: 11, False: 3.12k]
  ------------------
  279|  2.73k|        l = 1;
  280|  2.73k|        break;
  281|     18|    case 0xe0: case 0xe1: case 0xe2: case 0xe3:
  ------------------
  |  Branch (281:5): [True: 17, False: 3.12k]
  |  Branch (281:16): [True: 0, False: 3.13k]
  |  Branch (281:27): [True: 0, False: 3.13k]
  |  Branch (281:38): [True: 1, False: 3.13k]
  ------------------
  282|     29|    case 0xe4: case 0xe5: case 0xe6: case 0xe7:
  ------------------
  |  Branch (282:5): [True: 0, False: 3.13k]
  |  Branch (282:16): [True: 0, False: 3.13k]
  |  Branch (282:27): [True: 11, False: 3.12k]
  |  Branch (282:38): [True: 0, False: 3.13k]
  ------------------
  283|     29|    case 0xe8: case 0xe9: case 0xea: case 0xeb:
  ------------------
  |  Branch (283:5): [True: 0, False: 3.13k]
  |  Branch (283:16): [True: 0, False: 3.13k]
  |  Branch (283:27): [True: 0, False: 3.13k]
  |  Branch (283:38): [True: 0, False: 3.13k]
  ------------------
  284|     33|    case 0xec: case 0xed: case 0xee: case 0xef:
  ------------------
  |  Branch (284:5): [True: 0, False: 3.13k]
  |  Branch (284:16): [True: 0, False: 3.13k]
  |  Branch (284:27): [True: 0, False: 3.13k]
  |  Branch (284:38): [True: 4, False: 3.13k]
  ------------------
  285|     33|        l = 2;
  286|     33|        break;
  287|     37|    case 0xf0: case 0xf1: case 0xf2: case 0xf3:
  ------------------
  |  Branch (287:5): [True: 20, False: 3.11k]
  |  Branch (287:16): [True: 0, False: 3.13k]
  |  Branch (287:27): [True: 0, False: 3.13k]
  |  Branch (287:38): [True: 17, False: 3.12k]
  ------------------
  288|     39|    case 0xf4: case 0xf5: case 0xf6: case 0xf7:
  ------------------
  |  Branch (288:5): [True: 0, False: 3.13k]
  |  Branch (288:16): [True: 0, False: 3.13k]
  |  Branch (288:27): [True: 1, False: 3.13k]
  |  Branch (288:38): [True: 1, False: 3.13k]
  ------------------
  289|     39|        l = 3;
  290|     39|        break;
  291|      0|    case 0xf8: case 0xf9: case 0xfa: case 0xfb:
  ------------------
  |  Branch (291:5): [True: 0, False: 3.13k]
  |  Branch (291:16): [True: 0, False: 3.13k]
  |  Branch (291:27): [True: 0, False: 3.13k]
  |  Branch (291:38): [True: 0, False: 3.13k]
  ------------------
  292|      0|        l = 4;
  293|      0|        break;
  294|      0|    case 0xfc: case 0xfd:
  ------------------
  |  Branch (294:5): [True: 0, False: 3.13k]
  |  Branch (294:16): [True: 0, False: 3.13k]
  ------------------
  295|      0|        l = 5;
  296|      0|        break;
  297|    333|    default:
  ------------------
  |  Branch (297:5): [True: 333, False: 2.80k]
  ------------------
  298|    333|        return -1;
  299|  3.13k|    }
  300|       |    /* check that we have enough characters */
  301|  2.80k|    if (l > (max_len - 1))
  ------------------
  |  Branch (301:9): [True: 0, False: 2.80k]
  ------------------
  302|      0|        return -1;
  303|  2.80k|    c &= utf8_first_code_mask[l - 1];
  304|  5.42k|    for(i = 0; i < l; i++) {
  ------------------
  |  Branch (304:16): [True: 2.83k, False: 2.58k]
  ------------------
  305|  2.83k|        b = *p++;
  306|  2.83k|        if (b < 0x80 || b >= 0xc0)
  ------------------
  |  Branch (306:13): [True: 89, False: 2.74k]
  |  Branch (306:25): [True: 127, False: 2.61k]
  ------------------
  307|    216|            return -1;
  308|  2.61k|        c = (c << 6) | (b & 0x3f);
  309|  2.61k|    }
  310|  2.58k|    if (c < utf8_min_code[l - 1])
  ------------------
  |  Branch (310:9): [True: 0, False: 2.58k]
  ------------------
  311|      0|        return -1;
  312|  2.58k|    *pp = p;
  313|  2.58k|    return c;
  314|  2.58k|}
rqsort:
  523|     34|{
  524|     34|    struct { uint8_t *base; size_t count; int depth; } stack[50], *sp = stack;
  525|     34|    uint8_t *ptr, *pi, *pj, *plt, *pgt, *top, *m;
  526|     34|    size_t m4, i, lt, gt, span, span2;
  527|     34|    int c, depth;
  528|     34|    exchange_f swap = exchange_func(base, size);
  529|     34|    exchange_f swap_block = exchange_func(base, size | 128);
  530|       |
  531|     34|    if (nmemb < 2 || size <= 0)
  ------------------
  |  Branch (531:9): [True: 0, False: 34]
  |  Branch (531:22): [True: 0, False: 34]
  ------------------
  532|      0|        return;
  533|       |
  534|     34|    sp->base = (uint8_t *)base;
  535|     34|    sp->count = nmemb;
  536|     34|    sp->depth = 0;
  537|     34|    sp++;
  538|       |
  539|    374|    while (sp > stack) {
  ------------------
  |  Branch (539:12): [True: 340, False: 34]
  ------------------
  540|    340|        sp--;
  541|    340|        ptr = sp->base;
  542|    340|        nmemb = sp->count;
  543|    340|        depth = sp->depth;
  544|       |
  545|    646|        while (nmemb > 6) {
  ------------------
  |  Branch (545:16): [True: 306, False: 340]
  ------------------
  546|    306|            if (++depth > 50) {
  ------------------
  |  Branch (546:17): [True: 0, False: 306]
  ------------------
  547|       |                /* depth check to ensure worst case logarithmic time */
  548|      0|                heapsortx(ptr, nmemb, size, cmp, opaque);
  549|      0|                nmemb = 0;
  550|      0|                break;
  551|      0|            }
  552|       |            /* select median of 3 from 1/4, 1/2, 3/4 positions */
  553|       |            /* should use median of 5 or 9? */
  554|    306|            m4 = (nmemb >> 2) * size;
  555|    306|            m = med3(ptr + m4, ptr + 2 * m4, ptr + 3 * m4, cmp, opaque);
  556|    306|            swap(ptr, m, size);  /* move the pivot to the start or the array */
  557|    306|            i = lt = 1;
  558|    306|            pi = plt = ptr + size;
  559|    306|            gt = nmemb;
  560|    306|            pj = pgt = top = ptr + nmemb * size;
  561|  1.54k|            for (;;) {
  562|  3.00k|                while (pi < pj && (c = cmp(ptr, pi, opaque)) >= 0) {
  ------------------
  |  Branch (562:24): [True: 2.87k, False: 136]
  |  Branch (562:35): [True: 1.46k, False: 1.41k]
  ------------------
  563|  1.46k|                    if (c == 0) {
  ------------------
  |  Branch (563:25): [True: 0, False: 1.46k]
  ------------------
  564|      0|                        swap(plt, pi, size);
  565|      0|                        lt++;
  566|      0|                        plt += size;
  567|      0|                    }
  568|  1.46k|                    i++;
  569|  1.46k|                    pi += size;
  570|  1.46k|                }
  571|  3.23k|                while (pi < (pj -= size) && (c = cmp(ptr, pj, opaque)) <= 0) {
  ------------------
  |  Branch (571:24): [True: 2.92k, False: 306]
  |  Branch (571:45): [True: 1.68k, False: 1.24k]
  ------------------
  572|  1.68k|                    if (c == 0) {
  ------------------
  |  Branch (572:25): [True: 0, False: 1.68k]
  ------------------
  573|      0|                        gt--;
  574|      0|                        pgt -= size;
  575|      0|                        swap(pgt, pj, size);
  576|      0|                    }
  577|  1.68k|                }
  578|  1.54k|                if (pi >= pj)
  ------------------
  |  Branch (578:21): [True: 306, False: 1.24k]
  ------------------
  579|    306|                    break;
  580|  1.24k|                swap(pi, pj, size);
  581|  1.24k|                i++;
  582|  1.24k|                pi += size;
  583|  1.24k|            }
  584|       |            /* array has 4 parts:
  585|       |             * from 0 to lt excluded: elements identical to pivot
  586|       |             * from lt to pi excluded: elements smaller than pivot
  587|       |             * from pi to gt excluded: elements greater than pivot
  588|       |             * from gt to n excluded: elements identical to pivot
  589|       |             */
  590|       |            /* move elements identical to pivot in the middle of the array: */
  591|       |            /* swap values in ranges [0..lt[ and [i-lt..i[
  592|       |               swapping the smallest span between lt and i-lt is sufficient
  593|       |             */
  594|    306|            span = plt - ptr;
  595|    306|            span2 = pi - plt;
  596|    306|            lt = i - lt;
  597|    306|            if (span > span2)
  ------------------
  |  Branch (597:17): [True: 0, False: 306]
  ------------------
  598|      0|                span = span2;
  599|    306|            swap_block(ptr, pi - span, span);
  600|       |            /* swap values in ranges [gt..top[ and [i..top-(top-gt)[
  601|       |               swapping the smallest span between top-gt and gt-i is sufficient
  602|       |             */
  603|    306|            span = top - pgt;
  604|    306|            span2 = pgt - pi;
  605|    306|            pgt = top - span2;
  606|    306|            gt = nmemb - (gt - i);
  607|    306|            if (span > span2)
  ------------------
  |  Branch (607:17): [True: 0, False: 306]
  ------------------
  608|      0|                span = span2;
  609|    306|            swap_block(pi, top - span, span);
  610|       |
  611|       |            /* now array has 3 parts:
  612|       |             * from 0 to lt excluded: elements smaller than pivot
  613|       |             * from lt to gt excluded: elements identical to pivot
  614|       |             * from gt to n excluded: elements greater than pivot
  615|       |             */
  616|       |            /* stack the larger segment and keep processing the smaller one
  617|       |               to minimize stack use for pathological distributions */
  618|    306|            if (lt > nmemb - gt) {
  ------------------
  |  Branch (618:17): [True: 102, False: 204]
  ------------------
  619|    102|                sp->base = ptr;
  620|    102|                sp->count = lt;
  621|    102|                sp->depth = depth;
  622|    102|                sp++;
  623|    102|                ptr = pgt;
  624|    102|                nmemb -= gt;
  625|    204|            } else {
  626|    204|                sp->base = pgt;
  627|    204|                sp->count = nmemb - gt;
  628|    204|                sp->depth = depth;
  629|    204|                sp++;
  630|    204|                nmemb = lt;
  631|    204|            }
  632|    306|        }
  633|       |        /* Use insertion sort for small fragments */
  634|  1.36k|        for (pi = ptr + size, top = ptr + nmemb * size; pi < top; pi += size) {
  ------------------
  |  Branch (634:57): [True: 1.02k, False: 340]
  ------------------
  635|  1.93k|            for (pj = pi; pj > ptr && cmp(pj - size, pj, opaque) > 0; pj -= size)
  ------------------
  |  Branch (635:27): [True: 1.66k, False: 272]
  |  Branch (635:39): [True: 918, False: 748]
  ------------------
  636|    918|                swap(pj, pj - size, size);
  637|  1.02k|        }
  638|    340|    }
  639|     34|}
cutils.c:exchange_func:
  446|     68|static inline exchange_f exchange_func(const void *base, size_t size) {
  447|     68|    switch (((uintptr_t)base | (uintptr_t)size) & 15) {
  448|     34|    case 0:
  ------------------
  |  Branch (448:5): [True: 34, False: 34]
  ------------------
  449|     34|        if (size == sizeof(uint64_t) * 2)
  ------------------
  |  Branch (449:13): [True: 17, False: 17]
  ------------------
  450|     17|            return exchange_one_int128;
  451|     17|        else
  452|     17|            return exchange_int128s;
  453|     34|    case 8:
  ------------------
  |  Branch (453:5): [True: 34, False: 34]
  ------------------
  454|     34|        if (size == sizeof(uint64_t))
  ------------------
  |  Branch (454:13): [True: 0, False: 34]
  ------------------
  455|      0|            return exchange_one_int64;
  456|     34|        else
  457|     34|            return exchange_int64s;
  458|      0|    case 4:
  ------------------
  |  Branch (458:5): [True: 0, False: 68]
  ------------------
  459|      0|    case 12:
  ------------------
  |  Branch (459:5): [True: 0, False: 68]
  ------------------
  460|      0|        if (size == sizeof(uint32_t))
  ------------------
  |  Branch (460:13): [True: 0, False: 0]
  ------------------
  461|      0|            return exchange_one_int32;
  462|      0|        else
  463|      0|            return exchange_int32s;
  464|      0|    case 2:
  ------------------
  |  Branch (464:5): [True: 0, False: 68]
  ------------------
  465|      0|    case 6:
  ------------------
  |  Branch (465:5): [True: 0, False: 68]
  ------------------
  466|      0|    case 10:
  ------------------
  |  Branch (466:5): [True: 0, False: 68]
  ------------------
  467|      0|    case 14:
  ------------------
  |  Branch (467:5): [True: 0, False: 68]
  ------------------
  468|      0|        if (size == sizeof(uint16_t))
  ------------------
  |  Branch (468:13): [True: 0, False: 0]
  ------------------
  469|      0|            return exchange_one_int16;
  470|      0|        else
  471|      0|            return exchange_int16s;
  472|      0|    default:
  ------------------
  |  Branch (472:5): [True: 0, False: 68]
  ------------------
  473|      0|        if (size == 1)
  ------------------
  |  Branch (473:13): [True: 0, False: 0]
  ------------------
  474|      0|            return exchange_one_byte;
  475|      0|        else
  476|      0|            return exchange_bytes;
  477|     68|    }
  478|     68|}
cutils.c:exchange_one_int128:
  435|    680|static void exchange_one_int128(void *a, void *b, size_t size) {
  436|    680|    uint64_t *ap = (uint64_t *)a;
  437|    680|    uint64_t *bp = (uint64_t *)b;
  438|    680|    uint64_t t = ap[0];
  439|    680|    uint64_t u = ap[1];
  440|    680|    ap[0] = bp[0];
  441|    680|    ap[1] = bp[1];
  442|    680|    bp[0] = t;
  443|    680|    bp[1] = u;
  444|    680|}
cutils.c:exchange_int128s:
  421|    136|static void exchange_int128s(void *a, void *b, size_t size) {
  422|    136|    uint64_t *ap = (uint64_t *)a;
  423|    136|    uint64_t *bp = (uint64_t *)b;
  424|       |
  425|    204|    for (size /= sizeof(uint64_t) * 2; size-- != 0; ap += 2, bp += 2) {
  ------------------
  |  Branch (425:40): [True: 68, False: 136]
  ------------------
  426|     68|        uint64_t t = ap[0];
  427|     68|        uint64_t u = ap[1];
  428|     68|        ap[0] = bp[0];
  429|     68|        ap[1] = bp[1];
  430|     68|        bp[0] = t;
  431|     68|        bp[1] = u;
  432|     68|    }
  433|    136|}
cutils.c:exchange_int64s:
  402|  2.26k|static void exchange_int64s(void *a, void *b, size_t size) {
  403|  2.26k|    uint64_t *ap = (uint64_t *)a;
  404|  2.26k|    uint64_t *bp = (uint64_t *)b;
  405|       |
  406|  6.30k|    for (size /= sizeof(uint64_t); size-- != 0;) {
  ------------------
  |  Branch (406:36): [True: 4.04k, False: 2.26k]
  ------------------
  407|  4.04k|        uint64_t t = *ap;
  408|  4.04k|        *ap++ = *bp;
  409|  4.04k|        *bp++ = t;
  410|  4.04k|    }
  411|  2.26k|}
cutils.c:med3:
  515|    306|{
  516|    306|    return cmp(a, b, opaque) < 0 ?
  ------------------
  |  Branch (516:12): [True: 170, False: 136]
  ------------------
  517|    170|        (cmp(b, c, opaque) < 0 ? b : (cmp(a, c, opaque) < 0 ? c : a )) :
  ------------------
  |  Branch (517:10): [True: 68, False: 102]
  |  Branch (517:39): [True: 51, False: 51]
  ------------------
  518|    306|        (cmp(b, c, opaque) > 0 ? b : (cmp(a, c, opaque) < 0 ? a : c ));
  ------------------
  |  Branch (518:10): [True: 51, False: 85]
  |  Branch (518:39): [True: 34, False: 51]
  ------------------
  519|    306|}

quickjs.c:max_int:
   81|  1.01M|{
   82|  1.01M|    if (a > b)
  ------------------
  |  Branch (82:9): [True: 1.01M, False: 1.74k]
  ------------------
   83|  1.01M|        return a;
   84|  1.74k|    else
   85|  1.74k|        return b;
   86|  1.01M|}
quickjs.c:get_hi_surrogate:
  351|      6|{
  352|      6|    return (c >> 10) - (0x10000 >> 10) + 0xD800;
  353|      6|}
quickjs.c:get_lo_surrogate:
  356|      6|{
  357|      6|    return (c & 0x3FF) | 0xDC00;
  358|      6|}
quickjs.c:is_hi_surrogate:
  341|  1.01M|{
  342|  1.01M|    return (c >> 10) == (0xD800 >> 10); // 0xD800-0xDBFF
  343|  1.01M|}
quickjs.c:is_lo_surrogate:
  346|      2|{
  347|      2|    return (c >> 10) == (0xDC00 >> 10); // 0xDC00-0xDFFF
  348|      2|}
quickjs.c:clz32:
  130|  1.49k|{
  131|  1.49k|    return __builtin_clz(a);
  132|  1.49k|}
quickjs.c:get_u32:
  180|    882|{
  181|    882|    return ((const struct packed_u32 *)tab)->v;
  182|    882|}
quickjs.c:dbuf_putc:
  277|  1.83k|{
  278|  1.83k|    if (unlikely((s->allocated_size - s->size) < 1)) {
  ------------------
  |  |   33|  1.83k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 516, False: 1.31k]
  |  |  ------------------
  ------------------
  279|    516|        return __dbuf_putc(s, val);
  280|  1.31k|    } else {
  281|  1.31k|        s->buf[s->size++] = val;
  282|  1.31k|        return 0;
  283|  1.31k|    }
  284|  1.83k|}
quickjs.c:dbuf_error:
  322|    264|static inline BOOL dbuf_error(DynBuf *s) {
  323|    264|    return s->error;
  324|    264|}
quickjs.c:get_u16:
  195|    335|{
  196|    335|    return ((const struct packed_u16 *)tab)->v;
  197|    335|}
quickjs.c:dbuf_put_u16:
  287|    445|{
  288|    445|    if (unlikely((s->allocated_size - s->size) < 2)) {
  ------------------
  |  |   33|    445|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 93, False: 352]
  |  |  ------------------
  ------------------
  289|     93|        return __dbuf_put_u16(s, val);
  290|    352|    } else {
  291|    352|        put_u16(s->buf + s->size, val);
  292|    352|        s->size += 2;
  293|    352|        return 0;
  294|    352|    }
  295|    445|}
quickjs.c:put_u16:
  205|    352|{
  206|    352|    ((struct packed_u16 *)tab)->v = val;
  207|    352|}
quickjs.c:put_u32:
  190|    501|{
  191|    501|    ((struct packed_u32 *)tab)->v = val;
  192|    501|}
quickjs.c:from_hex:
  366|  73.4k|{
  367|  73.4k|    if (c >= '0' && c <= '9')
  ------------------
  |  Branch (367:9): [True: 73.4k, False: 0]
  |  Branch (367:21): [True: 54.0k, False: 19.4k]
  ------------------
  368|  54.0k|        return c - '0';
  369|  19.4k|    else if (c >= 'A' && c <= 'F')
  ------------------
  |  Branch (369:14): [True: 15.5k, False: 3.90k]
  |  Branch (369:26): [True: 0, False: 15.5k]
  ------------------
  370|      0|        return c - 'A' + 10;
  371|  19.4k|    else if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (371:14): [True: 15.5k, False: 3.90k]
  |  Branch (371:26): [True: 11.6k, False: 3.88k]
  ------------------
  372|  11.6k|        return c - 'a' + 10;
  373|  7.78k|    else
  374|  7.78k|        return -1;
  375|  73.4k|}
quickjs.c:min_int:
   89|  9.17k|{
   90|  9.17k|    if (a < b)
  ------------------
  |  Branch (90:9): [True: 3.53k, False: 5.64k]
  ------------------
   91|  3.53k|        return a;
   92|  5.64k|    else
   93|  5.64k|        return b;
   94|  9.17k|}
quickjs.c:dbuf_put_u32:
  298|    639|{
  299|    639|    if (unlikely((s->allocated_size - s->size) < 4)) {
  ------------------
  |  |   33|    639|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 201, False: 438]
  |  |  ------------------
  ------------------
  300|    201|        return __dbuf_put_u32(s, val);
  301|    438|    } else {
  302|    438|        put_u32(s->buf + s->size, val);
  303|    438|        s->size += 4;
  304|    438|        return 0;
  305|    438|    }
  306|    639|}
quickjs.c:put_u8:
  220|     24|{
  221|     24|    *tab = val;
  222|     24|}
quickjs.c:get_i32:
  185|      7|{
  186|      7|    return (int32_t)((const struct packed_u32 *)tab)->v;
  187|      7|}
dtoa.c:clz32:
  130|     21|{
  131|     21|    return __builtin_clz(a);
  132|     21|}
dtoa.c:float64_as_uint64:
  382|      1|{
  383|      1|    union {
  384|      1|        double d;
  385|      1|        uint64_t u64;
  386|      1|    } u;
  387|      1|    u.d = d;
  388|      1|    return u.u64;
  389|      1|}
dtoa.c:max_int:
   81|      3|{
   82|      3|    if (a > b)
  ------------------
  |  Branch (82:9): [True: 3, False: 0]
  ------------------
   83|      3|        return a;
   84|      0|    else
   85|      0|        return b;
   86|      3|}
dtoa.c:ctz32:
  142|     25|{
  143|     25|    return __builtin_ctz(a);
  144|     25|}
dtoa.c:min_int:
   89|      6|{
   90|      6|    if (a < b)
  ------------------
  |  Branch (90:9): [True: 6, False: 0]
  ------------------
   91|      6|        return a;
   92|      0|    else
   93|      0|        return b;
   94|      6|}
dtoa.c:uint64_as_float64:
  392|     24|{
  393|     24|    union {
  394|     24|        double d;
  395|     24|        uint64_t u64;
  396|     24|    } u;
  397|     24|    u.u64 = u64;
  398|     24|    return u.d;
  399|     24|}
libregexp.c:from_hex:
  366|      4|{
  367|      4|    if (c >= '0' && c <= '9')
  ------------------
  |  Branch (367:9): [True: 4, False: 0]
  |  Branch (367:21): [True: 3, False: 1]
  ------------------
  368|      3|        return c - '0';
  369|      1|    else if (c >= 'A' && c <= 'F')
  ------------------
  |  Branch (369:14): [True: 1, False: 0]
  |  Branch (369:26): [True: 0, False: 1]
  ------------------
  370|      0|        return c - 'A' + 10;
  371|      1|    else if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (371:14): [True: 1, False: 0]
  |  Branch (371:26): [True: 1, False: 0]
  ------------------
  372|      1|        return c - 'a' + 10;
  373|      0|    else
  374|      0|        return -1;
  375|      4|}
libregexp.c:is_hi_surrogate:
  341|  1.01M|{
  342|  1.01M|    return (c >> 10) == (0xD800 >> 10); // 0xD800-0xDBFF
  343|  1.01M|}
libregexp.c:is_lo_surrogate:
  346|  1.00M|{
  347|  1.00M|    return (c >> 10) == (0xDC00 >> 10); // 0xDC00-0xDFFF
  348|  1.00M|}
libregexp.c:dbuf_put_u16:
  287|      6|{
  288|      6|    if (unlikely((s->allocated_size - s->size) < 2)) {
  ------------------
  |  |   33|      6|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 5, False: 1]
  |  |  ------------------
  ------------------
  289|      5|        return __dbuf_put_u16(s, val);
  290|      5|    } else {
  291|      1|        put_u16(s->buf + s->size, val);
  292|      1|        s->size += 2;
  293|      1|        return 0;
  294|      1|    }
  295|      6|}
libregexp.c:dbuf_putc:
  277|     30|{
  278|     30|    if (unlikely((s->allocated_size - s->size) < 1)) {
  ------------------
  |  |   33|     30|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 10, False: 20]
  |  |  ------------------
  ------------------
  279|     10|        return __dbuf_putc(s, val);
  280|     20|    } else {
  281|     20|        s->buf[s->size++] = val;
  282|     20|        return 0;
  283|     20|    }
  284|     30|}
libregexp.c:dbuf_put_u32:
  298|      5|{
  299|      5|    if (unlikely((s->allocated_size - s->size) < 4)) {
  ------------------
  |  |   33|      5|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 5, False: 0]
  |  |  ------------------
  ------------------
  300|      5|        return __dbuf_put_u32(s, val);
  301|      5|    } else {
  302|      0|        put_u32(s->buf + s->size, val);
  303|      0|        s->size += 4;
  304|      0|        return 0;
  305|      0|    }
  306|      5|}
libregexp.c:dbuf_error:
  322|      3|static inline BOOL dbuf_error(DynBuf *s) {
  323|      3|    return s->error;
  324|      3|}
libregexp.c:put_u32:
  190|      3|{
  191|      3|    ((struct packed_u32 *)tab)->v = val;
  192|      3|}
libregexp.c:put_u16:
  205|      1|{
  206|      1|    ((struct packed_u16 *)tab)->v = val;
  207|      1|}
libregexp.c:get_u16:
  195|  2.02M|{
  196|  2.02M|    return ((const struct packed_u16 *)tab)->v;
  197|  2.02M|}
cutils.c:memcpy_no_ub:
   75|  1.63k|static inline void memcpy_no_ub(void *dest, const void *src, size_t n) {
   76|  1.63k|    if (n)
  ------------------
  |  Branch (76:9): [True: 1.63k, False: 0]
  ------------------
   77|  1.63k|        memcpy(dest, src, n);
   78|  1.63k|}

js_dtoa_max_len:
 1035|      1|{
 1036|      1|    int fmt = flags & JS_DTOA_FORMAT_MASK;
  ------------------
  |  |   38|      1|#define JS_DTOA_FORMAT_MASK  (3 << 0)
  ------------------
 1037|      1|    int n, e;
 1038|      1|    uint64_t a;
 1039|       |
 1040|      1|    if (fmt != JS_DTOA_FORMAT_FRAC) {
  ------------------
  |  |   37|      1|#define JS_DTOA_FORMAT_FRAC  (2 << 0)
  ------------------
  |  Branch (1040:9): [True: 1, False: 0]
  ------------------
 1041|      1|        if (fmt == JS_DTOA_FORMAT_FREE) {
  ------------------
  |  |   32|      1|#define JS_DTOA_FORMAT_FREE  (0 << 0)
  ------------------
  |  Branch (1041:13): [True: 1, False: 0]
  ------------------
 1042|      1|            n = dtoa_max_digits_table[radix - 2];
 1043|      1|        } else {
 1044|      0|            n = n_digits;
 1045|      0|        }
 1046|      1|        if ((flags & JS_DTOA_EXP_MASK) == JS_DTOA_EXP_DISABLED) {
  ------------------
  |  |   44|      1|#define JS_DTOA_EXP_MASK     (3 << 2)
  ------------------
                      if ((flags & JS_DTOA_EXP_MASK) == JS_DTOA_EXP_DISABLED) {
  ------------------
  |  |   43|      1|#define JS_DTOA_EXP_DISABLED (2 << 2)
  ------------------
  |  Branch (1046:13): [True: 0, False: 1]
  ------------------
 1047|       |            /* no exponential */
 1048|      0|            a = float64_as_uint64(d);
 1049|      0|            e = (a >> 52) & 0x7ff;
 1050|      0|            if (e == 0x7ff) {
  ------------------
  |  Branch (1050:17): [True: 0, False: 0]
  ------------------
 1051|       |                /* NaN, Infinity */
 1052|      0|                n = 0;
 1053|      0|            } else {
 1054|      0|                e -= 1023;
 1055|       |                /* XXX: adjust */
 1056|      0|                n += 10 + abs(mul_log2_radix(e - 1, radix));
 1057|      0|            }
 1058|      1|        } else {
 1059|       |            /* extra: sign, 1 dot and exponent "e-1000" */
 1060|      1|            n += 1 + 1 + 6;
 1061|      1|        }
 1062|      1|    } else {
 1063|      0|        a = float64_as_uint64(d);
 1064|      0|        e = (a >> 52) & 0x7ff;
 1065|      0|        if (e == 0x7ff) {
  ------------------
  |  Branch (1065:13): [True: 0, False: 0]
  ------------------
 1066|       |            /* NaN, Infinity */
 1067|      0|            n = 0;
 1068|      0|        } else {
 1069|       |            /* high bound for the integer part */
 1070|      0|            e -= 1023;
 1071|       |            /* x < 2^(e + 1) */
 1072|      0|            if (e < 0) {
  ------------------
  |  Branch (1072:17): [True: 0, False: 0]
  ------------------
 1073|      0|                n = 1;
 1074|      0|            } else {
 1075|      0|                n = 2 + mul_log2_radix(e - 1, radix);
 1076|      0|            }
 1077|       |            /* sign, extra digit, 1 dot */
 1078|      0|            n += 1 + 1 + 1 + n_digits;
 1079|      0|        }
 1080|      0|    }
 1081|      1|    return max_int(n, 9); /* also include NaN and [-]Infinity */
 1082|      1|}
js_dtoa:
 1110|      1|{
 1111|      1|    uint64_t a, m, *mptr = tmp_mem->mem;
 1112|      1|    int e, sgn, l, E, P, i, E_max, radix1, radix_shift;
 1113|      1|    char *q;
 1114|      1|    mpb_t *tmp1, *mant_max;
 1115|      1|    int fmt = flags & JS_DTOA_FORMAT_MASK;
  ------------------
  |  |   38|      1|#define JS_DTOA_FORMAT_MASK  (3 << 0)
  ------------------
 1116|       |
 1117|      1|    tmp1 = dtoa_malloc(&mptr, sizeof(mpb_t) + sizeof(limb_t) * DBIGNUM_LEN_MAX);
  ------------------
  |  |   64|      1|#define DBIGNUM_LEN_MAX 52 /* ~ 2^(1072+53)*36^100 (dtoa) */
  ------------------
 1118|      1|    mant_max = dtoa_malloc(&mptr, sizeof(mpb_t) + sizeof(limb_t) * MANT_LEN_MAX);
  ------------------
  |  |   65|      1|#define MANT_LEN_MAX 18 /* < 36^100 */
  ------------------
 1119|      1|    assert((mptr - tmp_mem->mem) <= sizeof(JSDTOATempMem) / sizeof(mptr[0]));
  ------------------
  |  Branch (1119:5): [True: 0, False: 1]
  |  Branch (1119:5): [True: 1, False: 0]
  ------------------
 1120|       |
 1121|      1|    radix_shift = ctz32(radix);
 1122|      1|    radix1 = radix >> radix_shift;
 1123|      1|    a = float64_as_uint64(d);
 1124|      1|    sgn = a >> 63;
 1125|      1|    e = (a >> 52) & 0x7ff;
 1126|      1|    m = a & (((uint64_t)1 << 52) - 1);
 1127|      1|    q = buf;
 1128|      1|    if (e == 0x7ff) {
  ------------------
  |  Branch (1128:9): [True: 1, False: 0]
  ------------------
 1129|      1|        if (m == 0) {
  ------------------
  |  Branch (1129:13): [True: 0, False: 1]
  ------------------
 1130|      0|            if (sgn)
  ------------------
  |  Branch (1130:17): [True: 0, False: 0]
  ------------------
 1131|      0|                *q++ = '-';
 1132|      0|            memcpy(q, "Infinity", 8);
 1133|      0|            q += 8;
 1134|      1|        } else {
 1135|      1|            memcpy(q, "NaN", 3);
 1136|      1|            q += 3;
 1137|      1|        }
 1138|      1|        goto done;
 1139|      1|    } else if (e == 0) {
  ------------------
  |  Branch (1139:16): [True: 0, False: 0]
  ------------------
 1140|      0|        if (m == 0) {
  ------------------
  |  Branch (1140:13): [True: 0, False: 0]
  ------------------
 1141|      0|            tmp1->len = 1;
 1142|      0|            tmp1->tab[0] = 0;
 1143|      0|            E = 1;
 1144|      0|            if (fmt == JS_DTOA_FORMAT_FREE)
  ------------------
  |  |   32|      0|#define JS_DTOA_FORMAT_FREE  (0 << 0)
  ------------------
  |  Branch (1144:17): [True: 0, False: 0]
  ------------------
 1145|      0|                P = 1;
 1146|      0|            else if (fmt == JS_DTOA_FORMAT_FRAC)
  ------------------
  |  |   37|      0|#define JS_DTOA_FORMAT_FRAC  (2 << 0)
  ------------------
  |  Branch (1146:22): [True: 0, False: 0]
  ------------------
 1147|      0|                P = n_digits + 1;
 1148|      0|            else
 1149|      0|                P = n_digits;
 1150|       |            /* "-0" is displayed as "0" if JS_DTOA_MINUS_ZERO is not present */
 1151|      0|            if (sgn && (flags & JS_DTOA_MINUS_ZERO))
  ------------------
  |  |   46|      0|#define JS_DTOA_MINUS_ZERO   (1 << 4) /* show the minus sign for -0 */
  ------------------
  |  Branch (1151:17): [True: 0, False: 0]
  |  Branch (1151:24): [True: 0, False: 0]
  ------------------
 1152|      0|                *q++ = '-';
 1153|      0|            goto output;
 1154|      0|        }
 1155|       |        /* denormal number: convert to a normal number */
 1156|      0|        l = clz64(m) - 11;
 1157|      0|        e -= l - 1;
 1158|      0|        m <<= l;
 1159|      0|    } else {
 1160|      0|        m |= (uint64_t)1 << 52;
 1161|      0|    }
 1162|      0|    if (sgn)
  ------------------
  |  Branch (1162:9): [True: 0, False: 0]
  ------------------
 1163|      0|        *q++ = '-';
 1164|       |    /* remove the bias */
 1165|      0|    e -= 1022;
 1166|       |    /* d = 2^(e-53)*m */
 1167|       |    //    printf("m=0x%016" PRIx64 " e=%d\n", m, e);
 1168|      0|#ifdef USE_FAST_INT
 1169|      0|    if (fmt == JS_DTOA_FORMAT_FREE &&
  ------------------
  |  |   32|      0|#define JS_DTOA_FORMAT_FREE  (0 << 0)
  ------------------
  |  Branch (1169:9): [True: 0, False: 0]
  ------------------
 1170|      0|        e >= 1 && e <= 53 &&
  ------------------
  |  Branch (1170:9): [True: 0, False: 0]
  |  Branch (1170:19): [True: 0, False: 0]
  ------------------
 1171|      0|        (m & (((uint64_t)1 << (53 - e)) - 1)) == 0 &&
  ------------------
  |  Branch (1171:9): [True: 0, False: 0]
  ------------------
 1172|      0|        (flags & JS_DTOA_EXP_MASK) != JS_DTOA_EXP_ENABLED) {
  ------------------
  |  |   44|      0|#define JS_DTOA_EXP_MASK     (3 << 2)
  ------------------
                      (flags & JS_DTOA_EXP_MASK) != JS_DTOA_EXP_ENABLED) {
  ------------------
  |  |   42|      0|#define JS_DTOA_EXP_ENABLED  (1 << 2)
  ------------------
  |  Branch (1172:9): [True: 0, False: 0]
  ------------------
 1173|      0|        m >>= 53 - e;
 1174|       |        /* 'm' is never zero */
 1175|      0|        q += u64toa_radix(q, m, radix);
 1176|      0|        goto done;
 1177|      0|    }
 1178|      0|#endif
 1179|       |    
 1180|       |    /* this choice of E implies F=round(x*B^(P-E) is such as: 
 1181|       |       B^(P-1) <= F < 2.B^P. */
 1182|      0|    E = 1 + mul_log2_radix(e - 1, radix);
 1183|       |    
 1184|      0|    if (fmt == JS_DTOA_FORMAT_FREE) {
  ------------------
  |  |   32|      0|#define JS_DTOA_FORMAT_FREE  (0 << 0)
  ------------------
  |  Branch (1184:9): [True: 0, False: 0]
  ------------------
 1185|      0|        int P_max, E0, e1, E_found, P_found;
 1186|      0|        uint64_t m1, mant_found, mant, mant_max1;
 1187|       |        /* P_max is guarranteed to work by construction */
 1188|      0|        P_max = dtoa_max_digits_table[radix - 2];
 1189|      0|        E0 = E;
 1190|      0|        E_found = 0;
 1191|      0|        P_found = 0;
 1192|      0|        mant_found = 0;
 1193|       |        /* find the minimum number of digits by successive tries */
 1194|      0|        P = P_max; /* P_max is guarateed to work */
 1195|      0|        for(;;) {
 1196|       |            /* mant_max always fits on 64 bits */
 1197|      0|            mant_max1 = pow_ui(radix, P);
 1198|       |            /* compute the mantissa in base B */
 1199|      0|            E = E0;
 1200|      0|            for(;;) {
 1201|       |                /* XXX: add inexact flag */
 1202|      0|                mul_pow_round(tmp1, m, e - 53, radix1, radix_shift, P - E, JS_RNDN);
 1203|      0|                mant = mpb_get_u64(tmp1);
 1204|      0|                if (mant < mant_max1)
  ------------------
  |  Branch (1204:21): [True: 0, False: 0]
  ------------------
 1205|      0|                    break;
 1206|      0|                E++; /* at most one iteration is possible */
 1207|      0|            }
 1208|       |            /* remove useless trailing zero digits */
 1209|      0|            while ((mant % radix) == 0) {
  ------------------
  |  Branch (1209:20): [True: 0, False: 0]
  ------------------
 1210|      0|                mant /= radix;
 1211|      0|                P--;
 1212|      0|            }
 1213|       |            /* garanteed to work for P = P_max */
 1214|      0|            if (P_found == 0)
  ------------------
  |  Branch (1214:17): [True: 0, False: 0]
  ------------------
 1215|      0|                goto prec_found;
 1216|       |            /* convert back to base 2 */
 1217|      0|            mpb_set_u64(tmp1, mant);
 1218|      0|            m1 = mul_pow_round_to_d(&e1, tmp1, radix1, radix_shift, E - P, JS_RNDN);
 1219|       |            //            printf("P=%2d: m=0x%016" PRIx64 " e=%d m1=0x%016" PRIx64 " e1=%d\n", P, m, e, m1, e1);
 1220|       |            /* Note: (m, e) is never zero here, so the exponent for m1
 1221|       |               = 0 does not matter */
 1222|      0|            if (m1 == m && e1 == e) {
  ------------------
  |  Branch (1222:17): [True: 0, False: 0]
  |  Branch (1222:28): [True: 0, False: 0]
  ------------------
 1223|      0|            prec_found:
 1224|      0|                P_found = P;
 1225|      0|                E_found = E;
 1226|      0|                mant_found = mant;
 1227|      0|                if (P == 1)
  ------------------
  |  Branch (1227:21): [True: 0, False: 0]
  ------------------
 1228|      0|                    break;
 1229|      0|                P--; /* try lower exponent */
 1230|      0|            } else {
 1231|      0|                break;
 1232|      0|            }
 1233|      0|        }
 1234|      0|        P = P_found;
 1235|      0|        E = E_found;
 1236|      0|        mpb_set_u64(tmp1, mant_found);
 1237|       |#ifdef JS_DTOA_DUMP_STATS
 1238|       |        if (radix == 10) {
 1239|       |            out_len_count[P - 1]++;
 1240|       |        }
 1241|       |#endif        
 1242|      0|    } else if (fmt == JS_DTOA_FORMAT_FRAC) {
  ------------------
  |  |   37|      0|#define JS_DTOA_FORMAT_FRAC  (2 << 0)
  ------------------
  |  Branch (1242:16): [True: 0, False: 0]
  ------------------
 1243|      0|        int len;
 1244|       |
 1245|      0|        assert(n_digits >= 0 && n_digits <= JS_DTOA_MAX_DIGITS);
  ------------------
  |  Branch (1245:9): [True: 0, False: 0]
  |  Branch (1245:9): [True: 0, False: 0]
  |  Branch (1245:9): [True: 0, False: 0]
  |  Branch (1245:9): [True: 0, False: 0]
  ------------------
 1246|       |        /* P = max_int(E, 1) + n_digits; */
 1247|       |        /* frac is rounded using RNDNA */
 1248|      0|        mul_pow_round(tmp1, m, e - 53, radix1, radix_shift, n_digits, JS_RNDNA);
 1249|       |
 1250|       |        /* we add one extra digit on the left and remove it if needed
 1251|       |           to avoid testing if the result is < radix^P */
 1252|      0|        len = output_digits(q, tmp1, radix, max_int(E + 1, 1) + n_digits,
 1253|      0|                            max_int(E + 1, 1));
 1254|      0|        if (q[0] == '0' && len >= 2 && q[1] != '.') {
  ------------------
  |  Branch (1254:13): [True: 0, False: 0]
  |  Branch (1254:28): [True: 0, False: 0]
  |  Branch (1254:40): [True: 0, False: 0]
  ------------------
 1255|      0|            len--;
 1256|      0|            memmove(q, q + 1, len);
 1257|      0|        }
 1258|      0|        q += len;
 1259|      0|        goto done;
 1260|      0|    } else {
 1261|      0|        int pow_shift;
 1262|      0|        assert(n_digits >= 1 && n_digits <= JS_DTOA_MAX_DIGITS);
  ------------------
  |  Branch (1262:9): [True: 0, False: 0]
  |  Branch (1262:9): [True: 0, False: 0]
  |  Branch (1262:9): [True: 0, False: 0]
  |  Branch (1262:9): [True: 0, False: 0]
  ------------------
 1263|      0|        P = n_digits;
 1264|       |        /* mant_max = radix^P */
 1265|      0|        mant_max->len = 1;
 1266|      0|        mant_max->tab[0] = 1;
 1267|      0|        pow_shift = mul_pow(mant_max, radix1, radix_shift, P, FALSE, 0);
 1268|      0|        mpb_shr_round(mant_max, pow_shift, JS_RNDZ);
 1269|       |        
 1270|      0|        for(;;) {
 1271|       |            /* fixed and frac are rounded using RNDNA */
 1272|      0|            mul_pow_round(tmp1, m, e - 53, radix1, radix_shift, P - E, JS_RNDNA);
 1273|      0|            if (mpb_cmp(tmp1, mant_max) < 0)
  ------------------
  |  Branch (1273:17): [True: 0, False: 0]
  ------------------
 1274|      0|                break;
 1275|      0|            E++; /* at most one iteration is possible */
 1276|      0|        }
 1277|      0|    }
 1278|      0| output:
 1279|      0|    if (fmt == JS_DTOA_FORMAT_FIXED)
  ------------------
  |  |   34|      0|#define JS_DTOA_FORMAT_FIXED (1 << 0)
  ------------------
  |  Branch (1279:9): [True: 0, False: 0]
  ------------------
 1280|      0|        E_max = n_digits;
 1281|      0|    else
 1282|      0|        E_max = dtoa_max_digits_table[radix - 2] + 4;
 1283|      0|    if ((flags & JS_DTOA_EXP_MASK) == JS_DTOA_EXP_ENABLED ||
  ------------------
  |  |   44|      0|#define JS_DTOA_EXP_MASK     (3 << 2)
  ------------------
                  if ((flags & JS_DTOA_EXP_MASK) == JS_DTOA_EXP_ENABLED ||
  ------------------
  |  |   42|      0|#define JS_DTOA_EXP_ENABLED  (1 << 2)
  ------------------
  |  Branch (1283:9): [True: 0, False: 0]
  ------------------
 1284|      0|        ((flags & JS_DTOA_EXP_MASK) == JS_DTOA_EXP_AUTO && (E <= -6 || E > E_max))) {
  ------------------
  |  |   44|      0|#define JS_DTOA_EXP_MASK     (3 << 2)
  ------------------
                      ((flags & JS_DTOA_EXP_MASK) == JS_DTOA_EXP_AUTO && (E <= -6 || E > E_max))) {
  ------------------
  |  |   41|      0|#define JS_DTOA_EXP_AUTO     (0 << 2)
  ------------------
  |  Branch (1284:10): [True: 0, False: 0]
  |  Branch (1284:61): [True: 0, False: 0]
  |  Branch (1284:72): [True: 0, False: 0]
  ------------------
 1285|      0|        q += output_digits(q, tmp1, radix, P, 1);
 1286|      0|        E--;
 1287|      0|        if (radix == 10) {
  ------------------
  |  Branch (1287:13): [True: 0, False: 0]
  ------------------
 1288|      0|            *q++ = 'e';
 1289|      0|        } else if (radix1 == 1 && radix_shift <= 4) {
  ------------------
  |  Branch (1289:20): [True: 0, False: 0]
  |  Branch (1289:35): [True: 0, False: 0]
  ------------------
 1290|      0|            E *= radix_shift;
 1291|      0|            *q++ = 'p';
 1292|      0|        } else {
 1293|      0|            *q++ = '@';
 1294|      0|        }
 1295|      0|        if (E < 0) {
  ------------------
  |  Branch (1295:13): [True: 0, False: 0]
  ------------------
 1296|      0|            *q++ = '-';
 1297|      0|            E = -E;
 1298|      0|        } else {
 1299|      0|            *q++ = '+';
 1300|      0|        }
 1301|      0|        q += u32toa(q, E);
 1302|      0|    } else if (E <= 0) {
  ------------------
  |  Branch (1302:16): [True: 0, False: 0]
  ------------------
 1303|      0|        *q++ = '0';
 1304|      0|        *q++ = '.';
 1305|      0|        for(i = 0; i < -E; i++)
  ------------------
  |  Branch (1305:20): [True: 0, False: 0]
  ------------------
 1306|      0|            *q++ = '0';
 1307|      0|        q += output_digits(q, tmp1, radix, P, P);
 1308|      0|    } else {
 1309|      0|        q += output_digits(q, tmp1, radix, P, min_int(P, E));
 1310|      0|        for(i = 0; i < E - P; i++)
  ------------------
  |  Branch (1310:20): [True: 0, False: 0]
  ------------------
 1311|      0|            *q++ = '0';
 1312|      0|    }
 1313|      1| done:
 1314|      1|    *q = '\0';
 1315|      1|    dtoa_free(mant_max);
 1316|      1|    dtoa_free(tmp1);
 1317|      1|    return q - buf;
 1318|      0|}
js_atod:
 1356|     24|{
 1357|     24|    uint64_t *mptr = tmp_mem->mem;
 1358|     24|    const char *p, *p_start;
 1359|     24|    limb_t cur_limb, radix_base, extra_digits;
 1360|     24|    int is_neg, digit_count, limb_digit_count, digits_per_limb, sep, radix1, radix_shift;
 1361|     24|    int radix_bits, expn, e, max_digits, expn_offset, dot_pos, sig_pos, pos;
 1362|     24|    mpb_t *tmp0;
 1363|     24|    double dval;
 1364|     24|    BOOL is_bin_exp, is_zero, expn_overflow;
 1365|     24|    uint64_t m, a;
 1366|       |
 1367|     24|    tmp0 = dtoa_malloc(&mptr, sizeof(mpb_t) + sizeof(limb_t) * DBIGNUM_LEN_MAX);
  ------------------
  |  |   64|     24|#define DBIGNUM_LEN_MAX 52 /* ~ 2^(1072+53)*36^100 (dtoa) */
  ------------------
 1368|     24|    assert((mptr - tmp_mem->mem) <= sizeof(JSATODTempMem) / sizeof(mptr[0]));
  ------------------
  |  Branch (1368:5): [True: 0, False: 24]
  |  Branch (1368:5): [True: 24, False: 0]
  ------------------
 1369|       |    /* optional separator between digits */
 1370|     24|    sep = (flags & JS_ATOD_ACCEPT_UNDERSCORES) ? '_' : 256;
  ------------------
  |  |   55|     24|#define JS_ATOD_ACCEPT_UNDERSCORES  (1 << 3)
  ------------------
  |  Branch (1370:11): [True: 0, False: 24]
  ------------------
 1371|       |
 1372|     24|    p = str;
 1373|     24|    is_neg = 0;
 1374|     24|    if (p[0] == '+') {
  ------------------
  |  Branch (1374:9): [True: 0, False: 24]
  ------------------
 1375|      0|        p++;
 1376|      0|        p_start = p;
 1377|     24|    } else if (p[0] == '-') {
  ------------------
  |  Branch (1377:16): [True: 0, False: 24]
  ------------------
 1378|      0|        is_neg = 1;
 1379|      0|        p++;
 1380|      0|        p_start = p;
 1381|     24|    } else {
 1382|     24|        p_start = p;
 1383|     24|    }
 1384|       |    
 1385|     24|    if (p[0] == '0') {
  ------------------
  |  Branch (1385:9): [True: 5, False: 19]
  ------------------
 1386|      5|        if ((p[1] == 'x' || p[1] == 'X') &&
  ------------------
  |  Branch (1386:14): [True: 0, False: 5]
  |  Branch (1386:29): [True: 0, False: 5]
  ------------------
 1387|      0|            (radix == 0 || radix == 16)) {
  ------------------
  |  Branch (1387:14): [True: 0, False: 0]
  |  Branch (1387:28): [True: 0, False: 0]
  ------------------
 1388|      0|            p += 2;
 1389|      0|            radix = 16;
 1390|      5|        } else if ((p[1] == 'o' || p[1] == 'O') &&
  ------------------
  |  Branch (1390:21): [True: 0, False: 5]
  |  Branch (1390:36): [True: 0, False: 5]
  ------------------
 1391|      0|                   radix == 0 && (flags & JS_ATOD_ACCEPT_BIN_OCT)) {
  ------------------
  |  |   51|      0|#define JS_ATOD_ACCEPT_BIN_OCT (1 << 1)
  ------------------
  |  Branch (1391:20): [True: 0, False: 0]
  |  Branch (1391:34): [True: 0, False: 0]
  ------------------
 1392|      0|            p += 2;
 1393|      0|            radix = 8;
 1394|      5|        } else if ((p[1] == 'b' || p[1] == 'B') &&
  ------------------
  |  Branch (1394:21): [True: 0, False: 5]
  |  Branch (1394:36): [True: 0, False: 5]
  ------------------
 1395|      0|                   radix == 0 && (flags & JS_ATOD_ACCEPT_BIN_OCT)) {
  ------------------
  |  |   51|      0|#define JS_ATOD_ACCEPT_BIN_OCT (1 << 1)
  ------------------
  |  Branch (1395:20): [True: 0, False: 0]
  |  Branch (1395:34): [True: 0, False: 0]
  ------------------
 1396|      0|            p += 2;
 1397|      0|            radix = 2;
 1398|      5|        } else if ((p[1] >= '0' && p[1] <= '9') &&
  ------------------
  |  Branch (1398:21): [True: 1, False: 4]
  |  Branch (1398:36): [True: 1, False: 0]
  ------------------
 1399|      1|                   radix == 0 && (flags & JS_ATOD_ACCEPT_LEGACY_OCTAL)) {
  ------------------
  |  |   53|      0|#define JS_ATOD_ACCEPT_LEGACY_OCTAL  (1 << 2)
  ------------------
  |  Branch (1399:20): [True: 0, False: 1]
  |  Branch (1399:34): [True: 0, False: 0]
  ------------------
 1400|      0|            int i;
 1401|      0|            sep = 256;
 1402|      0|            for (i = 1; (p[i] >= '0' && p[i] <= '7'); i++)
  ------------------
  |  Branch (1402:26): [True: 0, False: 0]
  |  Branch (1402:41): [True: 0, False: 0]
  ------------------
 1403|      0|                continue;
 1404|      0|            if (p[i] == '8' || p[i] == '9')
  ------------------
  |  Branch (1404:17): [True: 0, False: 0]
  |  Branch (1404:32): [True: 0, False: 0]
  ------------------
 1405|      0|                goto no_prefix;
 1406|      0|            p += 1;
 1407|      0|            radix = 8;
 1408|      5|        } else {
 1409|      5|            goto no_prefix;
 1410|      5|        }
 1411|       |        /* there must be a digit after the prefix */
 1412|      0|        if (to_digit((uint8_t)*p) >= radix)
  ------------------
  |  Branch (1412:13): [True: 0, False: 0]
  ------------------
 1413|      0|            goto fail;
 1414|      5|    no_prefix: ;
 1415|     19|    } else {
 1416|     19|        if (!(flags & JS_ATOD_INT_ONLY) && strstart(p, "Infinity", &p))
  ------------------
  |  |   49|     19|#define JS_ATOD_INT_ONLY       (1 << 0)
  ------------------
  |  Branch (1416:13): [True: 12, False: 7]
  |  Branch (1416:44): [True: 0, False: 12]
  ------------------
 1417|      0|            goto overflow;
 1418|     19|    }
 1419|     24|    if (radix == 0)
  ------------------
  |  Branch (1419:9): [True: 0, False: 24]
  ------------------
 1420|      0|        radix = 10;
 1421|       |
 1422|     24|    cur_limb = 0;
 1423|     24|    expn_offset = 0;
 1424|     24|    digit_count = 0;
 1425|     24|    limb_digit_count = 0;
 1426|     24|    max_digits = atod_max_digits_table[radix - 2];
 1427|     24|    digits_per_limb = digits_per_limb_table[radix - 2];
 1428|     24|    radix_base = radix_base_table[radix - 2];
 1429|     24|    radix_shift = ctz32(radix);
 1430|     24|    radix1 = radix >> radix_shift;
 1431|     24|    if (radix1 == 1) {
  ------------------
  |  Branch (1431:9): [True: 2, False: 22]
  ------------------
 1432|       |        /* radix = 2^radix_bits */
 1433|      2|        radix_bits = radix_shift;
 1434|     22|    } else {
 1435|     22|        radix_bits = 0;
 1436|     22|    }
 1437|     24|    tmp0->len = 1;
 1438|     24|    tmp0->tab[0] = 0;
 1439|     24|    extra_digits = 0;
 1440|     24|    pos = 0;
 1441|     24|    dot_pos = -1;
 1442|       |    /* skip leading zeros */
 1443|  5.30k|    for(;;) {
 1444|  5.30k|        if (*p == '.' && (p > p_start || to_digit(p[1]) < radix) &&
  ------------------
  |  Branch (1444:13): [True: 0, False: 5.30k]
  |  Branch (1444:27): [True: 0, False: 0]
  |  Branch (1444:42): [True: 0, False: 0]
  ------------------
 1445|      0|            !(flags & JS_ATOD_INT_ONLY)) {
  ------------------
  |  |   49|      0|#define JS_ATOD_INT_ONLY       (1 << 0)
  ------------------
  |  Branch (1445:13): [True: 0, False: 0]
  ------------------
 1446|      0|            if (*p == sep)
  ------------------
  |  Branch (1446:17): [True: 0, False: 0]
  ------------------
 1447|      0|                goto fail;
 1448|      0|            if (dot_pos >= 0)
  ------------------
  |  Branch (1448:17): [True: 0, False: 0]
  ------------------
 1449|      0|                break;
 1450|      0|            dot_pos = pos;
 1451|      0|            p++;
 1452|      0|        }
 1453|  5.30k|        if (*p == sep && p > p_start && p[1] == '0')
  ------------------
  |  Branch (1453:13): [True: 0, False: 5.30k]
  |  Branch (1453:26): [True: 0, False: 0]
  |  Branch (1453:41): [True: 0, False: 0]
  ------------------
 1454|      0|            p++;
 1455|  5.30k|        if (*p != '0')
  ------------------
  |  Branch (1455:13): [True: 24, False: 5.27k]
  ------------------
 1456|     24|            break;
 1457|  5.27k|        p++;
 1458|  5.27k|        pos++;
 1459|  5.27k|    }
 1460|       |    
 1461|     24|    sig_pos = pos;
 1462|  3.14M|    for(;;) {
 1463|  3.14M|        limb_t c;
 1464|  3.14M|        if (*p == '.' && (p > p_start || to_digit(p[1]) < radix) &&
  ------------------
  |  Branch (1464:13): [True: 12, False: 3.14M]
  |  Branch (1464:27): [True: 12, False: 0]
  |  Branch (1464:42): [True: 0, False: 0]
  ------------------
 1465|     12|            !(flags & JS_ATOD_INT_ONLY)) {
  ------------------
  |  |   49|     12|#define JS_ATOD_INT_ONLY       (1 << 0)
  ------------------
  |  Branch (1465:13): [True: 12, False: 0]
  ------------------
 1466|     12|            if (*p == sep)
  ------------------
  |  Branch (1466:17): [True: 0, False: 12]
  ------------------
 1467|      0|                goto fail;
 1468|     12|            if (dot_pos >= 0)
  ------------------
  |  Branch (1468:17): [True: 0, False: 12]
  ------------------
 1469|      0|                break;
 1470|     12|            dot_pos = pos;
 1471|     12|            p++;
 1472|     12|        }
 1473|  3.14M|        if (*p == sep && p > p_start && to_digit(p[1]) < radix)
  ------------------
  |  Branch (1473:13): [True: 0, False: 3.14M]
  |  Branch (1473:26): [True: 0, False: 0]
  |  Branch (1473:41): [True: 0, False: 0]
  ------------------
 1474|      0|            p++;
 1475|  3.14M|        c = to_digit(*p);
 1476|  3.14M|        if (c >= radix)
  ------------------
  |  Branch (1476:13): [True: 24, False: 3.14M]
  ------------------
 1477|     24|            break;
 1478|  3.14M|        p++;
 1479|  3.14M|        pos++;
 1480|  3.14M|        if (digit_count < max_digits) {
  ------------------
  |  Branch (1480:13): [True: 106, False: 3.14M]
  ------------------
 1481|       |            /* XXX: could be faster when radix_bits != 0 */
 1482|    106|            cur_limb = cur_limb * radix + c;
 1483|    106|            limb_digit_count++;
 1484|    106|            if (limb_digit_count == digits_per_limb) {
  ------------------
  |  Branch (1484:17): [True: 8, False: 98]
  ------------------
 1485|      8|                mpb_mul1_base(tmp0, radix_base, cur_limb);
 1486|      8|                cur_limb = 0;
 1487|      8|                limb_digit_count = 0;
 1488|      8|            }
 1489|    106|            digit_count++;
 1490|  3.14M|        } else {
 1491|  3.14M|            extra_digits |= c;
 1492|  3.14M|        }
 1493|  3.14M|    }
 1494|     24|    if (limb_digit_count != 0) {
  ------------------
  |  Branch (1494:9): [True: 19, False: 5]
  ------------------
 1495|     19|        mpb_mul1_base(tmp0, pow_ui(radix, limb_digit_count), cur_limb);
 1496|     19|    }
 1497|     24|    if (digit_count == 0) {
  ------------------
  |  Branch (1497:9): [True: 4, False: 20]
  ------------------
 1498|      4|        is_zero = TRUE;
 1499|      4|        expn_offset = 0;
 1500|     20|    } else {
 1501|     20|        is_zero = FALSE;
 1502|     20|        if (dot_pos < 0)
  ------------------
  |  Branch (1502:13): [True: 8, False: 12]
  ------------------
 1503|      8|            dot_pos = pos;
 1504|     20|        expn_offset = sig_pos + digit_count - dot_pos;
 1505|     20|    }
 1506|       |    
 1507|       |    /* Use the extra digits for rounding if the base is a power of
 1508|       |       two. Otherwise they are just truncated. */
 1509|     24|    if (radix_bits != 0 && extra_digits != 0) {
  ------------------
  |  Branch (1509:9): [True: 2, False: 22]
  |  Branch (1509:28): [True: 2, False: 0]
  ------------------
 1510|      2|        tmp0->tab[0] |= 1;
 1511|      2|    }
 1512|       |    
 1513|       |    /* parse the exponent, if any */
 1514|     24|    expn = 0;
 1515|     24|    expn_overflow = FALSE;
 1516|     24|    is_bin_exp = FALSE;
 1517|     24|    if (!(flags & JS_ATOD_INT_ONLY) &&
  ------------------
  |  |   49|     24|#define JS_ATOD_INT_ONLY       (1 << 0)
  ------------------
  |  Branch (1517:9): [True: 12, False: 12]
  ------------------
 1518|     12|        ((radix == 10 && (*p == 'e' || *p == 'E')) ||
  ------------------
  |  Branch (1518:11): [True: 12, False: 0]
  |  Branch (1518:27): [True: 0, False: 12]
  |  Branch (1518:40): [True: 0, False: 12]
  ------------------
 1519|     12|         (radix != 10 && (*p == '@' ||
  ------------------
  |  Branch (1519:11): [True: 0, False: 12]
  |  Branch (1519:27): [True: 0, False: 0]
  ------------------
 1520|      0|                          (radix_bits >= 1 && radix_bits <= 4 && (*p == 'p' || *p == 'P'))))) &&
  ------------------
  |  Branch (1520:28): [True: 0, False: 0]
  |  Branch (1520:47): [True: 0, False: 0]
  |  Branch (1520:67): [True: 0, False: 0]
  |  Branch (1520:80): [True: 0, False: 0]
  ------------------
 1521|      0|        p > p_start) {
  ------------------
  |  Branch (1521:9): [True: 0, False: 0]
  ------------------
 1522|      0|        BOOL exp_is_neg;
 1523|      0|        int c;
 1524|      0|        is_bin_exp = (*p == 'p' || *p == 'P');
  ------------------
  |  Branch (1524:23): [True: 0, False: 0]
  |  Branch (1524:36): [True: 0, False: 0]
  ------------------
 1525|      0|        p++;
 1526|      0|        exp_is_neg = 0;
 1527|      0|        if (*p == '+') {
  ------------------
  |  Branch (1527:13): [True: 0, False: 0]
  ------------------
 1528|      0|            p++;
 1529|      0|        } else if (*p == '-') {
  ------------------
  |  Branch (1529:20): [True: 0, False: 0]
  ------------------
 1530|      0|            exp_is_neg = 1;
 1531|      0|            p++;
 1532|      0|        }
 1533|      0|        c = to_digit(*p);
 1534|      0|        if (c >= 10)
  ------------------
  |  Branch (1534:13): [True: 0, False: 0]
  ------------------
 1535|      0|            goto fail; /* XXX: could stop before the exponent part */
 1536|      0|        expn = c;
 1537|      0|        p++;
 1538|      0|        for(;;) {
 1539|      0|            if (*p == sep && to_digit(p[1]) < 10)
  ------------------
  |  Branch (1539:17): [True: 0, False: 0]
  |  Branch (1539:30): [True: 0, False: 0]
  ------------------
 1540|      0|                p++;
 1541|      0|            c = to_digit(*p);
 1542|      0|            if (c >= 10)
  ------------------
  |  Branch (1542:17): [True: 0, False: 0]
  ------------------
 1543|      0|                break;
 1544|      0|            if (!expn_overflow) {
  ------------------
  |  Branch (1544:17): [True: 0, False: 0]
  ------------------
 1545|      0|                if (unlikely(expn > ((INT32_MAX - 2 - 9) / 10))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1546|      0|                    expn_overflow = TRUE;
 1547|      0|                } else {
 1548|      0|                    expn = expn * 10 + c;
 1549|      0|                }
 1550|      0|            }
 1551|      0|            p++;
 1552|      0|        }
 1553|      0|        if (exp_is_neg)
  ------------------
  |  Branch (1553:13): [True: 0, False: 0]
  ------------------
 1554|      0|            expn = -expn;
 1555|       |        /* if zero result, the exponent can be arbitrarily large */
 1556|      0|        if (!is_zero && expn_overflow) {
  ------------------
  |  Branch (1556:13): [True: 0, False: 0]
  |  Branch (1556:25): [True: 0, False: 0]
  ------------------
 1557|      0|            if (exp_is_neg)
  ------------------
  |  Branch (1557:17): [True: 0, False: 0]
  ------------------
 1558|      0|                a = 0;
 1559|      0|            else
 1560|      0|                a = (uint64_t)0x7ff << 52; /* infinity */
 1561|      0|            goto done;
 1562|      0|        }
 1563|      0|    }
 1564|       |
 1565|     24|    if (p == p_start)
  ------------------
  |  Branch (1565:9): [True: 0, False: 24]
  ------------------
 1566|      0|        goto fail;
 1567|       |
 1568|     24|    if (is_zero) {
  ------------------
  |  Branch (1568:9): [True: 4, False: 20]
  ------------------
 1569|      4|        a = 0;
 1570|     20|    } else {
 1571|     20|        int expn1;
 1572|     20|        if (radix_bits != 0) {
  ------------------
  |  Branch (1572:13): [True: 2, False: 18]
  ------------------
 1573|      2|            if (!is_bin_exp)
  ------------------
  |  Branch (1573:17): [True: 2, False: 0]
  ------------------
 1574|      2|                expn *= radix_bits;
 1575|      2|            expn -= expn_offset * radix_bits;
 1576|      2|            expn1 = expn + digit_count * radix_bits;
 1577|      2|            if (expn1 >= 1024 + radix_bits)
  ------------------
  |  Branch (1577:17): [True: 2, False: 0]
  ------------------
 1578|      2|                goto overflow;
 1579|      0|            else if (expn1 <= -1075)
  ------------------
  |  Branch (1579:22): [True: 0, False: 0]
  ------------------
 1580|      0|                goto underflow;
 1581|      0|            m = round_to_d(&e, tmp0, -expn, JS_RNDN);
 1582|     18|        } else {
 1583|     18|            expn -= expn_offset;
 1584|     18|            expn1 = expn + digit_count;
 1585|     18|            if (expn1 >= max_exponent[radix - 2] + 1)
  ------------------
  |  Branch (1585:17): [True: 1, False: 17]
  ------------------
 1586|      1|                goto overflow;
 1587|     17|            else if (expn1 <= min_exponent[radix - 2])
  ------------------
  |  Branch (1587:22): [True: 0, False: 17]
  ------------------
 1588|      0|                goto underflow;
 1589|     17|            m = mul_pow_round_to_d(&e, tmp0, radix1, radix_shift, expn, JS_RNDN);
 1590|     17|        }
 1591|     17|        if (m == 0) {
  ------------------
  |  Branch (1591:13): [True: 0, False: 17]
  ------------------
 1592|      0|        underflow:
 1593|      0|            a = 0;
 1594|     17|        } else if (e > 1024) {
  ------------------
  |  Branch (1594:20): [True: 0, False: 17]
  ------------------
 1595|      3|        overflow:
 1596|       |            /* overflow */
 1597|      3|            a = (uint64_t)0x7ff << 52;
 1598|     17|        } else if (e < -1073) {
  ------------------
  |  Branch (1598:20): [True: 0, False: 17]
  ------------------
 1599|       |            /* underflow */
 1600|       |            /* XXX: check rounding */
 1601|      0|            a = 0;
 1602|     17|        } else if (e < -1021) {
  ------------------
  |  Branch (1602:20): [True: 0, False: 17]
  ------------------
 1603|       |            /* subnormal */
 1604|      0|            a = m >> (-e - 1021);
 1605|     17|        } else {
 1606|     17|            a = ((uint64_t)(e + 1022) << 52) | (m & (((uint64_t)1 << 52) - 1));
 1607|     17|        }
 1608|     17|    }
 1609|     24| done:
 1610|     24|    a |= (uint64_t)is_neg << 63;
 1611|     24|    dval = uint64_as_float64(a);
 1612|     24| done1:
 1613|     24|    if (pnext)
  ------------------
  |  Branch (1613:9): [True: 0, False: 24]
  ------------------
 1614|      0|        *pnext = p;
 1615|     24|    dtoa_free(tmp0);
 1616|     24|    return dval;
 1617|      0| fail:
 1618|       |    dval = NAN;
 1619|      0|    goto done1;
 1620|     24|}
dtoa.c:dtoa_malloc:
 1095|     26|{
 1096|     26|    void *ret;
 1097|     26|    ret = *pptr;
 1098|     26|    *pptr += (size + 7) / 8;
 1099|     26|    return ret;
 1100|     26|}
dtoa.c:pow_ui:
  243|     19|{
  244|     19|    int i, n_bits;
  245|     19|    uint64_t r;
  246|     19|    if (b == 0)
  ------------------
  |  Branch (246:9): [True: 0, False: 19]
  ------------------
  247|      0|        return 1;
  248|     19|    if (b == 1)
  ------------------
  |  Branch (248:9): [True: 14, False: 5]
  ------------------
  249|     14|        return a;
  250|      5|#ifdef USE_POW5_TABLE
  251|      5|    if ((a == 5 || a == 10) && b <= 17) {
  ------------------
  |  Branch (251:10): [True: 0, False: 5]
  |  Branch (251:20): [True: 5, False: 0]
  |  Branch (251:32): [True: 5, False: 0]
  ------------------
  252|      5|        r = pow5_table[b - 1];
  253|      5|        if (b >= 14) {
  ------------------
  |  Branch (253:13): [True: 0, False: 5]
  ------------------
  254|      0|            r |= (uint64_t)pow5h_table[b - 14] << 32;
  255|      0|        }
  256|      5|        if (a == 10)
  ------------------
  |  Branch (256:13): [True: 5, False: 0]
  ------------------
  257|      5|            r <<= b;
  258|      5|        return r;
  259|      5|    }
  260|      0|#endif
  261|      0|    r = a;
  262|      0|    n_bits = 32 - clz32(b);
  263|      0|    for(i = n_bits - 2; i >= 0; i--) {
  ------------------
  |  Branch (263:25): [True: 0, False: 0]
  ------------------
  264|      0|        r *= r;
  265|      0|        if ((b >> i) & 1)
  ------------------
  |  Branch (265:13): [True: 0, False: 0]
  ------------------
  266|      0|            r *= a;
  267|      0|    }
  268|      0|    return r;
  269|      5|}
dtoa.c:mpb_get_u64:
  435|     17|{
  436|       |#if LIMB_BITS == 64
  437|       |    return r->tab[0];
  438|       |#else
  439|     17|    if (r->len == 1) {
  ------------------
  |  Branch (439:9): [True: 0, False: 17]
  ------------------
  440|      0|        return r->tab[0];
  441|     17|    } else {
  442|     17|        return r->tab[0] | ((uint64_t)r->tab[1] << LIMB_BITS);
  ------------------
  |  |   54|     17|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|     17|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  443|     17|    }
  444|     17|#endif
  445|     17|}
dtoa.c:mul_pow_round_to_d:
 1008|     17|{
 1009|     17|    int e_offset;
 1010|       |
 1011|     17|    e_offset = mul_pow(a, radix1, radix_shift, f, FALSE, 55);
 1012|     17|    return round_to_d(pe, a, e_offset, rnd_mode);
 1013|     17|}
dtoa.c:mpb_renorm:
  215|     28|{
  216|     47|    while (r->len > 1 && r->tab[r->len - 1] == 0)
  ------------------
  |  Branch (216:12): [True: 30, False: 17]
  |  Branch (216:26): [True: 19, False: 11]
  ------------------
  217|     19|        r->len--;
  218|     28|}
dtoa.c:mul_pow:
  894|     17|{
  895|     17|    int e_offset, d, n, n0;
  896|       |
  897|     17|    e_offset = -f * radix_shift;
  898|     17|    if (radix1 != 1) {
  ------------------
  |  Branch (898:9): [True: 17, False: 0]
  ------------------
  899|     17|        d = digits_per_limb_table[radix1 - 2];
  900|     17|        if (f >= 0) {
  ------------------
  |  Branch (900:13): [True: 15, False: 2]
  ------------------
  901|     15|            limb_t h, b;
  902|       |            
  903|     15|            b = 0;
  904|     15|            n0 = 0;
  905|     15|            while (f != 0) {
  ------------------
  |  Branch (905:20): [True: 0, False: 15]
  ------------------
  906|      0|                n = min_int(f, d);
  907|      0|                if (n != n0) {
  ------------------
  |  Branch (907:21): [True: 0, False: 0]
  ------------------
  908|      0|                    b = pow_ui(radix1, n);
  909|      0|                    n0 = n;
  910|      0|                }
  911|      0|                h = mp_mul1(a->tab, a->tab, a->len, b, 0);
  912|      0|                if (h != 0) {
  ------------------
  |  Branch (912:21): [True: 0, False: 0]
  ------------------
  913|      0|                    a->tab[a->len++] = h;
  914|      0|                }
  915|      0|                f -= n;
  916|      0|            }
  917|     15|        } else {
  918|      2|            int extra_bits, l, shift;
  919|      2|            limb_t r, rem, b, b_inv;
  920|       |            
  921|      2|            f = -f;
  922|      2|            l = (f + d - 1) / d; /* high bound for the number of limbs (XXX: make it better) */
  923|      2|            e_offset += l * LIMB_BITS;
  ------------------
  |  |   54|      2|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      2|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  924|      2|            if (!is_int) {
  ------------------
  |  Branch (924:17): [True: 2, False: 0]
  ------------------
  925|       |                /* at least 'e' bits are needed in the final result for rounding */
  926|      2|                extra_bits = max_int(e - mpb_floor_log2(a), 0);
  927|      2|            } else {
  928|       |                /* at least two extra bits are needed in the final result
  929|       |                   for rounding */
  930|      0|                extra_bits = max_int(2 + e - e_offset, 0);
  931|      0|            }
  932|      2|            e_offset += extra_bits;
  933|      2|            mpb_shr_round(a, -(l * LIMB_BITS + extra_bits), JS_RNDZ);
  ------------------
  |  |   54|      2|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      2|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  934|       |            
  935|      2|            b = 0;
  936|      2|            b_inv = 0;
  937|      2|            shift = 0;
  938|      2|            n0 = 0;
  939|      2|            rem = 0;
  940|      4|            while (f != 0) {
  ------------------
  |  Branch (940:20): [True: 2, False: 2]
  ------------------
  941|      2|                n = min_int(f, d);
  942|      2|                if (n != n0) {
  ------------------
  |  Branch (942:21): [True: 2, False: 0]
  ------------------
  943|      2|                    b = pow_ui_inv(&b_inv, &shift, radix1, n);
  944|      2|                    n0 = n;
  945|      2|                }
  946|      2|                r = mp_div1norm(a->tab, a->tab, a->len, b, 0, b_inv, shift);
  947|      2|                rem |= r;
  948|      2|                mpb_renorm(a);
  949|      2|                f -= n;
  950|      2|            }
  951|       |            /* if the remainder is non zero, use it for rounding */
  952|      2|            a->tab[0] |= (rem != 0);
  953|      2|        }
  954|     17|    }
  955|     17|    return e_offset;
  956|     17|}
dtoa.c:mp_mul1:
   94|      6|{
   95|      6|    limb_t i;
   96|      6|    dlimb_t t;
   97|       |
   98|     19|    for(i = 0; i < n; i++) {
  ------------------
  |  Branch (98:16): [True: 13, False: 6]
  ------------------
   99|     13|        t = (dlimb_t)taba[i] * (dlimb_t)b + l;
  100|     13|        tabr[i] = t;
  101|     13|        l = t >> LIMB_BITS;
  ------------------
  |  |   54|     13|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|     13|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  102|     13|    }
  103|      6|    return l;
  104|      6|}
dtoa.c:mpb_floor_log2:
  449|     19|{
  450|     19|    limb_t v;
  451|     19|    v = a->tab[a->len - 1];
  452|     19|    if (v == 0)
  ------------------
  |  Branch (452:9): [True: 0, False: 19]
  ------------------
  453|      0|        return -1;
  454|     19|    else
  455|     19|        return a->len * LIMB_BITS - 1 - clz32(v);
  ------------------
  |  |   54|     19|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|     19|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  456|     19|}
dtoa.c:pow_ui_inv:
  272|      2|{
  273|      2|    uint32_t r_inv, r;
  274|      2|    int shift;
  275|      2|#ifdef USE_POW5_TABLE
  276|      2|    if (a == 5 && b >= 1 && b <= 13) {
  ------------------
  |  Branch (276:9): [True: 2, False: 0]
  |  Branch (276:19): [True: 2, False: 0]
  |  Branch (276:29): [True: 2, False: 0]
  ------------------
  277|      2|        r = pow5_table[b - 1];
  278|      2|        shift = clz32(r);
  279|      2|        r <<= shift;
  280|      2|        r_inv = pow5_inv_table[b - 1];
  281|      2|    } else
  282|      0|#endif
  283|      0|    {
  284|      0|        r = pow_ui(a, b);
  285|      0|        shift = clz32(r);
  286|      0|        r <<= shift;
  287|      0|        r_inv = udiv1norm_init(r);
  288|      0|    }
  289|      2|    *pshift = shift;
  290|      2|    *pr_inv = r_inv;
  291|      2|    return r;
  292|      2|}
dtoa.c:mp_div1norm:
  188|      2|{
  189|      2|    slimb_t i;
  190|       |
  191|      2|    if (shift != 0) {
  ------------------
  |  Branch (191:9): [True: 2, False: 0]
  ------------------
  192|      2|        r = (r << shift) | mp_shl(tabr, taba, n, shift, 0);
  193|      2|    }
  194|      8|    for(i = n - 1; i >= 0; i--) {
  ------------------
  |  Branch (194:20): [True: 6, False: 2]
  ------------------
  195|      6|        tabr[i] = udiv1norm(&r, r, taba[i], b, b_inv);
  196|      6|    }
  197|      2|    r >>= shift;
  198|      2|    return r;
  199|      2|}
dtoa.c:mp_shl:
  172|     19|{
  173|     19|    mp_size_t i;
  174|     19|    limb_t l, a;
  175|       |
  176|     19|    assert(shift >= 1 && shift < LIMB_BITS);
  ------------------
  |  Branch (176:5): [True: 0, False: 19]
  |  Branch (176:5): [True: 0, False: 0]
  |  Branch (176:5): [True: 19, False: 0]
  |  Branch (176:5): [True: 19, False: 0]
  ------------------
  177|     19|    l = low;
  178|     42|    for(i = 0; i < n; i++) {
  ------------------
  |  Branch (178:16): [True: 23, False: 19]
  ------------------
  179|     23|        a = tab[i];
  180|     23|        tab_r[i] = (a << shift) | l;
  181|     23|        l = (a >> (LIMB_BITS - shift)); 
  ------------------
  |  |   54|     23|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|     23|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  182|     23|    }
  183|     19|    return l;
  184|     19|}
dtoa.c:udiv1norm:
  119|      6|{
  120|      6|    limb_t n1m, n_adj, q, r, ah;
  121|      6|    dlimb_t a;
  122|      6|    n1m = ((slimb_t)a0 >> (LIMB_BITS - 1));
  ------------------
  |  |   54|      6|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      6|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  123|      6|    n_adj = a0 + (n1m & d);
  124|      6|    a = (dlimb_t)d_inv * (a1 - n1m) + n_adj;
  125|      6|    q = (a >> LIMB_BITS) + a1;
  ------------------
  |  |   54|      6|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      6|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  126|       |    /* compute a - q * r and update q so that the remainder is between
  127|       |       0 and d - 1 */
  128|      6|    a = ((dlimb_t)a1 << LIMB_BITS) | a0;
  ------------------
  |  |   54|      6|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      6|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  129|      6|    a = a - (dlimb_t)q * d - d;
  130|      6|    ah = a >> LIMB_BITS;
  ------------------
  |  |   54|      6|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      6|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  131|      6|    q += 1 + ah;
  132|      6|    r = (limb_t)a + (ah & d);
  133|      6|    *pr = r;
  134|      6|    return q;
  135|      6|}
dtoa.c:mpb_shr_round:
  314|     19|{
  315|     19|    int l, i;
  316|       |
  317|     19|    if (shift == 0)
  ------------------
  |  Branch (317:9): [True: 0, False: 19]
  ------------------
  318|      0|        return;
  319|     19|    if (shift < 0) {
  ------------------
  |  Branch (319:9): [True: 17, False: 2]
  ------------------
  320|     17|        shift = -shift;
  321|     17|        l = (unsigned)shift / LIMB_BITS;
  ------------------
  |  |   54|     17|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|     17|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  322|     17|        shift = shift & (LIMB_BITS - 1);
  ------------------
  |  |   54|     17|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|     17|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  323|     17|        if (shift != 0) {
  ------------------
  |  Branch (323:13): [True: 17, False: 0]
  ------------------
  324|     17|            r->tab[r->len] = mp_shl(r->tab, r->tab, r->len, shift, 0);
  325|     17|            r->len++;
  326|     17|            mpb_renorm(r);
  327|     17|        }
  328|     17|        if (l > 0) {
  ------------------
  |  Branch (328:13): [True: 17, False: 0]
  ------------------
  329|     34|            for(i = r->len - 1; i >= 0; i--)
  ------------------
  |  Branch (329:33): [True: 17, False: 17]
  ------------------
  330|     17|                r->tab[i + l] = r->tab[i];
  331|     36|            for(i = 0; i < l; i++)
  ------------------
  |  Branch (331:24): [True: 19, False: 17]
  ------------------
  332|     19|                r->tab[i] = 0;
  333|     17|            r->len += l;
  334|     17|        }
  335|     17|    } else {
  336|      2|        limb_t bit1, bit2;
  337|      2|        int k, add_one;
  338|       |        
  339|      2|        switch(rnd_mode) {
  340|      0|        default:
  ------------------
  |  Branch (340:9): [True: 0, False: 2]
  ------------------
  341|      0|        case JS_RNDZ:
  ------------------
  |  Branch (341:9): [True: 0, False: 2]
  ------------------
  342|      0|            add_one = 0;
  343|      0|            break;
  344|      2|        case JS_RNDN:
  ------------------
  |  Branch (344:9): [True: 2, False: 0]
  ------------------
  345|      2|        case JS_RNDNA:
  ------------------
  |  Branch (345:9): [True: 0, False: 2]
  ------------------
  346|      2|            bit1 = mpb_get_bit(r, shift - 1);
  347|      2|            if (bit1) {
  ------------------
  |  Branch (347:17): [True: 2, False: 0]
  ------------------
  348|      2|                if (rnd_mode == JS_RNDNA) {
  ------------------
  |  Branch (348:21): [True: 0, False: 2]
  ------------------
  349|      0|                    bit2 = 1;
  350|      2|                } else {
  351|       |                    /* bit2 = oring of all the bits after bit1 */
  352|      2|                    bit2 = 0;
  353|      2|                    if (shift >= 2) {
  ------------------
  |  Branch (353:25): [True: 2, False: 0]
  ------------------
  354|      2|                        k = shift - 1;
  355|      2|                        l = (unsigned)k / LIMB_BITS;
  ------------------
  |  |   54|      2|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      2|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  356|      2|                        k = k & (LIMB_BITS - 1);
  ------------------
  |  |   54|      2|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      2|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  357|      4|                        for(i = 0; i < min_int(l, r->len); i++)
  ------------------
  |  Branch (357:36): [True: 2, False: 2]
  ------------------
  358|      2|                            bit2 |= r->tab[i];
  359|      2|                        if (l < r->len)
  ------------------
  |  Branch (359:29): [True: 2, False: 0]
  ------------------
  360|      2|                            bit2 |= r->tab[l] & (((limb_t)1 << k) - 1);
  361|      2|                    }
  362|      2|                }
  363|      2|                if (bit2) {
  ------------------
  |  Branch (363:21): [True: 2, False: 0]
  ------------------
  364|      2|                    add_one = 1;
  365|      2|                } else {
  366|       |                    /* round to even */
  367|      0|                    add_one = mpb_get_bit(r, shift);
  368|      0|                }
  369|      2|            } else {
  370|      0|                add_one = 0;
  371|      0|            }
  372|      2|            break;
  373|      2|        }
  374|       |
  375|      2|        l = (unsigned)shift / LIMB_BITS;
  ------------------
  |  |   54|      2|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      2|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  376|      2|        shift = shift & (LIMB_BITS - 1);
  ------------------
  |  |   54|      2|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      2|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  377|      2|        if (l >= r->len) {
  ------------------
  |  Branch (377:13): [True: 0, False: 2]
  ------------------
  378|      0|            r->len = 1;
  379|      0|            r->tab[0] = add_one;
  380|      2|        } else {
  381|      2|            if (l > 0) {
  ------------------
  |  Branch (381:17): [True: 2, False: 0]
  ------------------
  382|      2|                r->len -= l;
  383|      6|                for(i = 0; i < r->len; i++)
  ------------------
  |  Branch (383:28): [True: 4, False: 2]
  ------------------
  384|      4|                    r->tab[i] = r->tab[i + l];
  385|      2|            }
  386|      2|            if (shift != 0) {
  ------------------
  |  Branch (386:17): [True: 2, False: 0]
  ------------------
  387|      2|                mp_shr(r->tab, r->tab, r->len, shift, 0);
  388|      2|                mpb_renorm(r);
  389|      2|            }
  390|      2|            if (add_one) {
  ------------------
  |  Branch (390:17): [True: 2, False: 0]
  ------------------
  391|      2|                limb_t a;
  392|      2|                a = mp_add_ui(r->tab, 1, r->len);
  393|      2|                if (a)
  ------------------
  |  Branch (393:21): [True: 0, False: 2]
  ------------------
  394|      0|                    r->tab[r->len++] = a;
  395|      2|            }
  396|      2|        }
  397|      2|    }
  398|     19|}
dtoa.c:mpb_get_bit:
  301|      2|{
  302|      2|    int l;
  303|       |    
  304|      2|    l = (unsigned)k / LIMB_BITS;
  ------------------
  |  |   54|      2|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      2|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  305|      2|    k = k & (LIMB_BITS - 1);
  ------------------
  |  |   54|      2|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      2|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  306|      2|    if (l >= r->len)
  ------------------
  |  Branch (306:9): [True: 0, False: 2]
  ------------------
  307|      0|        return 0;
  308|      2|    else
  309|      2|        return (r->tab[l] >> k) & 1;
  310|      2|}
dtoa.c:mp_shr:
  154|      2|{
  155|      2|    mp_size_t i;
  156|      2|    limb_t l, a;
  157|       |
  158|      2|    assert(shift >= 1 && shift < LIMB_BITS);
  ------------------
  |  Branch (158:5): [True: 0, False: 2]
  |  Branch (158:5): [True: 0, False: 0]
  |  Branch (158:5): [True: 2, False: 0]
  |  Branch (158:5): [True: 2, False: 0]
  ------------------
  159|      2|    l = high;
  160|      6|    for(i = n - 1; i >= 0; i--) {
  ------------------
  |  Branch (160:20): [True: 4, False: 2]
  ------------------
  161|      4|        a = tab[i];
  162|      4|        tab_r[i] = (a >> shift) | (l << (LIMB_BITS - shift));
  ------------------
  |  |   54|      4|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      4|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  163|      4|        l = a;
  164|      4|    }
  165|      2|    return l & (((limb_t)1 << shift) - 1);
  166|      2|}
dtoa.c:mp_add_ui:
   76|      2|{
   77|      2|    size_t i;
   78|      2|    limb_t k, a;
   79|       |
   80|      2|    k=b;
   81|      4|    for(i=0;i<n;i++) {
  ------------------
  |  Branch (81:13): [True: 4, False: 0]
  ------------------
   82|      4|        if (k == 0)
  ------------------
  |  Branch (82:13): [True: 2, False: 2]
  ------------------
   83|      2|            break;
   84|      2|        a = tab[i] + k;
   85|      2|        k = (a < k);
   86|      2|        tab[i] = a;
   87|      2|    }
   88|      2|    return k;
   89|      2|}
dtoa.c:dtoa_free:
 1103|     26|{
 1104|     26|}
dtoa.c:to_digit:
 1321|  3.14M|{
 1322|  3.14M|    if (c >= '0' && c <= '9')
  ------------------
  |  Branch (1322:9): [True: 3.14M, False: 24]
  |  Branch (1322:21): [True: 2.09M, False: 1.04M]
  ------------------
 1323|  2.09M|        return c - '0';
 1324|  1.04M|    else if (c >= 'A' && c <= 'Z')
  ------------------
  |  Branch (1324:14): [True: 1.04M, False: 24]
  |  Branch (1324:26): [True: 0, False: 1.04M]
  ------------------
 1325|      0|        return c - 'A' + 10;
 1326|  1.04M|    else if (c >= 'a' && c <= 'z')
  ------------------
  |  Branch (1326:14): [True: 1.04M, False: 24]
  |  Branch (1326:26): [True: 1.04M, False: 0]
  ------------------
 1327|  1.04M|        return c - 'a' + 10;
 1328|     24|    else
 1329|     24|        return 36;
 1330|  3.14M|}
dtoa.c:mpb_mul1_base:
 1334|     27|{
 1335|     27|    int i;
 1336|     27|    if (r->tab[0] == 0 && r->len == 1) {
  ------------------
  |  Branch (1336:9): [True: 21, False: 6]
  |  Branch (1336:27): [True: 20, False: 1]
  ------------------
 1337|     20|        r->tab[0] = a;
 1338|     20|    } else {
 1339|      7|        if (radix_base == 0) {
  ------------------
  |  Branch (1339:13): [True: 1, False: 6]
  ------------------
 1340|      3|            for(i = r->len; i >= 0; i--) {
  ------------------
  |  Branch (1340:29): [True: 2, False: 1]
  ------------------
 1341|      2|                r->tab[i + 1] = r->tab[i];
 1342|      2|            }
 1343|      1|            r->tab[0] = a;
 1344|      6|        } else {
 1345|      6|            r->tab[r->len] = mp_mul1(r->tab, r->tab, r->len,
 1346|      6|                                     radix_base, a);
 1347|      6|        }
 1348|      7|        r->len++;
 1349|      7|        mpb_renorm(r);
 1350|      7|    }
 1351|     27|}
dtoa.c:round_to_d:
  971|     17|{
  972|     17|    int e;
  973|     17|    uint64_t m;
  974|       |
  975|     17|    if (a->tab[0] == 0 && a->len == 1) {
  ------------------
  |  Branch (975:9): [True: 0, False: 17]
  |  Branch (975:27): [True: 0, False: 0]
  ------------------
  976|       |        /* zero result */
  977|      0|        m = 0;
  978|      0|        e = 0; /* don't care */
  979|     17|    } else {
  980|     17|        int prec, prec1, e_min;
  981|     17|        e = mpb_floor_log2(a) + 1 - e_offset;
  982|     17|        prec1 = 53;
  983|     17|        e_min = -1021;
  984|     17|        if (e < e_min) {
  ------------------
  |  Branch (984:13): [True: 0, False: 17]
  ------------------
  985|       |            /* subnormal result or zero */
  986|      0|            prec = prec1 - (e_min - e);
  987|     17|        } else {
  988|     17|            prec = prec1;
  989|     17|        }
  990|     17|        mpb_shr_round(a, e + e_offset - prec, rnd_mode);
  991|     17|        m = mpb_get_u64(a);
  992|     17|        m <<= (53 - prec);
  993|       |        /* mantissa overflow due to rounding */
  994|     17|        if (m >= (uint64_t)1 << 53) {
  ------------------
  |  Branch (994:13): [True: 0, False: 17]
  ------------------
  995|      0|            m >>= 1;
  996|      0|            e++;
  997|      0|        }
  998|     17|    }
  999|     17|    *pe = e;
 1000|     17|    return m;
 1001|     17|}

reset_nbinterrupts:
   27|     17|void reset_nbinterrupts() {
   28|     17|    nbinterrupts = 0;
   29|     17|}
test_one_input_init:
   31|     17|void test_one_input_init(JSRuntime *rt, JSContext *ctx) {
   32|       |    // 64 Mo
   33|     17|    JS_SetMemoryLimit(rt, 0x4000000);
   34|       |    // 64 Kb
   35|     17|    JS_SetMaxStackSize(rt, 0x10000);
   36|       |
   37|     17|    JS_SetModuleLoaderFunc(rt, NULL, js_module_loader, NULL);
   38|     17|    JS_SetInterruptHandler(JS_GetRuntime(ctx), interrupt_handler, NULL);
   39|     17|    js_std_add_helpers(ctx, 0, NULL);
   40|       |
   41|       |    // Load os and std
   42|     17|    js_std_init_handlers(rt);
   43|     17|    js_init_module_std(ctx, "std");
   44|     17|    js_init_module_os(ctx, "os");
   45|     17|    const char *str = "import * as std from 'std';\n"
   46|     17|                "import * as os from 'os';\n"
   47|     17|                "globalThis.std = std;\n"
   48|     17|                "globalThis.os = os;\n";
   49|     17|    JSValue std_val = JS_Eval(ctx, str, strlen(str), "<input>", JS_EVAL_TYPE_MODULE | JS_EVAL_FLAG_COMPILE_ONLY);
  ------------------
  |  |  333|     17|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
                  JSValue std_val = JS_Eval(ctx, str, strlen(str), "<input>", JS_EVAL_TYPE_MODULE | JS_EVAL_FLAG_COMPILE_ONLY);
  ------------------
  |  |  342|     17|#define JS_EVAL_FLAG_COMPILE_ONLY (1 << 5)
  ------------------
   50|     17|    if (!JS_IsException(std_val)) {
  ------------------
  |  Branch (50:9): [True: 17, False: 0]
  ------------------
   51|     17|        js_module_set_import_meta(ctx, std_val, 1, 1);
   52|     17|        std_val = JS_EvalFunction(ctx, std_val);
   53|     17|    } else {
   54|      0|        js_std_dump_error(ctx);
   55|      0|    }
   56|     17|    std_val = js_std_await(ctx, std_val);
   57|     17|    JS_FreeValue(ctx, std_val);
   58|     17|}
fuzz_common.c:interrupt_handler:
   22|    118|{
   23|    118|    nbinterrupts++;
   24|    118|    return (nbinterrupts > 100);
   25|    118|}

LLVMFuzzerTestOneInput:
   24|     17|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   25|     17|    if (size == 0)
  ------------------
  |  Branch (25:9): [True: 0, False: 17]
  ------------------
   26|      0|        return 0;
   27|       |
   28|     17|    JSRuntime *rt = JS_NewRuntime();
   29|     17|    JSContext *ctx = JS_NewContext(rt);
   30|     17|    test_one_input_init(rt, ctx);
   31|       |
   32|     17|    uint8_t *null_terminated_data = malloc(size + 1);
   33|     17|    memcpy(null_terminated_data, data, size);
   34|     17|    null_terminated_data[size] = 0;
   35|       |
   36|     17|    reset_nbinterrupts();
   37|       |    //the final 0 does not count (as in strlen)
   38|     17|    JSValue val = JS_Eval(ctx, (const char *)null_terminated_data, size, "<none>", JS_EVAL_TYPE_GLOBAL);
  ------------------
  |  |  332|     17|#define JS_EVAL_TYPE_GLOBAL   (0 << 0) /* global code (default) */
  ------------------
   39|     17|    free(null_terminated_data);
   40|       |    //TODO targets with JS_ParseJSON, JS_ReadObject
   41|     17|    if (!JS_IsException(val)) {
  ------------------
  |  Branch (41:9): [True: 2, False: 15]
  ------------------
   42|      2|        js_std_loop(ctx);
   43|      2|        JS_FreeValue(ctx, val);
   44|      2|    }
   45|     17|    js_std_free_handlers(rt);
   46|     17|    JS_FreeContext(ctx);
   47|     17|    JS_FreeRuntime(rt);
   48|     17|    return 0;
   49|     17|}

lre_parse_escape:
  736|  59.5k|{
  737|  59.5k|    const uint8_t *p;
  738|  59.5k|    uint32_t c;
  739|       |
  740|  59.5k|    p = *pp;
  741|  59.5k|    c = *p++;
  742|  59.5k|    switch(c) {
  743|  2.67k|    case 'b':
  ------------------
  |  Branch (743:5): [True: 2.67k, False: 56.8k]
  ------------------
  744|  2.67k|        c = '\b';
  745|  2.67k|        break;
  746|      0|    case 'f':
  ------------------
  |  Branch (746:5): [True: 0, False: 59.5k]
  ------------------
  747|      0|        c = '\f';
  748|      0|        break;
  749|     11|    case 'n':
  ------------------
  |  Branch (749:5): [True: 11, False: 59.5k]
  ------------------
  750|     11|        c = '\n';
  751|     11|        break;
  752|      0|    case 'r':
  ------------------
  |  Branch (752:5): [True: 0, False: 59.5k]
  ------------------
  753|      0|        c = '\r';
  754|      0|        break;
  755|      0|    case 't':
  ------------------
  |  Branch (755:5): [True: 0, False: 59.5k]
  ------------------
  756|      0|        c = '\t';
  757|      0|        break;
  758|    638|    case 'v':
  ------------------
  |  Branch (758:5): [True: 638, False: 58.9k]
  ------------------
  759|    638|        c = '\v';
  760|    638|        break;
  761|      0|    case 'x':
  ------------------
  |  Branch (761:5): [True: 0, False: 59.5k]
  ------------------
  762|      0|        {
  763|      0|            int h0, h1;
  764|       |
  765|      0|            h0 = from_hex(*p++);
  766|      0|            if (h0 < 0)
  ------------------
  |  Branch (766:17): [True: 0, False: 0]
  ------------------
  767|      0|                return -1;
  768|      0|            h1 = from_hex(*p++);
  769|      0|            if (h1 < 0)
  ------------------
  |  Branch (769:17): [True: 0, False: 0]
  ------------------
  770|      0|                return -1;
  771|      0|            c = (h0 << 4) | h1;
  772|      0|        }
  773|      0|        break;
  774|      1|    case 'u':
  ------------------
  |  Branch (774:5): [True: 1, False: 59.5k]
  ------------------
  775|      1|        {
  776|      1|            int h, i;
  777|      1|            uint32_t c1;
  778|       |
  779|      1|            if (*p == '{' && allow_utf16) {
  ------------------
  |  Branch (779:17): [True: 0, False: 1]
  |  Branch (779:30): [True: 0, False: 0]
  ------------------
  780|      0|                p++;
  781|      0|                c = 0;
  782|      0|                for(;;) {
  783|      0|                    h = from_hex(*p++);
  784|      0|                    if (h < 0)
  ------------------
  |  Branch (784:25): [True: 0, False: 0]
  ------------------
  785|      0|                        return -1;
  786|      0|                    c = (c << 4) | h;
  787|      0|                    if (c > 0x10FFFF)
  ------------------
  |  Branch (787:25): [True: 0, False: 0]
  ------------------
  788|      0|                        return -1;
  789|      0|                    if (*p == '}')
  ------------------
  |  Branch (789:25): [True: 0, False: 0]
  ------------------
  790|      0|                        break;
  791|      0|                }
  792|      0|                p++;
  793|      1|            } else {
  794|      1|                c = 0;
  795|      5|                for(i = 0; i < 4; i++) {
  ------------------
  |  Branch (795:28): [True: 4, False: 1]
  ------------------
  796|      4|                    h = from_hex(*p++);
  797|      4|                    if (h < 0) {
  ------------------
  |  Branch (797:25): [True: 0, False: 4]
  ------------------
  798|      0|                        return -1;
  799|      0|                    }
  800|      4|                    c = (c << 4) | h;
  801|      4|                }
  802|      1|                if (is_hi_surrogate(c) &&
  ------------------
  |  Branch (802:21): [True: 1, False: 0]
  ------------------
  803|      1|                    allow_utf16 == 2 && p[0] == '\\' && p[1] == 'u') {
  ------------------
  |  Branch (803:21): [True: 0, False: 1]
  |  Branch (803:41): [True: 0, False: 0]
  |  Branch (803:57): [True: 0, False: 0]
  ------------------
  804|       |                    /* convert an escaped surrogate pair into a
  805|       |                       unicode char */
  806|      0|                    c1 = 0;
  807|      0|                    for(i = 0; i < 4; i++) {
  ------------------
  |  Branch (807:32): [True: 0, False: 0]
  ------------------
  808|      0|                        h = from_hex(p[2 + i]);
  809|      0|                        if (h < 0)
  ------------------
  |  Branch (809:29): [True: 0, False: 0]
  ------------------
  810|      0|                            break;
  811|      0|                        c1 = (c1 << 4) | h;
  812|      0|                    }
  813|      0|                    if (i == 4 && is_lo_surrogate(c1)) {
  ------------------
  |  Branch (813:25): [True: 0, False: 0]
  |  Branch (813:35): [True: 0, False: 0]
  ------------------
  814|      0|                        p += 6;
  815|      0|                        c = from_surrogate(c, c1);
  816|      0|                    }
  817|      0|                }
  818|      1|            }
  819|      1|        }
  820|      1|        break;
  821|      1|    case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (821:5): [True: 0, False: 59.5k]
  |  Branch (821:15): [True: 0, False: 59.5k]
  |  Branch (821:25): [True: 0, False: 59.5k]
  |  Branch (821:35): [True: 0, False: 59.5k]
  ------------------
  822|      0|    case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (822:5): [True: 0, False: 59.5k]
  |  Branch (822:15): [True: 0, False: 59.5k]
  |  Branch (822:25): [True: 0, False: 59.5k]
  |  Branch (822:35): [True: 0, False: 59.5k]
  ------------------
  823|      0|        c -= '0';
  824|      0|        if (allow_utf16 == 2) {
  ------------------
  |  Branch (824:13): [True: 0, False: 0]
  ------------------
  825|       |            /* only accept \0 not followed by digit */
  826|      0|            if (c != 0 || is_digit(*p))
  ------------------
  |  Branch (826:17): [True: 0, False: 0]
  |  Branch (826:27): [True: 0, False: 0]
  ------------------
  827|      0|                return -1;
  828|      0|        } else {
  829|       |            /* parse a legacy octal sequence */
  830|      0|            uint32_t v;
  831|      0|            v = *p - '0';
  832|      0|            if (v > 7)
  ------------------
  |  Branch (832:17): [True: 0, False: 0]
  ------------------
  833|      0|                break;
  834|      0|            c = (c << 3) | v;
  835|      0|            p++;
  836|      0|            if (c >= 32)
  ------------------
  |  Branch (836:17): [True: 0, False: 0]
  ------------------
  837|      0|                break;
  838|      0|            v = *p - '0';
  839|      0|            if (v > 7)
  ------------------
  |  Branch (839:17): [True: 0, False: 0]
  ------------------
  840|      0|                break;
  841|      0|            c = (c << 3) | v;
  842|      0|            p++;
  843|      0|        }
  844|      0|        break;
  845|  56.2k|    default:
  ------------------
  |  Branch (845:5): [True: 56.2k, False: 3.32k]
  ------------------
  846|  56.2k|        return -2;
  847|  59.5k|    }
  848|  3.32k|    *pp = p;
  849|  3.32k|    return c;
  850|  59.5k|}
lre_compile:
 2525|      3|{
 2526|      3|    REParseState s_s, *s = &s_s;
 2527|      3|    int register_count;
 2528|      3|    BOOL is_sticky;
 2529|       |
 2530|      3|    memset(s, 0, sizeof(*s));
 2531|      3|    s->opaque = opaque;
 2532|      3|    s->buf_ptr = (const uint8_t *)buf;
 2533|      3|    s->buf_end = s->buf_ptr + buf_len;
 2534|      3|    s->buf_start = s->buf_ptr;
 2535|      3|    s->re_flags = re_flags;
 2536|      3|    s->is_unicode = ((re_flags & (LRE_FLAG_UNICODE | LRE_FLAG_UNICODE_SETS)) != 0);
  ------------------
  |  |   34|      3|#define LRE_FLAG_UNICODE    (1 << 4)
  ------------------
                  s->is_unicode = ((re_flags & (LRE_FLAG_UNICODE | LRE_FLAG_UNICODE_SETS)) != 0);
  ------------------
  |  |   38|      3|#define LRE_FLAG_UNICODE_SETS (1 << 8)
  ------------------
 2537|      3|    is_sticky = ((re_flags & LRE_FLAG_STICKY) != 0);
  ------------------
  |  |   35|      3|#define LRE_FLAG_STICKY     (1 << 5)
  ------------------
 2538|      3|    s->ignore_case = ((re_flags & LRE_FLAG_IGNORECASE) != 0);
  ------------------
  |  |   31|      3|#define LRE_FLAG_IGNORECASE (1 << 1)
  ------------------
 2539|      3|    s->multi_line = ((re_flags & LRE_FLAG_MULTILINE) != 0);
  ------------------
  |  |   32|      3|#define LRE_FLAG_MULTILINE  (1 << 2)
  ------------------
 2540|      3|    s->dotall = ((re_flags & LRE_FLAG_DOTALL) != 0);
  ------------------
  |  |   33|      3|#define LRE_FLAG_DOTALL     (1 << 3)
  ------------------
 2541|      3|    s->unicode_sets = ((re_flags & LRE_FLAG_UNICODE_SETS) != 0);
  ------------------
  |  |   38|      3|#define LRE_FLAG_UNICODE_SETS (1 << 8)
  ------------------
 2542|      3|    s->capture_count = 1;
 2543|      3|    s->total_capture_count = -1;
 2544|      3|    s->has_named_captures = -1;
 2545|       |
 2546|      3|    dbuf_init2(&s->byte_code, opaque, lre_bytecode_realloc);
 2547|      3|    dbuf_init2(&s->group_names, opaque, lre_realloc);
 2548|       |
 2549|      3|    dbuf_put_u16(&s->byte_code, re_flags); /* first element is the flags */
 2550|      3|    dbuf_putc(&s->byte_code, 0); /* second element is the number of captures */
 2551|      3|    dbuf_putc(&s->byte_code, 0); /* stack size */
 2552|      3|    dbuf_put_u32(&s->byte_code, 0); /* bytecode length */
 2553|       |
 2554|      3|    if (!is_sticky) {
  ------------------
  |  Branch (2554:9): [True: 1, False: 2]
  ------------------
 2555|       |        /* iterate thru all positions (about the same as .*?( ... ) )
 2556|       |           .  We do it without an explicit loop so that lock step
 2557|       |           thread execution will be possible in an optimized
 2558|       |           implementation */
 2559|      1|        re_emit_op_u32(s, REOP_split_goto_first, 1 + 5);
 2560|      1|        re_emit_op(s, REOP_any);
 2561|      1|        re_emit_op_u32(s, REOP_goto, -(5 + 1 + 5));
 2562|      1|    }
 2563|      3|    re_emit_op_u8(s, REOP_save_start, 0);
 2564|       |
 2565|      3|    if (re_parse_disjunction(s, FALSE)) {
  ------------------
  |  Branch (2565:9): [True: 0, False: 3]
  ------------------
 2566|      0|    error:
 2567|      0|        dbuf_free(&s->byte_code);
 2568|      0|        dbuf_free(&s->group_names);
 2569|      0|        pstrcpy(error_msg, error_msg_size, s->u.error_msg);
 2570|      0|        *plen = 0;
 2571|      0|        return NULL;
 2572|      0|    }
 2573|       |
 2574|      3|    re_emit_op_u8(s, REOP_save_end, 0);
 2575|       |
 2576|      3|    re_emit_op(s, REOP_match);
 2577|       |
 2578|      3|    if (*s->buf_ptr != '\0') {
  ------------------
  |  Branch (2578:9): [True: 0, False: 3]
  ------------------
 2579|      0|        re_parse_error(s, "extraneous characters at the end");
 2580|      0|        goto error;
 2581|      0|    }
 2582|       |
 2583|      3|    if (dbuf_error(&s->byte_code)) {
  ------------------
  |  Branch (2583:9): [True: 0, False: 3]
  ------------------
 2584|      0|        re_parse_out_of_memory(s);
 2585|      0|        goto error;
 2586|      0|    }
 2587|       |
 2588|      3|    register_count = compute_register_count(s->byte_code.buf, s->byte_code.size);
 2589|      3|    if (register_count < 0) {
  ------------------
  |  Branch (2589:9): [True: 0, False: 3]
  ------------------
 2590|      0|        re_parse_error(s, "too many imbricated quantifiers");
 2591|      0|        goto error;
 2592|      0|    }
 2593|       |
 2594|      3|    s->byte_code.buf[RE_HEADER_CAPTURE_COUNT] = s->capture_count;
  ------------------
  |  |  112|      3|#define RE_HEADER_CAPTURE_COUNT  2
  ------------------
 2595|      3|    s->byte_code.buf[RE_HEADER_REGISTER_COUNT] = register_count;
  ------------------
  |  |  113|      3|#define RE_HEADER_REGISTER_COUNT 3
  ------------------
 2596|      3|    put_u32(s->byte_code.buf + RE_HEADER_BYTECODE_LEN,
  ------------------
  |  |  114|      3|#define RE_HEADER_BYTECODE_LEN   4
  ------------------
 2597|      3|            s->byte_code.size - RE_HEADER_LEN);
  ------------------
  |  |  116|      3|#define RE_HEADER_LEN 8
  ------------------
 2598|       |
 2599|       |    /* add the named groups if needed */
 2600|      3|    if (s->group_names.size > (s->capture_count - 1) * LRE_GROUP_NAME_TRAILER_LEN) {
  ------------------
  |  |   44|      3|#define LRE_GROUP_NAME_TRAILER_LEN 2 
  ------------------
  |  Branch (2600:9): [True: 0, False: 3]
  ------------------
 2601|      0|        dbuf_put(&s->byte_code, s->group_names.buf, s->group_names.size);
 2602|      0|        put_u16(s->byte_code.buf + RE_HEADER_FLAGS,
  ------------------
  |  |  111|      0|#define RE_HEADER_FLAGS          0
  ------------------
 2603|      0|                lre_get_flags(s->byte_code.buf) | LRE_FLAG_NAMED_GROUPS);
  ------------------
  |  |   37|      0|#define LRE_FLAG_NAMED_GROUPS (1 << 7) /* named groups are present in the regexp */
  ------------------
 2604|      0|    }
 2605|      3|    dbuf_free(&s->group_names);
 2606|       |
 2607|       |#ifdef DUMP_REOP
 2608|       |    lre_dump_bytecode(s->byte_code.buf, s->byte_code.size);
 2609|       |#endif
 2610|       |
 2611|      3|    error_msg[0] = '\0';
 2612|      3|    *plen = s->byte_code.size;
 2613|      3|    return s->byte_code.buf;
 2614|      3|}
lre_exec:
 3329|  1.00M|{
 3330|  1.00M|    REExecContext s_s, *s = &s_s;
 3331|  1.00M|    int re_flags, i, ret;
 3332|  1.00M|    const uint8_t *cptr;
 3333|       |
 3334|  1.00M|    re_flags = lre_get_flags(bc_buf);
 3335|  1.00M|    s->is_unicode = (re_flags & (LRE_FLAG_UNICODE | LRE_FLAG_UNICODE_SETS)) != 0;
  ------------------
  |  |   34|  1.00M|#define LRE_FLAG_UNICODE    (1 << 4)
  ------------------
                  s->is_unicode = (re_flags & (LRE_FLAG_UNICODE | LRE_FLAG_UNICODE_SETS)) != 0;
  ------------------
  |  |   38|  1.00M|#define LRE_FLAG_UNICODE_SETS (1 << 8)
  ------------------
 3336|  1.00M|    s->capture_count = bc_buf[RE_HEADER_CAPTURE_COUNT];
  ------------------
  |  |  112|  1.00M|#define RE_HEADER_CAPTURE_COUNT  2
  ------------------
 3337|  1.00M|    s->cbuf = cbuf;
 3338|  1.00M|    s->cbuf_end = cbuf + (clen << cbuf_type);
 3339|  1.00M|    s->cbuf_type = cbuf_type;
 3340|  1.00M|    if (s->cbuf_type == 1 && s->is_unicode)
  ------------------
  |  Branch (3340:9): [True: 1.00M, False: 0]
  |  Branch (3340:30): [True: 1.00M, False: 0]
  ------------------
 3341|  1.00M|        s->cbuf_type = 2;
 3342|  1.00M|    s->interrupt_counter = INTERRUPT_COUNTER_INIT;
  ------------------
  |  |   63|  1.00M|#define INTERRUPT_COUNTER_INIT 10000
  ------------------
 3343|  1.00M|    s->opaque = opaque;
 3344|       |
 3345|  1.00M|    s->stack_buf = s->static_stack_buf;
 3346|  1.00M|    s->stack_size = countof(s->static_stack_buf);
  ------------------
  |  |   47|  1.00M|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 3347|       |
 3348|  3.02M|    for(i = 0; i < s->capture_count * 2; i++)
  ------------------
  |  Branch (3348:16): [True: 2.01M, False: 1.00M]
  ------------------
 3349|  2.01M|        capture[i] = NULL;
 3350|       |
 3351|  1.00M|    cptr = cbuf + (cindex << cbuf_type);
 3352|  1.00M|    if (0 < cindex && cindex < clen && s->cbuf_type == 2) {
  ------------------
  |  Branch (3352:9): [True: 1.00M, False: 2]
  |  Branch (3352:23): [True: 1.00M, False: 0]
  |  Branch (3352:40): [True: 1.00M, False: 0]
  ------------------
 3353|  1.00M|        const uint16_t *p = (const uint16_t *)cptr;
 3354|  1.00M|        if (is_lo_surrogate(*p) && is_hi_surrogate(p[-1])) {
  ------------------
  |  Branch (3354:13): [True: 0, False: 1.00M]
  |  Branch (3354:36): [True: 0, False: 0]
  ------------------
 3355|      0|            cptr = (const uint8_t *)(p - 1);
 3356|      0|        }
 3357|  1.00M|    }
 3358|       |
 3359|  1.00M|    ret = lre_exec_backtrack(s, capture, bc_buf + RE_HEADER_LEN, cptr);
  ------------------
  |  |  116|  1.00M|#define RE_HEADER_LEN 8
  ------------------
 3360|       |
 3361|  1.00M|    if (s->stack_buf != s->static_stack_buf)
  ------------------
  |  Branch (3361:9): [True: 0, False: 1.00M]
  ------------------
 3362|      0|        lre_realloc(s->opaque, s->stack_buf, 0);
 3363|  1.00M|    return ret;
 3364|  1.00M|}
lre_get_alloc_count:
 3367|  1.00M|{
 3368|  1.00M|    return bc_buf[RE_HEADER_CAPTURE_COUNT] * 2 +
  ------------------
  |  |  112|  1.00M|#define RE_HEADER_CAPTURE_COUNT  2
  ------------------
 3369|  1.00M|        bc_buf[RE_HEADER_REGISTER_COUNT];
  ------------------
  |  |  113|  1.00M|#define RE_HEADER_REGISTER_COUNT 3
  ------------------
 3370|  1.00M|}
lre_get_capture_count:
 3373|  1.00M|{
 3374|  1.00M|    return bc_buf[RE_HEADER_CAPTURE_COUNT];
  ------------------
  |  |  112|  1.00M|#define RE_HEADER_CAPTURE_COUNT  2
  ------------------
 3375|  1.00M|}
lre_get_flags:
 3378|  2.01M|{
 3379|  2.01M|    return get_u16(bc_buf + RE_HEADER_FLAGS);
  ------------------
  |  |  111|  2.01M|#define RE_HEADER_FLAGS          0
  ------------------
 3380|  2.01M|}
lre_get_groupnames:
 3385|      4|{
 3386|      4|    uint32_t re_bytecode_len;
 3387|      4|    if ((lre_get_flags(bc_buf) & LRE_FLAG_NAMED_GROUPS) == 0)
  ------------------
  |  |   37|      4|#define LRE_FLAG_NAMED_GROUPS (1 << 7) /* named groups are present in the regexp */
  ------------------
  |  Branch (3387:9): [True: 4, False: 0]
  ------------------
 3388|      4|        return NULL;
 3389|      0|    re_bytecode_len = get_u32(bc_buf + RE_HEADER_BYTECODE_LEN);
  ------------------
  |  |  114|      0|#define RE_HEADER_BYTECODE_LEN   4
  ------------------
 3390|      0|    return (const char *)(bc_buf + RE_HEADER_LEN + re_bytecode_len);
  ------------------
  |  |  116|      0|#define RE_HEADER_LEN 8
  ------------------
 3391|      4|}
libregexp.c:lre_bytecode_realloc:
 2508|     20|{
 2509|     20|    if (size > (INT32_MAX / 2)) {
  ------------------
  |  Branch (2509:9): [True: 0, False: 20]
  ------------------
 2510|       |        /* the bytecode cannot be larger than 2G. Leave some slack to 
 2511|       |           avoid some overflows. */
 2512|      0|        return NULL;
 2513|     20|    } else {
 2514|     20|        return lre_realloc(opaque, ptr, size);
 2515|     20|    }
 2516|     20|}
libregexp.c:re_emit_op_u32:
  623|      2|{
  624|      2|    int pos;
  625|      2|    dbuf_putc(&s->byte_code, op);
  626|      2|    pos = s->byte_code.size;
  627|      2|    dbuf_put_u32(&s->byte_code, val);
  628|      2|    return pos;
  629|      2|}
libregexp.c:re_emit_op:
  617|      7|{
  618|      7|    dbuf_putc(&s->byte_code, op);
  619|      7|}
libregexp.c:re_emit_op_u8:
  662|      6|{
  663|      6|    dbuf_putc(&s->byte_code, op);
  664|      6|    dbuf_putc(&s->byte_code, val);
  665|      6|}
libregexp.c:re_parse_disjunction:
 2407|      3|{
 2408|      3|    int start, len, pos;
 2409|       |
 2410|      3|    if (lre_check_stack_overflow(s->opaque, 0))
  ------------------
  |  Branch (2410:9): [True: 0, False: 3]
  ------------------
 2411|      0|        return re_parse_error(s, "stack overflow");
 2412|       |
 2413|      3|    start = s->byte_code.size;
 2414|      3|    if (re_parse_alternative(s, is_backward_dir))
  ------------------
  |  Branch (2414:9): [True: 0, False: 3]
  ------------------
 2415|      0|        return -1;
 2416|      3|    while (*s->buf_ptr == '|') {
  ------------------
  |  Branch (2416:12): [True: 0, False: 3]
  ------------------
 2417|      0|        s->buf_ptr++;
 2418|       |
 2419|      0|        len = s->byte_code.size - start;
 2420|       |
 2421|       |        /* insert a split before the first alternative */
 2422|      0|        if (dbuf_insert(&s->byte_code, start, 5)) {
  ------------------
  |  Branch (2422:13): [True: 0, False: 0]
  ------------------
 2423|      0|            return re_parse_out_of_memory(s);
 2424|      0|        }
 2425|      0|        s->byte_code.buf[start] = REOP_split_next_first;
 2426|      0|        put_u32(s->byte_code.buf + start + 1, len + 5);
 2427|       |
 2428|      0|        pos = re_emit_op_u32(s, REOP_goto, 0);
 2429|       |
 2430|      0|        s->group_name_scope++;
 2431|       |        
 2432|      0|        if (re_parse_alternative(s, is_backward_dir))
  ------------------
  |  Branch (2432:13): [True: 0, False: 0]
  ------------------
 2433|      0|            return -1;
 2434|       |
 2435|       |        /* patch the goto */
 2436|      0|        len = s->byte_code.size - (pos + 4);
 2437|      0|        put_u32(s->byte_code.buf + pos, len);
 2438|      0|    }
 2439|      3|    return 0;
 2440|      3|}
libregexp.c:re_parse_alternative:
 2373|      3|{
 2374|      3|    const uint8_t *p;
 2375|      3|    int ret;
 2376|      3|    size_t start, term_start, end, term_size;
 2377|       |
 2378|      3|    start = s->byte_code.size;
 2379|      9|    for(;;) {
 2380|      9|        p = s->buf_ptr;
 2381|      9|        if (p >= s->buf_end)
  ------------------
  |  Branch (2381:13): [True: 3, False: 6]
  ------------------
 2382|      3|            break;
 2383|      6|        if (*p == '|' || *p == ')')
  ------------------
  |  Branch (2383:13): [True: 0, False: 6]
  |  Branch (2383:26): [True: 0, False: 6]
  ------------------
 2384|      0|            break;
 2385|      6|        term_start = s->byte_code.size;
 2386|      6|        ret = re_parse_term(s, is_backward_dir);
 2387|      6|        if (ret)
  ------------------
  |  Branch (2387:13): [True: 0, False: 6]
  ------------------
 2388|      0|            return ret;
 2389|      6|        if (is_backward_dir) {
  ------------------
  |  Branch (2389:13): [True: 0, False: 6]
  ------------------
 2390|       |            /* reverse the order of the terms (XXX: inefficient, but
 2391|       |               speed is not really critical here) */
 2392|      0|            end = s->byte_code.size;
 2393|      0|            term_size = end - term_start;
 2394|      0|            if (dbuf_claim(&s->byte_code, term_size))
  ------------------
  |  Branch (2394:17): [True: 0, False: 0]
  ------------------
 2395|      0|                return -1;
 2396|      0|            memmove(s->byte_code.buf + start + term_size,
 2397|      0|                    s->byte_code.buf + start,
 2398|      0|                    end - start);
 2399|      0|            memcpy(s->byte_code.buf + start, s->byte_code.buf + end,
 2400|      0|                   term_size);
 2401|      0|        }
 2402|      6|    }
 2403|      3|    return 0;
 2404|      3|}
libregexp.c:re_parse_term:
 1846|      6|{
 1847|      6|    const uint8_t *p;
 1848|      6|    int c, last_atom_start, quant_min, quant_max, last_capture_count;
 1849|      6|    BOOL greedy, is_neg, is_backward_lookahead;
 1850|      6|    REStringList cr_s, *cr = &cr_s;
 1851|       |
 1852|      6|    last_atom_start = -1;
 1853|      6|    last_capture_count = 0;
 1854|      6|    p = s->buf_ptr;
 1855|      6|    c = *p;
 1856|      6|    switch(c) {
 1857|      0|    case '^':
  ------------------
  |  Branch (1857:5): [True: 0, False: 6]
  ------------------
 1858|      0|        p++;
 1859|      0|        re_emit_op(s, s->multi_line ? REOP_line_start_m : REOP_line_start);
  ------------------
  |  Branch (1859:23): [True: 0, False: 0]
  ------------------
 1860|      0|        break;
 1861|      0|    case '$':
  ------------------
  |  Branch (1861:5): [True: 0, False: 6]
  ------------------
 1862|      0|        p++;
 1863|      0|        re_emit_op(s, s->multi_line ? REOP_line_end_m : REOP_line_end);
  ------------------
  |  Branch (1863:23): [True: 0, False: 0]
  ------------------
 1864|      0|        break;
 1865|      3|    case '.':
  ------------------
  |  Branch (1865:5): [True: 3, False: 3]
  ------------------
 1866|      3|        p++;
 1867|      3|        last_atom_start = s->byte_code.size;
 1868|      3|        last_capture_count = s->capture_count;
 1869|      3|        if (is_backward_dir)
  ------------------
  |  Branch (1869:13): [True: 0, False: 3]
  ------------------
 1870|      0|            re_emit_op(s, REOP_prev);
 1871|      3|        re_emit_op(s, s->dotall ? REOP_any : REOP_dot);
  ------------------
  |  Branch (1871:23): [True: 0, False: 3]
  ------------------
 1872|      3|        if (is_backward_dir)
  ------------------
  |  Branch (1872:13): [True: 0, False: 3]
  ------------------
 1873|      0|            re_emit_op(s, REOP_prev);
 1874|      3|        break;
 1875|      0|    case '{':
  ------------------
  |  Branch (1875:5): [True: 0, False: 6]
  ------------------
 1876|      0|        if (s->is_unicode) {
  ------------------
  |  Branch (1876:13): [True: 0, False: 0]
  ------------------
 1877|      0|            return re_parse_error(s, "syntax error");
 1878|      0|        } else if (!is_digit(p[1])) {
  ------------------
  |  Branch (1878:20): [True: 0, False: 0]
  ------------------
 1879|       |            /* Annex B: we accept '{' not followed by digits as a
 1880|       |               normal atom */
 1881|      0|            goto parse_class_atom;
 1882|      0|        } else {
 1883|      0|            const uint8_t *p1 = p + 1;
 1884|       |            /* Annex B: error if it is like a repetition count */
 1885|      0|            parse_digits(&p1, TRUE);
 1886|      0|            if (*p1 == ',') {
  ------------------
  |  Branch (1886:17): [True: 0, False: 0]
  ------------------
 1887|      0|                p1++;
 1888|      0|                if (is_digit(*p1)) {
  ------------------
  |  Branch (1888:21): [True: 0, False: 0]
  ------------------
 1889|      0|                    parse_digits(&p1, TRUE);
 1890|      0|                }
 1891|      0|            }
 1892|      0|            if (*p1 != '}') {
  ------------------
  |  Branch (1892:17): [True: 0, False: 0]
  ------------------
 1893|      0|                goto parse_class_atom;
 1894|      0|            }
 1895|      0|        }
 1896|       |        /* fall thru */
 1897|      0|    case '*':
  ------------------
  |  Branch (1897:5): [True: 0, False: 6]
  ------------------
 1898|      0|    case '+':
  ------------------
  |  Branch (1898:5): [True: 0, False: 6]
  ------------------
 1899|      0|    case '?':
  ------------------
  |  Branch (1899:5): [True: 0, False: 6]
  ------------------
 1900|      0|        return re_parse_error(s, "nothing to repeat");
 1901|      0|    case '(':
  ------------------
  |  Branch (1901:5): [True: 0, False: 6]
  ------------------
 1902|      0|        if (p[1] == '?') {
  ------------------
  |  Branch (1902:13): [True: 0, False: 0]
  ------------------
 1903|      0|            if (p[2] == ':') {
  ------------------
  |  Branch (1903:17): [True: 0, False: 0]
  ------------------
 1904|      0|                p += 3;
 1905|      0|                last_atom_start = s->byte_code.size;
 1906|      0|                last_capture_count = s->capture_count;
 1907|      0|                s->buf_ptr = p;
 1908|      0|                if (re_parse_disjunction(s, is_backward_dir))
  ------------------
  |  Branch (1908:21): [True: 0, False: 0]
  ------------------
 1909|      0|                    return -1;
 1910|      0|                p = s->buf_ptr;
 1911|      0|                if (re_parse_expect(s, &p, ')'))
  ------------------
  |  Branch (1911:21): [True: 0, False: 0]
  ------------------
 1912|      0|                    return -1;
 1913|      0|            } else if (p[2] == 'i' || p[2] == 'm' || p[2] == 's' || p[2] == '-') {
  ------------------
  |  Branch (1913:24): [True: 0, False: 0]
  |  Branch (1913:39): [True: 0, False: 0]
  |  Branch (1913:54): [True: 0, False: 0]
  |  Branch (1913:69): [True: 0, False: 0]
  ------------------
 1914|      0|                BOOL saved_ignore_case, saved_multi_line, saved_dotall;
 1915|      0|                int add_mask, remove_mask;
 1916|      0|                p += 2;
 1917|      0|                remove_mask = 0;
 1918|      0|                add_mask = re_parse_modifiers(s, &p);
 1919|      0|                if (add_mask < 0)
  ------------------
  |  Branch (1919:21): [True: 0, False: 0]
  ------------------
 1920|      0|                    return -1;
 1921|      0|                if (*p == '-') {
  ------------------
  |  Branch (1921:21): [True: 0, False: 0]
  ------------------
 1922|      0|                    p++;
 1923|      0|                    remove_mask = re_parse_modifiers(s, &p);
 1924|      0|                    if (remove_mask < 0)
  ------------------
  |  Branch (1924:25): [True: 0, False: 0]
  ------------------
 1925|      0|                        return -1;
 1926|      0|                }
 1927|      0|                if ((add_mask == 0 && remove_mask == 0) ||
  ------------------
  |  Branch (1927:22): [True: 0, False: 0]
  |  Branch (1927:39): [True: 0, False: 0]
  ------------------
 1928|      0|                    (add_mask & remove_mask) != 0) {
  ------------------
  |  Branch (1928:21): [True: 0, False: 0]
  ------------------
 1929|      0|                    return re_parse_error(s, "invalid modifiers");
 1930|      0|                }
 1931|      0|                if (re_parse_expect(s, &p, ':'))
  ------------------
  |  Branch (1931:21): [True: 0, False: 0]
  ------------------
 1932|      0|                    return -1;
 1933|      0|                saved_ignore_case = s->ignore_case;
 1934|      0|                saved_multi_line = s->multi_line;
 1935|      0|                saved_dotall = s->dotall;
 1936|      0|                s->ignore_case = update_modifier(s->ignore_case, add_mask, remove_mask, LRE_FLAG_IGNORECASE);
  ------------------
  |  |   31|      0|#define LRE_FLAG_IGNORECASE (1 << 1)
  ------------------
 1937|      0|                s->multi_line = update_modifier(s->multi_line, add_mask, remove_mask, LRE_FLAG_MULTILINE);
  ------------------
  |  |   32|      0|#define LRE_FLAG_MULTILINE  (1 << 2)
  ------------------
 1938|      0|                s->dotall = update_modifier(s->dotall, add_mask, remove_mask, LRE_FLAG_DOTALL);
  ------------------
  |  |   33|      0|#define LRE_FLAG_DOTALL     (1 << 3)
  ------------------
 1939|       |
 1940|      0|                last_atom_start = s->byte_code.size;
 1941|      0|                last_capture_count = s->capture_count;
 1942|      0|                s->buf_ptr = p;
 1943|      0|                if (re_parse_disjunction(s, is_backward_dir))
  ------------------
  |  Branch (1943:21): [True: 0, False: 0]
  ------------------
 1944|      0|                    return -1;
 1945|      0|                p = s->buf_ptr;
 1946|      0|                if (re_parse_expect(s, &p, ')'))
  ------------------
  |  Branch (1946:21): [True: 0, False: 0]
  ------------------
 1947|      0|                    return -1;
 1948|      0|                s->ignore_case = saved_ignore_case;
 1949|      0|                s->multi_line = saved_multi_line;
 1950|      0|                s->dotall = saved_dotall;
 1951|      0|            } else if ((p[2] == '=' || p[2] == '!')) {
  ------------------
  |  Branch (1951:25): [True: 0, False: 0]
  |  Branch (1951:40): [True: 0, False: 0]
  ------------------
 1952|      0|                is_neg = (p[2] == '!');
 1953|      0|                is_backward_lookahead = FALSE;
 1954|      0|                p += 3;
 1955|      0|                goto lookahead;
 1956|      0|            } else if (p[2] == '<' &&
  ------------------
  |  Branch (1956:24): [True: 0, False: 0]
  ------------------
 1957|      0|                       (p[3] == '=' || p[3] == '!')) {
  ------------------
  |  Branch (1957:25): [True: 0, False: 0]
  |  Branch (1957:40): [True: 0, False: 0]
  ------------------
 1958|      0|                int pos;
 1959|      0|                is_neg = (p[3] == '!');
 1960|      0|                is_backward_lookahead = TRUE;
 1961|      0|                p += 4;
 1962|       |                /* lookahead */
 1963|      0|            lookahead:
 1964|       |                /* Annex B allows lookahead to be used as an atom for
 1965|       |                   the quantifiers */
 1966|      0|                if (!s->is_unicode && !is_backward_lookahead)  {
  ------------------
  |  Branch (1966:21): [True: 0, False: 0]
  |  Branch (1966:39): [True: 0, False: 0]
  ------------------
 1967|      0|                    last_atom_start = s->byte_code.size;
 1968|      0|                    last_capture_count = s->capture_count;
 1969|      0|                }
 1970|      0|                pos = re_emit_op_u32(s, REOP_lookahead + is_neg, 0);
 1971|      0|                s->buf_ptr = p;
 1972|      0|                if (re_parse_disjunction(s, is_backward_lookahead))
  ------------------
  |  Branch (1972:21): [True: 0, False: 0]
  ------------------
 1973|      0|                    return -1;
 1974|      0|                p = s->buf_ptr;
 1975|      0|                if (re_parse_expect(s, &p, ')'))
  ------------------
  |  Branch (1975:21): [True: 0, False: 0]
  ------------------
 1976|      0|                    return -1;
 1977|      0|                re_emit_op(s, REOP_lookahead_match + is_neg);
 1978|       |                /* jump after the 'match' after the lookahead is successful */
 1979|      0|                if (dbuf_error(&s->byte_code))
  ------------------
  |  Branch (1979:21): [True: 0, False: 0]
  ------------------
 1980|      0|                    return -1;
 1981|      0|                put_u32(s->byte_code.buf + pos, s->byte_code.size - (pos + 4));
 1982|      0|            } else if (p[2] == '<') {
  ------------------
  |  Branch (1982:24): [True: 0, False: 0]
  ------------------
 1983|      0|                p += 3;
 1984|      0|                if (re_parse_group_name(s->u.tmp_buf, sizeof(s->u.tmp_buf),
  ------------------
  |  Branch (1984:21): [True: 0, False: 0]
  ------------------
 1985|      0|                                        &p)) {
 1986|      0|                    return re_parse_error(s, "invalid group name");
 1987|      0|                }
 1988|       |                /* poor's man method to test duplicate group
 1989|       |                   names. */
 1990|       |                /* XXX: this method does not catch all the errors*/
 1991|      0|                if (is_duplicate_group_name(s, s->u.tmp_buf, s->group_name_scope)) {
  ------------------
  |  Branch (1991:21): [True: 0, False: 0]
  ------------------
 1992|      0|                    return re_parse_error(s, "duplicate group name");
 1993|      0|                }
 1994|       |                /* group name with a trailing zero */
 1995|      0|                dbuf_put(&s->group_names, (uint8_t *)s->u.tmp_buf,
 1996|      0|                         strlen(s->u.tmp_buf) + 1);
 1997|      0|                dbuf_putc(&s->group_names, s->group_name_scope);
 1998|      0|                s->has_named_captures = 1;
 1999|      0|                goto parse_capture;
 2000|      0|            } else {
 2001|      0|                return re_parse_error(s, "invalid group");
 2002|      0|            }
 2003|      0|        } else {
 2004|      0|            int capture_index;
 2005|      0|            p++;
 2006|       |            /* capture without group name */
 2007|      0|            dbuf_putc(&s->group_names, 0);
 2008|      0|            dbuf_putc(&s->group_names, 0);
 2009|      0|        parse_capture:
 2010|      0|            if (s->capture_count >= CAPTURE_COUNT_MAX)
  ------------------
  |  |   59|      0|#define CAPTURE_COUNT_MAX 255
  ------------------
  |  Branch (2010:17): [True: 0, False: 0]
  ------------------
 2011|      0|                return re_parse_error(s, "too many captures");
 2012|      0|            last_atom_start = s->byte_code.size;
 2013|      0|            last_capture_count = s->capture_count;
 2014|      0|            capture_index = s->capture_count++;
 2015|      0|            re_emit_op_u8(s, REOP_save_start + is_backward_dir,
 2016|      0|                          capture_index);
 2017|       |
 2018|      0|            s->buf_ptr = p;
 2019|      0|            if (re_parse_disjunction(s, is_backward_dir))
  ------------------
  |  Branch (2019:17): [True: 0, False: 0]
  ------------------
 2020|      0|                return -1;
 2021|      0|            p = s->buf_ptr;
 2022|       |
 2023|      0|            re_emit_op_u8(s, REOP_save_start + 1 - is_backward_dir,
 2024|      0|                          capture_index);
 2025|       |
 2026|      0|            if (re_parse_expect(s, &p, ')'))
  ------------------
  |  Branch (2026:17): [True: 0, False: 0]
  ------------------
 2027|      0|                return -1;
 2028|      0|        }
 2029|      0|        break;
 2030|      0|    case '\\':
  ------------------
  |  Branch (2030:5): [True: 0, False: 6]
  ------------------
 2031|      0|        switch(p[1]) {
 2032|      0|        case 'b':
  ------------------
  |  Branch (2032:9): [True: 0, False: 0]
  ------------------
 2033|      0|        case 'B':
  ------------------
  |  Branch (2033:9): [True: 0, False: 0]
  ------------------
 2034|      0|            if (p[1] != 'b') {
  ------------------
  |  Branch (2034:17): [True: 0, False: 0]
  ------------------
 2035|      0|                re_emit_op(s, s->ignore_case && s->is_unicode ? REOP_not_word_boundary_i : REOP_not_word_boundary);
  ------------------
  |  Branch (2035:31): [True: 0, False: 0]
  |  Branch (2035:49): [True: 0, False: 0]
  ------------------
 2036|      0|            } else {
 2037|      0|                re_emit_op(s, s->ignore_case && s->is_unicode ? REOP_word_boundary_i : REOP_word_boundary);
  ------------------
  |  Branch (2037:31): [True: 0, False: 0]
  |  Branch (2037:49): [True: 0, False: 0]
  ------------------
 2038|      0|            }
 2039|      0|            p += 2;
 2040|      0|            break;
 2041|      0|        case 'k':
  ------------------
  |  Branch (2041:9): [True: 0, False: 0]
  ------------------
 2042|      0|            {
 2043|      0|                const uint8_t *p1;
 2044|      0|                int dummy_res, n;
 2045|      0|                BOOL is_forward;
 2046|       |                
 2047|      0|                p1 = p;
 2048|      0|                if (p1[2] != '<') {
  ------------------
  |  Branch (2048:21): [True: 0, False: 0]
  ------------------
 2049|       |                    /* annex B: we tolerate invalid group names in non
 2050|       |                       unicode mode if there is no named capture
 2051|       |                       definition */
 2052|      0|                    if (s->is_unicode || re_has_named_captures(s))
  ------------------
  |  Branch (2052:25): [True: 0, False: 0]
  |  Branch (2052:42): [True: 0, False: 0]
  ------------------
 2053|      0|                        return re_parse_error(s, "expecting group name");
 2054|      0|                    else
 2055|      0|                        goto parse_class_atom;
 2056|      0|                }
 2057|      0|                p1 += 3;
 2058|      0|                if (re_parse_group_name(s->u.tmp_buf, sizeof(s->u.tmp_buf),
  ------------------
  |  Branch (2058:21): [True: 0, False: 0]
  ------------------
 2059|      0|                                        &p1)) {
 2060|      0|                    if (s->is_unicode || re_has_named_captures(s))
  ------------------
  |  Branch (2060:25): [True: 0, False: 0]
  |  Branch (2060:42): [True: 0, False: 0]
  ------------------
 2061|      0|                        return re_parse_error(s, "invalid group name");
 2062|      0|                    else
 2063|      0|                        goto parse_class_atom;
 2064|      0|                }
 2065|      0|                is_forward = FALSE;
 2066|      0|                n = find_group_name(s, s->u.tmp_buf, FALSE);
 2067|      0|                if (n == 0) {
  ------------------
  |  Branch (2067:21): [True: 0, False: 0]
  ------------------
 2068|       |                    /* no capture name parsed before, try to look
 2069|       |                       after (inefficient, but hopefully not common */
 2070|      0|                    n = re_parse_captures(s, &dummy_res, s->u.tmp_buf, FALSE);
 2071|      0|                    if (n == 0) {
  ------------------
  |  Branch (2071:25): [True: 0, False: 0]
  ------------------
 2072|      0|                        if (s->is_unicode || re_has_named_captures(s))
  ------------------
  |  Branch (2072:29): [True: 0, False: 0]
  |  Branch (2072:46): [True: 0, False: 0]
  ------------------
 2073|      0|                            return re_parse_error(s, "group name not defined");
 2074|      0|                        else
 2075|      0|                            goto parse_class_atom;
 2076|      0|                    }
 2077|      0|                    is_forward = TRUE;
 2078|      0|                }
 2079|      0|                last_atom_start = s->byte_code.size;
 2080|      0|                last_capture_count = s->capture_count;
 2081|       |                
 2082|       |                /* emit back references to all the captures indexes matching the group name */
 2083|      0|                re_emit_op_u8(s, REOP_back_reference + 2 * is_backward_dir + s->ignore_case, n);
 2084|      0|                if (is_forward) {
  ------------------
  |  Branch (2084:21): [True: 0, False: 0]
  ------------------
 2085|      0|                    re_parse_captures(s, &dummy_res, s->u.tmp_buf, TRUE);
 2086|      0|                } else {
 2087|      0|                    find_group_name(s, s->u.tmp_buf, TRUE);
 2088|      0|                }
 2089|      0|                p = p1;
 2090|      0|            }
 2091|      0|            break;
 2092|      0|        case '0':
  ------------------
  |  Branch (2092:9): [True: 0, False: 0]
  ------------------
 2093|      0|            p += 2;
 2094|      0|            c = 0;
 2095|      0|            if (s->is_unicode) {
  ------------------
  |  Branch (2095:17): [True: 0, False: 0]
  ------------------
 2096|      0|                if (is_digit(*p)) {
  ------------------
  |  Branch (2096:21): [True: 0, False: 0]
  ------------------
 2097|      0|                    return re_parse_error(s, "invalid decimal escape in regular expression");
 2098|      0|                }
 2099|      0|            } else {
 2100|       |                /* Annex B.1.4: accept legacy octal */
 2101|      0|                if (*p >= '0' && *p <= '7') {
  ------------------
  |  Branch (2101:21): [True: 0, False: 0]
  |  Branch (2101:34): [True: 0, False: 0]
  ------------------
 2102|      0|                    c = *p++ - '0';
 2103|      0|                    if (*p >= '0' && *p <= '7') {
  ------------------
  |  Branch (2103:25): [True: 0, False: 0]
  |  Branch (2103:38): [True: 0, False: 0]
  ------------------
 2104|      0|                        c = (c << 3) + *p++ - '0';
 2105|      0|                    }
 2106|      0|                }
 2107|      0|            }
 2108|      0|            goto normal_char;
 2109|      0|        case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (2109:9): [True: 0, False: 0]
  |  Branch (2109:19): [True: 0, False: 0]
  |  Branch (2109:29): [True: 0, False: 0]
  |  Branch (2109:39): [True: 0, False: 0]
  ------------------
 2110|      0|        case '5': case '6': case '7': case '8':
  ------------------
  |  Branch (2110:9): [True: 0, False: 0]
  |  Branch (2110:19): [True: 0, False: 0]
  |  Branch (2110:29): [True: 0, False: 0]
  |  Branch (2110:39): [True: 0, False: 0]
  ------------------
 2111|      0|        case '9':
  ------------------
  |  Branch (2111:9): [True: 0, False: 0]
  ------------------
 2112|      0|            {
 2113|      0|                const uint8_t *q = ++p;
 2114|       |
 2115|      0|                c = parse_digits(&p, FALSE);
 2116|      0|                if (c < 0 || (c >= s->capture_count && c >= re_count_captures(s))) {
  ------------------
  |  Branch (2116:21): [True: 0, False: 0]
  |  Branch (2116:31): [True: 0, False: 0]
  |  Branch (2116:56): [True: 0, False: 0]
  ------------------
 2117|      0|                    if (!s->is_unicode) {
  ------------------
  |  Branch (2117:25): [True: 0, False: 0]
  ------------------
 2118|       |                        /* Annex B.1.4: accept legacy octal */
 2119|      0|                        p = q;
 2120|      0|                        if (*p <= '7') {
  ------------------
  |  Branch (2120:29): [True: 0, False: 0]
  ------------------
 2121|      0|                            c = 0;
 2122|      0|                            if (*p <= '3')
  ------------------
  |  Branch (2122:33): [True: 0, False: 0]
  ------------------
 2123|      0|                                c = *p++ - '0';
 2124|      0|                            if (*p >= '0' && *p <= '7') {
  ------------------
  |  Branch (2124:33): [True: 0, False: 0]
  |  Branch (2124:46): [True: 0, False: 0]
  ------------------
 2125|      0|                                c = (c << 3) + *p++ - '0';
 2126|      0|                                if (*p >= '0' && *p <= '7') {
  ------------------
  |  Branch (2126:37): [True: 0, False: 0]
  |  Branch (2126:50): [True: 0, False: 0]
  ------------------
 2127|      0|                                    c = (c << 3) + *p++ - '0';
 2128|      0|                                }
 2129|      0|                            }
 2130|      0|                        } else {
 2131|      0|                            c = *p++;
 2132|      0|                        }
 2133|      0|                        goto normal_char;
 2134|      0|                    }
 2135|      0|                    return re_parse_error(s, "back reference out of range in regular expression");
 2136|      0|                }
 2137|      0|                last_atom_start = s->byte_code.size;
 2138|      0|                last_capture_count = s->capture_count;
 2139|       |                
 2140|      0|                re_emit_op_u8(s, REOP_back_reference + 2 * is_backward_dir + s->ignore_case, 1);
 2141|      0|                dbuf_putc(&s->byte_code, c);
 2142|      0|            }
 2143|      0|            break;
 2144|      0|        default:
  ------------------
  |  Branch (2144:9): [True: 0, False: 0]
  ------------------
 2145|      0|            goto parse_class_atom;
 2146|      0|        }
 2147|      0|        break;
 2148|      0|    case '[':
  ------------------
  |  Branch (2148:5): [True: 0, False: 6]
  ------------------
 2149|      0|        last_atom_start = s->byte_code.size;
 2150|      0|        last_capture_count = s->capture_count;
 2151|      0|        if (is_backward_dir)
  ------------------
  |  Branch (2151:13): [True: 0, False: 0]
  ------------------
 2152|      0|            re_emit_op(s, REOP_prev);
 2153|      0|        if (re_parse_char_class(s, &p))
  ------------------
  |  Branch (2153:13): [True: 0, False: 0]
  ------------------
 2154|      0|            return -1;
 2155|      0|        if (is_backward_dir)
  ------------------
  |  Branch (2155:13): [True: 0, False: 0]
  ------------------
 2156|      0|            re_emit_op(s, REOP_prev);
 2157|      0|        break;
 2158|      0|    case ']':
  ------------------
  |  Branch (2158:5): [True: 0, False: 6]
  ------------------
 2159|      0|    case '}':
  ------------------
  |  Branch (2159:5): [True: 0, False: 6]
  ------------------
 2160|      0|        if (s->is_unicode)
  ------------------
  |  Branch (2160:13): [True: 0, False: 0]
  ------------------
 2161|      0|            return re_parse_error(s, "syntax error");
 2162|      0|        goto parse_class_atom;
 2163|      3|    default:
  ------------------
  |  Branch (2163:5): [True: 3, False: 3]
  ------------------
 2164|      3|    parse_class_atom:
 2165|      3|        c = get_class_atom(s, cr, &p, FALSE);
 2166|      3|        if ((int)c < 0)
  ------------------
  |  Branch (2166:13): [True: 0, False: 3]
  ------------------
 2167|      0|            return -1;
 2168|      3|    normal_char:
 2169|      3|        last_atom_start = s->byte_code.size;
 2170|      3|        last_capture_count = s->capture_count;
 2171|      3|        if (is_backward_dir)
  ------------------
  |  Branch (2171:13): [True: 0, False: 3]
  ------------------
 2172|      0|            re_emit_op(s, REOP_prev);
 2173|      3|        if (c >= CLASS_RANGE_BASE) {
  ------------------
  |  |  421|      3|#define CLASS_RANGE_BASE 0x40000000
  ------------------
  |  Branch (2173:13): [True: 0, False: 3]
  ------------------
 2174|      0|            int ret = 0;
 2175|       |            /* optimize the common 'space' tests */
 2176|      0|            if (c == (CLASS_RANGE_BASE + CHAR_RANGE_s)) {
  ------------------
  |  |  421|      0|#define CLASS_RANGE_BASE 0x40000000
  ------------------
  |  Branch (2176:17): [True: 0, False: 0]
  ------------------
 2177|      0|                re_emit_op(s, REOP_space);
 2178|      0|            } else if (c == (CLASS_RANGE_BASE + CHAR_RANGE_S)) {
  ------------------
  |  |  421|      0|#define CLASS_RANGE_BASE 0x40000000
  ------------------
  |  Branch (2178:24): [True: 0, False: 0]
  ------------------
 2179|      0|                re_emit_op(s, REOP_not_space);
 2180|      0|            } else {
 2181|      0|                ret = re_emit_string_list(s, cr);
 2182|      0|            }
 2183|      0|            re_string_list_free(cr);
 2184|      0|            if (ret)
  ------------------
  |  Branch (2184:17): [True: 0, False: 0]
  ------------------
 2185|      0|                return -1;
 2186|      3|        } else {
 2187|      3|            if (s->ignore_case)
  ------------------
  |  Branch (2187:17): [True: 0, False: 3]
  ------------------
 2188|      0|                c = lre_canonicalize(c, s->is_unicode);
 2189|      3|            re_emit_char(s, c);
 2190|      3|        }
 2191|      3|        if (is_backward_dir)
  ------------------
  |  Branch (2191:13): [True: 0, False: 3]
  ------------------
 2192|      0|            re_emit_op(s, REOP_prev);
 2193|      3|        break;
 2194|      6|    }
 2195|       |
 2196|       |    /* quantifier */
 2197|      6|    if (last_atom_start >= 0) {
  ------------------
  |  Branch (2197:9): [True: 6, False: 0]
  ------------------
 2198|      6|        c = *p;
 2199|      6|        switch(c) {
 2200|      0|        case '*':
  ------------------
  |  Branch (2200:9): [True: 0, False: 6]
  ------------------
 2201|      0|            p++;
 2202|      0|            quant_min = 0;
 2203|      0|            quant_max = INT32_MAX;
 2204|      0|            goto quantifier;
 2205|      0|        case '+':
  ------------------
  |  Branch (2205:9): [True: 0, False: 6]
  ------------------
 2206|      0|            p++;
 2207|      0|            quant_min = 1;
 2208|      0|            quant_max = INT32_MAX;
 2209|      0|            goto quantifier;
 2210|      0|        case '?':
  ------------------
  |  Branch (2210:9): [True: 0, False: 6]
  ------------------
 2211|      0|            p++;
 2212|      0|            quant_min = 0;
 2213|      0|            quant_max = 1;
 2214|      0|            goto quantifier;
 2215|      0|        case '{':
  ------------------
  |  Branch (2215:9): [True: 0, False: 6]
  ------------------
 2216|      0|            {
 2217|      0|                const uint8_t *p1 = p;
 2218|       |                /* As an extension (see ES6 annex B), we accept '{' not
 2219|       |                   followed by digits as a normal atom */
 2220|      0|                if (!is_digit(p[1])) {
  ------------------
  |  Branch (2220:21): [True: 0, False: 0]
  ------------------
 2221|      0|                    if (s->is_unicode)
  ------------------
  |  Branch (2221:25): [True: 0, False: 0]
  ------------------
 2222|      0|                        goto invalid_quant_count;
 2223|      0|                    break;
 2224|      0|                }
 2225|      0|                p++;
 2226|      0|                quant_min = parse_digits(&p, TRUE);
 2227|      0|                quant_max = quant_min;
 2228|      0|                if (*p == ',') {
  ------------------
  |  Branch (2228:21): [True: 0, False: 0]
  ------------------
 2229|      0|                    p++;
 2230|      0|                    if (is_digit(*p)) {
  ------------------
  |  Branch (2230:25): [True: 0, False: 0]
  ------------------
 2231|      0|                        quant_max = parse_digits(&p, TRUE);
 2232|      0|                        if (quant_max < quant_min) {
  ------------------
  |  Branch (2232:29): [True: 0, False: 0]
  ------------------
 2233|      0|                        invalid_quant_count:
 2234|      0|                            return re_parse_error(s, "invalid repetition count");
 2235|      0|                        }
 2236|      0|                    } else {
 2237|      0|                        quant_max = INT32_MAX; /* infinity */
 2238|      0|                    }
 2239|      0|                }
 2240|      0|                if (*p != '}' && !s->is_unicode) {
  ------------------
  |  Branch (2240:21): [True: 0, False: 0]
  |  Branch (2240:34): [True: 0, False: 0]
  ------------------
 2241|       |                    /* Annex B: normal atom if invalid '{' syntax */
 2242|      0|                    p = p1;
 2243|      0|                    break;
 2244|      0|                }
 2245|      0|                if (re_parse_expect(s, &p, '}'))
  ------------------
  |  Branch (2245:21): [True: 0, False: 0]
  ------------------
 2246|      0|                    return -1;
 2247|      0|            }
 2248|      0|        quantifier:
 2249|      0|            greedy = TRUE;
 2250|      0|            if (*p == '?') {
  ------------------
  |  Branch (2250:17): [True: 0, False: 0]
  ------------------
 2251|      0|                p++;
 2252|      0|                greedy = FALSE;
 2253|      0|            }
 2254|      0|            if (last_atom_start < 0) {
  ------------------
  |  Branch (2254:17): [True: 0, False: 0]
  ------------------
 2255|      0|                return re_parse_error(s, "nothing to repeat");
 2256|      0|            }
 2257|      0|            {
 2258|      0|                BOOL need_capture_init, add_zero_advance_check;
 2259|      0|                int len, pos;
 2260|       |                
 2261|       |                /* the spec tells that if there is no advance when
 2262|       |                   running the atom after the first quant_min times,
 2263|       |                   then there is no match. We remove this test when we
 2264|       |                   are sure the atom always advances the position. */
 2265|      0|                add_zero_advance_check =
 2266|      0|                    re_need_check_adv_and_capture_init(&need_capture_init,
 2267|      0|                                                       s->byte_code.buf + last_atom_start,
 2268|      0|                                                       s->byte_code.size - last_atom_start);
 2269|       |            
 2270|       |                /* general case: need to reset the capture at each
 2271|       |                   iteration. We don't do it if there are no captures
 2272|       |                   in the atom or if we are sure all captures are
 2273|       |                   initialized in the atom. If quant_min = 0, we still
 2274|       |                   need to reset once the captures in case the atom
 2275|       |                   does not match. */
 2276|      0|                if (need_capture_init && last_capture_count != s->capture_count) {
  ------------------
  |  Branch (2276:21): [True: 0, False: 0]
  |  Branch (2276:42): [True: 0, False: 0]
  ------------------
 2277|      0|                    if (dbuf_insert(&s->byte_code, last_atom_start, 3))
  ------------------
  |  Branch (2277:25): [True: 0, False: 0]
  ------------------
 2278|      0|                        goto out_of_memory;
 2279|      0|                    int pos = last_atom_start;
 2280|      0|                    s->byte_code.buf[pos++] = REOP_save_reset;
 2281|      0|                    s->byte_code.buf[pos++] = last_capture_count;
 2282|      0|                    s->byte_code.buf[pos++] = s->capture_count - 1;
 2283|      0|                }
 2284|       |
 2285|      0|                len = s->byte_code.size - last_atom_start;
 2286|      0|                if (quant_min == 0) {
  ------------------
  |  Branch (2286:21): [True: 0, False: 0]
  ------------------
 2287|       |                    /* need to reset the capture in case the atom is
 2288|       |                       not executed */
 2289|      0|                    if (!need_capture_init && last_capture_count != s->capture_count) {
  ------------------
  |  Branch (2289:25): [True: 0, False: 0]
  |  Branch (2289:47): [True: 0, False: 0]
  ------------------
 2290|      0|                        if (dbuf_insert(&s->byte_code, last_atom_start, 3))
  ------------------
  |  Branch (2290:29): [True: 0, False: 0]
  ------------------
 2291|      0|                            goto out_of_memory;
 2292|      0|                        s->byte_code.buf[last_atom_start++] = REOP_save_reset;
 2293|      0|                        s->byte_code.buf[last_atom_start++] = last_capture_count;
 2294|      0|                        s->byte_code.buf[last_atom_start++] = s->capture_count - 1;
 2295|      0|                    }
 2296|      0|                    if (quant_max == 0) {
  ------------------
  |  Branch (2296:25): [True: 0, False: 0]
  ------------------
 2297|      0|                        s->byte_code.size = last_atom_start;
 2298|      0|                    } else if (quant_max == 1 || quant_max == INT32_MAX) {
  ------------------
  |  Branch (2298:32): [True: 0, False: 0]
  |  Branch (2298:50): [True: 0, False: 0]
  ------------------
 2299|      0|                        BOOL has_goto = (quant_max == INT32_MAX);
 2300|      0|                        if (dbuf_insert(&s->byte_code, last_atom_start, 5 + add_zero_advance_check * 2))
  ------------------
  |  Branch (2300:29): [True: 0, False: 0]
  ------------------
 2301|      0|                            goto out_of_memory;
 2302|      0|                        s->byte_code.buf[last_atom_start] = REOP_split_goto_first +
 2303|      0|                            greedy;
 2304|      0|                        put_u32(s->byte_code.buf + last_atom_start + 1,
 2305|      0|                                len + 5 * has_goto + add_zero_advance_check * 2 * 2);
 2306|      0|                        if (add_zero_advance_check) {
  ------------------
  |  Branch (2306:29): [True: 0, False: 0]
  ------------------
 2307|      0|                            s->byte_code.buf[last_atom_start + 1 + 4] = REOP_set_char_pos;
 2308|      0|                            s->byte_code.buf[last_atom_start + 1 + 4 + 1] = 0;
 2309|      0|                            re_emit_op_u8(s, REOP_check_advance, 0);
 2310|      0|                        }
 2311|      0|                        if (has_goto)
  ------------------
  |  Branch (2311:29): [True: 0, False: 0]
  ------------------
 2312|      0|                            re_emit_goto(s, REOP_goto, last_atom_start);
 2313|      0|                    } else {
 2314|      0|                        if (dbuf_insert(&s->byte_code, last_atom_start, 11 + add_zero_advance_check * 2))
  ------------------
  |  Branch (2314:29): [True: 0, False: 0]
  ------------------
 2315|      0|                            goto out_of_memory;
 2316|      0|                        pos = last_atom_start;
 2317|      0|                        s->byte_code.buf[pos++] = REOP_split_goto_first + greedy;
 2318|      0|                        put_u32(s->byte_code.buf + pos, 6 + add_zero_advance_check * 2 + len + 10);
 2319|      0|                        pos += 4;
 2320|       |
 2321|      0|                        s->byte_code.buf[pos++] = REOP_set_i32;
 2322|      0|                        s->byte_code.buf[pos++] = 0;
 2323|      0|                        put_u32(s->byte_code.buf + pos, quant_max);
 2324|      0|                        pos += 4;
 2325|      0|                        last_atom_start = pos;
 2326|      0|                        if (add_zero_advance_check) {
  ------------------
  |  Branch (2326:29): [True: 0, False: 0]
  ------------------
 2327|      0|                            s->byte_code.buf[pos++] = REOP_set_char_pos;
 2328|      0|                            s->byte_code.buf[pos++] = 0;
 2329|      0|                        }
 2330|      0|                        re_emit_goto_u8_u32(s, (add_zero_advance_check ? REOP_loop_check_adv_split_next_first : REOP_loop_split_next_first) - greedy, 0, quant_max, last_atom_start);
  ------------------
  |  Branch (2330:49): [True: 0, False: 0]
  ------------------
 2331|      0|                    }
 2332|      0|                } else if (quant_min == 1 && quant_max == INT32_MAX &&
  ------------------
  |  Branch (2332:28): [True: 0, False: 0]
  |  Branch (2332:46): [True: 0, False: 0]
  ------------------
 2333|      0|                           !add_zero_advance_check) {
  ------------------
  |  Branch (2333:28): [True: 0, False: 0]
  ------------------
 2334|      0|                    re_emit_goto(s, REOP_split_next_first - greedy,
 2335|      0|                                 last_atom_start);
 2336|      0|                } else {
 2337|      0|                    if (quant_min == quant_max)
  ------------------
  |  Branch (2337:25): [True: 0, False: 0]
  ------------------
 2338|      0|                        add_zero_advance_check = FALSE;
 2339|      0|                    if (dbuf_insert(&s->byte_code, last_atom_start, 6 + add_zero_advance_check * 2))
  ------------------
  |  Branch (2339:25): [True: 0, False: 0]
  ------------------
 2340|      0|                        goto out_of_memory;
 2341|       |                    /* Note: we assume the string length is < INT32_MAX */
 2342|      0|                    pos = last_atom_start;
 2343|      0|                    s->byte_code.buf[pos++] = REOP_set_i32;
 2344|      0|                    s->byte_code.buf[pos++] = 0;
 2345|      0|                    put_u32(s->byte_code.buf + pos, quant_max);
 2346|      0|                    pos += 4;
 2347|      0|                    last_atom_start = pos;
 2348|      0|                    if (add_zero_advance_check) {
  ------------------
  |  Branch (2348:25): [True: 0, False: 0]
  ------------------
 2349|      0|                        s->byte_code.buf[pos++] = REOP_set_char_pos;
 2350|      0|                        s->byte_code.buf[pos++] = 0;
 2351|      0|                    }
 2352|      0|                    if (quant_min == quant_max) {
  ------------------
  |  Branch (2352:25): [True: 0, False: 0]
  ------------------
 2353|       |                        /* a simple loop is enough */
 2354|      0|                        re_emit_goto_u8(s, REOP_loop, 0, last_atom_start);
 2355|      0|                    } else {
 2356|      0|                        re_emit_goto_u8_u32(s, (add_zero_advance_check ? REOP_loop_check_adv_split_next_first : REOP_loop_split_next_first) - greedy, 0, quant_max - quant_min, last_atom_start);
  ------------------
  |  Branch (2356:49): [True: 0, False: 0]
  ------------------
 2357|      0|                    }
 2358|      0|                }
 2359|      0|                last_atom_start = -1;
 2360|      0|            }
 2361|      0|            break;
 2362|      6|        default:
  ------------------
  |  Branch (2362:9): [True: 6, False: 0]
  ------------------
 2363|      6|            break;
 2364|      6|        }
 2365|      6|    }
 2366|      6|    s->buf_ptr = p;
 2367|      6|    return 0;
 2368|      0| out_of_memory:
 2369|      0|    return re_parse_out_of_memory(s);
 2370|      6|}
libregexp.c:get_class_atom:
 1046|      3|{
 1047|      3|    const uint8_t *p;
 1048|      3|    uint32_t c;
 1049|      3|    int ret;
 1050|       |
 1051|      3|    p = *pp;
 1052|       |
 1053|      3|    c = *p;
 1054|      3|    switch(c) {
 1055|      0|    case '\\':
  ------------------
  |  Branch (1055:5): [True: 0, False: 3]
  ------------------
 1056|      0|        p++;
 1057|      0|        if (p >= s->buf_end)
  ------------------
  |  Branch (1057:13): [True: 0, False: 0]
  ------------------
 1058|      0|            goto unexpected_end;
 1059|      0|        c = *p++;
 1060|      0|        switch(c) {
 1061|      0|        case 'd':
  ------------------
  |  Branch (1061:9): [True: 0, False: 0]
  ------------------
 1062|      0|            c = CHAR_RANGE_d;
 1063|      0|            goto class_range;
 1064|      0|        case 'D':
  ------------------
  |  Branch (1064:9): [True: 0, False: 0]
  ------------------
 1065|      0|            c = CHAR_RANGE_D;
 1066|      0|            goto class_range;
 1067|      0|        case 's':
  ------------------
  |  Branch (1067:9): [True: 0, False: 0]
  ------------------
 1068|      0|            c = CHAR_RANGE_s;
 1069|      0|            goto class_range;
 1070|      0|        case 'S':
  ------------------
  |  Branch (1070:9): [True: 0, False: 0]
  ------------------
 1071|      0|            c = CHAR_RANGE_S;
 1072|      0|            goto class_range;
 1073|      0|        case 'w':
  ------------------
  |  Branch (1073:9): [True: 0, False: 0]
  ------------------
 1074|      0|            c = CHAR_RANGE_w;
 1075|      0|            goto class_range;
 1076|      0|        case 'W':
  ------------------
  |  Branch (1076:9): [True: 0, False: 0]
  ------------------
 1077|      0|            c = CHAR_RANGE_W;
 1078|      0|        class_range:
 1079|      0|            if (!cr)
  ------------------
  |  Branch (1079:17): [True: 0, False: 0]
  ------------------
 1080|      0|                goto default_escape;
 1081|      0|            if (cr_init_char_range(s, cr, c))
  ------------------
  |  Branch (1081:17): [True: 0, False: 0]
  ------------------
 1082|      0|                return -1;
 1083|      0|            c += CLASS_RANGE_BASE;
  ------------------
  |  |  421|      0|#define CLASS_RANGE_BASE 0x40000000
  ------------------
 1084|      0|            break;
 1085|      0|        case 'c':
  ------------------
  |  Branch (1085:9): [True: 0, False: 0]
  ------------------
 1086|      0|            c = *p;
 1087|      0|            if ((c >= 'a' && c <= 'z') ||
  ------------------
  |  Branch (1087:18): [True: 0, False: 0]
  |  Branch (1087:30): [True: 0, False: 0]
  ------------------
 1088|      0|                (c >= 'A' && c <= 'Z') ||
  ------------------
  |  Branch (1088:18): [True: 0, False: 0]
  |  Branch (1088:30): [True: 0, False: 0]
  ------------------
 1089|      0|                (((c >= '0' && c <= '9') || c == '_') &&
  ------------------
  |  Branch (1089:20): [True: 0, False: 0]
  |  Branch (1089:32): [True: 0, False: 0]
  |  Branch (1089:45): [True: 0, False: 0]
  ------------------
 1090|      0|                 inclass && !s->is_unicode)) {   /* Annex B.1.4 */
  ------------------
  |  Branch (1090:18): [True: 0, False: 0]
  |  Branch (1090:29): [True: 0, False: 0]
  ------------------
 1091|      0|                c &= 0x1f;
 1092|      0|                p++;
 1093|      0|            } else if (s->is_unicode) {
  ------------------
  |  Branch (1093:24): [True: 0, False: 0]
  ------------------
 1094|      0|                goto invalid_escape;
 1095|      0|            } else {
 1096|       |                /* otherwise return '\' and 'c' */
 1097|      0|                p--;
 1098|      0|                c = '\\';
 1099|      0|            }
 1100|      0|            break;
 1101|      0|        case '-':
  ------------------
  |  Branch (1101:9): [True: 0, False: 0]
  ------------------
 1102|      0|            if (!inclass && s->is_unicode)
  ------------------
  |  Branch (1102:17): [True: 0, False: 0]
  |  Branch (1102:29): [True: 0, False: 0]
  ------------------
 1103|      0|                goto invalid_escape;
 1104|      0|            break;
 1105|      0|        case '^':
  ------------------
  |  Branch (1105:9): [True: 0, False: 0]
  ------------------
 1106|      0|        case '$':
  ------------------
  |  Branch (1106:9): [True: 0, False: 0]
  ------------------
 1107|      0|        case '\\':
  ------------------
  |  Branch (1107:9): [True: 0, False: 0]
  ------------------
 1108|      0|        case '.':
  ------------------
  |  Branch (1108:9): [True: 0, False: 0]
  ------------------
 1109|      0|        case '*':
  ------------------
  |  Branch (1109:9): [True: 0, False: 0]
  ------------------
 1110|      0|        case '+':
  ------------------
  |  Branch (1110:9): [True: 0, False: 0]
  ------------------
 1111|      0|        case '?':
  ------------------
  |  Branch (1111:9): [True: 0, False: 0]
  ------------------
 1112|      0|        case '(':
  ------------------
  |  Branch (1112:9): [True: 0, False: 0]
  ------------------
 1113|      0|        case ')':
  ------------------
  |  Branch (1113:9): [True: 0, False: 0]
  ------------------
 1114|      0|        case '[':
  ------------------
  |  Branch (1114:9): [True: 0, False: 0]
  ------------------
 1115|      0|        case ']':
  ------------------
  |  Branch (1115:9): [True: 0, False: 0]
  ------------------
 1116|      0|        case '{':
  ------------------
  |  Branch (1116:9): [True: 0, False: 0]
  ------------------
 1117|      0|        case '}':
  ------------------
  |  Branch (1117:9): [True: 0, False: 0]
  ------------------
 1118|      0|        case '|':
  ------------------
  |  Branch (1118:9): [True: 0, False: 0]
  ------------------
 1119|      0|        case '/':
  ------------------
  |  Branch (1119:9): [True: 0, False: 0]
  ------------------
 1120|       |            /* always valid to escape these characters */
 1121|      0|            break;
 1122|      0|#ifdef CONFIG_ALL_UNICODE
 1123|      0|        case 'p':
  ------------------
  |  Branch (1123:9): [True: 0, False: 0]
  ------------------
 1124|      0|        case 'P':
  ------------------
  |  Branch (1124:9): [True: 0, False: 0]
  ------------------
 1125|      0|            if (s->is_unicode && cr) {
  ------------------
  |  Branch (1125:17): [True: 0, False: 0]
  |  Branch (1125:34): [True: 0, False: 0]
  ------------------
 1126|      0|                if (parse_unicode_property(s, cr, &p, (c == 'P'), s->unicode_sets))
  ------------------
  |  Branch (1126:21): [True: 0, False: 0]
  ------------------
 1127|      0|                    return -1;
 1128|      0|                c = CLASS_RANGE_BASE;
  ------------------
  |  |  421|      0|#define CLASS_RANGE_BASE 0x40000000
  ------------------
 1129|      0|                break;
 1130|      0|            }
 1131|      0|            goto default_escape;
 1132|      0|#endif
 1133|      0|        case 'q':
  ------------------
  |  Branch (1133:9): [True: 0, False: 0]
  ------------------
 1134|      0|            if (s->unicode_sets && cr && inclass) {
  ------------------
  |  Branch (1134:17): [True: 0, False: 0]
  |  Branch (1134:36): [True: 0, False: 0]
  |  Branch (1134:42): [True: 0, False: 0]
  ------------------
 1135|      0|                if (parse_class_string_disjunction(s, cr, &p))
  ------------------
  |  Branch (1135:21): [True: 0, False: 0]
  ------------------
 1136|      0|                    return -1;
 1137|      0|                c = CLASS_RANGE_BASE;
  ------------------
  |  |  421|      0|#define CLASS_RANGE_BASE 0x40000000
  ------------------
 1138|      0|                break;
 1139|      0|            }
 1140|      0|            goto default_escape;
 1141|      0|        default:
  ------------------
  |  Branch (1141:9): [True: 0, False: 0]
  ------------------
 1142|      0|        default_escape:
 1143|      0|            p--;
 1144|      0|            ret = lre_parse_escape(&p, s->is_unicode * 2);
 1145|      0|            if (ret >= 0) {
  ------------------
  |  Branch (1145:17): [True: 0, False: 0]
  ------------------
 1146|      0|                c = ret;
 1147|      0|            } else {
 1148|      0|                if (s->is_unicode) {
  ------------------
  |  Branch (1148:21): [True: 0, False: 0]
  ------------------
 1149|      0|                invalid_escape:
 1150|      0|                    return re_parse_error(s, "invalid escape sequence in regular expression");
 1151|      0|                } else {
 1152|       |                    /* just ignore the '\' */
 1153|      0|                    goto normal_char;
 1154|      0|                }
 1155|      0|            }
 1156|      0|            break;
 1157|      0|        }
 1158|      0|        break;
 1159|      0|    case '\0':
  ------------------
  |  Branch (1159:5): [True: 0, False: 3]
  ------------------
 1160|      0|        if (p >= s->buf_end) {
  ------------------
  |  Branch (1160:13): [True: 0, False: 0]
  ------------------
 1161|      0|        unexpected_end:
 1162|      0|            return re_parse_error(s, "unexpected end");
 1163|      0|        }
 1164|       |        /* fall thru */
 1165|      0|        goto normal_char;
 1166|       |
 1167|      0|    case '&':
  ------------------
  |  Branch (1167:5): [True: 0, False: 3]
  ------------------
 1168|      0|    case '!':
  ------------------
  |  Branch (1168:5): [True: 0, False: 3]
  ------------------
 1169|      0|    case '#':
  ------------------
  |  Branch (1169:5): [True: 0, False: 3]
  ------------------
 1170|      0|    case '$':
  ------------------
  |  Branch (1170:5): [True: 0, False: 3]
  ------------------
 1171|      0|    case '%':
  ------------------
  |  Branch (1171:5): [True: 0, False: 3]
  ------------------
 1172|      0|    case '*':
  ------------------
  |  Branch (1172:5): [True: 0, False: 3]
  ------------------
 1173|      0|    case '+':
  ------------------
  |  Branch (1173:5): [True: 0, False: 3]
  ------------------
 1174|      3|    case ',':
  ------------------
  |  Branch (1174:5): [True: 3, False: 0]
  ------------------
 1175|      3|    case '.':
  ------------------
  |  Branch (1175:5): [True: 0, False: 3]
  ------------------
 1176|      3|    case ':':
  ------------------
  |  Branch (1176:5): [True: 0, False: 3]
  ------------------
 1177|      3|    case ';':
  ------------------
  |  Branch (1177:5): [True: 0, False: 3]
  ------------------
 1178|      3|    case '<':
  ------------------
  |  Branch (1178:5): [True: 0, False: 3]
  ------------------
 1179|      3|    case '=':
  ------------------
  |  Branch (1179:5): [True: 0, False: 3]
  ------------------
 1180|      3|    case '>':
  ------------------
  |  Branch (1180:5): [True: 0, False: 3]
  ------------------
 1181|      3|    case '?':
  ------------------
  |  Branch (1181:5): [True: 0, False: 3]
  ------------------
 1182|      3|    case '@':
  ------------------
  |  Branch (1182:5): [True: 0, False: 3]
  ------------------
 1183|      3|    case '^':
  ------------------
  |  Branch (1183:5): [True: 0, False: 3]
  ------------------
 1184|      3|    case '`':
  ------------------
  |  Branch (1184:5): [True: 0, False: 3]
  ------------------
 1185|      3|    case '~':
  ------------------
  |  Branch (1185:5): [True: 0, False: 3]
  ------------------
 1186|      3|        if (s->unicode_sets && p[1] == c) {
  ------------------
  |  Branch (1186:13): [True: 0, False: 3]
  |  Branch (1186:32): [True: 0, False: 0]
  ------------------
 1187|       |            /* forbidden double characters */
 1188|      0|            return re_parse_error(s, "invalid class set operation in regular expression");
 1189|      0|        }
 1190|      3|        goto normal_char;
 1191|       |
 1192|      3|    case '(':
  ------------------
  |  Branch (1192:5): [True: 0, False: 3]
  ------------------
 1193|      0|    case ')':
  ------------------
  |  Branch (1193:5): [True: 0, False: 3]
  ------------------
 1194|      0|    case '[':
  ------------------
  |  Branch (1194:5): [True: 0, False: 3]
  ------------------
 1195|      0|    case ']':
  ------------------
  |  Branch (1195:5): [True: 0, False: 3]
  ------------------
 1196|      0|    case '{':
  ------------------
  |  Branch (1196:5): [True: 0, False: 3]
  ------------------
 1197|      0|    case '}':
  ------------------
  |  Branch (1197:5): [True: 0, False: 3]
  ------------------
 1198|      0|    case '/':
  ------------------
  |  Branch (1198:5): [True: 0, False: 3]
  ------------------
 1199|      0|    case '-':
  ------------------
  |  Branch (1199:5): [True: 0, False: 3]
  ------------------
 1200|      0|    case '|':
  ------------------
  |  Branch (1200:5): [True: 0, False: 3]
  ------------------
 1201|      0|        if (s->unicode_sets) {
  ------------------
  |  Branch (1201:13): [True: 0, False: 0]
  ------------------
 1202|       |            /* invalid characters in unicode sets */
 1203|      0|            return re_parse_error(s, "invalid character in class in regular expression");
 1204|      0|        }
 1205|      0|        goto normal_char;
 1206|       |
 1207|      0|    default:
  ------------------
  |  Branch (1207:5): [True: 0, False: 3]
  ------------------
 1208|      3|    normal_char:
 1209|       |        /* normal char */
 1210|      3|        if (c >= 128) {
  ------------------
  |  Branch (1210:13): [True: 0, False: 3]
  ------------------
 1211|      0|            c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
 1212|      0|            if ((unsigned)c > 0xffff && !s->is_unicode) {
  ------------------
  |  Branch (1212:17): [True: 0, False: 0]
  |  Branch (1212:41): [True: 0, False: 0]
  ------------------
 1213|       |                /* XXX: should handle non BMP-1 code points */
 1214|      0|                return re_parse_error(s, "malformed unicode char");
 1215|      0|            }
 1216|      3|        } else {
 1217|      3|            p++;
 1218|      3|        }
 1219|      3|        break;
 1220|      3|    }
 1221|      3|    *pp = p;
 1222|      3|    return c;
 1223|      3|}
libregexp.c:re_emit_op_u16:
  668|      3|{
  669|      3|    dbuf_putc(&s->byte_code, op);
  670|      3|    dbuf_put_u16(&s->byte_code, val);
  671|      3|}
libregexp.c:re_emit_char:
 1269|      3|{
 1270|      3|    if (c <= 0xffff)
  ------------------
  |  Branch (1270:9): [True: 3, False: 0]
  ------------------
 1271|      3|        re_emit_op_u16(s, s->ignore_case ? REOP_char_i : REOP_char, c);
  ------------------
  |  Branch (1271:27): [True: 0, False: 3]
  ------------------
 1272|      0|    else
 1273|      0|        re_emit_op_u32(s, s->ignore_case ? REOP_char32_i : REOP_char32, c);
  ------------------
  |  Branch (1273:27): [True: 0, False: 0]
  ------------------
 1274|      3|}
libregexp.c:compute_register_count:
 2445|      3|{
 2446|      3|    int stack_size, stack_size_max, pos, opcode, len;
 2447|      3|    uint32_t val;
 2448|       |
 2449|      3|    stack_size = 0;
 2450|      3|    stack_size_max = 0;
 2451|      3|    bc_buf += RE_HEADER_LEN;
  ------------------
  |  |  116|      3|#define RE_HEADER_LEN 8
  ------------------
 2452|      3|    bc_buf_len -= RE_HEADER_LEN;
  ------------------
  |  |  116|      3|#define RE_HEADER_LEN 8
  ------------------
 2453|      3|    pos = 0;
 2454|     21|    while (pos < bc_buf_len) {
  ------------------
  |  Branch (2454:12): [True: 18, False: 3]
  ------------------
 2455|     18|        opcode = bc_buf[pos];
 2456|     18|        len = reopcode_info[opcode].size;
 2457|     18|        assert(opcode < REOP_COUNT);
  ------------------
  |  Branch (2457:9): [True: 0, False: 18]
  |  Branch (2457:9): [True: 18, False: 0]
  ------------------
 2458|     18|        assert((pos + len) <= bc_buf_len);
  ------------------
  |  Branch (2458:9): [True: 0, False: 18]
  |  Branch (2458:9): [True: 18, False: 0]
  ------------------
 2459|     18|        switch(opcode) {
  ------------------
  |  Branch (2459:16): [True: 0, False: 18]
  ------------------
 2460|      0|        case REOP_set_i32:
  ------------------
  |  Branch (2460:9): [True: 0, False: 18]
  ------------------
 2461|      0|        case REOP_set_char_pos:
  ------------------
  |  Branch (2461:9): [True: 0, False: 18]
  ------------------
 2462|      0|            bc_buf[pos + 1] = stack_size;
 2463|      0|            stack_size++;
 2464|      0|            if (stack_size > stack_size_max) {
  ------------------
  |  Branch (2464:17): [True: 0, False: 0]
  ------------------
 2465|      0|                if (stack_size > REGISTER_COUNT_MAX)
  ------------------
  |  |   60|      0|#define REGISTER_COUNT_MAX 255
  ------------------
  |  Branch (2465:21): [True: 0, False: 0]
  ------------------
 2466|      0|                    return -1;
 2467|      0|                stack_size_max = stack_size;
 2468|      0|            }
 2469|      0|            break;
 2470|      0|        case REOP_check_advance:
  ------------------
  |  Branch (2470:9): [True: 0, False: 18]
  ------------------
 2471|      0|        case REOP_loop:
  ------------------
  |  Branch (2471:9): [True: 0, False: 18]
  ------------------
 2472|      0|        case REOP_loop_split_goto_first:
  ------------------
  |  Branch (2472:9): [True: 0, False: 18]
  ------------------
 2473|      0|        case REOP_loop_split_next_first:
  ------------------
  |  Branch (2473:9): [True: 0, False: 18]
  ------------------
 2474|      0|            assert(stack_size > 0);
  ------------------
  |  Branch (2474:13): [True: 0, False: 0]
  |  Branch (2474:13): [True: 0, False: 0]
  ------------------
 2475|      0|            stack_size--;
 2476|      0|            bc_buf[pos + 1] = stack_size;
 2477|      0|            break;
 2478|      0|        case REOP_loop_check_adv_split_goto_first:
  ------------------
  |  Branch (2478:9): [True: 0, False: 18]
  ------------------
 2479|      0|        case REOP_loop_check_adv_split_next_first:
  ------------------
  |  Branch (2479:9): [True: 0, False: 18]
  ------------------
 2480|      0|            assert(stack_size >= 2);
  ------------------
  |  Branch (2480:13): [True: 0, False: 0]
  |  Branch (2480:13): [True: 0, False: 0]
  ------------------
 2481|      0|            stack_size -= 2;
 2482|      0|            bc_buf[pos + 1] = stack_size;
 2483|      0|            break;
 2484|      0|        case REOP_range:
  ------------------
  |  Branch (2484:9): [True: 0, False: 18]
  ------------------
 2485|      0|        case REOP_range_i:
  ------------------
  |  Branch (2485:9): [True: 0, False: 18]
  ------------------
 2486|      0|            val = get_u16(bc_buf + pos + 1);
 2487|      0|            len += val * 4;
 2488|      0|            break;
 2489|      0|        case REOP_range32:
  ------------------
  |  Branch (2489:9): [True: 0, False: 18]
  ------------------
 2490|      0|        case REOP_range32_i:
  ------------------
  |  Branch (2490:9): [True: 0, False: 18]
  ------------------
 2491|      0|            val = get_u16(bc_buf + pos + 1);
 2492|      0|            len += val * 8;
 2493|      0|            break;
 2494|      0|        case REOP_back_reference:
  ------------------
  |  Branch (2494:9): [True: 0, False: 18]
  ------------------
 2495|      0|        case REOP_back_reference_i:
  ------------------
  |  Branch (2495:9): [True: 0, False: 18]
  ------------------
 2496|      0|        case REOP_backward_back_reference:
  ------------------
  |  Branch (2496:9): [True: 0, False: 18]
  ------------------
 2497|      0|        case REOP_backward_back_reference_i:
  ------------------
  |  Branch (2497:9): [True: 0, False: 18]
  ------------------
 2498|      0|            val = bc_buf[pos + 1];
 2499|      0|            len += val;
 2500|      0|            break;
 2501|     18|        }
 2502|     18|        pos += len;
 2503|     18|    }
 2504|      3|    return stack_size_max;
 2505|      3|}
libregexp.c:lre_exec_backtrack:
 2776|  1.00M|{
 2777|  1.00M|    int opcode;
 2778|  1.00M|    int cbuf_type;
 2779|  1.00M|    uint32_t val, c, idx;
 2780|  1.00M|    const uint8_t *cbuf_end;
 2781|  1.00M|    StackElem *sp, *bp, *stack_end;
 2782|       |#ifdef DUMP_EXEC
 2783|       |    const uint8_t *pc_start = pc; /* TEST */
 2784|       |#endif
 2785|  1.00M|    cbuf_type = s->cbuf_type;
 2786|  1.00M|    cbuf_end = s->cbuf_end;
 2787|       |
 2788|  1.00M|    sp = s->stack_buf;
 2789|  1.00M|    bp = s->stack_buf;
 2790|  1.00M|    stack_end = s->stack_buf + s->stack_size;
 2791|       |    
 2792|  1.00M|#define CHECK_STACK_SPACE(n)                            \
 2793|  1.00M|    if (unlikely((stack_end - sp) < (n))) {             \
 2794|  1.00M|        size_t saved_sp = sp - s->stack_buf;            \
 2795|  1.00M|        size_t saved_bp = bp - s->stack_buf;            \
 2796|  1.00M|        if (stack_realloc(s, sp - s->stack_buf + (n)))  \
 2797|  1.00M|            return LRE_RET_MEMORY_ERROR;                \
 2798|  1.00M|        stack_end = s->stack_buf + s->stack_size;       \
 2799|  1.00M|        sp = s->stack_buf + saved_sp;                   \
 2800|  1.00M|        bp = s->stack_buf + saved_bp;                   \
 2801|  1.00M|    }
 2802|       |
 2803|       |    /* XXX: could test if the value was saved to reduce the stack size
 2804|       |       but slower */
 2805|  1.00M|#define SAVE_CAPTURE(idx, value)                        \
 2806|  1.00M|    {                                                   \
 2807|  1.00M|        CHECK_STACK_SPACE(2);                           \
 2808|  1.00M|        sp[0].val = idx;                                \
 2809|  1.00M|        sp[1].ptr = capture[idx];                       \
 2810|  1.00M|        sp += 2;                                        \
 2811|  1.00M|        capture[idx] = (value);                         \
 2812|  1.00M|    }
 2813|       |
 2814|       |    /* avoid saving the previous value if already saved */
 2815|  1.00M|#define SAVE_CAPTURE_CHECK(idx, value)          \
 2816|  1.00M|    {                                           \
 2817|  1.00M|        StackElem *sp1;                         \
 2818|  1.00M|        sp1 = sp;                               \
 2819|  1.00M|        for(;;) {                               \
 2820|  1.00M|            if (sp1 > bp) {                             \
 2821|  1.00M|                if (sp1[-2].val == idx)                 \
 2822|  1.00M|                    break;                              \
 2823|  1.00M|                sp1 -= 2;                               \
 2824|  1.00M|            } else {                                    \
 2825|  1.00M|                CHECK_STACK_SPACE(2);                   \
 2826|  1.00M|                sp[0].val = idx;                        \
 2827|  1.00M|                sp[1].ptr = capture[idx];               \
 2828|  1.00M|                sp += 2;                                \
 2829|  1.00M|                break;                                  \
 2830|  1.00M|            }                                           \
 2831|  1.00M|        }                                               \
 2832|  1.00M|        capture[idx] = (value);                         \
 2833|  1.00M|    }
 2834|       |
 2835|       |
 2836|       |#ifdef DUMP_EXEC
 2837|       |    printf("%5s %5s %5s %5s %s\n", "PC", "CP", "BP", "SP", "OPCODE");
 2838|       |#endif    
 2839|  2.02M|    for(;;) {
 2840|  2.02M|        opcode = *pc++;
 2841|       |#ifdef DUMP_EXEC
 2842|       |        printf("%5ld %5ld %5ld %5ld %s\n",
 2843|       |               pc - 1 - pc_start,
 2844|       |               cbuf_type == 0 ? cptr - s->cbuf : (cptr - s->cbuf) / 2,
 2845|       |               bp - s->stack_buf,
 2846|       |               sp - s->stack_buf,
 2847|       |               reopcode_info[opcode].name);
 2848|       |#endif        
 2849|  2.02M|        switch(opcode) {
 2850|      4|        case REOP_match:
  ------------------
  |  Branch (2850:9): [True: 4, False: 2.02M]
  ------------------
 2851|      4|            return 1;
 2852|  1.00M|        no_match:
 2853|  1.00M|            for(;;) {
 2854|  1.00M|                REExecStateEnum type;
 2855|  1.00M|                if (bp == s->stack_buf)
  ------------------
  |  Branch (2855:21): [True: 1.00M, False: 0]
  ------------------
 2856|  1.00M|                    return 0;
 2857|       |                /* undo the modifications to capture[] */
 2858|      0|                while (sp > bp) {
  ------------------
  |  Branch (2858:24): [True: 0, False: 0]
  ------------------
 2859|      0|                    capture[sp[-2].val] = sp[-1].ptr;
 2860|      0|                    sp -= 2;
 2861|      0|                }
 2862|       |                
 2863|      0|                pc = sp[-3].ptr;
 2864|      0|                cptr = sp[-2].ptr;
 2865|      0|                type = sp[-1].bp.type;
 2866|      0|                bp = s->stack_buf + sp[-1].bp.val;
 2867|      0|                sp -= 3;
 2868|      0|                if (type != RE_EXEC_STATE_LOOKAHEAD)
  ------------------
  |  Branch (2868:21): [True: 0, False: 0]
  ------------------
 2869|      0|                    break;
 2870|      0|            }
 2871|      0|            if (lre_poll_timeout(s))
  ------------------
  |  Branch (2871:17): [True: 0, False: 0]
  ------------------
 2872|      0|                return LRE_RET_TIMEOUT;
  ------------------
  |  |   41|      0|#define LRE_RET_TIMEOUT      (-2)
  ------------------
 2873|      0|            break;
 2874|      0|        case REOP_lookahead_match:
  ------------------
  |  Branch (2874:9): [True: 0, False: 2.02M]
  ------------------
 2875|       |            /* pop all the saved states until reaching the start of
 2876|       |               the lookahead and keep the updated captures and
 2877|       |               variables and the corresponding undo info. */
 2878|      0|            {
 2879|      0|                StackElem *sp1, *sp_top, *next_sp;
 2880|      0|                REExecStateEnum type;
 2881|       |
 2882|      0|                sp_top = sp;
 2883|      0|                for(;;) {
 2884|      0|                    sp1 = sp;
 2885|      0|                    sp = bp;
 2886|      0|                    pc = sp[-3].ptr;
 2887|      0|                    cptr = sp[-2].ptr;
 2888|      0|                    type = sp[-1].bp.type;
 2889|      0|                    bp = s->stack_buf + sp[-1].bp.val;
 2890|      0|                    sp[-1].ptr = (void *)sp1; /* save the next value for the copy step */
 2891|      0|                    sp -= 3;
 2892|      0|                    if (type == RE_EXEC_STATE_LOOKAHEAD)
  ------------------
  |  Branch (2892:25): [True: 0, False: 0]
  ------------------
 2893|      0|                        break;
 2894|      0|                }
 2895|      0|                if (sp != s->stack_buf) {
  ------------------
  |  Branch (2895:21): [True: 0, False: 0]
  ------------------
 2896|       |                    /* keep the undo info if there is a saved state */
 2897|      0|                    sp1 = sp;
 2898|      0|                    while (sp1 < sp_top) {
  ------------------
  |  Branch (2898:28): [True: 0, False: 0]
  ------------------
 2899|      0|                        next_sp = (void *)sp1[2].ptr;
 2900|      0|                        sp1 += 3;
 2901|      0|                        while (sp1 < next_sp)
  ------------------
  |  Branch (2901:32): [True: 0, False: 0]
  ------------------
 2902|      0|                            *sp++ = *sp1++;
 2903|      0|                    }
 2904|      0|                }
 2905|      0|            }
 2906|      0|            break;
 2907|      0|        case REOP_negative_lookahead_match:
  ------------------
  |  Branch (2907:9): [True: 0, False: 2.02M]
  ------------------
 2908|       |            /* pop all the saved states until reaching start of the negative lookahead */
 2909|      0|            for(;;) {
 2910|      0|                REExecStateEnum type;
 2911|      0|                type = bp[-1].bp.type;
 2912|       |                /* undo the modifications to capture[] */
 2913|      0|                while (sp > bp) {
  ------------------
  |  Branch (2913:24): [True: 0, False: 0]
  ------------------
 2914|      0|                    capture[sp[-2].val] = sp[-1].ptr;
 2915|      0|                    sp -= 2;
 2916|      0|                }
 2917|      0|                pc = sp[-3].ptr;
 2918|      0|                cptr = sp[-2].ptr;
 2919|      0|                type = sp[-1].bp.type;
 2920|      0|                bp = s->stack_buf + sp[-1].bp.val;
 2921|      0|                sp -= 3;
 2922|      0|                if (type == RE_EXEC_STATE_NEGATIVE_LOOKAHEAD)
  ------------------
  |  Branch (2922:21): [True: 0, False: 0]
  ------------------
 2923|      0|                    break;
 2924|      0|            }
 2925|      0|            goto no_match;
 2926|      0|        case REOP_char32:
  ------------------
  |  Branch (2926:9): [True: 0, False: 2.02M]
  ------------------
 2927|      0|        case REOP_char32_i:
  ------------------
  |  Branch (2927:9): [True: 0, False: 2.02M]
  ------------------
 2928|      0|            val = get_u32(pc);
 2929|      0|            pc += 4;
 2930|      0|            goto test_char;
 2931|    970|        case REOP_char:
  ------------------
  |  Branch (2931:9): [True: 970, False: 2.01M]
  ------------------
 2932|    970|        case REOP_char_i:
  ------------------
  |  Branch (2932:9): [True: 0, False: 2.02M]
  ------------------
 2933|    970|            val = get_u16(pc);
 2934|    970|            pc += 2;
 2935|    970|        test_char:
 2936|    970|            if (cptr >= cbuf_end)
  ------------------
  |  Branch (2936:17): [True: 1, False: 969]
  ------------------
 2937|      1|                goto no_match;
 2938|    969|            GET_CHAR(c, cptr, cbuf_end, cbuf_type);
  ------------------
  |  | 2622|    969|    do {                                                                \
  |  | 2623|    969|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2623:13): [True: 0, False: 969]
  |  |  ------------------
  |  | 2624|      0|            c = *cptr++;                                                \
  |  | 2625|    969|        } else {                                                        \
  |  | 2626|    969|            const uint16_t *_p = (const uint16_t *)cptr;                \
  |  | 2627|    969|            const uint16_t *_end = (const uint16_t *)cbuf_end;          \
  |  | 2628|    969|            c = *_p++;                                                  \
  |  | 2629|    969|            if (is_hi_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2629:17): [True: 1, False: 968]
  |  |  |  Branch (2629:39): [True: 1, False: 0]
  |  |  ------------------
  |  | 2630|      1|                if (_p < _end && is_lo_surrogate(*_p)) {                \
  |  |  ------------------
  |  |  |  Branch (2630:21): [True: 1, False: 0]
  |  |  |  Branch (2630:34): [True: 0, False: 1]
  |  |  ------------------
  |  | 2631|      0|                    c = from_surrogate(c, *_p++);                       \
  |  | 2632|      0|                }                                                       \
  |  | 2633|      1|            }                                                           \
  |  | 2634|    969|            cptr = (const void *)_p;                                    \
  |  | 2635|    969|        }                                                               \
  |  | 2636|    969|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2636:14): [Folded, False: 969]
  |  |  ------------------
  ------------------
 2939|    969|            if (opcode == REOP_char_i || opcode == REOP_char32_i) {
  ------------------
  |  Branch (2939:17): [True: 0, False: 969]
  |  Branch (2939:42): [True: 0, False: 969]
  ------------------
 2940|      0|                c = lre_canonicalize(c, s->is_unicode);
 2941|      0|            }
 2942|    969|            if (val != c)
  ------------------
  |  Branch (2942:17): [True: 965, False: 4]
  ------------------
 2943|    965|                goto no_match;
 2944|      4|            break;
 2945|      4|        case REOP_split_goto_first:
  ------------------
  |  Branch (2945:9): [True: 0, False: 2.02M]
  ------------------
 2946|      0|        case REOP_split_next_first:
  ------------------
  |  Branch (2946:9): [True: 0, False: 2.02M]
  ------------------
 2947|      0|            {
 2948|      0|                const uint8_t *pc1;
 2949|       |
 2950|      0|                val = get_u32(pc);
 2951|      0|                pc += 4;
 2952|      0|                if (opcode == REOP_split_next_first) {
  ------------------
  |  Branch (2952:21): [True: 0, False: 0]
  ------------------
 2953|      0|                    pc1 = pc + (int)val;
 2954|      0|                } else {
 2955|      0|                    pc1 = pc;
 2956|      0|                    pc = pc + (int)val;
 2957|      0|                }
 2958|      0|                CHECK_STACK_SPACE(3);
  ------------------
  |  | 2793|      0|    if (unlikely((stack_end - sp) < (n))) {             \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2794|      0|        size_t saved_sp = sp - s->stack_buf;            \
  |  | 2795|      0|        size_t saved_bp = bp - s->stack_buf;            \
  |  | 2796|      0|        if (stack_realloc(s, sp - s->stack_buf + (n)))  \
  |  |  ------------------
  |  |  |  Branch (2796:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2797|      0|            return LRE_RET_MEMORY_ERROR;                \
  |  |  ------------------
  |  |  |  |   40|      0|#define LRE_RET_MEMORY_ERROR (-1)
  |  |  ------------------
  |  | 2798|      0|        stack_end = s->stack_buf + s->stack_size;       \
  |  | 2799|      0|        sp = s->stack_buf + saved_sp;                   \
  |  | 2800|      0|        bp = s->stack_buf + saved_bp;                   \
  |  | 2801|      0|    }
  ------------------
 2959|      0|                sp[0].ptr = (uint8_t *)pc1;
 2960|      0|                sp[1].ptr = (uint8_t *)cptr;
 2961|      0|                sp[2].bp.val = bp - s->stack_buf;
 2962|      0|                sp[2].bp.type = RE_EXEC_STATE_SPLIT;
 2963|      0|                sp += 3;
 2964|      0|                bp = sp;
 2965|      0|            }
 2966|      0|            break;
 2967|      0|        case REOP_lookahead:
  ------------------
  |  Branch (2967:9): [True: 0, False: 2.02M]
  ------------------
 2968|      0|        case REOP_negative_lookahead:
  ------------------
  |  Branch (2968:9): [True: 0, False: 2.02M]
  ------------------
 2969|      0|            val = get_u32(pc);
 2970|      0|            pc += 4;
 2971|      0|            CHECK_STACK_SPACE(3);
  ------------------
  |  | 2793|      0|    if (unlikely((stack_end - sp) < (n))) {             \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2794|      0|        size_t saved_sp = sp - s->stack_buf;            \
  |  | 2795|      0|        size_t saved_bp = bp - s->stack_buf;            \
  |  | 2796|      0|        if (stack_realloc(s, sp - s->stack_buf + (n)))  \
  |  |  ------------------
  |  |  |  Branch (2796:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2797|      0|            return LRE_RET_MEMORY_ERROR;                \
  |  |  ------------------
  |  |  |  |   40|      0|#define LRE_RET_MEMORY_ERROR (-1)
  |  |  ------------------
  |  | 2798|      0|        stack_end = s->stack_buf + s->stack_size;       \
  |  | 2799|      0|        sp = s->stack_buf + saved_sp;                   \
  |  | 2800|      0|        bp = s->stack_buf + saved_bp;                   \
  |  | 2801|      0|    }
  ------------------
 2972|      0|            sp[0].ptr = (uint8_t *)(pc + (int)val);
 2973|      0|            sp[1].ptr = (uint8_t *)cptr;
 2974|      0|            sp[2].bp.val = bp - s->stack_buf;
 2975|      0|            sp[2].bp.type = RE_EXEC_STATE_LOOKAHEAD + opcode - REOP_lookahead;
 2976|      0|            sp += 3;
 2977|      0|            bp = sp;
 2978|      0|            break;
 2979|      0|        case REOP_goto:
  ------------------
  |  Branch (2979:9): [True: 0, False: 2.02M]
  ------------------
 2980|      0|            val = get_u32(pc);
 2981|      0|            pc += 4 + (int)val;
 2982|      0|            if (lre_poll_timeout(s))
  ------------------
  |  Branch (2982:17): [True: 0, False: 0]
  ------------------
 2983|      0|                return LRE_RET_TIMEOUT;
  ------------------
  |  |   41|      0|#define LRE_RET_TIMEOUT      (-2)
  ------------------
 2984|      0|            break;
 2985|      0|        case REOP_line_start:
  ------------------
  |  Branch (2985:9): [True: 0, False: 2.02M]
  ------------------
 2986|      0|        case REOP_line_start_m:
  ------------------
  |  Branch (2986:9): [True: 0, False: 2.02M]
  ------------------
 2987|      0|            if (cptr == s->cbuf)
  ------------------
  |  Branch (2987:17): [True: 0, False: 0]
  ------------------
 2988|      0|                break;
 2989|      0|            if (opcode == REOP_line_start)
  ------------------
  |  Branch (2989:17): [True: 0, False: 0]
  ------------------
 2990|      0|                goto no_match;
 2991|      0|            PEEK_PREV_CHAR(c, cptr, s->cbuf, cbuf_type);
  ------------------
  |  | 2655|      0|    do {                                                                \
  |  | 2656|      0|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2656:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2657|      0|            c = cptr[-1];                                               \
  |  | 2658|      0|        } else {                                                        \
  |  | 2659|      0|            const uint16_t *_p = (const uint16_t *)cptr - 1;            \
  |  | 2660|      0|            const uint16_t *_start = (const uint16_t *)cbuf_start;      \
  |  | 2661|      0|            c = *_p;                                                    \
  |  | 2662|      0|            if (is_lo_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2662:17): [True: 0, False: 0]
  |  |  |  Branch (2662:39): [True: 0, False: 0]
  |  |  ------------------
  |  | 2663|      0|                if (_p > _start && is_hi_surrogate(_p[-1])) {           \
  |  |  ------------------
  |  |  |  Branch (2663:21): [True: 0, False: 0]
  |  |  |  Branch (2663:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 2664|      0|                    c = from_surrogate(*--_p, c);                       \
  |  | 2665|      0|                }                                                       \
  |  | 2666|      0|            }                                                           \
  |  | 2667|      0|        }                                                               \
  |  | 2668|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2668:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2992|      0|            if (!is_line_terminator(c))
  ------------------
  |  Branch (2992:17): [True: 0, False: 0]
  ------------------
 2993|      0|                goto no_match;
 2994|      0|            break;
 2995|      0|        case REOP_line_end:
  ------------------
  |  Branch (2995:9): [True: 0, False: 2.02M]
  ------------------
 2996|      0|        case REOP_line_end_m:
  ------------------
  |  Branch (2996:9): [True: 0, False: 2.02M]
  ------------------
 2997|      0|            if (cptr == cbuf_end)
  ------------------
  |  Branch (2997:17): [True: 0, False: 0]
  ------------------
 2998|      0|                break;
 2999|      0|            if (opcode == REOP_line_end)
  ------------------
  |  Branch (2999:17): [True: 0, False: 0]
  ------------------
 3000|      0|                goto no_match;
 3001|      0|            PEEK_CHAR(c, cptr, cbuf_end, cbuf_type);
  ------------------
  |  | 2639|      0|    do {                                                                \
  |  | 2640|      0|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2640:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2641|      0|            c = cptr[0];                                                \
  |  | 2642|      0|        } else {                                                        \
  |  | 2643|      0|            const uint16_t *_p = (const uint16_t *)cptr;                \
  |  | 2644|      0|            const uint16_t *_end = (const uint16_t *)cbuf_end;          \
  |  | 2645|      0|            c = *_p++;                                                  \
  |  | 2646|      0|            if (is_hi_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2646:17): [True: 0, False: 0]
  |  |  |  Branch (2646:39): [True: 0, False: 0]
  |  |  ------------------
  |  | 2647|      0|                if (_p < _end && is_lo_surrogate(*_p)) {                \
  |  |  ------------------
  |  |  |  Branch (2647:21): [True: 0, False: 0]
  |  |  |  Branch (2647:34): [True: 0, False: 0]
  |  |  ------------------
  |  | 2648|      0|                    c = from_surrogate(c, *_p);                         \
  |  | 2649|      0|                }                                                       \
  |  | 2650|      0|            }                                                           \
  |  | 2651|      0|        }                                                               \
  |  | 2652|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2652:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3002|      0|            if (!is_line_terminator(c))
  ------------------
  |  Branch (3002:17): [True: 0, False: 0]
  ------------------
 3003|      0|                goto no_match;
 3004|      0|            break;
 3005|  1.00M|        case REOP_dot:
  ------------------
  |  Branch (3005:9): [True: 1.00M, False: 1.01M]
  ------------------
 3006|  1.00M|            if (cptr == cbuf_end)
  ------------------
  |  Branch (3006:17): [True: 0, False: 1.00M]
  ------------------
 3007|      0|                goto no_match;
 3008|  1.00M|            GET_CHAR(c, cptr, cbuf_end, cbuf_type);
  ------------------
  |  | 2622|  1.00M|    do {                                                                \
  |  | 2623|  1.00M|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2623:13): [True: 0, False: 1.00M]
  |  |  ------------------
  |  | 2624|      0|            c = *cptr++;                                                \
  |  | 2625|  1.00M|        } else {                                                        \
  |  | 2626|  1.00M|            const uint16_t *_p = (const uint16_t *)cptr;                \
  |  | 2627|  1.00M|            const uint16_t *_end = (const uint16_t *)cbuf_end;          \
  |  | 2628|  1.00M|            c = *_p++;                                                  \
  |  | 2629|  1.00M|            if (is_hi_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2629:17): [True: 1, False: 1.00M]
  |  |  |  Branch (2629:39): [True: 1, False: 0]
  |  |  ------------------
  |  | 2630|      1|                if (_p < _end && is_lo_surrogate(*_p)) {                \
  |  |  ------------------
  |  |  |  Branch (2630:21): [True: 1, False: 0]
  |  |  |  Branch (2630:34): [True: 0, False: 1]
  |  |  ------------------
  |  | 2631|      0|                    c = from_surrogate(c, *_p++);                       \
  |  | 2632|      0|                }                                                       \
  |  | 2633|      1|            }                                                           \
  |  | 2634|  1.00M|            cptr = (const void *)_p;                                    \
  |  | 2635|  1.00M|        }                                                               \
  |  | 2636|  1.00M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2636:14): [Folded, False: 1.00M]
  |  |  ------------------
  ------------------
 3009|  1.00M|            if (is_line_terminator(c))
  ------------------
  |  Branch (3009:17): [True: 1.00M, False: 970]
  ------------------
 3010|  1.00M|                goto no_match;
 3011|    970|            break;
 3012|    970|        case REOP_any:
  ------------------
  |  Branch (3012:9): [True: 0, False: 2.02M]
  ------------------
 3013|      0|            if (cptr == cbuf_end)
  ------------------
  |  Branch (3013:17): [True: 0, False: 0]
  ------------------
 3014|      0|                goto no_match;
 3015|      0|            GET_CHAR(c, cptr, cbuf_end, cbuf_type);
  ------------------
  |  | 2622|      0|    do {                                                                \
  |  | 2623|      0|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2623:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2624|      0|            c = *cptr++;                                                \
  |  | 2625|      0|        } else {                                                        \
  |  | 2626|      0|            const uint16_t *_p = (const uint16_t *)cptr;                \
  |  | 2627|      0|            const uint16_t *_end = (const uint16_t *)cbuf_end;          \
  |  | 2628|      0|            c = *_p++;                                                  \
  |  | 2629|      0|            if (is_hi_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2629:17): [True: 0, False: 0]
  |  |  |  Branch (2629:39): [True: 0, False: 0]
  |  |  ------------------
  |  | 2630|      0|                if (_p < _end && is_lo_surrogate(*_p)) {                \
  |  |  ------------------
  |  |  |  Branch (2630:21): [True: 0, False: 0]
  |  |  |  Branch (2630:34): [True: 0, False: 0]
  |  |  ------------------
  |  | 2631|      0|                    c = from_surrogate(c, *_p++);                       \
  |  | 2632|      0|                }                                                       \
  |  | 2633|      0|            }                                                           \
  |  | 2634|      0|            cptr = (const void *)_p;                                    \
  |  | 2635|      0|        }                                                               \
  |  | 2636|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2636:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3016|      0|            break;
 3017|      0|        case REOP_space:
  ------------------
  |  Branch (3017:9): [True: 0, False: 2.02M]
  ------------------
 3018|      0|            if (cptr == cbuf_end)
  ------------------
  |  Branch (3018:17): [True: 0, False: 0]
  ------------------
 3019|      0|                goto no_match;
 3020|      0|            GET_CHAR(c, cptr, cbuf_end, cbuf_type);
  ------------------
  |  | 2622|      0|    do {                                                                \
  |  | 2623|      0|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2623:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2624|      0|            c = *cptr++;                                                \
  |  | 2625|      0|        } else {                                                        \
  |  | 2626|      0|            const uint16_t *_p = (const uint16_t *)cptr;                \
  |  | 2627|      0|            const uint16_t *_end = (const uint16_t *)cbuf_end;          \
  |  | 2628|      0|            c = *_p++;                                                  \
  |  | 2629|      0|            if (is_hi_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2629:17): [True: 0, False: 0]
  |  |  |  Branch (2629:39): [True: 0, False: 0]
  |  |  ------------------
  |  | 2630|      0|                if (_p < _end && is_lo_surrogate(*_p)) {                \
  |  |  ------------------
  |  |  |  Branch (2630:21): [True: 0, False: 0]
  |  |  |  Branch (2630:34): [True: 0, False: 0]
  |  |  ------------------
  |  | 2631|      0|                    c = from_surrogate(c, *_p++);                       \
  |  | 2632|      0|                }                                                       \
  |  | 2633|      0|            }                                                           \
  |  | 2634|      0|            cptr = (const void *)_p;                                    \
  |  | 2635|      0|        }                                                               \
  |  | 2636|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2636:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3021|      0|            if (!lre_is_space(c))
  ------------------
  |  Branch (3021:17): [True: 0, False: 0]
  ------------------
 3022|      0|                goto no_match;
 3023|      0|            break;
 3024|      0|        case REOP_not_space:
  ------------------
  |  Branch (3024:9): [True: 0, False: 2.02M]
  ------------------
 3025|      0|            if (cptr == cbuf_end)
  ------------------
  |  Branch (3025:17): [True: 0, False: 0]
  ------------------
 3026|      0|                goto no_match;
 3027|      0|            GET_CHAR(c, cptr, cbuf_end, cbuf_type);
  ------------------
  |  | 2622|      0|    do {                                                                \
  |  | 2623|      0|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2623:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2624|      0|            c = *cptr++;                                                \
  |  | 2625|      0|        } else {                                                        \
  |  | 2626|      0|            const uint16_t *_p = (const uint16_t *)cptr;                \
  |  | 2627|      0|            const uint16_t *_end = (const uint16_t *)cbuf_end;          \
  |  | 2628|      0|            c = *_p++;                                                  \
  |  | 2629|      0|            if (is_hi_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2629:17): [True: 0, False: 0]
  |  |  |  Branch (2629:39): [True: 0, False: 0]
  |  |  ------------------
  |  | 2630|      0|                if (_p < _end && is_lo_surrogate(*_p)) {                \
  |  |  ------------------
  |  |  |  Branch (2630:21): [True: 0, False: 0]
  |  |  |  Branch (2630:34): [True: 0, False: 0]
  |  |  ------------------
  |  | 2631|      0|                    c = from_surrogate(c, *_p++);                       \
  |  | 2632|      0|                }                                                       \
  |  | 2633|      0|            }                                                           \
  |  | 2634|      0|            cptr = (const void *)_p;                                    \
  |  | 2635|      0|        }                                                               \
  |  | 2636|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2636:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3028|      0|            if (lre_is_space(c))
  ------------------
  |  Branch (3028:17): [True: 0, False: 0]
  ------------------
 3029|      0|                goto no_match;
 3030|      0|            break;
 3031|  1.00M|        case REOP_save_start:
  ------------------
  |  Branch (3031:9): [True: 1.00M, False: 1.01M]
  ------------------
 3032|  1.00M|        case REOP_save_end:
  ------------------
  |  Branch (3032:9): [True: 4, False: 2.02M]
  ------------------
 3033|  1.00M|            val = *pc++;
 3034|  1.00M|            assert(val < s->capture_count);
  ------------------
  |  Branch (3034:13): [True: 0, False: 1.00M]
  |  Branch (3034:13): [True: 1.00M, False: 0]
  ------------------
 3035|  1.00M|            idx = 2 * val + opcode - REOP_save_start;
 3036|  1.00M|            SAVE_CAPTURE(idx, (uint8_t *)cptr);
  ------------------
  |  | 2806|  1.00M|    {                                                   \
  |  | 2807|  1.00M|        CHECK_STACK_SPACE(2);                           \
  |  |  ------------------
  |  |  |  | 2793|  1.00M|    if (unlikely((stack_end - sp) < (n))) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  1.00M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:25): [True: 0, False: 1.00M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2794|      0|        size_t saved_sp = sp - s->stack_buf;            \
  |  |  |  | 2795|      0|        size_t saved_bp = bp - s->stack_buf;            \
  |  |  |  | 2796|      0|        if (stack_realloc(s, sp - s->stack_buf + (n)))  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2796:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2797|      0|            return LRE_RET_MEMORY_ERROR;                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|      0|#define LRE_RET_MEMORY_ERROR (-1)
  |  |  |  |  ------------------
  |  |  |  | 2798|      0|        stack_end = s->stack_buf + s->stack_size;       \
  |  |  |  | 2799|      0|        sp = s->stack_buf + saved_sp;                   \
  |  |  |  | 2800|      0|        bp = s->stack_buf + saved_bp;                   \
  |  |  |  | 2801|      0|    }
  |  |  ------------------
  |  | 2808|  1.00M|        sp[0].val = idx;                                \
  |  | 2809|  1.00M|        sp[1].ptr = capture[idx];                       \
  |  | 2810|  1.00M|        sp += 2;                                        \
  |  | 2811|  1.00M|        capture[idx] = (value);                         \
  |  | 2812|  1.00M|    }
  ------------------
 3037|  1.00M|            break;
 3038|      0|        case REOP_save_reset:
  ------------------
  |  Branch (3038:9): [True: 0, False: 2.02M]
  ------------------
 3039|      0|            {
 3040|      0|                uint32_t val2;
 3041|      0|                val = pc[0];
 3042|      0|                val2 = pc[1];
 3043|      0|                pc += 2;
 3044|      0|                assert(val2 < s->capture_count);
  ------------------
  |  Branch (3044:17): [True: 0, False: 0]
  |  Branch (3044:17): [True: 0, False: 0]
  ------------------
 3045|      0|                CHECK_STACK_SPACE(2 * (val2 - val + 1));
  ------------------
  |  | 2793|      0|    if (unlikely((stack_end - sp) < (n))) {             \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2794|      0|        size_t saved_sp = sp - s->stack_buf;            \
  |  | 2795|      0|        size_t saved_bp = bp - s->stack_buf;            \
  |  | 2796|      0|        if (stack_realloc(s, sp - s->stack_buf + (n)))  \
  |  |  ------------------
  |  |  |  Branch (2796:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2797|      0|            return LRE_RET_MEMORY_ERROR;                \
  |  |  ------------------
  |  |  |  |   40|      0|#define LRE_RET_MEMORY_ERROR (-1)
  |  |  ------------------
  |  | 2798|      0|        stack_end = s->stack_buf + s->stack_size;       \
  |  | 2799|      0|        sp = s->stack_buf + saved_sp;                   \
  |  | 2800|      0|        bp = s->stack_buf + saved_bp;                   \
  |  | 2801|      0|    }
  ------------------
 3046|      0|                while (val <= val2) {
  ------------------
  |  Branch (3046:24): [True: 0, False: 0]
  ------------------
 3047|      0|                    idx = 2 * val;
 3048|      0|                    SAVE_CAPTURE(idx, NULL);
  ------------------
  |  | 2806|      0|    {                                                   \
  |  | 2807|      0|        CHECK_STACK_SPACE(2);                           \
  |  |  ------------------
  |  |  |  | 2793|      0|    if (unlikely((stack_end - sp) < (n))) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2794|      0|        size_t saved_sp = sp - s->stack_buf;            \
  |  |  |  | 2795|      0|        size_t saved_bp = bp - s->stack_buf;            \
  |  |  |  | 2796|      0|        if (stack_realloc(s, sp - s->stack_buf + (n)))  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2796:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2797|      0|            return LRE_RET_MEMORY_ERROR;                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|      0|#define LRE_RET_MEMORY_ERROR (-1)
  |  |  |  |  ------------------
  |  |  |  | 2798|      0|        stack_end = s->stack_buf + s->stack_size;       \
  |  |  |  | 2799|      0|        sp = s->stack_buf + saved_sp;                   \
  |  |  |  | 2800|      0|        bp = s->stack_buf + saved_bp;                   \
  |  |  |  | 2801|      0|    }
  |  |  ------------------
  |  | 2808|      0|        sp[0].val = idx;                                \
  |  | 2809|      0|        sp[1].ptr = capture[idx];                       \
  |  | 2810|      0|        sp += 2;                                        \
  |  | 2811|      0|        capture[idx] = (value);                         \
  |  | 2812|      0|    }
  ------------------
 3049|      0|                    idx = 2 * val + 1;
 3050|      0|                    SAVE_CAPTURE(idx, NULL);
  ------------------
  |  | 2806|      0|    {                                                   \
  |  | 2807|      0|        CHECK_STACK_SPACE(2);                           \
  |  |  ------------------
  |  |  |  | 2793|      0|    if (unlikely((stack_end - sp) < (n))) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2794|      0|        size_t saved_sp = sp - s->stack_buf;            \
  |  |  |  | 2795|      0|        size_t saved_bp = bp - s->stack_buf;            \
  |  |  |  | 2796|      0|        if (stack_realloc(s, sp - s->stack_buf + (n)))  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2796:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2797|      0|            return LRE_RET_MEMORY_ERROR;                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|      0|#define LRE_RET_MEMORY_ERROR (-1)
  |  |  |  |  ------------------
  |  |  |  | 2798|      0|        stack_end = s->stack_buf + s->stack_size;       \
  |  |  |  | 2799|      0|        sp = s->stack_buf + saved_sp;                   \
  |  |  |  | 2800|      0|        bp = s->stack_buf + saved_bp;                   \
  |  |  |  | 2801|      0|    }
  |  |  ------------------
  |  | 2808|      0|        sp[0].val = idx;                                \
  |  | 2809|      0|        sp[1].ptr = capture[idx];                       \
  |  | 2810|      0|        sp += 2;                                        \
  |  | 2811|      0|        capture[idx] = (value);                         \
  |  | 2812|      0|    }
  ------------------
 3051|      0|                    val++;
 3052|      0|                }
 3053|      0|            }
 3054|      0|            break;
 3055|      0|        case REOP_set_i32:
  ------------------
  |  Branch (3055:9): [True: 0, False: 2.02M]
  ------------------
 3056|      0|            idx = 2 * s->capture_count + pc[0];
 3057|      0|            val = get_u32(pc + 1);
 3058|      0|            pc += 5;
 3059|      0|            SAVE_CAPTURE_CHECK(idx, (void *)(uintptr_t)val);
  ------------------
  |  | 2816|      0|    {                                           \
  |  | 2817|      0|        StackElem *sp1;                         \
  |  | 2818|      0|        sp1 = sp;                               \
  |  | 2819|      0|        for(;;) {                               \
  |  | 2820|      0|            if (sp1 > bp) {                             \
  |  |  ------------------
  |  |  |  Branch (2820:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 2821|      0|                if (sp1[-2].val == idx)                 \
  |  |  ------------------
  |  |  |  Branch (2821:21): [True: 0, False: 0]
  |  |  ------------------
  |  | 2822|      0|                    break;                              \
  |  | 2823|      0|                sp1 -= 2;                               \
  |  | 2824|      0|            } else {                                    \
  |  | 2825|      0|                CHECK_STACK_SPACE(2);                   \
  |  |  ------------------
  |  |  |  | 2793|      0|    if (unlikely((stack_end - sp) < (n))) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2794|      0|        size_t saved_sp = sp - s->stack_buf;            \
  |  |  |  | 2795|      0|        size_t saved_bp = bp - s->stack_buf;            \
  |  |  |  | 2796|      0|        if (stack_realloc(s, sp - s->stack_buf + (n)))  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2796:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2797|      0|            return LRE_RET_MEMORY_ERROR;                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|      0|#define LRE_RET_MEMORY_ERROR (-1)
  |  |  |  |  ------------------
  |  |  |  | 2798|      0|        stack_end = s->stack_buf + s->stack_size;       \
  |  |  |  | 2799|      0|        sp = s->stack_buf + saved_sp;                   \
  |  |  |  | 2800|      0|        bp = s->stack_buf + saved_bp;                   \
  |  |  |  | 2801|      0|    }
  |  |  ------------------
  |  | 2826|      0|                sp[0].val = idx;                        \
  |  | 2827|      0|                sp[1].ptr = capture[idx];               \
  |  | 2828|      0|                sp += 2;                                \
  |  | 2829|      0|                break;                                  \
  |  | 2830|      0|            }                                           \
  |  | 2831|      0|        }                                               \
  |  | 2832|      0|        capture[idx] = (value);                         \
  |  | 2833|      0|    }
  ------------------
 3060|      0|            break;
 3061|      0|        case REOP_loop:
  ------------------
  |  Branch (3061:9): [True: 0, False: 2.02M]
  ------------------
 3062|      0|            {
 3063|      0|                uint32_t val2;
 3064|      0|                idx = 2 * s->capture_count + pc[0];
 3065|      0|                val = get_u32(pc + 1);
 3066|      0|                pc += 5;
 3067|       |
 3068|      0|                val2 = (uintptr_t)capture[idx] - 1;
 3069|      0|                SAVE_CAPTURE_CHECK(idx, (void *)(uintptr_t)val2);
  ------------------
  |  | 2816|      0|    {                                           \
  |  | 2817|      0|        StackElem *sp1;                         \
  |  | 2818|      0|        sp1 = sp;                               \
  |  | 2819|      0|        for(;;) {                               \
  |  | 2820|      0|            if (sp1 > bp) {                             \
  |  |  ------------------
  |  |  |  Branch (2820:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 2821|      0|                if (sp1[-2].val == idx)                 \
  |  |  ------------------
  |  |  |  Branch (2821:21): [True: 0, False: 0]
  |  |  ------------------
  |  | 2822|      0|                    break;                              \
  |  | 2823|      0|                sp1 -= 2;                               \
  |  | 2824|      0|            } else {                                    \
  |  | 2825|      0|                CHECK_STACK_SPACE(2);                   \
  |  |  ------------------
  |  |  |  | 2793|      0|    if (unlikely((stack_end - sp) < (n))) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2794|      0|        size_t saved_sp = sp - s->stack_buf;            \
  |  |  |  | 2795|      0|        size_t saved_bp = bp - s->stack_buf;            \
  |  |  |  | 2796|      0|        if (stack_realloc(s, sp - s->stack_buf + (n)))  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2796:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2797|      0|            return LRE_RET_MEMORY_ERROR;                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|      0|#define LRE_RET_MEMORY_ERROR (-1)
  |  |  |  |  ------------------
  |  |  |  | 2798|      0|        stack_end = s->stack_buf + s->stack_size;       \
  |  |  |  | 2799|      0|        sp = s->stack_buf + saved_sp;                   \
  |  |  |  | 2800|      0|        bp = s->stack_buf + saved_bp;                   \
  |  |  |  | 2801|      0|    }
  |  |  ------------------
  |  | 2826|      0|                sp[0].val = idx;                        \
  |  | 2827|      0|                sp[1].ptr = capture[idx];               \
  |  | 2828|      0|                sp += 2;                                \
  |  | 2829|      0|                break;                                  \
  |  | 2830|      0|            }                                           \
  |  | 2831|      0|        }                                               \
  |  | 2832|      0|        capture[idx] = (value);                         \
  |  | 2833|      0|    }
  ------------------
 3070|      0|                if (val2 != 0) {
  ------------------
  |  Branch (3070:21): [True: 0, False: 0]
  ------------------
 3071|      0|                    pc += (int)val;
 3072|      0|                    if (lre_poll_timeout(s))
  ------------------
  |  Branch (3072:25): [True: 0, False: 0]
  ------------------
 3073|      0|                        return LRE_RET_TIMEOUT;
  ------------------
  |  |   41|      0|#define LRE_RET_TIMEOUT      (-2)
  ------------------
 3074|      0|                }
 3075|      0|            }
 3076|      0|            break;
 3077|      0|        case REOP_loop_split_goto_first:
  ------------------
  |  Branch (3077:9): [True: 0, False: 2.02M]
  ------------------
 3078|      0|        case REOP_loop_split_next_first:
  ------------------
  |  Branch (3078:9): [True: 0, False: 2.02M]
  ------------------
 3079|      0|        case REOP_loop_check_adv_split_goto_first:
  ------------------
  |  Branch (3079:9): [True: 0, False: 2.02M]
  ------------------
 3080|      0|        case REOP_loop_check_adv_split_next_first:
  ------------------
  |  Branch (3080:9): [True: 0, False: 2.02M]
  ------------------
 3081|      0|            {
 3082|      0|                const uint8_t *pc1;
 3083|      0|                uint32_t val2, limit;
 3084|      0|                idx = 2 * s->capture_count + pc[0];
 3085|      0|                limit = get_u32(pc + 1);
 3086|      0|                val = get_u32(pc + 5);
 3087|      0|                pc += 9;
 3088|       |
 3089|       |                /* decrement the counter */
 3090|      0|                val2 = (uintptr_t)capture[idx] - 1;
 3091|      0|                SAVE_CAPTURE_CHECK(idx, (void *)(uintptr_t)val2);
  ------------------
  |  | 2816|      0|    {                                           \
  |  | 2817|      0|        StackElem *sp1;                         \
  |  | 2818|      0|        sp1 = sp;                               \
  |  | 2819|      0|        for(;;) {                               \
  |  | 2820|      0|            if (sp1 > bp) {                             \
  |  |  ------------------
  |  |  |  Branch (2820:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 2821|      0|                if (sp1[-2].val == idx)                 \
  |  |  ------------------
  |  |  |  Branch (2821:21): [True: 0, False: 0]
  |  |  ------------------
  |  | 2822|      0|                    break;                              \
  |  | 2823|      0|                sp1 -= 2;                               \
  |  | 2824|      0|            } else {                                    \
  |  | 2825|      0|                CHECK_STACK_SPACE(2);                   \
  |  |  ------------------
  |  |  |  | 2793|      0|    if (unlikely((stack_end - sp) < (n))) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2794|      0|        size_t saved_sp = sp - s->stack_buf;            \
  |  |  |  | 2795|      0|        size_t saved_bp = bp - s->stack_buf;            \
  |  |  |  | 2796|      0|        if (stack_realloc(s, sp - s->stack_buf + (n)))  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2796:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2797|      0|            return LRE_RET_MEMORY_ERROR;                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|      0|#define LRE_RET_MEMORY_ERROR (-1)
  |  |  |  |  ------------------
  |  |  |  | 2798|      0|        stack_end = s->stack_buf + s->stack_size;       \
  |  |  |  | 2799|      0|        sp = s->stack_buf + saved_sp;                   \
  |  |  |  | 2800|      0|        bp = s->stack_buf + saved_bp;                   \
  |  |  |  | 2801|      0|    }
  |  |  ------------------
  |  | 2826|      0|                sp[0].val = idx;                        \
  |  | 2827|      0|                sp[1].ptr = capture[idx];               \
  |  | 2828|      0|                sp += 2;                                \
  |  | 2829|      0|                break;                                  \
  |  | 2830|      0|            }                                           \
  |  | 2831|      0|        }                                               \
  |  | 2832|      0|        capture[idx] = (value);                         \
  |  | 2833|      0|    }
  ------------------
 3092|       |
 3093|      0|                if (val2 > limit) {
  ------------------
  |  Branch (3093:21): [True: 0, False: 0]
  ------------------
 3094|       |                    /* normal loop if counter > limit */
 3095|      0|                    pc += (int)val;
 3096|      0|                    if (lre_poll_timeout(s))
  ------------------
  |  Branch (3096:25): [True: 0, False: 0]
  ------------------
 3097|      0|                        return LRE_RET_TIMEOUT;
  ------------------
  |  |   41|      0|#define LRE_RET_TIMEOUT      (-2)
  ------------------
 3098|      0|                } else {
 3099|       |                    /* check advance */
 3100|      0|                    if ((opcode == REOP_loop_check_adv_split_goto_first ||
  ------------------
  |  Branch (3100:26): [True: 0, False: 0]
  ------------------
 3101|      0|                         opcode == REOP_loop_check_adv_split_next_first) &&
  ------------------
  |  Branch (3101:26): [True: 0, False: 0]
  ------------------
 3102|      0|                        capture[idx + 1] == cptr &&
  ------------------
  |  Branch (3102:25): [True: 0, False: 0]
  ------------------
 3103|      0|                        val2 != limit) {
  ------------------
  |  Branch (3103:25): [True: 0, False: 0]
  ------------------
 3104|      0|                        goto no_match;
 3105|      0|                    }
 3106|       |                    
 3107|       |                    /* otherwise conditional split */
 3108|      0|                    if (val2 != 0) {
  ------------------
  |  Branch (3108:25): [True: 0, False: 0]
  ------------------
 3109|      0|                        if (opcode == REOP_loop_split_next_first ||
  ------------------
  |  Branch (3109:29): [True: 0, False: 0]
  ------------------
 3110|      0|                            opcode == REOP_loop_check_adv_split_next_first) {
  ------------------
  |  Branch (3110:29): [True: 0, False: 0]
  ------------------
 3111|      0|                            pc1 = pc + (int)val;
 3112|      0|                        } else {
 3113|      0|                            pc1 = pc;
 3114|      0|                            pc = pc + (int)val;
 3115|      0|                        }
 3116|      0|                        CHECK_STACK_SPACE(3);
  ------------------
  |  | 2793|      0|    if (unlikely((stack_end - sp) < (n))) {             \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2794|      0|        size_t saved_sp = sp - s->stack_buf;            \
  |  | 2795|      0|        size_t saved_bp = bp - s->stack_buf;            \
  |  | 2796|      0|        if (stack_realloc(s, sp - s->stack_buf + (n)))  \
  |  |  ------------------
  |  |  |  Branch (2796:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2797|      0|            return LRE_RET_MEMORY_ERROR;                \
  |  |  ------------------
  |  |  |  |   40|      0|#define LRE_RET_MEMORY_ERROR (-1)
  |  |  ------------------
  |  | 2798|      0|        stack_end = s->stack_buf + s->stack_size;       \
  |  | 2799|      0|        sp = s->stack_buf + saved_sp;                   \
  |  | 2800|      0|        bp = s->stack_buf + saved_bp;                   \
  |  | 2801|      0|    }
  ------------------
 3117|      0|                        sp[0].ptr = (uint8_t *)pc1;
 3118|      0|                        sp[1].ptr = (uint8_t *)cptr;
 3119|      0|                        sp[2].bp.val = bp - s->stack_buf;
 3120|      0|                        sp[2].bp.type = RE_EXEC_STATE_SPLIT;
 3121|      0|                        sp += 3;
 3122|      0|                        bp = sp;
 3123|      0|                    }
 3124|      0|                }
 3125|      0|            }
 3126|      0|            break;
 3127|      0|        case REOP_set_char_pos:
  ------------------
  |  Branch (3127:9): [True: 0, False: 2.02M]
  ------------------
 3128|      0|            idx = 2 * s->capture_count + pc[0];
 3129|      0|            pc++;
 3130|      0|            SAVE_CAPTURE_CHECK(idx, (uint8_t *)cptr);
  ------------------
  |  | 2816|      0|    {                                           \
  |  | 2817|      0|        StackElem *sp1;                         \
  |  | 2818|      0|        sp1 = sp;                               \
  |  | 2819|      0|        for(;;) {                               \
  |  | 2820|      0|            if (sp1 > bp) {                             \
  |  |  ------------------
  |  |  |  Branch (2820:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 2821|      0|                if (sp1[-2].val == idx)                 \
  |  |  ------------------
  |  |  |  Branch (2821:21): [True: 0, False: 0]
  |  |  ------------------
  |  | 2822|      0|                    break;                              \
  |  | 2823|      0|                sp1 -= 2;                               \
  |  | 2824|      0|            } else {                                    \
  |  | 2825|      0|                CHECK_STACK_SPACE(2);                   \
  |  |  ------------------
  |  |  |  | 2793|      0|    if (unlikely((stack_end - sp) < (n))) {             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2794|      0|        size_t saved_sp = sp - s->stack_buf;            \
  |  |  |  | 2795|      0|        size_t saved_bp = bp - s->stack_buf;            \
  |  |  |  | 2796|      0|        if (stack_realloc(s, sp - s->stack_buf + (n)))  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2796:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2797|      0|            return LRE_RET_MEMORY_ERROR;                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|      0|#define LRE_RET_MEMORY_ERROR (-1)
  |  |  |  |  ------------------
  |  |  |  | 2798|      0|        stack_end = s->stack_buf + s->stack_size;       \
  |  |  |  | 2799|      0|        sp = s->stack_buf + saved_sp;                   \
  |  |  |  | 2800|      0|        bp = s->stack_buf + saved_bp;                   \
  |  |  |  | 2801|      0|    }
  |  |  ------------------
  |  | 2826|      0|                sp[0].val = idx;                        \
  |  | 2827|      0|                sp[1].ptr = capture[idx];               \
  |  | 2828|      0|                sp += 2;                                \
  |  | 2829|      0|                break;                                  \
  |  | 2830|      0|            }                                           \
  |  | 2831|      0|        }                                               \
  |  | 2832|      0|        capture[idx] = (value);                         \
  |  | 2833|      0|    }
  ------------------
 3131|      0|            break;
 3132|      0|        case REOP_check_advance:
  ------------------
  |  Branch (3132:9): [True: 0, False: 2.02M]
  ------------------
 3133|      0|            idx = 2 * s->capture_count + pc[0];
 3134|      0|            pc++;
 3135|      0|            if (capture[idx] == cptr)
  ------------------
  |  Branch (3135:17): [True: 0, False: 0]
  ------------------
 3136|      0|                goto no_match;
 3137|      0|            break;
 3138|      0|        case REOP_word_boundary:
  ------------------
  |  Branch (3138:9): [True: 0, False: 2.02M]
  ------------------
 3139|      0|        case REOP_word_boundary_i:
  ------------------
  |  Branch (3139:9): [True: 0, False: 2.02M]
  ------------------
 3140|      0|        case REOP_not_word_boundary:
  ------------------
  |  Branch (3140:9): [True: 0, False: 2.02M]
  ------------------
 3141|      0|        case REOP_not_word_boundary_i:
  ------------------
  |  Branch (3141:9): [True: 0, False: 2.02M]
  ------------------
 3142|      0|            {
 3143|      0|                BOOL v1, v2;
 3144|      0|                int ignore_case = (opcode == REOP_word_boundary_i || opcode == REOP_not_word_boundary_i);
  ------------------
  |  Branch (3144:36): [True: 0, False: 0]
  |  Branch (3144:70): [True: 0, False: 0]
  ------------------
 3145|      0|                BOOL is_boundary = (opcode == REOP_word_boundary || opcode == REOP_word_boundary_i);
  ------------------
  |  Branch (3145:37): [True: 0, False: 0]
  |  Branch (3145:69): [True: 0, False: 0]
  ------------------
 3146|       |                /* char before */
 3147|      0|                if (cptr == s->cbuf) {
  ------------------
  |  Branch (3147:21): [True: 0, False: 0]
  ------------------
 3148|      0|                    v1 = FALSE;
 3149|      0|                } else {
 3150|      0|                    PEEK_PREV_CHAR(c, cptr, s->cbuf, cbuf_type);
  ------------------
  |  | 2655|      0|    do {                                                                \
  |  | 2656|      0|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2656:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2657|      0|            c = cptr[-1];                                               \
  |  | 2658|      0|        } else {                                                        \
  |  | 2659|      0|            const uint16_t *_p = (const uint16_t *)cptr - 1;            \
  |  | 2660|      0|            const uint16_t *_start = (const uint16_t *)cbuf_start;      \
  |  | 2661|      0|            c = *_p;                                                    \
  |  | 2662|      0|            if (is_lo_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2662:17): [True: 0, False: 0]
  |  |  |  Branch (2662:39): [True: 0, False: 0]
  |  |  ------------------
  |  | 2663|      0|                if (_p > _start && is_hi_surrogate(_p[-1])) {           \
  |  |  ------------------
  |  |  |  Branch (2663:21): [True: 0, False: 0]
  |  |  |  Branch (2663:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 2664|      0|                    c = from_surrogate(*--_p, c);                       \
  |  | 2665|      0|                }                                                       \
  |  | 2666|      0|            }                                                           \
  |  | 2667|      0|        }                                                               \
  |  | 2668|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2668:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3151|      0|                    if (c < 256) {
  ------------------
  |  Branch (3151:25): [True: 0, False: 0]
  ------------------
 3152|      0|                        v1 = (lre_is_word_byte(c) != 0);
 3153|      0|                    } else {
 3154|      0|                        v1 = ignore_case && (c == 0x017f || c == 0x212a);
  ------------------
  |  Branch (3154:30): [True: 0, False: 0]
  |  Branch (3154:46): [True: 0, False: 0]
  |  Branch (3154:61): [True: 0, False: 0]
  ------------------
 3155|      0|                    }
 3156|      0|                }
 3157|       |                /* current char */
 3158|      0|                if (cptr >= cbuf_end) {
  ------------------
  |  Branch (3158:21): [True: 0, False: 0]
  ------------------
 3159|      0|                    v2 = FALSE;
 3160|      0|                } else {
 3161|      0|                    PEEK_CHAR(c, cptr, cbuf_end, cbuf_type);
  ------------------
  |  | 2639|      0|    do {                                                                \
  |  | 2640|      0|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2640:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2641|      0|            c = cptr[0];                                                \
  |  | 2642|      0|        } else {                                                        \
  |  | 2643|      0|            const uint16_t *_p = (const uint16_t *)cptr;                \
  |  | 2644|      0|            const uint16_t *_end = (const uint16_t *)cbuf_end;          \
  |  | 2645|      0|            c = *_p++;                                                  \
  |  | 2646|      0|            if (is_hi_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2646:17): [True: 0, False: 0]
  |  |  |  Branch (2646:39): [True: 0, False: 0]
  |  |  ------------------
  |  | 2647|      0|                if (_p < _end && is_lo_surrogate(*_p)) {                \
  |  |  ------------------
  |  |  |  Branch (2647:21): [True: 0, False: 0]
  |  |  |  Branch (2647:34): [True: 0, False: 0]
  |  |  ------------------
  |  | 2648|      0|                    c = from_surrogate(c, *_p);                         \
  |  | 2649|      0|                }                                                       \
  |  | 2650|      0|            }                                                           \
  |  | 2651|      0|        }                                                               \
  |  | 2652|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2652:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3162|      0|                    if (c < 256) {
  ------------------
  |  Branch (3162:25): [True: 0, False: 0]
  ------------------
 3163|      0|                        v2 = (lre_is_word_byte(c) != 0);
 3164|      0|                    } else {
 3165|      0|                        v2 = ignore_case && (c == 0x017f || c == 0x212a);
  ------------------
  |  Branch (3165:30): [True: 0, False: 0]
  |  Branch (3165:46): [True: 0, False: 0]
  |  Branch (3165:61): [True: 0, False: 0]
  ------------------
 3166|      0|                    }
 3167|      0|                }
 3168|      0|                if (v1 ^ v2 ^ is_boundary)
  ------------------
  |  Branch (3168:21): [True: 0, False: 0]
  ------------------
 3169|      0|                    goto no_match;
 3170|      0|            }
 3171|      0|            break;
 3172|      0|        case REOP_back_reference:
  ------------------
  |  Branch (3172:9): [True: 0, False: 2.02M]
  ------------------
 3173|      0|        case REOP_back_reference_i:
  ------------------
  |  Branch (3173:9): [True: 0, False: 2.02M]
  ------------------
 3174|      0|        case REOP_backward_back_reference:
  ------------------
  |  Branch (3174:9): [True: 0, False: 2.02M]
  ------------------
 3175|      0|        case REOP_backward_back_reference_i:
  ------------------
  |  Branch (3175:9): [True: 0, False: 2.02M]
  ------------------
 3176|      0|            {
 3177|      0|                const uint8_t *cptr1, *cptr1_end, *cptr1_start;
 3178|      0|                const uint8_t *pc1;
 3179|      0|                uint32_t c1, c2;
 3180|      0|                int i, n;
 3181|       |
 3182|      0|                n = *pc++;
 3183|      0|                pc1 = pc;
 3184|      0|                pc += n;
 3185|       |
 3186|      0|                for(i = 0; i < n; i++) {
  ------------------
  |  Branch (3186:28): [True: 0, False: 0]
  ------------------
 3187|      0|                    val = pc1[i];
 3188|      0|                    if (val >= s->capture_count)
  ------------------
  |  Branch (3188:25): [True: 0, False: 0]
  ------------------
 3189|      0|                        goto no_match;
 3190|      0|                    cptr1_start = capture[2 * val];
 3191|      0|                    cptr1_end = capture[2 * val + 1];
 3192|       |                    /* test the first not empty capture */
 3193|      0|                    if (cptr1_start && cptr1_end) {
  ------------------
  |  Branch (3193:25): [True: 0, False: 0]
  |  Branch (3193:40): [True: 0, False: 0]
  ------------------
 3194|      0|                        if (opcode == REOP_back_reference ||
  ------------------
  |  Branch (3194:29): [True: 0, False: 0]
  ------------------
 3195|      0|                            opcode == REOP_back_reference_i) {
  ------------------
  |  Branch (3195:29): [True: 0, False: 0]
  ------------------
 3196|      0|                            cptr1 = cptr1_start;
 3197|      0|                            while (cptr1 < cptr1_end) {
  ------------------
  |  Branch (3197:36): [True: 0, False: 0]
  ------------------
 3198|      0|                                if (cptr >= cbuf_end)
  ------------------
  |  Branch (3198:37): [True: 0, False: 0]
  ------------------
 3199|      0|                                    goto no_match;
 3200|      0|                                GET_CHAR(c1, cptr1, cptr1_end, cbuf_type);
  ------------------
  |  | 2622|      0|    do {                                                                \
  |  | 2623|      0|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2623:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2624|      0|            c = *cptr++;                                                \
  |  | 2625|      0|        } else {                                                        \
  |  | 2626|      0|            const uint16_t *_p = (const uint16_t *)cptr;                \
  |  | 2627|      0|            const uint16_t *_end = (const uint16_t *)cbuf_end;          \
  |  | 2628|      0|            c = *_p++;                                                  \
  |  | 2629|      0|            if (is_hi_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2629:17): [True: 0, False: 0]
  |  |  |  Branch (2629:39): [True: 0, False: 0]
  |  |  ------------------
  |  | 2630|      0|                if (_p < _end && is_lo_surrogate(*_p)) {                \
  |  |  ------------------
  |  |  |  Branch (2630:21): [True: 0, False: 0]
  |  |  |  Branch (2630:34): [True: 0, False: 0]
  |  |  ------------------
  |  | 2631|      0|                    c = from_surrogate(c, *_p++);                       \
  |  | 2632|      0|                }                                                       \
  |  | 2633|      0|            }                                                           \
  |  | 2634|      0|            cptr = (const void *)_p;                                    \
  |  | 2635|      0|        }                                                               \
  |  | 2636|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2636:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3201|      0|                                GET_CHAR(c2, cptr, cbuf_end, cbuf_type);
  ------------------
  |  | 2622|      0|    do {                                                                \
  |  | 2623|      0|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2623:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2624|      0|            c = *cptr++;                                                \
  |  | 2625|      0|        } else {                                                        \
  |  | 2626|      0|            const uint16_t *_p = (const uint16_t *)cptr;                \
  |  | 2627|      0|            const uint16_t *_end = (const uint16_t *)cbuf_end;          \
  |  | 2628|      0|            c = *_p++;                                                  \
  |  | 2629|      0|            if (is_hi_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2629:17): [True: 0, False: 0]
  |  |  |  Branch (2629:39): [True: 0, False: 0]
  |  |  ------------------
  |  | 2630|      0|                if (_p < _end && is_lo_surrogate(*_p)) {                \
  |  |  ------------------
  |  |  |  Branch (2630:21): [True: 0, False: 0]
  |  |  |  Branch (2630:34): [True: 0, False: 0]
  |  |  ------------------
  |  | 2631|      0|                    c = from_surrogate(c, *_p++);                       \
  |  | 2632|      0|                }                                                       \
  |  | 2633|      0|            }                                                           \
  |  | 2634|      0|            cptr = (const void *)_p;                                    \
  |  | 2635|      0|        }                                                               \
  |  | 2636|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2636:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3202|      0|                                if (opcode == REOP_back_reference_i) {
  ------------------
  |  Branch (3202:37): [True: 0, False: 0]
  ------------------
 3203|      0|                                    c1 = lre_canonicalize(c1, s->is_unicode);
 3204|      0|                                    c2 = lre_canonicalize(c2, s->is_unicode);
 3205|      0|                                }
 3206|      0|                                if (c1 != c2)
  ------------------
  |  Branch (3206:37): [True: 0, False: 0]
  ------------------
 3207|      0|                                    goto no_match;
 3208|      0|                            }
 3209|      0|                        } else {
 3210|      0|                            cptr1 = cptr1_end;
 3211|      0|                            while (cptr1 > cptr1_start) {
  ------------------
  |  Branch (3211:36): [True: 0, False: 0]
  ------------------
 3212|      0|                                if (cptr == s->cbuf)
  ------------------
  |  Branch (3212:37): [True: 0, False: 0]
  ------------------
 3213|      0|                                    goto no_match;
 3214|      0|                                GET_PREV_CHAR(c1, cptr1, cptr1_start, cbuf_type);
  ------------------
  |  | 2671|      0|    do {                                                                \
  |  | 2672|      0|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2672:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2673|      0|            cptr--;                                                     \
  |  | 2674|      0|            c = cptr[0];                                                \
  |  | 2675|      0|        } else {                                                        \
  |  | 2676|      0|            const uint16_t *_p = (const uint16_t *)cptr - 1;            \
  |  | 2677|      0|            const uint16_t *_start = (const uint16_t *)cbuf_start;      \
  |  | 2678|      0|            c = *_p;                                                    \
  |  | 2679|      0|            if (is_lo_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2679:17): [True: 0, False: 0]
  |  |  |  Branch (2679:39): [True: 0, False: 0]
  |  |  ------------------
  |  | 2680|      0|                if (_p > _start && is_hi_surrogate(_p[-1])) {           \
  |  |  ------------------
  |  |  |  Branch (2680:21): [True: 0, False: 0]
  |  |  |  Branch (2680:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 2681|      0|                    c = from_surrogate(*--_p, c);                       \
  |  | 2682|      0|                }                                                       \
  |  | 2683|      0|            }                                                           \
  |  | 2684|      0|            cptr = (const void *)_p;                                    \
  |  | 2685|      0|        }                                                               \
  |  | 2686|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2686:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3215|      0|                                GET_PREV_CHAR(c2, cptr, s->cbuf, cbuf_type);
  ------------------
  |  | 2671|      0|    do {                                                                \
  |  | 2672|      0|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2672:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2673|      0|            cptr--;                                                     \
  |  | 2674|      0|            c = cptr[0];                                                \
  |  | 2675|      0|        } else {                                                        \
  |  | 2676|      0|            const uint16_t *_p = (const uint16_t *)cptr - 1;            \
  |  | 2677|      0|            const uint16_t *_start = (const uint16_t *)cbuf_start;      \
  |  | 2678|      0|            c = *_p;                                                    \
  |  | 2679|      0|            if (is_lo_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2679:17): [True: 0, False: 0]
  |  |  |  Branch (2679:39): [True: 0, False: 0]
  |  |  ------------------
  |  | 2680|      0|                if (_p > _start && is_hi_surrogate(_p[-1])) {           \
  |  |  ------------------
  |  |  |  Branch (2680:21): [True: 0, False: 0]
  |  |  |  Branch (2680:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 2681|      0|                    c = from_surrogate(*--_p, c);                       \
  |  | 2682|      0|                }                                                       \
  |  | 2683|      0|            }                                                           \
  |  | 2684|      0|            cptr = (const void *)_p;                                    \
  |  | 2685|      0|        }                                                               \
  |  | 2686|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2686:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3216|      0|                                if (opcode == REOP_backward_back_reference_i) {
  ------------------
  |  Branch (3216:37): [True: 0, False: 0]
  ------------------
 3217|      0|                                    c1 = lre_canonicalize(c1, s->is_unicode);
 3218|      0|                                    c2 = lre_canonicalize(c2, s->is_unicode);
 3219|      0|                                }
 3220|      0|                                if (c1 != c2)
  ------------------
  |  Branch (3220:37): [True: 0, False: 0]
  ------------------
 3221|      0|                                    goto no_match;
 3222|      0|                            }
 3223|      0|                        }
 3224|      0|                        break;
 3225|      0|                    }
 3226|      0|                }
 3227|      0|            }
 3228|      0|            break;
 3229|      0|        case REOP_range:
  ------------------
  |  Branch (3229:9): [True: 0, False: 2.02M]
  ------------------
 3230|      0|        case REOP_range_i:
  ------------------
  |  Branch (3230:9): [True: 0, False: 2.02M]
  ------------------
 3231|      0|            {
 3232|      0|                int n;
 3233|      0|                uint32_t low, high, idx_min, idx_max, idx;
 3234|       |
 3235|      0|                n = get_u16(pc); /* n must be >= 1 */
 3236|      0|                pc += 2;
 3237|      0|                if (cptr >= cbuf_end)
  ------------------
  |  Branch (3237:21): [True: 0, False: 0]
  ------------------
 3238|      0|                    goto no_match;
 3239|      0|                GET_CHAR(c, cptr, cbuf_end, cbuf_type);
  ------------------
  |  | 2622|      0|    do {                                                                \
  |  | 2623|      0|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2623:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2624|      0|            c = *cptr++;                                                \
  |  | 2625|      0|        } else {                                                        \
  |  | 2626|      0|            const uint16_t *_p = (const uint16_t *)cptr;                \
  |  | 2627|      0|            const uint16_t *_end = (const uint16_t *)cbuf_end;          \
  |  | 2628|      0|            c = *_p++;                                                  \
  |  | 2629|      0|            if (is_hi_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2629:17): [True: 0, False: 0]
  |  |  |  Branch (2629:39): [True: 0, False: 0]
  |  |  ------------------
  |  | 2630|      0|                if (_p < _end && is_lo_surrogate(*_p)) {                \
  |  |  ------------------
  |  |  |  Branch (2630:21): [True: 0, False: 0]
  |  |  |  Branch (2630:34): [True: 0, False: 0]
  |  |  ------------------
  |  | 2631|      0|                    c = from_surrogate(c, *_p++);                       \
  |  | 2632|      0|                }                                                       \
  |  | 2633|      0|            }                                                           \
  |  | 2634|      0|            cptr = (const void *)_p;                                    \
  |  | 2635|      0|        }                                                               \
  |  | 2636|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2636:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3240|      0|                if (opcode == REOP_range_i) {
  ------------------
  |  Branch (3240:21): [True: 0, False: 0]
  ------------------
 3241|      0|                    c = lre_canonicalize(c, s->is_unicode);
 3242|      0|                }
 3243|      0|                idx_min = 0;
 3244|      0|                low = get_u16(pc + 0 * 4);
 3245|      0|                if (c < low)
  ------------------
  |  Branch (3245:21): [True: 0, False: 0]
  ------------------
 3246|      0|                    goto no_match;
 3247|      0|                idx_max = n - 1;
 3248|      0|                high = get_u16(pc + idx_max * 4 + 2);
 3249|       |                /* 0xffff in for last value means +infinity */
 3250|      0|                if (unlikely(c >= 0xffff) && high == 0xffff)
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3250:46): [True: 0, False: 0]
  ------------------
 3251|      0|                    goto range_match;
 3252|      0|                if (c > high)
  ------------------
  |  Branch (3252:21): [True: 0, False: 0]
  ------------------
 3253|      0|                    goto no_match;
 3254|      0|                while (idx_min <= idx_max) {
  ------------------
  |  Branch (3254:24): [True: 0, False: 0]
  ------------------
 3255|      0|                    idx = (idx_min + idx_max) / 2;
 3256|      0|                    low = get_u16(pc + idx * 4);
 3257|      0|                    high = get_u16(pc + idx * 4 + 2);
 3258|      0|                    if (c < low)
  ------------------
  |  Branch (3258:25): [True: 0, False: 0]
  ------------------
 3259|      0|                        idx_max = idx - 1;
 3260|      0|                    else if (c > high)
  ------------------
  |  Branch (3260:30): [True: 0, False: 0]
  ------------------
 3261|      0|                        idx_min = idx + 1;
 3262|      0|                    else
 3263|      0|                        goto range_match;
 3264|      0|                }
 3265|      0|                goto no_match;
 3266|      0|            range_match:
 3267|      0|                pc += 4 * n;
 3268|      0|            }
 3269|      0|            break;
 3270|      0|        case REOP_range32:
  ------------------
  |  Branch (3270:9): [True: 0, False: 2.02M]
  ------------------
 3271|      0|        case REOP_range32_i:
  ------------------
  |  Branch (3271:9): [True: 0, False: 2.02M]
  ------------------
 3272|      0|            {
 3273|      0|                int n;
 3274|      0|                uint32_t low, high, idx_min, idx_max, idx;
 3275|       |
 3276|      0|                n = get_u16(pc); /* n must be >= 1 */
 3277|      0|                pc += 2;
 3278|      0|                if (cptr >= cbuf_end)
  ------------------
  |  Branch (3278:21): [True: 0, False: 0]
  ------------------
 3279|      0|                    goto no_match;
 3280|      0|                GET_CHAR(c, cptr, cbuf_end, cbuf_type);
  ------------------
  |  | 2622|      0|    do {                                                                \
  |  | 2623|      0|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2623:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2624|      0|            c = *cptr++;                                                \
  |  | 2625|      0|        } else {                                                        \
  |  | 2626|      0|            const uint16_t *_p = (const uint16_t *)cptr;                \
  |  | 2627|      0|            const uint16_t *_end = (const uint16_t *)cbuf_end;          \
  |  | 2628|      0|            c = *_p++;                                                  \
  |  | 2629|      0|            if (is_hi_surrogate(c) && cbuf_type == 2) {                 \
  |  |  ------------------
  |  |  |  Branch (2629:17): [True: 0, False: 0]
  |  |  |  Branch (2629:39): [True: 0, False: 0]
  |  |  ------------------
  |  | 2630|      0|                if (_p < _end && is_lo_surrogate(*_p)) {                \
  |  |  ------------------
  |  |  |  Branch (2630:21): [True: 0, False: 0]
  |  |  |  Branch (2630:34): [True: 0, False: 0]
  |  |  ------------------
  |  | 2631|      0|                    c = from_surrogate(c, *_p++);                       \
  |  | 2632|      0|                }                                                       \
  |  | 2633|      0|            }                                                           \
  |  | 2634|      0|            cptr = (const void *)_p;                                    \
  |  | 2635|      0|        }                                                               \
  |  | 2636|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2636:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3281|      0|                if (opcode == REOP_range32_i) {
  ------------------
  |  Branch (3281:21): [True: 0, False: 0]
  ------------------
 3282|      0|                    c = lre_canonicalize(c, s->is_unicode);
 3283|      0|                }
 3284|      0|                idx_min = 0;
 3285|      0|                low = get_u32(pc + 0 * 8);
 3286|      0|                if (c < low)
  ------------------
  |  Branch (3286:21): [True: 0, False: 0]
  ------------------
 3287|      0|                    goto no_match;
 3288|      0|                idx_max = n - 1;
 3289|      0|                high = get_u32(pc + idx_max * 8 + 4);
 3290|      0|                if (c > high)
  ------------------
  |  Branch (3290:21): [True: 0, False: 0]
  ------------------
 3291|      0|                    goto no_match;
 3292|      0|                while (idx_min <= idx_max) {
  ------------------
  |  Branch (3292:24): [True: 0, False: 0]
  ------------------
 3293|      0|                    idx = (idx_min + idx_max) / 2;
 3294|      0|                    low = get_u32(pc + idx * 8);
 3295|      0|                    high = get_u32(pc + idx * 8 + 4);
 3296|      0|                    if (c < low)
  ------------------
  |  Branch (3296:25): [True: 0, False: 0]
  ------------------
 3297|      0|                        idx_max = idx - 1;
 3298|      0|                    else if (c > high)
  ------------------
  |  Branch (3298:30): [True: 0, False: 0]
  ------------------
 3299|      0|                        idx_min = idx + 1;
 3300|      0|                    else
 3301|      0|                        goto range32_match;
 3302|      0|                }
 3303|      0|                goto no_match;
 3304|      0|            range32_match:
 3305|      0|                pc += 8 * n;
 3306|      0|            }
 3307|      0|            break;
 3308|      0|        case REOP_prev:
  ------------------
  |  Branch (3308:9): [True: 0, False: 2.02M]
  ------------------
 3309|       |            /* go to the previous char */
 3310|      0|            if (cptr == s->cbuf)
  ------------------
  |  Branch (3310:17): [True: 0, False: 0]
  ------------------
 3311|      0|                goto no_match;
 3312|      0|            PREV_CHAR(cptr, s->cbuf, cbuf_type);
  ------------------
  |  | 2689|      0|    do {                                                                \
  |  | 2690|      0|        if (cbuf_type == 0) {                                           \
  |  |  ------------------
  |  |  |  Branch (2690:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2691|      0|            cptr--;                                                     \
  |  | 2692|      0|        } else {                                                        \
  |  | 2693|      0|            const uint16_t *_p = (const uint16_t *)cptr - 1;            \
  |  | 2694|      0|            const uint16_t *_start = (const uint16_t *)cbuf_start;      \
  |  | 2695|      0|            if (is_lo_surrogate(*_p) && cbuf_type == 2) {               \
  |  |  ------------------
  |  |  |  Branch (2695:17): [True: 0, False: 0]
  |  |  |  Branch (2695:41): [True: 0, False: 0]
  |  |  ------------------
  |  | 2696|      0|                if (_p > _start && is_hi_surrogate(_p[-1])) {           \
  |  |  ------------------
  |  |  |  Branch (2696:21): [True: 0, False: 0]
  |  |  |  Branch (2696:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 2697|      0|                    --_p;                                               \
  |  | 2698|      0|                }                                                       \
  |  | 2699|      0|            }                                                           \
  |  | 2700|      0|            cptr = (const void *)_p;                                    \
  |  | 2701|      0|        }                                                               \
  |  | 2702|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (2702:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3313|      0|            break;
 3314|      0|        default:
  ------------------
  |  Branch (3314:9): [True: 0, False: 2.02M]
  ------------------
 3315|       |#ifdef DUMP_EXEC
 3316|       |            printf("unknown opcode pc=%ld\n", pc - 1 - pc_start);
 3317|       |#endif            
 3318|      0|            abort();
 3319|  2.02M|        }
 3320|  2.02M|    }
 3321|  1.00M|}
libregexp.c:is_line_terminator:
 2617|  1.00M|{
 2618|  1.00M|    return (c == '\n' || c == '\r' || c == CP_LS || c == CP_PS);
  ------------------
  |  |   66|  1.01M|#define CP_LS   0x2028
  ------------------
                  return (c == '\n' || c == '\r' || c == CP_LS || c == CP_PS);
  ------------------
  |  |   67|    970|#define CP_PS   0x2029
  ------------------
  |  Branch (2618:13): [True: 1.00M, False: 970]
  |  Branch (2618:26): [True: 0, False: 970]
  |  Branch (2618:39): [True: 0, False: 970]
  |  Branch (2618:53): [True: 0, False: 970]
  ------------------
 2619|  1.00M|}

lre_is_id_start:
  747|     31|{
  748|     31|    return lre_is_in_table(c, unicode_prop_ID_Start_table,
  749|     31|                           unicode_prop_ID_Start_index,
  750|     31|                           sizeof(unicode_prop_ID_Start_index) / 3);
  751|     31|}
lre_is_id_continue:
  754|     28|{
  755|     28|    return lre_is_id_start(c) ||
  ------------------
  |  Branch (755:12): [True: 28, False: 0]
  ------------------
  756|      0|        lre_is_in_table(c, unicode_prop_ID_Continue1_table,
  ------------------
  |  Branch (756:9): [True: 0, False: 0]
  ------------------
  757|      0|                        unicode_prop_ID_Continue1_index,
  758|      0|                        sizeof(unicode_prop_ID_Continue1_index) / 3);
  759|     28|}
lre_is_space_non_ascii:
 1904|      1|{
 1905|      1|    size_t i, n;
 1906|       |
 1907|      1|    n = countof(char_range_s);
  ------------------
  |  |   47|      1|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 1908|      9|    for(i = 5; i < n; i += 2) {
  ------------------
  |  Branch (1908:16): [True: 8, False: 1]
  ------------------
 1909|      8|        uint32_t low = char_range_s[i];
 1910|      8|        uint32_t high = char_range_s[i + 1];
 1911|      8|        if (c < low)
  ------------------
  |  Branch (1911:13): [True: 0, False: 8]
  ------------------
 1912|      0|            return FALSE;
 1913|      8|        if (c < high)
  ------------------
  |  Branch (1913:13): [True: 0, False: 8]
  ------------------
 1914|      0|            return TRUE;
 1915|      8|    }
 1916|      1|    return FALSE;
 1917|      1|}
libunicode.c:lre_is_in_table:
  306|     31|{
  307|     31|    uint32_t code, b, bit;
  308|     31|    int pos;
  309|     31|    const uint8_t *p;
  310|       |
  311|     31|    pos = get_index_pos(&code, c, index_table, index_table_len);
  312|     31|    if (pos < 0)
  ------------------
  |  Branch (312:9): [True: 1, False: 30]
  ------------------
  313|      1|        return FALSE; /* outside the table */
  314|     30|    p = table + pos;
  315|     30|    bit = 0;
  316|       |    /* Compressed run length encoding:
  317|       |       00..3F: 2 packed lengths: 3-bit + 3-bit
  318|       |       40..5F: 5-bits plus extra byte for length
  319|       |       60..7F: 5-bits plus 2 extra bytes for length
  320|       |       80..FF: 7-bit length
  321|       |       lengths must be incremented to get character count
  322|       |       Ranges alternate between false and true return value.
  323|       |     */
  324|    344|    for(;;) {
  325|    344|        b = *p++;
  326|    344|        if (b < 64) {
  ------------------
  |  Branch (326:13): [True: 56, False: 288]
  ------------------
  327|     56|            code += (b >> 3) + 1;
  328|     56|            if (c < code)
  ------------------
  |  Branch (328:17): [True: 0, False: 56]
  ------------------
  329|      0|                return bit;
  330|     56|            bit ^= 1;
  331|     56|            code += (b & 7) + 1;
  332|    288|        } else if (b >= 0x80) {
  ------------------
  |  Branch (332:20): [True: 284, False: 4]
  ------------------
  333|    284|            code += b - 0x80 + 1;
  334|    284|        } else if (b < 0x60) {
  ------------------
  |  Branch (334:20): [True: 2, False: 2]
  ------------------
  335|      2|            code += (((b - 0x40) << 8) | p[0]) + 1;
  336|      2|            p++;
  337|      2|        } else {
  338|      2|            code += (((b - 0x60) << 16) | (p[0] << 8) | p[1]) + 1;
  339|      2|            p += 2;
  340|      2|        }
  341|    344|        if (c < code)
  ------------------
  |  Branch (341:13): [True: 30, False: 314]
  ------------------
  342|     30|            return bit;
  343|    314|        bit ^= 1;
  344|    314|    }
  345|     30|}
libunicode.c:get_index_pos:
  273|     31|{
  274|     31|    uint32_t code, v;
  275|     31|    int idx_min, idx_max, idx;
  276|       |
  277|     31|    idx_min = 0;
  278|     31|    v = get_le24(index_table);
  279|     31|    code = v & ((1 << 21) - 1);
  280|     31|    if (c < code) {
  ------------------
  |  Branch (280:9): [True: 26, False: 5]
  ------------------
  281|     26|        *pcode = 0;
  282|     26|        return 0;
  283|     26|    }
  284|      5|    idx_max = index_table_len - 1;
  285|      5|    code = get_le24(index_table + idx_max * 3);
  286|      5|    if (c >= code)
  ------------------
  |  Branch (286:9): [True: 1, False: 4]
  ------------------
  287|      1|        return -1;
  288|       |    /* invariant: tab[idx_min] <= c < tab2[idx_max] */
  289|     26|    while ((idx_max - idx_min) > 1) {
  ------------------
  |  Branch (289:12): [True: 22, False: 4]
  ------------------
  290|     22|        idx = (idx_max + idx_min) / 2;
  291|     22|        v = get_le24(index_table + idx * 3);
  292|     22|        code = v & ((1 << 21) - 1);
  293|     22|        if (c < code) {
  ------------------
  |  Branch (293:13): [True: 10, False: 12]
  ------------------
  294|     10|            idx_max = idx;
  295|     12|        } else {
  296|     12|            idx_min = idx;
  297|     12|        }
  298|     22|    }
  299|      4|    v = get_le24(index_table + idx_min * 3);
  300|      4|    *pcode = v & ((1 << 21) - 1);
  301|      4|    return (idx_min + 1) * UNICODE_INDEX_BLOCK_LEN + (v >> 21);
  ------------------
  |  |  268|      4|#define UNICODE_INDEX_BLOCK_LEN 32
  ------------------
  302|      5|}
libunicode.c:get_le24:
  264|     62|{
  265|     62|    return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16);
  266|     62|}

quickjs.c:lre_is_space:
  162|    185|static inline int lre_is_space(uint32_t c) {
  163|    185|    if (c < 256)
  ------------------
  |  Branch (163:9): [True: 184, False: 1]
  ------------------
  164|    184|        return lre_is_space_byte(c);
  165|      1|    else
  166|      1|        return lre_is_space_non_ascii(c);
  167|    185|}
quickjs.c:lre_is_space_byte:
  140|    184|static inline int lre_is_space_byte(uint8_t c) {
  141|    184|    return lre_ctype_bits[c] & UNICODE_C_SPACE;
  142|    184|}
quickjs.c:lre_js_is_ident_next:
  181|  2.09M|static inline int lre_js_is_ident_next(uint32_t c) {
  182|  2.09M|    if (c < 128) {
  ------------------
  |  Branch (182:9): [True: 2.09M, False: 28]
  ------------------
  183|  2.09M|        return lre_is_id_continue_byte(c);
  184|  2.09M|    } else {
  185|       |        /* ZWNJ and ZWJ are accepted in identifiers */
  186|     28|        if (c >= 0x200C && c <= 0x200D)
  ------------------
  |  Branch (186:13): [True: 2, False: 26]
  |  Branch (186:28): [True: 0, False: 2]
  ------------------
  187|      0|            return TRUE;
  188|     28|#ifdef CONFIG_ALL_UNICODE
  189|     28|        return lre_is_id_continue(c);
  190|       |#else
  191|       |        return !lre_is_space_non_ascii(c);
  192|       |#endif
  193|     28|    }
  194|  2.09M|}
quickjs.c:lre_is_id_continue_byte:
  149|  2.09M|static inline int lre_is_id_continue_byte(uint8_t c) {
  150|  2.09M|    return lre_ctype_bits[c] & (UNICODE_C_UPPER | UNICODE_C_LOWER |
  151|  2.09M|                                UNICODE_C_UNDER | UNICODE_C_DOLLAR |
  152|  2.09M|                                UNICODE_C_DIGIT);
  153|  2.09M|}
quickjs.c:lre_js_is_ident_first:
  169|    185|static inline int lre_js_is_ident_first(uint32_t c) {
  170|    185|    if (c < 128) {
  ------------------
  |  Branch (170:9): [True: 182, False: 3]
  ------------------
  171|    182|        return lre_is_id_start_byte(c);
  172|    182|    } else {
  173|      3|#ifdef CONFIG_ALL_UNICODE
  174|      3|        return lre_is_id_start(c);
  175|       |#else
  176|       |        return !lre_is_space_non_ascii(c);
  177|       |#endif
  178|      3|    }
  179|    185|}
quickjs.c:lre_is_id_start_byte:
  144|    182|static inline int lre_is_id_start_byte(uint8_t c) {
  145|    182|    return lre_ctype_bits[c] & (UNICODE_C_UPPER | UNICODE_C_LOWER |
  146|    182|                                UNICODE_C_UNDER | UNICODE_C_DOLLAR);
  147|    182|}

quickjs.c:init_list_head:
   42|  1.33k|{
   43|  1.33k|    head->prev = head;
   44|  1.33k|    head->next = head;
   45|  1.33k|}
quickjs.c:list_empty:
   81|     36|{
   82|     36|    return el->next == el;
   83|     36|}
quickjs.c:list_del:
   70|  42.9k|{
   71|  42.9k|    struct list_head *prev, *next;
   72|  42.9k|    prev = el->prev;
   73|  42.9k|    next = el->next;
   74|  42.9k|    prev->next = next;
   75|  42.9k|    next->prev = prev;
   76|  42.9k|    el->prev = NULL; /* fail safe */
   77|       |    el->next = NULL; /* fail safe */
   78|  42.9k|}
quickjs.c:list_add_tail:
   65|  41.5k|{
   66|  41.5k|    __list_add(el, head->prev, head);
   67|  41.5k|}
quickjs.c:__list_add:
   50|  46.0k|{
   51|  46.0k|    prev->next = el;
   52|  46.0k|    el->prev = prev;
   53|  46.0k|    el->next = next;
   54|  46.0k|    next->prev = el;
   55|  46.0k|}
quickjs.c:list_add:
   59|  4.41k|{
   60|  4.41k|    __list_add(el, head, head->next);
   61|  4.41k|}
quickjs-libc.c:list_empty:
   81|      8|{
   82|      8|    return el->next == el;
   83|      8|}
quickjs-libc.c:init_list_head:
   42|     85|{
   43|     85|    head->prev = head;
   44|     85|    head->next = head;
   45|     85|}

js_module_set_import_meta:
  550|     17|{
  551|     17|    JSModuleDef *m;
  552|     17|    char buf[PATH_MAX + 16];
  553|     17|    JSValue meta_obj;
  554|     17|    JSAtom module_name_atom;
  555|     17|    const char *module_name;
  556|       |
  557|     17|    assert(JS_VALUE_GET_TAG(func_val) == JS_TAG_MODULE);
  ------------------
  |  Branch (557:5): [True: 0, False: 17]
  |  Branch (557:5): [True: 17, False: 0]
  ------------------
  558|     17|    m = JS_VALUE_GET_PTR(func_val);
  ------------------
  |  |  243|     17|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  559|       |
  560|     17|    module_name_atom = JS_GetModuleName(ctx, m);
  561|     17|    module_name = JS_AtomToCString(ctx, module_name_atom);
  562|     17|    JS_FreeAtom(ctx, module_name_atom);
  563|     17|    if (!module_name)
  ------------------
  |  Branch (563:9): [True: 0, False: 17]
  ------------------
  564|      0|        return -1;
  565|     17|    if (!strchr(module_name, ':')) {
  ------------------
  |  Branch (565:9): [True: 17, False: 0]
  ------------------
  566|     17|        strcpy(buf, "file://");
  567|     17|#if !defined(_WIN32)
  568|       |        /* realpath() cannot be used with modules compiled with qjsc
  569|       |           because the corresponding module source code is not
  570|       |           necessarily present */
  571|     17|        if (use_realpath) {
  ------------------
  |  Branch (571:13): [True: 17, False: 0]
  ------------------
  572|     17|            char *res = realpath(module_name, buf + strlen(buf));
  573|     17|            if (!res) {
  ------------------
  |  Branch (573:17): [True: 17, False: 0]
  ------------------
  574|     17|                JS_ThrowTypeError(ctx, "realpath failure");
  575|     17|                JS_FreeCString(ctx, module_name);
  576|     17|                return -1;
  577|     17|            }
  578|     17|        } else
  579|      0|#endif
  580|      0|        {
  581|      0|            pstrcat(buf, sizeof(buf), module_name);
  582|      0|        }
  583|     17|    } else {
  584|      0|        pstrcpy(buf, sizeof(buf), module_name);
  585|      0|    }
  586|      0|    JS_FreeCString(ctx, module_name);
  587|       |
  588|      0|    meta_obj = JS_GetImportMeta(ctx, m);
  589|      0|    if (JS_IsException(meta_obj))
  ------------------
  |  Branch (589:9): [True: 0, False: 0]
  ------------------
  590|      0|        return -1;
  591|      0|    JS_DefinePropertyValueStr(ctx, meta_obj, "url",
  592|      0|                              JS_NewString(ctx, buf),
  593|      0|                              JS_PROP_C_W_E);
  ------------------
  |  |  301|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
  594|      0|    JS_DefinePropertyValueStr(ctx, meta_obj, "main",
  595|      0|                              JS_NewBool(ctx, is_main),
  596|      0|                              JS_PROP_C_W_E);
  ------------------
  |  |  301|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
  597|      0|    JS_FreeValue(ctx, meta_obj);
  598|      0|    return 0;
  599|      0|}
js_init_module_std:
 1720|     17|{
 1721|     17|    JSModuleDef *m;
 1722|     17|    m = JS_NewCModule(ctx, module_name, js_std_init);
 1723|     17|    if (!m)
  ------------------
  |  Branch (1723:9): [True: 0, False: 17]
  ------------------
 1724|      0|        return NULL;
 1725|     17|    JS_AddModuleExportList(ctx, m, js_std_funcs, countof(js_std_funcs));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 1726|     17|    JS_AddModuleExport(ctx, m, "in");
 1727|     17|    JS_AddModuleExport(ctx, m, "out");
 1728|     17|    JS_AddModuleExport(ctx, m, "err");
 1729|     17|    return m;
 1730|     17|}
js_init_module_os:
 4049|     17|{
 4050|     17|    JSModuleDef *m;
 4051|     17|    m = JS_NewCModule(ctx, module_name, js_os_init);
 4052|     17|    if (!m)
  ------------------
  |  Branch (4052:9): [True: 0, False: 17]
  ------------------
 4053|      0|        return NULL;
 4054|     17|    JS_AddModuleExportList(ctx, m, js_os_funcs, countof(js_os_funcs));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 4055|       |#ifdef USE_WORKER
 4056|       |    JS_AddModuleExport(ctx, m, "Worker");
 4057|       |#endif
 4058|     17|    return m;
 4059|     17|}
js_std_add_helpers:
 4099|     17|{
 4100|     17|    JSValue global_obj, console, args, performance;
 4101|     17|    int i;
 4102|       |
 4103|       |    /* XXX: should these global definitions be enumerable? */
 4104|     17|    global_obj = JS_GetGlobalObject(ctx);
 4105|       |
 4106|     17|    console = JS_NewObject(ctx);
 4107|     17|    JS_SetPropertyStr(ctx, console, "log",
 4108|     17|                      JS_NewCFunction(ctx, js_console_log, "log", 1));
 4109|     17|    JS_SetPropertyStr(ctx, global_obj, "console", console);
 4110|       |
 4111|     17|    performance = JS_NewObject(ctx);
 4112|     17|    JS_SetPropertyStr(ctx, performance, "now",
 4113|     17|                      JS_NewCFunction(ctx, js_os_now, "now", 0));
 4114|     17|    JS_SetPropertyStr(ctx, global_obj, "performance", performance);
 4115|       |
 4116|       |    /* same methods as the mozilla JS shell */
 4117|     17|    if (argc >= 0) {
  ------------------
  |  Branch (4117:9): [True: 17, False: 0]
  ------------------
 4118|     17|        args = JS_NewArray(ctx);
 4119|     17|        for(i = 0; i < argc; i++) {
  ------------------
  |  Branch (4119:20): [True: 0, False: 17]
  ------------------
 4120|      0|            JS_SetPropertyUint32(ctx, args, i, JS_NewString(ctx, argv[i]));
 4121|      0|        }
 4122|     17|        JS_SetPropertyStr(ctx, global_obj, "scriptArgs", args);
 4123|     17|    }
 4124|       |
 4125|     17|    JS_SetPropertyStr(ctx, global_obj, "print",
 4126|     17|                      JS_NewCFunction(ctx, js_print, "print", 1));
 4127|     17|    JS_SetPropertyStr(ctx, global_obj, "__loadScript",
 4128|     17|                      JS_NewCFunction(ctx, js_loadScript, "__loadScript", 1));
 4129|       |
 4130|     17|    JS_FreeValue(ctx, global_obj);
 4131|     17|}
js_std_init_handlers:
 4134|     17|{
 4135|     17|    JSThreadState *ts;
 4136|       |
 4137|     17|    ts = malloc(sizeof(*ts));
 4138|     17|    if (!ts) {
  ------------------
  |  Branch (4138:9): [True: 0, False: 17]
  ------------------
 4139|      0|        fprintf(stderr, "Could not allocate memory for the worker");
 4140|      0|        exit(1);
 4141|      0|    }
 4142|     17|    memset(ts, 0, sizeof(*ts));
 4143|     17|    init_list_head(&ts->os_rw_handlers);
 4144|     17|    init_list_head(&ts->os_signal_handlers);
 4145|     17|    init_list_head(&ts->os_timers);
 4146|     17|    init_list_head(&ts->port_list);
 4147|     17|    init_list_head(&ts->rejected_promise_list);
 4148|     17|    ts->next_timer_id = 1;
 4149|       |
 4150|     17|    JS_SetRuntimeOpaque(rt, ts);
 4151|       |
 4152|       |#ifdef USE_WORKER
 4153|       |    /* set the SharedArrayBuffer memory handlers */
 4154|       |    {
 4155|       |        JSSharedArrayBufferFunctions sf;
 4156|       |        memset(&sf, 0, sizeof(sf));
 4157|       |        sf.sab_alloc = js_sab_alloc;
 4158|       |        sf.sab_free = js_sab_free;
 4159|       |        sf.sab_dup = js_sab_dup;
 4160|       |        JS_SetSharedArrayBufferFunctions(rt, &sf);
 4161|       |    }
 4162|       |#endif
 4163|     17|}
js_std_free_handlers:
 4166|     17|{
 4167|     17|    JSThreadState *ts = JS_GetRuntimeOpaque(rt);
 4168|     17|    struct list_head *el, *el1;
 4169|       |
 4170|     17|    list_for_each_safe(el, el1, &ts->os_rw_handlers) {
  ------------------
  |  |   89|     17|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 17]
  |  |  ------------------
  |  |   90|     17|        el = el1, el1 = el->next)
  ------------------
 4171|      0|        JSOSRWHandler *rh = list_entry(el, JSOSRWHandler, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|      0|#define offsetof(type, field) ((size_t) &((type *)0)->field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4172|      0|        free_rw_handler(rt, rh);
 4173|      0|    }
 4174|       |
 4175|     17|    list_for_each_safe(el, el1, &ts->os_signal_handlers) {
  ------------------
  |  |   89|     17|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 17]
  |  |  ------------------
  |  |   90|     17|        el = el1, el1 = el->next)
  ------------------
 4176|      0|        JSOSSignalHandler *sh = list_entry(el, JSOSSignalHandler, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|      0|#define offsetof(type, field) ((size_t) &((type *)0)->field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4177|      0|        free_sh(rt, sh);
 4178|      0|    }
 4179|       |
 4180|     17|    list_for_each_safe(el, el1, &ts->os_timers) {
  ------------------
  |  |   89|     17|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 17]
  |  |  ------------------
  |  |   90|     17|        el = el1, el1 = el->next)
  ------------------
 4181|      0|        JSOSTimer *th = list_entry(el, JSOSTimer, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|      0|#define offsetof(type, field) ((size_t) &((type *)0)->field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4182|      0|        free_timer(rt, th);
 4183|      0|    }
 4184|       |
 4185|     17|    list_for_each_safe(el, el1, &ts->rejected_promise_list) {
  ------------------
  |  |   89|     17|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 17]
  |  |  ------------------
  |  |   90|     17|        el = el1, el1 = el->next)
  ------------------
 4186|      0|        JSRejectedPromiseEntry *rp = list_entry(el, JSRejectedPromiseEntry, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|      0|#define offsetof(type, field) ((size_t) &((type *)0)->field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4187|      0|        JS_FreeValueRT(rt, rp->promise);
 4188|      0|        JS_FreeValueRT(rt, rp->reason);
 4189|      0|        free(rp);
 4190|      0|    }
 4191|       |
 4192|       |#ifdef USE_WORKER
 4193|       |    js_free_message_pipe(ts->recv_pipe);
 4194|       |    js_free_message_pipe(ts->send_pipe);
 4195|       |
 4196|       |    list_for_each_safe(el, el1, &ts->port_list) {
 4197|       |        JSWorkerMessageHandler *port = list_entry(el, JSWorkerMessageHandler, link);
 4198|       |        /* unlink the message ports. They are freed by the Worker object */
 4199|       |        port->link.prev = NULL;
 4200|       |        port->link.next = NULL;
 4201|       |    }
 4202|       |#endif
 4203|       |
 4204|     17|#if !defined(_WIN32)
 4205|     17|    free(ts->poll_fds);
 4206|     17|#endif
 4207|       |
 4208|     17|    free(ts);
 4209|       |    JS_SetRuntimeOpaque(rt, NULL); /* fail safe */
 4210|     17|}
js_std_loop:
 4293|      2|{
 4294|      2|    int err;
 4295|       |
 4296|      2|    for(;;) {
 4297|       |        /* execute the pending jobs */
 4298|      2|        for(;;) {
 4299|      2|            err = JS_ExecutePendingJob(JS_GetRuntime(ctx), NULL);
 4300|      2|            if (err <= 0) {
  ------------------
  |  Branch (4300:17): [True: 2, False: 0]
  ------------------
 4301|      2|                if (err < 0)
  ------------------
  |  Branch (4301:21): [True: 0, False: 2]
  ------------------
 4302|      0|                    js_std_dump_error(ctx);
 4303|      2|                break;
 4304|      2|            }
 4305|      2|        }
 4306|       |
 4307|      2|        js_std_promise_rejection_check(ctx);
 4308|       |        
 4309|      2|        if (!os_poll_func || os_poll_func(ctx))
  ------------------
  |  Branch (4309:13): [True: 0, False: 2]
  |  Branch (4309:30): [True: 2, False: 0]
  ------------------
 4310|      2|            break;
 4311|      2|    }
 4312|      2|}
js_std_await:
 4318|     17|{
 4319|     17|    JSValue ret;
 4320|     17|    int state;
 4321|       |
 4322|     17|    for(;;) {
 4323|     17|        state = JS_PromiseState(ctx, obj);
 4324|     17|        if (state == JS_PROMISE_FULFILLED) {
  ------------------
  |  Branch (4324:13): [True: 16, False: 1]
  ------------------
 4325|     16|            ret = JS_PromiseResult(ctx, obj);
 4326|     16|            JS_FreeValue(ctx, obj);
 4327|     16|            break;
 4328|     16|        } else if (state == JS_PROMISE_REJECTED) {
  ------------------
  |  Branch (4328:20): [True: 0, False: 1]
  ------------------
 4329|      0|            ret = JS_Throw(ctx, JS_PromiseResult(ctx, obj));
 4330|      0|            JS_FreeValue(ctx, obj);
 4331|      0|            break;
 4332|      1|        } else if (state == JS_PROMISE_PENDING) {
  ------------------
  |  Branch (4332:20): [True: 0, False: 1]
  ------------------
 4333|      0|            int err;
 4334|      0|            err = JS_ExecutePendingJob(JS_GetRuntime(ctx), NULL);
 4335|      0|            if (err < 0) {
  ------------------
  |  Branch (4335:17): [True: 0, False: 0]
  ------------------
 4336|      0|                js_std_dump_error(ctx);
 4337|      0|            }
 4338|      0|            if (err == 0) {
  ------------------
  |  Branch (4338:17): [True: 0, False: 0]
  ------------------
 4339|      0|                js_std_promise_rejection_check(ctx);
 4340|       |
 4341|      0|                if (os_poll_func)
  ------------------
  |  Branch (4341:21): [True: 0, False: 0]
  ------------------
 4342|      0|                    os_poll_func(ctx);
 4343|      0|            }
 4344|      1|        } else {
 4345|       |            /* not a promise */
 4346|      1|            ret = obj;
 4347|      1|            break;
 4348|      1|        }
 4349|     17|    }
 4350|     17|    return ret;
 4351|     17|}
quickjs-libc.c:js_std_init:
 1698|     16|{
 1699|     16|    JSValue proto;
 1700|       |
 1701|       |    /* FILE class */
 1702|       |    /* the class ID is created once */
 1703|     16|    JS_NewClassID(&js_std_file_class_id);
 1704|       |    /* the class is created once per runtime */
 1705|     16|    JS_NewClass(JS_GetRuntime(ctx), js_std_file_class_id, &js_std_file_class);
 1706|     16|    proto = JS_NewObject(ctx);
 1707|     16|    JS_SetPropertyFunctionList(ctx, proto, js_std_file_proto_funcs,
 1708|     16|                               countof(js_std_file_proto_funcs));
  ------------------
  |  |   47|     16|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 1709|     16|    JS_SetClassProto(ctx, js_std_file_class_id, proto);
 1710|       |
 1711|     16|    JS_SetModuleExportList(ctx, m, js_std_funcs,
 1712|     16|                           countof(js_std_funcs));
  ------------------
  |  |   47|     16|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 1713|     16|    JS_SetModuleExport(ctx, m, "in", js_new_std_file(ctx, stdin, FALSE, FALSE));
 1714|     16|    JS_SetModuleExport(ctx, m, "out", js_new_std_file(ctx, stdout, FALSE, FALSE));
 1715|       |    JS_SetModuleExport(ctx, m, "err", js_new_std_file(ctx, stderr, FALSE, FALSE));
 1716|     16|    return 0;
 1717|     16|}
quickjs-libc.c:js_std_file_finalizer:
  938|     48|{
  939|     48|    JSSTDFile *s = JS_GetOpaque(val, js_std_file_class_id);
  940|     48|    if (s) {
  ------------------
  |  Branch (940:9): [True: 48, False: 0]
  ------------------
  941|     48|        if (s->f && s->close_in_finalizer) {
  ------------------
  |  Branch (941:13): [True: 48, False: 0]
  |  Branch (941:21): [True: 0, False: 48]
  ------------------
  942|      0|            if (s->is_popen)
  ------------------
  |  Branch (942:17): [True: 0, False: 0]
  ------------------
  943|      0|                pclose(s->f);
  944|      0|            else
  945|      0|                fclose(s->f);
  946|      0|        }
  947|     48|        js_free_rt(rt, s);
  948|     48|    }
  949|     48|}
quickjs-libc.c:js_new_std_file:
  985|     48|{
  986|     48|    JSSTDFile *s;
  987|     48|    JSValue obj;
  988|     48|    obj = JS_NewObjectClass(ctx, js_std_file_class_id);
  989|     48|    if (JS_IsException(obj))
  ------------------
  |  Branch (989:9): [True: 0, False: 48]
  ------------------
  990|      0|        return obj;
  991|     48|    s = js_mallocz(ctx, sizeof(*s));
  992|     48|    if (!s) {
  ------------------
  |  Branch (992:9): [True: 0, False: 48]
  ------------------
  993|      0|        JS_FreeValue(ctx, obj);
  994|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
  995|      0|    }
  996|     48|    s->close_in_finalizer = close_in_finalizer;
  997|     48|    s->is_popen = is_popen;
  998|     48|    s->f = f;
  999|     48|    JS_SetOpaque(obj, s);
 1000|     48|    return obj;
 1001|     48|}
quickjs-libc.c:js_os_init:
 4013|     16|{
 4014|     16|    os_poll_func = js_os_poll;
 4015|       |
 4016|       |#ifdef USE_WORKER
 4017|       |    {
 4018|       |        JSRuntime *rt = JS_GetRuntime(ctx);
 4019|       |        JSThreadState *ts = JS_GetRuntimeOpaque(rt);
 4020|       |        JSValue proto, obj;
 4021|       |        /* Worker class */
 4022|       |        JS_NewClassID(&js_worker_class_id);
 4023|       |        JS_NewClass(JS_GetRuntime(ctx), js_worker_class_id, &js_worker_class);
 4024|       |        proto = JS_NewObject(ctx);
 4025|       |        JS_SetPropertyFunctionList(ctx, proto, js_worker_proto_funcs, countof(js_worker_proto_funcs));
 4026|       |
 4027|       |        obj = JS_NewCFunction2(ctx, js_worker_ctor, "Worker", 1,
 4028|       |                               JS_CFUNC_constructor, 0);
 4029|       |        JS_SetConstructor(ctx, obj, proto);
 4030|       |
 4031|       |        JS_SetClassProto(ctx, js_worker_class_id, proto);
 4032|       |
 4033|       |        /* set 'Worker.parent' if necessary */
 4034|       |        if (ts->recv_pipe && ts->send_pipe) {
 4035|       |            JS_DefinePropertyValueStr(ctx, obj, "parent",
 4036|       |                                      js_worker_ctor_internal(ctx, JS_UNDEFINED, ts->recv_pipe, ts->send_pipe),
 4037|       |                                      JS_PROP_C_W_E);
 4038|       |        }
 4039|       |
 4040|       |        JS_SetModuleExport(ctx, m, "Worker", obj);
 4041|       |    }
 4042|       |#endif /* USE_WORKER */
 4043|       |
 4044|     16|    return JS_SetModuleExportList(ctx, m, js_os_funcs,
 4045|     16|                                  countof(js_os_funcs));
  ------------------
  |  |   47|     16|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 4046|     16|}
quickjs-libc.c:js_os_poll:
 2548|      2|{
 2549|      2|    JSRuntime *rt = JS_GetRuntime(ctx);
 2550|      2|    JSThreadState *ts = JS_GetRuntimeOpaque(rt);
 2551|      2|    int min_delay, nfds;
 2552|      2|    int64_t cur_time, delay;
 2553|      2|    JSOSRWHandler *rh;
 2554|      2|    struct list_head *el;
 2555|       |
 2556|       |    /* only check signals in the main thread */
 2557|      2|    if (!ts->recv_pipe &&
  ------------------
  |  Branch (2557:9): [True: 2, False: 0]
  ------------------
 2558|      2|        unlikely(os_pending_signals != 0)) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 2559|      0|        JSOSSignalHandler *sh;
 2560|      0|        uint64_t mask;
 2561|       |
 2562|      0|        list_for_each(el, &ts->os_signal_handlers) {
  ------------------
  |  |   86|      0|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2563|      0|            sh = list_entry(el, JSOSSignalHandler, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|      0|#define offsetof(type, field) ((size_t) &((type *)0)->field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2564|      0|            mask = (uint64_t)1 << sh->sig_num;
 2565|      0|            if (os_pending_signals & mask) {
  ------------------
  |  Branch (2565:17): [True: 0, False: 0]
  ------------------
 2566|      0|                os_pending_signals &= ~mask;
 2567|      0|                call_handler(ctx, sh->func);
 2568|      0|                return 0;
 2569|      0|            }
 2570|      0|        }
 2571|      0|    }
 2572|       |
 2573|      2|    if (list_empty(&ts->os_rw_handlers) && list_empty(&ts->os_timers) &&
  ------------------
  |  Branch (2573:9): [True: 2, False: 0]
  |  Branch (2573:44): [True: 2, False: 0]
  ------------------
 2574|      2|        list_empty(&ts->port_list))
  ------------------
  |  Branch (2574:9): [True: 2, False: 0]
  ------------------
 2575|      2|        return -1; /* no more events */
 2576|       |
 2577|      0|    if (!list_empty(&ts->os_timers)) {
  ------------------
  |  Branch (2577:9): [True: 0, False: 0]
  ------------------
 2578|      0|        cur_time = get_time_ms();
 2579|      0|        min_delay = 10000;
 2580|      0|        list_for_each(el, &ts->os_timers) {
  ------------------
  |  |   86|      0|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2581|      0|            JSOSTimer *th = list_entry(el, JSOSTimer, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|      0|#define offsetof(type, field) ((size_t) &((type *)0)->field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2582|      0|            delay = th->timeout - cur_time;
 2583|      0|            if (delay <= 0) {
  ------------------
  |  Branch (2583:17): [True: 0, False: 0]
  ------------------
 2584|      0|                JSValue func;
 2585|       |                /* the timer expired */
 2586|      0|                func = th->func;
 2587|      0|                th->func = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 2588|      0|                free_timer(rt, th);
 2589|      0|                call_handler(ctx, func);
 2590|      0|                JS_FreeValue(ctx, func);
 2591|      0|                return 0;
 2592|      0|            } else if (delay < min_delay) {
  ------------------
  |  Branch (2592:24): [True: 0, False: 0]
  ------------------
 2593|      0|                min_delay = delay;
 2594|      0|            }
 2595|      0|        }
 2596|      0|    } else {
 2597|      0|        min_delay = -1; /* infinite */
 2598|      0|    }
 2599|       |
 2600|      0|    nfds = 0;
 2601|      0|    list_for_each(el, &ts->os_rw_handlers) {
  ------------------
  |  |   86|      0|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2602|      0|        int events;
 2603|       |
 2604|      0|        rh = list_entry(el, JSOSRWHandler, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|      0|#define offsetof(type, field) ((size_t) &((type *)0)->field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2605|      0|        events = 0;
 2606|      0|        if (!JS_IsNull(rh->rw_func[0]))
  ------------------
  |  Branch (2606:13): [True: 0, False: 0]
  ------------------
 2607|      0|            events |= POLLIN;
 2608|      0|        if (!JS_IsNull(rh->rw_func[1]))
  ------------------
  |  Branch (2608:13): [True: 0, False: 0]
  ------------------
 2609|      0|            events |= POLLOUT;
 2610|      0|        if (events) {
  ------------------
  |  Branch (2610:13): [True: 0, False: 0]
  ------------------
 2611|      0|            rh->poll_fd_index = nfds;
 2612|      0|            if (js_poll_add_poll_fd(ts, &nfds, rh->fd, events))
  ------------------
  |  Branch (2612:17): [True: 0, False: 0]
  ------------------
 2613|      0|                return -1;
 2614|      0|        }
 2615|      0|    }
 2616|       |
 2617|      0|    list_for_each(el, &ts->port_list) {
  ------------------
  |  |   86|      0|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2618|      0|        JSWorkerMessageHandler *port = list_entry(el, JSWorkerMessageHandler, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|      0|#define offsetof(type, field) ((size_t) &((type *)0)->field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2619|      0|        if (!JS_IsNull(port->on_message_func)) {
  ------------------
  |  Branch (2619:13): [True: 0, False: 0]
  ------------------
 2620|      0|            JSWorkerMessagePipe *ps = port->recv_pipe;
 2621|      0|            port->poll_fd_index = nfds;
 2622|      0|            if (js_poll_add_poll_fd(ts, &nfds, ps->waker.read_fd, POLLIN))
  ------------------
  |  Branch (2622:17): [True: 0, False: 0]
  ------------------
 2623|      0|                return -1;
 2624|      0|        }
 2625|      0|    }
 2626|       |
 2627|      0|    nfds = poll(ts->poll_fds, nfds, min_delay);
 2628|      0|    if (nfds > 0) {
  ------------------
  |  Branch (2628:9): [True: 0, False: 0]
  ------------------
 2629|      0|        list_for_each(el, &ts->os_rw_handlers) {
  ------------------
  |  |   86|      0|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2630|      0|            rh = list_entry(el, JSOSRWHandler, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|      0|#define offsetof(type, field) ((size_t) &((type *)0)->field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2631|      0|            if (!JS_IsNull(rh->rw_func[0]) &&
  ------------------
  |  Branch (2631:17): [True: 0, False: 0]
  ------------------
 2632|      0|                (ts->poll_fds[rh->poll_fd_index].revents & (POLLERR | POLLHUP | POLLNVAL | POLLIN))) {
  ------------------
  |  Branch (2632:17): [True: 0, False: 0]
  ------------------
 2633|      0|                call_handler(ctx, rh->rw_func[0]);
 2634|       |                /* must stop because the list may have been modified */
 2635|      0|                goto done;
 2636|      0|            }
 2637|      0|            if (!JS_IsNull(rh->rw_func[1]) &&
  ------------------
  |  Branch (2637:17): [True: 0, False: 0]
  ------------------
 2638|      0|                (ts->poll_fds[rh->poll_fd_index].revents & (POLLERR | POLLHUP | POLLNVAL | POLLOUT))) {
  ------------------
  |  Branch (2638:17): [True: 0, False: 0]
  ------------------
 2639|      0|                call_handler(ctx, rh->rw_func[1]);
 2640|       |                /* must stop because the list may have been modified */
 2641|      0|                goto done;
 2642|      0|            }
 2643|      0|        }
 2644|       |
 2645|      0|        list_for_each(el, &ts->port_list) {
  ------------------
  |  |   86|      0|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2646|      0|            JSWorkerMessageHandler *port = list_entry(el, JSWorkerMessageHandler, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|      0|#define offsetof(type, field) ((size_t) &((type *)0)->field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2647|      0|            if (!JS_IsNull(port->on_message_func)) {
  ------------------
  |  Branch (2647:17): [True: 0, False: 0]
  ------------------
 2648|      0|                if (ts->poll_fds[port->poll_fd_index].revents != 0) {
  ------------------
  |  Branch (2648:21): [True: 0, False: 0]
  ------------------
 2649|      0|                    if (handle_posted_message(rt, ctx, port))
  ------------------
  |  Branch (2649:25): [True: 0, False: 0]
  ------------------
 2650|      0|                        goto done;
 2651|      0|                }
 2652|      0|            }
 2653|      0|        }
 2654|      0|    }
 2655|      0| done:
 2656|      0|    return 0;
 2657|      0|}
quickjs-libc.c:js_std_promise_rejection_check:
 4276|      2|{
 4277|      2|    JSRuntime *rt = JS_GetRuntime(ctx);
 4278|      2|    JSThreadState *ts = JS_GetRuntimeOpaque(rt);
 4279|      2|    struct list_head *el;
 4280|       |
 4281|      2|    if (unlikely(!list_empty(&ts->rejected_promise_list))) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 4282|      0|        list_for_each(el, &ts->rejected_promise_list) {
  ------------------
  |  |   86|      0|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4283|      0|            JSRejectedPromiseEntry *rp = list_entry(el, JSRejectedPromiseEntry, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|      0|#define offsetof(type, field) ((size_t) &((type *)0)->field)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4284|       |            fprintf(stderr, "Possibly unhandled promise rejection: ");
 4285|      0|            js_std_dump_error1(ctx, rp->reason);
 4286|      0|        }
 4287|      0|        exit(1);
 4288|      0|    }
 4289|      2|}

js_malloc_rt:
 1801|  1.11M|{
 1802|  1.11M|    return __js_malloc(&rt->malloc_ctx, size);
 1803|  1.11M|}
js_free_rt:
 1806|  1.11M|{
 1807|  1.11M|    __js_free(&rt->malloc_ctx, ptr);
 1808|  1.11M|}
js_realloc_rt:
 1811|  3.70k|{
 1812|  3.70k|    return __js_realloc(&rt->malloc_ctx, ptr, size);
 1813|  3.70k|}
js_malloc_usable_size_rt:
 1816|  1.59k|{
 1817|  1.59k|    return __js_malloc_usable_size(&rt->malloc_ctx, ptr);
 1818|  1.59k|}
js_mallocz_rt:
 1821|    367|{
 1822|    367|    void *ptr;
 1823|    367|    ptr = js_malloc_rt(rt, size);
 1824|    367|    if (unlikely(!ptr))
  ------------------
  |  |   33|    367|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 367]
  |  |  ------------------
  ------------------
 1825|      0|        return NULL;
 1826|    367|    return memset(ptr, 0, size);
 1827|    367|}
js_malloc:
 1831|  1.02M|{
 1832|  1.02M|    void *ptr;
 1833|  1.02M|    ptr = js_malloc_rt(ctx->rt, size);
 1834|  1.02M|    if (unlikely(!ptr)) {
  ------------------
  |  |   33|  1.02M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.02M]
  |  |  ------------------
  ------------------
 1835|      0|        JS_ThrowOutOfMemory(ctx);
 1836|      0|        return NULL;
 1837|      0|    }
 1838|  1.02M|    return ptr;
 1839|  1.02M|}
js_mallocz:
 1843|    279|{
 1844|    279|    void *ptr;
 1845|    279|    ptr = js_mallocz_rt(ctx->rt, size);
 1846|    279|    if (unlikely(!ptr)) {
  ------------------
  |  |   33|    279|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 279]
  |  |  ------------------
  ------------------
 1847|      0|        JS_ThrowOutOfMemory(ctx);
 1848|      0|        return NULL;
 1849|      0|    }
 1850|    279|    return ptr;
 1851|    279|}
js_free:
 1854|  1.01M|{
 1855|  1.01M|    js_free_rt(ctx->rt, ptr);
 1856|  1.01M|}
js_realloc:
 1860|    631|{
 1861|    631|    void *ret;
 1862|    631|    ret = js_realloc_rt(ctx->rt, ptr, size);
 1863|    631|    if (unlikely(!ret && size != 0)) {
  ------------------
  |  |   33|    631|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 631]
  |  |  |  Branch (33:45): [True: 0, False: 631]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1864|      0|        JS_ThrowOutOfMemory(ctx);
 1865|      0|        return NULL;
 1866|      0|    }
 1867|    631|    return ret;
 1868|    631|}
js_realloc2:
 1872|  1.59k|{
 1873|  1.59k|    void *ret;
 1874|  1.59k|    ret = js_realloc_rt(ctx->rt, ptr, size);
 1875|  1.59k|    if (unlikely(!ret && size != 0)) {
  ------------------
  |  |   33|  1.59k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.59k]
  |  |  |  Branch (33:45): [True: 0, False: 1.59k]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1876|      0|        JS_ThrowOutOfMemory(ctx);
 1877|      0|        return NULL;
 1878|      0|    }
 1879|  1.59k|    if (pslack) {
  ------------------
  |  Branch (1879:9): [True: 1.59k, False: 0]
  ------------------
 1880|  1.59k|        size_t new_size = js_malloc_usable_size_rt(ctx->rt, ret);
 1881|  1.59k|        *pslack = (new_size > size) ? new_size - size : 0;
  ------------------
  |  Branch (1881:19): [True: 824, False: 767]
  ------------------
 1882|  1.59k|    }
 1883|  1.59k|    return ret;
 1884|  1.59k|}
js_strndup:
 1893|     37|{
 1894|     37|    char *ptr;
 1895|     37|    ptr = js_malloc(ctx, n + 1);
 1896|     37|    if (ptr) {
  ------------------
  |  Branch (1896:9): [True: 37, False: 0]
  ------------------
 1897|     37|        memcpy(ptr, s, n);
 1898|     37|        ptr[n] = '\0';
 1899|     37|    }
 1900|     37|    return ptr;
 1901|     37|}
js_strdup:
 1904|     34|{
 1905|     34|    return js_strndup(ctx, str, strlen(str));
 1906|     34|}
JS_NewRuntime2:
 2068|     17|{
 2069|     17|    JSRuntime *rt;
 2070|     17|    JSMallocState ms;
 2071|       |
 2072|     17|    memset(&ms, 0, sizeof(ms));
 2073|     17|    ms.opaque = opaque;
 2074|     17|    ms.malloc_limit = -1;
 2075|       |
 2076|     17|    rt = mf->js_malloc(&ms, sizeof(JSRuntime));
 2077|     17|    if (!rt)
  ------------------
  |  Branch (2077:9): [True: 0, False: 17]
  ------------------
 2078|      0|        return NULL;
 2079|     17|    memset(rt, 0, sizeof(*rt));
 2080|     17|    js_malloc_init(&rt->malloc_ctx);
 2081|     17|    rt->malloc_ctx.mf = *mf;
 2082|     17|    rt->malloc_ctx.malloc_state = ms;
 2083|     17|    rt->malloc_gc_threshold = 256 * 1024;
 2084|       |
 2085|     17|    init_list_head(&rt->context_list);
 2086|     17|    init_list_head(&rt->gc_obj_list);
 2087|     17|    init_list_head(&rt->gc_zero_ref_count_list);
 2088|     17|    rt->gc_phase = JS_GC_PHASE_NONE;
 2089|     17|    init_list_head(&rt->weakref_list);
 2090|       |
 2091|       |#ifdef DUMP_LEAKS
 2092|       |    init_list_head(&rt->string_list);
 2093|       |#endif
 2094|     17|    init_list_head(&rt->job_list);
 2095|       |
 2096|     17|    if (JS_InitAtoms(rt))
  ------------------
  |  Branch (2096:9): [True: 0, False: 17]
  ------------------
 2097|      0|        goto fail;
 2098|       |
 2099|       |    /* create the object, array and function classes */
 2100|     17|    if (init_class_range(rt, js_std_class_def, JS_CLASS_OBJECT,
  ------------------
  |  Branch (2100:9): [True: 0, False: 17]
  ------------------
 2101|     17|                         countof(js_std_class_def)) < 0)
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 2102|      0|        goto fail;
 2103|     17|    rt->class_array[JS_CLASS_ARGUMENTS].exotic = &js_arguments_exotic_methods;
 2104|     17|    rt->class_array[JS_CLASS_MAPPED_ARGUMENTS].exotic = &js_arguments_exotic_methods;
 2105|     17|    rt->class_array[JS_CLASS_STRING].exotic = &js_string_exotic_methods;
 2106|     17|    rt->class_array[JS_CLASS_MODULE_NS].exotic = &js_module_ns_exotic_methods;
 2107|       |
 2108|     17|    rt->class_array[JS_CLASS_C_FUNCTION].call = js_call_c_function;
 2109|     17|    rt->class_array[JS_CLASS_C_FUNCTION_DATA].call = js_c_function_data_call;
 2110|     17|    rt->class_array[JS_CLASS_BOUND_FUNCTION].call = js_call_bound_function;
 2111|     17|    rt->class_array[JS_CLASS_GENERATOR_FUNCTION].call = js_generator_function_call;
 2112|     17|    if (init_shape_hash(rt))
  ------------------
  |  Branch (2112:9): [True: 0, False: 17]
  ------------------
 2113|      0|        goto fail;
 2114|       |
 2115|     17|    rt->stack_size = JS_DEFAULT_STACK_SIZE;
  ------------------
  |  |  328|     17|#define JS_DEFAULT_STACK_SIZE (1024 * 1024)
  ------------------
 2116|     17|    JS_UpdateStackTop(rt);
 2117|       |
 2118|     17|    rt->current_exception = JS_UNINITIALIZED;
  ------------------
  |  |  295|     17|#define JS_UNINITIALIZED JS_MKVAL(JS_TAG_UNINITIALIZED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 2119|       |
 2120|     17|    return rt;
 2121|      0| fail:
 2122|      0|    JS_FreeRuntime(rt);
 2123|       |    return NULL;
 2124|     17|}
JS_GetRuntimeOpaque:
 2127|     21|{
 2128|     21|    return rt->user_opaque;
 2129|     21|}
JS_SetRuntimeOpaque:
 2132|     34|{
 2133|     34|    rt->user_opaque = opaque;
 2134|     34|}
JS_NewRuntime:
 2217|     17|{
 2218|       |    return JS_NewRuntime2(&def_malloc_funcs, NULL);
 2219|     17|}
JS_SetMemoryLimit:
 2222|     17|{
 2223|     17|    rt->malloc_ctx.malloc_state.malloc_limit = limit;
 2224|     17|}
JS_SetInterruptHandler:
 2237|     17|{
 2238|     17|    rt->interrupt_handler = cb;
 2239|     17|    rt->interrupt_opaque = opaque;
 2240|     17|}
JS_ExecutePendingJob:
 2304|      2|{
 2305|      2|    JSContext *ctx;
 2306|      2|    JSJobEntry *e;
 2307|      2|    JSValue res;
 2308|      2|    int i, ret;
 2309|       |
 2310|      2|    if (list_empty(&rt->job_list)) {
  ------------------
  |  Branch (2310:9): [True: 2, False: 0]
  ------------------
 2311|      2|        if (pctx)
  ------------------
  |  Branch (2311:13): [True: 0, False: 2]
  ------------------
 2312|      0|            *pctx = NULL;
 2313|      2|        return 0;
 2314|      2|    }
 2315|       |
 2316|       |    /* get the first pending job and execute it */
 2317|      0|    e = list_entry(rt->job_list.next, JSJobEntry, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 2318|      0|    list_del(&e->link);
 2319|      0|    ctx = e->realm;
 2320|      0|    res = e->job_func(ctx, e->argc, (JSValueConst *)e->argv);
 2321|      0|    for(i = 0; i < e->argc; i++)
  ------------------
  |  Branch (2321:16): [True: 0, False: 0]
  ------------------
 2322|      0|        JS_FreeValue(ctx, e->argv[i]);
 2323|      0|    if (JS_IsException(res))
  ------------------
  |  Branch (2323:9): [True: 0, False: 0]
  ------------------
 2324|      0|        ret = -1;
 2325|      0|    else
 2326|      0|        ret = 1;
 2327|      0|    JS_FreeValue(ctx, res);
 2328|      0|    js_free(ctx, e);
 2329|      0|    if (pctx) {
  ------------------
  |  Branch (2329:9): [True: 0, False: 0]
  ------------------
 2330|      0|        if (js_rc(ctx)->ref_count > 1)
  ------------------
  |  Branch (2330:13): [True: 0, False: 0]
  ------------------
 2331|      0|            *pctx = ctx;
 2332|      0|        else
 2333|      0|            *pctx = NULL;
 2334|      0|    }
 2335|      0|    JS_FreeContext(ctx);
 2336|      0|    return ret;
 2337|      2|}
JS_FreeRuntime:
 2406|     17|{
 2407|     17|    struct list_head *el, *el1;
 2408|     17|    int i;
 2409|       |
 2410|     17|    JS_FreeValueRT(rt, rt->current_exception);
 2411|       |
 2412|     17|    list_for_each_safe(el, el1, &rt->job_list) {
  ------------------
  |  |   89|     17|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 17]
  |  |  ------------------
  |  |   90|     17|        el = el1, el1 = el->next)
  ------------------
 2413|      0|        JSJobEntry *e = list_entry(el, JSJobEntry, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 2414|      0|        for(i = 0; i < e->argc; i++)
  ------------------
  |  Branch (2414:20): [True: 0, False: 0]
  ------------------
 2415|      0|            JS_FreeValueRT(rt, e->argv[i]);
 2416|      0|        JS_FreeContext(e->realm);
 2417|      0|        js_free_rt(rt, e);
 2418|      0|    }
 2419|     17|    init_list_head(&rt->job_list);
 2420|       |
 2421|       |    /* don't remove the weak objects to avoid create new jobs with
 2422|       |       FinalizationRegistry */
 2423|     17|    JS_RunGCInternal(rt, FALSE);
 2424|       |
 2425|       |#ifdef DUMP_LEAKS
 2426|       |    /* leaking objects */
 2427|       |    {
 2428|       |        BOOL header_done;
 2429|       |        JSGCObjectHeader *p;
 2430|       |        int count;
 2431|       |
 2432|       |        /* remove the internal refcounts to display only the object
 2433|       |           referenced externally */
 2434|       |        list_for_each(el, &rt->gc_obj_list) {
 2435|       |            p = list_entry(el, JSGCObjectHeader, link);
 2436|       |            js_rc(p)->mark = 0;
 2437|       |        }
 2438|       |        gc_decref(rt);
 2439|       |
 2440|       |        header_done = FALSE;
 2441|       |        list_for_each(el, &rt->gc_obj_list) {
 2442|       |            p = list_entry(el, JSGCObjectHeader, link);
 2443|       |            if (js_rc(p)->ref_count != 0) {
 2444|       |                if (!header_done) {
 2445|       |                    printf("Object leaks:\n");
 2446|       |                    JS_DumpObjectHeader(rt);
 2447|       |                    header_done = TRUE;
 2448|       |                }
 2449|       |                JS_DumpGCObject(rt, p);
 2450|       |            }
 2451|       |        }
 2452|       |
 2453|       |        count = 0;
 2454|       |        list_for_each(el, &rt->gc_obj_list) {
 2455|       |            p = list_entry(el, JSGCObjectHeader, link);
 2456|       |            if (js_rc(p)->ref_count == 0) {
 2457|       |                count++;
 2458|       |            }
 2459|       |        }
 2460|       |        if (count != 0)
 2461|       |            printf("Secondary object leaks: %d\n", count);
 2462|       |    }
 2463|       |#endif
 2464|     17|    assert(list_empty(&rt->gc_obj_list));
  ------------------
  |  Branch (2464:5): [True: 0, False: 17]
  |  Branch (2464:5): [True: 17, False: 0]
  ------------------
 2465|     17|    assert(list_empty(&rt->weakref_list));
  ------------------
  |  Branch (2465:5): [True: 0, False: 17]
  |  Branch (2465:5): [True: 17, False: 0]
  ------------------
 2466|       |
 2467|       |    /* free the classes */
 2468|  1.58k|    for(i = 0; i < rt->class_count; i++) {
  ------------------
  |  Branch (2468:16): [True: 1.56k, False: 17]
  ------------------
 2469|  1.56k|        JSClass *cl = &rt->class_array[i];
 2470|  1.56k|        if (cl->class_id != 0) {
  ------------------
  |  Branch (2470:13): [True: 1.07k, False: 497]
  ------------------
 2471|  1.07k|            JS_FreeAtomRT(rt, cl->class_name);
 2472|  1.07k|        }
 2473|  1.56k|    }
 2474|     17|    js_free_rt(rt, rt->class_array);
 2475|       |
 2476|       |#ifdef DUMP_LEAKS
 2477|       |    /* only the atoms defined in JS_InitAtoms() should be left */
 2478|       |    {
 2479|       |        BOOL header_done = FALSE;
 2480|       |
 2481|       |        for(i = 0; i < rt->atom_size; i++) {
 2482|       |            JSAtomStruct *p = rt->atom_array[i];
 2483|       |            if (!atom_is_free(p) /* && p->str*/) {
 2484|       |                if (i >= JS_ATOM_END || js_rc(p)->ref_count != 1) {
 2485|       |                    if (!header_done) {
 2486|       |                        header_done = TRUE;
 2487|       |                        if (rt->rt_info) {
 2488|       |                            printf("%s:1: atom leakage:", rt->rt_info);
 2489|       |                        } else {
 2490|       |                            printf("Atom leaks:\n"
 2491|       |                                   "    %6s %6s %s\n",
 2492|       |                                   "ID", "REFCNT", "NAME");
 2493|       |                        }
 2494|       |                    }
 2495|       |                    if (rt->rt_info) {
 2496|       |                        printf(" ");
 2497|       |                    } else {
 2498|       |                        printf("    %6u %6u ", i, js_rc(p)->ref_count);
 2499|       |                    }
 2500|       |                    switch (p->atom_type) {
 2501|       |                    case JS_ATOM_TYPE_STRING:
 2502|       |                        JS_DumpString(rt, p);
 2503|       |                        break;
 2504|       |                    case JS_ATOM_TYPE_GLOBAL_SYMBOL:
 2505|       |                        printf("Symbol.for(");
 2506|       |                        JS_DumpString(rt, p);
 2507|       |                        printf(")");
 2508|       |                        break;
 2509|       |                    case JS_ATOM_TYPE_SYMBOL:
 2510|       |                        if (p->hash != JS_ATOM_HASH_PRIVATE) {
 2511|       |                            printf("Symbol(");
 2512|       |                            JS_DumpString(rt, p);
 2513|       |                            printf(")");
 2514|       |                        } else {
 2515|       |                            printf("Private(");
 2516|       |                            JS_DumpString(rt, p);
 2517|       |                            printf(")");
 2518|       |                        }
 2519|       |                        break;
 2520|       |                    }
 2521|       |                    if (rt->rt_info) {
 2522|       |                        printf(":%u", js_rc(p)->ref_count);
 2523|       |                    } else {
 2524|       |                        printf("\n");
 2525|       |                    }
 2526|       |                }
 2527|       |            }
 2528|       |        }
 2529|       |        if (rt->rt_info && header_done)
 2530|       |            printf("\n");
 2531|       |    }
 2532|       |#endif
 2533|       |
 2534|       |    /* free the atoms */
 2535|  12.1k|    for(i = 0; i < rt->atom_size; i++) {
  ------------------
  |  Branch (2535:16): [True: 12.0k, False: 17]
  ------------------
 2536|  12.0k|        JSAtomStruct *p = rt->atom_array[i];
 2537|  12.0k|        if (!atom_is_free(p)) {
  ------------------
  |  Branch (2537:13): [True: 4.13k, False: 7.95k]
  ------------------
 2538|       |#ifdef DUMP_LEAKS
 2539|       |            list_del(&p->link);
 2540|       |#endif
 2541|  4.13k|            js_free_rt(rt, p);
 2542|  4.13k|        }
 2543|  12.0k|    }
 2544|     17|    js_free_rt(rt, rt->atom_array);
 2545|     17|    js_free_rt(rt, rt->atom_hash);
 2546|     17|    js_free_rt(rt, rt->shape_hash);
 2547|       |#ifdef DUMP_LEAKS
 2548|       |    if (!list_empty(&rt->string_list)) {
 2549|       |        if (rt->rt_info) {
 2550|       |            printf("%s:1: string leakage:", rt->rt_info);
 2551|       |        } else {
 2552|       |            printf("String leaks:\n"
 2553|       |                   "    %6s %s\n",
 2554|       |                   "REFCNT", "VALUE");
 2555|       |        }
 2556|       |        list_for_each_safe(el, el1, &rt->string_list) {
 2557|       |            JSString *str = list_entry(el, JSString, link);
 2558|       |            if (rt->rt_info) {
 2559|       |                printf(" ");
 2560|       |            } else {
 2561|       |                printf("    %6u ", js_rc(str)->ref_count);
 2562|       |            }
 2563|       |            JS_DumpString(rt, str);
 2564|       |            if (rt->rt_info) {
 2565|       |                printf(":%u", js_rc(str)->ref_count);
 2566|       |            } else {
 2567|       |                printf("\n");
 2568|       |            }
 2569|       |            list_del(&str->link);
 2570|       |            js_free_rt(rt, str);
 2571|       |        }
 2572|       |        if (rt->rt_info)
 2573|       |            printf("\n");
 2574|       |    }
 2575|       |    {
 2576|       |        JSMallocState *s = &rt->malloc_ctx.malloc_state;
 2577|       |        if (s->malloc_count > 1) {
 2578|       |            if (rt->rt_info)
 2579|       |                printf("%s:1: ", rt->rt_info);
 2580|       |            printf("Memory leak: %"PRIu64" bytes lost in %"PRIu64" block%s\n",
 2581|       |                   (uint64_t)(s->malloc_size - sizeof(JSRuntime)),
 2582|       |                   (uint64_t)(s->malloc_count - 1), &"s"[s->malloc_count == 2]);
 2583|       |        }
 2584|       |    }
 2585|       |#endif
 2586|       |
 2587|     17|    {
 2588|     17|        JSMallocState ms = rt->malloc_ctx.malloc_state;
 2589|     17|        rt->malloc_ctx.mf.js_free(&ms, rt);
 2590|     17|    }
 2591|     17|}
JS_NewContextRaw:
 2594|     17|{
 2595|     17|    JSContext *ctx;
 2596|     17|    int i;
 2597|       |
 2598|     17|    ctx = js_mallocz_rt(rt, sizeof(JSContext));
 2599|     17|    if (!ctx)
  ------------------
  |  Branch (2599:9): [True: 0, False: 17]
  ------------------
 2600|      0|        return NULL;
 2601|     17|    js_rc(ctx)->ref_count = 1;
 2602|     17|    add_gc_object(rt, &ctx->header, JS_GC_OBJ_TYPE_JS_CONTEXT);
 2603|       |
 2604|     17|    ctx->class_proto = js_malloc_rt(rt, sizeof(ctx->class_proto[0]) *
 2605|     17|                                    rt->class_count);
 2606|     17|    if (!ctx->class_proto) {
  ------------------
  |  Branch (2606:9): [True: 0, False: 17]
  ------------------
 2607|      0|        js_free_rt(rt, ctx);
 2608|      0|        return NULL;
 2609|      0|    }
 2610|     17|    ctx->rt = rt;
 2611|     17|    list_add_tail(&ctx->link, &rt->context_list);
 2612|  1.08k|    for(i = 0; i < rt->class_count; i++)
  ------------------
  |  Branch (2612:16): [True: 1.07k, False: 17]
  ------------------
 2613|  1.07k|        ctx->class_proto[i] = JS_NULL;
  ------------------
  |  |  290|  1.07k|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|  1.08k|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 2614|     17|    ctx->array_ctor = JS_NULL;
  ------------------
  |  |  290|     17|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 2615|     17|    ctx->iterator_ctor = JS_NULL;
  ------------------
  |  |  290|     17|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 2616|     17|    ctx->regexp_ctor = JS_NULL;
  ------------------
  |  |  290|     17|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 2617|     17|    ctx->promise_ctor = JS_NULL;
  ------------------
  |  |  290|     17|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 2618|     17|    init_list_head(&ctx->loaded_modules);
 2619|       |
 2620|     17|    if (JS_AddIntrinsicBasicObjects(ctx)) {
  ------------------
  |  Branch (2620:9): [True: 0, False: 17]
  ------------------
 2621|      0|        JS_FreeContext(ctx);
 2622|      0|        return NULL;
 2623|      0|    }
 2624|     17|    return ctx;
 2625|     17|}
JS_NewContext:
 2628|     17|{
 2629|     17|    JSContext *ctx;
 2630|       |
 2631|     17|    ctx = JS_NewContextRaw(rt);
 2632|     17|    if (!ctx)
  ------------------
  |  Branch (2632:9): [True: 0, False: 17]
  ------------------
 2633|      0|        return NULL;
 2634|       |
 2635|     17|    if (JS_AddIntrinsicBaseObjects(ctx) ||
  ------------------
  |  Branch (2635:9): [True: 0, False: 17]
  ------------------
 2636|     17|        JS_AddIntrinsicDate(ctx) ||
  ------------------
  |  Branch (2636:9): [True: 0, False: 17]
  ------------------
 2637|     17|        JS_AddIntrinsicEval(ctx) ||
  ------------------
  |  Branch (2637:9): [True: 0, False: 17]
  ------------------
 2638|     17|        JS_AddIntrinsicStringNormalize(ctx) ||
  ------------------
  |  Branch (2638:9): [True: 0, False: 17]
  ------------------
 2639|     17|        JS_AddIntrinsicRegExp(ctx) ||
  ------------------
  |  Branch (2639:9): [True: 0, False: 17]
  ------------------
 2640|     17|        JS_AddIntrinsicJSON(ctx) ||
  ------------------
  |  Branch (2640:9): [True: 0, False: 17]
  ------------------
 2641|     17|        JS_AddIntrinsicProxy(ctx) ||
  ------------------
  |  Branch (2641:9): [True: 0, False: 17]
  ------------------
 2642|     17|        JS_AddIntrinsicMapSet(ctx) ||
  ------------------
  |  Branch (2642:9): [True: 0, False: 17]
  ------------------
 2643|     17|        JS_AddIntrinsicTypedArrays(ctx) ||
  ------------------
  |  Branch (2643:9): [True: 0, False: 17]
  ------------------
 2644|     17|        JS_AddIntrinsicPromise(ctx) ||
  ------------------
  |  Branch (2644:9): [True: 0, False: 17]
  ------------------
 2645|     17|        JS_AddIntrinsicWeakRef(ctx)) {
  ------------------
  |  Branch (2645:9): [True: 0, False: 17]
  ------------------
 2646|      0|        JS_FreeContext(ctx);
 2647|      0|        return NULL;
 2648|      0|    }
 2649|     17|    return ctx;
 2650|     17|}
JS_SetClassProto:
 2673|     16|{
 2674|     16|    JSRuntime *rt = ctx->rt;
 2675|     16|    assert(class_id < rt->class_count);
  ------------------
  |  Branch (2675:5): [True: 0, False: 16]
  |  Branch (2675:5): [True: 16, False: 0]
  ------------------
 2676|     16|    set_value(ctx, &ctx->class_proto[class_id], obj);
 2677|     16|}
JS_DupContext:
 2711|  10.1k|{
 2712|  10.1k|    js_rc(ctx)->ref_count++;
 2713|  10.1k|    return ctx;
 2714|  10.1k|}
JS_FreeContext:
 2766|  10.1k|{
 2767|  10.1k|    JSRuntime *rt = ctx->rt;
 2768|  10.1k|    int i;
 2769|       |
 2770|  10.1k|    if (--js_rc(ctx)->ref_count > 0)
  ------------------
  |  Branch (2770:9): [True: 10.1k, False: 17]
  ------------------
 2771|  10.1k|        return;
 2772|  10.1k|    assert(js_rc(ctx)->ref_count == 0);
  ------------------
  |  Branch (2772:5): [True: 0, False: 17]
  |  Branch (2772:5): [True: 17, False: 0]
  ------------------
 2773|       |
 2774|       |#ifdef DUMP_ATOMS
 2775|       |    JS_DumpAtoms(ctx->rt);
 2776|       |#endif
 2777|       |#ifdef DUMP_SHAPES
 2778|       |    JS_DumpShapes(ctx->rt);
 2779|       |#endif
 2780|       |#ifdef DUMP_OBJECTS
 2781|       |    {
 2782|       |        struct list_head *el;
 2783|       |        JSGCObjectHeader *p;
 2784|       |        printf("JSObjects: {\n");
 2785|       |        JS_DumpObjectHeader(ctx->rt);
 2786|       |        list_for_each(el, &rt->gc_obj_list) {
 2787|       |            p = list_entry(el, JSGCObjectHeader, link);
 2788|       |            JS_DumpGCObject(rt, p);
 2789|       |        }
 2790|       |        printf("}\n");
 2791|       |    }
 2792|       |#endif
 2793|       |#ifdef DUMP_MEM
 2794|       |    {
 2795|       |        JSMemoryUsage stats;
 2796|       |        JS_ComputeMemoryUsage(rt, &stats);
 2797|       |        JS_DumpMemoryUsage(stdout, &stats, rt);
 2798|       |    }
 2799|       |#endif
 2800|       |
 2801|     17|    js_free_modules(ctx, JS_FREE_MODULE_ALL);
 2802|       |
 2803|     17|    JS_FreeValue(ctx, ctx->global_obj);
 2804|     17|    JS_FreeValue(ctx, ctx->global_var_obj);
 2805|       |
 2806|     17|    JS_FreeValue(ctx, ctx->throw_type_error);
 2807|     17|    JS_FreeValue(ctx, ctx->eval_obj);
 2808|       |
 2809|     17|    JS_FreeValue(ctx, ctx->array_proto_values);
 2810|    153|    for(i = 0; i < JS_NATIVE_ERROR_COUNT; i++) {
  ------------------
  |  Branch (2810:16): [True: 136, False: 17]
  ------------------
 2811|    136|        JS_FreeValue(ctx, ctx->native_error_proto[i]);
 2812|    136|    }
 2813|  1.58k|    for(i = 0; i < rt->class_count; i++) {
  ------------------
  |  Branch (2813:16): [True: 1.56k, False: 17]
  ------------------
 2814|  1.56k|        JS_FreeValue(ctx, ctx->class_proto[i]);
 2815|  1.56k|    }
 2816|     17|    js_free_rt(rt, ctx->class_proto);
 2817|     17|    JS_FreeValue(ctx, ctx->iterator_ctor);
 2818|     17|    JS_FreeValue(ctx, ctx->async_iterator_proto);
 2819|     17|    JS_FreeValue(ctx, ctx->promise_ctor);
 2820|     17|    JS_FreeValue(ctx, ctx->array_ctor);
 2821|     17|    JS_FreeValue(ctx, ctx->regexp_ctor);
 2822|     17|    JS_FreeValue(ctx, ctx->function_ctor);
 2823|     17|    JS_FreeValue(ctx, ctx->function_proto);
 2824|       |
 2825|     17|    js_free_shape_null(ctx->rt, ctx->array_shape);
 2826|     17|    js_free_shape_null(ctx->rt, ctx->arguments_shape);
 2827|     17|    js_free_shape_null(ctx->rt, ctx->mapped_arguments_shape);
 2828|     17|    js_free_shape_null(ctx->rt, ctx->regexp_shape);
 2829|     17|    js_free_shape_null(ctx->rt, ctx->regexp_result_shape);
 2830|       |
 2831|     17|    list_del(&ctx->link);
 2832|     17|    remove_gc_object(&ctx->header);
 2833|     17|    js_free_rt(ctx->rt, ctx);
 2834|     17|}
JS_GetRuntime:
 2837|     39|{
 2838|     39|    return ctx->rt;
 2839|     39|}
JS_SetMaxStackSize:
 2851|     17|{
 2852|     17|    rt->stack_size = stack_size;
 2853|     17|    update_stack_limit(rt);
 2854|     17|}
JS_UpdateStackTop:
 2857|     17|{
 2858|     17|    rt->stack_top = js_get_stack_pointer();
 2859|     17|    update_stack_limit(rt);
 2860|     17|}
JS_DupAtom:
 3119|  22.4k|{
 3120|  22.4k|    JSRuntime *rt;
 3121|  22.4k|    JSAtomStruct *p;
 3122|       |
 3123|  22.4k|    if (!__JS_AtomIsConst(v)) {
  ------------------
  |  Branch (3123:9): [True: 9.77k, False: 12.6k]
  ------------------
 3124|  9.77k|        rt = ctx->rt;
 3125|  9.77k|        p = rt->atom_array[v];
 3126|  9.77k|        js_rc(p)->ref_count++;
 3127|  9.77k|    }
 3128|  22.4k|    return v;
 3129|  22.4k|}
JS_NewAtomLen:
 3461|  16.0k|{
 3462|  16.0k|    JSValue val;
 3463|       |
 3464|  16.0k|    if (len == 0 ||
  ------------------
  |  Branch (3464:9): [True: 34, False: 16.0k]
  ------------------
 3465|  16.0k|        (!is_digit(*str) &&
  ------------------
  |  Branch (3465:10): [True: 16.0k, False: 0]
  ------------------
 3466|  16.0k|         count_ascii((const uint8_t *)str, len) == len)) {
  ------------------
  |  Branch (3466:10): [True: 16.0k, False: 18]
  ------------------
 3467|  16.0k|        JSAtom atom = __JS_FindAtom(ctx->rt, str, len, JS_ATOM_TYPE_STRING);
 3468|  16.0k|        if (atom)
  ------------------
  |  Branch (3468:13): [True: 9.29k, False: 6.77k]
  ------------------
 3469|  9.29k|            return atom;
 3470|  16.0k|    }
 3471|  6.79k|    val = JS_NewStringLen(ctx, str, len);
 3472|  6.79k|    if (JS_IsException(val))
  ------------------
  |  Branch (3472:9): [True: 0, False: 6.79k]
  ------------------
 3473|      0|        return JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
 3474|  6.79k|    return JS_NewAtomStr(ctx, JS_VALUE_GET_STRING(val));
  ------------------
  |  |  230|  6.79k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  6.79k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 3475|  6.79k|}
JS_NewAtom:
 3478|  15.6k|{
 3479|  15.6k|    return JS_NewAtomLen(ctx, str, strlen(str));
 3480|  15.6k|}
JS_AtomToValue:
 3623|    364|{
 3624|    364|    return __JS_AtomToValue(ctx, atom, FALSE);
 3625|    364|}
JS_AtomToString:
 3628|   290k|{
 3629|   290k|    return __JS_AtomToValue(ctx, atom, TRUE);
 3630|   290k|}
JS_FreeAtom:
 3725|  1.37M|{
 3726|  1.37M|    if (!__JS_AtomIsConst(v))
  ------------------
  |  Branch (3726:9): [True: 11.6k, False: 1.35M]
  ------------------
 3727|  11.6k|        __JS_FreeAtom(ctx->rt, v);
 3728|  1.37M|}
JS_FreeAtomRT:
 3731|  22.5k|{
 3732|  22.5k|    if (!__JS_AtomIsConst(v))
  ------------------
  |  Branch (3732:9): [True: 9.73k, False: 12.7k]
  ------------------
 3733|  9.73k|        __JS_FreeAtom(rt, v);
 3734|  22.5k|}
JS_AtomToCStringLen:
 3754|     96|{
 3755|     96|    JSValue str;
 3756|     96|    const char *cstr;
 3757|       |
 3758|     96|    str = JS_AtomToString(ctx, atom);
 3759|     96|    if (JS_IsException(str)) {
  ------------------
  |  Branch (3759:9): [True: 0, False: 96]
  ------------------
 3760|      0|        if (plen)
  ------------------
  |  Branch (3760:13): [True: 0, False: 0]
  ------------------
 3761|      0|            *plen = 0;
 3762|      0|        return NULL;
 3763|      0|    }
 3764|     96|    cstr = JS_ToCStringLen(ctx, plen, str);
 3765|     96|    JS_FreeValue(ctx, str);
 3766|     96|    return cstr;
 3767|     96|}
JS_NewClassID:
 3824|     16|{
 3825|     16|    JSClassID class_id;
 3826|     16|#ifdef CONFIG_ATOMICS
 3827|     16|    pthread_mutex_lock(&js_class_id_mutex);
 3828|     16|#endif
 3829|     16|    class_id = *pclass_id;
 3830|     16|    if (class_id == 0) {
  ------------------
  |  Branch (3830:9): [True: 1, False: 15]
  ------------------
 3831|      1|        class_id = js_class_id_alloc++;
 3832|      1|        *pclass_id = class_id;
 3833|      1|    }
 3834|     16|#ifdef CONFIG_ATOMICS
 3835|     16|    pthread_mutex_unlock(&js_class_id_mutex);
 3836|     16|#endif
 3837|     16|    return class_id;
 3838|     16|}
JS_IsRegisteredClass:
 3850|     68|{
 3851|     68|    return (class_id < rt->class_count &&
  ------------------
  |  Branch (3851:13): [True: 68, False: 0]
  ------------------
 3852|     68|            rt->class_array[class_id].class_id != 0);
  ------------------
  |  Branch (3852:13): [True: 0, False: 68]
  ------------------
 3853|     68|}
JS_NewClass:
 3907|     16|{
 3908|     16|    int ret, len;
 3909|     16|    JSAtom name;
 3910|       |
 3911|     16|    len = strlen(class_def->class_name);
 3912|     16|    name = __JS_FindAtom(rt, class_def->class_name, len, JS_ATOM_TYPE_STRING);
 3913|     16|    if (name == JS_ATOM_NULL) {
  ------------------
  |  |  451|     16|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (3913:9): [True: 16, False: 0]
  ------------------
 3914|     16|        name = __JS_NewAtomInit(rt, class_def->class_name, len, JS_ATOM_TYPE_STRING);
 3915|     16|        if (name == JS_ATOM_NULL)
  ------------------
  |  |  451|     16|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (3915:13): [True: 0, False: 16]
  ------------------
 3916|      0|            return -1;
 3917|     16|    }
 3918|     16|    ret = JS_NewClass1(rt, class_id, class_def, name);
 3919|     16|    JS_FreeAtomRT(rt, name);
 3920|     16|    return ret;
 3921|     16|}
JS_NewStringLen:
 4358|  6.88k|{
 4359|  6.88k|    const uint8_t *p, *p_end, *p_start, *p_next;
 4360|  6.88k|    uint32_t c;
 4361|  6.88k|    StringBuffer b_s, *b = &b_s;
 4362|  6.88k|    size_t len1;
 4363|       |
 4364|  6.88k|    p_start = (const uint8_t *)buf;
 4365|  6.88k|    p_end = p_start + buf_len;
 4366|  6.88k|    len1 = count_ascii(p_start, buf_len);
 4367|  6.88k|    p = p_start + len1;
 4368|  6.88k|    if (len1 > JS_STRING_LEN_MAX)
  ------------------
  |  |  212|  6.88k|#define JS_STRING_LEN_MAX ((1 << 30) - 1)
  ------------------
  |  Branch (4368:9): [True: 0, False: 6.88k]
  ------------------
 4369|      0|        return JS_ThrowInternalError(ctx, "string too long");
 4370|  6.88k|    if (p == p_end) {
  ------------------
  |  Branch (4370:9): [True: 6.86k, False: 19]
  ------------------
 4371|       |        /* ASCII string */
 4372|  6.86k|        return js_new_string8_len(ctx, buf, buf_len);
 4373|  6.86k|    } else {
 4374|     19|        if (string_buffer_init(ctx, b, buf_len))
  ------------------
  |  Branch (4374:13): [True: 0, False: 19]
  ------------------
 4375|      0|            goto fail;
 4376|     19|        string_buffer_write8(b, p_start, len1);
 4377|  2.09M|        while (p < p_end) {
  ------------------
  |  Branch (4377:16): [True: 2.09M, False: 19]
  ------------------
 4378|  2.09M|            if (*p < 128) {
  ------------------
  |  Branch (4378:17): [True: 2.09M, False: 20]
  ------------------
 4379|  2.09M|                string_buffer_putc8(b, *p++);
 4380|  2.09M|            } else {
 4381|       |                /* parse utf-8 sequence, return 0xFFFFFFFF for error */
 4382|     20|                c = unicode_from_utf8(p, p_end - p, &p_next);
 4383|     20|                if (c < 0x10000) {
  ------------------
  |  Branch (4383:21): [True: 18, False: 2]
  ------------------
 4384|     18|                    p = p_next;
 4385|     18|                } else if (c <= 0x10FFFF) {
  ------------------
  |  Branch (4385:28): [True: 0, False: 2]
  ------------------
 4386|      0|                    p = p_next;
 4387|       |                    /* surrogate pair */
 4388|      0|                    string_buffer_putc16(b, get_hi_surrogate(c));
 4389|      0|                    c = get_lo_surrogate(c);
 4390|      2|                } else {
 4391|       |                    /* invalid char */
 4392|      2|                    c = 0xfffd;
 4393|       |                    /* skip the invalid chars */
 4394|       |                    /* XXX: seems incorrect. Why not just use c = *p++; ? */
 4395|      2|                    while (p < p_end && (*p >= 0x80 && *p < 0xc0))
  ------------------
  |  Branch (4395:28): [True: 2, False: 0]
  |  Branch (4395:42): [True: 2, False: 0]
  |  Branch (4395:56): [True: 0, False: 2]
  ------------------
 4396|      0|                        p++;
 4397|      2|                    if (p < p_end) {
  ------------------
  |  Branch (4397:25): [True: 2, False: 0]
  ------------------
 4398|      2|                        p++;
 4399|      2|                        while (p < p_end && (*p >= 0x80 && *p < 0xc0))
  ------------------
  |  Branch (4399:32): [True: 2, False: 0]
  |  Branch (4399:46): [True: 1, False: 1]
  |  Branch (4399:60): [True: 0, False: 1]
  ------------------
 4400|      0|                            p++;
 4401|      2|                    }
 4402|      2|                }
 4403|     20|                string_buffer_putc16(b, c);
 4404|     20|            }
 4405|  2.09M|        }
 4406|     19|    }
 4407|     19|    return string_buffer_end(b);
 4408|       |
 4409|      0| fail:
 4410|      0|    string_buffer_free(b);
 4411|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 4412|  6.88k|}
JS_ToCStringLen2:
 4459|    120|{
 4460|    120|    JSValue val;
 4461|    120|    JSString *str, *str_new;
 4462|    120|    int pos, len, c, c1;
 4463|    120|    uint8_t *q;
 4464|       |
 4465|    120|    if (JS_VALUE_GET_TAG(val1) != JS_TAG_STRING) {
  ------------------
  |  |  236|    120|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (4465:9): [True: 1, False: 119]
  ------------------
 4466|      1|        val = JS_ToString(ctx, val1);
 4467|      1|        if (JS_IsException(val))
  ------------------
  |  Branch (4467:13): [True: 0, False: 1]
  ------------------
 4468|      0|            goto fail;
 4469|    119|    } else {
 4470|    119|        val = JS_DupValue(ctx, val1);
 4471|    119|    }
 4472|       |
 4473|    120|    str = JS_VALUE_GET_STRING(val);
  ------------------
  |  |  230|    120|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    120|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4474|    120|    len = str->len;
 4475|    120|    if (!str->is_wide_char) {
  ------------------
  |  Branch (4475:9): [True: 116, False: 4]
  ------------------
 4476|    116|        const uint8_t *src = str->u.str8;
 4477|    116|        int count;
 4478|       |
 4479|       |        /* count the number of non-ASCII characters */
 4480|       |        /* Scanning the whole string is required for ASCII strings,
 4481|       |           and computing the number of non-ASCII bytes is less expensive
 4482|       |           than testing each byte, hence this method is faster for ASCII
 4483|       |           strings, which is the most common case.
 4484|       |         */
 4485|    116|        count = 0;
 4486|    741|        for (pos = 0; pos < len; pos++) {
  ------------------
  |  Branch (4486:23): [True: 625, False: 116]
  ------------------
 4487|    625|            count += src[pos] >> 7;
 4488|    625|        }
 4489|    116|        if (count == 0) {
  ------------------
  |  Branch (4489:13): [True: 116, False: 0]
  ------------------
 4490|    116|            if (plen)
  ------------------
  |  Branch (4490:17): [True: 7, False: 109]
  ------------------
 4491|      7|                *plen = len;
 4492|    116|            return (const char *)src;
 4493|    116|        }
 4494|      0|        str_new = js_alloc_string(ctx, len + count, 0);
 4495|      0|        if (!str_new)
  ------------------
  |  Branch (4495:13): [True: 0, False: 0]
  ------------------
 4496|      0|            goto fail;
 4497|      0|        q = str_new->u.str8;
 4498|      0|        for (pos = 0; pos < len; pos++) {
  ------------------
  |  Branch (4498:23): [True: 0, False: 0]
  ------------------
 4499|      0|            c = src[pos];
 4500|      0|            if (c < 0x80) {
  ------------------
  |  Branch (4500:17): [True: 0, False: 0]
  ------------------
 4501|      0|                *q++ = c;
 4502|      0|            } else {
 4503|      0|                *q++ = (c >> 6) | 0xc0;
 4504|      0|                *q++ = (c & 0x3f) | 0x80;
 4505|      0|            }
 4506|      0|        }
 4507|      4|    } else {
 4508|      4|        const uint16_t *src = str->u.str16;
 4509|       |        /* Allocate 3 bytes per 16 bit code point. Surrogate pairs may
 4510|       |           produce 4 bytes but use 2 code points.
 4511|       |         */
 4512|      4|        str_new = js_alloc_string(ctx, len * 3, 0);
 4513|      4|        if (!str_new)
  ------------------
  |  Branch (4513:13): [True: 0, False: 4]
  ------------------
 4514|      0|            goto fail;
 4515|      4|        q = str_new->u.str8;
 4516|      4|        pos = 0;
 4517|  2.46M|        while (pos < len) {
  ------------------
  |  Branch (4517:16): [True: 2.46M, False: 4]
  ------------------
 4518|  2.46M|            c = src[pos++];
 4519|  2.46M|            if (c < 0x80) {
  ------------------
  |  Branch (4519:17): [True: 2.46M, False: 1.24k]
  ------------------
 4520|  2.46M|                *q++ = c;
 4521|  2.46M|            } else {
 4522|  1.24k|                if (is_hi_surrogate(c)) {
  ------------------
  |  Branch (4522:21): [True: 1, False: 1.24k]
  ------------------
 4523|      1|                    if (pos < len && !cesu8) {
  ------------------
  |  Branch (4523:25): [True: 1, False: 0]
  |  Branch (4523:38): [True: 1, False: 0]
  ------------------
 4524|      1|                        c1 = src[pos];
 4525|      1|                        if (is_lo_surrogate(c1)) {
  ------------------
  |  Branch (4525:29): [True: 0, False: 1]
  ------------------
 4526|      0|                            pos++;
 4527|      0|                            c = from_surrogate(c, c1);
 4528|      1|                        } else {
 4529|       |                            /* Keep unmatched surrogate code points */
 4530|       |                            /* c = 0xfffd; */ /* error */
 4531|      1|                        }
 4532|      1|                    } else {
 4533|       |                        /* Keep unmatched surrogate code points */
 4534|       |                        /* c = 0xfffd; */ /* error */
 4535|      0|                    }
 4536|      1|                }
 4537|  1.24k|                q += unicode_to_utf8(q, c);
 4538|  1.24k|            }
 4539|  2.46M|        }
 4540|      4|    }
 4541|       |
 4542|      4|    *q = '\0';
 4543|      4|    str_new->len = q - str_new->u.str8;
 4544|      4|    JS_FreeValue(ctx, val);
 4545|      4|    if (plen)
  ------------------
  |  Branch (4545:9): [True: 4, False: 0]
  ------------------
 4546|      4|        *plen = str_new->len;
 4547|      4|    return (const char *)str_new->u.str8;
 4548|      0| fail:
 4549|      0|    if (plen)
  ------------------
  |  Branch (4549:9): [True: 0, False: 0]
  ------------------
 4550|      0|        *plen = 0;
 4551|       |    return NULL;
 4552|    120|}
JS_FreeCString:
 4555|    120|{
 4556|    120|    JSString *p;
 4557|    120|    if (!ptr)
  ------------------
  |  Branch (4557:9): [True: 0, False: 120]
  ------------------
 4558|      0|        return;
 4559|       |    /* purposely removing constness */
 4560|    120|    p = container_of(ptr, JSString, u);
  ------------------
  |  |   51|    120|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 4561|    120|    JS_FreeValue(ctx, JS_MKPTR(JS_TAG_STRING, p));
  ------------------
  |  |  248|    120|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 4562|    120|}
JS_NewObjectProtoClass:
 5745|  2.25k|{
 5746|  2.25k|    JSShape *sh;
 5747|  2.25k|    JSObject *proto;
 5748|       |
 5749|  2.25k|    proto = get_proto_obj(proto_val);
 5750|  2.25k|    sh = find_hashed_shape_proto(ctx->rt, proto);
 5751|  2.25k|    if (likely(sh)) {
  ------------------
  |  |   32|  2.25k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 1.05k, False: 1.19k]
  |  |  ------------------
  ------------------
 5752|  1.05k|        sh = js_dup_shape(sh);
 5753|  1.19k|    } else {
 5754|  1.19k|        sh = js_new_shape(ctx, proto);
 5755|  1.19k|        if (!sh)
  ------------------
  |  Branch (5755:13): [True: 0, False: 1.19k]
  ------------------
 5756|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 5757|  1.19k|    }
 5758|  2.25k|    return JS_NewObjectFromShape(ctx, sh, class_id, NULL);
 5759|  2.25k|}
JS_NewObjectClass:
 5832|     99|{
 5833|     99|    return JS_NewObjectProtoClass(ctx, ctx->class_proto[class_id], class_id);
 5834|     99|}
JS_NewArray:
 5842|     33|{
 5843|     33|    return JS_NewObjectFromShape(ctx, js_dup_shape(ctx->array_shape),
 5844|       |                                 JS_CLASS_ARRAY, NULL);
 5845|     33|}
JS_NewObject:
 5848|     50|{
 5849|       |    /* inline JS_NewObjectClass(ctx, JS_CLASS_OBJECT); */
 5850|     50|    return JS_NewObjectProtoClass(ctx, ctx->class_proto[JS_CLASS_OBJECT], JS_CLASS_OBJECT);
 5851|     50|}
JS_NewCFunction2:
 5986|  1.90k|{
 5987|  1.90k|    return JS_NewCFunction3(ctx, func, name, length, cproto, magic,
 5988|  1.90k|                            ctx->function_proto, 0);
 5989|  1.90k|}
JS_NewCFunctionData:
 6050|     49|{
 6051|     49|    JSCFunctionDataRecord *s;
 6052|     49|    JSValue func_obj;
 6053|     49|    int i;
 6054|       |
 6055|     49|    func_obj = JS_NewObjectProtoClass(ctx, ctx->function_proto,
 6056|     49|                                      JS_CLASS_C_FUNCTION_DATA);
 6057|     49|    if (JS_IsException(func_obj))
  ------------------
  |  Branch (6057:9): [True: 0, False: 49]
  ------------------
 6058|      0|        return func_obj;
 6059|     49|    s = js_malloc(ctx, sizeof(*s) + data_len * sizeof(JSValue));
 6060|     49|    if (!s) {
  ------------------
  |  Branch (6060:9): [True: 0, False: 49]
  ------------------
 6061|      0|        JS_FreeValue(ctx, func_obj);
 6062|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 6063|      0|    }
 6064|     49|    s->func = func;
 6065|     49|    s->length = length;
 6066|     49|    s->data_len = data_len;
 6067|     49|    s->magic = magic;
 6068|    130|    for(i = 0; i < data_len; i++)
  ------------------
  |  Branch (6068:16): [True: 81, False: 49]
  ------------------
 6069|     81|        s->data[i] = JS_DupValue(ctx, data[i]);
 6070|     49|    JS_SetOpaque(func_obj, s);
 6071|     49|    js_function_set_properties(ctx, func_obj,
 6072|     49|                               JS_ATOM_empty_string, length);
 6073|     49|    return func_obj;
 6074|     49|}
__JS_FreeValueRT:
 6433|  77.6k|{
 6434|  77.6k|    uint32_t tag = JS_VALUE_GET_TAG(v);
  ------------------
  |  |  236|  77.6k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
 6435|       |
 6436|       |#ifdef DUMP_FREE
 6437|       |    {
 6438|       |        printf("Freeing ");
 6439|       |        if (tag == JS_TAG_OBJECT) {
 6440|       |            JS_DumpObject(rt, JS_VALUE_GET_OBJ(v));
 6441|       |        } else {
 6442|       |            JS_DumpValueShort(rt, v);
 6443|       |            printf("\n");
 6444|       |        }
 6445|       |    }
 6446|       |#endif
 6447|       |
 6448|  77.6k|    switch(tag) {
 6449|  73.4k|    case JS_TAG_STRING:
  ------------------
  |  Branch (6449:5): [True: 73.4k, False: 4.17k]
  ------------------
 6450|  73.4k|        {
 6451|  73.4k|            JSString *p = JS_VALUE_GET_STRING(v);
  ------------------
  |  |  230|  73.4k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  73.4k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6452|  73.4k|            if (p->atom_type) {
  ------------------
  |  Branch (6452:17): [True: 569, False: 72.8k]
  ------------------
 6453|    569|                JS_FreeAtomStruct(rt, p);
 6454|  72.8k|            } else {
 6455|       |#ifdef DUMP_LEAKS
 6456|       |                list_del(&p->link);
 6457|       |#endif
 6458|  72.8k|                js_free_rt(rt, p);
 6459|  72.8k|            }
 6460|  73.4k|        }
 6461|  73.4k|        break;
 6462|      1|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (6462:5): [True: 1, False: 77.5k]
  ------------------
 6463|       |        /* Note: recursion is acceptable because the rope depth is bounded */
 6464|      1|        {
 6465|      1|            JSStringRope *p = JS_VALUE_GET_STRING_ROPE(v);
  ------------------
  |  |  231|      1|#define JS_VALUE_GET_STRING_ROPE(v) ((JSStringRope *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6466|      1|            JS_FreeValueRT(rt, p->left);
 6467|      1|            JS_FreeValueRT(rt, p->right);
 6468|      1|            js_free_rt(rt, p);
 6469|      1|        }
 6470|      1|        break;
 6471|  4.14k|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (6471:5): [True: 4.14k, False: 73.4k]
  ------------------
 6472|  4.17k|    case JS_TAG_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6472:5): [True: 31, False: 77.5k]
  ------------------
 6473|  4.17k|    case JS_TAG_MODULE:
  ------------------
  |  Branch (6473:5): [True: 0, False: 77.6k]
  ------------------
 6474|  4.17k|        {
 6475|  4.17k|            JSGCObjectHeader *p = JS_VALUE_GET_PTR(v);
  ------------------
  |  |  243|  4.17k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
 6476|  4.17k|            if (rt->gc_phase != JS_GC_PHASE_REMOVE_CYCLES) {
  ------------------
  |  Branch (6476:17): [True: 168, False: 4.00k]
  ------------------
 6477|    168|                list_del(&p->link);
 6478|    168|                list_add(&p->link, &rt->gc_zero_ref_count_list);
 6479|    168|                js_rc(p)->mark = 1; /* indicate that the object is about to be freed */
 6480|    168|                if (rt->gc_phase == JS_GC_PHASE_NONE) {
  ------------------
  |  Branch (6480:21): [True: 109, False: 59]
  ------------------
 6481|    109|                    free_zero_refcount(rt);
 6482|    109|                }
 6483|    168|            }
 6484|  4.17k|        }
 6485|  4.17k|        break;
 6486|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (6486:5): [True: 0, False: 77.6k]
  ------------------
 6487|      0|        {
 6488|      0|            JSBigInt *p = JS_VALUE_GET_PTR(v);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
 6489|      0|            js_free_rt(rt, p);
 6490|      0|        }
 6491|      0|        break;
 6492|      0|    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (6492:5): [True: 0, False: 77.6k]
  ------------------
 6493|      0|        {
 6494|      0|            JSAtomStruct *p = JS_VALUE_GET_PTR(v);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
 6495|      0|            JS_FreeAtomStruct(rt, p);
 6496|      0|        }
 6497|      0|        break;
 6498|      0|    default:
  ------------------
  |  Branch (6498:5): [True: 0, False: 77.6k]
  ------------------
 6499|      0|        abort();
 6500|  77.6k|    }
 6501|  77.6k|}
__JS_FreeValue:
 6504|  1.30k|{
 6505|  1.30k|    __JS_FreeValueRT(ctx->rt, v);
 6506|  1.30k|}
JS_MarkValue:
 6554|   737k|{
 6555|   737k|    if (JS_VALUE_HAS_REF_COUNT(val)) {
  ------------------
  |  |  287|   737k|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|   737k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (287:35): [True: 717k, False: 19.7k]
  |  |  ------------------
  ------------------
 6556|   717k|        switch(JS_VALUE_GET_TAG(val)) {
  ------------------
  |  |  236|   717k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
 6557|  18.8k|        case JS_TAG_OBJECT:
  ------------------
  |  Branch (6557:9): [True: 18.8k, False: 698k]
  ------------------
 6558|  18.9k|        case JS_TAG_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6558:9): [True: 70, False: 717k]
  ------------------
 6559|  19.1k|        case JS_TAG_MODULE:
  ------------------
  |  Branch (6559:9): [True: 186, False: 717k]
  ------------------
 6560|  19.1k|            mark_func(rt, JS_VALUE_GET_PTR(val));
  ------------------
  |  |  243|  19.1k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
 6561|  19.1k|            break;
 6562|   698k|        default:
  ------------------
  |  Branch (6562:9): [True: 698k, False: 19.1k]
  ------------------
 6563|   698k|            break;
 6564|   717k|        }
 6565|   717k|    }
 6566|   737k|}
JS_RunGC:
 6836|     14|{
 6837|     14|    JS_RunGCInternal(rt, TRUE);
 6838|     14|}
JS_GetGlobalObject:
 7350|     17|{
 7351|     17|    return JS_DupValue(ctx, ctx->global_obj);
 7352|     17|}
JS_Throw:
 7356|     33|{
 7357|     33|    JSRuntime *rt = ctx->rt;
 7358|     33|    JS_FreeValue(ctx, rt->current_exception);
 7359|     33|    rt->current_exception = obj;
 7360|     33|    rt->current_exception_is_uncatchable = FALSE;
 7361|     33|    return JS_EXCEPTION;
  ------------------
  |  |  294|     33|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|     33|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 7362|     33|}
JS_ThrowTypeError:
 7688|     17|{
 7689|     17|    JSValue val;
 7690|     17|    va_list ap;
 7691|       |
 7692|     17|    va_start(ap, fmt);
 7693|     17|    val = JS_ThrowError(ctx, JS_TYPE_ERROR, fmt, ap);
 7694|       |    va_end(ap);
 7695|     17|    return val;
 7696|     17|}
JS_ThrowReferenceError:
 7746|      9|{
 7747|      9|    JSValue val;
 7748|      9|    va_list ap;
 7749|       |
 7750|      9|    va_start(ap, fmt);
 7751|      9|    val = JS_ThrowError(ctx, JS_REFERENCE_ERROR, fmt, ap);
 7752|       |    va_end(ap);
 7753|      9|    return val;
 7754|      9|}
JS_ThrowInternalError:
 7768|      2|{
 7769|      2|    JSValue val;
 7770|      2|    va_list ap;
 7771|       |
 7772|      2|    va_start(ap, fmt);
 7773|      2|    val = JS_ThrowError(ctx, JS_INTERNAL_ERROR, fmt, ap);
 7774|       |    va_end(ap);
 7775|      2|    return val;
 7776|      2|}
JS_GetPrototype:
 8028|      6|{
 8029|      6|    JSValue val;
 8030|      6|    if (JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT) {
  ------------------
  |  |  236|      6|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (8030:9): [True: 6, False: 0]
  ------------------
 8031|      6|        JSObject *p;
 8032|      6|        p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|      6|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      6|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8033|      6|        if (unlikely(p->is_exotic)) {
  ------------------
  |  |   33|      6|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 6]
  |  |  ------------------
  ------------------
 8034|      0|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8035|      0|            if (em && em->get_prototype) {
  ------------------
  |  Branch (8035:17): [True: 0, False: 0]
  |  Branch (8035:23): [True: 0, False: 0]
  ------------------
 8036|      0|                return em->get_prototype(ctx, obj);
 8037|      0|            }
 8038|      0|        }
 8039|      6|        p = p->shape->proto;
 8040|      6|        if (!p)
  ------------------
  |  Branch (8040:13): [True: 2, False: 4]
  ------------------
 8041|      2|            val = JS_NULL;
  ------------------
  |  |  290|      2|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8042|      4|        else
 8043|      4|            val = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|      4|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8044|      6|    } else {
 8045|      0|        val = JS_DupValue(ctx, JS_GetPrototypePrimitive(ctx, obj));
 8046|      0|    }
 8047|      6|    return val;
 8048|      6|}
JS_GetPropertyInternal:
 8213|  1.01M|{
 8214|  1.01M|    JSObject *p;
 8215|  1.01M|    JSProperty *pr;
 8216|  1.01M|    JSShapeProperty *prs;
 8217|  1.01M|    uint32_t tag;
 8218|       |
 8219|  1.01M|    tag = JS_VALUE_GET_TAG(obj);
  ------------------
  |  |  236|  1.01M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
 8220|  1.01M|    if (unlikely(tag != JS_TAG_OBJECT)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 5, False: 1.01M]
  |  |  ------------------
  ------------------
 8221|      5|        switch(tag) {
 8222|      0|        case JS_TAG_NULL:
  ------------------
  |  Branch (8222:9): [True: 0, False: 5]
  ------------------
 8223|      0|            return JS_ThrowTypeErrorAtom(ctx, "cannot read property '%s' of null", prop);
  ------------------
  |  | 7731|      0|#define JS_ThrowTypeErrorAtom(ctx, fmt, atom) __JS_ThrowTypeErrorAtom(ctx, atom, fmt, "")
  ------------------
 8224|      0|        case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (8224:9): [True: 0, False: 5]
  ------------------
 8225|      0|            return JS_ThrowTypeErrorAtom(ctx, "cannot read property '%s' of undefined", prop);
  ------------------
  |  | 7731|      0|#define JS_ThrowTypeErrorAtom(ctx, fmt, atom) __JS_ThrowTypeErrorAtom(ctx, atom, fmt, "")
  ------------------
 8226|      0|        case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (8226:9): [True: 0, False: 5]
  ------------------
 8227|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8228|      5|        case JS_TAG_STRING:
  ------------------
  |  Branch (8228:9): [True: 5, False: 0]
  ------------------
 8229|      5|            {
 8230|      5|                JSString *p1 = JS_VALUE_GET_STRING(obj);
  ------------------
  |  |  230|      5|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      5|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8231|      5|                if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (8231:21): [True: 0, False: 5]
  ------------------
 8232|      0|                    uint32_t idx;
 8233|      0|                    idx = __JS_AtomToUInt32(prop);
 8234|      0|                    if (idx < p1->len) {
  ------------------
  |  Branch (8234:25): [True: 0, False: 0]
  ------------------
 8235|      0|                        return js_new_string_char(ctx, string_get(p1, idx));
 8236|      0|                    }
 8237|      5|                } else if (prop == JS_ATOM_length) {
  ------------------
  |  Branch (8237:28): [True: 0, False: 5]
  ------------------
 8238|      0|                    return JS_NewInt32(ctx, p1->len);
 8239|      0|                }
 8240|      5|            }
 8241|      5|            break;
 8242|      5|        case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (8242:9): [True: 0, False: 5]
  ------------------
 8243|      0|            {
 8244|      0|                JSStringRope *p1 = JS_VALUE_GET_STRING_ROPE(obj);
  ------------------
  |  |  231|      0|#define JS_VALUE_GET_STRING_ROPE(v) ((JSStringRope *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8245|      0|                if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (8245:21): [True: 0, False: 0]
  ------------------
 8246|      0|                    uint32_t idx;
 8247|      0|                    idx = __JS_AtomToUInt32(prop);
 8248|      0|                    if (idx < p1->len) {
  ------------------
  |  Branch (8248:25): [True: 0, False: 0]
  ------------------
 8249|      0|                        return js_new_string_char(ctx, string_rope_get(obj, idx));
 8250|      0|                    }
 8251|      0|                } else if (prop == JS_ATOM_length) {
  ------------------
  |  Branch (8251:28): [True: 0, False: 0]
  ------------------
 8252|      0|                    return JS_NewInt32(ctx, p1->len);
 8253|      0|                }
 8254|      0|            }
 8255|      0|            break;
 8256|      0|        default:
  ------------------
  |  Branch (8256:9): [True: 0, False: 5]
  ------------------
 8257|      0|            break;
 8258|      5|        }
 8259|       |        /* cannot raise an exception */
 8260|      5|        p = JS_VALUE_GET_OBJ(JS_GetPrototypePrimitive(ctx, obj));
  ------------------
  |  |  229|      5|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      5|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8261|      5|        if (!p)
  ------------------
  |  Branch (8261:13): [True: 0, False: 5]
  ------------------
 8262|      0|            return JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8263|  1.01M|    } else {
 8264|  1.01M|        p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|  1.01M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.01M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8265|  1.01M|    }
 8266|       |
 8267|  2.02M|    for(;;) {
 8268|  2.02M|        prs = find_own_property(&pr, p, prop);
 8269|  2.02M|        if (prs) {
  ------------------
  |  Branch (8269:13): [True: 1.01M, False: 1.01M]
  ------------------
 8270|       |            /* found */
 8271|  1.01M|            if (unlikely(prs->flags & JS_PROP_TMASK)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 276, False: 1.01M]
  |  |  ------------------
  ------------------
 8272|    276|                if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|    276|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  305|    276|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (8272:21): [True: 20, False: 256]
  ------------------
 8273|     20|                    if (unlikely(!pr->u.getset.getter)) {
  ------------------
  |  |   33|     20|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 20]
  |  |  ------------------
  ------------------
 8274|      0|                        return JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8275|     20|                    } else {
 8276|     20|                        JSValue func = JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.getter);
  ------------------
  |  |  248|     20|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8277|       |                        /* Note: the field could be removed in the getter */
 8278|     20|                        func = JS_DupValue(ctx, func);
 8279|     20|                        return JS_CallFree(ctx, func, this_obj, 0, NULL);
 8280|     20|                    }
 8281|    256|                } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  303|    256|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  306|    256|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (8281:28): [True: 51, False: 205]
  ------------------
 8282|     51|                    JSValue val = *pr->u.var_ref->pvalue;
 8283|     51|                    if (unlikely(JS_IsUninitialized(val)))
  ------------------
  |  |   33|     51|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 51]
  |  |  ------------------
  ------------------
 8284|      0|                        return JS_ThrowReferenceErrorUninitialized(ctx, prs->atom);
 8285|     51|                    return JS_DupValue(ctx, val);
 8286|    205|                } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  303|    205|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  307|    205|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (8286:28): [True: 205, False: 0]
  ------------------
 8287|       |                    /* Instantiate property and retry */
 8288|    205|                    if (JS_AutoInitProperty(ctx, p, prop, pr, prs))
  ------------------
  |  Branch (8288:25): [True: 0, False: 205]
  ------------------
 8289|      0|                        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8290|    205|                    continue;
 8291|    205|                }
 8292|  1.01M|            } else {
 8293|  1.01M|                return JS_DupValue(ctx, pr->u.value);
 8294|  1.01M|            }
 8295|  1.01M|        }
 8296|  1.01M|        if (unlikely(p->is_exotic)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 42, False: 1.01M]
  |  |  ------------------
  ------------------
 8297|       |            /* exotic behaviors */
 8298|     42|            if (p->fast_array) {
  ------------------
  |  Branch (8298:17): [True: 26, False: 16]
  ------------------
 8299|     26|                if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (8299:21): [True: 2, False: 24]
  ------------------
 8300|      2|                    uint32_t idx = __JS_AtomToUInt32(prop);
 8301|      2|                    if (idx < p->u.array.count) {
  ------------------
  |  Branch (8301:25): [True: 0, False: 2]
  ------------------
 8302|       |                        /* we avoid duplicating the code */
 8303|      0|                        return JS_GetPropertyUint32(ctx, JS_MKPTR(JS_TAG_OBJECT, p), idx);
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8304|      2|                    } else if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (8304:32): [True: 0, False: 2]
  ------------------
 8305|      0|                               p->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (8305:32): [True: 0, False: 0]
  ------------------
 8306|      0|                        return JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8307|      0|                    }
 8308|     24|                } else if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (8308:28): [True: 0, False: 24]
  ------------------
 8309|      0|                           p->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (8309:28): [True: 0, False: 0]
  ------------------
 8310|      0|                    int ret;
 8311|      0|                    ret = JS_AtomIsNumericIndex(ctx, prop);
 8312|      0|                    if (ret != 0) {
  ------------------
  |  Branch (8312:25): [True: 0, False: 0]
  ------------------
 8313|      0|                        if (ret < 0)
  ------------------
  |  Branch (8313:29): [True: 0, False: 0]
  ------------------
 8314|      0|                            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8315|      0|                        return JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8316|      0|                    }
 8317|      0|                }
 8318|     26|            } else {
 8319|     16|                const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8320|     16|                if (em) {
  ------------------
  |  Branch (8320:21): [True: 0, False: 16]
  ------------------
 8321|      0|                    if (em->get_property) {
  ------------------
  |  Branch (8321:25): [True: 0, False: 0]
  ------------------
 8322|      0|                        JSValue obj1, retval;
 8323|       |                        /* XXX: should pass throw_ref_error */
 8324|       |                        /* Note: if 'p' is a prototype, it can be
 8325|       |                           freed in the called function */
 8326|      0|                        obj1 = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8327|      0|                        retval = em->get_property(ctx, obj1, prop, this_obj);
 8328|      0|                        JS_FreeValue(ctx, obj1);
 8329|      0|                        return retval;
 8330|      0|                    }
 8331|      0|                    if (em->get_own_property) {
  ------------------
  |  Branch (8331:25): [True: 0, False: 0]
  ------------------
 8332|      0|                        JSPropertyDescriptor desc;
 8333|      0|                        int ret;
 8334|      0|                        JSValue obj1;
 8335|       |
 8336|       |                        /* Note: if 'p' is a prototype, it can be
 8337|       |                           freed in the called function */
 8338|      0|                        obj1 = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8339|      0|                        ret = em->get_own_property(ctx, &desc, obj1, prop);
 8340|      0|                        JS_FreeValue(ctx, obj1);
 8341|      0|                        if (ret < 0)
  ------------------
  |  Branch (8341:29): [True: 0, False: 0]
  ------------------
 8342|      0|                            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8343|      0|                        if (ret) {
  ------------------
  |  Branch (8343:29): [True: 0, False: 0]
  ------------------
 8344|      0|                            if (desc.flags & JS_PROP_GETSET) {
  ------------------
  |  |  305|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (8344:33): [True: 0, False: 0]
  ------------------
 8345|      0|                                JS_FreeValue(ctx, desc.setter);
 8346|      0|                                return JS_CallFree(ctx, desc.getter, this_obj, 0, NULL);
 8347|      0|                            } else {
 8348|      0|                                return desc.value;
 8349|      0|                            }
 8350|      0|                        }
 8351|      0|                    }
 8352|      0|                }
 8353|     16|            }
 8354|     42|        }
 8355|  1.01M|        p = p->shape->proto;
 8356|  1.01M|        if (!p)
  ------------------
  |  Branch (8356:13): [True: 21, False: 1.01M]
  ------------------
 8357|     21|            break;
 8358|  1.01M|    }
 8359|     21|    if (unlikely(throw_ref_error)) {
  ------------------
  |  |   33|     21|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 9, False: 12]
  |  |  ------------------
  ------------------
 8360|      9|        return JS_ThrowReferenceErrorNotDefined(ctx, prop);
 8361|     12|    } else {
 8362|     12|        return JS_UNDEFINED;
  ------------------
  |  |  291|     12|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     12|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8363|     12|    }
 8364|     21|}
JS_FreePropertyEnum:
 8587|     21|{
 8588|     21|    uint32_t i;
 8589|     21|    if (tab) {
  ------------------
  |  Branch (8589:9): [True: 21, False: 0]
  ------------------
 8590|     55|        for(i = 0; i < len; i++)
  ------------------
  |  Branch (8590:20): [True: 34, False: 21]
  ------------------
 8591|     34|            JS_FreeAtom(ctx, tab[i].atom);
 8592|     21|        js_free(ctx, tab);
 8593|     21|    }
 8594|     21|}
JS_IsExtensible:
 8907|     34|{
 8908|     34|    JSObject *p;
 8909|       |
 8910|     34|    if (unlikely(JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT))
  ------------------
  |  |   33|     34|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 34]
  |  |  ------------------
  ------------------
 8911|      0|        return FALSE;
 8912|     34|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|     34|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     34|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8913|     34|    if (unlikely(p->is_exotic)) {
  ------------------
  |  |   33|     34|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 34, False: 0]
  |  |  ------------------
  ------------------
 8914|     34|        const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8915|     34|        if (em && em->is_extensible) {
  ------------------
  |  Branch (8915:13): [True: 34, False: 0]
  |  Branch (8915:19): [True: 0, False: 34]
  ------------------
 8916|      0|            return em->is_extensible(ctx, obj);
 8917|      0|        }
 8918|     34|    }
 8919|     34|    return p->extensible;
 8920|     34|}
JS_PreventExtensions:
 8924|     17|{
 8925|     17|    JSObject *p;
 8926|       |
 8927|     17|    if (unlikely(JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT))
  ------------------
  |  |   33|     17|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 17]
  |  |  ------------------
  ------------------
 8928|      0|        return FALSE;
 8929|     17|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|     17|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     17|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8930|     17|    if (unlikely(p->is_exotic)) {
  ------------------
  |  |   33|     17|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 17]
  |  |  ------------------
  ------------------
 8931|      0|        if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (8931:13): [True: 0, False: 0]
  ------------------
 8932|      0|            p->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (8932:13): [True: 0, False: 0]
  ------------------
 8933|      0|            JSTypedArray *ta;
 8934|      0|            JSArrayBuffer *abuf;
 8935|       |            /* resizable type arrays return FALSE */
 8936|      0|            ta = p->u.typed_array;
 8937|      0|            abuf = ta->buffer->u.array_buffer;
 8938|      0|            if (ta->track_rab ||
  ------------------
  |  Branch (8938:17): [True: 0, False: 0]
  ------------------
 8939|      0|                (array_buffer_is_resizable(abuf) && !abuf->shared))
  ------------------
  |  Branch (8939:18): [True: 0, False: 0]
  |  Branch (8939:53): [True: 0, False: 0]
  ------------------
 8940|      0|                return FALSE;
 8941|      0|        } else {
 8942|      0|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8943|      0|            if (em && em->prevent_extensions) {
  ------------------
  |  Branch (8943:17): [True: 0, False: 0]
  |  Branch (8943:23): [True: 0, False: 0]
  ------------------
 8944|      0|                return em->prevent_extensions(ctx, obj);
 8945|      0|            }
 8946|      0|        }
 8947|      0|    }
 8948|     17|    p->extensible = FALSE;
 8949|     17|    return TRUE;
 8950|     17|}
JS_HasProperty:
 8954|      2|{
 8955|      2|    JSObject *p;
 8956|      2|    int ret;
 8957|      2|    JSValue obj1;
 8958|       |
 8959|      2|    if (unlikely(JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 8960|      0|        return FALSE;
 8961|      2|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8962|      4|    for(;;) {
 8963|      4|        if (p->is_exotic) {
  ------------------
  |  Branch (8963:13): [True: 0, False: 4]
  ------------------
 8964|      0|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8965|      0|            if (em && em->has_property) {
  ------------------
  |  Branch (8965:17): [True: 0, False: 0]
  |  Branch (8965:23): [True: 0, False: 0]
  ------------------
 8966|       |                /* has_property can free the prototype */
 8967|      0|                obj1 = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8968|      0|                ret = em->has_property(ctx, obj1, prop);
 8969|      0|                JS_FreeValue(ctx, obj1);
 8970|      0|                return ret;
 8971|      0|            }
 8972|      0|        }
 8973|       |        /* JS_GetOwnPropertyInternal can free the prototype */
 8974|      4|        JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|      4|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8975|      4|        ret = JS_GetOwnPropertyInternal(ctx, NULL, p, prop);
 8976|      4|        JS_FreeValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|      4|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8977|      4|        if (ret != 0)
  ------------------
  |  Branch (8977:13): [True: 0, False: 4]
  ------------------
 8978|      0|            return ret;
 8979|      4|        if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (8979:13): [True: 2, False: 2]
  ------------------
 8980|      2|            p->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (8980:13): [True: 0, False: 2]
  ------------------
 8981|      0|            ret = JS_AtomIsNumericIndex(ctx, prop);
 8982|      0|            if (ret != 0) {
  ------------------
  |  Branch (8982:17): [True: 0, False: 0]
  ------------------
 8983|      0|                if (ret < 0)
  ------------------
  |  Branch (8983:21): [True: 0, False: 0]
  ------------------
 8984|      0|                    return -1;
 8985|      0|                return FALSE;
 8986|      0|            }
 8987|      0|        }
 8988|      4|        p = p->shape->proto;
 8989|      4|        if (!p)
  ------------------
  |  Branch (8989:13): [True: 2, False: 2]
  ------------------
 8990|      2|            break;
 8991|      4|    }
 8992|      2|    return FALSE;
 8993|      2|}
JS_ValueToAtom:
 9004|   343k|{
 9005|   343k|    JSAtom atom;
 9006|   343k|    uint32_t tag;
 9007|   343k|    tag = JS_VALUE_GET_TAG(val);
  ------------------
  |  |  236|   343k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
 9008|   343k|    if (tag == JS_TAG_INT &&
  ------------------
  |  Branch (9008:9): [True: 343k, False: 34]
  ------------------
 9009|   343k|        (uint32_t)JS_VALUE_GET_INT(val) <= JS_ATOM_MAX_INT) {
  ------------------
  |  |  239|   343k|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
                      (uint32_t)JS_VALUE_GET_INT(val) <= JS_ATOM_MAX_INT) {
  ------------------
  |  | 2871|   343k|#define JS_ATOM_MAX_INT (JS_ATOM_TAG_INT - 1)
  |  |  ------------------
  |  |  |  | 2870|   343k|#define JS_ATOM_TAG_INT (1U << 31)
  |  |  ------------------
  ------------------
  |  Branch (9009:9): [True: 343k, False: 0]
  ------------------
 9010|       |        /* fast path for integer values */
 9011|   343k|        atom = __JS_AtomFromUInt32(JS_VALUE_GET_INT(val));
  ------------------
  |  |  239|   343k|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
 9012|   343k|    } else if (tag == JS_TAG_SYMBOL) {
  ------------------
  |  Branch (9012:16): [True: 0, False: 34]
  ------------------
 9013|      0|        JSAtomStruct *p = JS_VALUE_GET_PTR(val);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
 9014|      0|        atom = JS_DupAtom(ctx, js_get_atom_index(ctx->rt, p));
 9015|     34|    } else {
 9016|     34|        JSValue str;
 9017|     34|        str = JS_ToPropertyKey(ctx, val);
 9018|     34|        if (JS_IsException(str))
  ------------------
  |  Branch (9018:13): [True: 0, False: 34]
  ------------------
 9019|      0|            return JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
 9020|     34|        if (JS_VALUE_GET_TAG(str) == JS_TAG_SYMBOL) {
  ------------------
  |  |  236|     34|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (9020:13): [True: 0, False: 34]
  ------------------
 9021|      0|            atom = js_symbol_to_atom(ctx, str);
 9022|     34|        } else {
 9023|     34|            atom = JS_NewAtomStr(ctx, JS_VALUE_GET_STRING(str));
  ------------------
  |  |  230|     34|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     34|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9024|     34|        }
 9025|     34|    }
 9026|   343k|    return atom;
 9027|   343k|}
JS_GetPropertyUint32:
 9106|   343k|{
 9107|   343k|    return JS_GetPropertyValue(ctx, this_obj, JS_NewUint32(ctx, idx));
 9108|   343k|}
JS_SetPropertyInternal:
 9665|  1.01M|{
 9666|  1.01M|    JSObject *p, *p1;
 9667|  1.01M|    JSShapeProperty *prs;
 9668|  1.01M|    JSProperty *pr;
 9669|  1.01M|    uint32_t tag;
 9670|  1.01M|    JSPropertyDescriptor desc;
 9671|  1.01M|    int ret;
 9672|       |#if 0
 9673|       |    printf("JS_SetPropertyInternal: "); print_atom(ctx, prop); printf("\n");
 9674|       |#endif
 9675|  1.01M|    tag = JS_VALUE_GET_TAG(this_obj);
  ------------------
  |  |  236|  1.01M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
 9676|  1.01M|    if (unlikely(tag != JS_TAG_OBJECT)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.01M]
  |  |  ------------------
  ------------------
 9677|      0|        if (JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (9677:13): [True: 0, False: 0]
  ------------------
 9678|      0|            p = NULL;
 9679|      0|            p1 = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9680|      0|            goto prototype_lookup;
 9681|      0|        } else {
 9682|      0|            switch(tag) {
 9683|      0|            case JS_TAG_NULL:
  ------------------
  |  Branch (9683:13): [True: 0, False: 0]
  ------------------
 9684|      0|                JS_FreeValue(ctx, val);
 9685|      0|                JS_ThrowTypeErrorAtom(ctx, "cannot set property '%s' of null", prop);
  ------------------
  |  | 7731|      0|#define JS_ThrowTypeErrorAtom(ctx, fmt, atom) __JS_ThrowTypeErrorAtom(ctx, atom, fmt, "")
  ------------------
 9686|      0|                return -1;
 9687|      0|            case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (9687:13): [True: 0, False: 0]
  ------------------
 9688|      0|                JS_FreeValue(ctx, val);
 9689|      0|                JS_ThrowTypeErrorAtom(ctx, "cannot set property '%s' of undefined", prop);
  ------------------
  |  | 7731|      0|#define JS_ThrowTypeErrorAtom(ctx, fmt, atom) __JS_ThrowTypeErrorAtom(ctx, atom, fmt, "")
  ------------------
 9690|      0|                return -1;
 9691|      0|            default:
  ------------------
  |  Branch (9691:13): [True: 0, False: 0]
  ------------------
 9692|       |                /* even on a primitive type we can have setters on the prototype */
 9693|      0|                p = NULL;
 9694|      0|                p1 = JS_VALUE_GET_OBJ(JS_GetPrototypePrimitive(ctx, obj));
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9695|      0|                goto prototype_lookup;
 9696|      0|            }
 9697|      0|        }
 9698|  1.01M|    } else {
 9699|  1.01M|        p = JS_VALUE_GET_OBJ(this_obj);
  ------------------
  |  |  229|  1.01M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.01M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9700|  1.01M|        p1 = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|  1.01M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.01M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9701|  1.01M|        if (unlikely(p != p1))
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.01M]
  |  |  ------------------
  ------------------
 9702|      0|            goto retry2;
 9703|  1.01M|    }
 9704|       |
 9705|       |    /* fast path if obj == this_obj */
 9706|  1.01M| retry:
 9707|  1.01M|    prs = find_own_property(&pr, p1, prop);
 9708|  1.01M|    if (prs) {
  ------------------
  |  Branch (9708:9): [True: 1.00M, False: 153]
  ------------------
 9709|  1.00M|        if (likely((prs->flags & (JS_PROP_TMASK | JS_PROP_WRITABLE |
  ------------------
  |  |   32|  1.00M|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 1.00M, False: 0]
  |  |  ------------------
  ------------------
 9710|  1.00M|                                  JS_PROP_LENGTH)) == JS_PROP_WRITABLE)) {
 9711|       |            /* fast case */
 9712|  1.00M|            set_value(ctx, &pr->u.value, val);
 9713|  1.00M|            return TRUE;
 9714|  1.00M|        } else if (prs->flags & JS_PROP_LENGTH) {
  ------------------
  |  |  302|      0|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
  |  Branch (9714:20): [True: 0, False: 0]
  ------------------
 9715|      0|            assert(p->class_id == JS_CLASS_ARRAY);
  ------------------
  |  Branch (9715:13): [True: 0, False: 0]
  |  Branch (9715:13): [True: 0, False: 0]
  ------------------
 9716|      0|            assert(prop == JS_ATOM_length);
  ------------------
  |  Branch (9716:13): [True: 0, False: 0]
  |  Branch (9716:13): [True: 0, False: 0]
  ------------------
 9717|      0|            return set_array_length(ctx, p, val, flags);
 9718|      0|        } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  305|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (9718:20): [True: 0, False: 0]
  ------------------
 9719|      0|            return call_setter(ctx, pr->u.getset.setter, this_obj, val, flags);
 9720|      0|        } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  303|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  306|      0|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (9720:20): [True: 0, False: 0]
  ------------------
 9721|       |            /* XXX: already use var_ref->is_const. Cannot simplify use the
 9722|       |               writable flag for JS_CLASS_MODULE_NS. */
 9723|      0|            if (p->class_id == JS_CLASS_MODULE_NS || pr->u.var_ref->is_const)
  ------------------
  |  Branch (9723:17): [True: 0, False: 0]
  |  Branch (9723:54): [True: 0, False: 0]
  ------------------
 9724|      0|                goto read_only_prop;
 9725|      0|            set_value(ctx, pr->u.var_ref->pvalue, val);
 9726|      0|            return TRUE;
 9727|      0|        } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  303|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  307|      0|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (9727:20): [True: 0, False: 0]
  ------------------
 9728|       |            /* Instantiate property and retry (potentially useless) */
 9729|      0|            if (JS_AutoInitProperty(ctx, p, prop, pr, prs)) {
  ------------------
  |  Branch (9729:17): [True: 0, False: 0]
  ------------------
 9730|      0|                JS_FreeValue(ctx, val);
 9731|      0|                return -1;
 9732|      0|            }
 9733|      0|            goto retry;
 9734|      0|        } else {
 9735|      0|            goto read_only_prop;
 9736|      0|        }
 9737|  1.00M|    }
 9738|       |
 9739|    306|    for(;;) {
 9740|    306|        if (p1->is_exotic) {
  ------------------
  |  Branch (9740:13): [True: 0, False: 306]
  ------------------
 9741|      0|            if (p1->fast_array) {
  ------------------
  |  Branch (9741:17): [True: 0, False: 0]
  ------------------
 9742|      0|                if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (9742:21): [True: 0, False: 0]
  ------------------
 9743|      0|                    uint32_t idx = __JS_AtomToUInt32(prop);
 9744|      0|                    if (idx < p1->u.array.count) {
  ------------------
  |  Branch (9744:25): [True: 0, False: 0]
  ------------------
 9745|      0|                        if (unlikely(p == p1))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9746|      0|                            return JS_SetPropertyValue(ctx, this_obj, JS_NewInt32(ctx, idx), val, flags);
 9747|      0|                        else
 9748|      0|                            break;
 9749|      0|                    } else if (p1->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (9749:32): [True: 0, False: 0]
  ------------------
 9750|      0|                               p1->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (9750:32): [True: 0, False: 0]
  ------------------
 9751|      0|                        goto typed_array_oob;
 9752|      0|                    }
 9753|      0|                } else if (p1->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (9753:28): [True: 0, False: 0]
  ------------------
 9754|      0|                           p1->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (9754:28): [True: 0, False: 0]
  ------------------
 9755|      0|                    ret = JS_AtomIsNumericIndex(ctx, prop);
 9756|      0|                    if (ret != 0) {
  ------------------
  |  Branch (9756:25): [True: 0, False: 0]
  ------------------
 9757|      0|                        if (ret < 0) {
  ------------------
  |  Branch (9757:29): [True: 0, False: 0]
  ------------------
 9758|      0|                            JS_FreeValue(ctx, val);
 9759|      0|                            return -1;
 9760|      0|                        }
 9761|      0|                    typed_array_oob:
 9762|      0|                        if (p == p1) {
  ------------------
  |  Branch (9762:29): [True: 0, False: 0]
  ------------------
 9763|       |                            /* must convert the argument even if out of bound access */
 9764|      0|                            if (p1->class_id == JS_CLASS_BIG_INT64_ARRAY ||
  ------------------
  |  Branch (9764:33): [True: 0, False: 0]
  ------------------
 9765|      0|                                p1->class_id == JS_CLASS_BIG_UINT64_ARRAY) {
  ------------------
  |  Branch (9765:33): [True: 0, False: 0]
  ------------------
 9766|      0|                                int64_t v;
 9767|      0|                                if (JS_ToBigInt64Free(ctx, &v, val))
  ------------------
  |  Branch (9767:37): [True: 0, False: 0]
  ------------------
 9768|      0|                                    return -1;
 9769|      0|                            } else {
 9770|      0|                                val = JS_ToNumberFree(ctx, val);
 9771|      0|                                JS_FreeValue(ctx, val);
 9772|      0|                                if (JS_IsException(val))
  ------------------
  |  Branch (9772:37): [True: 0, False: 0]
  ------------------
 9773|      0|                                    return -1;
 9774|      0|                            }
 9775|      0|                        } else {
 9776|      0|                            JS_FreeValue(ctx, val);
 9777|      0|                        }
 9778|      0|                        return TRUE;
 9779|      0|                    }
 9780|      0|                }
 9781|      0|            } else {
 9782|      0|                const JSClassExoticMethods *em = ctx->rt->class_array[p1->class_id].exotic;
 9783|      0|                if (em) {
  ------------------
  |  Branch (9783:21): [True: 0, False: 0]
  ------------------
 9784|      0|                    JSValue obj1;
 9785|      0|                    if (em->set_property) {
  ------------------
  |  Branch (9785:25): [True: 0, False: 0]
  ------------------
 9786|       |                        /* set_property can free the prototype */
 9787|      0|                        obj1 = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p1));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 9788|      0|                        ret = em->set_property(ctx, obj1, prop,
 9789|      0|                                               val, this_obj, flags);
 9790|      0|                        JS_FreeValue(ctx, obj1);
 9791|      0|                        JS_FreeValue(ctx, val);
 9792|      0|                        return ret;
 9793|      0|                    }
 9794|      0|                    if (em->get_own_property) {
  ------------------
  |  Branch (9794:25): [True: 0, False: 0]
  ------------------
 9795|       |                        /* get_own_property can free the prototype */
 9796|      0|                        obj1 = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p1));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 9797|      0|                        ret = em->get_own_property(ctx, &desc,
 9798|      0|                                                   obj1, prop);
 9799|      0|                        JS_FreeValue(ctx, obj1);
 9800|      0|                        if (ret < 0) {
  ------------------
  |  Branch (9800:29): [True: 0, False: 0]
  ------------------
 9801|      0|                            JS_FreeValue(ctx, val);
 9802|      0|                            return ret;
 9803|      0|                        }
 9804|      0|                        if (ret) {
  ------------------
  |  Branch (9804:29): [True: 0, False: 0]
  ------------------
 9805|      0|                            if (desc.flags & JS_PROP_GETSET) {
  ------------------
  |  |  305|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (9805:33): [True: 0, False: 0]
  ------------------
 9806|      0|                                JSObject *setter;
 9807|      0|                                if (JS_IsUndefined(desc.setter))
  ------------------
  |  Branch (9807:37): [True: 0, False: 0]
  ------------------
 9808|      0|                                    setter = NULL;
 9809|      0|                                else
 9810|      0|                                    setter = JS_VALUE_GET_OBJ(desc.setter);
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9811|      0|                                ret = call_setter(ctx, setter, this_obj, val, flags);
 9812|      0|                                JS_FreeValue(ctx, desc.getter);
 9813|      0|                                JS_FreeValue(ctx, desc.setter);
 9814|      0|                                return ret;
 9815|      0|                            } else {
 9816|      0|                                JS_FreeValue(ctx, desc.value);
 9817|      0|                                if (!(desc.flags & JS_PROP_WRITABLE))
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (9817:37): [True: 0, False: 0]
  ------------------
 9818|      0|                                    goto read_only_prop;
 9819|      0|                                if (likely(p == p1)) {
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9820|      0|                                    ret = JS_DefineProperty(ctx, this_obj, prop, val,
 9821|      0|                                                            JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
                                                                          JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 9822|      0|                                                            JS_PROP_HAS_VALUE);
  ------------------
  |  |  316|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
 9823|      0|                                    JS_FreeValue(ctx, val);
 9824|      0|                                    return ret;
 9825|      0|                                } else {
 9826|      0|                                    break;
 9827|      0|                                }
 9828|      0|                            }
 9829|      0|                        }
 9830|      0|                    }
 9831|      0|                }
 9832|      0|            }
 9833|      0|        }
 9834|    306|        p1 = p1->shape->proto;
 9835|    306|    prototype_lookup:
 9836|    306|        if (!p1)
  ------------------
  |  Branch (9836:13): [True: 153, False: 153]
  ------------------
 9837|    153|            break;
 9838|       |
 9839|    153|    retry2:
 9840|    153|        prs = find_own_property(&pr, p1, prop);
 9841|    153|        if (prs) {
  ------------------
  |  Branch (9841:13): [True: 0, False: 153]
  ------------------
 9842|      0|            if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                          if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  305|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (9842:17): [True: 0, False: 0]
  ------------------
 9843|      0|                return call_setter(ctx, pr->u.getset.setter, this_obj, val, flags);
 9844|      0|            } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  303|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                          } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  307|      0|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (9844:24): [True: 0, False: 0]
  ------------------
 9845|       |                /* Instantiate property and retry (potentially useless) */
 9846|      0|                if (JS_AutoInitProperty(ctx, p1, prop, pr, prs))
  ------------------
  |  Branch (9846:21): [True: 0, False: 0]
  ------------------
 9847|      0|                    return -1;
 9848|      0|                goto retry2;
 9849|      0|            } else if (!(prs->flags & JS_PROP_WRITABLE)) {
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (9849:24): [True: 0, False: 0]
  ------------------
 9850|      0|                goto read_only_prop;
 9851|      0|            } else {
 9852|      0|                break;
 9853|      0|            }
 9854|      0|        }
 9855|    153|    }
 9856|       |
 9857|    153|    if (unlikely(!p)) {
  ------------------
  |  |   33|    153|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 153]
  |  |  ------------------
  ------------------
 9858|      0|        JS_FreeValue(ctx, val);
 9859|      0|        return JS_ThrowTypeErrorOrFalse(ctx, flags, "not an object");
 9860|      0|    }
 9861|       |
 9862|    153|    if (unlikely(!p->extensible)) {
  ------------------
  |  |   33|    153|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 153]
  |  |  ------------------
  ------------------
 9863|      0|        JS_FreeValue(ctx, val);
 9864|      0|        return JS_ThrowTypeErrorOrFalse(ctx, flags, "object is not extensible");
 9865|      0|    }
 9866|       |
 9867|    153|    if (likely(p == JS_VALUE_GET_OBJ(obj))) {
  ------------------
  |  |   32|    153|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 153, False: 0]
  |  |  ------------------
  ------------------
 9868|    153|        if (p->is_exotic) {
  ------------------
  |  Branch (9868:13): [True: 0, False: 153]
  ------------------
 9869|      0|            if (p->class_id == JS_CLASS_ARRAY && p->fast_array &&
  ------------------
  |  Branch (9869:17): [True: 0, False: 0]
  |  Branch (9869:50): [True: 0, False: 0]
  ------------------
 9870|      0|                __JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (9870:17): [True: 0, False: 0]
  ------------------
 9871|      0|                uint32_t idx = __JS_AtomToUInt32(prop);
 9872|      0|                if (idx == p->u.array.count) {
  ------------------
  |  Branch (9872:21): [True: 0, False: 0]
  ------------------
 9873|       |                    /* fast case */
 9874|      0|                    return add_fast_array_element(ctx, p, val, flags);
 9875|      0|                } else {
 9876|      0|                    goto generic_create_prop;
 9877|      0|                }
 9878|      0|            } else {
 9879|      0|                goto generic_create_prop;
 9880|      0|            }
 9881|    153|        } else {
 9882|    153|            if (unlikely(p->class_id == JS_CLASS_GLOBAL_OBJECT))
  ------------------
  |  |   33|    153|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 119, False: 34]
  |  |  ------------------
  ------------------
 9883|    119|                goto generic_create_prop;
 9884|     34|            pr = add_property(ctx, p, prop, JS_PROP_C_W_E);
  ------------------
  |  |  301|     34|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     34|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|     34|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|     34|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
 9885|     34|            if (unlikely(!pr)) {
  ------------------
  |  |   33|     34|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 34]
  |  |  ------------------
  ------------------
 9886|      0|                JS_FreeValue(ctx, val);
 9887|      0|                return -1;
 9888|      0|            }
 9889|     34|            pr->u.value = val;
 9890|     34|            return TRUE;
 9891|     34|        }
 9892|    153|    } else {
 9893|       |        /* generic case: modify the property in this_obj if it already exists */
 9894|      0|        ret = JS_GetOwnPropertyInternal(ctx, &desc, p, prop);
 9895|      0|        if (ret < 0) {
  ------------------
  |  Branch (9895:13): [True: 0, False: 0]
  ------------------
 9896|      0|            JS_FreeValue(ctx, val);
 9897|      0|            return ret;
 9898|      0|        }
 9899|      0|        if (ret) {
  ------------------
  |  Branch (9899:13): [True: 0, False: 0]
  ------------------
 9900|      0|            if (desc.flags & JS_PROP_GETSET) {
  ------------------
  |  |  305|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (9900:17): [True: 0, False: 0]
  ------------------
 9901|      0|                JS_FreeValue(ctx, desc.getter);
 9902|      0|                JS_FreeValue(ctx, desc.setter);
 9903|      0|                JS_FreeValue(ctx, val);
 9904|      0|                return JS_ThrowTypeErrorOrFalse(ctx, flags, "setter is forbidden");
 9905|      0|            } else {
 9906|      0|                JS_FreeValue(ctx, desc.value);
 9907|      0|                if (!(desc.flags & JS_PROP_WRITABLE) ||
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (9907:21): [True: 0, False: 0]
  ------------------
 9908|      0|                    p->class_id == JS_CLASS_MODULE_NS) {
  ------------------
  |  Branch (9908:21): [True: 0, False: 0]
  ------------------
 9909|      0|                read_only_prop:
 9910|      0|                    JS_FreeValue(ctx, val);
 9911|      0|                    return JS_ThrowTypeErrorReadOnly(ctx, flags, prop);
 9912|      0|                }
 9913|      0|            }
 9914|      0|            ret = JS_DefineProperty(ctx, this_obj, prop, val,
 9915|      0|                                    JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
                                                  JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 9916|      0|                                    JS_PROP_HAS_VALUE);
  ------------------
  |  |  316|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
 9917|      0|            JS_FreeValue(ctx, val);
 9918|      0|            return ret;
 9919|      0|        } else {
 9920|    119|        generic_create_prop:
 9921|    119|            ret = JS_CreateProperty(ctx, p, prop, val, JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  291|    119|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|    119|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
                          ret = JS_CreateProperty(ctx, p, prop, val, JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  291|    119|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|    119|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 9922|    119|                                    flags |
 9923|    119|                                    JS_PROP_HAS_VALUE |
  ------------------
  |  |  316|    119|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
 9924|    119|                                    JS_PROP_HAS_ENUMERABLE |
  ------------------
  |  |  313|    119|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
 9925|    119|                                    JS_PROP_HAS_WRITABLE |
  ------------------
  |  |  312|    119|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
 9926|    119|                                    JS_PROP_HAS_CONFIGURABLE |
  ------------------
  |  |  311|    119|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
 9927|    119|                                    JS_PROP_C_W_E);
  ------------------
  |  |  301|    119|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|    119|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|    119|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|    119|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
 9928|    119|            JS_FreeValue(ctx, val);
 9929|    119|            return ret;
 9930|      0|        }
 9931|      0|    }
 9932|    153|}
JS_SetPropertyStr:
10102|    119|{
10103|    119|    JSAtom atom;
10104|    119|    int ret;
10105|    119|    atom = JS_NewAtom(ctx, prop);
10106|    119|    if (atom == JS_ATOM_NULL) {
  ------------------
  |  |  451|    119|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (10106:9): [True: 0, False: 119]
  ------------------
10107|      0|        JS_FreeValue(ctx, val);
10108|      0|        return -1;
10109|      0|    }
10110|    119|    ret = JS_SetPropertyInternal(ctx, this_obj, atom, val, this_obj, JS_PROP_THROW);
  ------------------
  |  |  320|    119|#define JS_PROP_THROW            (1 << 14)
  ------------------
10111|    119|    JS_FreeAtom(ctx, atom);
10112|    119|    return ret;
10113|    119|}
JS_DefineProperty:
10353|   353k|{
10354|   353k|    JSObject *p;
10355|   353k|    JSShapeProperty *prs;
10356|   353k|    JSProperty *pr;
10357|   353k|    int mask, res;
10358|       |
10359|   353k|    if (JS_VALUE_GET_TAG(this_obj) != JS_TAG_OBJECT) {
  ------------------
  |  |  236|   353k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10359:9): [True: 0, False: 353k]
  ------------------
10360|      0|        JS_ThrowTypeErrorNotAnObject(ctx);
10361|      0|        return -1;
10362|      0|    }
10363|   353k|    p = JS_VALUE_GET_OBJ(this_obj);
  ------------------
  |  |  229|   353k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|   353k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10364|       |
10365|   353k| redo_prop_update:
10366|   353k|    prs = find_own_property(&pr, p, prop);
10367|   353k|    if (prs) {
  ------------------
  |  Branch (10367:9): [True: 53, False: 353k]
  ------------------
10368|       |        /* the range of the Array length property is always tested before */
10369|     53|        if ((prs->flags & JS_PROP_LENGTH) && (flags & JS_PROP_HAS_VALUE)) {
  ------------------
  |  |  302|     53|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
                      if ((prs->flags & JS_PROP_LENGTH) && (flags & JS_PROP_HAS_VALUE)) {
  ------------------
  |  |  316|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10369:13): [True: 0, False: 53]
  |  Branch (10369:46): [True: 0, False: 0]
  ------------------
10370|      0|            uint32_t array_length;
10371|      0|            if (JS_ToArrayLengthFree(ctx, &array_length,
  ------------------
  |  Branch (10371:17): [True: 0, False: 0]
  ------------------
10372|      0|                                     JS_DupValue(ctx, val), FALSE)) {
10373|      0|                return -1;
10374|      0|            }
10375|       |            /* this code relies on the fact that Uint32 are never allocated */
10376|      0|            val = (JSValueConst)JS_NewUint32(ctx, array_length);
10377|       |            /* prs may have been modified */
10378|      0|            prs = find_own_property(&pr, p, prop);
10379|      0|            assert(prs != NULL);
  ------------------
  |  Branch (10379:13): [True: 0, False: 0]
  |  Branch (10379:13): [True: 0, False: 0]
  ------------------
10380|      0|        }
10381|       |        /* property already exists */
10382|     53|        if (!check_define_prop_flags(prs->flags, flags)) {
  ------------------
  |  Branch (10382:13): [True: 0, False: 53]
  ------------------
10383|      0|        not_configurable:
10384|      0|            return JS_ThrowTypeErrorOrFalse(ctx, flags, "property is not configurable");
10385|      0|        }
10386|       |
10387|     53|        if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  303|     53|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  307|     53|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (10387:13): [True: 0, False: 53]
  ------------------
10388|       |            /* Instantiate property and retry */
10389|      0|            if (JS_AutoInitProperty(ctx, p, prop, pr, prs))
  ------------------
  |  Branch (10389:17): [True: 0, False: 0]
  ------------------
10390|      0|                return -1;
10391|      0|            goto redo_prop_update;
10392|      0|        }
10393|       |
10394|     53|        if (flags & (JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE |
  ------------------
  |  |  316|     53|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
                      if (flags & (JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE |
  ------------------
  |  |  312|     53|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
  |  Branch (10394:13): [True: 19, False: 34]
  ------------------
10395|     53|                     JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  314|     53|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                   JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  315|     53|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
10396|     19|            if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  314|     19|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                          if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  315|     19|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10396:17): [True: 17, False: 2]
  ------------------
10397|     17|                JSObject *new_getter, *new_setter;
10398|       |
10399|     17|                if (JS_IsFunction(ctx, getter)) {
  ------------------
  |  Branch (10399:21): [True: 17, False: 0]
  ------------------
10400|     17|                    new_getter = JS_VALUE_GET_OBJ(getter);
  ------------------
  |  |  229|     17|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     17|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10401|     17|                } else {
10402|      0|                    new_getter = NULL;
10403|      0|                }
10404|     17|                if (JS_IsFunction(ctx, setter)) {
  ------------------
  |  Branch (10404:21): [True: 17, False: 0]
  ------------------
10405|     17|                    new_setter = JS_VALUE_GET_OBJ(setter);
  ------------------
  |  |  229|     17|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     17|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10406|     17|                } else {
10407|      0|                    new_setter = NULL;
10408|      0|                }
10409|       |
10410|     17|                if ((prs->flags & JS_PROP_TMASK) != JS_PROP_GETSET) {
  ------------------
  |  |  303|     17|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              if ((prs->flags & JS_PROP_TMASK) != JS_PROP_GETSET) {
  ------------------
  |  |  305|     17|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (10410:21): [True: 17, False: 0]
  ------------------
10411|     17|                    if (js_shape_prepare_update(ctx, p, &prs))
  ------------------
  |  Branch (10411:25): [True: 0, False: 17]
  ------------------
10412|      0|                        return -1;
10413|       |                    /* convert to getset */
10414|     17|                    if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  303|     17|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                  if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  306|     17|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (10414:25): [True: 0, False: 17]
  ------------------
10415|      0|                        if (unlikely(p->class_id == JS_CLASS_GLOBAL_OBJECT)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10416|      0|                            if (remove_global_object_property(ctx, p, prs, pr))
  ------------------
  |  Branch (10416:33): [True: 0, False: 0]
  ------------------
10417|      0|                                return -1;
10418|      0|                        }
10419|      0|                        free_var_ref(ctx->rt, pr->u.var_ref);
10420|     17|                    } else {
10421|     17|                        JS_FreeValue(ctx, pr->u.value);
10422|     17|                    }
10423|     17|                    prs->flags = (prs->flags &
10424|     17|                                  (JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE)) |
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                                (JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE)) |
  ------------------
  |  |  300|     17|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
10425|     17|                        JS_PROP_GETSET;
  ------------------
  |  |  305|     17|#define JS_PROP_GETSET         (1 << 4)
  ------------------
10426|     17|                    pr->u.getset.getter = NULL;
10427|     17|                    pr->u.getset.setter = NULL;
10428|     17|                } else {
10429|      0|                    if (!(prs->flags & JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
  |  Branch (10429:25): [True: 0, False: 0]
  ------------------
10430|      0|                        if ((flags & JS_PROP_HAS_GET) &&
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
  |  Branch (10430:29): [True: 0, False: 0]
  ------------------
10431|      0|                            new_getter != pr->u.getset.getter) {
  ------------------
  |  Branch (10431:29): [True: 0, False: 0]
  ------------------
10432|      0|                            goto not_configurable;
10433|      0|                        }
10434|      0|                        if ((flags & JS_PROP_HAS_SET) &&
  ------------------
  |  |  315|      0|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10434:29): [True: 0, False: 0]
  ------------------
10435|      0|                            new_setter != pr->u.getset.setter) {
  ------------------
  |  Branch (10435:29): [True: 0, False: 0]
  ------------------
10436|      0|                            goto not_configurable;
10437|      0|                        }
10438|      0|                    }
10439|      0|                }
10440|     17|                if (flags & JS_PROP_HAS_GET) {
  ------------------
  |  |  314|     17|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
  |  Branch (10440:21): [True: 17, False: 0]
  ------------------
10441|     17|                    if (pr->u.getset.getter)
  ------------------
  |  Branch (10441:25): [True: 0, False: 17]
  ------------------
10442|      0|                        JS_FreeValue(ctx, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.getter));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
10443|     17|                    if (new_getter)
  ------------------
  |  Branch (10443:25): [True: 17, False: 0]
  ------------------
10444|     17|                        JS_DupValue(ctx, getter);
10445|     17|                    pr->u.getset.getter = new_getter;
10446|     17|                }
10447|     17|                if (flags & JS_PROP_HAS_SET) {
  ------------------
  |  |  315|     17|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10447:21): [True: 17, False: 0]
  ------------------
10448|     17|                    if (pr->u.getset.setter)
  ------------------
  |  Branch (10448:25): [True: 0, False: 17]
  ------------------
10449|      0|                        JS_FreeValue(ctx, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.setter));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
10450|     17|                    if (new_setter)
  ------------------
  |  Branch (10450:25): [True: 17, False: 0]
  ------------------
10451|     17|                        JS_DupValue(ctx, setter);
10452|     17|                    pr->u.getset.setter = new_setter;
10453|     17|                }
10454|     17|            } else {
10455|      2|                if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|      2|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  305|      2|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (10455:21): [True: 0, False: 2]
  ------------------
10456|       |                    /* convert to data descriptor */
10457|      0|                    JSVarRef *var_ref;
10458|      0|                    if (unlikely(p->class_id == JS_CLASS_GLOBAL_OBJECT)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10459|      0|                        var_ref = js_global_object_find_uninitialized_var(ctx, p, prop, FALSE);
10460|      0|                        if (!var_ref)
  ------------------
  |  Branch (10460:29): [True: 0, False: 0]
  ------------------
10461|      0|                            return -1;
10462|      0|                    } else {
10463|      0|                        var_ref = NULL;
10464|      0|                    }
10465|      0|                    if (js_shape_prepare_update(ctx, p, &prs)) {
  ------------------
  |  Branch (10465:25): [True: 0, False: 0]
  ------------------
10466|      0|                        if (var_ref)
  ------------------
  |  Branch (10466:29): [True: 0, False: 0]
  ------------------
10467|      0|                            free_var_ref(ctx->rt, var_ref);
10468|      0|                        return -1;
10469|      0|                    }
10470|      0|                    if (pr->u.getset.getter)
  ------------------
  |  Branch (10470:25): [True: 0, False: 0]
  ------------------
10471|      0|                        JS_FreeValue(ctx, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.getter));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
10472|      0|                    if (pr->u.getset.setter)
  ------------------
  |  Branch (10472:25): [True: 0, False: 0]
  ------------------
10473|      0|                        JS_FreeValue(ctx, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.setter));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
10474|      0|                    if (var_ref) {
  ------------------
  |  Branch (10474:25): [True: 0, False: 0]
  ------------------
10475|      0|                        prs->flags = (prs->flags & ~JS_PROP_TMASK) |
  ------------------
  |  |  303|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
10476|      0|                            JS_PROP_VARREF | JS_PROP_WRITABLE;
  ------------------
  |  |  306|      0|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
                                          JS_PROP_VARREF | JS_PROP_WRITABLE;
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10477|      0|                        pr->u.var_ref = var_ref;
10478|      0|                    } else {
10479|      0|                        prs->flags &= ~(JS_PROP_TMASK | JS_PROP_WRITABLE);
  ------------------
  |  |  303|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                      prs->flags &= ~(JS_PROP_TMASK | JS_PROP_WRITABLE);
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10480|      0|                        pr->u.value = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
10481|      0|                    }
10482|      2|                } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  303|      2|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  306|      2|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (10482:28): [True: 0, False: 2]
  ------------------
10483|       |                    /* Note: JS_PROP_VARREF is always writable */
10484|      2|                } else {
10485|      2|                    if ((prs->flags & (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE)) == 0 &&
  ------------------
  |  |  298|      2|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                  if ((prs->flags & (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE)) == 0 &&
  ------------------
  |  |  299|      2|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (10485:25): [True: 0, False: 2]
  ------------------
10486|      0|                        (flags & JS_PROP_HAS_VALUE)) {
  ------------------
  |  |  316|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10486:25): [True: 0, False: 0]
  ------------------
10487|      0|                        if (!js_same_value(ctx, val, pr->u.value)) {
  ------------------
  |  Branch (10487:29): [True: 0, False: 0]
  ------------------
10488|      0|                            goto not_configurable;
10489|      0|                        } else {
10490|      0|                            return TRUE;
10491|      0|                        }
10492|      0|                    }
10493|      2|                }
10494|      2|                if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  303|      2|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  306|      2|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (10494:21): [True: 0, False: 2]
  ------------------
10495|      0|                    if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  316|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10495:25): [True: 0, False: 0]
  ------------------
10496|      0|                        if (p->class_id == JS_CLASS_MODULE_NS) {
  ------------------
  |  Branch (10496:29): [True: 0, False: 0]
  ------------------
10497|       |                            /* JS_PROP_WRITABLE is always true for variable
10498|       |                               references, but they are write protected in module name
10499|       |                               spaces. */
10500|      0|                            if (!js_same_value(ctx, val, *pr->u.var_ref->pvalue))
  ------------------
  |  Branch (10500:33): [True: 0, False: 0]
  ------------------
10501|      0|                                goto not_configurable;
10502|      0|                        } else {
10503|       |                            /* update the reference */
10504|      0|                            set_value(ctx, pr->u.var_ref->pvalue,
10505|      0|                                      JS_DupValue(ctx, val));
10506|      0|                        }
10507|      0|                    }
10508|      0|                    if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) == JS_PROP_HAS_WRITABLE) {
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
                                  if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) == JS_PROP_HAS_WRITABLE) {
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                  if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) == JS_PROP_HAS_WRITABLE) {
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
  |  Branch (10508:25): [True: 0, False: 0]
  ------------------
10509|      0|                        JSValue val1;
10510|      0|                        if (p->class_id == JS_CLASS_MODULE_NS) {
  ------------------
  |  Branch (10510:29): [True: 0, False: 0]
  ------------------
10511|      0|                            return JS_ThrowTypeErrorOrFalse(ctx, flags, "module namespace properties have writable = false");
10512|      0|                        }
10513|      0|                        if (js_shape_prepare_update(ctx, p, &prs))
  ------------------
  |  Branch (10513:29): [True: 0, False: 0]
  ------------------
10514|      0|                            return -1;
10515|      0|                        if (p->class_id == JS_CLASS_GLOBAL_OBJECT) {
  ------------------
  |  Branch (10515:29): [True: 0, False: 0]
  ------------------
10516|      0|                            pr->u.var_ref->is_const = TRUE; /* mark as read-only */
10517|      0|                            prs->flags &= ~JS_PROP_WRITABLE;
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10518|      0|                        } else {
10519|       |                            /* if writable is set to false, no longer a
10520|       |                               reference (for mapped arguments) */
10521|      0|                            val1 = JS_DupValue(ctx, *pr->u.var_ref->pvalue);
10522|      0|                            free_var_ref(ctx->rt, pr->u.var_ref);
10523|      0|                            pr->u.value = val1;
10524|      0|                            prs->flags &= ~(JS_PROP_TMASK | JS_PROP_WRITABLE);
  ------------------
  |  |  303|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                          prs->flags &= ~(JS_PROP_TMASK | JS_PROP_WRITABLE);
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10525|      0|                        }
10526|      0|                    }
10527|      2|                } else if (prs->flags & JS_PROP_LENGTH) {
  ------------------
  |  |  302|      2|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
  |  Branch (10527:28): [True: 0, False: 2]
  ------------------
10528|      0|                    if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  316|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10528:25): [True: 0, False: 0]
  ------------------
10529|       |                        /* Note: no JS code is executable because
10530|       |                           'val' is guaranted to be a Uint32 */
10531|      0|                        res = set_array_length(ctx, p, JS_DupValue(ctx, val),
10532|      0|                                               flags);
10533|      0|                    } else {
10534|      0|                        res = TRUE;
10535|      0|                    }
10536|       |                    /* still need to reset the writable flag if
10537|       |                       needed.  The JS_PROP_LENGTH is kept because the
10538|       |                       Uint32 test is still done if the length
10539|       |                       property is read-only. */
10540|      0|                    if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) ==
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
                                  if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) ==
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (10540:25): [True: 0, False: 0]
  ------------------
10541|      0|                        JS_PROP_HAS_WRITABLE) {
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
10542|      0|                        prs = get_shape_prop(p->shape);
10543|      0|                        if (js_update_property_flags(ctx, p, &prs,
  ------------------
  |  Branch (10543:29): [True: 0, False: 0]
  ------------------
10544|      0|                                                     prs->flags & ~JS_PROP_WRITABLE))
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10545|      0|                            return -1;
10546|      0|                    }
10547|      0|                    return res;
10548|      2|                } else {
10549|      2|                    if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  316|      2|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10549:25): [True: 2, False: 0]
  ------------------
10550|      2|                        JS_FreeValue(ctx, pr->u.value);
10551|      2|                        pr->u.value = JS_DupValue(ctx, val);
10552|      2|                    }
10553|      2|                    if (flags & JS_PROP_HAS_WRITABLE) {
  ------------------
  |  |  312|      2|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
  |  Branch (10553:25): [True: 2, False: 0]
  ------------------
10554|      2|                        if (js_update_property_flags(ctx, p, &prs,
  ------------------
  |  Branch (10554:29): [True: 0, False: 2]
  ------------------
10555|      2|                                                     (prs->flags & ~JS_PROP_WRITABLE) |
  ------------------
  |  |  299|      2|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10556|      2|                                                     (flags & JS_PROP_WRITABLE)))
  ------------------
  |  |  299|      2|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10557|      0|                            return -1;
10558|      2|                    }
10559|      2|                }
10560|      2|            }
10561|     19|        }
10562|     53|        mask = 0;
10563|     53|        if (flags & JS_PROP_HAS_CONFIGURABLE)
  ------------------
  |  |  311|     53|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
  |  Branch (10563:13): [True: 36, False: 17]
  ------------------
10564|     36|            mask |= JS_PROP_CONFIGURABLE;
  ------------------
  |  |  298|     36|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
10565|     53|        if (flags & JS_PROP_HAS_ENUMERABLE)
  ------------------
  |  |  313|     53|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
  |  Branch (10565:13): [True: 2, False: 51]
  ------------------
10566|      2|            mask |= JS_PROP_ENUMERABLE;
  ------------------
  |  |  300|      2|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
10567|     53|        if (js_update_property_flags(ctx, p, &prs,
  ------------------
  |  Branch (10567:13): [True: 0, False: 53]
  ------------------
10568|     53|                                     (prs->flags & ~mask) | (flags & mask)))
10569|      0|            return -1;
10570|     53|        return TRUE;
10571|     53|    }
10572|       |
10573|       |    /* handle modification of fast array elements */
10574|   353k|    if (p->fast_array) {
  ------------------
  |  Branch (10574:9): [True: 343k, False: 10.2k]
  ------------------
10575|   343k|        uint32_t idx;
10576|   343k|        uint32_t prop_flags;
10577|   343k|        if (p->class_id == JS_CLASS_ARRAY) {
  ------------------
  |  Branch (10577:13): [True: 343k, False: 0]
  ------------------
10578|   343k|            if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (10578:17): [True: 343k, False: 40]
  ------------------
10579|   343k|                idx = __JS_AtomToUInt32(prop);
10580|   343k|                if (idx < p->u.array.count) {
  ------------------
  |  Branch (10580:21): [True: 0, False: 343k]
  ------------------
10581|      0|                    prop_flags = get_prop_flags(flags, JS_PROP_C_W_E);
  ------------------
  |  |  301|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
10582|      0|                    if (prop_flags != JS_PROP_C_W_E)
  ------------------
  |  |  301|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
  |  Branch (10582:25): [True: 0, False: 0]
  ------------------
10583|      0|                        goto convert_to_slow_array;
10584|      0|                    if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                  if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  315|      0|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10584:25): [True: 0, False: 0]
  ------------------
10585|      0|                    convert_to_slow_array:
10586|      0|                        if (convert_fast_array_to_array(ctx, p))
  ------------------
  |  Branch (10586:29): [True: 0, False: 0]
  ------------------
10587|      0|                            return -1;
10588|      0|                        else
10589|      0|                            goto redo_prop_update;
10590|      0|                    }
10591|      0|                    if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  316|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10591:25): [True: 0, False: 0]
  ------------------
10592|      0|                        set_value(ctx, &p->u.array.u.values[idx], JS_DupValue(ctx, val));
10593|      0|                    }
10594|      0|                    return TRUE;
10595|      0|                }
10596|   343k|            }
10597|   343k|        } else if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (10597:20): [True: 0, False: 0]
  ------------------
10598|      0|                   p->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (10598:20): [True: 0, False: 0]
  ------------------
10599|      0|            JSValue num;
10600|      0|            int ret;
10601|       |
10602|      0|            if (!__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (10602:17): [True: 0, False: 0]
  ------------------
10603|       |                /* slow path with to handle all numeric indexes */
10604|      0|                num = JS_AtomIsNumericIndex1(ctx, prop);
10605|      0|                if (JS_IsUndefined(num))
  ------------------
  |  Branch (10605:21): [True: 0, False: 0]
  ------------------
10606|      0|                    goto typed_array_done;
10607|      0|                if (JS_IsException(num))
  ------------------
  |  Branch (10607:21): [True: 0, False: 0]
  ------------------
10608|      0|                    return -1;
10609|      0|                ret = JS_NumberIsInteger(ctx, num);
10610|      0|                if (ret < 0) {
  ------------------
  |  Branch (10610:21): [True: 0, False: 0]
  ------------------
10611|      0|                    JS_FreeValue(ctx, num);
10612|      0|                    return -1;
10613|      0|                }
10614|      0|                if (!ret) {
  ------------------
  |  Branch (10614:21): [True: 0, False: 0]
  ------------------
10615|      0|                    JS_FreeValue(ctx, num);
10616|      0|                    return JS_ThrowTypeErrorOrFalse(ctx, flags, "non integer index in typed array");
10617|      0|                }
10618|      0|                ret = JS_NumberIsNegativeOrMinusZero(ctx, num);
10619|      0|                JS_FreeValue(ctx, num);
10620|      0|                if (ret) {
  ------------------
  |  Branch (10620:21): [True: 0, False: 0]
  ------------------
10621|      0|                    return JS_ThrowTypeErrorOrFalse(ctx, flags, "negative index in typed array");
10622|      0|                }
10623|      0|                if (!__JS_AtomIsTaggedInt(prop))
  ------------------
  |  Branch (10623:21): [True: 0, False: 0]
  ------------------
10624|      0|                    goto typed_array_oob;
10625|      0|            }
10626|      0|            idx = __JS_AtomToUInt32(prop);
10627|       |            /* if the typed array is detached, p->u.array.count = 0 */
10628|      0|            if (idx >= p->u.array.count) {
  ------------------
  |  Branch (10628:17): [True: 0, False: 0]
  ------------------
10629|      0|            typed_array_oob:
10630|      0|                return JS_ThrowTypeErrorOrFalse(ctx, flags, "out-of-bound index in typed array");
10631|      0|            }
10632|      0|            prop_flags = get_prop_flags(flags, JS_PROP_ENUMERABLE | JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                          prop_flags = get_prop_flags(flags, JS_PROP_ENUMERABLE | JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                          prop_flags = get_prop_flags(flags, JS_PROP_ENUMERABLE | JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
10633|      0|            if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET) ||
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                          if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET) ||
  ------------------
  |  |  315|      0|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10633:17): [True: 0, False: 0]
  ------------------
10634|      0|                prop_flags != (JS_PROP_ENUMERABLE | JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                              prop_flags != (JS_PROP_ENUMERABLE | JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                              prop_flags != (JS_PROP_ENUMERABLE | JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
  |  Branch (10634:17): [True: 0, False: 0]
  ------------------
10635|      0|                return JS_ThrowTypeErrorOrFalse(ctx, flags, "invalid descriptor flags");
10636|      0|            }
10637|      0|            if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  316|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10637:17): [True: 0, False: 0]
  ------------------
10638|      0|                return JS_SetPropertyValue(ctx, this_obj, JS_NewInt32(ctx, idx), JS_DupValue(ctx, val), flags);
10639|      0|            }
10640|      0|            return TRUE;
10641|      0|        typed_array_done: ;
10642|      0|        }
10643|   343k|    }
10644|       |
10645|   353k|    return JS_CreateProperty(ctx, p, prop, val, getter, setter, flags);
10646|   353k|}
JS_DefinePropertyValue:
10681|   352k|{
10682|   352k|    int ret;
10683|   352k|    ret = JS_DefineProperty(ctx, this_obj, prop, val, JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  291|   352k|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|   352k|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
                  ret = JS_DefineProperty(ctx, this_obj, prop, val, JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  291|   352k|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|   352k|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
10684|   352k|                            flags | JS_PROP_HAS_VALUE | JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_WRITABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  316|   352k|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
                                          flags | JS_PROP_HAS_VALUE | JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_WRITABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  311|   352k|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                                          flags | JS_PROP_HAS_VALUE | JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_WRITABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  312|   352k|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
                                          flags | JS_PROP_HAS_VALUE | JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_WRITABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  313|   352k|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
10685|   352k|    JS_FreeValue(ctx, val);
10686|   352k|    return ret;
10687|   352k|}
JS_DefinePropertyValueValue:
10691|   343k|{
10692|   343k|    JSAtom atom;
10693|   343k|    int ret;
10694|   343k|    atom = JS_ValueToAtom(ctx, prop);
10695|   343k|    JS_FreeValue(ctx, prop);
10696|   343k|    if (unlikely(atom == JS_ATOM_NULL)) {
  ------------------
  |  |   33|   343k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 343k]
  |  |  ------------------
  ------------------
10697|      0|        JS_FreeValue(ctx, val);
10698|      0|        return -1;
10699|      0|    }
10700|   343k|    ret = JS_DefinePropertyValue(ctx, this_obj, atom, val, flags);
10701|   343k|    JS_FreeAtom(ctx, atom);
10702|   343k|    return ret;
10703|   343k|}
JS_DefinePropertyValueUint32:
10707|     12|{
10708|     12|    return JS_DefinePropertyValueValue(ctx, this_obj, JS_NewUint32(ctx, idx),
10709|     12|                                       val, flags);
10710|     12|}
JS_DefinePropertyValueInt64:
10714|      5|{
10715|      5|    return JS_DefinePropertyValueValue(ctx, this_obj, JS_NewInt64(ctx, idx),
10716|      5|                                       val, flags);
10717|      5|}
JS_DefinePropertyValueStr:
10721|    731|{
10722|    731|    JSAtom atom;
10723|    731|    int ret;
10724|    731|    atom = JS_NewAtom(ctx, prop);
10725|    731|    if (atom == JS_ATOM_NULL) {
  ------------------
  |  |  451|    731|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (10725:9): [True: 0, False: 731]
  ------------------
10726|      0|        JS_FreeValue(ctx, val);
10727|      0|        return -1;
10728|      0|    }
10729|    731|    ret = JS_DefinePropertyValue(ctx, this_obj, atom, val, flags);
10730|    731|    JS_FreeAtom(ctx, atom);
10731|    731|    return ret;
10732|    731|}
JS_DefinePropertyGetSet:
10738|    697|{
10739|    697|    int ret;
10740|    697|    ret = JS_DefineProperty(ctx, this_obj, prop, JS_UNDEFINED, getter, setter,
  ------------------
  |  |  291|    697|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|    697|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
10741|    697|                            flags | JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  314|    697|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                          flags | JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  315|    697|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
10742|    697|                            JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  311|    697|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                                          JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  313|    697|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
10743|    697|    JS_FreeValue(ctx, getter);
10744|    697|    JS_FreeValue(ctx, setter);
10745|    697|    return ret;
10746|    697|}
JS_IsFunction:
10960|  1.01M|{
10961|  1.01M|    JSObject *p;
10962|  1.01M|    if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|  1.01M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10962:9): [True: 663, False: 1.01M]
  ------------------
10963|    663|        return FALSE;
10964|  1.01M|    p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|  1.01M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.01M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10965|  1.01M|    switch(p->class_id) {
10966|      1|    case JS_CLASS_BYTECODE_FUNCTION:
  ------------------
  |  Branch (10966:5): [True: 1, False: 1.01M]
  ------------------
10967|      1|        return TRUE;
10968|      0|    case JS_CLASS_PROXY:
  ------------------
  |  Branch (10968:5): [True: 0, False: 1.01M]
  ------------------
10969|      0|        return p->u.proxy_data->is_func;
10970|  1.01M|    default:
  ------------------
  |  Branch (10970:5): [True: 1.01M, False: 1]
  ------------------
10971|       |        return (ctx->rt->class_array[p->class_id].call != NULL);
10972|  1.01M|    }
10973|  1.01M|}
JS_IsConstructor:
10988|      2|{
10989|      2|    JSObject *p;
10990|      2|    if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10990:9): [True: 0, False: 2]
  ------------------
10991|      0|        return FALSE;
10992|      2|    p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10993|      2|    return p->is_constructor;
10994|      2|}
JS_SetConstructorBit:
10997|     17|{
10998|     17|    JSObject *p;
10999|     17|    if (JS_VALUE_GET_TAG(func_obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|     17|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10999:9): [True: 0, False: 17]
  ------------------
11000|      0|        return FALSE;
11001|     17|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  229|     17|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     17|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
11002|     17|    p->is_constructor = val;
11003|     17|    return TRUE;
11004|     17|}
JS_SetUncatchableException:
11017|      2|{
11018|      2|    ctx->rt->current_exception_is_uncatchable = flag;
11019|      2|}
JS_SetOpaque:
11022|    194|{
11023|    194|   JSObject *p;
11024|    194|    if (JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT) {
  ------------------
  |  |  236|    194|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (11024:9): [True: 194, False: 0]
  ------------------
11025|    194|        p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|    194|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    194|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
11026|    194|        p->u.opaque = opaque;
11027|    194|    }
11028|    194|}
JS_GetOpaque:
11032|    394|{
11033|    394|    JSObject *p;
11034|    394|    if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|    394|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (11034:9): [True: 1, False: 393]
  ------------------
11035|      1|        return NULL;
11036|    393|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|    393|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    393|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
11037|    393|    if (p->class_id != class_id)
  ------------------
  |  Branch (11037:9): [True: 0, False: 393]
  ------------------
11038|      0|        return NULL;
11039|    393|    return p->u.opaque;
11040|    393|}
JS_GetOpaque2:
11043|      2|{
11044|      2|    void *p = JS_GetOpaque(obj, class_id);
11045|      2|    if (unlikely(!p)) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
11046|      0|        JS_ThrowTypeErrorInvalidClass(ctx, class_id);
11047|      0|    }
11048|      2|    return p;
11049|      2|}
JS_ToInt64Clamp:
13239|     15|{
13240|     15|    int res = JS_ToInt64SatFree(ctx, pres, JS_DupValue(ctx, val));
13241|     15|    if (res == 0) {
  ------------------
  |  Branch (13241:9): [True: 15, False: 0]
  ------------------
13242|     15|        if (*pres < 0)
  ------------------
  |  Branch (13242:13): [True: 0, False: 15]
  ------------------
13243|      0|            *pres += neg_offset;
13244|     15|        if (*pres < min)
  ------------------
  |  Branch (13244:13): [True: 0, False: 15]
  ------------------
13245|      0|            *pres = min;
13246|     15|        else if (*pres > max)
  ------------------
  |  Branch (13246:18): [True: 0, False: 15]
  ------------------
13247|      0|            *pres = max;
13248|     15|    }
13249|     15|    return res;
13250|     15|}
JS_ToInt32:
13372|     12|{
13373|     12|    return JS_ToInt32Free(ctx, pres, JS_DupValue(ctx, val));
13374|     12|}
JS_ToString:
13646|  1.00M|{
13647|  1.00M|    return JS_ToStringInternal(ctx, val, FALSE);
13648|  1.00M|}
JS_ToPropertyKey:
13666|     34|{
13667|     34|    return JS_ToStringInternal(ctx, val, TRUE);
13668|     34|}
JS_Call:
20602|     82|{
20603|     82|    return JS_CallInternal(ctx, func_obj, this_obj, JS_UNDEFINED,
  ------------------
  |  |  291|     82|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     82|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20604|     82|                           argc, (JSValue *)argv, JS_CALL_FLAG_COPY_ARGV);
  ------------------
  |  |17585|     82|#define JS_CALL_FLAG_COPY_ARGV   (1 << 1)
  ------------------
20605|     82|}
JS_CallConstructor:
20751|      2|{
20752|      2|    return JS_CallConstructorInternal(ctx, func_obj, func_obj,
20753|      2|                                      argc, (JSValue *)argv,
20754|      2|                                      JS_CALL_FLAG_COPY_ARGV);
  ------------------
  |  |17585|      2|#define JS_CALL_FLAG_COPY_ARGV   (1 << 1)
  ------------------
20755|      2|}
JS_NewCModule:
29737|     34|{
29738|     34|    JSModuleDef *m;
29739|     34|    JSAtom name;
29740|     34|    name = JS_NewAtom(ctx, name_str);
29741|     34|    if (name == JS_ATOM_NULL)
  ------------------
  |  |  451|     34|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (29741:9): [True: 0, False: 34]
  ------------------
29742|      0|        return NULL;
29743|     34|    m = js_new_module_def(ctx, name);
29744|     34|    if (!m)
  ------------------
  |  Branch (29744:9): [True: 0, False: 34]
  ------------------
29745|      0|        return NULL;
29746|     34|    m->init_func = func;
29747|     34|    return m;
29748|     34|}
JS_AddModuleExport:
29751|  1.66k|{
29752|  1.66k|    JSExportEntry *me;
29753|  1.66k|    JSAtom name;
29754|  1.66k|    name = JS_NewAtom(ctx, export_name);
29755|  1.66k|    if (name == JS_ATOM_NULL)
  ------------------
  |  |  451|  1.66k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (29755:9): [True: 0, False: 1.66k]
  ------------------
29756|      0|        return -1;
29757|  1.66k|    me = add_export_entry2(ctx, NULL, m, JS_ATOM_NULL, name,
  ------------------
  |  |  451|  1.66k|#define JS_ATOM_NULL 0
  ------------------
29758|  1.66k|                           JS_EXPORT_TYPE_LOCAL);
29759|  1.66k|    JS_FreeAtom(ctx, name);
29760|  1.66k|    if (!me)
  ------------------
  |  Branch (29760:9): [True: 0, False: 1.66k]
  ------------------
29761|      0|        return -1;
29762|  1.66k|    else
29763|  1.66k|        return 0;
29764|  1.66k|}
JS_SetModuleExport:
29768|  1.56k|{
29769|  1.56k|    JSExportEntry *me;
29770|  1.56k|    JSAtom name;
29771|  1.56k|    name = JS_NewAtom(ctx, export_name);
29772|  1.56k|    if (name == JS_ATOM_NULL)
  ------------------
  |  |  451|  1.56k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (29772:9): [True: 0, False: 1.56k]
  ------------------
29773|      0|        goto fail;
29774|  1.56k|    me = find_export_entry(ctx, m, name);
29775|  1.56k|    JS_FreeAtom(ctx, name);
29776|  1.56k|    if (!me)
  ------------------
  |  Branch (29776:9): [True: 0, False: 1.56k]
  ------------------
29777|      0|        goto fail;
29778|  1.56k|    set_value(ctx, me->u.local.var_ref->pvalue, val);
29779|  1.56k|    return 0;
29780|      0| fail:
29781|      0|    JS_FreeValue(ctx, val);
29782|      0|    return -1;
29783|  1.56k|}
JS_SetModuleLoaderFunc:
29799|     17|{
29800|     17|    rt->module_normalize_func = module_normalize;
29801|     17|    rt->module_loader_has_attr = FALSE;
29802|     17|    rt->u.module_loader_func = module_loader;
29803|       |    rt->module_check_attrs = NULL;
29804|     17|    rt->module_loader_opaque = opaque;
29805|     17|}
JS_GetModuleNamespace:
30396|     34|{
30397|     34|    if (JS_IsUndefined(m->module_ns)) {
  ------------------
  |  Branch (30397:9): [True: 34, False: 0]
  ------------------
30398|     34|        JSValue val;
30399|     34|        val = js_build_module_ns(ctx, m);
30400|     34|        if (JS_IsException(val))
  ------------------
  |  Branch (30400:13): [True: 0, False: 34]
  ------------------
30401|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
30402|     34|        m->module_ns = val;
30403|     34|    }
30404|     34|    return JS_DupValue(ctx, m->module_ns);
30405|     34|}
JS_GetModuleName:
30773|     17|{
30774|     17|    return JS_DupAtom(ctx, m->module_name);
30775|     17|}
JS_EvalFunction:
37066|     17|{
37067|     17|    return JS_EvalFunctionInternal(ctx, fun_obj, ctx->global_obj, NULL, NULL);
37068|     17|}
JS_EvalThis:
37229|     34|{
37230|     34|    int eval_type = eval_flags & JS_EVAL_TYPE_MASK;
  ------------------
  |  |  336|     34|#define JS_EVAL_TYPE_MASK     (3 << 0)
  ------------------
37231|     34|    JSValue ret;
37232|       |
37233|     34|    assert(eval_type == JS_EVAL_TYPE_GLOBAL ||
  ------------------
  |  Branch (37233:5): [True: 34, False: 0]
  |  Branch (37233:5): [True: 0, False: 0]
  |  Branch (37233:5): [True: 17, False: 17]
  |  Branch (37233:5): [True: 17, False: 0]
  ------------------
37234|     34|           eval_type == JS_EVAL_TYPE_MODULE);
37235|     34|    ret = JS_EvalInternal(ctx, this_obj, input, input_len, filename,
37236|     34|                          eval_flags, -1);
37237|     34|    return ret;
37238|     34|}
JS_Eval:
37242|     34|{
37243|     34|    return JS_EvalThis(ctx, ctx->global_obj, input, input_len, filename,
37244|     34|                       eval_flags);
37245|     34|}
JS_SetPropertyFunctionList:
39594|  1.91k|{
39595|  1.91k|    int i, ret;
39596|       |
39597|  11.2k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (39597:17): [True: 9.37k, False: 1.91k]
  ------------------
39598|  9.37k|        const JSCFunctionListEntry *e = &tab[i];
39599|  9.37k|        JSAtom atom = find_atom(ctx, e->name);
39600|  9.37k|        if (atom == JS_ATOM_NULL)
  ------------------
  |  |  451|  9.37k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (39600:13): [True: 0, False: 9.37k]
  ------------------
39601|      0|            return -1;
39602|  9.37k|        ret = JS_InstantiateFunctionListItem(ctx, obj, atom, e);
39603|  9.37k|        JS_FreeAtom(ctx, atom);
39604|  9.37k|        if (ret)
  ------------------
  |  Branch (39604:13): [True: 0, False: 9.37k]
  ------------------
39605|      0|            return -1;
39606|  9.37k|    }
39607|  1.91k|    return 0;
39608|  1.91k|}
JS_AddModuleExportList:
39612|     34|{
39613|     34|    int i;
39614|  1.64k|    for(i = 0; i < len; i++) {
  ------------------
  |  Branch (39614:16): [True: 1.61k, False: 34]
  ------------------
39615|  1.61k|        if (JS_AddModuleExport(ctx, m, tab[i].name))
  ------------------
  |  Branch (39615:13): [True: 0, False: 1.61k]
  ------------------
39616|      0|            return -1;
39617|  1.61k|    }
39618|     34|    return 0;
39619|     34|}
JS_SetModuleExportList:
39623|     32|{
39624|     32|    int i;
39625|     32|    JSValue val;
39626|       |
39627|  1.55k|    for(i = 0; i < len; i++) {
  ------------------
  |  Branch (39627:16): [True: 1.52k, False: 32]
  ------------------
39628|  1.52k|        const JSCFunctionListEntry *e = &tab[i];
39629|  1.52k|        switch(e->def_type) {
39630|    880|        case JS_DEF_CFUNC:
  ------------------
  |  | 1099|    880|#define JS_DEF_CFUNC          0
  ------------------
  |  Branch (39630:9): [True: 880, False: 640]
  ------------------
39631|    880|            val = JS_NewCFunction2(ctx, e->u.func.cfunc.generic,
39632|    880|                                   e->name, e->u.func.length, e->u.func.cproto, e->magic);
39633|    880|            break;
39634|     16|        case JS_DEF_PROP_STRING:
  ------------------
  |  | 1102|     16|#define JS_DEF_PROP_STRING    3
  ------------------
  |  Branch (39634:9): [True: 16, False: 1.50k]
  ------------------
39635|     16|            val = JS_NewString(ctx, e->u.str);
39636|     16|            break;
39637|    608|        case JS_DEF_PROP_INT32:
  ------------------
  |  | 1103|    608|#define JS_DEF_PROP_INT32     4
  ------------------
  |  Branch (39637:9): [True: 608, False: 912]
  ------------------
39638|    608|            val = JS_NewInt32(ctx, e->u.i32);
39639|    608|            break;
39640|      0|        case JS_DEF_PROP_INT64:
  ------------------
  |  | 1104|      0|#define JS_DEF_PROP_INT64     5
  ------------------
  |  Branch (39640:9): [True: 0, False: 1.52k]
  ------------------
39641|      0|            val = JS_NewInt64(ctx, e->u.i64);
39642|      0|            break;
39643|      0|        case JS_DEF_PROP_DOUBLE:
  ------------------
  |  | 1105|      0|#define JS_DEF_PROP_DOUBLE    6
  ------------------
  |  Branch (39643:9): [True: 0, False: 1.52k]
  ------------------
39644|      0|            val = __JS_NewFloat64(ctx, e->u.f64);
39645|      0|            break;
39646|     16|        case JS_DEF_OBJECT:
  ------------------
  |  | 1107|     16|#define JS_DEF_OBJECT         8
  ------------------
  |  Branch (39646:9): [True: 16, False: 1.50k]
  ------------------
39647|     16|            val = JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_OBJECT],
39648|     16|                                        e->u.prop_list.tab, e->u.prop_list.len);
39649|     16|            break;
39650|      0|        default:
  ------------------
  |  Branch (39650:9): [True: 0, False: 1.52k]
  ------------------
39651|      0|            abort();
39652|  1.52k|        }
39653|  1.52k|        if (JS_SetModuleExport(ctx, m, e->name, val))
  ------------------
  |  Branch (39653:13): [True: 0, False: 1.52k]
  ------------------
39654|      0|            return -1;
39655|  1.52k|    }
39656|     32|    return 0;
39657|     32|}
JS_AddIntrinsicStringNormalize:
46690|     17|{
46691|     17|    return JS_SetPropertyFunctionList(ctx, ctx->class_proto[JS_CLASS_STRING], js_string_proto_normalize,
46692|     17|                                      countof(js_string_proto_normalize));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
46693|     17|}
lre_check_stack_overflow:
47774|      3|{
47775|      3|    JSContext *ctx = opaque;
47776|      3|    return js_check_stack_overflow(ctx->rt, alloca_size);
47777|      3|}
lre_realloc:
47788|     20|{
47789|     20|    JSContext *ctx = opaque;
47790|       |    /* No JS exception is raised here */
47791|     20|    return js_realloc_rt(ctx->rt, ptr, size);
47792|     20|}
JS_AddIntrinsicRegExpCompiler:
49035|     17|{
49036|     17|    ctx->compile_regexp = js_compile_regexp;
49037|     17|}
JS_AddIntrinsicRegExp:
49040|     17|{
49041|     17|    JSValue obj;
49042|       |
49043|     17|    JS_AddIntrinsicRegExpCompiler(ctx);
49044|       |
49045|     17|    obj = JS_NewCConstructor(ctx, JS_CLASS_REGEXP, "RegExp",
49046|     17|                                    js_regexp_constructor, 2, JS_CFUNC_constructor_or_func, 0,
49047|     17|                                    JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
49048|     17|                                    js_regexp_funcs, countof(js_regexp_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
49049|     17|                                    js_regexp_proto_funcs, countof(js_regexp_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
49050|     17|                                    0);
49051|     17|    if (JS_IsException(obj))
  ------------------
  |  Branch (49051:9): [True: 0, False: 17]
  ------------------
49052|      0|        return -1;
49053|     17|    ctx->regexp_ctor = obj;
49054|       |    
49055|     17|    ctx->class_proto[JS_CLASS_REGEXP_STRING_ITERATOR] =
49056|     17|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR],
49057|     17|                              js_regexp_string_iterator_proto_funcs,
49058|     17|                              countof(js_regexp_string_iterator_proto_funcs));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
49059|     17|    if (JS_IsException(ctx->class_proto[JS_CLASS_REGEXP_STRING_ITERATOR]))
  ------------------
  |  Branch (49059:9): [True: 0, False: 17]
  ------------------
49060|      0|        return -1;
49061|       |
49062|     17|    ctx->regexp_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_REGEXP]),
49063|     17|                                     JS_PROP_INITIAL_HASH_SIZE, 1);
  ------------------
  |  |  966|     17|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
49064|     17|    if (!ctx->regexp_shape)
  ------------------
  |  Branch (49064:9): [True: 0, False: 17]
  ------------------
49065|      0|        return -1;
49066|     17|    if (add_shape_property(ctx, &ctx->regexp_shape, NULL,
  ------------------
  |  Branch (49066:9): [True: 0, False: 17]
  ------------------
49067|     17|                           JS_ATOM_lastIndex, JS_PROP_WRITABLE))
  ------------------
  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
49068|      0|        return -1;
49069|       |
49070|     17|    ctx->regexp_result_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_ARRAY]),
49071|     17|                                     JS_PROP_INITIAL_HASH_SIZE, 4);
  ------------------
  |  |  966|     17|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
49072|     17|    if (!ctx->regexp_result_shape)
  ------------------
  |  Branch (49072:9): [True: 0, False: 17]
  ------------------
49073|      0|        return -1;
49074|     17|    if (add_shape_property(ctx, &ctx->regexp_result_shape, NULL,
  ------------------
  |  Branch (49074:9): [True: 0, False: 17]
  ------------------
49075|     17|                           JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_LENGTH))
  ------------------
  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_LENGTH))
  ------------------
  |  |  302|     17|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
49076|      0|        return -1;
49077|     17|    if (add_shape_property(ctx, &ctx->regexp_result_shape, NULL,
  ------------------
  |  Branch (49077:9): [True: 0, False: 17]
  ------------------
49078|     17|                           JS_ATOM_index, JS_PROP_C_W_E))
  ------------------
  |  |  301|     17|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|     17|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
49079|      0|        return -1;
49080|     17|    if (add_shape_property(ctx, &ctx->regexp_result_shape, NULL,
  ------------------
  |  Branch (49080:9): [True: 0, False: 17]
  ------------------
49081|     17|                           JS_ATOM_input, JS_PROP_C_W_E))
  ------------------
  |  |  301|     17|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|     17|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
49082|      0|        return -1;
49083|     17|    if (add_shape_property(ctx, &ctx->regexp_result_shape, NULL,
  ------------------
  |  Branch (49083:9): [True: 0, False: 17]
  ------------------
49084|     17|                           JS_ATOM_groups, JS_PROP_C_W_E))
  ------------------
  |  |  301|     17|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|     17|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
49085|      0|        return -1;
49086|       |
49087|     17|    return 0;
49088|     17|}
JS_AddIntrinsicJSON:
50178|     17|{
50179|       |    /* add JSON as autoinit object */
50180|     17|    return JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_json_obj, countof(js_json_obj));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
50181|     17|}
JS_AddIntrinsicProxy:
51308|     17|{
51309|     17|    JSRuntime *rt = ctx->rt;
51310|     17|    JSValue obj1;
51311|       |
51312|     17|    if (!JS_IsRegisteredClass(rt, JS_CLASS_PROXY)) {
  ------------------
  |  Branch (51312:9): [True: 17, False: 0]
  ------------------
51313|     17|        if (init_class_range(rt, js_proxy_class_def, JS_CLASS_PROXY,
  ------------------
  |  Branch (51313:13): [True: 0, False: 17]
  ------------------
51314|     17|                             countof(js_proxy_class_def)))
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
51315|      0|            return -1;
51316|     17|        rt->class_array[JS_CLASS_PROXY].exotic = &js_proxy_exotic_methods;
51317|     17|        rt->class_array[JS_CLASS_PROXY].call = js_proxy_call;
51318|     17|    }
51319|       |
51320|       |    /* additional fields: name, length */
51321|     17|    obj1 = JS_NewCFunction3(ctx, js_proxy_constructor, "Proxy", 2,
51322|     17|                            JS_CFUNC_constructor, 0,
51323|     17|                            ctx->function_proto, countof(js_proxy_funcs) + 2);
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
51324|     17|    if (JS_IsException(obj1))
  ------------------
  |  Branch (51324:9): [True: 0, False: 17]
  ------------------
51325|      0|        return -1;
51326|     17|    JS_SetConstructorBit(ctx, obj1, TRUE);
51327|     17|    if (JS_SetPropertyFunctionList(ctx, obj1, js_proxy_funcs,
  ------------------
  |  Branch (51327:9): [True: 0, False: 17]
  ------------------
51328|     17|                                   countof(js_proxy_funcs)))
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
51329|      0|        goto fail;
51330|     17|    if (JS_DefinePropertyValueStr(ctx, ctx->global_obj, "Proxy",
  ------------------
  |  Branch (51330:9): [True: 0, False: 17]
  ------------------
51331|     17|                                  obj1, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                obj1, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
51332|      0|        goto fail;
51333|     17|    return 0;
51334|      0| fail:
51335|      0|    JS_FreeValue(ctx, obj1);
51336|      0|    return -1;
51337|     17|}
JS_AddIntrinsicMapSet:
53061|     17|{
53062|     17|    int i;
53063|     17|    JSValue obj1;
53064|     17|    char buf[ATOM_GET_STR_BUF_SIZE];
53065|       |
53066|     85|    for(i = 0; i < 4; i++) {
  ------------------
  |  Branch (53066:16): [True: 68, False: 17]
  ------------------
53067|     68|        JSCFunctionType ft;
53068|     68|        const char *name = JS_AtomGetStr(ctx, buf, sizeof(buf),
53069|     68|                                         JS_ATOM_Map + i);
53070|     68|        ft.constructor_magic = js_map_constructor;
53071|     68|        obj1 = JS_NewCConstructor(ctx, JS_CLASS_MAP + i, name,
53072|     68|                                  ft.generic, 0, JS_CFUNC_constructor_magic, i,
53073|     68|                                  JS_UNDEFINED,
  ------------------
  |  |  291|     68|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     68|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53074|     68|                                  js_map_funcs, i < 2 ? countof(js_map_funcs) : 0,
  ------------------
  |  |   47|     34|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (53074:49): [True: 34, False: 34]
  ------------------
53075|     68|                                  js_map_proto_funcs_ptr[i], js_map_proto_funcs_count[i],
53076|     68|                                  0);
53077|     68|        if (JS_IsException(obj1))
  ------------------
  |  Branch (53077:13): [True: 0, False: 68]
  ------------------
53078|      0|            return -1;
53079|     68|        JS_FreeValue(ctx, obj1);
53080|     68|    }
53081|       |
53082|     51|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53082:16): [True: 34, False: 17]
  ------------------
53083|     34|        ctx->class_proto[JS_CLASS_MAP_ITERATOR + i] =
53084|     34|            JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
53085|     34|                                  js_map_proto_funcs_ptr[i + 4],
53086|     34|                                  js_map_proto_funcs_count[i + 4]);
53087|     34|        if (JS_IsException(ctx->class_proto[JS_CLASS_MAP_ITERATOR + i]))
  ------------------
  |  Branch (53087:13): [True: 0, False: 34]
  ------------------
53088|      0|            return -1;
53089|     34|    }
53090|     17|    return 0;
53091|     17|}
JS_PromiseState:
53132|     33|{
53133|     33|    JSPromiseData *s = JS_GetOpaque(promise, JS_CLASS_PROMISE);
53134|     33|    if (!s)
  ------------------
  |  Branch (53134:9): [True: 1, False: 32]
  ------------------
53135|      1|        return -1;
53136|     32|    return s->promise_state;
53137|     33|}
JS_PromiseResult:
53140|     16|{
53141|     16|    JSPromiseData *s = JS_GetOpaque(promise, JS_CLASS_PROMISE);
53142|     16|    if (!s)
  ------------------
  |  Branch (53142:9): [True: 0, False: 16]
  ------------------
53143|      0|        return JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53144|     16|    return JS_DupValue(ctx, s->promise_result);
53145|     16|}
JS_NewPromiseCapability:
53555|     32|{
53556|     32|    return js_new_promise_capability(ctx, resolving_funcs, JS_UNDEFINED);
  ------------------
  |  |  291|     32|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     32|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53557|     32|}
JS_AddIntrinsicPromise:
54410|     17|{
54411|     17|    JSRuntime *rt = ctx->rt;
54412|     17|    JSValue obj1;
54413|     17|    JSCFunctionType ft;
54414|       |
54415|     17|    if (!JS_IsRegisteredClass(rt, JS_CLASS_PROMISE)) {
  ------------------
  |  Branch (54415:9): [True: 17, False: 0]
  ------------------
54416|     17|        if (init_class_range(rt, js_async_class_def, JS_CLASS_PROMISE,
  ------------------
  |  Branch (54416:13): [True: 0, False: 17]
  ------------------
54417|     17|                             countof(js_async_class_def)))
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54418|      0|            return -1;
54419|     17|        rt->class_array[JS_CLASS_PROMISE_RESOLVE_FUNCTION].call = js_promise_resolve_function_call;
54420|     17|        rt->class_array[JS_CLASS_PROMISE_REJECT_FUNCTION].call = js_promise_resolve_function_call;
54421|     17|        rt->class_array[JS_CLASS_ASYNC_FUNCTION].call = js_async_function_call;
54422|     17|        rt->class_array[JS_CLASS_ASYNC_FUNCTION_RESOLVE].call = js_async_function_resolve_call;
54423|     17|        rt->class_array[JS_CLASS_ASYNC_FUNCTION_REJECT].call = js_async_function_resolve_call;
54424|     17|        rt->class_array[JS_CLASS_ASYNC_GENERATOR_FUNCTION].call = js_async_generator_function_call;
54425|     17|    }
54426|       |
54427|       |    /* Promise */
54428|     17|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_PROMISE, "Promise",
54429|     17|                                     js_promise_constructor, 1, JS_CFUNC_constructor, 0,
54430|     17|                                     JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
54431|     17|                                     js_promise_funcs, countof(js_promise_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54432|     17|                                     js_promise_proto_funcs, countof(js_promise_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54433|     17|                                     0);
54434|     17|    if (JS_IsException(obj1))
  ------------------
  |  Branch (54434:9): [True: 0, False: 17]
  ------------------
54435|      0|        return -1;
54436|     17|    ctx->promise_ctor = obj1;
54437|       |    
54438|       |    /* AsyncFunction */
54439|     17|    ft.generic_magic = js_function_constructor;
54440|     17|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_ASYNC_FUNCTION, "AsyncFunction",
54441|     17|                                     ft.generic, 1, JS_CFUNC_constructor_or_func_magic, JS_FUNC_ASYNC,
54442|     17|                                     ctx->function_ctor,
54443|     17|                                     NULL, 0,
54444|     17|                                     js_async_function_proto_funcs, countof(js_async_function_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54445|     17|                                     JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39685|     17|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
                                                   JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39688|     17|#define JS_NEW_CTOR_READONLY    (1 << 3) /* read-only constructor field */
  ------------------
54446|     17|    if (JS_IsException(obj1))
  ------------------
  |  Branch (54446:9): [True: 0, False: 17]
  ------------------
54447|      0|        return -1;
54448|     17|    JS_FreeValue(ctx, obj1);
54449|       |    
54450|       |    /* AsyncIteratorPrototype */
54451|     17|    ctx->async_iterator_proto =
54452|     17|        JS_NewObjectProtoList(ctx,  ctx->class_proto[JS_CLASS_OBJECT],
54453|     17|                              js_async_iterator_proto_funcs,
54454|     17|                              countof(js_async_iterator_proto_funcs));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54455|     17|    if (JS_IsException(ctx->async_iterator_proto))
  ------------------
  |  Branch (54455:9): [True: 0, False: 17]
  ------------------
54456|      0|        return -1;
54457|       |
54458|       |    /* AsyncFromSyncIteratorPrototype */
54459|     17|    ctx->class_proto[JS_CLASS_ASYNC_FROM_SYNC_ITERATOR] =
54460|     17|        JS_NewObjectProtoList(ctx, ctx->async_iterator_proto,
54461|     17|                              js_async_from_sync_iterator_proto_funcs,
54462|     17|                              countof(js_async_from_sync_iterator_proto_funcs));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54463|     17|    if (JS_IsException(ctx->class_proto[JS_CLASS_ASYNC_FROM_SYNC_ITERATOR]))
  ------------------
  |  Branch (54463:9): [True: 0, False: 17]
  ------------------
54464|      0|        return -1;
54465|       |    
54466|       |    /* AsyncGeneratorPrototype */
54467|     17|    ctx->class_proto[JS_CLASS_ASYNC_GENERATOR] =
54468|     17|        JS_NewObjectProtoList(ctx, ctx->async_iterator_proto, 
54469|     17|                              js_async_generator_proto_funcs,
54470|     17|                              countof(js_async_generator_proto_funcs));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54471|     17|    if (JS_IsException(ctx->class_proto[JS_CLASS_ASYNC_GENERATOR]))
  ------------------
  |  Branch (54471:9): [True: 0, False: 17]
  ------------------
54472|      0|        return -1;
54473|       |
54474|       |    /* AsyncGeneratorFunction */
54475|     17|    ft.generic_magic = js_function_constructor;
54476|     17|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_ASYNC_GENERATOR_FUNCTION, "AsyncGeneratorFunction",
54477|     17|                                     ft.generic, 1, JS_CFUNC_constructor_or_func_magic, JS_FUNC_ASYNC_GENERATOR,
54478|     17|                                     ctx->function_ctor,
54479|     17|                                     NULL, 0,
54480|     17|                                     js_async_generator_function_proto_funcs, countof(js_async_generator_function_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54481|     17|                                     JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39685|     17|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
                                                   JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39688|     17|#define JS_NEW_CTOR_READONLY    (1 << 3) /* read-only constructor field */
  ------------------
54482|     17|    if (JS_IsException(obj1))
  ------------------
  |  Branch (54482:9): [True: 0, False: 17]
  ------------------
54483|      0|        return -1;
54484|     17|    JS_FreeValue(ctx, obj1);
54485|       |
54486|     17|    return JS_SetConstructor2(ctx, ctx->class_proto[JS_CLASS_ASYNC_GENERATOR_FUNCTION],
54487|     17|                              ctx->class_proto[JS_CLASS_ASYNC_GENERATOR],
54488|     17|                              JS_PROP_CONFIGURABLE, JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                            JS_PROP_CONFIGURABLE, JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
54489|     17|}
JS_AddIntrinsicDate:
55929|     17|{
55930|     17|    JSValue obj;
55931|       |
55932|       |    /* Date */
55933|     17|    obj = JS_NewCConstructor(ctx, JS_CLASS_DATE, "Date",
55934|     17|                                    js_date_constructor, 7, JS_CFUNC_constructor_or_func, 0,
55935|     17|                                    JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
55936|     17|                                    js_date_funcs, countof(js_date_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
55937|     17|                                    js_date_proto_funcs, countof(js_date_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
55938|     17|                                    0);
55939|     17|    if (JS_IsException(obj))
  ------------------
  |  Branch (55939:9): [True: 0, False: 17]
  ------------------
55940|      0|        return -1;
55941|     17|    JS_FreeValue(ctx, obj);
55942|     17|    return 0;
55943|     17|}
JS_AddIntrinsicEval:
55948|     17|{
55949|     17|    ctx->eval_internal = __JS_EvalInternal;
55950|     17|    return 0;
55951|     17|}
JS_AddIntrinsicBaseObjects:
56285|     17|{
56286|     17|    JSValue obj1, obj2;
56287|     17|    JSCFunctionType ft;
56288|       |
56289|     17|    ctx->throw_type_error = JS_NewCFunction(ctx, js_throw_type_error, NULL, 0);
56290|     17|    if (JS_IsException(ctx->throw_type_error))
  ------------------
  |  Branch (56290:9): [True: 0, False: 17]
  ------------------
56291|      0|        return -1;
56292|       |    /* add caller and arguments properties to throw a TypeError */
56293|     17|    if (JS_DefineProperty(ctx, ctx->function_proto, JS_ATOM_caller, JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
  |  Branch (56293:9): [True: 0, False: 17]
  ------------------
56294|     17|                          ctx->throw_type_error, ctx->throw_type_error,
56295|     17|                          JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  314|     17|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                        JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  315|     17|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
56296|     17|                          JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  311|     17|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                                        JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56297|      0|        return -1;
56298|     17|    if (JS_DefineProperty(ctx, ctx->function_proto, JS_ATOM_arguments, JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
  |  Branch (56298:9): [True: 0, False: 17]
  ------------------
56299|     17|                          ctx->throw_type_error, ctx->throw_type_error,
56300|     17|                          JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  314|     17|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                        JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  315|     17|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
56301|     17|                          JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  311|     17|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                                        JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56302|      0|        return -1;
56303|     17|    JS_FreeValue(ctx, js_object_seal(ctx, JS_UNDEFINED, 1, (JSValueConst *)&ctx->throw_type_error, 1));
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56304|       |
56305|       |    /* Object */
56306|     17|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_OBJECT, "Object",
56307|     17|                              js_object_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56308|     17|                              JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56309|     17|                              js_object_funcs, countof(js_object_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56310|     17|                              js_object_proto_funcs, countof(js_object_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56311|     17|                              JS_NEW_CTOR_PROTO_EXIST);
  ------------------
  |  |39687|     17|#define JS_NEW_CTOR_PROTO_EXIST (1 << 2) /* the prototype is already defined */
  ------------------
56312|     17|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56312:9): [True: 0, False: 17]
  ------------------
56313|      0|        return -1;
56314|     17|    JS_FreeValue(ctx, obj1);
56315|       |    
56316|       |    /* Function */
56317|     17|    ft.generic_magic = js_function_constructor;
56318|     17|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_BYTECODE_FUNCTION, "Function",
56319|     17|                              ft.generic, 1, JS_CFUNC_constructor_or_func_magic, JS_FUNC_NORMAL,
56320|     17|                              JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56321|     17|                              NULL, 0,
56322|     17|                              js_function_proto_funcs, countof(js_function_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56323|     17|                              JS_NEW_CTOR_PROTO_EXIST);
  ------------------
  |  |39687|     17|#define JS_NEW_CTOR_PROTO_EXIST (1 << 2) /* the prototype is already defined */
  ------------------
56324|     17|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56324:9): [True: 0, False: 17]
  ------------------
56325|      0|        return -1;
56326|     17|    ctx->function_ctor = obj1;
56327|       |
56328|       |    /* Iterator */
56329|     17|    obj2 = JS_NewCConstructor(ctx, JS_CLASS_ITERATOR, "Iterator",
56330|     17|                                     js_iterator_constructor, 0, JS_CFUNC_constructor_or_func, 0,
56331|     17|                                     JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56332|     17|                                     js_iterator_funcs, countof(js_iterator_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56333|     17|                                     js_iterator_proto_funcs, countof(js_iterator_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56334|     17|                                     0);
56335|     17|    if (JS_IsException(obj2))
  ------------------
  |  Branch (56335:9): [True: 0, False: 17]
  ------------------
56336|      0|        return -1;
56337|       |    // quirk: Iterator.prototype.constructor is an accessor property
56338|       |    // TODO(bnoordhuis) mildly inefficient because JS_NewGlobalCConstructor
56339|       |    // first creates a .constructor value property that we then replace with
56340|       |    // an accessor
56341|     17|    obj1 = JS_NewCFunctionData(ctx, js_iterator_constructor_getset,
56342|     17|                               0, 0, 1, (JSValueConst *)&obj2);
56343|     17|    if (JS_IsException(obj1)) {
  ------------------
  |  Branch (56343:9): [True: 0, False: 17]
  ------------------
56344|      0|        JS_FreeValue(ctx, obj2);
56345|      0|        return -1;
56346|      0|    }
56347|     17|    if (JS_DefineProperty(ctx, ctx->class_proto[JS_CLASS_ITERATOR],
  ------------------
  |  Branch (56347:9): [True: 0, False: 17]
  ------------------
56348|     17|                          JS_ATOM_constructor, JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56349|     17|                          obj1, obj1,
56350|     17|                          JS_PROP_HAS_GET | JS_PROP_HAS_SET | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  314|     17|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                        JS_PROP_HAS_GET | JS_PROP_HAS_SET | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  315|     17|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
                                        JS_PROP_HAS_GET | JS_PROP_HAS_SET | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56351|      0|        JS_FreeValue(ctx, obj2);
56352|      0|        JS_FreeValue(ctx, obj1);
56353|      0|        return -1;
56354|      0|    }
56355|     17|    JS_FreeValue(ctx, obj1);
56356|     17|    ctx->iterator_ctor = obj2;
56357|       |    
56358|     17|    ctx->class_proto[JS_CLASS_ITERATOR_CONCAT] =
56359|     17|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56360|     17|                              js_iterator_concat_proto_funcs,
56361|     17|                              countof(js_iterator_concat_proto_funcs));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56362|     17|    if (JS_IsException(ctx->class_proto[JS_CLASS_ITERATOR_CONCAT]))
  ------------------
  |  Branch (56362:9): [True: 0, False: 17]
  ------------------
56363|      0|        return -1;
56364|     17|    ctx->class_proto[JS_CLASS_ITERATOR_HELPER] =
56365|     17|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56366|     17|                              js_iterator_helper_proto_funcs,
56367|     17|                              countof(js_iterator_helper_proto_funcs));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56368|     17|    if (JS_IsException(ctx->class_proto[JS_CLASS_ITERATOR_HELPER]))
  ------------------
  |  Branch (56368:9): [True: 0, False: 17]
  ------------------
56369|      0|        return -1;
56370|       |                       
56371|     17|    ctx->class_proto[JS_CLASS_ITERATOR_WRAP] =
56372|     17|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56373|     17|                              js_iterator_wrap_proto_funcs,
56374|     17|                              countof(js_iterator_wrap_proto_funcs));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56375|     17|    if (JS_IsException(ctx->class_proto[JS_CLASS_ITERATOR_WRAP]))
  ------------------
  |  Branch (56375:9): [True: 0, False: 17]
  ------------------
56376|      0|        return -1;
56377|       |
56378|       |    /* needed to initialize arguments[Symbol.iterator] */
56379|     17|    ctx->array_proto_values =
56380|     17|        JS_GetProperty(ctx, ctx->class_proto[JS_CLASS_ARRAY], JS_ATOM_values);
56381|     17|    if (JS_IsException(ctx->array_proto_values))
  ------------------
  |  Branch (56381:9): [True: 0, False: 17]
  ------------------
56382|      0|        return -1;
56383|       |
56384|     17|    ctx->class_proto[JS_CLASS_ARRAY_ITERATOR] =
56385|     17|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56386|     17|                              js_array_iterator_proto_funcs,
56387|     17|                              countof(js_array_iterator_proto_funcs));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56388|     17|    if (JS_IsException(ctx->class_proto[JS_CLASS_ARRAY_ITERATOR]))
  ------------------
  |  Branch (56388:9): [True: 0, False: 17]
  ------------------
56389|      0|        return -1;
56390|       |
56391|       |    /* parseFloat and parseInteger must be defined before Number
56392|       |       because of the Number.parseFloat and Number.parseInteger
56393|       |       aliases */
56394|     17|    if (JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_global_funcs,
  ------------------
  |  Branch (56394:9): [True: 0, False: 17]
  ------------------
56395|     17|                                   countof(js_global_funcs)))
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56396|      0|        return -1;
56397|       |
56398|       |    /* Number */
56399|     17|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_NUMBER, "Number",
56400|     17|                                     js_number_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56401|     17|                                     JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56402|     17|                                     js_number_funcs, countof(js_number_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56403|     17|                                     js_number_proto_funcs, countof(js_number_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56404|     17|                                     JS_NEW_CTOR_PROTO_CLASS);
  ------------------
  |  |39686|     17|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
56405|     17|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56405:9): [True: 0, False: 17]
  ------------------
56406|      0|        return -1;
56407|     17|    JS_FreeValue(ctx, obj1);
56408|     17|    if (JS_SetObjectData(ctx, ctx->class_proto[JS_CLASS_NUMBER], JS_NewInt32(ctx, 0)))
  ------------------
  |  Branch (56408:9): [True: 0, False: 17]
  ------------------
56409|      0|        return -1;
56410|       |    
56411|       |    /* Boolean */
56412|     17|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_BOOLEAN, "Boolean",
56413|     17|                                     js_boolean_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56414|     17|                                     JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56415|     17|                                     NULL, 0,
56416|     17|                                     js_boolean_proto_funcs, countof(js_boolean_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56417|     17|                                     JS_NEW_CTOR_PROTO_CLASS);
  ------------------
  |  |39686|     17|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
56418|     17|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56418:9): [True: 0, False: 17]
  ------------------
56419|      0|        return -1;
56420|     17|    JS_FreeValue(ctx, obj1);
56421|     17|    if (JS_SetObjectData(ctx, ctx->class_proto[JS_CLASS_BOOLEAN], JS_NewBool(ctx, FALSE)))
  ------------------
  |  Branch (56421:9): [True: 0, False: 17]
  ------------------
56422|      0|        return -1;
56423|       |
56424|       |    /* String */
56425|     17|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_STRING, "String",
56426|     17|                                     js_string_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56427|     17|                                     JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56428|     17|                                     js_string_funcs, countof(js_string_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56429|     17|                                     js_string_proto_funcs, countof(js_string_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56430|     17|                                     JS_NEW_CTOR_PROTO_CLASS);
  ------------------
  |  |39686|     17|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
56431|     17|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56431:9): [True: 0, False: 17]
  ------------------
56432|      0|        return -1;
56433|     17|    JS_FreeValue(ctx, obj1);
56434|     17|    if (JS_SetObjectData(ctx, ctx->class_proto[JS_CLASS_STRING], JS_AtomToString(ctx, JS_ATOM_empty_string)))
  ------------------
  |  Branch (56434:9): [True: 0, False: 17]
  ------------------
56435|      0|        return -1;
56436|       |
56437|     17|    ctx->class_proto[JS_CLASS_STRING_ITERATOR] =
56438|     17|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56439|     17|                              js_string_iterator_proto_funcs,
56440|     17|                              countof(js_string_iterator_proto_funcs));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56441|     17|    if (JS_IsException(ctx->class_proto[JS_CLASS_STRING_ITERATOR]))
  ------------------
  |  Branch (56441:9): [True: 0, False: 17]
  ------------------
56442|      0|        return -1;
56443|       |
56444|       |    /* Math: create as autoinit object */
56445|     17|    js_random_init(ctx);
56446|     17|    if (JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_math_obj, countof(js_math_obj)))
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (56446:9): [True: 0, False: 17]
  ------------------
56447|      0|        return -1;
56448|       |
56449|       |    /* ES6 Reflect: create as autoinit object */
56450|     17|    if (JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_reflect_obj, countof(js_reflect_obj)))
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (56450:9): [True: 0, False: 17]
  ------------------
56451|      0|        return -1;
56452|       |
56453|       |    /* ES6 Symbol */
56454|     17|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_SYMBOL, "Symbol",
56455|     17|                                     js_symbol_constructor, 0, JS_CFUNC_constructor_or_func, 0,
56456|     17|                                     JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56457|     17|                                     js_symbol_funcs, countof(js_symbol_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56458|     17|                                     js_symbol_proto_funcs, countof(js_symbol_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56459|     17|                                     0);
56460|     17|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56460:9): [True: 0, False: 17]
  ------------------
56461|      0|        return -1;
56462|     17|    JS_FreeValue(ctx, obj1);
56463|       |    
56464|       |    /* ES6 Generator */
56465|     17|    ctx->class_proto[JS_CLASS_GENERATOR] =
56466|     17|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR],
56467|     17|                              js_generator_proto_funcs,
56468|     17|                              countof(js_generator_proto_funcs));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56469|     17|    if (JS_IsException(ctx->class_proto[JS_CLASS_GENERATOR]))
  ------------------
  |  Branch (56469:9): [True: 0, False: 17]
  ------------------
56470|      0|        return -1;
56471|       |
56472|     17|    ft.generic_magic = js_function_constructor;
56473|     17|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_GENERATOR_FUNCTION, "GeneratorFunction",
56474|     17|                                     ft.generic, 1, JS_CFUNC_constructor_or_func_magic, JS_FUNC_GENERATOR,
56475|     17|                                     ctx->function_ctor,
56476|     17|                                     NULL, 0,
56477|     17|                                     js_generator_function_proto_funcs,
56478|     17|                                     countof(js_generator_function_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56479|     17|                                     JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39685|     17|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
                                                   JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39688|     17|#define JS_NEW_CTOR_READONLY    (1 << 3) /* read-only constructor field */
  ------------------
56480|     17|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56480:9): [True: 0, False: 17]
  ------------------
56481|      0|        return -1;
56482|     17|    JS_FreeValue(ctx, obj1);
56483|     17|    if (JS_SetConstructor2(ctx, ctx->class_proto[JS_CLASS_GENERATOR_FUNCTION],
  ------------------
  |  Branch (56483:9): [True: 0, False: 17]
  ------------------
56484|     17|                           ctx->class_proto[JS_CLASS_GENERATOR],
56485|     17|                           JS_PROP_CONFIGURABLE, JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                         JS_PROP_CONFIGURABLE, JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56486|      0|        return -1;
56487|       |    
56488|       |    /* global properties */
56489|     17|    ctx->eval_obj = JS_GetProperty(ctx, ctx->global_obj, JS_ATOM_eval);
56490|     17|    if (JS_IsException(ctx->eval_obj))
  ------------------
  |  Branch (56490:9): [True: 0, False: 17]
  ------------------
56491|      0|        return -1;
56492|       |    
56493|     17|    if (JS_DefinePropertyValue(ctx, ctx->global_obj, JS_ATOM_globalThis,
  ------------------
  |  Branch (56493:9): [True: 0, False: 17]
  ------------------
56494|     17|                               JS_DupValue(ctx, ctx->global_obj),
56495|     17|                               JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE) < 0)
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                             JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE) < 0)
  ------------------
  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
56496|      0|        return -1;
56497|       |
56498|       |    /* BigInt */
56499|     17|    if (JS_AddIntrinsicBigInt(ctx))
  ------------------
  |  Branch (56499:9): [True: 0, False: 17]
  ------------------
56500|      0|        return -1;
56501|     17|    return 0;
56502|     17|}
JS_AddIntrinsicTypedArrays:
60805|     17|{
60806|     17|    JSValue typed_array_base_func, typed_array_base_proto, obj;
60807|     17|    int i, ret;
60808|       |
60809|     17|    obj = JS_NewCConstructor(ctx, JS_CLASS_ARRAY_BUFFER, "ArrayBuffer",
60810|     17|                                    js_array_buffer_constructor, 1, JS_CFUNC_constructor, 0,
60811|     17|                                    JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
60812|     17|                                    js_array_buffer_funcs, countof(js_array_buffer_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60813|     17|                                    js_array_buffer_proto_funcs, countof(js_array_buffer_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60814|     17|                                    0);
60815|     17|    if (JS_IsException(obj))
  ------------------
  |  Branch (60815:9): [True: 0, False: 17]
  ------------------
60816|      0|        return -1;
60817|     17|    JS_FreeValue(ctx, obj);
60818|       |
60819|     17|    obj = JS_NewCConstructor(ctx, JS_CLASS_SHARED_ARRAY_BUFFER, "SharedArrayBuffer",
60820|     17|                                    js_shared_array_buffer_constructor, 1, JS_CFUNC_constructor, 0,
60821|     17|                                    JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
60822|     17|                                    js_shared_array_buffer_funcs, countof(js_shared_array_buffer_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60823|     17|                                    js_shared_array_buffer_proto_funcs, countof(js_shared_array_buffer_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60824|     17|                                    0);
60825|     17|    if (JS_IsException(obj))
  ------------------
  |  Branch (60825:9): [True: 0, False: 17]
  ------------------
60826|      0|        return -1;
60827|     17|    JS_FreeValue(ctx, obj);
60828|       |
60829|       |
60830|     17|    typed_array_base_func =
60831|     17|        JS_NewCConstructor(ctx, -1, "TypedArray",
60832|     17|                                  js_typed_array_base_constructor, 0, JS_CFUNC_constructor_or_func, 0,
60833|     17|                                  JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
60834|     17|                                  js_typed_array_base_funcs, countof(js_typed_array_base_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60835|     17|                                  js_typed_array_base_proto_funcs, countof(js_typed_array_base_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60836|     17|                                  JS_NEW_CTOR_NO_GLOBAL);
  ------------------
  |  |39685|     17|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
60837|     17|    if (JS_IsException(typed_array_base_func))
  ------------------
  |  Branch (60837:9): [True: 0, False: 17]
  ------------------
60838|      0|        return -1;
60839|       |
60840|       |    /* TypedArray.prototype.toString must be the same object as Array.prototype.toString */
60841|     17|    obj = JS_GetProperty(ctx, ctx->class_proto[JS_CLASS_ARRAY], JS_ATOM_toString);
60842|     17|    if (JS_IsException(obj))
  ------------------
  |  Branch (60842:9): [True: 0, False: 17]
  ------------------
60843|      0|        goto fail;
60844|       |    /* XXX: should use alias method in JSCFunctionListEntry */ //@@@
60845|     17|    typed_array_base_proto = JS_GetProperty(ctx, typed_array_base_func, JS_ATOM_prototype);
60846|     17|    if (JS_IsException(typed_array_base_proto))
  ------------------
  |  Branch (60846:9): [True: 0, False: 17]
  ------------------
60847|      0|        goto fail;
60848|     17|    ret = JS_DefinePropertyValue(ctx, typed_array_base_proto, JS_ATOM_toString, obj,
60849|     17|                                 JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                               JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
60850|     17|    JS_FreeValue(ctx, typed_array_base_proto);
60851|     17|    if (ret < 0)
  ------------------
  |  Branch (60851:9): [True: 0, False: 17]
  ------------------
60852|      0|        goto fail;
60853|       |    
60854|       |    /* Used to squelch a -Wcast-function-type warning. */
60855|     17|    JSCFunctionType ft = { .generic_magic = js_typed_array_constructor };
60856|    221|    for(i = JS_CLASS_UINT8C_ARRAY; i < JS_CLASS_UINT8C_ARRAY + JS_TYPED_ARRAY_COUNT; i++) {
  ------------------
  |  |  191|    221|#define JS_TYPED_ARRAY_COUNT  (JS_CLASS_FLOAT64_ARRAY - JS_CLASS_UINT8C_ARRAY + 1)
  ------------------
  |  Branch (60856:36): [True: 204, False: 17]
  ------------------
60857|    204|        char buf[ATOM_GET_STR_BUF_SIZE];
60858|    204|        const char *name;
60859|       |            
60860|    204|        name = JS_AtomGetStr(ctx, buf, sizeof(buf),
60861|    204|                             JS_ATOM_Uint8ClampedArray + i - JS_CLASS_UINT8C_ARRAY);
60862|    204|        if (i == JS_CLASS_UINT8_ARRAY) {
  ------------------
  |  Branch (60862:13): [True: 17, False: 187]
  ------------------
60863|     17|            obj = JS_NewCConstructor(ctx, i, name,
60864|     17|                                     ft.generic, 3, JS_CFUNC_constructor_magic, i,
60865|     17|                                     typed_array_base_func,
60866|     17|                                     js_uint8array_funcs, countof(js_uint8array_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60867|     17|                                     js_uint8array_proto_funcs, countof(js_uint8array_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60868|     17|                                     0);
60869|    187|        } else {
60870|    187|            const JSCFunctionListEntry *bpe = js_typed_array_funcs + typed_array_size_log2(i);
  ------------------
  |  |  193|    187|#define typed_array_size_log2(classid)  (typed_array_size_log2[(classid)- JS_CLASS_UINT8C_ARRAY])
  ------------------
60871|    187|            obj = JS_NewCConstructor(ctx, i, name,
60872|    187|                                     ft.generic, 3, JS_CFUNC_constructor_magic, i,
60873|    187|                                     typed_array_base_func,
60874|    187|                                     bpe, 1,
60875|    187|                                     bpe, 1,
60876|    187|                                     0);
60877|    187|        }
60878|    204|        if (JS_IsException(obj)) {
  ------------------
  |  Branch (60878:13): [True: 0, False: 204]
  ------------------
60879|      0|        fail:
60880|      0|            JS_FreeValue(ctx, typed_array_base_func);
60881|      0|            return -1;
60882|      0|        }
60883|    204|        JS_FreeValue(ctx, obj);
60884|    204|    }
60885|     17|    JS_FreeValue(ctx, typed_array_base_func);
60886|       |
60887|       |    /* DataView */
60888|     17|    obj = JS_NewCConstructor(ctx, JS_CLASS_DATAVIEW, "DataView",
60889|     17|                                    js_dataview_constructor, 1, JS_CFUNC_constructor, 0,
60890|     17|                                    JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
60891|     17|                                    NULL, 0,
60892|     17|                                    js_dataview_proto_funcs, countof(js_dataview_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60893|     17|                                    0);
60894|     17|    if (JS_IsException(obj))
  ------------------
  |  Branch (60894:9): [True: 0, False: 17]
  ------------------
60895|      0|        return -1;
60896|     17|    JS_FreeValue(ctx, obj);
60897|       |
60898|       |    /* Atomics */
60899|     17|#ifdef CONFIG_ATOMICS
60900|     17|    if (JS_AddIntrinsicAtomics(ctx))
  ------------------
  |  Branch (60900:9): [True: 0, False: 17]
  ------------------
60901|      0|        return -1;
60902|     17|#endif
60903|     17|    return 0;
60904|     17|}
JS_AddIntrinsicWeakRef:
61160|     17|{
61161|     17|    JSRuntime *rt = ctx->rt;
61162|     17|    JSValue obj;
61163|       |    
61164|       |    /* WeakRef */
61165|     17|    if (!JS_IsRegisteredClass(rt, JS_CLASS_WEAK_REF)) {
  ------------------
  |  Branch (61165:9): [True: 17, False: 0]
  ------------------
61166|     17|        if (init_class_range(rt, js_weakref_class_def, JS_CLASS_WEAK_REF,
  ------------------
  |  Branch (61166:13): [True: 0, False: 17]
  ------------------
61167|     17|                             countof(js_weakref_class_def)))
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61168|      0|            return -1;
61169|     17|    }
61170|     17|    obj = JS_NewCConstructor(ctx, JS_CLASS_WEAK_REF, "WeakRef",
61171|     17|                             js_weakref_constructor, 1, JS_CFUNC_constructor_or_func, 0,
61172|     17|                             JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
61173|     17|                             NULL, 0,
61174|     17|                             js_weakref_proto_funcs, countof(js_weakref_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61175|     17|                             0);
61176|     17|    if (JS_IsException(obj))
  ------------------
  |  Branch (61176:9): [True: 0, False: 17]
  ------------------
61177|      0|        return -1;
61178|     17|    JS_FreeValue(ctx, obj);
61179|       |
61180|       |    /* FinalizationRegistry */
61181|     17|    if (!JS_IsRegisteredClass(rt, JS_CLASS_FINALIZATION_REGISTRY)) {
  ------------------
  |  Branch (61181:9): [True: 17, False: 0]
  ------------------
61182|     17|        if (init_class_range(rt, js_finrec_class_def, JS_CLASS_FINALIZATION_REGISTRY,
  ------------------
  |  Branch (61182:13): [True: 0, False: 17]
  ------------------
61183|     17|                             countof(js_finrec_class_def)))
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61184|      0|            return -1;
61185|     17|    }
61186|       |
61187|     17|    obj = JS_NewCConstructor(ctx, JS_CLASS_FINALIZATION_REGISTRY, "FinalizationRegistry",
61188|     17|                             js_finrec_constructor, 1, JS_CFUNC_constructor_or_func, 0,
61189|     17|                             JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
61190|     17|                             NULL, 0,
61191|     17|                             js_finrec_proto_funcs, countof(js_finrec_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61192|     17|                             0);
61193|     17|    if (JS_IsException(obj))
  ------------------
  |  Branch (61193:9): [True: 0, False: 17]
  ------------------
61194|      0|        return -1;
61195|     17|    JS_FreeValue(ctx, obj);
61196|     17|    return 0;
61197|     17|}
quickjs.c:__js_malloc:
 1550|  1.11M|{
 1551|  1.11M|    size_t total_size;
 1552|  1.11M|    if (unlikely(size == 0)) {
  ------------------
  |  |   33|  1.11M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.11M]
  |  |  ------------------
  ------------------
 1553|      0|        JSMallocBlockHeader *b = get_zero_size_block(s);
 1554|      0|        return b->user_data;
 1555|  1.11M|    } else {
 1556|  1.11M|        total_size = ((size + JS_MALLOC_ALIGN - 1) & ~(JS_MALLOC_ALIGN - 1)) +
  ------------------
  |  |  243|  1.11M|#define JS_MALLOC_ALIGN 8
  ------------------
                      total_size = ((size + JS_MALLOC_ALIGN - 1) & ~(JS_MALLOC_ALIGN - 1)) +
  ------------------
  |  |  243|  1.11M|#define JS_MALLOC_ALIGN 8
  ------------------
 1557|  1.11M|            sizeof(JSMallocBlockHeader);
 1558|  1.11M|        if (!JS_MALLOC_LARGE_BLOCKS_ONLY &&
  ------------------
  |  |  252|  2.22M|#define JS_MALLOC_LARGE_BLOCKS_ONLY 0
  ------------------
  |  Branch (1558:13): [True: 1.11M, Folded]
  ------------------
 1559|  1.11M|            total_size <= JS_MALLOC_MAX_SMALL_SIZE) {
  ------------------
  |  |  247|  1.11M|#define JS_MALLOC_MAX_SMALL_SIZE 512
  ------------------
  |  Branch (1559:13): [True: 1.11M, False: 508]
  ------------------
 1560|  1.11M|            int block_size_idx;
 1561|  1.11M|            unsigned int block_idx, block_size;
 1562|  1.11M|            JSMallocBlockHeader *b;
 1563|  1.11M|            JSMallocArena *ar;
 1564|  1.11M|            struct list_head *el, *head;
 1565|       |            
 1566|  1.11M|            block_size_idx = get_block_size_index(total_size);
 1567|  1.11M|            block_size = js_malloc_block_sizes[block_size_idx];
 1568|  1.11M|            head = &s->free_arena_list[block_size_idx];
 1569|  1.11M|            el = head->next;
 1570|  1.11M|            if (unlikely(el == head)) {
  ------------------
  |  |   33|  1.11M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1.61k, False: 1.11M]
  |  |  ------------------
  ------------------
 1571|  1.61k|                ar = js_malloc_new_arena(s, block_size_idx);
 1572|  1.61k|                if (!ar)
  ------------------
  |  Branch (1572:21): [True: 0, False: 1.61k]
  ------------------
 1573|      0|                    return NULL;
 1574|  1.11M|            } else {
 1575|  1.11M|                ar = list_entry(el, JSMallocArena, free_link);
  ------------------
  |  |   39|  1.11M|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  1.11M|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 1576|  1.11M|            }
 1577|  1.11M|            block_idx = ar->first_free_block;
 1578|  1.11M|            b = get_arena_block(ar, ar->first_free_block, block_size);
 1579|  1.11M|            ar->first_free_block = b->u.free_next;
 1580|  1.11M|            b->u.block_idx = block_idx;
 1581|  1.11M|            ar->n_used_blocks++;
 1582|  1.11M|            if (unlikely(ar->n_used_blocks == ar->n_blocks)) {
  ------------------
  |  |   33|  1.11M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 991, False: 1.11M]
  |  |  ------------------
  ------------------
 1583|    991|                list_del(&ar->free_link);
 1584|    991|            }
 1585|       |#ifdef JS_MALLOC_USE_ITER
 1586|       |            ar->bitmap[block_idx / 32] |= 1 << (block_idx % 32);
 1587|       |#endif
 1588|  1.11M|            return b->user_data;
 1589|  1.11M|        } else {
 1590|    508|            return js_malloc_large(s, size);
 1591|    508|        }
 1592|  1.11M|    }
 1593|  1.11M|}
quickjs.c:get_zero_size_block:
 1469|  1.83k|{
 1470|  1.83k|    return (JSMallocBlockHeader *)s->zero_size_block;
 1471|  1.83k|}
quickjs.c:get_block_size_index:
 1454|  1.11M|{
 1455|  1.11M|    if (size <= 16) {
  ------------------
  |  Branch (1455:9): [True: 331, False: 1.11M]
  ------------------
 1456|    331|        return 0;
 1457|  1.11M|    } else if (size <= 128) {
  ------------------
  |  Branch (1457:16): [True: 1.10M, False: 4.13k]
  ------------------
 1458|  1.10M|        return (size + 7) / 8 - 2;
 1459|  1.10M|    } else if (size <= 256) {
  ------------------
  |  Branch (1459:16): [True: 3.21k, False: 918]
  ------------------
 1460|  3.21k|        return (size + 15) / 16 + 6;
 1461|  3.21k|    } else if (size <= 512) {
  ------------------
  |  Branch (1461:16): [True: 918, False: 0]
  ------------------
 1462|    918|        return (size + 31) / 32 + 14;
 1463|    918|    } else {
 1464|      0|        return JS_MALLOC_BLOCK_SIZE_COUNT;
  ------------------
  |  |  245|      0|#define JS_MALLOC_BLOCK_SIZE_COUNT 31
  ------------------
 1465|      0|    }
 1466|  1.11M|}
quickjs.c:js_malloc_new_arena:
 1498|  1.61k|{
 1499|  1.61k|    JSMallocBlockHeader *b;
 1500|  1.61k|    JSMallocArena *ar;
 1501|  1.61k|    int n_blocks, block_size, i;
 1502|       |
 1503|  1.61k|    block_size = js_malloc_block_sizes[block_size_idx];
 1504|  1.61k|    n_blocks = (JS_MALLOC_ARENA_SIZE - sizeof(JSMallocArena)) / block_size;
  ------------------
  |  |  244|  1.61k|#define JS_MALLOC_ARENA_SIZE 4096
  ------------------
 1505|  1.61k|    ar = s->mf.js_malloc(&s->malloc_state, sizeof(JSMallocArena) + n_blocks * block_size);
 1506|  1.61k|    if (!ar)
  ------------------
  |  Branch (1506:9): [True: 0, False: 1.61k]
  ------------------
 1507|      0|        return NULL;
 1508|       |
 1509|  1.61k|    ar->block_size_idx = block_size_idx;
 1510|  1.61k|    ar->n_blocks = n_blocks;
 1511|  1.61k|    ar->n_used_blocks = 0;
 1512|  1.61k|    ar->first_free_block = 0;
 1513|       |#ifdef JS_MALLOC_USE_ITER
 1514|       |    {
 1515|       |        int n_bitmap_words = (n_blocks + 31) / 32;
 1516|       |        for(i = 0; i < n_bitmap_words; i++)
 1517|       |            ar->bitmap[i] = 0;
 1518|       |    }
 1519|       |#endif
 1520|   157k|    for(i = 0; i < n_blocks - 1; i++) {
  ------------------
  |  Branch (1520:16): [True: 156k, False: 1.61k]
  ------------------
 1521|   156k|        b = get_arena_block(ar, i, block_size);
 1522|   156k|        b->u.free_next = i + 1;
 1523|   156k|        b->block_size_idx = block_size_idx;
 1524|   156k|    }
 1525|  1.61k|    b = get_arena_block(ar, n_blocks - 1, block_size);
 1526|  1.61k|    b->u.free_next = FREE_NIL;
  ------------------
  |  |  259|  1.61k|#define FREE_NIL 0xffff
  ------------------
 1527|  1.61k|    b->block_size_idx = block_size_idx;
 1528|       |    
 1529|       |    /* add to the head */
 1530|  1.61k|    list_add(&ar->link, &s->arena_list[block_size_idx]);
 1531|  1.61k|    list_add(&ar->free_link, &s->free_arena_list[block_size_idx]);
 1532|  1.61k|    return ar;
 1533|  1.61k|}
quickjs.c:get_arena_block:
 1488|  1.26M|{
 1489|  1.26M|    return ar->blocks + idx * block_size;
 1490|  1.26M|}
quickjs.c:js_malloc_large:
 1536|    508|{
 1537|    508|    JSMallocLargeBlockHeader *b;
 1538|    508|    b = s->mf.js_malloc(&s->malloc_state, sizeof(JSMallocLargeBlockHeader) + size);
 1539|    508|    if (!b)
  ------------------
  |  Branch (1539:9): [True: 0, False: 508]
  ------------------
 1540|      0|        return NULL;
 1541|    508|    b->header.u.block_idx = FREE_NIL;
  ------------------
  |  |  259|    508|#define FREE_NIL 0xffff
  ------------------
 1542|    508|    b->header.block_size_idx = 0xff; /* fail safe */
 1543|       |#ifdef JS_MALLOC_USE_ITER
 1544|       |    list_add_tail(&b->link, &s->large_block_list);
 1545|       |#endif
 1546|    508|    return b->header.user_data;
 1547|    508|}
quickjs.c:__js_free:
 1596|  1.11M|{
 1597|  1.11M|    JSMallocBlockHeader *b;
 1598|       |
 1599|  1.11M|    if (!ptr)
  ------------------
  |  Branch (1599:9): [True: 437, False: 1.11M]
  ------------------
 1600|    437|        return;
 1601|  1.11M|    b = container_of(ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|  1.11M|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1602|  1.11M|    if (unlikely(b->u.block_idx == FREE_NIL)) {
  ------------------
  |  |   33|  1.11M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 508, False: 1.11M]
  |  |  ------------------
  ------------------
 1603|       |        /* large or zero size block */
 1604|    508|        if (b == get_zero_size_block(s)) {
  ------------------
  |  Branch (1604:13): [True: 0, False: 508]
  ------------------
 1605|       |            /* nothing to do */
 1606|    508|        } else {
 1607|    508|            JSMallocLargeBlockHeader *lb = container_of(ptr, JSMallocLargeBlockHeader, header.user_data);
  ------------------
  |  |   51|    508|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1608|       |#ifdef JS_MALLOC_USE_ITER
 1609|       |            list_del(&lb->link);
 1610|       |#endif
 1611|    508|            s->mf.js_free(&s->malloc_state, lb);
 1612|    508|        }
 1613|  1.11M|    } else {
 1614|  1.11M|        unsigned int block_idx = b->u.block_idx;
 1615|  1.11M|        unsigned int block_size_idx = b->block_size_idx;
 1616|  1.11M|        unsigned int block_size = js_malloc_block_sizes[block_size_idx];
 1617|  1.11M|        JSMallocArena *ar = (JSMallocArena *)((uint8_t *)b - block_size * block_idx - sizeof(JSMallocArena));
 1618|  1.11M|        b->u.free_next = ar->first_free_block;
 1619|  1.11M|        ar->first_free_block = block_idx;
 1620|       |#ifdef JS_MALLOC_USE_ITER
 1621|       |        ar->bitmap[block_idx / 32] &= ~(1 << (block_idx % 32));
 1622|       |#endif
 1623|       |        /* add back to the free list if needed */
 1624|  1.11M|        if (unlikely(ar->n_used_blocks == ar->n_blocks)) {
  ------------------
  |  |   33|  1.11M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 991, False: 1.11M]
  |  |  ------------------
  ------------------
 1625|    991|            list_add(&ar->free_link, &s->free_arena_list[block_size_idx]);
 1626|    991|        }
 1627|  1.11M|        ar->n_used_blocks--;
 1628|  1.11M|        if (unlikely(ar->n_used_blocks == 0)) {
  ------------------
  |  |   33|  1.11M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1.61k, False: 1.11M]
  |  |  ------------------
  ------------------
 1629|  1.61k|            list_del(&ar->link);
 1630|  1.61k|            list_del(&ar->free_link);
 1631|  1.61k|            s->mf.js_free(&s->malloc_state, ar);
 1632|  1.61k|        }
 1633|  1.11M|    }
 1634|  1.11M|}
quickjs.c:__js_realloc:
 1637|  3.70k|{
 1638|  3.70k|    JSMallocBlockHeader *b;
 1639|  3.70k|    if (ptr == NULL) {
  ------------------
  |  Branch (1639:9): [True: 470, False: 3.23k]
  ------------------
 1640|    470|        return __js_malloc(s, size);
 1641|  3.23k|    } else if (size == 0) {
  ------------------
  |  Branch (1641:16): [True: 103, False: 3.13k]
  ------------------
 1642|    103|        __js_free(s, ptr);
 1643|    103|        return NULL;
 1644|    103|    }
 1645|  3.13k|    b = container_of(ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|  3.13k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1646|  3.13k|    if (b->u.block_idx == FREE_NIL) {
  ------------------
  |  |  259|  3.13k|#define FREE_NIL 0xffff
  ------------------
  |  Branch (1646:9): [True: 714, False: 2.42k]
  ------------------
 1647|    714|        if (b == get_zero_size_block(s)) {
  ------------------
  |  Branch (1647:13): [True: 0, False: 714]
  ------------------
 1648|      0|            return __js_malloc(s, size);
 1649|    714|        } else {
 1650|    714|            JSMallocLargeBlockHeader *lb, *new_lb;
 1651|    714|            lb = container_of(ptr, JSMallocLargeBlockHeader, header.user_data);
  ------------------
  |  |   51|    714|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1652|       |#ifdef JS_MALLOC_USE_ITER
 1653|       |            list_del(&lb->link);
 1654|       |#endif
 1655|    714|            new_lb = s->mf.js_realloc(&s->malloc_state, lb, sizeof(JSMallocLargeBlockHeader) + size);
 1656|    714|            if (!new_lb) {
  ------------------
  |  Branch (1656:17): [True: 0, False: 714]
  ------------------
 1657|       |#ifdef JS_MALLOC_USE_ITER
 1658|       |                /* add again in the list */
 1659|       |                list_add_tail(&lb->link, &s->large_block_list);
 1660|       |#endif
 1661|      0|                return NULL;
 1662|      0|            }
 1663|    714|            new_lb->header.u.block_idx = FREE_NIL;
  ------------------
  |  |  259|    714|#define FREE_NIL 0xffff
  ------------------
 1664|    714|            new_lb->header.block_size_idx = 0xff; /* fail safe */
 1665|       |#ifdef JS_MALLOC_USE_ITER
 1666|       |            list_add_tail(&new_lb->link, &s->large_block_list);
 1667|       |#endif
 1668|    714|            return new_lb->header.user_data;
 1669|    714|        }
 1670|  2.42k|    } else {
 1671|  2.42k|        unsigned int block_size_idx = b->block_size_idx;
 1672|  2.42k|        size_t block_size = js_malloc_block_sizes[block_size_idx];
 1673|  2.42k|        size_t total_size, old_size;
 1674|  2.42k|        void *new_ptr;
 1675|  2.42k|        JSMallocBlockHeader *new_b;
 1676|       |
 1677|  2.42k|        total_size = ((size + JS_MALLOC_ALIGN - 1) & ~(JS_MALLOC_ALIGN - 1)) +
  ------------------
  |  |  243|  2.42k|#define JS_MALLOC_ALIGN 8
  ------------------
                      total_size = ((size + JS_MALLOC_ALIGN - 1) & ~(JS_MALLOC_ALIGN - 1)) +
  ------------------
  |  |  243|  2.42k|#define JS_MALLOC_ALIGN 8
  ------------------
 1678|  2.42k|            sizeof(JSMallocBlockHeader);
 1679|  2.42k|        if (total_size <= block_size)
  ------------------
  |  Branch (1679:13): [True: 622, False: 1.80k]
  ------------------
 1680|    622|            return ptr;
 1681|  1.80k|        new_ptr = __js_malloc(s, size);
 1682|  1.80k|        if (!new_ptr)
  ------------------
  |  Branch (1682:13): [True: 0, False: 1.80k]
  ------------------
 1683|      0|            return NULL;
 1684|  1.80k|        new_b = container_of(new_ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|  1.80k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1685|       |        /* copy the GC data */
 1686|  1.80k|        new_b->gc_obj_type = b->gc_obj_type;
 1687|  1.80k|        new_b->mark = b->mark;
 1688|  1.80k|        new_b->ref_count = b->ref_count;
 1689|       |        /* copy the data */
 1690|  1.80k|        old_size = block_size - sizeof(JSMallocBlockHeader);
 1691|  1.80k|        if (size > old_size)
  ------------------
  |  Branch (1691:13): [True: 1.80k, False: 0]
  ------------------
 1692|  1.80k|            size = old_size;
 1693|  1.80k|        memcpy(new_ptr, ptr, size);
 1694|  1.80k|        __js_free(s, ptr);
 1695|  1.80k|        return new_ptr;
 1696|  1.80k|    }
 1697|  3.13k|}
quickjs.c:__js_malloc_usable_size:
 1700|  1.59k|{
 1701|  1.59k|    JSMallocBlockHeader *b;
 1702|  1.59k|    if (!ptr)
  ------------------
  |  Branch (1702:9): [True: 0, False: 1.59k]
  ------------------
 1703|      0|        return 0;
 1704|  1.59k|    b = container_of(ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|  1.59k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1705|  1.59k|    if (b->u.block_idx == FREE_NIL) {
  ------------------
  |  |  259|  1.59k|#define FREE_NIL 0xffff
  ------------------
  |  Branch (1705:9): [True: 596, False: 995]
  ------------------
 1706|    596|        if (b == get_zero_size_block(s)) {
  ------------------
  |  Branch (1706:13): [True: 0, False: 596]
  ------------------
 1707|      0|            return 0;
 1708|    596|        } else {
 1709|    596|            JSMallocLargeBlockHeader *lb;
 1710|    596|            size_t size;
 1711|    596|            lb = container_of(ptr, JSMallocLargeBlockHeader, header.user_data);
  ------------------
  |  |   51|    596|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1712|    596|            if (s->mf.js_malloc_usable_size) {
  ------------------
  |  Branch (1712:17): [True: 596, False: 0]
  ------------------
 1713|    596|                size = s->mf.js_malloc_usable_size(lb);
 1714|    596|                if (size != 0)
  ------------------
  |  Branch (1714:21): [True: 596, False: 0]
  ------------------
 1715|    596|                    size -= sizeof(JSMallocLargeBlockHeader);
 1716|    596|                return size;
 1717|    596|            } else {
 1718|      0|                return 0;
 1719|      0|            }
 1720|    596|        }
 1721|    995|    } else {
 1722|    995|        size_t block_size = js_malloc_block_sizes[b->block_size_idx];
 1723|    995|        return block_size - sizeof(*b);
 1724|    995|    }
 1725|  1.59k|}
quickjs.c:js_malloc_init:
 1474|     17|{
 1475|     17|    int i;
 1476|     17|    memset(s, 0, sizeof(*s));
 1477|     17|    get_zero_size_block(s)->u.block_idx = FREE_NIL;
  ------------------
  |  |  259|     17|#define FREE_NIL 0xffff
  ------------------
 1478|    544|    for(i = 0; i < JS_MALLOC_BLOCK_SIZE_COUNT; i++) {
  ------------------
  |  |  245|    544|#define JS_MALLOC_BLOCK_SIZE_COUNT 31
  ------------------
  |  Branch (1478:16): [True: 527, False: 17]
  ------------------
 1479|    527|        init_list_head(&s->arena_list[i]);
 1480|    527|        init_list_head(&s->free_arena_list[i]);
 1481|    527|    }
 1482|       |#ifdef JS_MALLOC_USE_ITER
 1483|       |    init_list_head(&s->large_block_list);
 1484|       |#endif
 1485|     17|}
quickjs.c:init_class_range:
 2026|     85|{
 2027|     85|    JSClassDef cm_s, *cm = &cm_s;
 2028|     85|    int i, class_id;
 2029|       |
 2030|  1.13k|    for(i = 0; i < count; i++) {
  ------------------
  |  Branch (2030:16): [True: 1.05k, False: 85]
  ------------------
 2031|  1.05k|        class_id = i + start;
 2032|  1.05k|        memset(cm, 0, sizeof(*cm));
 2033|  1.05k|        cm->finalizer = tab[i].finalizer;
 2034|  1.05k|        cm->gc_mark = tab[i].gc_mark;
 2035|  1.05k|        if (JS_NewClass1(rt, class_id, cm, tab[i].class_name) < 0)
  ------------------
  |  Branch (2035:13): [True: 0, False: 1.05k]
  ------------------
 2036|      0|            return -1;
 2037|  1.05k|    }
 2038|     85|    return 0;
 2039|     85|}
quickjs.c:js_array_finalizer:
 6187|     54|{
 6188|     54|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|     54|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     54|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6189|     54|    int i;
 6190|       |
 6191|   343k|    for(i = 0; i < p->u.array.count; i++) {
  ------------------
  |  Branch (6191:16): [True: 343k, False: 54]
  ------------------
 6192|   343k|        JS_FreeValueRT(rt, p->u.array.u.values[i]);
 6193|   343k|    }
 6194|     54|    js_free_rt(rt, p->u.array.u.values);
 6195|     54|}
quickjs.c:js_array_mark:
 6199|    146|{
 6200|    146|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|    146|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    146|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6201|    146|    int i;
 6202|       |
 6203|   686k|    for(i = 0; i < p->u.array.count; i++) {
  ------------------
  |  Branch (6203:16): [True: 686k, False: 146]
  ------------------
 6204|   686k|        JS_MarkValue(rt, p->u.array.u.values[i], mark_func);
 6205|   686k|    }
 6206|    146|}
quickjs.c:js_object_data_finalizer:
 6209|     53|{
 6210|     53|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|     53|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     53|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6211|     53|    JS_FreeValueRT(rt, p->u.object_data);
 6212|     53|    p->u.object_data = JS_UNDEFINED;
  ------------------
  |  |  291|     53|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     53|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 6213|     53|}
quickjs.c:js_object_data_mark:
 6217|    186|{
 6218|    186|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|    186|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    186|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6219|    186|    JS_MarkValue(rt, p->u.object_data, mark_func);
 6220|    186|}
quickjs.c:js_c_function_finalizer:
 6223|  2.71k|{
 6224|  2.71k|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|  2.71k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  2.71k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6225|       |
 6226|  2.71k|    if (p->u.cfunc.realm)
  ------------------
  |  Branch (6226:9): [True: 2.71k, False: 0]
  ------------------
 6227|  2.71k|        JS_FreeContext(p->u.cfunc.realm);
 6228|  2.71k|}
quickjs.c:js_c_function_mark:
 6232|  9.77k|{
 6233|  9.77k|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|  9.77k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  9.77k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6234|       |
 6235|  9.77k|    if (p->u.cfunc.realm)
  ------------------
  |  Branch (6235:9): [True: 9.77k, False: 0]
  ------------------
 6236|  9.77k|        mark_func(rt, &p->u.cfunc.realm->header);
 6237|  9.77k|}
quickjs.c:js_bytecode_function_finalizer:
 6240|     31|{
 6241|     31|    JSObject *p1, *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|     31|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     31|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6242|     31|    JSFunctionBytecode *b;
 6243|     31|    JSVarRef **var_refs;
 6244|     31|    int i;
 6245|       |
 6246|     31|    p1 = p->u.func.home_object;
 6247|     31|    if (p1) {
  ------------------
  |  Branch (6247:9): [True: 0, False: 31]
  ------------------
 6248|      0|        JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_OBJECT, p1));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6249|      0|    }
 6250|     31|    b = p->u.func.function_bytecode;
 6251|     31|    if (b) {
  ------------------
  |  Branch (6251:9): [True: 31, False: 0]
  ------------------
 6252|     31|        var_refs = p->u.func.var_refs;
 6253|     31|        if (var_refs) {
  ------------------
  |  Branch (6253:13): [True: 29, False: 2]
  ------------------
 6254|    102|            for(i = 0; i < b->closure_var_count; i++)
  ------------------
  |  Branch (6254:24): [True: 73, False: 29]
  ------------------
 6255|     73|                free_var_ref(rt, var_refs[i]);
 6256|     29|            js_free_rt(rt, var_refs);
 6257|     29|        }
 6258|     31|        JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_FUNCTION_BYTECODE, b));
  ------------------
  |  |  248|     31|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6259|     31|    }
 6260|     31|}
quickjs.c:js_bytecode_function_mark:
 6264|     70|{
 6265|     70|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|     70|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     70|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6266|     70|    JSVarRef **var_refs = p->u.func.var_refs;
 6267|     70|    JSFunctionBytecode *b = p->u.func.function_bytecode;
 6268|     70|    int i;
 6269|       |
 6270|     70|    if (p->u.func.home_object) {
  ------------------
  |  Branch (6270:9): [True: 0, False: 70]
  ------------------
 6271|      0|        JS_MarkValue(rt, JS_MKPTR(JS_TAG_OBJECT, p->u.func.home_object),
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6272|      0|                     mark_func);
 6273|      0|    }
 6274|     70|    if (b) {
  ------------------
  |  Branch (6274:9): [True: 70, False: 0]
  ------------------
 6275|     70|        if (var_refs) {
  ------------------
  |  Branch (6275:13): [True: 70, False: 0]
  ------------------
 6276|    268|            for(i = 0; i < b->closure_var_count; i++) {
  ------------------
  |  Branch (6276:24): [True: 198, False: 70]
  ------------------
 6277|    198|                JSVarRef *var_ref = var_refs[i];
 6278|    198|                if (var_ref) {
  ------------------
  |  Branch (6278:21): [True: 198, False: 0]
  ------------------
 6279|    198|                    mark_func(rt, &var_ref->header);
 6280|    198|                }
 6281|    198|            }
 6282|     70|        }
 6283|       |        /* must mark the function bytecode because template objects may be
 6284|       |           part of a cycle */
 6285|     70|        JS_MarkValue(rt, JS_MKPTR(JS_TAG_FUNCTION_BYTECODE, b), mark_func);
  ------------------
  |  |  248|     70|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6286|     70|    }
 6287|     70|}
quickjs.c:js_c_function_data_finalizer:
 6000|     49|{
 6001|     49|    JSCFunctionDataRecord *s = JS_GetOpaque(val, JS_CLASS_C_FUNCTION_DATA);
 6002|     49|    int i;
 6003|       |
 6004|     49|    if (s) {
  ------------------
  |  Branch (6004:9): [True: 49, False: 0]
  ------------------
 6005|    130|        for(i = 0; i < s->data_len; i++) {
  ------------------
  |  Branch (6005:20): [True: 81, False: 49]
  ------------------
 6006|     81|            JS_FreeValueRT(rt, s->data[i]);
 6007|     81|        }
 6008|     49|        js_free_rt(rt, s);
 6009|     49|    }
 6010|     49|}
quickjs.c:js_c_function_data_mark:
 6014|     62|{
 6015|     62|    JSCFunctionDataRecord *s = JS_GetOpaque(val, JS_CLASS_C_FUNCTION_DATA);
 6016|     62|    int i;
 6017|       |
 6018|     62|    if (s) {
  ------------------
  |  Branch (6018:9): [True: 62, False: 0]
  ------------------
 6019|    124|        for(i = 0; i < s->data_len; i++) {
  ------------------
  |  Branch (6019:20): [True: 62, False: 62]
  ------------------
 6020|     62|            JS_MarkValue(rt, s->data[i], mark_func);
 6021|     62|        }
 6022|     62|    }
 6023|     62|}
quickjs.c:js_for_in_iterator_finalizer:
 6317|      2|{
 6318|      2|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6319|      2|    JSForInIterator *it = p->u.for_in_iterator;
 6320|      2|    int i;
 6321|       |
 6322|      2|    JS_FreeValueRT(rt, it->obj);
 6323|      2|    if (!it->is_array) {
  ------------------
  |  Branch (6323:9): [True: 2, False: 0]
  ------------------
 6324|      2|        for(i = 0; i < it->atom_count; i++) {
  ------------------
  |  Branch (6324:20): [True: 0, False: 2]
  ------------------
 6325|      0|            JS_FreeAtomRT(rt, it->tab_atom[i].atom);
 6326|      0|        }
 6327|      2|        js_free_rt(rt, it->tab_atom);
 6328|      2|    }
 6329|      2|    js_free_rt(rt, it);
 6330|      2|}
quickjs.c:js_regexp_finalizer:
47328|      4|{
47329|      4|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|      4|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      4|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47330|      4|    JSRegExp *re = &p->u.regexp;
47331|      4|    if (re->bytecode != NULL)
  ------------------
  |  Branch (47331:9): [True: 4, False: 0]
  ------------------
47332|      4|        JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_STRING, re->bytecode));
  ------------------
  |  |  248|      4|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
47333|      4|    if (re->pattern != NULL)
  ------------------
  |  Branch (47333:9): [True: 4, False: 0]
  ------------------
47334|      4|        JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_STRING, re->pattern));
  ------------------
  |  |  248|      4|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
47335|      4|}
quickjs.c:js_array_iterator_finalizer:
43345|      1|{
43346|      1|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|      1|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
43347|      1|    JSArrayIteratorData *it = p->u.array_iterator_data;
43348|      1|    if (it) {
  ------------------
  |  Branch (43348:9): [True: 1, False: 0]
  ------------------
43349|      1|        JS_FreeValueRT(rt, it->obj);
43350|      1|        js_free_rt(rt, it);
43351|      1|    }
43352|      1|}
quickjs.c:js_array_iterator_mark:
43356|      2|{
43357|      2|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
43358|      2|    JSArrayIteratorData *it = p->u.array_iterator_data;
43359|      2|    if (it) {
  ------------------
  |  Branch (43359:9): [True: 2, False: 0]
  ------------------
43360|      2|        JS_MarkValue(rt, it->obj, mark_func);
43361|      2|    }
43362|      2|}
quickjs.c:async_func_free:
20891|     16|{
20892|     16|    if (--js_rc(s)->ref_count == 0) {
  ------------------
  |  Branch (20892:9): [True: 16, False: 0]
  ------------------
20893|     16|        if (rt->gc_phase != JS_GC_PHASE_REMOVE_CYCLES) {
  ------------------
  |  Branch (20893:13): [True: 16, False: 0]
  ------------------
20894|     16|            list_del(&s->header.link);
20895|     16|            list_add(&s->header.link, &rt->gc_zero_ref_count_list);
20896|     16|            if (rt->gc_phase == JS_GC_PHASE_NONE) {
  ------------------
  |  Branch (20896:17): [True: 16, False: 0]
  ------------------
20897|     16|                free_zero_refcount(rt);
20898|     16|            }
20899|     16|        }
20900|     16|    }
20901|     16|}
quickjs.c:js_global_object_finalizer:
17083|     17|{
17084|     17|    JSObject *p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|     17|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     17|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17085|     17|    JS_FreeValueRT(rt, p->u.global_object.uninitialized_vars);
17086|     17|}
quickjs.c:js_global_object_mark:
17090|     62|{
17091|     62|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|     62|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     62|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17092|     62|    JS_MarkValue(rt, p->u.global_object.uninitialized_vars, mark_func);
17093|     62|}
quickjs.c:js_def_malloc:
 2154|  2.14k|{
 2155|  2.14k|    void *ptr;
 2156|       |
 2157|       |    /* Do not allocate zero bytes: behavior is platform dependent */
 2158|  2.14k|    assert(size != 0);
  ------------------
  |  Branch (2158:5): [True: 0, False: 2.14k]
  |  Branch (2158:5): [True: 2.14k, False: 0]
  ------------------
 2159|       |
 2160|  2.14k|    if (unlikely(s->malloc_size + size > s->malloc_limit))
  ------------------
  |  |   33|  2.14k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2.14k]
  |  |  ------------------
  ------------------
 2161|      0|        return NULL;
 2162|       |
 2163|  2.14k|    ptr = malloc(size);
 2164|  2.14k|    if (!ptr)
  ------------------
  |  Branch (2164:9): [True: 0, False: 2.14k]
  ------------------
 2165|      0|        return NULL;
 2166|       |
 2167|  2.14k|    s->malloc_count++;
 2168|  2.14k|    s->malloc_size += js_def_malloc_usable_size(ptr) + MALLOC_OVERHEAD;
  ------------------
  |  |   61|  2.14k|#define MALLOC_OVERHEAD  8
  ------------------
 2169|  2.14k|    return ptr;
 2170|  2.14k|}
quickjs.c:js_def_free:
 2173|  2.14k|{
 2174|  2.14k|    if (!ptr)
  ------------------
  |  Branch (2174:9): [True: 0, False: 2.14k]
  ------------------
 2175|      0|        return;
 2176|       |
 2177|  2.14k|    s->malloc_count--;
 2178|  2.14k|    s->malloc_size -= js_def_malloc_usable_size(ptr) + MALLOC_OVERHEAD;
  ------------------
  |  |   61|  2.14k|#define MALLOC_OVERHEAD  8
  ------------------
 2179|  2.14k|    free(ptr);
 2180|  2.14k|}
quickjs.c:js_def_realloc:
 2183|    714|{
 2184|    714|    size_t old_size;
 2185|       |
 2186|    714|    if (!ptr) {
  ------------------
  |  Branch (2186:9): [True: 0, False: 714]
  ------------------
 2187|      0|        if (size == 0)
  ------------------
  |  Branch (2187:13): [True: 0, False: 0]
  ------------------
 2188|      0|            return NULL;
 2189|      0|        return js_def_malloc(s, size);
 2190|      0|    }
 2191|    714|    old_size = js_def_malloc_usable_size(ptr);
 2192|    714|    if (size == 0) {
  ------------------
  |  Branch (2192:9): [True: 0, False: 714]
  ------------------
 2193|      0|        s->malloc_count--;
 2194|      0|        s->malloc_size -= old_size + MALLOC_OVERHEAD;
  ------------------
  |  |   61|      0|#define MALLOC_OVERHEAD  8
  ------------------
 2195|      0|        free(ptr);
 2196|      0|        return NULL;
 2197|      0|    }
 2198|    714|    if (s->malloc_size + size - old_size > s->malloc_limit)
  ------------------
  |  Branch (2198:9): [True: 0, False: 714]
  ------------------
 2199|      0|        return NULL;
 2200|       |
 2201|    714|    ptr = realloc(ptr, size);
 2202|    714|    if (!ptr)
  ------------------
  |  Branch (2202:9): [True: 0, False: 714]
  ------------------
 2203|      0|        return NULL;
 2204|       |
 2205|    714|    s->malloc_size += js_def_malloc_usable_size(ptr) - old_size;
 2206|    714|    return ptr;
 2207|    714|}
quickjs.c:js_def_malloc_usable_size:
 2138|  6.31k|{
 2139|       |#if defined(__APPLE__)
 2140|       |    return malloc_size(ptr);
 2141|       |#elif defined(_WIN32)
 2142|       |    return _msize((void *)ptr);
 2143|       |#elif defined(__EMSCRIPTEN__)
 2144|       |    return 0;
 2145|       |#elif defined(__linux__) || defined(__GLIBC__)
 2146|       |    return malloc_usable_size((void *)ptr);
 2147|       |#else
 2148|       |    /* change this to `return 0;` if compilation fails */
 2149|       |    return malloc_usable_size((void *)ptr);
 2150|       |#endif
 2151|  6.31k|}
quickjs.c:js_rc:
 1493|   576k|{
 1494|       |    return container_of(ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|   576k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1495|   576k|}
quickjs.c:atom_is_free:
 2345|  12.5k|{
 2346|  12.5k|    return (uintptr_t)p & 1;
 2347|  12.5k|}
quickjs.c:set_value:
 2665|  2.02M|{
 2666|  2.02M|    JSValue old_val;
 2667|  2.02M|    old_val = *pval;
 2668|  2.02M|    *pval = new_val;
 2669|  2.02M|    JS_FreeValue(ctx, old_val);
 2670|  2.02M|}
quickjs.c:js_free_modules:
 2693|     17|{
 2694|     17|    struct list_head *el, *el1;
 2695|     17|    list_for_each_safe(el, el1, &ctx->loaded_modules) {
  ------------------
  |  |   89|     17|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 17]
  |  |  ------------------
  |  |   90|     17|        el = el1, el1 = el->next)
  ------------------
 2696|      0|        JSModuleDef *m = list_entry(el, JSModuleDef, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 2697|      0|        if (flag == JS_FREE_MODULE_ALL ||
  ------------------
  |  Branch (2697:13): [True: 0, False: 0]
  ------------------
 2698|      0|            (flag == JS_FREE_MODULE_NOT_RESOLVED && !m->resolved)) {
  ------------------
  |  Branch (2698:14): [True: 0, False: 0]
  |  Branch (2698:53): [True: 0, False: 0]
  ------------------
 2699|       |            /* warning: the module may be referenced elsewhere. It
 2700|       |               could be simpler to use an array instead of a list for
 2701|       |               'ctx->loaded_modules' */
 2702|      0|            list_del(&m->link);
 2703|      0|            m->link.prev = NULL;
 2704|      0|            m->link.next = NULL;
 2705|      0|            JS_FreeValue(ctx, JS_MKPTR(JS_TAG_MODULE, m));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 2706|      0|        }
 2707|      0|    }
 2708|     17|}
quickjs.c:update_stack_limit:
 2842|     34|{
 2843|     34|    if (rt->stack_size == 0) {
  ------------------
  |  Branch (2843:9): [True: 0, False: 34]
  ------------------
 2844|      0|        rt->stack_limit = 0; /* no limit */
 2845|     34|    } else {
 2846|     34|        rt->stack_limit = rt->stack_top - rt->stack_size;
 2847|     34|    }
 2848|     34|}
quickjs.c:js_get_stack_pointer:
 2055|  1.01M|{
 2056|  1.01M|    return (uintptr_t)__builtin_frame_address(0);
 2057|  1.01M|}
quickjs.c:JS_InitAtoms:
 3079|     17|{
 3080|     17|    int i, len, atom_type;
 3081|     17|    const char *p;
 3082|       |
 3083|     17|    rt->atom_hash_size = 0;
 3084|     17|    rt->atom_hash = NULL;
 3085|     17|    rt->atom_count = 0;
 3086|     17|    rt->atom_size = 0;
 3087|     17|    rt->atom_free_index = 0;
 3088|     17|    if (JS_ResizeAtomHash(rt, 512))     /* there are at least 504 predefined atoms */
  ------------------
  |  Branch (3088:9): [True: 0, False: 17]
  ------------------
 3089|      0|        return -1;
 3090|       |
 3091|     17|    p = js_atom_init;
 3092|  4.13k|    for(i = 1; i < JS_ATOM_END; i++) {
  ------------------
  |  Branch (3092:16): [True: 4.11k, False: 17]
  ------------------
 3093|  4.11k|        if (i == JS_ATOM_Private_brand)
  ------------------
  |  Branch (3093:13): [True: 17, False: 4.09k]
  ------------------
 3094|     17|            atom_type = JS_ATOM_TYPE_PRIVATE;
 3095|  4.09k|        else if (i >= JS_ATOM_Symbol_toPrimitive)
  ------------------
  |  Branch (3095:18): [True: 221, False: 3.87k]
  ------------------
 3096|    221|            atom_type = JS_ATOM_TYPE_SYMBOL;
 3097|  3.87k|        else
 3098|  3.87k|            atom_type = JS_ATOM_TYPE_STRING;
 3099|  4.11k|        len = strlen(p);
 3100|  4.11k|        if (__JS_NewAtomInit(rt, p, len, atom_type) == JS_ATOM_NULL)
  ------------------
  |  |  451|  4.11k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (3100:13): [True: 0, False: 4.11k]
  ------------------
 3101|      0|            return -1;
 3102|  4.11k|        p = p + len + 1;
 3103|  4.11k|    }
 3104|     17|    return 0;
 3105|     17|}
quickjs.c:JS_ResizeAtomHash:
 3049|     17|{
 3050|     17|    JSAtomStruct *p;
 3051|     17|    uint32_t new_hash_mask, h, i, hash_next1, j, *new_hash;
 3052|       |
 3053|     17|    assert((new_hash_size & (new_hash_size - 1)) == 0); /* power of two */
  ------------------
  |  Branch (3053:5): [True: 0, False: 17]
  |  Branch (3053:5): [True: 17, False: 0]
  ------------------
 3054|     17|    new_hash_mask = new_hash_size - 1;
 3055|     17|    new_hash = js_mallocz_rt(rt, sizeof(rt->atom_hash[0]) * new_hash_size);
 3056|     17|    if (!new_hash)
  ------------------
  |  Branch (3056:9): [True: 0, False: 17]
  ------------------
 3057|      0|        return -1;
 3058|     17|    for(i = 0; i < rt->atom_hash_size; i++) {
  ------------------
  |  Branch (3058:16): [True: 0, False: 17]
  ------------------
 3059|      0|        h = rt->atom_hash[i];
 3060|      0|        while (h != 0) {
  ------------------
  |  Branch (3060:16): [True: 0, False: 0]
  ------------------
 3061|      0|            p = rt->atom_array[h];
 3062|      0|            hash_next1 = p->hash_next;
 3063|       |            /* add in new hash table */
 3064|      0|            j = p->hash & new_hash_mask;
 3065|      0|            p->hash_next = new_hash[j];
 3066|      0|            new_hash[j] = h;
 3067|      0|            h = hash_next1;
 3068|      0|        }
 3069|      0|    }
 3070|     17|    js_free_rt(rt, rt->atom_hash);
 3071|     17|    rt->atom_hash = new_hash;
 3072|     17|    rt->atom_hash_size = new_hash_size;
 3073|     17|    rt->atom_count_resize = JS_ATOM_COUNT_RESIZE(new_hash_size);
  ------------------
  |  | 2875|     17|#define JS_ATOM_COUNT_RESIZE(n) ((n) * 2)
  ------------------
 3074|       |    //    JS_DumpAtoms(rt);
 3075|     17|    return 0;
 3076|     17|}
quickjs.c:__JS_AtomIsConst:
 2878|  1.42M|{
 2879|       |#if defined(DUMP_LEAKS) && DUMP_LEAKS > 1
 2880|       |        return (int32_t)v <= 0;
 2881|       |#else
 2882|  1.42M|        return (int32_t)v < JS_ATOM_END;
 2883|  1.42M|#endif
 2884|  1.42M|}
quickjs.c:is_digit:
 1957|  16.0k|static inline int is_digit(int c) {
 1958|  16.0k|    return c >= '0' && c <= '9';
  ------------------
  |  Branch (1958:12): [True: 16.0k, False: 4]
  |  Branch (1958:24): [True: 1, False: 16.0k]
  ------------------
 1959|  16.0k|}
quickjs.c:count_ascii:
 3450|  22.9k|{
 3451|  22.9k|    const uint8_t *p, *p_end;
 3452|  22.9k|    p = buf;
 3453|  22.9k|    p_end = buf + len;
 3454|   217k|    while (p < p_end && *p < 128)
  ------------------
  |  Branch (3454:12): [True: 194k, False: 22.9k]
  |  Branch (3454:25): [True: 194k, False: 37]
  ------------------
 3455|   194k|        p++;
 3456|  22.9k|    return p - buf;
 3457|  22.9k|}
quickjs.c:__JS_FindAtom:
 3350|  16.0k|{
 3351|  16.0k|    uint32_t h, h1, i;
 3352|  16.0k|    JSAtomStruct *p;
 3353|       |
 3354|  16.0k|    h = hash_string8((const uint8_t *)str, len, JS_ATOM_TYPE_STRING);
 3355|  16.0k|    h &= JS_ATOM_HASH_MASK;
  ------------------
  |  |  580|  16.0k|#define JS_ATOM_HASH_MASK  ((1 << 30) - 1)
  ------------------
 3356|  16.0k|    h1 = h & (rt->atom_hash_size - 1);
 3357|  16.0k|    i = rt->atom_hash[h1];
 3358|  25.6k|    while (i != 0) {
  ------------------
  |  Branch (3358:12): [True: 18.8k, False: 6.79k]
  ------------------
 3359|  18.8k|        p = rt->atom_array[i];
 3360|  18.8k|        if (p->hash == h &&
  ------------------
  |  Branch (3360:13): [True: 9.29k, False: 9.55k]
  ------------------
 3361|  9.29k|            p->atom_type == JS_ATOM_TYPE_STRING &&
  ------------------
  |  Branch (3361:13): [True: 9.29k, False: 0]
  ------------------
 3362|  9.29k|            p->len == len &&
  ------------------
  |  Branch (3362:13): [True: 9.29k, False: 0]
  ------------------
 3363|  9.29k|            p->is_wide_char == 0 &&
  ------------------
  |  Branch (3363:13): [True: 9.29k, False: 0]
  ------------------
 3364|  9.29k|            memcmp(p->u.str8, str, len) == 0) {
  ------------------
  |  Branch (3364:13): [True: 9.29k, False: 0]
  ------------------
 3365|  9.29k|            if (!__JS_AtomIsConst(i))
  ------------------
  |  Branch (3365:17): [True: 4.75k, False: 4.54k]
  ------------------
 3366|  4.75k|                js_rc(p)->ref_count++;
 3367|  9.29k|            return i;
 3368|  9.29k|        }
 3369|  9.55k|        i = p->hash_next;
 3370|  9.55k|    }
 3371|  6.79k|    return JS_ATOM_NULL;
  ------------------
  |  |  451|  6.79k|#define JS_ATOM_NULL 0
  ------------------
 3372|  16.0k|}
quickjs.c:hash_string8:
 2943|  26.8k|{
 2944|  26.8k|    size_t i;
 2945|       |
 2946|   248k|    for(i = 0; i < len; i++)
  ------------------
  |  Branch (2946:16): [True: 221k, False: 26.8k]
  ------------------
 2947|   221k|        h = h * 263 + str[i];
 2948|  26.8k|    return h;
 2949|  26.8k|}
quickjs.c:JS_NewAtomStr:
 3435|  6.85k|{
 3436|  6.85k|    JSRuntime *rt = ctx->rt;
 3437|  6.85k|    uint32_t n;
 3438|  6.85k|    if (is_num_string(&n, p)) {
  ------------------
  |  Branch (3438:9): [True: 0, False: 6.85k]
  ------------------
 3439|      0|        if (n <= JS_ATOM_MAX_INT) {
  ------------------
  |  | 2871|      0|#define JS_ATOM_MAX_INT (JS_ATOM_TAG_INT - 1)
  |  |  ------------------
  |  |  |  | 2870|      0|#define JS_ATOM_TAG_INT (1U << 31)
  |  |  ------------------
  ------------------
  |  Branch (3439:13): [True: 0, False: 0]
  ------------------
 3440|      0|            js_free_string(rt, p);
 3441|      0|            return __JS_AtomFromUInt32(n);
 3442|      0|        }
 3443|      0|    }
 3444|       |    /* XXX: should generate an exception */
 3445|  6.85k|    return __JS_NewAtom(rt, p, JS_ATOM_TYPE_STRING);
 3446|  6.85k|}
quickjs.c:is_num_string:
 2908|  6.95k|{
 2909|  6.95k|    uint32_t n;
 2910|  6.95k|    uint64_t n64;
 2911|  6.95k|    int c, i, len;
 2912|       |
 2913|  6.95k|    len = p->len;
 2914|  6.95k|    if (len == 0 || len > 10)
  ------------------
  |  Branch (2914:9): [True: 2, False: 6.94k]
  |  Branch (2914:21): [True: 1.83k, False: 5.11k]
  ------------------
 2915|  1.83k|        return FALSE;
 2916|  5.11k|    c = string_get(p, 0);
 2917|  5.11k|    if (is_num(c)) {
  ------------------
  |  Branch (2917:9): [True: 0, False: 5.11k]
  ------------------
 2918|      0|        if (c == '0') {
  ------------------
  |  Branch (2918:13): [True: 0, False: 0]
  ------------------
 2919|      0|            if (len != 1)
  ------------------
  |  Branch (2919:17): [True: 0, False: 0]
  ------------------
 2920|      0|                return FALSE;
 2921|      0|            n = 0;
 2922|      0|        } else {
 2923|      0|            n = c - '0';
 2924|      0|            for(i = 1; i < len; i++) {
  ------------------
  |  Branch (2924:24): [True: 0, False: 0]
  ------------------
 2925|      0|                c = string_get(p, i);
 2926|      0|                if (!is_num(c))
  ------------------
  |  Branch (2926:21): [True: 0, False: 0]
  ------------------
 2927|      0|                    return FALSE;
 2928|      0|                n64 = (uint64_t)n * 10 + (c - '0');
 2929|      0|                if ((n64 >> 32) != 0)
  ------------------
  |  Branch (2929:21): [True: 0, False: 0]
  ------------------
 2930|      0|                    return FALSE;
 2931|      0|                n = n64;
 2932|      0|            }
 2933|      0|        }
 2934|      0|        *pval = n;
 2935|      0|        return TRUE;
 2936|  5.11k|    } else {
 2937|  5.11k|        return FALSE;
 2938|  5.11k|    }
 2939|  5.11k|}
quickjs.c:is_num:
 2902|  5.11k|{
 2903|  5.11k|    return c >= '0' && c <= '9';
  ------------------
  |  Branch (2903:12): [True: 5.10k, False: 12]
  |  Branch (2903:24): [True: 0, False: 5.10k]
  ------------------
 2904|  5.11k|}
quickjs.c:js_free_string:
 2386|     61|{
 2387|     61|    if (--js_rc(str)->ref_count <= 0) {
  ------------------
  |  Branch (2387:9): [True: 11, False: 50]
  ------------------
 2388|     11|        if (str->atom_type) {
  ------------------
  |  Branch (2388:13): [True: 0, False: 11]
  ------------------
 2389|      0|            JS_FreeAtomStruct(rt, str);
 2390|     11|        } else {
 2391|       |#ifdef DUMP_LEAKS
 2392|       |            list_del(&str->link);
 2393|       |#endif
 2394|     11|            js_free_rt(rt, str);
 2395|     11|        }
 2396|     11|    }
 2397|     61|}
quickjs.c:__JS_AtomFromUInt32:
 2892|   343k|{
 2893|   343k|    return v | JS_ATOM_TAG_INT;
  ------------------
  |  | 2870|   343k|#define JS_ATOM_TAG_INT (1U << 31)
  ------------------
 2894|   343k|}
quickjs.c:__JS_NewAtom:
 3180|  10.9k|{
 3181|  10.9k|    uint32_t h, h1, i;
 3182|  10.9k|    JSAtomStruct *p;
 3183|  10.9k|    int len;
 3184|       |
 3185|       |#if 0
 3186|       |    printf("__JS_NewAtom: ");  JS_DumpString(rt, str); printf("\n");
 3187|       |#endif
 3188|  10.9k|    if (atom_type < JS_ATOM_TYPE_SYMBOL) {
  ------------------
  |  Branch (3188:9): [True: 10.7k, False: 238]
  ------------------
 3189|       |        /* str is not NULL */
 3190|  10.7k|        if (str->atom_type == atom_type) {
  ------------------
  |  Branch (3190:13): [True: 2, False: 10.7k]
  ------------------
 3191|       |            /* str is the atom, return its index */
 3192|      2|            i = js_get_atom_index(rt, str);
 3193|       |            /* reduce string refcount and increase atom's unless constant */
 3194|      2|            if (__JS_AtomIsConst(i))
  ------------------
  |  Branch (3194:17): [True: 2, False: 0]
  ------------------
 3195|      2|                js_rc(str)->ref_count--;
 3196|      2|            return i;
 3197|      2|        }
 3198|       |        /* try and locate an already registered atom */
 3199|  10.7k|        len = str->len;
 3200|  10.7k|        h = hash_string(str, atom_type);
 3201|  10.7k|        h &= JS_ATOM_HASH_MASK;
  ------------------
  |  |  580|  10.7k|#define JS_ATOM_HASH_MASK  ((1 << 30) - 1)
  ------------------
 3202|  10.7k|        h1 = h & (rt->atom_hash_size - 1);
 3203|  10.7k|        i = rt->atom_hash[h1];
 3204|  17.8k|        while (i != 0) {
  ------------------
  |  Branch (3204:16): [True: 7.16k, False: 10.6k]
  ------------------
 3205|  7.16k|            p = rt->atom_array[i];
 3206|  7.16k|            if (p->hash == h &&
  ------------------
  |  Branch (3206:17): [True: 61, False: 7.10k]
  ------------------
 3207|     61|                p->atom_type == atom_type &&
  ------------------
  |  Branch (3207:17): [True: 61, False: 0]
  ------------------
 3208|     61|                p->len == len &&
  ------------------
  |  Branch (3208:17): [True: 61, False: 0]
  ------------------
 3209|     61|                js_string_memcmp(p, 0, str, 0, len) == 0) {
  ------------------
  |  Branch (3209:17): [True: 61, False: 0]
  ------------------
 3210|     61|                if (!__JS_AtomIsConst(i))
  ------------------
  |  Branch (3210:21): [True: 61, False: 0]
  ------------------
 3211|     61|                    js_rc(p)->ref_count++;
 3212|     61|                goto done;
 3213|     61|            }
 3214|  7.10k|            i = p->hash_next;
 3215|  7.10k|        }
 3216|  10.7k|    } else {
 3217|    238|        h1 = 0; /* avoid warning */
 3218|    238|        if (atom_type == JS_ATOM_TYPE_SYMBOL) {
  ------------------
  |  Branch (3218:13): [True: 221, False: 17]
  ------------------
 3219|    221|            h = 0;
 3220|    221|        } else {
 3221|     17|            h = JS_ATOM_HASH_PRIVATE;
  ------------------
  |  |  581|     17|#define JS_ATOM_HASH_PRIVATE JS_ATOM_HASH_MASK
  |  |  ------------------
  |  |  |  |  580|     17|#define JS_ATOM_HASH_MASK  ((1 << 30) - 1)
  |  |  ------------------
  ------------------
 3222|     17|            atom_type = JS_ATOM_TYPE_SYMBOL;
 3223|     17|        }
 3224|    238|    }
 3225|       |
 3226|  10.9k|    if (rt->atom_free_index == 0) {
  ------------------
  |  Branch (3226:9): [True: 17, False: 10.9k]
  ------------------
 3227|       |        /* allow new atom entries */
 3228|     17|        uint32_t new_size, start;
 3229|     17|        JSAtomStruct **new_array;
 3230|       |
 3231|       |        /* alloc new with size progression 3/2:
 3232|       |           4 6 9 13 19 28 42 63 94 141 211 316 474 711 1066 1599 2398 3597 5395 8092
 3233|       |           preallocating space for predefined atoms (at least 504).
 3234|       |         */
 3235|     17|        new_size = max_int(711, rt->atom_size * 3 / 2);
 3236|     17|        if (new_size > JS_ATOM_MAX)
  ------------------
  |  | 2872|     17|#define JS_ATOM_MAX     ((1U << 30) - 1)
  ------------------
  |  Branch (3236:13): [True: 0, False: 17]
  ------------------
 3237|      0|            goto fail;
 3238|       |        /* XXX: should use realloc2 to use slack space */
 3239|     17|        new_array = js_realloc_rt(rt, rt->atom_array, sizeof(*new_array) * new_size);
 3240|     17|        if (!new_array)
  ------------------
  |  Branch (3240:13): [True: 0, False: 17]
  ------------------
 3241|      0|            goto fail;
 3242|       |        /* Note: the atom 0 is not used */
 3243|     17|        start = rt->atom_size;
 3244|     17|        if (start == 0) {
  ------------------
  |  Branch (3244:13): [True: 17, False: 0]
  ------------------
 3245|       |            /* JS_ATOM_NULL entry */
 3246|     17|            p = js_mallocz_rt(rt, sizeof(JSAtomStruct));
 3247|     17|            if (!p) {
  ------------------
  |  Branch (3247:17): [True: 0, False: 17]
  ------------------
 3248|      0|                js_free_rt(rt, new_array);
 3249|      0|                goto fail;
 3250|      0|            }
 3251|     17|            js_rc(p)->ref_count = 1;  /* not refcounted */
 3252|     17|            p->atom_type = JS_ATOM_TYPE_SYMBOL;
 3253|       |#ifdef DUMP_LEAKS
 3254|       |            list_add_tail(&p->link, &rt->string_list);
 3255|       |#endif
 3256|     17|            new_array[0] = p;
 3257|     17|            rt->atom_count++;
 3258|     17|            start = 1;
 3259|     17|        }
 3260|     17|        rt->atom_size = new_size;
 3261|     17|        rt->atom_array = new_array;
 3262|     17|        rt->atom_free_index = start;
 3263|  12.0k|        for(i = start; i < new_size; i++) {
  ------------------
  |  Branch (3263:24): [True: 12.0k, False: 17]
  ------------------
 3264|  12.0k|            uint32_t next;
 3265|  12.0k|            if (i == (new_size - 1))
  ------------------
  |  Branch (3265:17): [True: 17, False: 12.0k]
  ------------------
 3266|     17|                next = 0;
 3267|  12.0k|            else
 3268|  12.0k|                next = i + 1;
 3269|  12.0k|            rt->atom_array[i] = atom_set_free(next);
 3270|  12.0k|        }
 3271|     17|    }
 3272|       |
 3273|  10.9k|    if (str) {
  ------------------
  |  Branch (3273:9): [True: 10.9k, False: 0]
  ------------------
 3274|  10.9k|        if (str->atom_type == 0) {
  ------------------
  |  Branch (3274:13): [True: 10.9k, False: 0]
  ------------------
 3275|  10.9k|            p = str;
 3276|  10.9k|            p->atom_type = atom_type;
 3277|  10.9k|        } else {
 3278|      0|            p = js_malloc_rt(rt, sizeof(JSString) +
 3279|      0|                             (str->len << str->is_wide_char) +
 3280|      0|                             1 - str->is_wide_char);
 3281|      0|            if (unlikely(!p))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3282|      0|                goto fail;
 3283|      0|            js_rc(p)->ref_count = 1;
 3284|      0|            p->is_wide_char = str->is_wide_char;
 3285|      0|            p->len = str->len;
 3286|       |#ifdef DUMP_LEAKS
 3287|       |            list_add_tail(&p->link, &rt->string_list);
 3288|       |#endif
 3289|      0|            memcpy(p->u.str8, str->u.str8, (str->len << str->is_wide_char) +
 3290|      0|                   1 - str->is_wide_char);
 3291|      0|            js_free_string(rt, str);
 3292|      0|        }
 3293|  10.9k|    } else {
 3294|      0|        p = js_malloc_rt(rt, sizeof(JSAtomStruct)); /* empty wide string */
 3295|      0|        if (!p)
  ------------------
  |  Branch (3295:13): [True: 0, False: 0]
  ------------------
 3296|      0|            return JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
 3297|      0|        js_rc(p)->ref_count = 1;
 3298|      0|        p->is_wide_char = 1;    /* Hack to represent NULL as a JSString */
 3299|      0|        p->len = 0;
 3300|       |#ifdef DUMP_LEAKS
 3301|       |        list_add_tail(&p->link, &rt->string_list);
 3302|       |#endif
 3303|      0|    }
 3304|       |
 3305|       |    /* use an already free entry */
 3306|  10.9k|    i = rt->atom_free_index;
 3307|  10.9k|    rt->atom_free_index = atom_get_free(rt->atom_array[i]);
 3308|  10.9k|    rt->atom_array[i] = p;
 3309|       |
 3310|  10.9k|    p->hash = h;
 3311|  10.9k|    p->hash_next = i;   /* atom_index */
 3312|  10.9k|    p->atom_type = atom_type;
 3313|       |
 3314|  10.9k|    rt->atom_count++;
 3315|       |
 3316|  10.9k|    if (atom_type != JS_ATOM_TYPE_SYMBOL) {
  ------------------
  |  Branch (3316:9): [True: 10.6k, False: 238]
  ------------------
 3317|  10.6k|        p->hash_next = rt->atom_hash[h1];
 3318|  10.6k|        rt->atom_hash[h1] = i;
 3319|  10.6k|        if (unlikely(rt->atom_count >= rt->atom_count_resize))
  ------------------
  |  |   33|  10.6k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 3320|      0|            JS_ResizeAtomHash(rt, rt->atom_hash_size * 2);
 3321|  10.6k|    }
 3322|       |
 3323|       |    //    JS_DumpAtoms(rt);
 3324|  10.9k|    return i;
 3325|       |
 3326|      0| fail:
 3327|      0|    i = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
 3328|     61| done:
 3329|     61|    if (str)
  ------------------
  |  Branch (3329:9): [True: 61, False: 0]
  ------------------
 3330|     61|        js_free_string(rt, str);
 3331|     61|    return i;
 3332|      0|}
quickjs.c:hash_string:
 2962|  10.7k|{
 2963|  10.7k|    if (str->is_wide_char)
  ------------------
  |  Branch (2963:9): [True: 7, False: 10.7k]
  ------------------
 2964|      7|        h = hash_string16(str->u.str16, str->len, h);
 2965|  10.7k|    else
 2966|  10.7k|        h = hash_string8(str->u.str8, str->len, h);
 2967|  10.7k|    return h;
 2968|  10.7k|}
quickjs.c:hash_string16:
 2953|      7|{
 2954|      7|    size_t i;
 2955|       |
 2956|  4.90M|    for(i = 0; i < len; i++)
  ------------------
  |  Branch (2956:16): [True: 4.90M, False: 7]
  ------------------
 2957|  4.90M|        h = h * 263 + str[i];
 2958|      7|    return h;
 2959|      7|}
quickjs.c:js_string_memcmp:
 4588|  8.32k|{
 4589|  8.32k|    int res;
 4590|       |
 4591|  8.32k|    if (likely(!p1->is_wide_char)) {
  ------------------
  |  |   32|  8.32k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 8.32k, False: 0]
  |  |  ------------------
  ------------------
 4592|  8.32k|        if (likely(!p2->is_wide_char))
  ------------------
  |  |   32|  8.32k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 8.32k, False: 0]
  |  |  ------------------
  ------------------
 4593|  8.32k|            res = memcmp(p1->u.str8 + pos1, p2->u.str8 + pos2, len);
 4594|      0|        else
 4595|      0|            res = -memcmp16_8(p2->u.str16 + pos2, p1->u.str8 + pos1, len);
 4596|  8.32k|    } else {
 4597|      0|        if (!p2->is_wide_char)
  ------------------
  |  Branch (4597:13): [True: 0, False: 0]
  ------------------
 4598|      0|            res = memcmp16_8(p1->u.str16 + pos1, p2->u.str8 + pos2, len);
 4599|      0|        else
 4600|      0|            res = memcmp16(p1->u.str16 + pos1, p2->u.str16 + pos2, len);
 4601|      0|    }
 4602|  8.32k|    return res;
 4603|  8.32k|}
quickjs.c:atom_set_free:
 2350|  18.8k|{
 2351|  18.8k|    return (JSAtomStruct *)(((uintptr_t)v << 1) | 1);
 2352|  18.8k|}
quickjs.c:atom_get_free:
 2340|  10.9k|{
 2341|  10.9k|    return (uintptr_t)p >> 1;
 2342|  10.9k|}
quickjs.c:__JS_AtomToValue:
 3596|   290k|{
 3597|   290k|    char buf[ATOM_GET_STR_BUF_SIZE];
 3598|       |
 3599|   290k|    if (__JS_AtomIsTaggedInt(atom)) {
  ------------------
  |  Branch (3599:9): [True: 0, False: 290k]
  ------------------
 3600|      0|        size_t len = u32toa(buf, __JS_AtomToUInt32(atom));
 3601|      0|        return js_new_string8_len(ctx, buf, len);
 3602|   290k|    } else {
 3603|   290k|        JSRuntime *rt = ctx->rt;
 3604|   290k|        JSAtomStruct *p;
 3605|   290k|        assert(atom < rt->atom_size);
  ------------------
  |  Branch (3605:9): [True: 0, False: 290k]
  |  Branch (3605:9): [True: 290k, False: 0]
  ------------------
 3606|   290k|        p = rt->atom_array[atom];
 3607|   290k|        if (p->atom_type == JS_ATOM_TYPE_STRING) {
  ------------------
  |  Branch (3607:13): [True: 290k, False: 221]
  ------------------
 3608|   290k|            goto ret_string;
 3609|   290k|        } else if (force_string) {
  ------------------
  |  Branch (3609:20): [True: 0, False: 221]
  ------------------
 3610|      0|            if (p->len == 0 && p->is_wide_char != 0) {
  ------------------
  |  Branch (3610:17): [True: 0, False: 0]
  |  Branch (3610:32): [True: 0, False: 0]
  ------------------
 3611|       |                /* no description string */
 3612|      0|                p = rt->atom_array[JS_ATOM_empty_string];
 3613|      0|            }
 3614|   290k|        ret_string:
 3615|   290k|            return JS_DupValue(ctx, JS_MKPTR(JS_TAG_STRING, p));
  ------------------
  |  |  248|   290k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3616|    221|        } else {
 3617|    221|            return JS_DupValue(ctx, JS_MKPTR(JS_TAG_SYMBOL, p));
  ------------------
  |  |  248|    221|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3618|    221|        }
 3619|   290k|    }
 3620|   290k|}
quickjs.c:__JS_FreeAtom:
 3424|  21.4k|{
 3425|  21.4k|    JSAtomStruct *p;
 3426|       |
 3427|  21.4k|    p = rt->atom_array[i];
 3428|  21.4k|    if (--js_rc(p)->ref_count > 0)
  ------------------
  |  Branch (3428:9): [True: 15.1k, False: 6.24k]
  ------------------
 3429|  15.1k|        return;
 3430|  6.24k|    JS_FreeAtomStruct(rt, p);
 3431|  6.24k|}
quickjs.c:__JS_NewAtomInit:
 3337|  4.13k|{
 3338|  4.13k|    JSString *p;
 3339|  4.13k|    p = js_alloc_string_rt(rt, len, 0);
 3340|  4.13k|    if (!p)
  ------------------
  |  Branch (3340:9): [True: 0, False: 4.13k]
  ------------------
 3341|      0|        return JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
 3342|  4.13k|    memcpy(p->u.str8, str, len);
 3343|  4.13k|    p->u.str8[len] = '\0';
 3344|  4.13k|    return __JS_NewAtom(rt, p, atom_type);
 3345|  4.13k|}
quickjs.c:js_alloc_string_rt:
 2356|  83.8k|{
 2357|  83.8k|    JSString *str;
 2358|  83.8k|    str = js_malloc_rt(rt, sizeof(JSString) + (max_len << is_wide_char) + 1 - is_wide_char);
 2359|  83.8k|    if (unlikely(!str))
  ------------------
  |  |   33|  83.8k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 83.8k]
  |  |  ------------------
  ------------------
 2360|      0|        return NULL;
 2361|  83.8k|    js_rc(str)->ref_count = 1;
 2362|  83.8k|    str->is_wide_char = is_wide_char;
 2363|  83.8k|    str->len = max_len;
 2364|  83.8k|    str->atom_type = 0;
 2365|  83.8k|    str->hash = 0;          /* optional but costless */
 2366|  83.8k|    str->hash_next = 0;     /* optional */
 2367|       |#ifdef DUMP_LEAKS
 2368|       |    list_add_tail(&str->link, &rt->string_list);
 2369|       |#endif
 2370|  83.8k|    return str;
 2371|  83.8k|}
quickjs.c:JS_NewClass1:
 3859|  1.07k|{
 3860|  1.07k|    int new_size, i;
 3861|  1.07k|    JSClass *cl, *new_class_array;
 3862|  1.07k|    struct list_head *el;
 3863|       |
 3864|  1.07k|    if (class_id >= (1 << 16))
  ------------------
  |  Branch (3864:9): [True: 0, False: 1.07k]
  ------------------
 3865|      0|        return -1;
 3866|  1.07k|    if (class_id < rt->class_count &&
  ------------------
  |  Branch (3866:9): [True: 1.03k, False: 33]
  ------------------
 3867|  1.03k|        rt->class_array[class_id].class_id != 0)
  ------------------
  |  Branch (3867:9): [True: 0, False: 1.03k]
  ------------------
 3868|      0|        return -1;
 3869|       |
 3870|  1.07k|    if (class_id >= rt->class_count) {
  ------------------
  |  Branch (3870:9): [True: 33, False: 1.03k]
  ------------------
 3871|     33|        new_size = max_int(JS_CLASS_INIT_COUNT,
 3872|     33|                           max_int(class_id + 1, rt->class_count * 3 / 2));
 3873|       |
 3874|       |        /* reallocate the context class prototype array, if any */
 3875|     33|        list_for_each(el, &rt->context_list) {
  ------------------
  |  |   86|     49|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 16, False: 33]
  |  |  ------------------
  ------------------
 3876|     16|            JSContext *ctx = list_entry(el, JSContext, link);
  ------------------
  |  |   39|     16|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|     16|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 3877|     16|            JSValue *new_tab;
 3878|     16|            new_tab = js_realloc_rt(rt, ctx->class_proto,
 3879|     16|                                    sizeof(ctx->class_proto[0]) * new_size);
 3880|     16|            if (!new_tab)
  ------------------
  |  Branch (3880:17): [True: 0, False: 16]
  ------------------
 3881|      0|                return -1;
 3882|    512|            for(i = rt->class_count; i < new_size; i++)
  ------------------
  |  Branch (3882:38): [True: 496, False: 16]
  ------------------
 3883|    496|                new_tab[i] = JS_NULL;
  ------------------
  |  |  290|    496|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|    512|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 3884|     16|            ctx->class_proto = new_tab;
 3885|     16|        }
 3886|       |        /* reallocate the class array */
 3887|     33|        new_class_array = js_realloc_rt(rt, rt->class_array,
 3888|     33|                                        sizeof(JSClass) * new_size);
 3889|     33|        if (!new_class_array)
  ------------------
  |  Branch (3889:13): [True: 0, False: 33]
  ------------------
 3890|      0|            return -1;
 3891|     33|        memset(new_class_array + rt->class_count, 0,
 3892|     33|               (new_size - rt->class_count) * sizeof(JSClass));
 3893|     33|        rt->class_array = new_class_array;
 3894|     33|        rt->class_count = new_size;
 3895|     33|    }
 3896|  1.07k|    cl = &rt->class_array[class_id];
 3897|  1.07k|    cl->class_id = class_id;
 3898|  1.07k|    cl->class_name = JS_DupAtomRT(rt, name);
 3899|  1.07k|    cl->finalizer = class_def->finalizer;
 3900|  1.07k|    cl->gc_mark = class_def->gc_mark;
 3901|  1.07k|    cl->call = class_def->call;
 3902|  1.07k|    cl->exotic = class_def->exotic;
 3903|  1.07k|    return 0;
 3904|  1.07k|}
quickjs.c:JS_DupAtomRT:
 3108|  1.07k|{
 3109|  1.07k|    JSAtomStruct *p;
 3110|       |
 3111|  1.07k|    if (!__JS_AtomIsConst(v)) {
  ------------------
  |  Branch (3111:9): [True: 16, False: 1.05k]
  ------------------
 3112|     16|        p = rt->atom_array[v];
 3113|     16|        js_rc(p)->ref_count++;
 3114|     16|    }
 3115|  1.07k|    return v;
 3116|  1.07k|}
quickjs.c:js_new_string8_len:
 3924|   277k|{
 3925|   277k|    JSString *str;
 3926|       |
 3927|   277k|    if (len <= 0) {
  ------------------
  |  Branch (3927:9): [True: 270k, False: 6.85k]
  ------------------
 3928|   270k|        return JS_AtomToString(ctx, JS_ATOM_empty_string);
 3929|   270k|    }
 3930|  6.85k|    str = js_alloc_string(ctx, len, 0);
 3931|  6.85k|    if (!str)
  ------------------
  |  Branch (3931:9): [True: 0, False: 6.85k]
  ------------------
 3932|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 3933|  6.85k|    memcpy(str->u.str8, buf, len);
 3934|  6.85k|    str->u.str8[len] = '\0';
 3935|  6.85k|    return JS_MKPTR(JS_TAG_STRING, str);
  ------------------
  |  |  248|  6.85k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3936|  6.85k|}
quickjs.c:string_buffer_init:
 4027|    148|{
 4028|    148|    return string_buffer_init2(ctx, s, size, 0);
 4029|    148|}
quickjs.c:string_buffer_write8:
 4196|  71.4k|{
 4197|  71.4k|    int i;
 4198|       |
 4199|  71.4k|    if (s->len + len > s->size) {
  ------------------
  |  Branch (4199:9): [True: 45, False: 71.3k]
  ------------------
 4200|     45|        if (string_buffer_realloc(s, s->len + len, 0))
  ------------------
  |  Branch (4200:13): [True: 0, False: 45]
  ------------------
 4201|      0|            return -1;
 4202|     45|    }
 4203|  71.4k|    if (s->is_wide_char) {
  ------------------
  |  Branch (4203:9): [True: 71.4k, False: 34]
  ------------------
 4204|  1.31M|        for (i = 0; i < len; i++) {
  ------------------
  |  Branch (4204:21): [True: 1.24M, False: 71.4k]
  ------------------
 4205|  1.24M|            s->str->u.str16[s->len + i] = p[i];
 4206|  1.24M|        }
 4207|  71.4k|        s->len += len;
 4208|  71.4k|    } else {
 4209|     34|        memcpy(&s->str->u.str8[s->len], p, len);
 4210|     34|        s->len += len;
 4211|     34|    }
 4212|  71.4k|    return 0;
 4213|  71.4k|}
quickjs.c:string_buffer_realloc:
 4069|    459|{
 4070|    459|    JSString *new_str;
 4071|    459|    int new_size;
 4072|    459|    size_t new_size_bytes, slack;
 4073|       |
 4074|    459|    if (s->error_status)
  ------------------
  |  Branch (4074:9): [True: 0, False: 459]
  ------------------
 4075|      0|        return -1;
 4076|       |
 4077|    459|    if (new_len > JS_STRING_LEN_MAX) {
  ------------------
  |  |  212|    459|#define JS_STRING_LEN_MAX ((1 << 30) - 1)
  ------------------
  |  Branch (4077:9): [True: 0, False: 459]
  ------------------
 4078|      0|        JS_ThrowInternalError(s->ctx, "string too long");
 4079|      0|        return string_buffer_set_error(s);
 4080|      0|    }
 4081|    459|    new_size = min_int(max_int(new_len, s->size * 3 / 2), JS_STRING_LEN_MAX);
  ------------------
  |  |  212|    459|#define JS_STRING_LEN_MAX ((1 << 30) - 1)
  ------------------
 4082|    459|    if (!s->is_wide_char && c >= 0x100) {
  ------------------
  |  Branch (4082:9): [True: 265, False: 194]
  |  Branch (4082:29): [True: 4, False: 261]
  ------------------
 4083|      4|        return string_buffer_widen(s, new_size);
 4084|      4|    }
 4085|    455|    new_size_bytes = sizeof(JSString) + (new_size << s->is_wide_char) + 1 - s->is_wide_char;
 4086|    455|    new_str = js_realloc2(s->ctx, s->str, new_size_bytes, &slack);
 4087|    455|    if (!new_str)
  ------------------
  |  Branch (4087:9): [True: 0, False: 455]
  ------------------
 4088|      0|        return string_buffer_set_error(s);
 4089|    455|    new_size = min_int(new_size + (slack >> s->is_wide_char), JS_STRING_LEN_MAX);
  ------------------
  |  |  212|    455|#define JS_STRING_LEN_MAX ((1 << 30) - 1)
  ------------------
 4090|    455|    s->size = new_size;
 4091|    455|    s->str = new_str;
 4092|    455|    return 0;
 4093|    455|}
quickjs.c:string_buffer_widen:
 4047|     21|{
 4048|     21|    JSString *str;
 4049|     21|    size_t slack;
 4050|     21|    int i;
 4051|       |
 4052|     21|    if (s->error_status)
  ------------------
  |  Branch (4052:9): [True: 0, False: 21]
  ------------------
 4053|      0|        return -1;
 4054|       |
 4055|     21|    str = js_realloc2(s->ctx, s->str, sizeof(JSString) + (size << 1), &slack);
 4056|     21|    if (!str)
  ------------------
  |  Branch (4056:9): [True: 0, False: 21]
  ------------------
 4057|      0|        return string_buffer_set_error(s);
 4058|     21|    size += slack >> 1;
 4059|  1.26M|    for(i = s->len; i-- > 0;) {
  ------------------
  |  Branch (4059:21): [True: 1.26M, False: 21]
  ------------------
 4060|  1.26M|        str->u.str16[i] = str->u.str8[i];
 4061|  1.26M|    }
 4062|     21|    s->is_wide_char = 1;
 4063|     21|    s->size = size;
 4064|     21|    s->str = str;
 4065|     21|    return 0;
 4066|     21|}
quickjs.c:string_buffer_putc8:
 4115|  2.49M|{
 4116|  2.49M|    if (unlikely(s->len >= s->size)) {
  ------------------
  |  |   33|  2.49M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 2.49M]
  |  |  ------------------
  ------------------
 4117|      2|        if (string_buffer_realloc(s, s->len + 1, c))
  ------------------
  |  Branch (4117:13): [True: 0, False: 2]
  ------------------
 4118|      0|            return -1;
 4119|      2|    }
 4120|  2.49M|    if (s->is_wide_char) {
  ------------------
  |  Branch (4120:9): [True: 2.49M, False: 27]
  ------------------
 4121|  2.49M|        s->str->u.str16[s->len++] = c;
 4122|  2.49M|    } else {
 4123|     27|        s->str->u.str8[s->len++] = c;
 4124|     27|    }
 4125|  2.49M|    return 0;
 4126|  2.49M|}
quickjs.c:string_buffer_putc16:
 4130|  1.62M|{
 4131|  1.62M|    if (likely(s->len < s->size)) {
  ------------------
  |  |   32|  1.62M|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 1.61M, False: 408]
  |  |  ------------------
  ------------------
 4132|  1.61M|        if (s->is_wide_char) {
  ------------------
  |  Branch (4132:13): [True: 1.61M, False: 915]
  ------------------
 4133|  1.61M|            s->str->u.str16[s->len++] = c;
 4134|  1.61M|            return 0;
 4135|  1.61M|        } else if (c < 0x100) {
  ------------------
  |  Branch (4135:20): [True: 898, False: 17]
  ------------------
 4136|    898|            s->str->u.str8[s->len++] = c;
 4137|    898|            return 0;
 4138|    898|        }
 4139|  1.61M|    }
 4140|    425|    return string_buffer_putc16_slow(s, c);
 4141|  1.62M|}
quickjs.c:string_buffer_putc16_slow:
 4096|    425|{
 4097|    425|    if (unlikely(s->len >= s->size)) {
  ------------------
  |  |   33|    425|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 408, False: 17]
  |  |  ------------------
  ------------------
 4098|    408|        if (string_buffer_realloc(s, s->len + 1, c))
  ------------------
  |  Branch (4098:13): [True: 0, False: 408]
  ------------------
 4099|      0|            return -1;
 4100|    408|    }
 4101|    425|    if (s->is_wide_char) {
  ------------------
  |  Branch (4101:9): [True: 156, False: 269]
  ------------------
 4102|    156|        s->str->u.str16[s->len++] = c;
 4103|    269|    } else if (c < 0x100) {
  ------------------
  |  Branch (4103:16): [True: 252, False: 17]
  ------------------
 4104|    252|        s->str->u.str8[s->len++] = c;
 4105|    252|    } else {
 4106|     17|        if (string_buffer_widen(s, s->size))
  ------------------
  |  Branch (4106:13): [True: 0, False: 17]
  ------------------
 4107|      0|            return -1;
 4108|     17|        s->str->u.str16[s->len++] = c;
 4109|     17|    }
 4110|    425|    return 0;
 4111|    425|}
quickjs.c:string_buffer_end:
 4325|    149|{
 4326|    149|    JSString *str;
 4327|    149|    str = s->str;
 4328|    149|    if (s->error_status)
  ------------------
  |  Branch (4328:9): [True: 0, False: 149]
  ------------------
 4329|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 4330|    149|    if (s->len == 0) {
  ------------------
  |  Branch (4330:9): [True: 8, False: 141]
  ------------------
 4331|      8|        js_free(s->ctx, str);
 4332|      8|        s->str = NULL;
 4333|      8|        return JS_AtomToString(s->ctx, JS_ATOM_empty_string);
 4334|      8|    }
 4335|    141|    if (s->len < s->size) {
  ------------------
  |  Branch (4335:9): [True: 136, False: 5]
  ------------------
 4336|       |        /* smaller size so js_realloc should not fail, but OK if it does */
 4337|       |        /* XXX: should add some slack to avoid unnecessary calls */
 4338|       |        /* XXX: might need to use malloc+free to ensure smaller size */
 4339|    136|        str = js_realloc_rt(s->ctx->rt, str, sizeof(JSString) +
 4340|    136|                            (s->len << s->is_wide_char) + 1 - s->is_wide_char);
 4341|    136|        if (str == NULL)
  ------------------
  |  Branch (4341:13): [True: 0, False: 136]
  ------------------
 4342|      0|            str = s->str;
 4343|    136|        s->str = str;
 4344|    136|    }
 4345|    141|    if (!s->is_wide_char)
  ------------------
  |  Branch (4345:9): [True: 120, False: 21]
  ------------------
 4346|    120|        str->u.str8[s->len] = 0;
 4347|       |#ifdef DUMP_LEAKS
 4348|       |    list_add_tail(&str->link, &s->ctx->rt->string_list);
 4349|       |#endif
 4350|    141|    str->is_wide_char = s->is_wide_char;
 4351|    141|    str->len = s->len;
 4352|    141|    s->str = NULL;
 4353|    141|    return JS_MKPTR(JS_TAG_STRING, str);
  ------------------
  |  |  248|    141|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 4354|    149|}
quickjs.c:string_buffer_free:
 4032|      2|{
 4033|      2|    js_free(s->ctx, s->str);
 4034|       |    s->str = NULL;
 4035|      2|}
quickjs.c:js_alloc_string:
 2374|  79.6k|{
 2375|  79.6k|    JSString *p;
 2376|  79.6k|    p = js_alloc_string_rt(ctx->rt, max_len, is_wide_char);
 2377|  79.6k|    if (unlikely(!p)) {
  ------------------
  |  |   33|  79.6k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 79.6k]
  |  |  ------------------
  ------------------
 2378|      0|        JS_ThrowOutOfMemory(ctx);
 2379|      0|        return NULL;
 2380|      0|    }
 2381|  79.6k|    return p;
 2382|  79.6k|}
quickjs.c:init_shape_hash:
 5133|     17|{
 5134|     17|    rt->shape_hash_bits = 4;   /* 16 shapes */
 5135|     17|    rt->shape_hash_size = 1 << rt->shape_hash_bits;
 5136|     17|    rt->shape_hash_count = 0;
 5137|     17|    rt->shape_hash = js_mallocz_rt(rt, sizeof(rt->shape_hash[0]) *
 5138|     17|                                   rt->shape_hash_size);
 5139|     17|    if (!rt->shape_hash)
  ------------------
  |  Branch (5139:9): [True: 0, False: 17]
  ------------------
 5140|      0|        return -1;
 5141|     17|    return 0;
 5142|     17|}
quickjs.c:js_free_shape_null:
 5328|     85|{
 5329|     85|    if (sh)
  ------------------
  |  Branch (5329:9): [True: 85, False: 0]
  ------------------
 5330|     85|        js_free_shape(rt, sh);
 5331|     85|}
quickjs.c:js_free_shape:
 5321|  7.28k|{
 5322|  7.28k|    if (unlikely(--js_rc(sh)->ref_count <= 0)) {
  ------------------
  |  |   33|  7.28k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 4.16k, False: 3.11k]
  |  |  ------------------
  ------------------
 5323|  4.16k|        js_free_shape0(rt, sh);
 5324|  4.16k|    }
 5325|  7.28k|}
quickjs.c:js_free_shape0:
 5301|  4.16k|{
 5302|  4.16k|    uint32_t i;
 5303|  4.16k|    JSShapeProperty *pr;
 5304|       |
 5305|  4.16k|    assert(js_rc(sh)->ref_count == 0);
  ------------------
  |  Branch (5305:5): [True: 0, False: 4.16k]
  |  Branch (5305:5): [True: 4.16k, False: 0]
  ------------------
 5306|  4.16k|    if (sh->is_hashed)
  ------------------
  |  Branch (5306:9): [True: 2.28k, False: 1.88k]
  ------------------
 5307|  2.28k|        js_shape_hash_unlink(rt, sh);
 5308|  4.16k|    if (sh->proto != NULL) {
  ------------------
  |  Branch (5308:9): [True: 4.08k, False: 87]
  ------------------
 5309|  4.08k|        JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_OBJECT, sh->proto));
  ------------------
  |  |  248|  4.08k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 5310|  4.08k|    }
 5311|  4.16k|    pr = get_shape_prop(sh);
 5312|  21.8k|    for(i = 0; i < sh->prop_count; i++) {
  ------------------
  |  Branch (5312:16): [True: 17.7k, False: 4.16k]
  ------------------
 5313|  17.7k|        JS_FreeAtomRT(rt, pr->atom);
 5314|  17.7k|        pr++;
 5315|  17.7k|    }
 5316|  4.16k|    remove_gc_object(&sh->header);
 5317|  4.16k|    js_free_rt(rt, sh);
 5318|  4.16k|}
quickjs.c:js_shape_hash_unlink:
 5201|  6.63k|{
 5202|  6.63k|    uint32_t h;
 5203|  6.63k|    JSShape **psh;
 5204|       |
 5205|  6.63k|    h = get_shape_hash(sh->hash, rt->shape_hash_bits);
 5206|  6.63k|    psh = &rt->shape_hash[h];
 5207|  6.66k|    while (*psh != sh)
  ------------------
  |  Branch (5207:12): [True: 26, False: 6.63k]
  ------------------
 5208|     26|        psh = &(*psh)->shape_hash_next;
 5209|  6.63k|    *psh = sh->shape_hash_next;
 5210|  6.63k|    rt->shape_hash_count--;
 5211|  6.63k|}
quickjs.c:get_shape_hash:
 5152|  21.8k|{
 5153|  21.8k|    return h >> (32 - hash_bits);
 5154|  21.8k|}
quickjs.c:get_proto_obj:
 5735|  4.18k|{
 5736|  4.18k|    if (JS_VALUE_GET_TAG(proto_val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|  4.18k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5736:9): [True: 87, False: 4.10k]
  ------------------
 5737|     87|        return NULL;
 5738|  4.10k|    else
 5739|  4.10k|        return JS_VALUE_GET_OBJ(proto_val);
  ------------------
  |  |  229|  4.10k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  4.10k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5740|  4.18k|}
quickjs.c:find_hashed_shape_proto:
 5515|  2.25k|{
 5516|  2.25k|    JSShape *sh1;
 5517|  2.25k|    uint32_t h, h1;
 5518|       |
 5519|  2.25k|    h = shape_initial_hash(proto);
 5520|  2.25k|    h1 = get_shape_hash(h, rt->shape_hash_bits);
 5521|  3.21k|    for(sh1 = rt->shape_hash[h1]; sh1 != NULL; sh1 = sh1->shape_hash_next) {
  ------------------
  |  Branch (5521:35): [True: 2.02k, False: 1.19k]
  ------------------
 5522|  2.02k|        if (sh1->hash == h &&
  ------------------
  |  Branch (5522:13): [True: 1.05k, False: 964]
  ------------------
 5523|  1.05k|            sh1->proto == proto &&
  ------------------
  |  Branch (5523:13): [True: 1.05k, False: 0]
  ------------------
 5524|  1.05k|            sh1->prop_count == 0) {
  ------------------
  |  Branch (5524:13): [True: 1.05k, False: 0]
  ------------------
 5525|  1.05k|            return sh1;
 5526|  1.05k|        }
 5527|  2.02k|    }
 5528|  1.19k|    return NULL;
 5529|  2.25k|}
quickjs.c:shape_initial_hash:
 5157|  3.52k|{
 5158|  3.52k|    uint32_t h;
 5159|  3.52k|    h = shape_hash(1, (uintptr_t)proto);
 5160|  3.52k|    if (sizeof(proto) > 4)
  ------------------
  |  Branch (5160:9): [True: 3.52k, Folded]
  ------------------
 5161|  3.52k|        h = shape_hash(h, (uint64_t)(uintptr_t)proto >> 32);
 5162|  3.52k|    return h;
 5163|  3.52k|}
quickjs.c:shape_hash:
 5146|  28.0k|{
 5147|  28.0k|    return (h + val) * 0x9e370001;
 5148|  28.0k|}
quickjs.c:js_dup_shape:
 5295|  3.11k|{
 5296|  3.11k|    js_rc(sh)->ref_count++;
 5297|  3.11k|    return sh;
 5298|  3.11k|}
quickjs.c:js_new_shape:
 5261|  1.19k|{
 5262|  1.19k|    return js_new_shape2(ctx, proto, JS_PROP_INITIAL_HASH_SIZE,
  ------------------
  |  |  966|  1.19k|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
 5263|  1.19k|                         JS_PROP_INITIAL_SIZE);
  ------------------
  |  |  965|  1.19k|#define JS_PROP_INITIAL_SIZE 2
  ------------------
 5264|  1.19k|}
quickjs.c:JS_NewObjectFromShape:
 5615|  4.14k|{
 5616|  4.14k|    JSObject *p;
 5617|  4.14k|    int i;
 5618|       |    
 5619|  4.14k|    js_trigger_gc(ctx->rt, sizeof(JSObject));
 5620|  4.14k|    p = js_malloc(ctx, sizeof(JSObject));
 5621|  4.14k|    if (unlikely(!p))
  ------------------
  |  |   33|  4.14k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 4.14k]
  |  |  ------------------
  ------------------
 5622|      0|        goto fail;
 5623|  4.14k|    p->class_id = class_id;
 5624|  4.14k|    p->is_std_array_prototype = 0;
 5625|  4.14k|    p->extensible = TRUE;
 5626|  4.14k|    p->free_mark = 0;
 5627|  4.14k|    p->is_exotic = 0;
 5628|  4.14k|    p->fast_array = 0;
 5629|  4.14k|    p->is_constructor = 0;
 5630|  4.14k|    p->has_immutable_prototype = 0;
 5631|  4.14k|    p->tmp_mark = 0;
 5632|  4.14k|    p->is_HTMLDDA = 0;
 5633|  4.14k|    p->weakref_count = 0;
 5634|  4.14k|    p->u.opaque = NULL;
 5635|  4.14k|    p->shape = sh;
 5636|  4.14k|    p->prop = js_malloc(ctx, sizeof(JSProperty) * sh->prop_size);
 5637|  4.14k|    if (unlikely(!p->prop)) {
  ------------------
  |  |   33|  4.14k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 4.14k]
  |  |  ------------------
  ------------------
 5638|      0|        js_free(ctx, p);
 5639|      0|    fail:
 5640|      0|        if (props) {
  ------------------
  |  Branch (5640:13): [True: 0, False: 0]
  ------------------
 5641|      0|            JSShapeProperty *prs = get_shape_prop(sh);
 5642|      0|            for(i = 0; i < sh->prop_count; i++) {
  ------------------
  |  Branch (5642:24): [True: 0, False: 0]
  ------------------
 5643|      0|                free_property(ctx->rt, &props[i], prs->flags);
 5644|      0|                prs++;
 5645|      0|            }
 5646|      0|        }
 5647|      0|        js_free_shape(ctx->rt, sh);
 5648|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 5649|      0|    }
 5650|       |
 5651|  4.14k|    switch(class_id) {
 5652|  1.00k|    case JS_CLASS_OBJECT:
  ------------------
  |  Branch (5652:5): [True: 1.00k, False: 3.14k]
  ------------------
 5653|  1.00k|        break;
 5654|     54|    case JS_CLASS_ARRAY:
  ------------------
  |  Branch (5654:5): [True: 54, False: 4.08k]
  ------------------
 5655|     54|        {
 5656|     54|            JSProperty *pr;
 5657|     54|            p->is_exotic = 1;
 5658|     54|            p->fast_array = 1;
 5659|     54|            p->u.array.u.values = NULL;
 5660|     54|            p->u.array.count = 0;
 5661|     54|            p->u.array.u1.size = 0;
 5662|     54|            if (!props) {
  ------------------
  |  Branch (5662:17): [True: 50, False: 4]
  ------------------
 5663|       |                /* XXX: remove */
 5664|       |                /* the length property is always the first one */
 5665|     50|                if (likely(sh == ctx->array_shape)) {
  ------------------
  |  |   32|     50|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 33, False: 17]
  |  |  ------------------
  ------------------
 5666|     33|                    pr = &p->prop[0];
 5667|     33|                } else {
 5668|       |                    /* only used for the first array */
 5669|       |                    /* cannot fail */
 5670|     17|                    pr = add_property(ctx, p, JS_ATOM_length,
 5671|     17|                                      JS_PROP_WRITABLE | JS_PROP_LENGTH);
  ------------------
  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                    JS_PROP_WRITABLE | JS_PROP_LENGTH);
  ------------------
  |  |  302|     17|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
 5672|     17|                }
 5673|     50|                pr->u.value = JS_NewInt32(ctx, 0);
 5674|     50|            }
 5675|     54|        }
 5676|     54|        break;
 5677|  2.71k|    case JS_CLASS_C_FUNCTION:
  ------------------
  |  Branch (5677:5): [True: 2.71k, False: 1.42k]
  ------------------
 5678|  2.71k|        p->prop[0].u.value = JS_UNDEFINED;
  ------------------
  |  |  291|  2.71k|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|  2.71k|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 5679|  2.71k|        break;
 5680|      0|    case JS_CLASS_ARGUMENTS:
  ------------------
  |  Branch (5680:5): [True: 0, False: 4.14k]
  ------------------
 5681|      0|    case JS_CLASS_MAPPED_ARGUMENTS:
  ------------------
  |  Branch (5681:5): [True: 0, False: 4.14k]
  ------------------
 5682|      0|    case JS_CLASS_UINT8C_ARRAY:
  ------------------
  |  Branch (5682:5): [True: 0, False: 4.14k]
  ------------------
 5683|      0|    case JS_CLASS_INT8_ARRAY:
  ------------------
  |  Branch (5683:5): [True: 0, False: 4.14k]
  ------------------
 5684|      0|    case JS_CLASS_UINT8_ARRAY:
  ------------------
  |  Branch (5684:5): [True: 0, False: 4.14k]
  ------------------
 5685|      0|    case JS_CLASS_INT16_ARRAY:
  ------------------
  |  Branch (5685:5): [True: 0, False: 4.14k]
  ------------------
 5686|      0|    case JS_CLASS_UINT16_ARRAY:
  ------------------
  |  Branch (5686:5): [True: 0, False: 4.14k]
  ------------------
 5687|      0|    case JS_CLASS_INT32_ARRAY:
  ------------------
  |  Branch (5687:5): [True: 0, False: 4.14k]
  ------------------
 5688|      0|    case JS_CLASS_UINT32_ARRAY:
  ------------------
  |  Branch (5688:5): [True: 0, False: 4.14k]
  ------------------
 5689|      0|    case JS_CLASS_BIG_INT64_ARRAY:
  ------------------
  |  Branch (5689:5): [True: 0, False: 4.14k]
  ------------------
 5690|      0|    case JS_CLASS_BIG_UINT64_ARRAY:
  ------------------
  |  Branch (5690:5): [True: 0, False: 4.14k]
  ------------------
 5691|      0|    case JS_CLASS_FLOAT16_ARRAY:
  ------------------
  |  Branch (5691:5): [True: 0, False: 4.14k]
  ------------------
 5692|      0|    case JS_CLASS_FLOAT32_ARRAY:
  ------------------
  |  Branch (5692:5): [True: 0, False: 4.14k]
  ------------------
 5693|      0|    case JS_CLASS_FLOAT64_ARRAY:
  ------------------
  |  Branch (5693:5): [True: 0, False: 4.14k]
  ------------------
 5694|      0|        p->is_exotic = 1;
 5695|      0|        p->fast_array = 1;
 5696|      0|        p->u.array.u.ptr = NULL;
 5697|      0|        p->u.array.count = 0;
 5698|      0|        break;
 5699|      0|    case JS_CLASS_DATAVIEW:
  ------------------
  |  Branch (5699:5): [True: 0, False: 4.14k]
  ------------------
 5700|      0|        p->u.array.u.ptr = NULL;
 5701|      0|        p->u.array.count = 0;
 5702|      0|        break;
 5703|     17|    case JS_CLASS_NUMBER:
  ------------------
  |  Branch (5703:5): [True: 17, False: 4.12k]
  ------------------
 5704|     34|    case JS_CLASS_STRING:
  ------------------
  |  Branch (5704:5): [True: 17, False: 4.12k]
  ------------------
 5705|     53|    case JS_CLASS_BOOLEAN:
  ------------------
  |  Branch (5705:5): [True: 19, False: 4.12k]
  ------------------
 5706|     53|    case JS_CLASS_SYMBOL:
  ------------------
  |  Branch (5706:5): [True: 0, False: 4.14k]
  ------------------
 5707|     53|    case JS_CLASS_DATE:
  ------------------
  |  Branch (5707:5): [True: 0, False: 4.14k]
  ------------------
 5708|     53|    case JS_CLASS_BIG_INT:
  ------------------
  |  Branch (5708:5): [True: 0, False: 4.14k]
  ------------------
 5709|     53|        p->u.object_data = JS_UNDEFINED;
  ------------------
  |  |  291|     53|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     53|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 5710|     53|        goto set_exotic;
 5711|      4|    case JS_CLASS_REGEXP:
  ------------------
  |  Branch (5711:5): [True: 4, False: 4.13k]
  ------------------
 5712|      4|        p->u.regexp.pattern = NULL;
 5713|      4|        p->u.regexp.bytecode = NULL;
 5714|      4|        break;
 5715|     17|    case JS_CLASS_GLOBAL_OBJECT:
  ------------------
  |  Branch (5715:5): [True: 17, False: 4.12k]
  ------------------
 5716|     17|        p->u.global_object.uninitialized_vars = JS_UNDEFINED;
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 5717|     17|        break;
 5718|    294|    default:
  ------------------
  |  Branch (5718:5): [True: 294, False: 3.84k]
  ------------------
 5719|    347|    set_exotic:
 5720|    347|        if (ctx->rt->class_array[class_id].exotic) {
  ------------------
  |  Branch (5720:13): [True: 51, False: 296]
  ------------------
 5721|     51|            p->is_exotic = 1;
 5722|     51|        }
 5723|    347|        break;
 5724|  4.14k|    }
 5725|  4.14k|    js_rc(p)->ref_count = 1;
 5726|  4.14k|    add_gc_object(ctx->rt, &p->header, JS_GC_OBJ_TYPE_JS_OBJECT);
 5727|  4.14k|    if (props) {
  ------------------
  |  Branch (5727:9): [True: 6, False: 4.13k]
  ------------------
 5728|     24|        for(i = 0; i < sh->prop_count; i++)
  ------------------
  |  Branch (5728:20): [True: 18, False: 6]
  ------------------
 5729|     18|            p->prop[i] = props[i];
 5730|      6|    }
 5731|  4.14k|    return JS_MKPTR(JS_TAG_OBJECT, p);
  ------------------
  |  |  248|  4.14k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 5732|  4.14k|}
quickjs.c:js_trigger_gc:
 1781|  4.14k|{
 1782|  4.14k|    BOOL force_gc;
 1783|       |#ifdef FORCE_GC_AT_MALLOC
 1784|       |    force_gc = TRUE;
 1785|       |#else
 1786|  4.14k|    force_gc = ((rt->malloc_ctx.malloc_state.malloc_size + size) >
 1787|  4.14k|                rt->malloc_gc_threshold);
 1788|  4.14k|#endif
 1789|  4.14k|    if (force_gc) {
  ------------------
  |  Branch (1789:9): [True: 14, False: 4.12k]
  ------------------
 1790|       |#ifdef DUMP_GC
 1791|       |        printf("GC: size=%" PRIu64 "\n",
 1792|       |               (uint64_t)rt->malloc_ctx.malloc_state.malloc_size);
 1793|       |#endif
 1794|     14|        JS_RunGC(rt);
 1795|     14|        rt->malloc_gc_threshold = rt->malloc_ctx.malloc_state.malloc_size +
 1796|     14|            (rt->malloc_ctx.malloc_state.malloc_size >> 1);
 1797|     14|    }
 1798|  4.14k|}
quickjs.c:free_property:
 6098|  19.5k|{
 6099|  19.5k|    if (unlikely(prop_flags & JS_PROP_TMASK)) {
  ------------------
  |  |   33|  19.5k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 10.5k, False: 8.98k]
  |  |  ------------------
  ------------------
 6100|  10.5k|        if ((prop_flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|  10.5k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      if ((prop_flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  305|  10.5k|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (6100:13): [True: 748, False: 9.80k]
  ------------------
 6101|    748|            if (pr->u.getset.getter)
  ------------------
  |  Branch (6101:17): [True: 748, False: 0]
  ------------------
 6102|    748|                JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.getter));
  ------------------
  |  |  248|    748|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6103|    748|            if (pr->u.getset.setter)
  ------------------
  |  Branch (6103:17): [True: 85, False: 663]
  ------------------
 6104|     85|                JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.setter));
  ------------------
  |  |  248|     85|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6105|  9.80k|        } else if ((prop_flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  303|  9.80k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      } else if ((prop_flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  306|  9.80k|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (6105:20): [True: 2.65k, False: 7.15k]
  ------------------
 6106|  2.65k|            free_var_ref(rt, pr->u.var_ref);
 6107|  7.15k|        } else if ((prop_flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  303|  7.15k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      } else if ((prop_flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  307|  7.15k|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (6107:20): [True: 7.15k, False: 0]
  ------------------
 6108|  7.15k|            js_autoinit_free(rt, pr);
 6109|  7.15k|        }
 6110|  10.5k|    } else {
 6111|  8.98k|        JS_FreeValueRT(rt, pr->u.value);
 6112|  8.98k|    }
 6113|  19.5k|}
quickjs.c:js_autoinit_free:
 6087|  7.36k|{
 6088|  7.36k|    JS_FreeContext(js_autoinit_get_realm(pr));
 6089|  7.36k|}
quickjs.c:js_autoinit_get_realm:
 6077|  33.6k|{
 6078|  33.6k|    return (JSContext *)(pr->u.init.realm_and_id & ~3);
 6079|  33.6k|}
quickjs.c:JS_NewCFunction3:
 5948|  2.71k|{
 5949|  2.71k|    JSValue func_obj;
 5950|  2.71k|    JSObject *p;
 5951|  2.71k|    JSAtom name_atom;
 5952|       |
 5953|  2.71k|    if (n_fields > 0) {
  ------------------
  |  Branch (5953:9): [True: 816, False: 1.90k]
  ------------------
 5954|    816|        func_obj = JS_NewObjectProtoClassAlloc(ctx, proto_val, JS_CLASS_C_FUNCTION, n_fields);
 5955|  1.90k|    } else {
 5956|  1.90k|        func_obj = JS_NewObjectProtoClass(ctx, proto_val, JS_CLASS_C_FUNCTION);
 5957|  1.90k|    }
 5958|  2.71k|    if (JS_IsException(func_obj))
  ------------------
  |  Branch (5958:9): [True: 0, False: 2.71k]
  ------------------
 5959|      0|        return func_obj;
 5960|  2.71k|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  229|  2.71k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  2.71k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5961|  2.71k|    p->u.cfunc.realm = JS_DupContext(ctx);
 5962|  2.71k|    p->u.cfunc.c_function.generic = func;
 5963|  2.71k|    p->u.cfunc.length = length;
 5964|  2.71k|    p->u.cfunc.cproto = cproto;
 5965|  2.71k|    p->u.cfunc.magic = magic;
 5966|  2.71k|    p->is_constructor = (cproto == JS_CFUNC_constructor ||
  ------------------
  |  Branch (5966:26): [True: 85, False: 2.63k]
  ------------------
 5967|  2.63k|                         cproto == JS_CFUNC_constructor_magic ||
  ------------------
  |  Branch (5967:26): [True: 272, False: 2.36k]
  ------------------
 5968|  2.36k|                         cproto == JS_CFUNC_constructor_or_func ||
  ------------------
  |  Branch (5968:26): [True: 221, False: 2.14k]
  ------------------
 5969|  2.14k|                         cproto == JS_CFUNC_constructor_or_func_magic);
  ------------------
  |  Branch (5969:26): [True: 221, False: 1.92k]
  ------------------
 5970|  2.71k|    if (!name)
  ------------------
  |  Branch (5970:9): [True: 17, False: 2.70k]
  ------------------
 5971|     17|        name = "";
 5972|  2.71k|    name_atom = JS_NewAtom(ctx, name);
 5973|  2.71k|    if (name_atom == JS_ATOM_NULL) {
  ------------------
  |  |  451|  2.71k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (5973:9): [True: 0, False: 2.71k]
  ------------------
 5974|      0|        JS_FreeValue(ctx, func_obj);
 5975|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 5976|      0|    }
 5977|  2.71k|    js_function_set_properties(ctx, func_obj, name_atom, length);
 5978|  2.71k|    JS_FreeAtom(ctx, name_atom);
 5979|  2.71k|    return func_obj;
 5980|  2.71k|}
quickjs.c:JS_NewObjectProtoClassAlloc:
 5765|  1.85k|{
 5766|  1.85k|    JSShape *sh;
 5767|  1.85k|    JSObject *proto;
 5768|  1.85k|    int hash_size, hash_bits;
 5769|       |    
 5770|  1.85k|    if (n_alloc_props <= JS_PROP_INITIAL_SIZE) {
  ------------------
  |  |  965|  1.85k|#define JS_PROP_INITIAL_SIZE 2
  ------------------
  |  Branch (5770:9): [True: 357, False: 1.49k]
  ------------------
 5771|    357|        n_alloc_props = JS_PROP_INITIAL_SIZE;
  ------------------
  |  |  965|    357|#define JS_PROP_INITIAL_SIZE 2
  ------------------
 5772|    357|        hash_size = JS_PROP_INITIAL_HASH_SIZE;
  ------------------
  |  |  966|    357|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
 5773|  1.49k|    } else {
 5774|  1.49k|        hash_bits = 32 - clz32(n_alloc_props - 1); /* ceil(log2(radix)) */
 5775|  1.49k|        hash_size = 1 << hash_bits;
 5776|  1.49k|    }
 5777|  1.85k|    proto = get_proto_obj(proto_val);
 5778|  1.85k|    sh = js_new_shape_nohash(ctx, proto, hash_size, n_alloc_props);
 5779|  1.85k|    if (!sh)
  ------------------
  |  Branch (5779:9): [True: 0, False: 1.85k]
  ------------------
 5780|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 5781|  1.85k|    return JS_NewObjectFromShape(ctx, sh, class_id, NULL);
 5782|  1.85k|}
quickjs.c:js_new_shape_nohash:
 5216|  3.13k|{
 5217|  3.13k|    JSRuntime *rt = ctx->rt;
 5218|  3.13k|    JSShape *sh;
 5219|       |
 5220|  3.13k|    sh = js_malloc(ctx, get_shape_size(hash_size, prop_size));
 5221|  3.13k|    if (!sh)
  ------------------
  |  Branch (5221:9): [True: 0, False: 3.13k]
  ------------------
 5222|      0|        return NULL;
 5223|  3.13k|    js_rc(sh)->ref_count = 1;
 5224|  3.13k|    add_gc_object(rt, &sh->header, JS_GC_OBJ_TYPE_SHAPE);
 5225|  3.13k|    if (proto)
  ------------------
  |  Branch (5225:9): [True: 3.04k, False: 87]
  ------------------
 5226|  3.04k|        JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, proto));
  ------------------
  |  |  248|  3.04k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 5227|  3.13k|    sh->proto = proto;
 5228|  3.13k|    memset(sh->hash_table, 0, sizeof(sh->hash_table[0]) * hash_size);
 5229|  3.13k|    sh->prop_hash_mask = hash_size - 1;
 5230|  3.13k|    sh->prop_size = prop_size;
 5231|  3.13k|    sh->prop_count = 0;
 5232|  3.13k|    sh->deleted_prop_count = 0;
 5233|  3.13k|    sh->is_hashed = FALSE;
 5234|  3.13k|    return sh;
 5235|  3.13k|}
quickjs.c:js_c_function_data_call:
 6028|     32|{
 6029|     32|    JSCFunctionDataRecord *s = JS_GetOpaque(func_obj, JS_CLASS_C_FUNCTION_DATA);
 6030|     32|    JSValueConst *arg_buf;
  ------------------
  |  |  234|     32|#define JSValueConst JSValue
  ------------------
 6031|     32|    int i;
 6032|       |
 6033|       |    /* XXX: could add the function on the stack for debug */
 6034|     32|    if (unlikely(argc < s->length)) {
  ------------------
  |  |   33|     32|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 32]
  |  |  ------------------
  ------------------
 6035|      0|        arg_buf = alloca(sizeof(arg_buf[0]) * s->length);
 6036|      0|        for(i = 0; i < argc; i++)
  ------------------
  |  Branch (6036:20): [True: 0, False: 0]
  ------------------
 6037|      0|            arg_buf[i] = argv[i];
 6038|      0|        for(i = argc; i < s->length; i++)
  ------------------
  |  Branch (6038:23): [True: 0, False: 0]
  ------------------
 6039|      0|            arg_buf[i] = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 6040|     32|    } else {
 6041|     32|        arg_buf = argv;
 6042|     32|    }
 6043|       |
 6044|     32|    return s->func(ctx, this_val, argc, arg_buf, s->magic, s->data);
 6045|     32|}
quickjs.c:js_function_set_properties:
 5855|  2.84k|{
 5856|       |    /* ES6 feature non compatible with ES5.1: length is configurable */
 5857|  2.84k|    JS_DefinePropertyValue(ctx, func_obj, JS_ATOM_length, JS_NewInt32(ctx, len),
 5858|  2.84k|                           JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|  2.84k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 5859|  2.84k|    JS_DefinePropertyValue(ctx, func_obj, JS_ATOM_name,
 5860|  2.84k|                           JS_AtomToString(ctx, name), JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|  2.84k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 5861|  2.84k|}
quickjs.c:JS_FreeAtomStruct:
 3375|  6.81k|{
 3376|       |#if 0   /* JS_ATOM_NULL is not refcounted: __JS_AtomIsConst() includes 0 */
 3377|       |    if (unlikely(i == JS_ATOM_NULL)) {
 3378|       |        js_rc(p)->ref_count = INT32_MAX / 2;
 3379|       |        return;
 3380|       |    }
 3381|       |#endif
 3382|  6.81k|    uint32_t i = p->hash_next;  /* atom_index */
 3383|  6.81k|    if (p->atom_type != JS_ATOM_TYPE_SYMBOL) {
  ------------------
  |  Branch (3383:9): [True: 6.81k, False: 0]
  ------------------
 3384|  6.81k|        JSAtomStruct *p0, *p1;
 3385|  6.81k|        uint32_t h0;
 3386|       |
 3387|  6.81k|        h0 = p->hash & (rt->atom_hash_size - 1);
 3388|  6.81k|        i = rt->atom_hash[h0];
 3389|  6.81k|        p1 = rt->atom_array[i];
 3390|  6.81k|        if (p1 == p) {
  ------------------
  |  Branch (3390:13): [True: 4.99k, False: 1.81k]
  ------------------
 3391|  4.99k|            rt->atom_hash[h0] = p1->hash_next;
 3392|  4.99k|        } else {
 3393|  2.51k|            for(;;) {
 3394|  2.51k|                assert(i != 0);
  ------------------
  |  Branch (3394:17): [True: 0, False: 2.51k]
  |  Branch (3394:17): [True: 2.51k, False: 0]
  ------------------
 3395|  2.51k|                p0 = p1;
 3396|  2.51k|                i = p1->hash_next;
 3397|  2.51k|                p1 = rt->atom_array[i];
 3398|  2.51k|                if (p1 == p) {
  ------------------
  |  Branch (3398:21): [True: 1.81k, False: 695]
  ------------------
 3399|  1.81k|                    p0->hash_next = p1->hash_next;
 3400|  1.81k|                    break;
 3401|  1.81k|                }
 3402|  2.51k|            }
 3403|  1.81k|        }
 3404|  6.81k|    }
 3405|       |    /* insert in free atom list */
 3406|  6.81k|    rt->atom_array[i] = atom_set_free(rt->atom_free_index);
 3407|  6.81k|    rt->atom_free_index = i;
 3408|       |    /* free the string structure */
 3409|       |#ifdef DUMP_LEAKS
 3410|       |    list_del(&p->link);
 3411|       |#endif
 3412|  6.81k|    if (p->atom_type == JS_ATOM_TYPE_SYMBOL &&
  ------------------
  |  Branch (3412:9): [True: 0, False: 6.81k]
  ------------------
 3413|      0|        p->hash != JS_ATOM_HASH_PRIVATE && p->hash != 0) {
  ------------------
  |  |  581|      0|#define JS_ATOM_HASH_PRIVATE JS_ATOM_HASH_MASK
  |  |  ------------------
  |  |  |  |  580|  6.81k|#define JS_ATOM_HASH_MASK  ((1 << 30) - 1)
  |  |  ------------------
  ------------------
  |  Branch (3413:9): [True: 0, False: 0]
  |  Branch (3413:44): [True: 0, False: 0]
  ------------------
 3414|       |        /* live weak references are still present on this object: keep
 3415|       |           it */
 3416|  6.81k|    } else {
 3417|  6.81k|        js_free_rt(rt, p);
 3418|  6.81k|    }
 3419|  6.81k|    rt->atom_count--;
 3420|       |    assert(rt->atom_count >= 0);
  ------------------
  |  Branch (3420:5): [True: 0, False: 6.81k]
  |  Branch (3420:5): [True: 6.81k, False: 0]
  ------------------
 3421|  6.81k|}
quickjs.c:free_zero_refcount:
 6415|    139|{
 6416|    139|    struct list_head *el;
 6417|    139|    JSGCObjectHeader *p;
 6418|       |
 6419|    139|    rt->gc_phase = JS_GC_PHASE_DECREF;
 6420|    323|    for(;;) {
 6421|    323|        el = rt->gc_zero_ref_count_list.next;
 6422|    323|        if (el == &rt->gc_zero_ref_count_list)
  ------------------
  |  Branch (6422:13): [True: 139, False: 184]
  ------------------
 6423|    139|            break;
 6424|    184|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|    184|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|    184|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6425|    184|        assert(js_rc(p)->ref_count == 0);
  ------------------
  |  Branch (6425:9): [True: 0, False: 184]
  |  Branch (6425:9): [True: 184, False: 0]
  ------------------
 6426|    184|        free_gc_object(rt, p);
 6427|    184|    }
 6428|    139|    rt->gc_phase = JS_GC_PHASE_NONE;
 6429|    139|}
quickjs.c:free_gc_object:
 6395|  4.24k|{
 6396|  4.24k|    switch(js_rc(gp)->gc_obj_type) {
 6397|  4.14k|    case JS_GC_OBJ_TYPE_JS_OBJECT:
  ------------------
  |  Branch (6397:5): [True: 4.14k, False: 98]
  ------------------
 6398|  4.14k|        free_object(rt, (JSObject *)gp);
 6399|  4.14k|        break;
 6400|     31|    case JS_GC_OBJ_TYPE_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6400:5): [True: 31, False: 4.20k]
  ------------------
 6401|     31|        free_function_bytecode(rt, (JSFunctionBytecode *)gp);
 6402|     31|        break;
 6403|     16|    case JS_GC_OBJ_TYPE_ASYNC_FUNCTION:
  ------------------
  |  Branch (6403:5): [True: 16, False: 4.22k]
  ------------------
 6404|     16|        __async_func_free(rt, (JSAsyncFunctionState *)gp);
 6405|     16|        break;
 6406|     51|    case JS_GC_OBJ_TYPE_MODULE:
  ------------------
  |  Branch (6406:5): [True: 51, False: 4.18k]
  ------------------
 6407|     51|        js_free_module_def(rt, (JSModuleDef *)gp);
 6408|     51|        break;
 6409|      0|    default:
  ------------------
  |  Branch (6409:5): [True: 0, False: 4.24k]
  ------------------
 6410|      0|        abort();
 6411|  4.24k|    }
 6412|  4.24k|}
quickjs.c:free_object:
 6341|  4.14k|{
 6342|  4.14k|    int i;
 6343|  4.14k|    JSClassFinalizer *finalizer;
 6344|  4.14k|    JSShape *sh;
 6345|  4.14k|    JSShapeProperty *pr;
 6346|       |
 6347|  4.14k|    p->free_mark = 1; /* used to tell the object is invalid when
 6348|       |                         freeing cycles */
 6349|       |    /* free all the fields */
 6350|  4.14k|    sh = p->shape;
 6351|  4.14k|    pr = get_shape_prop(sh);
 6352|  23.6k|    for(i = 0; i < sh->prop_count; i++) {
  ------------------
  |  Branch (6352:16): [True: 19.5k, False: 4.14k]
  ------------------
 6353|  19.5k|        free_property(rt, &p->prop[i], pr->flags);
 6354|  19.5k|        pr++;
 6355|  19.5k|    }
 6356|  4.14k|    js_free_rt(rt, p->prop);
 6357|       |    /* as an optimization we destroy the shape immediately without
 6358|       |       putting it in gc_zero_ref_count_list */
 6359|  4.14k|    js_free_shape(rt, sh);
 6360|       |
 6361|       |    /* fail safe */
 6362|  4.14k|    p->shape = NULL;
 6363|  4.14k|    p->prop = NULL;
 6364|       |
 6365|  4.14k|    finalizer = rt->class_array[p->class_id].finalizer;
 6366|  4.14k|    if (finalizer)
  ------------------
  |  Branch (6366:9): [True: 3.07k, False: 1.06k]
  ------------------
 6367|  3.07k|        (*finalizer)(rt, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|  3.07k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6368|       |
 6369|       |    /* fail safe */
 6370|  4.14k|    p->class_id = 0;
 6371|  4.14k|    p->u.opaque = NULL;
 6372|  4.14k|    p->u.func.var_refs = NULL;
 6373|  4.14k|    p->u.func.home_object = NULL;
 6374|       |
 6375|  4.14k|    remove_gc_object(&p->header);
 6376|  4.14k|    if (rt->gc_phase == JS_GC_PHASE_REMOVE_CYCLES) {
  ------------------
  |  Branch (6376:9): [True: 3.98k, False: 155]
  ------------------
 6377|  3.98k|        if (js_rc(p)->ref_count == 0 && p->weakref_count == 0) {
  ------------------
  |  Branch (6377:13): [True: 976, False: 3.01k]
  |  Branch (6377:41): [True: 976, False: 0]
  ------------------
 6378|    976|            js_free_rt(rt, p);
 6379|  3.01k|        } else {
 6380|       |            /* keep the object structure because there are may be
 6381|       |               references to it */
 6382|  3.01k|            list_add_tail(&p->header.link, &rt->gc_zero_ref_count_list);
 6383|  3.01k|        }
 6384|  3.98k|    } else {
 6385|       |        /* keep the object structure in case there are weak references to it */
 6386|    155|        if (p->weakref_count == 0) {
  ------------------
  |  Branch (6386:13): [True: 155, False: 0]
  ------------------
 6387|    155|            js_free_rt(rt, p);
 6388|    155|        } else {
 6389|      0|            js_rc(p)->mark = 0; /* reset the mark so that the weakref can be freed */
 6390|      0|        }
 6391|    155|    }
 6392|  4.14k|}
quickjs.c:free_function_bytecode:
36167|     31|{
36168|     31|    int i;
36169|       |
36170|       |#if 0
36171|       |    {
36172|       |        char buf[ATOM_GET_STR_BUF_SIZE];
36173|       |        printf("freeing %s\n",
36174|       |               JS_AtomGetStrRT(rt, buf, sizeof(buf), b->func_name));
36175|       |    }
36176|       |#endif
36177|     31|    if (b->byte_code_buf)
  ------------------
  |  Branch (36177:9): [True: 31, False: 0]
  ------------------
36178|     31|        free_bytecode_atoms(rt, b->byte_code_buf, b->byte_code_len, TRUE);
36179|       |
36180|     31|    if (b->vardefs) {
  ------------------
  |  Branch (36180:9): [True: 14, False: 17]
  ------------------
36181|     38|        for(i = 0; i < b->arg_count + b->var_count; i++) {
  ------------------
  |  Branch (36181:20): [True: 24, False: 14]
  ------------------
36182|     24|            JS_FreeAtomRT(rt, b->vardefs[i].var_name);
36183|     24|        }
36184|     14|    }
36185|     46|    for(i = 0; i < b->cpool_count; i++)
  ------------------
  |  Branch (36185:16): [True: 15, False: 31]
  ------------------
36186|     15|        JS_FreeValueRT(rt, b->cpool[i]);
36187|       |
36188|    104|    for(i = 0; i < b->closure_var_count; i++) {
  ------------------
  |  Branch (36188:16): [True: 73, False: 31]
  ------------------
36189|     73|        JSClosureVar *cv = &b->closure_var[i];
36190|     73|        JS_FreeAtomRT(rt, cv->var_name);
36191|     73|    }
36192|     31|    if (b->realm)
  ------------------
  |  Branch (36192:9): [True: 31, False: 0]
  ------------------
36193|     31|        JS_FreeContext(b->realm);
36194|       |
36195|     31|    JS_FreeAtomRT(rt, b->func_name);
36196|     31|    if (b->has_debug) {
  ------------------
  |  Branch (36196:9): [True: 31, False: 0]
  ------------------
36197|     31|        JS_FreeAtomRT(rt, b->debug.filename);
36198|     31|        js_free_rt(rt, b->debug.pc2line_buf);
36199|     31|        js_free_rt(rt, b->debug.source);
36200|     31|    }
36201|       |
36202|     31|    remove_gc_object(&b->header);
36203|     31|    if (rt->gc_phase == JS_GC_PHASE_REMOVE_CYCLES && js_rc(b)->ref_count != 0) {
  ------------------
  |  Branch (36203:9): [True: 18, False: 13]
  |  Branch (36203:54): [True: 9, False: 9]
  ------------------
36204|      9|        list_add_tail(&b->header.link, &rt->gc_zero_ref_count_list);
36205|     22|    } else {
36206|     22|        js_free_rt(rt, b);
36207|     22|    }
36208|     31|}
quickjs.c:free_bytecode_atoms:
32013|     39|{
32014|     39|    int pos, len, op;
32015|     39|    JSAtom atom;
32016|     39|    const JSOpCode *oi;
32017|       |
32018|     39|    pos = 0;
32019|    981|    while (pos < bc_len) {
  ------------------
  |  Branch (32019:12): [True: 942, False: 39]
  ------------------
32020|    942|        op = bc_buf[pos];
32021|    942|        if (use_short_opcodes)
  ------------------
  |  Branch (32021:13): [True: 384, False: 558]
  ------------------
32022|    384|            oi = &short_opcode_info(op);
  ------------------
  |  |22065|    384|    opcode_info[(op) >= OP_TEMP_START ? \
  |  |  ------------------
  |  |  |  Branch (22065:17): [True: 102, False: 282]
  |  |  ------------------
  |  |22066|    384|                (op) + (OP_TEMP_END - OP_TEMP_START) : (op)]
  ------------------
32023|    558|        else
32024|    558|            oi = &opcode_info[op];
32025|       |
32026|    942|        len = oi->size;
32027|    942|        switch(oi->fmt) {
32028|     71|        case OP_FMT_atom:
  ------------------
  |  Branch (32028:9): [True: 71, False: 871]
  ------------------
32029|     71|        case OP_FMT_atom_u8:
  ------------------
  |  Branch (32029:9): [True: 0, False: 942]
  ------------------
32030|    110|        case OP_FMT_atom_u16:
  ------------------
  |  Branch (32030:9): [True: 39, False: 903]
  ------------------
32031|    110|        case OP_FMT_atom_label_u8:
  ------------------
  |  Branch (32031:9): [True: 0, False: 942]
  ------------------
32032|    110|        case OP_FMT_atom_label_u16:
  ------------------
  |  Branch (32032:9): [True: 0, False: 942]
  ------------------
32033|    110|            if ((pos + 1 + 4) > bc_len)
  ------------------
  |  Branch (32033:17): [True: 0, False: 110]
  ------------------
32034|      0|                break; /* may happen if there is not enough memory when emiting bytecode */
32035|    110|            atom = get_u32(bc_buf + pos + 1);
32036|    110|            JS_FreeAtomRT(rt, atom);
32037|    110|            break;
32038|    832|        default:
  ------------------
  |  Branch (32038:9): [True: 832, False: 110]
  ------------------
32039|    832|            break;
32040|    942|        }
32041|    942|        pos += len;
32042|    942|    }
32043|     39|}
quickjs.c:__async_func_free:
20872|     16|{
20873|       |    /* cannot close the closure variables here because it would
20874|       |       potentially modify the object graph */
20875|     16|    if (!s->is_completed) {
  ------------------
  |  Branch (20875:9): [True: 0, False: 16]
  ------------------
20876|      0|        async_func_free_frame(rt, s);
20877|      0|    }
20878|       |
20879|     16|    JS_FreeValueRT(rt, s->resolving_funcs[0]);
20880|     16|    JS_FreeValueRT(rt, s->resolving_funcs[1]);
20881|       |
20882|     16|    remove_gc_object(&s->header);
20883|     16|    if (rt->gc_phase == JS_GC_PHASE_REMOVE_CYCLES && js_rc(s)->ref_count != 0) {
  ------------------
  |  Branch (20883:9): [True: 0, False: 16]
  |  Branch (20883:54): [True: 0, False: 0]
  ------------------
20884|      0|        list_add_tail(&s->header.link, &rt->gc_zero_ref_count_list);
20885|     16|    } else {
20886|     16|        js_free_rt(rt, s);
20887|     16|    }
20888|     16|}
quickjs.c:async_func_free_frame:
20821|     16|{
20822|     16|    JSStackFrame *sf = &s->frame;
20823|     16|    JSValue *sp;
20824|       |
20825|       |    /* cannot free the function if it is running */
20826|     16|    assert(sf->cur_sp != NULL);
  ------------------
  |  Branch (20826:5): [True: 0, False: 16]
  |  Branch (20826:5): [True: 16, False: 0]
  ------------------
20827|     32|    for(sp = sf->arg_buf; sp < sf->cur_sp; sp++) {
  ------------------
  |  Branch (20827:27): [True: 16, False: 16]
  ------------------
20828|     16|        JS_FreeValueRT(rt, *sp);
20829|     16|    }
20830|     16|    JS_FreeValueRT(rt, sf->cur_func);
20831|     16|    JS_FreeValueRT(rt, s->this_val);
20832|     16|}
quickjs.c:js_free_module_def:
29599|     51|{
29600|     51|    int i;
29601|       |
29602|     51|    JS_FreeAtomRT(rt, m->module_name);
29603|       |
29604|     85|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (29604:16): [True: 34, False: 51]
  ------------------
29605|     34|        JSReqModuleEntry *rme = &m->req_module_entries[i];
29606|     34|        JS_FreeAtomRT(rt, rme->module_name);
29607|     34|        JS_FreeValueRT(rt, rme->attributes);
29608|     34|    }
29609|     51|    js_free_rt(rt, m->req_module_entries);
29610|       |
29611|  1.71k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (29611:16): [True: 1.66k, False: 51]
  ------------------
29612|  1.66k|        JSExportEntry *me = &m->export_entries[i];
29613|  1.66k|        if (me->export_type == JS_EXPORT_TYPE_LOCAL)
  ------------------
  |  Branch (29613:13): [True: 1.66k, False: 0]
  ------------------
29614|  1.66k|            free_var_ref(rt, me->u.local.var_ref);
29615|  1.66k|        JS_FreeAtomRT(rt, me->export_name);
29616|  1.66k|        JS_FreeAtomRT(rt, me->local_name);
29617|  1.66k|    }
29618|     51|    js_free_rt(rt, m->export_entries);
29619|       |
29620|     51|    js_free_rt(rt, m->star_export_entries);
29621|       |
29622|     85|    for(i = 0; i < m->import_entries_count; i++) {
  ------------------
  |  Branch (29622:16): [True: 34, False: 51]
  ------------------
29623|     34|        JSImportEntry *mi = &m->import_entries[i];
29624|     34|        JS_FreeAtomRT(rt, mi->import_name);
29625|     34|    }
29626|     51|    js_free_rt(rt, m->import_entries);
29627|     51|    js_free_rt(rt, m->async_parent_modules);
29628|       |
29629|     51|    JS_FreeValueRT(rt, m->module_ns);
29630|     51|    JS_FreeValueRT(rt, m->func_obj);
29631|     51|    JS_FreeValueRT(rt, m->eval_exception);
29632|     51|    JS_FreeValueRT(rt, m->meta_obj);
29633|     51|    JS_FreeValueRT(rt, m->promise);
29634|     51|    JS_FreeValueRT(rt, m->resolving_funcs[0]);
29635|     51|    JS_FreeValueRT(rt, m->resolving_funcs[1]);
29636|     51|    JS_FreeValueRT(rt, m->private_value);
29637|       |    /* during the GC the finalizers are called in an arbitrary
29638|       |       order so the module may no longer be referenced by the JSContext list */
29639|     51|    if (m->link.next) {
  ------------------
  |  Branch (29639:9): [True: 51, False: 0]
  ------------------
29640|     51|        list_del(&m->link);
29641|     51|    }
29642|     51|    remove_gc_object(&m->header);
29643|     51|    if (rt->gc_phase == JS_GC_PHASE_REMOVE_CYCLES && js_rc(m)->ref_count != 0) {
  ------------------
  |  Branch (29643:9): [True: 51, False: 0]
  |  Branch (29643:54): [True: 51, False: 0]
  ------------------
29644|     51|        list_add_tail(&m->header.link, &rt->gc_zero_ref_count_list);
29645|     51|    } else {
29646|      0|        js_free_rt(rt, m);
29647|      0|    }
29648|     51|}
quickjs.c:add_gc_object:
 6542|  11.6k|{
 6543|  11.6k|    js_rc(h)->mark = 0;
 6544|  11.6k|    js_rc(h)->gc_obj_type = type;
 6545|  11.6k|    list_add_tail(&h->link, &rt->gc_obj_list);
 6546|  11.6k|}
quickjs.c:remove_gc_object:
 6549|  11.6k|{
 6550|  11.6k|    list_del(&h->link);
 6551|  11.6k|}
quickjs.c:JS_RunGCInternal:
 6816|     31|{
 6817|     31|    if (remove_weak_objects) {
  ------------------
  |  Branch (6817:9): [True: 14, False: 17]
  ------------------
 6818|       |        /* free the weakly referenced object or symbol structures, delete
 6819|       |           the associated Map/Set entries and queue the finalization
 6820|       |           registry callbacks. */
 6821|     14|        gc_remove_weak_objects(rt);
 6822|     14|    }
 6823|       |    
 6824|       |    /* decrement the reference of the children of each object. mark =
 6825|       |       1 after this pass. */
 6826|     31|    gc_decref(rt);
 6827|       |
 6828|       |    /* keep the GC objects with a non zero refcount and their childs */
 6829|     31|    gc_scan(rt);
 6830|       |
 6831|       |    /* free the GC objects in a cycle */
 6832|     31|    gc_free_cycles(rt);
 6833|     31|}
quickjs.c:gc_remove_weak_objects:
 6511|     14|{
 6512|     14|    struct list_head *el;
 6513|       |
 6514|       |    /* add the freed objects to rt->gc_zero_ref_count_list so that
 6515|       |       rt->weakref_list is not modified while we traverse it */
 6516|     14|    rt->gc_phase = JS_GC_PHASE_DECREF; 
 6517|       |        
 6518|     14|    list_for_each(el, &rt->weakref_list) {
  ------------------
  |  |   86|     14|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 0, False: 14]
  |  |  ------------------
  ------------------
 6519|      0|        JSWeakRefHeader *wh = list_entry(el, JSWeakRefHeader, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6520|      0|        switch(wh->weakref_type) {
 6521|      0|        case JS_WEAKREF_TYPE_MAP:
  ------------------
  |  Branch (6521:9): [True: 0, False: 0]
  ------------------
 6522|      0|            map_delete_weakrefs(rt, wh);
 6523|      0|            break;
 6524|      0|        case JS_WEAKREF_TYPE_WEAKREF:
  ------------------
  |  Branch (6524:9): [True: 0, False: 0]
  ------------------
 6525|      0|            weakref_delete_weakref(rt, wh);
 6526|      0|            break;
 6527|      0|        case JS_WEAKREF_TYPE_FINREC:
  ------------------
  |  Branch (6527:9): [True: 0, False: 0]
  ------------------
 6528|      0|            finrec_delete_weakref(rt, wh);
 6529|      0|            break;
 6530|      0|        default:
  ------------------
  |  Branch (6530:9): [True: 0, False: 0]
  ------------------
 6531|      0|            abort();
 6532|      0|        }
 6533|      0|    }
 6534|       |
 6535|     14|    rt->gc_phase = JS_GC_PHASE_NONE;
 6536|       |    /* free the freed objects here. */
 6537|     14|    free_zero_refcount(rt);
 6538|     14|}
quickjs.c:gc_decref:
 6698|     31|{
 6699|     31|    struct list_head *el, *el1;
 6700|     31|    JSGCObjectHeader *p;
 6701|       |
 6702|     31|    init_list_head(&rt->tmp_obj_list);
 6703|       |
 6704|       |    /* decrement the refcount of all the children of all the GC
 6705|       |       objects and move the GC objects with zero refcount to
 6706|       |       tmp_obj_list */
 6707|  16.1k|    list_for_each_safe(el, el1, &rt->gc_obj_list) {
  ------------------
  |  |   89|  16.1k|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 16.1k, False: 31]
  |  |  ------------------
  |  |   90|  16.1k|        el = el1, el1 = el->next)
  ------------------
 6708|  16.1k|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  16.1k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  16.1k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6709|  16.1k|        assert(js_rc(p)->mark == 0);
  ------------------
  |  Branch (6709:9): [True: 0, False: 16.1k]
  |  Branch (6709:9): [True: 16.1k, False: 0]
  ------------------
 6710|  16.1k|        mark_children(rt, p, gc_decref_child);
 6711|  16.1k|        js_rc(p)->mark = 1;
 6712|  16.1k|        if (js_rc(p)->ref_count == 0) {
  ------------------
  |  Branch (6712:13): [True: 8.42k, False: 7.69k]
  ------------------
 6713|  8.42k|            list_del(&p->link);
 6714|  8.42k|            list_add_tail(&p->link, &rt->tmp_obj_list);
 6715|  8.42k|        }
 6716|  16.1k|    }
 6717|     31|}
quickjs.c:mark_children:
 6570|  32.2k|{
 6571|  32.2k|    switch(js_rc(gp)->gc_obj_type) {
 6572|  14.4k|    case JS_GC_OBJ_TYPE_JS_OBJECT:
  ------------------
  |  Branch (6572:5): [True: 14.4k, False: 17.8k]
  ------------------
 6573|  14.4k|        {
 6574|  14.4k|            JSObject *p = (JSObject *)gp;
 6575|  14.4k|            JSShapeProperty *prs;
 6576|  14.4k|            JSShape *sh;
 6577|  14.4k|            int i;
 6578|  14.4k|            sh = p->shape;
 6579|  14.4k|            mark_func(rt, &sh->header);
 6580|       |            /* mark all the fields */
 6581|  14.4k|            prs = get_shape_prop(sh);
 6582|  84.3k|            for(i = 0; i < sh->prop_count; i++) {
  ------------------
  |  Branch (6582:24): [True: 69.9k, False: 14.4k]
  ------------------
 6583|  69.9k|                JSProperty *pr = &p->prop[i];
 6584|  69.9k|                if (prs->atom != JS_ATOM_NULL) {
  ------------------
  |  |  451|  69.9k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (6584:21): [True: 69.9k, False: 6]
  ------------------
 6585|  69.9k|                    if (prs->flags & JS_PROP_TMASK) {
  ------------------
  |  |  303|  69.9k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
  |  Branch (6585:25): [True: 38.4k, False: 31.4k]
  ------------------
 6586|  38.4k|                        if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|  38.4k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                      if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  305|  38.4k|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (6586:29): [True: 2.72k, False: 35.6k]
  ------------------
 6587|  2.72k|                            if (pr->u.getset.getter)
  ------------------
  |  Branch (6587:33): [True: 2.72k, False: 0]
  ------------------
 6588|  2.72k|                                mark_func(rt, &pr->u.getset.getter->header);
 6589|  2.72k|                            if (pr->u.getset.setter)
  ------------------
  |  Branch (6589:33): [True: 310, False: 2.41k]
  ------------------
 6590|    310|                                mark_func(rt, &pr->u.getset.setter->header);
 6591|  35.6k|                        } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  303|  35.6k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                      } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  306|  35.6k|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (6591:36): [True: 9.63k, False: 26.0k]
  ------------------
 6592|       |                            /* Note: the tag does not matter
 6593|       |                               provided it is a GC object */
 6594|  9.63k|                            mark_func(rt, &pr->u.var_ref->header);
 6595|  26.0k|                        } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  303|  26.0k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                      } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  307|  26.0k|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (6595:36): [True: 26.0k, False: 0]
  ------------------
 6596|  26.0k|                            js_autoinit_mark(rt, pr, mark_func);
 6597|  26.0k|                        }
 6598|  38.4k|                    } else {
 6599|  31.4k|                        JS_MarkValue(rt, pr->u.value, mark_func);
 6600|  31.4k|                    }
 6601|  69.9k|                }
 6602|  69.9k|                prs++;
 6603|  69.9k|            }
 6604|       |
 6605|  14.4k|            if (p->class_id != JS_CLASS_OBJECT) {
  ------------------
  |  Branch (6605:17): [True: 10.7k, False: 3.64k]
  ------------------
 6606|  10.7k|                JSClassGCMark *gc_mark;
 6607|  10.7k|                gc_mark = rt->class_array[p->class_id].gc_mark;
 6608|  10.7k|                if (gc_mark)
  ------------------
  |  Branch (6608:21): [True: 10.4k, False: 320]
  ------------------
 6609|  10.4k|                    gc_mark(rt, JS_MKPTR(JS_TAG_OBJECT, p), mark_func);
  ------------------
  |  |  248|  10.4k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6610|  10.7k|            }
 6611|  14.4k|        }
 6612|  14.4k|        break;
 6613|     80|    case JS_GC_OBJ_TYPE_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6613:5): [True: 80, False: 32.1k]
  ------------------
 6614|       |        /* the template objects can be part of a cycle */
 6615|     80|        {
 6616|     80|            JSFunctionBytecode *b = (JSFunctionBytecode *)gp;
 6617|     80|            int i;
 6618|    100|            for(i = 0; i < b->cpool_count; i++) {
  ------------------
  |  Branch (6618:24): [True: 20, False: 80]
  ------------------
 6619|     20|                JS_MarkValue(rt, b->cpool[i], mark_func);
 6620|     20|            }
 6621|     80|            if (b->realm)
  ------------------
  |  Branch (6621:17): [True: 80, False: 0]
  ------------------
 6622|     80|                mark_func(rt, &b->realm->header);
 6623|     80|        }
 6624|     80|        break;
 6625|  9.75k|    case JS_GC_OBJ_TYPE_VAR_REF:
  ------------------
  |  Branch (6625:5): [True: 9.75k, False: 22.4k]
  ------------------
 6626|  9.75k|        {
 6627|  9.75k|            JSVarRef *var_ref = (JSVarRef *)gp;
 6628|  9.75k|            if (var_ref->is_detached) {
  ------------------
  |  Branch (6628:17): [True: 9.75k, False: 0]
  ------------------
 6629|  9.75k|                JS_MarkValue(rt, *var_ref->pvalue, mark_func);
 6630|  9.75k|            } else {
 6631|      0|                JSStackFrame *sf = var_ref->stack_frame;
 6632|      0|                if (sf->js_mode & JS_MODE_ASYNC) {
  ------------------
  |  |  404|      0|#define JS_MODE_ASYNC  (1 << 2) /* async function */
  ------------------
  |  Branch (6632:21): [True: 0, False: 0]
  ------------------
 6633|      0|                    JSAsyncFunctionState *async_func = container_of(sf, JSAsyncFunctionState, frame);
  ------------------
  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 6634|      0|                    mark_func(rt, &async_func->header);
 6635|      0|                }
 6636|      0|            }
 6637|  9.75k|        }
 6638|  9.75k|        break;
 6639|      0|    case JS_GC_OBJ_TYPE_ASYNC_FUNCTION:
  ------------------
  |  Branch (6639:5): [True: 0, False: 32.2k]
  ------------------
 6640|      0|        {
 6641|      0|            JSAsyncFunctionState *s = (JSAsyncFunctionState *)gp;
 6642|      0|            JSStackFrame *sf = &s->frame;
 6643|      0|            JSValue *sp;
 6644|       |
 6645|      0|            if (!s->is_completed) {
  ------------------
  |  Branch (6645:17): [True: 0, False: 0]
  ------------------
 6646|      0|                JS_MarkValue(rt, sf->cur_func, mark_func);
 6647|      0|                JS_MarkValue(rt, s->this_val, mark_func);
 6648|       |                /* sf->cur_sp = NULL if the function is running */
 6649|      0|                if (sf->cur_sp) {
  ------------------
  |  Branch (6649:21): [True: 0, False: 0]
  ------------------
 6650|       |                    /* if the function is running, cur_sp is not known so we
 6651|       |                       cannot mark the stack. Marking the variables is not needed
 6652|       |                       because a running function cannot be part of a removable
 6653|       |                       cycle */
 6654|      0|                    for(sp = sf->arg_buf; sp < sf->cur_sp; sp++)
  ------------------
  |  Branch (6654:43): [True: 0, False: 0]
  ------------------
 6655|      0|                        JS_MarkValue(rt, *sp, mark_func);
 6656|      0|                }
 6657|      0|            }
 6658|      0|            JS_MarkValue(rt, s->resolving_funcs[0], mark_func);
 6659|      0|            JS_MarkValue(rt, s->resolving_funcs[1], mark_func);
 6660|      0|        }
 6661|      0|        break;
 6662|  7.71k|    case JS_GC_OBJ_TYPE_SHAPE:
  ------------------
  |  Branch (6662:5): [True: 7.71k, False: 24.5k]
  ------------------
 6663|  7.71k|        {
 6664|  7.71k|            JSShape *sh = (JSShape *)gp;
 6665|  7.71k|            if (sh->proto != NULL) {
  ------------------
  |  Branch (6665:17): [True: 7.40k, False: 310]
  ------------------
 6666|  7.40k|                mark_func(rt, &sh->proto->header);
 6667|  7.40k|            }
 6668|  7.71k|        }
 6669|  7.71k|        break;
 6670|     62|    case JS_GC_OBJ_TYPE_JS_CONTEXT:
  ------------------
  |  Branch (6670:5): [True: 62, False: 32.1k]
  ------------------
 6671|     62|        {
 6672|     62|            JSContext *ctx = (JSContext *)gp;
 6673|     62|            JS_MarkContext(rt, ctx, mark_func);
 6674|     62|        }
 6675|     62|        break;
 6676|    186|    case JS_GC_OBJ_TYPE_MODULE:
  ------------------
  |  Branch (6676:5): [True: 186, False: 32.0k]
  ------------------
 6677|    186|        {
 6678|    186|            JSModuleDef *m = (JSModuleDef *)gp;
 6679|    186|            js_mark_module_def(rt, m, mark_func);
 6680|    186|        }
 6681|    186|        break;
 6682|      0|    default:
  ------------------
  |  Branch (6682:5): [True: 0, False: 32.2k]
  ------------------
 6683|      0|        abort();
 6684|  32.2k|    }
 6685|  32.2k|}
quickjs.c:js_autoinit_mark:
 6093|  26.0k|{
 6094|  26.0k|    mark_func(rt, &js_autoinit_get_realm(pr)->header);
 6095|  26.0k|}
quickjs.c:JS_MarkContext:
 2719|     62|{
 2720|     62|    int i;
 2721|     62|    struct list_head *el;
 2722|       |
 2723|    186|    list_for_each(el, &ctx->loaded_modules) {
  ------------------
  |  |   86|    248|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 186, False: 62]
  |  |  ------------------
  ------------------
 2724|    186|        JSModuleDef *m = list_entry(el, JSModuleDef, link);
  ------------------
  |  |   39|    186|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|    186|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 2725|    186|        JS_MarkValue(rt, JS_MKPTR(JS_TAG_MODULE, m), mark_func);
  ------------------
  |  |  248|    186|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 2726|    186|    }
 2727|       |
 2728|     62|    JS_MarkValue(rt, ctx->global_obj, mark_func);
 2729|     62|    JS_MarkValue(rt, ctx->global_var_obj, mark_func);
 2730|       |
 2731|     62|    JS_MarkValue(rt, ctx->throw_type_error, mark_func);
 2732|     62|    JS_MarkValue(rt, ctx->eval_obj, mark_func);
 2733|       |
 2734|     62|    JS_MarkValue(rt, ctx->array_proto_values, mark_func);
 2735|    558|    for(i = 0; i < JS_NATIVE_ERROR_COUNT; i++) {
  ------------------
  |  Branch (2735:16): [True: 496, False: 62]
  ------------------
 2736|    496|        JS_MarkValue(rt, ctx->native_error_proto[i], mark_func);
 2737|    496|    }
 2738|  5.70k|    for(i = 0; i < rt->class_count; i++) {
  ------------------
  |  Branch (2738:16): [True: 5.64k, False: 62]
  ------------------
 2739|  5.64k|        JS_MarkValue(rt, ctx->class_proto[i], mark_func);
 2740|  5.64k|    }
 2741|     62|    JS_MarkValue(rt, ctx->iterator_ctor, mark_func);
 2742|     62|    JS_MarkValue(rt, ctx->async_iterator_proto, mark_func);
 2743|     62|    JS_MarkValue(rt, ctx->promise_ctor, mark_func);
 2744|     62|    JS_MarkValue(rt, ctx->array_ctor, mark_func);
 2745|     62|    JS_MarkValue(rt, ctx->regexp_ctor, mark_func);
 2746|     62|    JS_MarkValue(rt, ctx->function_ctor, mark_func);
 2747|     62|    JS_MarkValue(rt, ctx->function_proto, mark_func);
 2748|       |
 2749|     62|    if (ctx->array_shape)
  ------------------
  |  Branch (2749:9): [True: 62, False: 0]
  ------------------
 2750|     62|        mark_func(rt, &ctx->array_shape->header);
 2751|       |
 2752|     62|    if (ctx->arguments_shape)
  ------------------
  |  Branch (2752:9): [True: 62, False: 0]
  ------------------
 2753|     62|        mark_func(rt, &ctx->arguments_shape->header);
 2754|       |
 2755|     62|    if (ctx->mapped_arguments_shape)
  ------------------
  |  Branch (2755:9): [True: 62, False: 0]
  ------------------
 2756|     62|        mark_func(rt, &ctx->mapped_arguments_shape->header);
 2757|       |
 2758|     62|    if (ctx->regexp_shape)
  ------------------
  |  Branch (2758:9): [True: 62, False: 0]
  ------------------
 2759|     62|        mark_func(rt, &ctx->regexp_shape->header);
 2760|       |
 2761|     62|    if (ctx->regexp_result_shape)
  ------------------
  |  Branch (2761:9): [True: 62, False: 0]
  ------------------
 2762|     62|        mark_func(rt, &ctx->regexp_result_shape->header);
 2763|     62|}
quickjs.c:js_mark_module_def:
29572|    186|{
29573|    186|    int i;
29574|       |
29575|    310|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (29575:16): [True: 124, False: 186]
  ------------------
29576|    124|        JSReqModuleEntry *rme = &m->req_module_entries[i];
29577|    124|        JS_MarkValue(rt, rme->attributes, mark_func);
29578|    124|    }
29579|       |    
29580|  6.26k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (29580:16): [True: 6.07k, False: 186]
  ------------------
29581|  6.07k|        JSExportEntry *me = &m->export_entries[i];
29582|  6.07k|        if (me->export_type == JS_EXPORT_TYPE_LOCAL &&
  ------------------
  |  Branch (29582:13): [True: 6.07k, False: 0]
  ------------------
29583|  6.07k|            me->u.local.var_ref) {
  ------------------
  |  Branch (29583:13): [True: 6.07k, False: 0]
  ------------------
29584|  6.07k|            mark_func(rt, &me->u.local.var_ref->header);
29585|  6.07k|        }
29586|  6.07k|    }
29587|       |
29588|    186|    JS_MarkValue(rt, m->module_ns, mark_func);
29589|    186|    JS_MarkValue(rt, m->func_obj, mark_func);
29590|    186|    JS_MarkValue(rt, m->eval_exception, mark_func);
29591|    186|    JS_MarkValue(rt, m->meta_obj, mark_func);
29592|    186|    JS_MarkValue(rt, m->promise, mark_func);
29593|    186|    JS_MarkValue(rt, m->resolving_funcs[0], mark_func);
29594|    186|    JS_MarkValue(rt, m->resolving_funcs[1], mark_func);
29595|    186|    JS_MarkValue(rt, m->private_value, mark_func);
29596|    186|}
quickjs.c:gc_decref_child:
 6688|  48.0k|{
 6689|  48.0k|    assert(js_rc(p)->ref_count > 0);
  ------------------
  |  Branch (6689:5): [True: 0, False: 48.0k]
  |  Branch (6689:5): [True: 48.0k, False: 0]
  ------------------
 6690|  48.0k|    js_rc(p)->ref_count--;
 6691|  48.0k|    if (js_rc(p)->ref_count == 0 && js_rc(p)->mark == 1) {
  ------------------
  |  Branch (6691:9): [True: 16.0k, False: 32.0k]
  |  Branch (6691:37): [True: 7.63k, False: 8.42k]
  ------------------
 6692|  7.63k|        list_del(&p->link);
 6693|  7.63k|        list_add_tail(&p->link, &rt->tmp_obj_list);
 6694|  7.63k|    }
 6695|  48.0k|}
quickjs.c:gc_scan:
 6737|     31|{
 6738|     31|    struct list_head *el;
 6739|     31|    JSGCObjectHeader *p;
 6740|       |
 6741|       |    /* keep the objects with a refcount > 0 and their children. */
 6742|  7.25k|    list_for_each(el, &rt->gc_obj_list) {
  ------------------
  |  |   86|  7.29k|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 7.25k, False: 31]
  |  |  ------------------
  ------------------
 6743|  7.25k|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  7.25k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  7.25k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6744|  7.25k|        assert(js_rc(p)->ref_count > 0);
  ------------------
  |  Branch (6744:9): [True: 0, False: 7.25k]
  |  Branch (6744:9): [True: 7.25k, False: 0]
  ------------------
 6745|  7.25k|        js_rc(p)->mark = 0; /* reset the mark for the next GC call */
 6746|  7.25k|        mark_children(rt, p, gc_scan_incref_child);
 6747|  7.25k|    }
 6748|       |
 6749|       |    /* restore the refcount of the objects to be deleted. */
 6750|  8.85k|    list_for_each(el, &rt->tmp_obj_list) {
  ------------------
  |  |   86|  8.89k|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 8.85k, False: 31]
  |  |  ------------------
  ------------------
 6751|       |        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  8.85k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  8.85k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6752|  8.85k|        mark_children(rt, p, gc_scan_incref_child2);
 6753|  8.85k|    }
 6754|     31|}
quickjs.c:gc_scan_incref_child:
 6720|  21.6k|{
 6721|  21.6k|    js_rc(p)->ref_count++;
 6722|  21.6k|    if (js_rc(p)->ref_count == 1) {
  ------------------
  |  Branch (6722:9): [True: 7.20k, False: 14.4k]
  ------------------
 6723|       |        /* ref_count was 0: remove from tmp_obj_list and add at the
 6724|       |           end of gc_obj_list */
 6725|  7.20k|        list_del(&p->link);
 6726|  7.20k|        list_add_tail(&p->link, &rt->gc_obj_list);
 6727|  7.20k|        js_rc(p)->mark = 0; /* reset the mark for the next GC call */
 6728|  7.20k|    }
 6729|  21.6k|}
quickjs.c:gc_scan_incref_child2:
 6732|  26.4k|{
 6733|  26.4k|    js_rc(p)->ref_count++;
 6734|  26.4k|}
quickjs.c:gc_free_cycles:
 6757|     31|{
 6758|     31|    struct list_head *el, *el1;
 6759|     31|    JSGCObjectHeader *p;
 6760|       |#ifdef DUMP_GC_FREE
 6761|       |    BOOL header_done = FALSE;
 6762|       |#endif
 6763|       |
 6764|     31|    rt->gc_phase = JS_GC_PHASE_REMOVE_CYCLES;
 6765|       |
 6766|  7.61k|    for(;;) {
 6767|  7.61k|        el = rt->tmp_obj_list.next;
 6768|  7.61k|        if (el == &rt->tmp_obj_list)
  ------------------
  |  Branch (6768:13): [True: 31, False: 7.58k]
  ------------------
 6769|     31|            break;
 6770|  7.58k|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  7.58k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  7.58k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6771|       |        /* Only need to free the GC object associated with JS values
 6772|       |           or async functions. The rest will be automatically removed
 6773|       |           because they must be referenced by them. */
 6774|  7.58k|        switch(js_rc(p)->gc_obj_type) {
 6775|  3.98k|        case JS_GC_OBJ_TYPE_JS_OBJECT:
  ------------------
  |  Branch (6775:9): [True: 3.98k, False: 3.59k]
  ------------------
 6776|  4.00k|        case JS_GC_OBJ_TYPE_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6776:9): [True: 18, False: 7.56k]
  ------------------
 6777|  4.00k|        case JS_GC_OBJ_TYPE_ASYNC_FUNCTION:
  ------------------
  |  Branch (6777:9): [True: 0, False: 7.58k]
  ------------------
 6778|  4.05k|        case JS_GC_OBJ_TYPE_MODULE:
  ------------------
  |  Branch (6778:9): [True: 51, False: 7.52k]
  ------------------
 6779|       |#ifdef DUMP_GC_FREE
 6780|       |            if (!header_done) {
 6781|       |                printf("Freeing cycles:\n");
 6782|       |                JS_DumpObjectHeader(rt);
 6783|       |                header_done = TRUE;
 6784|       |            }
 6785|       |            JS_DumpGCObject(rt, p);
 6786|       |#endif
 6787|  4.05k|            free_gc_object(rt, p);
 6788|  4.05k|            break;
 6789|  3.52k|        default:
  ------------------
  |  Branch (6789:9): [True: 3.52k, False: 4.05k]
  ------------------
 6790|  3.52k|            list_del(&p->link);
 6791|  3.52k|            list_add_tail(&p->link, &rt->gc_zero_ref_count_list);
 6792|  3.52k|            break;
 6793|  7.58k|        }
 6794|  7.58k|    }
 6795|     31|    rt->gc_phase = JS_GC_PHASE_NONE;
 6796|       |
 6797|  3.07k|    list_for_each_safe(el, el1, &rt->gc_zero_ref_count_list) {
  ------------------
  |  |   89|  3.10k|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 3.07k, False: 31]
  |  |  ------------------
  |  |   90|  3.07k|        el = el1, el1 = el->next)
  ------------------
 6798|  3.07k|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  3.07k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  3.07k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6799|  3.07k|        assert(js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_JS_OBJECT ||
  ------------------
  |  Branch (6799:9): [True: 3.07k, False: 0]
  |  Branch (6799:9): [True: 0, False: 0]
  |  Branch (6799:9): [True: 0, False: 0]
  |  Branch (6799:9): [True: 0, False: 0]
  |  Branch (6799:9): [True: 3.01k, False: 60]
  |  Branch (6799:9): [True: 9, False: 51]
  |  Branch (6799:9): [True: 0, False: 51]
  |  Branch (6799:9): [True: 51, False: 0]
  ------------------
 6800|  3.07k|               js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_FUNCTION_BYTECODE ||
 6801|  3.07k|               js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_ASYNC_FUNCTION ||
 6802|  3.07k|               js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_MODULE);
 6803|  3.07k|        if (js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_JS_OBJECT &&
  ------------------
  |  Branch (6803:13): [True: 3.01k, False: 60]
  ------------------
 6804|  3.01k|            ((JSObject *)p)->weakref_count != 0) {
  ------------------
  |  Branch (6804:13): [True: 0, False: 3.01k]
  ------------------
 6805|       |            /* keep the object because there are weak references to it */
 6806|      0|            js_rc(p)->mark = 0;
 6807|  3.07k|        } else {
 6808|  3.07k|            js_free_rt(rt, p);
 6809|  3.07k|        }
 6810|  3.07k|    }
 6811|       |
 6812|     31|    init_list_head(&rt->gc_zero_ref_count_list);
 6813|     31|}
quickjs.c:get_shape_size:
 5122|  4.72k|{
 5123|  4.72k|    return sizeof(JSShape) + hash_size * sizeof(uint32_t) +
 5124|  4.72k|        prop_size * sizeof(JSShapeProperty);
 5125|  4.72k|}
quickjs.c:get_shape_prop:
 5128|  4.79M|{
 5129|  4.79M|    return (JSShapeProperty *)((uint32_t *)(sh + 1) + sh->prop_hash_mask + 1);
 5130|  4.79M|}
quickjs.c:JS_AtomGetStrRT:
 3546|    417|{
 3547|    417|    if (__JS_AtomIsTaggedInt(atom)) {
  ------------------
  |  Branch (3547:9): [True: 0, False: 417]
  ------------------
 3548|      0|        snprintf(buf, buf_size, "%u", __JS_AtomToUInt32(atom));
 3549|    417|    } else {
 3550|    417|        JSAtomStruct *p;
 3551|    417|        assert(atom < rt->atom_size);
  ------------------
  |  Branch (3551:9): [True: 0, False: 417]
  |  Branch (3551:9): [True: 417, False: 0]
  ------------------
 3552|    417|        if (atom == JS_ATOM_NULL) {
  ------------------
  |  |  451|    417|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (3552:13): [True: 0, False: 417]
  ------------------
 3553|      0|            snprintf(buf, buf_size, "<null>");
 3554|    417|        } else {
 3555|    417|            int i, c;
 3556|    417|            char *q;
 3557|    417|            JSString *str;
 3558|       |
 3559|    417|            q = buf;
 3560|    417|            p = rt->atom_array[atom];
 3561|    417|            assert(!atom_is_free(p));
  ------------------
  |  Branch (3561:13): [True: 0, False: 417]
  |  Branch (3561:13): [True: 417, False: 0]
  ------------------
 3562|    417|            str = p;
 3563|    417|            if (str) {
  ------------------
  |  Branch (3563:17): [True: 417, False: 0]
  ------------------
 3564|    417|                if (!str->is_wide_char) {
  ------------------
  |  Branch (3564:21): [True: 415, False: 2]
  ------------------
 3565|       |                    /* special case ASCII strings */
 3566|    415|                    c = 0;
 3567|  4.66k|                    for(i = 0; i < str->len; i++) {
  ------------------
  |  Branch (3567:32): [True: 4.25k, False: 415]
  ------------------
 3568|  4.25k|                        c |= str->u.str8[i];
 3569|  4.25k|                    }
 3570|    415|                    if (c < 0x80)
  ------------------
  |  Branch (3570:25): [True: 415, False: 0]
  ------------------
 3571|    415|                        return (const char *)str->u.str8;
 3572|    415|                }
 3573|    118|                for(i = 0; i < str->len; i++) {
  ------------------
  |  Branch (3573:28): [True: 118, False: 0]
  ------------------
 3574|    118|                    c = string_get(str, i);
 3575|    118|                    if ((q - buf) >= buf_size - UTF8_CHAR_LEN_MAX)
  ------------------
  |  |  330|    118|#define UTF8_CHAR_LEN_MAX 6
  ------------------
  |  Branch (3575:25): [True: 2, False: 116]
  ------------------
 3576|      2|                        break;
 3577|    116|                    if (c < 128) {
  ------------------
  |  Branch (3577:25): [True: 116, False: 0]
  ------------------
 3578|    116|                        *q++ = c;
 3579|    116|                    } else {
 3580|      0|                        q += unicode_to_utf8((uint8_t *)q, c);
 3581|      0|                    }
 3582|    116|                }
 3583|      2|            }
 3584|      2|            *q = '\0';
 3585|      2|        }
 3586|    417|    }
 3587|      2|    return buf;
 3588|    417|}
quickjs.c:JS_ThrowError:
 7664|     28|{
 7665|     28|    JSRuntime *rt = ctx->rt;
 7666|     28|    JSStackFrame *sf;
 7667|     28|    BOOL add_backtrace;
 7668|       |
 7669|       |    /* the backtrace is added later if called from a bytecode function */
 7670|     28|    sf = rt->current_stack_frame;
 7671|     28|    add_backtrace = !rt->in_out_of_memory &&
  ------------------
  |  Branch (7671:21): [True: 28, False: 0]
  ------------------
 7672|     28|        (!sf || (JS_GetFunctionBytecode(sf->cur_func) == NULL));
  ------------------
  |  Branch (7672:10): [True: 18, False: 10]
  |  Branch (7672:17): [True: 1, False: 9]
  ------------------
 7673|     28|    return JS_ThrowError2(ctx, error_num, fmt, ap, add_backtrace);
 7674|     28|}
quickjs.c:JS_GetFunctionBytecode:
 5873|     10|{
 5874|     10|    JSObject *p;
 5875|     10|    if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|     10|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5875:9): [True: 0, False: 10]
  ------------------
 5876|      0|        return NULL;
 5877|     10|    p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|     10|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     10|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5878|     10|    if (!js_class_has_bytecode(p->class_id))
  ------------------
  |  Branch (5878:9): [True: 1, False: 9]
  ------------------
 5879|      1|        return NULL;
 5880|      9|    return p->u.func.function_bytecode;
 5881|     10|}
quickjs.c:JS_ThrowError2:
 7640|     33|{
 7641|     33|    char buf[256];
 7642|     33|    JSValue obj, ret;
 7643|       |
 7644|     33|    vsnprintf(buf, sizeof(buf), fmt, ap);
 7645|     33|    obj = JS_NewObjectProtoClass(ctx, ctx->native_error_proto[error_num],
 7646|     33|                                 JS_CLASS_ERROR);
 7647|     33|    if (unlikely(JS_IsException(obj))) {
  ------------------
  |  |   33|     33|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 33]
  |  |  ------------------
  ------------------
 7648|       |        /* out of memory: throw JS_NULL to avoid recursing */
 7649|      0|        obj = JS_NULL;
  ------------------
  |  |  290|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 7650|     33|    } else {
 7651|     33|        JS_DefinePropertyValue(ctx, obj, JS_ATOM_message,
 7652|     33|                               JS_NewString(ctx, buf),
 7653|     33|                               JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  299|     33|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                             JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|     33|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7654|     33|        if (add_backtrace) {
  ------------------
  |  Branch (7654:13): [True: 19, False: 14]
  ------------------
 7655|       |            build_backtrace(ctx, obj, NULL, 0, 0, 0);
 7656|     19|        }
 7657|     33|    }
 7658|     33|    ret = JS_Throw(ctx, obj);
 7659|     33|    return ret;
 7660|     33|}
quickjs.c:build_backtrace:
 7541|     33|{
 7542|     33|    JSStackFrame *sf;
 7543|     33|    JSValue str;
 7544|     33|    DynBuf dbuf;
 7545|     33|    const char *func_name_str;
 7546|     33|    const char *str1;
 7547|     33|    JSObject *p;
 7548|       |
 7549|     33|    if (!JS_IsObject(error_obj))
  ------------------
  |  Branch (7549:9): [True: 0, False: 33]
  ------------------
 7550|      0|        return; /* protection in the out of memory case */
 7551|       |    
 7552|     33|    js_dbuf_init(ctx, &dbuf);
 7553|     33|    if (filename) {
  ------------------
  |  Branch (7553:9): [True: 5, False: 28]
  ------------------
 7554|      5|        dbuf_printf(&dbuf, "    at %s", filename);
 7555|      5|        if (line_num != -1)
  ------------------
  |  Branch (7555:13): [True: 5, False: 0]
  ------------------
 7556|      5|            dbuf_printf(&dbuf, ":%d:%d", line_num, col_num);
 7557|      5|        dbuf_putc(&dbuf, '\n');
 7558|      5|        str = JS_NewString(ctx, filename);
 7559|      5|        if (JS_IsException(str))
  ------------------
  |  Branch (7559:13): [True: 0, False: 5]
  ------------------
 7560|      0|            return;
 7561|       |        /* Note: SpiderMonkey does that, could update once there is a standard */
 7562|      5|        if (JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_fileName, str,
  ------------------
  |  Branch (7562:13): [True: 0, False: 5]
  ------------------
 7563|      5|                                   JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0 ||
  ------------------
  |  |  299|      5|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                 JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0 ||
  ------------------
  |  |  298|      5|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7564|      5|            JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_lineNumber, JS_NewInt32(ctx, line_num),
  ------------------
  |  Branch (7564:13): [True: 0, False: 5]
  ------------------
 7565|      5|                                   JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0 ||
  ------------------
  |  |  299|      5|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                 JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0 ||
  ------------------
  |  |  298|      5|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7566|      5|            JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_columnNumber, JS_NewInt32(ctx, col_num),
  ------------------
  |  Branch (7566:13): [True: 0, False: 5]
  ------------------
 7567|      5|                                   JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  299|      5|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                 JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  298|      5|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7568|      0|            return;
 7569|      0|        }
 7570|      5|    }
 7571|     46|    for(sf = ctx->rt->current_stack_frame; sf != NULL; sf = sf->prev_frame) {
  ------------------
  |  Branch (7571:44): [True: 13, False: 33]
  ------------------
 7572|     13|        if (sf->js_mode & JS_MODE_BACKTRACE_BARRIER)
  ------------------
  |  |  405|     13|#define JS_MODE_BACKTRACE_BARRIER (1 << 3) /* stop backtrace before this frame */
  ------------------
  |  Branch (7572:13): [True: 0, False: 13]
  ------------------
 7573|      0|            break;
 7574|     13|        if (backtrace_flags & JS_BACKTRACE_FLAG_SKIP_FIRST_LEVEL) {
  ------------------
  |  | 7534|     13|#define JS_BACKTRACE_FLAG_SKIP_FIRST_LEVEL (1 << 0)
  ------------------
  |  Branch (7574:13): [True: 0, False: 13]
  ------------------
 7575|      0|            backtrace_flags &= ~JS_BACKTRACE_FLAG_SKIP_FIRST_LEVEL;
  ------------------
  |  | 7534|      0|#define JS_BACKTRACE_FLAG_SKIP_FIRST_LEVEL (1 << 0)
  ------------------
 7576|      0|            continue;
 7577|      0|        }
 7578|     13|        func_name_str = get_prop_string(ctx, sf->cur_func, JS_ATOM_name);
 7579|     13|        if (!func_name_str || func_name_str[0] == '\0')
  ------------------
  |  Branch (7579:13): [True: 0, False: 13]
  |  Branch (7579:31): [True: 0, False: 13]
  ------------------
 7580|      0|            str1 = "<anonymous>";
 7581|     13|        else
 7582|     13|            str1 = func_name_str;
 7583|     13|        dbuf_printf(&dbuf, "    at %s", str1);
 7584|     13|        JS_FreeCString(ctx, func_name_str);
 7585|       |
 7586|     13|        p = JS_VALUE_GET_OBJ(sf->cur_func);
  ------------------
  |  |  229|     13|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     13|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 7587|     13|        if (js_class_has_bytecode(p->class_id)) {
  ------------------
  |  Branch (7587:13): [True: 11, False: 2]
  ------------------
 7588|     11|            JSFunctionBytecode *b;
 7589|     11|            const char *atom_str;
 7590|     11|            int line_num1, col_num1;
 7591|       |
 7592|     11|            b = p->u.func.function_bytecode;
 7593|     11|            if (b->has_debug) {
  ------------------
  |  Branch (7593:17): [True: 11, False: 0]
  ------------------
 7594|     11|                line_num1 = find_line_num(ctx, b,
 7595|     11|                                          sf->cur_pc - b->byte_code_buf - 1, &col_num1);
 7596|     11|                atom_str = JS_AtomToCString(ctx, b->debug.filename);
 7597|     11|                dbuf_printf(&dbuf, " (%s",
 7598|     11|                            atom_str ? atom_str : "<null>");
  ------------------
  |  Branch (7598:29): [True: 11, False: 0]
  ------------------
 7599|     11|                JS_FreeCString(ctx, atom_str);
 7600|     11|                if (line_num1 != 0)
  ------------------
  |  Branch (7600:21): [True: 11, False: 0]
  ------------------
 7601|     11|                    dbuf_printf(&dbuf, ":%d:%d", line_num1, col_num1);
 7602|     11|                dbuf_putc(&dbuf, ')');
 7603|     11|            }
 7604|     11|        } else {
 7605|      2|            dbuf_printf(&dbuf, " (native)");
 7606|      2|        }
 7607|     13|        dbuf_putc(&dbuf, '\n');
 7608|     13|    }
 7609|     33|    dbuf_putc(&dbuf, '\0');
 7610|     33|    if (dbuf_error(&dbuf))
  ------------------
  |  Branch (7610:9): [True: 0, False: 33]
  ------------------
 7611|      0|        str = JS_NULL;
  ------------------
  |  |  290|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 7612|     33|    else
 7613|     33|        str = JS_NewString(ctx, (char *)dbuf.buf);
 7614|     33|    dbuf_free(&dbuf);
 7615|     33|    JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_stack, str,
 7616|     33|                           JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  299|     33|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|     33|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7617|     33|}
quickjs.c:get_prop_string:
 7505|     13|{
 7506|     13|    JSObject *p;
 7507|     13|    JSProperty *pr;
 7508|     13|    JSShapeProperty *prs;
 7509|     13|    JSValueConst val;
  ------------------
  |  |  234|     13|#define JSValueConst JSValue
  ------------------
 7510|       |
 7511|     13|    if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|     13|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (7511:9): [True: 0, False: 13]
  ------------------
 7512|      0|        return NULL;
 7513|     13|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|     13|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     13|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 7514|     13|    prs = find_own_property(&pr, p, prop);
 7515|     13|    if (!prs) {
  ------------------
  |  Branch (7515:9): [True: 0, False: 13]
  ------------------
 7516|       |        /* we look at one level in the prototype to handle the 'name'
 7517|       |           field of the Error objects */
 7518|      0|        p = p->shape->proto;
 7519|      0|        if (!p)
  ------------------
  |  Branch (7519:13): [True: 0, False: 0]
  ------------------
 7520|      0|            return NULL;
 7521|      0|        prs = find_own_property(&pr, p, prop);
 7522|      0|        if (!prs)
  ------------------
  |  Branch (7522:13): [True: 0, False: 0]
  ------------------
 7523|      0|            return NULL;
 7524|      0|    }
 7525|       |    
 7526|     13|    if ((prs->flags & JS_PROP_TMASK) != JS_PROP_NORMAL)
  ------------------
  |  |  303|     13|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                  if ((prs->flags & JS_PROP_TMASK) != JS_PROP_NORMAL)
  ------------------
  |  |  304|     13|#define JS_PROP_NORMAL         (0 << 4)
  ------------------
  |  Branch (7526:9): [True: 0, False: 13]
  ------------------
 7527|      0|        return NULL;
 7528|     13|    val = pr->u.value;
 7529|     13|    if (JS_VALUE_GET_TAG(val) != JS_TAG_STRING)
  ------------------
  |  |  236|     13|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (7529:9): [True: 0, False: 13]
  ------------------
 7530|      0|        return NULL;
 7531|     13|    return JS_ToCString(ctx, val);
 7532|     13|}
quickjs.c:find_line_num:
 7437|     11|{
 7438|     11|    const uint8_t *p_end, *p;
 7439|     11|    int new_line_num, line_num, pc, v, ret, new_col_num, col_num;
 7440|     11|    uint32_t val;
 7441|     11|    unsigned int op;
 7442|       |
 7443|     11|    if (!b->has_debug || !b->debug.pc2line_buf)
  ------------------
  |  Branch (7443:9): [True: 0, False: 11]
  |  Branch (7443:26): [True: 0, False: 11]
  ------------------
 7444|      0|        goto fail; /* function was stripped */
 7445|       |
 7446|     11|    p = b->debug.pc2line_buf;
 7447|     11|    p_end = p + b->debug.pc2line_len;
 7448|       |
 7449|       |    /* get the function line and column numbers */
 7450|     11|    ret = get_leb128(&val, p, p_end);
 7451|     11|    if (ret < 0)
  ------------------
  |  Branch (7451:9): [True: 0, False: 11]
  ------------------
 7452|      0|        goto fail;
 7453|     11|    p += ret;
 7454|     11|    line_num = val + 1;
 7455|       |
 7456|     11|    ret = get_leb128(&val, p, p_end);
 7457|     11|    if (ret < 0)
  ------------------
  |  Branch (7457:9): [True: 0, False: 11]
  ------------------
 7458|      0|        goto fail;
 7459|     11|    p += ret;
 7460|     11|    col_num = val + 1;
 7461|       |
 7462|     11|    if (pc_value != -1) {
  ------------------
  |  Branch (7462:9): [True: 11, False: 0]
  ------------------
 7463|     11|        pc = 0;
 7464|     48|        while (p < p_end) {
  ------------------
  |  Branch (7464:16): [True: 43, False: 5]
  ------------------
 7465|     43|            op = *p++;
 7466|     43|            if (op == 0) {
  ------------------
  |  Branch (7466:17): [True: 12, False: 31]
  ------------------
 7467|     12|                ret = get_leb128(&val, p, p_end);
 7468|     12|                if (ret < 0)
  ------------------
  |  Branch (7468:21): [True: 0, False: 12]
  ------------------
 7469|      0|                    goto fail;
 7470|     12|                pc += val;
 7471|     12|                p += ret;
 7472|     12|                ret = get_sleb128(&v, p, p_end);
 7473|     12|                if (ret < 0)
  ------------------
  |  Branch (7473:21): [True: 0, False: 12]
  ------------------
 7474|      0|                    goto fail;
 7475|     12|                p += ret;
 7476|     12|                new_line_num = line_num + v;
 7477|     31|            } else {
 7478|     31|                op -= PC2LINE_OP_FIRST;
  ------------------
  |  |  675|     31|#define PC2LINE_OP_FIRST 1
  ------------------
 7479|     31|                pc += (op / PC2LINE_RANGE);
  ------------------
  |  |  674|     31|#define PC2LINE_RANGE    5
  ------------------
 7480|     31|                new_line_num = line_num + (op % PC2LINE_RANGE) + PC2LINE_BASE;
  ------------------
  |  |  674|     31|#define PC2LINE_RANGE    5
  ------------------
                              new_line_num = line_num + (op % PC2LINE_RANGE) + PC2LINE_BASE;
  ------------------
  |  |  673|     31|#define PC2LINE_BASE     (-1)
  ------------------
 7481|     31|            }
 7482|     43|            ret = get_sleb128(&v, p, p_end);
 7483|     43|            if (ret < 0)
  ------------------
  |  Branch (7483:17): [True: 0, False: 43]
  ------------------
 7484|      0|                goto fail;
 7485|     43|            p += ret;
 7486|     43|            new_col_num = col_num + v;
 7487|       |            
 7488|     43|            if (pc_value < pc)
  ------------------
  |  Branch (7488:17): [True: 6, False: 37]
  ------------------
 7489|      6|                goto done;
 7490|     37|            line_num = new_line_num;
 7491|     37|            col_num = new_col_num;
 7492|     37|        }
 7493|     11|    }
 7494|     11| done:
 7495|     11|    *pcol_num = col_num;
 7496|     11|    return line_num;
 7497|      0| fail:
 7498|      0|    *pcol_num = 0;
 7499|      0|    return 0;
 7500|     11|}
quickjs.c:get_leb128:
 7402|     89|{
 7403|     89|    const uint8_t *ptr = buf;
 7404|     89|    uint32_t v, a, i;
 7405|     89|    v = 0;
 7406|    111|    for(i = 0; i < 5; i++) {
  ------------------
  |  Branch (7406:16): [True: 111, False: 0]
  ------------------
 7407|    111|        if (unlikely(ptr >= buf_end))
  ------------------
  |  |   33|    111|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 111]
  |  |  ------------------
  ------------------
 7408|      0|            break;
 7409|    111|        a = *ptr++;
 7410|    111|        v |= (a & 0x7f) << (i * 7);
 7411|    111|        if (!(a & 0x80)) {
  ------------------
  |  Branch (7411:13): [True: 89, False: 22]
  ------------------
 7412|     89|            *pval = v;
 7413|     89|            return ptr - buf;
 7414|     89|        }
 7415|    111|    }
 7416|      0|    *pval = 0;
 7417|      0|    return -1;
 7418|     89|}
quickjs.c:get_sleb128:
 7422|     55|{
 7423|     55|    int ret;
 7424|     55|    uint32_t val;
 7425|     55|    ret = get_leb128(&val, buf, buf_end);
 7426|     55|    if (ret < 0) {
  ------------------
  |  Branch (7426:9): [True: 0, False: 55]
  ------------------
 7427|      0|        *pval = 0;
 7428|      0|        return -1;
 7429|      0|    }
 7430|     55|    *pval = (val >> 1) ^ -(val & 1);
 7431|     55|    return ret;
 7432|     55|}
quickjs.c:JS_GetPrototypePrimitive:
 7996|      5|{
 7997|      5|    switch(JS_VALUE_GET_NORM_TAG(val)) {
  ------------------
  |  |  238|      5|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      5|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
 7998|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (7998:5): [True: 0, False: 5]
  ------------------
 7999|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (7999:5): [True: 0, False: 5]
  ------------------
 8000|      0|        val = ctx->class_proto[JS_CLASS_BIG_INT];
 8001|      0|        break;
 8002|      0|    case JS_TAG_INT:
  ------------------
  |  Branch (8002:5): [True: 0, False: 5]
  ------------------
 8003|      0|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (8003:5): [True: 0, False: 5]
  ------------------
 8004|      0|        val = ctx->class_proto[JS_CLASS_NUMBER];
 8005|      0|        break;
 8006|      0|    case JS_TAG_BOOL:
  ------------------
  |  Branch (8006:5): [True: 0, False: 5]
  ------------------
 8007|      0|        val = ctx->class_proto[JS_CLASS_BOOLEAN];
 8008|      0|        break;
 8009|      5|    case JS_TAG_STRING:
  ------------------
  |  Branch (8009:5): [True: 5, False: 0]
  ------------------
 8010|      5|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (8010:5): [True: 0, False: 5]
  ------------------
 8011|      5|        val = ctx->class_proto[JS_CLASS_STRING];
 8012|      5|        break;
 8013|      0|    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (8013:5): [True: 0, False: 5]
  ------------------
 8014|      0|        val = ctx->class_proto[JS_CLASS_SYMBOL];
 8015|      0|        break;
 8016|      0|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (8016:5): [True: 0, False: 5]
  ------------------
 8017|      0|    case JS_TAG_NULL:
  ------------------
  |  Branch (8017:5): [True: 0, False: 5]
  ------------------
 8018|      0|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (8018:5): [True: 0, False: 5]
  ------------------
 8019|      0|    default:
  ------------------
  |  Branch (8019:5): [True: 0, False: 5]
  ------------------
 8020|      0|        val = JS_NULL;
  ------------------
  |  |  290|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8021|      0|        break;
 8022|      5|    }
 8023|      5|    return val;
 8024|      5|}
quickjs.c:JS_GetPrototypeFree:
 8051|      6|{
 8052|      6|    JSValue obj1;
 8053|      6|    obj1 = JS_GetPrototype(ctx, obj);
 8054|      6|    JS_FreeValue(ctx, obj);
 8055|      6|    return obj1;
 8056|      6|}
quickjs.c:js_poll_interrupts:
 7878|  1.01M|{
 7879|  1.01M|    if (unlikely(--ctx->interrupt_counter <= 0)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 118, False: 1.01M]
  |  |  ------------------
  ------------------
 7880|    118|        return __js_poll_interrupts(ctx);
 7881|  1.01M|    } else {
 7882|  1.01M|        return 0;
 7883|  1.01M|    }
 7884|  1.01M|}
quickjs.c:__js_poll_interrupts:
 7865|    118|{
 7866|    118|    JSRuntime *rt = ctx->rt;
 7867|    118|    ctx->interrupt_counter = JS_INTERRUPT_COUNTER_INIT;
  ------------------
  |  |  512|    118|#define JS_INTERRUPT_COUNTER_INIT 10000
  ------------------
 7868|    118|    if (rt->interrupt_handler) {
  ------------------
  |  Branch (7868:9): [True: 118, False: 0]
  ------------------
 7869|    118|        if (rt->interrupt_handler(rt, rt->interrupt_opaque)) {
  ------------------
  |  Branch (7869:13): [True: 2, False: 116]
  ------------------
 7870|      2|            JS_ThrowInterrupted(ctx);
 7871|      2|            return -1;
 7872|      2|        }
 7873|    118|    }
 7874|    116|    return 0;
 7875|    118|}
quickjs.c:JS_ThrowInterrupted:
 7859|      2|{
 7860|      2|    JS_ThrowInternalError(ctx, "interrupted");
 7861|      2|    JS_SetUncatchableException(ctx, TRUE);
 7862|      2|}
quickjs.c:__JS_AtomIsTaggedInt:
 2887|   997k|{
 2888|   997k|    return (v & JS_ATOM_TAG_INT) != 0;
  ------------------
  |  | 2870|   997k|#define JS_ATOM_TAG_INT (1U << 31)
  ------------------
 2889|   997k|}
quickjs.c:__JS_AtomToUInt32:
 2897|   686k|{
 2898|   686k|    return atom & ~JS_ATOM_TAG_INT;
  ------------------
  |  | 2870|   686k|#define JS_ATOM_TAG_INT (1U << 31)
  ------------------
 2899|   686k|}
quickjs.c:js_new_string_char:
 3954|      2|{
 3955|      2|    if (c < 0x100) {
  ------------------
  |  Branch (3955:9): [True: 2, False: 0]
  ------------------
 3956|      2|        uint8_t ch8 = c;
 3957|      2|        return js_new_string8_len(ctx, (const char *)&ch8, 1);
 3958|      2|    } else {
 3959|      0|        uint16_t ch16 = c;
 3960|      0|        return js_new_string16_len(ctx, &ch16, 1);
 3961|      0|    }
 3962|      2|}
quickjs.c:js_new_string16_len:
 3944|  1.24k|{
 3945|  1.24k|    JSString *str;
 3946|  1.24k|    str = js_alloc_string(ctx, len, 1);
 3947|  1.24k|    if (!str)
  ------------------
  |  Branch (3947:9): [True: 0, False: 1.24k]
  ------------------
 3948|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 3949|  1.24k|    memcpy(str->u.str16, buf, len * 2);
 3950|  1.24k|    return JS_MKPTR(JS_TAG_STRING, str);
  ------------------
  |  |  248|  1.24k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3951|  1.24k|}
quickjs.c:string_get:
 1961|  2.91M|static inline int string_get(const JSString *p, int idx) {
 1962|  2.91M|    return p->is_wide_char ? p->u.str16[idx] : p->u.str8[idx];
  ------------------
  |  Branch (1962:12): [True: 1.28M, False: 1.63M]
  ------------------
 1963|  2.91M|}
quickjs.c:find_own_property:
 6138|  3.39M|{
 6139|  3.39M|    JSShape *sh;
 6140|  3.39M|    JSShapeProperty *pr, *prop;
 6141|  3.39M|    intptr_t h;
 6142|  3.39M|    sh = p->shape;
 6143|  3.39M|    h = (uintptr_t)atom & sh->prop_hash_mask;
 6144|  3.39M|    h = sh->hash_table[h];
 6145|  3.39M|    prop = get_shape_prop(sh);
 6146|  4.49M|    while (h) {
  ------------------
  |  Branch (6146:12): [True: 3.12M, False: 1.37M]
  ------------------
 6147|  3.12M|        pr = &prop[h - 1];
 6148|  3.12M|        if (likely(pr->atom == atom)) {
  ------------------
  |  |   32|  3.12M|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 2.02M, False: 1.10M]
  |  |  ------------------
  ------------------
 6149|  2.02M|            *ppr = &p->prop[h - 1];
 6150|       |            /* the compiler should be able to assume that pr != NULL here */
 6151|  2.02M|            return pr;
 6152|  2.02M|        }
 6153|  1.10M|        h = pr->hash_next;
 6154|  1.10M|    }
 6155|  1.37M|    *ppr = NULL;
 6156|       |    return NULL;
 6157|  3.39M|}
quickjs.c:JS_AutoInitProperty:
 8169|    207|{
 8170|    207|    JSValue val;
 8171|    207|    JSContext *realm;
 8172|    207|    JSAutoInitFunc *func;
 8173|    207|    JSAutoInitIDEnum id;
 8174|       |    
 8175|    207|    if (js_shape_prepare_update(ctx, p, &prs))
  ------------------
  |  Branch (8175:9): [True: 0, False: 207]
  ------------------
 8176|      0|        return -1;
 8177|       |
 8178|    207|    realm = js_autoinit_get_realm(pr);
 8179|    207|    id = js_autoinit_get_id(pr);
 8180|    207|    func = js_autoinit_func_table[id];
 8181|       |    /* 'func' shall not modify the object properties 'pr' */
 8182|    207|    val = func(realm, p, prop, pr->u.init.opaque);
 8183|    207|    js_autoinit_free(ctx->rt, pr);
 8184|    207|    prs->flags &= ~JS_PROP_TMASK;
  ------------------
  |  |  303|    207|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
 8185|    207|    pr->u.value = JS_UNDEFINED;
  ------------------
  |  |  291|    207|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|    207|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8186|    207|    if (JS_IsException(val))
  ------------------
  |  Branch (8186:9): [True: 0, False: 207]
  ------------------
 8187|      0|        return -1;
 8188|    207|    if (id == JS_AUTOINIT_ID_MODULE_NS &&
  ------------------
  |  Branch (8188:9): [True: 0, False: 207]
  ------------------
 8189|      0|        JS_VALUE_GET_TAG(val) == JS_TAG_STRING) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (8189:9): [True: 0, False: 0]
  ------------------
 8190|       |        /* WARNING: a varref is returned as a string  ! */
 8191|      0|        prs->flags |= JS_PROP_VARREF;
  ------------------
  |  |  306|      0|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
 8192|      0|        pr->u.var_ref = JS_VALUE_GET_PTR(val);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
 8193|      0|        js_rc(pr->u.var_ref)->ref_count++;
 8194|    207|    } else if (p->class_id == JS_CLASS_GLOBAL_OBJECT) {
  ------------------
  |  Branch (8194:16): [True: 53, False: 154]
  ------------------
 8195|     53|        JSVarRef *var_ref;
 8196|       |        /* in the global object we use references */
 8197|     53|        var_ref = js_create_var_ref(ctx, FALSE);
 8198|     53|        if (!var_ref)
  ------------------
  |  Branch (8198:13): [True: 0, False: 53]
  ------------------
 8199|      0|            return -1;
 8200|     53|        prs->flags |= JS_PROP_VARREF;
  ------------------
  |  |  306|     53|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
 8201|     53|        pr->u.var_ref = var_ref;
 8202|     53|        var_ref->value = val; 
 8203|     53|        var_ref->is_const = !(prs->flags & JS_PROP_WRITABLE);
  ------------------
  |  |  299|     53|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
 8204|    154|    } else {
 8205|    154|        pr->u.value = val;
 8206|    154|    }
 8207|    207|    return 0;
 8208|    207|}
quickjs.c:js_autoinit_get_id:
 6082|    207|{
 6083|    207|    return pr->u.init.realm_and_id & 3;
 6084|    207|}
quickjs.c:set_cycle_flag:
 6161|  1.63k|{
 6162|  1.63k|}
quickjs.c:js_resize_array:
 1928|  4.05k|{
 1929|  4.05k|    if (unlikely(req_size > *psize))
  ------------------
  |  |   33|  4.05k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1.03k, False: 3.01k]
  |  |  ------------------
  ------------------
 1930|  1.03k|        return js_realloc_array(ctx, parray, elem_size, psize, req_size);
 1931|  3.01k|    else
 1932|  3.01k|        return 0;
 1933|  4.05k|}
quickjs.c:js_realloc_array:
 1910|  1.03k|{
 1911|  1.03k|    int new_size;
 1912|  1.03k|    size_t slack;
 1913|  1.03k|    void *new_array;
 1914|       |    /* XXX: potential arithmetic overflow */
 1915|  1.03k|    new_size = max_int(req_size, *psize * 3 / 2);
 1916|  1.03k|    new_array = js_realloc2(ctx, *parray, new_size * elem_size, &slack);
 1917|  1.03k|    if (!new_array)
  ------------------
  |  Branch (1917:9): [True: 0, False: 1.03k]
  ------------------
 1918|      0|        return -1;
 1919|  1.03k|    new_size += slack / elem_size;
 1920|  1.03k|    *psize = new_size;
 1921|  1.03k|    *parray = new_array;
 1922|  1.03k|    return 0;
 1923|  1.03k|}
quickjs.c:JS_InstantiateFunctionListItem2:
39454|    207|{
39455|    207|    const JSCFunctionListEntry *e = opaque;
39456|    207|    JSValue val, proto;
39457|       |
39458|    207|    switch(e->def_type) {
39459|    207|    case JS_DEF_CFUNC:
  ------------------
  |  | 1099|    207|#define JS_DEF_CFUNC          0
  ------------------
  |  Branch (39459:5): [True: 207, False: 0]
  ------------------
39460|    207|        val = JS_NewCFunction2(ctx, e->u.func.cfunc.generic,
39461|    207|                               e->name, e->u.func.length, e->u.func.cproto, e->magic);
39462|    207|        break;
39463|      0|    case JS_DEF_PROP_STRING:
  ------------------
  |  | 1102|      0|#define JS_DEF_PROP_STRING    3
  ------------------
  |  Branch (39463:5): [True: 0, False: 207]
  ------------------
39464|      0|        val = JS_NewAtomString(ctx, e->u.str);
39465|      0|        break;
39466|      0|    case JS_DEF_OBJECT:
  ------------------
  |  | 1107|      0|#define JS_DEF_OBJECT         8
  ------------------
  |  Branch (39466:5): [True: 0, False: 207]
  ------------------
39467|       |        /* XXX: could add a flag */
39468|      0|        if (atom == JS_ATOM_Symbol_unscopables)
  ------------------
  |  Branch (39468:13): [True: 0, False: 0]
  ------------------
39469|      0|            proto = JS_NULL;
  ------------------
  |  |  290|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
39470|      0|        else
39471|      0|            proto = ctx->class_proto[JS_CLASS_OBJECT];
39472|      0|        val = JS_NewObjectProtoList(ctx, proto,
39473|      0|                                    e->u.prop_list.tab, e->u.prop_list.len);
39474|      0|        break;
39475|      0|    default:
  ------------------
  |  Branch (39475:5): [True: 0, False: 207]
  ------------------
39476|      0|        abort();
39477|    207|    }
39478|    207|    return val;
39479|    207|}
quickjs.c:js_create_var_ref:
17005|  2.68k|{
17006|  2.68k|    JSVarRef *var_ref;
17007|  2.68k|    var_ref = js_malloc(ctx, sizeof(JSVarRef));
17008|  2.68k|    if (!var_ref)
  ------------------
  |  Branch (17008:9): [True: 0, False: 2.68k]
  ------------------
17009|      0|        return NULL;
17010|  2.68k|    js_rc(var_ref)->ref_count = 1;
17011|  2.68k|    if (is_lexical)
  ------------------
  |  Branch (17011:9): [True: 47, False: 2.63k]
  ------------------
17012|     47|        var_ref->value = JS_UNINITIALIZED;
  ------------------
  |  |  295|     47|#define JS_UNINITIALIZED JS_MKVAL(JS_TAG_UNINITIALIZED, 0)
  |  |  ------------------
  |  |  |  |  247|     47|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17013|  2.63k|    else
17014|  2.63k|        var_ref->value = JS_UNDEFINED;
  ------------------
  |  |  291|  2.63k|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|  2.63k|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17015|  2.68k|    var_ref->pvalue = &var_ref->value;
17016|  2.68k|    var_ref->is_detached = TRUE;
17017|  2.68k|    var_ref->is_lexical = FALSE;
17018|  2.68k|    var_ref->is_const = FALSE;
17019|  2.68k|    add_gc_object(ctx->rt, &var_ref->header, JS_GC_OBJ_TYPE_VAR_REF);
17020|  2.68k|    return var_ref;
17021|  2.68k|}
quickjs.c:JS_ThrowReferenceErrorNotDefined:
 7821|      9|{
 7822|      9|    char buf[ATOM_GET_STR_BUF_SIZE];
 7823|      9|    return JS_ThrowReferenceError(ctx, "'%s' is not defined",
 7824|      9|                                  JS_AtomGetStr(ctx, buf, sizeof(buf), name));
 7825|      9|}
quickjs.c:JS_GetOwnPropertyNamesInternal:
 8602|     23|{
 8603|     23|    int i, j;
 8604|     23|    JSShape *sh;
 8605|     23|    JSShapeProperty *prs;
 8606|     23|    JSPropertyEnum *tab_atom, *tab_exotic;
 8607|     23|    JSAtom atom;
 8608|     23|    uint32_t num_keys_count, str_keys_count, sym_keys_count, atom_count;
 8609|     23|    uint32_t num_index, str_index, sym_index, exotic_count, exotic_keys_count;
 8610|     23|    BOOL is_enumerable, num_sorted;
 8611|     23|    uint32_t num_key;
 8612|     23|    JSAtomKindEnum kind;
 8613|       |
 8614|       |    /* clear pointer for consistency in case of failure */
 8615|     23|    *ptab = NULL;
 8616|     23|    *plen = 0;
 8617|       |
 8618|       |    /* compute the number of returned properties */
 8619|     23|    num_keys_count = 0;
 8620|     23|    str_keys_count = 0;
 8621|     23|    sym_keys_count = 0;
 8622|     23|    exotic_keys_count = 0;
 8623|     23|    exotic_count = 0;
 8624|     23|    tab_exotic = NULL;
 8625|     23|    sh = p->shape;
 8626|     87|    for(i = 0, prs = get_shape_prop(sh); i < sh->prop_count; i++, prs++) {
  ------------------
  |  Branch (8626:42): [True: 64, False: 23]
  ------------------
 8627|     64|        atom = prs->atom;
 8628|     64|        if (atom != JS_ATOM_NULL) {
  ------------------
  |  |  451|     64|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (8628:13): [True: 64, False: 0]
  ------------------
 8629|     64|            is_enumerable = ((prs->flags & JS_PROP_ENUMERABLE) != 0);
  ------------------
  |  |  300|     64|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
 8630|     64|            kind = JS_AtomGetKind(ctx, atom);
 8631|     64|            if ((!(flags & JS_GPN_ENUM_ONLY) || is_enumerable) &&
  ------------------
  |  |  814|     64|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
  |  Branch (8631:18): [True: 34, False: 30]
  |  Branch (8631:49): [True: 0, False: 30]
  ------------------
 8632|     34|                ((flags >> kind) & 1) != 0) {
  ------------------
  |  Branch (8632:17): [True: 34, False: 0]
  ------------------
 8633|       |                /* need to raise an exception in case of the module
 8634|       |                   name space (implicit GetOwnProperty) */
 8635|     34|                if (unlikely((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) &&
  ------------------
  |  |   33|     68|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 34]
  |  |  ------------------
  ------------------
 8636|      0|                    (flags & (JS_GPN_SET_ENUM | JS_GPN_ENUM_ONLY))) {
  ------------------
  |  |  816|      0|#define JS_GPN_SET_ENUM     (1 << 5)
  ------------------
                                  (flags & (JS_GPN_SET_ENUM | JS_GPN_ENUM_ONLY))) {
  ------------------
  |  |  814|      0|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
  |  Branch (8636:21): [True: 0, False: 0]
  ------------------
 8637|      0|                    JSVarRef *var_ref = p->prop[i].u.var_ref;
 8638|      0|                    if (unlikely(JS_IsUninitialized(*var_ref->pvalue))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8639|      0|                        JS_ThrowReferenceErrorUninitialized(ctx, prs->atom);
 8640|      0|                        return -1;
 8641|      0|                    }
 8642|      0|                }
 8643|     34|                if (JS_AtomIsArrayIndex(ctx, &num_key, atom)) {
  ------------------
  |  Branch (8643:21): [True: 0, False: 34]
  ------------------
 8644|      0|                    num_keys_count++;
 8645|     34|                } else if (kind == JS_ATOM_KIND_STRING) {
  ------------------
  |  Branch (8645:28): [True: 34, False: 0]
  ------------------
 8646|     34|                    str_keys_count++;
 8647|     34|                } else {
 8648|      0|                    sym_keys_count++;
 8649|      0|                }
 8650|     34|            }
 8651|     64|        }
 8652|     64|    }
 8653|       |
 8654|     23|    if (p->is_exotic) {
  ------------------
  |  Branch (8654:9): [True: 0, False: 23]
  ------------------
 8655|      0|        if (p->fast_array) {
  ------------------
  |  Branch (8655:13): [True: 0, False: 0]
  ------------------
 8656|      0|            if (flags & JS_GPN_STRING_MASK) {
  ------------------
  |  |  810|      0|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
  |  Branch (8656:17): [True: 0, False: 0]
  ------------------
 8657|      0|                num_keys_count += p->u.array.count;
 8658|      0|            }
 8659|      0|        } else if (p->class_id == JS_CLASS_STRING) {
  ------------------
  |  Branch (8659:20): [True: 0, False: 0]
  ------------------
 8660|      0|            if (flags & JS_GPN_STRING_MASK) {
  ------------------
  |  |  810|      0|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
  |  Branch (8660:17): [True: 0, False: 0]
  ------------------
 8661|      0|                num_keys_count += js_string_obj_get_length(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8662|      0|            }
 8663|      0|        } else {
 8664|      0|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8665|      0|            if (em && em->get_own_property_names) {
  ------------------
  |  Branch (8665:17): [True: 0, False: 0]
  |  Branch (8665:23): [True: 0, False: 0]
  ------------------
 8666|      0|                if (em->get_own_property_names(ctx, &tab_exotic, &exotic_count,
  ------------------
  |  Branch (8666:21): [True: 0, False: 0]
  ------------------
 8667|      0|                                               JS_MKPTR(JS_TAG_OBJECT, p)))
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8668|      0|                    return -1;
 8669|      0|                for(i = 0; i < exotic_count; i++) {
  ------------------
  |  Branch (8669:28): [True: 0, False: 0]
  ------------------
 8670|      0|                    atom = tab_exotic[i].atom;
 8671|      0|                    kind = JS_AtomGetKind(ctx, atom);
 8672|      0|                    if (((flags >> kind) & 1) != 0) {
  ------------------
  |  Branch (8672:25): [True: 0, False: 0]
  ------------------
 8673|      0|                        is_enumerable = FALSE;
 8674|      0|                        if (flags & (JS_GPN_SET_ENUM | JS_GPN_ENUM_ONLY)) {
  ------------------
  |  |  816|      0|#define JS_GPN_SET_ENUM     (1 << 5)
  ------------------
                                      if (flags & (JS_GPN_SET_ENUM | JS_GPN_ENUM_ONLY)) {
  ------------------
  |  |  814|      0|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
  |  Branch (8674:29): [True: 0, False: 0]
  ------------------
 8675|      0|                            JSPropertyDescriptor desc;
 8676|      0|                            int res;
 8677|       |                            /* set the "is_enumerable" field if necessary */
 8678|      0|                            res = JS_GetOwnPropertyInternal(ctx, &desc, p, atom);
 8679|      0|                            if (res < 0) {
  ------------------
  |  Branch (8679:33): [True: 0, False: 0]
  ------------------
 8680|      0|                                JS_FreePropertyEnum(ctx, tab_exotic, exotic_count);
 8681|      0|                                return -1;
 8682|      0|                            }
 8683|      0|                            if (res) {
  ------------------
  |  Branch (8683:33): [True: 0, False: 0]
  ------------------
 8684|      0|                                is_enumerable =
 8685|      0|                                    ((desc.flags & JS_PROP_ENUMERABLE) != 0);
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
 8686|      0|                                js_free_desc(ctx, &desc);
 8687|      0|                            }
 8688|      0|                            tab_exotic[i].is_enumerable = is_enumerable;
 8689|      0|                        }
 8690|      0|                        if (!(flags & JS_GPN_ENUM_ONLY) || is_enumerable) {
  ------------------
  |  |  814|      0|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
  |  Branch (8690:29): [True: 0, False: 0]
  |  Branch (8690:60): [True: 0, False: 0]
  ------------------
 8691|      0|                            exotic_keys_count++;
 8692|      0|                        }
 8693|      0|                    }
 8694|      0|                }
 8695|      0|            }
 8696|      0|        }
 8697|      0|    }
 8698|       |
 8699|       |    /* fill them */
 8700|       |
 8701|     23|    atom_count = num_keys_count + str_keys_count;
 8702|     23|    if (atom_count < str_keys_count)
  ------------------
  |  Branch (8702:9): [True: 0, False: 23]
  ------------------
 8703|      0|        goto add_overflow;
 8704|     23|    atom_count += sym_keys_count;
 8705|     23|    if (atom_count < sym_keys_count)
  ------------------
  |  Branch (8705:9): [True: 0, False: 23]
  ------------------
 8706|      0|        goto add_overflow;
 8707|     23|    atom_count += exotic_keys_count;
 8708|     23|    if (atom_count < exotic_keys_count || atom_count > INT32_MAX) {
  ------------------
  |  Branch (8708:9): [True: 0, False: 23]
  |  Branch (8708:43): [True: 0, False: 23]
  ------------------
 8709|      0|    add_overflow:
 8710|      0|        JS_ThrowOutOfMemory(ctx);
 8711|      0|        JS_FreePropertyEnum(ctx, tab_exotic, exotic_count);
 8712|      0|        return -1;
 8713|      0|    }
 8714|       |    /* XXX: need generic way to test for js_malloc(ctx, a * b) overflow */
 8715|       |    
 8716|       |    /* avoid allocating 0 bytes */
 8717|     23|    tab_atom = js_malloc(ctx, sizeof(tab_atom[0]) * max_int(atom_count, 1));
 8718|     23|    if (!tab_atom) {
  ------------------
  |  Branch (8718:9): [True: 0, False: 23]
  ------------------
 8719|      0|        JS_FreePropertyEnum(ctx, tab_exotic, exotic_count);
 8720|      0|        return -1;
 8721|      0|    }
 8722|       |
 8723|     23|    num_index = 0;
 8724|     23|    str_index = num_keys_count;
 8725|     23|    sym_index = str_index + str_keys_count;
 8726|       |
 8727|     23|    num_sorted = TRUE;
 8728|     23|    sh = p->shape;
 8729|     87|    for(i = 0, prs = get_shape_prop(sh); i < sh->prop_count; i++, prs++) {
  ------------------
  |  Branch (8729:42): [True: 64, False: 23]
  ------------------
 8730|     64|        atom = prs->atom;
 8731|     64|        if (atom != JS_ATOM_NULL) {
  ------------------
  |  |  451|     64|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (8731:13): [True: 64, False: 0]
  ------------------
 8732|     64|            is_enumerable = ((prs->flags & JS_PROP_ENUMERABLE) != 0);
  ------------------
  |  |  300|     64|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
 8733|     64|            kind = JS_AtomGetKind(ctx, atom);
 8734|     64|            if ((!(flags & JS_GPN_ENUM_ONLY) || is_enumerable) &&
  ------------------
  |  |  814|     64|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
  |  Branch (8734:18): [True: 34, False: 30]
  |  Branch (8734:49): [True: 0, False: 30]
  ------------------
 8735|     34|                ((flags >> kind) & 1) != 0) {
  ------------------
  |  Branch (8735:17): [True: 34, False: 0]
  ------------------
 8736|     34|                if (JS_AtomIsArrayIndex(ctx, &num_key, atom)) {
  ------------------
  |  Branch (8736:21): [True: 0, False: 34]
  ------------------
 8737|      0|                    j = num_index++;
 8738|      0|                    num_sorted = FALSE;
 8739|     34|                } else if (kind == JS_ATOM_KIND_STRING) {
  ------------------
  |  Branch (8739:28): [True: 34, False: 0]
  ------------------
 8740|     34|                    j = str_index++;
 8741|     34|                } else {
 8742|      0|                    j = sym_index++;
 8743|      0|                }
 8744|     34|                tab_atom[j].atom = JS_DupAtom(ctx, atom);
 8745|     34|                tab_atom[j].is_enumerable = is_enumerable;
 8746|     34|            }
 8747|     64|        }
 8748|     64|    }
 8749|       |
 8750|     23|    if (p->is_exotic) {
  ------------------
  |  Branch (8750:9): [True: 0, False: 23]
  ------------------
 8751|      0|        int len;
 8752|      0|        if (p->fast_array) {
  ------------------
  |  Branch (8752:13): [True: 0, False: 0]
  ------------------
 8753|      0|            if (flags & JS_GPN_STRING_MASK) {
  ------------------
  |  |  810|      0|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
  |  Branch (8753:17): [True: 0, False: 0]
  ------------------
 8754|      0|                len = p->u.array.count;
 8755|      0|                goto add_array_keys;
 8756|      0|            }
 8757|      0|        } else if (p->class_id == JS_CLASS_STRING) {
  ------------------
  |  Branch (8757:20): [True: 0, False: 0]
  ------------------
 8758|      0|            if (flags & JS_GPN_STRING_MASK) {
  ------------------
  |  |  810|      0|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
  |  Branch (8758:17): [True: 0, False: 0]
  ------------------
 8759|      0|                len = js_string_obj_get_length(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8760|      0|            add_array_keys:
 8761|      0|                for(i = 0; i < len; i++) {
  ------------------
  |  Branch (8761:28): [True: 0, False: 0]
  ------------------
 8762|      0|                    tab_atom[num_index].atom = __JS_AtomFromUInt32(i);
 8763|      0|                    if (tab_atom[num_index].atom == JS_ATOM_NULL) {
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (8763:25): [True: 0, False: 0]
  ------------------
 8764|      0|                        JS_FreePropertyEnum(ctx, tab_atom, num_index);
 8765|      0|                        return -1;
 8766|      0|                    }
 8767|      0|                    tab_atom[num_index].is_enumerable = TRUE;
 8768|      0|                    num_index++;
 8769|      0|                }
 8770|      0|            }
 8771|      0|        } else {
 8772|       |            /* Note: exotic keys are not reordered and comes after the object own properties. */
 8773|      0|            for(i = 0; i < exotic_count; i++) {
  ------------------
  |  Branch (8773:24): [True: 0, False: 0]
  ------------------
 8774|      0|                atom = tab_exotic[i].atom;
 8775|      0|                is_enumerable = tab_exotic[i].is_enumerable;
 8776|      0|                kind = JS_AtomGetKind(ctx, atom);
 8777|      0|                if ((!(flags & JS_GPN_ENUM_ONLY) || is_enumerable) &&
  ------------------
  |  |  814|      0|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
  |  Branch (8777:22): [True: 0, False: 0]
  |  Branch (8777:53): [True: 0, False: 0]
  ------------------
 8778|      0|                    ((flags >> kind) & 1) != 0) {
  ------------------
  |  Branch (8778:21): [True: 0, False: 0]
  ------------------
 8779|      0|                    tab_atom[sym_index].atom = atom;
 8780|      0|                    tab_atom[sym_index].is_enumerable = is_enumerable;
 8781|      0|                    sym_index++;
 8782|      0|                } else {
 8783|      0|                    JS_FreeAtom(ctx, atom);
 8784|      0|                }
 8785|      0|            }
 8786|      0|            js_free(ctx, tab_exotic);
 8787|      0|        }
 8788|      0|    }
 8789|       |
 8790|     23|    assert(num_index == num_keys_count);
  ------------------
  |  Branch (8790:5): [True: 0, False: 23]
  |  Branch (8790:5): [True: 23, False: 0]
  ------------------
 8791|     23|    assert(str_index == num_keys_count + str_keys_count);
  ------------------
  |  Branch (8791:5): [True: 0, False: 23]
  |  Branch (8791:5): [True: 23, False: 0]
  ------------------
 8792|     23|    assert(sym_index == atom_count);
  ------------------
  |  Branch (8792:5): [True: 0, False: 23]
  |  Branch (8792:5): [True: 23, False: 0]
  ------------------
 8793|       |
 8794|     23|    if (num_keys_count != 0 && !num_sorted) {
  ------------------
  |  Branch (8794:9): [True: 0, False: 23]
  |  Branch (8794:32): [True: 0, False: 0]
  ------------------
 8795|      0|        rqsort(tab_atom, num_keys_count, sizeof(tab_atom[0]), num_keys_cmp,
 8796|      0|               ctx);
 8797|      0|    }
 8798|     23|    *ptab = tab_atom;
 8799|     23|    *plen = atom_count;
 8800|     23|    return 0;
 8801|     23|}
quickjs.c:JS_AtomGetKind:
 3132|    128|{
 3133|    128|    JSRuntime *rt;
 3134|    128|    JSAtomStruct *p;
 3135|       |
 3136|    128|    rt = ctx->rt;
 3137|    128|    if (__JS_AtomIsTaggedInt(v))
  ------------------
  |  Branch (3137:9): [True: 0, False: 128]
  ------------------
 3138|      0|        return JS_ATOM_KIND_STRING;
 3139|    128|    p = rt->atom_array[v];
 3140|    128|    switch(p->atom_type) {
 3141|    128|    case JS_ATOM_TYPE_STRING:
  ------------------
  |  Branch (3141:5): [True: 128, False: 0]
  ------------------
 3142|    128|        return JS_ATOM_KIND_STRING;
 3143|      0|    case JS_ATOM_TYPE_GLOBAL_SYMBOL:
  ------------------
  |  Branch (3143:5): [True: 0, False: 128]
  ------------------
 3144|      0|        return JS_ATOM_KIND_SYMBOL;
 3145|      0|    case JS_ATOM_TYPE_SYMBOL:
  ------------------
  |  Branch (3145:5): [True: 0, False: 128]
  ------------------
 3146|      0|        if (p->hash == JS_ATOM_HASH_PRIVATE)
  ------------------
  |  |  581|      0|#define JS_ATOM_HASH_PRIVATE JS_ATOM_HASH_MASK
  |  |  ------------------
  |  |  |  |  580|      0|#define JS_ATOM_HASH_MASK  ((1 << 30) - 1)
  |  |  ------------------
  ------------------
  |  Branch (3146:13): [True: 0, False: 0]
  ------------------
 3147|      0|            return JS_ATOM_KIND_PRIVATE;
 3148|      0|        else
 3149|      0|            return JS_ATOM_KIND_SYMBOL;
 3150|      0|    default:
  ------------------
  |  Branch (3150:5): [True: 0, False: 128]
  ------------------
 3151|      0|        abort();
 3152|    128|    }
 3153|    128|}
quickjs.c:JS_AtomIsArrayIndex:
 3635|    108|{
 3636|    108|    if (__JS_AtomIsTaggedInt(atom)) {
  ------------------
  |  Branch (3636:9): [True: 0, False: 108]
  ------------------
 3637|      0|        *pval = __JS_AtomToUInt32(atom);
 3638|      0|        return TRUE;
 3639|    108|    } else {
 3640|    108|        JSRuntime *rt = ctx->rt;
 3641|    108|        JSAtomStruct *p;
 3642|    108|        uint32_t val;
 3643|       |
 3644|    108|        assert(atom < rt->atom_size);
  ------------------
  |  Branch (3644:9): [True: 0, False: 108]
  |  Branch (3644:9): [True: 108, False: 0]
  ------------------
 3645|    108|        p = rt->atom_array[atom];
 3646|    108|        if (p->atom_type == JS_ATOM_TYPE_STRING &&
  ------------------
  |  Branch (3646:13): [True: 91, False: 17]
  ------------------
 3647|     91|            is_num_string(&val, p) && val != -1) {
  ------------------
  |  Branch (3647:13): [True: 0, False: 91]
  |  Branch (3647:39): [True: 0, False: 0]
  ------------------
 3648|      0|            *pval = val;
 3649|      0|            return TRUE;
 3650|    108|        } else {
 3651|    108|            *pval = 0;
 3652|    108|            return FALSE;
 3653|    108|        }
 3654|    108|    }
 3655|    108|}
quickjs.c:js_free_desc:
 9653|     34|{
 9654|     34|    JS_FreeValue(ctx, desc->getter);
 9655|     34|    JS_FreeValue(ctx, desc->setter);
 9656|     34|    JS_FreeValue(ctx, desc->value);
 9657|     34|}
quickjs.c:JS_GetOwnPropertyInternal:
 8819|     38|{
 8820|     38|    JSShapeProperty *prs;
 8821|     38|    JSProperty *pr;
 8822|       |
 8823|     38|retry:
 8824|     38|    prs = find_own_property(&pr, p, prop);
 8825|     38|    if (prs) {
  ------------------
  |  Branch (8825:9): [True: 34, False: 4]
  ------------------
 8826|     34|        if (desc) {
  ------------------
  |  Branch (8826:13): [True: 34, False: 0]
  ------------------
 8827|     34|            desc->flags = prs->flags & JS_PROP_C_W_E;
  ------------------
  |  |  301|     34|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     34|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|     34|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|     34|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
 8828|     34|            desc->getter = JS_UNDEFINED;
  ------------------
  |  |  291|     34|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     34|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8829|     34|            desc->setter = JS_UNDEFINED;
  ------------------
  |  |  291|     34|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     34|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8830|     34|            desc->value = JS_UNDEFINED;
  ------------------
  |  |  291|     34|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     34|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8831|     34|            if (unlikely(prs->flags & JS_PROP_TMASK)) {
  ------------------
  |  |   33|     34|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 34]
  |  |  ------------------
  ------------------
 8832|      0|                if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  305|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (8832:21): [True: 0, False: 0]
  ------------------
 8833|      0|                    desc->flags |= JS_PROP_GETSET;
  ------------------
  |  |  305|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
 8834|      0|                    if (pr->u.getset.getter)
  ------------------
  |  Branch (8834:25): [True: 0, False: 0]
  ------------------
 8835|      0|                        desc->getter = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.getter));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8836|      0|                    if (pr->u.getset.setter)
  ------------------
  |  Branch (8836:25): [True: 0, False: 0]
  ------------------
 8837|      0|                        desc->setter = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.setter));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8838|      0|                } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  303|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  306|      0|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (8838:28): [True: 0, False: 0]
  ------------------
 8839|      0|                    JSValue val = *pr->u.var_ref->pvalue;
 8840|      0|                    if (unlikely(JS_IsUninitialized(val))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8841|      0|                        JS_ThrowReferenceErrorUninitialized(ctx, prs->atom);
 8842|      0|                        return -1;
 8843|      0|                    }
 8844|      0|                    desc->value = JS_DupValue(ctx, val);
 8845|      0|                } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  303|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  307|      0|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (8845:28): [True: 0, False: 0]
  ------------------
 8846|       |                    /* Instantiate property and retry */
 8847|      0|                    if (JS_AutoInitProperty(ctx, p, prop, pr, prs))
  ------------------
  |  Branch (8847:25): [True: 0, False: 0]
  ------------------
 8848|      0|                        return -1;
 8849|      0|                    goto retry;
 8850|      0|                }
 8851|     34|            } else {
 8852|     34|                desc->value = JS_DupValue(ctx, pr->u.value);
 8853|     34|            }
 8854|     34|        } else {
 8855|       |            /* for consistency, send the exception even if desc is NULL */
 8856|      0|            if (unlikely((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8857|      0|                if (unlikely(JS_IsUninitialized(*pr->u.var_ref->pvalue))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8858|      0|                    JS_ThrowReferenceErrorUninitialized(ctx, prs->atom);
 8859|      0|                    return -1;
 8860|      0|                }
 8861|      0|            } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  303|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                          } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  307|      0|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (8861:24): [True: 0, False: 0]
  ------------------
 8862|       |                /* nothing to do: delay instantiation until actual value and/or attributes are read */
 8863|      0|            }
 8864|      0|        }
 8865|     34|        return TRUE;
 8866|     34|    }
 8867|      4|    if (p->is_exotic) {
  ------------------
  |  Branch (8867:9): [True: 0, False: 4]
  ------------------
 8868|      0|        if (p->fast_array) {
  ------------------
  |  Branch (8868:13): [True: 0, False: 0]
  ------------------
 8869|       |            /* specific case for fast arrays */
 8870|      0|            if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (8870:17): [True: 0, False: 0]
  ------------------
 8871|      0|                uint32_t idx;
 8872|      0|                idx = __JS_AtomToUInt32(prop);
 8873|      0|                if (idx < p->u.array.count) {
  ------------------
  |  Branch (8873:21): [True: 0, False: 0]
  ------------------
 8874|      0|                    if (desc) {
  ------------------
  |  Branch (8874:25): [True: 0, False: 0]
  ------------------
 8875|      0|                        desc->flags = JS_PROP_WRITABLE | JS_PROP_ENUMERABLE |
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                      desc->flags = JS_PROP_WRITABLE | JS_PROP_ENUMERABLE |
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
 8876|      0|                            JS_PROP_CONFIGURABLE;
  ------------------
  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 8877|      0|                        desc->getter = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8878|      0|                        desc->setter = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8879|      0|                        desc->value = JS_GetPropertyUint32(ctx, JS_MKPTR(JS_TAG_OBJECT, p), idx);
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8880|      0|                    }
 8881|      0|                    return TRUE;
 8882|      0|                }
 8883|      0|            }
 8884|      0|        } else {
 8885|      0|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8886|      0|            if (em && em->get_own_property) {
  ------------------
  |  Branch (8886:17): [True: 0, False: 0]
  |  Branch (8886:23): [True: 0, False: 0]
  ------------------
 8887|      0|                return em->get_own_property(ctx, desc,
 8888|      0|                                            JS_MKPTR(JS_TAG_OBJECT, p), prop);
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8889|      0|            }
 8890|      0|        }
 8891|      0|    }
 8892|      4|    return FALSE;
 8893|      4|}
quickjs.c:js_get_atom_index:
 3161|      2|{
 3162|      2|    uint32_t i = p->hash_next;  /* atom_index */
 3163|      2|    if (p->atom_type != JS_ATOM_TYPE_SYMBOL) {
  ------------------
  |  Branch (3163:9): [True: 2, False: 0]
  ------------------
 3164|      2|        JSAtomStruct *p1;
 3165|       |
 3166|      2|        i = rt->atom_hash[p->hash & (rt->atom_hash_size - 1)];
 3167|      2|        p1 = rt->atom_array[i];
 3168|      8|        while (p1 != p) {
  ------------------
  |  Branch (3168:16): [True: 6, False: 2]
  ------------------
 3169|      6|            assert(i != 0);
  ------------------
  |  Branch (3169:13): [True: 0, False: 6]
  |  Branch (3169:13): [True: 6, False: 0]
  ------------------
 3170|      6|            i = p1->hash_next;
 3171|      6|            p1 = rt->atom_array[i];
 3172|      6|        }
 3173|      2|    }
 3174|      2|    return i;
 3175|      2|}
quickjs.c:JS_GetPropertyValue:
 9031|   343k|{
 9032|   343k|    JSAtom atom;
 9033|   343k|    JSValue ret;
 9034|       |
 9035|   343k|    if (likely(JS_VALUE_GET_TAG(this_obj) == JS_TAG_OBJECT &&
  ------------------
  |  |   32|   686k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 343k, False: 0]
  |  |  |  Branch (32:45): [True: 343k, False: 0]
  |  |  |  Branch (32:45): [True: 343k, False: 0]
  |  |  ------------------
  ------------------
 9036|   343k|               JS_VALUE_GET_TAG(prop) == JS_TAG_INT)) {
 9037|   343k|        JSObject *p;
 9038|   343k|        uint32_t idx;
 9039|       |        /* fast path for array access */
 9040|   343k|        p = JS_VALUE_GET_OBJ(this_obj);
  ------------------
  |  |  229|   343k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|   343k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9041|   343k|        idx = JS_VALUE_GET_INT(prop);
  ------------------
  |  |  239|   343k|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
 9042|   343k|        switch(p->class_id) {
 9043|   343k|        case JS_CLASS_ARRAY:
  ------------------
  |  Branch (9043:9): [True: 343k, False: 0]
  ------------------
 9044|   343k|        case JS_CLASS_ARGUMENTS:
  ------------------
  |  Branch (9044:9): [True: 0, False: 343k]
  ------------------
 9045|   343k|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|   343k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 4, False: 343k]
  |  |  ------------------
  ------------------
 9046|   343k|            return JS_DupValue(ctx, p->u.array.u.values[idx]);
 9047|      0|        case JS_CLASS_MAPPED_ARGUMENTS:
  ------------------
  |  Branch (9047:9): [True: 0, False: 343k]
  ------------------
 9048|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9049|      0|            return JS_DupValue(ctx, *p->u.array.u.var_refs[idx]->pvalue);
 9050|      0|        case JS_CLASS_INT8_ARRAY:
  ------------------
  |  Branch (9050:9): [True: 0, False: 343k]
  ------------------
 9051|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9052|      0|            return JS_NewInt32(ctx, p->u.array.u.int8_ptr[idx]);
 9053|      0|        case JS_CLASS_UINT8C_ARRAY:
  ------------------
  |  Branch (9053:9): [True: 0, False: 343k]
  ------------------
 9054|      0|        case JS_CLASS_UINT8_ARRAY:
  ------------------
  |  Branch (9054:9): [True: 0, False: 343k]
  ------------------
 9055|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9056|      0|            return JS_NewInt32(ctx, p->u.array.u.uint8_ptr[idx]);
 9057|      0|        case JS_CLASS_INT16_ARRAY:
  ------------------
  |  Branch (9057:9): [True: 0, False: 343k]
  ------------------
 9058|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9059|      0|            return JS_NewInt32(ctx, p->u.array.u.int16_ptr[idx]);
 9060|      0|        case JS_CLASS_UINT16_ARRAY:
  ------------------
  |  Branch (9060:9): [True: 0, False: 343k]
  ------------------
 9061|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9062|      0|            return JS_NewInt32(ctx, p->u.array.u.uint16_ptr[idx]);
 9063|      0|        case JS_CLASS_INT32_ARRAY:
  ------------------
  |  Branch (9063:9): [True: 0, False: 343k]
  ------------------
 9064|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9065|      0|            return JS_NewInt32(ctx, p->u.array.u.int32_ptr[idx]);
 9066|      0|        case JS_CLASS_UINT32_ARRAY:
  ------------------
  |  Branch (9066:9): [True: 0, False: 343k]
  ------------------
 9067|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9068|      0|            return JS_NewUint32(ctx, p->u.array.u.uint32_ptr[idx]);
 9069|      0|        case JS_CLASS_BIG_INT64_ARRAY:
  ------------------
  |  Branch (9069:9): [True: 0, False: 343k]
  ------------------
 9070|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9071|      0|            return JS_NewBigInt64(ctx, p->u.array.u.int64_ptr[idx]);
 9072|      0|        case JS_CLASS_BIG_UINT64_ARRAY:
  ------------------
  |  Branch (9072:9): [True: 0, False: 343k]
  ------------------
 9073|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9074|      0|            return JS_NewBigUint64(ctx, p->u.array.u.uint64_ptr[idx]);
 9075|      0|        case JS_CLASS_FLOAT16_ARRAY:
  ------------------
  |  Branch (9075:9): [True: 0, False: 343k]
  ------------------
 9076|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9077|      0|            return __JS_NewFloat64(ctx, fromfp16(p->u.array.u.fp16_ptr[idx]));
 9078|      0|        case JS_CLASS_FLOAT32_ARRAY:
  ------------------
  |  Branch (9078:9): [True: 0, False: 343k]
  ------------------
 9079|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9080|      0|            return __JS_NewFloat64(ctx, p->u.array.u.float_ptr[idx]);
 9081|      0|        case JS_CLASS_FLOAT64_ARRAY:
  ------------------
  |  Branch (9081:9): [True: 0, False: 343k]
  ------------------
 9082|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9083|      0|            return __JS_NewFloat64(ctx, p->u.array.u.double_ptr[idx]);
 9084|      0|        default:
  ------------------
  |  Branch (9084:9): [True: 0, False: 343k]
  ------------------
 9085|      0|            goto slow_path;
 9086|   343k|        }
 9087|   343k|    } else {
 9088|      4|    slow_path:
 9089|       |        /* ToObject() must be done before ToPropertyKey() */
 9090|      4|        if (JS_IsNull(this_obj) || JS_IsUndefined(this_obj)) {
  ------------------
  |  Branch (9090:13): [True: 0, False: 4]
  |  Branch (9090:36): [True: 0, False: 4]
  ------------------
 9091|      0|            JS_FreeValue(ctx, prop);
 9092|      0|            return JS_ThrowTypeError(ctx, "cannot read property of %s", JS_IsNull(this_obj) ? "null" : "undefined");
  ------------------
  |  Branch (9092:73): [True: 0, False: 0]
  ------------------
 9093|      0|        }
 9094|      4|        atom = JS_ValueToAtom(ctx, prop);
 9095|      4|        JS_FreeValue(ctx, prop);
 9096|      4|        if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      4|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 4]
  |  |  ------------------
  ------------------
 9097|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 9098|      4|        ret = JS_GetProperty(ctx, this_obj, atom);
 9099|      4|        JS_FreeAtom(ctx, atom);
 9100|      4|        return ret;
 9101|      4|    }
 9102|   343k|}
quickjs.c:add_fast_array_element:
 9544|   343k|{
 9545|   343k|    uint32_t new_len, array_len;
 9546|       |    /* extend the array by one */
 9547|       |    /* XXX: convert to slow array if new_len > 2^31-1 elements */
 9548|   343k|    new_len = p->u.array.count + 1;
 9549|       |    /* update the length if necessary. We assume that if the length is
 9550|       |       not an integer, then if it >= 2^31.  */
 9551|   343k|    if (likely(JS_VALUE_GET_TAG(p->prop[0].u.value) == JS_TAG_INT)) {
  ------------------
  |  |   32|   343k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 343k, False: 0]
  |  |  ------------------
  ------------------
 9552|   343k|        array_len = JS_VALUE_GET_INT(p->prop[0].u.value);
  ------------------
  |  |  239|   343k|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
 9553|   343k|        if (new_len > array_len) {
  ------------------
  |  Branch (9553:13): [True: 343k, False: 0]
  ------------------
 9554|   343k|            if (unlikely(!(get_shape_prop(p->shape)->flags & JS_PROP_WRITABLE))) {
  ------------------
  |  |   33|   343k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 343k]
  |  |  ------------------
  ------------------
 9555|      0|                JS_FreeValue(ctx, val);
 9556|      0|                return JS_ThrowTypeErrorReadOnly(ctx, flags, JS_ATOM_length);
 9557|      0|            }
 9558|   343k|            p->prop[0].u.value = JS_NewInt32(ctx, new_len);
 9559|   343k|        }
 9560|   343k|    }
 9561|   343k|    if (unlikely(new_len > p->u.array.u1.size)) {
  ------------------
  |  |   33|   343k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 67, False: 343k]
  |  |  ------------------
  ------------------
 9562|     67|        if (expand_fast_array(ctx, p, new_len)) {
  ------------------
  |  Branch (9562:13): [True: 0, False: 67]
  ------------------
 9563|      0|            JS_FreeValue(ctx, val);
 9564|      0|            return -1;
 9565|      0|        }
 9566|     67|    }
 9567|   343k|    p->u.array.u.values[new_len - 1] = val;
 9568|   343k|    p->u.array.count = new_len;
 9569|   343k|    return TRUE;
 9570|   343k|}
quickjs.c:expand_fast_array:
 9525|     71|{
 9526|     71|    uint32_t new_size;
 9527|     71|    size_t slack;
 9528|     71|    JSValue *new_array_prop;
 9529|       |    /* XXX: potential arithmetic overflow */
 9530|     71|    new_size = max_int(new_len, p->u.array.u1.size * 3 / 2);
 9531|     71|    new_array_prop = js_realloc2(ctx, p->u.array.u.values, sizeof(JSValue) * new_size, &slack);
 9532|     71|    if (!new_array_prop)
  ------------------
  |  Branch (9532:9): [True: 0, False: 71]
  ------------------
 9533|      0|        return -1;
 9534|     71|    new_size += slack / sizeof(*new_array_prop);
 9535|     71|    p->u.array.u.values = new_array_prop;
 9536|     71|    p->u.array.u1.size = new_size;
 9537|     71|    return 0;
 9538|     71|}
quickjs.c:add_property:
 9181|  19.4k|{
 9182|  19.4k|    JSShape *sh, *new_sh;
 9183|       |
 9184|  19.4k|    if (unlikely(__JS_AtomIsTaggedInt(prop))) {
  ------------------
  |  |   33|  19.4k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 12, False: 19.4k]
  |  |  ------------------
  ------------------
 9185|       |        /* update is_std_array_prototype */
 9186|     12|        if (unlikely(p->is_std_array_prototype)) {
  ------------------
  |  |   33|     12|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 12]
  |  |  ------------------
  ------------------
 9187|      0|            p->is_std_array_prototype = FALSE;
 9188|     12|        } else if (unlikely(p->has_immutable_prototype)) {
  ------------------
  |  |   33|     12|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 12]
  |  |  ------------------
  ------------------
 9189|      0|            struct list_head *el;
 9190|       |            
 9191|       |            /* modifying Object.prototype : reset the corresponding is_std_array_prototype */
 9192|      0|            list_for_each(el, &ctx->rt->context_list) {
  ------------------
  |  |   86|      0|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9193|      0|                JSContext *ctx1 = list_entry(el, JSContext, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 9194|      0|                if (JS_IsObject(ctx1->class_proto[JS_CLASS_OBJECT]) && 
  ------------------
  |  Branch (9194:21): [True: 0, False: 0]
  ------------------
 9195|      0|                    JS_VALUE_GET_OBJ(ctx1->class_proto[JS_CLASS_OBJECT]) == p) {
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
  |  Branch (9195:21): [True: 0, False: 0]
  ------------------
 9196|      0|                    if (JS_IsObject(ctx1->class_proto[JS_CLASS_ARRAY])) {
  ------------------
  |  Branch (9196:25): [True: 0, False: 0]
  ------------------
 9197|      0|                        JSObject *p1 = JS_VALUE_GET_OBJ(ctx1->class_proto[JS_CLASS_ARRAY]);
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9198|      0|                        p1->is_std_array_prototype = FALSE;
 9199|      0|                    }
 9200|      0|                    break;
 9201|      0|                }
 9202|      0|            }
 9203|      0|        }
 9204|     12|    }
 9205|  19.4k|    sh = p->shape;
 9206|  19.4k|    if (sh->is_hashed) {
  ------------------
  |  Branch (9206:9): [True: 6.15k, False: 13.3k]
  ------------------
 9207|       |        /* try to find an existing shape */
 9208|  6.15k|        new_sh = find_hashed_shape_prop(ctx->rt, sh, prop, prop_flags);
 9209|  6.15k|        if (new_sh) {
  ------------------
  |  Branch (9209:13): [True: 2.01k, False: 4.14k]
  ------------------
 9210|       |            /* matching shape found: use it */
 9211|       |            /*  the property array may need to be resized */
 9212|  2.01k|            if (new_sh->prop_size != sh->prop_size) {
  ------------------
  |  Branch (9212:17): [True: 2, False: 2.01k]
  ------------------
 9213|      2|                JSProperty *new_prop;
 9214|      2|                new_prop = js_realloc(ctx, p->prop, sizeof(p->prop[0]) *
 9215|      2|                                      new_sh->prop_size);
 9216|      2|                if (!new_prop)
  ------------------
  |  Branch (9216:21): [True: 0, False: 2]
  ------------------
 9217|      0|                    return NULL;
 9218|      2|                p->prop = new_prop;
 9219|      2|            }
 9220|  2.01k|            p->shape = js_dup_shape(new_sh);
 9221|  2.01k|            js_free_shape(ctx->rt, sh);
 9222|  2.01k|            return &p->prop[new_sh->prop_count - 1];
 9223|  4.14k|        } else if (js_rc(sh)->ref_count != 1) {
  ------------------
  |  Branch (9223:20): [True: 1.01k, False: 3.12k]
  ------------------
 9224|       |            /* if the shape is shared, clone it */
 9225|  1.01k|            new_sh = js_clone_shape(ctx, sh);
 9226|  1.01k|            if (!new_sh)
  ------------------
  |  Branch (9226:17): [True: 0, False: 1.01k]
  ------------------
 9227|      0|                return NULL;
 9228|       |            /* hash the cloned shape */
 9229|  1.01k|            new_sh->is_hashed = TRUE;
 9230|  1.01k|            js_shape_hash_link(ctx->rt, new_sh);
 9231|  1.01k|            js_free_shape(ctx->rt, p->shape);
 9232|  1.01k|            p->shape = new_sh;
 9233|  1.01k|        }
 9234|  6.15k|    }
 9235|  19.4k|    assert(js_rc(p->shape)->ref_count == 1);
  ------------------
  |  Branch (9235:5): [True: 0, False: 17.4k]
  |  Branch (9235:5): [True: 17.4k, False: 0]
  ------------------
 9236|  17.4k|    if (add_shape_property(ctx, &p->shape, p, prop, prop_flags))
  ------------------
  |  Branch (9236:9): [True: 0, False: 17.4k]
  ------------------
 9237|      0|        return NULL;
 9238|  17.4k|    return &p->prop[p->shape->prop_count - 1];
 9239|  17.4k|}
quickjs.c:find_hashed_shape_prop:
 5535|  6.15k|{
 5536|  6.15k|    JSShape *sh1;
 5537|  6.15k|    uint32_t h, h1, i, n;
 5538|       |
 5539|  6.15k|    h = sh->hash;
 5540|  6.15k|    h = shape_hash(h, atom);
 5541|  6.15k|    h = shape_hash(h, prop_flags);
 5542|  6.15k|    h1 = get_shape_hash(h, rt->shape_hash_bits);
 5543|  7.90k|    for(sh1 = rt->shape_hash[h1]; sh1 != NULL; sh1 = sh1->shape_hash_next) {
  ------------------
  |  Branch (5543:35): [True: 3.76k, False: 4.14k]
  ------------------
 5544|       |        /* we test the hash first so that the rest is done only if the
 5545|       |           shapes really match */
 5546|  3.76k|        if (sh1->hash == h &&
  ------------------
  |  Branch (5546:13): [True: 2.01k, False: 1.74k]
  ------------------
 5547|  2.01k|            sh1->proto == sh->proto &&
  ------------------
  |  Branch (5547:13): [True: 2.01k, False: 0]
  ------------------
 5548|  2.01k|            sh1->prop_count == ((n = sh->prop_count) + 1)) {
  ------------------
  |  Branch (5548:13): [True: 2.01k, False: 0]
  ------------------
 5549|  2.01k|            JSShapeProperty *prop = get_shape_prop(sh);
 5550|  2.01k|            JSShapeProperty *prop1 = get_shape_prop(sh1);
 5551|  4.02k|            for(i = 0; i < n; i++) {
  ------------------
  |  Branch (5551:24): [True: 2.01k, False: 2.01k]
  ------------------
 5552|  2.01k|                if (unlikely(prop1[i].atom != prop[i].atom) ||
  ------------------
  |  |   33|  4.02k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2.01k]
  |  |  ------------------
  ------------------
 5553|  2.01k|                    unlikely(prop1[i].flags != prop[i].flags))
  ------------------
  |  |   33|  2.01k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2.01k]
  |  |  ------------------
  ------------------
 5554|      0|                    goto next;
 5555|  2.01k|            }
 5556|  2.01k|            if (unlikely(prop1[n].atom != atom) ||
  ------------------
  |  |   33|  4.03k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2.01k]
  |  |  ------------------
  ------------------
 5557|  2.01k|                unlikely(prop1[n].flags != prop_flags))
  ------------------
  |  |   33|  2.01k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2.01k]
  |  |  ------------------
  ------------------
 5558|      0|                goto next;
 5559|  2.01k|            return sh1;
 5560|  2.01k|        }
 5561|  1.74k|    next: ;
 5562|  1.74k|    }
 5563|  4.14k|    return NULL;
 5564|  6.15k|}
quickjs.c:js_clone_shape:
 5269|  1.03k|{
 5270|  1.03k|    JSShape *sh;
 5271|  1.03k|    size_t size;
 5272|  1.03k|    JSShapeProperty *pr;
 5273|  1.03k|    uint32_t i, hash_size;
 5274|       |
 5275|  1.03k|    hash_size = sh1->prop_hash_mask + 1;
 5276|  1.03k|    size = get_shape_size(hash_size, sh1->prop_size);
 5277|  1.03k|    sh = js_malloc(ctx, size);
 5278|  1.03k|    if (!sh)
  ------------------
  |  Branch (5278:9): [True: 0, False: 1.03k]
  ------------------
 5279|      0|        return NULL;
 5280|  1.03k|    memcpy(&sh->header + 1, &sh1->header + 1,
 5281|  1.03k|           size - sizeof(JSGCObjectHeader));
 5282|  1.03k|    js_rc(sh)->ref_count = 1;
 5283|  1.03k|    add_gc_object(ctx->rt, &sh->header, JS_GC_OBJ_TYPE_SHAPE);
 5284|  1.03k|    sh->is_hashed = FALSE;
 5285|  1.03k|    if (sh->proto) {
  ------------------
  |  Branch (5285:9): [True: 1.03k, False: 0]
  ------------------
 5286|  1.03k|        JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, sh->proto));
  ------------------
  |  |  248|  1.03k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 5287|  1.03k|    }
 5288|  1.08k|    for(i = 0, pr = get_shape_prop(sh); i < sh->prop_count; i++, pr++) {
  ------------------
  |  Branch (5288:41): [True: 46, False: 1.03k]
  ------------------
 5289|     46|        JS_DupAtom(ctx, pr->atom);
 5290|     46|    }
 5291|  1.03k|    return sh;
 5292|  1.03k|}
quickjs.c:js_shape_hash_link:
 5192|  6.63k|{
 5193|  6.63k|    uint32_t h;
 5194|  6.63k|    h = get_shape_hash(sh->hash, rt->shape_hash_bits);
 5195|  6.63k|    sh->shape_hash_next = rt->shape_hash[h];
 5196|  6.63k|    rt->shape_hash[h] = sh;
 5197|  6.63k|    rt->shape_hash_count++;
 5198|  6.63k|}
quickjs.c:JS_CreateProperty:
10130|   353k|{
10131|   353k|    JSProperty *pr;
10132|   353k|    int ret, prop_flags;
10133|   353k|    JSVarRef *var_ref;
10134|   353k|    JSObject *delete_obj;
10135|       |    
10136|       |    /* add a new property or modify an existing exotic one */
10137|   353k|    if (p->is_exotic) {
  ------------------
  |  Branch (10137:9): [True: 343k, False: 10.2k]
  ------------------
10138|   343k|        if (p->class_id == JS_CLASS_ARRAY) {
  ------------------
  |  Branch (10138:13): [True: 343k, False: 170]
  ------------------
10139|   343k|            uint32_t idx, len;
10140|       |
10141|   343k|            if (p->fast_array) {
  ------------------
  |  Branch (10141:17): [True: 343k, False: 0]
  ------------------
10142|   343k|                if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (10142:21): [True: 343k, False: 40]
  ------------------
10143|   343k|                    idx = __JS_AtomToUInt32(prop);
10144|   343k|                    if (idx == p->u.array.count) {
  ------------------
  |  Branch (10144:25): [True: 343k, False: 0]
  ------------------
10145|   343k|                        if (!p->extensible)
  ------------------
  |  Branch (10145:29): [True: 0, False: 343k]
  ------------------
10146|      0|                            goto not_extensible;
10147|   343k|                        if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET))
  ------------------
  |  |  314|   343k|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                      if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET))
  ------------------
  |  |  315|   343k|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10147:29): [True: 0, False: 343k]
  ------------------
10148|      0|                            goto convert_to_array;
10149|   343k|                        prop_flags = get_prop_flags(flags, 0);
10150|   343k|                        if (prop_flags != JS_PROP_C_W_E)
  ------------------
  |  |  301|   343k|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|   343k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|   343k|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|   343k|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
  |  Branch (10150:29): [True: 12, False: 343k]
  ------------------
10151|     12|                            goto convert_to_array;
10152|   343k|                        return add_fast_array_element(ctx, p,
10153|   343k|                                                      JS_DupValue(ctx, val), flags);
10154|   343k|                    } else {
10155|      0|                        goto convert_to_array;
10156|      0|                    }
10157|   343k|                } else if (JS_AtomIsArrayIndex(ctx, &idx, prop)) {
  ------------------
  |  Branch (10157:28): [True: 0, False: 40]
  ------------------
10158|       |                    /* convert the fast array to normal array */
10159|     12|                convert_to_array:
10160|     12|                    if (convert_fast_array_to_array(ctx, p))
  ------------------
  |  Branch (10160:25): [True: 0, False: 12]
  ------------------
10161|      0|                        return -1;
10162|     12|                    goto generic_array;
10163|     12|                }
10164|   343k|            } else if (JS_AtomIsArrayIndex(ctx, &idx, prop)) {
  ------------------
  |  Branch (10164:24): [True: 0, False: 0]
  ------------------
10165|      0|                JSProperty *plen;
10166|      0|                JSShapeProperty *pslen;
10167|     12|            generic_array:
10168|       |                /* update the length field */
10169|     12|                plen = &p->prop[0];
10170|     12|                JS_ToUint32(ctx, &len, plen->u.value);
10171|     12|                if ((idx + 1) > len) {
  ------------------
  |  Branch (10171:21): [True: 12, False: 0]
  ------------------
10172|     12|                    pslen = get_shape_prop(p->shape);
10173|     12|                    if (unlikely(!(pslen->flags & JS_PROP_WRITABLE)))
  ------------------
  |  |   33|     12|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 12]
  |  |  ------------------
  ------------------
10174|      0|                        return JS_ThrowTypeErrorReadOnly(ctx, flags, JS_ATOM_length);
10175|       |                    /* XXX: should update the length after defining
10176|       |                       the property */
10177|     12|                    len = idx + 1;
10178|     12|                    set_value(ctx, &plen->u.value, JS_NewUint32(ctx, len));
10179|     12|                }
10180|     12|            }
10181|   343k|        } else if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (10181:20): [True: 0, False: 170]
  ------------------
10182|      0|                   p->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (10182:20): [True: 0, False: 0]
  ------------------
10183|      0|            ret = JS_AtomIsNumericIndex(ctx, prop);
10184|      0|            if (ret != 0) {
  ------------------
  |  Branch (10184:17): [True: 0, False: 0]
  ------------------
10185|      0|                if (ret < 0)
  ------------------
  |  Branch (10185:21): [True: 0, False: 0]
  ------------------
10186|      0|                    return -1;
10187|      0|                return JS_ThrowTypeErrorOrFalse(ctx, flags, "cannot create numeric index in typed array");
10188|      0|            }
10189|    170|        } else if (!(flags & JS_PROP_NO_EXOTIC)) {
  ------------------
  |  |  325|    170|#define JS_PROP_NO_EXOTIC        (1 << 16) /* internal use */
  ------------------
  |  Branch (10189:20): [True: 102, False: 68]
  ------------------
10190|    102|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
10191|    102|            if (em) {
  ------------------
  |  Branch (10191:17): [True: 102, False: 0]
  ------------------
10192|    102|                if (em->define_own_property) {
  ------------------
  |  Branch (10192:21): [True: 68, False: 34]
  ------------------
10193|     68|                    return em->define_own_property(ctx, JS_MKPTR(JS_TAG_OBJECT, p),
  ------------------
  |  |  248|     68|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
10194|     68|                                                   prop, val, getter, setter, flags);
10195|     68|                }
10196|     34|                ret = JS_IsExtensible(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|     34|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
10197|     34|                if (ret < 0)
  ------------------
  |  Branch (10197:21): [True: 0, False: 34]
  ------------------
10198|      0|                    return -1;
10199|     34|                if (!ret)
  ------------------
  |  Branch (10199:21): [True: 0, False: 34]
  ------------------
10200|      0|                    goto not_extensible;
10201|     34|            }
10202|    102|        }
10203|   343k|    }
10204|       |
10205|  10.3k|    if (!p->extensible) {
  ------------------
  |  Branch (10205:9): [True: 0, False: 10.3k]
  ------------------
10206|      0|    not_extensible:
10207|      0|        return JS_ThrowTypeErrorOrFalse(ctx, flags, "object is not extensible");
10208|      0|    }
10209|       |
10210|  10.3k|    var_ref = NULL;
10211|  10.3k|    delete_obj = NULL;
10212|  10.3k|    if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  314|  10.3k|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                  if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  315|  10.3k|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10212:9): [True: 731, False: 9.65k]
  ------------------
10213|    731|        prop_flags = (flags & (JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE)) |
  ------------------
  |  |  298|    731|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                      prop_flags = (flags & (JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE)) |
  ------------------
  |  |  300|    731|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
10214|    731|            JS_PROP_GETSET;
  ------------------
  |  |  305|    731|#define JS_PROP_GETSET         (1 << 4)
  ------------------
10215|  9.65k|    } else {
10216|  9.65k|        prop_flags = flags & JS_PROP_C_W_E;
  ------------------
  |  |  301|  9.65k|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|  9.65k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|  9.65k|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|  9.65k|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
10217|  9.65k|        if (p->class_id == JS_CLASS_GLOBAL_OBJECT) {
  ------------------
  |  Branch (10217:13): [True: 918, False: 8.74k]
  ------------------
10218|    918|            JSObject *p1 = JS_VALUE_GET_OBJ(p->u.global_object.uninitialized_vars);
  ------------------
  |  |  229|    918|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    918|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10219|    918|            JSShapeProperty *prs1;
10220|    918|            JSProperty *pr1;
10221|    918|            prs1 = find_own_property(&pr1, p1, prop);
10222|    918|            if (prs1) {
  ------------------
  |  Branch (10222:17): [True: 2, False: 916]
  ------------------
10223|      2|                delete_obj = p1;
10224|      2|                var_ref = pr1->u.var_ref;
10225|      2|                js_rc(var_ref)->ref_count++;
10226|    916|            } else {
10227|    916|                var_ref = js_create_var_ref(ctx, FALSE);
10228|    916|                if (!var_ref)
  ------------------
  |  Branch (10228:21): [True: 0, False: 916]
  ------------------
10229|      0|                    return -1;
10230|    916|            }
10231|    918|            var_ref->is_const = !(prop_flags & JS_PROP_WRITABLE);
  ------------------
  |  |  299|    918|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10232|    918|            prop_flags |= JS_PROP_VARREF;
  ------------------
  |  |  306|    918|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
10233|    918|        }
10234|  9.65k|    }
10235|  10.3k|    pr = add_property(ctx, p, prop, prop_flags);
10236|  10.3k|    if (unlikely(!pr)) {
  ------------------
  |  |   33|  10.3k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 10.3k]
  |  |  ------------------
  ------------------
10237|      0|        if (var_ref)
  ------------------
  |  Branch (10237:13): [True: 0, False: 0]
  ------------------
10238|      0|            free_var_ref(ctx->rt, var_ref);
10239|      0|        return -1;
10240|      0|    }
10241|  10.3k|    if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  314|  10.3k|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                  if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  315|  10.3k|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10241:9): [True: 731, False: 9.65k]
  ------------------
10242|    731|        pr->u.getset.getter = NULL;
10243|    731|        if ((flags & JS_PROP_HAS_GET) && JS_IsFunction(ctx, getter)) {
  ------------------
  |  |  314|    731|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
  |  Branch (10243:13): [True: 731, False: 0]
  |  Branch (10243:42): [True: 731, False: 0]
  ------------------
10244|    731|            pr->u.getset.getter =
10245|    731|                JS_VALUE_GET_OBJ(JS_DupValue(ctx, getter));
  ------------------
  |  |  229|    731|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    731|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10246|    731|        }
10247|    731|        pr->u.getset.setter = NULL;
10248|    731|        if ((flags & JS_PROP_HAS_SET) && JS_IsFunction(ctx, setter)) {
  ------------------
  |  |  315|    731|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10248:13): [True: 731, False: 0]
  |  Branch (10248:42): [True: 68, False: 663]
  ------------------
10249|     68|            pr->u.getset.setter =
10250|     68|                JS_VALUE_GET_OBJ(JS_DupValue(ctx, setter));
  ------------------
  |  |  229|     68|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     68|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10251|     68|        }
10252|  9.65k|    } else if (p->class_id == JS_CLASS_GLOBAL_OBJECT) {
  ------------------
  |  Branch (10252:16): [True: 918, False: 8.74k]
  ------------------
10253|    918|        if (delete_obj)
  ------------------
  |  Branch (10253:13): [True: 2, False: 916]
  ------------------
10254|      2|            delete_property(ctx, delete_obj, prop);
10255|    918|        pr->u.var_ref = var_ref;
10256|    918|        if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  316|    918|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10256:13): [True: 918, False: 0]
  ------------------
10257|    918|            *var_ref->pvalue = JS_DupValue(ctx, val);
10258|    918|        } else {
10259|      0|            *var_ref->pvalue = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
10260|      0|        }
10261|  8.74k|    } else {
10262|  8.74k|        if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  316|  8.74k|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10262:13): [True: 8.74k, False: 0]
  ------------------
10263|  8.74k|            pr->u.value = JS_DupValue(ctx, val);
10264|  8.74k|        } else {
10265|      0|            pr->u.value = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
10266|      0|        }
10267|  8.74k|    }
10268|  10.3k|    return TRUE;
10269|  10.3k|}
quickjs.c:check_define_prop_flags:
10273|     53|{
10274|     53|    BOOL has_accessor, is_getset;
10275|       |
10276|     53|    if (!(prop_flags & JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  298|     53|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
  |  Branch (10276:9): [True: 0, False: 53]
  ------------------
10277|      0|        if ((flags & (JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE)) ==
  ------------------
  |  |  311|      0|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                      if ((flags & (JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE)) ==
  ------------------
  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
  |  Branch (10277:13): [True: 0, False: 0]
  ------------------
10278|      0|            (JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  311|      0|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                          (JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
10279|      0|            return FALSE;
10280|      0|        }
10281|      0|        if ((flags & JS_PROP_HAS_ENUMERABLE) &&
  ------------------
  |  |  313|      0|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
  |  Branch (10281:13): [True: 0, False: 0]
  ------------------
10282|      0|            (flags & JS_PROP_ENUMERABLE) != (prop_flags & JS_PROP_ENUMERABLE))
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                          (flags & JS_PROP_ENUMERABLE) != (prop_flags & JS_PROP_ENUMERABLE))
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
  |  Branch (10282:13): [True: 0, False: 0]
  ------------------
10283|      0|            return FALSE;
10284|      0|        if (flags & (JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE |
  ------------------
  |  |  316|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
                      if (flags & (JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE |
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
  |  Branch (10284:13): [True: 0, False: 0]
  ------------------
10285|      0|                     JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                   JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  315|      0|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
10286|      0|            has_accessor = ((flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) != 0);
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                          has_accessor = ((flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) != 0);
  ------------------
  |  |  315|      0|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
10287|      0|            is_getset = ((prop_flags & JS_PROP_TMASK) == JS_PROP_GETSET);
  ------------------
  |  |  303|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                          is_getset = ((prop_flags & JS_PROP_TMASK) == JS_PROP_GETSET);
  ------------------
  |  |  305|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
10288|      0|            if (has_accessor != is_getset)
  ------------------
  |  Branch (10288:17): [True: 0, False: 0]
  ------------------
10289|      0|                return FALSE;
10290|      0|            if (!is_getset && !(prop_flags & JS_PROP_WRITABLE)) {
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (10290:17): [True: 0, False: 0]
  |  Branch (10290:31): [True: 0, False: 0]
  ------------------
10291|       |                /* not writable: cannot set the writable bit */
10292|      0|                if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) ==
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
                              if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) ==
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (10292:21): [True: 0, False: 0]
  ------------------
10293|      0|                    (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE))
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
                                  (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE))
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10294|      0|                    return FALSE;
10295|      0|            }
10296|      0|        }
10297|      0|    }
10298|     53|    return TRUE;
10299|     53|}
quickjs.c:js_shape_prepare_update:
10304|    284|{
10305|    284|    JSShape *sh;
10306|    284|    uint32_t idx = 0;    /* prevent warning */
10307|       |
10308|    284|    sh = p->shape;
10309|    284|    if (sh->is_hashed) {
  ------------------
  |  Branch (10309:9): [True: 29, False: 255]
  ------------------
10310|     29|        if (js_rc(sh)->ref_count != 1) {
  ------------------
  |  Branch (10310:13): [True: 23, False: 6]
  ------------------
10311|     23|            if (pprs)
  ------------------
  |  Branch (10311:17): [True: 17, False: 6]
  ------------------
10312|     17|                idx = *pprs - get_shape_prop(sh);
10313|       |            /* clone the shape (the resulting one is no longer hashed) */
10314|     23|            sh = js_clone_shape(ctx, sh);
10315|     23|            if (!sh)
  ------------------
  |  Branch (10315:17): [True: 0, False: 23]
  ------------------
10316|      0|                return -1;
10317|     23|            js_free_shape(ctx->rt, p->shape);
10318|     23|            p->shape = sh;
10319|     23|            if (pprs)
  ------------------
  |  Branch (10319:17): [True: 17, False: 6]
  ------------------
10320|     17|                *pprs = get_shape_prop(sh) + idx;
10321|     23|        } else {
10322|      6|            js_shape_hash_unlink(ctx->rt, sh);
10323|      6|            sh->is_hashed = FALSE;
10324|      6|        }
10325|     29|    }
10326|    284|    return 0;
10327|    284|}
quickjs.c:free_var_ref:
 6165|  4.38k|{
 6166|  4.38k|    if (var_ref) {
  ------------------
  |  Branch (6166:9): [True: 4.38k, False: 0]
  ------------------
 6167|  4.38k|        assert(js_rc(var_ref)->ref_count > 0);
  ------------------
  |  Branch (6167:9): [True: 0, False: 4.38k]
  |  Branch (6167:9): [True: 4.38k, False: 0]
  ------------------
 6168|  4.38k|        if (--js_rc(var_ref)->ref_count == 0) {
  ------------------
  |  Branch (6168:13): [True: 2.68k, False: 1.70k]
  ------------------
 6169|  2.68k|            if (var_ref->is_detached) {
  ------------------
  |  Branch (6169:17): [True: 2.68k, False: 0]
  ------------------
 6170|  2.68k|                JS_FreeValueRT(rt, var_ref->value);
 6171|  2.68k|            } else {
 6172|      0|                JSStackFrame *sf = var_ref->stack_frame;
 6173|      0|                assert(sf->var_refs[var_ref->var_ref_idx] == var_ref);
  ------------------
  |  Branch (6173:17): [True: 0, False: 0]
  |  Branch (6173:17): [True: 0, False: 0]
  ------------------
 6174|      0|                sf->var_refs[var_ref->var_ref_idx] = NULL;
 6175|      0|                if (sf->js_mode & JS_MODE_ASYNC) {
  ------------------
  |  |  404|      0|#define JS_MODE_ASYNC  (1 << 2) /* async function */
  ------------------
  |  Branch (6175:21): [True: 0, False: 0]
  ------------------
 6176|      0|                    JSAsyncFunctionState *async_func = container_of(sf, JSAsyncFunctionState, frame);
  ------------------
  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 6177|      0|                    async_func_free(rt, async_func);
 6178|      0|                }
 6179|      0|            }
 6180|  2.68k|            remove_gc_object(&var_ref->header);
 6181|  2.68k|            js_free_rt(rt, var_ref);
 6182|  2.68k|        }
 6183|  4.38k|    }
 6184|  4.38k|}
quickjs.c:js_update_property_flags:
10331|     67|{
10332|     67|    if (flags != (*pprs)->flags) {
  ------------------
  |  Branch (10332:9): [True: 46, False: 21]
  ------------------
10333|     46|        if (js_shape_prepare_update(ctx, p, pprs))
  ------------------
  |  Branch (10333:13): [True: 0, False: 46]
  ------------------
10334|      0|            return -1;
10335|     46|        (*pprs)->flags = flags;
10336|     46|    }
10337|     67|    return 0;
10338|     67|}
quickjs.c:get_prop_flags:
10120|   343k|{
10121|   343k|    int mask;
10122|   343k|    mask = (flags >> JS_PROP_HAS_SHIFT) & JS_PROP_C_W_E;
  ------------------
  |  |  310|   343k|#define JS_PROP_HAS_SHIFT        8
  ------------------
                  mask = (flags >> JS_PROP_HAS_SHIFT) & JS_PROP_C_W_E;
  ------------------
  |  |  301|   343k|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|   343k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|   343k|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|   343k|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
10123|   343k|    return (flags & mask) | (def_flags & ~mask);
10124|   343k|}
quickjs.c:convert_fast_array_to_array:
 9246|     12|{
 9247|     12|    JSProperty *pr;
 9248|     12|    JSShape *sh;
 9249|     12|    uint32_t i, len, new_count;
 9250|       |
 9251|     12|    if (js_shape_prepare_update(ctx, p, NULL))
  ------------------
  |  Branch (9251:9): [True: 0, False: 12]
  ------------------
 9252|      0|        return -1;
 9253|     12|    len = p->u.array.count;
 9254|       |    /* resize the properties once to simplify the error handling */
 9255|     12|    sh = p->shape;
 9256|     12|    new_count = sh->prop_count + len;
 9257|     12|    if (new_count > sh->prop_size) {
  ------------------
  |  Branch (9257:9): [True: 0, False: 12]
  ------------------
 9258|      0|        if (resize_properties(ctx, &p->shape, p, new_count))
  ------------------
  |  Branch (9258:13): [True: 0, False: 0]
  ------------------
 9259|      0|            return -1;
 9260|      0|    }
 9261|       |
 9262|     12|    if (p->class_id == JS_CLASS_MAPPED_ARGUMENTS) {
  ------------------
  |  Branch (9262:9): [True: 0, False: 12]
  ------------------
 9263|      0|        JSVarRef **tab = p->u.array.u.var_refs;
 9264|      0|        for(i = 0; i < len; i++) {
  ------------------
  |  Branch (9264:20): [True: 0, False: 0]
  ------------------
 9265|       |            /* add_property cannot fail here but
 9266|       |               __JS_AtomFromUInt32(i) fails for i > INT32_MAX */
 9267|      0|            pr = add_property(ctx, p, __JS_AtomFromUInt32(i), JS_PROP_C_W_E | JS_PROP_VARREF);
  ------------------
  |  |  301|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                          pr = add_property(ctx, p, __JS_AtomFromUInt32(i), JS_PROP_C_W_E | JS_PROP_VARREF);
  ------------------
  |  |  306|      0|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
 9268|      0|            pr->u.var_ref = *tab++;
 9269|      0|        }
 9270|     12|    } else {
 9271|     12|        JSValue *tab = p->u.array.u.values;
 9272|     12|        for(i = 0; i < len; i++) {
  ------------------
  |  Branch (9272:20): [True: 0, False: 12]
  ------------------
 9273|       |            /* add_property cannot fail here but
 9274|       |               __JS_AtomFromUInt32(i) fails for i > INT32_MAX */
 9275|      0|            pr = add_property(ctx, p, __JS_AtomFromUInt32(i), JS_PROP_C_W_E);
  ------------------
  |  |  301|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
 9276|      0|            pr->u.value = *tab++;
 9277|      0|        }
 9278|     12|    }
 9279|     12|    js_free(ctx, p->u.array.u.values);
 9280|     12|    p->u.array.count = 0;
 9281|       |    p->u.array.u.values = NULL; /* fail safe */
 9282|     12|    p->u.array.u1.size = 0;
 9283|     12|    p->fast_array = 0;
 9284|     12|    p->is_std_array_prototype = FALSE;
 9285|     12|    return 0;
 9286|     12|}
quickjs.c:resize_properties:
 5336|    554|{
 5337|    554|    JSShape *sh;
 5338|    554|    uint32_t new_size, new_hash_size, new_hash_mask, i;
 5339|    554|    JSShapeProperty *pr;
 5340|    554|    intptr_t h;
 5341|    554|    JSShape *old_sh;
 5342|       |
 5343|    554|    sh = *psh;
 5344|    554|    new_size = max_int(count, sh->prop_size * 3 / 2);
 5345|       |    /* Reallocate prop array first to avoid crash or size inconsistency
 5346|       |       in case of memory allocation failure */
 5347|    554|    if (p) {
  ------------------
  |  Branch (5347:9): [True: 554, False: 0]
  ------------------
 5348|    554|        JSProperty *new_prop;
 5349|    554|        new_prop = js_realloc(ctx, p->prop, sizeof(new_prop[0]) * new_size);
 5350|    554|        if (unlikely(!new_prop))
  ------------------
  |  |   33|    554|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 554]
  |  |  ------------------
  ------------------
 5351|      0|            return -1;
 5352|    554|        p->prop = new_prop;
 5353|    554|    }
 5354|    554|    new_hash_size = sh->prop_hash_mask + 1;
 5355|    811|    while (new_hash_size < new_size)
  ------------------
  |  Branch (5355:12): [True: 257, False: 554]
  ------------------
 5356|    257|        new_hash_size = 2 * new_hash_size;
 5357|       |    /* resize the property shapes. Using js_realloc() is not possible in
 5358|       |       case the GC runs during the allocation */
 5359|    554|    old_sh = sh;
 5360|    554|    sh = js_malloc(ctx, get_shape_size(new_hash_size, new_size));
 5361|    554|    if (!sh)
  ------------------
  |  Branch (5361:9): [True: 0, False: 554]
  ------------------
 5362|      0|        return -1;
 5363|    554|    remove_gc_object(&old_sh->header);
 5364|       |
 5365|    554|    js_rc(sh)->ref_count = 1;
 5366|    554|    add_gc_object(ctx->rt, &sh->header, JS_GC_OBJ_TYPE_SHAPE);
 5367|       |
 5368|    554|    memcpy(&sh->header + 1, &old_sh->header + 1,
 5369|    554|           sizeof(JSShape) - sizeof(JSGCObjectHeader));
 5370|       |    
 5371|    554|    if (new_hash_size != (sh->prop_hash_mask + 1)) {
  ------------------
  |  Branch (5371:9): [True: 257, False: 297]
  ------------------
 5372|       |        /* resize the hash table and the properties */
 5373|    257|        new_hash_mask = new_hash_size - 1;
 5374|    257|        sh->prop_hash_mask = new_hash_mask;
 5375|    257|        memset(sh->hash_table, 0,
 5376|    257|               sizeof(sh->hash_table[0]) * new_hash_size);
 5377|    257|        memcpy(get_shape_prop(sh), get_shape_prop(old_sh),
 5378|    257|               sizeof(JSShapeProperty) * old_sh->prop_count);
 5379|  5.06k|        for(i = 0, pr = get_shape_prop(sh); i < sh->prop_count; i++, pr++) {
  ------------------
  |  Branch (5379:45): [True: 4.80k, False: 257]
  ------------------
 5380|  4.80k|            if (pr->atom != JS_ATOM_NULL) {
  ------------------
  |  |  451|  4.80k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (5380:17): [True: 4.80k, False: 0]
  ------------------
 5381|  4.80k|                h = ((uintptr_t)pr->atom & new_hash_mask);
 5382|  4.80k|                pr->hash_next = sh->hash_table[h];
 5383|  4.80k|                sh->hash_table[h] = i + 1;
 5384|  4.80k|            }
 5385|  4.80k|        }
 5386|    297|    } else {
 5387|       |        /* just copy the previous hash table and the properties */
 5388|    297|        memcpy(sh->hash_table, old_sh->hash_table,
 5389|    297|               sizeof(sh->hash_table[0]) * new_hash_size);
 5390|       |
 5391|    297|        memcpy(get_shape_prop(sh), get_shape_prop(old_sh),
 5392|    297|               sizeof(JSShapeProperty) * old_sh->prop_count);
 5393|    297|    }
 5394|    554|    js_free(ctx, old_sh);
 5395|    554|    *psh = sh;
 5396|    554|    sh->prop_size = new_size;
 5397|    554|    return 0;
 5398|    554|}
quickjs.c:delete_property:
 9312|      2|{
 9313|      2|    JSShape *sh;
 9314|      2|    JSShapeProperty *pr, *lpr, *prop;
 9315|      2|    JSProperty *pr1;
 9316|      2|    uint32_t lpr_idx;
 9317|      2|    intptr_t h, h1;
 9318|       |
 9319|      2| redo:
 9320|      2|    sh = p->shape;
 9321|      2|    h1 = atom & sh->prop_hash_mask;
 9322|      2|    h = sh->hash_table[h1];
 9323|      2|    prop = get_shape_prop(sh);
 9324|      2|    lpr = NULL;
 9325|      2|    lpr_idx = 0;   /* prevent warning */
 9326|      2|    while (h != 0) {
  ------------------
  |  Branch (9326:12): [True: 2, False: 0]
  ------------------
 9327|      2|        pr = &prop[h - 1];
 9328|      2|        if (likely(pr->atom == atom)) {
  ------------------
  |  |   32|      2|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 2, False: 0]
  |  |  ------------------
  ------------------
 9329|       |            /* found ! */
 9330|      2|            if (!(pr->flags & JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|      2|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
  |  Branch (9330:17): [True: 0, False: 2]
  ------------------
 9331|      0|                return FALSE;
 9332|       |            /* realloc the shape if needed */
 9333|      2|            if (lpr)
  ------------------
  |  Branch (9333:17): [True: 0, False: 2]
  ------------------
 9334|      0|                lpr_idx = lpr - get_shape_prop(sh);
 9335|      2|            if (js_shape_prepare_update(ctx, p, &pr))
  ------------------
  |  Branch (9335:17): [True: 0, False: 2]
  ------------------
 9336|      0|                return -1;
 9337|      2|            sh = p->shape;
 9338|       |            /* remove property */
 9339|      2|            if (lpr) {
  ------------------
  |  Branch (9339:17): [True: 0, False: 2]
  ------------------
 9340|      0|                lpr = get_shape_prop(sh) + lpr_idx;
 9341|      0|                lpr->hash_next = pr->hash_next;
 9342|      2|            } else {
 9343|      2|                sh->hash_table[h1] = pr->hash_next;
 9344|      2|            }
 9345|      2|            sh->deleted_prop_count++;
 9346|       |            /* free the entry */
 9347|      2|            pr1 = &p->prop[h - 1];
 9348|      2|            if (unlikely(p->class_id == JS_CLASS_GLOBAL_OBJECT)) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 9349|      0|                if ((pr->flags & JS_PROP_TMASK) == JS_PROP_VARREF)
  ------------------
  |  |  303|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              if ((pr->flags & JS_PROP_TMASK) == JS_PROP_VARREF)
  ------------------
  |  |  306|      0|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (9349:21): [True: 0, False: 0]
  ------------------
 9350|      0|                    if (remove_global_object_property(ctx, p, pr, pr1))
  ------------------
  |  Branch (9350:25): [True: 0, False: 0]
  ------------------
 9351|      0|                        return -1;
 9352|      0|            }
 9353|      2|            free_property(ctx->rt, pr1, pr->flags);
 9354|      2|            JS_FreeAtom(ctx, pr->atom);
 9355|       |            /* put default values */
 9356|      2|            pr->flags = 0;
 9357|      2|            pr->atom = JS_ATOM_NULL;
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
 9358|      2|            pr1->u.value = JS_UNDEFINED;
  ------------------
  |  |  291|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 9359|       |
 9360|       |            /* compact the properties if too many deleted properties */
 9361|      2|            if (sh->deleted_prop_count >= 8 &&
  ------------------
  |  Branch (9361:17): [True: 0, False: 2]
  ------------------
 9362|      0|                sh->deleted_prop_count >= ((unsigned)sh->prop_count / 2)) {
  ------------------
  |  Branch (9362:17): [True: 0, False: 0]
  ------------------
 9363|      0|                compact_properties(ctx, p);
 9364|      0|            }
 9365|      2|            return TRUE;
 9366|      2|        }
 9367|      0|        lpr = pr;
 9368|      0|        h = pr->hash_next;
 9369|      0|    }
 9370|       |
 9371|      0|    if (p->is_exotic) {
  ------------------
  |  Branch (9371:9): [True: 0, False: 0]
  ------------------
 9372|      0|        if (p->fast_array) {
  ------------------
  |  Branch (9372:13): [True: 0, False: 0]
  ------------------
 9373|      0|            uint32_t idx;
 9374|      0|            if (JS_AtomIsArrayIndex(ctx, &idx, atom) &&
  ------------------
  |  Branch (9374:17): [True: 0, False: 0]
  ------------------
 9375|      0|                idx < p->u.array.count) {
  ------------------
  |  Branch (9375:17): [True: 0, False: 0]
  ------------------
 9376|      0|                if (p->class_id == JS_CLASS_ARRAY ||
  ------------------
  |  Branch (9376:21): [True: 0, False: 0]
  ------------------
 9377|      0|                    p->class_id == JS_CLASS_ARGUMENTS ||
  ------------------
  |  Branch (9377:21): [True: 0, False: 0]
  ------------------
 9378|      0|                    p->class_id == JS_CLASS_MAPPED_ARGUMENTS) {
  ------------------
  |  Branch (9378:21): [True: 0, False: 0]
  ------------------
 9379|       |                    /* Special case deleting the last element of a fast Array */
 9380|      0|                    if (idx == p->u.array.count - 1) {
  ------------------
  |  Branch (9380:25): [True: 0, False: 0]
  ------------------
 9381|      0|                        if (p->class_id == JS_CLASS_MAPPED_ARGUMENTS) {
  ------------------
  |  Branch (9381:29): [True: 0, False: 0]
  ------------------
 9382|      0|                            free_var_ref(ctx->rt, p->u.array.u.var_refs[idx]);
 9383|      0|                        } else {
 9384|      0|                            JS_FreeValue(ctx, p->u.array.u.values[idx]);
 9385|      0|                        }
 9386|      0|                        p->u.array.count = idx;
 9387|      0|                        return TRUE;
 9388|      0|                    }
 9389|      0|                    if (convert_fast_array_to_array(ctx, p))
  ------------------
  |  Branch (9389:25): [True: 0, False: 0]
  ------------------
 9390|      0|                        return -1;
 9391|      0|                    goto redo;
 9392|      0|                } else {
 9393|      0|                    return FALSE;
 9394|      0|                }
 9395|      0|            }
 9396|      0|        } else {
 9397|      0|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 9398|      0|            if (em && em->delete_property) {
  ------------------
  |  Branch (9398:17): [True: 0, False: 0]
  |  Branch (9398:23): [True: 0, False: 0]
  ------------------
 9399|      0|                return em->delete_property(ctx, JS_MKPTR(JS_TAG_OBJECT, p), atom);
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 9400|      0|            }
 9401|      0|        }
 9402|      0|    }
 9403|       |    /* not found */
 9404|      0|    return TRUE;
 9405|      0|}
quickjs.c:is_strict_mode:
 2863|      2|{
 2864|      2|    JSStackFrame *sf = ctx->rt->current_stack_frame;
 2865|      2|    return (sf && (sf->js_mode & JS_MODE_STRICT));
  ------------------
  |  |  403|      2|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (2865:13): [True: 2, False: 0]
  |  Branch (2865:19): [True: 0, False: 2]
  ------------------
 2866|      2|}
quickjs.c:JS_ToBoolFree:
11161|     20|{
11162|     20|    uint32_t tag = JS_VALUE_GET_TAG(val);
  ------------------
  |  |  236|     20|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
11163|     20|    switch(tag) {
11164|      0|    case JS_TAG_INT:
  ------------------
  |  Branch (11164:5): [True: 0, False: 20]
  ------------------
11165|      0|        return JS_VALUE_GET_INT(val) != 0;
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
11166|     16|    case JS_TAG_BOOL:
  ------------------
  |  Branch (11166:5): [True: 16, False: 4]
  ------------------
11167|     16|    case JS_TAG_NULL:
  ------------------
  |  Branch (11167:5): [True: 0, False: 20]
  ------------------
11168|     16|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (11168:5): [True: 0, False: 20]
  ------------------
11169|     16|        return JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|     16|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
11170|      0|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (11170:5): [True: 0, False: 20]
  ------------------
11171|      0|        return -1;
11172|      2|    case JS_TAG_STRING:
  ------------------
  |  Branch (11172:5): [True: 2, False: 18]
  ------------------
11173|      2|        {
11174|      2|            BOOL ret = JS_VALUE_GET_STRING(val)->len != 0;
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
11175|      2|            JS_FreeValue(ctx, val);
11176|      2|            return ret;
11177|     16|        }
11178|      0|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (11178:5): [True: 0, False: 20]
  ------------------
11179|      0|        {
11180|      0|            BOOL ret = JS_VALUE_GET_STRING_ROPE(val)->len != 0;
  ------------------
  |  |  231|      0|#define JS_VALUE_GET_STRING_ROPE(v) ((JSStringRope *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
11181|      0|            JS_FreeValue(ctx, val);
11182|      0|            return ret;
11183|     16|        }
11184|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (11184:5): [True: 0, False: 20]
  ------------------
11185|      0|        return JS_VALUE_GET_SHORT_BIG_INT(val) != 0;
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
11186|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (11186:5): [True: 0, False: 20]
  ------------------
11187|      0|        {
11188|      0|            JSBigInt *p = JS_VALUE_GET_PTR(val);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
11189|      0|            BOOL ret;
11190|      0|            int i;
11191|       |            
11192|       |            /* fail safe: we assume it is not necessarily
11193|       |               normalized. Beginning from the MSB ensures that the
11194|       |               test is fast. */
11195|      0|            ret = FALSE;
11196|      0|            for(i = p->len - 1; i >= 0; i--) {
  ------------------
  |  Branch (11196:33): [True: 0, False: 0]
  ------------------
11197|      0|                if (p->tab[i] != 0) {
  ------------------
  |  Branch (11197:21): [True: 0, False: 0]
  ------------------
11198|      0|                    ret = TRUE;
11199|      0|                    break;
11200|      0|                }
11201|      0|            }
11202|      0|            JS_FreeValue(ctx, val);
11203|      0|            return ret;
11204|     16|        }
11205|      2|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (11205:5): [True: 2, False: 18]
  ------------------
11206|      2|        {
11207|      2|            JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
11208|      2|            BOOL ret;
11209|      2|            ret = !p->is_HTMLDDA;
11210|      2|            JS_FreeValue(ctx, val);
11211|      2|            return ret;
11212|     16|        }
11213|      0|        break;
11214|      0|    default:
  ------------------
  |  Branch (11214:5): [True: 0, False: 20]
  ------------------
11215|      0|        if (JS_TAG_IS_FLOAT64(tag)) {
  ------------------
  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
11216|      0|            double d = JS_VALUE_GET_FLOAT64(val);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
11217|      0|            return !isnan(d) && d != 0;
  ------------------
  |  Branch (11217:20): [True: 0, False: 0]
  |  Branch (11217:33): [True: 0, False: 0]
  ------------------
11218|      0|        } else {
11219|      0|            JS_FreeValue(ctx, val);
11220|      0|            return TRUE;
11221|      0|        }
11222|     20|    }
11223|     20|}
quickjs.c:JS_ToNumberHintFree:
12948|     10|{
12949|     10|    uint32_t tag;
12950|     10|    JSValue ret;
12951|       |
12952|     13| redo:
12953|     13|    tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  238|     13|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|     13|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
12954|     13|    switch(tag) {
12955|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (12955:5): [True: 0, False: 13]
  ------------------
12956|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (12956:5): [True: 0, False: 13]
  ------------------
12957|      0|        if (flag != TON_FLAG_NUMERIC) {
  ------------------
  |  Branch (12957:13): [True: 0, False: 0]
  ------------------
12958|      0|            JS_FreeValue(ctx, val);
12959|      0|            return JS_ThrowTypeError(ctx, "cannot convert bigint to number");
12960|      0|        }
12961|      0|        ret = val;
12962|      0|        break;
12963|      2|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (12963:5): [True: 2, False: 11]
  ------------------
12964|      4|    case JS_TAG_INT:
  ------------------
  |  Branch (12964:5): [True: 2, False: 11]
  ------------------
12965|      4|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (12965:5): [True: 0, False: 13]
  ------------------
12966|      4|        ret = val;
12967|      4|        break;
12968|      0|    case JS_TAG_BOOL:
  ------------------
  |  Branch (12968:5): [True: 0, False: 13]
  ------------------
12969|      0|    case JS_TAG_NULL:
  ------------------
  |  Branch (12969:5): [True: 0, False: 13]
  ------------------
12970|      0|        ret = JS_NewInt32(ctx, JS_VALUE_GET_INT(val));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
12971|      0|        break;
12972|      1|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (12972:5): [True: 1, False: 12]
  ------------------
12973|      1|        ret = JS_NAN;
  ------------------
  |  |  252|      1|#define JS_NAN (JSValue){ .u.float64 = JS_FLOAT64_NAN, JS_TAG_FLOAT64 }
  |  |  ------------------
  |  |  |  |  103|      1|#define JS_FLOAT64_NAN NAN
  |  |  ------------------
  ------------------
12974|      1|        break;
12975|      3|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (12975:5): [True: 3, False: 10]
  ------------------
12976|      3|        val = JS_ToPrimitiveFree(ctx, val, HINT_NUMBER);
  ------------------
  |  | 1245|      3|#define HINT_NUMBER  1
  ------------------
12977|      3|        if (JS_IsException(val))
  ------------------
  |  Branch (12977:13): [True: 0, False: 3]
  ------------------
12978|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
12979|      3|        goto redo;
12980|      4|    case JS_TAG_STRING:
  ------------------
  |  Branch (12980:5): [True: 4, False: 9]
  ------------------
12981|      5|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (12981:5): [True: 1, False: 12]
  ------------------
12982|      5|        {
12983|      5|            const char *str;
12984|      5|            const char *p;
12985|      5|            size_t len;
12986|       |
12987|      5|            str = JS_ToCStringLen(ctx, &len, val);
12988|      5|            JS_FreeValue(ctx, val);
12989|      5|            if (!str)
  ------------------
  |  Branch (12989:17): [True: 0, False: 5]
  ------------------
12990|      0|                return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
12991|      5|            p = str;
12992|      5|            p += skip_spaces(p);
12993|      5|            if ((p - str) == len) {
  ------------------
  |  Branch (12993:17): [True: 0, False: 5]
  ------------------
12994|      0|                ret = JS_NewInt32(ctx, 0);
12995|      5|            } else {
12996|      5|                int flags = ATOD_ACCEPT_BIN_OCT;
  ------------------
  |  |12746|      5|#define ATOD_ACCEPT_BIN_OCT  (1 << 2)
  ------------------
12997|      5|                ret = js_atof(ctx, p, &p, 0, flags);
12998|      5|                if (!JS_IsException(ret)) {
  ------------------
  |  Branch (12998:21): [True: 5, False: 0]
  ------------------
12999|      5|                    p += skip_spaces(p);
13000|      5|                    if ((p - str) != len) {
  ------------------
  |  Branch (13000:25): [True: 5, False: 0]
  ------------------
13001|      5|                        JS_FreeValue(ctx, ret);
13002|      5|                        ret = JS_NAN;
  ------------------
  |  |  252|      5|#define JS_NAN (JSValue){ .u.float64 = JS_FLOAT64_NAN, JS_TAG_FLOAT64 }
  |  |  ------------------
  |  |  |  |  103|      5|#define JS_FLOAT64_NAN NAN
  |  |  ------------------
  ------------------
13003|      5|                    }
13004|      5|                }
13005|      5|            }
13006|      5|            JS_FreeCString(ctx, str);
13007|      5|        }
13008|      0|        break;
13009|      0|    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (13009:5): [True: 0, False: 13]
  ------------------
13010|      0|        JS_FreeValue(ctx, val);
13011|      0|        return JS_ThrowTypeError(ctx, "cannot convert symbol to number");
13012|      0|    default:
  ------------------
  |  Branch (13012:5): [True: 0, False: 13]
  ------------------
13013|      0|        JS_FreeValue(ctx, val);
13014|      0|        ret = JS_NAN;
  ------------------
  |  |  252|      0|#define JS_NAN (JSValue){ .u.float64 = JS_FLOAT64_NAN, JS_TAG_FLOAT64 }
  |  |  ------------------
  |  |  |  |  103|      0|#define JS_FLOAT64_NAN NAN
  |  |  ------------------
  ------------------
13015|      0|        break;
13016|     13|    }
13017|     10|    return ret;
13018|     13|}
quickjs.c:JS_ToPrimitiveFree:
11064|      9|{
11065|      9|    int i;
11066|      9|    BOOL force_ordinary;
11067|       |
11068|      9|    JSAtom method_name;
11069|      9|    JSValue method, ret;
11070|      9|    if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      9|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (11070:9): [True: 1, False: 8]
  ------------------
11071|      1|        return val;
11072|      8|    force_ordinary = hint & HINT_FORCE_ORDINARY;
  ------------------
  |  | 1247|      8|#define HINT_FORCE_ORDINARY (1 << 4) // don't try Symbol.toPrimitive
  ------------------
11073|      8|    hint &= ~HINT_FORCE_ORDINARY;
  ------------------
  |  | 1247|      8|#define HINT_FORCE_ORDINARY (1 << 4) // don't try Symbol.toPrimitive
  ------------------
11074|      8|    if (!force_ordinary) {
  ------------------
  |  Branch (11074:9): [True: 8, False: 0]
  ------------------
11075|      8|        method = JS_GetProperty(ctx, val, JS_ATOM_Symbol_toPrimitive);
11076|      8|        if (JS_IsException(method))
  ------------------
  |  Branch (11076:13): [True: 0, False: 8]
  ------------------
11077|      0|            goto exception;
11078|       |        /* ECMA says *If exoticToPrim is not undefined* but tests in
11079|       |           test262 use null as a non callable converter */
11080|      8|        if (!JS_IsUndefined(method) && !JS_IsNull(method)) {
  ------------------
  |  Branch (11080:13): [True: 0, False: 8]
  |  Branch (11080:40): [True: 0, False: 0]
  ------------------
11081|      0|            JSAtom atom;
11082|      0|            JSValue arg;
11083|      0|            switch(hint) {
11084|      0|            case HINT_STRING:
  ------------------
  |  | 1244|      0|#define HINT_STRING  0
  ------------------
  |  Branch (11084:13): [True: 0, False: 0]
  ------------------
11085|      0|                atom = JS_ATOM_string;
11086|      0|                break;
11087|      0|            case HINT_NUMBER:
  ------------------
  |  | 1245|      0|#define HINT_NUMBER  1
  ------------------
  |  Branch (11087:13): [True: 0, False: 0]
  ------------------
11088|      0|                atom = JS_ATOM_number;
11089|      0|                break;
11090|      0|            default:
  ------------------
  |  Branch (11090:13): [True: 0, False: 0]
  ------------------
11091|      0|            case HINT_NONE:
  ------------------
  |  | 1246|      0|#define HINT_NONE    2
  ------------------
  |  Branch (11091:13): [True: 0, False: 0]
  ------------------
11092|      0|                atom = JS_ATOM_default;
11093|      0|                break;
11094|      0|            }
11095|      0|            arg = JS_AtomToString(ctx, atom);
11096|      0|            ret = JS_CallFree(ctx, method, val, 1, (JSValueConst *)&arg);
11097|      0|            JS_FreeValue(ctx, arg);
11098|      0|            if (JS_IsException(ret))
  ------------------
  |  Branch (11098:17): [True: 0, False: 0]
  ------------------
11099|      0|                goto exception;
11100|      0|            JS_FreeValue(ctx, val);
11101|      0|            if (JS_VALUE_GET_TAG(ret) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (11101:17): [True: 0, False: 0]
  ------------------
11102|      0|                return ret;
11103|      0|            JS_FreeValue(ctx, ret);
11104|      0|            return JS_ThrowTypeError(ctx, "toPrimitive");
11105|      0|        }
11106|      8|    }
11107|      8|    if (hint != HINT_STRING)
  ------------------
  |  | 1244|      8|#define HINT_STRING  0
  ------------------
  |  Branch (11107:9): [True: 4, False: 4]
  ------------------
11108|      4|        hint = HINT_NUMBER;
  ------------------
  |  | 1245|      4|#define HINT_NUMBER  1
  ------------------
11109|     12|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (11109:16): [True: 12, False: 0]
  ------------------
11110|     12|        if ((i ^ hint) == 0) {
  ------------------
  |  Branch (11110:13): [True: 8, False: 4]
  ------------------
11111|      8|            method_name = JS_ATOM_toString;
11112|      8|        } else {
11113|      4|            method_name = JS_ATOM_valueOf;
11114|      4|        }
11115|     12|        method = JS_GetProperty(ctx, val, method_name);
11116|     12|        if (JS_IsException(method))
  ------------------
  |  Branch (11116:13): [True: 0, False: 12]
  ------------------
11117|      0|            goto exception;
11118|     12|        if (JS_IsFunction(ctx, method)) {
  ------------------
  |  Branch (11118:13): [True: 12, False: 0]
  ------------------
11119|     12|            ret = JS_CallFree(ctx, method, val, 0, NULL);
11120|     12|            if (JS_IsException(ret))
  ------------------
  |  Branch (11120:17): [True: 0, False: 12]
  ------------------
11121|      0|                goto exception;
11122|     12|            if (JS_VALUE_GET_TAG(ret) != JS_TAG_OBJECT) {
  ------------------
  |  |  236|     12|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (11122:17): [True: 8, False: 4]
  ------------------
11123|      8|                JS_FreeValue(ctx, val);
11124|      8|                return ret;
11125|      8|            }
11126|      4|            JS_FreeValue(ctx, ret);
11127|      4|        } else {
11128|      0|            JS_FreeValue(ctx, method);
11129|      0|        }
11130|     12|    }
11131|      0|    JS_ThrowTypeError(ctx, "toPrimitive");
11132|      0|exception:
11133|      0|    JS_FreeValue(ctx, val);
11134|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
11135|      0|}
quickjs.c:skip_spaces:
11231|     10|{
11232|     10|    const uint8_t *p, *p_next, *p_start;
11233|     10|    uint32_t c;
11234|       |
11235|     10|    p = p_start = (const uint8_t *)pc;
11236|     11|    for (;;) {
11237|     11|        c = *p;
11238|     11|        if (c < 128) {
  ------------------
  |  Branch (11238:13): [True: 11, False: 0]
  ------------------
11239|     11|            if (!((c >= 0x09 && c <= 0x0d) || (c == 0x20)))
  ------------------
  |  Branch (11239:20): [True: 11, False: 0]
  |  Branch (11239:33): [True: 1, False: 10]
  |  Branch (11239:47): [True: 0, False: 10]
  ------------------
11240|     10|                break;
11241|      1|            p++;
11242|      1|        } else {
11243|      0|            c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
11244|      0|            if (!lre_is_space(c))
  ------------------
  |  Branch (11244:17): [True: 0, False: 0]
  ------------------
11245|      0|                break;
11246|      0|            p = p_next;
11247|      0|        }
11248|     11|    }
11249|     10|    return p - p_start;
11250|     10|}
quickjs.c:js_atof:
12765|     27|{
12766|     27|    const char *p, *p_start;
12767|     27|    int sep, is_neg;
12768|     27|    BOOL is_float, has_legacy_octal;
12769|     27|    int atod_type = flags & ATOD_TYPE_MASK;
  ------------------
  |  |12754|     27|#define ATOD_TYPE_MASK        (3 << 7)
  ------------------
12770|     27|    char buf1[64], *buf;
12771|     27|    int i, j, len;
12772|     27|    BOOL buf_allocated = FALSE;
12773|     27|    JSValue val;
12774|     27|    JSATODTempMem atod_mem;
12775|       |    
12776|       |    /* optional separator between digits */
12777|     27|    sep = (flags & ATOD_ACCEPT_UNDERSCORES) ? '_' : 256;
  ------------------
  |  |12750|     27|#define ATOD_ACCEPT_UNDERSCORES  (1 << 5)
  ------------------
  |  Branch (12777:11): [True: 22, False: 5]
  ------------------
12778|     27|    has_legacy_octal = FALSE;
12779|       |
12780|     27|    p = str;
12781|     27|    p_start = p;
12782|     27|    is_neg = 0;
12783|     27|    if (p[0] == '+') {
  ------------------
  |  Branch (12783:9): [True: 0, False: 27]
  ------------------
12784|      0|        p++;
12785|      0|        p_start++;
12786|      0|        if (!(flags & ATOD_ACCEPT_PREFIX_AFTER_SIGN))
  ------------------
  |  |12758|      0|#define ATOD_ACCEPT_PREFIX_AFTER_SIGN (1 << 10)
  ------------------
  |  Branch (12786:13): [True: 0, False: 0]
  ------------------
12787|      0|            goto no_radix_prefix;
12788|     27|    } else if (p[0] == '-') {
  ------------------
  |  Branch (12788:16): [True: 0, False: 27]
  ------------------
12789|      0|        p++;
12790|      0|        p_start++;
12791|      0|        is_neg = 1;
12792|      0|        if (!(flags & ATOD_ACCEPT_PREFIX_AFTER_SIGN))
  ------------------
  |  |12758|      0|#define ATOD_ACCEPT_PREFIX_AFTER_SIGN (1 << 10)
  ------------------
  |  Branch (12792:13): [True: 0, False: 0]
  ------------------
12793|      0|            goto no_radix_prefix;
12794|      0|    }
12795|     27|    if (p[0] == '0') {
  ------------------
  |  Branch (12795:9): [True: 6, False: 21]
  ------------------
12796|      6|        if ((p[1] == 'x' || p[1] == 'X') &&
  ------------------
  |  Branch (12796:14): [True: 0, False: 6]
  |  Branch (12796:29): [True: 1, False: 5]
  ------------------
12797|      1|            (radix == 0 || radix == 16)) {
  ------------------
  |  Branch (12797:14): [True: 1, False: 0]
  |  Branch (12797:28): [True: 0, False: 0]
  ------------------
12798|      1|            p += 2;
12799|      1|            radix = 16;
12800|      5|        } else if ((p[1] == 'o' || p[1] == 'O') &&
  ------------------
  |  Branch (12800:21): [True: 0, False: 5]
  |  Branch (12800:36): [True: 0, False: 5]
  ------------------
12801|      0|                   radix == 0 && (flags & ATOD_ACCEPT_BIN_OCT)) {
  ------------------
  |  |12746|      0|#define ATOD_ACCEPT_BIN_OCT  (1 << 2)
  ------------------
  |  Branch (12801:20): [True: 0, False: 0]
  |  Branch (12801:34): [True: 0, False: 0]
  ------------------
12802|      0|            p += 2;
12803|      0|            radix = 8;
12804|      5|        } else if ((p[1] == 'b' || p[1] == 'B') &&
  ------------------
  |  Branch (12804:21): [True: 0, False: 5]
  |  Branch (12804:36): [True: 0, False: 5]
  ------------------
12805|      0|                   radix == 0 && (flags & ATOD_ACCEPT_BIN_OCT)) {
  ------------------
  |  |12746|      0|#define ATOD_ACCEPT_BIN_OCT  (1 << 2)
  ------------------
  |  Branch (12805:20): [True: 0, False: 0]
  |  Branch (12805:34): [True: 0, False: 0]
  ------------------
12806|      0|            p += 2;
12807|      0|            radix = 2;
12808|      5|        } else if ((p[1] >= '0' && p[1] <= '9') &&
  ------------------
  |  Branch (12808:21): [True: 1, False: 4]
  |  Branch (12808:36): [True: 1, False: 0]
  ------------------
12809|      1|                   radix == 0 && (flags & ATOD_ACCEPT_LEGACY_OCTAL)) {
  ------------------
  |  |12748|      1|#define ATOD_ACCEPT_LEGACY_OCTAL  (1 << 4)
  ------------------
  |  Branch (12809:20): [True: 1, False: 0]
  |  Branch (12809:34): [True: 1, False: 0]
  ------------------
12810|      1|            int i;
12811|      1|            has_legacy_octal = TRUE;
12812|      1|            sep = 256;
12813|  1.04M|            for (i = 1; (p[i] >= '0' && p[i] <= '7'); i++)
  ------------------
  |  Branch (12813:26): [True: 1.04M, False: 1]
  |  Branch (12813:41): [True: 1.04M, False: 0]
  ------------------
12814|  1.04M|                continue;
12815|      1|            if (p[i] == '8' || p[i] == '9')
  ------------------
  |  Branch (12815:17): [True: 0, False: 1]
  |  Branch (12815:32): [True: 0, False: 1]
  ------------------
12816|      0|                goto no_prefix;
12817|      1|            p += 1;
12818|      1|            radix = 8;
12819|      4|        } else {
12820|      4|            goto no_prefix;
12821|      4|        }
12822|       |        /* there must be a digit after the prefix */
12823|      2|        if (to_digit((uint8_t)*p) >= radix)
  ------------------
  |  Branch (12823:13): [True: 0, False: 2]
  ------------------
12824|      0|            goto fail;
12825|      6|    no_prefix: ;
12826|     21|    } else {
12827|     21| no_radix_prefix:
12828|     21|        if (!(flags & ATOD_INT_ONLY) &&
  ------------------
  |  |12744|     21|#define ATOD_INT_ONLY        (1 << 0)
  ------------------
  |  Branch (12828:13): [True: 21, False: 0]
  ------------------
12829|     21|            (atod_type == ATOD_TYPE_FLOAT64) &&
  ------------------
  |  |12755|     21|#define ATOD_TYPE_FLOAT64     (0 << 7)
  ------------------
  |  Branch (12829:13): [True: 21, False: 0]
  ------------------
12830|     21|            strstart(p, "Infinity", &p)) {
  ------------------
  |  Branch (12830:13): [True: 0, False: 21]
  ------------------
12831|      0|            double d = 1.0 / 0.0;
12832|      0|            if (is_neg)
  ------------------
  |  Branch (12832:17): [True: 0, False: 0]
  ------------------
12833|      0|                d = -d;
12834|      0|            val = JS_NewFloat64(ctx, d);
12835|      0|            goto done;
12836|      0|        }
12837|     21|    }
12838|     27|    if (radix == 0)
  ------------------
  |  Branch (12838:9): [True: 25, False: 2]
  ------------------
12839|     25|        radix = 10;
12840|     27|    is_float = FALSE;
12841|     27|    p_start = p;
12842|  3.14M|    while (to_digit((uint8_t)*p) < radix
  ------------------
  |  Branch (12842:12): [True: 3.14M, False: 27]
  ------------------
12843|     27|           ||  (*p == sep && (radix != 10 ||
  ------------------
  |  Branch (12843:17): [True: 0, False: 27]
  |  Branch (12843:31): [True: 0, False: 0]
  ------------------
12844|      0|                              p != p_start + 1 || p[-1] != '0') &&
  ------------------
  |  Branch (12844:31): [True: 0, False: 0]
  |  Branch (12844:51): [True: 0, False: 0]
  ------------------
12845|  3.14M|                to_digit((uint8_t)p[1]) < radix)) {
  ------------------
  |  Branch (12845:17): [True: 0, False: 0]
  ------------------
12846|  3.14M|        p++;
12847|  3.14M|    }
12848|     27|    if (!(flags & ATOD_INT_ONLY) && radix == 10) {
  ------------------
  |  |12744|     27|#define ATOD_INT_ONLY        (1 << 0)
  ------------------
  |  Branch (12848:9): [True: 27, False: 0]
  |  Branch (12848:37): [True: 25, False: 2]
  ------------------
12849|     25|        if (*p == '.' && (p > p_start || to_digit((uint8_t)p[1]) < radix)) {
  ------------------
  |  Branch (12849:13): [True: 12, False: 13]
  |  Branch (12849:27): [True: 12, False: 0]
  |  Branch (12849:42): [True: 0, False: 0]
  ------------------
12850|     12|            is_float = TRUE;
12851|     12|            p++;
12852|     12|            if (*p == sep)
  ------------------
  |  Branch (12852:17): [True: 0, False: 12]
  ------------------
12853|      0|                goto fail;
12854|     14|            while (to_digit((uint8_t)*p) < radix ||
  ------------------
  |  Branch (12854:20): [True: 2, False: 12]
  ------------------
12855|     12|                   (*p == sep && to_digit((uint8_t)p[1]) < radix))
  ------------------
  |  Branch (12855:21): [True: 0, False: 12]
  |  Branch (12855:34): [True: 0, False: 0]
  ------------------
12856|      2|                p++;
12857|     12|        }
12858|     25|        if (p > p_start && (*p == 'e' || *p == 'E')) {
  ------------------
  |  Branch (12858:13): [True: 22, False: 3]
  |  Branch (12858:29): [True: 0, False: 22]
  |  Branch (12858:42): [True: 0, False: 22]
  ------------------
12859|      0|            const char *p1 = p + 1;
12860|      0|            is_float = TRUE;
12861|      0|            if (*p1 == '+') {
  ------------------
  |  Branch (12861:17): [True: 0, False: 0]
  ------------------
12862|      0|                p1++;
12863|      0|            } else if (*p1 == '-') {
  ------------------
  |  Branch (12863:24): [True: 0, False: 0]
  ------------------
12864|      0|                p1++;
12865|      0|            }
12866|      0|            if (is_digit((uint8_t)*p1)) {
  ------------------
  |  Branch (12866:17): [True: 0, False: 0]
  ------------------
12867|      0|                p = p1 + 1;
12868|      0|                while (is_digit((uint8_t)*p) || (*p == sep && is_digit((uint8_t)p[1])))
  ------------------
  |  Branch (12868:24): [True: 0, False: 0]
  |  Branch (12868:50): [True: 0, False: 0]
  |  Branch (12868:63): [True: 0, False: 0]
  ------------------
12869|      0|                    p++;
12870|      0|            }
12871|      0|        }
12872|     25|    }
12873|     27|    if (p == p_start)
  ------------------
  |  Branch (12873:9): [True: 3, False: 24]
  ------------------
12874|      3|        goto fail;
12875|       |
12876|     24|    buf = buf1;
12877|     24|    buf_allocated = FALSE;
12878|     24|    len = p - p_start;
12879|     24|    if (unlikely((len + 2) > sizeof(buf1))) {
  ------------------
  |  |   33|     24|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 3, False: 21]
  |  |  ------------------
  ------------------
12880|      3|        buf = js_malloc_rt(ctx->rt, len + 2); /* no exception raised */
12881|      3|        if (!buf)
  ------------------
  |  Branch (12881:13): [True: 0, False: 3]
  ------------------
12882|      0|            goto mem_error;
12883|      3|        buf_allocated = TRUE;
12884|      3|    }
12885|       |    /* remove the separators and the radix prefixes */
12886|     24|    j = 0;
12887|     24|    if (is_neg)
  ------------------
  |  Branch (12887:9): [True: 0, False: 24]
  ------------------
12888|      0|        buf[j++] = '-';
12889|  3.14M|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (12889:17): [True: 3.14M, False: 24]
  ------------------
12890|  3.14M|        if (p_start[i] != '_')
  ------------------
  |  Branch (12890:13): [True: 3.14M, False: 0]
  ------------------
12891|  3.14M|            buf[j++] = p_start[i];
12892|  3.14M|    }
12893|     24|    buf[j] = '\0';
12894|       |
12895|     24|    if ((flags & ATOD_ACCEPT_SUFFIX) && *p == 'n') {
  ------------------
  |  |12752|     24|#define ATOD_ACCEPT_SUFFIX    (1 << 6)
  ------------------
  |  Branch (12895:9): [True: 22, False: 2]
  |  Branch (12895:41): [True: 0, False: 22]
  ------------------
12896|      0|        p++;
12897|      0|        atod_type = ATOD_TYPE_BIG_INT;
  ------------------
  |  |12756|      0|#define ATOD_TYPE_BIG_INT     (1 << 7)
  ------------------
12898|      0|    }
12899|       |
12900|     24|    switch(atod_type) {
12901|     24|    case ATOD_TYPE_FLOAT64:
  ------------------
  |  |12755|     24|#define ATOD_TYPE_FLOAT64     (0 << 7)
  ------------------
  |  Branch (12901:5): [True: 24, False: 0]
  ------------------
12902|     24|        {
12903|     24|            double d;
12904|     24|            d = js_atod(buf, NULL, radix, is_float ? 0 : JS_ATOD_INT_ONLY,
  ------------------
  |  |   49|     12|#define JS_ATOD_INT_ONLY       (1 << 0)
  ------------------
  |  Branch (12904:43): [True: 12, False: 12]
  ------------------
12905|     24|                        &atod_mem);
12906|       |            /* return int or float64 */
12907|     24|            val = JS_NewFloat64(ctx, d);
12908|     24|        }
12909|     24|        break;
12910|      0|    case ATOD_TYPE_BIG_INT:
  ------------------
  |  |12756|      0|#define ATOD_TYPE_BIG_INT     (1 << 7)
  ------------------
  |  Branch (12910:5): [True: 0, False: 24]
  ------------------
12911|      0|        {
12912|      0|            JSBigInt *r;
12913|      0|            if (has_legacy_octal || is_float)
  ------------------
  |  Branch (12913:17): [True: 0, False: 0]
  |  Branch (12913:37): [True: 0, False: 0]
  ------------------
12914|      0|                goto fail;
12915|      0|            r = js_bigint_from_string(ctx, buf, radix);
12916|      0|            if (!r) {
  ------------------
  |  Branch (12916:17): [True: 0, False: 0]
  ------------------
12917|      0|                val = JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
12918|      0|                goto done;
12919|      0|            }
12920|      0|            val = JS_CompactBigInt(ctx, r);
12921|      0|        }
12922|      0|        break;
12923|      0|    default:
  ------------------
  |  Branch (12923:5): [True: 0, False: 24]
  ------------------
12924|      0|        abort();
12925|     24|    }
12926|       |
12927|     27|done:
12928|     27|    if (buf_allocated)
  ------------------
  |  Branch (12928:9): [True: 3, False: 24]
  ------------------
12929|      3|        js_free_rt(ctx->rt, buf);
12930|     27|    if (pp)
  ------------------
  |  Branch (12930:9): [True: 27, False: 0]
  ------------------
12931|     27|        *pp = p;
12932|     27|    return val;
12933|      3| fail:
12934|      3|    val = JS_NAN;
  ------------------
  |  |  252|      3|#define JS_NAN (JSValue){ .u.float64 = JS_FLOAT64_NAN, JS_TAG_FLOAT64 }
  |  |  ------------------
  |  |  |  |  103|      3|#define JS_FLOAT64_NAN NAN
  |  |  ------------------
  ------------------
12935|      3|    goto done;
12936|      0| mem_error:
12937|      0|    val = JS_ThrowOutOfMemory(ctx);
12938|      0|    goto done;
12939|     24|}
quickjs.c:to_digit:
11253|  3.14M|{
11254|  3.14M|    if (c >= '0' && c <= '9')
  ------------------
  |  Branch (11254:9): [True: 3.14M, False: 38]
  |  Branch (11254:21): [True: 2.09M, False: 1.04M]
  ------------------
11255|  2.09M|        return c - '0';
11256|  1.04M|    else if (c >= 'A' && c <= 'Z')
  ------------------
  |  Branch (11256:14): [True: 1.04M, False: 38]
  |  Branch (11256:26): [True: 0, False: 1.04M]
  ------------------
11257|      0|        return c - 'A' + 10;
11258|  1.04M|    else if (c >= 'a' && c <= 'z')
  ------------------
  |  Branch (11258:14): [True: 1.04M, False: 38]
  |  Branch (11258:26): [True: 1.04M, False: 0]
  ------------------
11259|  1.04M|        return c - 'a' + 10;
11260|     38|    else
11261|     38|        return 36;
11262|  3.14M|}
quickjs.c:JS_ToFloat64Free:
13063|      6|{
13064|      6|    uint32_t tag;
13065|       |
13066|      6|    tag = JS_VALUE_GET_TAG(val);
  ------------------
  |  |  236|      6|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
13067|      6|    if (tag <= JS_TAG_NULL) {
  ------------------
  |  Branch (13067:9): [True: 2, False: 4]
  ------------------
13068|      2|        *pres = JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|      2|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
13069|      2|        return 0;
13070|      4|    } else if (JS_TAG_IS_FLOAT64(tag)) {
  ------------------
  |  |  250|      4|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 4, False: 0]
  |  |  ------------------
  ------------------
13071|      4|        *pres = JS_VALUE_GET_FLOAT64(val);
  ------------------
  |  |  241|      4|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
13072|      4|        return 0;
13073|      4|    } else {
13074|      0|        return __JS_ToFloat64Free(ctx, pres, val);
13075|      0|    }
13076|      6|}
quickjs.c:JS_ToInt64SatFree:
13192|     15|{
13193|     15|    uint32_t tag;
13194|       |
13195|     15| redo:
13196|     15|    tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  238|     15|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|     15|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
13197|     15|    switch(tag) {
13198|     15|    case JS_TAG_INT:
  ------------------
  |  Branch (13198:5): [True: 15, False: 0]
  ------------------
13199|     15|    case JS_TAG_BOOL:
  ------------------
  |  Branch (13199:5): [True: 0, False: 15]
  ------------------
13200|     15|    case JS_TAG_NULL:
  ------------------
  |  Branch (13200:5): [True: 0, False: 15]
  ------------------
13201|     15|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (13201:5): [True: 0, False: 15]
  ------------------
13202|     15|        *pres = JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|     15|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
13203|     15|        return 0;
13204|      0|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (13204:5): [True: 0, False: 15]
  ------------------
13205|      0|        *pres = 0;
13206|      0|        return -1;
13207|      0|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (13207:5): [True: 0, False: 15]
  ------------------
13208|      0|        {
13209|      0|            double d = JS_VALUE_GET_FLOAT64(val);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
13210|      0|            if (isnan(d)) {
  ------------------
  |  Branch (13210:17): [True: 0, False: 0]
  ------------------
13211|      0|                *pres = 0;
13212|      0|            } else {
13213|      0|                if (d < INT64_MIN)
  ------------------
  |  Branch (13213:21): [True: 0, False: 0]
  ------------------
13214|      0|                    *pres = INT64_MIN;
13215|      0|                else if (d >= 0x1p63) /* must use INT64_MAX + 1 because INT64_MAX cannot be exactly represented as a double */
  ------------------
  |  Branch (13215:26): [True: 0, False: 0]
  ------------------
13216|      0|                    *pres = INT64_MAX;
13217|      0|                else
13218|      0|                    *pres = (int64_t)d;
13219|      0|            }
13220|      0|        }
13221|      0|        return 0;
13222|      0|    default:
  ------------------
  |  Branch (13222:5): [True: 0, False: 15]
  ------------------
13223|      0|        val = JS_ToNumberFree(ctx, val);
13224|      0|        if (JS_IsException(val)) {
  ------------------
  |  Branch (13224:13): [True: 0, False: 0]
  ------------------
13225|      0|            *pres = 0;
13226|      0|            return -1;
13227|      0|        }
13228|      0|        goto redo;
13229|     15|    }
13230|     15|}
quickjs.c:JS_ToInt32Free:
13320|     14|{
13321|     14|    uint32_t tag;
13322|     14|    int32_t ret;
13323|       |
13324|     14| redo:
13325|     14|    tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  238|     14|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|     14|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
13326|     14|    switch(tag) {
13327|     12|    case JS_TAG_INT:
  ------------------
  |  Branch (13327:5): [True: 12, False: 2]
  ------------------
13328|     12|    case JS_TAG_BOOL:
  ------------------
  |  Branch (13328:5): [True: 0, False: 14]
  ------------------
13329|     12|    case JS_TAG_NULL:
  ------------------
  |  Branch (13329:5): [True: 0, False: 14]
  ------------------
13330|     12|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (13330:5): [True: 0, False: 14]
  ------------------
13331|     12|        ret = JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|     12|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
13332|     12|        break;
13333|      2|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (13333:5): [True: 2, False: 12]
  ------------------
13334|      2|        {
13335|      2|            JSFloat64Union u;
13336|      2|            double d;
13337|      2|            int e;
13338|      2|            d = JS_VALUE_GET_FLOAT64(val);
  ------------------
  |  |  241|      2|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
13339|      2|            u.d = d;
13340|       |            /* we avoid doing fmod(x, 2^32) */
13341|      2|            e = (u.u64 >> 52) & 0x7ff;
13342|      2|            if (likely(e <= (1023 + 30))) {
  ------------------
  |  |   32|      2|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
13343|       |                /* fast case */
13344|      0|                ret = (int32_t)d;
13345|      2|            } else if (e <= (1023 + 30 + 53)) {
  ------------------
  |  Branch (13345:24): [True: 0, False: 2]
  ------------------
13346|      0|                uint64_t v;
13347|       |                /* remainder modulo 2^32 */
13348|      0|                v = (u.u64 & (((uint64_t)1 << 52) - 1)) | ((uint64_t)1 << 52);
13349|      0|                v = v << ((e - 1023) - 52 + 32);
13350|      0|                ret = v >> 32;
13351|       |                /* take the sign into account */
13352|      0|                if (u.u64 >> 63)
  ------------------
  |  Branch (13352:21): [True: 0, False: 0]
  ------------------
13353|      0|                    ret = -ret;
13354|      2|            } else {
13355|      2|                ret = 0; /* also handles NaN and +inf */
13356|      2|            }
13357|      2|        }
13358|      2|        break;
13359|      0|    default:
  ------------------
  |  Branch (13359:5): [True: 0, False: 14]
  ------------------
13360|      0|        val = JS_ToNumberFree(ctx, val);
13361|      0|        if (JS_IsException(val)) {
  ------------------
  |  Branch (13361:13): [True: 0, False: 0]
  ------------------
13362|      0|            *pres = 0;
13363|      0|            return -1;
13364|      0|        }
13365|      0|        goto redo;
13366|     14|    }
13367|     14|    *pres = ret;
13368|     14|    return 0;
13369|     14|}
quickjs.c:JS_ToStringInternal:
13589|  1.01M|{
13590|  1.01M|    uint32_t tag;
13591|  1.01M|    char buf[32];
13592|       |
13593|  1.01M|    tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  238|  1.01M|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|  1.01M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
13594|  1.01M|    switch(tag) {
13595|  1.01M|    case JS_TAG_STRING:
  ------------------
  |  Branch (13595:5): [True: 1.01M, False: 6]
  ------------------
13596|  1.01M|        return JS_DupValue(ctx, val);
13597|      1|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (13597:5): [True: 1, False: 1.01M]
  ------------------
13598|      1|        return js_linearize_string_rope(ctx, JS_DupValue(ctx, val));
13599|      0|    case JS_TAG_INT:
  ------------------
  |  Branch (13599:5): [True: 0, False: 1.01M]
  ------------------
13600|      0|        {
13601|      0|            size_t len;
13602|      0|            len = i32toa(buf, JS_VALUE_GET_INT(val));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
13603|      0|            return js_new_string8_len(ctx, buf, len);
13604|      0|        }
13605|      0|        break;
13606|      0|    case JS_TAG_BOOL:
  ------------------
  |  Branch (13606:5): [True: 0, False: 1.01M]
  ------------------
13607|      0|        return JS_AtomToString(ctx, JS_VALUE_GET_BOOL(val) ?
  ------------------
  |  |  240|      0|#define JS_VALUE_GET_BOOL(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |  |  Branch (240:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
13608|      0|                          JS_ATOM_true : JS_ATOM_false);
13609|      0|    case JS_TAG_NULL:
  ------------------
  |  Branch (13609:5): [True: 0, False: 1.01M]
  ------------------
13610|      0|        return JS_AtomToString(ctx, JS_ATOM_null);
13611|      0|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (13611:5): [True: 0, False: 1.01M]
  ------------------
13612|      0|        return JS_AtomToString(ctx, JS_ATOM_undefined);
13613|      0|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (13613:5): [True: 0, False: 1.01M]
  ------------------
13614|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
13615|      4|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (13615:5): [True: 4, False: 1.01M]
  ------------------
13616|      4|        {
13617|      4|            JSValue val1, ret;
13618|      4|            val1 = JS_ToPrimitive(ctx, val, HINT_STRING);
  ------------------
  |  | 1244|      4|#define HINT_STRING  0
  ------------------
13619|      4|            if (JS_IsException(val1))
  ------------------
  |  Branch (13619:17): [True: 0, False: 4]
  ------------------
13620|      0|                return val1;
13621|      4|            ret = JS_ToStringInternal(ctx, val1, is_ToPropertyKey);
13622|      4|            JS_FreeValue(ctx, val1);
13623|      4|            return ret;
13624|      4|        }
13625|      0|        break;
13626|      0|    case JS_TAG_FUNCTION_BYTECODE:
  ------------------
  |  Branch (13626:5): [True: 0, False: 1.01M]
  ------------------
13627|      0|        return js_new_string8(ctx, "[function bytecode]");
13628|      0|    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (13628:5): [True: 0, False: 1.01M]
  ------------------
13629|      0|        if (is_ToPropertyKey) {
  ------------------
  |  Branch (13629:13): [True: 0, False: 0]
  ------------------
13630|      0|            return JS_DupValue(ctx, val);
13631|      0|        } else {
13632|      0|            return JS_ThrowTypeError(ctx, "cannot convert symbol to string");
13633|      0|        }
13634|      1|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (13634:5): [True: 1, False: 1.01M]
  ------------------
13635|      1|        return js_dtoa2(ctx, JS_VALUE_GET_FLOAT64(val), 10, 0,
  ------------------
  |  |  241|      1|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
13636|      1|                        JS_DTOA_FORMAT_FREE);
  ------------------
  |  |   32|      1|#define JS_DTOA_FORMAT_FREE  (0 << 0)
  ------------------
13637|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (13637:5): [True: 0, False: 1.01M]
  ------------------
13638|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (13638:5): [True: 0, False: 1.01M]
  ------------------
13639|      0|        return js_bigint_to_string(ctx, val);
13640|      0|    default:
  ------------------
  |  Branch (13640:5): [True: 0, False: 1.01M]
  ------------------
13641|      0|        return js_new_string8(ctx, "[unsupported type]");
13642|  1.01M|    }
13643|  1.01M|}
quickjs.c:js_linearize_string_rope:
 4832|      1|{
 4833|      1|    StringBuffer b_s, *b = &b_s;
 4834|      1|    JSStringRope *r;
 4835|      1|    JSValue ret;
 4836|       |    
 4837|      1|    r = JS_VALUE_GET_STRING_ROPE(rope);
  ------------------
  |  |  231|      1|#define JS_VALUE_GET_STRING_ROPE(v) ((JSStringRope *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4838|       |
 4839|       |    /* check whether it is already linearized */
 4840|      1|    if (JS_VALUE_GET_TAG(r->right) == JS_TAG_STRING &&
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (4840:9): [True: 1, False: 0]
  ------------------
 4841|      1|        JS_VALUE_GET_STRING(r->right)->len == 0) {
  ------------------
  |  |  230|      1|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
  |  Branch (4841:9): [True: 0, False: 1]
  ------------------
 4842|      0|        ret = JS_DupValue(ctx, r->left);
 4843|      0|        JS_FreeValue(ctx, rope);
 4844|      0|        return ret;
 4845|      0|    }
 4846|      1|    if (string_buffer_init2(ctx, b, r->len, r->is_wide_char))
  ------------------
  |  Branch (4846:9): [True: 0, False: 1]
  ------------------
 4847|      0|        goto fail;
 4848|      1|    if (string_buffer_concat_value(b, rope))
  ------------------
  |  Branch (4848:9): [True: 0, False: 1]
  ------------------
 4849|      0|        goto fail;
 4850|      1|    ret = string_buffer_end(b);
 4851|      1|    if (js_rc(r)->ref_count > 1) {
  ------------------
  |  Branch (4851:9): [True: 1, False: 0]
  ------------------
 4852|       |        /* update the rope so that it won't need to be linearized again */
 4853|      1|        JS_FreeValue(ctx, r->left);
 4854|      1|        JS_FreeValue(ctx, r->right);
 4855|      1|        r->left = JS_DupValue(ctx, ret);
 4856|      1|        r->right = JS_AtomToString(ctx, JS_ATOM_empty_string);
 4857|      1|    }
 4858|      1|    JS_FreeValue(ctx, rope);
 4859|      1|    return ret;
 4860|      0| fail:
 4861|      0|    JS_FreeValue(ctx, rope);
 4862|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 4863|      1|}
quickjs.c:string_buffer_concat_value:
 4259|      3|{
 4260|      3|    JSString *p;
 4261|      3|    JSValue v1;
 4262|      3|    int res;
 4263|       |
 4264|      3|    if (s->error_status) {
  ------------------
  |  Branch (4264:9): [True: 0, False: 3]
  ------------------
 4265|       |        /* prevent exception overload */
 4266|      0|        return -1;
 4267|      0|    }
 4268|      3|    if (unlikely(JS_VALUE_GET_TAG(v) != JS_TAG_STRING)) {
  ------------------
  |  |   33|      3|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1, False: 2]
  |  |  ------------------
  ------------------
 4269|      1|        if (JS_VALUE_GET_TAG(v) == JS_TAG_STRING_ROPE) {
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (4269:13): [True: 1, False: 0]
  ------------------
 4270|      1|            JSStringRope *r = JS_VALUE_GET_STRING_ROPE(v);
  ------------------
  |  |  231|      1|#define JS_VALUE_GET_STRING_ROPE(v) ((JSStringRope *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4271|       |            /* recursion is acceptable because the rope depth is bounded */
 4272|      1|            if (string_buffer_concat_value(s, r->left))
  ------------------
  |  Branch (4272:17): [True: 0, False: 1]
  ------------------
 4273|      0|                return -1;
 4274|      1|            return string_buffer_concat_value(s, r->right);
 4275|      1|        } else {
 4276|      0|            v1 = JS_ToString(s->ctx, v);
 4277|      0|            if (JS_IsException(v1))
  ------------------
  |  Branch (4277:17): [True: 0, False: 0]
  ------------------
 4278|      0|                return string_buffer_set_error(s);
 4279|      0|            p = JS_VALUE_GET_STRING(v1);
  ------------------
  |  |  230|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4280|      0|            res = string_buffer_concat(s, p, 0, p->len);
 4281|      0|            JS_FreeValue(s->ctx, v1);
 4282|      0|            return res;
 4283|      0|        }
 4284|      1|    }
 4285|      2|    p = JS_VALUE_GET_STRING(v);
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4286|      2|    return string_buffer_concat(s, p, 0, p->len);
 4287|      3|}
quickjs.c:string_buffer_concat:
 4249|   343k|{
 4250|   343k|    if (to <= from)
  ------------------
  |  Branch (4250:9): [True: 270k, False: 72.6k]
  ------------------
 4251|   270k|        return 0;
 4252|  72.6k|    if (p->is_wide_char)
  ------------------
  |  Branch (4252:9): [True: 1.24k, False: 71.4k]
  ------------------
 4253|  1.24k|        return string_buffer_write16(s, p->u.str16 + from, to - from);
 4254|  71.4k|    else
 4255|  71.4k|        return string_buffer_write8(s, p->u.str8 + from, to - from);
 4256|  72.6k|}
quickjs.c:string_buffer_write16:
 4216|  1.24k|{
 4217|  1.24k|    int c = 0, i;
 4218|       |
 4219|  2.53M|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (4219:17): [True: 2.53M, False: 1.24k]
  ------------------
 4220|  2.53M|        c |= p[i];
 4221|  2.53M|    }
 4222|  1.24k|    if (s->len + len > s->size) {
  ------------------
  |  Branch (4222:9): [True: 4, False: 1.24k]
  ------------------
 4223|      4|        if (string_buffer_realloc(s, s->len + len, c))
  ------------------
  |  Branch (4223:13): [True: 0, False: 4]
  ------------------
 4224|      0|            return -1;
 4225|  1.24k|    } else if (!s->is_wide_char && c >= 0x100) {
  ------------------
  |  Branch (4225:16): [True: 0, False: 1.24k]
  |  Branch (4225:36): [True: 0, False: 0]
  ------------------
 4226|      0|        if (string_buffer_widen(s, s->size))
  ------------------
  |  Branch (4226:13): [True: 0, False: 0]
  ------------------
 4227|      0|            return -1;
 4228|      0|    }
 4229|  1.24k|    if (s->is_wide_char) {
  ------------------
  |  Branch (4229:9): [True: 1.24k, False: 0]
  ------------------
 4230|  1.24k|        memcpy(&s->str->u.str16[s->len], p, len << 1);
 4231|  1.24k|        s->len += len;
 4232|  1.24k|    } else {
 4233|      0|        for (i = 0; i < len; i++) {
  ------------------
  |  Branch (4233:21): [True: 0, False: 0]
  ------------------
 4234|      0|            s->str->u.str8[s->len + i] = p[i];
 4235|      0|        }
 4236|      0|        s->len += len;
 4237|      0|    }
 4238|  1.24k|    return 0;
 4239|  1.24k|}
quickjs.c:JS_ToPrimitive:
11138|      4|{
11139|      4|    return JS_ToPrimitiveFree(ctx, JS_DupValue(ctx, val), hint);
11140|      4|}
quickjs.c:js_dtoa2:
13565|      1|{
13566|      1|    char static_buf[128], *buf, *tmp_buf;
13567|      1|    int len, len_max;
13568|      1|    JSValue res;
13569|      1|    JSDTOATempMem dtoa_mem;
13570|      1|    len_max = js_dtoa_max_len(d, radix, n_digits, flags);
13571|       |    
13572|       |    /* longer buffer may be used if radix != 10 */
13573|      1|    if (len_max > sizeof(static_buf) - 1) {
  ------------------
  |  Branch (13573:9): [True: 0, False: 1]
  ------------------
13574|      0|        tmp_buf = js_malloc(ctx, len_max + 1);
13575|      0|        if (!tmp_buf)
  ------------------
  |  Branch (13575:13): [True: 0, False: 0]
  ------------------
13576|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
13577|      0|        buf = tmp_buf;
13578|      1|    } else {
13579|      1|        tmp_buf = NULL;
13580|      1|        buf = static_buf;
13581|      1|    }
13582|      1|    len = js_dtoa(buf, d, radix, n_digits, flags, &dtoa_mem);
13583|      1|    res = js_new_string8_len(ctx, buf, len);
13584|      1|    js_free(ctx, tmp_buf);
13585|      1|    return res;
13586|      1|}
quickjs.c:tag_is_string:
15094|      3|{
15095|      3|    return tag == JS_TAG_STRING || tag == JS_TAG_STRING_ROPE;
  ------------------
  |  Branch (15095:12): [True: 2, False: 1]
  |  Branch (15095:36): [True: 0, False: 1]
  ------------------
15096|      3|}
quickjs.c:js_call_c_function:
17591|  1.01M|{
17592|  1.01M|    JSRuntime *rt = ctx->rt;
17593|  1.01M|    JSCFunctionType func;
17594|  1.01M|    JSObject *p;
17595|  1.01M|    JSStackFrame sf_s, *sf = &sf_s, *prev_sf;
17596|  1.01M|    JSValue ret_val;
17597|  1.01M|    JSValueConst *arg_buf;
  ------------------
  |  |  234|  1.01M|#define JSValueConst JSValue
  ------------------
17598|  1.01M|    int arg_count, i;
17599|  1.01M|    JSCFunctionEnum cproto;
17600|       |
17601|  1.01M|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  229|  1.01M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.01M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17602|  1.01M|    cproto = p->u.cfunc.cproto;
17603|  1.01M|    arg_count = p->u.cfunc.length;
17604|       |
17605|       |    /* better to always check stack overflow */
17606|  1.01M|    if (js_check_stack_overflow(rt, sizeof(arg_buf[0]) * arg_count))
  ------------------
  |  Branch (17606:9): [True: 0, False: 1.01M]
  ------------------
17607|      0|        return JS_ThrowStackOverflow(ctx);
17608|       |
17609|  1.01M|    prev_sf = rt->current_stack_frame;
17610|  1.01M|    sf->prev_frame = prev_sf;
17611|  1.01M|    rt->current_stack_frame = sf;
17612|  1.01M|    ctx = p->u.cfunc.realm; /* change the current realm */
17613|  1.01M|    sf->js_mode = 0;
17614|  1.01M|    sf->cur_func = (JSValue)func_obj;
17615|  1.01M|    sf->arg_count = argc;
17616|  1.01M|    arg_buf = argv;
17617|       |
17618|  1.01M|    if (unlikely(argc < arg_count)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 11, False: 1.00M]
  |  |  ------------------
  ------------------
17619|       |        /* ensure that at least argc_count arguments are readable */
17620|     11|        arg_buf = alloca(sizeof(arg_buf[0]) * arg_count);
17621|     15|        for(i = 0; i < argc; i++)
  ------------------
  |  Branch (17621:20): [True: 4, False: 11]
  ------------------
17622|      4|            arg_buf[i] = argv[i];
17623|     22|        for(i = argc; i < arg_count; i++)
  ------------------
  |  Branch (17623:23): [True: 11, False: 11]
  ------------------
17624|     11|            arg_buf[i] = JS_UNDEFINED;
  ------------------
  |  |  291|     11|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     11|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17625|     11|        sf->arg_count = arg_count;
17626|     11|    }
17627|  1.01M|    sf->arg_buf = (JSValue*)arg_buf;
17628|       |
17629|  1.01M|    func = p->u.cfunc.c_function;
17630|  1.01M|    switch(cproto) {
17631|      0|    case JS_CFUNC_constructor:
  ------------------
  |  Branch (17631:5): [True: 0, False: 1.01M]
  ------------------
17632|      2|    case JS_CFUNC_constructor_or_func:
  ------------------
  |  Branch (17632:5): [True: 2, False: 1.01M]
  ------------------
17633|      2|        if (!(flags & JS_CALL_FLAG_CONSTRUCTOR)) {
  ------------------
  |  |  526|      2|#define JS_CALL_FLAG_CONSTRUCTOR (1 << 0)
  ------------------
  |  Branch (17633:13): [True: 0, False: 2]
  ------------------
17634|      0|            if (cproto == JS_CFUNC_constructor) {
  ------------------
  |  Branch (17634:17): [True: 0, False: 0]
  ------------------
17635|      0|            not_a_constructor:
17636|      0|                ret_val = JS_ThrowTypeError(ctx, "must be called with new");
17637|      0|                break;
17638|      0|            } else {
17639|      0|                this_obj = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17640|      0|            }
17641|      0|        }
17642|       |        /* here this_obj is new_target */
17643|       |        /* fall thru */
17644|  1.00M|    case JS_CFUNC_generic:
  ------------------
  |  Branch (17644:5): [True: 1.00M, False: 30]
  ------------------
17645|  1.00M|        ret_val = func.generic(ctx, this_obj, argc, arg_buf);
17646|  1.00M|        break;
17647|      0|    case JS_CFUNC_constructor_magic:
  ------------------
  |  Branch (17647:5): [True: 0, False: 1.01M]
  ------------------
17648|      0|    case JS_CFUNC_constructor_or_func_magic:
  ------------------
  |  Branch (17648:5): [True: 0, False: 1.01M]
  ------------------
17649|      0|        if (!(flags & JS_CALL_FLAG_CONSTRUCTOR)) {
  ------------------
  |  |  526|      0|#define JS_CALL_FLAG_CONSTRUCTOR (1 << 0)
  ------------------
  |  Branch (17649:13): [True: 0, False: 0]
  ------------------
17650|      0|            if (cproto == JS_CFUNC_constructor_magic) {
  ------------------
  |  Branch (17650:17): [True: 0, False: 0]
  ------------------
17651|      0|                goto not_a_constructor;
17652|      0|            } else {
17653|      0|                this_obj = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17654|      0|            }
17655|      0|        }
17656|       |        /* fall thru */
17657|      8|    case JS_CFUNC_generic_magic:
  ------------------
  |  Branch (17657:5): [True: 8, False: 1.01M]
  ------------------
17658|      8|        ret_val = func.generic_magic(ctx, this_obj, argc, arg_buf,
17659|      8|                                     p->u.cfunc.magic);
17660|      8|        break;
17661|      4|    case JS_CFUNC_getter:
  ------------------
  |  Branch (17661:5): [True: 4, False: 1.01M]
  ------------------
17662|      4|        ret_val = func.getter(ctx, this_obj);
17663|      4|        break;
17664|      0|    case JS_CFUNC_setter:
  ------------------
  |  Branch (17664:5): [True: 0, False: 1.01M]
  ------------------
17665|      0|        ret_val = func.setter(ctx, this_obj, arg_buf[0]);
17666|      0|        break;
17667|     16|    case JS_CFUNC_getter_magic:
  ------------------
  |  Branch (17667:5): [True: 16, False: 1.00M]
  ------------------
17668|     16|        ret_val = func.getter_magic(ctx, this_obj, p->u.cfunc.magic);
17669|     16|        break;
17670|      0|    case JS_CFUNC_setter_magic:
  ------------------
  |  Branch (17670:5): [True: 0, False: 1.01M]
  ------------------
17671|      0|        ret_val = func.setter_magic(ctx, this_obj, arg_buf[0], p->u.cfunc.magic);
17672|      0|        break;
17673|      0|    case JS_CFUNC_f_f:
  ------------------
  |  Branch (17673:5): [True: 0, False: 1.01M]
  ------------------
17674|      0|        {
17675|      0|            double d1;
17676|       |
17677|      0|            if (unlikely(JS_ToFloat64(ctx, &d1, arg_buf[0]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17678|      0|                ret_val = JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17679|      0|                break;
17680|      0|            }
17681|      0|            ret_val = JS_NewFloat64(ctx, func.f_f(d1));
17682|      0|        }
17683|      0|        break;
17684|      0|    case JS_CFUNC_f_f_f:
  ------------------
  |  Branch (17684:5): [True: 0, False: 1.01M]
  ------------------
17685|      0|        {
17686|      0|            double d1, d2;
17687|       |
17688|      0|            if (unlikely(JS_ToFloat64(ctx, &d1, arg_buf[0]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17689|      0|                ret_val = JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17690|      0|                break;
17691|      0|            }
17692|      0|            if (unlikely(JS_ToFloat64(ctx, &d2, arg_buf[1]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17693|      0|                ret_val = JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17694|      0|                break;
17695|      0|            }
17696|      0|            ret_val = JS_NewFloat64(ctx, func.f_f_f(d1, d2));
17697|      0|        }
17698|      0|        break;
17699|      0|    case JS_CFUNC_iterator_next:
  ------------------
  |  Branch (17699:5): [True: 0, False: 1.01M]
  ------------------
17700|      0|        {
17701|      0|            int done;
17702|      0|            ret_val = func.iterator_next(ctx, this_obj, argc, arg_buf,
17703|      0|                                         &done, p->u.cfunc.magic);
17704|      0|            if (!JS_IsException(ret_val) && done != 2) {
  ------------------
  |  Branch (17704:17): [True: 0, False: 0]
  |  Branch (17704:45): [True: 0, False: 0]
  ------------------
17705|      0|                ret_val = js_create_iterator_result(ctx, ret_val, done);
17706|      0|            }
17707|      0|        }
17708|      0|        break;
17709|      0|    default:
  ------------------
  |  Branch (17709:5): [True: 0, False: 1.01M]
  ------------------
17710|      0|        abort();
17711|  1.01M|    }
17712|       |
17713|  1.01M|    rt->current_stack_frame = sf->prev_frame;
17714|  1.01M|    return ret_val;
17715|  1.01M|}
quickjs.c:JS_CallInternal:
17775|  1.01M|{
17776|  1.01M|    JSRuntime *rt = caller_ctx->rt;
17777|  1.01M|    JSContext *ctx;
17778|  1.01M|    JSObject *p;
17779|  1.01M|    JSFunctionBytecode *b;
17780|  1.01M|    JSStackFrame sf_s, *sf = &sf_s;
17781|  1.01M|    const uint8_t *pc;
17782|  1.01M|    int opcode, arg_allocated_size, i;
17783|  1.01M|    JSValue *local_buf, *stack_buf, *var_buf, *arg_buf, *sp, ret_val, *pval;
17784|  1.01M|    JSVarRef **var_refs;
17785|  1.01M|    size_t alloca_size;
17786|       |
17787|       |#if !DIRECT_DISPATCH
17788|       |#define SWITCH(pc)      switch (opcode = *pc++)
17789|       |#define CASE(op)        case op
17790|       |#define DEFAULT         default
17791|       |#define BREAK           break
17792|       |#else
17793|  1.01M|    static const void * const dispatch_table[256] = {
17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
17795|  1.01M|#if SHORT_OPCODES
17796|  1.01M|#define def(id, size, n_pop, n_push, f)
17797|       |#else
17798|       |#define def(id, size, n_pop, n_push, f) && case_default,
17799|       |#endif
17800|  1.01M|#include "quickjs-opcode.h"
  ------------------
  |  |    1|       |/*
  |  |    2|       | * QuickJS opcode definitions
  |  |    3|       | *
  |  |    4|       | * Copyright (c) 2017-2018 Fabrice Bellard
  |  |    5|       | * Copyright (c) 2017-2018 Charlie Gordon
  |  |    6|       | *
  |  |    7|       | * Permission is hereby granted, free of charge, to any person obtaining a copy
  |  |    8|       | * of this software and associated documentation files (the "Software"), to deal
  |  |    9|       | * in the Software without restriction, including without limitation the rights
  |  |   10|       | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  |  |   11|       | * copies of the Software, and to permit persons to whom the Software is
  |  |   12|       | * furnished to do so, subject to the following conditions:
  |  |   13|       | *
  |  |   14|       | * The above copyright notice and this permission notice shall be included in
  |  |   15|       | * all copies or substantial portions of the Software.
  |  |   16|       | *
  |  |   17|       | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  |  |   18|       | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  |  |   19|       | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  |  |   20|       | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  |  |   21|       | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  |  |   22|       | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  |  |   23|       | * THE SOFTWARE.
  |  |   24|       | */
  |  |   25|       |
  |  |   26|       |#ifdef FMT
  |  |   27|       |FMT(none)
  |  |   28|       |FMT(none_int)
  |  |   29|       |FMT(none_loc)
  |  |   30|       |FMT(none_arg)
  |  |   31|       |FMT(none_var_ref)
  |  |   32|       |FMT(u8)
  |  |   33|       |FMT(i8)
  |  |   34|       |FMT(loc8)
  |  |   35|       |FMT(const8)
  |  |   36|       |FMT(label8)
  |  |   37|       |FMT(u16)
  |  |   38|       |FMT(i16)
  |  |   39|       |FMT(label16)
  |  |   40|       |FMT(npop)
  |  |   41|       |FMT(npopx)
  |  |   42|       |FMT(npop_u16)
  |  |   43|       |FMT(loc)
  |  |   44|       |FMT(arg)
  |  |   45|       |FMT(var_ref)
  |  |   46|       |FMT(u32)
  |  |   47|       |FMT(i32)
  |  |   48|       |FMT(const)
  |  |   49|       |FMT(label)
  |  |   50|       |FMT(atom)
  |  |   51|       |FMT(atom_u8)
  |  |   52|       |FMT(atom_u16)
  |  |   53|       |FMT(atom_label_u8)
  |  |   54|       |FMT(atom_label_u16)
  |  |   55|       |FMT(label_u16)
  |  |   56|       |#undef FMT
  |  |   57|       |#endif /* FMT */
  |  |   58|       |
  |  |   59|  1.01M|#ifdef DEF
  |  |   60|       |
  |  |   61|       |#ifndef def
  |  |   62|       |#define def(id, size, n_pop, n_push, f) DEF(id, size, n_pop, n_push, f)
  |  |   63|       |#endif
  |  |   64|       |
  |  |   65|  1.01M|DEF(invalid, 1, 0, 0, none) /* never emitted */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   66|       |
  |  |   67|       |/* push values */
  |  |   68|  1.01M|DEF(       push_i32, 5, 0, 1, i32)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   69|  1.01M|DEF(     push_const, 5, 0, 1, const)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   70|  1.01M|DEF(       fclosure, 5, 0, 1, const) /* must follow push_const */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   71|  1.01M|DEF(push_atom_value, 5, 0, 1, atom)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   72|  1.01M|DEF( private_symbol, 5, 0, 1, atom)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   73|  1.01M|DEF(      undefined, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   74|  1.01M|DEF(           null, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   75|  1.01M|DEF(      push_this, 1, 0, 1, none) /* only used at the start of a function */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   76|  1.01M|DEF(     push_false, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   77|  1.01M|DEF(      push_true, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   78|  1.01M|DEF(         object, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   79|  1.01M|DEF( special_object, 2, 0, 1, u8) /* only used at the start of a function */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   80|  1.01M|DEF(           rest, 3, 0, 1, u16) /* only used at the start of a function */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   81|       |
  |  |   82|  1.01M|DEF(           drop, 1, 1, 0, none) /* a -> */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   83|  1.01M|DEF(            nip, 1, 2, 1, none) /* a b -> b */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   84|  1.01M|DEF(           nip1, 1, 3, 2, none) /* a b c -> b c */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   85|  1.01M|DEF(            dup, 1, 1, 2, none) /* a -> a a */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   86|  1.01M|DEF(           dup1, 1, 2, 3, none) /* a b -> a a b */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   87|  1.01M|DEF(           dup2, 1, 2, 4, none) /* a b -> a b a b */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   88|  1.01M|DEF(           dup3, 1, 3, 6, none) /* a b c -> a b c a b c */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   89|  1.01M|DEF(        insert2, 1, 2, 3, none) /* obj a -> a obj a (dup_x1) */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   90|  1.01M|DEF(        insert3, 1, 3, 4, none) /* obj prop a -> a obj prop a (dup_x2) */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   91|  1.01M|DEF(        insert4, 1, 4, 5, none) /* this obj prop a -> a this obj prop a */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   92|  1.01M|DEF(          perm3, 1, 3, 3, none) /* obj a b -> a obj b */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   93|  1.01M|DEF(          perm4, 1, 4, 4, none) /* obj prop a b -> a obj prop b */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   94|  1.01M|DEF(          perm5, 1, 5, 5, none) /* this obj prop a b -> a this obj prop b */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   95|  1.01M|DEF(           swap, 1, 2, 2, none) /* a b -> b a */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   96|  1.01M|DEF(          swap2, 1, 4, 4, none) /* a b c d -> c d a b */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   97|  1.01M|DEF(          rot3l, 1, 3, 3, none) /* x a b -> a b x */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   98|  1.01M|DEF(          rot3r, 1, 3, 3, none) /* a b x -> x a b */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   99|  1.01M|DEF(          rot4l, 1, 4, 4, none) /* x a b c -> a b c x */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  100|  1.01M|DEF(          rot5l, 1, 5, 5, none) /* x a b c d -> a b c d x */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  101|       |
  |  |  102|  1.01M|DEF(call_constructor, 3, 2, 1, npop) /* func new.target args -> ret. arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  103|  1.01M|DEF(           call, 3, 1, 1, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  104|  1.01M|DEF(      tail_call, 3, 1, 0, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  105|  1.01M|DEF(    call_method, 3, 2, 1, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  106|  1.01M|DEF(tail_call_method, 3, 2, 0, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  107|  1.01M|DEF(     array_from, 3, 0, 1, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  108|  1.01M|DEF(          apply, 3, 3, 1, u16)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  109|  1.01M|DEF(         return, 1, 1, 0, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  110|  1.01M|DEF(   return_undef, 1, 0, 0, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  111|  1.01M|DEF(check_ctor_return, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  112|  1.01M|DEF(     check_ctor, 1, 0, 0, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  113|  1.01M|DEF(      init_ctor, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  114|  1.01M|DEF(    check_brand, 1, 2, 2, none) /* this_obj func -> this_obj func */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  115|  1.01M|DEF(      add_brand, 1, 2, 0, none) /* this_obj home_obj -> */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  116|  1.01M|DEF(   return_async, 1, 1, 0, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  117|  1.01M|DEF(          throw, 1, 1, 0, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  118|  1.01M|DEF(    throw_error, 6, 0, 0, atom_u8)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  119|  1.01M|DEF(           eval, 5, 1, 1, npop_u16) /* func args... -> ret_val */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  120|  1.01M|DEF(     apply_eval, 3, 2, 1, u16) /* func array -> ret_eval */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  121|  1.01M|DEF(         regexp, 1, 2, 1, none) /* create a RegExp object from the pattern and a
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  122|       |                                       bytecode string */
  |  |  123|  1.01M|DEF(      get_super, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  124|  1.01M|DEF(         import, 1, 2, 1, none) /* dynamic module import */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  125|       |
  |  |  126|  1.01M|DEF(  get_var_undef, 3, 0, 1, var_ref) /* push undefined if the variable does not exist */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  127|  1.01M|DEF(        get_var, 3, 0, 1, var_ref) /* throw an exception if the variable does not exist */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  128|  1.01M|DEF(        put_var, 3, 1, 0, var_ref) /* must come after get_var */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  129|  1.01M|DEF(   put_var_init, 3, 1, 0, var_ref) /* must come after put_var. Used to initialize a global lexical variable */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  130|       |
  |  |  131|  1.01M|DEF(  get_ref_value, 1, 2, 3, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  132|  1.01M|DEF(  put_ref_value, 1, 3, 0, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  133|       |
  |  |  134|  1.01M|DEF(      get_field, 5, 1, 1, atom)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  135|  1.01M|DEF(     get_field2, 5, 1, 2, atom)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  136|  1.01M|DEF(      put_field, 5, 2, 0, atom)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  137|  1.01M|DEF( get_private_field, 1, 2, 1, none) /* obj prop -> value */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  138|  1.01M|DEF( put_private_field, 1, 3, 0, none) /* obj value prop -> */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  139|  1.01M|DEF(define_private_field, 1, 3, 1, none) /* obj prop value -> obj */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  140|  1.01M|DEF(   get_array_el, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  141|  1.01M|DEF(  get_array_el2, 1, 2, 2, none) /* obj prop -> obj value */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  142|  1.01M|DEF(  get_array_el3, 1, 2, 3, none) /* obj prop -> obj prop1 value */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  143|  1.01M|DEF(   put_array_el, 1, 3, 0, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  144|  1.01M|DEF(get_super_value, 1, 3, 1, none) /* this obj prop -> value */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  145|  1.01M|DEF(put_super_value, 1, 4, 0, none) /* this obj prop value -> */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  146|  1.01M|DEF(   define_field, 5, 2, 1, atom)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  147|  1.01M|DEF(       set_name, 5, 1, 1, atom)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  148|  1.01M|DEF(set_name_computed, 1, 2, 2, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  149|  1.01M|DEF(      set_proto, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  150|  1.01M|DEF(set_home_object, 1, 2, 2, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  151|  1.01M|DEF(define_array_el, 1, 3, 2, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  152|  1.01M|DEF(         append, 1, 3, 2, none) /* append enumerated object, update length */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  153|  1.01M|DEF(copy_data_properties, 2, 3, 3, u8)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  154|  1.01M|DEF(  define_method, 6, 2, 1, atom_u8)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  155|  1.01M|DEF(define_method_computed, 2, 3, 1, u8) /* must come after define_method */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  156|  1.01M|DEF(   define_class, 6, 2, 2, atom_u8) /* parent ctor -> ctor proto */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  157|  1.01M|DEF(   define_class_computed, 6, 3, 3, atom_u8) /* field_name parent ctor -> field_name ctor proto (class with computed name) */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  158|       |
  |  |  159|  1.01M|DEF(        get_loc, 3, 0, 1, loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  160|  1.01M|DEF(        put_loc, 3, 1, 0, loc) /* must come after get_loc */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  161|  1.01M|DEF(        set_loc, 3, 1, 1, loc) /* must come after put_loc */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  162|  1.01M|DEF(        get_arg, 3, 0, 1, arg)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  163|  1.01M|DEF(        put_arg, 3, 1, 0, arg) /* must come after get_arg */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  164|  1.01M|DEF(        set_arg, 3, 1, 1, arg) /* must come after put_arg */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  165|  1.01M|DEF(    get_var_ref, 3, 0, 1, var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  166|  1.01M|DEF(    put_var_ref, 3, 1, 0, var_ref) /* must come after get_var_ref */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  167|  1.01M|DEF(    set_var_ref, 3, 1, 1, var_ref) /* must come after put_var_ref */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  168|  1.01M|DEF(set_loc_uninitialized, 3, 0, 0, loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  169|  1.01M|DEF(  get_loc_check, 3, 0, 1, loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  170|  1.01M|DEF(  put_loc_check, 3, 1, 0, loc) /* must come after get_loc_check */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  171|  1.01M|DEF(  set_loc_check, 3, 1, 1, loc) /* must come after put_loc_check */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  172|  1.01M|DEF(  put_loc_check_init, 3, 1, 0, loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  173|  1.01M|DEF(get_loc_checkthis, 3, 0, 1, loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  174|  1.01M|DEF(get_var_ref_check, 3, 0, 1, var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  175|  1.01M|DEF(put_var_ref_check, 3, 1, 0, var_ref) /* must come after get_var_ref_check */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  176|  1.01M|DEF(put_var_ref_check_init, 3, 1, 0, var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  177|  1.01M|DEF(      close_loc, 3, 0, 0, loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  178|  1.01M|DEF(       if_false, 5, 1, 0, label)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  179|  1.01M|DEF(        if_true, 5, 1, 0, label) /* must come after if_false */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  180|  1.01M|DEF(           goto, 5, 0, 0, label) /* must come after if_true */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  181|  1.01M|DEF(          catch, 5, 0, 1, label)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  182|  1.01M|DEF(          gosub, 5, 0, 0, label) /* used to execute the finally block */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  183|  1.01M|DEF(            ret, 1, 1, 0, none) /* used to return from the finally block */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  184|  1.01M|DEF(      nip_catch, 1, 2, 1, none) /* catch ... a -> a */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  185|       |
  |  |  186|  1.01M|DEF(      to_object, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  187|       |//DEF(      to_string, 1, 1, 1, none)
  |  |  188|  1.01M|DEF(     to_propkey, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  189|       |
  |  |  190|  1.01M|DEF(   with_get_var, 10, 1, 0, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  191|  1.01M|DEF(   with_put_var, 10, 2, 1, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  192|  1.01M|DEF(with_delete_var, 10, 1, 0, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  193|  1.01M|DEF(  with_make_ref, 10, 1, 0, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  194|  1.01M|DEF(   with_get_ref, 10, 1, 0, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  195|       |
  |  |  196|  1.01M|DEF(   make_loc_ref, 7, 0, 2, atom_u16)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  197|  1.01M|DEF(   make_arg_ref, 7, 0, 2, atom_u16)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  198|  1.01M|DEF(make_var_ref_ref, 7, 0, 2, atom_u16)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  199|  1.01M|DEF(   make_var_ref, 5, 0, 2, atom)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  200|       |
  |  |  201|  1.01M|DEF(   for_in_start, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  202|  1.01M|DEF(   for_of_start, 1, 1, 3, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  203|  1.01M|DEF(for_await_of_start, 1, 1, 3, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  204|  1.01M|DEF(    for_in_next, 1, 1, 3, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  205|  1.01M|DEF(    for_of_next, 2, 3, 5, u8)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  206|  1.01M|DEF(for_await_of_next, 1, 3, 4, none) /* iter next catch_offset -> iter next catch_offset obj */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  207|  1.01M|DEF(iterator_check_object, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  208|  1.01M|DEF(iterator_get_value_done, 1, 2, 3, none) /* catch_offset obj -> catch_offset value done */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  209|  1.01M|DEF( iterator_close, 1, 3, 0, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  210|  1.01M|DEF(  iterator_next, 1, 4, 4, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  211|  1.01M|DEF(  iterator_call, 2, 4, 5, u8)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  212|  1.01M|DEF(  initial_yield, 1, 0, 0, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  213|  1.01M|DEF(          yield, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  214|  1.01M|DEF(     yield_star, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  215|  1.01M|DEF(async_yield_star, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  216|  1.01M|DEF(          await, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  217|       |
  |  |  218|       |/* arithmetic/logic operations */
  |  |  219|  1.01M|DEF(            neg, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  220|  1.01M|DEF(           plus, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  221|  1.01M|DEF(            dec, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  222|  1.01M|DEF(            inc, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  223|  1.01M|DEF(       post_dec, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  224|  1.01M|DEF(       post_inc, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  225|  1.01M|DEF(        dec_loc, 2, 0, 0, loc8)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  226|  1.01M|DEF(        inc_loc, 2, 0, 0, loc8)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  227|  1.01M|DEF(        add_loc, 2, 1, 0, loc8)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  228|  1.01M|DEF(            not, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  229|  1.01M|DEF(           lnot, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  230|  1.01M|DEF(         typeof, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  231|  1.01M|DEF(         delete, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  232|  1.01M|DEF(     delete_var, 5, 0, 1, atom)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  233|       |
  |  |  234|  1.01M|DEF(            mul, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  235|  1.01M|DEF(            div, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  236|  1.01M|DEF(            mod, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  237|  1.01M|DEF(            add, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  238|  1.01M|DEF(            sub, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  239|  1.01M|DEF(            pow, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  240|  1.01M|DEF(            shl, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  241|  1.01M|DEF(            sar, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  242|  1.01M|DEF(            shr, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  243|  1.01M|DEF(             lt, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  244|  1.01M|DEF(            lte, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  245|  1.01M|DEF(             gt, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  246|  1.01M|DEF(            gte, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  247|  1.01M|DEF(     instanceof, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  248|  1.01M|DEF(             in, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  249|  1.01M|DEF(             eq, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  250|  1.01M|DEF(            neq, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  251|  1.01M|DEF(      strict_eq, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  252|  1.01M|DEF(     strict_neq, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  253|  1.01M|DEF(            and, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  254|  1.01M|DEF(            xor, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  255|  1.01M|DEF(             or, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  256|  1.01M|DEF(is_undefined_or_null, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  257|  1.01M|DEF(     private_in, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  258|  1.01M|DEF(push_bigint_i32, 5, 0, 1, i32)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  259|       |/* must be the last non short and non temporary opcode */
  |  |  260|  1.01M|DEF(            nop, 1, 0, 0, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  261|       |
  |  |  262|       |/* temporary opcodes: never emitted in the final bytecode */
  |  |  263|       |
  |  |  264|  1.01M|def(    enter_scope, 3, 0, 0, u16)  /* emitted in phase 1, removed in phase 2 */
  |  |  265|  1.01M|def(    leave_scope, 3, 0, 0, u16)  /* emitted in phase 1, removed in phase 2 */
  |  |  266|       |
  |  |  267|  1.01M|def(          label, 5, 0, 0, label) /* emitted in phase 1, removed in phase 3 */
  |  |  268|       |
  |  |  269|       |/* the following opcodes must be in the same order as the 'with_x' and
  |  |  270|       |   get_var_undef, get_var and put_var opcodes */
  |  |  271|  1.01M|def(scope_get_var_undef, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  272|  1.01M|def(  scope_get_var, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  273|  1.01M|def(  scope_put_var, 7, 1, 0, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  274|  1.01M|def(scope_delete_var, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  275|  1.01M|def( scope_make_ref, 11, 0, 2, atom_label_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  276|  1.01M|def(  scope_get_ref, 7, 0, 2, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  277|  1.01M|def(scope_put_var_init, 7, 0, 2, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  278|  1.01M|def(scope_get_var_checkthis, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2, only used to return 'this' in derived class constructors */
  |  |  279|  1.01M|def(scope_get_private_field, 7, 1, 1, atom_u16) /* obj -> value, emitted in phase 1, removed in phase 2 */
  |  |  280|  1.01M|def(scope_get_private_field2, 7, 1, 2, atom_u16) /* obj -> obj value, emitted in phase 1, removed in phase 2 */
  |  |  281|  1.01M|def(scope_put_private_field, 7, 2, 0, atom_u16) /* obj value ->, emitted in phase 1, removed in phase 2 */
  |  |  282|  1.01M|def(scope_in_private_field, 7, 1, 1, atom_u16) /* obj -> res emitted in phase 1, removed in phase 2 */
  |  |  283|  1.01M|def(get_field_opt_chain, 5, 1, 1, atom) /* emitted in phase 1, removed in phase 2 */
  |  |  284|  1.01M|def(get_array_el_opt_chain, 1, 2, 1, none) /* emitted in phase 1, removed in phase 2 */
  |  |  285|  1.01M|def( set_class_name, 5, 1, 1, u32) /* emitted in phase 1, removed in phase 2 */
  |  |  286|       |
  |  |  287|  1.01M|def(       line_num, 5, 0, 0, u32) /* emitted in phase 1, removed in phase 3 */
  |  |  288|       |
  |  |  289|  1.01M|#if SHORT_OPCODES
  |  |  290|  1.01M|DEF(    push_minus1, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  291|  1.01M|DEF(         push_0, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  292|  1.01M|DEF(         push_1, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  293|  1.01M|DEF(         push_2, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  294|  1.01M|DEF(         push_3, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  295|  1.01M|DEF(         push_4, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  296|  1.01M|DEF(         push_5, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  297|  1.01M|DEF(         push_6, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  298|  1.01M|DEF(         push_7, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  299|  1.01M|DEF(        push_i8, 2, 0, 1, i8)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  300|  1.01M|DEF(       push_i16, 3, 0, 1, i16)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  301|  1.01M|DEF(    push_const8, 2, 0, 1, const8)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  302|  1.01M|DEF(      fclosure8, 2, 0, 1, const8) /* must follow push_const8 */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  303|  1.01M|DEF(push_empty_string, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  304|       |
  |  |  305|  1.01M|DEF(       get_loc8, 2, 0, 1, loc8)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  306|  1.01M|DEF(       put_loc8, 2, 1, 0, loc8)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  307|  1.01M|DEF(       set_loc8, 2, 1, 1, loc8)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  308|       |
  |  |  309|  1.01M|DEF(       get_loc0, 1, 0, 1, none_loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  310|  1.01M|DEF(       get_loc1, 1, 0, 1, none_loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  311|  1.01M|DEF(       get_loc2, 1, 0, 1, none_loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  312|  1.01M|DEF(       get_loc3, 1, 0, 1, none_loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  313|  1.01M|DEF(       put_loc0, 1, 1, 0, none_loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  314|  1.01M|DEF(       put_loc1, 1, 1, 0, none_loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  315|  1.01M|DEF(       put_loc2, 1, 1, 0, none_loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  316|  1.01M|DEF(       put_loc3, 1, 1, 0, none_loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  317|  1.01M|DEF(       set_loc0, 1, 1, 1, none_loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  318|  1.01M|DEF(       set_loc1, 1, 1, 1, none_loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  319|  1.01M|DEF(       set_loc2, 1, 1, 1, none_loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  320|  1.01M|DEF(       set_loc3, 1, 1, 1, none_loc)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  321|  1.01M|DEF(       get_arg0, 1, 0, 1, none_arg)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  322|  1.01M|DEF(       get_arg1, 1, 0, 1, none_arg)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  323|  1.01M|DEF(       get_arg2, 1, 0, 1, none_arg)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  324|  1.01M|DEF(       get_arg3, 1, 0, 1, none_arg)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  325|  1.01M|DEF(       put_arg0, 1, 1, 0, none_arg)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  326|  1.01M|DEF(       put_arg1, 1, 1, 0, none_arg)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  327|  1.01M|DEF(       put_arg2, 1, 1, 0, none_arg)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  328|  1.01M|DEF(       put_arg3, 1, 1, 0, none_arg)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  329|  1.01M|DEF(       set_arg0, 1, 1, 1, none_arg)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  330|  1.01M|DEF(       set_arg1, 1, 1, 1, none_arg)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  331|  1.01M|DEF(       set_arg2, 1, 1, 1, none_arg)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  332|  1.01M|DEF(       set_arg3, 1, 1, 1, none_arg)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  333|  1.01M|DEF(   get_var_ref0, 1, 0, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  334|  1.01M|DEF(   get_var_ref1, 1, 0, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  335|  1.01M|DEF(   get_var_ref2, 1, 0, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  336|  1.01M|DEF(   get_var_ref3, 1, 0, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  337|  1.01M|DEF(   put_var_ref0, 1, 1, 0, none_var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  338|  1.01M|DEF(   put_var_ref1, 1, 1, 0, none_var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  339|  1.01M|DEF(   put_var_ref2, 1, 1, 0, none_var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  340|  1.01M|DEF(   put_var_ref3, 1, 1, 0, none_var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  341|  1.01M|DEF(   set_var_ref0, 1, 1, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  342|  1.01M|DEF(   set_var_ref1, 1, 1, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  343|  1.01M|DEF(   set_var_ref2, 1, 1, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  344|  1.01M|DEF(   set_var_ref3, 1, 1, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  345|       |
  |  |  346|  1.01M|DEF(     get_length, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  347|       |
  |  |  348|  1.01M|DEF(      if_false8, 2, 1, 0, label8)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  349|  1.01M|DEF(       if_true8, 2, 1, 0, label8) /* must come after if_false8 */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  350|  1.01M|DEF(          goto8, 2, 0, 0, label8) /* must come after if_true8 */
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  351|  1.01M|DEF(         goto16, 3, 0, 0, label16)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  352|       |
  |  |  353|  1.01M|DEF(          call0, 1, 1, 1, npopx)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  354|  1.01M|DEF(          call1, 1, 1, 1, npopx)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  355|  1.01M|DEF(          call2, 1, 1, 1, npopx)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  356|  1.01M|DEF(          call3, 1, 1, 1, npopx)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  357|       |
  |  |  358|  1.01M|DEF(   is_undefined, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  359|  1.01M|DEF(        is_null, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  360|  1.01M|DEF(typeof_is_undefined, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  361|  1.01M|DEF( typeof_is_function, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17794|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  362|  1.01M|#endif
  |  |  363|       |
  |  |  364|  1.01M|#undef DEF
  |  |  365|  1.01M|#undef def
  |  |  366|  1.01M|#endif  /* DEF */
  ------------------
17801|  1.01M|        [ OP_COUNT ... 255 ] = &&case_default
17802|  1.01M|    };
17803|  1.01M|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
17804|       |#ifdef OPCODE_ASM_LABEL
17805|       |#define CASE(op)        case_ ## op: asm volatile("label_" #op ":\n.globl label_" #op); dummy_case_ ## op
17806|       |#else
17807|  1.01M|#define CASE(op)        case_ ## op
17808|  1.01M|#endif
17809|  1.01M|#define DEFAULT         case_default
17810|  1.01M|#define BREAK           SWITCH(pc)
17811|  1.01M|#endif
17812|       |
17813|  1.01M|    if (js_poll_interrupts(caller_ctx))
  ------------------
  |  Branch (17813:9): [True: 2, False: 1.01M]
  ------------------
17814|      2|        return JS_EXCEPTION;
  ------------------
  |  |  294|      2|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17815|  1.01M|    if (unlikely(JS_VALUE_GET_TAG(func_obj) != JS_TAG_OBJECT)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 16, False: 1.01M]
  |  |  ------------------
  ------------------
17816|     16|        if (flags & JS_CALL_FLAG_GENERATOR) {
  ------------------
  |  |17586|     16|#define JS_CALL_FLAG_GENERATOR   (1 << 2)
  ------------------
  |  Branch (17816:13): [True: 16, False: 0]
  ------------------
17817|     16|            JSAsyncFunctionState *s = JS_VALUE_GET_PTR(func_obj);
  ------------------
  |  |  243|     16|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
17818|       |            /* func_obj get contains a pointer to JSFuncAsyncState */
17819|       |            /* the stack frame is already allocated */
17820|     16|            sf = &s->frame;
17821|     16|            p = JS_VALUE_GET_OBJ(sf->cur_func);
  ------------------
  |  |  229|     16|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     16|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17822|     16|            b = p->u.func.function_bytecode;
17823|     16|            ctx = b->realm;
17824|     16|            var_refs = p->u.func.var_refs;
17825|     16|            local_buf = arg_buf = sf->arg_buf;
17826|     16|            var_buf = sf->var_buf;
17827|     16|            stack_buf = sf->var_buf + b->var_count;
17828|     16|            sp = sf->cur_sp;
17829|     16|            sf->cur_sp = NULL; /* cur_sp is NULL if the function is running */
17830|     16|            pc = sf->cur_pc;
17831|     16|            sf->prev_frame = rt->current_stack_frame;
17832|     16|            rt->current_stack_frame = sf;
17833|     16|            if (s->throw_flag)
  ------------------
  |  Branch (17833:17): [True: 0, False: 16]
  ------------------
17834|      0|                goto exception;
17835|     16|            else
17836|     16|                goto restart;
17837|     16|        } else {
17838|      0|            goto not_a_function;
17839|      0|        }
17840|     16|    }
17841|  1.01M|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  229|  1.01M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.01M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17842|  1.01M|    if (unlikely(p->class_id != JS_CLASS_BYTECODE_FUNCTION)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1.01M, False: 30]
  |  |  ------------------
  ------------------
17843|  1.01M|        JSClassCall *call_func;
17844|  1.01M|        call_func = rt->class_array[p->class_id].call;
17845|  1.01M|        if (!call_func) {
  ------------------
  |  Branch (17845:13): [True: 0, False: 1.01M]
  ------------------
17846|      0|        not_a_function:
17847|      0|            return JS_ThrowTypeError(caller_ctx, "not a function");
17848|      0|        }
17849|  1.01M|        return call_func(caller_ctx, func_obj, this_obj, argc,
17850|  1.01M|                         (JSValueConst *)argv, flags);
17851|  1.01M|    }
17852|     30|    b = p->u.func.function_bytecode;
17853|       |
17854|     30|    if (unlikely(argc < b->arg_count || (flags & JS_CALL_FLAG_COPY_ARGV))) {
  ------------------
  |  |   33|     58|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 30, False: 0]
  |  |  |  Branch (33:45): [True: 2, False: 28]
  |  |  |  Branch (33:45): [True: 28, False: 0]
  |  |  ------------------
  ------------------
17855|     30|        arg_allocated_size = b->arg_count;
17856|     30|    } else {
17857|      0|        arg_allocated_size = 0;
17858|      0|    }
17859|       |
17860|     30|    alloca_size = sizeof(JSValue) * (arg_allocated_size + b->var_count +
17861|     30|                                     b->stack_size) +
17862|     30|        sizeof(JSVarRef *) * b->var_ref_count;
17863|     30|    if (js_check_stack_overflow(rt, alloca_size))
  ------------------
  |  Branch (17863:9): [True: 0, False: 30]
  ------------------
17864|      0|        return JS_ThrowStackOverflow(caller_ctx);
17865|       |
17866|     30|    sf->js_mode = b->js_mode;
17867|     30|    arg_buf = argv;
17868|     30|    sf->arg_count = argc;
17869|     30|    sf->cur_func = (JSValue)func_obj;
17870|     30|    var_refs = p->u.func.var_refs;
17871|       |
17872|     30|    local_buf = alloca(alloca_size);
17873|     30|    if (unlikely(arg_allocated_size)) {
  ------------------
  |  |   33|     30|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 28]
  |  |  ------------------
  ------------------
17874|      2|        int n = min_int(argc, b->arg_count);
17875|      2|        arg_buf = local_buf;
17876|      4|        for(i = 0; i < n; i++)
  ------------------
  |  Branch (17876:20): [True: 2, False: 2]
  ------------------
17877|      2|            arg_buf[i] = JS_DupValue(caller_ctx, argv[i]);
17878|      4|        for(; i < b->arg_count; i++)
  ------------------
  |  Branch (17878:15): [True: 2, False: 2]
  ------------------
17879|      2|            arg_buf[i] = JS_UNDEFINED;
  ------------------
  |  |  291|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17880|      2|        sf->arg_count = b->arg_count;
17881|      2|    }
17882|     30|    var_buf = local_buf + arg_allocated_size;
17883|     30|    sf->var_buf = var_buf;
17884|     30|    sf->arg_buf = arg_buf;
17885|       |
17886|     50|    for(i = 0; i < b->var_count; i++)
  ------------------
  |  Branch (17886:16): [True: 20, False: 30]
  ------------------
17887|     30|        var_buf[i] = JS_UNDEFINED;
  ------------------
  |  |  291|     20|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     50|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17888|       |
17889|     30|    stack_buf = var_buf + b->var_count;
17890|     30|    sf->var_refs = (JSVarRef **)(stack_buf + b->stack_size);
17891|     30|    for(i = 0; i < b->var_ref_count; i++)
  ------------------
  |  Branch (17891:16): [True: 0, False: 30]
  ------------------
17892|      0|        sf->var_refs[i] = NULL;
17893|     30|    sp = stack_buf;
17894|     30|    pc = b->byte_code_buf;
17895|     30|    sf->prev_frame = rt->current_stack_frame;
17896|     30|    rt->current_stack_frame = sf;
17897|     30|    ctx = b->realm; /* set the current realm */
17898|       |
17899|     46| restart:
17900|     46|    for(;;) {
17901|     46|        int call_argc;
17902|     46|        JSValue *call_argv;
17903|       |
17904|     46|        SWITCH(pc) {
  ------------------
  |  |17803|     46|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  ------------------
17905|     46|        CASE(OP_push_i32):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
17906|      0|            *sp++ = JS_NewInt32(ctx, get_u32(pc));
17907|      0|            pc += 4;
17908|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17909|      0|        CASE(OP_push_bigint_i32):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
17910|      0|            *sp++ = __JS_NewShortBigInt(ctx, (int)get_u32(pc));
17911|      0|            pc += 4;
17912|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17913|      0|        CASE(OP_push_const):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
17914|      0|            *sp++ = JS_DupValue(ctx, b->cpool[get_u32(pc)]);
17915|      0|            pc += 4;
17916|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17917|      0|#if SHORT_OPCODES
17918|      0|        CASE(OP_push_minus1):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
17919|      0|        CASE(OP_push_0):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
17920|      2|        CASE(OP_push_1):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
17921|      2|        CASE(OP_push_2):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
17922|      2|        CASE(OP_push_3):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
17923|      2|        CASE(OP_push_4):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
17924|      2|        CASE(OP_push_5):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
17925|      2|        CASE(OP_push_6):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
17926|      2|        CASE(OP_push_7):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
17927|      2|            *sp++ = JS_NewInt32(ctx, opcode - OP_push_0);
17928|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17929|      2|        CASE(OP_push_i8):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
17930|      0|            *sp++ = JS_NewInt32(ctx, get_i8(pc));
17931|      0|            pc += 1;
17932|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17933|      0|        CASE(OP_push_i16):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
17934|      0|            *sp++ = JS_NewInt32(ctx, get_i16(pc));
17935|      0|            pc += 2;
17936|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17937|     12|        CASE(OP_push_const8):
  ------------------
  |  |17807|     12|#define CASE(op)        case_ ## op
  ------------------
17938|     12|            *sp++ = JS_DupValue(ctx, b->cpool[*pc++]);
17939|     12|            BREAK;
  ------------------
  |  |17810|     12|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|     12|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17940|     12|        CASE(OP_fclosure8):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
17941|      2|            *sp++ = js_closure(ctx, JS_DupValue(ctx, b->cpool[*pc++]), var_refs, sf, FALSE);
17942|      2|            if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
17943|      0|                goto exception;
17944|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17945|      2|        CASE(OP_push_empty_string):
  ------------------
  |  |17807|      1|#define CASE(op)        case_ ## op
  ------------------
17946|      1|            *sp++ = JS_AtomToString(ctx, JS_ATOM_empty_string);
17947|      1|            BREAK;
  ------------------
  |  |17810|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17948|      1|#endif
17949|      7|        CASE(OP_push_atom_value):
  ------------------
  |  |17807|      7|#define CASE(op)        case_ ## op
  ------------------
17950|      7|            *sp++ = JS_AtomToValue(ctx, get_u32(pc));
17951|      7|            pc += 4;
17952|      7|            BREAK;
  ------------------
  |  |17810|      7|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      7|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17953|     19|        CASE(OP_undefined):
  ------------------
  |  |17807|     19|#define CASE(op)        case_ ## op
  ------------------
17954|     19|            *sp++ = JS_UNDEFINED;
  ------------------
  |  |  291|     19|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     19|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17955|     19|            BREAK;
  ------------------
  |  |17810|     19|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|     19|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17956|     19|        CASE(OP_null):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
17957|      0|            *sp++ = JS_NULL;
  ------------------
  |  |  290|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17958|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17959|     32|        CASE(OP_push_this):
  ------------------
  |  |17807|     32|#define CASE(op)        case_ ## op
  ------------------
17960|       |            /* OP_push_this is only called at the start of a function */
17961|     32|            {
17962|     32|                JSValue val;
17963|     32|                if (!(b->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  403|     32|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (17963:21): [True: 0, False: 32]
  ------------------
17964|      0|                    uint32_t tag = JS_VALUE_GET_TAG(this_obj);
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
17965|      0|                    if (likely(tag == JS_TAG_OBJECT))
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17966|      0|                        goto normal_this;
17967|      0|                    if (tag == JS_TAG_NULL || tag == JS_TAG_UNDEFINED) {
  ------------------
  |  Branch (17967:25): [True: 0, False: 0]
  |  Branch (17967:47): [True: 0, False: 0]
  ------------------
17968|      0|                        val = JS_DupValue(ctx, ctx->global_obj);
17969|      0|                    } else {
17970|      0|                        val = JS_ToObject(ctx, this_obj);
17971|      0|                        if (JS_IsException(val))
  ------------------
  |  Branch (17971:29): [True: 0, False: 0]
  ------------------
17972|      0|                            goto exception;
17973|      0|                    }
17974|     32|                } else {
17975|     32|                normal_this:
17976|     32|                    val = JS_DupValue(ctx, this_obj);
17977|     32|                }
17978|     32|                *sp++ = val;
17979|     32|            }
17980|     32|            BREAK;
  ------------------
  |  |17810|     32|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|     32|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17981|     32|        CASE(OP_push_false):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
17982|      0|            *sp++ = JS_FALSE;
  ------------------
  |  |  292|      0|#define JS_FALSE     JS_MKVAL(JS_TAG_BOOL, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17983|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17984|      0|        CASE(OP_push_true):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
17985|      0|            *sp++ = JS_TRUE;
  ------------------
  |  |  293|      0|#define JS_TRUE      JS_MKVAL(JS_TAG_BOOL, 1)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17986|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17987|      0|        CASE(OP_object):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
17988|      0|            *sp++ = JS_NewObject(ctx);
17989|      0|            if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17990|      0|                goto exception;
17991|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17992|      0|        CASE(OP_special_object):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
17993|      0|            {
17994|      0|                int arg = *pc++;
17995|      0|                switch(arg) {
17996|      0|                case OP_SPECIAL_OBJECT_ARGUMENTS:
  ------------------
  |  Branch (17996:17): [True: 0, False: 0]
  ------------------
17997|      0|                    *sp++ = js_build_arguments(ctx, argc, (JSValueConst *)argv);
17998|      0|                    if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17999|      0|                        goto exception;
18000|      0|                    break;
18001|      0|                case OP_SPECIAL_OBJECT_MAPPED_ARGUMENTS:
  ------------------
  |  Branch (18001:17): [True: 0, False: 0]
  ------------------
18002|      0|                    *sp++ = js_build_mapped_arguments(ctx, argc, (JSValueConst *)argv,
18003|      0|                                                      sf, min_int(argc, b->arg_count));
18004|      0|                    if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18005|      0|                        goto exception;
18006|      0|                    break;
18007|      0|                case OP_SPECIAL_OBJECT_THIS_FUNC:
  ------------------
  |  Branch (18007:17): [True: 0, False: 0]
  ------------------
18008|      0|                    *sp++ = JS_DupValue(ctx, sf->cur_func);
18009|      0|                    break;
18010|      0|                case OP_SPECIAL_OBJECT_NEW_TARGET:
  ------------------
  |  Branch (18010:17): [True: 0, False: 0]
  ------------------
18011|      0|                    *sp++ = JS_DupValue(ctx, new_target);
18012|      0|                    break;
18013|      0|                case OP_SPECIAL_OBJECT_HOME_OBJECT:
  ------------------
  |  Branch (18013:17): [True: 0, False: 0]
  ------------------
18014|      0|                    {
18015|      0|                        JSObject *p1;
18016|      0|                        p1 = p->u.func.home_object;
18017|      0|                        if (unlikely(!p1))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18018|      0|                            *sp++ = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18019|      0|                        else
18020|      0|                            *sp++ = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p1));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
18021|      0|                    }
18022|      0|                    break;
18023|      0|                case OP_SPECIAL_OBJECT_VAR_OBJECT:
  ------------------
  |  Branch (18023:17): [True: 0, False: 0]
  ------------------
18024|      0|                    *sp++ = JS_NewObjectProto(ctx, JS_NULL);
  ------------------
  |  |  290|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18025|      0|                    if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18026|      0|                        goto exception;
18027|      0|                    break;
18028|      0|                case OP_SPECIAL_OBJECT_IMPORT_META:
  ------------------
  |  Branch (18028:17): [True: 0, False: 0]
  ------------------
18029|      0|                    *sp++ = js_import_meta(ctx);
18030|      0|                    if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18031|      0|                        goto exception;
18032|      0|                    break;
18033|      0|                default:
  ------------------
  |  Branch (18033:17): [True: 0, False: 0]
  ------------------
18034|      0|                    abort();
18035|      0|                }
18036|      0|            }
18037|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18038|      0|        CASE(OP_rest):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18039|      0|            {
18040|      0|                int first = get_u16(pc);
18041|      0|                pc += 2;
18042|      0|                first = min_int(first, argc);
18043|      0|                *sp++ = js_create_array(ctx, argc - first, (JSValueConst *)(argv + first));
18044|      0|                if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18045|      0|                    goto exception;
18046|      0|            }
18047|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18048|       |
18049|      8|        CASE(OP_drop):
  ------------------
  |  |17807|      8|#define CASE(op)        case_ ## op
  ------------------
18050|      8|            JS_FreeValue(ctx, sp[-1]);
18051|      8|            sp--;
18052|      8|            BREAK;
  ------------------
  |  |17810|      8|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      8|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18053|      8|        CASE(OP_nip):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18054|      0|            JS_FreeValue(ctx, sp[-2]);
18055|      0|            sp[-2] = sp[-1];
18056|      0|            sp--;
18057|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18058|      0|        CASE(OP_nip1): /* a b c -> b c */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18059|      0|            JS_FreeValue(ctx, sp[-3]);
18060|      0|            sp[-3] = sp[-2];
18061|      0|            sp[-2] = sp[-1];
18062|      0|            sp--;
18063|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18064|      6|        CASE(OP_dup):
  ------------------
  |  |17807|      6|#define CASE(op)        case_ ## op
  ------------------
18065|      6|            sp[0] = JS_DupValue(ctx, sp[-1]);
18066|      6|            sp++;
18067|      6|            BREAK;
  ------------------
  |  |17810|      6|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      6|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18068|      6|        CASE(OP_dup2): /* a b -> a b a b */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18069|      0|            sp[0] = JS_DupValue(ctx, sp[-2]);
18070|      0|            sp[1] = JS_DupValue(ctx, sp[-1]);
18071|      0|            sp += 2;
18072|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18073|      0|        CASE(OP_dup3): /* a b c -> a b c a b c */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18074|      0|            sp[0] = JS_DupValue(ctx, sp[-3]);
18075|      0|            sp[1] = JS_DupValue(ctx, sp[-2]);
18076|      0|            sp[2] = JS_DupValue(ctx, sp[-1]);
18077|      0|            sp += 3;
18078|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18079|      0|        CASE(OP_dup1): /* a b -> a a b */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18080|      0|            sp[0] = sp[-1];
18081|      0|            sp[-1] = JS_DupValue(ctx, sp[-2]);
18082|      0|            sp++;
18083|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18084|      0|        CASE(OP_insert2): /* obj a -> a obj a (dup_x1) */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18085|      0|            sp[0] = sp[-1];
18086|      0|            sp[-1] = sp[-2];
18087|      0|            sp[-2] = JS_DupValue(ctx, sp[0]);
18088|      0|            sp++;
18089|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18090|      0|        CASE(OP_insert3): /* obj prop a -> a obj prop a (dup_x2) */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18091|      0|            sp[0] = sp[-1];
18092|      0|            sp[-1] = sp[-2];
18093|      0|            sp[-2] = sp[-3];
18094|      0|            sp[-3] = JS_DupValue(ctx, sp[0]);
18095|      0|            sp++;
18096|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18097|      0|        CASE(OP_insert4): /* this obj prop a -> a this obj prop a */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18098|      0|            sp[0] = sp[-1];
18099|      0|            sp[-1] = sp[-2];
18100|      0|            sp[-2] = sp[-3];
18101|      0|            sp[-3] = sp[-4];
18102|      0|            sp[-4] = JS_DupValue(ctx, sp[0]);
18103|      0|            sp++;
18104|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18105|      0|        CASE(OP_perm3): /* obj a b -> a obj b (213) */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18106|      0|            {
18107|      0|                JSValue tmp;
18108|      0|                tmp = sp[-2];
18109|      0|                sp[-2] = sp[-3];
18110|      0|                sp[-3] = tmp;
18111|      0|            }
18112|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18113|      0|        CASE(OP_rot3l): /* x a b -> a b x (231) */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18114|      0|            {
18115|      0|                JSValue tmp;
18116|      0|                tmp = sp[-3];
18117|      0|                sp[-3] = sp[-2];
18118|      0|                sp[-2] = sp[-1];
18119|      0|                sp[-1] = tmp;
18120|      0|            }
18121|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18122|      0|        CASE(OP_rot4l): /* x a b c -> a b c x */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18123|      0|            {
18124|      0|                JSValue tmp;
18125|      0|                tmp = sp[-4];
18126|      0|                sp[-4] = sp[-3];
18127|      0|                sp[-3] = sp[-2];
18128|      0|                sp[-2] = sp[-1];
18129|      0|                sp[-1] = tmp;
18130|      0|            }
18131|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18132|      0|        CASE(OP_rot5l): /* x a b c d -> a b c d x */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18133|      0|            {
18134|      0|                JSValue tmp;
18135|      0|                tmp = sp[-5];
18136|      0|                sp[-5] = sp[-4];
18137|      0|                sp[-4] = sp[-3];
18138|      0|                sp[-3] = sp[-2];
18139|      0|                sp[-2] = sp[-1];
18140|      0|                sp[-1] = tmp;
18141|      0|            }
18142|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18143|      0|        CASE(OP_rot3r): /* a b x -> x a b (312) */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18144|      0|            {
18145|      0|                JSValue tmp;
18146|      0|                tmp = sp[-1];
18147|      0|                sp[-1] = sp[-2];
18148|      0|                sp[-2] = sp[-3];
18149|      0|                sp[-3] = tmp;
18150|      0|            }
18151|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18152|      0|        CASE(OP_perm4): /* obj prop a b -> a obj prop b */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18153|      0|            {
18154|      0|                JSValue tmp;
18155|      0|                tmp = sp[-2];
18156|      0|                sp[-2] = sp[-3];
18157|      0|                sp[-3] = sp[-4];
18158|      0|                sp[-4] = tmp;
18159|      0|            }
18160|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18161|      0|        CASE(OP_perm5): /* this obj prop a b -> a this obj prop b */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18162|      0|            {
18163|      0|                JSValue tmp;
18164|      0|                tmp = sp[-2];
18165|      0|                sp[-2] = sp[-3];
18166|      0|                sp[-3] = sp[-4];
18167|      0|                sp[-4] = sp[-5];
18168|      0|                sp[-5] = tmp;
18169|      0|            }
18170|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18171|      0|        CASE(OP_swap): /* a b -> b a */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18172|      0|            {
18173|      0|                JSValue tmp;
18174|      0|                tmp = sp[-2];
18175|      0|                sp[-2] = sp[-1];
18176|      0|                sp[-1] = tmp;
18177|      0|            }
18178|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18179|      0|        CASE(OP_swap2): /* a b c d -> c d a b */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18180|      0|            {
18181|      0|                JSValue tmp1, tmp2;
18182|      0|                tmp1 = sp[-4];
18183|      0|                tmp2 = sp[-3];
18184|      0|                sp[-4] = sp[-2];
18185|      0|                sp[-3] = sp[-1];
18186|      0|                sp[-2] = tmp1;
18187|      0|                sp[-1] = tmp2;
18188|      0|            }
18189|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18190|       |
18191|      0|        CASE(OP_fclosure):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18192|      0|            {
18193|      0|                JSValue bfunc = JS_DupValue(ctx, b->cpool[get_u32(pc)]);
18194|      0|                pc += 4;
18195|      0|                *sp++ = js_closure(ctx, bfunc, var_refs, sf, FALSE);
18196|      0|                if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18197|      0|                    goto exception;
18198|      0|            }
18199|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18200|      0|#if SHORT_OPCODES
18201|      0|        CASE(OP_call0):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18202|      4|        CASE(OP_call1):
  ------------------
  |  |17807|      4|#define CASE(op)        case_ ## op
  ------------------
18203|      4|        CASE(OP_call2):
  ------------------
  |  |17807|      4|#define CASE(op)        case_ ## op
  ------------------
18204|      4|        CASE(OP_call3):
  ------------------
  |  |17807|      4|#define CASE(op)        case_ ## op
  ------------------
18205|      4|            call_argc = opcode - OP_call0;
18206|      4|            goto has_call_argc;
18207|      0|#endif
18208|      0|        CASE(OP_call):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18209|      0|        CASE(OP_tail_call):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18210|      0|            {
18211|      0|                call_argc = get_u16(pc);
18212|      0|                pc += 2;
18213|      0|                goto has_call_argc;
18214|      4|            has_call_argc:
18215|      4|                call_argv = sp - call_argc;
18216|      4|                sf->cur_pc = pc;
18217|      4|                ret_val = JS_CallInternal(ctx, call_argv[-1], JS_UNDEFINED,
  ------------------
  |  |  291|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18218|      4|                                          JS_UNDEFINED, call_argc, call_argv, 0);
  ------------------
  |  |  291|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18219|      4|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      4|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1, False: 3]
  |  |  ------------------
  ------------------
18220|      1|                    goto exception;
18221|      3|                if (opcode == OP_tail_call)
  ------------------
  |  Branch (18221:21): [True: 0, False: 3]
  ------------------
18222|      0|                    goto done;
18223|      9|                for(i = -1; i < call_argc; i++)
  ------------------
  |  Branch (18223:29): [True: 6, False: 3]
  ------------------
18224|      6|                    JS_FreeValue(ctx, call_argv[i]);
18225|      3|                sp -= call_argc + 1;
18226|      3|                *sp++ = ret_val;
18227|      3|            }
18228|      3|            BREAK;
  ------------------
  |  |17810|      3|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      3|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18229|      3|        CASE(OP_call_constructor):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18230|      0|            {
18231|      0|                call_argc = get_u16(pc);
18232|      0|                pc += 2;
18233|      0|                call_argv = sp - call_argc;
18234|      0|                sf->cur_pc = pc;
18235|      0|                ret_val = JS_CallConstructorInternal(ctx, call_argv[-2],
18236|      0|                                                     call_argv[-1],
18237|      0|                                                     call_argc, call_argv, 0);
18238|      0|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18239|      0|                    goto exception;
18240|      0|                for(i = -2; i < call_argc; i++)
  ------------------
  |  Branch (18240:29): [True: 0, False: 0]
  ------------------
18241|      0|                    JS_FreeValue(ctx, call_argv[i]);
18242|      0|                sp -= call_argc + 2;
18243|      0|                *sp++ = ret_val;
18244|      0|            }
18245|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18246|      4|        CASE(OP_call_method):
  ------------------
  |  |17807|      4|#define CASE(op)        case_ ## op
  ------------------
18247|      4|        CASE(OP_tail_call_method):
  ------------------
  |  |17807|      4|#define CASE(op)        case_ ## op
  ------------------
18248|      4|            {
18249|      4|                call_argc = get_u16(pc);
18250|      4|                pc += 2;
18251|      4|                call_argv = sp - call_argc;
18252|      4|                sf->cur_pc = pc;
18253|      4|                ret_val = JS_CallInternal(ctx, call_argv[-1], call_argv[-2],
18254|      4|                                          JS_UNDEFINED, call_argc, call_argv, 0);
  ------------------
  |  |  291|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18255|      4|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      4|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1, False: 3]
  |  |  ------------------
  ------------------
18256|      1|                    goto exception;
18257|      3|                if (opcode == OP_tail_call_method)
  ------------------
  |  Branch (18257:21): [True: 0, False: 3]
  ------------------
18258|      0|                    goto done;
18259|     12|                for(i = -2; i < call_argc; i++)
  ------------------
  |  Branch (18259:29): [True: 9, False: 3]
  ------------------
18260|      9|                    JS_FreeValue(ctx, call_argv[i]);
18261|      3|                sp -= call_argc + 2;
18262|      3|                *sp++ = ret_val;
18263|      3|            }
18264|      3|            BREAK;
  ------------------
  |  |17810|      3|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      3|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18265|      3|        CASE(OP_array_from):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18266|      0|            call_argc = get_u16(pc);
18267|      0|            pc += 2;
18268|      0|            ret_val = js_create_array_free(ctx, call_argc, sp - call_argc);
18269|      0|            sp -= call_argc;
18270|      0|            if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18271|      0|                goto exception;
18272|      0|            *sp++ = ret_val;
18273|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18274|       |
18275|      0|        CASE(OP_apply):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18276|      0|            {
18277|      0|                int magic;
18278|      0|                magic = get_u16(pc);
18279|      0|                pc += 2;
18280|      0|                sf->cur_pc = pc;
18281|       |
18282|      0|                ret_val = js_function_apply(ctx, sp[-3], 2, (JSValueConst *)&sp[-2], magic);
18283|      0|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18284|      0|                    goto exception;
18285|      0|                JS_FreeValue(ctx, sp[-3]);
18286|      0|                JS_FreeValue(ctx, sp[-2]);
18287|      0|                JS_FreeValue(ctx, sp[-1]);
18288|      0|                sp -= 3;
18289|      0|                *sp++ = ret_val;
18290|      0|            }
18291|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18292|      3|        CASE(OP_return):
  ------------------
  |  |17807|      3|#define CASE(op)        case_ ## op
  ------------------
18293|      3|            ret_val = *--sp;
18294|      3|            goto done;
18295|     16|        CASE(OP_return_undef):
  ------------------
  |  |17807|     16|#define CASE(op)        case_ ## op
  ------------------
18296|     16|            ret_val = JS_UNDEFINED;
  ------------------
  |  |  291|     16|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     16|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18297|     16|            goto done;
18298|       |
18299|      0|        CASE(OP_check_ctor_return):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18300|       |            /* return TRUE if 'this' should be returned */
18301|      0|            if (!JS_IsObject(sp[-1])) {
  ------------------
  |  Branch (18301:17): [True: 0, False: 0]
  ------------------
18302|      0|                if (!JS_IsUndefined(sp[-1])) {
  ------------------
  |  Branch (18302:21): [True: 0, False: 0]
  ------------------
18303|      0|                    JS_ThrowTypeError(caller_ctx, "derived class constructor must return an object or undefined");
18304|      0|                    goto exception;
18305|      0|                }
18306|      0|                sp[0] = JS_TRUE;
  ------------------
  |  |  293|      0|#define JS_TRUE      JS_MKVAL(JS_TAG_BOOL, 1)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18307|      0|            } else {
18308|      0|                sp[0] = JS_FALSE;
  ------------------
  |  |  292|      0|#define JS_FALSE     JS_MKVAL(JS_TAG_BOOL, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18309|      0|            }
18310|      0|            sp++;
18311|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18312|      0|        CASE(OP_check_ctor):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18313|      0|            if (JS_IsUndefined(new_target)) {
  ------------------
  |  Branch (18313:17): [True: 0, False: 0]
  ------------------
18314|      0|            non_ctor_call:
18315|      0|                JS_ThrowTypeError(ctx, "class constructors must be invoked with 'new'");
18316|      0|                goto exception;
18317|      0|            }
18318|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18319|      0|        CASE(OP_init_ctor):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18320|      0|            {
18321|      0|                JSValue super, ret;
18322|      0|                sf->cur_pc = pc;
18323|      0|                if (JS_IsUndefined(new_target))
  ------------------
  |  Branch (18323:21): [True: 0, False: 0]
  ------------------
18324|      0|                    goto non_ctor_call;
18325|      0|                super = JS_GetPrototype(ctx, func_obj);
18326|      0|                if (JS_IsException(super))
  ------------------
  |  Branch (18326:21): [True: 0, False: 0]
  ------------------
18327|      0|                    goto exception;
18328|      0|                ret = JS_CallConstructor2(ctx, super, new_target, argc, (JSValueConst *)argv);
18329|      0|                JS_FreeValue(ctx, super);
18330|      0|                if (JS_IsException(ret))
  ------------------
  |  Branch (18330:21): [True: 0, False: 0]
  ------------------
18331|      0|                    goto exception;
18332|      0|                *sp++ = ret;
18333|      0|            }
18334|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18335|      0|        CASE(OP_check_brand):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18336|      0|            {
18337|      0|                int ret = JS_CheckBrand(ctx, sp[-2], sp[-1]);
18338|      0|                if (ret < 0)
  ------------------
  |  Branch (18338:21): [True: 0, False: 0]
  ------------------
18339|      0|                    goto exception;
18340|      0|                if (!ret) {
  ------------------
  |  Branch (18340:21): [True: 0, False: 0]
  ------------------
18341|      0|                    JS_ThrowTypeError(ctx, "invalid brand on object");
18342|      0|                    goto exception;
18343|      0|                }
18344|      0|            }
18345|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18346|      0|        CASE(OP_add_brand):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18347|      0|            if (JS_AddBrand(ctx, sp[-2], sp[-1]) < 0)
  ------------------
  |  Branch (18347:17): [True: 0, False: 0]
  ------------------
18348|      0|                goto exception;
18349|      0|            JS_FreeValue(ctx, sp[-2]);
18350|      0|            JS_FreeValue(ctx, sp[-1]);
18351|      0|            sp -= 2;
18352|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18353|       |
18354|      0|        CASE(OP_throw):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18355|      0|            JS_Throw(ctx, *--sp);
18356|      0|            goto exception;
18357|       |
18358|      0|        CASE(OP_throw_error):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18359|      0|#define JS_THROW_VAR_RO             0
18360|      0|#define JS_THROW_VAR_REDECL         1
18361|      0|#define JS_THROW_VAR_UNINITIALIZED  2
18362|      0|#define JS_THROW_ERROR_DELETE_SUPER   3
18363|      0|#define JS_THROW_ERROR_ITERATOR_THROW 4
18364|      0|            {
18365|      0|                JSAtom atom;
18366|      0|                int type;
18367|      0|                atom = get_u32(pc);
18368|      0|                type = pc[4];
18369|      0|                pc += 5;
18370|      0|                if (type == JS_THROW_VAR_RO)
  ------------------
  |  |18359|      0|#define JS_THROW_VAR_RO             0
  ------------------
  |  Branch (18370:21): [True: 0, False: 0]
  ------------------
18371|      0|                    JS_ThrowTypeErrorReadOnly(ctx, JS_PROP_THROW, atom);
  ------------------
  |  |  320|      0|#define JS_PROP_THROW            (1 << 14)
  ------------------
18372|      0|                else
18373|      0|                if (type == JS_THROW_VAR_REDECL)
  ------------------
  |  |18360|      0|#define JS_THROW_VAR_REDECL         1
  ------------------
  |  Branch (18373:21): [True: 0, False: 0]
  ------------------
18374|      0|                    JS_ThrowSyntaxErrorVarRedeclaration(ctx, atom);
18375|      0|                else
18376|      0|                if (type == JS_THROW_VAR_UNINITIALIZED)
  ------------------
  |  |18361|      0|#define JS_THROW_VAR_UNINITIALIZED  2
  ------------------
  |  Branch (18376:21): [True: 0, False: 0]
  ------------------
18377|      0|                    JS_ThrowReferenceErrorUninitialized(ctx, atom);
18378|      0|                else
18379|      0|                if (type == JS_THROW_ERROR_DELETE_SUPER)
  ------------------
  |  |18362|      0|#define JS_THROW_ERROR_DELETE_SUPER   3
  ------------------
  |  Branch (18379:21): [True: 0, False: 0]
  ------------------
18380|      0|                    JS_ThrowReferenceError(ctx, "unsupported reference to 'super'");
18381|      0|                else
18382|      0|                if (type == JS_THROW_ERROR_ITERATOR_THROW)
  ------------------
  |  |18363|      0|#define JS_THROW_ERROR_ITERATOR_THROW 4
  ------------------
  |  Branch (18382:21): [True: 0, False: 0]
  ------------------
18383|      0|                    JS_ThrowTypeError(ctx, "iterator does not have a throw method");
18384|      0|                else
18385|      0|                    JS_ThrowInternalError(ctx, "invalid throw var type %d", type);
18386|      0|            }
18387|      0|            goto exception;
18388|       |
18389|      0|        CASE(OP_eval):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18390|      0|            {
18391|      0|                JSValueConst obj;
  ------------------
  |  |  234|      0|#define JSValueConst JSValue
  ------------------
18392|      0|                int scope_idx;
18393|      0|                call_argc = get_u16(pc);
18394|      0|                scope_idx = get_u16(pc + 2) + ARG_SCOPE_END;
  ------------------
  |  |  636|      0|#define ARG_SCOPE_END (-2)
  ------------------
18395|      0|                pc += 4;
18396|      0|                call_argv = sp - call_argc;
18397|      0|                sf->cur_pc = pc;
18398|      0|                if (js_same_value(ctx, call_argv[-1], ctx->eval_obj)) {
  ------------------
  |  Branch (18398:21): [True: 0, False: 0]
  ------------------
18399|      0|                    if (call_argc >= 1)
  ------------------
  |  Branch (18399:25): [True: 0, False: 0]
  ------------------
18400|      0|                        obj = call_argv[0];
18401|      0|                    else
18402|      0|                        obj = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18403|      0|                    ret_val = JS_EvalObject(ctx, JS_UNDEFINED, obj,
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18404|      0|                                            JS_EVAL_TYPE_DIRECT, scope_idx);
  ------------------
  |  |  334|      0|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
18405|      0|                } else {
18406|      0|                    ret_val = JS_CallInternal(ctx, call_argv[-1], JS_UNDEFINED,
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18407|      0|                                              JS_UNDEFINED, call_argc, call_argv, 0);
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18408|      0|                }
18409|      0|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18410|      0|                    goto exception;
18411|      0|                for(i = -1; i < call_argc; i++)
  ------------------
  |  Branch (18411:29): [True: 0, False: 0]
  ------------------
18412|      0|                    JS_FreeValue(ctx, call_argv[i]);
18413|      0|                sp -= call_argc + 1;
18414|      0|                *sp++ = ret_val;
18415|      0|            }
18416|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18417|       |            /* could merge with OP_apply */
18418|      0|        CASE(OP_apply_eval):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18419|      0|            {
18420|      0|                int scope_idx;
18421|      0|                uint32_t len;
18422|      0|                JSValue *tab;
18423|      0|                JSValueConst obj;
  ------------------
  |  |  234|      0|#define JSValueConst JSValue
  ------------------
18424|       |
18425|      0|                scope_idx = get_u16(pc) + ARG_SCOPE_END;
  ------------------
  |  |  636|      0|#define ARG_SCOPE_END (-2)
  ------------------
18426|      0|                pc += 2;
18427|      0|                sf->cur_pc = pc;
18428|      0|                tab = build_arg_list(ctx, &len, sp[-1]);
18429|      0|                if (!tab)
  ------------------
  |  Branch (18429:21): [True: 0, False: 0]
  ------------------
18430|      0|                    goto exception;
18431|      0|                if (js_same_value(ctx, sp[-2], ctx->eval_obj)) {
  ------------------
  |  Branch (18431:21): [True: 0, False: 0]
  ------------------
18432|      0|                    if (len >= 1)
  ------------------
  |  Branch (18432:25): [True: 0, False: 0]
  ------------------
18433|      0|                        obj = tab[0];
18434|      0|                    else
18435|      0|                        obj = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18436|      0|                    ret_val = JS_EvalObject(ctx, JS_UNDEFINED, obj,
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18437|      0|                                            JS_EVAL_TYPE_DIRECT, scope_idx);
  ------------------
  |  |  334|      0|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
18438|      0|                } else {
18439|      0|                    ret_val = JS_Call(ctx, sp[-2], JS_UNDEFINED, len,
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18440|      0|                                      (JSValueConst *)tab);
18441|      0|                }
18442|      0|                free_arg_list(ctx, tab, len);
18443|      0|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18444|      0|                    goto exception;
18445|      0|                JS_FreeValue(ctx, sp[-2]);
18446|      0|                JS_FreeValue(ctx, sp[-1]);
18447|      0|                sp -= 2;
18448|      0|                *sp++ = ret_val;
18449|      0|            }
18450|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18451|       |
18452|      2|        CASE(OP_regexp):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
18453|      2|            {
18454|      2|                sp[-2] = JS_NewRegexp(ctx, sp[-2], sp[-1]);
18455|      2|                sp--;
18456|      2|                if (JS_IsException(sp[-1]))
  ------------------
  |  Branch (18456:21): [True: 0, False: 2]
  ------------------
18457|      0|                    goto exception;
18458|      2|            }
18459|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18460|       |
18461|      2|        CASE(OP_get_super):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18462|      0|            {
18463|      0|                JSValue proto;
18464|      0|                sf->cur_pc = pc;
18465|      0|                proto = JS_GetPrototype(ctx, sp[-1]);
18466|      0|                if (JS_IsException(proto))
  ------------------
  |  Branch (18466:21): [True: 0, False: 0]
  ------------------
18467|      0|                    goto exception;
18468|      0|                JS_FreeValue(ctx, sp[-1]);
18469|      0|                sp[-1] = proto;
18470|      0|            }
18471|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18472|       |
18473|      0|        CASE(OP_import):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18474|      0|            {
18475|      0|                JSValue val;
18476|      0|                sf->cur_pc = pc;
18477|      0|                val = js_dynamic_import(ctx, sp[-2], sp[-1]);
18478|      0|                if (JS_IsException(val))
  ------------------
  |  Branch (18478:21): [True: 0, False: 0]
  ------------------
18479|      0|                    goto exception;
18480|      0|                JS_FreeValue(ctx, sp[-2]);
18481|      0|                JS_FreeValue(ctx, sp[-1]);
18482|      0|                sp--;
18483|      0|                sp[-1] = val;
18484|      0|            }
18485|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18486|       |
18487|      0|        CASE(OP_get_var_undef):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18488|     47|        CASE(OP_get_var):
  ------------------
  |  |17807|     47|#define CASE(op)        case_ ## op
  ------------------
18489|     47|            {
18490|     47|                int idx;
18491|     47|                JSValue val;
18492|     47|                idx = get_u16(pc);
18493|     47|                pc += 2;
18494|     47|                val = *var_refs[idx]->pvalue;
18495|     47|                if (unlikely(JS_IsUninitialized(val))) {
  ------------------
  |  |   33|     47|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 9, False: 38]
  |  |  ------------------
  ------------------
18496|      9|                    JSClosureVar *cv = &b->closure_var[idx];
18497|      9|                    if (cv->is_lexical) {
  ------------------
  |  Branch (18497:25): [True: 0, False: 9]
  ------------------
18498|      0|                        JS_ThrowReferenceErrorUninitialized(ctx, cv->var_name);
18499|      0|                        goto exception;
18500|      9|                    } else {
18501|      9|                        sf->cur_pc = pc;
18502|      9|                        sp[0] = JS_GetPropertyInternal(ctx, ctx->global_obj,
18503|      9|                                                       cv->var_name,
18504|      9|                                                       ctx->global_obj,
18505|      9|                                                       opcode - OP_get_var_undef);
18506|      9|                        if (JS_IsException(sp[0]))
  ------------------
  |  Branch (18506:29): [True: 9, False: 0]
  ------------------
18507|      9|                            goto exception;
18508|      9|                    }
18509|     38|                } else {
18510|     38|                    sp[0] = JS_DupValue(ctx, val);
18511|     38|                }
18512|     38|                sp++;
18513|     38|            }
18514|     38|            BREAK;
  ------------------
  |  |17810|     38|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|     38|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18515|       |
18516|     38|        CASE(OP_put_var):
  ------------------
  |  |17807|      4|#define CASE(op)        case_ ## op
  ------------------
18517|      4|        CASE(OP_put_var_init):
  ------------------
  |  |17807|      4|#define CASE(op)        case_ ## op
  ------------------
18518|      4|            {
18519|      4|                int idx, ret;
18520|      4|                JSVarRef *var_ref;
18521|      4|                idx = get_u16(pc);
18522|      4|                pc += 2;
18523|      4|                var_ref = var_refs[idx];
18524|      4|                if (unlikely(JS_IsUninitialized(*var_ref->pvalue) ||
  ------------------
  |  |   33|      6|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 2]
  |  |  |  Branch (33:45): [True: 2, False: 2]
  |  |  |  Branch (33:45): [True: 0, False: 2]
  |  |  ------------------
  ------------------
18525|      4|                             var_ref->is_const)) {
18526|      2|                    JSClosureVar *cv = &b->closure_var[idx];
18527|      2|                    if (var_ref->is_lexical) {
  ------------------
  |  Branch (18527:25): [True: 0, False: 2]
  ------------------
18528|      0|                        if (opcode == OP_put_var_init)
  ------------------
  |  Branch (18528:29): [True: 0, False: 0]
  ------------------
18529|      0|                            goto put_var_ok;
18530|      0|                        if (JS_IsUninitialized(*var_ref->pvalue))
  ------------------
  |  Branch (18530:29): [True: 0, False: 0]
  ------------------
18531|      0|                            JS_ThrowReferenceErrorUninitialized(ctx, cv->var_name);
18532|      0|                        else
18533|      0|                            JS_ThrowTypeErrorReadOnly(ctx, JS_PROP_THROW, cv->var_name);
  ------------------
  |  |  320|      0|#define JS_PROP_THROW            (1 << 14)
  ------------------
18534|      0|                        goto exception;
18535|      2|                    } else {
18536|      2|                        sf->cur_pc = pc;
18537|      2|                        ret = JS_HasProperty(ctx, ctx->global_obj, cv->var_name);
18538|      2|                        if (ret < 0)
  ------------------
  |  Branch (18538:29): [True: 0, False: 2]
  ------------------
18539|      0|                            goto exception;
18540|      2|                        if (ret == 0 && is_strict_mode(ctx)) {
  ------------------
  |  Branch (18540:29): [True: 2, False: 0]
  |  Branch (18540:41): [True: 0, False: 2]
  ------------------
18541|      0|                            JS_ThrowReferenceErrorNotDefined(ctx, cv->var_name);
18542|      0|                            goto exception;
18543|      0|                        }
18544|      2|                        ret = JS_SetPropertyInternal(ctx, ctx->global_obj, cv->var_name, sp[-1],
18545|      2|                                                     ctx->global_obj, JS_PROP_THROW_STRICT);
  ------------------
  |  |  323|      2|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
18546|      2|                        sp--;
18547|      2|                        if (ret < 0)
  ------------------
  |  Branch (18547:29): [True: 0, False: 2]
  ------------------
18548|      0|                            goto exception;
18549|      2|                    }
18550|      2|                } else {
18551|      2|                put_var_ok:
18552|      2|                   set_value(ctx, var_ref->pvalue, sp[-1]);
18553|      2|                   sp--;
18554|      2|                }
18555|      4|            }
18556|      4|            BREAK;
  ------------------
  |  |17810|      4|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      4|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18557|      4|        CASE(OP_get_loc):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18558|      0|            {
18559|      0|                int idx;
18560|      0|                idx = get_u16(pc);
18561|      0|                pc += 2;
18562|      0|                sp[0] = JS_DupValue(ctx, var_buf[idx]);
18563|      0|                sp++;
18564|      0|            }
18565|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18566|      0|        CASE(OP_put_loc):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18567|      0|            {
18568|      0|                int idx;
18569|      0|                idx = get_u16(pc);
18570|      0|                pc += 2;
18571|      0|                set_value(ctx, &var_buf[idx], sp[-1]);
18572|      0|                sp--;
18573|      0|            }
18574|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18575|      0|        CASE(OP_set_loc):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18576|      0|            {
18577|      0|                int idx;
18578|      0|                idx = get_u16(pc);
18579|      0|                pc += 2;
18580|      0|                set_value(ctx, &var_buf[idx], JS_DupValue(ctx, sp[-1]));
18581|      0|            }
18582|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18583|      0|        CASE(OP_get_arg):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18584|      0|            {
18585|      0|                int idx;
18586|      0|                idx = get_u16(pc);
18587|      0|                pc += 2;
18588|      0|                sp[0] = JS_DupValue(ctx, arg_buf[idx]);
18589|      0|                sp++;
18590|      0|            }
18591|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18592|      0|        CASE(OP_put_arg):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18593|      0|            {
18594|      0|                int idx;
18595|      0|                idx = get_u16(pc);
18596|      0|                pc += 2;
18597|      0|                set_value(ctx, &arg_buf[idx], sp[-1]);
18598|      0|                sp--;
18599|      0|            }
18600|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18601|      0|        CASE(OP_set_arg):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18602|      0|            {
18603|      0|                int idx;
18604|      0|                idx = get_u16(pc);
18605|      0|                pc += 2;
18606|      0|                set_value(ctx, &arg_buf[idx], JS_DupValue(ctx, sp[-1]));
18607|      0|            }
18608|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18609|       |
18610|      0|#if SHORT_OPCODES
18611|      0|        CASE(OP_get_loc8): *sp++ = JS_DupValue(ctx, var_buf[*pc++]); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc8): *sp++ = JS_DupValue(ctx, var_buf[*pc++]); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18612|      0|        CASE(OP_put_loc8): set_value(ctx, &var_buf[*pc++], *--sp); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc8): set_value(ctx, &var_buf[*pc++], *--sp); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18613|      0|        CASE(OP_set_loc8): set_value(ctx, &var_buf[*pc++], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc8): set_value(ctx, &var_buf[*pc++], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18614|       |
18615|      0|        CASE(OP_get_loc0): *sp++ = JS_DupValue(ctx, var_buf[0]); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc0): *sp++ = JS_DupValue(ctx, var_buf[0]); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18616|      0|        CASE(OP_get_loc1): *sp++ = JS_DupValue(ctx, var_buf[1]); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc1): *sp++ = JS_DupValue(ctx, var_buf[1]); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18617|      0|        CASE(OP_get_loc2): *sp++ = JS_DupValue(ctx, var_buf[2]); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc2): *sp++ = JS_DupValue(ctx, var_buf[2]); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18618|      0|        CASE(OP_get_loc3): *sp++ = JS_DupValue(ctx, var_buf[3]); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc3): *sp++ = JS_DupValue(ctx, var_buf[3]); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18619|      9|        CASE(OP_put_loc0): set_value(ctx, &var_buf[0], *--sp); BREAK;
  ------------------
  |  |17807|      9|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc0): set_value(ctx, &var_buf[0], *--sp); BREAK;
  ------------------
  |  |17810|      9|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      9|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18620|      9|        CASE(OP_put_loc1): set_value(ctx, &var_buf[1], *--sp); BREAK;
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc1): set_value(ctx, &var_buf[1], *--sp); BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18621|      2|        CASE(OP_put_loc2): set_value(ctx, &var_buf[2], *--sp); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc2): set_value(ctx, &var_buf[2], *--sp); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18622|      0|        CASE(OP_put_loc3): set_value(ctx, &var_buf[3], *--sp); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc3): set_value(ctx, &var_buf[3], *--sp); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18623|      2|        CASE(OP_set_loc0): set_value(ctx, &var_buf[0], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc0): set_value(ctx, &var_buf[0], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18624|      2|        CASE(OP_set_loc1): set_value(ctx, &var_buf[1], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc1): set_value(ctx, &var_buf[1], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18625|      3|        CASE(OP_set_loc2): set_value(ctx, &var_buf[2], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17807|      3|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc2): set_value(ctx, &var_buf[2], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17810|      3|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      3|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18626|      3|        CASE(OP_set_loc3): set_value(ctx, &var_buf[3], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc3): set_value(ctx, &var_buf[3], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18627|      2|        CASE(OP_get_arg0): *sp++ = JS_DupValue(ctx, arg_buf[0]); BREAK;
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_arg0): *sp++ = JS_DupValue(ctx, arg_buf[0]); BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18628|      2|        CASE(OP_get_arg1): *sp++ = JS_DupValue(ctx, arg_buf[1]); BREAK;
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_arg1): *sp++ = JS_DupValue(ctx, arg_buf[1]); BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18629|      2|        CASE(OP_get_arg2): *sp++ = JS_DupValue(ctx, arg_buf[2]); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_arg2): *sp++ = JS_DupValue(ctx, arg_buf[2]); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18630|      0|        CASE(OP_get_arg3): *sp++ = JS_DupValue(ctx, arg_buf[3]); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_arg3): *sp++ = JS_DupValue(ctx, arg_buf[3]); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18631|      0|        CASE(OP_put_arg0): set_value(ctx, &arg_buf[0], *--sp); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_arg0): set_value(ctx, &arg_buf[0], *--sp); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18632|      0|        CASE(OP_put_arg1): set_value(ctx, &arg_buf[1], *--sp); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_arg1): set_value(ctx, &arg_buf[1], *--sp); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18633|      0|        CASE(OP_put_arg2): set_value(ctx, &arg_buf[2], *--sp); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_arg2): set_value(ctx, &arg_buf[2], *--sp); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18634|      0|        CASE(OP_put_arg3): set_value(ctx, &arg_buf[3], *--sp); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_arg3): set_value(ctx, &arg_buf[3], *--sp); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18635|      0|        CASE(OP_set_arg0): set_value(ctx, &arg_buf[0], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_arg0): set_value(ctx, &arg_buf[0], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18636|      3|        CASE(OP_set_arg1): set_value(ctx, &arg_buf[1], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17807|      3|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_arg1): set_value(ctx, &arg_buf[1], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17810|      3|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      3|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18637|      3|        CASE(OP_set_arg2): set_value(ctx, &arg_buf[2], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_arg2): set_value(ctx, &arg_buf[2], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18638|      0|        CASE(OP_set_arg3): set_value(ctx, &arg_buf[3], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_arg3): set_value(ctx, &arg_buf[3], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18639|      0|        CASE(OP_get_var_ref0): *sp++ = JS_DupValue(ctx, *var_refs[0]->pvalue); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_var_ref0): *sp++ = JS_DupValue(ctx, *var_refs[0]->pvalue); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18640|      0|        CASE(OP_get_var_ref1): *sp++ = JS_DupValue(ctx, *var_refs[1]->pvalue); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_var_ref1): *sp++ = JS_DupValue(ctx, *var_refs[1]->pvalue); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18641|      0|        CASE(OP_get_var_ref2): *sp++ = JS_DupValue(ctx, *var_refs[2]->pvalue); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_var_ref2): *sp++ = JS_DupValue(ctx, *var_refs[2]->pvalue); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18642|      0|        CASE(OP_get_var_ref3): *sp++ = JS_DupValue(ctx, *var_refs[3]->pvalue); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_var_ref3): *sp++ = JS_DupValue(ctx, *var_refs[3]->pvalue); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18643|      0|        CASE(OP_put_var_ref0): set_value(ctx, var_refs[0]->pvalue, *--sp); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_var_ref0): set_value(ctx, var_refs[0]->pvalue, *--sp); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18644|      0|        CASE(OP_put_var_ref1): set_value(ctx, var_refs[1]->pvalue, *--sp); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_var_ref1): set_value(ctx, var_refs[1]->pvalue, *--sp); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18645|      0|        CASE(OP_put_var_ref2): set_value(ctx, var_refs[2]->pvalue, *--sp); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_var_ref2): set_value(ctx, var_refs[2]->pvalue, *--sp); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18646|      0|        CASE(OP_put_var_ref3): set_value(ctx, var_refs[3]->pvalue, *--sp); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_var_ref3): set_value(ctx, var_refs[3]->pvalue, *--sp); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18647|      0|        CASE(OP_set_var_ref0): set_value(ctx, var_refs[0]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_var_ref0): set_value(ctx, var_refs[0]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18648|      0|        CASE(OP_set_var_ref1): set_value(ctx, var_refs[1]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_var_ref1): set_value(ctx, var_refs[1]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18649|      0|        CASE(OP_set_var_ref2): set_value(ctx, var_refs[2]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_var_ref2): set_value(ctx, var_refs[2]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18650|      0|        CASE(OP_set_var_ref3): set_value(ctx, var_refs[3]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_var_ref3): set_value(ctx, var_refs[3]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18651|      0|#endif
18652|       |
18653|      0|        CASE(OP_get_var_ref):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18654|      0|            {
18655|      0|                int idx;
18656|      0|                JSValue val;
18657|      0|                idx = get_u16(pc);
18658|      0|                pc += 2;
18659|      0|                val = *var_refs[idx]->pvalue;
18660|      0|                sp[0] = JS_DupValue(ctx, val);
18661|      0|                sp++;
18662|      0|            }
18663|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18664|      0|        CASE(OP_put_var_ref):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18665|      0|            {
18666|      0|                int idx;
18667|      0|                idx = get_u16(pc);
18668|      0|                pc += 2;
18669|      0|                set_value(ctx, var_refs[idx]->pvalue, sp[-1]);
18670|      0|                sp--;
18671|      0|            }
18672|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18673|      0|        CASE(OP_set_var_ref):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18674|      0|            {
18675|      0|                int idx;
18676|      0|                idx = get_u16(pc);
18677|      0|                pc += 2;
18678|      0|                set_value(ctx, var_refs[idx]->pvalue, JS_DupValue(ctx, sp[-1]));
18679|      0|            }
18680|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18681|     32|        CASE(OP_get_var_ref_check):
  ------------------
  |  |17807|     32|#define CASE(op)        case_ ## op
  ------------------
18682|     32|            {
18683|     32|                int idx;
18684|     32|                JSValue val;
18685|     32|                idx = get_u16(pc);
18686|     32|                pc += 2;
18687|     32|                val = *var_refs[idx]->pvalue;
18688|     32|                if (unlikely(JS_IsUninitialized(val))) {
  ------------------
  |  |   33|     32|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 32]
  |  |  ------------------
  ------------------
18689|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, TRUE);
18690|      0|                    goto exception;
18691|      0|                }
18692|     32|                sp[0] = JS_DupValue(ctx, val);
18693|     32|                sp++;
18694|     32|            }
18695|     32|            BREAK;
  ------------------
  |  |17810|     32|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|     32|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18696|     32|        CASE(OP_put_var_ref_check):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18697|      0|            {
18698|      0|                int idx;
18699|      0|                idx = get_u16(pc);
18700|      0|                pc += 2;
18701|      0|                if (unlikely(JS_IsUninitialized(*var_refs[idx]->pvalue))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18702|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, TRUE);
18703|      0|                    goto exception;
18704|      0|                }
18705|      0|                set_value(ctx, var_refs[idx]->pvalue, sp[-1]);
18706|      0|                sp--;
18707|      0|            }
18708|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18709|      0|        CASE(OP_put_var_ref_check_init):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18710|      0|            {
18711|      0|                int idx;
18712|      0|                idx = get_u16(pc);
18713|      0|                pc += 2;
18714|      0|                if (unlikely(!JS_IsUninitialized(*var_refs[idx]->pvalue))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18715|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, TRUE);
18716|      0|                    goto exception;
18717|      0|                }
18718|      0|                set_value(ctx, var_refs[idx]->pvalue, sp[-1]);
18719|      0|                sp--;
18720|      0|            }
18721|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18722|      6|        CASE(OP_set_loc_uninitialized):
  ------------------
  |  |17807|      6|#define CASE(op)        case_ ## op
  ------------------
18723|      6|            {
18724|      6|                int idx;
18725|      6|                idx = get_u16(pc);
18726|      6|                pc += 2;
18727|      6|                set_value(ctx, &var_buf[idx], JS_UNINITIALIZED);
  ------------------
  |  |  295|      6|#define JS_UNINITIALIZED JS_MKVAL(JS_TAG_UNINITIALIZED, 0)
  |  |  ------------------
  |  |  |  |  247|      6|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18728|      6|            }
18729|      6|            BREAK;
  ------------------
  |  |17810|      6|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      6|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18730|      6|        CASE(OP_get_loc_check):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
18731|      2|            {
18732|      2|                int idx;
18733|      2|                idx = get_u16(pc);
18734|      2|                pc += 2;
18735|      2|                if (unlikely(JS_IsUninitialized(var_buf[idx]))) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
18736|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, FALSE);
18737|      0|                    goto exception;
18738|      0|                }
18739|      2|                sp[0] = JS_DupValue(ctx, var_buf[idx]);
18740|      2|                sp++;
18741|      2|            }
18742|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18743|      2|        CASE(OP_get_loc_checkthis):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18744|      0|            {
18745|      0|                int idx;
18746|      0|                idx = get_u16(pc);
18747|      0|                pc += 2;
18748|      0|                if (unlikely(JS_IsUninitialized(var_buf[idx]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18749|      0|                    JS_ThrowReferenceErrorUninitialized2(caller_ctx, b, idx, FALSE);
18750|      0|                    goto exception;
18751|      0|                }
18752|      0|                sp[0] = JS_DupValue(ctx, var_buf[idx]);
18753|      0|                sp++;
18754|      0|            }
18755|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18756|      0|        CASE(OP_put_loc_check):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18757|      0|            {
18758|      0|                int idx;
18759|      0|                idx = get_u16(pc);
18760|      0|                pc += 2;
18761|      0|                if (unlikely(JS_IsUninitialized(var_buf[idx]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18762|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, FALSE);
18763|      0|                    goto exception;
18764|      0|                }
18765|      0|                set_value(ctx, &var_buf[idx], sp[-1]);
18766|      0|                sp--;
18767|      0|            }
18768|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18769|      0|        CASE(OP_set_loc_check):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18770|      0|            {
18771|      0|                int idx;
18772|      0|                idx = get_u16(pc);
18773|      0|                pc += 2;
18774|      0|                if (unlikely(JS_IsUninitialized(var_buf[idx]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18775|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, FALSE);
18776|      0|                    goto exception;
18777|      0|                }
18778|      0|                set_value(ctx, &var_buf[idx], JS_DupValue(ctx, sp[-1]));
18779|      0|            }
18780|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18781|      0|        CASE(OP_put_loc_check_init):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18782|      0|            {
18783|      0|                int idx;
18784|      0|                idx = get_u16(pc);
18785|      0|                pc += 2;
18786|      0|                if (unlikely(!JS_IsUninitialized(var_buf[idx]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18787|      0|                    JS_ThrowReferenceError(ctx, "'this' can be initialized only once");
18788|      0|                    goto exception;
18789|      0|                }
18790|      0|                set_value(ctx, &var_buf[idx], sp[-1]);
18791|      0|                sp--;
18792|      0|            }
18793|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18794|      0|        CASE(OP_close_loc):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18795|      0|            {
18796|      0|                int idx;
18797|      0|                idx = get_u16(pc);
18798|      0|                pc += 2;
18799|      0|                close_lexical_var(ctx, b, sf, idx);
18800|      0|            }
18801|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18802|       |
18803|      0|        CASE(OP_make_loc_ref):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18804|      0|        CASE(OP_make_arg_ref):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18805|      0|        CASE(OP_make_var_ref_ref):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18806|      0|            {
18807|      0|                JSVarRef *var_ref;
18808|      0|                JSProperty *pr;
18809|      0|                JSAtom atom;
18810|      0|                int idx;
18811|      0|                atom = get_u32(pc);
18812|      0|                idx = get_u16(pc + 4);
18813|      0|                pc += 6;
18814|      0|                *sp++ = JS_NewObjectProto(ctx, JS_NULL);
  ------------------
  |  |  290|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18815|      0|                if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18816|      0|                    goto exception;
18817|      0|                if (opcode == OP_make_var_ref_ref) {
  ------------------
  |  Branch (18817:21): [True: 0, False: 0]
  ------------------
18818|      0|                    var_ref = var_refs[idx];
18819|      0|                    js_rc(var_ref)->ref_count++;
18820|      0|                } else {
18821|      0|                    var_ref = get_var_ref(ctx, sf, idx, opcode == OP_make_arg_ref);
18822|      0|                    if (!var_ref)
  ------------------
  |  Branch (18822:25): [True: 0, False: 0]
  ------------------
18823|      0|                        goto exception;
18824|      0|                }
18825|      0|                pr = add_property(ctx, JS_VALUE_GET_OBJ(sp[-1]), atom,
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
18826|      0|                                  JS_PROP_WRITABLE | JS_PROP_VARREF);
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                JS_PROP_WRITABLE | JS_PROP_VARREF);
  ------------------
  |  |  306|      0|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
18827|      0|                if (!pr) {
  ------------------
  |  Branch (18827:21): [True: 0, False: 0]
  ------------------
18828|      0|                    free_var_ref(rt, var_ref);
18829|      0|                    goto exception;
18830|      0|                }
18831|      0|                pr->u.var_ref = var_ref;
18832|      0|                *sp++ = JS_AtomToValue(ctx, atom);
18833|      0|            }
18834|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18835|      0|        CASE(OP_make_var_ref):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18836|      0|            {
18837|      0|                JSAtom atom;
18838|      0|                atom = get_u32(pc);
18839|      0|                pc += 4;
18840|      0|                sf->cur_pc = pc;
18841|       |
18842|      0|                if (JS_GetGlobalVarRef(ctx, atom, sp))
  ------------------
  |  Branch (18842:21): [True: 0, False: 0]
  ------------------
18843|      0|                    goto exception;
18844|      0|                sp += 2;
18845|      0|            }
18846|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18847|       |
18848|      0|        CASE(OP_goto):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18849|      0|            pc += (int32_t)get_u32(pc);
18850|      0|            if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18851|      0|                goto exception;
18852|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18853|      0|#if SHORT_OPCODES
18854|      0|        CASE(OP_goto16):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18855|      0|            pc += (int16_t)get_u16(pc);
18856|      0|            if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18857|      0|                goto exception;
18858|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18859|      5|        CASE(OP_goto8):
  ------------------
  |  |17807|      5|#define CASE(op)        case_ ## op
  ------------------
18860|      5|            pc += (int8_t)pc[0];
18861|      5|            if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      5|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 5]
  |  |  ------------------
  ------------------
18862|      0|                goto exception;
18863|      5|            BREAK;
  ------------------
  |  |17810|      5|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      5|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18864|      5|#endif
18865|      5|        CASE(OP_if_true):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18866|      0|            {
18867|      0|                int res;
18868|      0|                JSValue op1;
18869|       |
18870|      0|                op1 = sp[-1];
18871|      0|                pc += 4;
18872|      0|                if ((uint32_t)JS_VALUE_GET_TAG(op1) <= JS_TAG_UNDEFINED) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (18872:21): [True: 0, False: 0]
  ------------------
18873|      0|                    res = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
18874|      0|                } else {
18875|      0|                    res = JS_ToBoolFree(ctx, op1);
18876|      0|                }
18877|      0|                sp--;
18878|      0|                if (res) {
  ------------------
  |  Branch (18878:21): [True: 0, False: 0]
  ------------------
18879|      0|                    pc += (int32_t)get_u32(pc - 4) - 4;
18880|      0|                }
18881|      0|                if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18882|      0|                    goto exception;
18883|      0|            }
18884|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18885|      0|        CASE(OP_if_false):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18886|      0|            {
18887|      0|                int res;
18888|      0|                JSValue op1;
18889|       |
18890|      0|                op1 = sp[-1];
18891|      0|                pc += 4;
18892|       |                /* quick and dirty test for JS_TAG_INT, JS_TAG_BOOL, JS_TAG_NULL and JS_TAG_UNDEFINED */
18893|      0|                if ((uint32_t)JS_VALUE_GET_TAG(op1) <= JS_TAG_UNDEFINED) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (18893:21): [True: 0, False: 0]
  ------------------
18894|      0|                    res = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
18895|      0|                } else {
18896|      0|                    res = JS_ToBoolFree(ctx, op1);
18897|      0|                }
18898|      0|                sp--;
18899|      0|                if (!res) {
  ------------------
  |  Branch (18899:21): [True: 0, False: 0]
  ------------------
18900|      0|                    pc += (int32_t)get_u32(pc - 4) - 4;
18901|      0|                }
18902|      0|                if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18903|      0|                    goto exception;
18904|      0|            }
18905|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18906|      0|#if SHORT_OPCODES
18907|      2|        CASE(OP_if_true8):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
18908|      2|            {
18909|      2|                int res;
18910|      2|                JSValue op1;
18911|       |
18912|      2|                op1 = sp[-1];
18913|      2|                pc += 1;
18914|      2|                if ((uint32_t)JS_VALUE_GET_TAG(op1) <= JS_TAG_UNDEFINED) {
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (18914:21): [True: 2, False: 0]
  ------------------
18915|      2|                    res = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      2|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
18916|      2|                } else {
18917|      0|                    res = JS_ToBoolFree(ctx, op1);
18918|      0|                }
18919|      2|                sp--;
18920|      2|                if (res) {
  ------------------
  |  Branch (18920:21): [True: 0, False: 2]
  ------------------
18921|      0|                    pc += (int8_t)pc[-1] - 1;
18922|      0|                }
18923|      2|                if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
18924|      0|                    goto exception;
18925|      2|            }
18926|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18927|     36|        CASE(OP_if_false8):
  ------------------
  |  |17807|     36|#define CASE(op)        case_ ## op
  ------------------
18928|     36|            {
18929|     36|                int res;
18930|     36|                JSValue op1;
18931|       |
18932|     36|                op1 = sp[-1];
18933|     36|                pc += 1;
18934|     36|                if ((uint32_t)JS_VALUE_GET_TAG(op1) <= JS_TAG_UNDEFINED) {
  ------------------
  |  |  236|     36|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (18934:21): [True: 36, False: 0]
  ------------------
18935|     36|                    res = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|     36|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
18936|     36|                } else {
18937|      0|                    res = JS_ToBoolFree(ctx, op1);
18938|      0|                }
18939|     36|                sp--;
18940|     36|                if (!res) {
  ------------------
  |  Branch (18940:21): [True: 18, False: 18]
  ------------------
18941|     18|                    pc += (int8_t)pc[-1] - 1;
18942|     18|                }
18943|     36|                if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|     36|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 36]
  |  |  ------------------
  ------------------
18944|      0|                    goto exception;
18945|     36|            }
18946|     36|            BREAK;
  ------------------
  |  |17810|     36|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|     36|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18947|     36|#endif
18948|     36|        CASE(OP_catch):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18949|      0|            {
18950|      0|                int32_t diff;
18951|      0|                diff = get_u32(pc);
18952|      0|                sp[0] = JS_NewCatchOffset(ctx, pc + diff - b->byte_code_buf);
18953|      0|                sp++;
18954|      0|                pc += 4;
18955|      0|            }
18956|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18957|      0|        CASE(OP_gosub):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18958|      0|            {
18959|      0|                int32_t diff;
18960|      0|                diff = get_u32(pc);
18961|       |                /* XXX: should have a different tag to avoid security flaw */
18962|      0|                sp[0] = JS_NewInt32(ctx, pc + 4 - b->byte_code_buf);
18963|      0|                sp++;
18964|      0|                pc += diff;
18965|      0|            }
18966|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18967|      0|        CASE(OP_ret):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
18968|      0|            {
18969|      0|                JSValue op1;
18970|      0|                uint32_t pos;
18971|      0|                op1 = sp[-1];
18972|      0|                if (unlikely(JS_VALUE_GET_TAG(op1) != JS_TAG_INT))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18973|      0|                    goto ret_fail;
18974|      0|                pos = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
18975|      0|                if (unlikely(pos >= b->byte_code_len)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18976|      0|                ret_fail:
18977|      0|                    JS_ThrowInternalError(ctx, "invalid ret value");
18978|      0|                    goto exception;
18979|      0|                }
18980|      0|                sp--;
18981|      0|                pc = b->byte_code_buf + pos;
18982|      0|            }
18983|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18984|       |
18985|      2|        CASE(OP_for_in_start):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
18986|      2|            sf->cur_pc = pc;
18987|      2|            if (js_for_in_start(ctx, sp))
  ------------------
  |  Branch (18987:17): [True: 0, False: 2]
  ------------------
18988|      0|                goto exception;
18989|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18990|      2|        CASE(OP_for_in_next):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
18991|      2|            sf->cur_pc = pc;
18992|      2|            if (js_for_in_next(ctx, sp))
  ------------------
  |  Branch (18992:17): [True: 0, False: 2]
  ------------------
18993|      0|                goto exception;
18994|      2|            sp += 2;
18995|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18996|      2|        CASE(OP_for_of_start):
  ------------------
  |  |17807|      1|#define CASE(op)        case_ ## op
  ------------------
18997|      1|            sf->cur_pc = pc;
18998|      1|            if (js_for_of_start(ctx, sp, FALSE))
  ------------------
  |  Branch (18998:17): [True: 0, False: 1]
  ------------------
18999|      0|                goto exception;
19000|      1|            sp += 1;
19001|      1|            *sp++ = JS_NewCatchOffset(ctx, 0);
19002|      1|            BREAK;
  ------------------
  |  |17810|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19003|      2|        CASE(OP_for_of_next):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
19004|      2|            {
19005|      2|                int offset = -3 - pc[0];
19006|      2|                pc += 1;
19007|      2|                sf->cur_pc = pc;
19008|      2|                if (js_for_of_next(ctx, sp, offset))
  ------------------
  |  Branch (19008:21): [True: 0, False: 2]
  ------------------
19009|      0|                    goto exception;
19010|      2|                sp += 2;
19011|      2|            }
19012|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19013|      2|        CASE(OP_for_await_of_next):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19014|      0|            sf->cur_pc = pc;
19015|      0|            if (js_for_await_of_next(ctx, sp))
  ------------------
  |  Branch (19015:17): [True: 0, False: 0]
  ------------------
19016|      0|                goto exception;
19017|      0|            sp++;
19018|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19019|      0|        CASE(OP_for_await_of_start):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19020|      0|            sf->cur_pc = pc;
19021|      0|            if (js_for_of_start(ctx, sp, TRUE))
  ------------------
  |  Branch (19021:17): [True: 0, False: 0]
  ------------------
19022|      0|                goto exception;
19023|      0|            sp += 1;
19024|      0|            *sp++ = JS_NewCatchOffset(ctx, 0);
19025|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19026|      0|        CASE(OP_iterator_get_value_done):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19027|      0|            sf->cur_pc = pc;
19028|      0|            if (js_iterator_get_value_done(ctx, sp))
  ------------------
  |  Branch (19028:17): [True: 0, False: 0]
  ------------------
19029|      0|                goto exception;
19030|      0|            sp += 1;
19031|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19032|      0|        CASE(OP_iterator_check_object):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19033|      0|            if (unlikely(!JS_IsObject(sp[-1]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19034|      0|                JS_ThrowTypeError(ctx, "iterator must return an object");
19035|      0|                goto exception;
19036|      0|            }
19037|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19038|       |
19039|      0|        CASE(OP_iterator_close):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19040|       |            /* iter_obj next catch_offset -> */
19041|      0|            sp--; /* drop the catch offset to avoid getting caught by exception */
19042|      0|            JS_FreeValue(ctx, sp[-1]); /* drop the next method */
19043|      0|            sp--;
19044|      0|            if (!JS_IsUndefined(sp[-1])) {
  ------------------
  |  Branch (19044:17): [True: 0, False: 0]
  ------------------
19045|      0|                sf->cur_pc = pc;
19046|      0|                if (JS_IteratorClose(ctx, sp[-1], FALSE))
  ------------------
  |  Branch (19046:21): [True: 0, False: 0]
  ------------------
19047|      0|                    goto exception;
19048|      0|                JS_FreeValue(ctx, sp[-1]);
19049|      0|            }
19050|      0|            sp--;
19051|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19052|      0|        CASE(OP_nip_catch):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19053|      0|            {
19054|      0|                JSValue ret_val;
19055|       |                /* catch_offset ... ret_val -> ret_eval */
19056|      0|                ret_val = *--sp;
19057|      0|                while (sp > stack_buf &&
  ------------------
  |  Branch (19057:24): [True: 0, False: 0]
  ------------------
19058|      0|                       JS_VALUE_GET_TAG(sp[-1]) != JS_TAG_CATCH_OFFSET) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19058:24): [True: 0, False: 0]
  ------------------
19059|      0|                    JS_FreeValue(ctx, *--sp);
19060|      0|                }
19061|      0|                if (unlikely(sp == stack_buf)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19062|      0|                    JS_ThrowInternalError(ctx, "nip_catch");
19063|      0|                    JS_FreeValue(ctx, ret_val);
19064|      0|                    goto exception;
19065|      0|                }
19066|      0|                sp[-1] = ret_val;
19067|      0|            }
19068|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19069|       |
19070|      0|        CASE(OP_iterator_next):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19071|       |            /* stack: iter_obj next catch_offset val */
19072|      0|            {
19073|      0|                JSValue ret;
19074|      0|                sf->cur_pc = pc;
19075|      0|                ret = JS_Call(ctx, sp[-3], sp[-4],
19076|      0|                              1, (JSValueConst *)(sp - 1));
19077|      0|                if (JS_IsException(ret))
  ------------------
  |  Branch (19077:21): [True: 0, False: 0]
  ------------------
19078|      0|                    goto exception;
19079|      0|                JS_FreeValue(ctx, sp[-1]);
19080|      0|                sp[-1] = ret;
19081|      0|            }
19082|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19083|       |
19084|      0|        CASE(OP_iterator_call):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19085|       |            /* stack: iter_obj next catch_offset val */
19086|      0|            {
19087|      0|                JSValue method, ret;
19088|      0|                BOOL ret_flag;
19089|      0|                int flags;
19090|      0|                flags = *pc++;
19091|      0|                sf->cur_pc = pc;
19092|      0|                method = JS_GetProperty(ctx, sp[-4], (flags & 1) ?
  ------------------
  |  Branch (19092:54): [True: 0, False: 0]
  ------------------
19093|      0|                                        JS_ATOM_throw : JS_ATOM_return);
19094|      0|                if (JS_IsException(method))
  ------------------
  |  Branch (19094:21): [True: 0, False: 0]
  ------------------
19095|      0|                    goto exception;
19096|      0|                if (JS_IsUndefined(method) || JS_IsNull(method)) {
  ------------------
  |  Branch (19096:21): [True: 0, False: 0]
  |  Branch (19096:47): [True: 0, False: 0]
  ------------------
19097|      0|                    ret_flag = TRUE;
19098|      0|                } else {
19099|      0|                    if (flags & 2) {
  ------------------
  |  Branch (19099:25): [True: 0, False: 0]
  ------------------
19100|       |                        /* no argument */
19101|      0|                        ret = JS_CallFree(ctx, method, sp[-4],
19102|      0|                                          0, NULL);
19103|      0|                    } else {
19104|      0|                        ret = JS_CallFree(ctx, method, sp[-4],
19105|      0|                                          1, (JSValueConst *)(sp - 1));
19106|      0|                    }
19107|      0|                    if (JS_IsException(ret))
  ------------------
  |  Branch (19107:25): [True: 0, False: 0]
  ------------------
19108|      0|                        goto exception;
19109|      0|                    JS_FreeValue(ctx, sp[-1]);
19110|      0|                    sp[-1] = ret;
19111|      0|                    ret_flag = FALSE;
19112|      0|                }
19113|      0|                sp[0] = JS_NewBool(ctx, ret_flag);
19114|      0|                sp += 1;
19115|      0|            }
19116|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19117|       |
19118|      2|        CASE(OP_lnot):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
19119|      2|            {
19120|      2|                int res;
19121|      2|                JSValue op1;
19122|       |
19123|      2|                op1 = sp[-1];
19124|      2|                if ((uint32_t)JS_VALUE_GET_TAG(op1) <= JS_TAG_UNDEFINED) {
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19124:21): [True: 0, False: 2]
  ------------------
19125|      0|                    res = JS_VALUE_GET_INT(op1) != 0;
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19126|      2|                } else {
19127|      2|                    res = JS_ToBoolFree(ctx, op1);
19128|      2|                }
19129|      2|                sp[-1] = JS_NewBool(ctx, !res);
19130|      2|            }
19131|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19132|       |
19133|      2|#define GET_FIELD_INLINE(name, keep, is_length)                         \
19134|      2|            {                                                           \
19135|      2|                JSValue val, obj;                                       \
19136|      2|                JSAtom atom;                                            \
19137|      2|                JSObject *p;                                            \
19138|      2|                JSProperty *pr;                                         \
19139|      2|                JSShapeProperty *prs;                                   \
19140|      2|                                                                        \
19141|      2|                if (is_length) {                                        \
19142|      2|                    atom = JS_ATOM_length;                              \
19143|      2|                } else {                                                \
19144|      2|                    atom = get_u32(pc);                                 \
19145|      2|                    pc += 4;                                            \
19146|      2|                }                                                       \
19147|      2|                                                                        \
19148|      2|                obj = sp[-1];                                           \
19149|      2|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT)) {   \
19150|      2|                    p = JS_VALUE_GET_OBJ(obj);                          \
19151|      2|                    for(;;) {                                           \
19152|      2|                        prs = find_own_property(&pr, p, atom);          \
19153|      2|                        if (prs) {                                      \
19154|       |                            /* found */                                 \
19155|      2|                            if (unlikely(prs->flags & JS_PROP_TMASK))   \
19156|      2|                                    goto name ## _slow_path;            \
19157|      2|                            val = JS_DupValue(ctx, pr->u.value);        \
19158|      2|                            break;                                      \
19159|      2|                        }                                               \
19160|      2|                        if (unlikely(p->is_exotic)) {                   \
19161|       |                            /* XXX: should avoid the slow path for arrays \
19162|       |                               and typed arrays by ensuring that 'prop' is \
19163|       |                               not numeric */                           \
19164|      2|                            obj = JS_MKPTR(JS_TAG_OBJECT, p);           \
19165|      2|                            goto name ## _slow_path;                    \
19166|      2|                        }                                               \
19167|      2|                        p = p->shape->proto;                            \
19168|      2|                        if (!p) {                                       \
19169|      2|                            val = JS_UNDEFINED;                         \
19170|      2|                            break;                                      \
19171|      2|                        }                                               \
19172|      2|                    }                                                   \
19173|      2|                } else {                                                \
19174|      2|                name ## _slow_path:                                     \
19175|      2|                    sf->cur_pc = pc;                                    \
19176|      2|                    val = JS_GetPropertyInternal(ctx, obj, atom, sp[-1], 0); \
19177|      2|                    if (unlikely(JS_IsException(val)))                  \
19178|      2|                        goto exception;                                 \
19179|      2|                }                                                       \
19180|      2|                if (keep) {                                             \
19181|      2|                    *sp++ = val;                                        \
19182|      2|                } else {                                                \
19183|      2|                    JS_FreeValue(ctx, sp[-1]);                          \
19184|      2|                    sp[-1] = val;                                       \
19185|      2|                }                                                       \
19186|      2|            }
19187|       |
19188|       |            
19189|      2|        CASE(OP_get_field):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
19190|      2|            GET_FIELD_INLINE(get_field, 0, 0);
  ------------------
  |  |19134|      2|            {                                                           \
  |  |19135|      2|                JSValue val, obj;                                       \
  |  |19136|      2|                JSAtom atom;                                            \
  |  |19137|      2|                JSObject *p;                                            \
  |  |19138|      2|                JSProperty *pr;                                         \
  |  |19139|      2|                JSShapeProperty *prs;                                   \
  |  |19140|      2|                                                                        \
  |  |19141|      2|                if (is_length) {                                        \
  |  |  ------------------
  |  |  |  Branch (19141:21): [Folded, False: 2]
  |  |  ------------------
  |  |19142|      0|                    atom = JS_ATOM_length;                              \
  |  |19143|      2|                } else {                                                \
  |  |19144|      2|                    atom = get_u32(pc);                                 \
  |  |19145|      2|                    pc += 4;                                            \
  |  |19146|      2|                }                                                       \
  |  |19147|      2|                                                                        \
  |  |19148|      2|                obj = sp[-1];                                           \
  |  |19149|      2|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT)) {   \
  |  |  ------------------
  |  |  |  |   32|      2|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19150|      2|                    p = JS_VALUE_GET_OBJ(obj);                          \
  |  |  ------------------
  |  |  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  |  |  ------------------
  |  |  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19151|      2|                    for(;;) {                                           \
  |  |19152|      2|                        prs = find_own_property(&pr, p, atom);          \
  |  |19153|      2|                        if (prs) {                                      \
  |  |  ------------------
  |  |  |  Branch (19153:29): [True: 0, False: 2]
  |  |  ------------------
  |  |19154|      0|                            /* found */                                 \
  |  |19155|      0|                            if (unlikely(prs->flags & JS_PROP_TMASK))   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19156|      0|                                    goto name ## _slow_path;            \
  |  |19157|      0|                            val = JS_DupValue(ctx, pr->u.value);        \
  |  |19158|      0|                            break;                                      \
  |  |19159|      0|                        }                                               \
  |  |19160|      2|                        if (unlikely(p->is_exotic)) {                   \
  |  |  ------------------
  |  |  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19161|      2|                            /* XXX: should avoid the slow path for arrays \
  |  |19162|      2|                               and typed arrays by ensuring that 'prop' is \
  |  |19163|      2|                               not numeric */                           \
  |  |19164|      2|                            obj = JS_MKPTR(JS_TAG_OBJECT, p);           \
  |  |  ------------------
  |  |  |  |  248|      2|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  |  |  ------------------
  |  |19165|      2|                            goto name ## _slow_path;                    \
  |  |19166|      2|                        }                                               \
  |  |19167|      2|                        p = p->shape->proto;                            \
  |  |19168|      0|                        if (!p) {                                       \
  |  |  ------------------
  |  |  |  Branch (19168:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19169|      0|                            val = JS_UNDEFINED;                         \
  |  |  ------------------
  |  |  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19170|      0|                            break;                                      \
  |  |19171|      0|                        }                                               \
  |  |19172|      0|                    }                                                   \
  |  |19173|      2|                } else {                                                \
  |  |19174|      2|                name ## _slow_path:                                     \
  |  |19175|      2|                    sf->cur_pc = pc;                                    \
  |  |19176|      2|                    val = JS_GetPropertyInternal(ctx, obj, atom, sp[-1], 0); \
  |  |19177|      2|                    if (unlikely(JS_IsException(val)))                  \
  |  |  ------------------
  |  |  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19178|      2|                        goto exception;                                 \
  |  |19179|      2|                }                                                       \
  |  |19180|      2|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19180:21): [Folded, False: 2]
  |  |  ------------------
  |  |19181|      0|                    *sp++ = val;                                        \
  |  |19182|      2|                } else {                                                \
  |  |19183|      2|                    JS_FreeValue(ctx, sp[-1]);                          \
  |  |19184|      2|                    sp[-1] = val;                                       \
  |  |19185|      2|                }                                                       \
  |  |19186|      2|            }
  ------------------
19191|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19192|       |
19193|      4|        CASE(OP_get_field2):
  ------------------
  |  |17807|      4|#define CASE(op)        case_ ## op
  ------------------
19194|      4|            GET_FIELD_INLINE(get_field2, 1, 0);
  ------------------
  |  |19134|      4|            {                                                           \
  |  |19135|      4|                JSValue val, obj;                                       \
  |  |19136|      4|                JSAtom atom;                                            \
  |  |19137|      4|                JSObject *p;                                            \
  |  |19138|      4|                JSProperty *pr;                                         \
  |  |19139|      4|                JSShapeProperty *prs;                                   \
  |  |19140|      4|                                                                        \
  |  |19141|      4|                if (is_length) {                                        \
  |  |  ------------------
  |  |  |  Branch (19141:21): [Folded, False: 4]
  |  |  ------------------
  |  |19142|      0|                    atom = JS_ATOM_length;                              \
  |  |19143|      4|                } else {                                                \
  |  |19144|      4|                    atom = get_u32(pc);                                 \
  |  |19145|      4|                    pc += 4;                                            \
  |  |19146|      4|                }                                                       \
  |  |19147|      4|                                                                        \
  |  |19148|      4|                obj = sp[-1];                                           \
  |  |19149|      4|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT)) {   \
  |  |  ------------------
  |  |  |  |   32|      4|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19150|      0|                    p = JS_VALUE_GET_OBJ(obj);                          \
  |  |  ------------------
  |  |  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  |  |  ------------------
  |  |  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19151|      0|                    for(;;) {                                           \
  |  |19152|      0|                        prs = find_own_property(&pr, p, atom);          \
  |  |19153|      0|                        if (prs) {                                      \
  |  |  ------------------
  |  |  |  Branch (19153:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19154|      0|                            /* found */                                 \
  |  |19155|      0|                            if (unlikely(prs->flags & JS_PROP_TMASK))   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19156|      0|                                    goto name ## _slow_path;            \
  |  |19157|      0|                            val = JS_DupValue(ctx, pr->u.value);        \
  |  |19158|      0|                            break;                                      \
  |  |19159|      0|                        }                                               \
  |  |19160|      0|                        if (unlikely(p->is_exotic)) {                   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19161|      0|                            /* XXX: should avoid the slow path for arrays \
  |  |19162|      0|                               and typed arrays by ensuring that 'prop' is \
  |  |19163|      0|                               not numeric */                           \
  |  |19164|      0|                            obj = JS_MKPTR(JS_TAG_OBJECT, p);           \
  |  |  ------------------
  |  |  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  |  |  ------------------
  |  |19165|      0|                            goto name ## _slow_path;                    \
  |  |19166|      0|                        }                                               \
  |  |19167|      0|                        p = p->shape->proto;                            \
  |  |19168|      0|                        if (!p) {                                       \
  |  |  ------------------
  |  |  |  Branch (19168:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19169|      0|                            val = JS_UNDEFINED;                         \
  |  |  ------------------
  |  |  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19170|      0|                            break;                                      \
  |  |19171|      0|                        }                                               \
  |  |19172|      0|                    }                                                   \
  |  |19173|      4|                } else {                                                \
  |  |19174|      4|                name ## _slow_path:                                     \
  |  |19175|      4|                    sf->cur_pc = pc;                                    \
  |  |19176|      4|                    val = JS_GetPropertyInternal(ctx, obj, atom, sp[-1], 0); \
  |  |19177|      4|                    if (unlikely(JS_IsException(val)))                  \
  |  |  ------------------
  |  |  |  |   33|      4|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19178|      4|                        goto exception;                                 \
  |  |19179|      4|                }                                                       \
  |  |19180|      4|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19180:21): [True: 4, Folded]
  |  |  ------------------
  |  |19181|      4|                    *sp++ = val;                                        \
  |  |19182|      4|                } else {                                                \
  |  |19183|      0|                    JS_FreeValue(ctx, sp[-1]);                          \
  |  |19184|      0|                    sp[-1] = val;                                       \
  |  |19185|      0|                }                                                       \
  |  |19186|      4|            }
  ------------------
19195|      4|            BREAK;
  ------------------
  |  |17810|      4|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      4|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19196|       |
19197|      4|#if SHORT_OPCODES
19198|      4|        CASE(OP_get_length):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19199|      0|            GET_FIELD_INLINE(get_length, 0, 1);
  ------------------
  |  |19134|      0|            {                                                           \
  |  |19135|      0|                JSValue val, obj;                                       \
  |  |19136|      0|                JSAtom atom;                                            \
  |  |19137|      0|                JSObject *p;                                            \
  |  |19138|      0|                JSProperty *pr;                                         \
  |  |19139|      0|                JSShapeProperty *prs;                                   \
  |  |19140|      0|                                                                        \
  |  |19141|      0|                if (is_length) {                                        \
  |  |  ------------------
  |  |  |  Branch (19141:21): [True: 0, Folded]
  |  |  ------------------
  |  |19142|      0|                    atom = JS_ATOM_length;                              \
  |  |19143|      0|                } else {                                                \
  |  |19144|      0|                    atom = get_u32(pc);                                 \
  |  |19145|      0|                    pc += 4;                                            \
  |  |19146|      0|                }                                                       \
  |  |19147|      0|                                                                        \
  |  |19148|      0|                obj = sp[-1];                                           \
  |  |19149|      0|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT)) {   \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19150|      0|                    p = JS_VALUE_GET_OBJ(obj);                          \
  |  |  ------------------
  |  |  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  |  |  ------------------
  |  |  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19151|      0|                    for(;;) {                                           \
  |  |19152|      0|                        prs = find_own_property(&pr, p, atom);          \
  |  |19153|      0|                        if (prs) {                                      \
  |  |  ------------------
  |  |  |  Branch (19153:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19154|      0|                            /* found */                                 \
  |  |19155|      0|                            if (unlikely(prs->flags & JS_PROP_TMASK))   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19156|      0|                                    goto name ## _slow_path;            \
  |  |19157|      0|                            val = JS_DupValue(ctx, pr->u.value);        \
  |  |19158|      0|                            break;                                      \
  |  |19159|      0|                        }                                               \
  |  |19160|      0|                        if (unlikely(p->is_exotic)) {                   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19161|      0|                            /* XXX: should avoid the slow path for arrays \
  |  |19162|      0|                               and typed arrays by ensuring that 'prop' is \
  |  |19163|      0|                               not numeric */                           \
  |  |19164|      0|                            obj = JS_MKPTR(JS_TAG_OBJECT, p);           \
  |  |  ------------------
  |  |  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  |  |  ------------------
  |  |19165|      0|                            goto name ## _slow_path;                    \
  |  |19166|      0|                        }                                               \
  |  |19167|      0|                        p = p->shape->proto;                            \
  |  |19168|      0|                        if (!p) {                                       \
  |  |  ------------------
  |  |  |  Branch (19168:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19169|      0|                            val = JS_UNDEFINED;                         \
  |  |  ------------------
  |  |  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19170|      0|                            break;                                      \
  |  |19171|      0|                        }                                               \
  |  |19172|      0|                    }                                                   \
  |  |19173|      0|                } else {                                                \
  |  |19174|      0|                name ## _slow_path:                                     \
  |  |19175|      0|                    sf->cur_pc = pc;                                    \
  |  |19176|      0|                    val = JS_GetPropertyInternal(ctx, obj, atom, sp[-1], 0); \
  |  |19177|      0|                    if (unlikely(JS_IsException(val)))                  \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19178|      0|                        goto exception;                                 \
  |  |19179|      0|                }                                                       \
  |  |19180|      0|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19180:21): [Folded, False: 0]
  |  |  ------------------
  |  |19181|      0|                    *sp++ = val;                                        \
  |  |19182|      0|                } else {                                                \
  |  |19183|      0|                    JS_FreeValue(ctx, sp[-1]);                          \
  |  |19184|      0|                    sp[-1] = val;                                       \
  |  |19185|      0|                }                                                       \
  |  |19186|      0|            }
  ------------------
19200|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19201|      0|#endif
19202|       |            
19203|     32|        CASE(OP_put_field):
  ------------------
  |  |17807|     32|#define CASE(op)        case_ ## op
  ------------------
19204|     32|            {
19205|     32|                int ret;
19206|     32|                JSValue obj;
19207|     32|                JSAtom atom;
19208|     32|                JSObject *p;
19209|     32|                JSProperty *pr;
19210|     32|                JSShapeProperty *prs;
19211|       |
19212|     32|                atom = get_u32(pc);
19213|     32|                pc += 4;
19214|       |
19215|     32|                obj = sp[-2];
19216|     32|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT)) {
  ------------------
  |  |   32|     32|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 32, False: 0]
  |  |  ------------------
  ------------------
19217|     32|                    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|     32|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     32|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
19218|     32|                    prs = find_own_property(&pr, p, atom);
19219|     32|                    if (!prs)
  ------------------
  |  Branch (19219:25): [True: 32, False: 0]
  ------------------
19220|     32|                        goto put_field_slow_path;
19221|      0|                    if (likely((prs->flags & (JS_PROP_TMASK | JS_PROP_WRITABLE |
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19222|      0|                                              JS_PROP_LENGTH)) == JS_PROP_WRITABLE)) {
19223|       |                        /* fast path */
19224|      0|                        set_value(ctx, &pr->u.value, sp[-1]);
19225|      0|                    } else {
19226|      0|                        goto put_field_slow_path;
19227|      0|                    }
19228|      0|                    JS_FreeValue(ctx, obj);
19229|      0|                    sp -= 2;
19230|      0|                } else {
19231|     32|                put_field_slow_path:
19232|     32|                    sf->cur_pc = pc;
19233|     32|                    ret = JS_SetPropertyInternal(ctx, obj, atom, sp[-1], obj,
19234|     32|                                                 JS_PROP_THROW_STRICT);
  ------------------
  |  |  323|     32|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
19235|     32|                    JS_FreeValue(ctx, obj);
19236|     32|                    sp -= 2;
19237|     32|                    if (unlikely(ret < 0))
  ------------------
  |  |   33|     32|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 32]
  |  |  ------------------
  ------------------
19238|      0|                        goto exception;
19239|     32|                }
19240|       |                
19241|     32|            }
19242|     32|            BREAK;
  ------------------
  |  |17810|     32|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|     32|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19243|       |
19244|     32|        CASE(OP_private_symbol):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19245|      0|            {
19246|      0|                JSAtom atom;
19247|      0|                JSValue val;
19248|       |
19249|      0|                atom = get_u32(pc);
19250|      0|                pc += 4;
19251|      0|                val = JS_NewSymbolFromAtom(ctx, atom, JS_ATOM_TYPE_PRIVATE);
19252|      0|                if (JS_IsException(val))
  ------------------
  |  Branch (19252:21): [True: 0, False: 0]
  ------------------
19253|      0|                    goto exception;
19254|      0|                *sp++ = val;
19255|      0|            }
19256|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19257|       |
19258|      0|        CASE(OP_get_private_field):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19259|      0|            {
19260|      0|                JSValue val;
19261|       |
19262|      0|                val = JS_GetPrivateField(ctx, sp[-2], sp[-1]);
19263|      0|                JS_FreeValue(ctx, sp[-1]);
19264|      0|                JS_FreeValue(ctx, sp[-2]);
19265|      0|                sp[-2] = val;
19266|      0|                sp--;
19267|      0|                if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19268|      0|                    goto exception;
19269|      0|            }
19270|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19271|       |
19272|      0|        CASE(OP_put_private_field):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19273|      0|            {
19274|      0|                int ret;
19275|      0|                ret = JS_SetPrivateField(ctx, sp[-3], sp[-1], sp[-2]);
19276|      0|                JS_FreeValue(ctx, sp[-3]);
19277|      0|                JS_FreeValue(ctx, sp[-1]);
19278|      0|                sp -= 3;
19279|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19280|      0|                    goto exception;
19281|      0|            }
19282|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19283|       |
19284|      0|        CASE(OP_define_private_field):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19285|      0|            {
19286|      0|                int ret;
19287|      0|                ret = JS_DefinePrivateField(ctx, sp[-3], sp[-2], sp[-1]);
19288|      0|                JS_FreeValue(ctx, sp[-2]);
19289|      0|                sp -= 2;
19290|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19291|      0|                    goto exception;
19292|      0|            }
19293|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19294|       |
19295|      0|        CASE(OP_define_field):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19296|      0|            {
19297|      0|                int ret;
19298|      0|                JSAtom atom;
19299|      0|                atom = get_u32(pc);
19300|      0|                pc += 4;
19301|       |
19302|      0|                ret = JS_DefinePropertyValue(ctx, sp[-2], atom, sp[-1],
19303|      0|                                             JS_PROP_C_W_E | JS_PROP_THROW);
  ------------------
  |  |  301|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                                                           JS_PROP_C_W_E | JS_PROP_THROW);
  ------------------
  |  |  320|      0|#define JS_PROP_THROW            (1 << 14)
  ------------------
19304|      0|                sp--;
19305|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19306|      0|                    goto exception;
19307|      0|            }
19308|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19309|       |
19310|      2|        CASE(OP_set_name):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
19311|      2|            {
19312|      2|                int ret;
19313|      2|                JSAtom atom;
19314|      2|                atom = get_u32(pc);
19315|      2|                pc += 4;
19316|       |
19317|      2|                ret = JS_DefineObjectName(ctx, sp[-1], atom, JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|      2|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
19318|      2|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
19319|      0|                    goto exception;
19320|      2|            }
19321|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19322|      2|        CASE(OP_set_name_computed):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19323|      0|            {
19324|      0|                int ret;
19325|      0|                ret = JS_DefineObjectNameComputed(ctx, sp[-1], sp[-2], JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
19326|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19327|      0|                    goto exception;
19328|      0|            }
19329|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19330|      0|        CASE(OP_set_proto):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19331|      0|            {
19332|      0|                JSValue proto;
19333|      0|                sf->cur_pc = pc;
19334|      0|                proto = sp[-1];
19335|      0|                if (JS_IsObject(proto) || JS_IsNull(proto)) {
  ------------------
  |  Branch (19335:21): [True: 0, False: 0]
  |  Branch (19335:43): [True: 0, False: 0]
  ------------------
19336|      0|                    if (JS_SetPrototypeInternal(ctx, sp[-2], proto, TRUE) < 0)
  ------------------
  |  Branch (19336:25): [True: 0, False: 0]
  ------------------
19337|      0|                        goto exception;
19338|      0|                }
19339|      0|                JS_FreeValue(ctx, proto);
19340|      0|                sp--;
19341|      0|            }
19342|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19343|      0|        CASE(OP_set_home_object):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19344|      0|            js_method_set_home_object(ctx, sp[-1], sp[-2]);
19345|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19346|      0|        CASE(OP_define_method):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19347|      0|        CASE(OP_define_method_computed):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19348|      0|            {
19349|      0|                JSValue getter, setter, value;
19350|      0|                JSValueConst obj;
  ------------------
  |  |  234|      0|#define JSValueConst JSValue
  ------------------
19351|      0|                JSAtom atom;
19352|      0|                int flags, ret, op_flags;
19353|      0|                BOOL is_computed;
19354|      0|#define OP_DEFINE_METHOD_METHOD 0
19355|      0|#define OP_DEFINE_METHOD_GETTER 1
19356|      0|#define OP_DEFINE_METHOD_SETTER 2
19357|      0|#define OP_DEFINE_METHOD_ENUMERABLE 4
19358|       |
19359|      0|                is_computed = (opcode == OP_define_method_computed);
19360|      0|                if (is_computed) {
  ------------------
  |  Branch (19360:21): [True: 0, False: 0]
  ------------------
19361|      0|                    atom = JS_ValueToAtom(ctx, sp[-2]);
19362|      0|                    if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19363|      0|                        goto exception;
19364|      0|                    opcode += OP_define_method - OP_define_method_computed;
19365|      0|                } else {
19366|      0|                    atom = get_u32(pc);
19367|      0|                    pc += 4;
19368|      0|                }
19369|      0|                op_flags = *pc++;
19370|       |
19371|      0|                obj = sp[-2 - is_computed];
19372|      0|                flags = JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE |
  ------------------
  |  |  311|      0|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                              flags = JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE |
  ------------------
  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
19373|      0|                    JS_PROP_HAS_ENUMERABLE | JS_PROP_THROW;
  ------------------
  |  |  313|      0|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
                                  JS_PROP_HAS_ENUMERABLE | JS_PROP_THROW;
  ------------------
  |  |  320|      0|#define JS_PROP_THROW            (1 << 14)
  ------------------
19374|      0|                if (op_flags & OP_DEFINE_METHOD_ENUMERABLE)
  ------------------
  |  |19357|      0|#define OP_DEFINE_METHOD_ENUMERABLE 4
  ------------------
  |  Branch (19374:21): [True: 0, False: 0]
  ------------------
19375|      0|                    flags |= JS_PROP_ENUMERABLE;
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
19376|      0|                op_flags &= 3;
19377|      0|                value = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
19378|      0|                getter = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
19379|      0|                setter = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
19380|      0|                if (op_flags == OP_DEFINE_METHOD_METHOD) {
  ------------------
  |  |19354|      0|#define OP_DEFINE_METHOD_METHOD 0
  ------------------
  |  Branch (19380:21): [True: 0, False: 0]
  ------------------
19381|      0|                    value = sp[-1];
19382|      0|                    flags |= JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE;
  ------------------
  |  |  316|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
                                  flags |= JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE;
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
                                  flags |= JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE;
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
19383|      0|                } else if (op_flags == OP_DEFINE_METHOD_GETTER) {
  ------------------
  |  |19355|      0|#define OP_DEFINE_METHOD_GETTER 1
  ------------------
  |  Branch (19383:28): [True: 0, False: 0]
  ------------------
19384|      0|                    getter = sp[-1];
19385|      0|                    flags |= JS_PROP_HAS_GET;
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
19386|      0|                } else {
19387|      0|                    setter = sp[-1];
19388|      0|                    flags |= JS_PROP_HAS_SET;
  ------------------
  |  |  315|      0|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
19389|      0|                }
19390|      0|                ret = js_method_set_properties(ctx, sp[-1], atom, flags, obj);
19391|      0|                if (ret >= 0) {
  ------------------
  |  Branch (19391:21): [True: 0, False: 0]
  ------------------
19392|      0|                    ret = JS_DefineProperty(ctx, obj, atom, value,
19393|      0|                                            getter, setter, flags);
19394|      0|                }
19395|      0|                JS_FreeValue(ctx, sp[-1]);
19396|      0|                if (is_computed) {
  ------------------
  |  Branch (19396:21): [True: 0, False: 0]
  ------------------
19397|      0|                    JS_FreeAtom(ctx, atom);
19398|      0|                    JS_FreeValue(ctx, sp[-2]);
19399|      0|                }
19400|      0|                sp -= 1 + is_computed;
19401|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19402|      0|                    goto exception;
19403|      0|            }
19404|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19405|       |
19406|      0|        CASE(OP_define_class):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19407|      0|        CASE(OP_define_class_computed):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19408|      0|            {
19409|      0|                int class_flags;
19410|      0|                JSAtom atom;
19411|       |
19412|      0|                atom = get_u32(pc);
19413|      0|                class_flags = pc[4];
19414|      0|                pc += 5;
19415|      0|                if (js_op_define_class(ctx, sp, atom, class_flags,
  ------------------
  |  Branch (19415:21): [True: 0, False: 0]
  ------------------
19416|      0|                                       var_refs, sf,
19417|      0|                                       (opcode == OP_define_class_computed)) < 0)
19418|      0|                    goto exception;
19419|      0|            }
19420|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19421|       |
19422|      0|#define GET_ARRAY_EL_INLINE(name, keep)                                 \
19423|      0|            {                                                           \
19424|      0|                JSValue val, obj, prop;                                 \
19425|      0|                JSObject *p;                                            \
19426|      0|                uint32_t idx;                                           \
19427|      0|                                                                        \
19428|      0|                obj = sp[-2];                                           \
19429|      0|                prop = sp[-1];                                          \
19430|      0|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT &&    \
19431|      0|                           JS_VALUE_GET_TAG(prop) == JS_TAG_INT)) {     \
19432|      0|                    p = JS_VALUE_GET_OBJ(obj);                          \
19433|      0|                    idx = JS_VALUE_GET_INT(prop);                       \
19434|      0|                    if (unlikely(p->class_id != JS_CLASS_ARRAY))        \
19435|      0|                        goto name ## _slow_path;                        \
19436|      0|                    if (unlikely(idx >= p->u.array.count))              \
19437|      0|                        goto name ## _slow_path;                        \
19438|      0|                    val = JS_DupValue(ctx, p->u.array.u.values[idx]);   \
19439|      0|                } else {                                                \
19440|      0|                    name ## _slow_path:                                 \
19441|      0|                    sf->cur_pc = pc;                                    \
19442|      0|                    val = JS_GetPropertyValue(ctx, obj, prop);          \
19443|      0|                    if (unlikely(JS_IsException(val))) {                \
19444|      0|                        if (keep)                                       \
19445|      0|                            sp[-1] = JS_UNDEFINED;                      \
19446|      0|                        else                                            \
19447|      0|                            sp--;                                       \
19448|      0|                        goto exception;                                 \
19449|      0|                    }                                                   \
19450|      0|                }                                                       \
19451|      0|                if (keep) {                                             \
19452|      0|                    sp[-1] = val;                                       \
19453|      0|                } else {                                                \
19454|      0|                    JS_FreeValue(ctx, obj);                             \
19455|      0|                    sp[-2] = val;                                       \
19456|      0|                    sp--;                                               \
19457|      0|                }                                                       \
19458|      0|            }
19459|       |            
19460|      0|        CASE(OP_get_array_el):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19461|      0|            GET_ARRAY_EL_INLINE(get_array_el, 0);
  ------------------
  |  |19423|      0|            {                                                           \
  |  |19424|      0|                JSValue val, obj, prop;                                 \
  |  |19425|      0|                JSObject *p;                                            \
  |  |19426|      0|                uint32_t idx;                                           \
  |  |19427|      0|                                                                        \
  |  |19428|      0|                obj = sp[-2];                                           \
  |  |19429|      0|                prop = sp[-1];                                          \
  |  |19430|      0|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT &&    \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19431|      0|                           JS_VALUE_GET_TAG(prop) == JS_TAG_INT)) {     \
  |  |19432|      0|                    p = JS_VALUE_GET_OBJ(obj);                          \
  |  |  ------------------
  |  |  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  |  |  ------------------
  |  |  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19433|      0|                    idx = JS_VALUE_GET_INT(prop);                       \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |19434|      0|                    if (unlikely(p->class_id != JS_CLASS_ARRAY))        \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19435|      0|                        goto name ## _slow_path;                        \
  |  |19436|      0|                    if (unlikely(idx >= p->u.array.count))              \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19437|      0|                        goto name ## _slow_path;                        \
  |  |19438|      0|                    val = JS_DupValue(ctx, p->u.array.u.values[idx]);   \
  |  |19439|      0|                } else {                                                \
  |  |19440|      0|                    name ## _slow_path:                                 \
  |  |19441|      0|                    sf->cur_pc = pc;                                    \
  |  |19442|      0|                    val = JS_GetPropertyValue(ctx, obj, prop);          \
  |  |19443|      0|                    if (unlikely(JS_IsException(val))) {                \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19444|      0|                        if (keep)                                       \
  |  |  ------------------
  |  |  |  Branch (19444:29): [Folded, False: 0]
  |  |  ------------------
  |  |19445|      0|                            sp[-1] = JS_UNDEFINED;                      \
  |  |  ------------------
  |  |  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19446|      0|                        else                                            \
  |  |19447|      0|                            sp--;                                       \
  |  |19448|      0|                        goto exception;                                 \
  |  |19449|      0|                    }                                                   \
  |  |19450|      0|                }                                                       \
  |  |19451|      0|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19451:21): [Folded, False: 0]
  |  |  ------------------
  |  |19452|      0|                    sp[-1] = val;                                       \
  |  |19453|      0|                } else {                                                \
  |  |19454|      0|                    JS_FreeValue(ctx, obj);                             \
  |  |19455|      0|                    sp[-2] = val;                                       \
  |  |19456|      0|                    sp--;                                               \
  |  |19457|      0|                }                                                       \
  |  |19458|      0|            }
  ------------------
19462|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19463|       |
19464|      0|        CASE(OP_get_array_el2):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19465|      0|            GET_ARRAY_EL_INLINE(get_array_el2, 1);
  ------------------
  |  |19423|      0|            {                                                           \
  |  |19424|      0|                JSValue val, obj, prop;                                 \
  |  |19425|      0|                JSObject *p;                                            \
  |  |19426|      0|                uint32_t idx;                                           \
  |  |19427|      0|                                                                        \
  |  |19428|      0|                obj = sp[-2];                                           \
  |  |19429|      0|                prop = sp[-1];                                          \
  |  |19430|      0|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT &&    \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19431|      0|                           JS_VALUE_GET_TAG(prop) == JS_TAG_INT)) {     \
  |  |19432|      0|                    p = JS_VALUE_GET_OBJ(obj);                          \
  |  |  ------------------
  |  |  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  |  |  ------------------
  |  |  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19433|      0|                    idx = JS_VALUE_GET_INT(prop);                       \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |19434|      0|                    if (unlikely(p->class_id != JS_CLASS_ARRAY))        \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19435|      0|                        goto name ## _slow_path;                        \
  |  |19436|      0|                    if (unlikely(idx >= p->u.array.count))              \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19437|      0|                        goto name ## _slow_path;                        \
  |  |19438|      0|                    val = JS_DupValue(ctx, p->u.array.u.values[idx]);   \
  |  |19439|      0|                } else {                                                \
  |  |19440|      0|                    name ## _slow_path:                                 \
  |  |19441|      0|                    sf->cur_pc = pc;                                    \
  |  |19442|      0|                    val = JS_GetPropertyValue(ctx, obj, prop);          \
  |  |19443|      0|                    if (unlikely(JS_IsException(val))) {                \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19444|      0|                        if (keep)                                       \
  |  |  ------------------
  |  |  |  Branch (19444:29): [True: 0, Folded]
  |  |  ------------------
  |  |19445|      0|                            sp[-1] = JS_UNDEFINED;                      \
  |  |  ------------------
  |  |  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19446|      0|                        else                                            \
  |  |19447|      0|                            sp--;                                       \
  |  |19448|      0|                        goto exception;                                 \
  |  |19449|      0|                    }                                                   \
  |  |19450|      0|                }                                                       \
  |  |19451|      0|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19451:21): [True: 0, Folded]
  |  |  ------------------
  |  |19452|      0|                    sp[-1] = val;                                       \
  |  |19453|      0|                } else {                                                \
  |  |19454|      0|                    JS_FreeValue(ctx, obj);                             \
  |  |19455|      0|                    sp[-2] = val;                                       \
  |  |19456|      0|                    sp--;                                               \
  |  |19457|      0|                }                                                       \
  |  |19458|      0|            }
  ------------------
19466|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19467|       |
19468|      0|        CASE(OP_get_array_el3):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19469|      0|            {
19470|      0|                JSValue val;
19471|      0|                JSObject *p;
19472|      0|                uint32_t idx;
19473|       |
19474|      0|                if (likely(JS_VALUE_GET_TAG(sp[-2]) == JS_TAG_OBJECT &&
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19475|      0|                           JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_INT)) {
19476|      0|                    p = JS_VALUE_GET_OBJ(sp[-2]);
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
19477|      0|                    idx = JS_VALUE_GET_INT(sp[-1]);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19478|      0|                    if (unlikely(p->class_id != JS_CLASS_ARRAY))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19479|      0|                        goto get_array_el3_slow_path;
19480|      0|                    if (unlikely(idx >= p->u.array.count))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19481|      0|                        goto get_array_el3_slow_path;
19482|      0|                    val = JS_DupValue(ctx, p->u.array.u.values[idx]);
19483|      0|                } else {
19484|      0|                get_array_el3_slow_path:
19485|      0|                    switch (JS_VALUE_GET_TAG(sp[-1])) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
19486|      0|                    case JS_TAG_INT:
  ------------------
  |  Branch (19486:21): [True: 0, False: 0]
  ------------------
19487|      0|                    case JS_TAG_STRING:
  ------------------
  |  Branch (19487:21): [True: 0, False: 0]
  ------------------
19488|      0|                    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (19488:21): [True: 0, False: 0]
  ------------------
19489|       |                        /* undefined and null are tested in JS_GetPropertyValue() */
19490|      0|                        break;
19491|      0|                    default:
  ------------------
  |  Branch (19491:21): [True: 0, False: 0]
  ------------------
19492|       |                        /* must be tested before JS_ToPropertyKey */
19493|      0|                        if (unlikely(JS_IsUndefined(sp[-2]) || JS_IsNull(sp[-2]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19494|      0|                            JS_ThrowTypeError(ctx, "value has no property");
19495|      0|                            goto exception;
19496|      0|                        }
19497|      0|                        sf->cur_pc = pc;
19498|      0|                        ret_val = JS_ToPropertyKey(ctx, sp[-1]);
19499|      0|                        if (JS_IsException(ret_val))
  ------------------
  |  Branch (19499:29): [True: 0, False: 0]
  ------------------
19500|      0|                            goto exception;
19501|      0|                        JS_FreeValue(ctx, sp[-1]);
19502|      0|                        sp[-1] = ret_val;
19503|      0|                        break;
19504|      0|                    }
19505|      0|                    sf->cur_pc = pc;
19506|      0|                    val = JS_GetPropertyValue(ctx, sp[-2], JS_DupValue(ctx, sp[-1]));
19507|      0|                    if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19508|      0|                        goto exception;
19509|      0|                }
19510|      0|                *sp++ = val;
19511|      0|            }
19512|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19513|       |            
19514|      0|        CASE(OP_get_ref_value):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19515|      0|            {
19516|      0|                JSValue val;
19517|      0|                JSAtom atom;
19518|      0|                int ret;
19519|       |                
19520|      0|                sf->cur_pc = pc;
19521|      0|                atom = JS_ValueToAtom(ctx, sp[-1]);
19522|      0|                if (atom == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (19522:21): [True: 0, False: 0]
  ------------------
19523|      0|                    goto exception;
19524|      0|                if (unlikely(JS_IsUndefined(sp[-2]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19525|      0|                    JS_ThrowReferenceErrorNotDefined(ctx, atom);
19526|      0|                    JS_FreeAtom(ctx, atom);
19527|      0|                    goto exception;
19528|      0|                }
19529|      0|                ret = JS_HasProperty(ctx, sp[-2], atom);
19530|      0|                if (unlikely(ret <= 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19531|      0|                    if (ret < 0) {
  ------------------
  |  Branch (19531:25): [True: 0, False: 0]
  ------------------
19532|      0|                        JS_FreeAtom(ctx, atom);
19533|      0|                        goto exception;
19534|      0|                    }
19535|      0|                    if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (19535:25): [True: 0, False: 0]
  ------------------
19536|      0|                        JS_ThrowReferenceErrorNotDefined(ctx, atom);
19537|      0|                        JS_FreeAtom(ctx, atom);
19538|      0|                        goto exception;
19539|      0|                    } 
19540|      0|                    val = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
19541|      0|                } else {
19542|      0|                    val = JS_GetProperty(ctx, sp[-2], atom);
19543|      0|                }
19544|      0|                JS_FreeAtom(ctx, atom);
19545|      0|                if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19546|      0|                    goto exception;
19547|      0|                sp[0] = val;
19548|      0|                sp++;
19549|      0|            }
19550|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19551|       |
19552|      0|        CASE(OP_get_super_value):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19553|      0|            {
19554|      0|                JSValue val;
19555|      0|                JSAtom atom;
19556|      0|                sf->cur_pc = pc;
19557|      0|                atom = JS_ValueToAtom(ctx, sp[-1]);
19558|      0|                if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19559|      0|                    goto exception;
19560|      0|                val = JS_GetPropertyInternal(ctx, sp[-2], atom, sp[-3], FALSE);
19561|      0|                JS_FreeAtom(ctx, atom);
19562|      0|                if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19563|      0|                    goto exception;
19564|      0|                JS_FreeValue(ctx, sp[-1]);
19565|      0|                JS_FreeValue(ctx, sp[-2]);
19566|      0|                JS_FreeValue(ctx, sp[-3]);
19567|      0|                sp[-3] = val;
19568|      0|                sp -= 2;
19569|      0|            }
19570|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19571|       |
19572|      0|        CASE(OP_put_array_el):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19573|      0|            {
19574|      0|                int ret;
19575|      0|                JSObject *p;
19576|      0|                uint32_t idx;
19577|       |
19578|      0|                if (likely(JS_VALUE_GET_TAG(sp[-3]) == JS_TAG_OBJECT &&
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19579|      0|                           JS_VALUE_GET_TAG(sp[-2]) == JS_TAG_INT)) {
19580|      0|                    p = JS_VALUE_GET_OBJ(sp[-3]);
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
19581|      0|                    idx = JS_VALUE_GET_INT(sp[-2]);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19582|      0|                    if (unlikely(p->class_id != JS_CLASS_ARRAY))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19583|      0|                        goto put_array_el_slow_path;
19584|      0|                    if (unlikely(idx >= (uint32_t)p->u.array.count)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19585|      0|                        uint32_t new_len, array_len;
19586|      0|                        if (unlikely(idx != (uint32_t)p->u.array.count ||
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19587|      0|                                     !p->fast_array ||
19588|      0|                                     !can_extend_fast_array(p))) {
19589|      0|                            goto put_array_el_slow_path;
19590|      0|                        }
19591|      0|                        if (likely(JS_VALUE_GET_TAG(p->prop[0].u.value) != JS_TAG_INT))
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19592|      0|                            goto put_array_el_slow_path;
19593|       |                        /* cannot overflow otherwise the length would not be an integer */
19594|      0|                        new_len = idx + 1;
19595|      0|                        if (unlikely(new_len > p->u.array.u1.size))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19596|      0|                            goto put_array_el_slow_path;
19597|      0|                        array_len = JS_VALUE_GET_INT(p->prop[0].u.value);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19598|      0|                        if (new_len > array_len) {
  ------------------
  |  Branch (19598:29): [True: 0, False: 0]
  ------------------
19599|      0|                            if (unlikely(!(get_shape_prop(p->shape)->flags & JS_PROP_WRITABLE)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19600|      0|                                goto put_array_el_slow_path;
19601|      0|                            p->prop[0].u.value = JS_NewInt32(ctx, new_len);
19602|      0|                        }
19603|      0|                        p->u.array.count = new_len;
19604|      0|                        p->u.array.u.values[idx] = sp[-1];
19605|      0|                    } else {
19606|      0|                        set_value(ctx, &p->u.array.u.values[idx], sp[-1]);
19607|      0|                    }
19608|      0|                    JS_FreeValue(ctx, sp[-3]);
19609|      0|                    sp -= 3;
19610|      0|                } else {
19611|      0|                put_array_el_slow_path:
19612|      0|                    sf->cur_pc = pc;
19613|      0|                    ret = JS_SetPropertyValue(ctx, sp[-3], sp[-2], sp[-1], JS_PROP_THROW_STRICT);
  ------------------
  |  |  323|      0|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
19614|      0|                    JS_FreeValue(ctx, sp[-3]);
19615|      0|                    sp -= 3;
19616|      0|                    if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19617|      0|                        goto exception;
19618|      0|                }
19619|      0|            }
19620|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19621|       |
19622|      0|        CASE(OP_put_ref_value):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19623|      0|            {
19624|      0|                int ret;
19625|      0|                JSAtom atom;
19626|      0|                sf->cur_pc = pc;
19627|      0|                atom = JS_ValueToAtom(ctx, sp[-2]);
19628|      0|                if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19629|      0|                    goto exception;
19630|      0|                if (unlikely(JS_IsUndefined(sp[-3]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19631|      0|                    if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (19631:25): [True: 0, False: 0]
  ------------------
19632|      0|                        JS_ThrowReferenceErrorNotDefined(ctx, atom);
19633|      0|                        JS_FreeAtom(ctx, atom);
19634|      0|                        goto exception;
19635|      0|                    } else {
19636|      0|                        sp[-3] = JS_DupValue(ctx, ctx->global_obj);
19637|      0|                    }
19638|      0|                }
19639|      0|                ret = JS_HasProperty(ctx, sp[-3], atom);
19640|      0|                if (unlikely(ret <= 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19641|      0|                    if (unlikely(ret < 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19642|      0|                        JS_FreeAtom(ctx, atom);
19643|      0|                        goto exception;
19644|      0|                    }
19645|      0|                    if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (19645:25): [True: 0, False: 0]
  ------------------
19646|      0|                        JS_ThrowReferenceErrorNotDefined(ctx, atom);
19647|      0|                        JS_FreeAtom(ctx, atom);
19648|      0|                        goto exception;
19649|      0|                    }
19650|      0|                }
19651|      0|                ret = JS_SetPropertyInternal(ctx, sp[-3], atom, sp[-1], sp[-3], JS_PROP_THROW_STRICT);
  ------------------
  |  |  323|      0|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
19652|      0|                JS_FreeAtom(ctx, atom);
19653|      0|                JS_FreeValue(ctx, sp[-2]);
19654|      0|                JS_FreeValue(ctx, sp[-3]);
19655|      0|                sp -= 3;
19656|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19657|      0|                    goto exception;
19658|      0|            }
19659|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19660|       |
19661|      0|        CASE(OP_put_super_value):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19662|      0|            {
19663|      0|                int ret;
19664|      0|                JSAtom atom;
19665|      0|                sf->cur_pc = pc;
19666|      0|                if (JS_VALUE_GET_TAG(sp[-3]) != JS_TAG_OBJECT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19666:21): [True: 0, False: 0]
  ------------------
19667|      0|                    JS_ThrowTypeErrorNotAnObject(ctx);
19668|      0|                    goto exception;
19669|      0|                }
19670|      0|                atom = JS_ValueToAtom(ctx, sp[-2]);
19671|      0|                if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19672|      0|                    goto exception;
19673|      0|                ret = JS_SetPropertyInternal(ctx, sp[-3], atom, sp[-1], sp[-4],
19674|      0|                                             JS_PROP_THROW_STRICT);
  ------------------
  |  |  323|      0|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
19675|      0|                JS_FreeAtom(ctx, atom);
19676|      0|                JS_FreeValue(ctx, sp[-4]);
19677|      0|                JS_FreeValue(ctx, sp[-3]);
19678|      0|                JS_FreeValue(ctx, sp[-2]);
19679|      0|                sp -= 4;
19680|      0|                if (ret < 0)
  ------------------
  |  Branch (19680:21): [True: 0, False: 0]
  ------------------
19681|      0|                    goto exception;
19682|      0|            }
19683|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19684|       |
19685|      0|        CASE(OP_define_array_el):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19686|      0|            {
19687|      0|                int ret;
19688|      0|                ret = JS_DefinePropertyValueValue(ctx, sp[-3], JS_DupValue(ctx, sp[-2]), sp[-1],
19689|      0|                                                  JS_PROP_C_W_E | JS_PROP_THROW);
  ------------------
  |  |  301|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                                                                JS_PROP_C_W_E | JS_PROP_THROW);
  ------------------
  |  |  320|      0|#define JS_PROP_THROW            (1 << 14)
  ------------------
19690|      0|                sp -= 1;
19691|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19692|      0|                    goto exception;
19693|      0|            }
19694|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19695|       |
19696|      0|        CASE(OP_append):    /* array pos enumobj -- array pos */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19697|      0|            {
19698|      0|                sf->cur_pc = pc;
19699|      0|                if (js_append_enumerate(ctx, sp))
  ------------------
  |  Branch (19699:21): [True: 0, False: 0]
  ------------------
19700|      0|                    goto exception;
19701|      0|                JS_FreeValue(ctx, *--sp);
19702|      0|            }
19703|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19704|       |
19705|      0|        CASE(OP_copy_data_properties):    /* target source excludeList */
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19706|      0|            {
19707|       |                /* stack offsets (-1 based):
19708|       |                   2 bits for target,
19709|       |                   3 bits for source,
19710|       |                   2 bits for exclusionList */
19711|      0|                int mask;
19712|       |
19713|      0|                mask = *pc++;
19714|      0|                sf->cur_pc = pc;
19715|      0|                if (JS_CopyDataProperties(ctx, sp[-1 - (mask & 3)],
  ------------------
  |  Branch (19715:21): [True: 0, False: 0]
  ------------------
19716|      0|                                          sp[-1 - ((mask >> 2) & 7)],
19717|      0|                                          sp[-1 - ((mask >> 5) & 7)], 0))
19718|      0|                    goto exception;
19719|      0|            }
19720|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19721|       |
19722|      2|        CASE(OP_add):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
19723|      2|            {
19724|      2|                JSValue op1, op2;
19725|      2|                op1 = sp[-2];
19726|      2|                op2 = sp[-1];
19727|      2|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {
  ------------------
  |  |   32|      2|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
19728|      0|                    int64_t r;
19729|      0|                    r = (int64_t)JS_VALUE_GET_INT(op1) + JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
                                  r = (int64_t)JS_VALUE_GET_INT(op1) + JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19730|      0|                    if (unlikely((int)r != r)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19731|      0|                        sp[-2] = __JS_NewFloat64(ctx, (double)r);
19732|      0|                    } else {
19733|      0|                        sp[-2] = JS_NewInt32(ctx, r);
19734|      0|                    }
19735|      0|                    sp--;
19736|      2|                } else if (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op1)) ||
  ------------------
  |  |  250|      4|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 1, False: 1]
  |  |  ------------------
  ------------------
19737|      1|                           JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op2))) {
  ------------------
  |  |  250|      1|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 1]
  |  |  ------------------
  ------------------
19738|      1|                    double d1, d2;
19739|      1|                    if (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op1))) {
  ------------------
  |  |  250|      1|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 1, False: 0]
  |  |  ------------------
  ------------------
19740|      1|                        d1 = JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      1|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19741|      1|                    } else if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19741:32): [True: 0, False: 0]
  ------------------
19742|      0|                        d1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19743|      0|                    } else {
19744|      0|                        goto add_slow_case;
19745|      0|                    }
19746|      1|                    if (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op2))) {
  ------------------
  |  |  250|      1|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 1]
  |  |  ------------------
  ------------------
19747|      0|                        d2 = JS_VALUE_GET_FLOAT64(op2);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19748|      1|                    } else if (JS_VALUE_GET_TAG(op2) == JS_TAG_INT) {
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19748:32): [True: 0, False: 1]
  ------------------
19749|      0|                        d2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19750|      1|                    } else {
19751|      1|                        goto add_slow_case;
19752|      1|                    }
19753|      0|                    sp[-2] = __JS_NewFloat64(ctx, d1 + d2);
19754|      0|                    sp--;
19755|      1|                } else if (JS_IsString(op1) && JS_IsString(op2)) {
  ------------------
  |  Branch (19755:28): [True: 1, False: 0]
  |  Branch (19755:48): [True: 0, False: 1]
  ------------------
19756|      0|                    sp[-2] = JS_ConcatString(ctx, op1, op2);
19757|      0|                    sp--;
19758|      0|                    if (JS_IsException(sp[-1]))
  ------------------
  |  Branch (19758:25): [True: 0, False: 0]
  ------------------
19759|      0|                        goto exception;
19760|      1|                } else {
19761|      2|                add_slow_case:
19762|      2|                    sf->cur_pc = pc;
19763|      2|                    if (js_add_slow(ctx, sp))
  ------------------
  |  Branch (19763:25): [True: 0, False: 2]
  ------------------
19764|      0|                        goto exception;
19765|      2|                    sp--;
19766|      2|                }
19767|      2|            }
19768|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19769|      2|        CASE(OP_add_loc):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19770|      0|            {
19771|      0|                JSValue op2;
19772|      0|                JSValue *pv;
19773|      0|                int idx;
19774|      0|                idx = *pc;
19775|      0|                pc += 1;
19776|       |
19777|      0|                op2 = sp[-1];
19778|      0|                pv = &var_buf[idx];
19779|      0|                if (likely(JS_VALUE_IS_BOTH_INT(*pv, op2))) {
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19780|      0|                    int64_t r;
19781|      0|                    r = (int64_t)JS_VALUE_GET_INT(*pv) + JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
                                  r = (int64_t)JS_VALUE_GET_INT(*pv) + JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19782|      0|                    if (unlikely((int)r != r)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19783|      0|                        *pv = __JS_NewFloat64(ctx, (double)r);
19784|      0|                    } else {
19785|      0|                        *pv = JS_NewInt32(ctx, r);
19786|      0|                    }
19787|      0|                    sp--;
19788|      0|                } else if (JS_VALUE_IS_BOTH_FLOAT(*pv, op2)) {
  ------------------
  |  |  285|      0|#define JS_VALUE_IS_BOTH_FLOAT(v1, v2) (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(v1)) && JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(v2)))
  |  |  ------------------
  |  |  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define JS_VALUE_IS_BOTH_FLOAT(v1, v2) (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(v1)) && JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(v2)))
  |  |  ------------------
  |  |  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
19789|      0|                    *pv = __JS_NewFloat64(ctx, JS_VALUE_GET_FLOAT64(*pv) +
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19790|      0|                                               JS_VALUE_GET_FLOAT64(op2));
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19791|      0|                    sp--;
19792|      0|                } else if (JS_VALUE_GET_TAG(*pv) == JS_TAG_STRING &&
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19792:28): [True: 0, False: 0]
  ------------------
19793|      0|                           JS_VALUE_GET_TAG(op2) == JS_TAG_STRING) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19793:28): [True: 0, False: 0]
  ------------------
19794|      0|                    sp--;
19795|      0|                    sf->cur_pc = pc;
19796|      0|                    if (JS_ConcatStringInPlace(ctx, JS_VALUE_GET_STRING(*pv), op2)) {
  ------------------
  |  |  230|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
  |  Branch (19796:25): [True: 0, False: 0]
  ------------------
19797|      0|                        JS_FreeValue(ctx, op2);
19798|      0|                    } else {
19799|      0|                        op2 = JS_ConcatString(ctx, JS_DupValue(ctx, *pv), op2);
19800|      0|                        if (JS_IsException(op2))
  ------------------
  |  Branch (19800:29): [True: 0, False: 0]
  ------------------
19801|      0|                            goto exception;
19802|      0|                        set_value(ctx, pv, op2);
19803|      0|                    }
19804|      0|                } else {
19805|      0|                    JSValue ops[2];
19806|       |                    /* In case of exception, js_add_slow frees ops[0]
19807|       |                       and ops[1], so we must duplicate *pv */
19808|      0|                    sf->cur_pc = pc;
19809|      0|                    ops[0] = JS_DupValue(ctx, *pv);
19810|      0|                    ops[1] = op2;
19811|      0|                    sp--;
19812|      0|                    if (js_add_slow(ctx, ops + 2))
  ------------------
  |  Branch (19812:25): [True: 0, False: 0]
  ------------------
19813|      0|                        goto exception;
19814|      0|                    set_value(ctx, pv, ops[0]);
19815|      0|                }
19816|      0|            }
19817|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19818|      0|        CASE(OP_sub):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19819|      0|            {
19820|      0|                JSValue op1, op2;
19821|      0|                op1 = sp[-2];
19822|      0|                op2 = sp[-1];
19823|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19824|      0|                    int64_t r;
19825|      0|                    r = (int64_t)JS_VALUE_GET_INT(op1) - JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
                                  r = (int64_t)JS_VALUE_GET_INT(op1) - JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19826|      0|                    if (unlikely((int)r != r)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19827|      0|                        sp[-2] = __JS_NewFloat64(ctx, (double)r);
19828|      0|                    } else {
19829|      0|                        sp[-2] = JS_NewInt32(ctx, r);
19830|      0|                    }
19831|      0|                    sp--;
19832|      0|                } else if (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op1)) ||
  ------------------
  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19833|      0|                           JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op2))) {
  ------------------
  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19834|      0|                    double d1, d2;
19835|      0|                    if (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op1))) {
  ------------------
  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19836|      0|                        d1 = JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19837|      0|                    } else if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19837:32): [True: 0, False: 0]
  ------------------
19838|      0|                        d1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19839|      0|                    } else {
19840|      0|                        goto binary_arith_slow;
19841|      0|                    }
19842|      0|                    if (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op2))) {
  ------------------
  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19843|      0|                        d2 = JS_VALUE_GET_FLOAT64(op2);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19844|      0|                    } else if (JS_VALUE_GET_TAG(op2) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19844:32): [True: 0, False: 0]
  ------------------
19845|      0|                        d2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19846|      0|                    } else {
19847|      0|                        goto binary_arith_slow;
19848|      0|                    }
19849|      0|                    sp[-2] = __JS_NewFloat64(ctx, d1 - d2);
19850|      0|                    sp--;
19851|      0|                } else {
19852|      0|                    goto binary_arith_slow;
19853|      0|                }
19854|      0|            }
19855|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19856|      1|        CASE(OP_mul):
  ------------------
  |  |17807|      1|#define CASE(op)        case_ ## op
  ------------------
19857|      1|            {
19858|      1|                JSValue op1, op2;
19859|      1|                double d;
19860|      1|                op1 = sp[-2];
19861|      1|                op2 = sp[-1];
19862|      1|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {
  ------------------
  |  |   32|      1|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 1]
  |  |  ------------------
  ------------------
19863|      0|                    int32_t v1, v2;
19864|      0|                    int64_t r;
19865|      0|                    v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19866|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19867|      0|                    r = (int64_t)v1 * v2;
19868|      0|                    if (unlikely((int)r != r)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19869|      0|                        d = (double)r;
19870|      0|                        goto mul_fp_res;
19871|      0|                    }
19872|       |                    /* need to test zero case for -0 result */
19873|      0|                    if (unlikely(r == 0 && (v1 | v2) < 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19874|      0|                        d = -0.0;
19875|      0|                        goto mul_fp_res;
19876|      0|                    }
19877|      0|                    sp[-2] = JS_NewInt32(ctx, r);
19878|      0|                    sp--;
19879|      1|                } else if (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op1)) ||
  ------------------
  |  |  250|      2|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 1]
  |  |  ------------------
  ------------------
19880|      1|                           JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op2))) {
  ------------------
  |  |  250|      1|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 1]
  |  |  ------------------
  ------------------
19881|      0|                    double d1, d2;
19882|      0|                    if (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op1))) {
  ------------------
  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19883|      0|                        d1 = JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19884|      0|                    } else if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19884:32): [True: 0, False: 0]
  ------------------
19885|      0|                        d1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19886|      0|                    } else {
19887|      0|                        goto binary_arith_slow;
19888|      0|                    }
19889|      0|                    if (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op2))) {
  ------------------
  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19890|      0|                        d2 = JS_VALUE_GET_FLOAT64(op2);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19891|      0|                    } else if (JS_VALUE_GET_TAG(op2) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19891:32): [True: 0, False: 0]
  ------------------
19892|      0|                        d2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19893|      0|                    } else {
19894|      0|                        goto binary_arith_slow;
19895|      0|                    }
19896|      0|                    d = d1 * d2;
19897|      0|                mul_fp_res:
19898|      0|                    sp[-2] = __JS_NewFloat64(ctx, d);
19899|      0|                    sp--;
19900|      1|                } else {
19901|      1|                    goto binary_arith_slow;
19902|      1|                }
19903|      1|            }
19904|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19905|      0|        CASE(OP_div):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19906|      0|            {
19907|      0|                JSValue op1, op2;
19908|      0|                op1 = sp[-2];
19909|      0|                op2 = sp[-1];
19910|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19911|      0|                    int v1, v2;
19912|      0|                    v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19913|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19914|      0|                    sp[-2] = JS_NewFloat64(ctx, (double)v1 / (double)v2);
19915|      0|                    sp--;
19916|      0|                } else {
19917|      0|                    goto binary_arith_slow;
19918|      0|                }
19919|      0|            }
19920|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19921|      2|        CASE(OP_mod):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
19922|      2|            {
19923|      2|                JSValue op1, op2;
19924|      2|                op1 = sp[-2];
19925|      2|                op2 = sp[-1];
19926|      2|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {
  ------------------
  |  |   32|      2|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
19927|      0|                    int v1, v2, r;
19928|      0|                    v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19929|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19930|       |                    /* We must avoid v2 = 0, v1 = INT32_MIN and v2 =
19931|       |                       -1 and the cases where the result is -0. */
19932|      0|                    if (unlikely(v1 < 0 || v2 <= 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19933|      0|                        goto binary_arith_slow;
19934|      0|                    r = v1 % v2;
19935|      0|                    sp[-2] = JS_NewInt32(ctx, r);
19936|      0|                    sp--;
19937|      2|                } else {
19938|      2|                    goto binary_arith_slow;
19939|      2|                }
19940|      2|            }
19941|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19942|      0|        CASE(OP_pow):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19943|      3|        binary_arith_slow:
19944|      3|            sf->cur_pc = pc;
19945|      3|            if (js_binary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (19945:17): [True: 0, False: 3]
  ------------------
19946|      0|                goto exception;
19947|      3|            sp--;
19948|      3|            BREAK;
  ------------------
  |  |17810|      3|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      3|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19949|       |
19950|      3|        CASE(OP_plus):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
19951|      0|            {
19952|      0|                JSValue op1;
19953|      0|                uint32_t tag;
19954|      0|                op1 = sp[-1];
19955|      0|                tag = JS_VALUE_GET_TAG(op1);
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
19956|      0|                if (tag == JS_TAG_INT || JS_TAG_IS_FLOAT64(tag)) {
  ------------------
  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (19956:21): [True: 0, False: 0]
  ------------------
19957|      0|                } else if (tag == JS_TAG_NULL || tag == JS_TAG_BOOL) {
  ------------------
  |  Branch (19957:28): [True: 0, False: 0]
  |  Branch (19957:50): [True: 0, False: 0]
  ------------------
19958|      0|                    sp[-1] = JS_NewInt32(ctx, JS_VALUE_GET_INT(op1));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19959|      0|                } else {
19960|      0|                    sf->cur_pc = pc;
19961|      0|                    if (js_unary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (19961:25): [True: 0, False: 0]
  ------------------
19962|      0|                        goto exception;
19963|      0|                }
19964|      0|            }
19965|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19966|      2|        CASE(OP_neg):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
19967|      2|            {
19968|      2|                JSValue op1;
19969|      2|                uint32_t tag;
19970|      2|                int val;
19971|      2|                double d;
19972|      2|                op1 = sp[-1];
19973|      2|                tag = JS_VALUE_GET_TAG(op1);
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
19974|      2|                if (tag == JS_TAG_INT ||
  ------------------
  |  Branch (19974:21): [True: 0, False: 2]
  ------------------
19975|      2|                    tag == JS_TAG_BOOL ||
  ------------------
  |  Branch (19975:21): [True: 0, False: 2]
  ------------------
19976|      2|                    tag == JS_TAG_NULL) {
  ------------------
  |  Branch (19976:21): [True: 0, False: 2]
  ------------------
19977|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19978|       |                    /* Note: -0 cannot be expressed as integer */
19979|      0|                    if (unlikely(val == 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19980|      0|                        d = -0.0;
19981|      0|                        goto neg_fp_res;
19982|      0|                    }
19983|      0|                    if (unlikely(val == INT32_MIN)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19984|      0|                        d = -(double)val;
19985|      0|                        goto neg_fp_res;
19986|      0|                    }
19987|      0|                    sp[-1] = JS_NewInt32(ctx, -val);
19988|      2|                } else if (JS_TAG_IS_FLOAT64(tag)) {
  ------------------
  |  |  250|      2|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 2]
  |  |  ------------------
  ------------------
19989|      0|                    d = -JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19990|      0|                neg_fp_res:
19991|      0|                    sp[-1] = __JS_NewFloat64(ctx, d);
19992|      2|                } else {
19993|      2|                    sf->cur_pc = pc;
19994|      2|                    if (js_unary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (19994:25): [True: 0, False: 2]
  ------------------
19995|      0|                        goto exception;
19996|      2|                }
19997|      2|            }
19998|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19999|      2|        CASE(OP_inc):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20000|      0|            {
20001|      0|                JSValue op1;
20002|      0|                int val;
20003|      0|                op1 = sp[-1];
20004|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20004:21): [True: 0, False: 0]
  ------------------
20005|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20006|      0|                    if (unlikely(val == INT32_MAX))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20007|      0|                        goto inc_slow;
20008|      0|                    sp[-1] = JS_NewInt32(ctx, val + 1);
20009|      0|                } else {
20010|      0|                inc_slow:
20011|      0|                    sf->cur_pc = pc;
20012|      0|                    if (js_unary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20012:25): [True: 0, False: 0]
  ------------------
20013|      0|                        goto exception;
20014|      0|                }
20015|      0|            }
20016|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20017|      0|        CASE(OP_dec):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20018|      0|            {
20019|      0|                JSValue op1;
20020|      0|                int val;
20021|      0|                op1 = sp[-1];
20022|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20022:21): [True: 0, False: 0]
  ------------------
20023|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20024|      0|                    if (unlikely(val == INT32_MIN))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20025|      0|                        goto dec_slow;
20026|      0|                    sp[-1] = JS_NewInt32(ctx, val - 1);
20027|      0|                } else {
20028|      0|                dec_slow:
20029|      0|                    sf->cur_pc = pc;
20030|      0|                    if (js_unary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20030:25): [True: 0, False: 0]
  ------------------
20031|      0|                        goto exception;
20032|      0|                }
20033|      0|            }
20034|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20035|      0|        CASE(OP_post_inc):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20036|      0|            {
20037|      0|                JSValue op1;
20038|      0|                int val;
20039|      0|                op1 = sp[-1];
20040|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20040:21): [True: 0, False: 0]
  ------------------
20041|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20042|      0|                    if (unlikely(val == INT32_MAX))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20043|      0|                        goto post_inc_slow;
20044|      0|                    sp[0] = JS_NewInt32(ctx, val + 1);
20045|      0|                } else {
20046|      0|                post_inc_slow:
20047|      0|                    sf->cur_pc = pc;
20048|      0|                    if (js_post_inc_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20048:25): [True: 0, False: 0]
  ------------------
20049|      0|                        goto exception;
20050|      0|                }
20051|      0|                sp++;
20052|      0|            }
20053|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20054|      0|        CASE(OP_post_dec):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20055|      0|            {
20056|      0|                JSValue op1;
20057|      0|                int val;
20058|      0|                op1 = sp[-1];
20059|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20059:21): [True: 0, False: 0]
  ------------------
20060|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20061|      0|                    if (unlikely(val == INT32_MIN))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20062|      0|                        goto post_dec_slow;
20063|      0|                    sp[0] = JS_NewInt32(ctx, val - 1);
20064|      0|                } else {
20065|      0|                post_dec_slow:
20066|      0|                    sf->cur_pc = pc;
20067|      0|                    if (js_post_inc_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20067:25): [True: 0, False: 0]
  ------------------
20068|      0|                        goto exception;
20069|      0|                }
20070|      0|                sp++;
20071|      0|            }
20072|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20073|      0|        CASE(OP_inc_loc):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20074|      0|            {
20075|      0|                JSValue op1;
20076|      0|                int val;
20077|      0|                int idx;
20078|      0|                idx = *pc;
20079|      0|                pc += 1;
20080|       |
20081|      0|                op1 = var_buf[idx];
20082|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20082:21): [True: 0, False: 0]
  ------------------
20083|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20084|      0|                    if (unlikely(val == INT32_MAX))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20085|      0|                        goto inc_loc_slow;
20086|      0|                    var_buf[idx] = JS_NewInt32(ctx, val + 1);
20087|      0|                } else {
20088|      0|                inc_loc_slow:
20089|      0|                    sf->cur_pc = pc;
20090|       |                    /* must duplicate otherwise the variable value may
20091|       |                       be destroyed before JS code accesses it */
20092|      0|                    op1 = JS_DupValue(ctx, op1);
20093|      0|                    if (js_unary_arith_slow(ctx, &op1 + 1, OP_inc))
  ------------------
  |  Branch (20093:25): [True: 0, False: 0]
  ------------------
20094|      0|                        goto exception;
20095|      0|                    set_value(ctx, &var_buf[idx], op1);
20096|      0|                }
20097|      0|            }
20098|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20099|      0|        CASE(OP_dec_loc):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20100|      0|            {
20101|      0|                JSValue op1;
20102|      0|                int val;
20103|      0|                int idx;
20104|      0|                idx = *pc;
20105|      0|                pc += 1;
20106|       |
20107|      0|                op1 = var_buf[idx];
20108|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20108:21): [True: 0, False: 0]
  ------------------
20109|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20110|      0|                    if (unlikely(val == INT32_MIN))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20111|      0|                        goto dec_loc_slow;
20112|      0|                    var_buf[idx] = JS_NewInt32(ctx, val - 1);
20113|      0|                } else {
20114|      0|                dec_loc_slow:
20115|      0|                    sf->cur_pc = pc;
20116|       |                    /* must duplicate otherwise the variable value may
20117|       |                       be destroyed before JS code accesses it */
20118|      0|                    op1 = JS_DupValue(ctx, op1);
20119|      0|                    if (js_unary_arith_slow(ctx, &op1 + 1, OP_dec))
  ------------------
  |  Branch (20119:25): [True: 0, False: 0]
  ------------------
20120|      0|                        goto exception;
20121|      0|                    set_value(ctx, &var_buf[idx], op1);
20122|      0|                }
20123|      0|            }
20124|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20125|      0|        CASE(OP_not):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20126|      0|            {
20127|      0|                JSValue op1;
20128|      0|                op1 = sp[-1];
20129|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20129:21): [True: 0, False: 0]
  ------------------
20130|      0|                    sp[-1] = JS_NewInt32(ctx, ~JS_VALUE_GET_INT(op1));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20131|      0|                } else {
20132|      0|                    sf->cur_pc = pc;
20133|      0|                    if (js_not_slow(ctx, sp))
  ------------------
  |  Branch (20133:25): [True: 0, False: 0]
  ------------------
20134|      0|                        goto exception;
20135|      0|                }
20136|      0|            }
20137|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20138|       |
20139|      0|        CASE(OP_shl):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20140|      0|            {
20141|      0|                JSValue op1, op2;
20142|      0|                op1 = sp[-2];
20143|      0|                op2 = sp[-1];
20144|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20145|      0|                    uint32_t v1, v2;
20146|      0|                    v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20147|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20148|      0|                    v2 &= 0x1f;
20149|      0|                    sp[-2] = JS_NewInt32(ctx, v1 << v2);
20150|      0|                    sp--;
20151|      0|                } else {
20152|      0|                    sf->cur_pc = pc;
20153|      0|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20153:25): [True: 0, False: 0]
  ------------------
20154|      0|                        goto exception;
20155|      0|                    sp--;
20156|      0|                }
20157|      0|            }
20158|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20159|      0|        CASE(OP_shr):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20160|      0|            {
20161|      0|                JSValue op1, op2;
20162|      0|                op1 = sp[-2];
20163|      0|                op2 = sp[-1];
20164|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20165|      0|                    uint32_t v2;
20166|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20167|      0|                    v2 &= 0x1f;
20168|      0|                    sp[-2] = JS_NewUint32(ctx,
20169|      0|                                          (uint32_t)JS_VALUE_GET_INT(op1) >>
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20170|      0|                                          v2);
20171|      0|                    sp--;
20172|      0|                } else {
20173|      0|                    sf->cur_pc = pc;
20174|      0|                    if (js_shr_slow(ctx, sp))
  ------------------
  |  Branch (20174:25): [True: 0, False: 0]
  ------------------
20175|      0|                        goto exception;
20176|      0|                    sp--;
20177|      0|                }
20178|      0|            }
20179|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20180|      0|        CASE(OP_sar):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20181|      0|            {
20182|      0|                JSValue op1, op2;
20183|      0|                op1 = sp[-2];
20184|      0|                op2 = sp[-1];
20185|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20186|      0|                    uint32_t v2;
20187|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20188|      0|                    v2 &= 0x1f;
20189|      0|                    sp[-2] = JS_NewInt32(ctx,
20190|      0|                                          (int)JS_VALUE_GET_INT(op1) >> v2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20191|      0|                    sp--;
20192|      0|                } else {
20193|      0|                    sf->cur_pc = pc;
20194|      0|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20194:25): [True: 0, False: 0]
  ------------------
20195|      0|                        goto exception;
20196|      0|                    sp--;
20197|      0|                }
20198|      0|            }
20199|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20200|      1|        CASE(OP_and):
  ------------------
  |  |17807|      1|#define CASE(op)        case_ ## op
  ------------------
20201|      1|            {
20202|      1|                JSValue op1, op2;
20203|      1|                op1 = sp[-2];
20204|      1|                op2 = sp[-1];
20205|      1|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {
  ------------------
  |  |   32|      1|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 1]
  |  |  ------------------
  ------------------
20206|      0|                    sp[-2] = JS_NewInt32(ctx,
20207|      0|                                         JS_VALUE_GET_INT(op1) &
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20208|      0|                                         JS_VALUE_GET_INT(op2));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20209|      0|                    sp--;
20210|      1|                } else {
20211|      1|                    sf->cur_pc = pc;
20212|      1|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20212:25): [True: 0, False: 1]
  ------------------
20213|      0|                        goto exception;
20214|      1|                    sp--;
20215|      1|                }
20216|      1|            }
20217|      1|            BREAK;
  ------------------
  |  |17810|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20218|      1|        CASE(OP_or):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20219|      0|            {
20220|      0|                JSValue op1, op2;
20221|      0|                op1 = sp[-2];
20222|      0|                op2 = sp[-1];
20223|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20224|      0|                    sp[-2] = JS_NewInt32(ctx,
20225|      0|                                         JS_VALUE_GET_INT(op1) |
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20226|      0|                                         JS_VALUE_GET_INT(op2));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20227|      0|                    sp--;
20228|      0|                } else {
20229|      0|                    sf->cur_pc = pc;
20230|      0|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20230:25): [True: 0, False: 0]
  ------------------
20231|      0|                        goto exception;
20232|      0|                    sp--;
20233|      0|                }
20234|      0|            }
20235|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20236|      0|        CASE(OP_xor):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20237|      0|            {
20238|      0|                JSValue op1, op2;
20239|      0|                op1 = sp[-2];
20240|      0|                op2 = sp[-1];
20241|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20242|      0|                    sp[-2] = JS_NewInt32(ctx,
20243|      0|                                         JS_VALUE_GET_INT(op1) ^
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20244|      0|                                         JS_VALUE_GET_INT(op2));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20245|      0|                    sp--;
20246|      0|                } else {
20247|      0|                    sf->cur_pc = pc;
20248|      0|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20248:25): [True: 0, False: 0]
  ------------------
20249|      0|                        goto exception;
20250|      0|                    sp--;
20251|      0|                }
20252|      0|            }
20253|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20254|       |
20255|       |
20256|      0|#define OP_CMP(opcode, binary_op, slow_call)              \
20257|      0|            CASE(opcode):                                 \
20258|      0|                {                                         \
20259|      0|                JSValue op1, op2;                         \
20260|      0|                op1 = sp[-2];                             \
20261|      0|                op2 = sp[-1];                                   \
20262|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {           \
20263|      0|                    sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
20264|      0|                    sp--;                                               \
20265|      0|                } else {                                                \
20266|      0|                    sf->cur_pc = pc;                                    \
20267|      0|                    if (slow_call)                                      \
20268|      0|                        goto exception;                                 \
20269|      0|                    sp--;                                               \
20270|      0|                }                                                       \
20271|      0|                }                                                       \
20272|      0|            BREAK
20273|       |
20274|      0|            OP_CMP(OP_lt, <, js_relational_slow(ctx, sp, opcode));
  ------------------
  |  |20257|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17807|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20258|      0|                {                                         \
  |  |20259|      0|                JSValue op1, op2;                         \
  |  |20260|      0|                op1 = sp[-2];                             \
  |  |20261|      0|                op2 = sp[-1];                                   \
  |  |20262|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {           \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20263|      0|                    sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                   sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20264|      0|                    sp--;                                               \
  |  |20265|      0|                } else {                                                \
  |  |20266|      0|                    sf->cur_pc = pc;                                    \
  |  |20267|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20267:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20268|      0|                        goto exception;                                 \
  |  |20269|      0|                    sp--;                                               \
  |  |20270|      0|                }                                                       \
  |  |20271|      0|                }                                                       \
  |  |20272|      0|            BREAK
  |  |  ------------------
  |  |  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20275|      0|            OP_CMP(OP_lte, <=, js_relational_slow(ctx, sp, opcode));
  ------------------
  |  |20257|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17807|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20258|      0|                {                                         \
  |  |20259|      0|                JSValue op1, op2;                         \
  |  |20260|      0|                op1 = sp[-2];                             \
  |  |20261|      0|                op2 = sp[-1];                                   \
  |  |20262|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {           \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20263|      0|                    sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                   sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20264|      0|                    sp--;                                               \
  |  |20265|      0|                } else {                                                \
  |  |20266|      0|                    sf->cur_pc = pc;                                    \
  |  |20267|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20267:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20268|      0|                        goto exception;                                 \
  |  |20269|      0|                    sp--;                                               \
  |  |20270|      0|                }                                                       \
  |  |20271|      0|                }                                                       \
  |  |20272|      0|            BREAK
  |  |  ------------------
  |  |  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20276|      0|            OP_CMP(OP_gt, >, js_relational_slow(ctx, sp, opcode));
  ------------------
  |  |20257|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17807|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20258|      0|                {                                         \
  |  |20259|      0|                JSValue op1, op2;                         \
  |  |20260|      0|                op1 = sp[-2];                             \
  |  |20261|      0|                op2 = sp[-1];                                   \
  |  |20262|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {           \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20263|      0|                    sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                   sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20264|      0|                    sp--;                                               \
  |  |20265|      0|                } else {                                                \
  |  |20266|      0|                    sf->cur_pc = pc;                                    \
  |  |20267|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20267:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20268|      0|                        goto exception;                                 \
  |  |20269|      0|                    sp--;                                               \
  |  |20270|      0|                }                                                       \
  |  |20271|      0|                }                                                       \
  |  |20272|      0|            BREAK
  |  |  ------------------
  |  |  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20277|      0|            OP_CMP(OP_gte, >=, js_relational_slow(ctx, sp, opcode));
  ------------------
  |  |20257|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17807|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20258|      0|                {                                         \
  |  |20259|      0|                JSValue op1, op2;                         \
  |  |20260|      0|                op1 = sp[-2];                             \
  |  |20261|      0|                op2 = sp[-1];                                   \
  |  |20262|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {           \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20263|      0|                    sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                   sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20264|      0|                    sp--;                                               \
  |  |20265|      0|                } else {                                                \
  |  |20266|      0|                    sf->cur_pc = pc;                                    \
  |  |20267|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20267:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20268|      0|                        goto exception;                                 \
  |  |20269|      0|                    sp--;                                               \
  |  |20270|      0|                }                                                       \
  |  |20271|      0|                }                                                       \
  |  |20272|      0|            BREAK
  |  |  ------------------
  |  |  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20278|      0|            OP_CMP(OP_eq, ==, js_eq_slow(ctx, sp, 0));
  ------------------
  |  |20257|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17807|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20258|      0|                {                                         \
  |  |20259|      0|                JSValue op1, op2;                         \
  |  |20260|      0|                op1 = sp[-2];                             \
  |  |20261|      0|                op2 = sp[-1];                                   \
  |  |20262|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {           \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20263|      0|                    sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                   sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20264|      0|                    sp--;                                               \
  |  |20265|      0|                } else {                                                \
  |  |20266|      0|                    sf->cur_pc = pc;                                    \
  |  |20267|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20267:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20268|      0|                        goto exception;                                 \
  |  |20269|      0|                    sp--;                                               \
  |  |20270|      0|                }                                                       \
  |  |20271|      0|                }                                                       \
  |  |20272|      0|            BREAK
  |  |  ------------------
  |  |  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20279|      0|            OP_CMP(OP_neq, !=, js_eq_slow(ctx, sp, 1));
  ------------------
  |  |20257|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17807|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20258|      0|                {                                         \
  |  |20259|      0|                JSValue op1, op2;                         \
  |  |20260|      0|                op1 = sp[-2];                             \
  |  |20261|      0|                op2 = sp[-1];                                   \
  |  |20262|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {           \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20263|      0|                    sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                   sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20264|      0|                    sp--;                                               \
  |  |20265|      0|                } else {                                                \
  |  |20266|      0|                    sf->cur_pc = pc;                                    \
  |  |20267|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20267:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20268|      0|                        goto exception;                                 \
  |  |20269|      0|                    sp--;                                               \
  |  |20270|      0|                }                                                       \
  |  |20271|      0|                }                                                       \
  |  |20272|      0|            BREAK
  |  |  ------------------
  |  |  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20280|      0|            OP_CMP(OP_strict_eq, ==, js_strict_eq_slow(ctx, sp, 0));
  ------------------
  |  |20257|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17807|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20258|      0|                {                                         \
  |  |20259|      0|                JSValue op1, op2;                         \
  |  |20260|      0|                op1 = sp[-2];                             \
  |  |20261|      0|                op2 = sp[-1];                                   \
  |  |20262|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {           \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20263|      0|                    sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                   sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20264|      0|                    sp--;                                               \
  |  |20265|      0|                } else {                                                \
  |  |20266|      0|                    sf->cur_pc = pc;                                    \
  |  |20267|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20267:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20268|      0|                        goto exception;                                 \
  |  |20269|      0|                    sp--;                                               \
  |  |20270|      0|                }                                                       \
  |  |20271|      0|                }                                                       \
  |  |20272|      0|            BREAK
  |  |  ------------------
  |  |  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20281|      0|            OP_CMP(OP_strict_neq, !=, js_strict_eq_slow(ctx, sp, 1));
  ------------------
  |  |20257|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17807|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20258|      0|                {                                         \
  |  |20259|      0|                JSValue op1, op2;                         \
  |  |20260|      0|                op1 = sp[-2];                             \
  |  |20261|      0|                op2 = sp[-1];                                   \
  |  |20262|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {           \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20263|      0|                    sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                   sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20264|      0|                    sp--;                                               \
  |  |20265|      0|                } else {                                                \
  |  |20266|      0|                    sf->cur_pc = pc;                                    \
  |  |20267|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20267:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20268|      0|                        goto exception;                                 \
  |  |20269|      0|                    sp--;                                               \
  |  |20270|      0|                }                                                       \
  |  |20271|      0|                }                                                       \
  |  |20272|      0|            BREAK
  |  |  ------------------
  |  |  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20282|       |
20283|      0|        CASE(OP_in):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20284|      0|            sf->cur_pc = pc;
20285|      0|            if (js_operator_in(ctx, sp))
  ------------------
  |  Branch (20285:17): [True: 0, False: 0]
  ------------------
20286|      0|                goto exception;
20287|      0|            sp--;
20288|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20289|      0|        CASE(OP_private_in):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20290|      0|            sf->cur_pc = pc;
20291|      0|            if (js_operator_private_in(ctx, sp))
  ------------------
  |  Branch (20291:17): [True: 0, False: 0]
  ------------------
20292|      0|                goto exception;
20293|      0|            sp--;
20294|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20295|      0|        CASE(OP_instanceof):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20296|      0|            sf->cur_pc = pc;
20297|      0|            if (js_operator_instanceof(ctx, sp))
  ------------------
  |  Branch (20297:17): [True: 0, False: 0]
  ------------------
20298|      0|                goto exception;
20299|      0|            sp--;
20300|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20301|      0|        CASE(OP_typeof):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20302|      0|            {
20303|      0|                JSValue op1;
20304|      0|                JSAtom atom;
20305|       |
20306|      0|                op1 = sp[-1];
20307|      0|                atom = js_operator_typeof(ctx, op1);
20308|      0|                JS_FreeValue(ctx, op1);
20309|      0|                sp[-1] = JS_AtomToString(ctx, atom);
20310|      0|            }
20311|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20312|      0|        CASE(OP_delete):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20313|      0|            sf->cur_pc = pc;
20314|      0|            if (js_operator_delete(ctx, sp))
  ------------------
  |  Branch (20314:17): [True: 0, False: 0]
  ------------------
20315|      0|                goto exception;
20316|      0|            sp--;
20317|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20318|      0|        CASE(OP_delete_var):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20319|      0|            {
20320|      0|                JSAtom atom;
20321|      0|                int ret;
20322|       |
20323|      0|                atom = get_u32(pc);
20324|      0|                pc += 4;
20325|      0|                sf->cur_pc = pc;
20326|       |
20327|      0|                ret = JS_DeleteGlobalVar(ctx, atom);
20328|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20329|      0|                    goto exception;
20330|      0|                *sp++ = JS_NewBool(ctx, ret);
20331|      0|            }
20332|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20333|       |
20334|      2|        CASE(OP_to_object):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
20335|      2|            if (JS_VALUE_GET_TAG(sp[-1]) != JS_TAG_OBJECT) {
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20335:17): [True: 0, False: 2]
  ------------------
20336|      0|                sf->cur_pc = pc;
20337|      0|                ret_val = JS_ToObject(ctx, sp[-1]);
20338|      0|                if (JS_IsException(ret_val))
  ------------------
  |  Branch (20338:21): [True: 0, False: 0]
  ------------------
20339|      0|                    goto exception;
20340|      0|                JS_FreeValue(ctx, sp[-1]);
20341|      0|                sp[-1] = ret_val;
20342|      0|            }
20343|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20344|       |
20345|      2|        CASE(OP_to_propkey):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20346|      0|            switch (JS_VALUE_GET_TAG(sp[-1])) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
20347|      0|            case JS_TAG_INT:
  ------------------
  |  Branch (20347:13): [True: 0, False: 0]
  ------------------
20348|      0|            case JS_TAG_STRING:
  ------------------
  |  Branch (20348:13): [True: 0, False: 0]
  ------------------
20349|      0|            case JS_TAG_SYMBOL:
  ------------------
  |  Branch (20349:13): [True: 0, False: 0]
  ------------------
20350|      0|                break;
20351|      0|            default:
  ------------------
  |  Branch (20351:13): [True: 0, False: 0]
  ------------------
20352|      0|                sf->cur_pc = pc;
20353|      0|                ret_val = JS_ToPropertyKey(ctx, sp[-1]);
20354|      0|                if (JS_IsException(ret_val))
  ------------------
  |  Branch (20354:21): [True: 0, False: 0]
  ------------------
20355|      0|                    goto exception;
20356|      0|                JS_FreeValue(ctx, sp[-1]);
20357|      0|                sp[-1] = ret_val;
20358|      0|                break;
20359|      0|            }
20360|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20361|       |
20362|       |#if 0
20363|       |        CASE(OP_to_string):
20364|       |            if (JS_VALUE_GET_TAG(sp[-1]) != JS_TAG_STRING) {
20365|       |                ret_val = JS_ToString(ctx, sp[-1]);
20366|       |                if (JS_IsException(ret_val))
20367|       |                    goto exception;
20368|       |                JS_FreeValue(ctx, sp[-1]);
20369|       |                sp[-1] = ret_val;
20370|       |            }
20371|       |            BREAK;
20372|       |#endif
20373|      0|        CASE(OP_with_get_var):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20374|      0|        CASE(OP_with_put_var):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20375|      0|        CASE(OP_with_delete_var):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20376|      0|        CASE(OP_with_make_ref):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20377|      0|        CASE(OP_with_get_ref):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20378|      0|            {
20379|      0|                JSAtom atom;
20380|      0|                int32_t diff;
20381|      0|                JSValue obj, val;
20382|      0|                int ret, is_with;
20383|      0|                atom = get_u32(pc);
20384|      0|                diff = get_u32(pc + 4);
20385|      0|                is_with = pc[8];
20386|      0|                pc += 9;
20387|      0|                sf->cur_pc = pc;
20388|       |
20389|      0|                obj = sp[-1];
20390|      0|                ret = JS_HasProperty(ctx, obj, atom);
20391|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20392|      0|                    goto exception;
20393|      0|                if (ret) {
  ------------------
  |  Branch (20393:21): [True: 0, False: 0]
  ------------------
20394|      0|                    if (is_with) {
  ------------------
  |  Branch (20394:25): [True: 0, False: 0]
  ------------------
20395|      0|                        ret = js_has_unscopable(ctx, obj, atom);
20396|      0|                        if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20397|      0|                            goto exception;
20398|      0|                        if (ret)
  ------------------
  |  Branch (20398:29): [True: 0, False: 0]
  ------------------
20399|      0|                            goto no_with;
20400|      0|                    }
20401|      0|                    switch (opcode) {
  ------------------
  |  Branch (20401:29): [True: 0, False: 0]
  ------------------
20402|      0|                    case OP_with_get_var:
  ------------------
  |  Branch (20402:21): [True: 0, False: 0]
  ------------------
20403|       |                        /* in Object Environment Records, GetBindingValue() calls HasProperty() */
20404|      0|                        ret = JS_HasProperty(ctx, obj, atom);
20405|      0|                        if (unlikely(ret <= 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20406|      0|                            if (ret < 0)
  ------------------
  |  Branch (20406:33): [True: 0, False: 0]
  ------------------
20407|      0|                                goto exception;
20408|      0|                            if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (20408:33): [True: 0, False: 0]
  ------------------
20409|      0|                                JS_ThrowReferenceErrorNotDefined(ctx, atom);
20410|      0|                                goto exception;
20411|      0|                            } 
20412|      0|                            val = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20413|      0|                        } else {
20414|      0|                            val = JS_GetProperty(ctx, obj, atom);
20415|      0|                            if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20416|      0|                                goto exception;
20417|      0|                        }
20418|      0|                        set_value(ctx, &sp[-1], val);
20419|      0|                        break;
20420|      0|                    case OP_with_put_var: /* used e.g. in for in/of */
  ------------------
  |  Branch (20420:21): [True: 0, False: 0]
  ------------------
20421|       |                        /* in Object Environment Records, SetMutableBinding() calls HasProperty() */
20422|      0|                        ret = JS_HasProperty(ctx, obj, atom);
20423|      0|                        if (unlikely(ret <= 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20424|      0|                            if (ret < 0)
  ------------------
  |  Branch (20424:33): [True: 0, False: 0]
  ------------------
20425|      0|                                goto exception;
20426|      0|                            if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (20426:33): [True: 0, False: 0]
  ------------------
20427|      0|                                JS_ThrowReferenceErrorNotDefined(ctx, atom);
20428|      0|                                goto exception;
20429|      0|                            } 
20430|      0|                        }
20431|      0|                        ret = JS_SetPropertyInternal(ctx, obj, atom, sp[-2], obj,
20432|      0|                                                     JS_PROP_THROW_STRICT);
  ------------------
  |  |  323|      0|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
20433|      0|                        JS_FreeValue(ctx, sp[-1]);
20434|      0|                        sp -= 2;
20435|      0|                        if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20436|      0|                            goto exception;
20437|      0|                        break;
20438|      0|                    case OP_with_delete_var:
  ------------------
  |  Branch (20438:21): [True: 0, False: 0]
  ------------------
20439|      0|                        ret = JS_DeleteProperty(ctx, obj, atom, 0);
20440|      0|                        if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20441|      0|                            goto exception;
20442|      0|                        JS_FreeValue(ctx, sp[-1]);
20443|      0|                        sp[-1] = JS_NewBool(ctx, ret);
20444|      0|                        break;
20445|      0|                    case OP_with_make_ref:
  ------------------
  |  Branch (20445:21): [True: 0, False: 0]
  ------------------
20446|       |                        /* produce a pair object/propname on the stack */
20447|      0|                        *sp++ = JS_AtomToValue(ctx, atom);
20448|      0|                        break;
20449|      0|                    case OP_with_get_ref:
  ------------------
  |  Branch (20449:21): [True: 0, False: 0]
  ------------------
20450|       |                        /* produce a pair object/method on the stack */
20451|       |                        /* in Object Environment Records, GetBindingValue() calls HasProperty() */
20452|      0|                        ret = JS_HasProperty(ctx, obj, atom);
20453|      0|                        if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20454|      0|                            goto exception;
20455|      0|                        if (!ret) {
  ------------------
  |  Branch (20455:29): [True: 0, False: 0]
  ------------------
20456|      0|                            val = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20457|      0|                        } else {
20458|      0|                            val = JS_GetProperty(ctx, obj, atom);
20459|      0|                            if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20460|      0|                                goto exception;
20461|      0|                        }
20462|      0|                        *sp++ = val;
20463|      0|                        break;
20464|      0|                    }
20465|      0|                    pc += diff - 5;
20466|      0|                } else {
20467|      0|                no_with:
20468|       |                    /* if not jumping, drop the object argument */
20469|      0|                    JS_FreeValue(ctx, sp[-1]);
20470|      0|                    sp--;
20471|      0|                }
20472|      0|            }
20473|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20474|       |
20475|      0|        CASE(OP_await):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20476|      0|            ret_val = JS_NewInt32(ctx, FUNC_RET_AWAIT);
  ------------------
  |  |17761|      0|#define FUNC_RET_AWAIT         0
  ------------------
20477|      0|            goto done_generator;
20478|      0|        CASE(OP_yield):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20479|      0|            ret_val = JS_NewInt32(ctx, FUNC_RET_YIELD);
  ------------------
  |  |17762|      0|#define FUNC_RET_YIELD         1
  ------------------
20480|      0|            goto done_generator;
20481|      0|        CASE(OP_yield_star):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20482|      0|        CASE(OP_async_yield_star):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20483|      0|            ret_val = JS_NewInt32(ctx, FUNC_RET_YIELD_STAR);
  ------------------
  |  |17763|      0|#define FUNC_RET_YIELD_STAR    2
  ------------------
20484|      0|            goto done_generator;
20485|     16|        CASE(OP_return_async):
  ------------------
  |  |17807|     16|#define CASE(op)        case_ ## op
  ------------------
20486|     16|            ret_val = JS_UNDEFINED;
  ------------------
  |  |  291|     16|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     16|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20487|     16|            goto done_generator;
20488|      0|        CASE(OP_initial_yield):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20489|      0|            ret_val = JS_NewInt32(ctx, FUNC_RET_INITIAL_YIELD);
  ------------------
  |  |17764|      0|#define FUNC_RET_INITIAL_YIELD 3
  ------------------
20490|      0|            goto done_generator;
20491|       |
20492|      0|        CASE(OP_nop):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20493|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20494|      0|        CASE(OP_is_undefined_or_null):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20495|      0|            if (JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_UNDEFINED ||
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20495:17): [True: 0, False: 0]
  ------------------
20496|      0|                JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_NULL) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20496:17): [True: 0, False: 0]
  ------------------
20497|      0|                goto set_true;
20498|      0|            } else {
20499|      0|                goto free_and_set_false;
20500|      0|            }
20501|      0|#if SHORT_OPCODES
20502|      2|        CASE(OP_is_undefined):
  ------------------
  |  |17807|      2|#define CASE(op)        case_ ## op
  ------------------
20503|      2|            if (JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_UNDEFINED) {
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20503:17): [True: 0, False: 2]
  ------------------
20504|      0|                goto set_true;
20505|      2|            } else {
20506|      2|                goto free_and_set_false;
20507|      2|            }
20508|      0|        CASE(OP_is_null):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20509|      0|            if (JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_NULL) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20509:17): [True: 0, False: 0]
  ------------------
20510|      0|                goto set_true;
20511|      0|            } else {
20512|      0|                goto free_and_set_false;
20513|      0|            }
20514|       |            /* XXX: could merge to a single opcode */
20515|      0|        CASE(OP_typeof_is_undefined):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20516|       |            /* different from OP_is_undefined because of isHTMLDDA */
20517|      0|            if (js_operator_typeof(ctx, sp[-1]) == JS_ATOM_undefined) {
  ------------------
  |  Branch (20517:17): [True: 0, False: 0]
  ------------------
20518|      0|                goto free_and_set_true;
20519|      0|            } else {
20520|      0|                goto free_and_set_false;
20521|      0|            }
20522|      0|        CASE(OP_typeof_is_function):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20523|      0|            if (js_operator_typeof(ctx, sp[-1]) == JS_ATOM_function) {
  ------------------
  |  Branch (20523:17): [True: 0, False: 0]
  ------------------
20524|      0|                goto free_and_set_true;
20525|      0|            } else {
20526|      0|                goto free_and_set_false;
20527|      0|            }
20528|      0|        free_and_set_true:
20529|      0|            JS_FreeValue(ctx, sp[-1]);
20530|      0|#endif
20531|      0|        set_true:
20532|      0|            sp[-1] = JS_TRUE;
  ------------------
  |  |  293|      0|#define JS_TRUE      JS_MKVAL(JS_TAG_BOOL, 1)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20533|      0|            BREAK;
  ------------------
  |  |17810|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20534|      2|        free_and_set_false:
20535|      2|            JS_FreeValue(ctx, sp[-1]);
20536|      2|            sp[-1] = JS_FALSE;
  ------------------
  |  |  292|      2|#define JS_FALSE     JS_MKVAL(JS_TAG_BOOL, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20537|      2|            BREAK;
  ------------------
  |  |17810|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17803|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20538|      2|        CASE(OP_invalid):
  ------------------
  |  |17807|      0|#define CASE(op)        case_ ## op
  ------------------
20539|      0|        DEFAULT:
  ------------------
  |  |17809|      0|#define DEFAULT         case_default
  ------------------
20540|      0|            JS_ThrowInternalError(ctx, "invalid opcode: pc=%u opcode=0x%02x",
20541|      0|                                  (int)(pc - b->byte_code_buf - 1), opcode);
20542|      0|            goto exception;
20543|      0|        }
20544|      0|    }
20545|     11| exception:
20546|     11|    if (is_backtrace_needed(ctx, rt->current_exception)) {
  ------------------
  |  Branch (20546:9): [True: 9, False: 2]
  ------------------
20547|       |        /* add the backtrace information now (it is not done
20548|       |           before if the exception happens in a bytecode
20549|       |           operation */
20550|      9|        sf->cur_pc = pc;
20551|      9|        build_backtrace(ctx, rt->current_exception, NULL, 0, 0, 0);
20552|      9|    }
20553|     11|    if (!rt->current_exception_is_uncatchable) {
  ------------------
  |  Branch (20553:9): [True: 10, False: 1]
  ------------------
20554|     13|        while (sp > stack_buf) {
  ------------------
  |  Branch (20554:16): [True: 3, False: 10]
  ------------------
20555|      3|            JSValue val = *--sp;
20556|      3|            JS_FreeValue(ctx, val);
20557|      3|            if (JS_VALUE_GET_TAG(val) == JS_TAG_CATCH_OFFSET) {
  ------------------
  |  |  236|      3|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20557:17): [True: 0, False: 3]
  ------------------
20558|      0|                int pos = JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20559|      0|                if (pos == 0) {
  ------------------
  |  Branch (20559:21): [True: 0, False: 0]
  ------------------
20560|       |                    /* enumerator: close it with a throw */
20561|      0|                    JS_FreeValue(ctx, sp[-1]); /* drop the next method */
20562|      0|                    sp--;
20563|      0|                    JS_IteratorClose(ctx, sp[-1], TRUE);
20564|      0|                } else {
20565|      0|                    *sp++ = rt->current_exception;
20566|      0|                    rt->current_exception = JS_UNINITIALIZED;
  ------------------
  |  |  295|      0|#define JS_UNINITIALIZED JS_MKVAL(JS_TAG_UNINITIALIZED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20567|      0|                    pc = b->byte_code_buf + pos;
20568|      0|                    goto restart;
20569|      0|                }
20570|      0|            }
20571|      3|        }
20572|     10|    }
20573|     11|    ret_val = JS_EXCEPTION;
  ------------------
  |  |  294|     11|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|     11|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20574|       |    /* the local variables are freed by the caller in the generator
20575|       |       case. Hence the label 'done' should never be reached in a
20576|       |       generator function. */
20577|     11|    if (b->func_kind != JS_FUNC_NORMAL) {
  ------------------
  |  Branch (20577:9): [True: 0, False: 11]
  ------------------
20578|     16|    done_generator:
20579|     16|        sf->cur_pc = pc;
20580|     16|        sf->cur_sp = sp;
20581|     16|    } else {
20582|     30|    done:
20583|     30|        if (unlikely(b->var_ref_count != 0)) {
  ------------------
  |  |   33|     30|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 30]
  |  |  ------------------
  ------------------
20584|       |            /* variable references reference the stack: must close them */
20585|      0|            close_var_refs(rt, b, sf);
20586|      0|        }
20587|       |        /* free the local variables and stack */
20588|     61|        for(pval = local_buf; pval < sp; pval++) {
  ------------------
  |  Branch (20588:31): [True: 31, False: 30]
  ------------------
20589|     31|            JS_FreeValue(ctx, *pval);
20590|     31|        }
20591|     30|    }
20592|     46|    rt->current_stack_frame = sf->prev_frame;
20593|     46|    return ret_val;
20594|     11|}
quickjs.c:js_closure:
17398|     14|{
17399|     14|    JSFunctionBytecode *b;
17400|     14|    JSValue func_obj;
17401|     14|    JSAtom name_atom;
17402|       |
17403|     14|    b = JS_VALUE_GET_PTR(bfunc);
  ------------------
  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
17404|     14|    func_obj = JS_NewObjectClass(ctx, func_kind_to_class_id[b->func_kind]);
17405|     14|    if (JS_IsException(func_obj)) {
  ------------------
  |  Branch (17405:9): [True: 0, False: 14]
  ------------------
17406|      0|        JS_FreeValue(ctx, bfunc);
17407|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17408|      0|    }
17409|     14|    func_obj = js_closure2(ctx, func_obj, b, cur_var_refs, sf, is_eval, NULL);
17410|     14|    if (JS_IsException(func_obj)) {
  ------------------
  |  Branch (17410:9): [True: 0, False: 14]
  ------------------
17411|       |        /* bfunc has been freed */
17412|      0|        goto fail;
17413|      0|    }
17414|     14|    name_atom = b->func_name;
17415|     14|    if (name_atom == JS_ATOM_NULL)
  ------------------
  |  |  451|     14|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (17415:9): [True: 2, False: 12]
  ------------------
17416|      2|        name_atom = JS_ATOM_empty_string;
17417|     14|    js_function_set_properties(ctx, func_obj, name_atom,
17418|     14|                               b->defined_arg_count);
17419|       |
17420|     14|    if (b->func_kind & JS_FUNC_GENERATOR) {
  ------------------
  |  Branch (17420:9): [True: 0, False: 14]
  ------------------
17421|      0|        JSValue proto;
17422|      0|        int proto_class_id;
17423|       |        /* generators have a prototype field which is used as
17424|       |           prototype for the generator object */
17425|      0|        if (b->func_kind == JS_FUNC_ASYNC_GENERATOR)
  ------------------
  |  Branch (17425:13): [True: 0, False: 0]
  ------------------
17426|      0|            proto_class_id = JS_CLASS_ASYNC_GENERATOR;
17427|      0|        else
17428|      0|            proto_class_id = JS_CLASS_GENERATOR;
17429|      0|        proto = JS_NewObjectProto(ctx, ctx->class_proto[proto_class_id]);
17430|      0|        if (JS_IsException(proto))
  ------------------
  |  Branch (17430:13): [True: 0, False: 0]
  ------------------
17431|      0|            goto fail;
17432|      0|        JS_DefinePropertyValue(ctx, func_obj, JS_ATOM_prototype, proto,
17433|      0|                               JS_PROP_WRITABLE);
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
17434|     14|    } else if (b->has_prototype) {
  ------------------
  |  Branch (17434:16): [True: 0, False: 14]
  ------------------
17435|       |        /* add the 'prototype' property: delay instantiation to avoid
17436|       |           creating cycles for every javascript function. The prototype
17437|       |           object is created on the fly when first accessed */
17438|      0|        JS_SetConstructorBit(ctx, func_obj, TRUE);
17439|      0|        JS_DefineAutoInitProperty(ctx, func_obj, JS_ATOM_prototype,
17440|      0|                                  JS_AUTOINIT_ID_PROTOTYPE, NULL,
17441|      0|                                  JS_PROP_WRITABLE);
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
17442|      0|    }
17443|     14|    return func_obj;
17444|      0| fail:
17445|       |    /* bfunc is freed when func_obj is freed */
17446|      0|    JS_FreeValue(ctx, func_obj);
17447|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17448|     14|}
quickjs.c:js_closure2:
17293|     31|{
17294|     31|    JSObject *p;
17295|     31|    JSVarRef **var_refs;
17296|     31|    int i;
17297|       |
17298|     31|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  229|     31|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     31|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17299|     31|    p->u.func.function_bytecode = b;
17300|     31|    p->u.func.home_object = NULL;
17301|     31|    p->u.func.var_refs = NULL;
17302|     31|    if (b->closure_var_count) {
  ------------------
  |  Branch (17302:9): [True: 29, False: 2]
  ------------------
17303|     29|        var_refs = js_mallocz(ctx, sizeof(var_refs[0]) * b->closure_var_count);
17304|     29|        if (!var_refs)
  ------------------
  |  Branch (17304:13): [True: 0, False: 29]
  ------------------
17305|      0|            goto fail;
17306|     29|        p->u.func.var_refs = var_refs;
17307|     29|        if (is_eval) {
  ------------------
  |  Branch (17307:13): [True: 27, False: 2]
  ------------------
17308|       |            /* first pass to check the global variable definitions */
17309|     93|            for(i = 0; i < b->closure_var_count; i++) {
  ------------------
  |  Branch (17309:24): [True: 66, False: 27]
  ------------------
17310|     66|                JSClosureVar *cv = &b->closure_var[i];
17311|     66|                if (cv->closure_type == JS_CLOSURE_GLOBAL_DECL) {
  ------------------
  |  Branch (17311:21): [True: 0, False: 66]
  ------------------
17312|      0|                    int flags;
17313|      0|                    flags = 0;
17314|      0|                    if (cv->is_lexical)
  ------------------
  |  Branch (17314:25): [True: 0, False: 0]
  ------------------
17315|      0|                        flags |= DEFINE_GLOBAL_LEX_VAR;
  ------------------
  |  |10809|      0|#define DEFINE_GLOBAL_LEX_VAR (1 << 7)
  ------------------
17316|      0|                    if (cv->var_kind == JS_VAR_GLOBAL_FUNCTION_DECL)
  ------------------
  |  Branch (17316:25): [True: 0, False: 0]
  ------------------
17317|      0|                        flags |= DEFINE_GLOBAL_FUNC_VAR;
  ------------------
  |  |10810|      0|#define DEFINE_GLOBAL_FUNC_VAR (1 << 6)
  ------------------
17318|      0|                    if (JS_CheckDefineGlobalVar(ctx, cv->var_name, flags))
  ------------------
  |  Branch (17318:25): [True: 0, False: 0]
  ------------------
17319|      0|                        goto fail;
17320|      0|                }
17321|     66|            }
17322|     27|        }
17323|    102|        for(i = 0; i < b->closure_var_count; i++) {
  ------------------
  |  Branch (17323:20): [True: 73, False: 29]
  ------------------
17324|     73|            JSClosureVar *cv = &b->closure_var[i];
17325|     73|            JSVarRef *var_ref;
17326|     73|            switch(cv->closure_type) {
17327|      0|            case JS_CLOSURE_MODULE_IMPORT:
  ------------------
  |  Branch (17327:13): [True: 0, False: 73]
  ------------------
17328|       |                /* imported from other modules */
17329|      0|                continue;
17330|     34|            case JS_CLOSURE_MODULE_DECL:
  ------------------
  |  Branch (17330:13): [True: 34, False: 39]
  ------------------
17331|     34|                var_ref = js_create_var_ref(ctx, cv->is_lexical);
17332|     34|                break;
17333|      0|            case JS_CLOSURE_GLOBAL_DECL:
  ------------------
  |  Branch (17333:13): [True: 0, False: 73]
  ------------------
17334|      0|                var_ref = js_closure_define_global_var(ctx, cv, b->is_direct_or_indirect_eval);
17335|      0|                break;
17336|     32|            case JS_CLOSURE_GLOBAL:
  ------------------
  |  Branch (17336:13): [True: 32, False: 41]
  ------------------
17337|     32|                var_ref = js_closure_global_var(ctx, cv);
17338|     32|                break;
17339|      0|            case JS_CLOSURE_LOCAL:
  ------------------
  |  Branch (17339:13): [True: 0, False: 73]
  ------------------
17340|       |                /* reuse the existing variable reference if it already exists */
17341|      0|                var_ref = get_var_ref(ctx, sf, cv->var_idx, FALSE);
17342|      0|                break;
17343|      0|            case JS_CLOSURE_ARG:
  ------------------
  |  Branch (17343:13): [True: 0, False: 73]
  ------------------
17344|       |                /* reuse the existing variable reference if it already exists */
17345|      0|                var_ref = get_var_ref(ctx, sf, cv->var_idx, TRUE);
17346|      0|                break;
17347|      0|            case JS_CLOSURE_REF:
  ------------------
  |  Branch (17347:13): [True: 0, False: 73]
  ------------------
17348|      7|            case JS_CLOSURE_GLOBAL_REF:
  ------------------
  |  Branch (17348:13): [True: 7, False: 66]
  ------------------
17349|      7|                var_ref = cur_var_refs[cv->var_idx];
17350|      7|                js_rc(var_ref)->ref_count++;
17351|      7|                break;
17352|      0|            default:
  ------------------
  |  Branch (17352:13): [True: 0, False: 73]
  ------------------
17353|      0|                abort();
17354|     73|            }
17355|     73|            if (!var_ref)
  ------------------
  |  Branch (17355:17): [True: 0, False: 73]
  ------------------
17356|      0|                goto fail;
17357|     73|            var_refs[i] = var_ref;
17358|     73|        }
17359|     29|    }
17360|     31|    return func_obj;
17361|      0| fail:
17362|       |    /* bfunc is freed when func_obj is freed */
17363|      0|    JS_FreeValue(ctx, func_obj);
17364|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17365|     31|}
quickjs.c:find_own_property1:
 6117|     23|{
 6118|     23|    JSShape *sh;
 6119|     23|    JSShapeProperty *pr, *prop;
 6120|     23|    intptr_t h;
 6121|     23|    sh = p->shape;
 6122|     23|    h = (uintptr_t)atom & sh->prop_hash_mask;
 6123|     23|    h = sh->hash_table[h];
 6124|     23|    prop = get_shape_prop(sh);
 6125|     23|    while (h) {
  ------------------
  |  Branch (6125:12): [True: 14, False: 9]
  ------------------
 6126|     14|        pr = &prop[h - 1];
 6127|     14|        if (likely(pr->atom == atom)) {
  ------------------
  |  |   32|     14|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 14, False: 0]
  |  |  ------------------
  ------------------
 6128|     14|            return pr;
 6129|     14|        }
 6130|      0|        h = pr->hash_next;
 6131|      0|    }
 6132|      9|    return NULL;
 6133|     23|}
quickjs.c:js_global_object_get_uninitialized_var:
17097|     13|{
17098|     13|    JSObject *p = JS_VALUE_GET_OBJ(p1->u.global_object.uninitialized_vars);
  ------------------
  |  |  229|     13|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     13|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17099|     13|    JSShapeProperty *prs;
17100|     13|    JSProperty *pr;
17101|     13|    JSVarRef *var_ref;
17102|       |    
17103|     13|    prs = find_own_property(&pr, p, atom);
17104|     13|    if (prs) {
  ------------------
  |  Branch (17104:9): [True: 0, False: 13]
  ------------------
17105|      0|        assert((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF);
  ------------------
  |  Branch (17105:9): [True: 0, False: 0]
  |  Branch (17105:9): [True: 0, False: 0]
  ------------------
17106|      0|        var_ref = pr->u.var_ref;
17107|      0|        js_rc(var_ref)->ref_count++;
17108|      0|        return var_ref;
17109|      0|    }
17110|       |
17111|     13|    var_ref = js_create_var_ref(ctx, TRUE);
17112|     13|    if (!var_ref)
  ------------------
  |  Branch (17112:9): [True: 0, False: 13]
  ------------------
17113|      0|        return NULL;
17114|     13|    pr = add_property(ctx, p, atom, JS_PROP_C_W_E | JS_PROP_VARREF);
  ------------------
  |  |  301|     13|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     13|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|     13|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|     13|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                  pr = add_property(ctx, p, atom, JS_PROP_C_W_E | JS_PROP_VARREF);
  ------------------
  |  |  306|     13|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
17115|     13|    if (unlikely(!pr)) {
  ------------------
  |  |   33|     13|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 13]
  |  |  ------------------
  ------------------
17116|      0|        free_var_ref(ctx->rt, var_ref);
17117|      0|        return NULL;
17118|      0|    }
17119|     13|    pr->u.var_ref = var_ref;
17120|     13|    js_rc(var_ref)->ref_count++;
17121|     13|    return var_ref;
17122|     13|}
quickjs.c:js_closure_global_var:
17255|     32|{
17256|     32|    JSObject *p;
17257|     32|    JSShapeProperty *prs;
17258|     32|    JSProperty *pr;
17259|     32|    JSVarRef *var_ref;
17260|       |    
17261|     32|    p = JS_VALUE_GET_OBJ(ctx->global_var_obj);
  ------------------
  |  |  229|     32|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     32|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17262|     32|    prs = find_own_property(&pr, p, cv->var_name);
17263|     32|    if (prs) {
  ------------------
  |  Branch (17263:9): [True: 0, False: 32]
  ------------------
17264|      0|        assert((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF);
  ------------------
  |  Branch (17264:9): [True: 0, False: 0]
  |  Branch (17264:9): [True: 0, False: 0]
  ------------------
17265|      0|        var_ref = pr->u.var_ref;
17266|      0|        js_rc(var_ref)->ref_count++;
17267|      0|        return var_ref;
17268|      0|    }
17269|     32|    p = JS_VALUE_GET_OBJ(ctx->global_obj);
  ------------------
  |  |  229|     32|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     32|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17270|     34| redo:
17271|     34|    prs = find_own_property(&pr, p, cv->var_name);
17272|     34|    if (prs) {
  ------------------
  |  Branch (17272:9): [True: 21, False: 13]
  ------------------
17273|     21|        if (unlikely((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT)) {
  ------------------
  |  |   33|     21|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 19]
  |  |  ------------------
  ------------------
17274|       |            /* Instantiate property and retry */
17275|      2|            if (JS_AutoInitProperty(ctx, p, cv->var_name, pr, prs))
  ------------------
  |  Branch (17275:17): [True: 0, False: 2]
  ------------------
17276|      0|                return NULL;
17277|      2|            goto redo;
17278|      2|        }
17279|     19|        if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  303|     19|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  306|     19|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (17279:13): [True: 19, False: 0]
  ------------------
17280|     19|            var_ref = pr->u.var_ref;
17281|     19|            js_rc(var_ref)->ref_count++;
17282|     19|            return var_ref;
17283|     19|        }
17284|     19|    }
17285|     13|    return js_global_object_get_uninitialized_var(ctx, p, cv->var_name);
17286|     34|}
quickjs.c:JS_DefineAutoInitProperty:
10651|  7.36k|{
10652|  7.36k|    JSObject *p;
10653|  7.36k|    JSProperty *pr;
10654|       |
10655|  7.36k|    if (JS_VALUE_GET_TAG(this_obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|  7.36k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10655:9): [True: 0, False: 7.36k]
  ------------------
10656|      0|        return FALSE;
10657|       |
10658|  7.36k|    p = JS_VALUE_GET_OBJ(this_obj);
  ------------------
  |  |  229|  7.36k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  7.36k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10659|       |
10660|  7.36k|    if (find_own_property(&pr, p, prop)) {
  ------------------
  |  Branch (10660:9): [True: 0, False: 7.36k]
  ------------------
10661|       |        /* property already exists */
10662|      0|        abort();
10663|      0|        return FALSE;
10664|      0|    }
10665|       |
10666|       |    /* Specialized CreateProperty */
10667|  7.36k|    pr = add_property(ctx, p, prop, (flags & JS_PROP_C_W_E) | JS_PROP_AUTOINIT);
  ------------------
  |  |  301|  7.36k|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|  7.36k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|  7.36k|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|  7.36k|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                  pr = add_property(ctx, p, prop, (flags & JS_PROP_C_W_E) | JS_PROP_AUTOINIT);
  ------------------
  |  |  307|  7.36k|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
10668|  7.36k|    if (unlikely(!pr))
  ------------------
  |  |   33|  7.36k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 7.36k]
  |  |  ------------------
  ------------------
10669|      0|        return -1;
10670|  7.36k|    pr->u.init.realm_and_id = (uintptr_t)JS_DupContext(ctx);
10671|  7.36k|    assert((pr->u.init.realm_and_id & 3) == 0);
  ------------------
  |  Branch (10671:5): [True: 0, False: 7.36k]
  |  Branch (10671:5): [True: 7.36k, False: 0]
  ------------------
10672|  7.36k|    assert(id <= 3);
  ------------------
  |  Branch (10672:5): [True: 0, False: 7.36k]
  |  Branch (10672:5): [True: 7.36k, False: 0]
  ------------------
10673|  7.36k|    pr->u.init.realm_and_id |= id;
10674|  7.36k|    pr->u.init.opaque = opaque;
10675|  7.36k|    return TRUE;
10676|  7.36k|}
quickjs.c:js_find_loaded_module:
29881|     34|{
29882|     34|    struct list_head *el;
29883|     34|    JSModuleDef *m;
29884|       |
29885|       |    /* first look at the loaded modules */
29886|     51|    list_for_each(el, &ctx->loaded_modules) {
  ------------------
  |  |   86|     51|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 51, False: 0]
  |  |  ------------------
  ------------------
29887|     51|        m = list_entry(el, JSModuleDef, link);
  ------------------
  |  |   39|     51|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|     51|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
29888|     51|        if (m->module_name == name)
  ------------------
  |  Branch (29888:13): [True: 34, False: 17]
  ------------------
29889|     34|            return m;
29890|     51|    }
29891|      0|    return NULL;
29892|     34|}
quickjs.c:check_function:
39402|     97|{
39403|     97|    if (likely(JS_IsFunction(ctx, obj)))
  ------------------
  |  |   32|     97|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 97, False: 0]
  |  |  ------------------
  ------------------
39404|     97|        return 0;
39405|      0|    JS_ThrowTypeError(ctx, "not a function");
39406|      0|    return -1;
39407|     97|}
quickjs.c:JS_NewRegexp:
47418|      2|{
47419|      2|    JSValue obj;
47420|      2|    JSProperty props[1];
47421|      2|    JSObject *p;
47422|      2|    JSRegExp *re;
47423|       |
47424|       |    /* sanity check */
47425|      2|    if (unlikely(JS_VALUE_GET_TAG(bc) != JS_TAG_STRING ||
  ------------------
  |  |   33|      4|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  |  Branch (33:45): [True: 0, False: 2]
  |  |  |  Branch (33:45): [True: 0, False: 2]
  |  |  ------------------
  ------------------
47426|      2|                 JS_VALUE_GET_TAG(pattern) != JS_TAG_STRING)) {
47427|      0|        JS_ThrowTypeError(ctx, "string expected");
47428|      0|        goto fail;
47429|      0|    }
47430|      2|    props[0].u.value = JS_NewInt32(ctx, 0); /* lastIndex */
47431|      2|    obj = JS_NewObjectFromShape(ctx, js_dup_shape(ctx->regexp_shape), JS_CLASS_REGEXP, props);
47432|      2|    if (JS_IsException(obj))
  ------------------
  |  Branch (47432:9): [True: 0, False: 2]
  ------------------
47433|      0|        goto fail;
47434|      2|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47435|      2|    re = &p->u.regexp;
47436|      2|    re->pattern = JS_VALUE_GET_STRING(pattern);
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47437|      2|    re->bytecode = JS_VALUE_GET_STRING(bc);
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47438|      2|    return obj;
47439|      0| fail:
47440|      0|    JS_FreeValue(ctx, bc);
47441|      0|    JS_FreeValue(ctx, pattern);
47442|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47443|      2|}
quickjs.c:js_for_in_start:
16347|      2|{
16348|      2|    sp[-1] = build_for_in_iterator(ctx, sp[-1]);
16349|      2|    if (JS_IsException(sp[-1]))
  ------------------
  |  Branch (16349:9): [True: 0, False: 2]
  ------------------
16350|      0|        return -1;
16351|      2|    return 0;
16352|      2|}
quickjs.c:build_for_in_iterator:
16283|      2|{
16284|      2|    JSObject *p, *p1;
16285|      2|    JSPropertyEnum *tab_atom;
16286|      2|    int i;
16287|      2|    JSValue enum_obj;
16288|      2|    JSForInIterator *it;
16289|      2|    uint32_t tag, tab_atom_count;
16290|       |
16291|      2|    tag = JS_VALUE_GET_TAG(obj);
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
16292|      2|    if (tag != JS_TAG_OBJECT && tag != JS_TAG_NULL && tag != JS_TAG_UNDEFINED) {
  ------------------
  |  Branch (16292:9): [True: 2, False: 0]
  |  Branch (16292:33): [True: 2, False: 0]
  |  Branch (16292:55): [True: 2, False: 0]
  ------------------
16293|      2|        obj = JS_ToObjectFree(ctx, obj);
16294|      2|    }
16295|       |
16296|      2|    it = js_malloc(ctx, sizeof(*it));
16297|      2|    if (!it) {
  ------------------
  |  Branch (16297:9): [True: 0, False: 2]
  ------------------
16298|      0|        JS_FreeValue(ctx, obj);
16299|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16300|      0|    }
16301|      2|    enum_obj = JS_NewObjectProtoClass(ctx, JS_NULL, JS_CLASS_FOR_IN_ITERATOR);
  ------------------
  |  |  290|      2|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16302|      2|    if (JS_IsException(enum_obj)) {
  ------------------
  |  Branch (16302:9): [True: 0, False: 2]
  ------------------
16303|      0|        js_free(ctx, it);
16304|      0|        JS_FreeValue(ctx, obj);
16305|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16306|      0|    }
16307|      2|    it->is_array = FALSE;
16308|      2|    it->obj = obj;
16309|      2|    it->idx = 0;
16310|      2|    it->tab_atom = NULL;
16311|      2|    it->atom_count = 0;
16312|      2|    it->in_prototype_chain = FALSE;
16313|      2|    p1 = JS_VALUE_GET_OBJ(enum_obj);
  ------------------
  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16314|      2|    p1->u.for_in_iterator = it;
16315|       |
16316|      2|    if (tag == JS_TAG_NULL || tag == JS_TAG_UNDEFINED)
  ------------------
  |  Branch (16316:9): [True: 0, False: 2]
  |  Branch (16316:31): [True: 0, False: 2]
  ------------------
16317|      0|        return enum_obj;
16318|       |
16319|      2|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16320|      2|    if (p->fast_array) {
  ------------------
  |  Branch (16320:9): [True: 0, False: 2]
  ------------------
16321|      0|        JSShape *sh;
16322|      0|        JSShapeProperty *prs;
16323|       |        /* check that there are no enumerable normal fields */
16324|      0|        sh = p->shape;
16325|      0|        for(i = 0, prs = get_shape_prop(sh); i < sh->prop_count; i++, prs++) {
  ------------------
  |  Branch (16325:46): [True: 0, False: 0]
  ------------------
16326|      0|            if (prs->flags & JS_PROP_ENUMERABLE)
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
  |  Branch (16326:17): [True: 0, False: 0]
  ------------------
16327|      0|                goto normal_case;
16328|      0|        }
16329|       |        /* for fast arrays, we only store the number of elements */
16330|      0|        it->is_array = TRUE;
16331|      0|        it->atom_count = p->u.array.count;
16332|      2|    } else {
16333|      2|    normal_case:
16334|      2|        if (JS_GetOwnPropertyNamesInternal(ctx, &tab_atom, &tab_atom_count, p,
  ------------------
  |  Branch (16334:13): [True: 0, False: 2]
  ------------------
16335|      2|                                           JS_GPN_STRING_MASK | JS_GPN_SET_ENUM)) {
  ------------------
  |  |  810|      2|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
                                                         JS_GPN_STRING_MASK | JS_GPN_SET_ENUM)) {
  ------------------
  |  |  816|      2|#define JS_GPN_SET_ENUM     (1 << 5)
  ------------------
16336|      0|            JS_FreeValue(ctx, enum_obj);
16337|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16338|      0|        }
16339|      2|        it->tab_atom = tab_atom;
16340|      2|        it->atom_count = tab_atom_count;
16341|      2|    }
16342|      2|    return enum_obj;
16343|      2|}
quickjs.c:JS_ToObjectFree:
39841|      2|{
39842|      2|    JSValue obj = JS_ToObject(ctx, val);
39843|      2|    JS_FreeValue(ctx, val);
39844|      2|    return obj;
39845|      2|}
quickjs.c:js_for_in_next:
16419|      2|{
16420|      2|    JSValueConst enum_obj;
  ------------------
  |  |  234|      2|#define JSValueConst JSValue
  ------------------
16421|      2|    JSObject *p;
16422|      2|    JSAtom prop;
16423|      2|    JSForInIterator *it;
16424|      2|    JSPropertyEnum *tab_atom;
16425|      2|    uint32_t tab_atom_count;
16426|      2|    int ret;
16427|       |
16428|      2|    enum_obj = sp[-1];
16429|       |    /* fail safe */
16430|      2|    if (JS_VALUE_GET_TAG(enum_obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (16430:9): [True: 0, False: 2]
  ------------------
16431|      0|        goto done;
16432|      2|    p = JS_VALUE_GET_OBJ(enum_obj);
  ------------------
  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16433|      2|    if (p->class_id != JS_CLASS_FOR_IN_ITERATOR)
  ------------------
  |  Branch (16433:9): [True: 0, False: 2]
  ------------------
16434|      0|        goto done;
16435|      2|    it = p->u.for_in_iterator;
16436|       |
16437|      2|    for(;;) {
16438|      2|        if (it->idx >= it->atom_count) {
  ------------------
  |  Branch (16438:13): [True: 2, False: 0]
  ------------------
16439|      2|            if (JS_IsNull(it->obj) || JS_IsUndefined(it->obj))
  ------------------
  |  Branch (16439:17): [True: 0, False: 2]
  |  Branch (16439:39): [True: 0, False: 2]
  ------------------
16440|      0|                goto done; /* not an object */
16441|       |            /* no more property in the current object: look in the prototype */
16442|      2|            if (!it->in_prototype_chain) {
  ------------------
  |  Branch (16442:17): [True: 2, False: 0]
  ------------------
16443|      2|                ret = js_for_in_prepare_prototype_chain_enum(ctx, enum_obj);
16444|      2|                if (ret < 0)
  ------------------
  |  Branch (16444:21): [True: 0, False: 2]
  ------------------
16445|      0|                    return -1;
16446|      2|                if (ret)
  ------------------
  |  Branch (16446:21): [True: 2, False: 0]
  ------------------
16447|      2|                    goto done;
16448|      0|                it->in_prototype_chain = TRUE;
16449|      0|            }
16450|      0|            it->obj = JS_GetPrototypeFree(ctx, it->obj);
16451|      0|            if (JS_IsException(it->obj))
  ------------------
  |  Branch (16451:17): [True: 0, False: 0]
  ------------------
16452|      0|                return -1;
16453|      0|            if (JS_IsNull(it->obj))
  ------------------
  |  Branch (16453:17): [True: 0, False: 0]
  ------------------
16454|      0|                goto done; /* no more prototype */
16455|       |
16456|       |            /* must check for timeout to avoid infinite loop */
16457|      0|            if (js_poll_interrupts(ctx))
  ------------------
  |  Branch (16457:17): [True: 0, False: 0]
  ------------------
16458|      0|                return -1;
16459|       |
16460|      0|            if (JS_GetOwnPropertyNamesInternal(ctx, &tab_atom, &tab_atom_count,
  ------------------
  |  Branch (16460:17): [True: 0, False: 0]
  ------------------
16461|      0|                                               JS_VALUE_GET_OBJ(it->obj),
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16462|      0|                                               JS_GPN_STRING_MASK | JS_GPN_SET_ENUM)) {
  ------------------
  |  |  810|      0|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
                                                             JS_GPN_STRING_MASK | JS_GPN_SET_ENUM)) {
  ------------------
  |  |  816|      0|#define JS_GPN_SET_ENUM     (1 << 5)
  ------------------
16463|      0|                return -1;
16464|      0|            }
16465|      0|            JS_FreePropertyEnum(ctx, it->tab_atom, it->atom_count);
16466|      0|            it->tab_atom = tab_atom;
16467|      0|            it->atom_count = tab_atom_count;
16468|      0|            it->idx = 0;
16469|      0|        } else {
16470|      0|            if (it->is_array) {
  ------------------
  |  Branch (16470:17): [True: 0, False: 0]
  ------------------
16471|      0|                prop = __JS_AtomFromUInt32(it->idx);
16472|      0|                it->idx++;
16473|      0|            } else {
16474|      0|                BOOL is_enumerable;
16475|      0|                prop = it->tab_atom[it->idx].atom;
16476|      0|                is_enumerable = it->tab_atom[it->idx].is_enumerable;
16477|      0|                it->idx++;
16478|      0|                if (it->in_prototype_chain) {
  ------------------
  |  Branch (16478:21): [True: 0, False: 0]
  ------------------
16479|       |                    /* slow case: we are in the prototype chain */
16480|      0|                    ret = JS_GetOwnPropertyInternal(ctx, NULL, JS_VALUE_GET_OBJ(enum_obj), prop);
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16481|      0|                    if (ret < 0)
  ------------------
  |  Branch (16481:25): [True: 0, False: 0]
  ------------------
16482|      0|                        return ret;
16483|      0|                    if (ret)
  ------------------
  |  Branch (16483:25): [True: 0, False: 0]
  ------------------
16484|      0|                        continue; /* already visited */
16485|       |                    /* add to the visited property list */
16486|      0|                    if (JS_DefinePropertyValue(ctx, enum_obj, prop, JS_NULL,
  ------------------
  |  |  290|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
  |  Branch (16486:25): [True: 0, False: 0]
  ------------------
16487|      0|                                               JS_PROP_ENUMERABLE) < 0)
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
16488|      0|                        return -1;
16489|      0|                }
16490|      0|                if (!is_enumerable)
  ------------------
  |  Branch (16490:21): [True: 0, False: 0]
  ------------------
16491|      0|                    continue;
16492|      0|            }
16493|       |            /* check if the property was deleted */
16494|      0|            ret = JS_GetOwnPropertyInternal(ctx, NULL, JS_VALUE_GET_OBJ(it->obj), prop);
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16495|      0|            if (ret < 0)
  ------------------
  |  Branch (16495:17): [True: 0, False: 0]
  ------------------
16496|      0|                return ret;
16497|      0|            if (ret)
  ------------------
  |  Branch (16497:17): [True: 0, False: 0]
  ------------------
16498|      0|                break;
16499|      0|        }
16500|      2|    }
16501|       |    /* return the property */
16502|      0|    sp[0] = JS_AtomToValue(ctx, prop);
16503|      0|    sp[1] = JS_FALSE;
  ------------------
  |  |  292|      0|#define JS_FALSE     JS_MKVAL(JS_TAG_BOOL, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16504|      0|    return 0;
16505|      2| done:
16506|       |    /* return the end */
16507|      2|    sp[0] = JS_UNDEFINED;
  ------------------
  |  |  291|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16508|      2|    sp[1] = JS_TRUE;
  ------------------
  |  |  293|      2|#define JS_TRUE      JS_MKVAL(JS_TAG_BOOL, 1)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16509|      2|    return 0;
16510|      2|}
quickjs.c:js_for_in_prepare_prototype_chain_enum:
16357|      2|{
16358|      2|    JSObject *p;
16359|      2|    JSForInIterator *it;
16360|      2|    JSPropertyEnum *tab_atom;
16361|      2|    uint32_t tab_atom_count, i;
16362|      2|    JSValue obj1;
16363|       |
16364|      2|    p = JS_VALUE_GET_OBJ(enum_obj);
  ------------------
  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16365|      2|    it = p->u.for_in_iterator;
16366|       |
16367|       |    /* check if there are enumerable properties in the prototype chain (fast path) */
16368|      2|    obj1 = JS_DupValue(ctx, it->obj);
16369|      6|    for(;;) {
16370|      6|        obj1 = JS_GetPrototypeFree(ctx, obj1);
16371|      6|        if (JS_IsNull(obj1))
  ------------------
  |  Branch (16371:13): [True: 2, False: 4]
  ------------------
16372|      2|            break;
16373|      4|        if (JS_IsException(obj1))
  ------------------
  |  Branch (16373:13): [True: 0, False: 4]
  ------------------
16374|      0|            goto fail;
16375|      4|        if (JS_GetOwnPropertyNamesInternal(ctx, &tab_atom, &tab_atom_count,
  ------------------
  |  Branch (16375:13): [True: 0, False: 4]
  ------------------
16376|      4|                                           JS_VALUE_GET_OBJ(obj1),
  ------------------
  |  |  229|      4|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      4|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16377|      4|                                           JS_GPN_STRING_MASK | JS_GPN_ENUM_ONLY)) {
  ------------------
  |  |  810|      4|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
                                                         JS_GPN_STRING_MASK | JS_GPN_ENUM_ONLY)) {
  ------------------
  |  |  814|      4|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
16378|      0|            JS_FreeValue(ctx, obj1);
16379|      0|            goto fail;
16380|      0|        }
16381|      4|        JS_FreePropertyEnum(ctx, tab_atom, tab_atom_count);
16382|      4|        if (tab_atom_count != 0) {
  ------------------
  |  Branch (16382:13): [True: 0, False: 4]
  ------------------
16383|      0|            JS_FreeValue(ctx, obj1);
16384|      0|            goto slow_path;
16385|      0|        }
16386|       |        /* must check for timeout to avoid infinite loop */
16387|      4|        if (js_poll_interrupts(ctx)) {
  ------------------
  |  Branch (16387:13): [True: 0, False: 4]
  ------------------
16388|      0|            JS_FreeValue(ctx, obj1);
16389|      0|            goto fail;
16390|      0|        }
16391|      4|    }
16392|      2|    JS_FreeValue(ctx, obj1);
16393|      2|    return 1;
16394|       |
16395|      0| slow_path:
16396|       |    /* add the visited properties, even if they are not enumerable */
16397|      0|    if (it->is_array) {
  ------------------
  |  Branch (16397:9): [True: 0, False: 0]
  ------------------
16398|      0|        if (JS_GetOwnPropertyNamesInternal(ctx, &tab_atom, &tab_atom_count,
  ------------------
  |  Branch (16398:13): [True: 0, False: 0]
  ------------------
16399|      0|                                           JS_VALUE_GET_OBJ(it->obj),
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16400|      0|                                           JS_GPN_STRING_MASK | JS_GPN_SET_ENUM)) {
  ------------------
  |  |  810|      0|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
                                                         JS_GPN_STRING_MASK | JS_GPN_SET_ENUM)) {
  ------------------
  |  |  816|      0|#define JS_GPN_SET_ENUM     (1 << 5)
  ------------------
16401|      0|            goto fail;
16402|      0|        }
16403|      0|        it->is_array = FALSE;
16404|      0|        it->tab_atom = tab_atom;
16405|      0|        it->atom_count = tab_atom_count;
16406|      0|    }
16407|       |
16408|      0|    for(i = 0; i < it->atom_count; i++) {
  ------------------
  |  Branch (16408:16): [True: 0, False: 0]
  ------------------
16409|      0|        if (JS_DefinePropertyValue(ctx, enum_obj, it->tab_atom[i].atom, JS_NULL, JS_PROP_ENUMERABLE) < 0)
  ------------------
  |  |  290|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
                      if (JS_DefinePropertyValue(ctx, enum_obj, it->tab_atom[i].atom, JS_NULL, JS_PROP_ENUMERABLE) < 0)
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
  |  Branch (16409:13): [True: 0, False: 0]
  ------------------
16410|      0|            goto fail;
16411|      0|    }
16412|      0|    return 0;
16413|      0| fail:
16414|      0|    return -1;
16415|      0|}
quickjs.c:js_for_of_start:
16681|      1|{
16682|      1|    JSValue op1, obj, method;
16683|      1|    op1 = sp[-1];
16684|      1|    obj = JS_GetIterator(ctx, op1, is_async);
16685|      1|    if (JS_IsException(obj))
  ------------------
  |  Branch (16685:9): [True: 0, False: 1]
  ------------------
16686|      0|        return -1;
16687|      1|    JS_FreeValue(ctx, op1);
16688|      1|    sp[-1] = obj;
16689|      1|    method = JS_GetProperty(ctx, obj, JS_ATOM_next);
16690|      1|    if (JS_IsException(method))
  ------------------
  |  Branch (16690:9): [True: 0, False: 1]
  ------------------
16691|      0|        return -1;
16692|      1|    sp[0] = method;
16693|      1|    return 0;
16694|      1|}
quickjs.c:JS_GetIterator:
16528|      1|{
16529|      1|    JSValue method, ret, sync_iter;
16530|       |
16531|      1|    if (is_async) {
  ------------------
  |  Branch (16531:9): [True: 0, False: 1]
  ------------------
16532|      0|        method = JS_GetProperty(ctx, obj, JS_ATOM_Symbol_asyncIterator);
16533|      0|        if (JS_IsException(method))
  ------------------
  |  Branch (16533:13): [True: 0, False: 0]
  ------------------
16534|      0|            return method;
16535|      0|        if (JS_IsUndefined(method) || JS_IsNull(method)) {
  ------------------
  |  Branch (16535:13): [True: 0, False: 0]
  |  Branch (16535:39): [True: 0, False: 0]
  ------------------
16536|      0|            method = JS_GetProperty(ctx, obj, JS_ATOM_Symbol_iterator);
16537|      0|            if (JS_IsException(method))
  ------------------
  |  Branch (16537:17): [True: 0, False: 0]
  ------------------
16538|      0|                return method;
16539|      0|            sync_iter = JS_GetIterator2(ctx, obj, method);
16540|      0|            JS_FreeValue(ctx, method);
16541|      0|            if (JS_IsException(sync_iter))
  ------------------
  |  Branch (16541:17): [True: 0, False: 0]
  ------------------
16542|      0|                return sync_iter;
16543|      0|            ret = JS_CreateAsyncFromSyncIterator(ctx, sync_iter);
16544|      0|            JS_FreeValue(ctx, sync_iter);
16545|      0|            return ret;
16546|      0|        }
16547|      1|    } else {
16548|      1|        method = JS_GetProperty(ctx, obj, JS_ATOM_Symbol_iterator);
16549|      1|        if (JS_IsException(method))
  ------------------
  |  Branch (16549:13): [True: 0, False: 1]
  ------------------
16550|      0|            return method;
16551|      1|    }
16552|      1|    if (!JS_IsFunction(ctx, method)) {
  ------------------
  |  Branch (16552:9): [True: 0, False: 1]
  ------------------
16553|      0|        JS_FreeValue(ctx, method);
16554|      0|        return JS_ThrowTypeError(ctx, "value is not iterable");
16555|      0|    }
16556|      1|    ret = JS_GetIterator2(ctx, obj, method);
16557|      1|    JS_FreeValue(ctx, method);
16558|      1|    return ret;
16559|      1|}
quickjs.c:JS_GetIterator2:
16514|      1|{
16515|      1|    JSValue enum_obj;
16516|       |
16517|      1|    enum_obj = JS_Call(ctx, method, obj, 0, NULL);
16518|      1|    if (JS_IsException(enum_obj))
  ------------------
  |  Branch (16518:9): [True: 0, False: 1]
  ------------------
16519|      0|        return enum_obj;
16520|      1|    if (!JS_IsObject(enum_obj)) {
  ------------------
  |  Branch (16520:9): [True: 0, False: 1]
  ------------------
16521|      0|        JS_FreeValue(ctx, enum_obj);
16522|      0|        return JS_ThrowTypeErrorNotAnObject(ctx);
16523|      0|    }
16524|      1|    return enum_obj;
16525|      1|}
quickjs.c:js_for_of_next:
16701|      2|{
16702|      2|    JSValue value = JS_UNDEFINED;
  ------------------
  |  |  291|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16703|      2|    int done = 1;
16704|       |
16705|      2|    if (likely(!JS_IsUndefined(sp[offset]))) {
  ------------------
  |  |   32|      2|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 2, False: 0]
  |  |  ------------------
  ------------------
16706|      2|        value = JS_IteratorNext(ctx, sp[offset], sp[offset + 1], 0, NULL, &done);
16707|      2|        if (JS_IsException(value))
  ------------------
  |  Branch (16707:13): [True: 0, False: 2]
  ------------------
16708|      0|            done = -1;
16709|      2|        if (done) {
  ------------------
  |  Branch (16709:13): [True: 0, False: 2]
  ------------------
16710|       |            /* value is JS_UNDEFINED or JS_EXCEPTION */
16711|       |            /* replace the iteration object with undefined */
16712|      0|            JS_FreeValue(ctx, sp[offset]);
16713|      0|            sp[offset] = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16714|      0|            if (done < 0) {
  ------------------
  |  Branch (16714:17): [True: 0, False: 0]
  ------------------
16715|      0|                return -1;
16716|      0|            } else {
16717|      0|                JS_FreeValue(ctx, value);
16718|      0|                value = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16719|      0|            }
16720|      0|        }
16721|      2|    }
16722|      2|    sp[0] = value;
16723|      2|    sp[1] = JS_NewBool(ctx, done);
16724|      2|    return 0;
16725|      2|}
quickjs.c:JS_IteratorNext:
16606|      2|{
16607|      2|    JSValue obj, value, done_val;
16608|      2|    int done;
16609|       |
16610|      2|    obj = JS_IteratorNext2(ctx, enum_obj, method, argc, argv, &done);
16611|      2|    if (JS_IsException(obj))
  ------------------
  |  Branch (16611:9): [True: 0, False: 2]
  ------------------
16612|      0|        goto fail;
16613|      2|    if (likely(done == 0)) {
  ------------------
  |  |   32|      2|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 2, False: 0]
  |  |  ------------------
  ------------------
16614|      2|        *pdone = FALSE;
16615|      2|        return obj;
16616|      2|    } else if (done != 2) {
  ------------------
  |  Branch (16616:16): [True: 0, False: 0]
  ------------------
16617|      0|        JS_FreeValue(ctx, obj);
16618|      0|        *pdone = TRUE;
16619|      0|        return JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16620|      0|    } else {
16621|      0|        done_val = JS_GetProperty(ctx, obj, JS_ATOM_done);
16622|      0|        if (JS_IsException(done_val))
  ------------------
  |  Branch (16622:13): [True: 0, False: 0]
  ------------------
16623|      0|            goto fail;
16624|      0|        *pdone = JS_ToBoolFree(ctx, done_val);
16625|      0|        value = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16626|      0|        if (!*pdone) {
  ------------------
  |  Branch (16626:13): [True: 0, False: 0]
  ------------------
16627|      0|            value = JS_GetProperty(ctx, obj, JS_ATOM_value);
16628|      0|        }
16629|      0|        JS_FreeValue(ctx, obj);
16630|      0|        return value;
16631|      0|    }
16632|      0| fail:
16633|      0|    JS_FreeValue(ctx, obj);
16634|      0|    *pdone = FALSE;
16635|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16636|      2|}
quickjs.c:JS_IteratorNext2:
16565|      2|{
16566|      2|    JSValue obj;
16567|       |
16568|       |    /* fast path for the built-in iterators (avoid creating the
16569|       |       intermediate result object) */
16570|      2|    if (JS_IsObject(method)) {
  ------------------
  |  Branch (16570:9): [True: 2, False: 0]
  ------------------
16571|      2|        JSObject *p = JS_VALUE_GET_OBJ(method);
  ------------------
  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16572|      2|        if (p->class_id == JS_CLASS_C_FUNCTION &&
  ------------------
  |  Branch (16572:13): [True: 2, False: 0]
  ------------------
16573|      2|            p->u.cfunc.cproto == JS_CFUNC_iterator_next) {
  ------------------
  |  Branch (16573:13): [True: 2, False: 0]
  ------------------
16574|      2|            JSCFunctionType func;
16575|      2|            JSValueConst args[1];
  ------------------
  |  |  234|      2|#define JSValueConst JSValue
  ------------------
16576|       |
16577|       |            /* in case the function expects one argument */
16578|      2|            if (argc == 0) {
  ------------------
  |  Branch (16578:17): [True: 2, False: 0]
  ------------------
16579|      2|                args[0] = JS_UNDEFINED;
  ------------------
  |  |  291|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16580|      2|                argv = args;
16581|      2|            }
16582|      2|            func = p->u.cfunc.c_function;
16583|      2|            return func.iterator_next(ctx, enum_obj, argc, argv,
16584|      2|                                      pdone, p->u.cfunc.magic);
16585|      2|        }
16586|      2|    }
16587|      0|    obj = JS_Call(ctx, method, enum_obj, argc, argv);
16588|      0|    if (JS_IsException(obj))
  ------------------
  |  Branch (16588:9): [True: 0, False: 0]
  ------------------
16589|      0|        goto fail;
16590|      0|    if (!JS_IsObject(obj)) {
  ------------------
  |  Branch (16590:9): [True: 0, False: 0]
  ------------------
16591|      0|        JS_FreeValue(ctx, obj);
16592|      0|        JS_ThrowTypeError(ctx, "iterator must return an object");
16593|      0|        goto fail;
16594|      0|    }
16595|      0|    *pdone = 2;
16596|      0|    return obj;
16597|      0| fail:
16598|      0|    *pdone = FALSE;
16599|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16600|      0|}
quickjs.c:JS_DefineObjectName:
10779|      2|{
10780|      2|    if (name != JS_ATOM_NULL
  ------------------
  |  |  451|      4|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (10780:9): [True: 2, False: 0]
  ------------------
10781|      2|    &&  JS_IsObject(obj)
  ------------------
  |  Branch (10781:9): [True: 2, False: 0]
  ------------------
10782|      2|    &&  !js_object_has_name(ctx, obj)
  ------------------
  |  Branch (10782:9): [True: 2, False: 0]
  ------------------
10783|      2|    &&  JS_DefinePropertyValue(ctx, obj, JS_ATOM_name, JS_AtomToString(ctx, name), flags) < 0) {
  ------------------
  |  Branch (10783:9): [True: 0, False: 2]
  ------------------
10784|      0|        return -1;
10785|      0|    }
10786|      2|    return 0;
10787|      2|}
quickjs.c:js_object_has_name:
10759|      2|{
10760|      2|    JSProperty *pr;
10761|      2|    JSShapeProperty *prs;
10762|      2|    JSValueConst val;
  ------------------
  |  |  234|      2|#define JSValueConst JSValue
  ------------------
10763|      2|    JSString *p;
10764|       |
10765|      2|    prs = find_own_property(&pr, JS_VALUE_GET_OBJ(obj), JS_ATOM_name);
  ------------------
  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10766|      2|    if (!prs)
  ------------------
  |  Branch (10766:9): [True: 0, False: 2]
  ------------------
10767|      0|        return FALSE;
10768|      2|    if ((prs->flags & JS_PROP_TMASK) != JS_PROP_NORMAL)
  ------------------
  |  |  303|      2|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                  if ((prs->flags & JS_PROP_TMASK) != JS_PROP_NORMAL)
  ------------------
  |  |  304|      2|#define JS_PROP_NORMAL         (0 << 4)
  ------------------
  |  Branch (10768:9): [True: 0, False: 2]
  ------------------
10769|      0|        return TRUE;
10770|      2|    val = pr->u.value;
10771|      2|    if (JS_VALUE_GET_TAG(val) != JS_TAG_STRING)
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10771:9): [True: 0, False: 2]
  ------------------
10772|      0|        return TRUE;
10773|      2|    p = JS_VALUE_GET_STRING(val);
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10774|      2|    return (p->len != 0);
10775|      2|}
quickjs.c:JS_ConcatString3:
 4416|      2|{
 4417|      2|    StringBuffer b_s, *b = &b_s;
 4418|      2|    int len1, len3;
 4419|      2|    JSString *p;
 4420|       |
 4421|      2|    if (unlikely(JS_VALUE_GET_TAG(str2) != JS_TAG_STRING)) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 4422|      0|        str2 = JS_ToStringFree(ctx, str2);
 4423|      0|        if (JS_IsException(str2))
  ------------------
  |  Branch (4423:13): [True: 0, False: 0]
  ------------------
 4424|      0|            goto fail;
 4425|      0|    }
 4426|      2|    p = JS_VALUE_GET_STRING(str2);
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4427|      2|    len1 = strlen(str1);
 4428|      2|    len3 = strlen(str3);
 4429|       |
 4430|      2|    if (string_buffer_init2(ctx, b, len1 + p->len + len3, p->is_wide_char))
  ------------------
  |  Branch (4430:9): [True: 0, False: 2]
  ------------------
 4431|      0|        goto fail;
 4432|       |
 4433|      2|    string_buffer_write8(b, (const uint8_t *)str1, len1);
 4434|      2|    string_buffer_concat(b, p, 0, p->len);
 4435|      2|    string_buffer_write8(b, (const uint8_t *)str3, len3);
 4436|       |
 4437|      2|    JS_FreeValue(ctx, str2);
 4438|      2|    return string_buffer_end(b);
 4439|       |
 4440|      0| fail:
 4441|      0|    JS_FreeValue(ctx, str2);
 4442|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 4443|      2|}
quickjs.c:js_create_array_iterator:
43366|      1|{
43367|      1|    JSValue enum_obj, arr;
43368|      1|    JSArrayIteratorData *it;
43369|      1|    JSIteratorKindEnum kind;
43370|      1|    int class_id;
43371|       |
43372|      1|    kind = magic & 3;
43373|      1|    if (magic & 4) {
  ------------------
  |  Branch (43373:9): [True: 1, False: 0]
  ------------------
43374|       |        /* string iterator case */
43375|      1|        arr = JS_ToStringCheckObject(ctx, this_val);
43376|      1|        class_id = JS_CLASS_STRING_ITERATOR;
43377|      1|    } else {
43378|      0|        arr = JS_ToObject(ctx, this_val);
43379|      0|        class_id = JS_CLASS_ARRAY_ITERATOR;
43380|      0|    }
43381|      1|    if (JS_IsException(arr))
  ------------------
  |  Branch (43381:9): [True: 0, False: 1]
  ------------------
43382|      0|        goto fail;
43383|      1|    enum_obj = JS_NewObjectClass(ctx, class_id);
43384|      1|    if (JS_IsException(enum_obj))
  ------------------
  |  Branch (43384:9): [True: 0, False: 1]
  ------------------
43385|      0|        goto fail;
43386|      1|    it = js_malloc(ctx, sizeof(*it));
43387|      1|    if (!it)
  ------------------
  |  Branch (43387:9): [True: 0, False: 1]
  ------------------
43388|      0|        goto fail1;
43389|      1|    it->obj = arr;
43390|      1|    it->kind = kind;
43391|      1|    it->idx = 0;
43392|      1|    JS_SetOpaque(enum_obj, it);
43393|      1|    return enum_obj;
43394|      0| fail1:
43395|      0|    JS_FreeValue(ctx, enum_obj);
43396|      0| fail:
43397|      0|    JS_FreeValue(ctx, arr);
43398|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
43399|      0|}
quickjs.c:JS_ToStringCheckObject:
13671|      1|{
13672|      1|    uint32_t tag = JS_VALUE_GET_TAG(val);
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
13673|      1|    if (tag == JS_TAG_NULL || tag == JS_TAG_UNDEFINED)
  ------------------
  |  Branch (13673:9): [True: 0, False: 1]
  |  Branch (13673:31): [True: 0, False: 1]
  ------------------
13674|      0|        return JS_ThrowTypeError(ctx, "null or undefined are forbidden");
13675|      1|    return JS_ToString(ctx, val);
13676|      1|}
quickjs.c:JS_ConcatString:
 5043|      2|{
 5044|      2|    JSString *p1, *p2;
 5045|       |
 5046|      2|    if (unlikely(JS_VALUE_GET_TAG(op1) != JS_TAG_STRING &&
  ------------------
  |  |   33|      3|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1, False: 1]
  |  |  |  Branch (33:45): [True: 1, False: 1]
  |  |  |  Branch (33:45): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 5047|      2|                 JS_VALUE_GET_TAG(op1) != JS_TAG_STRING_ROPE)) {
 5048|      1|        op1 = JS_ToStringFree(ctx, op1);
 5049|      1|        if (JS_IsException(op1)) {
  ------------------
  |  Branch (5049:13): [True: 0, False: 1]
  ------------------
 5050|      0|            JS_FreeValue(ctx, op2);
 5051|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 5052|      0|        }
 5053|      1|    }
 5054|      2|    if (unlikely(JS_VALUE_GET_TAG(op2) != JS_TAG_STRING &&
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  |  Branch (33:45): [True: 0, False: 2]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5055|      2|                 JS_VALUE_GET_TAG(op2) != JS_TAG_STRING_ROPE)) {
 5056|      0|        op2 = JS_ToStringFree(ctx, op2);
 5057|      0|        if (JS_IsException(op2)) {
  ------------------
  |  Branch (5057:13): [True: 0, False: 0]
  ------------------
 5058|      0|            JS_FreeValue(ctx, op1);
 5059|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 5060|      0|        }
 5061|      0|    }
 5062|       |
 5063|       |    /* normal concatenation for short strings */
 5064|      2|    if (JS_VALUE_GET_TAG(op2) == JS_TAG_STRING) {
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5064:9): [True: 2, False: 0]
  ------------------
 5065|      2|        p2 = JS_VALUE_GET_STRING(op2);
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5066|      2|        if (p2->len == 0) {
  ------------------
  |  Branch (5066:13): [True: 1, False: 1]
  ------------------
 5067|      1|            JS_FreeValue(ctx, op2);
 5068|      1|            return op1;
 5069|      1|        }
 5070|      1|        if (p2->len <= JS_STRING_ROPE_SHORT_LEN) {
  ------------------
  |  |  216|      1|#define JS_STRING_ROPE_SHORT_LEN  512
  ------------------
  |  Branch (5070:13): [True: 0, False: 1]
  ------------------
 5071|      0|            if (JS_VALUE_GET_TAG(op1) == JS_TAG_STRING) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5071:17): [True: 0, False: 0]
  ------------------
 5072|      0|                p1 = JS_VALUE_GET_STRING(op1);
  ------------------
  |  |  230|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5073|      0|                if (p1->len <= JS_STRING_ROPE_SHORT2_LEN) {
  ------------------
  |  |  218|      0|#define JS_STRING_ROPE_SHORT2_LEN 8192
  ------------------
  |  Branch (5073:21): [True: 0, False: 0]
  ------------------
 5074|      0|                    return JS_ConcatString2(ctx, op1, op2);
 5075|      0|                } else {
 5076|      0|                    return js_new_string_rope(ctx, op1, op2);
 5077|      0|                }
 5078|      0|            } else {
 5079|      0|                JSStringRope *r1;
 5080|      0|                r1 = JS_VALUE_GET_STRING_ROPE(op1);
  ------------------
  |  |  231|      0|#define JS_VALUE_GET_STRING_ROPE(v) ((JSStringRope *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5081|      0|                if (JS_VALUE_GET_TAG(r1->right) == JS_TAG_STRING &&
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5081:21): [True: 0, False: 0]
  ------------------
 5082|      0|                    JS_VALUE_GET_STRING(r1->right)->len <= JS_STRING_ROPE_SHORT_LEN) {
  ------------------
  |  |  230|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
                                  JS_VALUE_GET_STRING(r1->right)->len <= JS_STRING_ROPE_SHORT_LEN) {
  ------------------
  |  |  216|      0|#define JS_STRING_ROPE_SHORT_LEN  512
  ------------------
  |  Branch (5082:21): [True: 0, False: 0]
  ------------------
 5083|      0|                    JSValue val, ret;
 5084|      0|                    val = JS_ConcatString2(ctx, JS_DupValue(ctx, r1->right), op2);
 5085|      0|                    if (JS_IsException(val)) {
  ------------------
  |  Branch (5085:25): [True: 0, False: 0]
  ------------------
 5086|      0|                        JS_FreeValue(ctx, op1);
 5087|      0|                        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 5088|      0|                    }
 5089|      0|                    ret = js_new_string_rope(ctx, JS_DupValue(ctx, r1->left), val);
 5090|      0|                    JS_FreeValue(ctx, op1);
 5091|      0|                    return ret;
 5092|      0|                }
 5093|      0|            }
 5094|      0|        }
 5095|      1|    } else if (JS_VALUE_GET_TAG(op1) == JS_TAG_STRING) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5095:16): [True: 0, False: 0]
  ------------------
 5096|      0|        JSStringRope *r2;
 5097|      0|        p1 = JS_VALUE_GET_STRING(op1);
  ------------------
  |  |  230|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5098|      0|        if (p1->len == 0) {
  ------------------
  |  Branch (5098:13): [True: 0, False: 0]
  ------------------
 5099|      0|            JS_FreeValue(ctx, op1);
 5100|      0|            return op2;
 5101|      0|        }
 5102|      0|        r2 = JS_VALUE_GET_STRING_ROPE(op2);
  ------------------
  |  |  231|      0|#define JS_VALUE_GET_STRING_ROPE(v) ((JSStringRope *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5103|      0|        if (JS_VALUE_GET_TAG(r2->left) == JS_TAG_STRING &&
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5103:13): [True: 0, False: 0]
  ------------------
 5104|      0|            JS_VALUE_GET_STRING(r2->left)->len <= JS_STRING_ROPE_SHORT_LEN) {
  ------------------
  |  |  230|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
                          JS_VALUE_GET_STRING(r2->left)->len <= JS_STRING_ROPE_SHORT_LEN) {
  ------------------
  |  |  216|      0|#define JS_STRING_ROPE_SHORT_LEN  512
  ------------------
  |  Branch (5104:13): [True: 0, False: 0]
  ------------------
 5105|      0|            JSValue val, ret;
 5106|      0|            val = JS_ConcatString2(ctx, op1, JS_DupValue(ctx, r2->left));
 5107|      0|            if (JS_IsException(val)) {
  ------------------
  |  Branch (5107:17): [True: 0, False: 0]
  ------------------
 5108|      0|                JS_FreeValue(ctx, op2);
 5109|      0|                return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 5110|      0|            }
 5111|      0|            ret = js_new_string_rope(ctx, val, JS_DupValue(ctx, r2->right));
 5112|      0|            JS_FreeValue(ctx, op2);
 5113|      0|            return ret;
 5114|      0|        }
 5115|      0|    }
 5116|      1|    return js_new_string_rope(ctx, op1, op2);
 5117|      2|}
quickjs.c:js_new_string_rope:
 4869|      1|{
 4870|      1|    uint32_t len;
 4871|      1|    int is_wide_char, depth;
 4872|      1|    JSStringRope *r;
 4873|      1|    JSValue res;
 4874|       |    
 4875|      1|    if (JS_VALUE_GET_TAG(op1) == JS_TAG_STRING) {
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (4875:9): [True: 1, False: 0]
  ------------------
 4876|      1|        JSString *p1 = JS_VALUE_GET_STRING(op1);
  ------------------
  |  |  230|      1|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4877|      1|        len = p1->len;
 4878|      1|        is_wide_char = p1->is_wide_char;
 4879|      1|        depth = 0;
 4880|      1|    } else {
 4881|      0|        JSStringRope *r1 = JS_VALUE_GET_STRING_ROPE(op1);
  ------------------
  |  |  231|      0|#define JS_VALUE_GET_STRING_ROPE(v) ((JSStringRope *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4882|      0|        len = r1->len;
 4883|      0|        is_wide_char = r1->is_wide_char;
 4884|      0|        depth = r1->depth;
 4885|      0|    }
 4886|       |
 4887|      1|    if (JS_VALUE_GET_TAG(op2) == JS_TAG_STRING) {
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (4887:9): [True: 1, False: 0]
  ------------------
 4888|      1|        JSString *p2 = JS_VALUE_GET_STRING(op2);
  ------------------
  |  |  230|      1|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4889|      1|        len += p2->len;
 4890|      1|        is_wide_char |= p2->is_wide_char;
 4891|      1|    } else {
 4892|      0|        JSStringRope *r2 = JS_VALUE_GET_STRING_ROPE(op2);
  ------------------
  |  |  231|      0|#define JS_VALUE_GET_STRING_ROPE(v) ((JSStringRope *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4893|      0|        len += r2->len;
 4894|      0|        is_wide_char |= r2->is_wide_char;
 4895|      0|        depth = max_int(depth, r2->depth);
 4896|      0|    }
 4897|      1|    if (len > JS_STRING_LEN_MAX) {
  ------------------
  |  |  212|      1|#define JS_STRING_LEN_MAX ((1 << 30) - 1)
  ------------------
  |  Branch (4897:9): [True: 0, False: 1]
  ------------------
 4898|      0|        JS_ThrowInternalError(ctx, "string too long");
 4899|      0|        goto fail;
 4900|      0|    }
 4901|      1|    r = js_malloc(ctx, sizeof(*r));
 4902|      1|    if (!r)
  ------------------
  |  Branch (4902:9): [True: 0, False: 1]
  ------------------
 4903|      0|        goto fail;
 4904|      1|    js_rc(r)->ref_count = 1;
 4905|      1|    r->len = len;
 4906|      1|    r->is_wide_char = is_wide_char;
 4907|      1|    r->depth = depth + 1;
 4908|      1|    r->left = op1;
 4909|      1|    r->right = op2;
 4910|      1|    res = JS_MKPTR(JS_TAG_STRING_ROPE, r);
  ------------------
  |  |  248|      1|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 4911|      1|    if (r->depth > JS_STRING_ROPE_MAX_DEPTH) {
  ------------------
  |  |  220|      1|#define JS_STRING_ROPE_MAX_DEPTH 60
  ------------------
  |  Branch (4911:9): [True: 0, False: 1]
  ------------------
 4912|      0|        JSValue res2;
 4913|       |#ifdef DUMP_ROPE_REBALANCE
 4914|       |        printf("rebalance: initial depth=%d\n", r->depth);
 4915|       |#endif
 4916|      0|        res2 = js_rebalancee_string_rope(ctx, res);
 4917|       |#ifdef DUMP_ROPE_REBALANCE
 4918|       |        if (JS_VALUE_GET_TAG(res2) == JS_TAG_STRING_ROPE) 
 4919|       |            printf("rebalance: final depth=%d\n", JS_VALUE_GET_STRING_ROPE(res2)->depth);
 4920|       |#endif
 4921|      0|        JS_FreeValue(ctx, res);
 4922|      0|        return res2;
 4923|      1|    } else {
 4924|      1|        return res;
 4925|      1|    }
 4926|      0| fail:
 4927|      0|    JS_FreeValue(ctx, op1);
 4928|      0|    JS_FreeValue(ctx, op2);
 4929|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 4930|      1|}
quickjs.c:js_add_slow:
15099|      2|{
15100|      2|    JSValue op1, op2;
15101|      2|    uint32_t tag1, tag2;
15102|       |
15103|      2|    op1 = sp[-2];
15104|      2|    op2 = sp[-1];
15105|       |
15106|      2|    tag1 = JS_VALUE_GET_NORM_TAG(op1);
  ------------------
  |  |  238|      2|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
15107|      2|    tag2 = JS_VALUE_GET_NORM_TAG(op2);
  ------------------
  |  |  238|      2|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
15108|       |    /* fast path for float64 */
15109|      2|    if (tag1 == JS_TAG_FLOAT64 && tag2 == JS_TAG_FLOAT64) {
  ------------------
  |  Branch (15109:9): [True: 1, False: 1]
  |  Branch (15109:35): [True: 0, False: 1]
  ------------------
15110|      0|        double d1, d2;
15111|      0|        d1 = JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
15112|      0|        d2 = JS_VALUE_GET_FLOAT64(op2);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
15113|      0|        sp[-2] = __JS_NewFloat64(ctx, d1 + d2);
15114|      0|        return 0;
15115|      0|    }
15116|       |    /* fast path for short bigint */
15117|      2|    if (tag1 == JS_TAG_SHORT_BIG_INT && tag2 == JS_TAG_SHORT_BIG_INT) {
  ------------------
  |  Branch (15117:9): [True: 0, False: 2]
  |  Branch (15117:41): [True: 0, False: 0]
  ------------------
15118|      0|        js_slimb_t v1, v2;
15119|      0|        js_sdlimb_t v;
15120|      0|        v1 = JS_VALUE_GET_SHORT_BIG_INT(op1);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
15121|      0|        v2 = JS_VALUE_GET_SHORT_BIG_INT(op2);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
15122|      0|        v = (js_sdlimb_t)v1 + (js_sdlimb_t)v2;
15123|      0|        if (likely(v >= JS_SHORT_BIG_INT_MIN && v <= JS_SHORT_BIG_INT_MAX)) {
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
15124|      0|            sp[-2] = __JS_NewShortBigInt(ctx, v);
15125|      0|        } else {
15126|      0|            JSBigInt *r = js_bigint_new_di(ctx, v);
15127|      0|            if (!r)
  ------------------
  |  Branch (15127:17): [True: 0, False: 0]
  ------------------
15128|      0|                goto exception;
15129|      0|            sp[-2] = JS_MKPTR(JS_TAG_BIG_INT, r);
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
15130|      0|        }
15131|      0|        return 0;
15132|      0|    }
15133|       |    
15134|      2|    if (tag1 == JS_TAG_OBJECT || tag2 == JS_TAG_OBJECT) {
  ------------------
  |  Branch (15134:9): [True: 0, False: 2]
  |  Branch (15134:34): [True: 1, False: 1]
  ------------------
15135|      1|        op1 = JS_ToPrimitiveFree(ctx, op1, HINT_NONE);
  ------------------
  |  | 1246|      1|#define HINT_NONE    2
  ------------------
15136|      1|        if (JS_IsException(op1)) {
  ------------------
  |  Branch (15136:13): [True: 0, False: 1]
  ------------------
15137|      0|            JS_FreeValue(ctx, op2);
15138|      0|            goto exception;
15139|      0|        }
15140|       |
15141|      1|        op2 = JS_ToPrimitiveFree(ctx, op2, HINT_NONE);
  ------------------
  |  | 1246|      1|#define HINT_NONE    2
  ------------------
15142|      1|        if (JS_IsException(op2)) {
  ------------------
  |  Branch (15142:13): [True: 0, False: 1]
  ------------------
15143|      0|            JS_FreeValue(ctx, op1);
15144|      0|            goto exception;
15145|      0|        }
15146|      1|        tag1 = JS_VALUE_GET_NORM_TAG(op1);
  ------------------
  |  |  238|      1|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
15147|      1|        tag2 = JS_VALUE_GET_NORM_TAG(op2);
  ------------------
  |  |  238|      1|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
15148|      1|    }
15149|       |
15150|      2|    if (tag_is_string(tag1) || tag_is_string(tag2)) {
  ------------------
  |  Branch (15150:9): [True: 1, False: 1]
  |  Branch (15150:32): [True: 1, False: 0]
  ------------------
15151|      2|        sp[-2] = JS_ConcatString(ctx, op1, op2);
15152|      2|        if (JS_IsException(sp[-2]))
  ------------------
  |  Branch (15152:13): [True: 0, False: 2]
  ------------------
15153|      0|            goto exception;
15154|      2|        return 0;
15155|      2|    }
15156|       |
15157|      0|    op1 = JS_ToNumericFree(ctx, op1);
15158|      0|    if (JS_IsException(op1)) {
  ------------------
  |  Branch (15158:9): [True: 0, False: 0]
  ------------------
15159|      0|        JS_FreeValue(ctx, op2);
15160|      0|        goto exception;
15161|      0|    }
15162|      0|    op2 = JS_ToNumericFree(ctx, op2);
15163|      0|    if (JS_IsException(op2)) {
  ------------------
  |  Branch (15163:9): [True: 0, False: 0]
  ------------------
15164|      0|        JS_FreeValue(ctx, op1);
15165|      0|        goto exception;
15166|      0|    }
15167|      0|    tag1 = JS_VALUE_GET_NORM_TAG(op1);
  ------------------
  |  |  238|      0|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
15168|      0|    tag2 = JS_VALUE_GET_NORM_TAG(op2);
  ------------------
  |  |  238|      0|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
15169|       |
15170|      0|    if (tag1 == JS_TAG_INT && tag2 == JS_TAG_INT) {
  ------------------
  |  Branch (15170:9): [True: 0, False: 0]
  |  Branch (15170:31): [True: 0, False: 0]
  ------------------
15171|      0|        int32_t v1, v2;
15172|      0|        int64_t v;
15173|      0|        v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
15174|      0|        v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
15175|      0|        v = (int64_t)v1 + (int64_t)v2;
15176|      0|        sp[-2] = JS_NewInt64(ctx, v);
15177|      0|    } else if ((tag1 == JS_TAG_BIG_INT || tag1 == JS_TAG_SHORT_BIG_INT) &&
  ------------------
  |  Branch (15177:17): [True: 0, False: 0]
  |  Branch (15177:43): [True: 0, False: 0]
  ------------------
15178|      0|               (tag2 == JS_TAG_BIG_INT || tag2 == JS_TAG_SHORT_BIG_INT)) {
  ------------------
  |  Branch (15178:17): [True: 0, False: 0]
  |  Branch (15178:43): [True: 0, False: 0]
  ------------------
15179|      0|        JSBigInt *p1, *p2, *r;
15180|      0|        JSBigIntBuf buf1, buf2;
15181|       |        /* bigint result */
15182|      0|        if (JS_VALUE_GET_TAG(op1) == JS_TAG_SHORT_BIG_INT)
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (15182:13): [True: 0, False: 0]
  ------------------
15183|      0|            p1 = js_bigint_set_short(&buf1, op1);
15184|      0|        else
15185|      0|            p1 = JS_VALUE_GET_PTR(op1);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
15186|      0|        if (JS_VALUE_GET_TAG(op2) == JS_TAG_SHORT_BIG_INT)
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (15186:13): [True: 0, False: 0]
  ------------------
15187|      0|            p2 = js_bigint_set_short(&buf2, op2);
15188|      0|        else
15189|      0|            p2 = JS_VALUE_GET_PTR(op2);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
15190|      0|        r = js_bigint_add(ctx, p1, p2, 0);
15191|      0|        JS_FreeValue(ctx, op1);
15192|      0|        JS_FreeValue(ctx, op2);
15193|      0|        if (!r)
  ------------------
  |  Branch (15193:13): [True: 0, False: 0]
  ------------------
15194|      0|            goto exception;
15195|      0|        sp[-2] = JS_CompactBigInt(ctx, r);
15196|      0|    } else {
15197|      0|        double d1, d2;
15198|       |        /* float64 result */
15199|      0|        if (JS_ToFloat64Free(ctx, &d1, op1)) {
  ------------------
  |  Branch (15199:13): [True: 0, False: 0]
  ------------------
15200|      0|            JS_FreeValue(ctx, op2);
15201|      0|            goto exception;
15202|      0|        }
15203|      0|        if (JS_ToFloat64Free(ctx, &d2, op2))
  ------------------
  |  Branch (15203:13): [True: 0, False: 0]
  ------------------
15204|      0|            goto exception;
15205|      0|        sp[-2] = __JS_NewFloat64(ctx, d1 + d2);
15206|      0|    }
15207|      0|    return 0;
15208|      0| exception:
15209|      0|    sp[-2] = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
15210|      0|    sp[-1] = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
15211|      0|    return -1;
15212|      0|}
quickjs.c:JS_ToNumericFree:
13026|     10|{
13027|     10|    return JS_ToNumberHintFree(ctx, val, TON_FLAG_NUMERIC);
13028|     10|}
quickjs.c:js_binary_arith_slow:
14908|      3|{
14909|      3|    JSValue op1, op2;
14910|      3|    uint32_t tag1, tag2;
14911|      3|    double d1, d2;
14912|       |
14913|      3|    op1 = sp[-2];
14914|      3|    op2 = sp[-1];
14915|      3|    tag1 = JS_VALUE_GET_NORM_TAG(op1);
  ------------------
  |  |  238|      3|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      3|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
14916|      3|    tag2 = JS_VALUE_GET_NORM_TAG(op2);
  ------------------
  |  |  238|      3|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      3|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
14917|       |    /* fast path for float operations */
14918|      3|    if (tag1 == JS_TAG_FLOAT64 && tag2 == JS_TAG_FLOAT64) {
  ------------------
  |  Branch (14918:9): [True: 0, False: 3]
  |  Branch (14918:35): [True: 0, False: 0]
  ------------------
14919|      0|        d1 = JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
14920|      0|        d2 = JS_VALUE_GET_FLOAT64(op2);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
14921|      0|        goto handle_float64;
14922|      0|    }
14923|       |    /* fast path for short big int operations */
14924|      3|    if (tag1 == JS_TAG_SHORT_BIG_INT && tag2 == JS_TAG_SHORT_BIG_INT) {
  ------------------
  |  Branch (14924:9): [True: 0, False: 3]
  |  Branch (14924:41): [True: 0, False: 0]
  ------------------
14925|      0|        js_slimb_t v1, v2;
14926|      0|        js_sdlimb_t v;
14927|      0|        v1 = JS_VALUE_GET_SHORT_BIG_INT(op1);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
14928|      0|        v2 = JS_VALUE_GET_SHORT_BIG_INT(op2);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
14929|      0|        switch(op) {
14930|      0|        case OP_sub:
  ------------------
  |  Branch (14930:9): [True: 0, False: 0]
  ------------------
14931|      0|            v = (js_sdlimb_t)v1 - (js_sdlimb_t)v2;
14932|      0|            break;
14933|      0|        case OP_mul:
  ------------------
  |  Branch (14933:9): [True: 0, False: 0]
  ------------------
14934|      0|            v = (js_sdlimb_t)v1 * (js_sdlimb_t)v2;
14935|      0|            break;
14936|      0|        case OP_div:
  ------------------
  |  Branch (14936:9): [True: 0, False: 0]
  ------------------
14937|      0|            if (v2 == 0 ||
  ------------------
  |  Branch (14937:17): [True: 0, False: 0]
  ------------------
14938|      0|                ((js_limb_t)v1 == (js_limb_t)1 << (JS_LIMB_BITS - 1) &&
  ------------------
  |  |   68|      0|#define JS_LIMB_BITS 64
  ------------------
  |  Branch (14938:18): [True: 0, False: 0]
  ------------------
14939|      0|                 v2 == -1)) {
  ------------------
  |  Branch (14939:18): [True: 0, False: 0]
  ------------------
14940|      0|                goto slow_big_int;
14941|      0|            }
14942|      0|            sp[-2] = __JS_NewShortBigInt(ctx, v1 / v2);
14943|      0|            return 0;
14944|      0|        case OP_mod:
  ------------------
  |  Branch (14944:9): [True: 0, False: 0]
  ------------------
14945|      0|            if (v2 == 0 ||
  ------------------
  |  Branch (14945:17): [True: 0, False: 0]
  ------------------
14946|      0|                ((js_limb_t)v1 == (js_limb_t)1 << (JS_LIMB_BITS - 1) &&
  ------------------
  |  |   68|      0|#define JS_LIMB_BITS 64
  ------------------
  |  Branch (14946:18): [True: 0, False: 0]
  ------------------
14947|      0|                 v2 == -1)) {
  ------------------
  |  Branch (14947:18): [True: 0, False: 0]
  ------------------
14948|      0|                goto slow_big_int;
14949|      0|            }
14950|      0|            sp[-2] = __JS_NewShortBigInt(ctx, v1 % v2);
14951|      0|            return 0;
14952|      0|        case OP_pow:
  ------------------
  |  Branch (14952:9): [True: 0, False: 0]
  ------------------
14953|      0|            goto slow_big_int;
14954|      0|        default:
  ------------------
  |  Branch (14954:9): [True: 0, False: 0]
  ------------------
14955|      0|            abort();
14956|      0|        }
14957|      0|        if (likely(v >= JS_SHORT_BIG_INT_MIN && v <= JS_SHORT_BIG_INT_MAX)) {
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
14958|      0|            sp[-2] = __JS_NewShortBigInt(ctx, v);
14959|      0|        } else {
14960|      0|            JSBigInt *r = js_bigint_new_di(ctx, v);
14961|      0|            if (!r)
  ------------------
  |  Branch (14961:17): [True: 0, False: 0]
  ------------------
14962|      0|                goto exception;
14963|      0|            sp[-2] = JS_MKPTR(JS_TAG_BIG_INT, r);
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
14964|      0|        }
14965|      0|        return 0;
14966|      0|    }
14967|      3|    op1 = JS_ToNumericFree(ctx, op1);
14968|      3|    if (JS_IsException(op1)) {
  ------------------
  |  Branch (14968:9): [True: 0, False: 3]
  ------------------
14969|      0|        JS_FreeValue(ctx, op2);
14970|      0|        goto exception;
14971|      0|    }
14972|      3|    op2 = JS_ToNumericFree(ctx, op2);
14973|      3|    if (JS_IsException(op2)) {
  ------------------
  |  Branch (14973:9): [True: 0, False: 3]
  ------------------
14974|      0|        JS_FreeValue(ctx, op1);
14975|      0|        goto exception;
14976|      0|    }
14977|      3|    tag1 = JS_VALUE_GET_NORM_TAG(op1);
  ------------------
  |  |  238|      3|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      3|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
14978|      3|    tag2 = JS_VALUE_GET_NORM_TAG(op2);
  ------------------
  |  |  238|      3|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      3|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
14979|       |
14980|      3|    if (tag1 == JS_TAG_INT && tag2 == JS_TAG_INT) {
  ------------------
  |  Branch (14980:9): [True: 2, False: 1]
  |  Branch (14980:31): [True: 0, False: 2]
  ------------------
14981|      0|        int32_t v1, v2;
14982|      0|        int64_t v;
14983|      0|        v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
14984|      0|        v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
14985|      0|        switch(op) {
14986|      0|        case OP_sub:
  ------------------
  |  Branch (14986:9): [True: 0, False: 0]
  ------------------
14987|      0|            v = (int64_t)v1 - (int64_t)v2;
14988|      0|            break;
14989|      0|        case OP_mul:
  ------------------
  |  Branch (14989:9): [True: 0, False: 0]
  ------------------
14990|      0|            v = (int64_t)v1 * (int64_t)v2;
14991|      0|            if (v == 0 && (v1 | v2) < 0) {
  ------------------
  |  Branch (14991:17): [True: 0, False: 0]
  |  Branch (14991:27): [True: 0, False: 0]
  ------------------
14992|      0|                sp[-2] = __JS_NewFloat64(ctx, -0.0);
14993|      0|                return 0;
14994|      0|            }
14995|      0|            break;
14996|      0|        case OP_div:
  ------------------
  |  Branch (14996:9): [True: 0, False: 0]
  ------------------
14997|      0|            sp[-2] = JS_NewFloat64(ctx, (double)v1 / (double)v2);
14998|      0|            return 0;
14999|      0|        case OP_mod:
  ------------------
  |  Branch (14999:9): [True: 0, False: 0]
  ------------------
15000|      0|            if (v1 < 0 || v2 <= 0) {
  ------------------
  |  Branch (15000:17): [True: 0, False: 0]
  |  Branch (15000:27): [True: 0, False: 0]
  ------------------
15001|      0|                sp[-2] = JS_NewFloat64(ctx, fmod(v1, v2));
15002|      0|                return 0;
15003|      0|            } else {
15004|      0|                v = (int64_t)v1 % (int64_t)v2;
15005|      0|            }
15006|      0|            break;
15007|      0|        case OP_pow:
  ------------------
  |  Branch (15007:9): [True: 0, False: 0]
  ------------------
15008|      0|            sp[-2] = JS_NewFloat64(ctx, js_pow(v1, v2));
15009|      0|            return 0;
15010|      0|        default:
  ------------------
  |  Branch (15010:9): [True: 0, False: 0]
  ------------------
15011|      0|            abort();
15012|      0|        }
15013|      0|        sp[-2] = JS_NewInt64(ctx, v);
15014|      3|    } else if ((tag1 == JS_TAG_SHORT_BIG_INT || tag1 == JS_TAG_BIG_INT) &&
  ------------------
  |  Branch (15014:17): [True: 0, False: 3]
  |  Branch (15014:49): [True: 0, False: 3]
  ------------------
15015|      0|               (tag2 == JS_TAG_SHORT_BIG_INT || tag2 == JS_TAG_BIG_INT)) {
  ------------------
  |  Branch (15015:17): [True: 0, False: 0]
  |  Branch (15015:49): [True: 0, False: 0]
  ------------------
15016|      0|        JSBigInt *p1, *p2, *r;
15017|      0|        JSBigIntBuf buf1, buf2;
15018|      0|    slow_big_int:
15019|       |        /* bigint result */
15020|      0|        if (JS_VALUE_GET_TAG(op1) == JS_TAG_SHORT_BIG_INT)
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (15020:13): [True: 0, False: 0]
  ------------------
15021|      0|            p1 = js_bigint_set_short(&buf1, op1);
15022|      0|        else
15023|      0|            p1 = JS_VALUE_GET_PTR(op1);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
15024|      0|        if (JS_VALUE_GET_TAG(op2) == JS_TAG_SHORT_BIG_INT)
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (15024:13): [True: 0, False: 0]
  ------------------
15025|      0|            p2 = js_bigint_set_short(&buf2, op2);
15026|      0|        else
15027|      0|            p2 = JS_VALUE_GET_PTR(op2);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
15028|      0|        switch(op) {
15029|      0|        case OP_add:
  ------------------
  |  Branch (15029:9): [True: 0, False: 0]
  ------------------
15030|      0|            r = js_bigint_add(ctx, p1, p2, 0);
15031|      0|            break;
15032|      0|        case OP_sub:
  ------------------
  |  Branch (15032:9): [True: 0, False: 0]
  ------------------
15033|      0|            r = js_bigint_add(ctx, p1, p2, 1);
15034|      0|            break;
15035|      0|        case OP_mul:
  ------------------
  |  Branch (15035:9): [True: 0, False: 0]
  ------------------
15036|      0|            r = js_bigint_mul(ctx, p1, p2);
15037|      0|            break;
15038|      0|        case OP_div:
  ------------------
  |  Branch (15038:9): [True: 0, False: 0]
  ------------------
15039|      0|            r = js_bigint_divrem(ctx, p1, p2, FALSE);
15040|      0|            break;
15041|      0|        case OP_mod:
  ------------------
  |  Branch (15041:9): [True: 0, False: 0]
  ------------------
15042|      0|            r = js_bigint_divrem(ctx, p1, p2, TRUE);
15043|      0|            break;
15044|      0|        case OP_pow:
  ------------------
  |  Branch (15044:9): [True: 0, False: 0]
  ------------------
15045|      0|            r = js_bigint_pow(ctx, p1, p2);
15046|      0|            break;
15047|      0|        default:
  ------------------
  |  Branch (15047:9): [True: 0, False: 0]
  ------------------
15048|      0|            abort();
15049|      0|        }
15050|      0|        JS_FreeValue(ctx, op1);
15051|      0|        JS_FreeValue(ctx, op2);
15052|      0|        if (!r)
  ------------------
  |  Branch (15052:13): [True: 0, False: 0]
  ------------------
15053|      0|            goto exception;
15054|      0|        sp[-2] = JS_CompactBigInt(ctx, r);
15055|      3|    } else {
15056|      3|        double dr;
15057|       |        /* float64 result */
15058|      3|        if (JS_ToFloat64Free(ctx, &d1, op1)) {
  ------------------
  |  Branch (15058:13): [True: 0, False: 3]
  ------------------
15059|      0|            JS_FreeValue(ctx, op2);
15060|      0|            goto exception;
15061|      0|        }
15062|      3|        if (JS_ToFloat64Free(ctx, &d2, op2))
  ------------------
  |  Branch (15062:13): [True: 0, False: 3]
  ------------------
15063|      0|            goto exception;
15064|      3|    handle_float64:
15065|      3|        switch(op) {
15066|      0|        case OP_sub:
  ------------------
  |  Branch (15066:9): [True: 0, False: 3]
  ------------------
15067|      0|            dr = d1 - d2;
15068|      0|            break;
15069|      1|        case OP_mul:
  ------------------
  |  Branch (15069:9): [True: 1, False: 2]
  ------------------
15070|      1|            dr = d1 * d2;
15071|      1|            break;
15072|      0|        case OP_div:
  ------------------
  |  Branch (15072:9): [True: 0, False: 3]
  ------------------
15073|      0|            dr = d1 / d2;
15074|      0|            break;
15075|      2|        case OP_mod:
  ------------------
  |  Branch (15075:9): [True: 2, False: 1]
  ------------------
15076|      2|            dr = fmod(d1, d2);
15077|      2|            break;
15078|      0|        case OP_pow:
  ------------------
  |  Branch (15078:9): [True: 0, False: 3]
  ------------------
15079|      0|            dr = js_pow(d1, d2);
15080|      0|            break;
15081|      0|        default:
  ------------------
  |  Branch (15081:9): [True: 0, False: 3]
  ------------------
15082|      0|            abort();
15083|      3|        }
15084|      3|        sp[-2] = __JS_NewFloat64(ctx, dr);
15085|      3|    }
15086|      3|    return 0;
15087|      0| exception:
15088|      0|    sp[-2] = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
15089|      0|    sp[-1] = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
15090|      0|    return -1;
15091|      3|}
quickjs.c:js_unary_arith_slow:
14723|      2|{
14724|      2|    JSValue op1;
14725|      2|    int v;
14726|      2|    uint32_t tag;
14727|      2|    JSBigIntBuf buf1;
14728|      2|    JSBigInt *p1;
14729|       |
14730|      2|    op1 = sp[-1];
14731|       |    /* fast path for float64 */
14732|      2|    if (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op1)))
  ------------------
  |  |  250|      2|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 2]
  |  |  ------------------
  ------------------
14733|      0|        goto handle_float64;
14734|      2|    op1 = JS_ToNumericFree(ctx, op1);
14735|      2|    if (JS_IsException(op1))
  ------------------
  |  Branch (14735:9): [True: 0, False: 2]
  ------------------
14736|      0|        goto exception;
14737|      2|    tag = JS_VALUE_GET_TAG(op1);
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
14738|      2|    switch(tag) {
14739|      0|    case JS_TAG_INT:
  ------------------
  |  Branch (14739:5): [True: 0, False: 2]
  ------------------
14740|      0|        {
14741|      0|            int64_t v64;
14742|      0|            v64 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
14743|      0|            switch(op) {
14744|      0|            case OP_inc:
  ------------------
  |  Branch (14744:13): [True: 0, False: 0]
  ------------------
14745|      0|            case OP_dec:
  ------------------
  |  Branch (14745:13): [True: 0, False: 0]
  ------------------
14746|      0|                v = 2 * (op - OP_dec) - 1;
14747|      0|                v64 += v;
14748|      0|                break;
14749|      0|            case OP_plus:
  ------------------
  |  Branch (14749:13): [True: 0, False: 0]
  ------------------
14750|      0|                break;
14751|      0|            case OP_neg:
  ------------------
  |  Branch (14751:13): [True: 0, False: 0]
  ------------------
14752|      0|                if (v64 == 0) {
  ------------------
  |  Branch (14752:21): [True: 0, False: 0]
  ------------------
14753|      0|                    sp[-1] = __JS_NewFloat64(ctx, -0.0);
14754|      0|                    return 0;
14755|      0|                } else {
14756|      0|                    v64 = -v64;
14757|      0|                }
14758|      0|                break;
14759|      0|            default:
  ------------------
  |  Branch (14759:13): [True: 0, False: 0]
  ------------------
14760|      0|                abort();
14761|      0|            }
14762|      0|            sp[-1] = JS_NewInt64(ctx, v64);
14763|      0|        }
14764|      0|        break;
14765|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (14765:5): [True: 0, False: 2]
  ------------------
14766|      0|        {
14767|      0|            int64_t v;
14768|      0|            v = JS_VALUE_GET_SHORT_BIG_INT(op1);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
14769|      0|            switch(op) {
14770|      0|            case OP_plus:
  ------------------
  |  Branch (14770:13): [True: 0, False: 0]
  ------------------
14771|      0|                JS_ThrowTypeError(ctx, "bigint argument with unary +");
14772|      0|                goto exception;
14773|      0|            case OP_inc:
  ------------------
  |  Branch (14773:13): [True: 0, False: 0]
  ------------------
14774|      0|                if (v == JS_SHORT_BIG_INT_MAX)
  ------------------
  |  |11274|      0|#define JS_SHORT_BIG_INT_MAX INT64_MAX
  ------------------
  |  Branch (14774:21): [True: 0, False: 0]
  ------------------
14775|      0|                    goto bigint_slow_case;
14776|      0|                sp[-1] = __JS_NewShortBigInt(ctx, v + 1);
14777|      0|                break;
14778|      0|            case OP_dec:
  ------------------
  |  Branch (14778:13): [True: 0, False: 0]
  ------------------
14779|      0|                if (v == JS_SHORT_BIG_INT_MIN)
  ------------------
  |  |11273|      0|#define JS_SHORT_BIG_INT_MIN INT64_MIN
  ------------------
  |  Branch (14779:21): [True: 0, False: 0]
  ------------------
14780|      0|                    goto bigint_slow_case;
14781|      0|                sp[-1] = __JS_NewShortBigInt(ctx, v - 1);
14782|      0|                break;
14783|      0|            case OP_neg:
  ------------------
  |  Branch (14783:13): [True: 0, False: 0]
  ------------------
14784|      0|                v = JS_VALUE_GET_SHORT_BIG_INT(op1);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
14785|      0|                if (v == JS_SHORT_BIG_INT_MIN) {
  ------------------
  |  |11273|      0|#define JS_SHORT_BIG_INT_MIN INT64_MIN
  ------------------
  |  Branch (14785:21): [True: 0, False: 0]
  ------------------
14786|      0|                bigint_slow_case:
14787|      0|                    p1 = js_bigint_set_short(&buf1, op1);
14788|      0|                    goto bigint_slow_case1;
14789|      0|                }
14790|      0|                sp[-1] = __JS_NewShortBigInt(ctx, -v);
14791|      0|                break;
14792|      0|            default:
  ------------------
  |  Branch (14792:13): [True: 0, False: 0]
  ------------------
14793|      0|                abort();
14794|      0|            }
14795|      0|        }
14796|      0|        break;
14797|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (14797:5): [True: 0, False: 2]
  ------------------
14798|      0|        {
14799|      0|            JSBigInt *r;
14800|      0|            p1 = JS_VALUE_GET_PTR(op1);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
14801|      0|        bigint_slow_case1:
14802|      0|            switch(op) {
14803|      0|            case OP_plus:
  ------------------
  |  Branch (14803:13): [True: 0, False: 0]
  ------------------
14804|      0|                JS_ThrowTypeError(ctx, "bigint argument with unary +");
14805|      0|                JS_FreeValue(ctx, op1);
14806|      0|                goto exception;
14807|      0|            case OP_inc:
  ------------------
  |  Branch (14807:13): [True: 0, False: 0]
  ------------------
14808|      0|            case OP_dec:
  ------------------
  |  Branch (14808:13): [True: 0, False: 0]
  ------------------
14809|      0|                {
14810|      0|                    JSBigIntBuf buf2;
14811|      0|                    JSBigInt *p2;
14812|      0|                    p2 = js_bigint_set_si(&buf2, 2 * (op - OP_dec) - 1);
14813|      0|                    r = js_bigint_add(ctx, p1, p2, 0);
14814|      0|                }
14815|      0|                break;
14816|      0|            case OP_neg:
  ------------------
  |  Branch (14816:13): [True: 0, False: 0]
  ------------------
14817|      0|                r = js_bigint_neg(ctx, p1);
14818|      0|                break;
14819|      0|            case OP_not:
  ------------------
  |  Branch (14819:13): [True: 0, False: 0]
  ------------------
14820|      0|                r = js_bigint_not(ctx, p1);
14821|      0|                break;
14822|      0|            default:
  ------------------
  |  Branch (14822:13): [True: 0, False: 0]
  ------------------
14823|      0|                abort();
14824|      0|            }
14825|      0|            JS_FreeValue(ctx, op1);
14826|      0|            if (!r)
  ------------------
  |  Branch (14826:17): [True: 0, False: 0]
  ------------------
14827|      0|                goto exception;
14828|      0|            sp[-1] = JS_CompactBigInt(ctx, r);
14829|      0|        }
14830|      0|        break;
14831|      2|    default:
  ------------------
  |  Branch (14831:5): [True: 2, False: 0]
  ------------------
14832|      2|    handle_float64:
14833|      2|        {
14834|      2|            double d;
14835|      2|            d = JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      2|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
14836|      2|            switch(op) {
14837|      0|            case OP_inc:
  ------------------
  |  Branch (14837:13): [True: 0, False: 2]
  ------------------
14838|      0|            case OP_dec:
  ------------------
  |  Branch (14838:13): [True: 0, False: 2]
  ------------------
14839|      0|                v = 2 * (op - OP_dec) - 1;
14840|      0|                d += v;
14841|      0|                break;
14842|      0|            case OP_plus:
  ------------------
  |  Branch (14842:13): [True: 0, False: 2]
  ------------------
14843|      0|                break;
14844|      2|            case OP_neg:
  ------------------
  |  Branch (14844:13): [True: 2, False: 0]
  ------------------
14845|      2|                d = -d;
14846|      2|                break;
14847|      0|            default:
  ------------------
  |  Branch (14847:13): [True: 0, False: 2]
  ------------------
14848|      0|                abort();
14849|      2|            }
14850|      2|            sp[-1] = __JS_NewFloat64(ctx, d);
14851|      2|        }
14852|      0|        break;
14853|      2|    }
14854|      2|    return 0;
14855|      0| exception:
14856|      0|    sp[-1] = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
14857|      0|    return -1;
14858|      2|}
quickjs.c:js_binary_logic_slow:
15217|      1|{
15218|      1|    JSValue op1, op2;
15219|      1|    uint32_t tag1, tag2;
15220|      1|    uint32_t v1, v2, r;
15221|       |
15222|      1|    op1 = sp[-2];
15223|      1|    op2 = sp[-1];
15224|      1|    tag1 = JS_VALUE_GET_NORM_TAG(op1);
  ------------------
  |  |  238|      1|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
15225|      1|    tag2 = JS_VALUE_GET_NORM_TAG(op2);
  ------------------
  |  |  238|      1|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
15226|       |
15227|      1|    if (tag1 == JS_TAG_SHORT_BIG_INT && tag2 == JS_TAG_SHORT_BIG_INT) {
  ------------------
  |  Branch (15227:9): [True: 0, False: 1]
  |  Branch (15227:41): [True: 0, False: 0]
  ------------------
15228|      0|        js_slimb_t v1, v2, v;
15229|      0|        js_sdlimb_t vd;
15230|      0|        v1 = JS_VALUE_GET_SHORT_BIG_INT(op1);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
15231|      0|        v2 = JS_VALUE_GET_SHORT_BIG_INT(op2);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
15232|       |        /* bigint fast path */
15233|      0|        switch(op) {
15234|      0|        case OP_and:
  ------------------
  |  Branch (15234:9): [True: 0, False: 0]
  ------------------
15235|      0|            v = v1 & v2;
15236|      0|            break;
15237|      0|        case OP_or:
  ------------------
  |  Branch (15237:9): [True: 0, False: 0]
  ------------------
15238|      0|            v = v1 | v2;
15239|      0|            break;
15240|      0|        case OP_xor:
  ------------------
  |  Branch (15240:9): [True: 0, False: 0]
  ------------------
15241|      0|            v = v1 ^ v2;
15242|      0|            break;
15243|      0|        case OP_sar:
  ------------------
  |  Branch (15243:9): [True: 0, False: 0]
  ------------------
15244|      0|            if (v2 > (JS_LIMB_BITS - 1)) {
  ------------------
  |  |   68|      0|#define JS_LIMB_BITS 64
  ------------------
  |  Branch (15244:17): [True: 0, False: 0]
  ------------------
15245|      0|                goto slow_big_int;
15246|      0|            } else if (v2 < 0) {
  ------------------
  |  Branch (15246:24): [True: 0, False: 0]
  ------------------
15247|      0|                if (v2 < -(JS_LIMB_BITS - 1))
  ------------------
  |  |   68|      0|#define JS_LIMB_BITS 64
  ------------------
  |  Branch (15247:21): [True: 0, False: 0]
  ------------------
15248|      0|                    goto slow_big_int;
15249|      0|                v2 = -v2;
15250|      0|                goto bigint_shl;
15251|      0|            }
15252|      0|        bigint_sar:
15253|      0|            v = v1 >> v2;
15254|      0|            break;
15255|      0|        case OP_shl:
  ------------------
  |  Branch (15255:9): [True: 0, False: 0]
  ------------------
15256|      0|            if (v2 > (JS_LIMB_BITS - 1)) {
  ------------------
  |  |   68|      0|#define JS_LIMB_BITS 64
  ------------------
  |  Branch (15256:17): [True: 0, False: 0]
  ------------------
15257|      0|                goto slow_big_int;
15258|      0|            } else if (v2 < 0) {
  ------------------
  |  Branch (15258:24): [True: 0, False: 0]
  ------------------
15259|      0|                if (v2 < -(JS_LIMB_BITS - 1))
  ------------------
  |  |   68|      0|#define JS_LIMB_BITS 64
  ------------------
  |  Branch (15259:21): [True: 0, False: 0]
  ------------------
15260|      0|                    goto slow_big_int;
15261|      0|                v2 = -v2;
15262|      0|                goto bigint_sar;
15263|      0|            }
15264|      0|        bigint_shl:
15265|      0|            vd = (js_dlimb_t)v1 << v2;
15266|      0|            if (likely(vd >= JS_SHORT_BIG_INT_MIN &&
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
15267|      0|                       vd <= JS_SHORT_BIG_INT_MAX)) {
15268|      0|                v = vd;
15269|      0|            } else {
15270|      0|                JSBigInt *r = js_bigint_new_di(ctx, vd);
15271|      0|                if (!r)
  ------------------
  |  Branch (15271:21): [True: 0, False: 0]
  ------------------
15272|      0|                    goto exception;
15273|      0|                sp[-2] = JS_MKPTR(JS_TAG_BIG_INT, r);
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
15274|      0|                return 0;
15275|      0|            }
15276|      0|            break;
15277|      0|        default:
  ------------------
  |  Branch (15277:9): [True: 0, False: 0]
  ------------------
15278|      0|            abort();
15279|      0|        }
15280|      0|        sp[-2] = __JS_NewShortBigInt(ctx, v);
15281|      0|        return 0;
15282|      0|    }
15283|      1|    op1 = JS_ToNumericFree(ctx, op1);
15284|      1|    if (JS_IsException(op1)) {
  ------------------
  |  Branch (15284:9): [True: 0, False: 1]
  ------------------
15285|      0|        JS_FreeValue(ctx, op2);
15286|      0|        goto exception;
15287|      0|    }
15288|      1|    op2 = JS_ToNumericFree(ctx, op2);
15289|      1|    if (JS_IsException(op2)) {
  ------------------
  |  Branch (15289:9): [True: 0, False: 1]
  ------------------
15290|      0|        JS_FreeValue(ctx, op1);
15291|      0|        goto exception;
15292|      0|    }
15293|       |
15294|      1|    tag1 = JS_VALUE_GET_TAG(op1);
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
15295|      1|    tag2 = JS_VALUE_GET_TAG(op2);
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
15296|      1|    if ((tag1 == JS_TAG_BIG_INT || tag1 == JS_TAG_SHORT_BIG_INT) &&
  ------------------
  |  Branch (15296:10): [True: 0, False: 1]
  |  Branch (15296:36): [True: 0, False: 1]
  ------------------
15297|      0|        (tag2 == JS_TAG_BIG_INT || tag2 == JS_TAG_SHORT_BIG_INT)) {
  ------------------
  |  Branch (15297:10): [True: 0, False: 0]
  |  Branch (15297:36): [True: 0, False: 0]
  ------------------
15298|      0|        JSBigInt *p1, *p2, *r;
15299|      0|        JSBigIntBuf buf1, buf2;
15300|      0|    slow_big_int:
15301|      0|        if (JS_VALUE_GET_TAG(op1) == JS_TAG_SHORT_BIG_INT)
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (15301:13): [True: 0, False: 0]
  ------------------
15302|      0|            p1 = js_bigint_set_short(&buf1, op1);
15303|      0|        else
15304|      0|            p1 = JS_VALUE_GET_PTR(op1);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
15305|      0|        if (JS_VALUE_GET_TAG(op2) == JS_TAG_SHORT_BIG_INT)
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (15305:13): [True: 0, False: 0]
  ------------------
15306|      0|            p2 = js_bigint_set_short(&buf2, op2);
15307|      0|        else
15308|      0|            p2 = JS_VALUE_GET_PTR(op2);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
15309|      0|        switch(op) {
15310|      0|        case OP_and:
  ------------------
  |  Branch (15310:9): [True: 0, False: 0]
  ------------------
15311|      0|        case OP_or:
  ------------------
  |  Branch (15311:9): [True: 0, False: 0]
  ------------------
15312|      0|        case OP_xor:
  ------------------
  |  Branch (15312:9): [True: 0, False: 0]
  ------------------
15313|      0|            r = js_bigint_logic(ctx, p1, p2, op);
15314|      0|            break;
15315|      0|        case OP_shl:
  ------------------
  |  Branch (15315:9): [True: 0, False: 0]
  ------------------
15316|      0|        case OP_sar:
  ------------------
  |  Branch (15316:9): [True: 0, False: 0]
  ------------------
15317|      0|            {
15318|      0|                js_slimb_t shift;
15319|      0|                shift = js_bigint_get_si_sat(p2);
15320|      0|                if (shift > INT32_MAX)
  ------------------
  |  Branch (15320:21): [True: 0, False: 0]
  ------------------
15321|      0|                    shift = INT32_MAX;
15322|      0|                else if (shift < -INT32_MAX)
  ------------------
  |  Branch (15322:26): [True: 0, False: 0]
  ------------------
15323|      0|                    shift = -INT32_MAX;
15324|      0|                if (op == OP_sar)
  ------------------
  |  Branch (15324:21): [True: 0, False: 0]
  ------------------
15325|      0|                    shift = -shift;
15326|      0|                if (shift >= 0)
  ------------------
  |  Branch (15326:21): [True: 0, False: 0]
  ------------------
15327|      0|                    r = js_bigint_shl(ctx, p1, shift);
15328|      0|                else
15329|      0|                    r = js_bigint_shr(ctx, p1, -shift);
15330|      0|            }
15331|      0|            break;
15332|      0|        default:
  ------------------
  |  Branch (15332:9): [True: 0, False: 0]
  ------------------
15333|      0|            abort();
15334|      0|        }
15335|      0|        JS_FreeValue(ctx, op1);
15336|      0|        JS_FreeValue(ctx, op2);
15337|      0|        if (!r)
  ------------------
  |  Branch (15337:13): [True: 0, False: 0]
  ------------------
15338|      0|            goto exception;
15339|      0|        sp[-2] = JS_CompactBigInt(ctx, r);
15340|      1|    } else {
15341|      1|        if (unlikely(JS_ToInt32Free(ctx, (int32_t *)&v1, op1))) {
  ------------------
  |  |   33|      1|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1]
  |  |  ------------------
  ------------------
15342|      0|            JS_FreeValue(ctx, op2);
15343|      0|            goto exception;
15344|      0|        }
15345|      1|        if (unlikely(JS_ToInt32Free(ctx, (int32_t *)&v2, op2)))
  ------------------
  |  |   33|      1|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1]
  |  |  ------------------
  ------------------
15346|      0|            goto exception;
15347|      1|        switch(op) {
15348|      0|        case OP_shl:
  ------------------
  |  Branch (15348:9): [True: 0, False: 1]
  ------------------
15349|      0|            r = v1 << (v2 & 0x1f);
15350|      0|            break;
15351|      0|        case OP_sar:
  ------------------
  |  Branch (15351:9): [True: 0, False: 1]
  ------------------
15352|      0|            r = (int)v1 >> (v2 & 0x1f);
15353|      0|            break;
15354|      1|        case OP_and:
  ------------------
  |  Branch (15354:9): [True: 1, False: 0]
  ------------------
15355|      1|            r = v1 & v2;
15356|      1|            break;
15357|      0|        case OP_or:
  ------------------
  |  Branch (15357:9): [True: 0, False: 1]
  ------------------
15358|      0|            r = v1 | v2;
15359|      0|            break;
15360|      0|        case OP_xor:
  ------------------
  |  Branch (15360:9): [True: 0, False: 1]
  ------------------
15361|      0|            r = v1 ^ v2;
15362|      0|            break;
15363|      0|        default:
  ------------------
  |  Branch (15363:9): [True: 0, False: 1]
  ------------------
15364|      0|            abort();
15365|      1|        }
15366|      1|        sp[-2] = JS_NewInt32(ctx, r);
15367|      1|    }
15368|      1|    return 0;
15369|      0| exception:
15370|      0|    sp[-2] = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
15371|      0|    sp[-1] = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
15372|      0|    return -1;
15373|      1|}
quickjs.c:js_string_compare:
 4618|  8.26k|{
 4619|  8.26k|    int res, len;
 4620|  8.26k|    len = min_int(p1->len, p2->len);
 4621|  8.26k|    res = js_string_memcmp(p1, 0, p2, 0, len);
 4622|  8.26k|    if (res == 0) {
  ------------------
  |  Branch (4622:9): [True: 102, False: 8.16k]
  ------------------
 4623|    102|        if (p1->len == p2->len)
  ------------------
  |  Branch (4623:13): [True: 0, False: 102]
  ------------------
 4624|      0|            res = 0;
 4625|    102|        else if (p1->len < p2->len)
  ------------------
  |  Branch (4625:18): [True: 51, False: 51]
  ------------------
 4626|     51|            res = -1;
 4627|     51|        else
 4628|     51|            res = 1;
 4629|    102|    }
 4630|  8.26k|    return res;
 4631|  8.26k|}
quickjs.c:is_backtrace_needed:
 7621|     11|{
 7622|     11|    JSObject *p;
 7623|     11|    if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|     11|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (7623:9): [True: 0, False: 11]
  ------------------
 7624|      0|        return FALSE;
 7625|     11|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|     11|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     11|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 7626|     11|    if (p->class_id != JS_CLASS_ERROR)
  ------------------
  |  Branch (7626:9): [True: 0, False: 11]
  ------------------
 7627|      0|        return FALSE;
 7628|     11|    if (find_own_property1(p, JS_ATOM_stack))
  ------------------
  |  Branch (7628:9): [True: 2, False: 9]
  ------------------
 7629|      2|        return FALSE;
 7630|      9|    return TRUE;
 7631|     11|}
quickjs.c:close_var_refs:
17560|     16|{
17561|     16|    JSVarRef *var_ref;
17562|     16|    int i;
17563|       |
17564|     16|    for(i = 0; i < b->var_ref_count; i++) {
  ------------------
  |  Branch (17564:16): [True: 0, False: 16]
  ------------------
17565|      0|        var_ref = sf->var_refs[i];
17566|      0|        if (var_ref)
  ------------------
  |  Branch (17566:13): [True: 0, False: 0]
  ------------------
17567|      0|            close_var_ref(rt, sf, var_ref);
17568|      0|    }
17569|     16|}
quickjs.c:JS_CallFree:
20609|  1.01M|{
20610|  1.01M|    JSValue res = JS_CallInternal(ctx, func_obj, this_obj, JS_UNDEFINED,
  ------------------
  |  |  291|  1.01M|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|  1.01M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20611|  1.01M|                                  argc, (JSValue *)argv, JS_CALL_FLAG_COPY_ARGV);
  ------------------
  |  |17585|  1.01M|#define JS_CALL_FLAG_COPY_ARGV   (1 << 1)
  ------------------
20612|  1.01M|    JS_FreeValue(ctx, func_obj);
20613|  1.01M|    return res;
20614|  1.01M|}
quickjs.c:JS_CallConstructorInternal:
20696|      2|{
20697|      2|    JSObject *p;
20698|      2|    JSFunctionBytecode *b;
20699|       |
20700|      2|    if (js_poll_interrupts(ctx))
  ------------------
  |  Branch (20700:9): [True: 0, False: 2]
  ------------------
20701|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20702|      2|    flags |= JS_CALL_FLAG_CONSTRUCTOR;
  ------------------
  |  |  526|      2|#define JS_CALL_FLAG_CONSTRUCTOR (1 << 0)
  ------------------
20703|      2|    if (unlikely(JS_VALUE_GET_TAG(func_obj) != JS_TAG_OBJECT))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
20704|      0|        goto not_a_function;
20705|      2|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
20706|      2|    if (unlikely(!p->is_constructor))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
20707|      0|        return JS_ThrowTypeErrorNotAConstructor(ctx, func_obj);
20708|      2|    if (unlikely(p->class_id != JS_CLASS_BYTECODE_FUNCTION)) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 0]
  |  |  ------------------
  ------------------
20709|      2|        JSClassCall *call_func;
20710|      2|        call_func = ctx->rt->class_array[p->class_id].call;
20711|      2|        if (!call_func) {
  ------------------
  |  Branch (20711:13): [True: 0, False: 2]
  ------------------
20712|      0|        not_a_function:
20713|      0|            return JS_ThrowTypeError(ctx, "not a function");
20714|      0|        }
20715|      2|        return call_func(ctx, func_obj, new_target, argc,
20716|      2|                         (JSValueConst *)argv, flags);
20717|      2|    }
20718|       |
20719|      0|    b = p->u.func.function_bytecode;
20720|      0|    if (b->is_derived_class_constructor) {
  ------------------
  |  Branch (20720:9): [True: 0, False: 0]
  ------------------
20721|      0|        return JS_CallInternal(ctx, func_obj, JS_UNDEFINED, new_target, argc, argv, flags);
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20722|      0|    } else {
20723|      0|        JSValue obj, ret;
20724|       |        /* legacy constructor behavior */
20725|      0|        obj = js_create_from_ctor(ctx, new_target, JS_CLASS_OBJECT);
20726|      0|        if (JS_IsException(obj))
  ------------------
  |  Branch (20726:13): [True: 0, False: 0]
  ------------------
20727|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20728|      0|        ret = JS_CallInternal(ctx, func_obj, obj, new_target, argc, argv, flags);
20729|      0|        if (JS_VALUE_GET_TAG(ret) == JS_TAG_OBJECT ||
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20729:13): [True: 0, False: 0]
  ------------------
20730|      0|            JS_IsException(ret)) {
  ------------------
  |  Branch (20730:13): [True: 0, False: 0]
  ------------------
20731|      0|            JS_FreeValue(ctx, obj);
20732|      0|            return ret;
20733|      0|        } else {
20734|      0|            JS_FreeValue(ctx, ret);
20735|      0|            return obj;
20736|      0|        }
20737|      0|    }
20738|      0|}
quickjs.c:async_func_init:
20779|     16|{
20780|     16|    JSAsyncFunctionState *s;
20781|     16|    JSObject *p;
20782|     16|    JSFunctionBytecode *b;
20783|     16|    JSStackFrame *sf;
20784|     16|    int i, arg_buf_len, n;
20785|       |
20786|     16|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  229|     16|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     16|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
20787|     16|    b = p->u.func.function_bytecode;
20788|     16|    arg_buf_len = max_int(b->arg_count, argc);
20789|     16|    s = js_malloc(ctx, sizeof(*s) + sizeof(JSValue) * (arg_buf_len + b->var_count + b->stack_size) + sizeof(JSVarRef *) * b->var_ref_count);
20790|     16|    if (!s)
  ------------------
  |  Branch (20790:9): [True: 0, False: 16]
  ------------------
20791|      0|        return NULL;
20792|     16|    memset(s, 0, sizeof(*s));
20793|     16|    js_rc(s)->ref_count = 1;
20794|     16|    add_gc_object(ctx->rt, &s->header, JS_GC_OBJ_TYPE_ASYNC_FUNCTION);
20795|       |
20796|     16|    sf = &s->frame;
20797|     16|    sf->js_mode = b->js_mode | JS_MODE_ASYNC;
  ------------------
  |  |  404|     16|#define JS_MODE_ASYNC  (1 << 2) /* async function */
  ------------------
20798|     16|    sf->cur_pc = b->byte_code_buf;
20799|     16|    sf->arg_buf = (JSValue *)(s + 1);
20800|     16|    sf->cur_func = JS_DupValue(ctx, func_obj);
20801|     16|    s->this_val = JS_DupValue(ctx, this_obj);
20802|     16|    s->argc = argc;
20803|     16|    sf->arg_count = arg_buf_len;
20804|     16|    sf->var_buf = sf->arg_buf + arg_buf_len;
20805|     16|    sf->cur_sp = sf->var_buf + b->var_count;
20806|     16|    sf->var_refs = (JSVarRef **)(sf->cur_sp + b->stack_size);
20807|     16|    for(i = 0; i < b->var_ref_count; i++)
  ------------------
  |  Branch (20807:16): [True: 0, False: 16]
  ------------------
20808|      0|        sf->var_refs[i] = NULL;
20809|     16|    for(i = 0; i < argc; i++)
  ------------------
  |  Branch (20809:16): [True: 0, False: 16]
  ------------------
20810|      0|        sf->arg_buf[i] = JS_DupValue(ctx, argv[i]);
20811|     16|    n = arg_buf_len + b->var_count;
20812|     16|    for(i = argc; i < n; i++)
  ------------------
  |  Branch (20812:19): [True: 0, False: 16]
  ------------------
20813|     16|        sf->arg_buf[i] = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     16|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20814|     16|    s->resolving_funcs[0] = JS_UNDEFINED;
  ------------------
  |  |  291|     16|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     16|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20815|     16|    s->resolving_funcs[1] = JS_UNDEFINED;
  ------------------
  |  |  291|     16|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     16|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20816|     16|    s->is_completed = FALSE;
20817|     16|    return s;
20818|     16|}
quickjs.c:async_func_resume:
20835|     16|{
20836|     16|    JSRuntime *rt = ctx->rt;
20837|     16|    JSStackFrame *sf = &s->frame;
20838|     16|    JSValue func_obj, ret;
20839|       |
20840|     16|    assert(!s->is_completed);
  ------------------
  |  Branch (20840:5): [True: 0, False: 16]
  |  Branch (20840:5): [True: 16, False: 0]
  ------------------
20841|     16|    if (js_check_stack_overflow(ctx->rt, 0)) {
  ------------------
  |  Branch (20841:9): [True: 0, False: 16]
  ------------------
20842|      0|        ret = JS_ThrowStackOverflow(ctx);
20843|     16|    } else {
20844|       |        /* the tag does not matter provided it is not an object */
20845|     16|        func_obj = JS_MKPTR(JS_TAG_INT, s);
  ------------------
  |  |  248|     16|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
20846|     16|        ret = JS_CallInternal(ctx, func_obj, s->this_val, JS_UNDEFINED,
  ------------------
  |  |  291|     16|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     16|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20847|     16|                              s->argc, sf->arg_buf, JS_CALL_FLAG_GENERATOR);
  ------------------
  |  |17586|     16|#define JS_CALL_FLAG_GENERATOR   (1 << 2)
  ------------------
20848|     16|    }
20849|     16|    if (JS_IsException(ret) || JS_IsUndefined(ret)) {
  ------------------
  |  Branch (20849:9): [True: 0, False: 16]
  |  Branch (20849:32): [True: 16, False: 0]
  ------------------
20850|     16|        JSObject *p;
20851|     16|        JSFunctionBytecode *b;
20852|       |        
20853|     16|        p = JS_VALUE_GET_OBJ(sf->cur_func);
  ------------------
  |  |  229|     16|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     16|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
20854|     16|        b = p->u.func.function_bytecode;
20855|       |        
20856|     16|        if (JS_IsUndefined(ret)) {
  ------------------
  |  Branch (20856:13): [True: 16, False: 0]
  ------------------
20857|     16|            ret = sf->cur_sp[-1];
20858|     16|            sf->cur_sp[-1] = JS_UNDEFINED;
  ------------------
  |  |  291|     16|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     16|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20859|     16|        }
20860|       |        /* end of execution */
20861|     16|        s->is_completed = TRUE;
20862|       |
20863|       |        /* close the closure variables. */
20864|     16|        close_var_refs(rt, b, sf);
20865|       |        
20866|     16|        async_func_free_frame(rt, s);
20867|     16|    }
20868|     16|    return ret;
20869|     16|}
quickjs.c:skip_shebang:
23645|     34|{
23646|     34|    const uint8_t *p = *pp;
23647|     34|    int c;
23648|       |
23649|     34|    if (p[0] == '#' && p[1] == '!') {
  ------------------
  |  Branch (23649:9): [True: 0, False: 34]
  |  Branch (23649:24): [True: 0, False: 0]
  ------------------
23650|      0|        p += 2;
23651|      0|        while (p < buf_end) {
  ------------------
  |  Branch (23651:16): [True: 0, False: 0]
  ------------------
23652|      0|            if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (23652:17): [True: 0, False: 0]
  |  Branch (23652:31): [True: 0, False: 0]
  ------------------
23653|      0|                break;
23654|      0|            } else if (*p >= 0x80) {
  ------------------
  |  Branch (23654:24): [True: 0, False: 0]
  ------------------
23655|      0|                c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
23656|      0|                if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21772|      0|#define CP_LS   0x2028
  ------------------
                              if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21773|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (23656:21): [True: 0, False: 0]
  |  Branch (23656:35): [True: 0, False: 0]
  ------------------
23657|      0|                    break;
23658|      0|                } else if (c == -1) {
  ------------------
  |  Branch (23658:28): [True: 0, False: 0]
  ------------------
23659|      0|                    p++; /* skip invalid UTF-8 */
23660|      0|                }
23661|      0|            } else {
23662|      0|                p++;
23663|      0|            }
23664|      0|        }
23665|      0|        *pp = p;
23666|      0|    }
23667|     34|}
quickjs.c:simple_next_token:
23554|    224|{
23555|    224|    const uint8_t *p;
23556|    224|    uint32_t c;
23557|       |
23558|       |    /* skip spaces and comments */
23559|    224|    p = *pp;
23560|  1.04M|    for (;;) {
23561|  1.04M|        switch(c = *p++) {
23562|      0|        case '\r':
  ------------------
  |  Branch (23562:9): [True: 0, False: 1.04M]
  ------------------
23563|  1.04M|        case '\n':
  ------------------
  |  Branch (23563:9): [True: 1.04M, False: 249]
  ------------------
23564|  1.04M|            if (no_line_terminator)
  ------------------
  |  Branch (23564:17): [True: 15, False: 1.04M]
  ------------------
23565|     15|                return '\n';
23566|  1.04M|            continue;
23567|  1.04M|        case ' ':
  ------------------
  |  Branch (23567:9): [True: 34, False: 1.04M]
  ------------------
23568|     37|        case '\t':
  ------------------
  |  Branch (23568:9): [True: 3, False: 1.04M]
  ------------------
23569|     37|        case '\v':
  ------------------
  |  Branch (23569:9): [True: 0, False: 1.04M]
  ------------------
23570|     37|        case '\f':
  ------------------
  |  Branch (23570:9): [True: 0, False: 1.04M]
  ------------------
23571|     37|            continue;
23572|      6|        case '/':
  ------------------
  |  Branch (23572:9): [True: 6, False: 1.04M]
  ------------------
23573|      6|            if (*p == '/') {
  ------------------
  |  Branch (23573:17): [True: 6, False: 0]
  ------------------
23574|      6|                if (no_line_terminator)
  ------------------
  |  Branch (23574:21): [True: 3, False: 3]
  ------------------
23575|      3|                    return '\n';
23576|     16|                while (*p && *p != '\r' && *p != '\n')
  ------------------
  |  Branch (23576:24): [True: 14, False: 2]
  |  Branch (23576:30): [True: 14, False: 0]
  |  Branch (23576:44): [True: 13, False: 1]
  ------------------
23577|     13|                    p++;
23578|      3|                continue;
23579|      6|            }
23580|      0|            if (*p == '*') {
  ------------------
  |  Branch (23580:17): [True: 0, False: 0]
  ------------------
23581|      0|                while (*++p) {
  ------------------
  |  Branch (23581:24): [True: 0, False: 0]
  ------------------
23582|      0|                    if ((*p == '\r' || *p == '\n') && no_line_terminator)
  ------------------
  |  Branch (23582:26): [True: 0, False: 0]
  |  Branch (23582:40): [True: 0, False: 0]
  |  Branch (23582:55): [True: 0, False: 0]
  ------------------
23583|      0|                        return '\n';
23584|      0|                    if (*p == '*' && p[1] == '/') {
  ------------------
  |  Branch (23584:25): [True: 0, False: 0]
  |  Branch (23584:38): [True: 0, False: 0]
  ------------------
23585|      0|                        p += 2;
23586|      0|                        break;
23587|      0|                    }
23588|      0|                }
23589|      0|                continue;
23590|      0|            }
23591|      0|            break;
23592|      9|        case '=':
  ------------------
  |  Branch (23592:9): [True: 9, False: 1.04M]
  ------------------
23593|      9|            if (*p == '>')
  ------------------
  |  Branch (23593:17): [True: 0, False: 9]
  ------------------
23594|      0|                return TOK_ARROW;
23595|      9|            break;
23596|     12|        case 'i':
  ------------------
  |  Branch (23596:9): [True: 12, False: 1.04M]
  ------------------
23597|     12|            if (match_identifier(p, "n"))
  ------------------
  |  Branch (23597:17): [True: 0, False: 12]
  ------------------
23598|      0|                return TOK_IN;
23599|     12|            if (match_identifier(p, "mport")) {
  ------------------
  |  Branch (23599:17): [True: 0, False: 12]
  ------------------
23600|      0|                *pp = p + 5;
23601|      0|                return TOK_IMPORT;
23602|      0|            }
23603|     12|            return TOK_IDENT;
23604|      0|        case 'o':
  ------------------
  |  Branch (23604:9): [True: 0, False: 1.04M]
  ------------------
23605|      0|            if (match_identifier(p, "f"))
  ------------------
  |  Branch (23605:17): [True: 0, False: 0]
  ------------------
23606|      0|                return TOK_OF;
23607|      0|            return TOK_IDENT;
23608|      1|        case 'e':
  ------------------
  |  Branch (23608:9): [True: 1, False: 1.04M]
  ------------------
23609|      1|            if (match_identifier(p, "xport"))
  ------------------
  |  Branch (23609:17): [True: 0, False: 1]
  ------------------
23610|      0|                return TOK_EXPORT;
23611|      1|            return TOK_IDENT;
23612|      2|        case 'f':
  ------------------
  |  Branch (23612:9): [True: 2, False: 1.04M]
  ------------------
23613|      2|            if (match_identifier(p, "unction"))
  ------------------
  |  Branch (23613:17): [True: 1, False: 1]
  ------------------
23614|      1|                return TOK_FUNCTION;
23615|      1|            return TOK_IDENT;
23616|      0|        case '\\':
  ------------------
  |  Branch (23616:9): [True: 0, False: 1.04M]
  ------------------
23617|      0|            if (*p == 'u') {
  ------------------
  |  Branch (23617:17): [True: 0, False: 0]
  ------------------
23618|      0|                if (lre_js_is_ident_first(lre_parse_escape(&p, TRUE)))
  ------------------
  |  Branch (23618:21): [True: 0, False: 0]
  ------------------
23619|      0|                    return TOK_IDENT;
23620|      0|            }
23621|      0|            break;
23622|    182|        default:
  ------------------
  |  Branch (23622:9): [True: 182, False: 1.04M]
  ------------------
23623|    182|            if (c >= 128) {
  ------------------
  |  Branch (23623:17): [True: 0, False: 182]
  ------------------
23624|      0|                c = unicode_from_utf8(p - 1, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
23625|      0|                if (no_line_terminator && (c == CP_PS || c == CP_LS))
  ------------------
  |  |21773|      0|#define CP_PS   0x2029
  ------------------
                              if (no_line_terminator && (c == CP_PS || c == CP_LS))
  ------------------
  |  |21772|      0|#define CP_LS   0x2028
  ------------------
  |  Branch (23625:21): [True: 0, False: 0]
  |  Branch (23625:44): [True: 0, False: 0]
  |  Branch (23625:58): [True: 0, False: 0]
  ------------------
23626|      0|                    return '\n';
23627|      0|            }
23628|    182|            if (lre_is_space(c))
  ------------------
  |  Branch (23628:17): [True: 0, False: 182]
  ------------------
23629|      0|                continue;
23630|    182|            if (lre_js_is_ident_first(c))
  ------------------
  |  Branch (23630:17): [True: 1, False: 181]
  ------------------
23631|      1|                return TOK_IDENT;
23632|    181|            break;
23633|  1.04M|        }
23634|    190|        return c;
23635|  1.04M|    }
23636|    224|}
quickjs.c:match_identifier:
23530|     27|static int match_identifier(const uint8_t *p, const char *s) {
23531|     27|    uint32_t c;
23532|    100|    while (*s) {
  ------------------
  |  Branch (23532:12): [True: 87, False: 13]
  ------------------
23533|     87|        if ((uint8_t)*s++ != *p++)
  ------------------
  |  Branch (23533:13): [True: 14, False: 73]
  ------------------
23534|     14|            return 0;
23535|     87|    }
23536|     13|    c = *p;
23537|     13|    if (c >= 128)
  ------------------
  |  Branch (23537:9): [True: 12, False: 1]
  ------------------
23538|     12|        c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|     12|#define UTF8_CHAR_LEN_MAX 6
  ------------------
23539|     13|    return !lre_js_is_ident_next(c);
23540|     27|}
quickjs.c:js_new_module_def:
29548|     51|{
29549|     51|    JSModuleDef *m;
29550|     51|    m = js_mallocz(ctx, sizeof(*m));
29551|     51|    if (!m) {
  ------------------
  |  Branch (29551:9): [True: 0, False: 51]
  ------------------
29552|      0|        JS_FreeAtom(ctx, name);
29553|      0|        return NULL;
29554|      0|    }
29555|     51|    js_rc(m)->ref_count = 1;
29556|     51|    add_gc_object(ctx->rt, &m->header, JS_GC_OBJ_TYPE_MODULE);
29557|     51|    m->module_name = name;
29558|     51|    m->module_ns = JS_UNDEFINED;
  ------------------
  |  |  291|     51|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     51|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29559|     51|    m->func_obj = JS_UNDEFINED;
  ------------------
  |  |  291|     51|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     51|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29560|     51|    m->eval_exception = JS_UNDEFINED;
  ------------------
  |  |  291|     51|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     51|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29561|     51|    m->meta_obj = JS_UNDEFINED;
  ------------------
  |  |  291|     51|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     51|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29562|     51|    m->promise = JS_UNDEFINED;
  ------------------
  |  |  291|     51|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     51|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29563|     51|    m->resolving_funcs[0] = JS_UNDEFINED;
  ------------------
  |  |  291|     51|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     51|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29564|     51|    m->resolving_funcs[1] = JS_UNDEFINED;
  ------------------
  |  |  291|     51|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     51|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29565|     51|    m->private_value = JS_UNDEFINED;
  ------------------
  |  |  291|     51|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     51|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29566|     51|    list_add_tail(&m->link, &ctx->loaded_modules);
29567|     51|    return m;
29568|     51|}
quickjs.c:add_export_entry2:
29684|  1.66k|{
29685|  1.66k|    JSExportEntry *me;
29686|       |
29687|  1.66k|    if (find_export_entry(ctx, m, export_name)) {
  ------------------
  |  Branch (29687:9): [True: 0, False: 1.66k]
  ------------------
29688|      0|        char buf1[ATOM_GET_STR_BUF_SIZE];
29689|      0|        if (s) {
  ------------------
  |  Branch (29689:13): [True: 0, False: 0]
  ------------------
29690|      0|            js_parse_error(s, "duplicate exported name '%s'",
29691|      0|                           JS_AtomGetStr(ctx, buf1, sizeof(buf1), export_name));
29692|      0|        } else {
29693|      0|            JS_ThrowSyntaxErrorAtom(ctx, "duplicate exported name '%s'", export_name);
  ------------------
  |  | 7732|      0|#define JS_ThrowSyntaxErrorAtom(ctx, fmt, atom) __JS_ThrowSyntaxErrorAtom(ctx, atom, fmt, "")
  ------------------
29694|      0|        }
29695|      0|        return NULL;
29696|      0|    }
29697|       |
29698|  1.66k|    if (js_resize_array(ctx, (void **)&m->export_entries,
  ------------------
  |  Branch (29698:9): [True: 0, False: 1.66k]
  ------------------
29699|  1.66k|                        sizeof(JSExportEntry),
29700|  1.66k|                        &m->export_entries_size,
29701|  1.66k|                        m->export_entries_count + 1))
29702|      0|        return NULL;
29703|  1.66k|    me = &m->export_entries[m->export_entries_count++];
29704|  1.66k|    memset(me, 0, sizeof(*me));
29705|  1.66k|    me->local_name = JS_DupAtom(ctx, local_name);
29706|  1.66k|    me->export_name = JS_DupAtom(ctx, export_name);
29707|  1.66k|    me->export_type = export_type;
29708|  1.66k|    return me;
29709|  1.66k|}
quickjs.c:find_export_entry:
29669|  3.23k|{
29670|  3.23k|    JSExportEntry *me;
29671|  3.23k|    int i;
29672|  96.8k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (29672:16): [True: 95.1k, False: 1.66k]
  ------------------
29673|  95.1k|        me = &m->export_entries[i];
29674|  95.1k|        if (me->export_name == export_name)
  ------------------
  |  Branch (29674:13): [True: 1.56k, False: 93.5k]
  ------------------
29675|  1.56k|            return me;
29676|  95.1k|    }
29677|  1.66k|    return NULL;
29678|  3.23k|}
quickjs.c:js_build_module_ns:
30291|     34|{
30292|     34|    JSValue obj;
30293|     34|    JSObject *p;
30294|     34|    GetExportNamesState s_s, *s = &s_s;
30295|     34|    int i, ret;
30296|     34|    JSProperty *pr;
30297|       |
30298|     34|    obj = JS_NewObjectClass(ctx, JS_CLASS_MODULE_NS);
30299|     34|    if (JS_IsException(obj))
  ------------------
  |  Branch (30299:9): [True: 0, False: 34]
  ------------------
30300|      0|        return obj;
30301|     34|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|     34|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     34|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30302|       |
30303|     34|    memset(s, 0, sizeof(*s));
30304|     34|    ret = get_exported_names(ctx, s, m, FALSE);
30305|     34|    js_free(ctx, s->modules);
30306|     34|    if (ret)
  ------------------
  |  Branch (30306:9): [True: 0, False: 34]
  ------------------
30307|      0|        goto fail;
30308|       |
30309|       |    /* Resolve the exported names. The ambiguous exports are removed */
30310|  1.70k|    for(i = 0; i < s->exported_names_count; i++) {
  ------------------
  |  Branch (30310:16): [True: 1.66k, False: 34]
  ------------------
30311|  1.66k|        ExportedNameEntry *en = &s->exported_names[i];
30312|  1.66k|        JSResolveResultEnum res;
30313|  1.66k|        JSExportEntry *res_me;
30314|  1.66k|        JSModuleDef *res_m;
30315|       |
30316|  1.66k|        if (en->u.me) {
  ------------------
  |  Branch (30316:13): [True: 1.66k, False: 0]
  ------------------
30317|  1.66k|            res_me = en->u.me; /* fast case: no resolution needed */
30318|  1.66k|            res_m = m;
30319|  1.66k|            res = JS_RESOLVE_RES_FOUND;
30320|  1.66k|        } else {
30321|      0|            res = js_resolve_export(ctx, &res_m, &res_me, m,
30322|      0|                                    en->export_name);
30323|      0|        }
30324|  1.66k|        if (res != JS_RESOLVE_RES_FOUND) {
  ------------------
  |  Branch (30324:13): [True: 0, False: 1.66k]
  ------------------
30325|      0|            if (res != JS_RESOLVE_RES_AMBIGUOUS) {
  ------------------
  |  Branch (30325:17): [True: 0, False: 0]
  ------------------
30326|      0|                js_resolve_export_throw_error(ctx, res, m, en->export_name);
30327|      0|                goto fail;
30328|      0|            }
30329|      0|            en->export_type = EXPORTED_NAME_AMBIGUOUS;
30330|  1.66k|        } else {
30331|  1.66k|            if (res_me->local_name == JS_ATOM__star_) {
  ------------------
  |  Branch (30331:17): [True: 0, False: 1.66k]
  ------------------
30332|      0|                en->export_type = EXPORTED_NAME_DELAYED;
30333|  1.66k|            } else {
30334|  1.66k|                if (res_me->u.local.var_ref) {
  ------------------
  |  Branch (30334:21): [True: 1.66k, False: 0]
  ------------------
30335|  1.66k|                    en->u.var_ref = res_me->u.local.var_ref;
30336|  1.66k|                } else {
30337|      0|                    JSObject *p1 = JS_VALUE_GET_OBJ(res_m->func_obj);
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30338|      0|                    en->u.var_ref = p1->u.func.var_refs[res_me->u.local.var_idx];
30339|      0|                }
30340|  1.66k|                if (en->u.var_ref == NULL)
  ------------------
  |  Branch (30340:21): [True: 0, False: 1.66k]
  ------------------
30341|      0|                    en->export_type = EXPORTED_NAME_DELAYED;
30342|  1.66k|                else
30343|  1.66k|                    en->export_type = EXPORTED_NAME_NORMAL;
30344|  1.66k|            }
30345|  1.66k|        }
30346|  1.66k|    }
30347|       |
30348|       |    /* sort the exported names */
30349|     34|    rqsort(s->exported_names, s->exported_names_count,
30350|     34|           sizeof(s->exported_names[0]), exported_names_cmp, ctx);
30351|       |
30352|  1.70k|    for(i = 0; i < s->exported_names_count; i++) {
  ------------------
  |  Branch (30352:16): [True: 1.66k, False: 34]
  ------------------
30353|  1.66k|        ExportedNameEntry *en = &s->exported_names[i];
30354|  1.66k|        switch(en->export_type) {
30355|  1.66k|        case EXPORTED_NAME_NORMAL:
  ------------------
  |  Branch (30355:9): [True: 1.66k, False: 0]
  ------------------
30356|  1.66k|            {
30357|  1.66k|                JSVarRef *var_ref = en->u.var_ref;
30358|  1.66k|                pr = add_property(ctx, p, en->export_name,
30359|  1.66k|                                  JS_PROP_ENUMERABLE | JS_PROP_WRITABLE |
  ------------------
  |  |  300|  1.66k|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                                                JS_PROP_ENUMERABLE | JS_PROP_WRITABLE |
  ------------------
  |  |  299|  1.66k|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
30360|  1.66k|                                  JS_PROP_VARREF);
  ------------------
  |  |  306|  1.66k|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
30361|  1.66k|                if (!pr)
  ------------------
  |  Branch (30361:21): [True: 0, False: 1.66k]
  ------------------
30362|      0|                    goto fail;
30363|  1.66k|                js_rc(var_ref)->ref_count++;
30364|  1.66k|                pr->u.var_ref = var_ref;
30365|  1.66k|            }
30366|      0|            break;
30367|      0|        case EXPORTED_NAME_DELAYED:
  ------------------
  |  Branch (30367:9): [True: 0, False: 1.66k]
  ------------------
30368|       |            /* the exported namespace or reference may depend on
30369|       |               circular references, so we resolve it lazily */
30370|      0|            if (JS_DefineAutoInitProperty(ctx, obj,
  ------------------
  |  Branch (30370:17): [True: 0, False: 0]
  ------------------
30371|      0|                                          en->export_name,
30372|      0|                                          JS_AUTOINIT_ID_MODULE_NS,
30373|      0|                                          m, JS_PROP_ENUMERABLE | JS_PROP_WRITABLE) < 0)
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                                                        m, JS_PROP_ENUMERABLE | JS_PROP_WRITABLE) < 0)
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
30374|      0|                goto fail;
30375|      0|            break;
30376|      0|        default:
  ------------------
  |  Branch (30376:9): [True: 0, False: 1.66k]
  ------------------
30377|      0|            break;
30378|  1.66k|        }
30379|  1.66k|    }
30380|       |
30381|     34|    js_free(ctx, s->exported_names);
30382|       |
30383|     34|    JS_DefinePropertyValue(ctx, obj, JS_ATOM_Symbol_toStringTag,
30384|     34|                           JS_AtomToString(ctx, JS_ATOM_Module),
30385|     34|                           0);
30386|       |
30387|     34|    p->extensible = FALSE;
30388|     34|    return obj;
30389|      0| fail:
30390|      0|    js_free(ctx, s->exported_names);
30391|      0|    JS_FreeValue(ctx, obj);
30392|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
30393|     34|}
quickjs.c:get_exported_names:
30182|     34|{
30183|     34|    ExportedNameEntry *en;
30184|     34|    int i, j;
30185|       |
30186|       |    /* check circular reference */
30187|     34|    for(i = 0; i < s->modules_count; i++) {
  ------------------
  |  Branch (30187:16): [True: 0, False: 34]
  ------------------
30188|      0|        if (s->modules[i] == m)
  ------------------
  |  Branch (30188:13): [True: 0, False: 0]
  ------------------
30189|      0|            return 0;
30190|      0|    }
30191|     34|    if (js_resize_array(ctx, (void **)&s->modules, sizeof(s->modules[0]),
  ------------------
  |  Branch (30191:9): [True: 0, False: 34]
  ------------------
30192|     34|                        &s->modules_size, s->modules_count + 1))
30193|      0|        return -1;
30194|     34|    s->modules[s->modules_count++] = m;
30195|       |
30196|  1.70k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (30196:16): [True: 1.66k, False: 34]
  ------------------
30197|  1.66k|        JSExportEntry *me = &m->export_entries[i];
30198|  1.66k|        if (from_star && me->export_name == JS_ATOM_default)
  ------------------
  |  Branch (30198:13): [True: 0, False: 1.66k]
  |  Branch (30198:26): [True: 0, False: 0]
  ------------------
30199|      0|            continue;
30200|  1.66k|        j = find_exported_name(s, me->export_name);
30201|  1.66k|        if (j < 0) {
  ------------------
  |  Branch (30201:13): [True: 1.66k, False: 0]
  ------------------
30202|  1.66k|            if (js_resize_array(ctx, (void **)&s->exported_names, sizeof(s->exported_names[0]),
  ------------------
  |  Branch (30202:17): [True: 0, False: 1.66k]
  ------------------
30203|  1.66k|                                &s->exported_names_size,
30204|  1.66k|                                s->exported_names_count + 1))
30205|      0|                return -1;
30206|  1.66k|            en = &s->exported_names[s->exported_names_count++];
30207|  1.66k|            en->export_name = me->export_name;
30208|       |            /* avoid a second lookup for simple module exports */
30209|  1.66k|            if (from_star || me->export_type != JS_EXPORT_TYPE_LOCAL)
  ------------------
  |  Branch (30209:17): [True: 0, False: 1.66k]
  |  Branch (30209:30): [True: 0, False: 1.66k]
  ------------------
30210|      0|                en->u.me = NULL;
30211|  1.66k|            else
30212|  1.66k|                en->u.me = me;
30213|  1.66k|        } else {
30214|      0|            en = &s->exported_names[j];
30215|      0|            en->u.me = NULL;
30216|      0|        }
30217|  1.66k|    }
30218|     34|    for(i = 0; i < m->star_export_entries_count; i++) {
  ------------------
  |  Branch (30218:16): [True: 0, False: 34]
  ------------------
30219|      0|        JSStarExportEntry *se = &m->star_export_entries[i];
30220|      0|        JSModuleDef *m1;
30221|      0|        m1 = m->req_module_entries[se->req_module_idx].module;
30222|      0|        if (get_exported_names(ctx, s, m1, TRUE))
  ------------------
  |  Branch (30222:13): [True: 0, False: 0]
  ------------------
30223|      0|            return -1;
30224|      0|    }
30225|     34|    return 0;
30226|     34|}
quickjs.c:find_exported_name:
30170|  1.66k|{
30171|  1.66k|    int i;
30172|  49.8k|    for(i = 0; i < s->exported_names_count; i++) {
  ------------------
  |  Branch (30172:16): [True: 48.2k, False: 1.66k]
  ------------------
30173|  48.2k|        if (s->exported_names[i].export_name == name)
  ------------------
  |  Branch (30173:13): [True: 0, False: 48.2k]
  ------------------
30174|      0|            return i;
30175|  48.2k|    }
30176|  1.66k|    return -1;
30177|  1.66k|}
quickjs.c:exported_names_cmp:
30239|  8.26k|{
30240|  8.26k|    JSContext *ctx = opaque;
30241|  8.26k|    const ExportedNameEntry *me1 = p1;
30242|  8.26k|    const ExportedNameEntry *me2 = p2;
30243|  8.26k|    JSValue str1, str2;
30244|  8.26k|    int ret;
30245|       |
30246|       |    /* XXX: should avoid allocation memory in atom comparison */
30247|  8.26k|    str1 = JS_AtomToString(ctx, me1->export_name);
30248|  8.26k|    str2 = JS_AtomToString(ctx, me2->export_name);
30249|  8.26k|    if (JS_IsException(str1) || JS_IsException(str2)) {
  ------------------
  |  Branch (30249:9): [True: 0, False: 8.26k]
  |  Branch (30249:33): [True: 0, False: 8.26k]
  ------------------
30250|       |        /* XXX: raise an error ? */
30251|      0|        ret = 0;
30252|  8.26k|    } else {
30253|  8.26k|        ret = js_string_compare(ctx, JS_VALUE_GET_STRING(str1),
  ------------------
  |  |  230|  8.26k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  8.26k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30254|  8.26k|                                JS_VALUE_GET_STRING(str2));
  ------------------
  |  |  230|  8.26k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  8.26k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30255|  8.26k|    }
30256|  8.26k|    JS_FreeValue(ctx, str1);
30257|  8.26k|    JS_FreeValue(ctx, str2);
30258|  8.26k|    return ret;
30259|  8.26k|}
quickjs.c:js_class_has_bytecode:
 5864|     24|{
 5865|     24|    return (class_id == JS_CLASS_BYTECODE_FUNCTION ||
  ------------------
  |  Branch (5865:13): [True: 21, False: 3]
  ------------------
 5866|      3|            class_id == JS_CLASS_GENERATOR_FUNCTION ||
  ------------------
  |  Branch (5866:13): [True: 0, False: 3]
  ------------------
 5867|      3|            class_id == JS_CLASS_ASYNC_FUNCTION ||
  ------------------
  |  Branch (5867:13): [True: 0, False: 3]
  ------------------
 5868|      3|            class_id == JS_CLASS_ASYNC_GENERATOR_FUNCTION);
  ------------------
  |  Branch (5868:13): [True: 0, False: 3]
  ------------------
 5869|     24|}
quickjs.c:js_host_resolve_imported_module:
29899|     34|{
29900|     34|    JSRuntime *rt = ctx->rt;
29901|     34|    JSModuleDef *m;
29902|     34|    char *cname;
29903|     34|    JSAtom module_name;
29904|       |
29905|     34|    if (!rt->module_normalize_func) {
  ------------------
  |  Branch (29905:9): [True: 34, False: 0]
  ------------------
29906|     34|        cname = js_default_module_normalize_name(ctx, base_cname, cname1);
29907|     34|    } else {
29908|      0|        cname = rt->module_normalize_func(ctx, base_cname, cname1,
29909|      0|                                          rt->module_loader_opaque);
29910|      0|    }
29911|     34|    if (!cname)
  ------------------
  |  Branch (29911:9): [True: 0, False: 34]
  ------------------
29912|      0|        return NULL;
29913|       |
29914|     34|    module_name = JS_NewAtom(ctx, cname);
29915|     34|    if (module_name == JS_ATOM_NULL) {
  ------------------
  |  |  451|     34|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (29915:9): [True: 0, False: 34]
  ------------------
29916|      0|        js_free(ctx, cname);
29917|      0|        return NULL;
29918|      0|    }
29919|       |
29920|       |    /* first look at the loaded modules */
29921|     34|    m = js_find_loaded_module(ctx, module_name);
29922|     34|    if (m) {
  ------------------
  |  Branch (29922:9): [True: 34, False: 0]
  ------------------
29923|     34|        js_free(ctx, cname);
29924|     34|        JS_FreeAtom(ctx, module_name);
29925|     34|        return m;
29926|     34|    }
29927|       |
29928|      0|    JS_FreeAtom(ctx, module_name);
29929|       |
29930|       |    /* load the module */
29931|      0|    if (!rt->u.module_loader_func) {
  ------------------
  |  Branch (29931:9): [True: 0, False: 0]
  ------------------
29932|       |        /* XXX: use a syntax error ? */
29933|      0|        JS_ThrowReferenceError(ctx, "could not load module '%s'",
29934|      0|                               cname);
29935|      0|        js_free(ctx, cname);
29936|      0|        return NULL;
29937|      0|    }
29938|      0|    if (rt->module_loader_has_attr) {
  ------------------
  |  Branch (29938:9): [True: 0, False: 0]
  ------------------
29939|      0|        m = rt->u.module_loader_func2(ctx, cname, rt->module_loader_opaque, attributes);
29940|      0|    } else {
29941|      0|        m = rt->u.module_loader_func(ctx, cname, rt->module_loader_opaque);
29942|      0|    }
29943|      0|    js_free(ctx, cname);
29944|      0|    return m;
29945|      0|}
quickjs.c:js_default_module_normalize_name:
29824|     34|{
29825|     34|    char *filename, *p;
29826|     34|    const char *r;
29827|     34|    int cap;
29828|     34|    int len;
29829|       |
29830|     34|    if (name[0] != '.') {
  ------------------
  |  Branch (29830:9): [True: 34, False: 0]
  ------------------
29831|       |        /* if no initial dot, the module name is not modified */
29832|     34|        return js_strdup(ctx, name);
29833|     34|    }
29834|       |
29835|      0|    p = strrchr(base_name, '/');
29836|      0|    if (p)
  ------------------
  |  Branch (29836:9): [True: 0, False: 0]
  ------------------
29837|      0|        len = p - base_name;
29838|      0|    else
29839|      0|        len = 0;
29840|       |
29841|      0|    cap = len + strlen(name) + 1 + 1;
29842|      0|    filename = js_malloc(ctx, cap);
29843|      0|    if (!filename)
  ------------------
  |  Branch (29843:9): [True: 0, False: 0]
  ------------------
29844|      0|        return NULL;
29845|      0|    memcpy(filename, base_name, len);
29846|      0|    filename[len] = '\0';
29847|       |
29848|       |    /* we only normalize the leading '..' or '.' */
29849|      0|    r = name;
29850|      0|    for(;;) {
29851|      0|        if (r[0] == '.' && r[1] == '/') {
  ------------------
  |  Branch (29851:13): [True: 0, False: 0]
  |  Branch (29851:28): [True: 0, False: 0]
  ------------------
29852|      0|            r += 2;
29853|      0|        } else if (r[0] == '.' && r[1] == '.' && r[2] == '/') {
  ------------------
  |  Branch (29853:20): [True: 0, False: 0]
  |  Branch (29853:35): [True: 0, False: 0]
  |  Branch (29853:50): [True: 0, False: 0]
  ------------------
29854|       |            /* remove the last path element of filename, except if "."
29855|       |               or ".." */
29856|      0|            if (filename[0] == '\0')
  ------------------
  |  Branch (29856:17): [True: 0, False: 0]
  ------------------
29857|      0|                break;
29858|      0|            p = strrchr(filename, '/');
29859|      0|            if (!p)
  ------------------
  |  Branch (29859:17): [True: 0, False: 0]
  ------------------
29860|      0|                p = filename;
29861|      0|            else
29862|      0|                p++;
29863|      0|            if (!strcmp(p, ".") || !strcmp(p, ".."))
  ------------------
  |  Branch (29863:17): [True: 0, False: 0]
  |  Branch (29863:36): [True: 0, False: 0]
  ------------------
29864|      0|                break;
29865|      0|            if (p > filename)
  ------------------
  |  Branch (29865:17): [True: 0, False: 0]
  ------------------
29866|      0|                p--;
29867|      0|            *p = '\0';
29868|      0|            r += 3;
29869|      0|        } else {
29870|      0|            break;
29871|      0|        }
29872|      0|    }
29873|      0|    if (filename[0] != '\0')
  ------------------
  |  Branch (29873:9): [True: 0, False: 0]
  ------------------
29874|      0|        pstrcat(filename, cap, "/");
29875|      0|    pstrcat(filename, cap, r);
29876|       |    //    printf("normalize: %s %s -> %s\n", base_name, name, filename);
29877|      0|    return filename;
29878|      0|}
quickjs.c:JS_NewModuleValue:
30813|     17|{
30814|     17|    return JS_DupValue(ctx, JS_MKPTR(JS_TAG_MODULE, m));
  ------------------
  |  |  248|     17|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
30815|     17|}
quickjs.c:JS_SpeciesConstructor:
40720|      2|{
40721|      2|    JSValue ctor, species;
40722|       |
40723|      2|    if (!JS_IsObject(obj))
  ------------------
  |  Branch (40723:9): [True: 0, False: 2]
  ------------------
40724|      0|        return JS_ThrowTypeErrorNotAnObject(ctx);
40725|      2|    ctor = JS_GetProperty(ctx, obj, JS_ATOM_constructor);
40726|      2|    if (JS_IsException(ctor))
  ------------------
  |  Branch (40726:9): [True: 0, False: 2]
  ------------------
40727|      0|        return ctor;
40728|      2|    if (JS_IsUndefined(ctor))
  ------------------
  |  Branch (40728:9): [True: 0, False: 2]
  ------------------
40729|      0|        return JS_DupValue(ctx, defaultConstructor);
40730|      2|    if (!JS_IsObject(ctor)) {
  ------------------
  |  Branch (40730:9): [True: 0, False: 2]
  ------------------
40731|      0|        JS_FreeValue(ctx, ctor);
40732|      0|        return JS_ThrowTypeErrorNotAnObject(ctx);
40733|      0|    }
40734|      2|    species = JS_GetProperty(ctx, ctor, JS_ATOM_Symbol_species);
40735|      2|    JS_FreeValue(ctx, ctor);
40736|      2|    if (JS_IsException(species))
  ------------------
  |  Branch (40736:9): [True: 0, False: 2]
  ------------------
40737|      0|        return species;
40738|      2|    if (JS_IsUndefined(species) || JS_IsNull(species))
  ------------------
  |  Branch (40738:9): [True: 0, False: 2]
  |  Branch (40738:36): [True: 0, False: 2]
  ------------------
40739|      0|        return JS_DupValue(ctx, defaultConstructor);
40740|      2|    if (!JS_IsConstructor(ctx, species)) {
  ------------------
  |  Branch (40740:9): [True: 0, False: 2]
  ------------------
40741|      0|        JS_ThrowTypeErrorNotAConstructor(ctx, species);
40742|      0|        JS_FreeValue(ctx, species);
40743|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
40744|      0|    }
40745|      2|    return species;
40746|      2|}
quickjs.c:JS_EvalFunctionInternal:
37034|     29|{
37035|     29|    JSValue ret_val;
37036|     29|    uint32_t tag;
37037|       |
37038|     29|    tag = JS_VALUE_GET_TAG(fun_obj);
  ------------------
  |  |  236|     29|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
37039|     29|    if (tag == JS_TAG_FUNCTION_BYTECODE) {
  ------------------
  |  Branch (37039:9): [True: 12, False: 17]
  ------------------
37040|     12|        fun_obj = js_closure(ctx, fun_obj, var_refs, sf, TRUE);
37041|     12|        if (JS_IsException(fun_obj))
  ------------------
  |  Branch (37041:13): [True: 0, False: 12]
  ------------------
37042|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
37043|     12|        ret_val = JS_CallFree(ctx, fun_obj, this_obj, 0, NULL);
37044|     17|    } else if (tag == JS_TAG_MODULE) {
  ------------------
  |  Branch (37044:16): [True: 17, False: 0]
  ------------------
37045|     17|        JSModuleDef *m;
37046|     17|        m = JS_VALUE_GET_PTR(fun_obj);
  ------------------
  |  |  243|     17|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
37047|       |        /* the module refcount should be >= 2 */
37048|     17|        JS_FreeValue(ctx, fun_obj);
37049|     17|        if (js_create_module_function(ctx, m) < 0)
  ------------------
  |  Branch (37049:13): [True: 0, False: 17]
  ------------------
37050|      0|            goto fail;
37051|     17|        if (js_link_module(ctx, m) < 0)
  ------------------
  |  Branch (37051:13): [True: 1, False: 16]
  ------------------
37052|      1|            goto fail;
37053|     16|        ret_val = js_evaluate_module(ctx, m);
37054|     16|        if (JS_IsException(ret_val)) {
  ------------------
  |  Branch (37054:13): [True: 0, False: 16]
  ------------------
37055|      1|        fail:
37056|      1|            return JS_EXCEPTION;
  ------------------
  |  |  294|      1|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
37057|      0|        }
37058|     16|    } else {
37059|      0|        JS_FreeValue(ctx, fun_obj);
37060|      0|        ret_val = JS_ThrowTypeError(ctx, "bytecode function expected");
37061|      0|    }
37062|     28|    return ret_val;
37063|     29|}
quickjs.c:js_create_module_function:
30464|     51|{
30465|     51|    BOOL is_c_module;
30466|     51|    int i;
30467|     51|    JSVarRef *var_ref;
30468|       |
30469|     51|    if (m->func_created)
  ------------------
  |  Branch (30469:9): [True: 0, False: 51]
  ------------------
30470|      0|        return 0;
30471|       |
30472|     51|    is_c_module = (m->init_func != NULL);
30473|       |
30474|     51|    if (is_c_module) {
  ------------------
  |  Branch (30474:9): [True: 34, False: 17]
  ------------------
30475|       |        /* initialize the exported variables */
30476|  1.70k|        for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (30476:20): [True: 1.66k, False: 34]
  ------------------
30477|  1.66k|            JSExportEntry *me = &m->export_entries[i];
30478|  1.66k|            if (me->export_type == JS_EXPORT_TYPE_LOCAL) {
  ------------------
  |  Branch (30478:17): [True: 1.66k, False: 0]
  ------------------
30479|  1.66k|                var_ref = js_create_var_ref(ctx, FALSE);
30480|  1.66k|                if (!var_ref)
  ------------------
  |  Branch (30480:21): [True: 0, False: 1.66k]
  ------------------
30481|      0|                    return -1;
30482|  1.66k|                me->u.local.var_ref = var_ref;
30483|  1.66k|            }
30484|  1.66k|        }
30485|     34|    } else {
30486|     17|        if (js_create_module_bytecode_function(ctx, m))
  ------------------
  |  Branch (30486:13): [True: 0, False: 17]
  ------------------
30487|      0|            return -1;
30488|     17|    }
30489|     51|    m->func_created = TRUE;
30490|       |
30491|       |    /* do it on the dependencies */
30492|       |
30493|     85|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (30493:16): [True: 34, False: 51]
  ------------------
30494|     34|        JSReqModuleEntry *rme = &m->req_module_entries[i];
30495|     34|        if (js_create_module_function(ctx, rme->module) < 0)
  ------------------
  |  Branch (30495:13): [True: 0, False: 34]
  ------------------
30496|      0|            return -1;
30497|     34|    }
30498|       |
30499|     51|    return 0;
30500|     51|}
quickjs.c:js_create_module_bytecode_function:
30441|     17|{
30442|     17|    JSFunctionBytecode *b;
30443|     17|    JSValue func_obj, bfunc;
30444|       |
30445|     17|    bfunc = m->func_obj;
30446|     17|    func_obj = JS_NewObjectProtoClass(ctx, ctx->function_proto,
30447|     17|                                      JS_CLASS_BYTECODE_FUNCTION);
30448|       |
30449|     17|    if (JS_IsException(func_obj))
  ------------------
  |  Branch (30449:9): [True: 0, False: 17]
  ------------------
30450|      0|        return -1;
30451|     17|    m->func_obj = func_obj;
30452|     17|    b = JS_VALUE_GET_PTR(bfunc);
  ------------------
  |  |  243|     17|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
30453|     17|    func_obj = js_closure2(ctx, func_obj, b, NULL, NULL, TRUE, m);
30454|     17|    if (JS_IsException(func_obj)) {
  ------------------
  |  Branch (30454:9): [True: 0, False: 17]
  ------------------
30455|      0|        m->func_obj = JS_UNDEFINED; /* XXX: keep it ? */
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
30456|      0|        JS_FreeValue(ctx, func_obj);
30457|      0|        return -1;
30458|      0|    }
30459|     17|    return 0;
30460|     17|}
quickjs.c:js_link_module:
30705|     17|{
30706|     17|    JSModuleDef *stack_top, *m1;
30707|       |
30708|       |#ifdef DUMP_MODULE_RESOLVE
30709|       |    {
30710|       |        char buf1[ATOM_GET_STR_BUF_SIZE];
30711|       |        printf("js_link_module '%s':\n", JS_AtomGetStr(ctx, buf1, sizeof(buf1), m->module_name));
30712|       |    }
30713|       |#endif
30714|     17|    assert(m->status == JS_MODULE_STATUS_UNLINKED ||
  ------------------
  |  Branch (30714:5): [True: 17, False: 0]
  |  Branch (30714:5): [True: 0, False: 0]
  |  Branch (30714:5): [True: 0, False: 0]
  |  Branch (30714:5): [True: 0, False: 0]
  |  Branch (30714:5): [True: 17, False: 0]
  |  Branch (30714:5): [True: 0, False: 0]
  |  Branch (30714:5): [True: 0, False: 0]
  |  Branch (30714:5): [True: 0, False: 0]
  ------------------
30715|     17|           m->status == JS_MODULE_STATUS_LINKED ||
30716|     17|           m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
30717|     17|           m->status == JS_MODULE_STATUS_EVALUATED);
30718|     17|    stack_top = NULL;
30719|     17|    if (js_inner_module_linking(ctx, m, &stack_top, 0) < 0) {
  ------------------
  |  Branch (30719:9): [True: 1, False: 16]
  ------------------
30720|      2|        while (stack_top != NULL) {
  ------------------
  |  Branch (30720:16): [True: 1, False: 1]
  ------------------
30721|      1|            m1 = stack_top;
30722|      1|            assert(m1->status == JS_MODULE_STATUS_LINKING);
  ------------------
  |  Branch (30722:13): [True: 0, False: 1]
  |  Branch (30722:13): [True: 1, False: 0]
  ------------------
30723|      1|            m1->status = JS_MODULE_STATUS_UNLINKED;
30724|      1|            stack_top = m1->stack_prev;
30725|      1|        }
30726|      1|        return -1;
30727|      1|    }
30728|     17|    assert(stack_top == NULL);
  ------------------
  |  Branch (30728:5): [True: 0, False: 16]
  |  Branch (30728:5): [True: 16, False: 0]
  ------------------
30729|     16|    assert(m->status == JS_MODULE_STATUS_LINKED ||
  ------------------
  |  Branch (30729:5): [True: 16, False: 0]
  |  Branch (30729:5): [True: 0, False: 0]
  |  Branch (30729:5): [True: 0, False: 0]
  |  Branch (30729:5): [True: 16, False: 0]
  |  Branch (30729:5): [True: 0, False: 0]
  |  Branch (30729:5): [True: 0, False: 0]
  ------------------
30730|     16|           m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
30731|     16|           m->status == JS_MODULE_STATUS_EVALUATED);
30732|     16|    return 0;
30733|     16|}
quickjs.c:js_inner_module_linking:
30507|     51|{
30508|     51|    int i;
30509|     51|    JSImportEntry *mi;
30510|     51|    JSModuleDef *m1;
30511|     51|    JSVarRef **var_refs, *var_ref;
30512|     51|    JSObject *p;
30513|     51|    BOOL is_c_module;
30514|     51|    JSValue ret_val;
30515|       |
30516|     51|    if (js_check_stack_overflow(ctx->rt, 0)) {
  ------------------
  |  Branch (30516:9): [True: 0, False: 51]
  ------------------
30517|      0|        JS_ThrowStackOverflow(ctx);
30518|      0|        return -1;
30519|      0|    }
30520|       |
30521|       |#ifdef DUMP_MODULE_RESOLVE
30522|       |    {
30523|       |        char buf1[ATOM_GET_STR_BUF_SIZE];
30524|       |        printf("js_inner_module_linking '%s':\n", JS_AtomGetStr(ctx, buf1, sizeof(buf1), m->module_name));
30525|       |    }
30526|       |#endif
30527|       |
30528|     51|    if (m->status == JS_MODULE_STATUS_LINKING ||
  ------------------
  |  Branch (30528:9): [True: 0, False: 51]
  ------------------
30529|     51|        m->status == JS_MODULE_STATUS_LINKED ||
  ------------------
  |  Branch (30529:9): [True: 0, False: 51]
  ------------------
30530|     51|        m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (30530:9): [True: 0, False: 51]
  ------------------
30531|     51|        m->status == JS_MODULE_STATUS_EVALUATED)
  ------------------
  |  Branch (30531:9): [True: 0, False: 51]
  ------------------
30532|      0|        return index;
30533|       |
30534|     51|    assert(m->status == JS_MODULE_STATUS_UNLINKED);
  ------------------
  |  Branch (30534:5): [True: 0, False: 51]
  |  Branch (30534:5): [True: 51, False: 0]
  ------------------
30535|     51|    m->status = JS_MODULE_STATUS_LINKING;
30536|     51|    m->dfs_index = index;
30537|     51|    m->dfs_ancestor_index = index;
30538|     51|    index++;
30539|       |    /* push 'm' on stack */
30540|     51|    m->stack_prev = *pstack_top;
30541|     51|    *pstack_top = m;
30542|       |
30543|     85|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (30543:16): [True: 34, False: 51]
  ------------------
30544|     34|        JSReqModuleEntry *rme = &m->req_module_entries[i];
30545|     34|        m1 = rme->module;
30546|     34|        index = js_inner_module_linking(ctx, m1, pstack_top, index);
30547|     34|        if (index < 0)
  ------------------
  |  Branch (30547:13): [True: 0, False: 34]
  ------------------
30548|      0|            goto fail;
30549|     34|        assert(m1->status == JS_MODULE_STATUS_LINKING ||
  ------------------
  |  Branch (30549:9): [True: 34, False: 0]
  |  Branch (30549:9): [True: 0, False: 0]
  |  Branch (30549:9): [True: 0, False: 0]
  |  Branch (30549:9): [True: 0, False: 0]
  |  Branch (30549:9): [True: 0, False: 34]
  |  Branch (30549:9): [True: 34, False: 0]
  |  Branch (30549:9): [True: 0, False: 0]
  |  Branch (30549:9): [True: 0, False: 0]
  ------------------
30550|     34|               m1->status == JS_MODULE_STATUS_LINKED ||
30551|     34|               m1->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
30552|     34|               m1->status == JS_MODULE_STATUS_EVALUATED);
30553|     34|        if (m1->status == JS_MODULE_STATUS_LINKING) {
  ------------------
  |  Branch (30553:13): [True: 0, False: 34]
  ------------------
30554|      0|            m->dfs_ancestor_index = min_int(m->dfs_ancestor_index,
30555|      0|                                            m1->dfs_ancestor_index);
30556|      0|        }
30557|     34|    }
30558|       |
30559|       |#ifdef DUMP_MODULE_RESOLVE
30560|       |    {
30561|       |        char buf1[ATOM_GET_STR_BUF_SIZE];
30562|       |        printf("instantiating module '%s':\n", JS_AtomGetStr(ctx, buf1, sizeof(buf1), m->module_name));
30563|       |    }
30564|       |#endif
30565|       |    /* check the indirect exports */
30566|  1.71k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (30566:16): [True: 1.66k, False: 51]
  ------------------
30567|  1.66k|        JSExportEntry *me = &m->export_entries[i];
30568|  1.66k|        if (me->export_type == JS_EXPORT_TYPE_INDIRECT &&
  ------------------
  |  Branch (30568:13): [True: 0, False: 1.66k]
  ------------------
30569|      0|            me->local_name != JS_ATOM__star_) {
  ------------------
  |  Branch (30569:13): [True: 0, False: 0]
  ------------------
30570|      0|            JSResolveResultEnum ret;
30571|      0|            JSExportEntry *res_me;
30572|      0|            JSModuleDef *res_m, *m1;
30573|      0|            m1 = m->req_module_entries[me->u.req_module_idx].module;
30574|      0|            ret = js_resolve_export(ctx, &res_m, &res_me, m1, me->local_name);
30575|      0|            if (ret != JS_RESOLVE_RES_FOUND) {
  ------------------
  |  Branch (30575:17): [True: 0, False: 0]
  ------------------
30576|      0|                js_resolve_export_throw_error(ctx, ret, m, me->export_name);
30577|      0|                goto fail;
30578|      0|            }
30579|      0|        }
30580|  1.66k|    }
30581|       |
30582|       |#ifdef DUMP_MODULE_RESOLVE
30583|       |    {
30584|       |        printf("exported bindings:\n");
30585|       |        for(i = 0; i < m->export_entries_count; i++) {
30586|       |            JSExportEntry *me = &m->export_entries[i];
30587|       |            printf(" name="); print_atom(ctx, me->export_name);
30588|       |            printf(" local="); print_atom(ctx, me->local_name);
30589|       |            printf(" type=%d idx=%d\n", me->export_type, me->u.local.var_idx);
30590|       |        }
30591|       |    }
30592|       |#endif
30593|       |
30594|     51|    is_c_module = (m->init_func != NULL);
30595|       |
30596|     51|    if (!is_c_module) {
  ------------------
  |  Branch (30596:9): [True: 17, False: 34]
  ------------------
30597|     17|        p = JS_VALUE_GET_OBJ(m->func_obj);
  ------------------
  |  |  229|     17|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     17|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30598|     17|        var_refs = p->u.func.var_refs;
30599|       |
30600|     51|        for(i = 0; i < m->import_entries_count; i++) {
  ------------------
  |  Branch (30600:20): [True: 34, False: 17]
  ------------------
30601|     34|            mi = &m->import_entries[i];
30602|       |#ifdef DUMP_MODULE_RESOLVE
30603|       |            printf("import var_idx=%d name=", mi->var_idx);
30604|       |            print_atom(ctx, mi->import_name);
30605|       |            printf(": ");
30606|       |#endif
30607|     34|            m1 = m->req_module_entries[mi->req_module_idx].module;
30608|     34|            if (mi->is_star) {
  ------------------
  |  Branch (30608:17): [True: 34, False: 0]
  ------------------
30609|     34|                JSValue val;
30610|       |                /* name space import */
30611|     34|                val = JS_GetModuleNamespace(ctx, m1);
30612|     34|                if (JS_IsException(val))
  ------------------
  |  Branch (30612:21): [True: 0, False: 34]
  ------------------
30613|      0|                    goto fail;
30614|     34|                set_value(ctx, &var_refs[mi->var_idx]->value, val);
30615|       |#ifdef DUMP_MODULE_RESOLVE
30616|       |                printf("namespace\n");
30617|       |#endif
30618|     34|            } else {
30619|      0|                JSResolveResultEnum ret;
30620|      0|                JSExportEntry *res_me;
30621|      0|                JSModuleDef *res_m;
30622|      0|                JSObject *p1;
30623|       |
30624|      0|                ret = js_resolve_export(ctx, &res_m,
30625|      0|                                        &res_me, m1, mi->import_name);
30626|      0|                if (ret != JS_RESOLVE_RES_FOUND) {
  ------------------
  |  Branch (30626:21): [True: 0, False: 0]
  ------------------
30627|      0|                    js_resolve_export_throw_error(ctx, ret, m1, mi->import_name);
30628|      0|                    goto fail;
30629|      0|                }
30630|      0|                if (res_me->local_name == JS_ATOM__star_) {
  ------------------
  |  Branch (30630:21): [True: 0, False: 0]
  ------------------
30631|      0|                    JSValue val;
30632|      0|                    JSModuleDef *m2;
30633|       |                    /* name space import from */
30634|      0|                    m2 = res_m->req_module_entries[res_me->u.req_module_idx].module;
30635|      0|                    val = JS_GetModuleNamespace(ctx, m2);
30636|      0|                    if (JS_IsException(val))
  ------------------
  |  Branch (30636:25): [True: 0, False: 0]
  ------------------
30637|      0|                        goto fail;
30638|      0|                    var_ref = js_create_var_ref(ctx, TRUE);
30639|      0|                    if (!var_ref) {
  ------------------
  |  Branch (30639:25): [True: 0, False: 0]
  ------------------
30640|      0|                        JS_FreeValue(ctx, val);
30641|      0|                        goto fail;
30642|      0|                    }
30643|      0|                    set_value(ctx, &var_ref->value, val);
30644|      0|                    var_refs[mi->var_idx] = var_ref;
30645|       |#ifdef DUMP_MODULE_RESOLVE
30646|       |                    printf("namespace from\n");
30647|       |#endif
30648|      0|                } else {
30649|      0|                    var_ref = res_me->u.local.var_ref;
30650|      0|                    if (!var_ref) {
  ------------------
  |  Branch (30650:25): [True: 0, False: 0]
  ------------------
30651|      0|                        p1 = JS_VALUE_GET_OBJ(res_m->func_obj);
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30652|      0|                        var_ref = p1->u.func.var_refs[res_me->u.local.var_idx];
30653|      0|                    }
30654|      0|                    js_rc(var_ref)->ref_count++;
30655|      0|                    var_refs[mi->var_idx] = var_ref;
30656|       |#ifdef DUMP_MODULE_RESOLVE
30657|       |                    printf("local export (var_ref=%p)\n", var_ref);
30658|       |#endif
30659|      0|                }
30660|      0|            }
30661|     34|        }
30662|       |
30663|       |        /* keep the exported variables in the module export entries (they
30664|       |           are used when the eval function is deleted and cannot be
30665|       |           initialized before in case imports are exported) */
30666|     17|        for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (30666:20): [True: 0, False: 17]
  ------------------
30667|      0|            JSExportEntry *me = &m->export_entries[i];
30668|      0|            if (me->export_type == JS_EXPORT_TYPE_LOCAL) {
  ------------------
  |  Branch (30668:17): [True: 0, False: 0]
  ------------------
30669|      0|                var_ref = var_refs[me->u.local.var_idx];
30670|      0|                js_rc(var_ref)->ref_count++;
30671|      0|                me->u.local.var_ref = var_ref;
30672|      0|            }
30673|      0|        }
30674|       |
30675|       |        /* initialize the global variables */
30676|     17|        ret_val = JS_Call(ctx, m->func_obj, JS_TRUE, 0, NULL);
  ------------------
  |  |  293|     17|#define JS_TRUE      JS_MKVAL(JS_TAG_BOOL, 1)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
30677|     17|        if (JS_IsException(ret_val))
  ------------------
  |  Branch (30677:13): [True: 1, False: 16]
  ------------------
30678|      1|            goto fail;
30679|     16|        JS_FreeValue(ctx, ret_val);
30680|     16|    }
30681|       |
30682|     51|    assert(m->dfs_ancestor_index <= m->dfs_index);
  ------------------
  |  Branch (30682:5): [True: 0, False: 50]
  |  Branch (30682:5): [True: 50, False: 0]
  ------------------
30683|     50|    if (m->dfs_index == m->dfs_ancestor_index) {
  ------------------
  |  Branch (30683:9): [True: 50, False: 0]
  ------------------
30684|     50|        for(;;) {
30685|       |            /* pop m1 from stack */
30686|     50|            m1 = *pstack_top;
30687|     50|            *pstack_top = m1->stack_prev;
30688|     50|            m1->status = JS_MODULE_STATUS_LINKED;
30689|     50|            if (m1 == m)
  ------------------
  |  Branch (30689:17): [True: 50, False: 0]
  ------------------
30690|     50|                break;
30691|     50|        }
30692|     50|    }
30693|       |
30694|       |#ifdef DUMP_MODULE_RESOLVE
30695|       |    printf("js_inner_module_linking done\n");
30696|       |#endif
30697|     50|    return index;
30698|      1| fail:
30699|      1|    return -1;
30700|     50|}
quickjs.c:js_evaluate_module:
31419|     16|{
31420|     16|    JSModuleDef *m1, *stack_top;
31421|     16|    JSValue ret_val, result;
31422|       |
31423|       |#ifdef DUMP_MODULE_EXEC
31424|       |    js_dump_module(ctx, __func__, m);
31425|       |#endif
31426|     16|    assert(m->status == JS_MODULE_STATUS_LINKED ||
  ------------------
  |  Branch (31426:5): [True: 16, False: 0]
  |  Branch (31426:5): [True: 0, False: 0]
  |  Branch (31426:5): [True: 0, False: 0]
  |  Branch (31426:5): [True: 16, False: 0]
  |  Branch (31426:5): [True: 0, False: 0]
  |  Branch (31426:5): [True: 0, False: 0]
  ------------------
31427|     16|           m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
31428|     16|           m->status == JS_MODULE_STATUS_EVALUATED);
31429|     16|    if (m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (31429:9): [True: 0, False: 16]
  ------------------
31430|     16|        m->status == JS_MODULE_STATUS_EVALUATED) {
  ------------------
  |  Branch (31430:9): [True: 0, False: 16]
  ------------------
31431|      0|        m = m->cycle_root;
31432|      0|    }
31433|       |    /* a promise may be created only on the cycle_root of a cycle */
31434|     16|    if (!JS_IsUndefined(m->promise))
  ------------------
  |  Branch (31434:9): [True: 0, False: 16]
  ------------------
31435|      0|        return JS_DupValue(ctx, m->promise);
31436|     16|    m->promise = JS_NewPromiseCapability(ctx, m->resolving_funcs);
31437|     16|    if (JS_IsException(m->promise))
  ------------------
  |  Branch (31437:9): [True: 0, False: 16]
  ------------------
31438|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
31439|       |
31440|     16|    stack_top = NULL;
31441|     16|    if (js_inner_module_evaluation(ctx, m, 0, &stack_top, &result) < 0) {
  ------------------
  |  Branch (31441:9): [True: 0, False: 16]
  ------------------
31442|      0|        while (stack_top != NULL) {
  ------------------
  |  Branch (31442:16): [True: 0, False: 0]
  ------------------
31443|      0|            m1 = stack_top;
31444|      0|            assert(m1->status == JS_MODULE_STATUS_EVALUATING);
  ------------------
  |  Branch (31444:13): [True: 0, False: 0]
  |  Branch (31444:13): [True: 0, False: 0]
  ------------------
31445|      0|            m1->status = JS_MODULE_STATUS_EVALUATED;
31446|      0|            m1->eval_has_exception = TRUE;
31447|      0|            m1->eval_exception = JS_DupValue(ctx, result);
31448|      0|            m1->cycle_root = m; /* spec bug: should be present */
31449|      0|            stack_top = m1->stack_prev;
31450|      0|        }
31451|      0|        JS_FreeValue(ctx, result);
31452|      0|        assert(m->status == JS_MODULE_STATUS_EVALUATED);
  ------------------
  |  Branch (31452:9): [True: 0, False: 0]
  |  Branch (31452:9): [True: 0, False: 0]
  ------------------
31453|      0|        assert(m->eval_has_exception);
  ------------------
  |  Branch (31453:9): [True: 0, False: 0]
  |  Branch (31453:9): [True: 0, False: 0]
  ------------------
31454|      0|        ret_val = JS_Call(ctx, m->resolving_funcs[1], JS_UNDEFINED,
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
31455|      0|                          1, (JSValueConst *)&m->eval_exception);
31456|      0|        JS_FreeValue(ctx, ret_val);
31457|     16|    } else {
31458|       |#ifdef DUMP_MODULE_EXEC
31459|       |        js_dump_module(ctx, "  done", m);
31460|       |#endif
31461|     16|        assert(m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (31461:9): [True: 16, False: 0]
  |  Branch (31461:9): [True: 0, False: 0]
  |  Branch (31461:9): [True: 0, False: 16]
  |  Branch (31461:9): [True: 16, False: 0]
  ------------------
31462|     16|               m->status == JS_MODULE_STATUS_EVALUATED);
31463|     16|        assert(!m->eval_has_exception);
  ------------------
  |  Branch (31463:9): [True: 0, False: 16]
  |  Branch (31463:9): [True: 16, False: 0]
  ------------------
31464|     16|        if (!m->async_evaluation) {
  ------------------
  |  Branch (31464:13): [True: 16, False: 0]
  ------------------
31465|     16|            JSValue value;
31466|     16|            assert(m->status == JS_MODULE_STATUS_EVALUATED);
  ------------------
  |  Branch (31466:13): [True: 0, False: 16]
  |  Branch (31466:13): [True: 16, False: 0]
  ------------------
31467|     16|            value = JS_UNDEFINED;
  ------------------
  |  |  291|     16|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     16|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
31468|     16|            ret_val = JS_Call(ctx, m->resolving_funcs[0], JS_UNDEFINED,
  ------------------
  |  |  291|     16|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     16|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
31469|     16|                              1, (JSValueConst *)&value);
31470|     16|            JS_FreeValue(ctx, ret_val);
31471|     16|        }
31472|     16|        assert(stack_top == NULL);
  ------------------
  |  Branch (31472:9): [True: 0, False: 16]
  |  Branch (31472:9): [True: 16, False: 0]
  ------------------
31473|     16|    }
31474|     16|    return JS_DupValue(ctx, m->promise);
31475|     16|}
quickjs.c:js_inner_module_evaluation:
31309|     48|{
31310|     48|    JSModuleDef *m1;
31311|     48|    int i;
31312|       |
31313|       |#ifdef DUMP_MODULE_EXEC
31314|       |    js_dump_module(ctx, __func__, m);
31315|       |#endif
31316|       |
31317|     48|    if (js_check_stack_overflow(ctx->rt, 0)) {
  ------------------
  |  Branch (31317:9): [True: 0, False: 48]
  ------------------
31318|      0|        JS_ThrowStackOverflow(ctx);
31319|      0|        *pvalue = JS_GetException(ctx);
31320|      0|        return -1;
31321|      0|    }
31322|       |
31323|     48|    if (m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (31323:9): [True: 0, False: 48]
  ------------------
31324|     48|        m->status == JS_MODULE_STATUS_EVALUATED) {
  ------------------
  |  Branch (31324:9): [True: 0, False: 48]
  ------------------
31325|      0|        if (m->eval_has_exception) {
  ------------------
  |  Branch (31325:13): [True: 0, False: 0]
  ------------------
31326|      0|            *pvalue = JS_DupValue(ctx, m->eval_exception);
31327|      0|            return -1;
31328|      0|        } else {
31329|      0|            *pvalue = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
31330|      0|            return index;
31331|      0|        }
31332|      0|    }
31333|     48|    if (m->status == JS_MODULE_STATUS_EVALUATING) {
  ------------------
  |  Branch (31333:9): [True: 0, False: 48]
  ------------------
31334|      0|        *pvalue = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
31335|      0|        return index;
31336|      0|    }
31337|     48|    assert(m->status == JS_MODULE_STATUS_LINKED);
  ------------------
  |  Branch (31337:5): [True: 0, False: 48]
  |  Branch (31337:5): [True: 48, False: 0]
  ------------------
31338|       |
31339|     48|    m->status = JS_MODULE_STATUS_EVALUATING;
31340|     48|    m->dfs_index = index;
31341|     48|    m->dfs_ancestor_index = index;
31342|     48|    m->pending_async_dependencies = 0;
31343|     48|    index++;
31344|       |    /* push 'm' on stack */
31345|     48|    m->stack_prev = *pstack_top;
31346|     48|    *pstack_top = m;
31347|       |
31348|     80|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (31348:16): [True: 32, False: 48]
  ------------------
31349|     32|        JSReqModuleEntry *rme = &m->req_module_entries[i];
31350|     32|        m1 = rme->module;
31351|     32|        index = js_inner_module_evaluation(ctx, m1, index, pstack_top, pvalue);
31352|     32|        if (index < 0)
  ------------------
  |  Branch (31352:13): [True: 0, False: 32]
  ------------------
31353|      0|            return -1;
31354|     32|        assert(m1->status == JS_MODULE_STATUS_EVALUATING ||
  ------------------
  |  Branch (31354:9): [True: 32, False: 0]
  |  Branch (31354:9): [True: 0, False: 0]
  |  Branch (31354:9): [True: 0, False: 0]
  |  Branch (31354:9): [True: 0, False: 32]
  |  Branch (31354:9): [True: 0, False: 32]
  |  Branch (31354:9): [True: 32, False: 0]
  ------------------
31355|     32|               m1->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
31356|     32|               m1->status == JS_MODULE_STATUS_EVALUATED);
31357|     32|        if (m1->status == JS_MODULE_STATUS_EVALUATING) {
  ------------------
  |  Branch (31357:13): [True: 0, False: 32]
  ------------------
31358|      0|            m->dfs_ancestor_index = min_int(m->dfs_ancestor_index,
31359|      0|                                            m1->dfs_ancestor_index);
31360|     32|        } else {
31361|     32|            m1 = m1->cycle_root;
31362|     32|            assert(m1->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (31362:13): [True: 32, False: 0]
  |  Branch (31362:13): [True: 0, False: 0]
  |  Branch (31362:13): [True: 0, False: 32]
  |  Branch (31362:13): [True: 32, False: 0]
  ------------------
31363|     32|                   m1->status == JS_MODULE_STATUS_EVALUATED);
31364|     32|            if (m1->eval_has_exception) {
  ------------------
  |  Branch (31364:17): [True: 0, False: 32]
  ------------------
31365|      0|                *pvalue = JS_DupValue(ctx, m1->eval_exception);
31366|      0|                return -1;
31367|      0|            }
31368|     32|        }
31369|     32|        if (m1->async_evaluation) {
  ------------------
  |  Branch (31369:13): [True: 0, False: 32]
  ------------------
31370|      0|            m->pending_async_dependencies++;
31371|      0|            if (js_resize_array(ctx, (void **)&m1->async_parent_modules, sizeof(m1->async_parent_modules[0]), &m1->async_parent_modules_size, m1->async_parent_modules_count + 1)) {
  ------------------
  |  Branch (31371:17): [True: 0, False: 0]
  ------------------
31372|      0|                *pvalue = JS_GetException(ctx);
31373|      0|                return -1;
31374|      0|            }
31375|      0|            m1->async_parent_modules[m1->async_parent_modules_count++] = m;
31376|      0|        }
31377|     32|    }
31378|       |
31379|     48|    if (m->pending_async_dependencies > 0) {
  ------------------
  |  Branch (31379:9): [True: 0, False: 48]
  ------------------
31380|      0|        assert(!m->async_evaluation);
  ------------------
  |  Branch (31380:9): [True: 0, False: 0]
  |  Branch (31380:9): [True: 0, False: 0]
  ------------------
31381|      0|        m->async_evaluation = TRUE;
31382|      0|        m->async_evaluation_timestamp =
31383|      0|            ctx->rt->module_async_evaluation_next_timestamp++;
31384|     48|    } else if (m->has_tla) {
  ------------------
  |  Branch (31384:16): [True: 0, False: 48]
  ------------------
31385|      0|        assert(!m->async_evaluation);
  ------------------
  |  Branch (31385:9): [True: 0, False: 0]
  |  Branch (31385:9): [True: 0, False: 0]
  ------------------
31386|      0|        m->async_evaluation = TRUE;
31387|      0|        m->async_evaluation_timestamp =
31388|      0|            ctx->rt->module_async_evaluation_next_timestamp++;
31389|      0|        js_execute_async_module(ctx, m);
31390|     48|    } else {
31391|     48|        if (js_execute_sync_module(ctx, m, pvalue) < 0)
  ------------------
  |  Branch (31391:13): [True: 0, False: 48]
  ------------------
31392|      0|            return -1;
31393|     48|    }
31394|       |
31395|     48|    assert(m->dfs_ancestor_index <= m->dfs_index);
  ------------------
  |  Branch (31395:5): [True: 0, False: 48]
  |  Branch (31395:5): [True: 48, False: 0]
  ------------------
31396|     48|    if (m->dfs_index == m->dfs_ancestor_index) {
  ------------------
  |  Branch (31396:9): [True: 48, False: 0]
  ------------------
31397|     48|        for(;;) {
31398|       |            /* pop m1 from stack */
31399|     48|            m1 = *pstack_top;
31400|     48|            *pstack_top = m1->stack_prev;
31401|     48|            if (!m1->async_evaluation) {
  ------------------
  |  Branch (31401:17): [True: 48, False: 0]
  ------------------
31402|     48|                m1->status = JS_MODULE_STATUS_EVALUATED;
31403|     48|            } else {
31404|      0|                m1->status = JS_MODULE_STATUS_EVALUATING_ASYNC;
31405|      0|            }
31406|       |            /* spec bug: cycle_root must be assigned before the test */
31407|     48|            m1->cycle_root = m;
31408|     48|            if (m1 == m)
  ------------------
  |  Branch (31408:17): [True: 48, False: 0]
  ------------------
31409|     48|                break;
31410|     48|        }
31411|     48|    }
31412|     48|    *pvalue = JS_UNDEFINED;
  ------------------
  |  |  291|     48|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     48|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
31413|     48|    return index;
31414|     48|}
quickjs.c:js_execute_sync_module:
31270|     48|{
31271|       |#ifdef DUMP_MODULE_EXEC
31272|       |    js_dump_module(ctx, __func__, m);
31273|       |#endif
31274|     48|    if (m->init_func) {
  ------------------
  |  Branch (31274:9): [True: 32, False: 16]
  ------------------
31275|       |        /* C module init : no asynchronous execution */
31276|     32|        if (m->init_func(ctx, m) < 0)
  ------------------
  |  Branch (31276:13): [True: 0, False: 32]
  ------------------
31277|      0|            goto fail;
31278|     32|    } else {
31279|     16|        JSValue promise;
31280|     16|        JSPromiseStateEnum state;
31281|       |
31282|     16|        promise = js_async_function_call(ctx, m->func_obj, JS_UNDEFINED, 0, NULL, 0);
  ------------------
  |  |  291|     16|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     16|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
31283|     16|        if (JS_IsException(promise))
  ------------------
  |  Branch (31283:13): [True: 0, False: 16]
  ------------------
31284|      0|            goto fail;
31285|     16|        state = JS_PromiseState(ctx, promise);
31286|     16|        if (state == JS_PROMISE_FULFILLED) {
  ------------------
  |  Branch (31286:13): [True: 16, False: 0]
  ------------------
31287|     16|            JS_FreeValue(ctx, promise);
31288|     16|        } else if (state == JS_PROMISE_REJECTED) {
  ------------------
  |  Branch (31288:20): [True: 0, False: 0]
  ------------------
31289|      0|            *pvalue = JS_PromiseResult(ctx, promise);
31290|      0|            JS_FreeValue(ctx, promise);
31291|      0|            return -1;
31292|      0|        } else {
31293|      0|            JS_FreeValue(ctx, promise);
31294|      0|            JS_ThrowTypeError(ctx, "promise is pending");
31295|      0|        fail:
31296|      0|            *pvalue = JS_GetException(ctx);
31297|      0|            return -1;
31298|      0|        }
31299|     16|    }
31300|     48|    *pvalue = JS_UNDEFINED;
  ------------------
  |  |  291|     48|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     48|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
31301|     48|    return 0;
31302|     48|}
quickjs.c:JS_EvalInternal:
37190|     34|{
37191|     34|    BOOL backtrace_barrier = ((flags & JS_EVAL_FLAG_BACKTRACE_BARRIER) != 0);
  ------------------
  |  |  344|     34|#define JS_EVAL_FLAG_BACKTRACE_BARRIER (1 << 6)
  ------------------
37192|     34|    int saved_js_mode = 0;
37193|     34|    JSValue ret;
37194|       |    
37195|     34|    if (unlikely(!ctx->eval_internal)) {
  ------------------
  |  |   33|     34|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 34]
  |  |  ------------------
  ------------------
37196|      0|        return JS_ThrowTypeError(ctx, "eval is not supported");
37197|      0|    }
37198|     34|    if (backtrace_barrier && ctx->rt->current_stack_frame) {
  ------------------
  |  Branch (37198:9): [True: 0, False: 34]
  |  Branch (37198:30): [True: 0, False: 0]
  ------------------
37199|      0|        saved_js_mode = ctx->rt->current_stack_frame->js_mode;
37200|      0|        ctx->rt->current_stack_frame->js_mode |= JS_MODE_BACKTRACE_BARRIER;
  ------------------
  |  |  405|      0|#define JS_MODE_BACKTRACE_BARRIER (1 << 3) /* stop backtrace before this frame */
  ------------------
37201|      0|    }
37202|     34|    ret = ctx->eval_internal(ctx, this_obj, input, input_len, filename,
37203|     34|                             flags, scope_idx);
37204|     34|    if (backtrace_barrier && ctx->rt->current_stack_frame)
  ------------------
  |  Branch (37204:9): [True: 0, False: 34]
  |  Branch (37204:30): [True: 0, False: 0]
  ------------------
37205|      0|        ctx->rt->current_stack_frame->js_mode = saved_js_mode;
37206|     34|    return ret;
37207|     34|}
quickjs.c:js_resolve_module:
30409|     51|{
30410|     51|    int i;
30411|     51|    JSModuleDef *m1;
30412|       |
30413|     51|    if (m->resolved)
  ------------------
  |  Branch (30413:9): [True: 0, False: 51]
  ------------------
30414|      0|        return 0;
30415|       |#ifdef DUMP_MODULE_RESOLVE
30416|       |    {
30417|       |        char buf1[ATOM_GET_STR_BUF_SIZE];
30418|       |        printf("resolving module '%s':\n", JS_AtomGetStr(ctx, buf1, sizeof(buf1), m->module_name));
30419|       |    }
30420|       |#endif
30421|     51|    m->resolved = TRUE;
30422|       |    /* resolve each requested module */
30423|     85|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (30423:16): [True: 34, False: 51]
  ------------------
30424|     34|        JSReqModuleEntry *rme = &m->req_module_entries[i];
30425|     34|        m1 = js_host_resolve_imported_module_atom(ctx, m->module_name,
30426|     34|                                                  rme->module_name,
30427|     34|                                                  rme->attributes);
30428|     34|        if (!m1)
  ------------------
  |  Branch (30428:13): [True: 0, False: 34]
  ------------------
30429|      0|            return -1;
30430|     34|        rme->module = m1;
30431|       |        /* already done in js_host_resolve_imported_module() except if
30432|       |           the module was loaded with JS_EvalBinary() */
30433|     34|        if (js_resolve_module(ctx, m1) < 0)
  ------------------
  |  Branch (30433:13): [True: 0, False: 34]
  ------------------
30434|      0|            return -1;
30435|     34|    }
30436|     51|    return 0;
30437|     51|}
quickjs.c:js_host_resolve_imported_module_atom:
29951|     34|{
29952|     34|    const char *base_cname, *cname;
29953|     34|    JSModuleDef *m;
29954|       |
29955|     34|    base_cname = JS_AtomToCString(ctx, base_module_name);
29956|     34|    if (!base_cname)
  ------------------
  |  Branch (29956:9): [True: 0, False: 34]
  ------------------
29957|      0|        return NULL;
29958|     34|    cname = JS_AtomToCString(ctx, module_name1);
29959|     34|    if (!cname) {
  ------------------
  |  Branch (29959:9): [True: 0, False: 34]
  ------------------
29960|      0|        JS_FreeCString(ctx, base_cname);
29961|      0|        return NULL;
29962|      0|    }
29963|     34|    m = js_host_resolve_imported_module(ctx, base_cname, cname, attributes);
29964|     34|    JS_FreeCString(ctx, base_cname);
29965|     34|    JS_FreeCString(ctx, cname);
29966|     34|    return m;
29967|     34|}
quickjs.c:js_dbuf_init:
 1936|    103|{
 1937|    103|    dbuf_init2(s, ctx->rt, (DynBufReallocFunc *)js_realloc_rt);
 1938|    103|}
quickjs.c:dbuf_put_sleb128:
 7395|    132|{
 7396|    132|    uint32_t v = v1;
 7397|    132|    dbuf_put_leb128(s, (2 * v) ^ -(v >> 31));
 7398|    132|}
quickjs.c:dbuf_put_leb128:
 7380|    208|{
 7381|    208|    uint32_t a;
 7382|    232|    for(;;) {
 7383|    232|        a = v & 0x7f;
 7384|    232|        v >>= 7;
 7385|    232|        if (v != 0) {
  ------------------
  |  Branch (7385:13): [True: 24, False: 208]
  ------------------
 7386|     24|            dbuf_putc(s, a | 0x80);
 7387|    208|        } else {
 7388|    208|            dbuf_putc(s, a);
 7389|    208|            break;
 7390|    208|        }
 7391|    232|    }
 7392|    208|}
quickjs.c:find_atom:
39416|  9.54k|{
39417|  9.54k|    JSAtom atom;
39418|  9.54k|    int len;
39419|       |
39420|  9.54k|    if (*name == '[') {
  ------------------
  |  Branch (39420:9): [True: 867, False: 8.67k]
  ------------------
39421|    867|        name++;
39422|    867|        len = strlen(name) - 1;
39423|       |        /* We assume 8 bit non null strings, which is the case for these
39424|       |           symbols */
39425|  6.42k|        for(atom = JS_ATOM_Symbol_toPrimitive; atom < JS_ATOM_END; atom++) {
  ------------------
  |  Branch (39425:48): [True: 6.42k, False: 0]
  ------------------
39426|  6.42k|            JSAtomStruct *p = ctx->rt->atom_array[atom];
39427|  6.42k|            JSString *str = p;
39428|  6.42k|            if (str->len == len && !memcmp(str->u.str8, name, len))
  ------------------
  |  Branch (39428:17): [True: 1.58k, False: 4.84k]
  |  Branch (39428:36): [True: 867, False: 714]
  ------------------
39429|    867|                return JS_DupAtom(ctx, atom);
39430|  6.42k|        }
39431|      0|        abort();
39432|  8.67k|    } else {
39433|  8.67k|        atom = JS_NewAtom(ctx, name);
39434|  8.67k|    }
39435|  8.67k|    return atom;
39436|  9.54k|}
quickjs.c:JS_InstantiateFunctionListItem:
39484|  9.37k|{
39485|  9.37k|    JSValue val;
39486|  9.37k|    int prop_flags = e->prop_flags;
39487|       |
39488|  9.37k|    switch(e->def_type) {
39489|    170|    case JS_DEF_ALIAS: /* using autoinit for aliases is not safe */
  ------------------
  |  | 1108|    170|#define JS_DEF_ALIAS          9
  ------------------
  |  Branch (39489:5): [True: 170, False: 9.20k]
  ------------------
39490|    170|        {
39491|    170|            JSAtom atom1 = find_atom(ctx, e->u.alias.name);
39492|    170|            switch (e->u.alias.base) {
39493|    136|            case -1:
  ------------------
  |  Branch (39493:13): [True: 136, False: 34]
  ------------------
39494|    136|                val = JS_GetProperty(ctx, obj, atom1);
39495|    136|                break;
39496|     34|            case 0:
  ------------------
  |  Branch (39496:13): [True: 34, False: 136]
  ------------------
39497|     34|                val = JS_GetProperty(ctx, ctx->global_obj, atom1);
39498|     34|                break;
39499|      0|            case 1:
  ------------------
  |  Branch (39499:13): [True: 0, False: 170]
  ------------------
39500|      0|                val = JS_GetProperty(ctx, ctx->class_proto[JS_CLASS_ARRAY], atom1);
39501|      0|                break;
39502|      0|            default:
  ------------------
  |  Branch (39502:13): [True: 0, False: 170]
  ------------------
39503|      0|                abort();
39504|    170|            }
39505|    170|            JS_FreeAtom(ctx, atom1);
39506|    170|            if (JS_IsException(val))
  ------------------
  |  Branch (39506:17): [True: 0, False: 170]
  ------------------
39507|      0|                return -1;
39508|    170|            if (atom == JS_ATOM_Symbol_toPrimitive) {
  ------------------
  |  Branch (39508:17): [True: 0, False: 170]
  ------------------
39509|       |                /* Symbol.toPrimitive functions are not writable */
39510|      0|                prop_flags = JS_PROP_CONFIGURABLE;
  ------------------
  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39511|    170|            } else if (atom == JS_ATOM_Symbol_hasInstance) {
  ------------------
  |  Branch (39511:24): [True: 0, False: 170]
  ------------------
39512|       |                /* Function.prototype[Symbol.hasInstance] is not writable nor configurable */
39513|      0|                prop_flags = 0;
39514|      0|            }
39515|    170|        }
39516|      0|        break;
39517|  6.68k|    case JS_DEF_CFUNC:
  ------------------
  |  | 1099|  6.68k|#define JS_DEF_CFUNC          0
  ------------------
  |  Branch (39517:5): [True: 6.68k, False: 2.69k]
  ------------------
39518|  6.68k|        if (atom == JS_ATOM_Symbol_toPrimitive) {
  ------------------
  |  Branch (39518:13): [True: 34, False: 6.64k]
  ------------------
39519|       |            /* Symbol.toPrimitive functions are not writable */
39520|     34|            prop_flags = JS_PROP_CONFIGURABLE;
  ------------------
  |  |  298|     34|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39521|  6.64k|        } else if (atom == JS_ATOM_Symbol_hasInstance) {
  ------------------
  |  Branch (39521:20): [True: 17, False: 6.63k]
  ------------------
39522|       |            /* Function.prototype[Symbol.hasInstance] is not writable nor configurable */
39523|     17|            prop_flags = 0;
39524|     17|        }
39525|  6.68k|        if (JS_DefineAutoInitProperty(ctx, obj, atom, JS_AUTOINIT_ID_PROP,
  ------------------
  |  Branch (39525:13): [True: 0, False: 6.68k]
  ------------------
39526|  6.68k|                                      (void *)e, prop_flags) < 0)
39527|      0|            return -1;
39528|  6.68k|        return 0;
39529|    391|    case JS_DEF_CGETSET: /* XXX: use autoinit again ? */
  ------------------
  |  | 1100|    391|#define JS_DEF_CGETSET        1
  ------------------
  |  Branch (39529:5): [True: 391, False: 8.98k]
  ------------------
39530|    697|    case JS_DEF_CGETSET_MAGIC:
  ------------------
  |  | 1101|    697|#define JS_DEF_CGETSET_MAGIC  2
  ------------------
  |  Branch (39530:5): [True: 306, False: 9.06k]
  ------------------
39531|    697|        {
39532|    697|            JSValue getter, setter;
39533|    697|            char buf[64];
39534|       |
39535|    697|            getter = JS_UNDEFINED;
  ------------------
  |  |  291|    697|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|    697|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
39536|    697|            if (e->u.getset.get.generic) {
  ------------------
  |  Branch (39536:17): [True: 697, False: 0]
  ------------------
39537|    697|                snprintf(buf, sizeof(buf), "get %s", e->name);
39538|    697|                getter = JS_NewCFunction2(ctx, e->u.getset.get.generic,
39539|    697|                                          buf, 0, e->def_type == JS_DEF_CGETSET_MAGIC ? JS_CFUNC_getter_magic : JS_CFUNC_getter,
  ------------------
  |  | 1101|    697|#define JS_DEF_CGETSET_MAGIC  2
  ------------------
  |  Branch (39539:51): [True: 306, False: 391]
  ------------------
39540|    697|                                          e->magic);
39541|    697|                if (JS_IsException(getter))
  ------------------
  |  Branch (39541:21): [True: 0, False: 697]
  ------------------
39542|      0|                    return -1;
39543|    697|            }
39544|    697|            setter = JS_UNDEFINED;
  ------------------
  |  |  291|    697|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|    697|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
39545|    697|            if (e->u.getset.set.generic) {
  ------------------
  |  Branch (39545:17): [True: 34, False: 663]
  ------------------
39546|     34|                snprintf(buf, sizeof(buf), "set %s", e->name);
39547|     34|                setter = JS_NewCFunction2(ctx, e->u.getset.set.generic,
39548|     34|                                          buf, 1, e->def_type == JS_DEF_CGETSET_MAGIC ? JS_CFUNC_setter_magic : JS_CFUNC_setter,
  ------------------
  |  | 1101|     34|#define JS_DEF_CGETSET_MAGIC  2
  ------------------
  |  Branch (39548:51): [True: 0, False: 34]
  ------------------
39549|     34|                                          e->magic);
39550|     34|                if (JS_IsException(setter)) {
  ------------------
  |  Branch (39550:21): [True: 0, False: 34]
  ------------------
39551|      0|                    JS_FreeValue(ctx, getter);
39552|      0|                    return -1;
39553|      0|                }
39554|     34|            }
39555|    697|            if (JS_DefinePropertyGetSet(ctx, obj, atom, getter, setter, prop_flags) < 0)
  ------------------
  |  Branch (39555:17): [True: 0, False: 697]
  ------------------
39556|      0|                return -1;
39557|    697|            return 0;
39558|    697|        }
39559|      0|        break;
39560|    601|    case JS_DEF_PROP_INT32:
  ------------------
  |  | 1103|    601|#define JS_DEF_PROP_INT32     4
  ------------------
  |  Branch (39560:5): [True: 601, False: 8.77k]
  ------------------
39561|    601|        val = JS_NewInt32(ctx, e->u.i32);
39562|    601|        break;
39563|      0|    case JS_DEF_PROP_INT64:
  ------------------
  |  | 1104|      0|#define JS_DEF_PROP_INT64     5
  ------------------
  |  Branch (39563:5): [True: 0, False: 9.37k]
  ------------------
39564|      0|        val = JS_NewInt64(ctx, e->u.i64);
39565|      0|        break;
39566|    170|    case JS_DEF_PROP_DOUBLE:
  ------------------
  |  | 1105|    170|#define JS_DEF_PROP_DOUBLE    6
  ------------------
  |  Branch (39566:5): [True: 170, False: 9.20k]
  ------------------
39567|    170|        val = __JS_NewFloat64(ctx, e->u.f64);
39568|    170|        break;
39569|     17|    case JS_DEF_PROP_UNDEFINED:
  ------------------
  |  | 1106|     17|#define JS_DEF_PROP_UNDEFINED 7
  ------------------
  |  Branch (39569:5): [True: 17, False: 9.35k]
  ------------------
39570|     17|        val = JS_UNDEFINED;
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
39571|     17|        break;
39572|    357|    case JS_DEF_PROP_ATOM:
  ------------------
  |  | 1109|    357|#define JS_DEF_PROP_ATOM     10
  ------------------
  |  Branch (39572:5): [True: 357, False: 9.01k]
  ------------------
39573|    357|        val = JS_AtomToValue(ctx, e->u.i32);
39574|    357|        break;
39575|      0|    case JS_DEF_PROP_BOOL:
  ------------------
  |  | 1110|      0|#define JS_DEF_PROP_BOOL     11
  ------------------
  |  Branch (39575:5): [True: 0, False: 9.37k]
  ------------------
39576|      0|        val = JS_NewBool(ctx, e->u.i32);
39577|      0|        break;
39578|    595|    case JS_DEF_PROP_STRING:
  ------------------
  |  | 1102|    595|#define JS_DEF_PROP_STRING    3
  ------------------
  |  Branch (39578:5): [True: 595, False: 8.77k]
  ------------------
39579|    680|    case JS_DEF_OBJECT:
  ------------------
  |  | 1107|    680|#define JS_DEF_OBJECT         8
  ------------------
  |  Branch (39579:5): [True: 85, False: 9.28k]
  ------------------
39580|    680|        if (JS_DefineAutoInitProperty(ctx, obj, atom, JS_AUTOINIT_ID_PROP,
  ------------------
  |  Branch (39580:13): [True: 0, False: 680]
  ------------------
39581|    680|                                      (void *)e, prop_flags) < 0)
39582|      0|            return -1;
39583|    680|        return 0;
39584|      0|    default:
  ------------------
  |  Branch (39584:5): [True: 0, False: 9.37k]
  ------------------
39585|      0|        abort();
39586|  9.37k|    }
39587|  1.31k|    if (JS_DefinePropertyValue(ctx, obj, atom, val, prop_flags) < 0)
  ------------------
  |  Branch (39587:9): [True: 0, False: 1.31k]
  ------------------
39588|      0|        return -1;
39589|  1.31k|    return 0;
39590|  1.31k|}
quickjs.c:JS_NewObjectProtoList:
39440|    220|{
39441|    220|    JSValue obj;
39442|    220|    obj = JS_NewObjectProtoClassAlloc(ctx, proto, JS_CLASS_OBJECT, n_fields);
39443|    220|    if (JS_IsException(obj))
  ------------------
  |  Branch (39443:9): [True: 0, False: 220]
  ------------------
39444|      0|        return obj;
39445|    220|    if (JS_SetPropertyFunctionList(ctx, obj, fields, n_fields)) {
  ------------------
  |  Branch (39445:9): [True: 0, False: 220]
  ------------------
39446|      0|        JS_FreeValue(ctx, obj);
39447|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
39448|      0|    }
39449|    220|    return obj;
39450|    220|}
quickjs.c:JS_SetConstructor2:
39664|    816|{
39665|    816|    if (JS_DefinePropertyValue(ctx, func_obj, JS_ATOM_prototype,
  ------------------
  |  Branch (39665:9): [True: 0, False: 816]
  ------------------
39666|    816|                               JS_DupValue(ctx, proto), proto_flags) < 0)
39667|      0|        return -1;
39668|    816|    if (JS_DefinePropertyValue(ctx, proto, JS_ATOM_constructor,
  ------------------
  |  Branch (39668:9): [True: 0, False: 816]
  ------------------
39669|    816|                               JS_DupValue(ctx, func_obj),
39670|    816|                               ctor_flags) < 0)
39671|      0|        return -1;
39672|    816|    set_cycle_flag(ctx, func_obj);
39673|    816|    set_cycle_flag(ctx, proto);
39674|    816|    return 0;
39675|    816|}
quickjs.c:JS_ToObject:
39791|     20|{
39792|     20|    int tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  238|     20|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|     20|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
39793|     20|    JSValue obj;
39794|       |
39795|     20|    switch(tag) {
39796|      0|    default:
  ------------------
  |  Branch (39796:5): [True: 0, False: 20]
  ------------------
39797|      0|    case JS_TAG_NULL:
  ------------------
  |  Branch (39797:5): [True: 0, False: 20]
  ------------------
39798|      0|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (39798:5): [True: 0, False: 20]
  ------------------
39799|      0|        return JS_ThrowTypeError(ctx, "cannot convert to object");
39800|     18|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (39800:5): [True: 18, False: 2]
  ------------------
39801|     18|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (39801:5): [True: 0, False: 20]
  ------------------
39802|     18|        return JS_DupValue(ctx, val);
39803|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (39803:5): [True: 0, False: 20]
  ------------------
39804|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (39804:5): [True: 0, False: 20]
  ------------------
39805|      0|        obj = JS_NewObjectClass(ctx, JS_CLASS_BIG_INT);
39806|      0|        goto set_value;
39807|      0|    case JS_TAG_INT:
  ------------------
  |  Branch (39807:5): [True: 0, False: 20]
  ------------------
39808|      0|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (39808:5): [True: 0, False: 20]
  ------------------
39809|      0|        obj = JS_NewObjectClass(ctx, JS_CLASS_NUMBER);
39810|      0|        goto set_value;
39811|      0|    case JS_TAG_STRING:
  ------------------
  |  Branch (39811:5): [True: 0, False: 20]
  ------------------
39812|      0|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (39812:5): [True: 0, False: 20]
  ------------------
39813|       |        /* XXX: should call the string constructor */
39814|      0|        {
39815|      0|            JSValue str;
39816|      0|            str = JS_ToString(ctx, val); /* ensure that we never store a rope */
39817|      0|            if (JS_IsException(str))
  ------------------
  |  Branch (39817:17): [True: 0, False: 0]
  ------------------
39818|      0|                return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
39819|      0|            obj = JS_NewObjectClass(ctx, JS_CLASS_STRING);
39820|      0|            if (!JS_IsException(obj)) {
  ------------------
  |  Branch (39820:17): [True: 0, False: 0]
  ------------------
39821|      0|                JS_DefinePropertyValue(ctx, obj, JS_ATOM_length,
39822|      0|                                       JS_NewInt32(ctx, JS_VALUE_GET_STRING(str)->len), 0);
  ------------------
  |  |  230|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
39823|      0|                JS_SetObjectData(ctx, obj, JS_DupValue(ctx, str));
39824|      0|            }
39825|      0|            JS_FreeValue(ctx, str);
39826|      0|            return obj;
39827|      0|        }
39828|      2|    case JS_TAG_BOOL:
  ------------------
  |  Branch (39828:5): [True: 2, False: 18]
  ------------------
39829|      2|        obj = JS_NewObjectClass(ctx, JS_CLASS_BOOLEAN);
39830|      2|        goto set_value;
39831|      0|    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (39831:5): [True: 0, False: 20]
  ------------------
39832|      0|        obj = JS_NewObjectClass(ctx, JS_CLASS_SYMBOL);
39833|      2|    set_value:
39834|      2|        if (!JS_IsException(obj))
  ------------------
  |  Branch (39834:13): [True: 2, False: 0]
  ------------------
39835|      2|            JS_SetObjectData(ctx, obj, JS_DupValue(ctx, val));
39836|      2|        return obj;
39837|     20|    }
39838|     20|}
quickjs.c:js_string_define_own_property:
44985|     68|{
44986|     68|    uint32_t idx;
44987|     68|    JSObject *p;
44988|     68|    JSString *p1, *p2;
44989|       |
44990|     68|    if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (44990:9): [True: 0, False: 68]
  ------------------
44991|      0|        idx = __JS_AtomToUInt32(prop);
44992|      0|        p = JS_VALUE_GET_OBJ(this_obj);
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
44993|      0|        if (JS_VALUE_GET_TAG(p->u.object_data) != JS_TAG_STRING)
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (44993:13): [True: 0, False: 0]
  ------------------
44994|      0|            goto def;
44995|      0|        p1 = JS_VALUE_GET_STRING(p->u.object_data);
  ------------------
  |  |  230|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
44996|      0|        if (idx >= p1->len)
  ------------------
  |  Branch (44996:13): [True: 0, False: 0]
  ------------------
44997|      0|            goto def;
44998|      0|        if (!check_define_prop_flags(JS_PROP_ENUMERABLE, flags))
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
  |  Branch (44998:13): [True: 0, False: 0]
  ------------------
44999|      0|            goto fail;
45000|       |        /* check that the same value is configured */
45001|      0|        if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  316|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (45001:13): [True: 0, False: 0]
  ------------------
45002|      0|            if (JS_VALUE_GET_TAG(val) != JS_TAG_STRING)
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (45002:17): [True: 0, False: 0]
  ------------------
45003|      0|                goto fail;
45004|      0|            p2 = JS_VALUE_GET_STRING(val);
  ------------------
  |  |  230|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
45005|      0|            if (p2->len != 1)
  ------------------
  |  Branch (45005:17): [True: 0, False: 0]
  ------------------
45006|      0|                goto fail;
45007|      0|            if (string_get(p1, idx) != string_get(p2, 0)) {
  ------------------
  |  Branch (45007:17): [True: 0, False: 0]
  ------------------
45008|      0|            fail:
45009|      0|                return JS_ThrowTypeErrorOrFalse(ctx, flags, "property is not configurable");
45010|      0|            }
45011|      0|        }
45012|      0|        return TRUE;
45013|     68|    } else {
45014|     68|    def:
45015|     68|        return JS_DefineProperty(ctx, this_obj, prop, val, getter, setter,
45016|     68|                                 flags | JS_PROP_NO_EXOTIC);
  ------------------
  |  |  325|     68|#define JS_PROP_NO_EXOTIC        (1 << 16) /* internal use */
  ------------------
45017|     68|    }
45018|     68|}
quickjs.c:string_buffer_init2:
 4008|    151|{
 4009|    151|    s->ctx = ctx;
 4010|    151|    s->size = size;
 4011|    151|    s->len = 0;
 4012|    151|    s->is_wide_char = is_wide;
 4013|    151|    s->error_status = 0;
 4014|    151|    s->str = js_alloc_string(ctx, size, is_wide);
 4015|    151|    if (unlikely(!s->str)) {
  ------------------
  |  |   33|    151|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 151]
  |  |  ------------------
  ------------------
 4016|      0|        s->size = 0;
 4017|      0|        return s->error_status = -1;
 4018|      0|    }
 4019|       |#ifdef DUMP_LEAKS
 4020|       |    /* the StringBuffer may reallocate the JSString, only link it at the end */
 4021|       |    list_del(&s->str->link);
 4022|       |#endif
 4023|    151|    return 0;
 4024|    151|}
quickjs.c:string_buffer_putc:
 4156|  12.5M|{
 4157|  12.5M|    if (likely(s->len < s->size)) {
  ------------------
  |  |   32|  12.5M|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 12.5M, False: 350]
  |  |  ------------------
  ------------------
 4158|  12.5M|        if (s->is_wide_char) {
  ------------------
  |  Branch (4158:13): [True: 7.73M, False: 4.81M]
  ------------------
 4159|  7.73M|            if (c < 0x10000) {
  ------------------
  |  Branch (4159:17): [True: 7.73M, False: 3]
  ------------------
 4160|  7.73M|                s->str->u.str16[s->len++] = c;
 4161|  7.73M|                return 0;
 4162|  7.73M|            } else if (likely((s->len + 1) < s->size)) {
  ------------------
  |  |   32|      3|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 3, False: 0]
  |  |  ------------------
  ------------------
 4163|      3|                s->str->u.str16[s->len++] = get_hi_surrogate(c);
 4164|      3|                s->str->u.str16[s->len++] = get_lo_surrogate(c);
 4165|      3|                return 0;
 4166|      3|            }
 4167|  7.73M|        } else if (c < 0x100) {
  ------------------
  |  Branch (4167:20): [True: 4.81M, False: 10]
  ------------------
 4168|  4.81M|            s->str->u.str8[s->len++] = c;
 4169|  4.81M|            return 0;
 4170|  4.81M|        }
 4171|  12.5M|    }
 4172|    360|    return string_buffer_putc_slow(s, c);
 4173|  12.5M|}
quickjs.c:string_buffer_putc_slow:
 4144|    360|{
 4145|    360|    if (unlikely(c >= 0x10000)) {
  ------------------
  |  |   33|    360|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 3, False: 357]
  |  |  ------------------
  ------------------
 4146|       |        /* surrogate pair */
 4147|      3|        if (string_buffer_putc16(s, get_hi_surrogate(c)))
  ------------------
  |  Branch (4147:13): [True: 0, False: 3]
  ------------------
 4148|      0|            return -1;
 4149|      3|        c = get_lo_surrogate(c);
 4150|      3|    }
 4151|    360|    return string_buffer_putc16(s, c);
 4152|    360|}
quickjs.c:string_getc:
 4176|  1.00M|{
 4177|  1.00M|    int idx, c, c1;
 4178|  1.00M|    idx = *pidx;
 4179|  1.00M|    if (p->is_wide_char) {
  ------------------
  |  Branch (4179:9): [True: 1.00M, False: 2]
  ------------------
 4180|  1.00M|        c = p->u.str16[idx++];
 4181|  1.00M|        if (is_hi_surrogate(c) && idx < p->len) {
  ------------------
  |  Branch (4181:13): [True: 1, False: 1.00M]
  |  Branch (4181:35): [True: 1, False: 0]
  ------------------
 4182|      1|            c1 = p->u.str16[idx];
 4183|      1|            if (is_lo_surrogate(c1)) {
  ------------------
  |  Branch (4183:17): [True: 0, False: 1]
  ------------------
 4184|      0|                c = from_surrogate(c, c1);
 4185|      0|                idx++;
 4186|      0|            }
 4187|      1|        }
 4188|  1.00M|    } else {
 4189|      2|        c = p->u.str8[idx++];
 4190|      2|    }
 4191|  1.00M|    *pidx = idx;
 4192|  1.00M|    return c;
 4193|  1.00M|}
quickjs.c:js_check_stack_overflow:
 2060|  1.01M|{
 2061|  1.01M|    uintptr_t sp;
 2062|  1.01M|    sp = js_get_stack_pointer() - alloca_size;
 2063|  1.01M|    return unlikely(sp < rt->stack_limit);
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  ------------------
 2064|  1.01M|}
quickjs.c:js_compile_regexp:
47340|      3|{
47341|      3|    const char *str;
47342|      3|    int re_flags, mask;
47343|      3|    uint8_t *re_bytecode_buf;
47344|      3|    size_t i, len;
47345|      3|    int re_bytecode_len;
47346|      3|    JSValue ret;
47347|      3|    char error_msg[64];
47348|       |
47349|      3|    re_flags = 0;
47350|      3|    if (!JS_IsUndefined(flags)) {
  ------------------
  |  Branch (47350:9): [True: 3, False: 0]
  ------------------
47351|      3|        str = JS_ToCStringLen(ctx, &len, flags);
47352|      3|        if (!str)
  ------------------
  |  Branch (47352:13): [True: 0, False: 3]
  ------------------
47353|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47354|       |        /* XXX: re_flags = LRE_FLAG_OCTAL unless strict mode? */
47355|      8|        for (i = 0; i < len; i++) {
  ------------------
  |  Branch (47355:21): [True: 5, False: 3]
  ------------------
47356|      5|            switch(str[i]) {
47357|      0|            case 'd':
  ------------------
  |  Branch (47357:13): [True: 0, False: 5]
  ------------------
47358|      0|                mask = LRE_FLAG_INDICES;
  ------------------
  |  |   36|      0|#define LRE_FLAG_INDICES    (1 << 6) /* Unused by libregexp, just recorded. */
  ------------------
47359|      0|                break;
47360|      0|            case 'g':
  ------------------
  |  Branch (47360:13): [True: 0, False: 5]
  ------------------
47361|      0|                mask = LRE_FLAG_GLOBAL;
  ------------------
  |  |   30|      0|#define LRE_FLAG_GLOBAL     (1 << 0)
  ------------------
47362|      0|                break;
47363|      0|            case 'i':
  ------------------
  |  Branch (47363:13): [True: 0, False: 5]
  ------------------
47364|      0|                mask = LRE_FLAG_IGNORECASE;
  ------------------
  |  |   31|      0|#define LRE_FLAG_IGNORECASE (1 << 1)
  ------------------
47365|      0|                break;
47366|      0|            case 'm':
  ------------------
  |  Branch (47366:13): [True: 0, False: 5]
  ------------------
47367|      0|                mask = LRE_FLAG_MULTILINE;
  ------------------
  |  |   32|      0|#define LRE_FLAG_MULTILINE  (1 << 2)
  ------------------
47368|      0|                break;
47369|      0|            case 's':
  ------------------
  |  Branch (47369:13): [True: 0, False: 5]
  ------------------
47370|      0|                mask = LRE_FLAG_DOTALL;
  ------------------
  |  |   33|      0|#define LRE_FLAG_DOTALL     (1 << 3)
  ------------------
47371|      0|                break;
47372|      3|            case 'u':
  ------------------
  |  Branch (47372:13): [True: 3, False: 2]
  ------------------
47373|      3|                mask = LRE_FLAG_UNICODE;
  ------------------
  |  |   34|      3|#define LRE_FLAG_UNICODE    (1 << 4)
  ------------------
47374|      3|                break;
47375|      0|            case 'v':
  ------------------
  |  Branch (47375:13): [True: 0, False: 5]
  ------------------
47376|      0|                mask = LRE_FLAG_UNICODE_SETS;
  ------------------
  |  |   38|      0|#define LRE_FLAG_UNICODE_SETS (1 << 8)
  ------------------
47377|      0|                break;
47378|      2|            case 'y':
  ------------------
  |  Branch (47378:13): [True: 2, False: 3]
  ------------------
47379|      2|                mask = LRE_FLAG_STICKY;
  ------------------
  |  |   35|      2|#define LRE_FLAG_STICKY     (1 << 5)
  ------------------
47380|      2|                break;
47381|      0|            default:
  ------------------
  |  Branch (47381:13): [True: 0, False: 5]
  ------------------
47382|      0|                goto bad_flags;
47383|      5|            }
47384|      5|            if ((re_flags & mask) != 0) {
  ------------------
  |  Branch (47384:17): [True: 0, False: 5]
  ------------------
47385|      0|            bad_flags:
47386|      0|                JS_FreeCString(ctx, str);
47387|      0|                goto bad_flags1;
47388|      0|            }
47389|      5|            re_flags |= mask;
47390|      5|        }
47391|      3|        JS_FreeCString(ctx, str);
47392|      3|    }
47393|       |
47394|       |    /* 'u' and 'v' cannot be both set */
47395|      3|    if ((re_flags & LRE_FLAG_UNICODE_SETS) && (re_flags & LRE_FLAG_UNICODE)) {
  ------------------
  |  |   38|      3|#define LRE_FLAG_UNICODE_SETS (1 << 8)
  ------------------
                  if ((re_flags & LRE_FLAG_UNICODE_SETS) && (re_flags & LRE_FLAG_UNICODE)) {
  ------------------
  |  |   34|      0|#define LRE_FLAG_UNICODE    (1 << 4)
  ------------------
  |  Branch (47395:9): [True: 0, False: 3]
  |  Branch (47395:47): [True: 0, False: 0]
  ------------------
47396|      0|    bad_flags1:
47397|      0|        return JS_ThrowSyntaxError(ctx, "invalid regular expression flags");
47398|      0|    }
47399|       |    
47400|      3|    str = JS_ToCStringLen2(ctx, &len, pattern, !(re_flags & (LRE_FLAG_UNICODE | LRE_FLAG_UNICODE_SETS)));
  ------------------
  |  |   34|      3|#define LRE_FLAG_UNICODE    (1 << 4)
  ------------------
                  str = JS_ToCStringLen2(ctx, &len, pattern, !(re_flags & (LRE_FLAG_UNICODE | LRE_FLAG_UNICODE_SETS)));
  ------------------
  |  |   38|      3|#define LRE_FLAG_UNICODE_SETS (1 << 8)
  ------------------
47401|      3|    if (!str)
  ------------------
  |  Branch (47401:9): [True: 0, False: 3]
  ------------------
47402|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47403|      3|    re_bytecode_buf = lre_compile(&re_bytecode_len, error_msg,
47404|      3|                                  sizeof(error_msg), str, len, re_flags, ctx);
47405|      3|    JS_FreeCString(ctx, str);
47406|      3|    if (!re_bytecode_buf) {
  ------------------
  |  Branch (47406:9): [True: 0, False: 3]
  ------------------
47407|      0|        JS_ThrowSyntaxError(ctx, "%s", error_msg);
47408|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47409|      0|    }
47410|       |
47411|      3|    ret = js_new_string8_len(ctx, (const char *)re_bytecode_buf, re_bytecode_len);
47412|      3|    js_free(ctx, re_bytecode_buf);
47413|      3|    return ret;
47414|      3|}
quickjs.c:JS_NewCConstructor:
39700|    782|{
39701|    782|    JSValue ctor = JS_UNDEFINED, proto, parent_proto;
  ------------------
  |  |  291|    782|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|    782|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
39702|    782|    int proto_class_id, proto_flags, ctor_flags;
39703|       |
39704|    782|    proto_flags = 0;
39705|    782|    if (flags & JS_NEW_CTOR_READONLY) {
  ------------------
  |  |39688|    782|#define JS_NEW_CTOR_READONLY    (1 << 3) /* read-only constructor field */
  ------------------
  |  Branch (39705:9): [True: 51, False: 731]
  ------------------
39706|     51|        ctor_flags = JS_PROP_CONFIGURABLE;
  ------------------
  |  |  298|     51|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39707|    731|    } else {
39708|    731|        ctor_flags = JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE;
  ------------------
  |  |  299|    731|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                      ctor_flags = JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE;
  ------------------
  |  |  298|    731|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39709|    731|    }
39710|       |    
39711|    782|    if (JS_IsUndefined(parent_ctor)) {
  ------------------
  |  Branch (39711:9): [True: 391, False: 391]
  ------------------
39712|    391|        parent_proto = JS_DupValue(ctx, ctx->class_proto[JS_CLASS_OBJECT]);
39713|    391|        parent_ctor = ctx->function_proto;
39714|    391|    } else {
39715|    391|        parent_proto = JS_GetProperty(ctx, parent_ctor, JS_ATOM_prototype);
39716|    391|        if (JS_IsException(parent_proto))
  ------------------
  |  Branch (39716:13): [True: 0, False: 391]
  ------------------
39717|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
39718|    391|    }
39719|       |    
39720|    782|    if (flags & JS_NEW_CTOR_PROTO_EXIST) {
  ------------------
  |  |39687|    782|#define JS_NEW_CTOR_PROTO_EXIST (1 << 2) /* the prototype is already defined */
  ------------------
  |  Branch (39720:9): [True: 34, False: 748]
  ------------------
39721|     34|        proto = JS_DupValue(ctx, ctx->class_proto[class_id]);
39722|    748|    } else {
39723|    748|        if (flags & JS_NEW_CTOR_PROTO_CLASS)
  ------------------
  |  |39686|    748|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
  |  Branch (39723:13): [True: 68, False: 680]
  ------------------
39724|     68|            proto_class_id = class_id;
39725|    680|        else
39726|    680|            proto_class_id = JS_CLASS_OBJECT;
39727|       |        /* one additional field: constructor */
39728|    748|        proto = JS_NewObjectProtoClassAlloc(ctx, parent_proto, proto_class_id,
39729|    748|                                            n_proto_fields + 1);
39730|    748|        if (JS_IsException(proto))
  ------------------
  |  Branch (39730:13): [True: 0, False: 748]
  ------------------
39731|      0|            goto fail;
39732|    748|        if (class_id >= 0)
  ------------------
  |  Branch (39732:13): [True: 595, False: 153]
  ------------------
39733|    595|            ctx->class_proto[class_id] = JS_DupValue(ctx, proto);
39734|    748|    }
39735|    782|    if (JS_SetPropertyFunctionList(ctx, proto, proto_fields, n_proto_fields))
  ------------------
  |  Branch (39735:9): [True: 0, False: 782]
  ------------------
39736|      0|        goto fail;
39737|       |
39738|       |    /* additional fields: name, length, prototype */
39739|    782|    ctor = JS_NewCFunction3(ctx, func, name, length, cproto, magic, parent_ctor,
39740|    782|                            n_ctor_fields + 3);
39741|    782|    if (JS_IsException(ctor))
  ------------------
  |  Branch (39741:9): [True: 0, False: 782]
  ------------------
39742|      0|        goto fail;
39743|    782|    if (JS_SetPropertyFunctionList(ctx, ctor, ctor_fields, n_ctor_fields))
  ------------------
  |  Branch (39743:9): [True: 0, False: 782]
  ------------------
39744|      0|        goto fail;
39745|    782|    if (!(flags & JS_NEW_CTOR_NO_GLOBAL)) {
  ------------------
  |  |39685|    782|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
  |  Branch (39745:9): [True: 714, False: 68]
  ------------------
39746|    714|        if (JS_DefinePropertyValueStr(ctx, ctx->global_obj, name,
  ------------------
  |  Branch (39746:13): [True: 0, False: 714]
  ------------------
39747|    714|                                      JS_DupValue(ctx, ctor),
39748|    714|                                      JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  299|    714|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                    JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  298|    714|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39749|      0|            goto fail;
39750|    714|    }
39751|    782|    JS_SetConstructor2(ctx, ctor, proto, proto_flags, ctor_flags);
39752|       |
39753|    782|    JS_FreeValue(ctx, proto);
39754|    782|    JS_FreeValue(ctx, parent_proto);
39755|    782|    return ctor;
39756|      0| fail:
39757|      0|    JS_FreeValue(ctx, proto);
39758|      0|    JS_FreeValue(ctx, parent_proto);
39759|      0|    JS_FreeValue(ctx, ctor);
39760|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
39761|    782|}
quickjs.c:js_regexp_constructor:
47503|      2|{
47504|      2|    JSValue pattern, flags, bc, val, obj = JS_UNDEFINED;
  ------------------
  |  |  291|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47505|      2|    JSValueConst pat, flags1;
  ------------------
  |  |  234|      2|#define JSValueConst JSValue
  ------------------
47506|      2|    JSRegExp *re;
47507|      2|    int pat_is_regexp;
47508|       |
47509|      2|    pat = argv[0];
47510|      2|    flags1 = argv[1];
47511|      2|    pat_is_regexp = js_is_regexp(ctx, pat);
47512|      2|    if (pat_is_regexp < 0)
  ------------------
  |  Branch (47512:9): [True: 0, False: 2]
  ------------------
47513|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47514|      2|    if (JS_IsUndefined(new_target)) {
  ------------------
  |  Branch (47514:9): [True: 0, False: 2]
  ------------------
47515|       |        /* called as a function */
47516|      0|        new_target = JS_GetActiveFunction(ctx);
47517|      0|        if (pat_is_regexp && JS_IsUndefined(flags1)) {
  ------------------
  |  Branch (47517:13): [True: 0, False: 0]
  |  Branch (47517:30): [True: 0, False: 0]
  ------------------
47518|      0|            JSValue ctor;
47519|      0|            BOOL res;
47520|      0|            ctor = JS_GetProperty(ctx, pat, JS_ATOM_constructor);
47521|      0|            if (JS_IsException(ctor))
  ------------------
  |  Branch (47521:17): [True: 0, False: 0]
  ------------------
47522|      0|                return ctor;
47523|      0|            res = js_same_value(ctx, ctor, new_target);
47524|      0|            JS_FreeValue(ctx, ctor);
47525|      0|            if (res)
  ------------------
  |  Branch (47525:17): [True: 0, False: 0]
  ------------------
47526|      0|                return JS_DupValue(ctx, pat);
47527|      0|        }
47528|      0|    }
47529|      2|    re = js_get_regexp(ctx, pat, FALSE);
47530|      2|    flags = JS_UNDEFINED;
  ------------------
  |  |  291|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47531|      2|    if (re) {
  ------------------
  |  Branch (47531:9): [True: 2, False: 0]
  ------------------
47532|      2|        pattern = JS_DupValue(ctx, JS_MKPTR(JS_TAG_STRING, re->pattern));
  ------------------
  |  |  248|      2|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
47533|      2|        if (JS_IsUndefined(flags1)) {
  ------------------
  |  Branch (47533:13): [True: 0, False: 2]
  ------------------
47534|      0|            bc = JS_DupValue(ctx, JS_MKPTR(JS_TAG_STRING, re->bytecode));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
47535|      0|            obj = js_create_from_ctor(ctx, new_target, JS_CLASS_REGEXP);
47536|      0|            if (JS_IsException(obj))
  ------------------
  |  Branch (47536:17): [True: 0, False: 0]
  ------------------
47537|      0|                goto fail;
47538|      0|            goto no_compilation;
47539|      2|        } else {
47540|      2|            flags = JS_DupValue(ctx, flags1);
47541|      2|        }
47542|      2|    } else {
47543|      0|        if (pat_is_regexp) {
  ------------------
  |  Branch (47543:13): [True: 0, False: 0]
  ------------------
47544|      0|            pattern = JS_GetProperty(ctx, pat, JS_ATOM_source);
47545|      0|            if (JS_IsException(pattern))
  ------------------
  |  Branch (47545:17): [True: 0, False: 0]
  ------------------
47546|      0|                goto fail;
47547|      0|            if (JS_IsUndefined(flags1)) {
  ------------------
  |  Branch (47547:17): [True: 0, False: 0]
  ------------------
47548|      0|                flags = JS_GetProperty(ctx, pat, JS_ATOM_flags);
47549|      0|                if (JS_IsException(flags))
  ------------------
  |  Branch (47549:21): [True: 0, False: 0]
  ------------------
47550|      0|                    goto fail;
47551|      0|            } else {
47552|      0|                flags = JS_DupValue(ctx, flags1);
47553|      0|            }
47554|      0|        } else {
47555|      0|            pattern = JS_DupValue(ctx, pat);
47556|      0|            flags = JS_DupValue(ctx, flags1);
47557|      0|        }
47558|      0|        if (JS_IsUndefined(pattern)) {
  ------------------
  |  Branch (47558:13): [True: 0, False: 0]
  ------------------
47559|      0|            pattern = JS_AtomToString(ctx, JS_ATOM_empty_string);
47560|      0|        } else {
47561|      0|            val = pattern;
47562|      0|            pattern = JS_ToString(ctx, val);
47563|      0|            JS_FreeValue(ctx, val);
47564|      0|            if (JS_IsException(pattern))
  ------------------
  |  Branch (47564:17): [True: 0, False: 0]
  ------------------
47565|      0|                goto fail;
47566|      0|        }
47567|      0|    }
47568|      2|    obj = js_create_from_ctor(ctx, new_target, JS_CLASS_REGEXP);
47569|      2|    if (JS_IsException(obj))
  ------------------
  |  Branch (47569:9): [True: 0, False: 2]
  ------------------
47570|      0|        goto fail;
47571|      2|    bc = js_compile_regexp(ctx, pattern, flags);
47572|      2|    if (JS_IsException(bc))
  ------------------
  |  Branch (47572:9): [True: 0, False: 2]
  ------------------
47573|      0|        goto fail;
47574|      2|    JS_FreeValue(ctx, flags);
47575|      2| no_compilation:
47576|      2|    return js_regexp_set_internal(ctx, obj, pattern, bc);
47577|      0| fail:
47578|      0|    JS_FreeValue(ctx, pattern);
47579|      0|    JS_FreeValue(ctx, flags);
47580|      0|    JS_FreeValue(ctx, obj);
47581|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47582|      2|}
quickjs.c:js_is_regexp:
47488|      2|{
47489|      2|    JSValue m;
47490|       |
47491|      2|    if (!JS_IsObject(obj))
  ------------------
  |  Branch (47491:9): [True: 0, False: 2]
  ------------------
47492|      0|        return FALSE;
47493|      2|    m = JS_GetProperty(ctx, obj, JS_ATOM_Symbol_match);
47494|      2|    if (JS_IsException(m))
  ------------------
  |  Branch (47494:9): [True: 0, False: 2]
  ------------------
47495|      0|        return -1;
47496|      2|    if (!JS_IsUndefined(m))
  ------------------
  |  Branch (47496:9): [True: 2, False: 0]
  ------------------
47497|      2|        return JS_ToBoolFree(ctx, m);
47498|      0|    return js_get_regexp(ctx, obj, FALSE) != NULL;
47499|      2|}
quickjs.c:js_get_regexp:
47474|  1.00M|{
47475|  1.00M|    if (JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT) {
  ------------------
  |  |  236|  1.00M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (47475:9): [True: 1.00M, False: 0]
  ------------------
47476|  1.00M|        JSObject *p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|  1.00M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.00M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47477|  1.00M|        if (p->class_id == JS_CLASS_REGEXP)
  ------------------
  |  Branch (47477:13): [True: 1.00M, False: 0]
  ------------------
47478|  1.00M|            return &p->u.regexp;
47479|  1.00M|    }
47480|      0|    if (throw_error) {
  ------------------
  |  Branch (47480:9): [True: 0, False: 0]
  ------------------
47481|      0|        JS_ThrowTypeErrorInvalidClass(ctx, JS_CLASS_REGEXP);
47482|      0|    }
47483|       |    return NULL;
47484|  1.00M|}
quickjs.c:js_regexp_set_internal:
47449|      2|{
47450|      2|    JSObject *p;
47451|      2|    JSRegExp *re;
47452|       |
47453|       |    /* sanity check */
47454|      2|    if (unlikely(JS_VALUE_GET_TAG(bc) != JS_TAG_STRING ||
  ------------------
  |  |   33|      4|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  |  Branch (33:45): [True: 0, False: 2]
  |  |  |  Branch (33:45): [True: 0, False: 2]
  |  |  ------------------
  ------------------
47455|      2|                 JS_VALUE_GET_TAG(pattern) != JS_TAG_STRING)) {
47456|      0|        JS_ThrowTypeError(ctx, "string expected");
47457|      0|        JS_FreeValue(ctx, obj);
47458|      0|        JS_FreeValue(ctx, bc);
47459|      0|        JS_FreeValue(ctx, pattern);
47460|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47461|      0|    }
47462|       |
47463|      2|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47464|      2|    re = &p->u.regexp;
47465|      2|    re->pattern = JS_VALUE_GET_STRING(pattern);
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47466|      2|    re->bytecode = JS_VALUE_GET_STRING(bc);
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47467|       |    /* Note: cannot fail because the field is preallocated */
47468|      2|    JS_DefinePropertyValue(ctx, obj, JS_ATOM_lastIndex, JS_NewInt32(ctx, 0),
47469|      2|                           JS_PROP_WRITABLE);
  ------------------
  |  |  299|      2|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
47470|      2|    return obj;
47471|      2|}
quickjs.c:js_get_this:
41739|      2|{
41740|      2|    return JS_DupValue(ctx, this_val);
41741|      2|}
quickjs.c:js_regexp_get_flags:
47717|      2|{
47718|      2|    char str[RE_FLAG_COUNT], *p = str;
47719|      2|    int res, i;
47720|      2|    static const int flag_atom[RE_FLAG_COUNT] = {
47721|      2|        JS_ATOM_hasIndices,
47722|      2|        JS_ATOM_global,
47723|      2|        JS_ATOM_ignoreCase,
47724|      2|        JS_ATOM_multiline,
47725|      2|        JS_ATOM_dotAll,
47726|      2|        JS_ATOM_unicode,
47727|      2|        JS_ATOM_unicodeSets,
47728|      2|        JS_ATOM_sticky,
47729|      2|    };
47730|      2|    static const char flag_char[RE_FLAG_COUNT] = { 'd', 'g', 'i', 'm', 's', 'u', 'v', 'y' };
47731|       |    
47732|      2|    if (JS_VALUE_GET_TAG(this_val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (47732:9): [True: 0, False: 2]
  ------------------
47733|      0|        return JS_ThrowTypeErrorNotAnObject(ctx);
47734|       |
47735|     18|    for(i = 0; i < RE_FLAG_COUNT; i++) {
  ------------------
  |  |47714|     18|#define RE_FLAG_COUNT 8
  ------------------
  |  Branch (47735:16): [True: 16, False: 2]
  ------------------
47736|     16|        res = JS_ToBoolFree(ctx, JS_GetProperty(ctx, this_val, flag_atom[i]));
47737|     16|        if (res < 0)
  ------------------
  |  Branch (47737:13): [True: 0, False: 16]
  ------------------
47738|      0|            goto exception;
47739|     16|        if (res)
  ------------------
  |  Branch (47739:13): [True: 2, False: 14]
  ------------------
47740|      2|            *p++ = flag_char[i];
47741|     16|    }
47742|      2|    return JS_NewStringLen(ctx, str, p - str);
47743|       |
47744|      0|exception:
47745|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47746|      2|}
quickjs.c:js_regexp_get_flag:
47695|     16|{
47696|     16|    JSRegExp *re;
47697|     16|    int flags;
47698|       |
47699|     16|    if (JS_VALUE_GET_TAG(this_val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|     16|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (47699:9): [True: 0, False: 16]
  ------------------
47700|      0|        return JS_ThrowTypeErrorNotAnObject(ctx);
47701|       |
47702|     16|    re = js_get_regexp(ctx, this_val, FALSE);
47703|     16|    if (!re) {
  ------------------
  |  Branch (47703:9): [True: 0, False: 16]
  ------------------
47704|      0|        if (js_same_value(ctx, this_val, ctx->class_proto[JS_CLASS_REGEXP]))
  ------------------
  |  Branch (47704:13): [True: 0, False: 0]
  ------------------
47705|      0|            return JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47706|      0|        else
47707|      0|            return JS_ThrowTypeErrorInvalidClass(ctx, JS_CLASS_REGEXP);
47708|      0|    }
47709|       |
47710|     16|    flags = lre_get_flags(re->bytecode->u.str8);
47711|     16|    return JS_NewBool(ctx, flags & mask);
47712|     16|}
quickjs.c:js_regexp_exec:
47883|  1.00M|{
47884|  1.00M|    JSRegExp *re = js_get_regexp(ctx, this_val, TRUE);
47885|  1.00M|    JSString *str;
47886|  1.00M|    JSValue t, ret, str_val, obj, groups;
47887|  1.00M|    JSValue indices, indices_groups;
47888|  1.00M|    uint8_t *re_bytecode;
47889|  1.00M|    uint8_t **capture, *str_buf;
47890|  1.00M|    int rc, capture_count, shift, i, re_flags, alloc_count;
47891|  1.00M|    int64_t last_index;
47892|  1.00M|    const char *group_name_ptr;
47893|  1.00M|    JSObject *p_obj;
47894|  1.00M|    JSAtom group_name;
47895|       |    
47896|  1.00M|    if (!re)
  ------------------
  |  Branch (47896:9): [True: 0, False: 1.00M]
  ------------------
47897|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47898|       |
47899|  1.00M|    str_val = JS_ToString(ctx, argv[0]);
47900|  1.00M|    if (JS_IsException(str_val))
  ------------------
  |  Branch (47900:9): [True: 0, False: 1.00M]
  ------------------
47901|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47902|       |
47903|  1.00M|    ret = JS_EXCEPTION;
  ------------------
  |  |  294|  1.00M|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|  1.00M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47904|  1.00M|    obj = JS_NULL;
  ------------------
  |  |  290|  1.00M|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|  1.00M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47905|  1.00M|    groups = JS_UNDEFINED;
  ------------------
  |  |  291|  1.00M|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|  1.00M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47906|  1.00M|    indices = JS_UNDEFINED;
  ------------------
  |  |  291|  1.00M|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|  1.00M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47907|  1.00M|    indices_groups = JS_UNDEFINED;
  ------------------
  |  |  291|  1.00M|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|  1.00M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47908|  1.00M|    capture = NULL;
47909|  1.00M|    group_name = JS_ATOM_NULL;
  ------------------
  |  |  451|  1.00M|#define JS_ATOM_NULL 0
  ------------------
47910|       |    
47911|  1.00M|    if (js_regexp_get_lastIndex(ctx, &last_index, this_val))
  ------------------
  |  Branch (47911:9): [True: 0, False: 1.00M]
  ------------------
47912|      0|        goto fail;
47913|       |
47914|  1.00M|    re_bytecode = re->bytecode->u.str8;
47915|  1.00M|    re_flags = lre_get_flags(re_bytecode);
47916|  1.00M|    if ((re_flags & (LRE_FLAG_GLOBAL | LRE_FLAG_STICKY)) == 0) {
  ------------------
  |  |   30|  1.00M|#define LRE_FLAG_GLOBAL     (1 << 0)
  ------------------
                  if ((re_flags & (LRE_FLAG_GLOBAL | LRE_FLAG_STICKY)) == 0) {
  ------------------
  |  |   35|  1.00M|#define LRE_FLAG_STICKY     (1 << 5)
  ------------------
  |  Branch (47916:9): [True: 0, False: 1.00M]
  ------------------
47917|      0|        last_index = 0;
47918|      0|    }
47919|  1.00M|    str = JS_VALUE_GET_STRING(str_val);
  ------------------
  |  |  230|  1.00M|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.00M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47920|  1.00M|    alloc_count = lre_get_alloc_count(re_bytecode);
47921|  1.00M|    if (alloc_count > 0) {
  ------------------
  |  Branch (47921:9): [True: 1.00M, False: 0]
  ------------------
47922|  1.00M|        capture = js_malloc(ctx, sizeof(capture[0]) * alloc_count);
47923|  1.00M|        if (!capture)
  ------------------
  |  Branch (47923:13): [True: 0, False: 1.00M]
  ------------------
47924|      0|            goto fail;
47925|  1.00M|    }
47926|  1.00M|    capture_count = lre_get_capture_count(re_bytecode);
47927|  1.00M|    shift = str->is_wide_char;
47928|  1.00M|    str_buf = str->u.str8;
47929|  1.00M|    if (last_index > str->len) {
  ------------------
  |  Branch (47929:9): [True: 0, False: 1.00M]
  ------------------
47930|      0|        rc = 2;
47931|  1.00M|    } else {
47932|  1.00M|        rc = lre_exec(capture, re_bytecode,
47933|  1.00M|                      str_buf, last_index, str->len,
47934|  1.00M|                      shift, ctx);
47935|  1.00M|    }
47936|  1.00M|    if (rc != 1) {
  ------------------
  |  Branch (47936:9): [True: 1.00M, False: 4]
  ------------------
47937|  1.00M|        if (rc >= 0) {
  ------------------
  |  Branch (47937:13): [True: 1.00M, False: 0]
  ------------------
47938|  1.00M|            if (rc == 2 || (re_flags & (LRE_FLAG_GLOBAL | LRE_FLAG_STICKY))) {
  ------------------
  |  |   30|  1.00M|#define LRE_FLAG_GLOBAL     (1 << 0)
  ------------------
                          if (rc == 2 || (re_flags & (LRE_FLAG_GLOBAL | LRE_FLAG_STICKY))) {
  ------------------
  |  |   35|  1.00M|#define LRE_FLAG_STICKY     (1 << 5)
  ------------------
  |  Branch (47938:17): [True: 0, False: 1.00M]
  |  Branch (47938:28): [True: 1.00M, False: 0]
  ------------------
47939|  1.00M|                if (js_regexp_set_lastIndex(ctx, this_val, 0) < 0)
  ------------------
  |  Branch (47939:21): [True: 0, False: 1.00M]
  ------------------
47940|      0|                    goto fail;
47941|  1.00M|            }
47942|  1.00M|        } else {
47943|      0|            if (rc == LRE_RET_TIMEOUT) {
  ------------------
  |  |   41|      0|#define LRE_RET_TIMEOUT      (-2)
  ------------------
  |  Branch (47943:17): [True: 0, False: 0]
  ------------------
47944|      0|                JS_ThrowInterrupted(ctx);
47945|      0|            } else {
47946|      0|                JS_ThrowInternalError(ctx, "out of memory in regexp execution");
47947|      0|            }
47948|      0|            goto fail;
47949|      0|        }
47950|  1.00M|    } else {
47951|      4|        int prop_flags;
47952|      4|        JSProperty props[4];
47953|       |        
47954|      4|        if (re_flags & (LRE_FLAG_GLOBAL | LRE_FLAG_STICKY)) {
  ------------------
  |  |   30|      4|#define LRE_FLAG_GLOBAL     (1 << 0)
  ------------------
                      if (re_flags & (LRE_FLAG_GLOBAL | LRE_FLAG_STICKY)) {
  ------------------
  |  |   35|      4|#define LRE_FLAG_STICKY     (1 << 5)
  ------------------
  |  Branch (47954:13): [True: 4, False: 0]
  ------------------
47955|      4|            if (js_regexp_set_lastIndex(ctx, this_val,
  ------------------
  |  Branch (47955:17): [True: 0, False: 4]
  ------------------
47956|      4|                                        (capture[1] - str_buf) >> shift) < 0)
47957|      0|                goto fail;
47958|      4|        }
47959|      4|        prop_flags = JS_PROP_C_W_E | JS_PROP_THROW;
  ------------------
  |  |  301|      4|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      4|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|      4|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|      4|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                      prop_flags = JS_PROP_C_W_E | JS_PROP_THROW;
  ------------------
  |  |  320|      4|#define JS_PROP_THROW            (1 << 14)
  ------------------
47960|      4|        group_name_ptr = lre_get_groupnames(re_bytecode);
47961|      4|        if (group_name_ptr) {
  ------------------
  |  Branch (47961:13): [True: 0, False: 4]
  ------------------
47962|      0|            groups = JS_NewObjectProto(ctx, JS_NULL);
  ------------------
  |  |  290|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47963|      0|            if (JS_IsException(groups))
  ------------------
  |  Branch (47963:17): [True: 0, False: 0]
  ------------------
47964|      0|                goto fail;
47965|      0|        }
47966|      4|        if (re_flags & LRE_FLAG_INDICES) {
  ------------------
  |  |   36|      4|#define LRE_FLAG_INDICES    (1 << 6) /* Unused by libregexp, just recorded. */
  ------------------
  |  Branch (47966:13): [True: 0, False: 4]
  ------------------
47967|      0|            indices = JS_NewArray(ctx);
47968|      0|            if (JS_IsException(indices))
  ------------------
  |  Branch (47968:17): [True: 0, False: 0]
  ------------------
47969|      0|                goto fail;
47970|      0|            if (group_name_ptr) {
  ------------------
  |  Branch (47970:17): [True: 0, False: 0]
  ------------------
47971|      0|                indices_groups = JS_NewObjectProto(ctx, JS_NULL);
  ------------------
  |  |  290|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47972|      0|                if (JS_IsException(indices_groups))
  ------------------
  |  Branch (47972:21): [True: 0, False: 0]
  ------------------
47973|      0|                    goto fail;
47974|      0|            }
47975|      0|        }
47976|       |
47977|      4|        props[0].u.value = JS_NewInt32(ctx, capture_count); /* length */
47978|      4|        props[1].u.value = JS_NewInt32(ctx, (capture[0] - str_buf) >> shift); /* index */
47979|      4|        props[2].u.value = str_val; /* input */
47980|      4|        props[3].u.value = JS_DupValue(ctx, groups); /* groups */
47981|       |
47982|      4|        str_val = JS_UNDEFINED;
  ------------------
  |  |  291|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
47983|      4|        obj = JS_NewObjectFromShape(ctx, js_dup_shape(ctx->regexp_result_shape),
47984|      4|                                    JS_CLASS_ARRAY, props);
47985|      4|        if (JS_IsException(obj))
  ------------------
  |  Branch (47985:13): [True: 0, False: 4]
  ------------------
47986|      0|            goto fail;
47987|       |
47988|      4|        p_obj = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|      4|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      4|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47989|      4|        if (expand_fast_array(ctx, p_obj, capture_count))
  ------------------
  |  Branch (47989:13): [True: 0, False: 4]
  ------------------
47990|      0|            goto fail;
47991|       |        
47992|      8|        for(i = 0; i < capture_count; i++) {
  ------------------
  |  Branch (47992:20): [True: 4, False: 4]
  ------------------
47993|      4|            uint8_t **match = &capture[2 * i];
47994|      4|            int start = -1;
47995|      4|            int end = -1;
47996|      4|            JSValue val;
47997|       |
47998|      4|            if (group_name_ptr && i > 0) {
  ------------------
  |  Branch (47998:17): [True: 0, False: 4]
  |  Branch (47998:35): [True: 0, False: 0]
  ------------------
47999|      0|                if (*group_name_ptr) {
  ------------------
  |  Branch (47999:21): [True: 0, False: 0]
  ------------------
48000|       |                    /* XXX: slow, should create a shape when the regexp is
48001|       |                       compiled */
48002|      0|                    group_name = JS_NewAtom(ctx, group_name_ptr);
48003|      0|                    if (group_name == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (48003:25): [True: 0, False: 0]
  ------------------
48004|      0|                        goto fail;
48005|      0|                }
48006|      0|                group_name_ptr += strlen(group_name_ptr) + LRE_GROUP_NAME_TRAILER_LEN;
  ------------------
  |  |   44|      0|#define LRE_GROUP_NAME_TRAILER_LEN 2 
  ------------------
48007|      0|            }
48008|       |
48009|      4|            if (match[0] && match[1]) {
  ------------------
  |  Branch (48009:17): [True: 4, False: 0]
  |  Branch (48009:29): [True: 4, False: 0]
  ------------------
48010|      4|                start = (match[0] - str_buf) >> shift;
48011|      4|                end = (match[1] - str_buf) >> shift;
48012|      4|            }
48013|       |
48014|      4|            if (!JS_IsUndefined(indices)) {
  ------------------
  |  Branch (48014:17): [True: 0, False: 4]
  ------------------
48015|      0|                val = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
48016|      0|                if (start != -1) {
  ------------------
  |  Branch (48016:21): [True: 0, False: 0]
  ------------------
48017|      0|                    val = JS_NewArray(ctx);
48018|      0|                    if (JS_IsException(val))
  ------------------
  |  Branch (48018:25): [True: 0, False: 0]
  ------------------
48019|      0|                        goto fail;
48020|      0|                    if (JS_DefinePropertyValueUint32(ctx, val, 0,
  ------------------
  |  Branch (48020:25): [True: 0, False: 0]
  ------------------
48021|      0|                                                     JS_NewInt32(ctx, start),
48022|      0|                                                     prop_flags) < 0) {
48023|      0|                        JS_FreeValue(ctx, val);
48024|      0|                        goto fail;
48025|      0|                    }
48026|      0|                    if (JS_DefinePropertyValueUint32(ctx, val, 1,
  ------------------
  |  Branch (48026:25): [True: 0, False: 0]
  ------------------
48027|      0|                                                     JS_NewInt32(ctx, end),
48028|      0|                                                     prop_flags) < 0) {
48029|      0|                        JS_FreeValue(ctx, val);
48030|      0|                        goto fail;
48031|      0|                    }
48032|      0|                }
48033|      0|                if (group_name != JS_ATOM_NULL) {
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (48033:21): [True: 0, False: 0]
  ------------------
48034|       |                    /* JS_HasProperty() cannot fail here */
48035|      0|                    if (!JS_IsUndefined(val) ||
  ------------------
  |  Branch (48035:25): [True: 0, False: 0]
  ------------------
48036|      0|                        !JS_HasProperty(ctx, indices_groups, group_name)) {
  ------------------
  |  Branch (48036:25): [True: 0, False: 0]
  ------------------
48037|      0|                        if (JS_DefinePropertyValue(ctx, indices_groups,
  ------------------
  |  Branch (48037:29): [True: 0, False: 0]
  ------------------
48038|      0|                                                   group_name, JS_DupValue(ctx, val), prop_flags) < 0) {
48039|      0|                            JS_FreeValue(ctx, val);
48040|      0|                            goto fail;
48041|      0|                        }
48042|      0|                    }
48043|      0|                }
48044|      0|                if (JS_DefinePropertyValueUint32(ctx, indices, i, val,
  ------------------
  |  Branch (48044:21): [True: 0, False: 0]
  ------------------
48045|      0|                                                 prop_flags) < 0) {
48046|      0|                    goto fail;
48047|      0|                }
48048|      0|            }
48049|       |
48050|      4|            val = JS_UNDEFINED;
  ------------------
  |  |  291|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
48051|      4|            if (start != -1) {
  ------------------
  |  Branch (48051:17): [True: 4, False: 0]
  ------------------
48052|      4|                val = js_sub_string(ctx, str, start, end);
48053|      4|                if (JS_IsException(val))
  ------------------
  |  Branch (48053:21): [True: 0, False: 4]
  ------------------
48054|      0|                    goto fail;
48055|      4|            }
48056|       |
48057|      4|            if (group_name != JS_ATOM_NULL) {
  ------------------
  |  |  451|      4|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (48057:17): [True: 0, False: 4]
  ------------------
48058|       |                /* JS_HasProperty() cannot fail here */
48059|      0|                if (!JS_IsUndefined(val) ||
  ------------------
  |  Branch (48059:21): [True: 0, False: 0]
  ------------------
48060|      0|                    !JS_HasProperty(ctx, groups, group_name)) {
  ------------------
  |  Branch (48060:21): [True: 0, False: 0]
  ------------------
48061|      0|                    if (JS_DefinePropertyValue(ctx, groups, group_name,
  ------------------
  |  Branch (48061:25): [True: 0, False: 0]
  ------------------
48062|      0|                                               JS_DupValue(ctx, val),
48063|      0|                                               prop_flags) < 0) {
48064|      0|                        JS_FreeValue(ctx, val);
48065|      0|                        goto fail;
48066|      0|                    }
48067|      0|                }
48068|      0|                JS_FreeAtom(ctx, group_name);
48069|      0|                group_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
48070|      0|            }
48071|      4|            p_obj->u.array.u.values[p_obj->u.array.count++] = val;
48072|      4|        }
48073|       |
48074|      4|        if (!JS_IsUndefined(indices)) {
  ------------------
  |  Branch (48074:13): [True: 0, False: 4]
  ------------------
48075|      0|            t = indices_groups, indices_groups = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
48076|      0|            if (JS_DefinePropertyValue(ctx, indices, JS_ATOM_groups,
  ------------------
  |  Branch (48076:17): [True: 0, False: 0]
  ------------------
48077|      0|                                       t, prop_flags) < 0) {
48078|      0|                goto fail;
48079|      0|            }
48080|      0|            t = indices, indices = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
48081|      0|            if (JS_DefinePropertyValue(ctx, obj, JS_ATOM_indices,
  ------------------
  |  Branch (48081:17): [True: 0, False: 0]
  ------------------
48082|      0|                                       t, prop_flags) < 0) {
48083|      0|                goto fail;
48084|      0|            }
48085|      0|        }
48086|      4|    }
48087|  1.00M|    ret = obj;
48088|  1.00M|    obj = JS_UNDEFINED;
  ------------------
  |  |  291|  1.00M|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|  1.00M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
48089|  1.00M|fail:
48090|  1.00M|    JS_FreeAtom(ctx, group_name);
48091|  1.00M|    JS_FreeValue(ctx, indices_groups);
48092|  1.00M|    JS_FreeValue(ctx, indices);
48093|  1.00M|    JS_FreeValue(ctx, str_val);
48094|  1.00M|    JS_FreeValue(ctx, groups);
48095|  1.00M|    JS_FreeValue(ctx, obj);
48096|  1.00M|    js_free(ctx, capture);
48097|  1.00M|    return ret;
48098|  1.00M|}
quickjs.c:js_regexp_get_lastIndex:
47851|  1.00M|{
47852|  1.00M|    JSObject *p = JS_VALUE_GET_OBJ(this_val);
  ------------------
  |  |  229|  1.00M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.00M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47853|       |    
47854|       |    /* lastIndex is always the first property (it is not configurable) */
47855|  1.00M|    if (likely(JS_VALUE_GET_TAG(p->prop[0].u.value) == JS_TAG_INT)) {
  ------------------
  |  |   32|  1.00M|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 1.00M, False: 0]
  |  |  ------------------
  ------------------
47856|  1.00M|        *plast_index = max_int(JS_VALUE_GET_INT(p->prop[0].u.value), 0);
  ------------------
  |  |  239|  1.00M|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
47857|  1.00M|        return 0;
47858|  1.00M|    } else {
47859|      0|        return JS_ToLengthFree(ctx, plast_index, JS_DupValue(ctx, p->prop[0].u.value));
47860|      0|    }
47861|  1.00M|}
quickjs.c:JS_ToLengthFree:
13511|     15|{
13512|     15|    int res = JS_ToInt64Clamp(ctx, plen, val, 0, MAX_SAFE_INTEGER, 0);
  ------------------
  |  |13485|     15|#define MAX_SAFE_INTEGER (((int64_t)1 << 53) - 1)
  ------------------
13513|     15|    JS_FreeValue(ctx, val);
13514|     15|    return res;
13515|     15|}
quickjs.c:js_regexp_set_lastIndex:
47866|  1.00M|{
47867|  1.00M|    JSObject *p = JS_VALUE_GET_OBJ(this_val);
  ------------------
  |  |  229|  1.00M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.00M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47868|       |    
47869|       |    /* lastIndex is always the first property (it is not configurable) */
47870|  1.00M|    if (likely(JS_VALUE_GET_TAG(p->prop[0].u.value) == JS_TAG_INT &&
  ------------------
  |  |   32|  2.01M|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 1.00M, False: 0]
  |  |  |  Branch (32:45): [True: 1.00M, False: 0]
  |  |  |  Branch (32:45): [True: 1.00M, False: 0]
  |  |  ------------------
  ------------------
47871|  1.00M|               (get_shape_prop(p->shape)->flags & JS_PROP_WRITABLE))) {
47872|  1.00M|        set_value(ctx, &p->prop[0].u.value, JS_NewInt32(ctx, last_index));
47873|  1.00M|    } else {
47874|      0|        if (JS_SetProperty(ctx, this_val, JS_ATOM_lastIndex,
  ------------------
  |  Branch (47874:13): [True: 0, False: 0]
  ------------------
47875|      0|                           JS_NewInt32(ctx, last_index)) < 0)
47876|      0|            return -1;
47877|      0|    }
47878|  1.00M|    return 0;
47879|  1.00M|}
quickjs.c:JS_RegExpExec:
48218|  1.00M|{
48219|  1.00M|    JSValue method, ret;
48220|       |
48221|  1.00M|    method = JS_GetProperty(ctx, r, JS_ATOM_exec);
48222|  1.00M|    if (JS_IsException(method))
  ------------------
  |  Branch (48222:9): [True: 0, False: 1.00M]
  ------------------
48223|      0|        return method;
48224|  1.00M|    if (JS_IsFunction(ctx, method)) {
  ------------------
  |  Branch (48224:9): [True: 1.00M, False: 0]
  ------------------
48225|  1.00M|        ret = JS_CallFree(ctx, method, r, 1, &s);
48226|  1.00M|        if (JS_IsException(ret))
  ------------------
  |  Branch (48226:13): [True: 1, False: 1.00M]
  ------------------
48227|      1|            return ret;
48228|  1.00M|        if (!JS_IsObject(ret) && !JS_IsNull(ret)) {
  ------------------
  |  Branch (48228:13): [True: 1.00M, False: 4]
  |  Branch (48228:34): [True: 0, False: 1.00M]
  ------------------
48229|      0|            JS_FreeValue(ctx, ret);
48230|      0|            return JS_ThrowTypeError(ctx, "RegExp exec method must return an object or null");
48231|      0|        }
48232|  1.00M|        return ret;
48233|  1.00M|    }
48234|      0|    JS_FreeValue(ctx, method);
48235|      0|    return js_regexp_exec(ctx, r, 1, &s);
48236|  1.00M|}
quickjs.c:string_buffer_concat_value_free:
 4290|   343k|{
 4291|   343k|    JSString *p;
 4292|   343k|    int res;
 4293|       |
 4294|   343k|    if (s->error_status) {
  ------------------
  |  Branch (4294:9): [True: 0, False: 343k]
  ------------------
 4295|       |        /* prevent exception overload */
 4296|      0|        JS_FreeValue(s->ctx, v);
 4297|      0|        return -1;
 4298|      0|    }
 4299|   343k|    if (unlikely(JS_VALUE_GET_TAG(v) != JS_TAG_STRING)) {
  ------------------
  |  |   33|   343k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 343k]
  |  |  ------------------
  ------------------
 4300|      0|        v = JS_ToStringFree(s->ctx, v);
 4301|      0|        if (JS_IsException(v))
  ------------------
  |  Branch (4301:13): [True: 0, False: 0]
  ------------------
 4302|      0|            return string_buffer_set_error(s);
 4303|      0|    }
 4304|   343k|    p = JS_VALUE_GET_STRING(v);
  ------------------
  |  |  230|   343k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|   343k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4305|   343k|    res = string_buffer_concat(s, p, 0, p->len);
 4306|   343k|    JS_FreeValue(s->ctx, v);
 4307|   343k|    return res;
 4308|   343k|}
quickjs.c:string_indexof_char:
45327|   421k|{
45328|       |    /* assuming 0 <= from <= p->len */
45329|   421k|    int i, len = p->len;
45330|   421k|    if (p->is_wide_char) {
  ------------------
  |  Branch (45330:9): [True: 421k, False: 4]
  ------------------
45331|  1.61M|        for (i = from; i < len; i++) {
  ------------------
  |  Branch (45331:24): [True: 1.61M, False: 2]
  ------------------
45332|  1.61M|            if (p->u.str16[i] == c)
  ------------------
  |  Branch (45332:17): [True: 421k, False: 1.19M]
  ------------------
45333|   421k|                return i;
45334|  1.61M|        }
45335|   421k|    } else {
45336|      4|        if ((c & ~0xff) == 0) {
  ------------------
  |  Branch (45336:13): [True: 4, False: 0]
  ------------------
45337|      6|            for (i = from; i < len; i++) {
  ------------------
  |  Branch (45337:28): [True: 4, False: 2]
  ------------------
45338|      4|                if (p->u.str8[i] == (uint8_t)c)
  ------------------
  |  Branch (45338:21): [True: 2, False: 2]
  ------------------
45339|      2|                    return i;
45340|      4|            }
45341|      4|        }
45342|      4|    }
45343|      4|    return -1;
45344|   421k|}
quickjs.c:string_advance_index:
45363|  1.00M|{
45364|  1.00M|    if (!unicode || index >= p->len || !p->is_wide_char) {
  ------------------
  |  Branch (45364:9): [True: 0, False: 1.00M]
  |  Branch (45364:21): [True: 0, False: 1.00M]
  |  Branch (45364:40): [True: 0, False: 1.00M]
  ------------------
45365|      0|        index++;
45366|  1.00M|    } else {
45367|  1.00M|        int index32 = (int)index;
45368|  1.00M|        string_getc(p, &index32);
45369|  1.00M|        index = index32;
45370|  1.00M|    }
45371|  1.00M|    return index;
45372|  1.00M|}
quickjs.c:js_regexp_Symbol_split:
48877|      2|{
48878|       |    // [Symbol.split](str, limit)
48879|      2|    JSValueConst rx = this_val;
  ------------------
  |  |  234|      2|#define JSValueConst JSValue
  ------------------
48880|      2|    JSValueConst args[2];
  ------------------
  |  |  234|      2|#define JSValueConst JSValue
  ------------------
48881|      2|    JSValue str, ctor, splitter, A, flags, z, sub;
48882|      2|    JSString *strp;
48883|      2|    uint32_t lim, size, p, q;
48884|      2|    int unicodeMatching;
48885|      2|    int64_t lengthA, e, numberOfCaptures, i;
48886|       |
48887|      2|    if (!JS_IsObject(rx))
  ------------------
  |  Branch (48887:9): [True: 0, False: 2]
  ------------------
48888|      0|        return JS_ThrowTypeErrorNotAnObject(ctx);
48889|       |
48890|      2|    ctor = JS_UNDEFINED;
  ------------------
  |  |  291|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
48891|      2|    splitter = JS_UNDEFINED;
  ------------------
  |  |  291|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
48892|      2|    A = JS_UNDEFINED;
  ------------------
  |  |  291|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
48893|      2|    flags = JS_UNDEFINED;
  ------------------
  |  |  291|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
48894|      2|    z = JS_UNDEFINED;
  ------------------
  |  |  291|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
48895|      2|    str = JS_ToString(ctx, argv[0]);
48896|      2|    if (JS_IsException(str))
  ------------------
  |  Branch (48896:9): [True: 0, False: 2]
  ------------------
48897|      0|        goto exception;
48898|      2|    ctor = JS_SpeciesConstructor(ctx, rx, ctx->regexp_ctor);
48899|      2|    if (JS_IsException(ctor))
  ------------------
  |  Branch (48899:9): [True: 0, False: 2]
  ------------------
48900|      0|        goto exception;
48901|      2|    flags = JS_ToStringFree(ctx, JS_GetProperty(ctx, rx, JS_ATOM_flags));
48902|      2|    if (JS_IsException(flags))
  ------------------
  |  Branch (48902:9): [True: 0, False: 2]
  ------------------
48903|      0|        goto exception;
48904|      2|    strp = JS_VALUE_GET_STRING(flags);
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
48905|      2|    unicodeMatching = (string_indexof_char(strp, 'u', 0) >= 0 ||
  ------------------
  |  Branch (48905:24): [True: 2, False: 0]
  ------------------
48906|      0|                       string_indexof_char(strp, 'v', 0) >= 0);
  ------------------
  |  Branch (48906:24): [True: 0, False: 0]
  ------------------
48907|      2|    if (string_indexof_char(strp, 'y', 0) < 0) {
  ------------------
  |  Branch (48907:9): [True: 2, False: 0]
  ------------------
48908|      2|        flags = JS_ConcatString3(ctx, "", flags, "y");
48909|      2|        if (JS_IsException(flags))
  ------------------
  |  Branch (48909:13): [True: 0, False: 2]
  ------------------
48910|      0|            goto exception;
48911|      2|    }
48912|      2|    args[0] = rx;
48913|      2|    args[1] = flags;
48914|      2|    splitter = JS_CallConstructor(ctx, ctor, 2, args);
48915|      2|    if (JS_IsException(splitter))
  ------------------
  |  Branch (48915:9): [True: 0, False: 2]
  ------------------
48916|      0|        goto exception;
48917|      2|    A = JS_NewArray(ctx);
48918|      2|    if (JS_IsException(A))
  ------------------
  |  Branch (48918:9): [True: 0, False: 2]
  ------------------
48919|      0|        goto exception;
48920|      2|    lengthA = 0;
48921|      2|    if (JS_IsUndefined(argv[1])) {
  ------------------
  |  Branch (48921:9): [True: 2, False: 0]
  ------------------
48922|      2|        lim = 0xffffffff;
48923|      2|    } else {
48924|      0|        if (JS_ToUint32(ctx, &lim, argv[1]) < 0)
  ------------------
  |  Branch (48924:13): [True: 0, False: 0]
  ------------------
48925|      0|            goto exception;
48926|      0|        if (lim == 0)
  ------------------
  |  Branch (48926:13): [True: 0, False: 0]
  ------------------
48927|      0|            goto done;
48928|      0|    }
48929|      2|    strp = JS_VALUE_GET_STRING(str);
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
48930|      2|    p = q = 0;
48931|      2|    size = strp->len;
48932|      2|    if (size == 0) {
  ------------------
  |  Branch (48932:9): [True: 0, False: 2]
  ------------------
48933|      0|        z = JS_RegExpExec(ctx, splitter, str);
48934|      0|        if (JS_IsException(z))
  ------------------
  |  Branch (48934:13): [True: 0, False: 0]
  ------------------
48935|      0|            goto exception;
48936|      0|        if (JS_IsNull(z))
  ------------------
  |  Branch (48936:13): [True: 0, False: 0]
  ------------------
48937|      0|            goto add_tail;
48938|      0|        goto done;
48939|      0|    }
48940|  1.00M|    while (q < size) {
  ------------------
  |  Branch (48940:12): [True: 1.00M, False: 1]
  ------------------
48941|  1.00M|        if (JS_SetProperty(ctx, splitter, JS_ATOM_lastIndex, JS_NewInt32(ctx, q)) < 0)
  ------------------
  |  Branch (48941:13): [True: 0, False: 1.00M]
  ------------------
48942|      0|            goto exception;
48943|  1.00M|        JS_FreeValue(ctx, z);
48944|  1.00M|        z = JS_RegExpExec(ctx, splitter, str);
48945|  1.00M|        if (JS_IsException(z))
  ------------------
  |  Branch (48945:13): [True: 1, False: 1.00M]
  ------------------
48946|      1|            goto exception;
48947|  1.00M|        if (JS_IsNull(z)) {
  ------------------
  |  Branch (48947:13): [True: 1.00M, False: 4]
  ------------------
48948|  1.00M|            q = string_advance_index(strp, q, unicodeMatching);
48949|  1.00M|        } else {
48950|      4|            if (JS_ToLengthFree(ctx, &e, JS_GetProperty(ctx, splitter, JS_ATOM_lastIndex)))
  ------------------
  |  Branch (48950:17): [True: 0, False: 4]
  ------------------
48951|      0|                goto exception;
48952|      4|            if (e > size)
  ------------------
  |  Branch (48952:17): [True: 0, False: 4]
  ------------------
48953|      0|                e = size;
48954|      4|            if (e == p) {
  ------------------
  |  Branch (48954:17): [True: 0, False: 4]
  ------------------
48955|      0|                q = string_advance_index(strp, q, unicodeMatching);
48956|      4|            } else {
48957|      4|                sub = js_sub_string(ctx, strp, p, q);
48958|      4|                if (JS_IsException(sub))
  ------------------
  |  Branch (48958:21): [True: 0, False: 4]
  ------------------
48959|      0|                    goto exception;
48960|      4|                if (JS_DefinePropertyValueInt64(ctx, A, lengthA++, sub,
  ------------------
  |  Branch (48960:21): [True: 0, False: 4]
  ------------------
48961|      4|                                                JS_PROP_C_W_E | JS_PROP_THROW) < 0)
  ------------------
  |  |  301|      4|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      4|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|      4|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|      4|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                                                              JS_PROP_C_W_E | JS_PROP_THROW) < 0)
  ------------------
  |  |  320|      4|#define JS_PROP_THROW            (1 << 14)
  ------------------
48962|      0|                    goto exception;
48963|      4|                if (lengthA == lim)
  ------------------
  |  Branch (48963:21): [True: 0, False: 4]
  ------------------
48964|      0|                    goto done;
48965|      4|                p = e;
48966|      4|                if (js_get_length64(ctx, &numberOfCaptures, z))
  ------------------
  |  Branch (48966:21): [True: 0, False: 4]
  ------------------
48967|      0|                    goto exception;
48968|      4|                for(i = 1; i < numberOfCaptures; i++) {
  ------------------
  |  Branch (48968:28): [True: 0, False: 4]
  ------------------
48969|      0|                    sub = JS_GetPropertyInt64(ctx, z, i);
48970|      0|                    if (JS_IsException(sub))
  ------------------
  |  Branch (48970:25): [True: 0, False: 0]
  ------------------
48971|      0|                        goto exception;
48972|      0|                    if (JS_DefinePropertyValueInt64(ctx, A, lengthA++, sub, JS_PROP_C_W_E | JS_PROP_THROW) < 0)
  ------------------
  |  |  301|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                                  if (JS_DefinePropertyValueInt64(ctx, A, lengthA++, sub, JS_PROP_C_W_E | JS_PROP_THROW) < 0)
  ------------------
  |  |  320|      0|#define JS_PROP_THROW            (1 << 14)
  ------------------
  |  Branch (48972:25): [True: 0, False: 0]
  ------------------
48973|      0|                        goto exception;
48974|      0|                    if (lengthA == lim)
  ------------------
  |  Branch (48974:25): [True: 0, False: 0]
  ------------------
48975|      0|                        goto done;
48976|      0|                }
48977|      4|                q = p;
48978|      4|            }
48979|      4|        }
48980|  1.00M|    }
48981|      1|add_tail:
48982|      1|    if (p > size)
  ------------------
  |  Branch (48982:9): [True: 0, False: 1]
  ------------------
48983|      0|        p = size;
48984|      1|    sub = js_sub_string(ctx, strp, p, size);
48985|      1|    if (JS_IsException(sub))
  ------------------
  |  Branch (48985:9): [True: 0, False: 1]
  ------------------
48986|      0|        goto exception;
48987|      1|    if (JS_DefinePropertyValueInt64(ctx, A, lengthA++, sub, JS_PROP_C_W_E | JS_PROP_THROW) < 0)
  ------------------
  |  |  301|      1|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      1|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|      1|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|      1|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                  if (JS_DefinePropertyValueInt64(ctx, A, lengthA++, sub, JS_PROP_C_W_E | JS_PROP_THROW) < 0)
  ------------------
  |  |  320|      1|#define JS_PROP_THROW            (1 << 14)
  ------------------
  |  Branch (48987:9): [True: 0, False: 1]
  ------------------
48988|      0|        goto exception;
48989|      1|    goto done;
48990|      1|exception:
48991|      1|    JS_FreeValue(ctx, A);
48992|      1|    A = JS_EXCEPTION;
  ------------------
  |  |  294|      1|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
48993|      2|done:
48994|      2|    JS_FreeValue(ctx, str);
48995|      2|    JS_FreeValue(ctx, ctor);
48996|      2|    JS_FreeValue(ctx, splitter);
48997|      2|    JS_FreeValue(ctx, flags);
48998|      2|    JS_FreeValue(ctx, z);
48999|      2|    return A;
49000|      1|}
quickjs.c:js_new_shape2:
 5240|  1.27k|{
 5241|  1.27k|    JSRuntime *rt = ctx->rt;
 5242|  1.27k|    JSShape *sh;
 5243|       |
 5244|       |    /* resize the shape hash table if necessary */
 5245|  1.27k|    if (2 * (rt->shape_hash_count + 1) > rt->shape_hash_size) {
  ------------------
  |  Branch (5245:9): [True: 20, False: 1.25k]
  ------------------
 5246|     20|        resize_shape_hash(rt, rt->shape_hash_bits + 1);
 5247|     20|    }
 5248|       |
 5249|  1.27k|    sh = js_new_shape_nohash(ctx, proto, hash_size, prop_size);
 5250|  1.27k|    if (!sh)
  ------------------
  |  Branch (5250:9): [True: 0, False: 1.27k]
  ------------------
 5251|      0|        return NULL;
 5252|       |    
 5253|       |    /* insert in the hash table */
 5254|  1.27k|    sh->hash = shape_initial_hash(proto);
 5255|  1.27k|    sh->is_hashed = TRUE;
 5256|  1.27k|    js_shape_hash_link(ctx->rt, sh);
 5257|  1.27k|    return sh;
 5258|  1.27k|}
quickjs.c:resize_shape_hash:
 5166|     20|{
 5167|     20|    int new_shape_hash_size, i;
 5168|     20|    uint32_t h;
 5169|     20|    JSShape **new_shape_hash, *sh, *sh_next;
 5170|       |
 5171|     20|    new_shape_hash_size = 1 << new_shape_hash_bits;
 5172|     20|    new_shape_hash = js_mallocz_rt(rt, sizeof(rt->shape_hash[0]) *
 5173|     20|                                   new_shape_hash_size);
 5174|     20|    if (!new_shape_hash)
  ------------------
  |  Branch (5174:9): [True: 0, False: 20]
  ------------------
 5175|      0|        return -1;
 5176|    388|    for(i = 0; i < rt->shape_hash_size; i++) {
  ------------------
  |  Branch (5176:16): [True: 368, False: 20]
  ------------------
 5177|    552|        for(sh = rt->shape_hash[i]; sh != NULL; sh = sh_next) {
  ------------------
  |  Branch (5177:37): [True: 184, False: 368]
  ------------------
 5178|    184|            sh_next = sh->shape_hash_next;
 5179|    184|            h = get_shape_hash(sh->hash, new_shape_hash_bits);
 5180|    184|            sh->shape_hash_next = new_shape_hash[h];
 5181|    184|            new_shape_hash[h] = sh;
 5182|    184|        }
 5183|    368|    }
 5184|     20|    js_free_rt(rt, rt->shape_hash);
 5185|     20|    rt->shape_hash_bits = new_shape_hash_bits;
 5186|     20|    rt->shape_hash_size = new_shape_hash_size;
 5187|     20|    rt->shape_hash = new_shape_hash;
 5188|     20|    return 0;
 5189|     20|}
quickjs.c:add_shape_property:
 5471|  17.6k|{
 5472|  17.6k|    JSRuntime *rt = ctx->rt;
 5473|  17.6k|    JSShape *sh = *psh;
 5474|  17.6k|    JSShapeProperty *pr, *prop;
 5475|  17.6k|    uint32_t hash_mask, new_shape_hash = 0;
 5476|  17.6k|    intptr_t h;
 5477|       |
 5478|       |    /* update the shape hash */
 5479|  17.6k|    if (sh->is_hashed) {
  ------------------
  |  Branch (5479:9): [True: 4.34k, False: 13.3k]
  ------------------
 5480|  4.34k|        js_shape_hash_unlink(rt, sh);
 5481|  4.34k|        new_shape_hash = shape_hash(shape_hash(sh->hash, atom), prop_flags);
 5482|  4.34k|    }
 5483|       |
 5484|  17.6k|    if (unlikely(sh->prop_count >= sh->prop_size)) {
  ------------------
  |  |   33|  17.6k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 554, False: 17.1k]
  |  |  ------------------
  ------------------
 5485|    554|        if (resize_properties(ctx, psh, p, sh->prop_count + 1)) {
  ------------------
  |  Branch (5485:13): [True: 0, False: 554]
  ------------------
 5486|       |            /* in case of error, reinsert in the hash table.
 5487|       |               sh is still valid if resize_properties() failed */
 5488|      0|            if (sh->is_hashed)
  ------------------
  |  Branch (5488:17): [True: 0, False: 0]
  ------------------
 5489|      0|                js_shape_hash_link(rt, sh);
 5490|      0|            return -1;
 5491|      0|        }
 5492|    554|        sh = *psh;
 5493|    554|    }
 5494|  17.6k|    if (sh->is_hashed) {
  ------------------
  |  Branch (5494:9): [True: 4.34k, False: 13.3k]
  ------------------
 5495|  4.34k|        sh->hash = new_shape_hash;
 5496|  4.34k|        js_shape_hash_link(rt, sh);
 5497|  4.34k|    }
 5498|       |    /* Initialize the new shape property.
 5499|       |       The object property at p->prop[sh->prop_count] is uninitialized */
 5500|  17.6k|    prop = get_shape_prop(sh);
 5501|  17.6k|    pr = &prop[sh->prop_count++];
 5502|  17.6k|    pr->atom = JS_DupAtom(ctx, atom);
 5503|  17.6k|    pr->flags = prop_flags;
 5504|       |    /* add in hash table */
 5505|  17.6k|    hash_mask = sh->prop_hash_mask;
 5506|  17.6k|    h = atom & hash_mask;
 5507|  17.6k|    pr->hash_next = sh->hash_table[h];
 5508|  17.6k|    sh->hash_table[h] = sh->prop_count;
 5509|  17.6k|    return 0;
 5510|  17.6k|}
quickjs.c:js_parse_init:
37016|     34|{
37017|     34|    memset(s, 0, sizeof(*s));
37018|     34|    s->ctx = ctx;
37019|     34|    s->filename = filename;
37020|     34|    s->buf_start = s->buf_ptr = (const uint8_t *)input;
37021|     34|    s->buf_end = s->buf_ptr + input_len;
37022|     34|    s->token.val = ' ';
37023|     34|    s->token.ptr = s->buf_ptr;
37024|       |
37025|     34|    s->get_line_col_cache.ptr = s->buf_start;
37026|     34|    s->get_line_col_cache.buf_start = s->buf_start;
37027|     34|    s->get_line_col_cache.line_num = 0;
37028|     34|    s->get_line_col_cache.col_num = 0;
37029|     34|}
quickjs.c:js_parse_error_pos:
22231|      1|{
22232|      1|    va_list ap;
22233|      1|    int ret;
22234|       |    
22235|      1|    va_start(ap, fmt);
22236|      1|    ret = js_parse_error_v(s, ptr, fmt, ap);
22237|       |    va_end(ap);
22238|      1|    return ret;
22239|      1|}
quickjs.c:js_parse_error_v:
22220|      5|{
22221|      5|    JSContext *ctx = s->ctx;
22222|      5|    int line_num, col_num;
22223|      5|    line_num = get_line_col(&col_num, s->buf_start, ptr - s->buf_start);
22224|      5|    JS_ThrowError2(ctx, JS_SYNTAX_ERROR, fmt, ap, FALSE);
22225|      5|    build_backtrace(ctx, ctx->rt->current_exception, s->filename,
22226|      5|                    line_num + 1, col_num + 1, 0);
22227|      5|    return -1;
22228|      5|}
quickjs.c:get_line_col:
22164|    154|{
22165|    154|    int line_num, col_num, c;
22166|    154|    size_t i;
22167|       |    
22168|    154|    line_num = 0;
22169|    154|    col_num = 0;
22170|  13.0M|    for(i = 0; i < len; i++) {
  ------------------
  |  Branch (22170:16): [True: 13.0M, False: 154]
  ------------------
22171|  13.0M|        c = buf[i];
22172|  13.0M|        if (c == '\n') {
  ------------------
  |  Branch (22172:13): [True: 3.65M, False: 9.35M]
  ------------------
22173|  3.65M|            line_num++;
22174|  3.65M|            col_num = 0;
22175|  9.35M|        } else if (c < 0x80 || c >= 0xc0) {
  ------------------
  |  Branch (22175:20): [True: 9.34M, False: 7.97k]
  |  Branch (22175:32): [True: 3.98k, False: 3.98k]
  ------------------
22176|  9.34M|            col_num++;
22177|  9.34M|        }
22178|  13.0M|    }
22179|    154|    *pcol_num = col_num;
22180|    154|    return line_num;
22181|    154|}
quickjs.c:ident_realloc:
22596|     46|{
22597|     46|    char *buf, *new_buf;
22598|     46|    size_t size, new_size;
22599|       |
22600|     46|    buf = *pbuf;
22601|     46|    size = *psize;
22602|     46|    if (size >= (SIZE_MAX / 3) * 2)
  ------------------
  |  Branch (22602:9): [True: 0, False: 46]
  ------------------
22603|      0|        new_size = SIZE_MAX;
22604|     46|    else
22605|     46|        new_size = size + (size >> 1);
22606|     46|    if (buf == static_buf) {
  ------------------
  |  Branch (22606:9): [True: 2, False: 44]
  ------------------
22607|      2|        new_buf = js_malloc(ctx, new_size);
22608|      2|        if (!new_buf)
  ------------------
  |  Branch (22608:13): [True: 0, False: 2]
  ------------------
22609|      0|            return -1;
22610|      2|        memcpy(new_buf, buf, size);
22611|     44|    } else {
22612|     44|        new_buf = js_realloc(ctx, buf, new_size);
22613|     44|        if (!new_buf)
  ------------------
  |  Branch (22613:13): [True: 0, False: 44]
  ------------------
22614|      0|            return -1;
22615|     44|    }
22616|     46|    *pbuf = new_buf;
22617|     46|    *psize = new_size;
22618|     46|    return 0;
22619|     46|}
quickjs.c:js_parse_error:
22242|      4|{
22243|      4|    va_list ap;
22244|      4|    int ret;
22245|       |    
22246|      4|    va_start(ap, fmt);
22247|      4|    ret = js_parse_error_v(s, s->token.ptr, fmt, ap);
22248|       |    va_end(ap);
22249|      4|    return ret;
22250|      4|}
quickjs.c:free_token:
22074|  1.03k|{
22075|  1.03k|    switch(token->val) {
22076|     22|    case TOK_NUMBER:
  ------------------
  |  Branch (22076:5): [True: 22, False: 1.00k]
  ------------------
22077|     22|        JS_FreeValue(s->ctx, token->u.num.val);
22078|     22|        break;
22079|     43|    case TOK_STRING:
  ------------------
  |  Branch (22079:5): [True: 43, False: 987]
  ------------------
22080|     87|    case TOK_TEMPLATE:
  ------------------
  |  Branch (22080:5): [True: 44, False: 986]
  ------------------
22081|     87|        JS_FreeValue(s->ctx, token->u.str.str);
22082|     87|        break;
22083|      1|    case TOK_REGEXP:
  ------------------
  |  Branch (22083:5): [True: 1, False: 1.02k]
  ------------------
22084|      1|        JS_FreeValue(s->ctx, token->u.regexp.body);
22085|      1|        JS_FreeValue(s->ctx, token->u.regexp.flags);
22086|      1|        break;
22087|    410|    case TOK_IDENT:
  ------------------
  |  Branch (22087:5): [True: 410, False: 620]
  ------------------
22088|    410|    case TOK_PRIVATE_NAME:
  ------------------
  |  Branch (22088:5): [True: 0, False: 1.03k]
  ------------------
22089|    410|        JS_FreeAtom(s->ctx, token->u.ident.atom);
22090|    410|        break;
22091|    510|    default:
  ------------------
  |  Branch (22091:5): [True: 510, False: 520]
  ------------------
22092|    510|        if (token->val >= TOK_FIRST_KEYWORD &&
  ------------------
  |  |21765|  1.02k|#define TOK_FIRST_KEYWORD   TOK_NULL
  ------------------
  |  Branch (22092:13): [True: 497, False: 13]
  ------------------
22093|    497|            token->val <= TOK_LAST_KEYWORD) {
  ------------------
  |  |21766|    497|#define TOK_LAST_KEYWORD    TOK_AWAIT
  ------------------
  |  Branch (22093:13): [True: 80, False: 417]
  ------------------
22094|     80|            JS_FreeAtom(s->ctx, token->u.ident.atom);
22095|     80|        }
22096|    510|        break;
22097|  1.03k|    }
22098|  1.03k|}
quickjs.c:js_get_length64:
41022|     11|{
41023|     11|    JSValue len_val;
41024|     11|    len_val = JS_GetProperty(ctx, obj, JS_ATOM_length);
41025|     11|    if (JS_IsException(len_val)) {
  ------------------
  |  Branch (41025:9): [True: 0, False: 11]
  ------------------
41026|      0|        *pres = 0;
41027|      0|        return -1;
41028|      0|    }
41029|     11|    return JS_ToLengthFree(ctx, pres, len_val);
41030|     11|}
quickjs.c:JS_ToStringFree:
13651|      3|{
13652|      3|    JSValue ret;
13653|      3|    ret = JS_ToString(ctx, val);
13654|      3|    JS_FreeValue(ctx, val);
13655|      3|    return ret;
13656|      3|}
quickjs.c:js_sub_string:
 3965|   343k|{
 3966|   343k|    int len = end - start;
 3967|   343k|    if (start == 0 && end == p->len) {
  ------------------
  |  Branch (3967:9): [True: 4, False: 343k]
  |  Branch (3967:23): [True: 0, False: 4]
  ------------------
 3968|      0|        return JS_DupValue(ctx, JS_MKPTR(JS_TAG_STRING, p));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3969|      0|    }
 3970|   343k|    if (p->is_wide_char && len > 0) {
  ------------------
  |  Branch (3970:9): [True: 343k, False: 0]
  |  Branch (3970:28): [True: 72.6k, False: 270k]
  ------------------
 3971|  72.6k|        JSString *str;
 3972|  72.6k|        int i;
 3973|  72.6k|        uint16_t c = 0;
 3974|  2.22M|        for (i = start; i < end; i++) {
  ------------------
  |  Branch (3974:25): [True: 2.15M, False: 72.6k]
  ------------------
 3975|  2.15M|            c |= p->u.str16[i];
 3976|  2.15M|        }
 3977|  72.6k|        if (c > 0xFF)
  ------------------
  |  Branch (3977:13): [True: 1.24k, False: 71.4k]
  ------------------
 3978|  1.24k|            return js_new_string16_len(ctx, p->u.str16 + start, len);
 3979|       |
 3980|  71.4k|        str = js_alloc_string(ctx, len, 0);
 3981|  71.4k|        if (!str)
  ------------------
  |  Branch (3981:13): [True: 0, False: 71.4k]
  ------------------
 3982|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 3983|  1.38M|        for (i = 0; i < len; i++) {
  ------------------
  |  Branch (3983:21): [True: 1.31M, False: 71.4k]
  ------------------
 3984|  1.31M|            str->u.str8[i] = p->u.str16[start + i];
 3985|  1.31M|        }
 3986|  71.4k|        str->u.str8[len] = '\0';
 3987|  71.4k|        return JS_MKPTR(JS_TAG_STRING, str);
  ------------------
  |  |  248|  71.4k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3988|   270k|    } else {
 3989|   270k|        return js_new_string8_len(ctx, (const char *)(p->u.str8 + start), len);
 3990|   270k|    }
 3991|   343k|}
quickjs.c:JS_CreateDataPropertyUint32:
10750|   343k|{
10751|   343k|    return JS_DefinePropertyValueValue(ctx, this_obj, JS_NewInt64(ctx, idx),
10752|   343k|                                       val, flags | JS_PROP_CONFIGURABLE |
  ------------------
  |  |  298|   343k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
10753|   343k|                                       JS_PROP_ENUMERABLE | JS_PROP_WRITABLE);
  ------------------
  |  |  300|   343k|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                                                     JS_PROP_ENUMERABLE | JS_PROP_WRITABLE);
  ------------------
  |  |  299|   343k|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10754|   343k|}
quickjs.c:JS_AtomGetStr:
 3591|    417|{
 3592|    417|    return JS_AtomGetStrRT(ctx->rt, buf, buf_size, atom);
 3593|    417|}
quickjs.c:js_new_promise_capability:
53521|     32|{
53522|     32|    JSValue executor, result_promise;
53523|     32|    JSCFunctionDataRecord *s;
53524|     32|    int i;
53525|       |
53526|     32|    executor = js_promise_executor_new(ctx);
53527|     32|    if (JS_IsException(executor))
  ------------------
  |  Branch (53527:9): [True: 0, False: 32]
  ------------------
53528|      0|        return executor;
53529|       |
53530|     32|    if (JS_IsUndefined(ctor)) {
  ------------------
  |  Branch (53530:9): [True: 32, False: 0]
  ------------------
53531|     32|        result_promise = js_promise_constructor(ctx, ctor, 1,
53532|     32|                                                (JSValueConst *)&executor);
53533|     32|    } else {
53534|      0|        result_promise = JS_CallConstructor(ctx, ctor, 1,
53535|      0|                                            (JSValueConst *)&executor);
53536|      0|    }
53537|     32|    if (JS_IsException(result_promise))
  ------------------
  |  Branch (53537:9): [True: 0, False: 32]
  ------------------
53538|      0|        goto fail;
53539|     32|    s = JS_GetOpaque(executor, JS_CLASS_C_FUNCTION_DATA);
53540|     96|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53540:16): [True: 64, False: 32]
  ------------------
53541|     64|        if (check_function(ctx, s->data[i]))
  ------------------
  |  Branch (53541:13): [True: 0, False: 64]
  ------------------
53542|      0|            goto fail;
53543|     64|    }
53544|     96|    for(i = 0; i < 2; i++)
  ------------------
  |  Branch (53544:16): [True: 64, False: 32]
  ------------------
53545|     64|        resolving_funcs[i] = JS_DupValue(ctx, s->data[i]);
53546|     32|    JS_FreeValue(ctx, executor);
53547|     32|    return result_promise;
53548|      0| fail:
53549|      0|    JS_FreeValue(ctx, executor);
53550|      0|    JS_FreeValue(ctx, result_promise);
53551|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53552|     32|}
quickjs.c:js_promise_executor_new:
53509|     32|{
53510|     32|    JSValueConst func_data[2];
  ------------------
  |  |  234|     32|#define JSValueConst JSValue
  ------------------
53511|       |
53512|     32|    func_data[0] = JS_UNDEFINED;
  ------------------
  |  |  291|     32|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     32|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53513|     32|    func_data[1] = JS_UNDEFINED;
  ------------------
  |  |  291|     32|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     32|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53514|     32|    return JS_NewCFunctionData(ctx, js_promise_executor, 2,
53515|     32|                               0, 2, func_data);
53516|     32|}
quickjs.c:js_promise_executor:
53497|     32|{
53498|     32|    int i;
53499|       |
53500|     96|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53500:16): [True: 64, False: 32]
  ------------------
53501|     64|        if (!JS_IsUndefined(func_data[i]))
  ------------------
  |  Branch (53501:13): [True: 0, False: 64]
  ------------------
53502|      0|            return JS_ThrowTypeError(ctx, "resolving function already set");
53503|     64|        func_data[i] = JS_DupValue(ctx, argv[i]);
53504|     64|    }
53505|     32|    return JS_UNDEFINED;
  ------------------
  |  |  291|     32|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     32|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53506|     32|}
quickjs.c:js_promise_finalizer:
53406|     32|{
53407|     32|    JSPromiseData *s = JS_GetOpaque(val, JS_CLASS_PROMISE);
53408|     32|    struct list_head *el, *el1;
53409|     32|    int i;
53410|       |
53411|     32|    if (!s)
  ------------------
  |  Branch (53411:9): [True: 0, False: 32]
  ------------------
53412|      0|        return;
53413|     96|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53413:16): [True: 64, False: 32]
  ------------------
53414|     64|        list_for_each_safe(el, el1, &s->promise_reactions[i]) {
  ------------------
  |  |   89|     64|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 64]
  |  |  ------------------
  |  |   90|     64|        el = el1, el1 = el->next)
  ------------------
53415|      0|            JSPromiseReactionData *rd =
53416|       |                list_entry(el, JSPromiseReactionData, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
53417|      0|            promise_reaction_data_free(rt, rd);
53418|      0|        }
53419|     64|    }
53420|     32|    JS_FreeValueRT(rt, s->promise_result);
53421|     32|    js_free_rt(rt, s);
53422|     32|}
quickjs.c:js_promise_mark:
53426|     56|{
53427|     56|    JSPromiseData *s = JS_GetOpaque(val, JS_CLASS_PROMISE);
53428|     56|    struct list_head *el;
53429|     56|    int i;
53430|       |
53431|     56|    if (!s)
  ------------------
  |  Branch (53431:9): [True: 0, False: 56]
  ------------------
53432|      0|        return;
53433|    168|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53433:16): [True: 112, False: 56]
  ------------------
53434|    112|        list_for_each(el, &s->promise_reactions[i]) {
  ------------------
  |  |   86|    112|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 0, False: 112]
  |  |  ------------------
  ------------------
53435|      0|            JSPromiseReactionData *rd =
53436|       |                list_entry(el, JSPromiseReactionData, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
53437|      0|            JS_MarkValue(rt, rd->resolving_funcs[0], mark_func);
53438|      0|            JS_MarkValue(rt, rd->resolving_funcs[1], mark_func);
53439|      0|            JS_MarkValue(rt, rd->handler, mark_func);
53440|      0|        }
53441|    112|    }
53442|     56|    JS_MarkValue(rt, s->promise_result, mark_func);
53443|     56|}
quickjs.c:js_promise_resolve_function_finalizer:
53334|     64|{
53335|     64|    JSPromiseFunctionData *s = JS_VALUE_GET_OBJ(val)->u.promise_function_data;
  ------------------
  |  |  229|     64|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     64|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
53336|     64|    if (s) {
  ------------------
  |  Branch (53336:9): [True: 64, False: 0]
  ------------------
53337|     64|        js_promise_resolve_function_free_resolved(rt, s->presolved);
53338|     64|        JS_FreeValueRT(rt, s->promise);
53339|     64|        js_free_rt(rt, s);
53340|     64|    }
53341|     64|}
quickjs.c:js_promise_resolve_function_free_resolved:
53285|     96|{
53286|     96|    if (--sr->ref_count == 0) {
  ------------------
  |  Branch (53286:9): [True: 32, False: 64]
  ------------------
53287|     32|        js_free_rt(rt, sr);
53288|     32|    }
53289|     96|}
quickjs.c:js_promise_resolve_function_mark:
53345|    112|{
53346|    112|    JSPromiseFunctionData *s = JS_VALUE_GET_OBJ(val)->u.promise_function_data;
  ------------------
  |  |  229|    112|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    112|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
53347|    112|    if (s) {
  ------------------
  |  Branch (53347:9): [True: 112, False: 0]
  ------------------
53348|    112|        JS_MarkValue(rt, s->promise, mark_func);
53349|    112|    }
53350|    112|}
quickjs.c:js_promise_resolve_function_call:
53357|     32|{
53358|     32|    JSObject *p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  229|     32|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     32|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
53359|     32|    JSPromiseFunctionData *s;
53360|     32|    JSValueConst resolution, args[3];
  ------------------
  |  |  234|     32|#define JSValueConst JSValue
  ------------------
53361|     32|    JSValue then;
53362|     32|    BOOL is_reject;
53363|       |
53364|     32|    s = p->u.promise_function_data;
53365|     32|    if (!s || s->presolved->already_resolved)
  ------------------
  |  Branch (53365:9): [True: 0, False: 32]
  |  Branch (53365:15): [True: 0, False: 32]
  ------------------
53366|      0|        return JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53367|     32|    s->presolved->already_resolved = TRUE;
53368|     32|    is_reject = p->class_id - JS_CLASS_PROMISE_RESOLVE_FUNCTION;
53369|     32|    if (argc > 0)
  ------------------
  |  Branch (53369:9): [True: 32, False: 0]
  ------------------
53370|     32|        resolution = argv[0];
53371|      0|    else
53372|      0|        resolution = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53373|       |#ifdef DUMP_PROMISE
53374|       |    printf("js_promise_resolving_function_call: is_reject=%d ", is_reject);
53375|       |    JS_DumpValue(ctx, "resolution", resolution);
53376|       |    printf("\n");
53377|       |#endif
53378|     32|    if (is_reject || !JS_IsObject(resolution)) {
  ------------------
  |  Branch (53378:9): [True: 0, False: 32]
  |  Branch (53378:22): [True: 32, False: 0]
  ------------------
53379|     32|        goto done;
53380|     32|    } else if (js_same_value(ctx, resolution, s->promise)) {
  ------------------
  |  Branch (53380:16): [True: 0, False: 0]
  ------------------
53381|      0|        JS_ThrowTypeError(ctx, "promise self resolution");
53382|      0|        goto fail_reject;
53383|      0|    }
53384|      0|    then = JS_GetProperty(ctx, resolution, JS_ATOM_then);
53385|      0|    if (JS_IsException(then)) {
  ------------------
  |  Branch (53385:9): [True: 0, False: 0]
  ------------------
53386|      0|        JSValue error;
53387|      0|    fail_reject:
53388|      0|        error = JS_GetException(ctx);
53389|      0|        reject_promise(ctx, s->promise, error);
53390|      0|        JS_FreeValue(ctx, error);
53391|      0|    } else if (!JS_IsFunction(ctx, then)) {
  ------------------
  |  Branch (53391:16): [True: 0, False: 0]
  ------------------
53392|      0|        JS_FreeValue(ctx, then);
53393|     32|    done:
53394|     32|        fulfill_or_reject_promise(ctx, s->promise, resolution, is_reject);
53395|     32|    } else {
53396|      0|        args[0] = s->promise;
53397|      0|        args[1] = resolution;
53398|      0|        args[2] = then;
53399|      0|        JS_EnqueueJob(ctx, js_promise_resolve_thenable_job, 3, args);
53400|      0|        JS_FreeValue(ctx, then);
53401|      0|    }
53402|     32|    return JS_UNDEFINED;
  ------------------
  |  |  291|     32|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     32|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53403|      0|}
quickjs.c:fulfill_or_reject_promise:
53211|     32|{
53212|     32|    JSPromiseData *s = JS_GetOpaque(promise, JS_CLASS_PROMISE);
53213|     32|    struct list_head *el, *el1;
53214|     32|    JSPromiseReactionData *rd;
53215|     32|    JSValueConst args[5];
  ------------------
  |  |  234|     32|#define JSValueConst JSValue
  ------------------
53216|       |
53217|     32|    if (!s || s->promise_state != JS_PROMISE_PENDING)
  ------------------
  |  Branch (53217:9): [True: 0, False: 32]
  |  Branch (53217:15): [True: 0, False: 32]
  ------------------
53218|      0|        return; /* should never happen */
53219|     32|    set_value(ctx, &s->promise_result, JS_DupValue(ctx, value));
53220|     32|    s->promise_state = JS_PROMISE_FULFILLED + is_reject;
53221|       |#ifdef DUMP_PROMISE
53222|       |    printf("fulfill_or_reject_promise: is_reject=%d\n", is_reject);
53223|       |#endif
53224|     32|    if (s->promise_state == JS_PROMISE_REJECTED && !s->is_handled) {
  ------------------
  |  Branch (53224:9): [True: 0, False: 32]
  |  Branch (53224:52): [True: 0, False: 0]
  ------------------
53225|      0|        JSRuntime *rt = ctx->rt;
53226|      0|        if (rt->host_promise_rejection_tracker) {
  ------------------
  |  Branch (53226:13): [True: 0, False: 0]
  ------------------
53227|      0|            rt->host_promise_rejection_tracker(ctx, promise, value, FALSE,
53228|      0|                                               rt->host_promise_rejection_tracker_opaque);
53229|      0|        }
53230|      0|    }
53231|       |
53232|     32|    list_for_each_safe(el, el1, &s->promise_reactions[is_reject]) {
  ------------------
  |  |   89|     32|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 32]
  |  |  ------------------
  |  |   90|     32|        el = el1, el1 = el->next)
  ------------------
53233|      0|        rd = list_entry(el, JSPromiseReactionData, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
53234|      0|        args[0] = rd->resolving_funcs[0];
53235|      0|        args[1] = rd->resolving_funcs[1];
53236|      0|        args[2] = rd->handler;
53237|      0|        args[3] = JS_NewBool(ctx, is_reject);
53238|      0|        args[4] = value;
53239|      0|        JS_EnqueueJob(ctx, promise_reaction_job, 5, args);
53240|      0|        list_del(&rd->link);
53241|      0|        promise_reaction_data_free(ctx->rt, rd);
53242|      0|    }
53243|       |
53244|     32|    list_for_each_safe(el, el1, &s->promise_reactions[1 - is_reject]) {
  ------------------
  |  |   89|     32|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 32]
  |  |  ------------------
  |  |   90|     32|        el = el1, el1 = el->next)
  ------------------
53245|       |        rd = list_entry(el, JSPromiseReactionData, link);
  ------------------
  |  |   39|      0|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
53246|      0|        list_del(&rd->link);
53247|      0|        promise_reaction_data_free(ctx->rt, rd);
53248|      0|    }
53249|     32|}
quickjs.c:js_create_resolving_functions:
53295|     32|{
53296|     32|    JSValue obj;
53297|     32|    JSPromiseFunctionData *s;
53298|     32|    JSPromiseFunctionDataResolved *sr;
53299|     32|    int i, ret;
53300|       |
53301|     32|    sr = js_malloc(ctx, sizeof(*sr));
53302|     32|    if (!sr)
  ------------------
  |  Branch (53302:9): [True: 0, False: 32]
  ------------------
53303|      0|        return -1;
53304|     32|    sr->ref_count = 1;
53305|     32|    sr->already_resolved = FALSE; /* must be shared between the two functions */
53306|     32|    ret = 0;
53307|     96|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53307:16): [True: 64, False: 32]
  ------------------
53308|     64|        obj = JS_NewObjectProtoClass(ctx, ctx->function_proto,
53309|     64|                                     JS_CLASS_PROMISE_RESOLVE_FUNCTION + i);
53310|     64|        if (JS_IsException(obj))
  ------------------
  |  Branch (53310:13): [True: 0, False: 64]
  ------------------
53311|      0|            goto fail;
53312|     64|        s = js_malloc(ctx, sizeof(*s));
53313|     64|        if (!s) {
  ------------------
  |  Branch (53313:13): [True: 0, False: 64]
  ------------------
53314|      0|            JS_FreeValue(ctx, obj);
53315|      0|        fail:
53316|       |
53317|      0|            if (i != 0)
  ------------------
  |  Branch (53317:17): [True: 0, False: 0]
  ------------------
53318|      0|                JS_FreeValue(ctx, resolving_funcs[0]);
53319|      0|            ret = -1;
53320|      0|            break;
53321|      0|        }
53322|     64|        sr->ref_count++;
53323|     64|        s->presolved = sr;
53324|     64|        s->promise = JS_DupValue(ctx, promise);
53325|     64|        JS_SetOpaque(obj, s);
53326|     64|        js_function_set_properties(ctx, obj, JS_ATOM_empty_string, 1);
53327|     64|        resolving_funcs[i] = obj;
53328|     64|    }
53329|     32|    js_promise_resolve_function_free_resolved(ctx->rt, sr);
53330|     32|    return ret;
53331|     32|}
quickjs.c:js_async_function_call:
21205|     16|{
21206|     16|    JSValue promise;
21207|     16|    JSAsyncFunctionState *s;
21208|       |
21209|     16|    s = async_func_init(ctx, func_obj, this_obj, argc, argv);
21210|     16|    if (!s)
  ------------------
  |  Branch (21210:9): [True: 0, False: 16]
  ------------------
21211|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
21212|       |
21213|     16|    promise = JS_NewPromiseCapability(ctx, s->resolving_funcs);
21214|     16|    if (JS_IsException(promise)) {
  ------------------
  |  Branch (21214:9): [True: 0, False: 16]
  ------------------
21215|      0|        async_func_free(ctx->rt, s);
21216|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
21217|      0|    }
21218|       |
21219|     16|    js_async_function_resume(ctx, s);
21220|       |
21221|     16|    async_func_free(ctx->rt, s);
21222|       |
21223|     16|    return promise;
21224|     16|}
quickjs.c:js_async_function_resume:
21122|     16|{
21123|     16|    JSValue func_ret, ret2;
21124|       |
21125|     16|    func_ret = async_func_resume(ctx, s);
21126|     16|    if (s->is_completed) {
  ------------------
  |  Branch (21126:9): [True: 16, False: 0]
  ------------------
21127|     16|        if (JS_IsException(func_ret)) {
  ------------------
  |  Branch (21127:13): [True: 0, False: 16]
  ------------------
21128|      0|            JSValue error;
21129|      0|        fail:
21130|      0|            error = JS_GetException(ctx);
21131|      0|            ret2 = JS_Call(ctx, s->resolving_funcs[1], JS_UNDEFINED,
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
21132|      0|                           1, (JSValueConst *)&error);
21133|      0|            JS_FreeValue(ctx, error);
21134|      0|            JS_FreeValue(ctx, ret2); /* XXX: what to do if exception ? */
21135|     16|        } else {
21136|       |            /* normal return */
21137|     16|            ret2 = JS_Call(ctx, s->resolving_funcs[0], JS_UNDEFINED,
  ------------------
  |  |  291|     16|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     16|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
21138|     16|                           1, (JSValueConst *)&func_ret);
21139|     16|            JS_FreeValue(ctx, func_ret);
21140|     16|            JS_FreeValue(ctx, ret2); /* XXX: what to do if exception ? */
21141|     16|        }
21142|     16|    } else {
21143|      0|        JSValue value, promise, resolving_funcs[2], resolving_funcs1[2];
21144|      0|        int i, res;
21145|       |
21146|      0|        value = s->frame.cur_sp[-1];
21147|      0|        s->frame.cur_sp[-1] = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
21148|       |
21149|       |        /* await */
21150|      0|        JS_FreeValue(ctx, func_ret); /* not used */
21151|      0|        promise = js_promise_resolve(ctx, ctx->promise_ctor,
21152|      0|                                     1, (JSValueConst *)&value, 0);
21153|      0|        JS_FreeValue(ctx, value);
21154|      0|        if (JS_IsException(promise))
  ------------------
  |  Branch (21154:13): [True: 0, False: 0]
  ------------------
21155|      0|            goto fail;
21156|      0|        if (js_async_function_resolve_create(ctx, s, resolving_funcs)) {
  ------------------
  |  Branch (21156:13): [True: 0, False: 0]
  ------------------
21157|      0|            JS_FreeValue(ctx, promise);
21158|      0|            goto fail;
21159|      0|        }
21160|       |
21161|       |        /* Note: no need to create 'thrownawayCapability' as in
21162|       |           the spec */
21163|      0|        for(i = 0; i < 2; i++)
  ------------------
  |  Branch (21163:20): [True: 0, False: 0]
  ------------------
21164|      0|            resolving_funcs1[i] = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
21165|      0|        res = perform_promise_then(ctx, promise,
21166|      0|                                   (JSValueConst *)resolving_funcs,
21167|      0|                                   (JSValueConst *)resolving_funcs1);
21168|      0|        JS_FreeValue(ctx, promise);
21169|      0|        for(i = 0; i < 2; i++)
  ------------------
  |  Branch (21169:20): [True: 0, False: 0]
  ------------------
21170|      0|            JS_FreeValue(ctx, resolving_funcs[i]);
21171|      0|        if (res)
  ------------------
  |  Branch (21171:13): [True: 0, False: 0]
  ------------------
21172|      0|            goto fail;
21173|      0|    }
21174|     16|}
quickjs.c:js_promise_constructor:
53447|     32|{
53448|     32|    JSValueConst executor;
  ------------------
  |  |  234|     32|#define JSValueConst JSValue
  ------------------
53449|     32|    JSValue obj;
53450|     32|    JSPromiseData *s;
53451|     32|    JSValue args[2], ret;
53452|     32|    int i;
53453|       |
53454|     32|    executor = argv[0];
53455|     32|    if (check_function(ctx, executor))
  ------------------
  |  Branch (53455:9): [True: 0, False: 32]
  ------------------
53456|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53457|     32|    obj = js_create_from_ctor(ctx, new_target, JS_CLASS_PROMISE);
53458|     32|    if (JS_IsException(obj))
  ------------------
  |  Branch (53458:9): [True: 0, False: 32]
  ------------------
53459|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53460|     32|    s = js_mallocz(ctx, sizeof(*s));
53461|     32|    if (!s)
  ------------------
  |  Branch (53461:9): [True: 0, False: 32]
  ------------------
53462|      0|        goto fail;
53463|     32|    s->promise_state = JS_PROMISE_PENDING;
53464|     32|    s->is_handled = FALSE;
53465|     96|    for(i = 0; i < 2; i++)
  ------------------
  |  Branch (53465:16): [True: 64, False: 32]
  ------------------
53466|     64|        init_list_head(&s->promise_reactions[i]);
53467|     32|    s->promise_result = JS_UNDEFINED;
  ------------------
  |  |  291|     32|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     32|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53468|     32|    JS_SetOpaque(obj, s);
53469|     32|    if (js_create_resolving_functions(ctx, args, obj))
  ------------------
  |  Branch (53469:9): [True: 0, False: 32]
  ------------------
53470|      0|        goto fail;
53471|     32|    ret = JS_Call(ctx, executor, JS_UNDEFINED, 2, (JSValueConst *)args);
  ------------------
  |  |  291|     32|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     32|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53472|     32|    if (JS_IsException(ret)) {
  ------------------
  |  Branch (53472:9): [True: 0, False: 32]
  ------------------
53473|      0|        JSValue ret2, error;
53474|      0|        error = JS_GetException(ctx);
53475|      0|        ret2 = JS_Call(ctx, args[1], JS_UNDEFINED, 1, (JSValueConst *)&error);
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53476|      0|        JS_FreeValue(ctx, error);
53477|      0|        if (JS_IsException(ret2))
  ------------------
  |  Branch (53477:13): [True: 0, False: 0]
  ------------------
53478|      0|            goto fail1;
53479|      0|        JS_FreeValue(ctx, ret2);
53480|      0|    }
53481|     32|    JS_FreeValue(ctx, ret);
53482|     32|    JS_FreeValue(ctx, args[0]);
53483|     32|    JS_FreeValue(ctx, args[1]);
53484|     32|    return obj;
53485|      0| fail1:
53486|      0|    JS_FreeValue(ctx, args[0]);
53487|      0|    JS_FreeValue(ctx, args[1]);
53488|      0| fail:
53489|      0|    JS_FreeValue(ctx, obj);
53490|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53491|      0|}
quickjs.c:js_create_from_ctor:
20668|     34|{
20669|     34|    JSValue proto, obj;
20670|     34|    JSContext *realm;
20671|       |
20672|     34|    if (JS_IsUndefined(ctor)) {
  ------------------
  |  Branch (20672:9): [True: 32, False: 2]
  ------------------
20673|     32|        proto = JS_DupValue(ctx, ctx->class_proto[class_id]);
20674|     32|    } else {
20675|      2|        proto = JS_GetProperty(ctx, ctor, JS_ATOM_prototype);
20676|      2|        if (JS_IsException(proto))
  ------------------
  |  Branch (20676:13): [True: 0, False: 2]
  ------------------
20677|      0|            return proto;
20678|      2|        if (!JS_IsObject(proto)) {
  ------------------
  |  Branch (20678:13): [True: 0, False: 2]
  ------------------
20679|      0|            JS_FreeValue(ctx, proto);
20680|      0|            realm = JS_GetFunctionRealm(ctx, ctor);
20681|      0|            if (!realm)
  ------------------
  |  Branch (20681:17): [True: 0, False: 0]
  ------------------
20682|      0|                return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20683|      0|            proto = JS_DupValue(ctx, realm->class_proto[class_id]);
20684|      0|        }
20685|      2|    }
20686|     34|    obj = JS_NewObjectProtoClass(ctx, proto, class_id);
20687|     34|    JS_FreeValue(ctx, proto);
20688|     34|    return obj;
20689|     34|}
quickjs.c:JS_SetObjectData:
 5806|     53|{
 5807|     53|    JSObject *p;
 5808|       |
 5809|     53|    if (JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT) {
  ------------------
  |  |  236|     53|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5809:9): [True: 53, False: 0]
  ------------------
 5810|     53|        p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|     53|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     53|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5811|     53|        switch(p->class_id) {
  ------------------
  |  Branch (5811:16): [True: 53, False: 0]
  ------------------
 5812|     17|        case JS_CLASS_NUMBER:
  ------------------
  |  Branch (5812:9): [True: 17, False: 36]
  ------------------
 5813|     34|        case JS_CLASS_STRING:
  ------------------
  |  Branch (5813:9): [True: 17, False: 36]
  ------------------
 5814|     53|        case JS_CLASS_BOOLEAN:
  ------------------
  |  Branch (5814:9): [True: 19, False: 34]
  ------------------
 5815|     53|        case JS_CLASS_SYMBOL:
  ------------------
  |  Branch (5815:9): [True: 0, False: 53]
  ------------------
 5816|     53|        case JS_CLASS_DATE:
  ------------------
  |  Branch (5816:9): [True: 0, False: 53]
  ------------------
 5817|     53|        case JS_CLASS_BIG_INT:
  ------------------
  |  Branch (5817:9): [True: 0, False: 53]
  ------------------
 5818|     53|            JS_FreeValue(ctx, p->u.object_data);
 5819|     53|            p->u.object_data = val; /* for JS_CLASS_STRING, 'val' must
 5820|       |                                       be JS_TAG_STRING (and not a
 5821|       |                                       rope) */
 5822|     53|            return 0;
 5823|     53|        }
 5824|     53|    }
 5825|      0|    JS_FreeValue(ctx, val);
 5826|      0|    if (!JS_IsException(obj))
  ------------------
  |  Branch (5826:9): [True: 0, False: 0]
  ------------------
 5827|      0|        JS_ThrowTypeError(ctx, "invalid object type");
 5828|      0|    return -1;
 5829|     53|}
quickjs.c:__JS_EvalInternal:
37074|     34|{
37075|     34|    JSParseState s1, *s = &s1;
37076|     34|    int err, js_mode, eval_type;
37077|     34|    JSValue fun_obj, ret_val;
37078|     34|    JSStackFrame *sf;
37079|     34|    JSVarRef **var_refs;
37080|     34|    JSFunctionBytecode *b;
37081|     34|    JSFunctionDef *fd;
37082|     34|    JSModuleDef *m;
37083|       |
37084|     34|    js_parse_init(ctx, s, input, input_len, filename);
37085|     34|    skip_shebang(&s->buf_ptr, s->buf_end);
37086|       |
37087|     34|    eval_type = flags & JS_EVAL_TYPE_MASK;
  ------------------
  |  |  336|     34|#define JS_EVAL_TYPE_MASK     (3 << 0)
  ------------------
37088|     34|    m = NULL;
37089|     34|    if (eval_type == JS_EVAL_TYPE_DIRECT) {
  ------------------
  |  |  334|     34|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
  |  Branch (37089:9): [True: 0, False: 34]
  ------------------
37090|      0|        JSObject *p;
37091|      0|        sf = ctx->rt->current_stack_frame;
37092|      0|        assert(sf != NULL);
  ------------------
  |  Branch (37092:9): [True: 0, False: 0]
  |  Branch (37092:9): [True: 0, False: 0]
  ------------------
37093|      0|        assert(JS_VALUE_GET_TAG(sf->cur_func) == JS_TAG_OBJECT);
  ------------------
  |  Branch (37093:9): [True: 0, False: 0]
  |  Branch (37093:9): [True: 0, False: 0]
  ------------------
37094|      0|        p = JS_VALUE_GET_OBJ(sf->cur_func);
  ------------------
  |  |  229|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
37095|      0|        assert(js_class_has_bytecode(p->class_id));
  ------------------
  |  Branch (37095:9): [True: 0, False: 0]
  |  Branch (37095:9): [True: 0, False: 0]
  ------------------
37096|      0|        b = p->u.func.function_bytecode;
37097|      0|        var_refs = p->u.func.var_refs;
37098|      0|        js_mode = b->js_mode;
37099|     34|    } else {
37100|     34|        sf = NULL;
37101|     34|        b = NULL;
37102|     34|        var_refs = NULL;
37103|     34|        js_mode = 0;
37104|     34|        if (flags & JS_EVAL_FLAG_STRICT)
  ------------------
  |  |  338|     34|#define JS_EVAL_FLAG_STRICT   (1 << 3) /* force 'strict' mode */
  ------------------
  |  Branch (37104:13): [True: 0, False: 34]
  ------------------
37105|      0|            js_mode |= JS_MODE_STRICT;
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
37106|     34|        if (eval_type == JS_EVAL_TYPE_MODULE) {
  ------------------
  |  |  333|     34|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (37106:13): [True: 17, False: 17]
  ------------------
37107|     17|            JSAtom module_name = JS_NewAtom(ctx, filename);
37108|     17|            if (module_name == JS_ATOM_NULL)
  ------------------
  |  |  451|     17|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (37108:17): [True: 0, False: 17]
  ------------------
37109|      0|                return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
37110|     17|            m = js_new_module_def(ctx, module_name);
37111|     17|            if (!m)
  ------------------
  |  Branch (37111:17): [True: 0, False: 17]
  ------------------
37112|      0|                return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
37113|     17|            js_mode |= JS_MODE_STRICT;
  ------------------
  |  |  403|     17|#define JS_MODE_STRICT (1 << 0)
  ------------------
37114|     17|        }
37115|     34|    }
37116|     34|    fd = js_new_function_def(ctx, NULL, TRUE, FALSE, filename,
37117|     34|                             s->buf_start, &s->get_line_col_cache);
37118|     34|    if (!fd)
  ------------------
  |  Branch (37118:9): [True: 0, False: 34]
  ------------------
37119|      0|        goto fail1;
37120|     34|    s->cur_func = fd;
37121|     34|    fd->eval_type = eval_type;
37122|     34|    fd->has_this_binding = (eval_type != JS_EVAL_TYPE_DIRECT);
  ------------------
  |  |  334|     34|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
37123|     34|    if (eval_type == JS_EVAL_TYPE_DIRECT) {
  ------------------
  |  |  334|     34|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
  |  Branch (37123:9): [True: 0, False: 34]
  ------------------
37124|      0|        fd->new_target_allowed = b->new_target_allowed;
37125|      0|        fd->super_call_allowed = b->super_call_allowed;
37126|      0|        fd->super_allowed = b->super_allowed;
37127|      0|        fd->arguments_allowed = b->arguments_allowed;
37128|     34|    } else {
37129|     34|        fd->new_target_allowed = FALSE;
37130|     34|        fd->super_call_allowed = FALSE;
37131|     34|        fd->super_allowed = FALSE;
37132|     34|        fd->arguments_allowed = TRUE;
37133|     34|    }
37134|     34|    fd->js_mode = js_mode;
37135|     34|    fd->func_name = JS_DupAtom(ctx, JS_ATOM__eval_);
37136|     34|    if (b) {
  ------------------
  |  Branch (37136:9): [True: 0, False: 34]
  ------------------
37137|      0|        if (add_closure_variables(ctx, fd, b, scope_idx))
  ------------------
  |  Branch (37137:13): [True: 0, False: 0]
  ------------------
37138|      0|            goto fail;
37139|      0|    }
37140|     34|    fd->module = m;
37141|     34|    if (m != NULL || (flags & JS_EVAL_FLAG_ASYNC)) {
  ------------------
  |  |  347|     17|#define JS_EVAL_FLAG_ASYNC (1 << 7)
  ------------------
  |  Branch (37141:9): [True: 17, False: 17]
  |  Branch (37141:22): [True: 0, False: 17]
  ------------------
37142|     17|        fd->in_function_body = TRUE;
37143|     17|        fd->func_kind = JS_FUNC_ASYNC;
37144|     17|    }
37145|     34|    s->is_module = (m != NULL);
37146|     34|    s->allow_html_comments = !s->is_module;
37147|       |
37148|     34|    push_scope(s); /* body scope */
37149|     34|    fd->body_scope = fd->scope_level;
37150|       |
37151|     34|    err = js_parse_program(s);
37152|     34|    if (err) {
  ------------------
  |  Branch (37152:9): [True: 5, False: 29]
  ------------------
37153|      5|    fail:
37154|      5|        free_token(s, &s->token);
37155|      5|        js_free_function_def(ctx, fd);
37156|      5|        goto fail1;
37157|      5|    }
37158|       |
37159|     29|    if (m != NULL)
  ------------------
  |  Branch (37159:9): [True: 17, False: 12]
  ------------------
37160|     17|        m->has_tla = fd->has_await;
37161|       |
37162|       |    /* create the function object and all the enclosed functions */
37163|     29|    fun_obj = js_create_function(ctx, fd);
37164|     29|    if (JS_IsException(fun_obj))
  ------------------
  |  Branch (37164:9): [True: 0, False: 29]
  ------------------
37165|      0|        goto fail1;
37166|       |    /* Could add a flag to avoid resolution if necessary */
37167|     29|    if (m) {
  ------------------
  |  Branch (37167:9): [True: 17, False: 12]
  ------------------
37168|     17|        m->func_obj = fun_obj;
37169|     17|        if (js_resolve_module(ctx, m) < 0)
  ------------------
  |  Branch (37169:13): [True: 0, False: 17]
  ------------------
37170|      0|            goto fail1;
37171|     17|        fun_obj = JS_NewModuleValue(ctx, m);
37172|     17|    }
37173|     29|    if (flags & JS_EVAL_FLAG_COMPILE_ONLY) {
  ------------------
  |  |  342|     29|#define JS_EVAL_FLAG_COMPILE_ONLY (1 << 5)
  ------------------
  |  Branch (37173:9): [True: 17, False: 12]
  ------------------
37174|     17|        ret_val = fun_obj;
37175|     17|    } else {
37176|     12|        ret_val = JS_EvalFunctionInternal(ctx, fun_obj, this_obj, var_refs, sf);
37177|     12|    }
37178|     29|    return ret_val;
37179|      5| fail1:
37180|       |    /* XXX: should free all the unresolved dependencies */
37181|      5|    if (m)
  ------------------
  |  Branch (37181:9): [True: 0, False: 5]
  ------------------
37182|      0|        JS_FreeValue(ctx, JS_MKPTR(JS_TAG_MODULE, m));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
37183|      5|    return JS_EXCEPTION;
  ------------------
  |  |  294|      5|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      5|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
37184|     29|}
quickjs.c:js_new_function_def:
31952|     39|{
31953|     39|    JSFunctionDef *fd;
31954|       |
31955|     39|    fd = js_mallocz(ctx, sizeof(*fd));
31956|     39|    if (!fd)
  ------------------
  |  Branch (31956:9): [True: 0, False: 39]
  ------------------
31957|      0|        return NULL;
31958|       |
31959|     39|    fd->ctx = ctx;
31960|     39|    init_list_head(&fd->child_list);
31961|       |
31962|       |    /* insert in parent list */
31963|     39|    fd->parent = parent;
31964|     39|    fd->parent_cpool_idx = -1;
31965|     39|    if (parent) {
  ------------------
  |  Branch (31965:9): [True: 5, False: 34]
  ------------------
31966|      5|        list_add_tail(&fd->link, &parent->child_list);
31967|      5|        fd->js_mode = parent->js_mode;
31968|      5|        fd->parent_scope_level = parent->scope_level;
31969|      5|    }
31970|     39|    fd->strip_debug = ((ctx->rt->strip_flags & JS_STRIP_DEBUG) != 0);
  ------------------
  |  |  931|     39|#define JS_STRIP_DEBUG  (1 << 1) /* strip all debug info including source code */
  ------------------
31971|     39|    fd->strip_source = ((ctx->rt->strip_flags & (JS_STRIP_DEBUG | JS_STRIP_SOURCE)) != 0);
  ------------------
  |  |  931|     39|#define JS_STRIP_DEBUG  (1 << 1) /* strip all debug info including source code */
  ------------------
                  fd->strip_source = ((ctx->rt->strip_flags & (JS_STRIP_DEBUG | JS_STRIP_SOURCE)) != 0);
  ------------------
  |  |  930|     39|#define JS_STRIP_SOURCE (1 << 0) /* strip source code */
  ------------------
31972|       |
31973|     39|    fd->is_eval = is_eval;
31974|     39|    fd->is_func_expr = is_func_expr;
31975|     39|    js_dbuf_bytecode_init(ctx, &fd->byte_code);
31976|     39|    fd->last_opcode_pos = -1;
31977|     39|    fd->func_name = JS_ATOM_NULL;
  ------------------
  |  |  451|     39|#define JS_ATOM_NULL 0
  ------------------
31978|     39|    fd->var_object_idx = -1;
31979|     39|    fd->arg_var_object_idx = -1;
31980|     39|    fd->arguments_var_idx = -1;
31981|     39|    fd->arguments_arg_idx = -1;
31982|     39|    fd->func_var_idx = -1;
31983|     39|    fd->eval_ret_idx = -1;
31984|     39|    fd->this_var_idx = -1;
31985|     39|    fd->new_target_var_idx = -1;
31986|     39|    fd->this_active_func_var_idx = -1;
31987|     39|    fd->home_object_var_idx = -1;
31988|       |
31989|       |    /* XXX: should distinguish arg, var and var object and body scopes */
31990|     39|    fd->scopes = fd->def_scope_array;
31991|     39|    fd->scope_size = countof(fd->def_scope_array);
  ------------------
  |  |   47|     39|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
31992|     39|    fd->scope_count = 1;
31993|     39|    fd->scopes[0].first = -1;
31994|     39|    fd->scopes[0].parent = -1;
31995|     39|    fd->scope_level = 0;  /* 0: var/arg scope */
31996|     39|    fd->scope_first = -1;
31997|     39|    fd->body_scope = -1;
31998|       |
31999|     39|    fd->filename = JS_NewAtom(ctx, filename);
32000|     39|    fd->source_pos = source_ptr - get_line_col_cache->buf_start;
32001|     39|    fd->get_line_col_cache = get_line_col_cache;
32002|       |    
32003|     39|    js_dbuf_init(ctx, &fd->pc2line);
32004|       |    //fd->pc2line_last_line_num = line_num;
32005|       |    //fd->pc2line_last_pc = 0;
32006|     39|    fd->last_opcode_source_ptr = source_ptr;
32007|     39|    return fd;
32008|     39|}
quickjs.c:js_dbuf_bytecode_init:
 1953|    101|{
 1954|    101|    dbuf_init2(s, ctx->rt, js_realloc_bytecode_rt);
 1955|    101|}
quickjs.c:js_realloc_bytecode_rt:
 1941|    958|{
 1942|    958|    JSRuntime *rt = opaque;
 1943|    958|    if (size > (INT32_MAX / 2)) {
  ------------------
  |  Branch (1943:9): [True: 0, False: 958]
  ------------------
 1944|       |        /* the bytecode cannot be larger than 2G. Leave some slack to 
 1945|       |           avoid some overflows. */
 1946|      0|        return NULL;
 1947|    958|    } else {
 1948|    958|        return js_realloc_rt(rt, ptr, size);
 1949|    958|    }
 1950|    958|}
quickjs.c:push_scope:
23989|     61|static int push_scope(JSParseState *s) {
23990|     61|    if (s->cur_func) {
  ------------------
  |  Branch (23990:9): [True: 61, False: 0]
  ------------------
23991|     61|        JSFunctionDef *fd = s->cur_func;
23992|     61|        int scope = fd->scope_count;
23993|       |        /* XXX: should check for scope overflow */
23994|     61|        if ((fd->scope_count + 1) > fd->scope_size) {
  ------------------
  |  Branch (23994:13): [True: 5, False: 56]
  ------------------
23995|      5|            int new_size;
23996|      5|            size_t slack;
23997|      5|            JSVarScope *new_buf;
23998|       |            /* XXX: potential arithmetic overflow */
23999|      5|            new_size = max_int(fd->scope_count + 1, fd->scope_size * 3 / 2);
24000|      5|            if (fd->scopes == fd->def_scope_array) {
  ------------------
  |  Branch (24000:17): [True: 2, False: 3]
  ------------------
24001|      2|                new_buf = js_realloc2(s->ctx, NULL, new_size * sizeof(*fd->scopes), &slack);
24002|      2|                if (!new_buf)
  ------------------
  |  Branch (24002:21): [True: 0, False: 2]
  ------------------
24003|      0|                    return -1;
24004|      2|                memcpy(new_buf, fd->scopes, fd->scope_count * sizeof(*fd->scopes));
24005|      3|            } else {
24006|      3|                new_buf = js_realloc2(s->ctx, fd->scopes, new_size * sizeof(*fd->scopes), &slack);
24007|      3|                if (!new_buf)
  ------------------
  |  Branch (24007:21): [True: 0, False: 3]
  ------------------
24008|      0|                    return -1;
24009|      3|            }
24010|      5|            new_size += slack / sizeof(*new_buf);
24011|      5|            fd->scopes = new_buf;
24012|      5|            fd->scope_size = new_size;
24013|      5|        }
24014|     61|        fd->scope_count++;
24015|     61|        fd->scopes[scope].parent = fd->scope_level;
24016|     61|        fd->scopes[scope].first = fd->scope_first;
24017|     61|        emit_op(s, OP_enter_scope);
24018|     61|        emit_u16(s, scope);
24019|     61|        return fd->scope_level = scope;
24020|     61|    }
24021|      0|    return 0;
24022|     61|}
quickjs.c:emit_op:
23748|    853|{
23749|    853|    JSFunctionDef *fd = s->cur_func;
23750|    853|    DynBuf *bc = &fd->byte_code;
23751|       |
23752|    853|    fd->last_opcode_pos = bc->size;
23753|    853|    dbuf_putc(bc, val);
23754|    853|}
quickjs.c:emit_u16:
23726|    329|{
23727|    329|    dbuf_put_u16(&s->cur_func->byte_code, val);
23728|    329|}
quickjs.c:js_parse_program:
36962|     34|{
36963|     34|    JSFunctionDef *fd = s->cur_func;
36964|     34|    int idx;
36965|       |
36966|     34|    if (next_token(s))
  ------------------
  |  Branch (36966:9): [True: 1, False: 33]
  ------------------
36967|      1|        return -1;
36968|       |
36969|     33|    if (js_parse_directives(s))
  ------------------
  |  Branch (36969:9): [True: 0, False: 33]
  ------------------
36970|      0|        return -1;
36971|       |
36972|     33|    fd->is_global_var = (fd->eval_type == JS_EVAL_TYPE_GLOBAL) ||
  ------------------
  |  |  332|     33|#define JS_EVAL_TYPE_GLOBAL   (0 << 0) /* global code (default) */
  ------------------
  |  Branch (36972:25): [True: 16, False: 17]
  ------------------
36973|     17|        (fd->eval_type == JS_EVAL_TYPE_MODULE) ||
  ------------------
  |  |  333|     17|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (36973:9): [True: 17, False: 0]
  ------------------
36974|      0|        !(fd->js_mode & JS_MODE_STRICT);
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (36974:9): [True: 0, False: 0]
  ------------------
36975|       |
36976|     33|    if (!s->is_module) {
  ------------------
  |  Branch (36976:9): [True: 16, False: 17]
  ------------------
36977|       |        /* hidden variable for the return value */
36978|     16|        fd->eval_ret_idx = idx = add_var(s->ctx, fd, JS_ATOM__ret_);
36979|     16|        if (idx < 0)
  ------------------
  |  Branch (36979:13): [True: 0, False: 16]
  ------------------
36980|      0|            return -1;
36981|     16|    }
36982|       |
36983|    128|    while (s->token.val != TOK_EOF) {
  ------------------
  |  Branch (36983:12): [True: 99, False: 29]
  ------------------
36984|     99|        if (js_parse_source_element(s))
  ------------------
  |  Branch (36984:13): [True: 4, False: 95]
  ------------------
36985|      4|            return -1;
36986|     99|    }
36987|       |
36988|     29|    if (!s->is_module) {
  ------------------
  |  Branch (36988:9): [True: 12, False: 17]
  ------------------
36989|       |        /* return the value of the hidden variable eval_ret_idx  */
36990|     12|        if (fd->func_kind == JS_FUNC_ASYNC) {
  ------------------
  |  Branch (36990:13): [True: 0, False: 12]
  ------------------
36991|       |            /* wrap the return value in an object so that promises can
36992|       |               be safely returned */
36993|      0|            emit_op(s, OP_object);
36994|      0|            emit_op(s, OP_dup);
36995|       |
36996|      0|            emit_op(s, OP_get_loc);
36997|      0|            emit_u16(s, fd->eval_ret_idx);
36998|       |
36999|      0|            emit_op(s, OP_put_field);
37000|      0|            emit_atom(s, JS_ATOM_value);
37001|     12|        } else {
37002|     12|            emit_op(s, OP_get_loc);
37003|     12|            emit_u16(s, fd->eval_ret_idx);
37004|     12|        }
37005|     12|        emit_return(s, TRUE);
37006|     17|    } else {
37007|     17|        emit_return(s, FALSE);
37008|     17|    }
37009|       |
37010|     29|    return 0;
37011|     33|}
quickjs.c:next_token:
22713|  1.02k|{
22714|  1.02k|    const uint8_t *p;
22715|  1.02k|    int c;
22716|  1.02k|    BOOL ident_has_escape;
22717|  1.02k|    JSAtom atom;
22718|       |
22719|  1.02k|    if (js_check_stack_overflow(s->ctx->rt, 0)) {
  ------------------
  |  Branch (22719:9): [True: 0, False: 1.02k]
  ------------------
22720|      0|        return js_parse_error(s, "stack overflow");
22721|      0|    }
22722|       |
22723|  1.02k|    free_token(s, &s->token);
22724|       |
22725|  1.02k|    p = s->last_ptr = s->buf_ptr;
22726|  1.02k|    s->got_lf = FALSE;
22727|  1.05M| redo:
22728|  1.05M|    s->token.ptr = p;
22729|  1.05M|    c = *p;
22730|  1.05M|    switch(c) {
22731|     32|    case 0:
  ------------------
  |  Branch (22731:5): [True: 32, False: 1.05M]
  ------------------
22732|     32|        if (p >= s->buf_end) {
  ------------------
  |  Branch (22732:13): [True: 31, False: 1]
  ------------------
22733|     31|            s->token.val = TOK_EOF;
22734|     31|        } else {
22735|      1|            goto def_token;
22736|      1|        }
22737|     31|        break;
22738|     46|    case '`':
  ------------------
  |  Branch (22738:5): [True: 46, False: 1.05M]
  ------------------
22739|     46|        if (js_parse_template_part(s, p + 1))
  ------------------
  |  Branch (22739:13): [True: 2, False: 44]
  ------------------
22740|      2|            goto fail;
22741|     44|        p = s->buf_ptr;
22742|     44|        break;
22743|     43|    case '\'':
  ------------------
  |  Branch (22743:5): [True: 43, False: 1.05M]
  ------------------
22744|     43|    case '\"':
  ------------------
  |  Branch (22744:5): [True: 0, False: 1.05M]
  ------------------
22745|     43|        if (js_parse_string(s, c, TRUE, p + 1, &s->token, &p))
  ------------------
  |  Branch (22745:13): [True: 0, False: 43]
  ------------------
22746|      0|            goto fail;
22747|     43|        break;
22748|     43|    case '\r':  /* accept DOS and MAC newline sequences */
  ------------------
  |  Branch (22748:5): [True: 11, False: 1.05M]
  ------------------
22749|     11|        if (p[1] == '\n') {
  ------------------
  |  Branch (22749:13): [True: 0, False: 11]
  ------------------
22750|      0|            p++;
22751|      0|        }
22752|       |        /* fall thru */
22753|  1.04M|    case '\n':
  ------------------
  |  Branch (22753:5): [True: 1.04M, False: 1.45k]
  ------------------
22754|  1.04M|        p++;
22755|  1.04M|    line_terminator:
22756|  1.04M|        s->got_lf = TRUE;
22757|  1.04M|        goto redo;
22758|      8|    case '\f':
  ------------------
  |  Branch (22758:5): [True: 8, False: 1.05M]
  ------------------
22759|     10|    case '\v':
  ------------------
  |  Branch (22759:5): [True: 2, False: 1.05M]
  ------------------
22760|    256|    case ' ':
  ------------------
  |  Branch (22760:5): [True: 246, False: 1.04M]
  ------------------
22761|    362|    case '\t':
  ------------------
  |  Branch (22761:5): [True: 106, False: 1.05M]
  ------------------
22762|    362|        p++;
22763|    362|        goto redo;
22764|     62|    case '/':
  ------------------
  |  Branch (22764:5): [True: 62, False: 1.05M]
  ------------------
22765|     62|        if (p[1] == '*') {
  ------------------
  |  Branch (22765:13): [True: 0, False: 62]
  ------------------
22766|       |            /* comment */
22767|      0|            p += 2;
22768|      0|            for(;;) {
22769|      0|                if (*p == '\0' && p >= s->buf_end) {
  ------------------
  |  Branch (22769:21): [True: 0, False: 0]
  |  Branch (22769:35): [True: 0, False: 0]
  ------------------
22770|      0|                    js_parse_error(s, "unexpected end of comment");
22771|      0|                    goto fail;
22772|      0|                }
22773|      0|                if (p[0] == '*' && p[1] == '/') {
  ------------------
  |  Branch (22773:21): [True: 0, False: 0]
  |  Branch (22773:36): [True: 0, False: 0]
  ------------------
22774|      0|                    p += 2;
22775|      0|                    break;
22776|      0|                }
22777|      0|                if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (22777:21): [True: 0, False: 0]
  |  Branch (22777:35): [True: 0, False: 0]
  ------------------
22778|      0|                    s->got_lf = TRUE; /* considered as LF for ASI */
22779|      0|                    p++;
22780|      0|                } else if (*p >= 0x80) {
  ------------------
  |  Branch (22780:28): [True: 0, False: 0]
  ------------------
22781|      0|                    c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22782|      0|                    if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21772|      0|#define CP_LS   0x2028
  ------------------
                                  if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21773|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (22782:25): [True: 0, False: 0]
  |  Branch (22782:39): [True: 0, False: 0]
  ------------------
22783|      0|                        s->got_lf = TRUE; /* considered as LF for ASI */
22784|      0|                    } else if (c == -1) {
  ------------------
  |  Branch (22784:32): [True: 0, False: 0]
  ------------------
22785|      0|                        p++; /* skip invalid UTF-8 */
22786|      0|                    }
22787|      0|                } else {
22788|      0|                    p++;
22789|      0|                }
22790|      0|            }
22791|      0|            goto redo;
22792|     62|        } else if (p[1] == '/') {
  ------------------
  |  Branch (22792:20): [True: 61, False: 1]
  ------------------
22793|       |            /* line comment */
22794|     61|            p += 2;
22795|     61|        skip_line_comment:
22796|  2.04M|            for(;;) {
22797|  2.04M|                if (*p == '\0' && p >= s->buf_end)
  ------------------
  |  Branch (22797:21): [True: 2.04M, False: 5.16k]
  |  Branch (22797:35): [True: 7, False: 2.04M]
  ------------------
22798|      7|                    break;
22799|  2.04M|                if (*p == '\r' || *p == '\n')
  ------------------
  |  Branch (22799:21): [True: 3, False: 2.04M]
  |  Branch (22799:35): [True: 51, False: 2.04M]
  ------------------
22800|     54|                    break;
22801|  2.04M|                if (*p >= 0x80) {
  ------------------
  |  Branch (22801:21): [True: 587, False: 2.04M]
  ------------------
22802|    587|                    c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|    587|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22803|       |                    /* LS or PS are considered as line terminator */
22804|    587|                    if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21772|  1.17k|#define CP_LS   0x2028
  ------------------
                                  if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21773|    587|#define CP_PS   0x2029
  ------------------
  |  Branch (22804:25): [True: 0, False: 587]
  |  Branch (22804:39): [True: 0, False: 587]
  ------------------
22805|      0|                        break;
22806|    587|                    } else if (c == -1) {
  ------------------
  |  Branch (22806:32): [True: 545, False: 42]
  ------------------
22807|    545|                        p++; /* skip invalid UTF-8 */
22808|    545|                    }
22809|  2.04M|                } else {
22810|  2.04M|                    p++;
22811|  2.04M|                }
22812|  2.04M|            }
22813|     61|            goto redo;
22814|     61|        } else if (p[1] == '=') {
  ------------------
  |  Branch (22814:20): [True: 0, False: 1]
  ------------------
22815|      0|            p += 2;
22816|      0|            s->token.val = TOK_DIV_ASSIGN;
22817|      1|        } else {
22818|      1|            p++;
22819|      1|            s->token.val = c;
22820|      1|        }
22821|      1|        break;
22822|      1|    case '\\':
  ------------------
  |  Branch (22822:5): [True: 0, False: 1.05M]
  ------------------
22823|      0|        if (p[1] == 'u') {
  ------------------
  |  Branch (22823:13): [True: 0, False: 0]
  ------------------
22824|      0|            const uint8_t *p1 = p + 1;
22825|      0|            int c1 = lre_parse_escape(&p1, TRUE);
22826|      0|            if (c1 >= 0 && lre_js_is_ident_first(c1)) {
  ------------------
  |  Branch (22826:17): [True: 0, False: 0]
  |  Branch (22826:28): [True: 0, False: 0]
  ------------------
22827|      0|                c = c1;
22828|      0|                p = p1;
22829|      0|                ident_has_escape = TRUE;
22830|      0|                goto has_ident;
22831|      0|            } else {
22832|       |                /* XXX: syntax error? */
22833|      0|            }
22834|      0|        }
22835|      0|        goto def_token;
22836|     40|    case 'a': case 'b': case 'c': case 'd':
  ------------------
  |  Branch (22836:5): [True: 39, False: 1.05M]
  |  Branch (22836:15): [True: 0, False: 1.05M]
  |  Branch (22836:25): [True: 0, False: 1.05M]
  |  Branch (22836:35): [True: 1, False: 1.05M]
  ------------------
22837|    137|    case 'e': case 'f': case 'g': case 'h':
  ------------------
  |  Branch (22837:5): [True: 5, False: 1.05M]
  |  Branch (22837:15): [True: 54, False: 1.05M]
  |  Branch (22837:25): [True: 38, False: 1.05M]
  |  Branch (22837:35): [True: 0, False: 1.05M]
  ------------------
22838|    317|    case 'i': case 'j': case 'k': case 'l':
  ------------------
  |  Branch (22838:5): [True: 116, False: 1.05M]
  |  Branch (22838:15): [True: 0, False: 1.05M]
  |  Branch (22838:25): [True: 22, False: 1.05M]
  |  Branch (22838:35): [True: 42, False: 1.05M]
  ------------------
22839|    386|    case 'm': case 'n': case 'o': case 'p':
  ------------------
  |  Branch (22839:5): [True: 4, False: 1.05M]
  |  Branch (22839:15): [True: 11, False: 1.05M]
  |  Branch (22839:25): [True: 54, False: 1.05M]
  |  Branch (22839:35): [True: 0, False: 1.05M]
  ------------------
22840|    443|    case 'q': case 'r': case 's': case 't':
  ------------------
  |  Branch (22840:5): [True: 3, False: 1.05M]
  |  Branch (22840:15): [True: 0, False: 1.05M]
  |  Branch (22840:25): [True: 54, False: 1.05M]
  |  Branch (22840:35): [True: 0, False: 1.05M]
  ------------------
22841|    455|    case 'u': case 'v': case 'w': case 'x':
  ------------------
  |  Branch (22841:5): [True: 5, False: 1.05M]
  |  Branch (22841:15): [True: 7, False: 1.05M]
  |  Branch (22841:25): [True: 0, False: 1.05M]
  |  Branch (22841:35): [True: 0, False: 1.05M]
  ------------------
22842|    459|    case 'y': case 'z':
  ------------------
  |  Branch (22842:5): [True: 0, False: 1.05M]
  |  Branch (22842:15): [True: 4, False: 1.05M]
  ------------------
22843|    459|    case 'A': case 'B': case 'C': case 'D':
  ------------------
  |  Branch (22843:5): [True: 0, False: 1.05M]
  |  Branch (22843:15): [True: 0, False: 1.05M]
  |  Branch (22843:25): [True: 0, False: 1.05M]
  |  Branch (22843:35): [True: 0, False: 1.05M]
  ------------------
22844|    460|    case 'E': case 'F': case 'G': case 'H':
  ------------------
  |  Branch (22844:5): [True: 0, False: 1.05M]
  |  Branch (22844:15): [True: 1, False: 1.05M]
  |  Branch (22844:25): [True: 0, False: 1.05M]
  |  Branch (22844:35): [True: 0, False: 1.05M]
  ------------------
22845|    461|    case 'I': case 'J': case 'K': case 'L':
  ------------------
  |  Branch (22845:5): [True: 0, False: 1.05M]
  |  Branch (22845:15): [True: 0, False: 1.05M]
  |  Branch (22845:25): [True: 0, False: 1.05M]
  |  Branch (22845:35): [True: 1, False: 1.05M]
  ------------------
22846|    468|    case 'M': case 'N': case 'O': case 'P':
  ------------------
  |  Branch (22846:5): [True: 0, False: 1.05M]
  |  Branch (22846:15): [True: 1, False: 1.05M]
  |  Branch (22846:25): [True: 5, False: 1.05M]
  |  Branch (22846:35): [True: 1, False: 1.05M]
  ------------------
22847|    468|    case 'Q': case 'R': case 'S': case 'T':
  ------------------
  |  Branch (22847:5): [True: 0, False: 1.05M]
  |  Branch (22847:15): [True: 0, False: 1.05M]
  |  Branch (22847:25): [True: 0, False: 1.05M]
  |  Branch (22847:35): [True: 0, False: 1.05M]
  ------------------
22848|    472|    case 'U': case 'V': case 'W': case 'X':
  ------------------
  |  Branch (22848:5): [True: 0, False: 1.05M]
  |  Branch (22848:15): [True: 0, False: 1.05M]
  |  Branch (22848:25): [True: 0, False: 1.05M]
  |  Branch (22848:35): [True: 4, False: 1.05M]
  ------------------
22849|    488|    case 'Y': case 'Z':
  ------------------
  |  Branch (22849:5): [True: 0, False: 1.05M]
  |  Branch (22849:15): [True: 16, False: 1.05M]
  ------------------
22850|    488|    case '_':
  ------------------
  |  Branch (22850:5): [True: 0, False: 1.05M]
  ------------------
22851|    488|    case '$':
  ------------------
  |  Branch (22851:5): [True: 0, False: 1.05M]
  ------------------
22852|       |        /* identifier */
22853|    488|        p++;
22854|    488|        ident_has_escape = FALSE;
22855|    490|    has_ident:
22856|    490|        atom = parse_ident(s, &p, &ident_has_escape, c, FALSE);
22857|    490|        if (atom == JS_ATOM_NULL)
  ------------------
  |  |  451|    490|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (22857:13): [True: 0, False: 490]
  ------------------
22858|      0|            goto fail;
22859|    490|        s->token.u.ident.atom = atom;
22860|    490|        s->token.u.ident.has_escape = ident_has_escape;
22861|    490|        s->token.u.ident.is_reserved = FALSE;
22862|    490|        s->token.val = TOK_IDENT;
22863|    490|        update_token_ident(s);
22864|    490|        break;
22865|      0|    case '#':
  ------------------
  |  Branch (22865:5): [True: 0, False: 1.05M]
  ------------------
22866|       |        /* private name */
22867|      0|        {
22868|      0|            const uint8_t *p1;
22869|      0|            p++;
22870|      0|            p1 = p;
22871|      0|            c = *p1++;
22872|      0|            if (c == '\\' && *p1 == 'u') {
  ------------------
  |  Branch (22872:17): [True: 0, False: 0]
  |  Branch (22872:30): [True: 0, False: 0]
  ------------------
22873|      0|                c = lre_parse_escape(&p1, TRUE);
22874|      0|            } else if (c >= 128) {
  ------------------
  |  Branch (22874:24): [True: 0, False: 0]
  ------------------
22875|      0|                c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p1);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22876|      0|            }
22877|      0|            if (!lre_js_is_ident_first(c)) {
  ------------------
  |  Branch (22877:17): [True: 0, False: 0]
  ------------------
22878|      0|                js_parse_error(s, "invalid first character of private name");
22879|      0|                goto fail;
22880|      0|            }
22881|      0|            p = p1;
22882|      0|            ident_has_escape = FALSE; /* not used */
22883|      0|            atom = parse_ident(s, &p, &ident_has_escape, c, TRUE);
22884|      0|            if (atom == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (22884:17): [True: 0, False: 0]
  ------------------
22885|      0|                goto fail;
22886|      0|            s->token.u.ident.atom = atom;
22887|      0|            s->token.val = TOK_PRIVATE_NAME;
22888|      0|        }
22889|      0|        break;
22890|     47|    case '.':
  ------------------
  |  Branch (22890:5): [True: 47, False: 1.05M]
  ------------------
22891|     47|        if (p[1] == '.' && p[2] == '.') {
  ------------------
  |  Branch (22891:13): [True: 0, False: 47]
  |  Branch (22891:28): [True: 0, False: 0]
  ------------------
22892|      0|            p += 3;
22893|      0|            s->token.val = TOK_ELLIPSIS;
22894|      0|            break;
22895|      0|        }
22896|     47|        if (p[1] >= '0' && p[1] <= '9') {
  ------------------
  |  Branch (22896:13): [True: 47, False: 0]
  |  Branch (22896:28): [True: 0, False: 47]
  ------------------
22897|      0|            goto parse_number;
22898|     47|        } else {
22899|     47|            goto def_token;
22900|     47|        }
22901|      0|        break;
22902|      6|    case '0':
  ------------------
  |  Branch (22902:5): [True: 6, False: 1.05M]
  ------------------
22903|       |        /* in strict mode, octal literals are not accepted */
22904|      6|        if (is_digit(p[1]) && (s->cur_func->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  403|      1|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (22904:13): [True: 1, False: 5]
  |  Branch (22904:31): [True: 0, False: 1]
  ------------------
22905|      0|            js_parse_error(s, "octal literals are deprecated in strict mode");
22906|      0|            goto fail;
22907|      0|        }
22908|      6|        goto parse_number;
22909|     13|    case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (22909:5): [True: 10, False: 1.05M]
  |  Branch (22909:15): [True: 2, False: 1.05M]
  |  Branch (22909:25): [True: 1, False: 1.05M]
  |  Branch (22909:35): [True: 0, False: 1.05M]
  ------------------
22910|     16|    case '5': case '6': case '7': case '8':
  ------------------
  |  Branch (22910:5): [True: 0, False: 1.05M]
  |  Branch (22910:15): [True: 0, False: 1.05M]
  |  Branch (22910:25): [True: 0, False: 1.05M]
  |  Branch (22910:35): [True: 3, False: 1.05M]
  ------------------
22911|     16|    case '9':
  ------------------
  |  Branch (22911:5): [True: 0, False: 1.05M]
  ------------------
22912|       |        /* number */
22913|     22|    parse_number:
22914|     22|        {
22915|     22|            JSValue ret;
22916|     22|            const uint8_t *p1;
22917|     22|            int flags;
22918|     22|            flags = ATOD_ACCEPT_BIN_OCT | ATOD_ACCEPT_LEGACY_OCTAL |
  ------------------
  |  |12746|     22|#define ATOD_ACCEPT_BIN_OCT  (1 << 2)
  ------------------
                          flags = ATOD_ACCEPT_BIN_OCT | ATOD_ACCEPT_LEGACY_OCTAL |
  ------------------
  |  |12748|     22|#define ATOD_ACCEPT_LEGACY_OCTAL  (1 << 4)
  ------------------
22919|     22|                ATOD_ACCEPT_UNDERSCORES | ATOD_ACCEPT_SUFFIX;
  ------------------
  |  |12750|     22|#define ATOD_ACCEPT_UNDERSCORES  (1 << 5)
  ------------------
                              ATOD_ACCEPT_UNDERSCORES | ATOD_ACCEPT_SUFFIX;
  ------------------
  |  |12752|     22|#define ATOD_ACCEPT_SUFFIX    (1 << 6)
  ------------------
22920|     22|            ret = js_atof(s->ctx, (const char *)p, (const char **)&p, 0,
22921|     22|                          flags);
22922|     22|            if (JS_IsException(ret))
  ------------------
  |  Branch (22922:17): [True: 0, False: 22]
  ------------------
22923|      0|                goto fail;
22924|       |            /* reject `10instanceof Number` */
22925|     22|            if (JS_VALUE_IS_NAN(ret) ||
  ------------------
  |  Branch (22925:17): [True: 0, False: 22]
  ------------------
22926|     22|                lre_js_is_ident_next(unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p1))) {
  ------------------
  |  |  330|     22|#define UTF8_CHAR_LEN_MAX 6
  ------------------
  |  Branch (22926:17): [True: 0, False: 22]
  ------------------
22927|      0|                JS_FreeValue(s->ctx, ret);
22928|      0|                js_parse_error(s, "invalid number literal");
22929|      0|                goto fail;
22930|      0|            }
22931|     22|            s->token.val = TOK_NUMBER;
22932|     22|            s->token.u.num.val = ret;
22933|     22|        }
22934|      0|        break;
22935|     43|    case '*':
  ------------------
  |  Branch (22935:5): [True: 43, False: 1.05M]
  ------------------
22936|     43|        if (p[1] == '=') {
  ------------------
  |  Branch (22936:13): [True: 2, False: 41]
  ------------------
22937|      2|            p += 2;
22938|      2|            s->token.val = TOK_MUL_ASSIGN;
22939|     41|        } else if (p[1] == '*') {
  ------------------
  |  Branch (22939:20): [True: 0, False: 41]
  ------------------
22940|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (22940:17): [True: 0, False: 0]
  ------------------
22941|      0|                p += 3;
22942|      0|                s->token.val = TOK_POW_ASSIGN;
22943|      0|            } else {
22944|      0|                p += 2;
22945|      0|                s->token.val = TOK_POW;
22946|      0|            }
22947|     41|        } else {
22948|     41|            goto def_token;
22949|     41|        }
22950|      2|        break;
22951|      4|    case '%':
  ------------------
  |  Branch (22951:5): [True: 4, False: 1.05M]
  ------------------
22952|      4|        if (p[1] == '=') {
  ------------------
  |  Branch (22952:13): [True: 0, False: 4]
  ------------------
22953|      0|            p += 2;
22954|      0|            s->token.val = TOK_MOD_ASSIGN;
22955|      4|        } else {
22956|      4|            goto def_token;
22957|      4|        }
22958|      0|        break;
22959|      3|    case '+':
  ------------------
  |  Branch (22959:5): [True: 3, False: 1.05M]
  ------------------
22960|      3|        if (p[1] == '=') {
  ------------------
  |  Branch (22960:13): [True: 0, False: 3]
  ------------------
22961|      0|            p += 2;
22962|      0|            s->token.val = TOK_PLUS_ASSIGN;
22963|      3|        } else if (p[1] == '+') {
  ------------------
  |  Branch (22963:20): [True: 0, False: 3]
  ------------------
22964|      0|            p += 2;
22965|      0|            s->token.val = TOK_INC;
22966|      3|        } else {
22967|      3|            goto def_token;
22968|      3|        }
22969|      0|        break;
22970|      5|    case '-':
  ------------------
  |  Branch (22970:5): [True: 5, False: 1.05M]
  ------------------
22971|      5|        if (p[1] == '=') {
  ------------------
  |  Branch (22971:13): [True: 0, False: 5]
  ------------------
22972|      0|            p += 2;
22973|      0|            s->token.val = TOK_MINUS_ASSIGN;
22974|      5|        } else if (p[1] == '-') {
  ------------------
  |  Branch (22974:20): [True: 0, False: 5]
  ------------------
22975|      0|            if (s->allow_html_comments && p[2] == '>' &&
  ------------------
  |  Branch (22975:17): [True: 0, False: 0]
  |  Branch (22975:43): [True: 0, False: 0]
  ------------------
22976|      0|                (s->got_lf || s->last_ptr == s->buf_start)) {
  ------------------
  |  Branch (22976:18): [True: 0, False: 0]
  |  Branch (22976:31): [True: 0, False: 0]
  ------------------
22977|       |                /* Annex B: `-->` at beginning of line is an html comment end.
22978|       |                   It extends to the end of the line.
22979|       |                 */
22980|      0|                goto skip_line_comment;
22981|      0|            }
22982|      0|            p += 2;
22983|      0|            s->token.val = TOK_DEC;
22984|      5|        } else {
22985|      5|            goto def_token;
22986|      5|        }
22987|      0|        break;
22988|      0|    case '<':
  ------------------
  |  Branch (22988:5): [True: 0, False: 1.05M]
  ------------------
22989|      0|        if (p[1] == '=') {
  ------------------
  |  Branch (22989:13): [True: 0, False: 0]
  ------------------
22990|      0|            p += 2;
22991|      0|            s->token.val = TOK_LTE;
22992|      0|        } else if (p[1] == '<') {
  ------------------
  |  Branch (22992:20): [True: 0, False: 0]
  ------------------
22993|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (22993:17): [True: 0, False: 0]
  ------------------
22994|      0|                p += 3;
22995|      0|                s->token.val = TOK_SHL_ASSIGN;
22996|      0|            } else {
22997|      0|                p += 2;
22998|      0|                s->token.val = TOK_SHL;
22999|      0|            }
23000|      0|        } else if (s->allow_html_comments &&
  ------------------
  |  Branch (23000:20): [True: 0, False: 0]
  ------------------
23001|      0|                   p[1] == '!' && p[2] == '-' && p[3] == '-') {
  ------------------
  |  Branch (23001:20): [True: 0, False: 0]
  |  Branch (23001:35): [True: 0, False: 0]
  |  Branch (23001:50): [True: 0, False: 0]
  ------------------
23002|       |            /* Annex B: handle `<!--` single line html comments */
23003|      0|            goto skip_line_comment;
23004|      0|        } else {
23005|      0|            goto def_token;
23006|      0|        }
23007|      0|        break;
23008|      0|    case '>':
  ------------------
  |  Branch (23008:5): [True: 0, False: 1.05M]
  ------------------
23009|      0|        if (p[1] == '=') {
  ------------------
  |  Branch (23009:13): [True: 0, False: 0]
  ------------------
23010|      0|            p += 2;
23011|      0|            s->token.val = TOK_GTE;
23012|      0|        } else if (p[1] == '>') {
  ------------------
  |  Branch (23012:20): [True: 0, False: 0]
  ------------------
23013|      0|            if (p[2] == '>') {
  ------------------
  |  Branch (23013:17): [True: 0, False: 0]
  ------------------
23014|      0|                if (p[3] == '=') {
  ------------------
  |  Branch (23014:21): [True: 0, False: 0]
  ------------------
23015|      0|                    p += 4;
23016|      0|                    s->token.val = TOK_SHR_ASSIGN;
23017|      0|                } else {
23018|      0|                    p += 3;
23019|      0|                    s->token.val = TOK_SHR;
23020|      0|                }
23021|      0|            } else if (p[2] == '=') {
  ------------------
  |  Branch (23021:24): [True: 0, False: 0]
  ------------------
23022|      0|                p += 3;
23023|      0|                s->token.val = TOK_SAR_ASSIGN;
23024|      0|            } else {
23025|      0|                p += 2;
23026|      0|                s->token.val = TOK_SAR;
23027|      0|            }
23028|      0|        } else {
23029|      0|            goto def_token;
23030|      0|        }
23031|      0|        break;
23032|     56|    case '=':
  ------------------
  |  Branch (23032:5): [True: 56, False: 1.05M]
  ------------------
23033|     56|        if (p[1] == '=') {
  ------------------
  |  Branch (23033:13): [True: 0, False: 56]
  ------------------
23034|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (23034:17): [True: 0, False: 0]
  ------------------
23035|      0|                p += 3;
23036|      0|                s->token.val = TOK_STRICT_EQ;
23037|      0|            } else {
23038|      0|                p += 2;
23039|      0|                s->token.val = TOK_EQ;
23040|      0|            }
23041|     56|        } else if (p[1] == '>') {
  ------------------
  |  Branch (23041:20): [True: 6, False: 50]
  ------------------
23042|      6|            p += 2;
23043|      6|            s->token.val = TOK_ARROW;
23044|     50|        } else {
23045|     50|            goto def_token;
23046|     50|        }
23047|      6|        break;
23048|      6|    case '!':
  ------------------
  |  Branch (23048:5): [True: 4, False: 1.05M]
  ------------------
23049|      4|        if (p[1] == '=') {
  ------------------
  |  Branch (23049:13): [True: 0, False: 4]
  ------------------
23050|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (23050:17): [True: 0, False: 0]
  ------------------
23051|      0|                p += 3;
23052|      0|                s->token.val = TOK_STRICT_NEQ;
23053|      0|            } else {
23054|      0|                p += 2;
23055|      0|                s->token.val = TOK_NEQ;
23056|      0|            }
23057|      4|        } else {
23058|      4|            goto def_token;
23059|      4|        }
23060|      0|        break;
23061|      1|    case '&':
  ------------------
  |  Branch (23061:5): [True: 1, False: 1.05M]
  ------------------
23062|      1|        if (p[1] == '=') {
  ------------------
  |  Branch (23062:13): [True: 0, False: 1]
  ------------------
23063|      0|            p += 2;
23064|      0|            s->token.val = TOK_AND_ASSIGN;
23065|      1|        } else if (p[1] == '&') {
  ------------------
  |  Branch (23065:20): [True: 0, False: 1]
  ------------------
23066|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (23066:17): [True: 0, False: 0]
  ------------------
23067|      0|                p += 3;
23068|      0|                s->token.val = TOK_LAND_ASSIGN;
23069|      0|            } else {
23070|      0|                p += 2;
23071|      0|                s->token.val = TOK_LAND;
23072|      0|            }
23073|      1|        } else {
23074|      1|            goto def_token;
23075|      1|        }
23076|      0|        break;
23077|      0|    case '^':
  ------------------
  |  Branch (23077:5): [True: 0, False: 1.05M]
  ------------------
23078|      0|        if (p[1] == '=') {
  ------------------
  |  Branch (23078:13): [True: 0, False: 0]
  ------------------
23079|      0|            p += 2;
23080|      0|            s->token.val = TOK_XOR_ASSIGN;
23081|      0|        } else {
23082|      0|            goto def_token;
23083|      0|        }
23084|      0|        break;
23085|      0|    case '|':
  ------------------
  |  Branch (23085:5): [True: 0, False: 1.05M]
  ------------------
23086|      0|        if (p[1] == '=') {
  ------------------
  |  Branch (23086:13): [True: 0, False: 0]
  ------------------
23087|      0|            p += 2;
23088|      0|            s->token.val = TOK_OR_ASSIGN;
23089|      0|        } else if (p[1] == '|') {
  ------------------
  |  Branch (23089:20): [True: 0, False: 0]
  ------------------
23090|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (23090:17): [True: 0, False: 0]
  ------------------
23091|      0|                p += 3;
23092|      0|                s->token.val = TOK_LOR_ASSIGN;
23093|      0|            } else {
23094|      0|                p += 2;
23095|      0|                s->token.val = TOK_LOR;
23096|      0|            }
23097|      0|        } else {
23098|      0|            goto def_token;
23099|      0|        }
23100|      0|        break;
23101|      0|    case '?':
  ------------------
  |  Branch (23101:5): [True: 0, False: 1.05M]
  ------------------
23102|      0|        if (p[1] == '?') {
  ------------------
  |  Branch (23102:13): [True: 0, False: 0]
  ------------------
23103|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (23103:17): [True: 0, False: 0]
  ------------------
23104|      0|                p += 3;
23105|      0|                s->token.val = TOK_DOUBLE_QUESTION_MARK_ASSIGN;
23106|      0|            } else {
23107|      0|                p += 2;
23108|      0|                s->token.val = TOK_DOUBLE_QUESTION_MARK;
23109|      0|            }
23110|      0|        } else if (p[1] == '.' && !(p[2] >= '0' && p[2] <= '9')) {
  ------------------
  |  Branch (23110:20): [True: 0, False: 0]
  |  Branch (23110:37): [True: 0, False: 0]
  |  Branch (23110:52): [True: 0, False: 0]
  ------------------
23111|      0|            p += 2;
23112|      0|            s->token.val = TOK_QUESTION_MARK_DOT;
23113|      0|        } else {
23114|      0|            goto def_token;
23115|      0|        }
23116|      0|        break;
23117|    230|    default:
  ------------------
  |  Branch (23117:5): [True: 230, False: 1.04M]
  ------------------
23118|    230|        if (c >= 128) {
  ------------------
  |  Branch (23118:13): [True: 3, False: 227]
  ------------------
23119|       |            /* unicode value */
23120|      3|            c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|      3|#define UTF8_CHAR_LEN_MAX 6
  ------------------
23121|      3|            switch(c) {
23122|      0|            case CP_PS:
  ------------------
  |  |21773|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (23122:13): [True: 0, False: 3]
  ------------------
23123|      0|            case CP_LS:
  ------------------
  |  |21772|      0|#define CP_LS   0x2028
  ------------------
  |  Branch (23123:13): [True: 0, False: 3]
  ------------------
23124|       |                /* XXX: should avoid incrementing line_number, but
23125|       |                   needed to handle HTML comments */
23126|      0|                goto line_terminator;
23127|      3|            default:
  ------------------
  |  Branch (23127:13): [True: 3, False: 0]
  ------------------
23128|      3|                if (lre_is_space(c)) {
  ------------------
  |  Branch (23128:21): [True: 0, False: 3]
  ------------------
23129|      0|                    goto redo;
23130|      3|                } else if (lre_js_is_ident_first(c)) {
  ------------------
  |  Branch (23130:28): [True: 2, False: 1]
  ------------------
23131|      2|                    ident_has_escape = FALSE;
23132|      2|                    goto has_ident;
23133|      2|                } else {
23134|      1|                    js_parse_error(s, "unexpected character");
23135|      1|                    goto fail;
23136|      1|                }
23137|      3|            }
23138|      3|        }
23139|    383|    def_token:
23140|    383|        s->token.val = c;
23141|    383|        p++;
23142|    383|        break;
23143|  1.05M|    }
23144|  1.02k|    s->buf_ptr = p;
23145|       |
23146|       |    //    dump_token(s, &s->token);
23147|  1.02k|    return 0;
23148|       |
23149|      3| fail:
23150|      3|    s->token.val = TOK_ERROR;
23151|      3|    return -1;
23152|  1.05M|}
quickjs.c:js_parse_template_part:
22282|     46|{
22283|     46|    uint32_t c;
22284|     46|    StringBuffer b_s, *b = &b_s;
22285|     46|    JSValue str;
22286|       |
22287|       |    /* p points to the first byte of the template part */
22288|     46|    if (string_buffer_init(s->ctx, b, 32))
  ------------------
  |  Branch (22288:9): [True: 0, False: 46]
  ------------------
22289|      0|        goto fail;
22290|  8.04M|    for(;;) {
22291|  8.04M|        if (p >= s->buf_end)
  ------------------
  |  Branch (22291:13): [True: 1, False: 8.04M]
  ------------------
22292|      1|            goto unexpected_eof;
22293|  8.04M|        c = *p++;
22294|  8.04M|        if (c == '`') {
  ------------------
  |  Branch (22294:13): [True: 44, False: 8.04M]
  ------------------
22295|       |            /* template end part */
22296|     44|            break;
22297|     44|        }
22298|  8.04M|        if (c == '$' && *p == '{') {
  ------------------
  |  Branch (22298:13): [True: 2.04k, False: 8.04M]
  |  Branch (22298:25): [True: 0, False: 2.04k]
  ------------------
22299|       |            /* template start or middle part */
22300|      0|            p++;
22301|      0|            break;
22302|      0|        }
22303|  8.04M|        if (c == '\\') {
  ------------------
  |  Branch (22303:13): [True: 60.2k, False: 7.98M]
  ------------------
22304|  60.2k|            if (string_buffer_putc8(b, c))
  ------------------
  |  Branch (22304:17): [True: 0, False: 60.2k]
  ------------------
22305|      0|                goto fail;
22306|  60.2k|            if (p >= s->buf_end)
  ------------------
  |  Branch (22306:17): [True: 0, False: 60.2k]
  ------------------
22307|      0|                goto unexpected_eof;
22308|  60.2k|            c = *p++;
22309|  60.2k|        }
22310|       |        /* newline sequences are normalized as single '\n' bytes */
22311|  8.04M|        if (c == '\r') {
  ------------------
  |  Branch (22311:13): [True: 0, False: 8.04M]
  ------------------
22312|      0|            if (*p == '\n')
  ------------------
  |  Branch (22312:17): [True: 0, False: 0]
  ------------------
22313|      0|                p++;
22314|      0|            c = '\n';
22315|      0|        }
22316|  8.04M|        if (c >= 0x80) {
  ------------------
  |  Branch (22316:13): [True: 1.25k, False: 8.04M]
  ------------------
22317|  1.25k|            const uint8_t *p_next;
22318|  1.25k|            c = unicode_from_utf8(p - 1, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|  1.25k|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22319|  1.25k|            if (c > 0x10FFFF) {
  ------------------
  |  Branch (22319:17): [True: 1, False: 1.25k]
  ------------------
22320|      1|                js_parse_error_pos(s, p - 1, "invalid UTF-8 sequence");
22321|      1|                goto fail;
22322|      1|            }
22323|  1.25k|            p = p_next;
22324|  1.25k|        }
22325|  8.04M|        if (string_buffer_putc(b, c))
  ------------------
  |  Branch (22325:13): [True: 0, False: 8.04M]
  ------------------
22326|      0|            goto fail;
22327|  8.04M|    }
22328|     44|    str = string_buffer_end(b);
22329|     44|    if (JS_IsException(str))
  ------------------
  |  Branch (22329:9): [True: 0, False: 44]
  ------------------
22330|      0|        return -1;
22331|     44|    s->token.val = TOK_TEMPLATE;
22332|     44|    s->token.u.str.sep = c;
22333|     44|    s->token.u.str.str = str;
22334|     44|    s->buf_ptr = p;
22335|     44|    return 0;
22336|       |
22337|      1| unexpected_eof:
22338|      1|    js_parse_error(s, "unexpected end of string");
22339|      2| fail:
22340|      2|    string_buffer_free(b);
22341|      2|    return -1;
22342|      1|}
quickjs.c:js_parse_string:
22347|     72|{
22348|     72|    int ret;
22349|     72|    uint32_t c;
22350|     72|    StringBuffer b_s, *b = &b_s;
22351|     72|    const uint8_t *p_escape;
22352|     72|    JSValue str;
22353|       |
22354|       |    /* string */
22355|     72|    if (string_buffer_init(s->ctx, b, 32))
  ------------------
  |  Branch (22355:9): [True: 0, False: 72]
  ------------------
22356|      0|        goto fail;
22357|  4.49M|    for(;;) {
22358|  4.49M|        if (p >= s->buf_end)
  ------------------
  |  Branch (22358:13): [True: 0, False: 4.49M]
  ------------------
22359|      0|            goto invalid_char;
22360|  4.49M|        c = *p;
22361|  4.49M|        if (c < 0x20) {
  ------------------
  |  Branch (22361:13): [True: 1.87M, False: 2.62M]
  ------------------
22362|  1.87M|            if (sep == '`') {
  ------------------
  |  Branch (22362:17): [True: 1.87M, False: 6]
  ------------------
22363|  1.87M|                if (c == '\r') {
  ------------------
  |  Branch (22363:21): [True: 0, False: 1.87M]
  ------------------
22364|      0|                    if (p[1] == '\n')
  ------------------
  |  Branch (22364:25): [True: 0, False: 0]
  ------------------
22365|      0|                        p++;
22366|      0|                    c = '\n';
22367|      0|                }
22368|       |                /* do not update s->line_num */
22369|  1.87M|            } else if (c == '\n' || c == '\r')
  ------------------
  |  Branch (22369:24): [True: 0, False: 6]
  |  Branch (22369:37): [True: 0, False: 6]
  ------------------
22370|      0|                goto invalid_char;
22371|  1.87M|        }
22372|  4.49M|        p++;
22373|  4.49M|        if (c == sep)
  ------------------
  |  Branch (22373:13): [True: 72, False: 4.49M]
  ------------------
22374|     72|            break;
22375|  4.49M|        if (c == '$' && *p == '{' && sep == '`') {
  ------------------
  |  Branch (22375:13): [True: 2.04k, False: 4.49M]
  |  Branch (22375:25): [True: 0, False: 2.04k]
  |  Branch (22375:38): [True: 0, False: 0]
  ------------------
22376|       |            /* template start or middle part */
22377|      0|            p++;
22378|      0|            break;
22379|      0|        }
22380|  4.49M|        if (c == '\\') {
  ------------------
  |  Branch (22380:13): [True: 60.2k, False: 4.43M]
  ------------------
22381|  60.2k|            p_escape = p - 1;
22382|  60.2k|            c = *p;
22383|       |            /* XXX: need a specific JSON case to avoid
22384|       |               accepting invalid escapes */
22385|  60.2k|            switch(c) {
22386|      1|            case '\0':
  ------------------
  |  Branch (22386:13): [True: 1, False: 60.2k]
  ------------------
22387|      1|                if (p >= s->buf_end)
  ------------------
  |  Branch (22387:21): [True: 0, False: 1]
  ------------------
22388|      0|                    goto invalid_char;
22389|      1|                p++;
22390|      1|                break;
22391|      0|            case '\'':
  ------------------
  |  Branch (22391:13): [True: 0, False: 60.2k]
  ------------------
22392|      0|            case '\"':
  ------------------
  |  Branch (22392:13): [True: 0, False: 60.2k]
  ------------------
22393|    639|            case '\\':
  ------------------
  |  Branch (22393:13): [True: 639, False: 59.5k]
  ------------------
22394|    639|                p++;
22395|    639|                break;
22396|      0|            case '\r':  /* accept DOS and MAC newline sequences */
  ------------------
  |  Branch (22396:13): [True: 0, False: 60.2k]
  ------------------
22397|      0|                if (p[1] == '\n') {
  ------------------
  |  Branch (22397:21): [True: 0, False: 0]
  ------------------
22398|      0|                    p++;
22399|      0|                }
22400|       |                /* fall thru */
22401|      0|            case '\n':
  ------------------
  |  Branch (22401:13): [True: 0, False: 60.2k]
  ------------------
22402|       |                /* ignore escaped newline sequence */
22403|      0|                p++;
22404|      0|                continue;
22405|  59.5k|            default:
  ------------------
  |  Branch (22405:13): [True: 59.5k, False: 640]
  ------------------
22406|  59.5k|                if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (22406:21): [True: 56.2k, False: 3.33k]
  |  Branch (22406:33): [True: 0, False: 56.2k]
  ------------------
22407|      0|                    if (!(s->cur_func->js_mode & JS_MODE_STRICT) && sep != '`')
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (22407:25): [True: 0, False: 0]
  |  Branch (22407:69): [True: 0, False: 0]
  ------------------
22408|      0|                        goto parse_escape;
22409|      0|                    if (c == '0' && !(p[1] >= '0' && p[1] <= '9')) {
  ------------------
  |  Branch (22409:25): [True: 0, False: 0]
  |  Branch (22409:39): [True: 0, False: 0]
  |  Branch (22409:54): [True: 0, False: 0]
  ------------------
22410|      0|                        p++;
22411|      0|                        c = '\0';
22412|      0|                    } else {
22413|      0|                        if (c >= '8' || sep == '`') {
  ------------------
  |  Branch (22413:29): [True: 0, False: 0]
  |  Branch (22413:41): [True: 0, False: 0]
  ------------------
22414|       |                            /* Note: according to ES2021, \8 and \9 are not
22415|       |                               accepted in strict mode or in templates. */
22416|      0|                            goto invalid_escape;
22417|      0|                        } else {
22418|      0|                            if (do_throw)
  ------------------
  |  Branch (22418:33): [True: 0, False: 0]
  ------------------
22419|      0|                                js_parse_error_pos(s, p_escape, "octal escape sequences are not allowed in strict mode");
22420|      0|                        }
22421|      0|                        goto fail;
22422|      0|                    }
22423|  59.5k|                } else if (c >= 0x80) {
  ------------------
  |  Branch (22423:28): [True: 0, False: 59.5k]
  ------------------
22424|      0|                    const uint8_t *p_next;
22425|      0|                    c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22426|      0|                    if (c > 0x10FFFF) {
  ------------------
  |  Branch (22426:25): [True: 0, False: 0]
  ------------------
22427|      0|                        goto invalid_utf8;
22428|      0|                    }
22429|      0|                    p = p_next;
22430|       |                    /* LS or PS are skipped */
22431|      0|                    if (c == CP_LS || c == CP_PS)
  ------------------
  |  |21772|      0|#define CP_LS   0x2028
  ------------------
                                  if (c == CP_LS || c == CP_PS)
  ------------------
  |  |21773|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (22431:25): [True: 0, False: 0]
  |  Branch (22431:39): [True: 0, False: 0]
  ------------------
22432|      0|                        continue;
22433|  59.5k|                } else {
22434|  59.5k|                parse_escape:
22435|  59.5k|                    ret = lre_parse_escape(&p, TRUE);
22436|  59.5k|                    if (ret == -1) {
  ------------------
  |  Branch (22436:25): [True: 0, False: 59.5k]
  ------------------
22437|      0|                    invalid_escape:
22438|      0|                        if (do_throw)
  ------------------
  |  Branch (22438:29): [True: 0, False: 0]
  ------------------
22439|      0|                            js_parse_error_pos(s, p_escape, "malformed escape sequence in string literal");
22440|      0|                        goto fail;
22441|  59.5k|                    } else if (ret < 0) {
  ------------------
  |  Branch (22441:32): [True: 56.2k, False: 3.32k]
  ------------------
22442|       |                        /* ignore the '\' (could output a warning) */
22443|  56.2k|                        p++;
22444|  56.2k|                    } else {
22445|  3.32k|                        c = ret;
22446|  3.32k|                    }
22447|  59.5k|                }
22448|  59.5k|                break;
22449|  60.2k|            }
22450|  4.43M|        } else if (c >= 0x80) {
  ------------------
  |  Branch (22450:20): [True: 1.24k, False: 4.43M]
  ------------------
22451|  1.24k|            const uint8_t *p_next;
22452|  1.24k|            c = unicode_from_utf8(p - 1, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|  1.24k|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22453|  1.24k|            if (c > 0x10FFFF)
  ------------------
  |  Branch (22453:17): [True: 0, False: 1.24k]
  ------------------
22454|      0|                goto invalid_utf8;
22455|  1.24k|            p = p_next;
22456|  1.24k|        }
22457|  4.49M|        if (string_buffer_putc(b, c))
  ------------------
  |  Branch (22457:13): [True: 0, False: 4.49M]
  ------------------
22458|      0|            goto fail;
22459|  4.49M|    }
22460|     72|    str = string_buffer_end(b);
22461|     72|    if (JS_IsException(str))
  ------------------
  |  Branch (22461:9): [True: 0, False: 72]
  ------------------
22462|      0|        return -1;
22463|     72|    token->val = TOK_STRING;
22464|     72|    token->u.str.sep = c;
22465|     72|    token->u.str.str = str;
22466|     72|    *pp = p;
22467|     72|    return 0;
22468|       |
22469|      0| invalid_utf8:
22470|      0|    if (do_throw)
  ------------------
  |  Branch (22470:9): [True: 0, False: 0]
  ------------------
22471|      0|        js_parse_error(s, "invalid UTF-8 sequence");
22472|      0|    goto fail;
22473|      0| invalid_char:
22474|      0|    if (do_throw)
  ------------------
  |  Branch (22474:9): [True: 0, False: 0]
  ------------------
22475|      0|        js_parse_error(s, "unexpected end of string");
22476|      0| fail:
22477|      0|    string_buffer_free(b);
22478|      0|    return -1;
22479|      0|}
quickjs.c:parse_ident:
22666|    490|{
22667|    490|    const uint8_t *p, *p1;
22668|    490|    char ident_buf[128], *buf;
22669|    490|    size_t ident_size, ident_pos;
22670|    490|    JSAtom atom;
22671|       |
22672|    490|    p = *pp;
22673|    490|    buf = ident_buf;
22674|    490|    ident_size = sizeof(ident_buf);
22675|    490|    ident_pos = 0;
22676|    490|    if (is_private)
  ------------------
  |  Branch (22676:9): [True: 0, False: 490]
  ------------------
22677|      0|        buf[ident_pos++] = '#';
22678|  2.09M|    for(;;) {
22679|  2.09M|        p1 = p;
22680|       |
22681|  2.09M|        if (c < 128) {
  ------------------
  |  Branch (22681:13): [True: 2.09M, False: 18]
  ------------------
22682|  2.09M|            buf[ident_pos++] = c;
22683|  2.09M|        } else {
22684|     18|            ident_pos += unicode_to_utf8((uint8_t*)buf + ident_pos, c);
22685|     18|        }
22686|  2.09M|        c = *p1++;
22687|  2.09M|        if (c == '\\' && *p1 == 'u') {
  ------------------
  |  Branch (22687:13): [True: 0, False: 2.09M]
  |  Branch (22687:26): [True: 0, False: 0]
  ------------------
22688|      0|            c = lre_parse_escape(&p1, TRUE);
22689|      0|            *pident_has_escape = TRUE;
22690|  2.09M|        } else if (c >= 128) {
  ------------------
  |  Branch (22690:20): [True: 16, False: 2.09M]
  ------------------
22691|     16|            c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p1);
  ------------------
  |  |  330|     16|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22692|     16|        }
22693|  2.09M|        if (!lre_js_is_ident_next(c))
  ------------------
  |  Branch (22693:13): [True: 490, False: 2.09M]
  ------------------
22694|    490|            break;
22695|  2.09M|        p = p1;
22696|  2.09M|        if (unlikely(ident_pos >= ident_size - UTF8_CHAR_LEN_MAX)) {
  ------------------
  |  |   33|  2.09M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 46, False: 2.09M]
  |  |  ------------------
  ------------------
22697|     46|            if (ident_realloc(s->ctx, &buf, &ident_size, ident_buf)) {
  ------------------
  |  Branch (22697:17): [True: 0, False: 46]
  ------------------
22698|      0|                atom = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
22699|      0|                goto done;
22700|      0|            }
22701|     46|        }
22702|  2.09M|    }
22703|    490|    atom = JS_NewAtomLen(s->ctx, buf, ident_pos);
22704|    490| done:
22705|    490|    if (unlikely(buf != ident_buf))
  ------------------
  |  |   33|    490|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 488]
  |  |  ------------------
  ------------------
22706|      2|        js_free(s->ctx, buf);
22707|    490|    *pp = p;
22708|    490|    return atom;
22709|    490|}
quickjs.c:update_token_ident:
22623|    491|{
22624|    491|    if (s->token.u.ident.atom <= JS_ATOM_LAST_KEYWORD ||
  ------------------
  |  | 1107|    982|#define JS_ATOM_LAST_KEYWORD JS_ATOM_super
  ------------------
  |  Branch (22624:9): [True: 80, False: 411]
  ------------------
22625|    411|        (s->token.u.ident.atom <= JS_ATOM_LAST_STRICT_KEYWORD &&
  ------------------
  |  | 1108|    822|#define JS_ATOM_LAST_STRICT_KEYWORD JS_ATOM_yield
  ------------------
  |  Branch (22625:10): [True: 42, False: 369]
  ------------------
22626|     42|         (s->cur_func->js_mode & JS_MODE_STRICT)) ||
  ------------------
  |  |  403|     42|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (22626:10): [True: 0, False: 42]
  ------------------
22627|    411|        (s->token.u.ident.atom == JS_ATOM_yield &&
  ------------------
  |  Branch (22627:10): [True: 0, False: 411]
  ------------------
22628|      0|         ((s->cur_func->func_kind & JS_FUNC_GENERATOR) ||
  ------------------
  |  Branch (22628:11): [True: 0, False: 0]
  ------------------
22629|      0|          (s->cur_func->func_type == JS_PARSE_FUNC_ARROW &&
  ------------------
  |  Branch (22629:12): [True: 0, False: 0]
  ------------------
22630|      0|           !s->cur_func->in_function_body && s->cur_func->parent &&
  ------------------
  |  Branch (22630:12): [True: 0, False: 0]
  |  Branch (22630:46): [True: 0, False: 0]
  ------------------
22631|      0|           (s->cur_func->parent->func_kind & JS_FUNC_GENERATOR)))) ||
  ------------------
  |  Branch (22631:12): [True: 0, False: 0]
  ------------------
22632|    411|        (s->token.u.ident.atom == JS_ATOM_await &&
  ------------------
  |  Branch (22632:10): [True: 0, False: 411]
  ------------------
22633|      0|         (s->is_module ||
  ------------------
  |  Branch (22633:11): [True: 0, False: 0]
  ------------------
22634|      0|          (s->cur_func->func_kind & JS_FUNC_ASYNC) ||
  ------------------
  |  Branch (22634:11): [True: 0, False: 0]
  ------------------
22635|      0|          s->cur_func->func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT ||
  ------------------
  |  Branch (22635:11): [True: 0, False: 0]
  ------------------
22636|      0|          (s->cur_func->func_type == JS_PARSE_FUNC_ARROW &&
  ------------------
  |  Branch (22636:12): [True: 0, False: 0]
  ------------------
22637|      0|           !s->cur_func->in_function_body && s->cur_func->parent &&
  ------------------
  |  Branch (22637:12): [True: 0, False: 0]
  |  Branch (22637:46): [True: 0, False: 0]
  ------------------
22638|      0|           ((s->cur_func->parent->func_kind & JS_FUNC_ASYNC) ||
  ------------------
  |  Branch (22638:13): [True: 0, False: 0]
  ------------------
22639|     80|            s->cur_func->parent->func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT))))) {
  ------------------
  |  Branch (22639:13): [True: 0, False: 0]
  ------------------
22640|     80|        if (s->token.u.ident.has_escape) {
  ------------------
  |  Branch (22640:13): [True: 0, False: 80]
  ------------------
22641|      0|            s->token.u.ident.is_reserved = TRUE;
22642|      0|            s->token.val = TOK_IDENT;
22643|     80|        } else {
22644|       |            /* The keywords atoms are pre allocated */
22645|     80|            s->token.val = s->token.u.ident.atom - 1 + TOK_FIRST_KEYWORD;
  ------------------
  |  |21765|     80|#define TOK_FIRST_KEYWORD   TOK_NULL
  ------------------
22646|     80|        }
22647|     80|    }
22648|    491|}
quickjs.c:js_parse_directives:
36211|     36|{
36212|     36|    char str[20];
36213|     36|    JSParsePos pos;
36214|     36|    BOOL has_semi;
36215|       |
36216|     36|    if (s->token.val != TOK_STRING)
  ------------------
  |  Branch (36216:9): [True: 34, False: 2]
  ------------------
36217|     34|        return 0;
36218|       |
36219|      2|    js_parse_get_pos(s, &pos);
36220|       |
36221|      4|    while(s->token.val == TOK_STRING) {
  ------------------
  |  Branch (36221:11): [True: 2, False: 2]
  ------------------
36222|       |        /* Copy actual source string representation */
36223|      2|        snprintf(str, sizeof str, "%.*s",
36224|      2|                 (int)(s->buf_ptr - s->token.ptr - 2), s->token.ptr + 1);
36225|       |
36226|      2|        if (next_token(s))
  ------------------
  |  Branch (36226:13): [True: 0, False: 2]
  ------------------
36227|      0|            return -1;
36228|       |
36229|      2|        has_semi = FALSE;
36230|      2|        switch (s->token.val) {
36231|      0|        case ';':
  ------------------
  |  Branch (36231:9): [True: 0, False: 2]
  ------------------
36232|      0|            if (next_token(s))
  ------------------
  |  Branch (36232:17): [True: 0, False: 0]
  ------------------
36233|      0|                return -1;
36234|      0|            has_semi = TRUE;
36235|      0|            break;
36236|      0|        case '}':
  ------------------
  |  Branch (36236:9): [True: 0, False: 2]
  ------------------
36237|      0|        case TOK_EOF:
  ------------------
  |  Branch (36237:9): [True: 0, False: 2]
  ------------------
36238|      0|            has_semi = TRUE;
36239|      0|            break;
36240|      0|        case TOK_NUMBER:
  ------------------
  |  Branch (36240:9): [True: 0, False: 2]
  ------------------
36241|      0|        case TOK_STRING:
  ------------------
  |  Branch (36241:9): [True: 0, False: 2]
  ------------------
36242|      0|        case TOK_TEMPLATE:
  ------------------
  |  Branch (36242:9): [True: 0, False: 2]
  ------------------
36243|      2|        case TOK_IDENT:
  ------------------
  |  Branch (36243:9): [True: 2, False: 0]
  ------------------
36244|      2|        case TOK_REGEXP:
  ------------------
  |  Branch (36244:9): [True: 0, False: 2]
  ------------------
36245|      2|        case TOK_DEC:
  ------------------
  |  Branch (36245:9): [True: 0, False: 2]
  ------------------
36246|      2|        case TOK_INC:
  ------------------
  |  Branch (36246:9): [True: 0, False: 2]
  ------------------
36247|      2|        case TOK_NULL:
  ------------------
  |  Branch (36247:9): [True: 0, False: 2]
  ------------------
36248|      2|        case TOK_FALSE:
  ------------------
  |  Branch (36248:9): [True: 0, False: 2]
  ------------------
36249|      2|        case TOK_TRUE:
  ------------------
  |  Branch (36249:9): [True: 0, False: 2]
  ------------------
36250|      2|        case TOK_IF:
  ------------------
  |  Branch (36250:9): [True: 0, False: 2]
  ------------------
36251|      2|        case TOK_RETURN:
  ------------------
  |  Branch (36251:9): [True: 0, False: 2]
  ------------------
36252|      2|        case TOK_VAR:
  ------------------
  |  Branch (36252:9): [True: 0, False: 2]
  ------------------
36253|      2|        case TOK_THIS:
  ------------------
  |  Branch (36253:9): [True: 0, False: 2]
  ------------------
36254|      2|        case TOK_DELETE:
  ------------------
  |  Branch (36254:9): [True: 0, False: 2]
  ------------------
36255|      2|        case TOK_TYPEOF:
  ------------------
  |  Branch (36255:9): [True: 0, False: 2]
  ------------------
36256|      2|        case TOK_NEW:
  ------------------
  |  Branch (36256:9): [True: 0, False: 2]
  ------------------
36257|      2|        case TOK_DO:
  ------------------
  |  Branch (36257:9): [True: 0, False: 2]
  ------------------
36258|      2|        case TOK_WHILE:
  ------------------
  |  Branch (36258:9): [True: 0, False: 2]
  ------------------
36259|      2|        case TOK_FOR:
  ------------------
  |  Branch (36259:9): [True: 0, False: 2]
  ------------------
36260|      2|        case TOK_SWITCH:
  ------------------
  |  Branch (36260:9): [True: 0, False: 2]
  ------------------
36261|      2|        case TOK_THROW:
  ------------------
  |  Branch (36261:9): [True: 0, False: 2]
  ------------------
36262|      2|        case TOK_TRY:
  ------------------
  |  Branch (36262:9): [True: 0, False: 2]
  ------------------
36263|      2|        case TOK_FUNCTION:
  ------------------
  |  Branch (36263:9): [True: 0, False: 2]
  ------------------
36264|      2|        case TOK_DEBUGGER:
  ------------------
  |  Branch (36264:9): [True: 0, False: 2]
  ------------------
36265|      2|        case TOK_WITH:
  ------------------
  |  Branch (36265:9): [True: 0, False: 2]
  ------------------
36266|      2|        case TOK_CLASS:
  ------------------
  |  Branch (36266:9): [True: 0, False: 2]
  ------------------
36267|      2|        case TOK_CONST:
  ------------------
  |  Branch (36267:9): [True: 0, False: 2]
  ------------------
36268|      2|        case TOK_ENUM:
  ------------------
  |  Branch (36268:9): [True: 0, False: 2]
  ------------------
36269|      2|        case TOK_EXPORT:
  ------------------
  |  Branch (36269:9): [True: 0, False: 2]
  ------------------
36270|      2|        case TOK_IMPORT:
  ------------------
  |  Branch (36270:9): [True: 0, False: 2]
  ------------------
36271|      2|        case TOK_SUPER:
  ------------------
  |  Branch (36271:9): [True: 0, False: 2]
  ------------------
36272|      2|        case TOK_INTERFACE:
  ------------------
  |  Branch (36272:9): [True: 0, False: 2]
  ------------------
36273|      2|        case TOK_LET:
  ------------------
  |  Branch (36273:9): [True: 0, False: 2]
  ------------------
36274|      2|        case TOK_PACKAGE:
  ------------------
  |  Branch (36274:9): [True: 0, False: 2]
  ------------------
36275|      2|        case TOK_PRIVATE:
  ------------------
  |  Branch (36275:9): [True: 0, False: 2]
  ------------------
36276|      2|        case TOK_PROTECTED:
  ------------------
  |  Branch (36276:9): [True: 0, False: 2]
  ------------------
36277|      2|        case TOK_PUBLIC:
  ------------------
  |  Branch (36277:9): [True: 0, False: 2]
  ------------------
36278|      2|        case TOK_STATIC:
  ------------------
  |  Branch (36278:9): [True: 0, False: 2]
  ------------------
36279|       |            /* automatic insertion of ';' */
36280|      2|            if (s->got_lf)
  ------------------
  |  Branch (36280:17): [True: 2, False: 0]
  ------------------
36281|      2|                has_semi = TRUE;
36282|      2|            break;
36283|      0|        default:
  ------------------
  |  Branch (36283:9): [True: 0, False: 2]
  ------------------
36284|      0|            break;
36285|      2|        }
36286|      2|        if (!has_semi)
  ------------------
  |  Branch (36286:13): [True: 0, False: 2]
  ------------------
36287|      0|            break;
36288|      2|        if (!strcmp(str, "use strict")) {
  ------------------
  |  Branch (36288:13): [True: 0, False: 2]
  ------------------
36289|      0|            s->cur_func->has_use_strict = TRUE;
36290|      0|            s->cur_func->js_mode |= JS_MODE_STRICT;
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
36291|      0|        }
36292|      2|    }
36293|      2|    return js_parse_seek_token(s, &pos);
36294|      2|}
quickjs.c:js_parse_get_pos:
24629|     40|{
24630|     40|    sp->ptr = s->token.ptr;
24631|     40|    sp->got_lf = s->got_lf;
24632|     40|    return 0;
24633|     40|}
quickjs.c:js_parse_seek_token:
24636|     40|{
24637|     40|    s->buf_ptr = sp->ptr;
24638|     40|    s->got_lf = sp->got_lf;
24639|     40|    return next_token(s);
24640|     40|}
quickjs.c:add_var:
24058|     38|{
24059|     38|    JSVarDef *vd;
24060|       |
24061|       |    /* the local variable indexes are currently stored on 16 bits */
24062|     38|    if (fd->var_count >= JS_MAX_LOCAL_VARS) {
  ------------------
  |  |  210|     38|#define JS_MAX_LOCAL_VARS 65534
  ------------------
  |  Branch (24062:9): [True: 0, False: 38]
  ------------------
24063|      0|        JS_ThrowInternalError(ctx, "too many local variables");
24064|      0|        return -1;
24065|      0|    }
24066|     38|    if (js_resize_array(ctx, (void **)&fd->vars, sizeof(fd->vars[0]),
  ------------------
  |  Branch (24066:9): [True: 0, False: 38]
  ------------------
24067|     38|                        &fd->var_size, fd->var_count + 1))
24068|      0|        return -1;
24069|     38|    vd = &fd->vars[fd->var_count++];
24070|     38|    memset(vd, 0, sizeof(*vd));
24071|     38|    vd->var_name = JS_DupAtom(ctx, name);
24072|     38|    vd->func_pool_idx = -1;
24073|     38|    return fd->var_count - 1;
24074|     38|}
quickjs.c:js_parse_source_element:
31918|    106|{
31919|    106|    JSFunctionDef *fd = s->cur_func;
31920|    106|    int tok;
31921|       |
31922|    106|    if (s->token.val == TOK_FUNCTION ||
  ------------------
  |  Branch (31922:9): [True: 1, False: 105]
  ------------------
31923|    105|        (token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (31923:10): [True: 0, False: 105]
  ------------------
31924|      1|         peek_token(s, TRUE) == TOK_FUNCTION)) {
  ------------------
  |  Branch (31924:10): [True: 0, False: 0]
  ------------------
31925|      1|        if (js_parse_function_decl(s, JS_PARSE_FUNC_STATEMENT,
  ------------------
  |  Branch (31925:13): [True: 0, False: 1]
  ------------------
31926|      1|                                   JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  451|      1|#define JS_ATOM_NULL 0
  ------------------
31927|      1|                                   s->token.ptr))
31928|      0|            return -1;
31929|    105|    } else if (s->token.val == TOK_EXPORT && fd->module) {
  ------------------
  |  Branch (31929:16): [True: 0, False: 105]
  |  Branch (31929:46): [True: 0, False: 0]
  ------------------
31930|      0|        if (js_parse_export(s))
  ------------------
  |  Branch (31930:13): [True: 0, False: 0]
  ------------------
31931|      0|            return -1;
31932|    105|    } else if (s->token.val == TOK_IMPORT && fd->module &&
  ------------------
  |  Branch (31932:16): [True: 34, False: 71]
  |  Branch (31932:46): [True: 34, False: 0]
  ------------------
31933|     34|               ((tok = peek_token(s, FALSE)) != '(' && tok != '.'))  {
  ------------------
  |  Branch (31933:17): [True: 34, False: 0]
  |  Branch (31933:56): [True: 34, False: 0]
  ------------------
31934|       |        /* the peek_token is needed to avoid confusion with ImportCall
31935|       |           (dynamic import) or import.meta */
31936|     34|        if (js_parse_import(s))
  ------------------
  |  Branch (31936:13): [True: 0, False: 34]
  ------------------
31937|      0|            return -1;
31938|     71|    } else {
31939|     71|        if (js_parse_statement_or_decl(s, DECL_MASK_ALL))
  ------------------
  |  |28368|     71|#define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28364|     71|#define DECL_MASK_FUNC  (1 << 0) /* allow normal function declaration */
  |  |  ------------------
  |  |               #define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28366|     71|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  |  |  ------------------
  |  |               #define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28367|     71|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  |  |  ------------------
  ------------------
  |  Branch (31939:13): [True: 6, False: 65]
  ------------------
31940|      6|            return -1;
31941|     71|    }
31942|    100|    return 0;
31943|    106|}
quickjs.c:token_is_pseudo_keyword:
22481|    725|static inline BOOL token_is_pseudo_keyword(JSParseState *s, JSAtom atom) {
22482|    725|    return s->token.val == TOK_IDENT && s->token.u.ident.atom == atom &&
  ------------------
  |  Branch (22482:12): [True: 609, False: 116]
  |  Branch (22482:41): [True: 84, False: 525]
  ------------------
22483|     84|        !s->token.u.ident.has_escape;
  ------------------
  |  Branch (22483:9): [True: 84, False: 0]
  ------------------
22484|    725|}
quickjs.c:peek_token:
23639|    224|{
23640|    224|    const uint8_t *p = s->buf_ptr;
23641|    224|    return simple_next_token(&p, no_line_terminator);
23642|    224|}
quickjs.c:js_parse_function_decl:
36956|      5|{
36957|      5|    return js_parse_function_decl2(s, func_type, func_kind, func_name, ptr,
36958|       |                                   JS_PARSE_EXPORT_NONE, NULL);
36959|      5|}
quickjs.c:js_parse_function_decl2:
36390|      5|{
36391|      5|    JSContext *ctx = s->ctx;
36392|      5|    JSFunctionDef *fd = s->cur_func;
36393|      5|    BOOL is_expr;
36394|      5|    int func_idx, lexical_func_idx = -1;
36395|      5|    BOOL has_opt_arg;
36396|      5|    BOOL create_func_var = FALSE;
36397|       |
36398|      5|    is_expr = (func_type != JS_PARSE_FUNC_STATEMENT &&
  ------------------
  |  Branch (36398:16): [True: 4, False: 1]
  ------------------
36399|      4|               func_type != JS_PARSE_FUNC_VAR);
  ------------------
  |  Branch (36399:16): [True: 2, False: 2]
  ------------------
36400|       |
36401|      5|    if (func_type == JS_PARSE_FUNC_STATEMENT ||
  ------------------
  |  Branch (36401:9): [True: 1, False: 4]
  ------------------
36402|      4|        func_type == JS_PARSE_FUNC_VAR ||
  ------------------
  |  Branch (36402:9): [True: 2, False: 2]
  ------------------
36403|      3|        func_type == JS_PARSE_FUNC_EXPR) {
  ------------------
  |  Branch (36403:9): [True: 0, False: 2]
  ------------------
36404|      3|        if (func_kind == JS_FUNC_NORMAL &&
  ------------------
  |  Branch (36404:13): [True: 3, False: 0]
  ------------------
36405|      3|            token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (36405:13): [True: 0, False: 3]
  ------------------
36406|      0|            peek_token(s, TRUE) != '\n') {
  ------------------
  |  Branch (36406:13): [True: 0, False: 0]
  ------------------
36407|      0|            if (next_token(s))
  ------------------
  |  Branch (36407:17): [True: 0, False: 0]
  ------------------
36408|      0|                return -1;
36409|      0|            func_kind = JS_FUNC_ASYNC;
36410|      0|        }
36411|      3|        if (next_token(s))
  ------------------
  |  Branch (36411:13): [True: 0, False: 3]
  ------------------
36412|      0|            return -1;
36413|      3|        if (s->token.val == '*') {
  ------------------
  |  Branch (36413:13): [True: 1, False: 2]
  ------------------
36414|      1|            if (next_token(s))
  ------------------
  |  Branch (36414:17): [True: 0, False: 1]
  ------------------
36415|      0|                return -1;
36416|      1|            func_kind |= JS_FUNC_GENERATOR;
36417|      1|        }
36418|       |
36419|      3|        if (s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (36419:13): [True: 3, False: 0]
  ------------------
36420|      3|            if (s->token.u.ident.is_reserved ||
  ------------------
  |  Branch (36420:17): [True: 0, False: 3]
  ------------------
36421|      3|                (s->token.u.ident.atom == JS_ATOM_yield &&
  ------------------
  |  Branch (36421:18): [True: 0, False: 3]
  ------------------
36422|      0|                 func_type == JS_PARSE_FUNC_EXPR &&
  ------------------
  |  Branch (36422:18): [True: 0, False: 0]
  ------------------
36423|      0|                 (func_kind & JS_FUNC_GENERATOR)) ||
  ------------------
  |  Branch (36423:18): [True: 0, False: 0]
  ------------------
36424|      3|                (s->token.u.ident.atom == JS_ATOM_await &&
  ------------------
  |  Branch (36424:18): [True: 0, False: 3]
  ------------------
36425|      0|                 ((func_type == JS_PARSE_FUNC_EXPR &&
  ------------------
  |  Branch (36425:20): [True: 0, False: 0]
  ------------------
36426|      0|                   (func_kind & JS_FUNC_ASYNC)) ||
  ------------------
  |  Branch (36426:20): [True: 0, False: 0]
  ------------------
36427|      0|                  func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT))) {
  ------------------
  |  Branch (36427:19): [True: 0, False: 0]
  ------------------
36428|      0|                return js_parse_error_reserved_identifier(s);
36429|      0|            }
36430|      3|        }
36431|      3|        if (s->token.val == TOK_IDENT ||
  ------------------
  |  Branch (36431:13): [True: 3, False: 0]
  ------------------
36432|      0|            (((s->token.val == TOK_YIELD && !(fd->js_mode & JS_MODE_STRICT)) ||
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (36432:16): [True: 0, False: 0]
  |  Branch (36432:45): [True: 0, False: 0]
  ------------------
36433|      0|             (s->token.val == TOK_AWAIT && !s->is_module)) &&
  ------------------
  |  Branch (36433:15): [True: 0, False: 0]
  |  Branch (36433:44): [True: 0, False: 0]
  ------------------
36434|      3|             func_type == JS_PARSE_FUNC_EXPR)) {
  ------------------
  |  Branch (36434:14): [True: 0, False: 0]
  ------------------
36435|      3|            func_name = JS_DupAtom(ctx, s->token.u.ident.atom);
36436|      3|            if (next_token(s)) {
  ------------------
  |  Branch (36436:17): [True: 0, False: 3]
  ------------------
36437|      0|                JS_FreeAtom(ctx, func_name);
36438|      0|                return -1;
36439|      0|            }
36440|      3|        } else {
36441|      0|            if (func_type != JS_PARSE_FUNC_EXPR &&
  ------------------
  |  Branch (36441:17): [True: 0, False: 0]
  ------------------
36442|      0|                export_flag != JS_PARSE_EXPORT_DEFAULT) {
  ------------------
  |  Branch (36442:17): [True: 0, False: 0]
  ------------------
36443|      0|                return js_parse_error(s, "function name expected");
36444|      0|            }
36445|      0|        }
36446|      3|    } else if (func_type != JS_PARSE_FUNC_ARROW) {
  ------------------
  |  Branch (36446:16): [True: 0, False: 2]
  ------------------
36447|      0|        func_name = JS_DupAtom(ctx, func_name);
36448|      0|    }
36449|       |
36450|      5|    if (fd->is_eval && fd->eval_type == JS_EVAL_TYPE_MODULE &&
  ------------------
  |  |  333|      8|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (36450:9): [True: 3, False: 2]
  |  Branch (36450:24): [True: 0, False: 3]
  ------------------
36451|      0|        (func_type == JS_PARSE_FUNC_STATEMENT || func_type == JS_PARSE_FUNC_VAR)) {
  ------------------
  |  Branch (36451:10): [True: 0, False: 0]
  |  Branch (36451:50): [True: 0, False: 0]
  ------------------
36452|      0|        JSGlobalVar *hf;
36453|      0|        hf = find_global_var(fd, func_name);
36454|       |        /* XXX: should check scope chain */
36455|      0|        if (hf && hf->scope_level == fd->scope_level) {
  ------------------
  |  Branch (36455:13): [True: 0, False: 0]
  |  Branch (36455:19): [True: 0, False: 0]
  ------------------
36456|      0|            js_parse_error(s, "invalid redefinition of global identifier in module code");
36457|      0|            JS_FreeAtom(ctx, func_name);
36458|      0|            return -1;
36459|      0|        }
36460|      0|    }
36461|       |
36462|      5|    if (func_type == JS_PARSE_FUNC_VAR) {
  ------------------
  |  Branch (36462:9): [True: 2, False: 3]
  ------------------
36463|      2|        if (!(fd->js_mode & JS_MODE_STRICT)
  ------------------
  |  |  403|      2|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (36463:13): [True: 2, False: 0]
  ------------------
36464|      2|        && func_kind == JS_FUNC_NORMAL
  ------------------
  |  Branch (36464:12): [True: 1, False: 1]
  ------------------
36465|      1|        &&  find_lexical_decl(ctx, fd, func_name, fd->scope_first, FALSE) < 0
  ------------------
  |  Branch (36465:13): [True: 1, False: 0]
  ------------------
36466|      1|        &&  !((func_idx = find_var(ctx, fd, func_name)) >= 0 && (func_idx & ARGUMENT_VAR_OFFSET))
  ------------------
  |  |16205|      1|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (36466:15): [True: 1, False: 0]
  |  Branch (36466:65): [True: 1, False: 0]
  ------------------
36467|      0|        &&  !(func_name == JS_ATOM_arguments && fd->has_arguments_binding)) {
  ------------------
  |  Branch (36467:15): [True: 0, False: 0]
  |  Branch (36467:49): [True: 0, False: 0]
  ------------------
36468|      0|            create_func_var = TRUE;
36469|      0|        }
36470|       |        /* Create the lexical name here so that the function closure
36471|       |           contains it */
36472|      2|        if (fd->is_eval &&
  ------------------
  |  Branch (36472:13): [True: 1, False: 1]
  ------------------
36473|      1|            (fd->eval_type == JS_EVAL_TYPE_GLOBAL ||
  ------------------
  |  |  332|      2|#define JS_EVAL_TYPE_GLOBAL   (0 << 0) /* global code (default) */
  ------------------
  |  Branch (36473:14): [True: 1, False: 0]
  ------------------
36474|      0|             fd->eval_type == JS_EVAL_TYPE_MODULE) &&
  ------------------
  |  |  333|      0|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (36474:14): [True: 0, False: 0]
  ------------------
36475|      1|            fd->scope_level == fd->body_scope) {
  ------------------
  |  Branch (36475:13): [True: 0, False: 1]
  ------------------
36476|       |            /* avoid creating a lexical variable in the global
36477|       |               scope. XXX: check annex B */
36478|      0|            JSGlobalVar *hf;
36479|      0|            hf = find_global_var(fd, func_name);
36480|       |            /* XXX: should check scope chain */
36481|      0|            if (hf && hf->scope_level == fd->scope_level) {
  ------------------
  |  Branch (36481:17): [True: 0, False: 0]
  |  Branch (36481:23): [True: 0, False: 0]
  ------------------
36482|      0|                js_parse_error(s, "invalid redefinition of global identifier");
36483|      0|                JS_FreeAtom(ctx, func_name);
36484|      0|                return -1;
36485|      0|            }
36486|      2|        } else {
36487|       |            /* Always create a lexical name, fail if at the same scope as
36488|       |               existing name */
36489|       |            /* Lexical variable will be initialized upon entering scope */
36490|      2|            lexical_func_idx = define_var(s, fd, func_name,
36491|      2|                                          func_kind != JS_FUNC_NORMAL ?
  ------------------
  |  Branch (36491:43): [True: 1, False: 1]
  ------------------
36492|      1|                                          JS_VAR_DEF_NEW_FUNCTION_DECL :
36493|      2|                                          JS_VAR_DEF_FUNCTION_DECL);
36494|      2|            if (lexical_func_idx < 0) {
  ------------------
  |  Branch (36494:17): [True: 0, False: 2]
  ------------------
36495|      0|                JS_FreeAtom(ctx, func_name);
36496|      0|                return -1;
36497|      0|            }
36498|      2|        }
36499|      2|    }
36500|       |
36501|      5|    fd = js_new_function_def(ctx, fd, FALSE, is_expr,
36502|      5|                             s->filename, ptr,
36503|      5|                             &s->get_line_col_cache);
36504|      5|    if (!fd) {
  ------------------
  |  Branch (36504:9): [True: 0, False: 5]
  ------------------
36505|      0|        JS_FreeAtom(ctx, func_name);
36506|      0|        return -1;
36507|      0|    }
36508|      5|    if (pfd)
  ------------------
  |  Branch (36508:9): [True: 0, False: 5]
  ------------------
36509|      0|        *pfd = fd;
36510|      5|    s->cur_func = fd;
36511|      5|    fd->func_name = func_name;
36512|       |    /* XXX: test !fd->is_generator is always false */
36513|      5|    fd->has_prototype = (func_type == JS_PARSE_FUNC_STATEMENT ||
  ------------------
  |  Branch (36513:26): [True: 1, False: 4]
  ------------------
36514|      4|                         func_type == JS_PARSE_FUNC_VAR ||
  ------------------
  |  Branch (36514:26): [True: 2, False: 2]
  ------------------
36515|      2|                         func_type == JS_PARSE_FUNC_EXPR) &&
  ------------------
  |  Branch (36515:26): [True: 0, False: 2]
  ------------------
36516|      3|                        func_kind == JS_FUNC_NORMAL;
  ------------------
  |  Branch (36516:25): [True: 2, False: 1]
  ------------------
36517|      5|    fd->has_home_object = (func_type == JS_PARSE_FUNC_METHOD ||
  ------------------
  |  Branch (36517:28): [True: 0, False: 5]
  ------------------
36518|      5|                           func_type == JS_PARSE_FUNC_GETTER ||
  ------------------
  |  Branch (36518:28): [True: 0, False: 5]
  ------------------
36519|      5|                           func_type == JS_PARSE_FUNC_SETTER ||
  ------------------
  |  Branch (36519:28): [True: 0, False: 5]
  ------------------
36520|      5|                           func_type == JS_PARSE_FUNC_CLASS_CONSTRUCTOR ||
  ------------------
  |  Branch (36520:28): [True: 0, False: 5]
  ------------------
36521|      5|                           func_type == JS_PARSE_FUNC_DERIVED_CLASS_CONSTRUCTOR);
  ------------------
  |  Branch (36521:28): [True: 0, False: 5]
  ------------------
36522|      5|    fd->has_arguments_binding = (func_type != JS_PARSE_FUNC_ARROW &&
  ------------------
  |  Branch (36522:34): [True: 3, False: 2]
  ------------------
36523|      3|                                 func_type != JS_PARSE_FUNC_CLASS_STATIC_INIT);
  ------------------
  |  Branch (36523:34): [True: 3, False: 0]
  ------------------
36524|      5|    fd->has_this_binding = fd->has_arguments_binding;
36525|      5|    fd->is_derived_class_constructor = (func_type == JS_PARSE_FUNC_DERIVED_CLASS_CONSTRUCTOR);
36526|      5|    if (func_type == JS_PARSE_FUNC_ARROW) {
  ------------------
  |  Branch (36526:9): [True: 2, False: 3]
  ------------------
36527|      2|        fd->new_target_allowed = fd->parent->new_target_allowed;
36528|      2|        fd->super_call_allowed = fd->parent->super_call_allowed;
36529|      2|        fd->super_allowed = fd->parent->super_allowed;
36530|      2|        fd->arguments_allowed = fd->parent->arguments_allowed;
36531|      3|    } else if (func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT) {
  ------------------
  |  Branch (36531:16): [True: 0, False: 3]
  ------------------
36532|      0|        fd->new_target_allowed = TRUE; // although new.target === undefined
36533|      0|        fd->super_call_allowed = FALSE;
36534|      0|        fd->super_allowed = TRUE;
36535|      0|        fd->arguments_allowed = FALSE;
36536|      3|    } else {
36537|      3|        fd->new_target_allowed = TRUE;
36538|      3|        fd->super_call_allowed = fd->is_derived_class_constructor;
36539|      3|        fd->super_allowed = fd->has_home_object;
36540|      3|        fd->arguments_allowed = TRUE;
36541|      3|    }
36542|       |
36543|       |    /* fd->in_function_body == FALSE prevents yield/await during the parsing
36544|       |       of the arguments in generator/async functions. They are parsed as
36545|       |       regular identifiers for other function kinds. */
36546|      5|    fd->func_kind = func_kind;
36547|      5|    fd->func_type = func_type;
36548|       |
36549|      5|    if (func_type == JS_PARSE_FUNC_CLASS_CONSTRUCTOR ||
  ------------------
  |  Branch (36549:9): [True: 0, False: 5]
  ------------------
36550|      5|        func_type == JS_PARSE_FUNC_DERIVED_CLASS_CONSTRUCTOR) {
  ------------------
  |  Branch (36550:9): [True: 0, False: 5]
  ------------------
36551|       |        /* error if not invoked as a constructor */
36552|      0|        emit_op(s, OP_check_ctor);
36553|      0|    }
36554|       |
36555|      5|    if (func_type == JS_PARSE_FUNC_CLASS_CONSTRUCTOR) {
  ------------------
  |  Branch (36555:9): [True: 0, False: 5]
  ------------------
36556|      0|        emit_class_field_init(s);
36557|      0|    }
36558|       |
36559|       |    /* parse arguments */
36560|      5|    fd->has_simple_parameter_list = TRUE;
36561|      5|    fd->has_parameter_expressions = FALSE;
36562|      5|    has_opt_arg = FALSE;
36563|      5|    if (func_type == JS_PARSE_FUNC_ARROW && s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (36563:9): [True: 2, False: 3]
  |  Branch (36563:45): [True: 0, False: 2]
  ------------------
36564|      0|        JSAtom name;
36565|      0|        if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (36565:13): [True: 0, False: 0]
  ------------------
36566|      0|            js_parse_error_reserved_identifier(s);
36567|      0|            goto fail;
36568|      0|        }
36569|      0|        name = s->token.u.ident.atom;
36570|      0|        if (add_arg(ctx, fd, name) < 0)
  ------------------
  |  Branch (36570:13): [True: 0, False: 0]
  ------------------
36571|      0|            goto fail;
36572|      0|        fd->defined_arg_count = 1;
36573|      5|    } else if (func_type != JS_PARSE_FUNC_CLASS_STATIC_INIT) {
  ------------------
  |  Branch (36573:16): [True: 5, False: 0]
  ------------------
36574|      5|        if (s->token.val == '(') {
  ------------------
  |  Branch (36574:13): [True: 5, False: 0]
  ------------------
36575|      5|            int skip_bits;
36576|       |            /* if there is an '=' inside the parameter list, we
36577|       |               consider there is a parameter expression inside */
36578|      5|            js_parse_skip_parens_token(s, &skip_bits, FALSE);
36579|      5|            if (skip_bits & SKIP_HAS_ASSIGNMENT)
  ------------------
  |  |24667|      5|#define SKIP_HAS_ASSIGNMENT (1 << 2)
  ------------------
  |  Branch (36579:17): [True: 2, False: 3]
  ------------------
36580|      2|                fd->has_parameter_expressions = TRUE;
36581|      5|            if (next_token(s))
  ------------------
  |  Branch (36581:17): [True: 0, False: 5]
  ------------------
36582|      0|                goto fail;
36583|      5|        } else {
36584|      0|            if (js_parse_expect(s, '('))
  ------------------
  |  Branch (36584:17): [True: 0, False: 0]
  ------------------
36585|      0|                goto fail;
36586|      0|        }
36587|       |
36588|      5|        if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36588:13): [True: 2, False: 3]
  ------------------
36589|      2|            fd->scope_level = -1; /* force no parent scope */
36590|      2|            if (push_scope(s) < 0)
  ------------------
  |  Branch (36590:17): [True: 0, False: 2]
  ------------------
36591|      0|                return -1;
36592|      2|        }
36593|       |
36594|      9|        while (s->token.val != ')') {
  ------------------
  |  Branch (36594:16): [True: 8, False: 1]
  ------------------
36595|      8|            JSAtom name;
36596|      8|            BOOL rest = FALSE;
36597|      8|            int idx, has_initializer;
36598|       |
36599|      8|            if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (36599:17): [True: 0, False: 8]
  ------------------
36600|      0|                if (func_type == JS_PARSE_FUNC_SETTER)
  ------------------
  |  Branch (36600:21): [True: 0, False: 0]
  ------------------
36601|      0|                    goto fail_accessor;
36602|      0|                fd->has_simple_parameter_list = FALSE;
36603|      0|                rest = TRUE;
36604|      0|                if (next_token(s))
  ------------------
  |  Branch (36604:21): [True: 0, False: 0]
  ------------------
36605|      0|                    goto fail;
36606|      0|            }
36607|      8|            if (s->token.val == '[' || s->token.val == '{') {
  ------------------
  |  Branch (36607:17): [True: 0, False: 8]
  |  Branch (36607:40): [True: 2, False: 6]
  ------------------
36608|      2|                fd->has_simple_parameter_list = FALSE;
36609|      2|                if (rest) {
  ------------------
  |  Branch (36609:21): [True: 0, False: 2]
  ------------------
36610|      0|                    emit_op(s, OP_rest);
36611|      0|                    emit_u16(s, fd->arg_count);
36612|      2|                } else {
36613|       |                    /* unnamed arg for destructuring */
36614|      2|                    idx = add_arg(ctx, fd, JS_ATOM_NULL);
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
36615|      2|                    emit_op(s, OP_get_arg);
36616|      2|                    emit_u16(s, idx);
36617|      2|                }
36618|      2|                has_initializer = js_parse_destructuring_element(s, fd->has_parameter_expressions ? TOK_LET : TOK_VAR, 1, TRUE, -1, TRUE, FALSE);
  ------------------
  |  Branch (36618:69): [True: 2, False: 0]
  ------------------
36619|      2|                if (has_initializer < 0)
  ------------------
  |  Branch (36619:21): [True: 0, False: 2]
  ------------------
36620|      0|                    goto fail;
36621|      2|                if (has_initializer)
  ------------------
  |  Branch (36621:21): [True: 2, False: 0]
  ------------------
36622|      2|                    has_opt_arg = TRUE;
36623|      2|                if (!has_opt_arg)
  ------------------
  |  Branch (36623:21): [True: 0, False: 2]
  ------------------
36624|      0|                    fd->defined_arg_count++;
36625|      6|            } else if (s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (36625:24): [True: 6, False: 0]
  ------------------
36626|      6|                if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (36626:21): [True: 0, False: 6]
  ------------------
36627|      0|                    js_parse_error_reserved_identifier(s);
36628|      0|                    goto fail;
36629|      0|                }
36630|      6|                name = s->token.u.ident.atom;
36631|      6|                if (name == JS_ATOM_yield && fd->func_kind == JS_FUNC_GENERATOR) {
  ------------------
  |  Branch (36631:21): [True: 0, False: 6]
  |  Branch (36631:46): [True: 0, False: 0]
  ------------------
36632|      0|                    js_parse_error_reserved_identifier(s);
36633|      0|                    goto fail;
36634|      0|                }
36635|      6|                if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36635:21): [True: 2, False: 4]
  ------------------
36636|      2|                    if (js_parse_check_duplicate_parameter(s, name))
  ------------------
  |  Branch (36636:25): [True: 0, False: 2]
  ------------------
36637|      0|                        goto fail;
36638|      2|                    if (define_var(s, fd, name, JS_VAR_DEF_LET) < 0)
  ------------------
  |  Branch (36638:25): [True: 0, False: 2]
  ------------------
36639|      0|                        goto fail;
36640|      2|                }
36641|       |                /* XXX: could avoid allocating an argument if rest is true */
36642|      6|                idx = add_arg(ctx, fd, name);
36643|      6|                if (idx < 0)
  ------------------
  |  Branch (36643:21): [True: 0, False: 6]
  ------------------
36644|      0|                    goto fail;
36645|      6|                if (next_token(s))
  ------------------
  |  Branch (36645:21): [True: 0, False: 6]
  ------------------
36646|      0|                    goto fail;
36647|      6|                if (rest) {
  ------------------
  |  Branch (36647:21): [True: 0, False: 6]
  ------------------
36648|      0|                    emit_op(s, OP_rest);
36649|      0|                    emit_u16(s, idx);
36650|      0|                    if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36650:25): [True: 0, False: 0]
  ------------------
36651|      0|                        emit_op(s, OP_dup);
36652|      0|                        emit_op(s, OP_scope_put_var_init);
36653|      0|                        emit_atom(s, name);
36654|      0|                        emit_u16(s, fd->scope_level);
36655|      0|                    }
36656|      0|                    emit_op(s, OP_put_arg);
36657|      0|                    emit_u16(s, idx);
36658|      0|                    fd->has_simple_parameter_list = FALSE;
36659|      0|                    has_opt_arg = TRUE;
36660|      6|                } else if (s->token.val == '=') {
  ------------------
  |  Branch (36660:28): [True: 0, False: 6]
  ------------------
36661|      0|                    int label;
36662|       |
36663|      0|                    fd->has_simple_parameter_list = FALSE;
36664|      0|                    has_opt_arg = TRUE;
36665|       |
36666|      0|                    if (next_token(s))
  ------------------
  |  Branch (36666:25): [True: 0, False: 0]
  ------------------
36667|      0|                        goto fail;
36668|       |
36669|      0|                    label = new_label(s);
36670|      0|                    emit_op(s, OP_get_arg);
36671|      0|                    emit_u16(s, idx);
36672|      0|                    emit_op(s, OP_dup);
36673|      0|                    emit_op(s, OP_undefined);
36674|      0|                    emit_op(s, OP_strict_eq);
36675|      0|                    emit_goto(s, OP_if_false, label);
36676|      0|                    emit_op(s, OP_drop);
36677|      0|                    if (js_parse_assign_expr(s))
  ------------------
  |  Branch (36677:25): [True: 0, False: 0]
  ------------------
36678|      0|                        goto fail;
36679|      0|                    set_object_name(s, name);
36680|      0|                    emit_op(s, OP_dup);
36681|      0|                    emit_op(s, OP_put_arg);
36682|      0|                    emit_u16(s, idx);
36683|      0|                    emit_label(s, label);
36684|      0|                    emit_op(s, OP_scope_put_var_init);
36685|      0|                    emit_atom(s, name);
36686|      0|                    emit_u16(s, fd->scope_level);
36687|      6|                } else {
36688|      6|                    if (!has_opt_arg) {
  ------------------
  |  Branch (36688:25): [True: 4, False: 2]
  ------------------
36689|      4|                        fd->defined_arg_count++;
36690|      4|                    }
36691|      6|                    if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36691:25): [True: 2, False: 4]
  ------------------
36692|       |                        /* copy the argument to the argument scope */
36693|      2|                        emit_op(s, OP_get_arg);
36694|      2|                        emit_u16(s, idx);
36695|      2|                        emit_op(s, OP_scope_put_var_init);
36696|      2|                        emit_atom(s, name);
36697|      2|                        emit_u16(s, fd->scope_level);
36698|      2|                    }
36699|      6|                }
36700|      6|            } else {
36701|      0|                js_parse_error(s, "missing formal parameter");
36702|      0|                goto fail;
36703|      0|            }
36704|      8|            if (rest && s->token.val != ')') {
  ------------------
  |  Branch (36704:17): [True: 0, False: 8]
  |  Branch (36704:25): [True: 0, False: 0]
  ------------------
36705|      0|                js_parse_expect(s, ')');
36706|      0|                goto fail;
36707|      0|            }
36708|      8|            if (s->token.val == ')')
  ------------------
  |  Branch (36708:17): [True: 4, False: 4]
  ------------------
36709|      4|                break;
36710|      4|            if (js_parse_expect(s, ','))
  ------------------
  |  Branch (36710:17): [True: 0, False: 4]
  ------------------
36711|      0|                goto fail;
36712|      4|        }
36713|      5|        if ((func_type == JS_PARSE_FUNC_GETTER && fd->arg_count != 0) ||
  ------------------
  |  Branch (36713:14): [True: 0, False: 5]
  |  Branch (36713:51): [True: 0, False: 0]
  ------------------
36714|      5|            (func_type == JS_PARSE_FUNC_SETTER && fd->arg_count != 1)) {
  ------------------
  |  Branch (36714:14): [True: 0, False: 5]
  |  Branch (36714:51): [True: 0, False: 0]
  ------------------
36715|      0|        fail_accessor:
36716|      0|            js_parse_error(s, "invalid number of arguments for getter or setter");
36717|      0|            goto fail;
36718|      0|        }
36719|      5|    }
36720|       |
36721|      5|    if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36721:9): [True: 2, False: 3]
  ------------------
36722|      2|        int idx;
36723|       |
36724|       |        /* Copy the variables in the argument scope to the variable
36725|       |           scope (see FunctionDeclarationInstantiation() in spec). The
36726|       |           normal arguments are already present, so no need to copy
36727|       |           them. */
36728|      2|        idx = fd->scopes[fd->scope_level].first;
36729|      6|        while (idx >= 0) {
  ------------------
  |  Branch (36729:16): [True: 4, False: 2]
  ------------------
36730|      4|            JSVarDef *vd = &fd->vars[idx];
36731|      4|            if (vd->scope_level != fd->scope_level)
  ------------------
  |  Branch (36731:17): [True: 0, False: 4]
  ------------------
36732|      0|                break;
36733|      4|            if (find_var(ctx, fd, vd->var_name) < 0) {
  ------------------
  |  Branch (36733:17): [True: 2, False: 2]
  ------------------
36734|      2|                if (add_var(ctx, fd, vd->var_name) < 0)
  ------------------
  |  Branch (36734:21): [True: 0, False: 2]
  ------------------
36735|      0|                    goto fail;
36736|      2|                vd = &fd->vars[idx]; /* fd->vars may have been reallocated */
36737|      2|                emit_op(s, OP_scope_get_var);
36738|      2|                emit_atom(s, vd->var_name);
36739|      2|                emit_u16(s, fd->scope_level);
36740|      2|                emit_op(s, OP_scope_put_var);
36741|      2|                emit_atom(s, vd->var_name);
36742|      2|                emit_u16(s, 0);
36743|      2|            }
36744|      4|            idx = vd->scope_next;
36745|      4|        }
36746|       |
36747|       |        /* the argument scope has no parent, hence we don't use pop_scope(s) */
36748|      2|        emit_op(s, OP_leave_scope);
36749|      2|        emit_u16(s, fd->scope_level);
36750|       |
36751|       |        /* set the variable scope as the current scope */
36752|      2|        fd->scope_level = 0;
36753|      2|        fd->scope_first = fd->scopes[fd->scope_level].first;
36754|      2|    }
36755|       |
36756|      5|    if (next_token(s))
  ------------------
  |  Branch (36756:9): [True: 0, False: 5]
  ------------------
36757|      0|        goto fail;
36758|       |
36759|       |    /* generator function: yield after the parameters are evaluated */
36760|      5|    if (func_kind == JS_FUNC_GENERATOR ||
  ------------------
  |  Branch (36760:9): [True: 1, False: 4]
  ------------------
36761|      4|        func_kind == JS_FUNC_ASYNC_GENERATOR)
  ------------------
  |  Branch (36761:9): [True: 0, False: 4]
  ------------------
36762|      1|        emit_op(s, OP_initial_yield);
36763|       |
36764|       |    /* in generators, yield expression is forbidden during the parsing
36765|       |       of the arguments */
36766|      5|    fd->in_function_body = TRUE;
36767|      5|    push_scope(s);  /* enter body scope */
36768|      5|    fd->body_scope = fd->scope_level;
36769|       |
36770|      5|    if (s->token.val == TOK_ARROW && func_type == JS_PARSE_FUNC_ARROW) {
  ------------------
  |  Branch (36770:9): [True: 2, False: 3]
  |  Branch (36770:38): [True: 2, False: 0]
  ------------------
36771|      2|        if (next_token(s))
  ------------------
  |  Branch (36771:13): [True: 0, False: 2]
  ------------------
36772|      0|            goto fail;
36773|       |
36774|      2|        if (s->token.val != '{') {
  ------------------
  |  Branch (36774:13): [True: 2, False: 0]
  ------------------
36775|      2|            if (js_parse_function_check_names(s, fd, func_name))
  ------------------
  |  Branch (36775:17): [True: 0, False: 2]
  ------------------
36776|      0|                goto fail;
36777|       |
36778|      2|            if (js_parse_assign_expr(s))
  ------------------
  |  Branch (36778:17): [True: 0, False: 2]
  ------------------
36779|      0|                goto fail;
36780|       |
36781|      2|            if (func_kind != JS_FUNC_NORMAL)
  ------------------
  |  Branch (36781:17): [True: 0, False: 2]
  ------------------
36782|      0|                emit_op(s, OP_return_async);
36783|      2|            else
36784|      2|                emit_op(s, OP_return);
36785|       |
36786|      2|            if (!fd->strip_source) {
  ------------------
  |  Branch (36786:17): [True: 2, False: 0]
  ------------------
36787|       |                /* save the function source code */
36788|       |                /* the end of the function source code is after the last
36789|       |                   token of the function source stored into s->last_ptr */
36790|      2|                fd->source_len = s->last_ptr - ptr;
36791|      2|                fd->source = js_strndup(ctx, (const char *)ptr, fd->source_len);
36792|      2|                if (!fd->source)
  ------------------
  |  Branch (36792:21): [True: 0, False: 2]
  ------------------
36793|      0|                    goto fail;
36794|      2|            }
36795|      2|            goto done;
36796|      2|        }
36797|      2|    }
36798|       |
36799|      3|    if (func_type != JS_PARSE_FUNC_CLASS_STATIC_INIT) {
  ------------------
  |  Branch (36799:9): [True: 3, False: 0]
  ------------------
36800|      3|        if (js_parse_expect(s, '{'))
  ------------------
  |  Branch (36800:13): [True: 0, False: 3]
  ------------------
36801|      0|            goto fail;
36802|      3|    }
36803|       |
36804|      3|    if (js_parse_directives(s))
  ------------------
  |  Branch (36804:9): [True: 0, False: 3]
  ------------------
36805|      0|        goto fail;
36806|       |
36807|       |    /* in strict_mode, check function and argument names */
36808|      3|    if (js_parse_function_check_names(s, fd, func_name))
  ------------------
  |  Branch (36808:9): [True: 0, False: 3]
  ------------------
36809|      0|        goto fail;
36810|       |
36811|      8|    while (s->token.val != '}') {
  ------------------
  |  Branch (36811:12): [True: 7, False: 1]
  ------------------
36812|      7|        if (js_parse_source_element(s))
  ------------------
  |  Branch (36812:13): [True: 2, False: 5]
  ------------------
36813|      2|            goto fail;
36814|      7|    }
36815|      1|    if (!fd->strip_source) {
  ------------------
  |  Branch (36815:9): [True: 1, False: 0]
  ------------------
36816|       |        /* save the function source code */
36817|      1|        fd->source_len = s->buf_ptr - ptr;
36818|      1|        fd->source = js_strndup(ctx, (const char *)ptr, fd->source_len);
36819|      1|        if (!fd->source)
  ------------------
  |  Branch (36819:13): [True: 0, False: 1]
  ------------------
36820|      0|            goto fail;
36821|      1|    }
36822|       |
36823|      1|    if (next_token(s)) {
  ------------------
  |  Branch (36823:9): [True: 0, False: 1]
  ------------------
36824|       |        /* consume the '}' */
36825|      0|        goto fail;
36826|      0|    }
36827|       |
36828|       |    /* in case there is no return, add one */
36829|      1|    if (js_is_live_code(s)) {
  ------------------
  |  Branch (36829:9): [True: 1, False: 0]
  ------------------
36830|      1|        emit_return(s, FALSE);
36831|      1|    }
36832|      3| done:
36833|      3|    s->cur_func = fd->parent;
36834|       |
36835|       |    /* Reparse identifiers after the function is terminated so that
36836|       |       the token is parsed in the englobing function. It could be done
36837|       |       by just using next_token() here for normal functions, but it is
36838|       |       necessary for arrow functions with an expression body. */
36839|      3|    reparse_ident_token(s);
36840|       |
36841|       |    /* create the function object */
36842|      3|    {
36843|      3|        int idx;
36844|      3|        JSAtom func_name = fd->func_name;
36845|       |
36846|       |        /* the real object will be set at the end of the compilation */
36847|      3|        idx = cpool_add(s, JS_NULL);
  ------------------
  |  |  290|      3|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      3|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
36848|      3|        fd->parent_cpool_idx = idx;
36849|       |
36850|      3|        if (is_expr) {
  ------------------
  |  Branch (36850:13): [True: 2, False: 1]
  ------------------
36851|       |            /* for constructors, no code needs to be generated here */
36852|      2|            if (func_type != JS_PARSE_FUNC_CLASS_CONSTRUCTOR &&
  ------------------
  |  Branch (36852:17): [True: 2, False: 0]
  ------------------
36853|      2|                func_type != JS_PARSE_FUNC_DERIVED_CLASS_CONSTRUCTOR) {
  ------------------
  |  Branch (36853:17): [True: 2, False: 0]
  ------------------
36854|       |                /* OP_fclosure creates the function object from the bytecode
36855|       |                   and adds the scope information */
36856|      2|                emit_op(s, OP_fclosure);
36857|      2|                emit_u32(s, idx);
36858|      2|                if (func_name == JS_ATOM_NULL) {
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (36858:21): [True: 2, False: 0]
  ------------------
36859|      2|                    emit_op(s, OP_set_name);
36860|      2|                    emit_u32(s, JS_ATOM_NULL);
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
36861|      2|                }
36862|      2|            }
36863|      2|        } else if (func_type == JS_PARSE_FUNC_VAR) {
  ------------------
  |  Branch (36863:20): [True: 0, False: 1]
  ------------------
36864|      0|            emit_op(s, OP_fclosure);
36865|      0|            emit_u32(s, idx);
36866|      0|            if (create_func_var) {
  ------------------
  |  Branch (36866:17): [True: 0, False: 0]
  ------------------
36867|      0|                if (s->cur_func->is_global_var) {
  ------------------
  |  Branch (36867:21): [True: 0, False: 0]
  ------------------
36868|      0|                    JSGlobalVar *hf;
36869|       |                    /* the global variable must be defined at the start of the
36870|       |                       function */
36871|      0|                    hf = add_global_var(ctx, s->cur_func, func_name);
36872|      0|                    if (!hf)
  ------------------
  |  Branch (36872:25): [True: 0, False: 0]
  ------------------
36873|      0|                        goto fail;
36874|       |                    /* it is considered as defined at the top level
36875|       |                       (needed for annex B.3.3.4 and B.3.3.5
36876|       |                       checks) */
36877|      0|                    hf->scope_level = 0;
36878|      0|                    hf->force_init = ((s->cur_func->js_mode & JS_MODE_STRICT) != 0);
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
36879|       |                    /* store directly into global var, bypass lexical scope */
36880|      0|                    emit_op(s, OP_dup);
36881|      0|                    emit_op(s, OP_scope_put_var);
36882|      0|                    emit_atom(s, func_name);
36883|      0|                    emit_u16(s, 0);
36884|      0|                } else {
36885|       |                    /* do not call define_var to bypass lexical scope check */
36886|      0|                    func_idx = find_var(ctx, s->cur_func, func_name);
36887|      0|                    if (func_idx < 0) {
  ------------------
  |  Branch (36887:25): [True: 0, False: 0]
  ------------------
36888|      0|                        func_idx = add_var(ctx, s->cur_func, func_name);
36889|      0|                        if (func_idx < 0)
  ------------------
  |  Branch (36889:29): [True: 0, False: 0]
  ------------------
36890|      0|                            goto fail;
36891|      0|                    }
36892|       |                    /* store directly into local var, bypass lexical catch scope */
36893|      0|                    emit_op(s, OP_dup);
36894|      0|                    emit_op(s, OP_scope_put_var);
36895|      0|                    emit_atom(s, func_name);
36896|      0|                    emit_u16(s, 0);
36897|      0|                }
36898|      0|            }
36899|      0|            if (lexical_func_idx >= 0) {
  ------------------
  |  Branch (36899:17): [True: 0, False: 0]
  ------------------
36900|       |                /* lexical variable will be initialized upon entering scope */
36901|      0|                s->cur_func->vars[lexical_func_idx].func_pool_idx = idx;
36902|      0|                emit_op(s, OP_drop);
36903|      0|            } else {
36904|       |                /* store function object into its lexical name */
36905|       |                /* XXX: could use OP_put_loc directly */
36906|      0|                emit_op(s, OP_scope_put_var_init);
36907|      0|                emit_atom(s, func_name);
36908|      0|                emit_u16(s, s->cur_func->scope_level);
36909|      0|            }
36910|      1|        } else {
36911|      1|            if (!s->cur_func->is_global_var) {
  ------------------
  |  Branch (36911:17): [True: 0, False: 1]
  ------------------
36912|      0|                int var_idx = define_var(s, s->cur_func, func_name, JS_VAR_DEF_VAR);
36913|       |
36914|      0|                if (var_idx < 0)
  ------------------
  |  Branch (36914:21): [True: 0, False: 0]
  ------------------
36915|      0|                    goto fail;
36916|       |                /* the variable will be assigned at the top of the function */
36917|      0|                if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16205|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (36917:21): [True: 0, False: 0]
  ------------------
36918|      0|                    s->cur_func->args[var_idx - ARGUMENT_VAR_OFFSET].func_pool_idx = idx;
  ------------------
  |  |16205|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
36919|      0|                } else {
36920|      0|                    s->cur_func->vars[var_idx].func_pool_idx = idx;
36921|      0|                }
36922|      1|            } else {
36923|      1|                JSAtom func_var_name;
36924|      1|                JSGlobalVar *hf;
36925|      1|                if (func_name == JS_ATOM_NULL)
  ------------------
  |  |  451|      1|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (36925:21): [True: 0, False: 1]
  ------------------
36926|      0|                    func_var_name = JS_ATOM__default_; /* export default */
36927|      1|                else
36928|      1|                    func_var_name = func_name;
36929|       |                /* the variable will be assigned at the top of the function */
36930|      1|                hf = add_global_var(ctx, s->cur_func, func_var_name);
36931|      1|                if (!hf)
  ------------------
  |  Branch (36931:21): [True: 0, False: 1]
  ------------------
36932|      0|                    goto fail;
36933|      1|                hf->cpool_idx = idx;
36934|      1|                if (export_flag != JS_PARSE_EXPORT_NONE) {
  ------------------
  |  Branch (36934:21): [True: 0, False: 1]
  ------------------
36935|      0|                    if (!add_export_entry(s, s->cur_func->module, func_var_name,
  ------------------
  |  Branch (36935:25): [True: 0, False: 0]
  ------------------
36936|      0|                                          export_flag == JS_PARSE_EXPORT_NAMED ? func_var_name : JS_ATOM_default, JS_EXPORT_TYPE_LOCAL))
  ------------------
  |  Branch (36936:43): [True: 0, False: 0]
  ------------------
36937|      0|                        goto fail;
36938|      0|                }
36939|      1|            }
36940|      1|        }
36941|      3|    }
36942|      3|    return 0;
36943|      2| fail:
36944|      2|    s->cur_func = fd->parent;
36945|      2|    js_free_function_def(ctx, fd);
36946|      2|    if (pfd)
  ------------------
  |  Branch (36946:9): [True: 0, False: 2]
  ------------------
36947|      0|        *pfd = NULL;
36948|      2|    return -1;
36949|      3|}
quickjs.c:find_global_var:
23950|     20|{
23951|     20|    int i;
23952|     36|    for(i = 0; i < fd->global_var_count; i++) {
  ------------------
  |  Branch (23952:16): [True: 16, False: 20]
  ------------------
23953|     16|        JSGlobalVar *hf = &fd->global_vars[i];
23954|     16|        if (hf->var_name == name)
  ------------------
  |  Branch (23954:13): [True: 0, False: 16]
  ------------------
23955|      0|            return hf;
23956|     16|    }
23957|     20|    return NULL;
23958|       |
23959|     20|}
quickjs.c:find_lexical_decl:
23972|     21|{
23973|     24|    while (scope_idx >= 0) {
  ------------------
  |  Branch (23973:12): [True: 3, False: 21]
  ------------------
23974|      3|        JSVarDef *vd = &fd->vars[scope_idx];
23975|      3|        if (vd->var_name == name &&
  ------------------
  |  Branch (23975:13): [True: 0, False: 3]
  ------------------
23976|      0|            (vd->is_lexical || (vd->var_kind == JS_VAR_CATCH &&
  ------------------
  |  Branch (23976:14): [True: 0, False: 0]
  |  Branch (23976:33): [True: 0, False: 0]
  ------------------
23977|      0|                                check_catch_var)))
  ------------------
  |  Branch (23977:33): [True: 0, False: 0]
  ------------------
23978|      0|            return scope_idx;
23979|      3|        scope_idx = vd->scope_next;
23980|      3|    }
23981|       |
23982|     21|    if (fd->is_eval && fd->eval_type == JS_EVAL_TYPE_GLOBAL) {
  ------------------
  |  |  332|     10|#define JS_EVAL_TYPE_GLOBAL   (0 << 0) /* global code (default) */
  ------------------
  |  Branch (23982:9): [True: 10, False: 11]
  |  Branch (23982:24): [True: 10, False: 0]
  ------------------
23983|     10|        if (find_lexical_global_var(fd, name))
  ------------------
  |  Branch (23983:13): [True: 0, False: 10]
  ------------------
23984|      0|            return GLOBAL_VAR_OFFSET;
  ------------------
  |  |16204|      0|#define GLOBAL_VAR_OFFSET 0x40000000
  ------------------
23985|     10|    }
23986|     21|    return -1;
23987|     21|}
quickjs.c:find_lexical_global_var:
23962|     10|{
23963|     10|    JSGlobalVar *hf = find_global_var(fd, name);
23964|     10|    if (hf && hf->is_lexical)
  ------------------
  |  Branch (23964:9): [True: 0, False: 10]
  |  Branch (23964:15): [True: 0, False: 0]
  ------------------
23965|      0|        return hf;
23966|     10|    else
23967|     10|        return NULL;
23968|     10|}
quickjs.c:find_var:
23895|    104|{
23896|    104|    int i;
23897|    169|    for(i = fd->var_count; i-- > 0;) {
  ------------------
  |  Branch (23897:28): [True: 65, False: 104]
  ------------------
23898|     65|        if (fd->vars[i].var_name == name && fd->vars[i].scope_level == 0)
  ------------------
  |  Branch (23898:13): [True: 9, False: 56]
  |  Branch (23898:45): [True: 0, False: 9]
  ------------------
23899|      0|            return i;
23900|     65|    }
23901|    104|    return find_arg(ctx, fd, name);
23902|    104|}
quickjs.c:find_arg:
23885|    104|{
23886|    104|    int i;
23887|    120|    for(i = fd->arg_count; i-- > 0;) {
  ------------------
  |  Branch (23887:28): [True: 24, False: 96]
  ------------------
23888|     24|        if (fd->args[i].var_name == name)
  ------------------
  |  Branch (23888:13): [True: 8, False: 16]
  ------------------
23889|      8|            return i | ARGUMENT_VAR_OFFSET;
  ------------------
  |  |16205|      8|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
23890|     24|    }
23891|     96|    return -1;
23892|    104|}
quickjs.c:define_var:
24188|     20|{
24189|     20|    JSContext *ctx = s->ctx;
24190|     20|    JSVarDef *vd;
24191|     20|    int idx;
24192|       |
24193|     20|    switch (var_def_type) {
24194|      0|    case JS_VAR_DEF_WITH:
  ------------------
  |  Branch (24194:5): [True: 0, False: 20]
  ------------------
24195|      0|        idx = add_scope_var(ctx, fd, name, JS_VAR_NORMAL);
24196|      0|        break;
24197|       |
24198|     18|    case JS_VAR_DEF_LET:
  ------------------
  |  Branch (24198:5): [True: 18, False: 2]
  ------------------
24199|     18|    case JS_VAR_DEF_CONST:
  ------------------
  |  Branch (24199:5): [True: 0, False: 20]
  ------------------
24200|     19|    case JS_VAR_DEF_FUNCTION_DECL:
  ------------------
  |  Branch (24200:5): [True: 1, False: 19]
  ------------------
24201|     20|    case JS_VAR_DEF_NEW_FUNCTION_DECL:
  ------------------
  |  Branch (24201:5): [True: 1, False: 19]
  ------------------
24202|     20|        idx = find_lexical_decl(ctx, fd, name, fd->scope_first, TRUE);
24203|     20|        if (idx >= 0) {
  ------------------
  |  Branch (24203:13): [True: 0, False: 20]
  ------------------
24204|      0|            if (idx < GLOBAL_VAR_OFFSET) {
  ------------------
  |  |16204|      0|#define GLOBAL_VAR_OFFSET 0x40000000
  ------------------
  |  Branch (24204:17): [True: 0, False: 0]
  ------------------
24205|      0|                if (fd->vars[idx].scope_level == fd->scope_level) {
  ------------------
  |  Branch (24205:21): [True: 0, False: 0]
  ------------------
24206|       |                    /* same scope: in non strict mode, functions
24207|       |                       can be redefined (annex B.3.3.4). */
24208|      0|                    if (!(!(fd->js_mode & JS_MODE_STRICT) &&
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (24208:27): [True: 0, False: 0]
  ------------------
24209|      0|                          var_def_type == JS_VAR_DEF_FUNCTION_DECL &&
  ------------------
  |  Branch (24209:27): [True: 0, False: 0]
  ------------------
24210|      0|                          fd->vars[idx].var_kind == JS_VAR_FUNCTION_DECL)) {
  ------------------
  |  Branch (24210:27): [True: 0, False: 0]
  ------------------
24211|      0|                        goto redef_lex_error;
24212|      0|                    }
24213|      0|                } else if (fd->vars[idx].var_kind == JS_VAR_CATCH && (fd->vars[idx].scope_level + 2) == fd->scope_level) {
  ------------------
  |  Branch (24213:28): [True: 0, False: 0]
  |  Branch (24213:70): [True: 0, False: 0]
  ------------------
24214|      0|                    goto redef_lex_error;
24215|      0|                }
24216|      0|            } else {
24217|      0|                if (fd->scope_level == fd->body_scope) {
  ------------------
  |  Branch (24217:21): [True: 0, False: 0]
  ------------------
24218|      0|                redef_lex_error:
24219|       |                    /* redefining a scoped var in the same scope: error */
24220|      0|                    return js_parse_error(s, "invalid redefinition of lexical identifier");
24221|      0|                }
24222|      0|            }
24223|      0|        }
24224|     20|        if (var_def_type != JS_VAR_DEF_FUNCTION_DECL &&
  ------------------
  |  Branch (24224:13): [True: 19, False: 1]
  ------------------
24225|     19|            var_def_type != JS_VAR_DEF_NEW_FUNCTION_DECL &&
  ------------------
  |  Branch (24225:13): [True: 18, False: 1]
  ------------------
24226|     18|            fd->scope_level == fd->body_scope &&
  ------------------
  |  Branch (24226:13): [True: 0, False: 18]
  ------------------
24227|      0|            find_arg(ctx, fd, name) >= 0) {
  ------------------
  |  Branch (24227:13): [True: 0, False: 0]
  ------------------
24228|       |            /* lexical variable redefines a parameter name */
24229|      0|            return js_parse_error(s, "invalid redefinition of parameter name");
24230|      0|        }
24231|       |
24232|     20|        if (find_var_in_child_scope(ctx, fd, name, fd->scope_level) >= 0) {
  ------------------
  |  Branch (24232:13): [True: 0, False: 20]
  ------------------
24233|      0|            return js_parse_error(s, "invalid redefinition of a variable");
24234|      0|        }
24235|       |
24236|     20|        if (fd->is_global_var) {
  ------------------
  |  Branch (24236:13): [True: 10, False: 10]
  ------------------
24237|     10|            JSGlobalVar *hf;
24238|     10|            hf = find_global_var(fd, name);
24239|     10|            if (hf && is_child_scope(ctx, fd, hf->scope_level,
  ------------------
  |  Branch (24239:17): [True: 0, False: 10]
  |  Branch (24239:23): [True: 0, False: 0]
  ------------------
24240|      0|                                     fd->scope_level)) {
24241|      0|                return js_parse_error(s, "invalid redefinition of global identifier");
24242|      0|            }
24243|     10|        }
24244|       |
24245|     20|        if (fd->is_eval &&
  ------------------
  |  Branch (24245:13): [True: 10, False: 10]
  ------------------
24246|     10|            (fd->eval_type == JS_EVAL_TYPE_GLOBAL ||
  ------------------
  |  |  332|     20|#define JS_EVAL_TYPE_GLOBAL   (0 << 0) /* global code (default) */
  ------------------
  |  Branch (24246:14): [True: 10, False: 0]
  ------------------
24247|      0|             fd->eval_type == JS_EVAL_TYPE_MODULE) &&
  ------------------
  |  |  333|      0|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (24247:14): [True: 0, False: 0]
  ------------------
24248|     10|            fd->scope_level == fd->body_scope) {
  ------------------
  |  Branch (24248:13): [True: 0, False: 10]
  ------------------
24249|      0|            JSGlobalVar *hf;
24250|      0|            hf = add_global_var(s->ctx, fd, name);
24251|      0|            if (!hf)
  ------------------
  |  Branch (24251:17): [True: 0, False: 0]
  ------------------
24252|      0|                return -1;
24253|      0|            hf->is_lexical = TRUE;
24254|      0|            hf->is_const = (var_def_type == JS_VAR_DEF_CONST);
24255|      0|            idx = GLOBAL_VAR_OFFSET;
  ------------------
  |  |16204|      0|#define GLOBAL_VAR_OFFSET 0x40000000
  ------------------
24256|     20|        } else {
24257|     20|            JSVarKindEnum var_kind;
24258|     20|            if (var_def_type == JS_VAR_DEF_FUNCTION_DECL)
  ------------------
  |  Branch (24258:17): [True: 1, False: 19]
  ------------------
24259|      1|                var_kind = JS_VAR_FUNCTION_DECL;
24260|     19|            else if (var_def_type == JS_VAR_DEF_NEW_FUNCTION_DECL)
  ------------------
  |  Branch (24260:22): [True: 1, False: 18]
  ------------------
24261|      1|                var_kind = JS_VAR_NEW_FUNCTION_DECL;
24262|     18|            else
24263|     18|                var_kind = JS_VAR_NORMAL;
24264|     20|            idx = add_scope_var(ctx, fd, name, var_kind);
24265|     20|            if (idx >= 0) {
  ------------------
  |  Branch (24265:17): [True: 20, False: 0]
  ------------------
24266|     20|                vd = &fd->vars[idx];
24267|     20|                vd->is_lexical = 1;
24268|     20|                vd->is_const = (var_def_type == JS_VAR_DEF_CONST);
24269|     20|            }
24270|     20|        }
24271|     20|        break;
24272|       |
24273|     20|    case JS_VAR_DEF_CATCH:
  ------------------
  |  Branch (24273:5): [True: 0, False: 20]
  ------------------
24274|      0|        idx = add_scope_var(ctx, fd, name, JS_VAR_CATCH);
24275|      0|        break;
24276|       |
24277|      0|    case JS_VAR_DEF_VAR:
  ------------------
  |  Branch (24277:5): [True: 0, False: 20]
  ------------------
24278|      0|        if (find_lexical_decl(ctx, fd, name, fd->scope_first,
  ------------------
  |  Branch (24278:13): [True: 0, False: 0]
  ------------------
24279|      0|                              FALSE) >= 0) {
24280|      0|       invalid_lexical_redefinition:
24281|       |            /* error to redefine a var that inside a lexical scope */
24282|      0|            return js_parse_error(s, "invalid redefinition of lexical identifier");
24283|      0|        }
24284|      0|        if (fd->is_global_var) {
  ------------------
  |  Branch (24284:13): [True: 0, False: 0]
  ------------------
24285|      0|            JSGlobalVar *hf;
24286|      0|            hf = find_global_var(fd, name);
24287|      0|            if (hf && hf->is_lexical && hf->scope_level == fd->scope_level &&
  ------------------
  |  Branch (24287:17): [True: 0, False: 0]
  |  Branch (24287:23): [True: 0, False: 0]
  |  Branch (24287:41): [True: 0, False: 0]
  ------------------
24288|      0|                fd->eval_type == JS_EVAL_TYPE_MODULE) {
  ------------------
  |  |  333|      0|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (24288:17): [True: 0, False: 0]
  ------------------
24289|      0|                goto invalid_lexical_redefinition;
24290|      0|            }
24291|      0|            hf = add_global_var(s->ctx, fd, name);
24292|      0|            if (!hf)
  ------------------
  |  Branch (24292:17): [True: 0, False: 0]
  ------------------
24293|      0|                return -1;
24294|      0|            idx = GLOBAL_VAR_OFFSET;
  ------------------
  |  |16204|      0|#define GLOBAL_VAR_OFFSET 0x40000000
  ------------------
24295|      0|        } else {
24296|       |            /* if the variable already exists, don't add it again  */
24297|      0|            idx = find_var(ctx, fd, name);
24298|      0|            if (idx >= 0)
  ------------------
  |  Branch (24298:17): [True: 0, False: 0]
  ------------------
24299|      0|                break;
24300|      0|            idx = add_var(ctx, fd, name);
24301|      0|            if (idx >= 0) {
  ------------------
  |  Branch (24301:17): [True: 0, False: 0]
  ------------------
24302|      0|                if (name == JS_ATOM_arguments && fd->has_arguments_binding)
  ------------------
  |  Branch (24302:21): [True: 0, False: 0]
  |  Branch (24302:50): [True: 0, False: 0]
  ------------------
24303|      0|                    fd->arguments_var_idx = idx;
24304|      0|                fd->vars[idx].scope_next = fd->scope_level;
24305|      0|            }
24306|      0|        }
24307|      0|        break;
24308|      0|    default:
  ------------------
  |  Branch (24308:5): [True: 0, False: 20]
  ------------------
24309|      0|        abort();
24310|     20|    }
24311|     20|    return idx;
24312|     20|}
quickjs.c:add_scope_var:
24078|     20|{
24079|     20|    int idx = add_var(ctx, fd, name);
24080|     20|    if (idx >= 0) {
  ------------------
  |  Branch (24080:9): [True: 20, False: 0]
  ------------------
24081|     20|        JSVarDef *vd = &fd->vars[idx];
24082|     20|        vd->var_kind = var_kind;
24083|     20|        vd->scope_level = fd->scope_level;
24084|     20|        vd->scope_next = fd->scope_first;
24085|     20|        fd->scopes[fd->scope_level].first = idx;
24086|     20|        fd->scope_first = idx;
24087|     20|    }
24088|     20|    return idx;
24089|     20|}
quickjs.c:find_var_in_child_scope:
23935|     20|{
23936|     20|    int i;
23937|     70|    for(i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (23937:16): [True: 50, False: 20]
  ------------------
23938|     50|        JSVarDef *vd = &fd->vars[i];
23939|     50|        if (vd->var_name == name && vd->scope_level == 0) {
  ------------------
  |  Branch (23939:13): [True: 31, False: 19]
  |  Branch (23939:37): [True: 0, False: 31]
  ------------------
23940|      0|            if (is_child_scope(ctx, fd, vd->scope_next,
  ------------------
  |  Branch (23940:17): [True: 0, False: 0]
  ------------------
23941|      0|                               scope_level))
23942|      0|                return i;
23943|      0|        }
23944|     50|    }
23945|     20|    return -1;
23946|     20|}
quickjs.c:add_arg:
24138|      8|{
24139|      8|    JSVarDef *vd;
24140|       |
24141|       |    /* the local variable indexes are currently stored on 16 bits */
24142|      8|    if (fd->arg_count >= JS_MAX_LOCAL_VARS) {
  ------------------
  |  |  210|      8|#define JS_MAX_LOCAL_VARS 65534
  ------------------
  |  Branch (24142:9): [True: 0, False: 8]
  ------------------
24143|      0|        JS_ThrowInternalError(ctx, "too many arguments");
24144|      0|        return -1;
24145|      0|    }
24146|      8|    if (js_resize_array(ctx, (void **)&fd->args, sizeof(fd->args[0]),
  ------------------
  |  Branch (24146:9): [True: 0, False: 8]
  ------------------
24147|      8|                        &fd->arg_size, fd->arg_count + 1))
24148|      0|        return -1;
24149|      8|    vd = &fd->args[fd->arg_count++];
24150|      8|    memset(vd, 0, sizeof(*vd));
24151|      8|    vd->var_name = JS_DupAtom(ctx, name);
24152|      8|    vd->func_pool_idx = -1;
24153|      8|    return fd->arg_count - 1;
24154|      8|}
quickjs.c:js_parse_skip_parens_token:
24684|     24|{
24685|     24|    char state[256];
24686|     24|    size_t level = 0;
24687|     24|    JSParsePos pos;
24688|     24|    int last_tok, tok = TOK_EOF;
24689|     24|    int c, tok_len, bits = 0;
24690|     24|    const uint8_t *last_token_ptr;
24691|       |    
24692|       |    /* protect from underflow */
24693|     24|    state[level++] = 0;
24694|       |
24695|     24|    js_parse_get_pos(s, &pos);
24696|     24|    last_tok = 0;
24697|    159|    for (;;) {
24698|    159|        switch(s->token.val) {
  ------------------
  |  Branch (24698:16): [True: 75, False: 84]
  ------------------
24699|     22|        case '(':
  ------------------
  |  Branch (24699:9): [True: 22, False: 137]
  ------------------
24700|     22|        case '[':
  ------------------
  |  Branch (24700:9): [True: 0, False: 159]
  ------------------
24701|     28|        case '{':
  ------------------
  |  Branch (24701:9): [True: 6, False: 153]
  ------------------
24702|     28|            if (level >= sizeof(state))
  ------------------
  |  Branch (24702:17): [True: 0, False: 28]
  ------------------
24703|      0|                goto done;
24704|     28|            state[level++] = s->token.val;
24705|     28|            break;
24706|     22|        case ')':
  ------------------
  |  Branch (24706:9): [True: 22, False: 137]
  ------------------
24707|     22|            if (state[--level] != '(')
  ------------------
  |  Branch (24707:17): [True: 0, False: 22]
  ------------------
24708|      0|                goto done;
24709|     22|            break;
24710|     22|        case ']':
  ------------------
  |  Branch (24710:9): [True: 0, False: 159]
  ------------------
24711|      0|            if (state[--level] != '[')
  ------------------
  |  Branch (24711:17): [True: 0, False: 0]
  ------------------
24712|      0|                goto done;
24713|      0|            break;
24714|      6|        case '}':
  ------------------
  |  Branch (24714:9): [True: 6, False: 153]
  ------------------
24715|      6|            c = state[--level];
24716|      6|            if (c == '`') {
  ------------------
  |  Branch (24716:17): [True: 0, False: 6]
  ------------------
24717|       |                /* continue the parsing of the template */
24718|      0|                free_token(s, &s->token);
24719|       |                /* Resume TOK_TEMPLATE parsing (s->token.line_num and
24720|       |                 * s->token.ptr are OK) */
24721|      0|                s->got_lf = FALSE;
24722|      0|                if (js_parse_template_part(s, s->buf_ptr))
  ------------------
  |  Branch (24722:21): [True: 0, False: 0]
  ------------------
24723|      0|                    goto done;
24724|      0|                goto handle_template;
24725|      6|            } else if (c != '{') {
  ------------------
  |  Branch (24725:24): [True: 0, False: 6]
  ------------------
24726|      0|                goto done;
24727|      0|            }
24728|      6|            break;
24729|     15|        case TOK_TEMPLATE:
  ------------------
  |  Branch (24729:9): [True: 15, False: 144]
  ------------------
24730|     15|        handle_template:
24731|     15|            if (s->token.u.str.sep != '`') {
  ------------------
  |  Branch (24731:17): [True: 0, False: 15]
  ------------------
24732|       |                /* '${' inside the template : closing '}' and continue
24733|       |                   parsing the template */
24734|      0|                if (level >= sizeof(state))
  ------------------
  |  Branch (24734:21): [True: 0, False: 0]
  ------------------
24735|      0|                    goto done;
24736|      0|                state[level++] = '`';
24737|      0|            }
24738|     15|            break;
24739|     15|        case TOK_EOF:
  ------------------
  |  Branch (24739:9): [True: 0, False: 159]
  ------------------
24740|      0|            goto done;
24741|      0|        case ';':
  ------------------
  |  Branch (24741:9): [True: 0, False: 159]
  ------------------
24742|      0|            if (level == 2) {
  ------------------
  |  Branch (24742:17): [True: 0, False: 0]
  ------------------
24743|      0|                bits |= SKIP_HAS_SEMI;
  ------------------
  |  |24665|      0|#define SKIP_HAS_SEMI       (1 << 0)
  ------------------
24744|      0|            }
24745|      0|            break;
24746|      0|        case TOK_ELLIPSIS:
  ------------------
  |  Branch (24746:9): [True: 0, False: 159]
  ------------------
24747|      0|            if (level == 2) {
  ------------------
  |  Branch (24747:17): [True: 0, False: 0]
  ------------------
24748|      0|                bits |= SKIP_HAS_ELLIPSIS;
  ------------------
  |  |24666|      0|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
24749|      0|            }
24750|      0|            break;
24751|      4|        case '=':
  ------------------
  |  Branch (24751:9): [True: 4, False: 155]
  ------------------
24752|      4|            bits |= SKIP_HAS_ASSIGNMENT;
  ------------------
  |  |24667|      4|#define SKIP_HAS_ASSIGNMENT (1 << 2)
  ------------------
24753|      4|            break;
24754|       |
24755|      0|        case TOK_DIV_ASSIGN:
  ------------------
  |  Branch (24755:9): [True: 0, False: 159]
  ------------------
24756|      0|            tok_len = 2;
24757|      0|            goto parse_regexp;
24758|      0|        case '/':
  ------------------
  |  Branch (24758:9): [True: 0, False: 159]
  ------------------
24759|      0|            tok_len = 1;
24760|      0|        parse_regexp:
24761|      0|            if (is_regexp_allowed(last_tok)) {
  ------------------
  |  Branch (24761:17): [True: 0, False: 0]
  ------------------
24762|      0|                s->buf_ptr -= tok_len;
24763|      0|                if (js_parse_regexp(s)) {
  ------------------
  |  Branch (24763:21): [True: 0, False: 0]
  ------------------
24764|       |                    /* XXX: should clear the exception */
24765|      0|                    goto done;
24766|      0|                }
24767|      0|            }
24768|      0|            break;
24769|    159|        }
24770|       |        /* last_tok is only used to recognize regexps */
24771|    159|        if (s->token.val == TOK_IDENT &&
  ------------------
  |  Branch (24771:13): [True: 50, False: 109]
  ------------------
24772|     50|            (token_is_pseudo_keyword(s, JS_ATOM_of) ||
  ------------------
  |  Branch (24772:14): [True: 1, False: 49]
  ------------------
24773|     49|             token_is_pseudo_keyword(s, JS_ATOM_yield))) {
  ------------------
  |  Branch (24773:14): [True: 0, False: 49]
  ------------------
24774|      1|            last_tok = TOK_OF;
24775|    158|        } else {
24776|    158|            last_tok = s->token.val;
24777|    158|        }
24778|    159|        last_token_ptr = s->token.ptr;
24779|    159|        if (next_token(s)) {
  ------------------
  |  Branch (24779:13): [True: 0, False: 159]
  ------------------
24780|       |            /* XXX: should clear the exception generated by next_token() */
24781|      0|            break;
24782|      0|        }
24783|    159|        if (level <= 1) {
  ------------------
  |  Branch (24783:13): [True: 24, False: 135]
  ------------------
24784|     24|            tok = s->token.val;
24785|     24|            if (token_is_pseudo_keyword(s, JS_ATOM_of))
  ------------------
  |  Branch (24785:17): [True: 0, False: 24]
  ------------------
24786|      0|                tok = TOK_OF;
24787|     24|            if (no_line_terminator && has_lf_in_range(last_token_ptr, s->token.ptr))
  ------------------
  |  Branch (24787:17): [True: 2, False: 22]
  |  Branch (24787:39): [True: 0, False: 2]
  ------------------
24788|      0|                tok = '\n';
24789|     24|            break;
24790|     24|        }
24791|    159|    }
24792|     24| done:
24793|     24|    if (pbits) {
  ------------------
  |  Branch (24793:9): [True: 22, False: 2]
  ------------------
24794|     22|        *pbits = bits;
24795|     22|    }
24796|     24|    if (js_parse_seek_token(s, &pos))
  ------------------
  |  Branch (24796:9): [True: 0, False: 24]
  ------------------
24797|      0|        return -1;
24798|     24|    return tok;
24799|     24|}
quickjs.c:js_parse_regexp:
22487|      1|{
22488|      1|    const uint8_t *p;
22489|      1|    BOOL in_class;
22490|      1|    StringBuffer b_s, *b = &b_s;
22491|      1|    StringBuffer b2_s, *b2 = &b2_s;
22492|      1|    uint32_t c;
22493|      1|    JSValue body_str, flags_str;
22494|       |
22495|      1|    p = s->buf_ptr;
22496|      1|    p++;
22497|      1|    in_class = FALSE;
22498|      1|    if (string_buffer_init(s->ctx, b, 32))
  ------------------
  |  Branch (22498:9): [True: 0, False: 1]
  ------------------
22499|      0|        return -1;
22500|      1|    if (string_buffer_init(s->ctx, b2, 1))
  ------------------
  |  Branch (22500:9): [True: 0, False: 1]
  ------------------
22501|      0|        goto fail;
22502|      3|    for(;;) {
22503|      3|        if (p >= s->buf_end) {
  ------------------
  |  Branch (22503:13): [True: 0, False: 3]
  ------------------
22504|      0|        eof_error:
22505|      0|            js_parse_error(s, "unexpected end of regexp");
22506|      0|            goto fail;
22507|      0|        }
22508|      3|        c = *p++;
22509|      3|        if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (22509:13): [True: 0, False: 3]
  |  Branch (22509:26): [True: 0, False: 3]
  ------------------
22510|      0|            goto eol_error;
22511|      3|        } else if (c == '/') {
  ------------------
  |  Branch (22511:20): [True: 1, False: 2]
  ------------------
22512|      1|            if (!in_class)
  ------------------
  |  Branch (22512:17): [True: 1, False: 0]
  ------------------
22513|      1|                break;
22514|      2|        } else if (c == '[') {
  ------------------
  |  Branch (22514:20): [True: 0, False: 2]
  ------------------
22515|      0|            in_class = TRUE;
22516|      2|        } else if (c == ']') {
  ------------------
  |  Branch (22516:20): [True: 0, False: 2]
  ------------------
22517|       |            /* XXX: incorrect as the first character in a class */
22518|      0|            in_class = FALSE;
22519|      2|        } else if (c == '\\') {
  ------------------
  |  Branch (22519:20): [True: 0, False: 2]
  ------------------
22520|      0|            if (string_buffer_putc8(b, c))
  ------------------
  |  Branch (22520:17): [True: 0, False: 0]
  ------------------
22521|      0|                goto fail;
22522|      0|            c = *p++;
22523|      0|            if (c == '\n' || c == '\r')
  ------------------
  |  Branch (22523:17): [True: 0, False: 0]
  |  Branch (22523:30): [True: 0, False: 0]
  ------------------
22524|      0|                goto eol_error;
22525|      0|            else if (c == '\0' && p >= s->buf_end)
  ------------------
  |  Branch (22525:22): [True: 0, False: 0]
  |  Branch (22525:35): [True: 0, False: 0]
  ------------------
22526|      0|                goto eof_error;
22527|      0|            else if (c >= 0x80) {
  ------------------
  |  Branch (22527:22): [True: 0, False: 0]
  ------------------
22528|      0|                const uint8_t *p_next;
22529|      0|                c = unicode_from_utf8(p - 1, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22530|      0|                if (c > 0x10FFFF) {
  ------------------
  |  Branch (22530:21): [True: 0, False: 0]
  ------------------
22531|      0|                    goto invalid_utf8;
22532|      0|                }
22533|      0|                p = p_next;
22534|      0|                if (c == CP_LS || c == CP_PS)
  ------------------
  |  |21772|      0|#define CP_LS   0x2028
  ------------------
                              if (c == CP_LS || c == CP_PS)
  ------------------
  |  |21773|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (22534:21): [True: 0, False: 0]
  |  Branch (22534:35): [True: 0, False: 0]
  ------------------
22535|      0|                    goto eol_error;
22536|      0|            }
22537|      2|        } else if (c >= 0x80) {
  ------------------
  |  Branch (22537:20): [True: 0, False: 2]
  ------------------
22538|      0|            const uint8_t *p_next;
22539|      0|            c = unicode_from_utf8(p - 1, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22540|      0|            if (c > 0x10FFFF) {
  ------------------
  |  Branch (22540:17): [True: 0, False: 0]
  ------------------
22541|      0|            invalid_utf8:
22542|      0|                js_parse_error_pos(s, p - 1, "invalid UTF-8 sequence");
22543|      0|                goto fail;
22544|      0|            }
22545|       |            /* LS or PS are considered as line terminator */
22546|      0|            if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21772|      0|#define CP_LS   0x2028
  ------------------
                          if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21773|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (22546:17): [True: 0, False: 0]
  |  Branch (22546:31): [True: 0, False: 0]
  ------------------
22547|      0|            eol_error:
22548|      0|                js_parse_error_pos(s, p - 1, "unexpected line terminator in regexp");
22549|      0|                goto fail;
22550|      0|            }
22551|      0|            p = p_next;
22552|      0|        }
22553|      2|        if (string_buffer_putc(b, c))
  ------------------
  |  Branch (22553:13): [True: 0, False: 2]
  ------------------
22554|      0|            goto fail;
22555|      2|    }
22556|       |
22557|       |    /* flags */
22558|      2|    for(;;) {
22559|      2|        const uint8_t *p_next = p;
22560|      2|        c = *p_next++;
22561|      2|        if (c >= 0x80) {
  ------------------
  |  Branch (22561:13): [True: 0, False: 2]
  ------------------
22562|      0|            c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22563|      0|            if (c > 0x10FFFF) {
  ------------------
  |  Branch (22563:17): [True: 0, False: 0]
  ------------------
22564|      0|                p++;
22565|      0|                goto invalid_utf8;
22566|      0|            }
22567|      0|        }
22568|      2|        if (!lre_js_is_ident_next(c))
  ------------------
  |  Branch (22568:13): [True: 1, False: 1]
  ------------------
22569|      1|            break;
22570|      1|        if (string_buffer_putc(b2, c))
  ------------------
  |  Branch (22570:13): [True: 0, False: 1]
  ------------------
22571|      0|            goto fail;
22572|      1|        p = p_next;
22573|      1|    }
22574|       |
22575|      1|    body_str = string_buffer_end(b);
22576|      1|    flags_str = string_buffer_end(b2);
22577|      1|    if (JS_IsException(body_str) ||
  ------------------
  |  Branch (22577:9): [True: 0, False: 1]
  ------------------
22578|      1|        JS_IsException(flags_str)) {
  ------------------
  |  Branch (22578:9): [True: 0, False: 1]
  ------------------
22579|      0|        JS_FreeValue(s->ctx, body_str);
22580|      0|        JS_FreeValue(s->ctx, flags_str);
22581|      0|        return -1;
22582|      0|    }
22583|      1|    s->token.val = TOK_REGEXP;
22584|      1|    s->token.u.regexp.body = body_str;
22585|      1|    s->token.u.regexp.flags = flags_str;
22586|      1|    s->buf_ptr = p;
22587|      1|    return 0;
22588|      0| fail:
22589|      0|    string_buffer_free(b);
22590|      0|    string_buffer_free(b2);
22591|      0|    return -1;
22592|      1|}
quickjs.c:has_lf_in_range:
24670|     16|{
24671|     16|    const uint8_t *tmp;
24672|     16|    if (p1 > p2) {
  ------------------
  |  Branch (24672:9): [True: 0, False: 16]
  ------------------
24673|      0|        tmp = p1;
24674|      0|        p1 = p2;
24675|      0|        p2 = tmp;
24676|      0|    }
24677|       |    return (memchr(p1, '\n', p2 - p1) != NULL);
24678|     16|}
quickjs.c:js_parse_expect:
22253|     59|{
22254|     59|    if (s->token.val != tok) {
  ------------------
  |  Branch (22254:9): [True: 0, False: 59]
  ------------------
22255|       |        /* XXX: dump token correctly in all cases */
22256|      0|        return js_parse_error(s, "expecting '%c'", tok);
22257|      0|    }
22258|     59|    return next_token(s);
22259|     59|}
quickjs.c:js_parse_destructuring_element:
26224|      2|{
26225|      2|    int label_parse, label_assign, label_done, label_lvalue, depth_lvalue;
26226|      2|    int start_addr, assign_addr;
26227|      2|    JSAtom prop_name, var_name;
26228|      2|    int opcode, scope, tok1, skip_bits;
26229|      2|    BOOL has_initializer;
26230|       |
26231|      2|    if (has_ellipsis < 0) {
  ------------------
  |  Branch (26231:9): [True: 2, False: 0]
  ------------------
26232|       |        /* pre-parse destructuration target for spread detection */
26233|      2|        js_parse_skip_parens_token(s, &skip_bits, FALSE);
26234|      2|        has_ellipsis = skip_bits & SKIP_HAS_ELLIPSIS;
  ------------------
  |  |24666|      2|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
26235|      2|    }
26236|       |
26237|      2|    label_parse = new_label(s);
26238|      2|    label_assign = new_label(s);
26239|       |
26240|      2|    start_addr = s->cur_func->byte_code.size;
26241|      2|    if (hasval) {
  ------------------
  |  Branch (26241:9): [True: 2, False: 0]
  ------------------
26242|       |        /* consume value from the stack */
26243|      2|        emit_op(s, OP_dup);
26244|      2|        emit_op(s, OP_undefined);
26245|      2|        emit_op(s, OP_strict_eq);
26246|      2|        emit_goto(s, OP_if_true, label_parse);
26247|      2|        emit_label(s, label_assign);
26248|      2|    } else {
26249|      0|        emit_goto(s, OP_goto, label_parse);
26250|      0|        emit_label(s, label_assign);
26251|       |        /* leave value on the stack */
26252|      0|        emit_op(s, OP_dup);
26253|      0|    }
26254|      2|    assign_addr = s->cur_func->byte_code.size;
26255|      2|    if (s->token.val == '{') {
  ------------------
  |  Branch (26255:9): [True: 2, False: 0]
  ------------------
26256|      2|        if (next_token(s))
  ------------------
  |  Branch (26256:13): [True: 0, False: 2]
  ------------------
26257|      0|            return -1;
26258|       |        /* throw an exception if the value cannot be converted to an object */
26259|      2|        emit_op(s, OP_to_object);
26260|      2|        if (has_ellipsis) {
  ------------------
  |  Branch (26260:13): [True: 0, False: 2]
  ------------------
26261|       |            /* add excludeList on stack just below src object */
26262|      0|            emit_op(s, OP_object);
26263|      0|            emit_op(s, OP_swap);
26264|      0|        }
26265|      2|        while (s->token.val != '}') {
  ------------------
  |  Branch (26265:16): [True: 2, False: 0]
  ------------------
26266|      2|            int prop_type;
26267|      2|            if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (26267:17): [True: 0, False: 2]
  ------------------
26268|      0|                if (!has_ellipsis) {
  ------------------
  |  Branch (26268:21): [True: 0, False: 0]
  ------------------
26269|      0|                    JS_ThrowInternalError(s->ctx, "unexpected ellipsis token");
26270|      0|                    return -1;
26271|      0|                }
26272|      0|                if (next_token(s))
  ------------------
  |  Branch (26272:21): [True: 0, False: 0]
  ------------------
26273|      0|                    return -1;
26274|      0|                if (tok) {
  ------------------
  |  Branch (26274:21): [True: 0, False: 0]
  ------------------
26275|      0|                    var_name = js_parse_destructuring_var(s, tok, is_arg);
26276|      0|                    if (var_name == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26276:25): [True: 0, False: 0]
  ------------------
26277|      0|                        return -1;
26278|      0|                    if (need_var_reference(s, tok)) {
  ------------------
  |  Branch (26278:25): [True: 0, False: 0]
  ------------------
26279|       |                        /* Must make a reference for proper `with` semantics */
26280|      0|                        emit_op(s, OP_scope_get_var);
26281|      0|                        emit_atom(s, var_name);
26282|      0|                        emit_u16(s, s->cur_func->scope_level);
26283|      0|                        JS_FreeAtom(s->ctx, var_name);
26284|      0|                        goto lvalue0;
26285|      0|                    } else {
26286|      0|                        opcode = OP_scope_get_var;
26287|      0|                        scope = s->cur_func->scope_level;
26288|      0|                        label_lvalue = -1;
26289|      0|                        depth_lvalue = 0;
26290|      0|                    }
26291|      0|                } else {
26292|      0|                    if (js_parse_left_hand_side_expr(s))
  ------------------
  |  Branch (26292:25): [True: 0, False: 0]
  ------------------
26293|      0|                        return -1;
26294|      0|                lvalue0:
26295|      0|                    if (get_lvalue(s, &opcode, &scope, &var_name,
  ------------------
  |  Branch (26295:25): [True: 0, False: 0]
  ------------------
26296|      0|                                   &label_lvalue, &depth_lvalue, FALSE, '{'))
26297|      0|                        return -1;
26298|      0|                }
26299|      0|                if (s->token.val != '}') {
  ------------------
  |  Branch (26299:21): [True: 0, False: 0]
  ------------------
26300|      0|                    js_parse_error(s, "assignment rest property must be last");
26301|      0|                    goto var_error;
26302|      0|                }
26303|      0|                emit_op(s, OP_object);  /* target */
26304|      0|                emit_op(s, OP_copy_data_properties);
26305|      0|                emit_u8(s, 0 | ((depth_lvalue + 1) << 2) | ((depth_lvalue + 2) << 5));
26306|      0|                goto set_val;
26307|      0|            }
26308|      2|            prop_type = js_parse_property_name(s, &prop_name, FALSE, TRUE, FALSE);
26309|      2|            if (prop_type < 0)
  ------------------
  |  Branch (26309:17): [True: 0, False: 2]
  ------------------
26310|      0|                return -1;
26311|      2|            var_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
26312|      2|            if (prop_type == PROP_TYPE_IDENT) {
  ------------------
  |  |24485|      2|#define PROP_TYPE_IDENT 0
  ------------------
  |  Branch (26312:17): [True: 2, False: 0]
  ------------------
26313|      2|                if (next_token(s))
  ------------------
  |  Branch (26313:21): [True: 0, False: 2]
  ------------------
26314|      0|                    goto prop_error;
26315|      2|                if ((s->token.val == '[' || s->token.val == '{')
  ------------------
  |  Branch (26315:22): [True: 0, False: 2]
  |  Branch (26315:45): [True: 0, False: 2]
  ------------------
26316|      0|                    &&  ((tok1 = js_parse_skip_parens_token(s, &skip_bits, FALSE)) == ',' ||
  ------------------
  |  Branch (26316:26): [True: 0, False: 0]
  ------------------
26317|      0|                         tok1 == '=' || tok1 == '}')) {
  ------------------
  |  Branch (26317:26): [True: 0, False: 0]
  |  Branch (26317:41): [True: 0, False: 0]
  ------------------
26318|      0|                    if (prop_name == JS_ATOM_NULL) {
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26318:25): [True: 0, False: 0]
  ------------------
26319|       |                        /* computed property name on stack */
26320|      0|                        if (has_ellipsis) {
  ------------------
  |  Branch (26320:29): [True: 0, False: 0]
  ------------------
26321|       |                            /* define the property in excludeList */
26322|      0|                            emit_op(s, OP_to_propkey); /* avoid calling ToString twice */
26323|      0|                            emit_op(s, OP_perm3); /* TOS: src excludeList prop */
26324|      0|                            emit_op(s, OP_null); /* TOS: src excludeList prop null */
26325|      0|                            emit_op(s, OP_define_array_el); /* TOS: src excludeList prop */
26326|      0|                            emit_op(s, OP_perm3); /* TOS: excludeList src prop */
26327|      0|                        }
26328|       |                        /* get the computed property from the source object */
26329|      0|                        emit_op(s, OP_get_array_el2);
26330|      0|                    } else {
26331|       |                        /* named property */
26332|      0|                        if (has_ellipsis) {
  ------------------
  |  Branch (26332:29): [True: 0, False: 0]
  ------------------
26333|       |                            /* define the property in excludeList */
26334|      0|                            emit_op(s, OP_swap); /* TOS: src excludeList */
26335|      0|                            emit_op(s, OP_null); /* TOS: src excludeList null */
26336|      0|                            emit_op(s, OP_define_field); /* TOS: src excludeList */
26337|      0|                            emit_atom(s, prop_name);
26338|      0|                            emit_op(s, OP_swap); /* TOS: excludeList src */
26339|      0|                        }
26340|       |                        /* get the named property from the source object */
26341|      0|                        emit_op(s, OP_get_field2);
26342|      0|                        emit_u32(s, prop_name);
26343|      0|                    }
26344|      0|                    if (js_parse_destructuring_element(s, tok, is_arg, TRUE, -1, TRUE, export_flag) < 0)
  ------------------
  |  Branch (26344:25): [True: 0, False: 0]
  ------------------
26345|      0|                        return -1;
26346|      0|                    if (s->token.val == '}')
  ------------------
  |  Branch (26346:25): [True: 0, False: 0]
  ------------------
26347|      0|                        break;
26348|       |                    /* accept a trailing comma before the '}' */
26349|      0|                    if (js_parse_expect(s, ','))
  ------------------
  |  Branch (26349:25): [True: 0, False: 0]
  ------------------
26350|      0|                        return -1;
26351|      0|                    continue;
26352|      0|                }
26353|      2|                if (prop_name == JS_ATOM_NULL) {
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26353:21): [True: 0, False: 2]
  ------------------
26354|      0|                    emit_op(s, OP_to_propkey);
26355|      0|                    if (has_ellipsis) {
  ------------------
  |  Branch (26355:25): [True: 0, False: 0]
  ------------------
26356|       |                        /* define the property in excludeList */
26357|      0|                        emit_op(s, OP_perm3);
26358|      0|                        emit_op(s, OP_null);
26359|      0|                        emit_op(s, OP_define_array_el);
26360|      0|                        emit_op(s, OP_perm3);
26361|      0|                    }
26362|       |                    /* source prop -- source source prop */
26363|      0|                    emit_op(s, OP_dup1);
26364|      2|                } else {
26365|      2|                    if (has_ellipsis) {
  ------------------
  |  Branch (26365:25): [True: 0, False: 2]
  ------------------
26366|       |                        /* define the property in excludeList */
26367|      0|                        emit_op(s, OP_swap);
26368|      0|                        emit_op(s, OP_null);
26369|      0|                        emit_op(s, OP_define_field);
26370|      0|                        emit_atom(s, prop_name);
26371|      0|                        emit_op(s, OP_swap);
26372|      0|                    }
26373|       |                    /* source -- source source */
26374|      2|                    emit_op(s, OP_dup);
26375|      2|                }
26376|      2|                if (tok) {
  ------------------
  |  Branch (26376:21): [True: 2, False: 0]
  ------------------
26377|      2|                    var_name = js_parse_destructuring_var(s, tok, is_arg);
26378|      2|                    if (var_name == JS_ATOM_NULL)
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26378:25): [True: 0, False: 2]
  ------------------
26379|      0|                        goto prop_error;
26380|      2|                    if (need_var_reference(s, tok)) {
  ------------------
  |  Branch (26380:25): [True: 0, False: 2]
  ------------------
26381|       |                        /* Must make a reference for proper `with` semantics */
26382|      0|                        emit_op(s, OP_scope_get_var);
26383|      0|                        emit_atom(s, var_name);
26384|      0|                        emit_u16(s, s->cur_func->scope_level);
26385|      0|                        JS_FreeAtom(s->ctx, var_name);
26386|      0|                        goto lvalue1;
26387|      2|                    } else {
26388|       |                        /* no need to make a reference for let/const */
26389|      2|                        opcode = OP_scope_get_var;
26390|      2|                        scope = s->cur_func->scope_level;
26391|      2|                        label_lvalue = -1;
26392|      2|                        depth_lvalue = 0;
26393|      2|                    }
26394|      2|                } else {
26395|      0|                    if (js_parse_left_hand_side_expr(s))
  ------------------
  |  Branch (26395:25): [True: 0, False: 0]
  ------------------
26396|      0|                        goto prop_error;
26397|      0|                lvalue1:
26398|      0|                    if (get_lvalue(s, &opcode, &scope, &var_name,
  ------------------
  |  Branch (26398:25): [True: 0, False: 0]
  ------------------
26399|      0|                                   &label_lvalue, &depth_lvalue, FALSE, '{'))
26400|      0|                        goto prop_error;
26401|       |                    /* swap ref and lvalue object if any */
26402|      0|                    if (prop_name == JS_ATOM_NULL) {
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26402:25): [True: 0, False: 0]
  ------------------
26403|      0|                        switch(depth_lvalue) {
26404|      0|                        case 0:
  ------------------
  |  Branch (26404:25): [True: 0, False: 0]
  ------------------
26405|      0|                            break;
26406|      0|                        case 1:
  ------------------
  |  Branch (26406:25): [True: 0, False: 0]
  ------------------
26407|       |                            /* source prop x -> x source prop */
26408|      0|                            emit_op(s, OP_rot3r);
26409|      0|                            break;
26410|      0|                        case 2:
  ------------------
  |  Branch (26410:25): [True: 0, False: 0]
  ------------------
26411|       |                            /* source prop x y -> x y source prop */
26412|      0|                            emit_op(s, OP_swap2);   /* t p2 s p1 */
26413|      0|                            break;
26414|      0|                        case 3:
  ------------------
  |  Branch (26414:25): [True: 0, False: 0]
  ------------------
26415|       |                            /* source prop x y z -> x y z source prop */
26416|      0|                            emit_op(s, OP_rot5l);
26417|      0|                            emit_op(s, OP_rot5l);
26418|      0|                            break;
26419|      0|                        default:
  ------------------
  |  Branch (26419:25): [True: 0, False: 0]
  ------------------
26420|      0|                            abort();
26421|      0|                        }
26422|      0|                    } else {
26423|      0|                        switch(depth_lvalue) {
26424|      0|                        case 0:
  ------------------
  |  Branch (26424:25): [True: 0, False: 0]
  ------------------
26425|      0|                            break;
26426|      0|                        case 1:
  ------------------
  |  Branch (26426:25): [True: 0, False: 0]
  ------------------
26427|       |                            /* source x -> x source */
26428|      0|                            emit_op(s, OP_swap);
26429|      0|                            break;
26430|      0|                        case 2:
  ------------------
  |  Branch (26430:25): [True: 0, False: 0]
  ------------------
26431|       |                            /* source x y -> x y source */
26432|      0|                            emit_op(s, OP_rot3l);
26433|      0|                            break;
26434|      0|                        case 3:
  ------------------
  |  Branch (26434:25): [True: 0, False: 0]
  ------------------
26435|       |                            /* source x y z -> x y z source */
26436|      0|                            emit_op(s, OP_rot4l);
26437|      0|                            break;
26438|      0|                        default:
  ------------------
  |  Branch (26438:25): [True: 0, False: 0]
  ------------------
26439|      0|                            abort();
26440|      0|                        }
26441|      0|                    }
26442|      0|                }
26443|      2|                if (prop_name == JS_ATOM_NULL) {
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26443:21): [True: 0, False: 2]
  ------------------
26444|       |                    /* computed property name on stack */
26445|       |                    /* XXX: should have OP_get_array_el2x with depth */
26446|       |                    /* source prop -- val */
26447|      0|                    emit_op(s, OP_get_array_el);
26448|      2|                } else {
26449|       |                    /* named property */
26450|       |                    /* XXX: should have OP_get_field2x with depth */
26451|       |                    /* source -- val */
26452|      2|                    emit_op(s, OP_get_field);
26453|      2|                    emit_u32(s, prop_name);
26454|      2|                }
26455|      2|            } else {
26456|       |                /* prop_type = PROP_TYPE_VAR, cannot be a computed property */
26457|      0|                if (is_arg && js_parse_check_duplicate_parameter(s, prop_name))
  ------------------
  |  Branch (26457:21): [True: 0, False: 0]
  |  Branch (26457:31): [True: 0, False: 0]
  ------------------
26458|      0|                    goto prop_error;
26459|      0|                if ((s->cur_func->js_mode & JS_MODE_STRICT) &&
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (26459:21): [True: 0, False: 0]
  ------------------
26460|      0|                    (prop_name == JS_ATOM_eval || prop_name == JS_ATOM_arguments)) {
  ------------------
  |  Branch (26460:22): [True: 0, False: 0]
  |  Branch (26460:51): [True: 0, False: 0]
  ------------------
26461|      0|                    js_parse_error(s, "invalid destructuring target");
26462|      0|                    goto prop_error;
26463|      0|                }
26464|      0|                if (has_ellipsis) {
  ------------------
  |  Branch (26464:21): [True: 0, False: 0]
  ------------------
26465|       |                    /* define the property in excludeList */
26466|      0|                    emit_op(s, OP_swap);
26467|      0|                    emit_op(s, OP_null);
26468|      0|                    emit_op(s, OP_define_field);
26469|      0|                    emit_atom(s, prop_name);
26470|      0|                    emit_op(s, OP_swap);
26471|      0|                }
26472|      0|                if (!tok || need_var_reference(s, tok)) {
  ------------------
  |  Branch (26472:21): [True: 0, False: 0]
  |  Branch (26472:29): [True: 0, False: 0]
  ------------------
26473|       |                    /* generate reference */
26474|       |                    /* source -- source source */
26475|      0|                    emit_op(s, OP_dup);
26476|      0|                    emit_op(s, OP_scope_get_var);
26477|      0|                    emit_atom(s, prop_name);
26478|      0|                    emit_u16(s, s->cur_func->scope_level);
26479|      0|                    goto lvalue1;
26480|      0|                } else {
26481|       |                    /* no need to make a reference for let/const */
26482|      0|                    var_name = JS_DupAtom(s->ctx, prop_name);
26483|      0|                    opcode = OP_scope_get_var;
26484|      0|                    scope = s->cur_func->scope_level;
26485|      0|                    label_lvalue = -1;
26486|      0|                    depth_lvalue = 0;
26487|       |                    
26488|       |                    /* source -- source val */
26489|      0|                    emit_op(s, OP_get_field2);
26490|      0|                    emit_u32(s, prop_name);
26491|      0|                }
26492|      0|            }
26493|      2|        set_val:
26494|      2|            if (tok) {
  ------------------
  |  Branch (26494:17): [True: 2, False: 0]
  ------------------
26495|      2|                if (js_define_var(s, var_name, tok))
  ------------------
  |  Branch (26495:21): [True: 0, False: 2]
  ------------------
26496|      0|                    goto var_error;
26497|      2|                if (export_flag) {
  ------------------
  |  Branch (26497:21): [True: 0, False: 2]
  ------------------
26498|      0|                    if (!add_export_entry(s, s->cur_func->module, var_name, var_name,
  ------------------
  |  Branch (26498:25): [True: 0, False: 0]
  ------------------
26499|      0|                                          JS_EXPORT_TYPE_LOCAL))
26500|      0|                        goto var_error;
26501|      0|                }
26502|      2|                scope = s->cur_func->scope_level; /* XXX: check */
26503|      2|            }
26504|      2|            if (s->token.val == '=') {  /* handle optional default value */
  ------------------
  |  Branch (26504:17): [True: 0, False: 2]
  ------------------
26505|      0|                int label_hasval;
26506|      0|                emit_op(s, OP_dup);
26507|      0|                emit_op(s, OP_undefined);
26508|      0|                emit_op(s, OP_strict_eq);
26509|      0|                label_hasval = emit_goto(s, OP_if_false, -1);
26510|      0|                if (next_token(s))
  ------------------
  |  Branch (26510:21): [True: 0, False: 0]
  ------------------
26511|      0|                    goto var_error;
26512|      0|                emit_op(s, OP_drop);
26513|      0|                if (js_parse_assign_expr(s))
  ------------------
  |  Branch (26513:21): [True: 0, False: 0]
  ------------------
26514|      0|                    goto var_error;
26515|      0|                if (opcode == OP_scope_get_var || opcode == OP_get_ref_value)
  ------------------
  |  Branch (26515:21): [True: 0, False: 0]
  |  Branch (26515:51): [True: 0, False: 0]
  ------------------
26516|      0|                    set_object_name(s, var_name);
26517|      0|                emit_label(s, label_hasval);
26518|      0|            }
26519|       |            /* store value into lvalue object */
26520|      2|            put_lvalue(s, opcode, scope, var_name, label_lvalue,
26521|      2|                       PUT_LVALUE_NOKEEP_DEPTH,
26522|      2|                       (tok == TOK_CONST || tok == TOK_LET));
  ------------------
  |  Branch (26522:25): [True: 0, False: 2]
  |  Branch (26522:45): [True: 2, False: 0]
  ------------------
26523|      2|            if (s->token.val == '}')
  ------------------
  |  Branch (26523:17): [True: 2, False: 0]
  ------------------
26524|      2|                break;
26525|       |            /* accept a trailing comma before the '}' */
26526|      0|            if (js_parse_expect(s, ','))
  ------------------
  |  Branch (26526:17): [True: 0, False: 0]
  ------------------
26527|      0|                return -1;
26528|      0|        }
26529|       |        /* drop the source object */
26530|      2|        emit_op(s, OP_drop);
26531|      2|        if (has_ellipsis) {
  ------------------
  |  Branch (26531:13): [True: 0, False: 2]
  ------------------
26532|      0|            emit_op(s, OP_drop); /* pop excludeList */
26533|      0|        }
26534|      2|        if (next_token(s))
  ------------------
  |  Branch (26534:13): [True: 0, False: 2]
  ------------------
26535|      0|            return -1;
26536|      2|    } else if (s->token.val == '[') {
  ------------------
  |  Branch (26536:16): [True: 0, False: 0]
  ------------------
26537|      0|        BOOL has_spread;
26538|      0|        int enum_depth;
26539|      0|        BlockEnv block_env;
26540|       |
26541|      0|        if (next_token(s))
  ------------------
  |  Branch (26541:13): [True: 0, False: 0]
  ------------------
26542|      0|            return -1;
26543|       |        /* the block environment is only needed in generators in case
26544|       |           'yield' triggers a 'return' */
26545|      0|        push_break_entry(s->cur_func, &block_env,
26546|      0|                         JS_ATOM_NULL, -1, -1, 2);
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
26547|      0|        block_env.has_iterator = TRUE;
26548|      0|        emit_op(s, OP_for_of_start);
26549|      0|        has_spread = FALSE;
26550|      0|        while (s->token.val != ']') {
  ------------------
  |  Branch (26550:16): [True: 0, False: 0]
  ------------------
26551|       |            /* get the next value */
26552|      0|            if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (26552:17): [True: 0, False: 0]
  ------------------
26553|      0|                if (next_token(s))
  ------------------
  |  Branch (26553:21): [True: 0, False: 0]
  ------------------
26554|      0|                    return -1;
26555|      0|                if (s->token.val == ',' || s->token.val == ']')
  ------------------
  |  Branch (26555:21): [True: 0, False: 0]
  |  Branch (26555:44): [True: 0, False: 0]
  ------------------
26556|      0|                    return js_parse_error(s, "missing binding pattern...");
26557|      0|                has_spread = TRUE;
26558|      0|            }
26559|      0|            if (s->token.val == ',') {
  ------------------
  |  Branch (26559:17): [True: 0, False: 0]
  ------------------
26560|       |                /* do nothing, skip the value, has_spread is false */
26561|      0|                emit_op(s, OP_for_of_next);
26562|      0|                emit_u8(s, 0);
26563|      0|                emit_op(s, OP_drop);
26564|      0|                emit_op(s, OP_drop);
26565|      0|            } else if ((s->token.val == '[' || s->token.val == '{')
  ------------------
  |  Branch (26565:25): [True: 0, False: 0]
  |  Branch (26565:48): [True: 0, False: 0]
  ------------------
26566|      0|                   &&  ((tok1 = js_parse_skip_parens_token(s, &skip_bits, FALSE)) == ',' ||
  ------------------
  |  Branch (26566:25): [True: 0, False: 0]
  ------------------
26567|      0|                        tok1 == '=' || tok1 == ']')) {
  ------------------
  |  Branch (26567:25): [True: 0, False: 0]
  |  Branch (26567:40): [True: 0, False: 0]
  ------------------
26568|      0|                if (has_spread) {
  ------------------
  |  Branch (26568:21): [True: 0, False: 0]
  ------------------
26569|      0|                    if (tok1 == '=')
  ------------------
  |  Branch (26569:25): [True: 0, False: 0]
  ------------------
26570|      0|                        return js_parse_error(s, "rest element cannot have a default value");
26571|      0|                    js_emit_spread_code(s, 0);
26572|      0|                } else {
26573|      0|                    emit_op(s, OP_for_of_next);
26574|      0|                    emit_u8(s, 0);
26575|      0|                    emit_op(s, OP_drop);
26576|      0|                }
26577|      0|                if (js_parse_destructuring_element(s, tok, is_arg, TRUE, skip_bits & SKIP_HAS_ELLIPSIS, TRUE, export_flag) < 0)
  ------------------
  |  |24666|      0|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
  |  Branch (26577:21): [True: 0, False: 0]
  ------------------
26578|      0|                    return -1;
26579|      0|            } else {
26580|      0|                var_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
26581|      0|                if (tok) {
  ------------------
  |  Branch (26581:21): [True: 0, False: 0]
  ------------------
26582|      0|                    var_name = js_parse_destructuring_var(s, tok, is_arg);
26583|      0|                    if (var_name == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26583:25): [True: 0, False: 0]
  ------------------
26584|      0|                        goto var_error;
26585|      0|                    if (js_define_var(s, var_name, tok))
  ------------------
  |  Branch (26585:25): [True: 0, False: 0]
  ------------------
26586|      0|                        goto var_error;
26587|      0|                    if (need_var_reference(s, tok)) {
  ------------------
  |  Branch (26587:25): [True: 0, False: 0]
  ------------------
26588|       |                        /* Must make a reference for proper `with` semantics */
26589|      0|                        emit_op(s, OP_scope_get_var);
26590|      0|                        emit_atom(s, var_name);
26591|      0|                        emit_u16(s, s->cur_func->scope_level);
26592|      0|                        JS_FreeAtom(s->ctx, var_name);
26593|      0|                        goto lvalue2;
26594|      0|                    } else {
26595|       |                        /* no need to make a reference for let/const */
26596|      0|                        opcode = OP_scope_get_var;
26597|      0|                        scope = s->cur_func->scope_level;
26598|      0|                        label_lvalue = -1;
26599|      0|                        enum_depth = 0;
26600|      0|                    }
26601|      0|                } else {
26602|      0|                    if (js_parse_left_hand_side_expr(s))
  ------------------
  |  Branch (26602:25): [True: 0, False: 0]
  ------------------
26603|      0|                        return -1;
26604|      0|                lvalue2:
26605|      0|                    if (get_lvalue(s, &opcode, &scope, &var_name,
  ------------------
  |  Branch (26605:25): [True: 0, False: 0]
  ------------------
26606|      0|                                   &label_lvalue, &enum_depth, FALSE, '[')) {
26607|      0|                        return -1;
26608|      0|                    }
26609|      0|                }
26610|      0|                if (has_spread) {
  ------------------
  |  Branch (26610:21): [True: 0, False: 0]
  ------------------
26611|      0|                    js_emit_spread_code(s, enum_depth);
26612|      0|                } else {
26613|      0|                    emit_op(s, OP_for_of_next);
26614|      0|                    emit_u8(s, enum_depth);
26615|      0|                    emit_op(s, OP_drop);
26616|      0|                }
26617|      0|                if (s->token.val == '=' && !has_spread) {
  ------------------
  |  Branch (26617:21): [True: 0, False: 0]
  |  Branch (26617:44): [True: 0, False: 0]
  ------------------
26618|       |                    /* handle optional default value */
26619|      0|                    int label_hasval;
26620|      0|                    emit_op(s, OP_dup);
26621|      0|                    emit_op(s, OP_undefined);
26622|      0|                    emit_op(s, OP_strict_eq);
26623|      0|                    label_hasval = emit_goto(s, OP_if_false, -1);
26624|      0|                    if (next_token(s))
  ------------------
  |  Branch (26624:25): [True: 0, False: 0]
  ------------------
26625|      0|                        goto var_error;
26626|      0|                    emit_op(s, OP_drop);
26627|      0|                    if (js_parse_assign_expr(s))
  ------------------
  |  Branch (26627:25): [True: 0, False: 0]
  ------------------
26628|      0|                        goto var_error;
26629|      0|                    if (opcode == OP_scope_get_var || opcode == OP_get_ref_value)
  ------------------
  |  Branch (26629:25): [True: 0, False: 0]
  |  Branch (26629:55): [True: 0, False: 0]
  ------------------
26630|      0|                        set_object_name(s, var_name);
26631|      0|                    emit_label(s, label_hasval);
26632|      0|                }
26633|       |                /* store value into lvalue object */
26634|      0|                put_lvalue(s, opcode, scope, var_name,
26635|      0|                           label_lvalue, PUT_LVALUE_NOKEEP_DEPTH,
26636|      0|                           (tok == TOK_CONST || tok == TOK_LET));
  ------------------
  |  Branch (26636:29): [True: 0, False: 0]
  |  Branch (26636:49): [True: 0, False: 0]
  ------------------
26637|      0|            }
26638|      0|            if (s->token.val == ']')
  ------------------
  |  Branch (26638:17): [True: 0, False: 0]
  ------------------
26639|      0|                break;
26640|      0|            if (has_spread)
  ------------------
  |  Branch (26640:17): [True: 0, False: 0]
  ------------------
26641|      0|                return js_parse_error(s, "rest element must be the last one");
26642|       |            /* accept a trailing comma before the ']' */
26643|      0|            if (js_parse_expect(s, ','))
  ------------------
  |  Branch (26643:17): [True: 0, False: 0]
  ------------------
26644|      0|                return -1;
26645|      0|        }
26646|       |        /* close iterator object:
26647|       |           if completed, enum_obj has been replaced by undefined */
26648|      0|        emit_op(s, OP_iterator_close);
26649|      0|        pop_break_entry(s->cur_func);
26650|      0|        if (next_token(s))
  ------------------
  |  Branch (26650:13): [True: 0, False: 0]
  ------------------
26651|      0|            return -1;
26652|      0|    } else {
26653|      0|        return js_parse_error(s, "invalid assignment syntax");
26654|      0|    }
26655|      2|    if (s->token.val == '=' && allow_initializer) {
  ------------------
  |  Branch (26655:9): [True: 2, False: 0]
  |  Branch (26655:32): [True: 2, False: 0]
  ------------------
26656|      2|        label_done = emit_goto(s, OP_goto, -1);
26657|      2|        if (next_token(s))
  ------------------
  |  Branch (26657:13): [True: 0, False: 2]
  ------------------
26658|      0|            return -1;
26659|      2|        emit_label(s, label_parse);
26660|      2|        if (hasval)
  ------------------
  |  Branch (26660:13): [True: 2, False: 0]
  ------------------
26661|      2|            emit_op(s, OP_drop);
26662|      2|        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (26662:13): [True: 0, False: 2]
  ------------------
26663|      0|            return -1;
26664|      2|        emit_goto(s, OP_goto, label_assign);
26665|      2|        emit_label(s, label_done);
26666|      2|        has_initializer = TRUE;
26667|      2|    } else {
26668|       |        /* normally hasval is true except if
26669|       |           js_parse_skip_parens_token() was wrong in the parsing */
26670|       |        //        assert(hasval);
26671|      0|        if (!hasval) {
  ------------------
  |  Branch (26671:13): [True: 0, False: 0]
  ------------------
26672|      0|            js_parse_error(s, "too complicated destructuring expression");
26673|      0|            return -1;
26674|      0|        }
26675|       |        /* remove test and decrement label ref count */
26676|      0|        memset(s->cur_func->byte_code.buf + start_addr, OP_nop,
26677|      0|               assign_addr - start_addr);
26678|      0|        s->cur_func->label_slots[label_parse].ref_count--;
26679|      0|        has_initializer = FALSE;
26680|      0|    }
26681|      2|    return has_initializer;
26682|       |
26683|      0| prop_error:
26684|      0|    JS_FreeAtom(s->ctx, prop_name);
26685|      0| var_error:
26686|      0|    JS_FreeAtom(s->ctx, var_name);
26687|      0|    return -1;
26688|      0|}
quickjs.c:js_parse_destructuring_var:
26198|      2|{
26199|      2|    JSAtom name;
26200|       |
26201|      2|    if (!(s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved)
  ------------------
  |  Branch (26201:11): [True: 2, False: 0]
  |  Branch (26201:40): [True: 2, False: 0]
  ------------------
26202|      2|    ||  ((s->cur_func->js_mode & JS_MODE_STRICT) &&
  ------------------
  |  |  403|      2|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (26202:10): [True: 0, False: 2]
  ------------------
26203|      0|         (s->token.u.ident.atom == JS_ATOM_eval || s->token.u.ident.atom == JS_ATOM_arguments))) {
  ------------------
  |  Branch (26203:11): [True: 0, False: 0]
  |  Branch (26203:52): [True: 0, False: 0]
  ------------------
26204|      0|        js_parse_error(s, "invalid destructuring target");
26205|      0|        return JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
26206|      0|    }
26207|      2|    name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
26208|      2|    if (is_arg && js_parse_check_duplicate_parameter(s, name))
  ------------------
  |  Branch (26208:9): [True: 2, False: 0]
  |  Branch (26208:19): [True: 0, False: 2]
  ------------------
26209|      0|        goto fail;
26210|      2|    if (next_token(s))
  ------------------
  |  Branch (26210:9): [True: 0, False: 2]
  ------------------
26211|      0|        goto fail;
26212|       |
26213|      2|    return name;
26214|      0|fail:
26215|      0|    JS_FreeAtom(s->ctx, name);
26216|      0|    return JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
26217|      2|}
quickjs.c:need_var_reference:
26184|      2|{
26185|      2|    JSFunctionDef *fd = s->cur_func;
26186|      2|    if (tok != TOK_VAR)
  ------------------
  |  Branch (26186:9): [True: 2, False: 0]
  ------------------
26187|      2|        return FALSE; /* no reference for let/const */
26188|      0|    if (fd->js_mode & JS_MODE_STRICT) {
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (26188:9): [True: 0, False: 0]
  ------------------
26189|      0|        if (!fd->is_global_var)
  ------------------
  |  Branch (26189:13): [True: 0, False: 0]
  ------------------
26190|      0|            return FALSE; /* local definitions in strict mode in function or direct eval */
26191|      0|        if (s->is_module)
  ------------------
  |  Branch (26191:13): [True: 0, False: 0]
  ------------------
26192|      0|            return FALSE; /* in a module global variables are like closure variables */
26193|      0|    }
26194|      0|    return TRUE;
26195|      0|}
quickjs.c:js_parse_left_hand_side_expr:
24988|      1|{
24989|      1|    return js_parse_postfix_expr(s, PF_POSTFIX_CALL);
  ------------------
  |  |24970|      1|#define PF_POSTFIX_CALL (1 << 1)
  ------------------
24990|      1|}
quickjs.c:js_parse_postfix_expr:
26716|    166|{
26717|    166|    FuncCallType call_type;
26718|    166|    int optional_chaining_label;
26719|    166|    BOOL accept_lparen = (parse_flags & PF_POSTFIX_CALL) != 0;
  ------------------
  |  |24970|    166|#define PF_POSTFIX_CALL (1 << 1)
  ------------------
26720|    166|    const uint8_t *op_token_ptr;
26721|       |    
26722|    166|    call_type = FUNC_CALL_NORMAL;
26723|    166|    switch(s->token.val) {
26724|     12|    case TOK_NUMBER:
  ------------------
  |  Branch (26724:5): [True: 12, False: 154]
  ------------------
26725|     12|        {
26726|     12|            JSValue val;
26727|     12|            val = s->token.u.num.val;
26728|       |
26729|     12|            if (JS_VALUE_GET_TAG(val) == JS_TAG_INT) {
  ------------------
  |  |  236|     12|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (26729:17): [True: 7, False: 5]
  ------------------
26730|      7|                emit_op(s, OP_push_i32);
26731|      7|                emit_u32(s, JS_VALUE_GET_INT(val));
  ------------------
  |  |  239|      7|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
26732|      7|            } else if (JS_VALUE_GET_TAG(val) == JS_TAG_SHORT_BIG_INT) {
  ------------------
  |  |  236|      5|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (26732:24): [True: 0, False: 5]
  ------------------
26733|      0|                int64_t v;
26734|      0|                v = JS_VALUE_GET_SHORT_BIG_INT(val);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
26735|      0|                if (v >= INT32_MIN && v <= INT32_MAX) {
  ------------------
  |  Branch (26735:21): [True: 0, False: 0]
  |  Branch (26735:39): [True: 0, False: 0]
  ------------------
26736|      0|                    emit_op(s, OP_push_bigint_i32);
26737|      0|                    emit_u32(s, v);
26738|      0|                } else {
26739|      0|                    goto large_number;
26740|      0|                }
26741|      5|            } else {
26742|      5|            large_number:
26743|      5|                if (emit_push_const(s, val, 0) < 0)
  ------------------
  |  Branch (26743:21): [True: 0, False: 5]
  ------------------
26744|      0|                    return -1;
26745|      5|            }
26746|     12|        }
26747|     12|        if (next_token(s))
  ------------------
  |  Branch (26747:13): [True: 0, False: 12]
  ------------------
26748|      0|            return -1;
26749|     12|        break;
26750|     23|    case TOK_TEMPLATE:
  ------------------
  |  Branch (26750:5): [True: 23, False: 143]
  ------------------
26751|     23|        if (js_parse_template(s, 0, NULL))
  ------------------
  |  Branch (26751:13): [True: 0, False: 23]
  ------------------
26752|      0|            return -1;
26753|     23|        break;
26754|     23|    case TOK_STRING:
  ------------------
  |  Branch (26754:5): [True: 7, False: 159]
  ------------------
26755|      7|        if (emit_push_const(s, s->token.u.str.str, 1))
  ------------------
  |  Branch (26755:13): [True: 0, False: 7]
  ------------------
26756|      0|            return -1;
26757|      7|        if (next_token(s))
  ------------------
  |  Branch (26757:13): [True: 0, False: 7]
  ------------------
26758|      0|            return -1;
26759|      7|        break;
26760|       |
26761|      7|    case TOK_DIV_ASSIGN:
  ------------------
  |  Branch (26761:5): [True: 0, False: 166]
  ------------------
26762|      0|        s->buf_ptr -= 2;
26763|      0|        goto parse_regexp;
26764|      1|    case '/':
  ------------------
  |  Branch (26764:5): [True: 1, False: 165]
  ------------------
26765|      1|        s->buf_ptr--;
26766|      1|    parse_regexp:
26767|      1|        {
26768|      1|            JSValue str;
26769|      1|            int ret;
26770|      1|            if (!s->ctx->compile_regexp)
  ------------------
  |  Branch (26770:17): [True: 0, False: 1]
  ------------------
26771|      0|                return js_parse_error(s, "RegExp are not supported");
26772|       |            /* the previous token is '/' or '/=', so no need to free */
26773|      1|            if (js_parse_regexp(s))
  ------------------
  |  Branch (26773:17): [True: 0, False: 1]
  ------------------
26774|      0|                return -1;
26775|      1|            ret = emit_push_const(s, s->token.u.regexp.body, 0);
26776|      1|            str = s->ctx->compile_regexp(s->ctx, s->token.u.regexp.body,
26777|      1|                                         s->token.u.regexp.flags);
26778|      1|            if (JS_IsException(str)) {
  ------------------
  |  Branch (26778:17): [True: 0, False: 1]
  ------------------
26779|       |                /* add the line number info */
26780|      0|                int line_num, col_num;
26781|      0|                line_num = get_line_col(&col_num, s->buf_start, s->token.ptr - s->buf_start);
26782|      0|                build_backtrace(s->ctx, s->ctx->rt->current_exception,
26783|      0|                                s->filename, line_num + 1, col_num + 1, 0);
26784|      0|                return -1;
26785|      0|            }
26786|      1|            ret = emit_push_const(s, str, 0);
26787|      1|            JS_FreeValue(s->ctx, str);
26788|      1|            if (ret)
  ------------------
  |  Branch (26788:17): [True: 0, False: 1]
  ------------------
26789|      0|                return -1;
26790|       |            /* we use a specific opcode to be sure the correct
26791|       |               function is called (otherwise the bytecode would have
26792|       |               to be verified by the RegExp constructor) */
26793|      1|            emit_op(s, OP_regexp);
26794|      1|            if (next_token(s))
  ------------------
  |  Branch (26794:17): [True: 0, False: 1]
  ------------------
26795|      0|                return -1;
26796|      1|        }
26797|      1|        break;
26798|      1|    case '(':
  ------------------
  |  Branch (26798:5): [True: 0, False: 166]
  ------------------
26799|      0|        if (js_parse_expr_paren(s))
  ------------------
  |  Branch (26799:13): [True: 0, False: 0]
  ------------------
26800|      0|            return -1;
26801|      0|        break;
26802|      0|    case TOK_FUNCTION:
  ------------------
  |  Branch (26802:5): [True: 0, False: 166]
  ------------------
26803|      0|        if (js_parse_function_decl(s, JS_PARSE_FUNC_EXPR,
  ------------------
  |  Branch (26803:13): [True: 0, False: 0]
  ------------------
26804|      0|                                   JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
26805|      0|                                   s->token.ptr))
26806|      0|            return -1;
26807|      0|        break;
26808|      0|    case TOK_CLASS:
  ------------------
  |  Branch (26808:5): [True: 0, False: 166]
  ------------------
26809|      0|        if (js_parse_class(s, TRUE, JS_PARSE_EXPORT_NONE))
  ------------------
  |  Branch (26809:13): [True: 0, False: 0]
  ------------------
26810|      0|            return -1;
26811|      0|        break;
26812|      0|    case TOK_NULL:
  ------------------
  |  Branch (26812:5): [True: 0, False: 166]
  ------------------
26813|      0|        if (next_token(s))
  ------------------
  |  Branch (26813:13): [True: 0, False: 0]
  ------------------
26814|      0|            return -1;
26815|      0|        emit_op(s, OP_null);
26816|      0|        break;
26817|      0|    case TOK_THIS:
  ------------------
  |  Branch (26817:5): [True: 0, False: 166]
  ------------------
26818|      0|        if (next_token(s))
  ------------------
  |  Branch (26818:13): [True: 0, False: 0]
  ------------------
26819|      0|            return -1;
26820|      0|        emit_op(s, OP_scope_get_var);
26821|      0|        emit_atom(s, JS_ATOM_this);
26822|      0|        emit_u16(s, 0);
26823|      0|        break;
26824|      0|    case TOK_FALSE:
  ------------------
  |  Branch (26824:5): [True: 0, False: 166]
  ------------------
26825|      0|        if (next_token(s))
  ------------------
  |  Branch (26825:13): [True: 0, False: 0]
  ------------------
26826|      0|            return -1;
26827|      0|        emit_op(s, OP_push_false);
26828|      0|        break;
26829|      0|    case TOK_TRUE:
  ------------------
  |  Branch (26829:5): [True: 0, False: 166]
  ------------------
26830|      0|        if (next_token(s))
  ------------------
  |  Branch (26830:13): [True: 0, False: 0]
  ------------------
26831|      0|            return -1;
26832|      0|        emit_op(s, OP_push_true);
26833|      0|        break;
26834|    122|    case TOK_IDENT:
  ------------------
  |  Branch (26834:5): [True: 122, False: 44]
  ------------------
26835|    122|        {
26836|    122|            JSAtom name;
26837|    122|            const uint8_t *source_ptr;
26838|    122|            if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (26838:17): [True: 0, False: 122]
  ------------------
26839|      0|                return js_parse_error_reserved_identifier(s);
26840|      0|            }
26841|    122|            source_ptr = s->token.ptr;
26842|    122|            if (token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (26842:17): [True: 0, False: 122]
  ------------------
26843|      0|                peek_token(s, TRUE) != '\n') {
  ------------------
  |  Branch (26843:17): [True: 0, False: 0]
  ------------------
26844|      0|                if (next_token(s))
  ------------------
  |  Branch (26844:21): [True: 0, False: 0]
  ------------------
26845|      0|                    return -1;
26846|      0|                if (s->token.val == TOK_FUNCTION) {
  ------------------
  |  Branch (26846:21): [True: 0, False: 0]
  ------------------
26847|      0|                    if (js_parse_function_decl(s, JS_PARSE_FUNC_EXPR,
  ------------------
  |  Branch (26847:25): [True: 0, False: 0]
  ------------------
26848|      0|                                               JS_FUNC_ASYNC, JS_ATOM_NULL,
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
26849|      0|                                               source_ptr))
26850|      0|                        return -1;
26851|      0|                } else {
26852|      0|                    name = JS_DupAtom(s->ctx, JS_ATOM_async);
26853|      0|                    goto do_get_var;
26854|      0|                }
26855|    122|            } else {
26856|    122|                if (s->token.u.ident.atom == JS_ATOM_arguments &&
  ------------------
  |  Branch (26856:21): [True: 0, False: 122]
  ------------------
26857|      0|                    !s->cur_func->arguments_allowed) {
  ------------------
  |  Branch (26857:21): [True: 0, False: 0]
  ------------------
26858|      0|                    js_parse_error(s, "'arguments' identifier is not allowed in class field initializer");
26859|      0|                    return -1;
26860|      0|                }
26861|    122|                name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
26862|    122|                if (next_token(s)) {
  ------------------
  |  Branch (26862:21): [True: 0, False: 122]
  ------------------
26863|      0|                    JS_FreeAtom(s->ctx, name);
26864|      0|                    return -1;
26865|      0|                }
26866|    122|            do_get_var:
26867|    122|                emit_source_pos(s, source_ptr);
26868|    122|                emit_op(s, OP_scope_get_var);
26869|    122|                emit_u32(s, name);
26870|    122|                emit_u16(s, s->cur_func->scope_level);
26871|    122|            }
26872|    122|        }
26873|    122|        break;
26874|    122|    case '{':
  ------------------
  |  Branch (26874:5): [True: 0, False: 166]
  ------------------
26875|      0|    case '[':
  ------------------
  |  Branch (26875:5): [True: 0, False: 166]
  ------------------
26876|      0|        if (s->token.val == '{') {
  ------------------
  |  Branch (26876:13): [True: 0, False: 0]
  ------------------
26877|      0|            if (js_parse_object_literal(s))
  ------------------
  |  Branch (26877:17): [True: 0, False: 0]
  ------------------
26878|      0|                return -1;
26879|      0|        } else {
26880|      0|            if (js_parse_array_literal(s))
  ------------------
  |  Branch (26880:17): [True: 0, False: 0]
  ------------------
26881|      0|                return -1;
26882|      0|        }
26883|      0|        break;
26884|      0|    case TOK_NEW:
  ------------------
  |  Branch (26884:5): [True: 0, False: 166]
  ------------------
26885|      0|        if (next_token(s))
  ------------------
  |  Branch (26885:13): [True: 0, False: 0]
  ------------------
26886|      0|            return -1;
26887|      0|        if (s->token.val == '.') {
  ------------------
  |  Branch (26887:13): [True: 0, False: 0]
  ------------------
26888|      0|            if (next_token(s))
  ------------------
  |  Branch (26888:17): [True: 0, False: 0]
  ------------------
26889|      0|                return -1;
26890|      0|            if (!token_is_pseudo_keyword(s, JS_ATOM_target))
  ------------------
  |  Branch (26890:17): [True: 0, False: 0]
  ------------------
26891|      0|                return js_parse_error(s, "expecting target");
26892|      0|            if (!s->cur_func->new_target_allowed)
  ------------------
  |  Branch (26892:17): [True: 0, False: 0]
  ------------------
26893|      0|                return js_parse_error(s, "new.target only allowed within functions");
26894|      0|            if (next_token(s))
  ------------------
  |  Branch (26894:17): [True: 0, False: 0]
  ------------------
26895|      0|                return -1;
26896|      0|            emit_op(s, OP_scope_get_var);
26897|      0|            emit_atom(s, JS_ATOM_new_target);
26898|      0|            emit_u16(s, 0);
26899|      0|        } else {
26900|      0|            if (js_parse_postfix_expr(s, 0))
  ------------------
  |  Branch (26900:17): [True: 0, False: 0]
  ------------------
26901|      0|                return -1;
26902|      0|            accept_lparen = TRUE;
26903|      0|            if (s->token.val != '(') {
  ------------------
  |  Branch (26903:17): [True: 0, False: 0]
  ------------------
26904|       |                /* new operator on an object */
26905|      0|                emit_source_pos(s, s->token.ptr);
26906|      0|                emit_op(s, OP_dup);
26907|      0|                emit_op(s, OP_call_constructor);
26908|      0|                emit_u16(s, 0);
26909|      0|            } else {
26910|      0|                call_type = FUNC_CALL_NEW;
26911|      0|            }
26912|      0|        }
26913|      0|        break;
26914|      0|    case TOK_SUPER:
  ------------------
  |  Branch (26914:5): [True: 0, False: 166]
  ------------------
26915|      0|        if (next_token(s))
  ------------------
  |  Branch (26915:13): [True: 0, False: 0]
  ------------------
26916|      0|            return -1;
26917|      0|        if (s->token.val == '(') {
  ------------------
  |  Branch (26917:13): [True: 0, False: 0]
  ------------------
26918|      0|            if (!s->cur_func->super_call_allowed)
  ------------------
  |  Branch (26918:17): [True: 0, False: 0]
  ------------------
26919|      0|                return js_parse_error(s, "super() is only valid in a derived class constructor");
26920|      0|            call_type = FUNC_CALL_SUPER_CTOR;
26921|      0|        } else if (s->token.val == '.' || s->token.val == '[') {
  ------------------
  |  Branch (26921:20): [True: 0, False: 0]
  |  Branch (26921:43): [True: 0, False: 0]
  ------------------
26922|      0|            if (!s->cur_func->super_allowed)
  ------------------
  |  Branch (26922:17): [True: 0, False: 0]
  ------------------
26923|      0|                return js_parse_error(s, "'super' is only valid in a method");
26924|      0|            emit_op(s, OP_scope_get_var);
26925|      0|            emit_atom(s, JS_ATOM_this);
26926|      0|            emit_u16(s, 0);
26927|      0|            emit_op(s, OP_scope_get_var);
26928|      0|            emit_atom(s, JS_ATOM_home_object);
26929|      0|            emit_u16(s, 0);
26930|      0|            emit_op(s, OP_get_super);
26931|      0|        } else {
26932|      0|            return js_parse_error(s, "invalid use of 'super'");
26933|      0|        }
26934|      0|        break;
26935|      0|    case TOK_IMPORT:
  ------------------
  |  Branch (26935:5): [True: 0, False: 166]
  ------------------
26936|      0|        if (next_token(s))
  ------------------
  |  Branch (26936:13): [True: 0, False: 0]
  ------------------
26937|      0|            return -1;
26938|      0|        if (s->token.val == '.') {
  ------------------
  |  Branch (26938:13): [True: 0, False: 0]
  ------------------
26939|      0|            if (next_token(s))
  ------------------
  |  Branch (26939:17): [True: 0, False: 0]
  ------------------
26940|      0|                return -1;
26941|      0|            if (!token_is_pseudo_keyword(s, JS_ATOM_meta))
  ------------------
  |  Branch (26941:17): [True: 0, False: 0]
  ------------------
26942|      0|                return js_parse_error(s, "meta expected");
26943|      0|            if (!s->is_module)
  ------------------
  |  Branch (26943:17): [True: 0, False: 0]
  ------------------
26944|      0|                return js_parse_error(s, "import.meta only valid in module code");
26945|      0|            if (next_token(s))
  ------------------
  |  Branch (26945:17): [True: 0, False: 0]
  ------------------
26946|      0|                return -1;
26947|      0|            emit_op(s, OP_special_object);
26948|      0|            emit_u8(s, OP_SPECIAL_OBJECT_IMPORT_META);
26949|      0|        } else {
26950|      0|            if (js_parse_expect(s, '('))
  ------------------
  |  Branch (26950:17): [True: 0, False: 0]
  ------------------
26951|      0|                return -1;
26952|      0|            if (!accept_lparen)
  ------------------
  |  Branch (26952:17): [True: 0, False: 0]
  ------------------
26953|      0|                return js_parse_error(s, "invalid use of 'import()'");
26954|      0|            if (js_parse_assign_expr(s))
  ------------------
  |  Branch (26954:17): [True: 0, False: 0]
  ------------------
26955|      0|                return -1;
26956|      0|            if (s->token.val == ',') {
  ------------------
  |  Branch (26956:17): [True: 0, False: 0]
  ------------------
26957|      0|                if (next_token(s))
  ------------------
  |  Branch (26957:21): [True: 0, False: 0]
  ------------------
26958|      0|                    return -1;
26959|      0|                if (s->token.val != ')') {
  ------------------
  |  Branch (26959:21): [True: 0, False: 0]
  ------------------
26960|      0|                    if (js_parse_assign_expr(s))
  ------------------
  |  Branch (26960:25): [True: 0, False: 0]
  ------------------
26961|      0|                        return -1;
26962|       |                    /* accept a trailing comma */
26963|      0|                    if (s->token.val == ',') {
  ------------------
  |  Branch (26963:25): [True: 0, False: 0]
  ------------------
26964|      0|                        if (next_token(s))
  ------------------
  |  Branch (26964:29): [True: 0, False: 0]
  ------------------
26965|      0|                            return -1;
26966|      0|                    }
26967|      0|                } else {
26968|      0|                    emit_op(s, OP_undefined);
26969|      0|                }
26970|      0|            } else {
26971|      0|                emit_op(s, OP_undefined);
26972|      0|            }
26973|      0|            if (js_parse_expect(s, ')'))
  ------------------
  |  Branch (26973:17): [True: 0, False: 0]
  ------------------
26974|      0|                return -1;
26975|      0|            emit_op(s, OP_import);
26976|      0|        }
26977|      0|        break;
26978|      1|    default:
  ------------------
  |  Branch (26978:5): [True: 1, False: 165]
  ------------------
26979|      1|        return js_parse_error(s, "unexpected token in expression: '%.*s'",
26980|      1|                              (int)(s->buf_ptr - s->token.ptr), s->token.ptr);
26981|    166|    }
26982|       |
26983|    165|    optional_chaining_label = -1;
26984|    214|    for(;;) {
26985|    214|        JSFunctionDef *fd = s->cur_func;
26986|    214|        BOOL has_optional_chain = FALSE;
26987|       |
26988|    214|        if (s->token.val == TOK_QUESTION_MARK_DOT) {
  ------------------
  |  Branch (26988:13): [True: 0, False: 214]
  ------------------
26989|      0|            if ((parse_flags & PF_POSTFIX_CALL) == 0)
  ------------------
  |  |24970|      0|#define PF_POSTFIX_CALL (1 << 1)
  ------------------
  |  Branch (26989:17): [True: 0, False: 0]
  ------------------
26990|      0|                return js_parse_error(s, "new keyword cannot be used with an optional chain");
26991|      0|            op_token_ptr = s->token.ptr;
26992|       |            /* optional chaining */
26993|      0|            if (next_token(s))
  ------------------
  |  Branch (26993:17): [True: 0, False: 0]
  ------------------
26994|      0|                return -1;
26995|      0|            has_optional_chain = TRUE;
26996|      0|            if (s->token.val == '(' && accept_lparen) {
  ------------------
  |  Branch (26996:17): [True: 0, False: 0]
  |  Branch (26996:40): [True: 0, False: 0]
  ------------------
26997|      0|                goto parse_func_call;
26998|      0|            } else if (s->token.val == '[') {
  ------------------
  |  Branch (26998:24): [True: 0, False: 0]
  ------------------
26999|      0|                goto parse_array_access;
27000|      0|            } else {
27001|      0|                goto parse_property;
27002|      0|            }
27003|    214|        } else if (s->token.val == TOK_TEMPLATE &&
  ------------------
  |  Branch (27003:20): [True: 6, False: 208]
  ------------------
27004|      6|                   call_type == FUNC_CALL_NORMAL) {
  ------------------
  |  Branch (27004:20): [True: 6, False: 0]
  ------------------
27005|      6|            if (optional_chaining_label >= 0) {
  ------------------
  |  Branch (27005:17): [True: 0, False: 6]
  ------------------
27006|      0|                return js_parse_error(s, "template literal cannot appear in an optional chain");
27007|      0|            }
27008|      6|            call_type = FUNC_CALL_TEMPLATE;
27009|      6|            op_token_ptr = s->token.ptr; /* XXX: check if right position */
27010|      6|            goto parse_func_call2;
27011|    208|        } else if (s->token.val == '(' && accept_lparen) {
  ------------------
  |  Branch (27011:20): [True: 6, False: 202]
  |  Branch (27011:43): [True: 6, False: 0]
  ------------------
27012|      6|            int opcode, arg_count, drop_count;
27013|       |
27014|       |            /* function call */
27015|      6|        parse_func_call:
27016|      6|            op_token_ptr = s->token.ptr;
27017|      6|            if (next_token(s))
  ------------------
  |  Branch (27017:17): [True: 0, False: 6]
  ------------------
27018|      0|                return -1;
27019|       |
27020|      6|            if (call_type == FUNC_CALL_NORMAL) {
  ------------------
  |  Branch (27020:17): [True: 6, False: 0]
  ------------------
27021|     12|            parse_func_call2:
27022|     12|                switch(opcode = get_prev_opcode(fd)) {
27023|      3|                case OP_get_field:
  ------------------
  |  Branch (27023:17): [True: 3, False: 9]
  ------------------
27024|       |                    /* keep the object on the stack */
27025|      3|                    fd->byte_code.buf[fd->last_opcode_pos] = OP_get_field2;
27026|      3|                    drop_count = 2;
27027|      3|                    break;
27028|      0|                case OP_get_field_opt_chain:
  ------------------
  |  Branch (27028:17): [True: 0, False: 12]
  ------------------
27029|      0|                    {
27030|      0|                        int opt_chain_label, next_label;
27031|      0|                        opt_chain_label = get_u32(fd->byte_code.buf +
27032|      0|                                                  fd->last_opcode_pos + 1 + 4 + 1);
27033|       |                        /* keep the object on the stack */
27034|      0|                        fd->byte_code.buf[fd->last_opcode_pos] = OP_get_field2;
27035|      0|                        fd->byte_code.size = fd->last_opcode_pos + 1 + 4;
27036|      0|                        next_label = emit_goto(s, OP_goto, -1);
27037|      0|                        emit_label(s, opt_chain_label);
27038|       |                        /* need an additional undefined value for the
27039|       |                           case where the optional field does not
27040|       |                           exists */
27041|      0|                        emit_op(s, OP_undefined);
27042|      0|                        emit_label(s, next_label);
27043|      0|                        drop_count = 2;
27044|      0|                        opcode = OP_get_field;
27045|      0|                    }
27046|      0|                    break;
27047|      0|                case OP_scope_get_private_field:
  ------------------
  |  Branch (27047:17): [True: 0, False: 12]
  ------------------
27048|       |                    /* keep the object on the stack */
27049|      0|                    fd->byte_code.buf[fd->last_opcode_pos] = OP_scope_get_private_field2;
27050|      0|                    drop_count = 2;
27051|      0|                    break;
27052|      0|                case OP_get_array_el:
  ------------------
  |  Branch (27052:17): [True: 0, False: 12]
  ------------------
27053|       |                    /* keep the object on the stack */
27054|      0|                    fd->byte_code.buf[fd->last_opcode_pos] = OP_get_array_el2;
27055|      0|                    drop_count = 2;
27056|      0|                    break;
27057|      0|                case OP_get_array_el_opt_chain:
  ------------------
  |  Branch (27057:17): [True: 0, False: 12]
  ------------------
27058|      0|                    {
27059|      0|                        int opt_chain_label, next_label;
27060|      0|                        opt_chain_label = get_u32(fd->byte_code.buf +
27061|      0|                                                  fd->last_opcode_pos + 1 + 1);
27062|       |                        /* keep the object on the stack */
27063|      0|                        fd->byte_code.buf[fd->last_opcode_pos] = OP_get_array_el2;
27064|      0|                        fd->byte_code.size = fd->last_opcode_pos + 1;
27065|      0|                        next_label = emit_goto(s, OP_goto, -1);
27066|      0|                        emit_label(s, opt_chain_label);
27067|       |                        /* need an additional undefined value for the
27068|       |                           case where the optional field does not
27069|       |                           exists */
27070|      0|                        emit_op(s, OP_undefined);
27071|      0|                        emit_label(s, next_label);
27072|      0|                        drop_count = 2;
27073|      0|                        opcode = OP_get_array_el;
27074|      0|                    }
27075|      0|                    break;
27076|      9|                case OP_scope_get_var:
  ------------------
  |  Branch (27076:17): [True: 9, False: 3]
  ------------------
27077|      9|                    {
27078|      9|                        JSAtom name;
27079|      9|                        int scope;
27080|      9|                        name = get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
27081|      9|                        scope = get_u16(fd->byte_code.buf + fd->last_opcode_pos + 5);
27082|      9|                        if (name == JS_ATOM_eval && call_type == FUNC_CALL_NORMAL && !has_optional_chain) {
  ------------------
  |  Branch (27082:29): [True: 0, False: 9]
  |  Branch (27082:53): [True: 0, False: 0]
  |  Branch (27082:86): [True: 0, False: 0]
  ------------------
27083|       |                            /* direct 'eval' */
27084|      0|                            opcode = OP_eval;
27085|      9|                        } else {
27086|       |                            /* verify if function name resolves to a simple
27087|       |                               get_loc/get_arg: a function call inside a `with`
27088|       |                               statement can resolve to a method call of the
27089|       |                               `with` context object
27090|       |                             */
27091|       |                            /* XXX: always generate the OP_scope_get_ref
27092|       |                               and remove it in variable resolution
27093|       |                               pass ? */
27094|      9|                            if (has_with_scope(fd, scope)) {
  ------------------
  |  Branch (27094:33): [True: 0, False: 9]
  ------------------
27095|      0|                                opcode = OP_scope_get_ref;
27096|      0|                                fd->byte_code.buf[fd->last_opcode_pos] = opcode;
27097|      0|                            }
27098|      9|                        }
27099|      9|                        drop_count = 1;
27100|      9|                    }
27101|      9|                    break;
27102|      0|                case OP_get_super_value:
  ------------------
  |  Branch (27102:17): [True: 0, False: 12]
  ------------------
27103|      0|                    fd->byte_code.buf[fd->last_opcode_pos] = OP_get_array_el;
27104|       |                    /* on stack: this func_obj */
27105|      0|                    opcode = OP_get_array_el;
27106|      0|                    drop_count = 2;
27107|      0|                    break;
27108|      0|                default:
  ------------------
  |  Branch (27108:17): [True: 0, False: 12]
  ------------------
27109|      0|                    opcode = OP_invalid;
27110|      0|                    drop_count = 1;
27111|      0|                    break;
27112|     12|                }
27113|     12|                if (has_optional_chain) {
  ------------------
  |  Branch (27113:21): [True: 0, False: 12]
  ------------------
27114|      0|                    optional_chain_test(s, &optional_chaining_label,
27115|      0|                                        drop_count);
27116|      0|                }
27117|     12|            } else {
27118|      0|                opcode = OP_invalid;
27119|      0|            }
27120|       |
27121|     12|            if (call_type == FUNC_CALL_TEMPLATE) {
  ------------------
  |  Branch (27121:17): [True: 6, False: 6]
  ------------------
27122|      6|                if (js_parse_template(s, 1, &arg_count))
  ------------------
  |  Branch (27122:21): [True: 0, False: 6]
  ------------------
27123|      0|                    return -1;
27124|      6|                goto emit_func_call;
27125|      6|            } else if (call_type == FUNC_CALL_SUPER_CTOR) {
  ------------------
  |  Branch (27125:24): [True: 0, False: 6]
  ------------------
27126|      0|                emit_op(s, OP_scope_get_var);
27127|      0|                emit_atom(s, JS_ATOM_this_active_func);
27128|      0|                emit_u16(s, 0);
27129|       |
27130|      0|                emit_op(s, OP_get_super);
27131|       |
27132|      0|                emit_op(s, OP_scope_get_var);
27133|      0|                emit_atom(s, JS_ATOM_new_target);
27134|      0|                emit_u16(s, 0);
27135|      6|            } else if (call_type == FUNC_CALL_NEW) {
  ------------------
  |  Branch (27135:24): [True: 0, False: 6]
  ------------------
27136|      0|                emit_op(s, OP_dup); /* new.target = function */
27137|      0|            }
27138|       |
27139|       |            /* parse arguments */
27140|      6|            arg_count = 0;
27141|      6|            while (s->token.val != ')') {
  ------------------
  |  Branch (27141:20): [True: 5, False: 1]
  ------------------
27142|      5|                if (arg_count >= 65535) {
  ------------------
  |  Branch (27142:21): [True: 0, False: 5]
  ------------------
27143|      0|                    return js_parse_error(s, "Too many call arguments");
27144|      0|                }
27145|      5|                if (s->token.val == TOK_ELLIPSIS)
  ------------------
  |  Branch (27145:21): [True: 0, False: 5]
  ------------------
27146|      0|                    break;
27147|      5|                if (js_parse_assign_expr(s))
  ------------------
  |  Branch (27147:21): [True: 0, False: 5]
  ------------------
27148|      0|                    return -1;
27149|      5|                arg_count++;
27150|      5|                if (s->token.val == ')')
  ------------------
  |  Branch (27150:21): [True: 5, False: 0]
  ------------------
27151|      5|                    break;
27152|       |                /* accept a trailing comma before the ')' */
27153|      0|                if (js_parse_expect(s, ','))
  ------------------
  |  Branch (27153:21): [True: 0, False: 0]
  ------------------
27154|      0|                    return -1;
27155|      0|            }
27156|      6|            if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (27156:17): [True: 0, False: 6]
  ------------------
27157|      0|                emit_op(s, OP_array_from);
27158|      0|                emit_u16(s, arg_count);
27159|      0|                emit_op(s, OP_push_i32);
27160|      0|                emit_u32(s, arg_count);
27161|       |
27162|       |                /* on stack: array idx */
27163|      0|                while (s->token.val != ')') {
  ------------------
  |  Branch (27163:24): [True: 0, False: 0]
  ------------------
27164|      0|                    if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (27164:25): [True: 0, False: 0]
  ------------------
27165|      0|                        if (next_token(s))
  ------------------
  |  Branch (27165:29): [True: 0, False: 0]
  ------------------
27166|      0|                            return -1;
27167|      0|                        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (27167:29): [True: 0, False: 0]
  ------------------
27168|      0|                            return -1;
27169|      0|#if 1
27170|       |                        /* XXX: could pass is_last indicator? */
27171|      0|                        emit_op(s, OP_append);
27172|       |#else
27173|       |                        int label_next, label_done;
27174|       |                        label_next = new_label(s);
27175|       |                        label_done = new_label(s);
27176|       |                        /* push enumerate object below array/idx pair */
27177|       |                        emit_op(s, OP_for_of_start);
27178|       |                        emit_op(s, OP_rot5l);
27179|       |                        emit_op(s, OP_rot5l);
27180|       |                        emit_label(s, label_next);
27181|       |                        /* on stack: enum_rec array idx */
27182|       |                        emit_op(s, OP_for_of_next);
27183|       |                        emit_u8(s, 2);
27184|       |                        emit_goto(s, OP_if_true, label_done);
27185|       |                        /* append element */
27186|       |                        /* enum_rec array idx val -> enum_rec array new_idx */
27187|       |                        emit_op(s, OP_define_array_el);
27188|       |                        emit_op(s, OP_inc);
27189|       |                        emit_goto(s, OP_goto, label_next);
27190|       |                        emit_label(s, label_done);
27191|       |                        /* close enumeration, drop enum_rec and idx */
27192|       |                        emit_op(s, OP_drop); /* drop undef */
27193|       |                        emit_op(s, OP_nip1); /* drop enum_rec */
27194|       |                        emit_op(s, OP_nip1);
27195|       |                        emit_op(s, OP_nip1);
27196|       |#endif
27197|      0|                    } else {
27198|      0|                        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (27198:29): [True: 0, False: 0]
  ------------------
27199|      0|                            return -1;
27200|       |                        /* array idx val */
27201|      0|                        emit_op(s, OP_define_array_el);
27202|      0|                        emit_op(s, OP_inc);
27203|      0|                    }
27204|      0|                    if (s->token.val == ')')
  ------------------
  |  Branch (27204:25): [True: 0, False: 0]
  ------------------
27205|      0|                        break;
27206|       |                    /* accept a trailing comma before the ')' */
27207|      0|                    if (js_parse_expect(s, ','))
  ------------------
  |  Branch (27207:25): [True: 0, False: 0]
  ------------------
27208|      0|                        return -1;
27209|      0|                }
27210|      0|                if (next_token(s))
  ------------------
  |  Branch (27210:21): [True: 0, False: 0]
  ------------------
27211|      0|                    return -1;
27212|       |                /* drop the index */
27213|      0|                emit_op(s, OP_drop);
27214|       |
27215|      0|                emit_source_pos(s, op_token_ptr);
27216|       |                /* apply function call */
27217|      0|                switch(opcode) {
27218|      0|                case OP_get_field:
  ------------------
  |  Branch (27218:17): [True: 0, False: 0]
  ------------------
27219|      0|                case OP_scope_get_private_field:
  ------------------
  |  Branch (27219:17): [True: 0, False: 0]
  ------------------
27220|      0|                case OP_get_array_el:
  ------------------
  |  Branch (27220:17): [True: 0, False: 0]
  ------------------
27221|      0|                case OP_scope_get_ref:
  ------------------
  |  Branch (27221:17): [True: 0, False: 0]
  ------------------
27222|       |                    /* obj func array -> func obj array */
27223|      0|                    emit_op(s, OP_perm3);
27224|      0|                    emit_op(s, OP_apply);
27225|      0|                    emit_u16(s, call_type == FUNC_CALL_NEW);
27226|      0|                    break;
27227|      0|                case OP_eval:
  ------------------
  |  Branch (27227:17): [True: 0, False: 0]
  ------------------
27228|      0|                    emit_op(s, OP_apply_eval);
27229|      0|                    emit_u16(s, fd->scope_level);
27230|      0|                    fd->has_eval_call = TRUE;
27231|      0|                    break;
27232|      0|                default:
  ------------------
  |  Branch (27232:17): [True: 0, False: 0]
  ------------------
27233|      0|                    if (call_type == FUNC_CALL_SUPER_CTOR) {
  ------------------
  |  Branch (27233:25): [True: 0, False: 0]
  ------------------
27234|      0|                        emit_op(s, OP_apply);
27235|      0|                        emit_u16(s, 1);
27236|       |                        /* set the 'this' value */
27237|      0|                        emit_op(s, OP_dup);
27238|      0|                        emit_op(s, OP_scope_put_var_init);
27239|      0|                        emit_atom(s, JS_ATOM_this);
27240|      0|                        emit_u16(s, 0);
27241|       |
27242|      0|                        emit_class_field_init(s);
27243|      0|                    } else if (call_type == FUNC_CALL_NEW) {
  ------------------
  |  Branch (27243:32): [True: 0, False: 0]
  ------------------
27244|       |                        /* obj func array -> func obj array */
27245|      0|                        emit_op(s, OP_perm3);
27246|      0|                        emit_op(s, OP_apply);
27247|      0|                        emit_u16(s, 1);
27248|      0|                    } else {
27249|       |                        /* func array -> func undef array */
27250|      0|                        emit_op(s, OP_undefined);
27251|      0|                        emit_op(s, OP_swap);
27252|      0|                        emit_op(s, OP_apply);
27253|      0|                        emit_u16(s, 0);
27254|      0|                    }
27255|      0|                    break;
27256|      0|                }
27257|      6|            } else {
27258|      6|                if (next_token(s))
  ------------------
  |  Branch (27258:21): [True: 0, False: 6]
  ------------------
27259|      0|                    return -1;
27260|     12|            emit_func_call:
27261|     12|                emit_source_pos(s, op_token_ptr);
27262|     12|                switch(opcode) {
27263|      3|                case OP_get_field:
  ------------------
  |  Branch (27263:17): [True: 3, False: 9]
  ------------------
27264|      3|                case OP_scope_get_private_field:
  ------------------
  |  Branch (27264:17): [True: 0, False: 12]
  ------------------
27265|      3|                case OP_get_array_el:
  ------------------
  |  Branch (27265:17): [True: 0, False: 12]
  ------------------
27266|      3|                case OP_scope_get_ref:
  ------------------
  |  Branch (27266:17): [True: 0, False: 12]
  ------------------
27267|      3|                    emit_op(s, OP_call_method);
27268|      3|                    emit_u16(s, arg_count);
27269|      3|                    break;
27270|      0|                case OP_eval:
  ------------------
  |  Branch (27270:17): [True: 0, False: 12]
  ------------------
27271|      0|                    emit_op(s, OP_eval);
27272|      0|                    emit_u16(s, arg_count);
27273|      0|                    emit_u16(s, fd->scope_level);
27274|      0|                    fd->has_eval_call = TRUE;
27275|      0|                    break;
27276|      9|                default:
  ------------------
  |  Branch (27276:17): [True: 9, False: 3]
  ------------------
27277|      9|                    if (call_type == FUNC_CALL_SUPER_CTOR) {
  ------------------
  |  Branch (27277:25): [True: 0, False: 9]
  ------------------
27278|      0|                        emit_op(s, OP_call_constructor);
27279|      0|                        emit_u16(s, arg_count);
27280|       |
27281|       |                        /* set the 'this' value */
27282|      0|                        emit_op(s, OP_dup);
27283|      0|                        emit_op(s, OP_scope_put_var_init);
27284|      0|                        emit_atom(s, JS_ATOM_this);
27285|      0|                        emit_u16(s, 0);
27286|       |
27287|      0|                        emit_class_field_init(s);
27288|      9|                    } else if (call_type == FUNC_CALL_NEW) {
  ------------------
  |  Branch (27288:32): [True: 0, False: 9]
  ------------------
27289|      0|                        emit_op(s, OP_call_constructor);
27290|      0|                        emit_u16(s, arg_count);
27291|      9|                    } else {
27292|      9|                        emit_op(s, OP_call);
27293|      9|                        emit_u16(s, arg_count);
27294|      9|                    }
27295|      9|                    break;
27296|     12|                }
27297|     12|            }
27298|     12|            call_type = FUNC_CALL_NORMAL;
27299|    202|        } else if (s->token.val == '.') {
  ------------------
  |  Branch (27299:20): [True: 39, False: 163]
  ------------------
27300|     39|            op_token_ptr = s->token.ptr;
27301|     39|            if (next_token(s))
  ------------------
  |  Branch (27301:17): [True: 0, False: 39]
  ------------------
27302|      0|                return -1;
27303|     39|        parse_property:
27304|     39|            emit_source_pos(s, op_token_ptr);
27305|     39|            if (s->token.val == TOK_PRIVATE_NAME) {
  ------------------
  |  Branch (27305:17): [True: 0, False: 39]
  ------------------
27306|       |                /* private class field */
27307|      0|                if (get_prev_opcode(fd) == OP_get_super) {
  ------------------
  |  Branch (27307:21): [True: 0, False: 0]
  ------------------
27308|      0|                    return js_parse_error(s, "private class field forbidden after super");
27309|      0|                }
27310|      0|                if (has_optional_chain) {
  ------------------
  |  Branch (27310:21): [True: 0, False: 0]
  ------------------
27311|      0|                    optional_chain_test(s, &optional_chaining_label, 1);
27312|      0|                }
27313|      0|                emit_op(s, OP_scope_get_private_field);
27314|      0|                emit_atom(s, s->token.u.ident.atom);
27315|      0|                emit_u16(s, s->cur_func->scope_level);
27316|     39|            } else {
27317|     39|                if (!token_is_ident(s->token.val)) {
  ------------------
  |  Branch (27317:21): [True: 0, False: 39]
  ------------------
27318|      0|                    return js_parse_error(s, "expecting field name");
27319|      0|                }
27320|     39|                if (get_prev_opcode(fd) == OP_get_super) {
  ------------------
  |  Branch (27320:21): [True: 0, False: 39]
  ------------------
27321|      0|                    JSValue val;
27322|      0|                    int ret;
27323|      0|                    val = JS_AtomToValue(s->ctx, s->token.u.ident.atom);
27324|      0|                    ret = emit_push_const(s, val, 1);
27325|      0|                    JS_FreeValue(s->ctx, val);
27326|      0|                    if (ret)
  ------------------
  |  Branch (27326:25): [True: 0, False: 0]
  ------------------
27327|      0|                        return -1;
27328|      0|                    emit_op(s, OP_get_super_value);
27329|     39|                } else {
27330|     39|                    if (has_optional_chain) {
  ------------------
  |  Branch (27330:25): [True: 0, False: 39]
  ------------------
27331|      0|                        optional_chain_test(s, &optional_chaining_label, 1);
27332|      0|                    }
27333|     39|                    emit_op(s, OP_get_field);
27334|     39|                    emit_atom(s, s->token.u.ident.atom);
27335|     39|                }
27336|     39|            }
27337|     39|            if (next_token(s))
  ------------------
  |  Branch (27337:17): [True: 2, False: 37]
  ------------------
27338|      2|                return -1;
27339|    163|        } else if (s->token.val == '[') {
  ------------------
  |  Branch (27339:20): [True: 0, False: 163]
  ------------------
27340|      0|            int prev_op;
27341|      0|            op_token_ptr = s->token.ptr;
27342|      0|        parse_array_access:
27343|      0|            prev_op = get_prev_opcode(fd);
27344|      0|            if (has_optional_chain) {
  ------------------
  |  Branch (27344:17): [True: 0, False: 0]
  ------------------
27345|      0|                optional_chain_test(s, &optional_chaining_label, 1);
27346|      0|            }
27347|      0|            if (next_token(s))
  ------------------
  |  Branch (27347:17): [True: 0, False: 0]
  ------------------
27348|      0|                return -1;
27349|      0|            if (js_parse_expr(s))
  ------------------
  |  Branch (27349:17): [True: 0, False: 0]
  ------------------
27350|      0|                return -1;
27351|      0|            if (js_parse_expect(s, ']'))
  ------------------
  |  Branch (27351:17): [True: 0, False: 0]
  ------------------
27352|      0|                return -1;
27353|      0|            emit_source_pos(s, op_token_ptr);
27354|      0|            if (prev_op == OP_get_super) {
  ------------------
  |  Branch (27354:17): [True: 0, False: 0]
  ------------------
27355|      0|                emit_op(s, OP_get_super_value);
27356|      0|            } else {
27357|      0|                emit_op(s, OP_get_array_el);
27358|      0|            }
27359|    163|        } else {
27360|    163|            break;
27361|    163|        }
27362|    214|    }
27363|    163|    if (optional_chaining_label >= 0) {
  ------------------
  |  Branch (27363:9): [True: 0, False: 163]
  ------------------
27364|      0|        JSFunctionDef *fd = s->cur_func;
27365|      0|        int opcode;
27366|      0|        emit_label_raw(s, optional_chaining_label);
27367|       |        /* modify the last opcode so that it is an indicator of an
27368|       |           optional chain */
27369|      0|        opcode = get_prev_opcode(fd);
27370|      0|        if (opcode == OP_get_field || opcode == OP_get_array_el) {
  ------------------
  |  Branch (27370:13): [True: 0, False: 0]
  |  Branch (27370:39): [True: 0, False: 0]
  ------------------
27371|      0|            if (opcode == OP_get_field)
  ------------------
  |  Branch (27371:17): [True: 0, False: 0]
  ------------------
27372|      0|                opcode = OP_get_field_opt_chain;
27373|      0|            else
27374|      0|                opcode = OP_get_array_el_opt_chain;
27375|      0|            fd->byte_code.buf[fd->last_opcode_pos] = opcode;
27376|      0|        } else {
27377|      0|            fd->last_opcode_pos = -1;
27378|      0|        }
27379|      0|    }
27380|    163|    return 0;
27381|    165|}
quickjs.c:emit_push_const:
23859|     43|{
23860|     43|    int idx;
23861|       |
23862|     43|    if (JS_VALUE_GET_TAG(val) == JS_TAG_STRING && as_atom) {
  ------------------
  |  |  236|     43|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (23862:9): [True: 32, False: 11]
  |  Branch (23862:51): [True: 30, False: 2]
  ------------------
23863|     30|        JSAtom atom;
23864|       |        /* warning: JS_NewAtomStr frees the string value */
23865|     30|        JS_DupValue(s->ctx, val);
23866|     30|        atom = JS_NewAtomStr(s->ctx, JS_VALUE_GET_STRING(val));
  ------------------
  |  |  230|     30|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     30|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
23867|     30|        if (atom != JS_ATOM_NULL && !__JS_AtomIsTaggedInt(atom)) {
  ------------------
  |  |  451|     60|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (23867:13): [True: 30, False: 0]
  |  Branch (23867:37): [True: 30, False: 0]
  ------------------
23868|     30|            emit_op(s, OP_push_atom_value);
23869|     30|            emit_u32(s, atom);
23870|     30|            return 0;
23871|     30|        }
23872|     30|    }
23873|       |
23874|     13|    idx = cpool_add(s, JS_DupValue(s->ctx, val));
23875|     13|    if (idx < 0)
  ------------------
  |  Branch (23875:9): [True: 0, False: 13]
  ------------------
23876|      0|        return -1;
23877|     13|    emit_op(s, OP_push_const);
23878|     13|    emit_u32(s, idx);
23879|     13|    return 0;
23880|     13|}
quickjs.c:js_parse_template:
24375|     29|{
24376|     29|    JSContext *ctx = s->ctx;
24377|     29|    JSValue raw_array, template_object;
24378|     29|    JSToken cooked;
24379|     29|    int depth, ret;
24380|       |
24381|     29|    raw_array = JS_UNDEFINED; /* avoid warning */
  ------------------
  |  |  291|     29|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     29|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
24382|     29|    template_object = JS_UNDEFINED; /* avoid warning */
  ------------------
  |  |  291|     29|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     29|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
24383|     29|    if (call) {
  ------------------
  |  Branch (24383:9): [True: 6, False: 23]
  ------------------
24384|       |        /* Create a template object: an array of cooked strings */
24385|       |        /* Create an array of raw strings and store it to the raw property */
24386|      6|        template_object = JS_NewArray(ctx);
24387|      6|        if (JS_IsException(template_object))
  ------------------
  |  Branch (24387:13): [True: 0, False: 6]
  ------------------
24388|      0|            return -1;
24389|       |        //        pool_idx = s->cur_func->cpool_count;
24390|      6|        ret = emit_push_const(s, template_object, 0);
24391|      6|        JS_FreeValue(ctx, template_object);
24392|      6|        if (ret)
  ------------------
  |  Branch (24392:13): [True: 0, False: 6]
  ------------------
24393|      0|            return -1;
24394|      6|        raw_array = JS_NewArray(ctx);
24395|      6|        if (JS_IsException(raw_array))
  ------------------
  |  Branch (24395:13): [True: 0, False: 6]
  ------------------
24396|      0|            return -1;
24397|      6|        if (JS_DefinePropertyValue(ctx, template_object, JS_ATOM_raw,
  ------------------
  |  Branch (24397:13): [True: 0, False: 6]
  ------------------
24398|      6|                                   raw_array, JS_PROP_THROW) < 0) {
  ------------------
  |  |  320|      6|#define JS_PROP_THROW            (1 << 14)
  ------------------
24399|      0|            return -1;
24400|      0|        }
24401|      6|    }
24402|       |
24403|     29|    depth = 0;
24404|     29|    while (s->token.val == TOK_TEMPLATE) {
  ------------------
  |  Branch (24404:12): [True: 29, False: 0]
  ------------------
24405|     29|        const uint8_t *p = s->token.ptr + 1;
24406|     29|        cooked = s->token;
24407|     29|        if (call) {
  ------------------
  |  Branch (24407:13): [True: 6, False: 23]
  ------------------
24408|      6|            if (JS_DefinePropertyValueUint32(ctx, raw_array, depth,
  ------------------
  |  Branch (24408:17): [True: 0, False: 6]
  ------------------
24409|      6|                                             JS_DupValue(ctx, s->token.u.str.str),
24410|      6|                                             JS_PROP_ENUMERABLE | JS_PROP_THROW) < 0) {
  ------------------
  |  |  300|      6|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                                                           JS_PROP_ENUMERABLE | JS_PROP_THROW) < 0) {
  ------------------
  |  |  320|      6|#define JS_PROP_THROW            (1 << 14)
  ------------------
24411|      0|                return -1;
24412|      0|            }
24413|       |            /* re-parse the string with escape sequences but do not throw a
24414|       |               syntax error if it contains invalid sequences
24415|       |             */
24416|      6|            if (js_parse_string(s, '`', FALSE, p, &cooked, &p)) {
  ------------------
  |  Branch (24416:17): [True: 0, False: 6]
  ------------------
24417|      0|                cooked.u.str.str = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
24418|      0|            }
24419|      6|            if (JS_DefinePropertyValueUint32(ctx, template_object, depth,
  ------------------
  |  Branch (24419:17): [True: 0, False: 6]
  ------------------
24420|      6|                                             cooked.u.str.str,
24421|      6|                                             JS_PROP_ENUMERABLE | JS_PROP_THROW) < 0) {
  ------------------
  |  |  300|      6|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                                                           JS_PROP_ENUMERABLE | JS_PROP_THROW) < 0) {
  ------------------
  |  |  320|      6|#define JS_PROP_THROW            (1 << 14)
  ------------------
24422|      0|                return -1;
24423|      0|            }
24424|     23|        } else {
24425|     23|            JSString *str;
24426|       |            /* re-parse the string with escape sequences and throw a
24427|       |               syntax error if it contains invalid sequences
24428|       |             */
24429|     23|            JS_FreeValue(ctx, s->token.u.str.str);
24430|     23|            s->token.u.str.str = JS_UNDEFINED;
  ------------------
  |  |  291|     23|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     23|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
24431|     23|            if (js_parse_string(s, '`', TRUE, p, &cooked, &p))
  ------------------
  |  Branch (24431:17): [True: 0, False: 23]
  ------------------
24432|      0|                return -1;
24433|     23|            str = JS_VALUE_GET_STRING(cooked.u.str.str);
  ------------------
  |  |  230|     23|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     23|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
24434|     23|            if (str->len != 0 || depth == 0) {
  ------------------
  |  Branch (24434:17): [True: 21, False: 2]
  |  Branch (24434:34): [True: 2, False: 0]
  ------------------
24435|     23|                ret = emit_push_const(s, cooked.u.str.str, 1);
24436|     23|                JS_FreeValue(s->ctx, cooked.u.str.str);
24437|     23|                if (ret)
  ------------------
  |  Branch (24437:21): [True: 0, False: 23]
  ------------------
24438|      0|                    return -1;
24439|     23|                if (depth == 0) {
  ------------------
  |  Branch (24439:21): [True: 23, False: 0]
  ------------------
24440|     23|                    if (s->token.u.str.sep == '`')
  ------------------
  |  Branch (24440:25): [True: 23, False: 0]
  ------------------
24441|     23|                        goto done1;
24442|      0|                    emit_op(s, OP_get_field2);
24443|      0|                    emit_atom(s, JS_ATOM_concat);
24444|      0|                }
24445|      0|                depth++;
24446|      0|            } else {
24447|      0|                JS_FreeValue(s->ctx, cooked.u.str.str);
24448|      0|            }
24449|     23|        }
24450|      6|        if (s->token.u.str.sep == '`')
  ------------------
  |  Branch (24450:13): [True: 6, False: 0]
  ------------------
24451|      6|            goto done;
24452|      0|        if (next_token(s))
  ------------------
  |  Branch (24452:13): [True: 0, False: 0]
  ------------------
24453|      0|            return -1;
24454|      0|        if (js_parse_expr(s))
  ------------------
  |  Branch (24454:13): [True: 0, False: 0]
  ------------------
24455|      0|            return -1;
24456|      0|        depth++;
24457|      0|        if (s->token.val != '}') {
  ------------------
  |  Branch (24457:13): [True: 0, False: 0]
  ------------------
24458|      0|            return js_parse_error(s, "expected '}' after template expression");
24459|      0|        }
24460|       |        /* XXX: should convert to string at this stage? */
24461|      0|        free_token(s, &s->token);
24462|       |        /* Resume TOK_TEMPLATE parsing (s->token.line_num and
24463|       |         * s->token.ptr are OK) */
24464|      0|        s->got_lf = FALSE;
24465|      0|        if (js_parse_template_part(s, s->buf_ptr))
  ------------------
  |  Branch (24465:13): [True: 0, False: 0]
  ------------------
24466|      0|            return -1;
24467|      0|    }
24468|      0|    return js_parse_expect(s, TOK_TEMPLATE);
24469|       |
24470|      6| done:
24471|      6|    if (call) {
  ------------------
  |  Branch (24471:9): [True: 6, False: 0]
  ------------------
24472|       |        /* Seal the objects */
24473|      6|        seal_template_obj(ctx, raw_array);
24474|      6|        seal_template_obj(ctx, template_object);
24475|      6|        *argc = depth + 1;
24476|      6|    } else {
24477|      0|        emit_op(s, OP_call_method);
24478|      0|        emit_u16(s, depth - 1);
24479|      0|    }
24480|     29| done1:
24481|     29|    return next_token(s);
24482|      6|}
quickjs.c:seal_template_obj:
24359|     12|{
24360|     12|    JSObject *p;
24361|     12|    JSShapeProperty *prs;
24362|       |
24363|     12|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|     12|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     12|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
24364|     12|    prs = find_own_property1(p, JS_ATOM_length);
24365|     12|    if (prs) {
  ------------------
  |  Branch (24365:9): [True: 12, False: 0]
  ------------------
24366|     12|        if (js_update_property_flags(ctx, p, &prs,
  ------------------
  |  Branch (24366:13): [True: 0, False: 12]
  ------------------
24367|     12|                                     prs->flags & ~(JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE)))
  ------------------
  |  |  298|     12|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                                   prs->flags & ~(JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE)))
  ------------------
  |  |  299|     12|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
24368|      0|            return -1;
24369|     12|    }
24370|     12|    p->extensible = FALSE;
24371|     12|    return 0;
24372|     12|}
quickjs.c:pop_scope:
24035|     13|static void pop_scope(JSParseState *s) {
24036|     13|    if (s->cur_func) {
  ------------------
  |  Branch (24036:9): [True: 13, False: 0]
  ------------------
24037|       |        /* disable scoped variables */
24038|     13|        JSFunctionDef *fd = s->cur_func;
24039|     13|        int scope = fd->scope_level;
24040|     13|        emit_op(s, OP_leave_scope);
24041|     13|        emit_u16(s, scope);
24042|     13|        fd->scope_level = fd->scopes[scope].parent;
24043|     13|        fd->scope_first = get_first_lexical_var(fd, fd->scope_level);
24044|     13|    }
24045|     13|}
quickjs.c:get_first_lexical_var:
24025|     13|{
24026|     47|    while (scope >= 0) {
  ------------------
  |  Branch (24026:12): [True: 34, False: 13]
  ------------------
24027|     34|        int scope_idx = fd->scopes[scope].first;
24028|     34|        if (scope_idx >= 0)
  ------------------
  |  Branch (24028:13): [True: 0, False: 34]
  ------------------
24029|      0|            return scope_idx;
24030|     34|        scope = fd->scopes[scope].parent;
24031|     34|    }
24032|     13|    return -1;
24033|     13|}
quickjs.c:js_parse_expect_semi:
22262|    112|{
22263|    112|    if (s->token.val != ';') {
  ------------------
  |  Branch (22263:9): [True: 44, False: 68]
  ------------------
22264|       |        /* automatic insertion of ';' */
22265|     44|        if (s->token.val == TOK_EOF || s->token.val == '}' || s->got_lf) {
  ------------------
  |  Branch (22265:13): [True: 12, False: 32]
  |  Branch (22265:40): [True: 0, False: 32]
  |  Branch (22265:63): [True: 31, False: 1]
  ------------------
22266|     43|            return 0;
22267|     43|        }
22268|      1|        return js_parse_error(s, "expecting '%c'", ';');
22269|     44|    }
22270|     68|    return next_token(s);
22271|    112|}
quickjs.c:emit_source_pos:
23736|    277|{
23737|    277|    JSFunctionDef *fd = s->cur_func;
23738|    277|    DynBuf *bc = &fd->byte_code;
23739|       |
23740|    277|    if (unlikely(fd->last_opcode_source_ptr != source_ptr)) {
  ------------------
  |  |   33|    277|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 203, False: 74]
  |  |  ------------------
  ------------------
23741|    203|        dbuf_putc(bc, OP_line_num);
23742|    203|        dbuf_put_u32(bc, source_ptr - s->buf_start);
23743|    203|        fd->last_opcode_source_ptr = source_ptr;
23744|    203|    }
23745|    277|}
quickjs.c:get_prev_opcode:
23692|    169|static inline int get_prev_opcode(JSFunctionDef *fd) {
23693|    169|    if (fd->last_opcode_pos < 0 || dbuf_error(&fd->byte_code))
  ------------------
  |  Branch (23693:9): [True: 0, False: 169]
  |  Branch (23693:36): [True: 0, False: 169]
  ------------------
23694|      0|        return OP_invalid;
23695|    169|    else
23696|    169|        return fd->byte_code.buf[fd->last_opcode_pos];
23697|    169|}
quickjs.c:has_with_scope:
25797|     20|{
25798|     60|    while (s) {
  ------------------
  |  Branch (25798:12): [True: 40, False: 20]
  ------------------
25799|       |        /* no with in strict mode */
25800|     40|        if (!(s->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  403|     40|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (25800:13): [True: 40, False: 0]
  ------------------
25801|     40|            int scope_idx = s->scopes[scope_level].first;
25802|     51|            while (scope_idx >= 0) {
  ------------------
  |  Branch (25802:20): [True: 11, False: 40]
  ------------------
25803|     11|                JSVarDef *vd = &s->vars[scope_idx];
25804|     11|                if (vd->var_name == JS_ATOM__with_)
  ------------------
  |  Branch (25804:21): [True: 0, False: 11]
  ------------------
25805|      0|                    return TRUE;
25806|     11|                scope_idx = vd->scope_next;
25807|     11|            }
25808|     40|        }
25809|       |        /* check parent scopes */
25810|     40|        scope_level = s->parent_scope_level;
25811|     40|        s = s->parent;
25812|     40|    }
25813|     20|    return FALSE;
25814|     20|}
quickjs.c:token_is_ident:
24496|     75|{
24497|       |    /* Accept keywords and reserved words as property names */
24498|     75|    return (tok == TOK_IDENT ||
  ------------------
  |  Branch (24498:13): [True: 73, False: 2]
  ------------------
24499|      2|            (tok >= TOK_FIRST_KEYWORD &&
  ------------------
  |  |21765|      4|#define TOK_FIRST_KEYWORD   TOK_NULL
  ------------------
  |  Branch (24499:14): [True: 0, False: 2]
  ------------------
24500|      0|             tok <= TOK_LAST_KEYWORD));
  ------------------
  |  |21766|      0|#define TOK_LAST_KEYWORD    TOK_AWAIT
  ------------------
  |  Branch (24500:14): [True: 0, False: 0]
  ------------------
24501|     75|}
quickjs.c:js_parse_expr:
28197|     95|{
28198|     95|    return js_parse_expr2(s, PF_IN_ACCEPTED);
  ------------------
  |  |24968|     95|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
28199|     95|}
quickjs.c:js_parse_expr2:
28173|     95|{
28174|     95|    BOOL comma = FALSE;
28175|     99|    for(;;) {
28176|     99|        if (js_parse_assign_expr2(s, parse_flags))
  ------------------
  |  Branch (28176:13): [True: 3, False: 96]
  ------------------
28177|      3|            return -1;
28178|     96|        if (comma) {
  ------------------
  |  Branch (28178:13): [True: 4, False: 92]
  ------------------
28179|       |            /* prevent get_lvalue from using the last expression
28180|       |               as an lvalue. This also prevents the conversion of
28181|       |               of get_var to get_ref for method lookup in function
28182|       |               call inside `with` statement.
28183|       |             */
28184|      4|            s->cur_func->last_opcode_pos = -1;
28185|      4|        }
28186|     96|        if (s->token.val != ',')
  ------------------
  |  Branch (28186:13): [True: 92, False: 4]
  ------------------
28187|     92|            break;
28188|      4|        comma = TRUE;
28189|      4|        if (next_token(s))
  ------------------
  |  Branch (28189:13): [True: 0, False: 4]
  ------------------
28190|      0|            return -1;
28191|      4|        emit_op(s, OP_drop);
28192|      4|    }
28193|     92|    return 0;
28194|     95|}
quickjs.c:js_parse_assign_expr2:
27883|    153|{
27884|    153|    int opcode, op, scope, skip_bits;
27885|    153|    JSAtom name0 = JS_ATOM_NULL;
  ------------------
  |  |  451|    153|#define JS_ATOM_NULL 0
  ------------------
27886|    153|    JSAtom name;
27887|       |
27888|    153|    if (s->token.val == TOK_YIELD) {
  ------------------
  |  Branch (27888:9): [True: 0, False: 153]
  ------------------
27889|      0|        BOOL is_star = FALSE, is_async;
27890|       |
27891|      0|        if (!(s->cur_func->func_kind & JS_FUNC_GENERATOR))
  ------------------
  |  Branch (27891:13): [True: 0, False: 0]
  ------------------
27892|      0|            return js_parse_error(s, "unexpected 'yield' keyword");
27893|      0|        if (!s->cur_func->in_function_body)
  ------------------
  |  Branch (27893:13): [True: 0, False: 0]
  ------------------
27894|      0|            return js_parse_error(s, "yield in default expression");
27895|      0|        if (next_token(s))
  ------------------
  |  Branch (27895:13): [True: 0, False: 0]
  ------------------
27896|      0|            return -1;
27897|       |        /* XXX: is there a better method to detect 'yield' without
27898|       |           parameters ? */
27899|      0|        if (s->token.val != ';' && s->token.val != ')' &&
  ------------------
  |  Branch (27899:13): [True: 0, False: 0]
  |  Branch (27899:36): [True: 0, False: 0]
  ------------------
27900|      0|            s->token.val != ']' && s->token.val != '}' &&
  ------------------
  |  Branch (27900:13): [True: 0, False: 0]
  |  Branch (27900:36): [True: 0, False: 0]
  ------------------
27901|      0|            s->token.val != ',' && s->token.val != ':' && !s->got_lf) {
  ------------------
  |  Branch (27901:13): [True: 0, False: 0]
  |  Branch (27901:36): [True: 0, False: 0]
  |  Branch (27901:59): [True: 0, False: 0]
  ------------------
27902|      0|            if (s->token.val == '*') {
  ------------------
  |  Branch (27902:17): [True: 0, False: 0]
  ------------------
27903|      0|                is_star = TRUE;
27904|      0|                if (next_token(s))
  ------------------
  |  Branch (27904:21): [True: 0, False: 0]
  ------------------
27905|      0|                    return -1;
27906|      0|            }
27907|      0|            if (js_parse_assign_expr2(s, parse_flags))
  ------------------
  |  Branch (27907:17): [True: 0, False: 0]
  ------------------
27908|      0|                return -1;
27909|      0|        } else {
27910|      0|            emit_op(s, OP_undefined);
27911|      0|        }
27912|      0|        is_async = (s->cur_func->func_kind == JS_FUNC_ASYNC_GENERATOR);
27913|       |
27914|      0|        if (is_star) {
  ------------------
  |  Branch (27914:13): [True: 0, False: 0]
  ------------------
27915|      0|            int label_loop, label_return, label_next;
27916|      0|            int label_return1, label_yield, label_throw, label_throw1;
27917|      0|            int label_throw2;
27918|       |
27919|      0|            label_loop = new_label(s);
27920|      0|            label_yield = new_label(s);
27921|       |
27922|      0|            emit_op(s, is_async ? OP_for_await_of_start : OP_for_of_start);
  ------------------
  |  Branch (27922:24): [True: 0, False: 0]
  ------------------
27923|       |
27924|       |            /* remove the catch offset (XXX: could avoid pushing back
27925|       |               undefined) */
27926|      0|            emit_op(s, OP_drop);
27927|      0|            emit_op(s, OP_undefined);
27928|       |
27929|      0|            emit_op(s, OP_undefined); /* initial value */
27930|       |
27931|      0|            emit_label(s, label_loop);
27932|      0|            emit_op(s, OP_iterator_next);
27933|      0|            if (is_async)
  ------------------
  |  Branch (27933:17): [True: 0, False: 0]
  ------------------
27934|      0|                emit_op(s, OP_await);
27935|      0|            emit_op(s, OP_iterator_check_object);
27936|      0|            emit_op(s, OP_get_field2);
27937|      0|            emit_atom(s, JS_ATOM_done);
27938|      0|            label_next = emit_goto(s, OP_if_true, -1); /* end of loop */
27939|      0|            emit_label(s, label_yield);
27940|      0|            if (is_async) {
  ------------------
  |  Branch (27940:17): [True: 0, False: 0]
  ------------------
27941|       |                /* OP_async_yield_star takes the value as parameter */
27942|      0|                emit_op(s, OP_get_field);
27943|      0|                emit_atom(s, JS_ATOM_value);
27944|      0|                emit_op(s, OP_async_yield_star);
27945|      0|            } else {
27946|       |                /* OP_yield_star takes (value, done) as parameter */
27947|      0|                emit_op(s, OP_yield_star);
27948|      0|            }
27949|      0|            emit_op(s, OP_dup);
27950|      0|            label_return = emit_goto(s, OP_if_true, -1);
27951|      0|            emit_op(s, OP_drop);
27952|      0|            emit_goto(s, OP_goto, label_loop);
27953|       |
27954|      0|            emit_label(s, label_return);
27955|      0|            emit_op(s, OP_push_i32);
27956|      0|            emit_u32(s, 2);
27957|      0|            emit_op(s, OP_strict_eq);
27958|      0|            label_throw = emit_goto(s, OP_if_true, -1);
27959|       |
27960|       |            /* return handling */
27961|      0|            if (is_async)
  ------------------
  |  Branch (27961:17): [True: 0, False: 0]
  ------------------
27962|      0|                emit_op(s, OP_await);
27963|      0|            emit_op(s, OP_iterator_call);
27964|      0|            emit_u8(s, 0);
27965|      0|            label_return1 = emit_goto(s, OP_if_true, -1);
27966|      0|            if (is_async)
  ------------------
  |  Branch (27966:17): [True: 0, False: 0]
  ------------------
27967|      0|                emit_op(s, OP_await);
27968|      0|            emit_op(s, OP_iterator_check_object);
27969|      0|            emit_op(s, OP_get_field2);
27970|      0|            emit_atom(s, JS_ATOM_done);
27971|      0|            emit_goto(s, OP_if_false, label_yield);
27972|       |
27973|      0|            emit_op(s, OP_get_field);
27974|      0|            emit_atom(s, JS_ATOM_value);
27975|       |
27976|      0|            emit_label(s, label_return1);
27977|      0|            emit_op(s, OP_nip);
27978|      0|            emit_op(s, OP_nip);
27979|      0|            emit_op(s, OP_nip);
27980|      0|            emit_return(s, TRUE);
27981|       |
27982|       |            /* throw handling */
27983|      0|            emit_label(s, label_throw);
27984|      0|            emit_op(s, OP_iterator_call);
27985|      0|            emit_u8(s, 1);
27986|      0|            label_throw1 = emit_goto(s, OP_if_true, -1);
27987|      0|            if (is_async)
  ------------------
  |  Branch (27987:17): [True: 0, False: 0]
  ------------------
27988|      0|                emit_op(s, OP_await);
27989|      0|            emit_op(s, OP_iterator_check_object);
27990|      0|            emit_op(s, OP_get_field2);
27991|      0|            emit_atom(s, JS_ATOM_done);
27992|      0|            emit_goto(s, OP_if_false, label_yield);
27993|      0|            emit_goto(s, OP_goto, label_next);
27994|       |            /* close the iterator and throw a type error exception */
27995|      0|            emit_label(s, label_throw1);
27996|      0|            emit_op(s, OP_iterator_call);
27997|      0|            emit_u8(s, 2);
27998|      0|            label_throw2 = emit_goto(s, OP_if_true, -1);
27999|      0|            if (is_async)
  ------------------
  |  Branch (27999:17): [True: 0, False: 0]
  ------------------
28000|      0|                emit_op(s, OP_await);
28001|      0|            emit_label(s, label_throw2);
28002|       |
28003|      0|            emit_op(s, OP_throw_error);
28004|      0|            emit_atom(s, JS_ATOM_NULL);
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
28005|      0|            emit_u8(s, JS_THROW_ERROR_ITERATOR_THROW);
  ------------------
  |  |18363|      0|#define JS_THROW_ERROR_ITERATOR_THROW 4
  ------------------
28006|       |
28007|      0|            emit_label(s, label_next);
28008|      0|            emit_op(s, OP_get_field);
28009|      0|            emit_atom(s, JS_ATOM_value);
28010|      0|            emit_op(s, OP_nip); /* keep the value associated with
28011|       |                                   done = true */
28012|      0|            emit_op(s, OP_nip);
28013|      0|            emit_op(s, OP_nip);
28014|      0|        } else {
28015|      0|            int label_next;
28016|       |
28017|      0|            if (is_async)
  ------------------
  |  Branch (28017:17): [True: 0, False: 0]
  ------------------
28018|      0|                emit_op(s, OP_await);
28019|      0|            emit_op(s, OP_yield);
28020|      0|            label_next = emit_goto(s, OP_if_false, -1);
28021|      0|            emit_return(s, TRUE);
28022|      0|            emit_label(s, label_next);
28023|      0|        }
28024|      0|        return 0;
28025|    153|    } else if (s->token.val == '(' &&
  ------------------
  |  Branch (28025:16): [True: 2, False: 151]
  ------------------
28026|      2|               js_parse_skip_parens_token(s, NULL, TRUE) == TOK_ARROW) {
  ------------------
  |  Branch (28026:16): [True: 2, False: 0]
  ------------------
28027|      2|        return js_parse_function_decl(s, JS_PARSE_FUNC_ARROW,
28028|      2|                                      JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
28029|      2|                                      s->token.ptr);
28030|    151|    } else if (token_is_pseudo_keyword(s, JS_ATOM_async)) {
  ------------------
  |  Branch (28030:16): [True: 0, False: 151]
  ------------------
28031|      0|        const uint8_t *source_ptr;
28032|      0|        int tok;
28033|      0|        JSParsePos pos;
28034|       |
28035|       |        /* fast test */
28036|      0|        tok = peek_token(s, TRUE);
28037|      0|        if (tok == TOK_FUNCTION || tok == '\n')
  ------------------
  |  Branch (28037:13): [True: 0, False: 0]
  |  Branch (28037:36): [True: 0, False: 0]
  ------------------
28038|      0|            goto next;
28039|       |
28040|      0|        source_ptr = s->token.ptr;
28041|      0|        js_parse_get_pos(s, &pos);
28042|      0|        if (next_token(s))
  ------------------
  |  Branch (28042:13): [True: 0, False: 0]
  ------------------
28043|      0|            return -1;
28044|      0|        if ((s->token.val == '(' &&
  ------------------
  |  Branch (28044:14): [True: 0, False: 0]
  ------------------
28045|      0|             js_parse_skip_parens_token(s, NULL, TRUE) == TOK_ARROW) ||
  ------------------
  |  Branch (28045:14): [True: 0, False: 0]
  ------------------
28046|      0|            (s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved &&
  ------------------
  |  Branch (28046:14): [True: 0, False: 0]
  |  Branch (28046:43): [True: 0, False: 0]
  ------------------
28047|      0|             peek_token(s, TRUE) == TOK_ARROW)) {
  ------------------
  |  Branch (28047:14): [True: 0, False: 0]
  ------------------
28048|      0|            return js_parse_function_decl(s, JS_PARSE_FUNC_ARROW,
28049|      0|                                          JS_FUNC_ASYNC, JS_ATOM_NULL,
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
28050|      0|                                          source_ptr);
28051|      0|        } else {
28052|       |            /* undo the token parsing */
28053|      0|            if (js_parse_seek_token(s, &pos))
  ------------------
  |  Branch (28053:17): [True: 0, False: 0]
  ------------------
28054|      0|                return -1;
28055|      0|        }
28056|    151|    } else if (s->token.val == TOK_IDENT &&
  ------------------
  |  Branch (28056:16): [True: 113, False: 38]
  ------------------
28057|    113|               peek_token(s, TRUE) == TOK_ARROW) {
  ------------------
  |  Branch (28057:16): [True: 0, False: 113]
  ------------------
28058|      0|        return js_parse_function_decl(s, JS_PARSE_FUNC_ARROW,
28059|      0|                                      JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
28060|      0|                                      s->token.ptr);
28061|    151|    } else if ((s->token.val == '{' || s->token.val == '[') &&
  ------------------
  |  Branch (28061:17): [True: 0, False: 151]
  |  Branch (28061:40): [True: 0, False: 151]
  ------------------
28062|      0|               js_parse_skip_parens_token(s, &skip_bits, FALSE) == '=') {
  ------------------
  |  Branch (28062:16): [True: 0, False: 0]
  ------------------
28063|      0|        if (js_parse_destructuring_element(s, 0, 0, FALSE, skip_bits & SKIP_HAS_ELLIPSIS, TRUE, FALSE) < 0)
  ------------------
  |  |24666|      0|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
  |  Branch (28063:13): [True: 0, False: 0]
  ------------------
28064|      0|            return -1;
28065|      0|        return 0;
28066|      0|    }
28067|    151| next:
28068|    151|    if (s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (28068:9): [True: 113, False: 38]
  ------------------
28069|       |        /* name0 is used to check for OP_set_name pattern, not duplicated */
28070|    113|        name0 = s->token.u.ident.atom;
28071|    113|    }
28072|    151|    if (js_parse_cond_expr(s, parse_flags))
  ------------------
  |  Branch (28072:9): [True: 3, False: 148]
  ------------------
28073|      3|        return -1;
28074|       |
28075|    148|    op = s->token.val;
28076|    148|    if (op == '=' || (op >= TOK_MUL_ASSIGN && op <= TOK_POW_ASSIGN)) {
  ------------------
  |  Branch (28076:9): [True: 42, False: 106]
  |  Branch (28076:23): [True: 83, False: 23]
  |  Branch (28076:47): [True: 2, False: 81]
  ------------------
28077|     44|        int label;
28078|     44|        const uint8_t *op_token_ptr;
28079|     44|        op_token_ptr = s->token.ptr;
28080|     44|        if (next_token(s))
  ------------------
  |  Branch (28080:13): [True: 0, False: 44]
  ------------------
28081|      0|            return -1;
28082|     44|        if (get_lvalue(s, &opcode, &scope, &name, &label, NULL, (op != '='), op) < 0)
  ------------------
  |  Branch (28082:13): [True: 0, False: 44]
  ------------------
28083|      0|            return -1;
28084|       |
28085|     44|        if (js_parse_assign_expr2(s, parse_flags)) {
  ------------------
  |  Branch (28085:13): [True: 0, False: 44]
  ------------------
28086|      0|            JS_FreeAtom(s->ctx, name);
28087|      0|            return -1;
28088|      0|        }
28089|       |
28090|     44|        if (op == '=') {
  ------------------
  |  Branch (28090:13): [True: 42, False: 2]
  ------------------
28091|     42|            if ((opcode == OP_get_ref_value || opcode == OP_scope_get_var) && name == name0) {
  ------------------
  |  Branch (28091:18): [True: 0, False: 42]
  |  Branch (28091:48): [True: 8, False: 34]
  |  Branch (28091:79): [True: 8, False: 0]
  ------------------
28092|      8|                set_object_name(s, name);
28093|      8|            }
28094|     42|        } else {
28095|      2|            static const uint8_t assign_opcodes[] = {
28096|      2|                OP_mul, OP_div, OP_mod, OP_add, OP_sub,
28097|      2|                OP_shl, OP_sar, OP_shr, OP_and, OP_xor, OP_or,
28098|      2|                OP_pow,
28099|      2|            };
28100|      2|            op = assign_opcodes[op - TOK_MUL_ASSIGN];
28101|      2|            emit_source_pos(s, op_token_ptr);
28102|      2|            emit_op(s, op);
28103|      2|        }
28104|     44|        put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_KEEP_TOP, FALSE);
28105|    104|    } else if (op >= TOK_LAND_ASSIGN && op <= TOK_DOUBLE_QUESTION_MARK_ASSIGN) {
  ------------------
  |  Branch (28105:16): [True: 81, False: 23]
  |  Branch (28105:41): [True: 0, False: 81]
  ------------------
28106|      0|        int label, label1, depth_lvalue, label2;
28107|       |
28108|      0|        if (next_token(s))
  ------------------
  |  Branch (28108:13): [True: 0, False: 0]
  ------------------
28109|      0|            return -1;
28110|      0|        if (get_lvalue(s, &opcode, &scope, &name, &label,
  ------------------
  |  Branch (28110:13): [True: 0, False: 0]
  ------------------
28111|      0|                       &depth_lvalue, TRUE, op) < 0)
28112|      0|            return -1;
28113|       |
28114|      0|        emit_op(s, OP_dup);
28115|      0|        if (op == TOK_DOUBLE_QUESTION_MARK_ASSIGN)
  ------------------
  |  Branch (28115:13): [True: 0, False: 0]
  ------------------
28116|      0|            emit_op(s, OP_is_undefined_or_null);
28117|      0|        label1 = emit_goto(s, op == TOK_LOR_ASSIGN ? OP_if_true : OP_if_false,
  ------------------
  |  Branch (28117:31): [True: 0, False: 0]
  ------------------
28118|      0|                           -1);
28119|      0|        emit_op(s, OP_drop);
28120|       |
28121|      0|        if (js_parse_assign_expr2(s, parse_flags)) {
  ------------------
  |  Branch (28121:13): [True: 0, False: 0]
  ------------------
28122|      0|            JS_FreeAtom(s->ctx, name);
28123|      0|            return -1;
28124|      0|        }
28125|       |
28126|      0|        if ((opcode == OP_get_ref_value || opcode == OP_scope_get_var) && name == name0) {
  ------------------
  |  Branch (28126:14): [True: 0, False: 0]
  |  Branch (28126:44): [True: 0, False: 0]
  |  Branch (28126:75): [True: 0, False: 0]
  ------------------
28127|      0|            set_object_name(s, name);
28128|      0|        }
28129|       |
28130|      0|        switch(depth_lvalue) {
28131|      0|        case 0:
  ------------------
  |  Branch (28131:9): [True: 0, False: 0]
  ------------------
28132|      0|            emit_op(s, OP_dup);
28133|      0|            break;
28134|      0|        case 1:
  ------------------
  |  Branch (28134:9): [True: 0, False: 0]
  ------------------
28135|      0|            emit_op(s, OP_insert2);
28136|      0|            break;
28137|      0|        case 2:
  ------------------
  |  Branch (28137:9): [True: 0, False: 0]
  ------------------
28138|      0|            emit_op(s, OP_insert3);
28139|      0|            break;
28140|      0|        case 3:
  ------------------
  |  Branch (28140:9): [True: 0, False: 0]
  ------------------
28141|      0|            emit_op(s, OP_insert4);
28142|      0|            break;
28143|      0|        default:
  ------------------
  |  Branch (28143:9): [True: 0, False: 0]
  ------------------
28144|      0|            abort();
28145|      0|        }
28146|       |
28147|       |        /* XXX: we disable the OP_put_ref_value optimization by not
28148|       |           using put_lvalue() otherwise depth_lvalue is not correct */
28149|      0|        put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_NOKEEP_DEPTH,
28150|      0|                   FALSE);
28151|      0|        label2 = emit_goto(s, OP_goto, -1);
28152|       |
28153|      0|        emit_label(s, label1);
28154|       |
28155|       |        /* remove the lvalue stack entries */
28156|      0|        while (depth_lvalue != 0) {
  ------------------
  |  Branch (28156:16): [True: 0, False: 0]
  ------------------
28157|      0|            emit_op(s, OP_nip);
28158|      0|            depth_lvalue--;
28159|      0|        }
28160|       |
28161|      0|        emit_label(s, label2);
28162|      0|    }
28163|    148|    return 0;
28164|    148|}
quickjs.c:js_parse_cond_expr:
27854|    151|{
27855|    151|    int label1, label2;
27856|       |
27857|    151|    if (js_parse_coalesce_expr(s, parse_flags))
  ------------------
  |  Branch (27857:9): [True: 3, False: 148]
  ------------------
27858|      3|        return -1;
27859|    148|    if (s->token.val == '?') {
  ------------------
  |  Branch (27859:9): [True: 0, False: 148]
  ------------------
27860|      0|        if (next_token(s))
  ------------------
  |  Branch (27860:13): [True: 0, False: 0]
  ------------------
27861|      0|            return -1;
27862|      0|        label1 = emit_goto(s, OP_if_false, -1);
27863|       |
27864|      0|        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (27864:13): [True: 0, False: 0]
  ------------------
27865|      0|            return -1;
27866|      0|        if (js_parse_expect(s, ':'))
  ------------------
  |  Branch (27866:13): [True: 0, False: 0]
  ------------------
27867|      0|            return -1;
27868|       |
27869|      0|        label2 = emit_goto(s, OP_goto, -1);
27870|       |
27871|      0|        emit_label(s, label1);
27872|       |
27873|      0|        if (js_parse_assign_expr2(s, parse_flags & PF_IN_ACCEPTED))
  ------------------
  |  |24968|      0|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
  |  Branch (27873:13): [True: 0, False: 0]
  ------------------
27874|      0|            return -1;
27875|       |
27876|      0|        emit_label(s, label2);
27877|      0|    }
27878|    148|    return 0;
27879|    148|}
quickjs.c:js_parse_coalesce_expr:
27826|    151|{
27827|    151|    int label1;
27828|       |
27829|    151|    if (js_parse_logical_and_or(s, TOK_LOR, parse_flags))
  ------------------
  |  Branch (27829:9): [True: 3, False: 148]
  ------------------
27830|      3|        return -1;
27831|    148|    if (s->token.val == TOK_DOUBLE_QUESTION_MARK) {
  ------------------
  |  Branch (27831:9): [True: 0, False: 148]
  ------------------
27832|      0|        label1 = new_label(s);
27833|      0|        for(;;) {
27834|      0|            if (next_token(s))
  ------------------
  |  Branch (27834:17): [True: 0, False: 0]
  ------------------
27835|      0|                return -1;
27836|       |
27837|      0|            emit_op(s, OP_dup);
27838|      0|            emit_op(s, OP_is_undefined_or_null);
27839|      0|            emit_goto(s, OP_if_false, label1);
27840|      0|            emit_op(s, OP_drop);
27841|       |
27842|      0|            if (js_parse_expr_binary(s, 8, parse_flags))
  ------------------
  |  Branch (27842:17): [True: 0, False: 0]
  ------------------
27843|      0|                return -1;
27844|      0|            if (s->token.val != TOK_DOUBLE_QUESTION_MARK)
  ------------------
  |  Branch (27844:17): [True: 0, False: 0]
  ------------------
27845|      0|                break;
27846|      0|        }
27847|      0|        emit_label(s, label1);
27848|      0|    }
27849|    148|    return 0;
27850|    148|}
quickjs.c:js_parse_logical_and_or:
27785|    302|{
27786|    302|    int label1;
27787|       |
27788|    302|    if (op == TOK_LAND) {
  ------------------
  |  Branch (27788:9): [True: 151, False: 151]
  ------------------
27789|    151|        if (js_parse_expr_binary(s, 8, parse_flags))
  ------------------
  |  Branch (27789:13): [True: 3, False: 148]
  ------------------
27790|      3|            return -1;
27791|    151|    } else {
27792|    151|        if (js_parse_logical_and_or(s, TOK_LAND, parse_flags))
  ------------------
  |  Branch (27792:13): [True: 3, False: 148]
  ------------------
27793|      3|            return -1;
27794|    151|    }
27795|    296|    if (s->token.val == op) {
  ------------------
  |  Branch (27795:9): [True: 0, False: 296]
  ------------------
27796|      0|        label1 = new_label(s);
27797|       |
27798|      0|        for(;;) {
27799|      0|            if (next_token(s))
  ------------------
  |  Branch (27799:17): [True: 0, False: 0]
  ------------------
27800|      0|                return -1;
27801|      0|            emit_op(s, OP_dup);
27802|      0|            emit_goto(s, op == TOK_LAND ? OP_if_false : OP_if_true, label1);
  ------------------
  |  Branch (27802:26): [True: 0, False: 0]
  ------------------
27803|      0|            emit_op(s, OP_drop);
27804|       |
27805|      0|            if (op == TOK_LAND) {
  ------------------
  |  Branch (27805:17): [True: 0, False: 0]
  ------------------
27806|      0|                if (js_parse_expr_binary(s, 8, parse_flags))
  ------------------
  |  Branch (27806:21): [True: 0, False: 0]
  ------------------
27807|      0|                    return -1;
27808|      0|            } else {
27809|      0|                if (js_parse_logical_and_or(s, TOK_LAND,
  ------------------
  |  Branch (27809:21): [True: 0, False: 0]
  ------------------
27810|      0|                                            parse_flags))
27811|      0|                    return -1;
27812|      0|            }
27813|      0|            if (s->token.val != op) {
  ------------------
  |  Branch (27813:17): [True: 0, False: 0]
  ------------------
27814|      0|                if (s->token.val == TOK_DOUBLE_QUESTION_MARK)
  ------------------
  |  Branch (27814:21): [True: 0, False: 0]
  ------------------
27815|      0|                    return js_parse_error(s, "cannot mix ?? with && or ||");
27816|      0|                break;
27817|      0|            }
27818|      0|        }
27819|       |
27820|      0|        emit_label(s, label1);
27821|      0|    }
27822|    296|    return 0;
27823|    296|}
quickjs.c:js_parse_expr_binary:
27618|  1.38k|{
27619|  1.38k|    int op, opcode;
27620|  1.38k|    const uint8_t *op_token_ptr;
27621|       |    
27622|  1.38k|    if (level == 0) {
  ------------------
  |  Branch (27622:9): [True: 165, False: 1.21k]
  ------------------
27623|    165|        return js_parse_unary(s, PF_POW_ALLOWED);
  ------------------
  |  |24972|    165|#define PF_POW_ALLOWED  (1 << 2)
  ------------------
27624|  1.21k|    } else if (s->token.val == TOK_PRIVATE_NAME &&
  ------------------
  |  Branch (27624:16): [True: 0, False: 1.21k]
  ------------------
27625|      0|               (parse_flags & PF_IN_ACCEPTED) && level == 4 &&
  ------------------
  |  |24968|      0|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
  |  Branch (27625:16): [True: 0, False: 0]
  |  Branch (27625:50): [True: 0, False: 0]
  ------------------
27626|      0|               peek_token(s, FALSE) == TOK_IN) {
  ------------------
  |  Branch (27626:16): [True: 0, False: 0]
  ------------------
27627|      0|        JSAtom atom;
27628|       |
27629|      0|        atom = JS_DupAtom(s->ctx, s->token.u.ident.atom);
27630|      0|        if (next_token(s))
  ------------------
  |  Branch (27630:13): [True: 0, False: 0]
  ------------------
27631|      0|            goto fail_private_in;
27632|      0|        if (s->token.val != TOK_IN)
  ------------------
  |  Branch (27632:13): [True: 0, False: 0]
  ------------------
27633|      0|            goto fail_private_in;
27634|      0|        if (next_token(s))
  ------------------
  |  Branch (27634:13): [True: 0, False: 0]
  ------------------
27635|      0|            goto fail_private_in;
27636|      0|        if (js_parse_expr_binary(s, level - 1, parse_flags)) {
  ------------------
  |  Branch (27636:13): [True: 0, False: 0]
  ------------------
27637|      0|        fail_private_in:
27638|      0|            JS_FreeAtom(s->ctx, atom);
27639|      0|            return -1;
27640|      0|        }
27641|      0|        emit_op(s, OP_scope_in_private_field);
27642|      0|        emit_atom(s, atom);
27643|      0|        emit_u16(s, s->cur_func->scope_level);
27644|      0|        JS_FreeAtom(s->ctx, atom);
27645|      0|        return 0;
27646|  1.21k|    } else {
27647|  1.21k|        if (js_parse_expr_binary(s, level - 1, parse_flags))
  ------------------
  |  Branch (27647:13): [True: 24, False: 1.19k]
  ------------------
27648|     24|            return -1;
27649|  1.21k|    }
27650|  1.20k|    for(;;) {
27651|  1.20k|        op = s->token.val;
27652|  1.20k|        op_token_ptr = s->token.ptr;
27653|  1.20k|        switch(level) {
27654|    162|        case 1:
  ------------------
  |  Branch (27654:9): [True: 162, False: 1.04k]
  ------------------
27655|    162|            switch(op) {
27656|      6|            case '*':
  ------------------
  |  Branch (27656:13): [True: 6, False: 156]
  ------------------
27657|      6|                opcode = OP_mul;
27658|      6|                break;
27659|      0|            case '/':
  ------------------
  |  Branch (27659:13): [True: 0, False: 162]
  ------------------
27660|      0|                opcode = OP_div;
27661|      0|                break;
27662|      4|            case '%':
  ------------------
  |  Branch (27662:13): [True: 4, False: 158]
  ------------------
27663|      4|                opcode = OP_mod;
27664|      4|                break;
27665|    152|            default:
  ------------------
  |  Branch (27665:13): [True: 152, False: 10]
  ------------------
27666|    152|                return 0;
27667|    162|            }
27668|     10|            break;
27669|    152|        case 2:
  ------------------
  |  Branch (27669:9): [True: 152, False: 1.05k]
  ------------------
27670|    152|            switch(op) {
27671|      3|            case '+':
  ------------------
  |  Branch (27671:13): [True: 3, False: 149]
  ------------------
27672|      3|                opcode = OP_add;
27673|      3|                break;
27674|      0|            case '-':
  ------------------
  |  Branch (27674:13): [True: 0, False: 152]
  ------------------
27675|      0|                opcode = OP_sub;
27676|      0|                break;
27677|    149|            default:
  ------------------
  |  Branch (27677:13): [True: 149, False: 3]
  ------------------
27678|    149|                return 0;
27679|    152|            }
27680|      3|            break;
27681|    149|        case 3:
  ------------------
  |  Branch (27681:9): [True: 149, False: 1.05k]
  ------------------
27682|    149|            switch(op) {
27683|      0|            case TOK_SHL:
  ------------------
  |  Branch (27683:13): [True: 0, False: 149]
  ------------------
27684|      0|                opcode = OP_shl;
27685|      0|                break;
27686|      0|            case TOK_SAR:
  ------------------
  |  Branch (27686:13): [True: 0, False: 149]
  ------------------
27687|      0|                opcode = OP_sar;
27688|      0|                break;
27689|      0|            case TOK_SHR:
  ------------------
  |  Branch (27689:13): [True: 0, False: 149]
  ------------------
27690|      0|                opcode = OP_shr;
27691|      0|                break;
27692|    149|            default:
  ------------------
  |  Branch (27692:13): [True: 149, False: 0]
  ------------------
27693|    149|                return 0;
27694|    149|            }
27695|      0|            break;
27696|    149|        case 4:
  ------------------
  |  Branch (27696:9): [True: 149, False: 1.05k]
  ------------------
27697|    149|            switch(op) {
27698|      0|            case '<':
  ------------------
  |  Branch (27698:13): [True: 0, False: 149]
  ------------------
27699|      0|                opcode = OP_lt;
27700|      0|                break;
27701|      0|            case '>':
  ------------------
  |  Branch (27701:13): [True: 0, False: 149]
  ------------------
27702|      0|                opcode = OP_gt;
27703|      0|                break;
27704|      0|            case TOK_LTE:
  ------------------
  |  Branch (27704:13): [True: 0, False: 149]
  ------------------
27705|      0|                opcode = OP_lte;
27706|      0|                break;
27707|      0|            case TOK_GTE:
  ------------------
  |  Branch (27707:13): [True: 0, False: 149]
  ------------------
27708|      0|                opcode = OP_gte;
27709|      0|                break;
27710|      0|            case TOK_INSTANCEOF:
  ------------------
  |  Branch (27710:13): [True: 0, False: 149]
  ------------------
27711|      0|                opcode = OP_instanceof;
27712|      0|                break;
27713|      0|            case TOK_IN:
  ------------------
  |  Branch (27713:13): [True: 0, False: 149]
  ------------------
27714|      0|                if (parse_flags & PF_IN_ACCEPTED) {
  ------------------
  |  |24968|      0|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
  |  Branch (27714:21): [True: 0, False: 0]
  ------------------
27715|      0|                    opcode = OP_in;
27716|      0|                } else {
27717|      0|                    return 0;
27718|      0|                }
27719|      0|                break;
27720|    149|            default:
  ------------------
  |  Branch (27720:13): [True: 149, False: 0]
  ------------------
27721|    149|                return 0;
27722|    149|            }
27723|      0|            break;
27724|    149|        case 5:
  ------------------
  |  Branch (27724:9): [True: 149, False: 1.05k]
  ------------------
27725|    149|            switch(op) {
27726|      0|            case TOK_EQ:
  ------------------
  |  Branch (27726:13): [True: 0, False: 149]
  ------------------
27727|      0|                opcode = OP_eq;
27728|      0|                break;
27729|      0|            case TOK_NEQ:
  ------------------
  |  Branch (27729:13): [True: 0, False: 149]
  ------------------
27730|      0|                opcode = OP_neq;
27731|      0|                break;
27732|      0|            case TOK_STRICT_EQ:
  ------------------
  |  Branch (27732:13): [True: 0, False: 149]
  ------------------
27733|      0|                opcode = OP_strict_eq;
27734|      0|                break;
27735|      0|            case TOK_STRICT_NEQ:
  ------------------
  |  Branch (27735:13): [True: 0, False: 149]
  ------------------
27736|      0|                opcode = OP_strict_neq;
27737|      0|                break;
27738|    149|            default:
  ------------------
  |  Branch (27738:13): [True: 149, False: 0]
  ------------------
27739|    149|                return 0;
27740|    149|            }
27741|      0|            break;
27742|    149|        case 6:
  ------------------
  |  Branch (27742:9): [True: 149, False: 1.05k]
  ------------------
27743|    149|            switch(op) {
27744|      1|            case '&':
  ------------------
  |  Branch (27744:13): [True: 1, False: 148]
  ------------------
27745|      1|                opcode = OP_and;
27746|      1|                break;
27747|    148|            default:
  ------------------
  |  Branch (27747:13): [True: 148, False: 1]
  ------------------
27748|    148|                return 0;
27749|    149|            }
27750|      1|            break;
27751|    148|        case 7:
  ------------------
  |  Branch (27751:9): [True: 148, False: 1.05k]
  ------------------
27752|    148|            switch(op) {
27753|      0|            case '^':
  ------------------
  |  Branch (27753:13): [True: 0, False: 148]
  ------------------
27754|      0|                opcode = OP_xor;
27755|      0|                break;
27756|    148|            default:
  ------------------
  |  Branch (27756:13): [True: 148, False: 0]
  ------------------
27757|    148|                return 0;
27758|    148|            }
27759|      0|            break;
27760|    148|        case 8:
  ------------------
  |  Branch (27760:9): [True: 148, False: 1.05k]
  ------------------
27761|    148|            switch(op) {
27762|      0|            case '|':
  ------------------
  |  Branch (27762:13): [True: 0, False: 148]
  ------------------
27763|      0|                opcode = OP_or;
27764|      0|                break;
27765|    148|            default:
  ------------------
  |  Branch (27765:13): [True: 148, False: 0]
  ------------------
27766|    148|                return 0;
27767|    148|            }
27768|      0|            break;
27769|      0|        default:
  ------------------
  |  Branch (27769:9): [True: 0, False: 1.20k]
  ------------------
27770|      0|            abort();
27771|  1.20k|        }
27772|     14|        if (next_token(s))
  ------------------
  |  Branch (27772:13): [True: 0, False: 14]
  ------------------
27773|      0|            return -1;
27774|     14|        if (js_parse_expr_binary(s, level - 1, parse_flags))
  ------------------
  |  Branch (27774:13): [True: 0, False: 14]
  ------------------
27775|      0|            return -1;
27776|     14|        emit_source_pos(s, op_token_ptr);
27777|     14|        emit_op(s, opcode);
27778|     14|    }
27779|      0|    return 0;
27780|  1.19k|}
quickjs.c:js_parse_unary:
27477|    174|{
27478|    174|    int op;
27479|    174|    const uint8_t *op_token_ptr;
27480|       |
27481|    174|    switch(s->token.val) {
27482|      0|    case '+':
  ------------------
  |  Branch (27482:5): [True: 0, False: 174]
  ------------------
27483|      5|    case '-':
  ------------------
  |  Branch (27483:5): [True: 5, False: 169]
  ------------------
27484|      7|    case '!':
  ------------------
  |  Branch (27484:5): [True: 2, False: 172]
  ------------------
27485|      9|    case '~':
  ------------------
  |  Branch (27485:5): [True: 2, False: 172]
  ------------------
27486|      9|    case TOK_VOID:
  ------------------
  |  Branch (27486:5): [True: 0, False: 174]
  ------------------
27487|      9|        op_token_ptr = s->token.ptr;
27488|      9|        op = s->token.val;
27489|      9|        if (next_token(s))
  ------------------
  |  Branch (27489:13): [True: 0, False: 9]
  ------------------
27490|      0|            return -1;
27491|      9|        if (js_parse_unary(s, PF_POW_FORBIDDEN))
  ------------------
  |  |24974|      9|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27491:13): [True: 0, False: 9]
  ------------------
27492|      0|            return -1;
27493|      9|        switch(op) {
27494|      5|        case '-':
  ------------------
  |  Branch (27494:9): [True: 5, False: 4]
  ------------------
27495|      5|            emit_source_pos(s, op_token_ptr);
27496|      5|            emit_op(s, OP_neg);
27497|      5|            break;
27498|      0|        case '+':
  ------------------
  |  Branch (27498:9): [True: 0, False: 9]
  ------------------
27499|      0|            emit_source_pos(s, op_token_ptr);
27500|      0|            emit_op(s, OP_plus);
27501|      0|            break;
27502|      2|        case '!':
  ------------------
  |  Branch (27502:9): [True: 2, False: 7]
  ------------------
27503|      2|            emit_op(s, OP_lnot);
27504|      2|            break;
27505|      2|        case '~':
  ------------------
  |  Branch (27505:9): [True: 2, False: 7]
  ------------------
27506|      2|            emit_source_pos(s, op_token_ptr);
27507|      2|            emit_op(s, OP_not);
27508|      2|            break;
27509|      0|        case TOK_VOID:
  ------------------
  |  Branch (27509:9): [True: 0, False: 9]
  ------------------
27510|      0|            emit_op(s, OP_drop);
27511|      0|            emit_op(s, OP_undefined);
27512|      0|            break;
27513|      0|        default:
  ------------------
  |  Branch (27513:9): [True: 0, False: 9]
  ------------------
27514|      0|            abort();
27515|      9|        }
27516|      9|        parse_flags = 0;
27517|      9|        break;
27518|      0|    case TOK_DEC:
  ------------------
  |  Branch (27518:5): [True: 0, False: 174]
  ------------------
27519|      0|    case TOK_INC:
  ------------------
  |  Branch (27519:5): [True: 0, False: 174]
  ------------------
27520|      0|        {
27521|      0|            int opcode, op, scope, label;
27522|      0|            JSAtom name;
27523|      0|            op = s->token.val;
27524|      0|            op_token_ptr = s->token.ptr;
27525|      0|            if (next_token(s))
  ------------------
  |  Branch (27525:17): [True: 0, False: 0]
  ------------------
27526|      0|                return -1;
27527|      0|            if (js_parse_unary(s, 0))
  ------------------
  |  Branch (27527:17): [True: 0, False: 0]
  ------------------
27528|      0|                return -1;
27529|      0|            if (get_lvalue(s, &opcode, &scope, &name, &label, NULL, TRUE, op))
  ------------------
  |  Branch (27529:17): [True: 0, False: 0]
  ------------------
27530|      0|                return -1;
27531|      0|            emit_source_pos(s, op_token_ptr);
27532|      0|            emit_op(s, OP_dec + op - TOK_DEC);
27533|      0|            put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_KEEP_TOP,
27534|      0|                       FALSE);
27535|      0|        }
27536|      0|        break;
27537|      0|    case TOK_TYPEOF:
  ------------------
  |  Branch (27537:5): [True: 0, False: 174]
  ------------------
27538|      0|        {
27539|      0|            JSFunctionDef *fd;
27540|      0|            if (next_token(s))
  ------------------
  |  Branch (27540:17): [True: 0, False: 0]
  ------------------
27541|      0|                return -1;
27542|      0|            if (js_parse_unary(s, PF_POW_FORBIDDEN))
  ------------------
  |  |24974|      0|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27542:17): [True: 0, False: 0]
  ------------------
27543|      0|                return -1;
27544|       |            /* reference access should not return an exception, so we
27545|       |               patch the get_var */
27546|      0|            fd = s->cur_func;
27547|      0|            if (get_prev_opcode(fd) == OP_scope_get_var) {
  ------------------
  |  Branch (27547:17): [True: 0, False: 0]
  ------------------
27548|      0|                fd->byte_code.buf[fd->last_opcode_pos] = OP_scope_get_var_undef;
27549|      0|            }
27550|      0|            emit_op(s, OP_typeof);
27551|      0|            parse_flags = 0;
27552|      0|        }
27553|      0|        break;
27554|      0|    case TOK_DELETE:
  ------------------
  |  Branch (27554:5): [True: 0, False: 174]
  ------------------
27555|      0|        if (js_parse_delete(s))
  ------------------
  |  Branch (27555:13): [True: 0, False: 0]
  ------------------
27556|      0|            return -1;
27557|      0|        parse_flags = 0;
27558|      0|        break;
27559|      0|    case TOK_AWAIT:
  ------------------
  |  Branch (27559:5): [True: 0, False: 174]
  ------------------
27560|      0|        if (!(s->cur_func->func_kind & JS_FUNC_ASYNC))
  ------------------
  |  Branch (27560:13): [True: 0, False: 0]
  ------------------
27561|      0|            return js_parse_error(s, "unexpected 'await' keyword");
27562|      0|        if (!s->cur_func->in_function_body)
  ------------------
  |  Branch (27562:13): [True: 0, False: 0]
  ------------------
27563|      0|            return js_parse_error(s, "await in default expression");
27564|      0|        if (next_token(s))
  ------------------
  |  Branch (27564:13): [True: 0, False: 0]
  ------------------
27565|      0|            return -1;
27566|      0|        if (js_parse_unary(s, PF_POW_FORBIDDEN))
  ------------------
  |  |24974|      0|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27566:13): [True: 0, False: 0]
  ------------------
27567|      0|            return -1;
27568|      0|        s->cur_func->has_await = TRUE;
27569|      0|        emit_op(s, OP_await);
27570|      0|        parse_flags = 0;
27571|      0|        break;
27572|    165|    default:
  ------------------
  |  Branch (27572:5): [True: 165, False: 9]
  ------------------
27573|    165|        if (js_parse_postfix_expr(s, PF_POSTFIX_CALL))
  ------------------
  |  |24970|    165|#define PF_POSTFIX_CALL (1 << 1)
  ------------------
  |  Branch (27573:13): [True: 3, False: 162]
  ------------------
27574|      3|            return -1;
27575|    162|        if (!s->got_lf &&
  ------------------
  |  Branch (27575:13): [True: 129, False: 33]
  ------------------
27576|    129|            (s->token.val == TOK_DEC || s->token.val == TOK_INC)) {
  ------------------
  |  Branch (27576:14): [True: 0, False: 129]
  |  Branch (27576:41): [True: 0, False: 129]
  ------------------
27577|      0|            int opcode, op, scope, label;
27578|      0|            JSAtom name;
27579|      0|            op = s->token.val;
27580|      0|            op_token_ptr = s->token.ptr;
27581|      0|            if (get_lvalue(s, &opcode, &scope, &name, &label, NULL, TRUE, op))
  ------------------
  |  Branch (27581:17): [True: 0, False: 0]
  ------------------
27582|      0|                return -1;
27583|      0|            emit_source_pos(s, op_token_ptr);
27584|      0|            emit_op(s, OP_post_dec + op - TOK_DEC);
27585|      0|            put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_KEEP_SECOND,
27586|      0|                       FALSE);
27587|      0|            if (next_token(s))
  ------------------
  |  Branch (27587:17): [True: 0, False: 0]
  ------------------
27588|      0|                return -1;
27589|      0|        }
27590|    162|        break;
27591|    174|    }
27592|    171|    if (parse_flags & (PF_POW_ALLOWED | PF_POW_FORBIDDEN)) {
  ------------------
  |  |24972|    171|#define PF_POW_ALLOWED  (1 << 2)
  ------------------
                  if (parse_flags & (PF_POW_ALLOWED | PF_POW_FORBIDDEN)) {
  ------------------
  |  |24974|    171|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27592:9): [True: 162, False: 9]
  ------------------
27593|    162|        if (s->token.val == TOK_POW) {
  ------------------
  |  Branch (27593:13): [True: 0, False: 162]
  ------------------
27594|       |            /* Strict ES7 exponentiation syntax rules: To solve
27595|       |               conficting semantics between different implementations
27596|       |               regarding the precedence of prefix operators and the
27597|       |               postifx exponential, ES7 specifies that -2**2 is a
27598|       |               syntax error. */
27599|      0|            if (parse_flags & PF_POW_FORBIDDEN) {
  ------------------
  |  |24974|      0|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27599:17): [True: 0, False: 0]
  ------------------
27600|      0|                JS_ThrowSyntaxError(s->ctx, "unparenthesized unary expression can't appear on the left-hand side of '**'");
27601|      0|                return -1;
27602|      0|            }
27603|      0|            op_token_ptr = s->token.ptr;
27604|      0|            if (next_token(s))
  ------------------
  |  Branch (27604:17): [True: 0, False: 0]
  ------------------
27605|      0|                return -1;
27606|      0|            if (js_parse_unary(s, PF_POW_ALLOWED))
  ------------------
  |  |24972|      0|#define PF_POW_ALLOWED  (1 << 2)
  ------------------
  |  Branch (27606:17): [True: 0, False: 0]
  ------------------
27607|      0|                return -1;
27608|      0|            emit_source_pos(s, op_token_ptr);
27609|      0|            emit_op(s, OP_pow);
27610|      0|        }
27611|    162|    }
27612|    171|    return 0;
27613|    171|}
quickjs.c:get_lvalue:
25819|     45|{
25820|     45|    JSFunctionDef *fd;
25821|     45|    int opcode, scope, label, depth;
25822|     45|    JSAtom name;
25823|       |
25824|       |    /* we check the last opcode to get the lvalue type */
25825|     45|    fd = s->cur_func;
25826|     45|    scope = 0;
25827|     45|    name = JS_ATOM_NULL;
  ------------------
  |  |  451|     45|#define JS_ATOM_NULL 0
  ------------------
25828|     45|    label = -1;
25829|     45|    depth = 0;
25830|     45|    switch(opcode = get_prev_opcode(fd)) {
25831|     11|    case OP_scope_get_var:
  ------------------
  |  Branch (25831:5): [True: 11, False: 34]
  ------------------
25832|     11|        name = get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
25833|     11|        scope = get_u16(fd->byte_code.buf + fd->last_opcode_pos + 5);
25834|     11|        if ((name == JS_ATOM_arguments || name == JS_ATOM_eval) &&
  ------------------
  |  Branch (25834:14): [True: 0, False: 11]
  |  Branch (25834:43): [True: 0, False: 11]
  ------------------
25835|      0|            (fd->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (25835:13): [True: 0, False: 0]
  ------------------
25836|      0|            return js_parse_error(s, "invalid lvalue in strict mode");
25837|      0|        }
25838|     11|        if (name == JS_ATOM_this || name == JS_ATOM_new_target)
  ------------------
  |  Branch (25838:13): [True: 0, False: 11]
  |  Branch (25838:37): [True: 0, False: 11]
  ------------------
25839|      0|            goto invalid_lvalue;
25840|     11|        if (has_with_scope(fd, scope)) {
  ------------------
  |  Branch (25840:13): [True: 0, False: 11]
  ------------------
25841|      0|            depth = 2;  /* will generate OP_get_ref_value */
25842|     11|        } else {
25843|     11|            depth = 0;
25844|     11|        }
25845|     11|        break;
25846|     34|    case OP_get_field:
  ------------------
  |  Branch (25846:5): [True: 34, False: 11]
  ------------------
25847|     34|        name = get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
25848|     34|        depth = 1;
25849|     34|        break;
25850|      0|    case OP_scope_get_private_field:
  ------------------
  |  Branch (25850:5): [True: 0, False: 45]
  ------------------
25851|      0|        name = get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
25852|      0|        scope = get_u16(fd->byte_code.buf + fd->last_opcode_pos + 5);
25853|      0|        depth = 1;
25854|      0|        break;
25855|      0|    case OP_get_array_el:
  ------------------
  |  Branch (25855:5): [True: 0, False: 45]
  ------------------
25856|      0|        depth = 2;
25857|      0|        break;
25858|      0|    case OP_get_super_value:
  ------------------
  |  Branch (25858:5): [True: 0, False: 45]
  ------------------
25859|      0|        depth = 3;
25860|      0|        break;
25861|      0|    default:
  ------------------
  |  Branch (25861:5): [True: 0, False: 45]
  ------------------
25862|      0|    invalid_lvalue:
25863|      0|        if (tok == TOK_FOR) {
  ------------------
  |  Branch (25863:13): [True: 0, False: 0]
  ------------------
25864|      0|            return js_parse_error(s, "invalid for in/of left hand-side");
25865|      0|        } else if (tok == TOK_INC || tok == TOK_DEC) {
  ------------------
  |  Branch (25865:20): [True: 0, False: 0]
  |  Branch (25865:38): [True: 0, False: 0]
  ------------------
25866|      0|            return js_parse_error(s, "invalid increment/decrement operand");
25867|      0|        } else if (tok == '[' || tok == '{') {
  ------------------
  |  Branch (25867:20): [True: 0, False: 0]
  |  Branch (25867:34): [True: 0, False: 0]
  ------------------
25868|      0|            return js_parse_error(s, "invalid destructuring target");
25869|      0|        } else {
25870|      0|            return js_parse_error(s, "invalid assignment left-hand side");
25871|      0|        }
25872|     45|    }
25873|       |    /* remove the last opcode */
25874|     45|    fd->byte_code.size = fd->last_opcode_pos;
25875|     45|    fd->last_opcode_pos = -1;
25876|       |
25877|     45|    if (keep) {
  ------------------
  |  Branch (25877:9): [True: 2, False: 43]
  ------------------
25878|       |        /* get the value but keep the object/fields on the stack */
25879|      2|        switch(opcode) {
25880|      2|        case OP_scope_get_var:
  ------------------
  |  Branch (25880:9): [True: 2, False: 0]
  ------------------
25881|      2|            if (depth != 0) {
  ------------------
  |  Branch (25881:17): [True: 0, False: 2]
  ------------------
25882|      0|                label = new_label(s);
25883|      0|                if (label < 0)
  ------------------
  |  Branch (25883:21): [True: 0, False: 0]
  ------------------
25884|      0|                    return -1;
25885|      0|                emit_op(s, OP_scope_make_ref);
25886|      0|                emit_atom(s, name);
25887|      0|                emit_u32(s, label);
25888|      0|                emit_u16(s, scope);
25889|      0|                update_label(fd, label, 1);
25890|      0|                emit_op(s, OP_get_ref_value);
25891|      0|                opcode = OP_get_ref_value;
25892|      2|            } else {
25893|      2|                emit_op(s, OP_scope_get_var);
25894|      2|                emit_atom(s, name);
25895|      2|                emit_u16(s, scope);
25896|      2|            }
25897|      2|            break;
25898|      2|        case OP_get_field:
  ------------------
  |  Branch (25898:9): [True: 0, False: 2]
  ------------------
25899|      0|            emit_op(s, OP_get_field2);
25900|      0|            emit_atom(s, name);
25901|      0|            break;
25902|      0|        case OP_scope_get_private_field:
  ------------------
  |  Branch (25902:9): [True: 0, False: 2]
  ------------------
25903|      0|            emit_op(s, OP_scope_get_private_field2);
25904|      0|            emit_atom(s, name);
25905|      0|            emit_u16(s, scope);
25906|      0|            break;
25907|      0|        case OP_get_array_el:
  ------------------
  |  Branch (25907:9): [True: 0, False: 2]
  ------------------
25908|      0|            emit_op(s, OP_get_array_el3);
25909|      0|            break;
25910|      0|        case OP_get_super_value:
  ------------------
  |  Branch (25910:9): [True: 0, False: 2]
  ------------------
25911|      0|            emit_op(s, OP_to_propkey);
25912|      0|            emit_op(s, OP_dup3);
25913|      0|            emit_op(s, OP_get_super_value);
25914|      0|            break;
25915|      0|        default:
  ------------------
  |  Branch (25915:9): [True: 0, False: 2]
  ------------------
25916|      0|            abort();
25917|      2|        }
25918|     43|    } else {
25919|     43|        switch(opcode) {
25920|      9|        case OP_scope_get_var:
  ------------------
  |  Branch (25920:9): [True: 9, False: 34]
  ------------------
25921|      9|            if (depth != 0) {
  ------------------
  |  Branch (25921:17): [True: 0, False: 9]
  ------------------
25922|      0|                label = new_label(s);
25923|      0|                if (label < 0)
  ------------------
  |  Branch (25923:21): [True: 0, False: 0]
  ------------------
25924|      0|                    return -1;
25925|      0|                emit_op(s, OP_scope_make_ref);
25926|      0|                emit_atom(s, name);
25927|      0|                emit_u32(s, label);
25928|      0|                emit_u16(s, scope);
25929|      0|                update_label(fd, label, 1);
25930|      0|                opcode = OP_get_ref_value;
25931|      0|            }
25932|      9|            break;
25933|     34|        default:
  ------------------
  |  Branch (25933:9): [True: 34, False: 9]
  ------------------
25934|     34|            break;
25935|     43|        }
25936|     43|    }
25937|       |
25938|     45|    *popcode = opcode;
25939|     45|    *pscope = scope;
25940|       |    /* name has refcount for OP_get_field and OP_get_ref_value,
25941|       |       and JS_ATOM_NULL for other opcodes */
25942|     45|    *pname = name;
25943|     45|    *plabel = label;
25944|     45|    if (pdepth)
  ------------------
  |  Branch (25944:9): [True: 0, False: 45]
  ------------------
25945|      0|        *pdepth = depth;
25946|     45|    return 0;
25947|     45|}
quickjs.c:update_label:
23766|    130|{
23767|    130|    LabelSlot *ls;
23768|       |
23769|    130|    assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (23769:5): [True: 0, False: 130]
  |  Branch (23769:5): [True: 0, False: 0]
  |  Branch (23769:5): [True: 130, False: 0]
  |  Branch (23769:5): [True: 130, False: 0]
  ------------------
23770|    130|    ls = &s->label_slots[label];
23771|    130|    ls->ref_count += delta;
23772|    130|    assert(ls->ref_count >= 0);
  ------------------
  |  Branch (23772:5): [True: 0, False: 130]
  |  Branch (23772:5): [True: 130, False: 0]
  ------------------
23773|    130|    return ls->ref_count;
23774|    130|}
quickjs.c:emit_u8:
23721|      1|{
23722|      1|    dbuf_putc(&s->cur_func->byte_code, val);
23723|      1|}
quickjs.c:js_parse_property_name:
24508|      2|{
24509|      2|    int is_private = 0;
24510|      2|    BOOL is_non_reserved_ident;
24511|      2|    JSAtom name;
24512|      2|    int prop_type;
24513|       |
24514|      2|    prop_type = PROP_TYPE_IDENT;
  ------------------
  |  |24485|      2|#define PROP_TYPE_IDENT 0
  ------------------
24515|      2|    if (allow_method) {
  ------------------
  |  Branch (24515:9): [True: 0, False: 2]
  ------------------
24516|       |        /* if allow_private is true (for class field parsing) and
24517|       |           get/set is following by ';' (or LF with ASI), then it
24518|       |           is a field name */
24519|      0|        if ((token_is_pseudo_keyword(s, JS_ATOM_get) ||
  ------------------
  |  Branch (24519:14): [True: 0, False: 0]
  ------------------
24520|      0|             token_is_pseudo_keyword(s, JS_ATOM_set)) &&
  ------------------
  |  Branch (24520:14): [True: 0, False: 0]
  ------------------
24521|      0|            (!allow_private || peek_token(s, TRUE) != '\n')) {
  ------------------
  |  Branch (24521:14): [True: 0, False: 0]
  |  Branch (24521:32): [True: 0, False: 0]
  ------------------
24522|       |            /* get x(), set x() */
24523|      0|            name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
24524|      0|            if (next_token(s))
  ------------------
  |  Branch (24524:17): [True: 0, False: 0]
  ------------------
24525|      0|                goto fail1;
24526|      0|            if (s->token.val == ':' || s->token.val == ',' ||
  ------------------
  |  Branch (24526:17): [True: 0, False: 0]
  |  Branch (24526:40): [True: 0, False: 0]
  ------------------
24527|      0|                s->token.val == '}' || s->token.val == '(' ||
  ------------------
  |  Branch (24527:17): [True: 0, False: 0]
  |  Branch (24527:40): [True: 0, False: 0]
  ------------------
24528|      0|                s->token.val == '=' ||
  ------------------
  |  Branch (24528:17): [True: 0, False: 0]
  ------------------
24529|      0|                (s->token.val == ';' && allow_private)) {
  ------------------
  |  Branch (24529:18): [True: 0, False: 0]
  |  Branch (24529:41): [True: 0, False: 0]
  ------------------
24530|      0|                is_non_reserved_ident = TRUE;
24531|      0|                goto ident_found;
24532|      0|            }
24533|      0|            prop_type = PROP_TYPE_GET + (name == JS_ATOM_set);
  ------------------
  |  |24487|      0|#define PROP_TYPE_GET   2
  ------------------
24534|      0|            JS_FreeAtom(s->ctx, name);
24535|      0|        } else if (s->token.val == '*') {
  ------------------
  |  Branch (24535:20): [True: 0, False: 0]
  ------------------
24536|      0|            if (next_token(s))
  ------------------
  |  Branch (24536:17): [True: 0, False: 0]
  ------------------
24537|      0|                goto fail;
24538|      0|            prop_type = PROP_TYPE_STAR;
  ------------------
  |  |24489|      0|#define PROP_TYPE_STAR  4
  ------------------
24539|      0|        } else if (token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (24539:20): [True: 0, False: 0]
  ------------------
24540|      0|                   peek_token(s, TRUE) != '\n') {
  ------------------
  |  Branch (24540:20): [True: 0, False: 0]
  ------------------
24541|      0|            name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
24542|      0|            if (next_token(s))
  ------------------
  |  Branch (24542:17): [True: 0, False: 0]
  ------------------
24543|      0|                goto fail1;
24544|      0|            if (s->token.val == ':' || s->token.val == ',' ||
  ------------------
  |  Branch (24544:17): [True: 0, False: 0]
  |  Branch (24544:40): [True: 0, False: 0]
  ------------------
24545|      0|                s->token.val == '}' || s->token.val == '(' ||
  ------------------
  |  Branch (24545:17): [True: 0, False: 0]
  |  Branch (24545:40): [True: 0, False: 0]
  ------------------
24546|      0|                s->token.val == '=') {
  ------------------
  |  Branch (24546:17): [True: 0, False: 0]
  ------------------
24547|      0|                is_non_reserved_ident = TRUE;
24548|      0|                goto ident_found;
24549|      0|            }
24550|      0|            JS_FreeAtom(s->ctx, name);
24551|      0|            if (s->token.val == '*') {
  ------------------
  |  Branch (24551:17): [True: 0, False: 0]
  ------------------
24552|      0|                if (next_token(s))
  ------------------
  |  Branch (24552:21): [True: 0, False: 0]
  ------------------
24553|      0|                    goto fail;
24554|      0|                prop_type = PROP_TYPE_ASYNC_STAR;
  ------------------
  |  |24491|      0|#define PROP_TYPE_ASYNC_STAR 6
  ------------------
24555|      0|            } else {
24556|      0|                prop_type = PROP_TYPE_ASYNC;
  ------------------
  |  |24490|      0|#define PROP_TYPE_ASYNC 5
  ------------------
24557|      0|            }
24558|      0|        }
24559|      0|    }
24560|       |
24561|      2|    if (token_is_ident(s->token.val)) {
  ------------------
  |  Branch (24561:9): [True: 0, False: 2]
  ------------------
24562|       |        /* variable can only be a non-reserved identifier */
24563|      0|        is_non_reserved_ident =
24564|      0|            (s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved);
  ------------------
  |  Branch (24564:14): [True: 0, False: 0]
  |  Branch (24564:43): [True: 0, False: 0]
  ------------------
24565|       |        /* keywords and reserved words have a valid atom */
24566|      0|        name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
24567|      0|        if (next_token(s))
  ------------------
  |  Branch (24567:13): [True: 0, False: 0]
  ------------------
24568|      0|            goto fail1;
24569|      0|    ident_found:
24570|      0|        if (is_non_reserved_ident &&
  ------------------
  |  Branch (24570:13): [True: 0, False: 0]
  ------------------
24571|      0|            prop_type == PROP_TYPE_IDENT && allow_var) {
  ------------------
  |  |24485|      0|#define PROP_TYPE_IDENT 0
  ------------------
  |  Branch (24571:13): [True: 0, False: 0]
  |  Branch (24571:45): [True: 0, False: 0]
  ------------------
24572|      0|            if (!(s->token.val == ':' ||
  ------------------
  |  Branch (24572:19): [True: 0, False: 0]
  ------------------
24573|      0|                  (s->token.val == '(' && allow_method))) {
  ------------------
  |  Branch (24573:20): [True: 0, False: 0]
  |  Branch (24573:43): [True: 0, False: 0]
  ------------------
24574|      0|                prop_type = PROP_TYPE_VAR;
  ------------------
  |  |24486|      0|#define PROP_TYPE_VAR   1
  ------------------
24575|      0|            }
24576|      0|        }
24577|      2|    } else if (s->token.val == TOK_STRING) {
  ------------------
  |  Branch (24577:16): [True: 0, False: 2]
  ------------------
24578|      0|        name = JS_ValueToAtom(s->ctx, s->token.u.str.str);
24579|      0|        if (name == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (24579:13): [True: 0, False: 0]
  ------------------
24580|      0|            goto fail;
24581|      0|        if (next_token(s))
  ------------------
  |  Branch (24581:13): [True: 0, False: 0]
  ------------------
24582|      0|            goto fail1;
24583|      2|    } else if (s->token.val == TOK_NUMBER) {
  ------------------
  |  Branch (24583:16): [True: 2, False: 0]
  ------------------
24584|      2|        JSValue val;
24585|      2|        val = s->token.u.num.val;
24586|      2|        name = JS_ValueToAtom(s->ctx, val);
24587|      2|        if (name == JS_ATOM_NULL)
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (24587:13): [True: 0, False: 2]
  ------------------
24588|      0|            goto fail;
24589|      2|        if (next_token(s))
  ------------------
  |  Branch (24589:13): [True: 0, False: 2]
  ------------------
24590|      0|            goto fail1;
24591|      2|    } else if (s->token.val == '[') {
  ------------------
  |  Branch (24591:16): [True: 0, False: 0]
  ------------------
24592|      0|        if (next_token(s))
  ------------------
  |  Branch (24592:13): [True: 0, False: 0]
  ------------------
24593|      0|            goto fail;
24594|      0|        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (24594:13): [True: 0, False: 0]
  ------------------
24595|      0|            goto fail;
24596|      0|        if (js_parse_expect(s, ']'))
  ------------------
  |  Branch (24596:13): [True: 0, False: 0]
  ------------------
24597|      0|            goto fail;
24598|      0|        name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
24599|      0|    } else if (s->token.val == TOK_PRIVATE_NAME && allow_private) {
  ------------------
  |  Branch (24599:16): [True: 0, False: 0]
  |  Branch (24599:52): [True: 0, False: 0]
  ------------------
24600|      0|        name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
24601|      0|        if (next_token(s))
  ------------------
  |  Branch (24601:13): [True: 0, False: 0]
  ------------------
24602|      0|            goto fail1;
24603|      0|        is_private = PROP_TYPE_PRIVATE;
  ------------------
  |  |24493|      0|#define PROP_TYPE_PRIVATE (1 << 4)
  ------------------
24604|      0|    } else {
24605|      0|        goto invalid_prop;
24606|      0|    }
24607|      2|    if (prop_type != PROP_TYPE_IDENT && prop_type != PROP_TYPE_VAR &&
  ------------------
  |  |24485|      4|#define PROP_TYPE_IDENT 0
  ------------------
                  if (prop_type != PROP_TYPE_IDENT && prop_type != PROP_TYPE_VAR &&
  ------------------
  |  |24486|      2|#define PROP_TYPE_VAR   1
  ------------------
  |  Branch (24607:9): [True: 0, False: 2]
  |  Branch (24607:41): [True: 0, False: 0]
  ------------------
24608|      0|        s->token.val != '(') {
  ------------------
  |  Branch (24608:9): [True: 0, False: 0]
  ------------------
24609|      0|        JS_FreeAtom(s->ctx, name);
24610|      0|    invalid_prop:
24611|      0|        js_parse_error(s, "invalid property name");
24612|      0|        goto fail;
24613|      0|    }
24614|      2|    *pname = name;
24615|      2|    return prop_type | is_private;
24616|      0| fail1:
24617|      0|    JS_FreeAtom(s->ctx, name);
24618|      0| fail:
24619|      0|    *pname = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
24620|      0|    return -1;
24621|      0|}
quickjs.c:js_define_var:
26097|     16|{
26098|     16|    JSFunctionDef *fd = s->cur_func;
26099|     16|    JSVarDefEnum var_def_type;
26100|       |
26101|     16|    if (name == JS_ATOM_yield && fd->func_kind == JS_FUNC_GENERATOR) {
  ------------------
  |  Branch (26101:9): [True: 0, False: 16]
  |  Branch (26101:34): [True: 0, False: 0]
  ------------------
26102|      0|        return js_parse_error(s, "yield is a reserved identifier");
26103|      0|    }
26104|     16|    if ((name == JS_ATOM_arguments || name == JS_ATOM_eval)
  ------------------
  |  Branch (26104:10): [True: 0, False: 16]
  |  Branch (26104:39): [True: 0, False: 16]
  ------------------
26105|      0|    &&  (fd->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (26105:9): [True: 0, False: 0]
  ------------------
26106|      0|        return js_parse_error(s, "invalid variable name in strict mode");
26107|      0|    }
26108|     16|    if (name == JS_ATOM_let
  ------------------
  |  Branch (26108:9): [True: 0, False: 16]
  ------------------
26109|      0|    &&  (tok == TOK_LET || tok == TOK_CONST)) {
  ------------------
  |  Branch (26109:10): [True: 0, False: 0]
  |  Branch (26109:28): [True: 0, False: 0]
  ------------------
26110|      0|        return js_parse_error(s, "invalid lexical variable name");
26111|      0|    }
26112|     16|    switch(tok) {
26113|     16|    case TOK_LET:
  ------------------
  |  Branch (26113:5): [True: 16, False: 0]
  ------------------
26114|     16|        var_def_type = JS_VAR_DEF_LET;
26115|     16|        break;
26116|      0|    case TOK_CONST:
  ------------------
  |  Branch (26116:5): [True: 0, False: 16]
  ------------------
26117|      0|        var_def_type = JS_VAR_DEF_CONST;
26118|      0|        break;
26119|      0|    case TOK_VAR:
  ------------------
  |  Branch (26119:5): [True: 0, False: 16]
  ------------------
26120|      0|        var_def_type = JS_VAR_DEF_VAR;
26121|      0|        break;
26122|      0|    case TOK_CATCH:
  ------------------
  |  Branch (26122:5): [True: 0, False: 16]
  ------------------
26123|      0|        var_def_type = JS_VAR_DEF_CATCH;
26124|      0|        break;
26125|      0|    default:
  ------------------
  |  Branch (26125:5): [True: 0, False: 16]
  ------------------
26126|      0|        abort();
26127|     16|    }
26128|     16|    if (define_var(s, fd, name, var_def_type) < 0)
  ------------------
  |  Branch (26128:9): [True: 0, False: 16]
  ------------------
26129|      0|        return -1;
26130|     16|    return 0;
26131|     16|}
quickjs.c:put_lvalue:
25963|     47|{
25964|     47|    switch(opcode) {
25965|     13|    case OP_scope_get_var:
  ------------------
  |  Branch (25965:5): [True: 13, False: 34]
  ------------------
25966|       |        /* depth = 0 */
25967|     13|        switch(special) {
25968|      0|        case PUT_LVALUE_NOKEEP:
  ------------------
  |  Branch (25968:9): [True: 0, False: 13]
  ------------------
25969|      2|        case PUT_LVALUE_NOKEEP_DEPTH:
  ------------------
  |  Branch (25969:9): [True: 2, False: 11]
  ------------------
25970|      2|        case PUT_LVALUE_KEEP_SECOND:
  ------------------
  |  Branch (25970:9): [True: 0, False: 13]
  ------------------
25971|      3|        case PUT_LVALUE_NOKEEP_BOTTOM:
  ------------------
  |  Branch (25971:9): [True: 1, False: 12]
  ------------------
25972|      3|            break;
25973|     10|        case PUT_LVALUE_KEEP_TOP:
  ------------------
  |  Branch (25973:9): [True: 10, False: 3]
  ------------------
25974|     10|            emit_op(s, OP_dup);
25975|     10|            break;
25976|      0|        default:
  ------------------
  |  Branch (25976:9): [True: 0, False: 13]
  ------------------
25977|      0|            abort();
25978|     13|        }
25979|     13|        break;
25980|     34|    case OP_get_field:
  ------------------
  |  Branch (25980:5): [True: 34, False: 13]
  ------------------
25981|     34|    case OP_scope_get_private_field:
  ------------------
  |  Branch (25981:5): [True: 0, False: 47]
  ------------------
25982|       |        /* depth = 1 */
25983|     34|        switch(special) {
25984|      0|        case PUT_LVALUE_NOKEEP:
  ------------------
  |  Branch (25984:9): [True: 0, False: 34]
  ------------------
25985|      0|        case PUT_LVALUE_NOKEEP_DEPTH:
  ------------------
  |  Branch (25985:9): [True: 0, False: 34]
  ------------------
25986|      0|            break;
25987|     34|        case PUT_LVALUE_KEEP_TOP:
  ------------------
  |  Branch (25987:9): [True: 34, False: 0]
  ------------------
25988|     34|            emit_op(s, OP_insert2); /* obj v -> v obj v */
25989|     34|            break;
25990|      0|        case PUT_LVALUE_KEEP_SECOND:
  ------------------
  |  Branch (25990:9): [True: 0, False: 34]
  ------------------
25991|      0|            emit_op(s, OP_perm3); /* obj v0 v -> v0 obj v */
25992|      0|            break;
25993|      0|        case PUT_LVALUE_NOKEEP_BOTTOM:
  ------------------
  |  Branch (25993:9): [True: 0, False: 34]
  ------------------
25994|      0|            emit_op(s, OP_swap);
25995|      0|            break;
25996|      0|        default:
  ------------------
  |  Branch (25996:9): [True: 0, False: 34]
  ------------------
25997|      0|            abort();
25998|     34|        }
25999|     34|        break;
26000|     34|    case OP_get_array_el:
  ------------------
  |  Branch (26000:5): [True: 0, False: 47]
  ------------------
26001|      0|    case OP_get_ref_value:
  ------------------
  |  Branch (26001:5): [True: 0, False: 47]
  ------------------
26002|       |        /* depth = 2 */
26003|      0|        if (opcode == OP_get_ref_value) {
  ------------------
  |  Branch (26003:13): [True: 0, False: 0]
  ------------------
26004|      0|            JS_FreeAtom(s->ctx, name);
26005|      0|            emit_label(s, label);
26006|      0|        }
26007|      0|        switch(special) {
26008|      0|        case PUT_LVALUE_NOKEEP:
  ------------------
  |  Branch (26008:9): [True: 0, False: 0]
  ------------------
26009|      0|            emit_op(s, OP_nop); /* will trigger optimization */
26010|      0|            break;
26011|      0|        case PUT_LVALUE_NOKEEP_DEPTH:
  ------------------
  |  Branch (26011:9): [True: 0, False: 0]
  ------------------
26012|      0|            break;
26013|      0|        case PUT_LVALUE_KEEP_TOP:
  ------------------
  |  Branch (26013:9): [True: 0, False: 0]
  ------------------
26014|      0|            emit_op(s, OP_insert3); /* obj prop v -> v obj prop v */
26015|      0|            break;
26016|      0|        case PUT_LVALUE_KEEP_SECOND:
  ------------------
  |  Branch (26016:9): [True: 0, False: 0]
  ------------------
26017|      0|            emit_op(s, OP_perm4); /* obj prop v0 v -> v0 obj prop v */
26018|      0|            break;
26019|      0|        case PUT_LVALUE_NOKEEP_BOTTOM:
  ------------------
  |  Branch (26019:9): [True: 0, False: 0]
  ------------------
26020|      0|            emit_op(s, OP_rot3l);
26021|      0|            break;
26022|      0|        default:
  ------------------
  |  Branch (26022:9): [True: 0, False: 0]
  ------------------
26023|      0|            abort();
26024|      0|        }
26025|      0|        break;
26026|      0|    case OP_get_super_value:
  ------------------
  |  Branch (26026:5): [True: 0, False: 47]
  ------------------
26027|       |        /* depth = 3 */
26028|      0|        switch(special) {
26029|      0|        case PUT_LVALUE_NOKEEP:
  ------------------
  |  Branch (26029:9): [True: 0, False: 0]
  ------------------
26030|      0|        case PUT_LVALUE_NOKEEP_DEPTH:
  ------------------
  |  Branch (26030:9): [True: 0, False: 0]
  ------------------
26031|      0|            break;
26032|      0|        case PUT_LVALUE_KEEP_TOP:
  ------------------
  |  Branch (26032:9): [True: 0, False: 0]
  ------------------
26033|      0|            emit_op(s, OP_insert4); /* this obj prop v -> v this obj prop v */
26034|      0|            break;
26035|      0|        case PUT_LVALUE_KEEP_SECOND:
  ------------------
  |  Branch (26035:9): [True: 0, False: 0]
  ------------------
26036|      0|            emit_op(s, OP_perm5); /* this obj prop v0 v -> v0 this obj prop v */
26037|      0|            break;
26038|      0|        case PUT_LVALUE_NOKEEP_BOTTOM:
  ------------------
  |  Branch (26038:9): [True: 0, False: 0]
  ------------------
26039|      0|            emit_op(s, OP_rot4l);
26040|      0|            break;
26041|      0|        default:
  ------------------
  |  Branch (26041:9): [True: 0, False: 0]
  ------------------
26042|      0|            abort();
26043|      0|        }
26044|      0|        break;
26045|      0|    default:
  ------------------
  |  Branch (26045:5): [True: 0, False: 47]
  ------------------
26046|      0|        break;
26047|     47|    }
26048|       |
26049|     47|    switch(opcode) {
26050|     13|    case OP_scope_get_var:  /* val -- */
  ------------------
  |  Branch (26050:5): [True: 13, False: 34]
  ------------------
26051|     13|        emit_op(s, is_let ? OP_scope_put_var_init : OP_scope_put_var);
  ------------------
  |  Branch (26051:20): [True: 2, False: 11]
  ------------------
26052|     13|        emit_u32(s, name);  /* has refcount */
26053|     13|        emit_u16(s, scope);
26054|     13|        break;
26055|     34|    case OP_get_field:
  ------------------
  |  Branch (26055:5): [True: 34, False: 13]
  ------------------
26056|     34|        emit_op(s, OP_put_field);
26057|     34|        emit_u32(s, name);  /* name has refcount */
26058|     34|        break;
26059|      0|    case OP_scope_get_private_field:
  ------------------
  |  Branch (26059:5): [True: 0, False: 47]
  ------------------
26060|      0|        emit_op(s, OP_scope_put_private_field);
26061|      0|        emit_u32(s, name);  /* name has refcount */
26062|      0|        emit_u16(s, scope);
26063|      0|        break;
26064|      0|    case OP_get_array_el:
  ------------------
  |  Branch (26064:5): [True: 0, False: 47]
  ------------------
26065|      0|        emit_op(s, OP_put_array_el);
26066|      0|        break;
26067|      0|    case OP_get_ref_value:
  ------------------
  |  Branch (26067:5): [True: 0, False: 47]
  ------------------
26068|      0|        emit_op(s, OP_put_ref_value);
26069|      0|        break;
26070|      0|    case OP_get_super_value:
  ------------------
  |  Branch (26070:5): [True: 0, False: 47]
  ------------------
26071|      0|        emit_op(s, OP_put_super_value);
26072|      0|        break;
26073|      0|    default:
  ------------------
  |  Branch (26073:5): [True: 0, False: 47]
  ------------------
26074|      0|        abort();
26075|     47|    }
26076|     47|}
quickjs.c:push_break_entry:
28205|     17|{
28206|     17|    be->prev = fd->top_break;
28207|     17|    fd->top_break = be;
28208|     17|    be->label_name = label_name;
28209|     17|    be->label_break = label_break;
28210|     17|    be->label_cont = label_cont;
28211|     17|    be->drop_count = drop_count;
28212|     17|    be->label_finally = -1;
28213|     17|    be->scope_level = fd->scope_level;
28214|     17|    be->has_iterator = FALSE;
28215|     17|    be->is_regular_stmt = FALSE;
28216|     17|}
quickjs.c:pop_break_entry:
28219|     15|{
28220|     15|    BlockEnv *be;
28221|     15|    be = fd->top_break;
28222|     15|    fd->top_break = be->prev;
28223|     15|}
quickjs.c:js_parse_check_duplicate_parameter:
26160|      4|{
26161|       |    /* Check for duplicate parameter names */
26162|      4|    JSFunctionDef *fd = s->cur_func;
26163|      4|    int i;
26164|      8|    for (i = 0; i < fd->arg_count; i++) {
  ------------------
  |  Branch (26164:17): [True: 4, False: 4]
  ------------------
26165|      4|        if (fd->args[i].var_name == name)
  ------------------
  |  Branch (26165:13): [True: 0, False: 4]
  ------------------
26166|      0|            goto duplicate;
26167|      4|    }
26168|      6|    for (i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (26168:17): [True: 2, False: 4]
  ------------------
26169|      2|        if (fd->vars[i].var_name == name)
  ------------------
  |  Branch (26169:13): [True: 0, False: 2]
  ------------------
26170|      0|            goto duplicate;
26171|      2|    }
26172|      4|    return 0;
26173|       |
26174|      0|duplicate:
26175|      0|    return js_parse_error(s, "duplicate parameter names not allowed in this context");
26176|      4|}
quickjs.c:new_label:
23796|     83|{
23797|     83|    int label;
23798|     83|    label = new_label_fd(s->cur_func);
23799|     83|    if (unlikely(label < 0)) {
  ------------------
  |  |   33|     83|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 83]
  |  |  ------------------
  ------------------
23800|      0|        dbuf_set_error(&s->cur_func->byte_code);
23801|      0|    }
23802|     83|    return label;
23803|     83|}
quickjs.c:new_label_fd:
23777|    100|{
23778|    100|    int label;
23779|    100|    LabelSlot *ls;
23780|       |
23781|    100|    if (js_resize_array(fd->ctx, (void *)&fd->label_slots,
  ------------------
  |  Branch (23781:9): [True: 0, False: 100]
  ------------------
23782|    100|                        sizeof(fd->label_slots[0]),
23783|    100|                        &fd->label_size, fd->label_count + 1))
23784|      0|        return -1;
23785|    100|    label = fd->label_count++;
23786|    100|    ls = &fd->label_slots[label];
23787|    100|    ls->ref_count = 0;
23788|    100|    ls->pos = -1;
23789|    100|    ls->pos2 = -1;
23790|    100|    ls->addr = -1;
23791|       |    ls->first_reloc = NULL;
23792|    100|    return label;
23793|    100|}
quickjs.c:emit_goto:
23828|     64|{
23829|     64|    if (js_is_live_code(s)) {
  ------------------
  |  Branch (23829:9): [True: 64, False: 0]
  ------------------
23830|     64|        if (label < 0) {
  ------------------
  |  Branch (23830:13): [True: 17, False: 47]
  ------------------
23831|     17|            label = new_label(s);
23832|     17|            if (label < 0)
  ------------------
  |  Branch (23832:17): [True: 0, False: 17]
  ------------------
23833|      0|                return -1;
23834|     17|        }
23835|     64|        emit_op(s, opcode);
23836|     64|        emit_u32(s, label);
23837|     64|        s->cur_func->label_slots[label].ref_count++;
23838|     64|        return label;
23839|     64|    }
23840|      0|    return -1;
23841|     64|}
quickjs.c:js_parse_assign_expr:
28167|     10|{
28168|     10|    return js_parse_assign_expr2(s, PF_IN_ACCEPTED);
  ------------------
  |  |24968|     10|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
28169|     10|}
quickjs.c:set_object_name:
24802|      8|{
24803|      8|    JSFunctionDef *fd = s->cur_func;
24804|      8|    int opcode;
24805|       |
24806|      8|    opcode = get_prev_opcode(fd);
24807|      8|    if (opcode == OP_set_name) {
  ------------------
  |  Branch (24807:9): [True: 2, False: 6]
  ------------------
24808|       |        /* XXX: should free atom after OP_set_name? */
24809|      2|        fd->byte_code.size = fd->last_opcode_pos;
24810|      2|        fd->last_opcode_pos = -1;
24811|      2|        emit_op(s, OP_set_name);
24812|      2|        emit_atom(s, name);
24813|      6|    } else if (opcode == OP_set_class_name) {
  ------------------
  |  Branch (24813:16): [True: 0, False: 6]
  ------------------
24814|      0|        int define_class_pos;
24815|      0|        JSAtom atom;
24816|      0|        define_class_pos = fd->last_opcode_pos + 1 -
24817|      0|            get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
24818|      0|        assert(fd->byte_code.buf[define_class_pos] == OP_define_class);
  ------------------
  |  Branch (24818:9): [True: 0, False: 0]
  |  Branch (24818:9): [True: 0, False: 0]
  ------------------
24819|       |        /* for consistency we free the previous atom which is
24820|       |           JS_ATOM_empty_string */
24821|      0|        atom = get_u32(fd->byte_code.buf + define_class_pos + 1);
24822|      0|        JS_FreeAtom(s->ctx, atom);
24823|      0|        put_u32(fd->byte_code.buf + define_class_pos + 1,
24824|      0|                JS_DupAtom(s->ctx, name));
24825|      0|        fd->last_opcode_pos = -1;
24826|      0|    }
24827|      8|}
quickjs.c:emit_label:
23815|     79|{
23816|     79|    if (label >= 0) {
  ------------------
  |  Branch (23816:9): [True: 79, False: 0]
  ------------------
23817|     79|        emit_op(s, OP_label);
23818|     79|        emit_u32(s, label);
23819|     79|        s->cur_func->label_slots[label].pos = s->cur_func->byte_code.size;
23820|     79|        return s->cur_func->byte_code.size - 4;
23821|     79|    } else {
23822|      0|        return -1;
23823|      0|    }
23824|     79|}
quickjs.c:js_parse_function_check_names:
36304|      5|{
36305|      5|    JSAtom name;
36306|      5|    int i, idx;
36307|       |
36308|      5|    if (fd->js_mode & JS_MODE_STRICT) {
  ------------------
  |  |  403|      5|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (36308:9): [True: 0, False: 5]
  ------------------
36309|      0|        if (!fd->has_simple_parameter_list && fd->has_use_strict) {
  ------------------
  |  Branch (36309:13): [True: 0, False: 0]
  |  Branch (36309:47): [True: 0, False: 0]
  ------------------
36310|      0|            return js_parse_error(s, "\"use strict\" not allowed in function with default or destructuring parameter");
36311|      0|        }
36312|      0|        if (func_name == JS_ATOM_eval || func_name == JS_ATOM_arguments ||
  ------------------
  |  Branch (36312:13): [True: 0, False: 0]
  |  Branch (36312:42): [True: 0, False: 0]
  ------------------
36313|      0|            is_strict_future_keyword(func_name)) {
  ------------------
  |  Branch (36313:13): [True: 0, False: 0]
  ------------------
36314|      0|            return js_parse_error(s, "invalid function name in strict code");
36315|      0|        }
36316|      0|        for (idx = 0; idx < fd->arg_count; idx++) {
  ------------------
  |  Branch (36316:23): [True: 0, False: 0]
  ------------------
36317|      0|            name = fd->args[idx].var_name;
36318|       |
36319|      0|            if (name == JS_ATOM_eval || name == JS_ATOM_arguments ||
  ------------------
  |  Branch (36319:17): [True: 0, False: 0]
  |  Branch (36319:41): [True: 0, False: 0]
  ------------------
36320|      0|                is_strict_future_keyword(name)) {
  ------------------
  |  Branch (36320:17): [True: 0, False: 0]
  ------------------
36321|      0|                return js_parse_error(s, "invalid argument name in strict code");
36322|      0|            }
36323|      0|        }
36324|      0|    }
36325|       |    /* check async_generator case */
36326|      5|    if ((fd->js_mode & JS_MODE_STRICT)
  ------------------
  |  |  403|      5|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (36326:9): [True: 0, False: 5]
  ------------------
36327|      5|    ||  !fd->has_simple_parameter_list
  ------------------
  |  Branch (36327:9): [True: 2, False: 3]
  ------------------
36328|      3|    ||  (fd->func_type == JS_PARSE_FUNC_METHOD && fd->func_kind == JS_FUNC_ASYNC)
  ------------------
  |  Branch (36328:10): [True: 0, False: 3]
  |  Branch (36328:51): [True: 0, False: 0]
  ------------------
36329|      3|    ||  fd->func_type == JS_PARSE_FUNC_ARROW
  ------------------
  |  Branch (36329:9): [True: 0, False: 3]
  ------------------
36330|      3|    ||  fd->func_type == JS_PARSE_FUNC_METHOD) {
  ------------------
  |  Branch (36330:9): [True: 0, False: 3]
  ------------------
36331|      6|        for (idx = 0; idx < fd->arg_count; idx++) {
  ------------------
  |  Branch (36331:23): [True: 4, False: 2]
  ------------------
36332|      4|            name = fd->args[idx].var_name;
36333|      4|            if (name != JS_ATOM_NULL) {
  ------------------
  |  |  451|      4|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (36333:17): [True: 2, False: 2]
  ------------------
36334|      4|                for (i = 0; i < idx; i++) {
  ------------------
  |  Branch (36334:29): [True: 2, False: 2]
  ------------------
36335|      2|                    if (fd->args[i].var_name == name)
  ------------------
  |  Branch (36335:25): [True: 0, False: 2]
  ------------------
36336|      0|                        goto duplicate;
36337|      2|                }
36338|       |                /* Check if argument name duplicates a destructuring parameter */
36339|       |                /* XXX: should have a flag for such variables */
36340|      8|                for (i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (36340:29): [True: 6, False: 2]
  ------------------
36341|      6|                    if (fd->vars[i].var_name == name &&
  ------------------
  |  Branch (36341:25): [True: 2, False: 4]
  ------------------
36342|      2|                        fd->vars[i].scope_level == 0)
  ------------------
  |  Branch (36342:25): [True: 0, False: 2]
  ------------------
36343|      0|                        goto duplicate;
36344|      6|                }
36345|      2|            }
36346|      4|        }
36347|      2|    }
36348|      5|    return 0;
36349|       |
36350|      0|duplicate:
36351|      0|    return js_parse_error(s, "duplicate argument names not allowed in this context");
36352|      5|}
quickjs.c:js_is_live_code:
23699|     65|static BOOL js_is_live_code(JSParseState *s) {
23700|     65|    switch (get_prev_opcode(s->cur_func)) {
23701|      0|    case OP_tail_call:
  ------------------
  |  Branch (23701:5): [True: 0, False: 65]
  ------------------
23702|      0|    case OP_tail_call_method:
  ------------------
  |  Branch (23702:5): [True: 0, False: 65]
  ------------------
23703|      0|    case OP_return:
  ------------------
  |  Branch (23703:5): [True: 0, False: 65]
  ------------------
23704|      0|    case OP_return_undef:
  ------------------
  |  Branch (23704:5): [True: 0, False: 65]
  ------------------
23705|      0|    case OP_return_async:
  ------------------
  |  Branch (23705:5): [True: 0, False: 65]
  ------------------
23706|      0|    case OP_throw:
  ------------------
  |  Branch (23706:5): [True: 0, False: 65]
  ------------------
23707|      0|    case OP_throw_error:
  ------------------
  |  Branch (23707:5): [True: 0, False: 65]
  ------------------
23708|      0|    case OP_goto:
  ------------------
  |  Branch (23708:5): [True: 0, False: 65]
  ------------------
23709|      0|#if SHORT_OPCODES
23710|      0|    case OP_goto8:
  ------------------
  |  Branch (23710:5): [True: 0, False: 65]
  ------------------
23711|      0|    case OP_goto16:
  ------------------
  |  Branch (23711:5): [True: 0, False: 65]
  ------------------
23712|      0|#endif
23713|      0|    case OP_ret:
  ------------------
  |  Branch (23713:5): [True: 0, False: 65]
  ------------------
23714|      0|        return FALSE;
23715|     65|    default:
  ------------------
  |  Branch (23715:5): [True: 65, False: 0]
  ------------------
23716|     65|        return TRUE;
23717|     65|    }
23718|     65|}
quickjs.c:reparse_ident_token:
22653|      3|{
22654|      3|    if (s->token.val == TOK_IDENT ||
  ------------------
  |  Branch (22654:9): [True: 1, False: 2]
  ------------------
22655|      2|        (s->token.val >= TOK_FIRST_KEYWORD &&
  ------------------
  |  |21765|      4|#define TOK_FIRST_KEYWORD   TOK_NULL
  ------------------
  |  Branch (22655:10): [True: 2, False: 0]
  ------------------
22656|      2|         s->token.val <= TOK_LAST_KEYWORD)) {
  ------------------
  |  |21766|      2|#define TOK_LAST_KEYWORD    TOK_AWAIT
  ------------------
  |  Branch (22656:10): [True: 0, False: 2]
  ------------------
22657|      1|        s->token.val = TOK_IDENT;
22658|      1|        s->token.u.ident.is_reserved = FALSE;
22659|      1|        update_token_ident(s);
22660|      1|    }
22661|      3|}
quickjs.c:cpool_add:
23845|     16|{
23846|     16|    JSFunctionDef *fd = s->cur_func;
23847|       |
23848|     16|    if (js_resize_array(s->ctx, (void *)&fd->cpool, sizeof(fd->cpool[0]),
  ------------------
  |  Branch (23848:9): [True: 0, False: 16]
  ------------------
23849|     16|                        &fd->cpool_size, fd->cpool_count + 1)) {
23850|      0|        JS_FreeValue(s->ctx, val);
23851|      0|        return -1;
23852|      0|    }
23853|     16|    fd->cpool[fd->cpool_count++] = val;
23854|     16|    return fd->cpool_count - 1;
23855|     16|}
quickjs.c:emit_u32:
23731|    368|{
23732|    368|    dbuf_put_u32(&s->cur_func->byte_code, val);
23733|    368|}
quickjs.c:add_global_var:
24159|      1|{
24160|      1|    JSGlobalVar *hf;
24161|       |
24162|      1|    if (js_resize_array(ctx, (void **)&s->global_vars,
  ------------------
  |  Branch (24162:9): [True: 0, False: 1]
  ------------------
24163|      1|                        sizeof(s->global_vars[0]),
24164|      1|                        &s->global_var_size, s->global_var_count + 1))
24165|      0|        return NULL;
24166|      1|    hf = &s->global_vars[s->global_var_count++];
24167|      1|    hf->cpool_idx = -1;
24168|      1|    hf->force_init = FALSE;
24169|      1|    hf->is_lexical = FALSE;
24170|      1|    hf->is_const = FALSE;
24171|      1|    hf->scope_level = s->scope_level;
24172|      1|    hf->var_name = JS_DupAtom(ctx, name);
24173|      1|    return hf;
24174|      1|}
quickjs.c:js_parse_from_clause:
31549|     34|{
31550|     34|    JSAtom module_name;
31551|     34|    int idx;
31552|       |
31553|     34|    if (!token_is_pseudo_keyword(s, JS_ATOM_from)) {
  ------------------
  |  Branch (31553:9): [True: 0, False: 34]
  ------------------
31554|      0|        js_parse_error(s, "from clause expected");
31555|      0|        return -1;
31556|      0|    }
31557|     34|    if (next_token(s))
  ------------------
  |  Branch (31557:9): [True: 0, False: 34]
  ------------------
31558|      0|        return -1;
31559|     34|    if (s->token.val != TOK_STRING) {
  ------------------
  |  Branch (31559:9): [True: 0, False: 34]
  ------------------
31560|      0|        js_parse_error(s, "string expected");
31561|      0|        return -1;
31562|      0|    }
31563|     34|    module_name = JS_ValueToAtom(s->ctx, s->token.u.str.str);
31564|     34|    if (module_name == JS_ATOM_NULL)
  ------------------
  |  |  451|     34|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (31564:9): [True: 0, False: 34]
  ------------------
31565|      0|        return -1;
31566|     34|    if (next_token(s)) {
  ------------------
  |  Branch (31566:9): [True: 0, False: 34]
  ------------------
31567|      0|        JS_FreeAtom(s->ctx, module_name);
31568|      0|        return -1;
31569|      0|    }
31570|       |
31571|     34|    idx = add_req_module_entry(s->ctx, m, module_name);
31572|     34|    JS_FreeAtom(s->ctx, module_name);
31573|     34|    if (idx < 0)
  ------------------
  |  Branch (31573:9): [True: 0, False: 34]
  ------------------
31574|      0|        return -1;
31575|     34|    if (s->token.val == TOK_WITH) {
  ------------------
  |  Branch (31575:9): [True: 0, False: 34]
  ------------------
31576|      0|        if (js_parse_with_clause(s, &m->req_module_entries[idx]))
  ------------------
  |  Branch (31576:13): [True: 0, False: 0]
  ------------------
31577|      0|            return -1;
31578|      0|    }
31579|     34|    return idx;
31580|     34|}
quickjs.c:add_req_module_entry:
29652|     34|{
29653|     34|    JSReqModuleEntry *rme;
29654|       |
29655|     34|    if (js_resize_array(ctx, (void **)&m->req_module_entries,
  ------------------
  |  Branch (29655:9): [True: 0, False: 34]
  ------------------
29656|     34|                        sizeof(JSReqModuleEntry),
29657|     34|                        &m->req_module_entries_size,
29658|     34|                        m->req_module_entries_count + 1))
29659|      0|        return -1;
29660|     34|    rme = &m->req_module_entries[m->req_module_entries_count++];
29661|     34|    rme->module_name = JS_DupAtom(ctx, module_name);
29662|     34|    rme->module = NULL;
29663|     34|    rme->attributes = JS_UNDEFINED;
  ------------------
  |  |  291|     34|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     34|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29664|     34|    return m->req_module_entries_count - 1;
29665|     34|}
quickjs.c:js_parse_import:
31783|     34|{
31784|     34|    JSContext *ctx = s->ctx;
31785|     34|    JSModuleDef *m = s->cur_func->module;
31786|     34|    JSAtom local_name, import_name, module_name;
31787|     34|    int first_import, i, idx;
31788|       |
31789|     34|    if (next_token(s))
  ------------------
  |  Branch (31789:9): [True: 0, False: 34]
  ------------------
31790|      0|        return -1;
31791|       |
31792|     34|    first_import = m->import_entries_count;
31793|     34|    if (s->token.val == TOK_STRING) {
  ------------------
  |  Branch (31793:9): [True: 0, False: 34]
  ------------------
31794|      0|        module_name = JS_ValueToAtom(ctx, s->token.u.str.str);
31795|      0|        if (module_name == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (31795:13): [True: 0, False: 0]
  ------------------
31796|      0|            return -1;
31797|      0|        if (next_token(s)) {
  ------------------
  |  Branch (31797:13): [True: 0, False: 0]
  ------------------
31798|      0|            JS_FreeAtom(ctx, module_name);
31799|      0|            return -1;
31800|      0|        }
31801|      0|        idx = add_req_module_entry(ctx, m, module_name);
31802|      0|        JS_FreeAtom(ctx, module_name);
31803|      0|        if (idx < 0)
  ------------------
  |  Branch (31803:13): [True: 0, False: 0]
  ------------------
31804|      0|            return -1;
31805|      0|        if (s->token.val == TOK_WITH) {
  ------------------
  |  Branch (31805:13): [True: 0, False: 0]
  ------------------
31806|      0|            if (js_parse_with_clause(s, &m->req_module_entries[idx]))
  ------------------
  |  Branch (31806:17): [True: 0, False: 0]
  ------------------
31807|      0|                return -1;
31808|      0|        }
31809|     34|    } else {
31810|     34|        if (s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (31810:13): [True: 0, False: 34]
  ------------------
31811|      0|            if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (31811:17): [True: 0, False: 0]
  ------------------
31812|      0|                return js_parse_error_reserved_identifier(s);
31813|      0|            }
31814|       |            /* "default" import */
31815|      0|            local_name = JS_DupAtom(ctx, s->token.u.ident.atom);
31816|      0|            import_name = JS_ATOM_default;
31817|      0|            if (next_token(s))
  ------------------
  |  Branch (31817:17): [True: 0, False: 0]
  ------------------
31818|      0|                goto fail;
31819|      0|            if (add_import(s, m, local_name, import_name, FALSE))
  ------------------
  |  Branch (31819:17): [True: 0, False: 0]
  ------------------
31820|      0|                goto fail;
31821|      0|            JS_FreeAtom(ctx, local_name);
31822|       |
31823|      0|            if (s->token.val != ',')
  ------------------
  |  Branch (31823:17): [True: 0, False: 0]
  ------------------
31824|      0|                goto end_import_clause;
31825|      0|            if (next_token(s))
  ------------------
  |  Branch (31825:17): [True: 0, False: 0]
  ------------------
31826|      0|                return -1;
31827|      0|        }
31828|       |
31829|     34|        if (s->token.val == '*') {
  ------------------
  |  Branch (31829:13): [True: 34, False: 0]
  ------------------
31830|       |            /* name space import */
31831|     34|            if (next_token(s))
  ------------------
  |  Branch (31831:17): [True: 0, False: 34]
  ------------------
31832|      0|                return -1;
31833|     34|            if (!token_is_pseudo_keyword(s, JS_ATOM_as))
  ------------------
  |  Branch (31833:17): [True: 0, False: 34]
  ------------------
31834|      0|                return js_parse_error(s, "expecting 'as'");
31835|     34|            if (next_token(s))
  ------------------
  |  Branch (31835:17): [True: 0, False: 34]
  ------------------
31836|      0|                return -1;
31837|     34|            if (!token_is_ident(s->token.val)) {
  ------------------
  |  Branch (31837:17): [True: 0, False: 34]
  ------------------
31838|      0|                js_parse_error(s, "identifier expected");
31839|      0|                return -1;
31840|      0|            }
31841|     34|            local_name = JS_DupAtom(ctx, s->token.u.ident.atom);
31842|     34|            import_name = JS_ATOM__star_;
31843|     34|            if (next_token(s))
  ------------------
  |  Branch (31843:17): [True: 0, False: 34]
  ------------------
31844|      0|                goto fail;
31845|     34|            if (add_import(s, m, local_name, import_name, TRUE))
  ------------------
  |  Branch (31845:17): [True: 0, False: 34]
  ------------------
31846|      0|                goto fail;
31847|     34|            JS_FreeAtom(ctx, local_name);
31848|     34|        } else if (s->token.val == '{') {
  ------------------
  |  Branch (31848:20): [True: 0, False: 0]
  ------------------
31849|      0|            if (next_token(s))
  ------------------
  |  Branch (31849:17): [True: 0, False: 0]
  ------------------
31850|      0|                return -1;
31851|       |
31852|      0|            while (s->token.val != '}') {
  ------------------
  |  Branch (31852:20): [True: 0, False: 0]
  ------------------
31853|      0|                BOOL is_string;
31854|      0|                if (s->token.val == TOK_STRING) {
  ------------------
  |  Branch (31854:21): [True: 0, False: 0]
  ------------------
31855|      0|                    is_string = TRUE;
31856|      0|                    if (js_string_find_invalid_codepoint(JS_VALUE_GET_STRING(s->token.u.str.str)) >= 0) {
  ------------------
  |  |  230|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
  |  Branch (31856:25): [True: 0, False: 0]
  ------------------
31857|      0|                        js_parse_error(s, "contains unpaired surrogate");
31858|      0|                        return -1;
31859|      0|                    }
31860|      0|                    import_name = JS_ValueToAtom(s->ctx, s->token.u.str.str);
31861|      0|                    if (import_name == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (31861:25): [True: 0, False: 0]
  ------------------
31862|      0|                        return -1;
31863|      0|                } else {
31864|      0|                    is_string = FALSE;
31865|      0|                    if (!token_is_ident(s->token.val)) {
  ------------------
  |  Branch (31865:25): [True: 0, False: 0]
  ------------------
31866|      0|                        js_parse_error(s, "identifier expected");
31867|      0|                        return -1;
31868|      0|                    }
31869|      0|                    import_name = JS_DupAtom(ctx, s->token.u.ident.atom);
31870|      0|                }
31871|      0|                local_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
31872|      0|                if (next_token(s))
  ------------------
  |  Branch (31872:21): [True: 0, False: 0]
  ------------------
31873|      0|                    goto fail;
31874|      0|                if (token_is_pseudo_keyword(s, JS_ATOM_as)) {
  ------------------
  |  Branch (31874:21): [True: 0, False: 0]
  ------------------
31875|      0|                    if (next_token(s))
  ------------------
  |  Branch (31875:25): [True: 0, False: 0]
  ------------------
31876|      0|                        goto fail;
31877|      0|                    if (!token_is_ident(s->token.val)) {
  ------------------
  |  Branch (31877:25): [True: 0, False: 0]
  ------------------
31878|      0|                        js_parse_error(s, "identifier expected");
31879|      0|                        goto fail;
31880|      0|                    }
31881|      0|                    local_name = JS_DupAtom(ctx, s->token.u.ident.atom);
31882|      0|                    if (next_token(s))
  ------------------
  |  Branch (31882:25): [True: 0, False: 0]
  ------------------
31883|      0|                        goto fail;
31884|      0|                } else {
31885|      0|                    if (is_string) {
  ------------------
  |  Branch (31885:25): [True: 0, False: 0]
  ------------------
31886|      0|                        js_parse_error(s, "expecting 'as'");
31887|      0|                    fail:
31888|      0|                        JS_FreeAtom(ctx, local_name);
31889|      0|                        JS_FreeAtom(ctx, import_name);
31890|      0|                        return -1;
31891|      0|                    }
31892|      0|                    local_name = JS_DupAtom(ctx, import_name);
31893|      0|                }
31894|      0|                if (add_import(s, m, local_name, import_name, FALSE))
  ------------------
  |  Branch (31894:21): [True: 0, False: 0]
  ------------------
31895|      0|                    goto fail;
31896|      0|                JS_FreeAtom(ctx, local_name);
31897|      0|                JS_FreeAtom(ctx, import_name);
31898|      0|                if (s->token.val != ',')
  ------------------
  |  Branch (31898:21): [True: 0, False: 0]
  ------------------
31899|      0|                    break;
31900|      0|                if (next_token(s))
  ------------------
  |  Branch (31900:21): [True: 0, False: 0]
  ------------------
31901|      0|                    return -1;
31902|      0|            }
31903|      0|            if (js_parse_expect(s, '}'))
  ------------------
  |  Branch (31903:17): [True: 0, False: 0]
  ------------------
31904|      0|                return -1;
31905|      0|        }
31906|     34|    end_import_clause:
31907|     34|        idx = js_parse_from_clause(s, m);
31908|     34|        if (idx < 0)
  ------------------
  |  Branch (31908:13): [True: 0, False: 34]
  ------------------
31909|      0|            return -1;
31910|     34|    }
31911|     68|    for(i = first_import; i < m->import_entries_count; i++)
  ------------------
  |  Branch (31911:27): [True: 34, False: 34]
  ------------------
31912|     34|        m->import_entries[i].req_module_idx = idx;
31913|       |
31914|     34|    return js_parse_expect_semi(s);
31915|     34|}
quickjs.c:add_import:
31749|     34|{
31750|     34|    JSContext *ctx = s->ctx;
31751|     34|    int i, var_idx;
31752|     34|    JSImportEntry *mi;
31753|       |
31754|     34|    if (local_name == JS_ATOM_arguments || local_name == JS_ATOM_eval)
  ------------------
  |  Branch (31754:9): [True: 0, False: 34]
  |  Branch (31754:44): [True: 0, False: 34]
  ------------------
31755|      0|        return js_parse_error(s, "invalid import binding");
31756|       |
31757|     34|    if (local_name != JS_ATOM_default) {
  ------------------
  |  Branch (31757:9): [True: 34, False: 0]
  ------------------
31758|     51|        for (i = 0; i < s->cur_func->closure_var_count; i++) {
  ------------------
  |  Branch (31758:21): [True: 17, False: 34]
  ------------------
31759|     17|            if (s->cur_func->closure_var[i].var_name == local_name)
  ------------------
  |  Branch (31759:17): [True: 0, False: 17]
  ------------------
31760|      0|                return js_parse_error(s, "duplicate import binding");
31761|     17|        }
31762|     34|    }
31763|       |
31764|     34|    var_idx = add_closure_var(ctx, s->cur_func,
31765|     34|                              is_star ? JS_CLOSURE_MODULE_DECL : JS_CLOSURE_MODULE_IMPORT,
  ------------------
  |  Branch (31765:31): [True: 34, False: 0]
  ------------------
31766|     34|                              m->import_entries_count,
31767|     34|                              local_name, TRUE, TRUE, JS_VAR_NORMAL);
31768|     34|    if (var_idx < 0)
  ------------------
  |  Branch (31768:9): [True: 0, False: 34]
  ------------------
31769|      0|        return -1;
31770|     34|    if (js_resize_array(ctx, (void **)&m->import_entries,
  ------------------
  |  Branch (31770:9): [True: 0, False: 34]
  ------------------
31771|     34|                        sizeof(JSImportEntry),
31772|     34|                        &m->import_entries_size,
31773|     34|                        m->import_entries_count + 1))
31774|      0|        return -1;
31775|     34|    mi = &m->import_entries[m->import_entries_count++];
31776|     34|    mi->import_name = JS_DupAtom(ctx, import_name);
31777|     34|    mi->var_idx = var_idx;
31778|     34|    mi->is_star = is_star;
31779|     34|    return 0;
31780|     34|}
quickjs.c:add_closure_var:
32582|     73|{
32583|     73|    JSClosureVar *cv;
32584|       |
32585|       |    /* the closure variable indexes are currently stored on 16 bits */
32586|     73|    if (s->closure_var_count >= JS_MAX_LOCAL_VARS) {
  ------------------
  |  |  210|     73|#define JS_MAX_LOCAL_VARS 65534
  ------------------
  |  Branch (32586:9): [True: 0, False: 73]
  ------------------
32587|      0|        JS_ThrowInternalError(ctx, "too many closure variables");
32588|      0|        return -1;
32589|      0|    }
32590|       |
32591|     73|    if (js_resize_array(ctx, (void **)&s->closure_var,
  ------------------
  |  Branch (32591:9): [True: 0, False: 73]
  ------------------
32592|     73|                        sizeof(s->closure_var[0]),
32593|     73|                        &s->closure_var_size, s->closure_var_count + 1))
32594|      0|        return -1;
32595|     73|    cv = &s->closure_var[s->closure_var_count++];
32596|     73|    cv->closure_type = closure_type;
32597|     73|    cv->is_const = is_const;
32598|     73|    cv->is_lexical = is_lexical;
32599|     73|    cv->var_kind = var_kind;
32600|     73|    cv->var_idx = var_idx;
32601|     73|    cv->var_name = JS_DupAtom(ctx, var_name);
32602|     73|    return s->closure_var_count - 1;
32603|     73|}
quickjs.c:js_parse_statement_or_decl:
28786|    106|{
28787|    106|    JSContext *ctx = s->ctx;
28788|    106|    JSAtom label_name;
28789|    106|    int tok;
28790|       |
28791|       |    /* specific label handling */
28792|       |    /* XXX: support multiple labels on loop statements */
28793|    106|    label_name = JS_ATOM_NULL;
  ------------------
  |  |  451|    106|#define JS_ATOM_NULL 0
  ------------------
28794|    106|    if (is_label(s)) {
  ------------------
  |  Branch (28794:9): [True: 16, False: 90]
  ------------------
28795|     16|        BlockEnv *be;
28796|       |
28797|     16|        label_name = JS_DupAtom(ctx, s->token.u.ident.atom);
28798|       |
28799|     16|        for (be = s->cur_func->top_break; be; be = be->prev) {
  ------------------
  |  Branch (28799:43): [True: 0, False: 16]
  ------------------
28800|      0|            if (be->label_name == label_name) {
  ------------------
  |  Branch (28800:17): [True: 0, False: 0]
  ------------------
28801|      0|                js_parse_error(s, "duplicate label name");
28802|      0|                goto fail;
28803|      0|            }
28804|      0|        }
28805|       |
28806|     16|        if (next_token(s))
  ------------------
  |  Branch (28806:13): [True: 0, False: 16]
  ------------------
28807|      0|            goto fail;
28808|     16|        if (js_parse_expect(s, ':'))
  ------------------
  |  Branch (28808:13): [True: 0, False: 16]
  ------------------
28809|      0|            goto fail;
28810|     16|        if (s->token.val != TOK_FOR
  ------------------
  |  Branch (28810:13): [True: 2, False: 14]
  ------------------
28811|      2|        &&  s->token.val != TOK_DO
  ------------------
  |  Branch (28811:13): [True: 2, False: 0]
  ------------------
28812|      2|        &&  s->token.val != TOK_WHILE) {
  ------------------
  |  Branch (28812:13): [True: 2, False: 0]
  ------------------
28813|       |            /* labelled regular statement */
28814|      2|            int label_break, mask;
28815|      2|            BlockEnv break_entry;
28816|       |
28817|      2|            label_break = new_label(s);
28818|      2|            push_break_entry(s->cur_func, &break_entry,
28819|      2|                             label_name, label_break, -1, 0);
28820|      2|            break_entry.is_regular_stmt = TRUE;
28821|      2|            if (!(s->cur_func->js_mode & JS_MODE_STRICT) &&
  ------------------
  |  |  403|      2|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (28821:17): [True: 2, False: 0]
  ------------------
28822|      2|                (decl_mask & DECL_MASK_FUNC_WITH_LABEL)) {
  ------------------
  |  |28366|      2|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  ------------------
  |  Branch (28822:17): [True: 2, False: 0]
  ------------------
28823|      2|                mask = DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL;
  ------------------
  |  |28364|      2|#define DECL_MASK_FUNC  (1 << 0) /* allow normal function declaration */
  ------------------
                              mask = DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL;
  ------------------
  |  |28366|      2|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  ------------------
28824|      2|            } else {
28825|      0|                mask = 0;
28826|      0|            }
28827|      2|            if (js_parse_statement_or_decl(s, mask))
  ------------------
  |  Branch (28827:17): [True: 0, False: 2]
  ------------------
28828|      0|                goto fail;
28829|      2|            emit_label(s, label_break);
28830|      2|            pop_break_entry(s->cur_func);
28831|      2|            goto done;
28832|      2|        }
28833|     16|    }
28834|       |
28835|    104|    switch(tok = s->token.val) {
28836|      6|    case '{':
  ------------------
  |  Branch (28836:5): [True: 6, False: 98]
  ------------------
28837|      6|        if (js_parse_block(s))
  ------------------
  |  Branch (28837:13): [True: 5, False: 1]
  ------------------
28838|      5|            goto fail;
28839|      1|        break;
28840|      1|    case TOK_RETURN:
  ------------------
  |  Branch (28840:5): [True: 0, False: 104]
  ------------------
28841|      0|        {
28842|      0|            const uint8_t *op_token_ptr;
28843|      0|            if (s->cur_func->is_eval) {
  ------------------
  |  Branch (28843:17): [True: 0, False: 0]
  ------------------
28844|      0|                js_parse_error(s, "return not in a function");
28845|      0|                goto fail;
28846|      0|            }
28847|      0|            if (s->cur_func->func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT) {
  ------------------
  |  Branch (28847:17): [True: 0, False: 0]
  ------------------
28848|      0|                js_parse_error(s, "return in a static initializer block");
28849|      0|                goto fail;
28850|      0|            }
28851|      0|            op_token_ptr = s->token.ptr;
28852|      0|            if (next_token(s))
  ------------------
  |  Branch (28852:17): [True: 0, False: 0]
  ------------------
28853|      0|                goto fail;
28854|      0|            if (s->token.val != ';' && s->token.val != '}' && !s->got_lf) {
  ------------------
  |  Branch (28854:17): [True: 0, False: 0]
  |  Branch (28854:40): [True: 0, False: 0]
  |  Branch (28854:63): [True: 0, False: 0]
  ------------------
28855|      0|                if (js_parse_expr(s))
  ------------------
  |  Branch (28855:21): [True: 0, False: 0]
  ------------------
28856|      0|                    goto fail;
28857|      0|                emit_source_pos(s, op_token_ptr);
28858|      0|                emit_return(s, TRUE);
28859|      0|            } else {
28860|      0|                emit_source_pos(s, op_token_ptr);
28861|      0|                emit_return(s, FALSE);
28862|      0|            }
28863|      0|            if (js_parse_expect_semi(s))
  ------------------
  |  Branch (28863:17): [True: 0, False: 0]
  ------------------
28864|      0|                goto fail;
28865|      0|        }
28866|      0|        break;
28867|      0|    case TOK_THROW:
  ------------------
  |  Branch (28867:5): [True: 0, False: 104]
  ------------------
28868|      0|        {
28869|      0|            const uint8_t *op_token_ptr;
28870|      0|            op_token_ptr = s->token.ptr;
28871|      0|            if (next_token(s))
  ------------------
  |  Branch (28871:17): [True: 0, False: 0]
  ------------------
28872|      0|                goto fail;
28873|      0|            if (s->got_lf) {
  ------------------
  |  Branch (28873:17): [True: 0, False: 0]
  ------------------
28874|      0|                js_parse_error(s, "line terminator not allowed after throw");
28875|      0|                goto fail;
28876|      0|            }
28877|      0|            if (js_parse_expr(s))
  ------------------
  |  Branch (28877:17): [True: 0, False: 0]
  ------------------
28878|      0|                goto fail;
28879|      0|            emit_source_pos(s, op_token_ptr);
28880|      0|            emit_op(s, OP_throw);
28881|      0|            if (js_parse_expect_semi(s))
  ------------------
  |  Branch (28881:17): [True: 0, False: 0]
  ------------------
28882|      0|                goto fail;
28883|      0|        }
28884|      0|        break;
28885|      0|    case TOK_LET:
  ------------------
  |  Branch (28885:5): [True: 0, False: 104]
  ------------------
28886|      0|    case TOK_CONST:
  ------------------
  |  Branch (28886:5): [True: 0, False: 104]
  ------------------
28887|      0|    haslet:
28888|      0|        if (!(decl_mask & DECL_MASK_OTHER)) {
  ------------------
  |  |28367|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (28888:13): [True: 0, False: 0]
  ------------------
28889|      0|            js_parse_error(s, "lexical declarations can't appear in single-statement context");
28890|      0|            goto fail;
28891|      0|        }
28892|       |        /* fall thru */
28893|      0|    case TOK_VAR:
  ------------------
  |  Branch (28893:5): [True: 0, False: 104]
  ------------------
28894|      0|        if (next_token(s))
  ------------------
  |  Branch (28894:13): [True: 0, False: 0]
  ------------------
28895|      0|            goto fail;
28896|      0|        if (js_parse_var(s, TRUE, tok, FALSE))
  ------------------
  |  Branch (28896:13): [True: 0, False: 0]
  ------------------
28897|      0|            goto fail;
28898|      0|        if (js_parse_expect_semi(s))
  ------------------
  |  Branch (28898:13): [True: 0, False: 0]
  ------------------
28899|      0|            goto fail;
28900|      0|        break;
28901|      0|    case TOK_IF:
  ------------------
  |  Branch (28901:5): [True: 0, False: 104]
  ------------------
28902|      0|        {
28903|      0|            int label1, label2, mask;
28904|      0|            if (next_token(s))
  ------------------
  |  Branch (28904:17): [True: 0, False: 0]
  ------------------
28905|      0|                goto fail;
28906|       |            /* create a new scope for `let f;if(1) function f(){}` */
28907|      0|            push_scope(s);
28908|      0|            set_eval_ret_undefined(s);
28909|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (28909:17): [True: 0, False: 0]
  ------------------
28910|      0|                goto fail;
28911|      0|            label1 = emit_goto(s, OP_if_false, -1);
28912|      0|            if (s->cur_func->js_mode & JS_MODE_STRICT)
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (28912:17): [True: 0, False: 0]
  ------------------
28913|      0|                mask = 0;
28914|      0|            else
28915|      0|                mask = DECL_MASK_FUNC; /* Annex B.3.4 */
  ------------------
  |  |28364|      0|#define DECL_MASK_FUNC  (1 << 0) /* allow normal function declaration */
  ------------------
28916|       |
28917|      0|            if (js_parse_statement_or_decl(s, mask))
  ------------------
  |  Branch (28917:17): [True: 0, False: 0]
  ------------------
28918|      0|                goto fail;
28919|       |
28920|      0|            if (s->token.val == TOK_ELSE) {
  ------------------
  |  Branch (28920:17): [True: 0, False: 0]
  ------------------
28921|      0|                label2 = emit_goto(s, OP_goto, -1);
28922|      0|                if (next_token(s))
  ------------------
  |  Branch (28922:21): [True: 0, False: 0]
  ------------------
28923|      0|                    goto fail;
28924|       |
28925|      0|                emit_label(s, label1);
28926|      0|                if (js_parse_statement_or_decl(s, mask))
  ------------------
  |  Branch (28926:21): [True: 0, False: 0]
  ------------------
28927|      0|                    goto fail;
28928|       |
28929|      0|                label1 = label2;
28930|      0|            }
28931|      0|            emit_label(s, label1);
28932|      0|            pop_scope(s);
28933|      0|        }
28934|      0|        break;
28935|      0|    case TOK_WHILE:
  ------------------
  |  Branch (28935:5): [True: 0, False: 104]
  ------------------
28936|      0|        {
28937|      0|            int label_cont, label_break;
28938|      0|            BlockEnv break_entry;
28939|       |
28940|      0|            label_cont = new_label(s);
28941|      0|            label_break = new_label(s);
28942|       |
28943|      0|            push_break_entry(s->cur_func, &break_entry,
28944|      0|                             label_name, label_break, label_cont, 0);
28945|       |
28946|      0|            if (next_token(s))
  ------------------
  |  Branch (28946:17): [True: 0, False: 0]
  ------------------
28947|      0|                goto fail;
28948|       |
28949|      0|            set_eval_ret_undefined(s);
28950|       |
28951|      0|            emit_label(s, label_cont);
28952|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (28952:17): [True: 0, False: 0]
  ------------------
28953|      0|                goto fail;
28954|      0|            emit_goto(s, OP_if_false, label_break);
28955|       |
28956|      0|            if (js_parse_statement(s))
  ------------------
  |  Branch (28956:17): [True: 0, False: 0]
  ------------------
28957|      0|                goto fail;
28958|      0|            emit_goto(s, OP_goto, label_cont);
28959|       |
28960|      0|            emit_label(s, label_break);
28961|       |
28962|      0|            pop_break_entry(s->cur_func);
28963|      0|        }
28964|      0|        break;
28965|      0|    case TOK_DO:
  ------------------
  |  Branch (28965:5): [True: 0, False: 104]
  ------------------
28966|      0|        {
28967|      0|            int label_cont, label_break, label1;
28968|      0|            BlockEnv break_entry;
28969|       |
28970|      0|            label_cont = new_label(s);
28971|      0|            label_break = new_label(s);
28972|      0|            label1 = new_label(s);
28973|       |
28974|      0|            push_break_entry(s->cur_func, &break_entry,
28975|      0|                             label_name, label_break, label_cont, 0);
28976|       |
28977|      0|            if (next_token(s))
  ------------------
  |  Branch (28977:17): [True: 0, False: 0]
  ------------------
28978|      0|                goto fail;
28979|       |
28980|      0|            emit_label(s, label1);
28981|       |
28982|      0|            set_eval_ret_undefined(s);
28983|       |
28984|      0|            if (js_parse_statement(s))
  ------------------
  |  Branch (28984:17): [True: 0, False: 0]
  ------------------
28985|      0|                goto fail;
28986|       |
28987|      0|            emit_label(s, label_cont);
28988|      0|            if (js_parse_expect(s, TOK_WHILE))
  ------------------
  |  Branch (28988:17): [True: 0, False: 0]
  ------------------
28989|      0|                goto fail;
28990|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (28990:17): [True: 0, False: 0]
  ------------------
28991|      0|                goto fail;
28992|       |            /* Insert semicolon if missing */
28993|      0|            if (s->token.val == ';') {
  ------------------
  |  Branch (28993:17): [True: 0, False: 0]
  ------------------
28994|      0|                if (next_token(s))
  ------------------
  |  Branch (28994:21): [True: 0, False: 0]
  ------------------
28995|      0|                    goto fail;
28996|      0|            }
28997|      0|            emit_goto(s, OP_if_true, label1);
28998|       |
28999|      0|            emit_label(s, label_break);
29000|       |
29001|      0|            pop_break_entry(s->cur_func);
29002|      0|        }
29003|      0|        break;
29004|     15|    case TOK_FOR:
  ------------------
  |  Branch (29004:5): [True: 15, False: 89]
  ------------------
29005|     15|        {
29006|     15|            int label_cont, label_break, label_body, label_test;
29007|     15|            int pos_cont, pos_body, block_scope_level;
29008|     15|            BlockEnv break_entry;
29009|     15|            int tok, bits;
29010|     15|            BOOL is_async;
29011|       |
29012|     15|            if (next_token(s))
  ------------------
  |  Branch (29012:17): [True: 0, False: 15]
  ------------------
29013|      0|                goto fail;
29014|       |
29015|     15|            set_eval_ret_undefined(s);
29016|     15|            bits = 0;
29017|     15|            is_async = FALSE;
29018|     15|            if (s->token.val == '(') {
  ------------------
  |  Branch (29018:17): [True: 15, False: 0]
  ------------------
29019|     15|                js_parse_skip_parens_token(s, &bits, FALSE);
29020|     15|            } else if (s->token.val == TOK_AWAIT) {
  ------------------
  |  Branch (29020:24): [True: 0, False: 0]
  ------------------
29021|      0|                if (!(s->cur_func->func_kind & JS_FUNC_ASYNC)) {
  ------------------
  |  Branch (29021:21): [True: 0, False: 0]
  ------------------
29022|      0|                    js_parse_error(s, "for await is only valid in asynchronous functions");
29023|      0|                    goto fail;
29024|      0|                }
29025|      0|                is_async = TRUE;
29026|      0|                if (next_token(s))
  ------------------
  |  Branch (29026:21): [True: 0, False: 0]
  ------------------
29027|      0|                    goto fail;
29028|      0|                s->cur_func->has_await = TRUE;
29029|      0|            }
29030|     15|            if (js_parse_expect(s, '('))
  ------------------
  |  Branch (29030:17): [True: 0, False: 15]
  ------------------
29031|      0|                goto fail;
29032|       |
29033|     15|            if (!(bits & SKIP_HAS_SEMI)) {
  ------------------
  |  |24665|     15|#define SKIP_HAS_SEMI       (1 << 0)
  ------------------
  |  Branch (29033:17): [True: 15, False: 0]
  ------------------
29034|       |                /* parse for/in or for/of */
29035|     15|                if (js_parse_for_in_of(s, label_name, is_async))
  ------------------
  |  Branch (29035:21): [True: 2, False: 13]
  ------------------
29036|      2|                    goto fail;
29037|     13|                break;
29038|     15|            }
29039|      0|            block_scope_level = s->cur_func->scope_level;
29040|       |
29041|       |            /* create scope for the lexical variables declared in the initial,
29042|       |               test and increment expressions */
29043|      0|            push_scope(s);
29044|       |            /* initial expression */
29045|      0|            tok = s->token.val;
29046|      0|            if (tok != ';') {
  ------------------
  |  Branch (29046:17): [True: 0, False: 0]
  ------------------
29047|      0|                switch (is_let(s, DECL_MASK_OTHER)) {
  ------------------
  |  |28367|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
29048|      0|                case TRUE:
  ------------------
  |  Branch (29048:17): [True: 0, False: 0]
  ------------------
29049|      0|                    tok = TOK_LET;
29050|      0|                    break;
29051|      0|                case FALSE:
  ------------------
  |  Branch (29051:17): [True: 0, False: 0]
  ------------------
29052|      0|                    break;
29053|      0|                default:
  ------------------
  |  Branch (29053:17): [True: 0, False: 0]
  ------------------
29054|      0|                    goto fail;
29055|      0|                }
29056|      0|                if (tok == TOK_VAR || tok == TOK_LET || tok == TOK_CONST) {
  ------------------
  |  Branch (29056:21): [True: 0, False: 0]
  |  Branch (29056:39): [True: 0, False: 0]
  |  Branch (29056:57): [True: 0, False: 0]
  ------------------
29057|      0|                    if (next_token(s))
  ------------------
  |  Branch (29057:25): [True: 0, False: 0]
  ------------------
29058|      0|                        goto fail;
29059|      0|                    if (js_parse_var(s, FALSE, tok, FALSE))
  ------------------
  |  Branch (29059:25): [True: 0, False: 0]
  ------------------
29060|      0|                        goto fail;
29061|      0|                } else {
29062|      0|                    if (js_parse_expr2(s, FALSE))
  ------------------
  |  Branch (29062:25): [True: 0, False: 0]
  ------------------
29063|      0|                        goto fail;
29064|      0|                    emit_op(s, OP_drop);
29065|      0|                }
29066|       |
29067|       |                /* close the closures before the first iteration */
29068|      0|                close_scopes(s, s->cur_func->scope_level, block_scope_level);
29069|      0|            }
29070|      0|            if (js_parse_expect(s, ';'))
  ------------------
  |  Branch (29070:17): [True: 0, False: 0]
  ------------------
29071|      0|                goto fail;
29072|       |
29073|      0|            label_test = new_label(s);
29074|      0|            label_cont = new_label(s);
29075|      0|            label_body = new_label(s);
29076|      0|            label_break = new_label(s);
29077|       |
29078|      0|            push_break_entry(s->cur_func, &break_entry,
29079|      0|                             label_name, label_break, label_cont, 0);
29080|       |
29081|       |            /* test expression */
29082|      0|            if (s->token.val == ';') {
  ------------------
  |  Branch (29082:17): [True: 0, False: 0]
  ------------------
29083|       |                /* no test expression */
29084|      0|                label_test = label_body;
29085|      0|            } else {
29086|      0|                emit_label(s, label_test);
29087|      0|                if (js_parse_expr(s))
  ------------------
  |  Branch (29087:21): [True: 0, False: 0]
  ------------------
29088|      0|                    goto fail;
29089|      0|                emit_goto(s, OP_if_false, label_break);
29090|      0|            }
29091|      0|            if (js_parse_expect(s, ';'))
  ------------------
  |  Branch (29091:17): [True: 0, False: 0]
  ------------------
29092|      0|                goto fail;
29093|       |
29094|      0|            if (s->token.val == ')') {
  ------------------
  |  Branch (29094:17): [True: 0, False: 0]
  ------------------
29095|       |                /* no end expression */
29096|      0|                break_entry.label_cont = label_cont = label_test;
29097|      0|                pos_cont = 0; /* avoid warning */
29098|      0|            } else {
29099|       |                /* skip the end expression */
29100|      0|                emit_goto(s, OP_goto, label_body);
29101|       |
29102|      0|                pos_cont = s->cur_func->byte_code.size;
29103|      0|                emit_label(s, label_cont);
29104|      0|                if (js_parse_expr(s))
  ------------------
  |  Branch (29104:21): [True: 0, False: 0]
  ------------------
29105|      0|                    goto fail;
29106|      0|                emit_op(s, OP_drop);
29107|      0|                if (label_test != label_body)
  ------------------
  |  Branch (29107:21): [True: 0, False: 0]
  ------------------
29108|      0|                    emit_goto(s, OP_goto, label_test);
29109|      0|            }
29110|      0|            if (js_parse_expect(s, ')'))
  ------------------
  |  Branch (29110:17): [True: 0, False: 0]
  ------------------
29111|      0|                goto fail;
29112|       |
29113|      0|            pos_body = s->cur_func->byte_code.size;
29114|      0|            emit_label(s, label_body);
29115|      0|            if (js_parse_statement(s))
  ------------------
  |  Branch (29115:17): [True: 0, False: 0]
  ------------------
29116|      0|                goto fail;
29117|       |
29118|       |            /* close the closures before the next iteration */
29119|       |            /* XXX: check continue case */
29120|      0|            close_scopes(s, s->cur_func->scope_level, block_scope_level);
29121|       |
29122|      0|            if (OPTIMIZE && label_test != label_body && label_cont != label_test) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
  |  Branch (29122:29): [True: 0, False: 0]
  |  Branch (29122:57): [True: 0, False: 0]
  ------------------
29123|       |                /* move the increment code here */
29124|      0|                DynBuf *bc = &s->cur_func->byte_code;
29125|      0|                int chunk_size = pos_body - pos_cont;
29126|      0|                int offset = bc->size - pos_cont;
29127|      0|                int i;
29128|      0|                if (dbuf_claim(bc, chunk_size))
  ------------------
  |  Branch (29128:21): [True: 0, False: 0]
  ------------------
29129|      0|                    goto fail;
29130|      0|                dbuf_put(bc, bc->buf + pos_cont, chunk_size);
29131|      0|                memset(bc->buf + pos_cont, OP_nop, chunk_size);
29132|       |                /* increment part ends with a goto */
29133|      0|                s->cur_func->last_opcode_pos = bc->size - 5;
29134|       |                /* relocate labels */
29135|      0|                for (i = label_cont; i < s->cur_func->label_count; i++) {
  ------------------
  |  Branch (29135:38): [True: 0, False: 0]
  ------------------
29136|      0|                    LabelSlot *ls = &s->cur_func->label_slots[i];
29137|      0|                    if (ls->pos >= pos_cont && ls->pos < pos_body)
  ------------------
  |  Branch (29137:25): [True: 0, False: 0]
  |  Branch (29137:48): [True: 0, False: 0]
  ------------------
29138|      0|                        ls->pos += offset;
29139|      0|                }
29140|      0|            } else {
29141|      0|                emit_goto(s, OP_goto, label_cont);
29142|      0|            }
29143|       |
29144|      0|            emit_label(s, label_break);
29145|       |
29146|      0|            pop_break_entry(s->cur_func);
29147|      0|            pop_scope(s);
29148|      0|        }
29149|      0|        break;
29150|      0|    case TOK_BREAK:
  ------------------
  |  Branch (29150:5): [True: 0, False: 104]
  ------------------
29151|      0|    case TOK_CONTINUE:
  ------------------
  |  Branch (29151:5): [True: 0, False: 104]
  ------------------
29152|      0|        {
29153|      0|            int is_cont = s->token.val - TOK_BREAK;
29154|      0|            int label;
29155|       |
29156|      0|            if (next_token(s))
  ------------------
  |  Branch (29156:17): [True: 0, False: 0]
  ------------------
29157|      0|                goto fail;
29158|      0|            if (!s->got_lf && s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved)
  ------------------
  |  Branch (29158:17): [True: 0, False: 0]
  |  Branch (29158:31): [True: 0, False: 0]
  |  Branch (29158:60): [True: 0, False: 0]
  ------------------
29159|      0|                label = s->token.u.ident.atom;
29160|      0|            else
29161|      0|                label = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
29162|      0|            if (emit_break(s, label, is_cont))
  ------------------
  |  Branch (29162:17): [True: 0, False: 0]
  ------------------
29163|      0|                goto fail;
29164|      0|            if (label != JS_ATOM_NULL) {
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (29164:17): [True: 0, False: 0]
  ------------------
29165|      0|                if (next_token(s))
  ------------------
  |  Branch (29165:21): [True: 0, False: 0]
  ------------------
29166|      0|                    goto fail;
29167|      0|            }
29168|      0|            if (js_parse_expect_semi(s))
  ------------------
  |  Branch (29168:17): [True: 0, False: 0]
  ------------------
29169|      0|                goto fail;
29170|      0|        }
29171|      0|        break;
29172|      0|    case TOK_SWITCH:
  ------------------
  |  Branch (29172:5): [True: 0, False: 104]
  ------------------
29173|      0|        {
29174|      0|            int label_case, label_break, label1;
29175|      0|            int default_label_pos;
29176|      0|            BlockEnv break_entry;
29177|       |
29178|      0|            if (next_token(s))
  ------------------
  |  Branch (29178:17): [True: 0, False: 0]
  ------------------
29179|      0|                goto fail;
29180|       |
29181|      0|            set_eval_ret_undefined(s);
29182|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (29182:17): [True: 0, False: 0]
  ------------------
29183|      0|                goto fail;
29184|       |
29185|      0|            push_scope(s);
29186|      0|            label_break = new_label(s);
29187|      0|            push_break_entry(s->cur_func, &break_entry,
29188|      0|                             label_name, label_break, -1, 1);
29189|       |
29190|      0|            if (js_parse_expect(s, '{'))
  ------------------
  |  Branch (29190:17): [True: 0, False: 0]
  ------------------
29191|      0|                goto fail;
29192|       |
29193|      0|            default_label_pos = -1;
29194|      0|            label_case = -1;
29195|      0|            while (s->token.val != '}') {
  ------------------
  |  Branch (29195:20): [True: 0, False: 0]
  ------------------
29196|      0|                if (s->token.val == TOK_CASE) {
  ------------------
  |  Branch (29196:21): [True: 0, False: 0]
  ------------------
29197|      0|                    label1 = -1;
29198|      0|                    if (label_case >= 0) {
  ------------------
  |  Branch (29198:25): [True: 0, False: 0]
  ------------------
29199|       |                        /* skip the case if needed */
29200|      0|                        label1 = emit_goto(s, OP_goto, -1);
29201|      0|                    }
29202|      0|                    emit_label(s, label_case);
29203|      0|                    label_case = -1;
29204|      0|                    for (;;) {
29205|       |                        /* parse a sequence of case clauses */
29206|      0|                        if (next_token(s))
  ------------------
  |  Branch (29206:29): [True: 0, False: 0]
  ------------------
29207|      0|                            goto fail;
29208|      0|                        emit_op(s, OP_dup);
29209|      0|                        if (js_parse_expr(s))
  ------------------
  |  Branch (29209:29): [True: 0, False: 0]
  ------------------
29210|      0|                            goto fail;
29211|      0|                        if (js_parse_expect(s, ':'))
  ------------------
  |  Branch (29211:29): [True: 0, False: 0]
  ------------------
29212|      0|                            goto fail;
29213|      0|                        emit_op(s, OP_strict_eq);
29214|      0|                        if (s->token.val == TOK_CASE) {
  ------------------
  |  Branch (29214:29): [True: 0, False: 0]
  ------------------
29215|      0|                            label1 = emit_goto(s, OP_if_true, label1);
29216|      0|                        } else {
29217|      0|                            label_case = emit_goto(s, OP_if_false, -1);
29218|      0|                            emit_label(s, label1);
29219|      0|                            break;
29220|      0|                        }
29221|      0|                    }
29222|      0|                } else if (s->token.val == TOK_DEFAULT) {
  ------------------
  |  Branch (29222:28): [True: 0, False: 0]
  ------------------
29223|      0|                    if (next_token(s))
  ------------------
  |  Branch (29223:25): [True: 0, False: 0]
  ------------------
29224|      0|                        goto fail;
29225|      0|                    if (js_parse_expect(s, ':'))
  ------------------
  |  Branch (29225:25): [True: 0, False: 0]
  ------------------
29226|      0|                        goto fail;
29227|      0|                    if (default_label_pos >= 0) {
  ------------------
  |  Branch (29227:25): [True: 0, False: 0]
  ------------------
29228|      0|                        js_parse_error(s, "duplicate default");
29229|      0|                        goto fail;
29230|      0|                    }
29231|      0|                    if (label_case < 0) {
  ------------------
  |  Branch (29231:25): [True: 0, False: 0]
  ------------------
29232|       |                        /* falling thru direct from switch expression */
29233|      0|                        label_case = emit_goto(s, OP_goto, -1);
29234|      0|                    }
29235|       |                    /* Emit a dummy label opcode. Label will be patched after
29236|       |                       the end of the switch body. Do not use emit_label(s, 0)
29237|       |                       because it would clobber label 0 address, preventing
29238|       |                       proper optimizer operation.
29239|       |                     */
29240|      0|                    emit_op(s, OP_label);
29241|      0|                    emit_u32(s, 0);
29242|      0|                    default_label_pos = s->cur_func->byte_code.size - 4;
29243|      0|                } else {
29244|      0|                    if (label_case < 0) {
  ------------------
  |  Branch (29244:25): [True: 0, False: 0]
  ------------------
29245|       |                        /* falling thru direct from switch expression */
29246|      0|                        js_parse_error(s, "invalid switch statement");
29247|      0|                        goto fail;
29248|      0|                    }
29249|      0|                    if (js_parse_statement_or_decl(s, DECL_MASK_ALL))
  ------------------
  |  |28368|      0|#define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28364|      0|#define DECL_MASK_FUNC  (1 << 0) /* allow normal function declaration */
  |  |  ------------------
  |  |               #define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28366|      0|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  |  |  ------------------
  |  |               #define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28367|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  |  |  ------------------
  ------------------
  |  Branch (29249:25): [True: 0, False: 0]
  ------------------
29250|      0|                        goto fail;
29251|      0|                }
29252|      0|            }
29253|      0|            if (js_parse_expect(s, '}'))
  ------------------
  |  Branch (29253:17): [True: 0, False: 0]
  ------------------
29254|      0|                goto fail;
29255|      0|            if (default_label_pos >= 0) {
  ------------------
  |  Branch (29255:17): [True: 0, False: 0]
  ------------------
29256|       |                /* Ugly patch for the `default` label, shameful and risky */
29257|      0|                put_u32(s->cur_func->byte_code.buf + default_label_pos,
29258|      0|                        label_case);
29259|      0|                s->cur_func->label_slots[label_case].pos = default_label_pos + 4;
29260|      0|            } else {
29261|      0|                emit_label(s, label_case);
29262|      0|            }
29263|      0|            emit_label(s, label_break);
29264|      0|            emit_op(s, OP_drop); /* drop the switch expression */
29265|       |
29266|      0|            pop_break_entry(s->cur_func);
29267|      0|            pop_scope(s);
29268|      0|        }
29269|      0|        break;
29270|      0|    case TOK_TRY:
  ------------------
  |  Branch (29270:5): [True: 0, False: 104]
  ------------------
29271|      0|        {
29272|      0|            int label_catch, label_catch2, label_finally, label_end;
29273|      0|            JSAtom name;
29274|      0|            BlockEnv block_env;
29275|       |
29276|      0|            set_eval_ret_undefined(s);
29277|      0|            if (next_token(s))
  ------------------
  |  Branch (29277:17): [True: 0, False: 0]
  ------------------
29278|      0|                goto fail;
29279|      0|            label_catch = new_label(s);
29280|      0|            label_catch2 = new_label(s);
29281|      0|            label_finally = new_label(s);
29282|      0|            label_end = new_label(s);
29283|       |
29284|      0|            emit_goto(s, OP_catch, label_catch);
29285|       |
29286|      0|            push_break_entry(s->cur_func, &block_env,
29287|      0|                             JS_ATOM_NULL, -1, -1, 1);
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
29288|      0|            block_env.label_finally = label_finally;
29289|       |
29290|      0|            if (js_parse_block(s))
  ------------------
  |  Branch (29290:17): [True: 0, False: 0]
  ------------------
29291|      0|                goto fail;
29292|       |
29293|      0|            pop_break_entry(s->cur_func);
29294|       |
29295|      0|            if (js_is_live_code(s)) {
  ------------------
  |  Branch (29295:17): [True: 0, False: 0]
  ------------------
29296|       |                /* drop the catch offset */
29297|      0|                emit_op(s, OP_drop);
29298|       |                /* must push dummy value to keep same stack size */
29299|      0|                emit_op(s, OP_undefined);
29300|      0|                emit_goto(s, OP_gosub, label_finally);
29301|      0|                emit_op(s, OP_drop);
29302|       |
29303|      0|                emit_goto(s, OP_goto, label_end);
29304|      0|            }
29305|       |
29306|      0|            if (s->token.val == TOK_CATCH) {
  ------------------
  |  Branch (29306:17): [True: 0, False: 0]
  ------------------
29307|      0|                if (next_token(s))
  ------------------
  |  Branch (29307:21): [True: 0, False: 0]
  ------------------
29308|      0|                    goto fail;
29309|       |
29310|      0|                push_scope(s);  /* catch variable */
29311|      0|                emit_label(s, label_catch);
29312|       |
29313|      0|                if (s->token.val == '{') {
  ------------------
  |  Branch (29313:21): [True: 0, False: 0]
  ------------------
29314|       |                    /* support optional-catch-binding feature */
29315|      0|                    emit_op(s, OP_drop);    /* pop the exception object */
29316|      0|                } else {
29317|      0|                    if (js_parse_expect(s, '('))
  ------------------
  |  Branch (29317:25): [True: 0, False: 0]
  ------------------
29318|      0|                        goto fail;
29319|      0|                    if (!(s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved)) {
  ------------------
  |  Branch (29319:27): [True: 0, False: 0]
  |  Branch (29319:56): [True: 0, False: 0]
  ------------------
29320|      0|                        if (s->token.val == '[' || s->token.val == '{') {
  ------------------
  |  Branch (29320:29): [True: 0, False: 0]
  |  Branch (29320:52): [True: 0, False: 0]
  ------------------
29321|       |                            /* XXX: TOK_LET is not completely correct */
29322|      0|                            if (js_parse_destructuring_element(s, TOK_LET, 0, TRUE, -1, TRUE, FALSE) < 0)
  ------------------
  |  Branch (29322:33): [True: 0, False: 0]
  ------------------
29323|      0|                                goto fail;
29324|      0|                        } else {
29325|      0|                            js_parse_error(s, "identifier expected");
29326|      0|                            goto fail;
29327|      0|                        }
29328|      0|                    } else {
29329|      0|                        name = JS_DupAtom(ctx, s->token.u.ident.atom);
29330|      0|                        if (next_token(s)
  ------------------
  |  Branch (29330:29): [True: 0, False: 0]
  ------------------
29331|      0|                        ||  js_define_var(s, name, TOK_CATCH) < 0) {
  ------------------
  |  Branch (29331:29): [True: 0, False: 0]
  ------------------
29332|      0|                            JS_FreeAtom(ctx, name);
29333|      0|                            goto fail;
29334|      0|                        }
29335|       |                        /* store the exception value in the catch variable */
29336|      0|                        emit_op(s, OP_scope_put_var);
29337|      0|                        emit_u32(s, name);
29338|      0|                        emit_u16(s, s->cur_func->scope_level);
29339|      0|                    }
29340|      0|                    if (js_parse_expect(s, ')'))
  ------------------
  |  Branch (29340:25): [True: 0, False: 0]
  ------------------
29341|      0|                        goto fail;
29342|      0|                }
29343|       |                /* XXX: should keep the address to nop it out if there is no finally block */
29344|      0|                emit_goto(s, OP_catch, label_catch2);
29345|       |
29346|      0|                push_scope(s);  /* catch block */
29347|      0|                push_break_entry(s->cur_func, &block_env, JS_ATOM_NULL,
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
29348|      0|                                 -1, -1, 1);
29349|      0|                block_env.label_finally = label_finally;
29350|       |
29351|      0|                if (js_parse_block(s))
  ------------------
  |  Branch (29351:21): [True: 0, False: 0]
  ------------------
29352|      0|                    goto fail;
29353|       |
29354|      0|                pop_break_entry(s->cur_func);
29355|      0|                pop_scope(s);  /* catch block */
29356|      0|                pop_scope(s);  /* catch variable */
29357|       |
29358|      0|                if (js_is_live_code(s)) {
  ------------------
  |  Branch (29358:21): [True: 0, False: 0]
  ------------------
29359|       |                    /* drop the catch2 offset */
29360|      0|                    emit_op(s, OP_drop);
29361|       |                    /* XXX: should keep the address to nop it out if there is no finally block */
29362|       |                    /* must push dummy value to keep same stack size */
29363|      0|                    emit_op(s, OP_undefined);
29364|      0|                    emit_goto(s, OP_gosub, label_finally);
29365|      0|                    emit_op(s, OP_drop);
29366|      0|                    emit_goto(s, OP_goto, label_end);
29367|      0|                }
29368|       |                /* catch exceptions thrown in the catch block to execute the
29369|       |                 * finally clause and rethrow the exception */
29370|      0|                emit_label(s, label_catch2);
29371|       |                /* catch value is at TOS, no need to push undefined */
29372|      0|                emit_goto(s, OP_gosub, label_finally);
29373|      0|                emit_op(s, OP_throw);
29374|       |
29375|      0|            } else if (s->token.val == TOK_FINALLY) {
  ------------------
  |  Branch (29375:24): [True: 0, False: 0]
  ------------------
29376|       |                /* finally without catch : execute the finally clause
29377|       |                 * and rethrow the exception */
29378|      0|                emit_label(s, label_catch);
29379|       |                /* catch value is at TOS, no need to push undefined */
29380|      0|                emit_goto(s, OP_gosub, label_finally);
29381|      0|                emit_op(s, OP_throw);
29382|      0|            } else {
29383|      0|                js_parse_error(s, "expecting catch or finally");
29384|      0|                goto fail;
29385|      0|            }
29386|      0|            emit_label(s, label_finally);
29387|      0|            if (s->token.val == TOK_FINALLY) {
  ------------------
  |  Branch (29387:17): [True: 0, False: 0]
  ------------------
29388|      0|                int saved_eval_ret_idx = 0; /* avoid warning */
29389|       |
29390|      0|                if (next_token(s))
  ------------------
  |  Branch (29390:21): [True: 0, False: 0]
  ------------------
29391|      0|                    goto fail;
29392|       |                /* on the stack: ret_value gosub_ret_value */
29393|      0|                push_break_entry(s->cur_func, &block_env, JS_ATOM_NULL,
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
29394|      0|                                 -1, -1, 2);
29395|       |
29396|      0|                if (s->cur_func->eval_ret_idx >= 0) {
  ------------------
  |  Branch (29396:21): [True: 0, False: 0]
  ------------------
29397|       |                    /* 'finally' updates eval_ret only if not a normal
29398|       |                       termination */
29399|      0|                    saved_eval_ret_idx =
29400|      0|                        add_var(s->ctx, s->cur_func, JS_ATOM__ret_);
29401|      0|                    if (saved_eval_ret_idx < 0)
  ------------------
  |  Branch (29401:25): [True: 0, False: 0]
  ------------------
29402|      0|                        goto fail;
29403|      0|                    emit_op(s, OP_get_loc);
29404|      0|                    emit_u16(s, s->cur_func->eval_ret_idx);
29405|      0|                    emit_op(s, OP_put_loc);
29406|      0|                    emit_u16(s, saved_eval_ret_idx);
29407|      0|                    set_eval_ret_undefined(s);
29408|      0|                }
29409|       |
29410|      0|                if (js_parse_block(s))
  ------------------
  |  Branch (29410:21): [True: 0, False: 0]
  ------------------
29411|      0|                    goto fail;
29412|       |
29413|      0|                if (s->cur_func->eval_ret_idx >= 0) {
  ------------------
  |  Branch (29413:21): [True: 0, False: 0]
  ------------------
29414|      0|                    emit_op(s, OP_get_loc);
29415|      0|                    emit_u16(s, saved_eval_ret_idx);
29416|      0|                    emit_op(s, OP_put_loc);
29417|      0|                    emit_u16(s, s->cur_func->eval_ret_idx);
29418|      0|                }
29419|      0|                pop_break_entry(s->cur_func);
29420|      0|            }
29421|      0|            emit_op(s, OP_ret);
29422|      0|            emit_label(s, label_end);
29423|      0|        }
29424|      0|        break;
29425|      0|    case ';':
  ------------------
  |  Branch (29425:5): [True: 0, False: 104]
  ------------------
29426|       |        /* empty statement */
29427|      0|        if (next_token(s))
  ------------------
  |  Branch (29427:13): [True: 0, False: 0]
  ------------------
29428|      0|            goto fail;
29429|      0|        break;
29430|      0|    case TOK_WITH:
  ------------------
  |  Branch (29430:5): [True: 0, False: 104]
  ------------------
29431|      0|        if (s->cur_func->js_mode & JS_MODE_STRICT) {
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (29431:13): [True: 0, False: 0]
  ------------------
29432|      0|            js_parse_error(s, "invalid keyword: with");
29433|      0|            goto fail;
29434|      0|        } else {
29435|      0|            int with_idx;
29436|       |
29437|      0|            if (next_token(s))
  ------------------
  |  Branch (29437:17): [True: 0, False: 0]
  ------------------
29438|      0|                goto fail;
29439|       |
29440|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (29440:17): [True: 0, False: 0]
  ------------------
29441|      0|                goto fail;
29442|       |
29443|      0|            push_scope(s);
29444|      0|            with_idx = define_var(s, s->cur_func, JS_ATOM__with_,
29445|      0|                                  JS_VAR_DEF_WITH);
29446|      0|            if (with_idx < 0)
  ------------------
  |  Branch (29446:17): [True: 0, False: 0]
  ------------------
29447|      0|                goto fail;
29448|      0|            emit_op(s, OP_to_object);
29449|      0|            emit_op(s, OP_put_loc);
29450|      0|            emit_u16(s, with_idx);
29451|       |
29452|      0|            set_eval_ret_undefined(s);
29453|      0|            if (js_parse_statement(s))
  ------------------
  |  Branch (29453:17): [True: 0, False: 0]
  ------------------
29454|      0|                goto fail;
29455|       |
29456|       |            /* Popping scope drops lexical context for the with object variable */
29457|      0|            pop_scope(s);
29458|      0|        }
29459|      0|        break;
29460|      2|    case TOK_FUNCTION:
  ------------------
  |  Branch (29460:5): [True: 2, False: 102]
  ------------------
29461|       |        /* ES6 Annex B.3.2 and B.3.3 semantics */
29462|      2|        if (!(decl_mask & DECL_MASK_FUNC))
  ------------------
  |  |28364|      2|#define DECL_MASK_FUNC  (1 << 0) /* allow normal function declaration */
  ------------------
  |  Branch (29462:13): [True: 0, False: 2]
  ------------------
29463|      0|            goto func_decl_error;
29464|      2|        if (!(decl_mask & DECL_MASK_OTHER) && peek_token(s, FALSE) == '*')
  ------------------
  |  |28367|      2|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (29464:13): [True: 0, False: 2]
  |  Branch (29464:47): [True: 0, False: 0]
  ------------------
29465|      0|            goto func_decl_error;
29466|      2|        goto parse_func_var;
29467|     61|    case TOK_IDENT:
  ------------------
  |  Branch (29467:5): [True: 61, False: 43]
  ------------------
29468|     61|        if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (29468:13): [True: 0, False: 61]
  ------------------
29469|      0|            js_parse_error_reserved_identifier(s);
29470|      0|            goto fail;
29471|      0|        }
29472|       |        /* Determine if `let` introduces a Declaration or an ExpressionStatement */
29473|     61|        switch (is_let(s, decl_mask)) {
29474|      0|        case TRUE:
  ------------------
  |  Branch (29474:9): [True: 0, False: 61]
  ------------------
29475|      0|            tok = TOK_LET;
29476|      0|            goto haslet;
29477|     61|        case FALSE:
  ------------------
  |  Branch (29477:9): [True: 61, False: 0]
  ------------------
29478|     61|            break;
29479|      0|        default:
  ------------------
  |  Branch (29479:9): [True: 0, False: 61]
  ------------------
29480|      0|            goto fail;
29481|     61|        }
29482|     61|        if (token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (29482:13): [True: 0, False: 61]
  ------------------
29483|      0|            peek_token(s, TRUE) == TOK_FUNCTION) {
  ------------------
  |  Branch (29483:13): [True: 0, False: 0]
  ------------------
29484|      0|            if (!(decl_mask & DECL_MASK_OTHER)) {
  ------------------
  |  |28367|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (29484:17): [True: 0, False: 0]
  ------------------
29485|      0|            func_decl_error:
29486|      0|                js_parse_error(s, "function declarations can't appear in single-statement context");
29487|      0|                goto fail;
29488|      0|            }
29489|      2|        parse_func_var:
29490|      2|            if (js_parse_function_decl(s, JS_PARSE_FUNC_VAR,
  ------------------
  |  Branch (29490:17): [True: 2, False: 0]
  ------------------
29491|      2|                                       JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
29492|      2|                                       s->token.ptr))
29493|      2|                goto fail;
29494|      0|            break;
29495|      2|        }
29496|     61|        goto hasexpr;
29497|       |
29498|     61|    case TOK_CLASS:
  ------------------
  |  Branch (29498:5): [True: 0, False: 104]
  ------------------
29499|      0|        if (!(decl_mask & DECL_MASK_OTHER)) {
  ------------------
  |  |28367|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (29499:13): [True: 0, False: 0]
  ------------------
29500|      0|            js_parse_error(s, "class declarations can't appear in single-statement context");
29501|      0|            goto fail;
29502|      0|        }
29503|      0|        if (js_parse_class(s, FALSE, JS_PARSE_EXPORT_NONE))
  ------------------
  |  Branch (29503:13): [True: 0, False: 0]
  ------------------
29504|      0|            return -1;
29505|      0|        break;
29506|       |
29507|      0|    case TOK_DEBUGGER:
  ------------------
  |  Branch (29507:5): [True: 0, False: 104]
  ------------------
29508|       |        /* currently no debugger, so just skip the keyword */
29509|      0|        if (next_token(s))
  ------------------
  |  Branch (29509:13): [True: 0, False: 0]
  ------------------
29510|      0|            goto fail;
29511|      0|        if (js_parse_expect_semi(s))
  ------------------
  |  Branch (29511:13): [True: 0, False: 0]
  ------------------
29512|      0|            goto fail;
29513|      0|        break;
29514|       |
29515|      0|    case TOK_ENUM:
  ------------------
  |  Branch (29515:5): [True: 0, False: 104]
  ------------------
29516|      0|    case TOK_EXPORT:
  ------------------
  |  Branch (29516:5): [True: 0, False: 104]
  ------------------
29517|      0|    case TOK_EXTENDS:
  ------------------
  |  Branch (29517:5): [True: 0, False: 104]
  ------------------
29518|      0|        js_unsupported_keyword(s, s->token.u.ident.atom);
29519|      0|        goto fail;
29520|       |
29521|     20|    default:
  ------------------
  |  Branch (29521:5): [True: 20, False: 84]
  ------------------
29522|     81|    hasexpr:
29523|     81|        emit_source_pos(s, s->token.ptr);
29524|     81|        if (js_parse_expr(s))
  ------------------
  |  Branch (29524:13): [True: 3, False: 78]
  ------------------
29525|      3|            goto fail;
29526|     78|        if (s->cur_func->eval_ret_idx >= 0) {
  ------------------
  |  Branch (29526:13): [True: 30, False: 48]
  ------------------
29527|       |            /* store the expression value so that it can be returned
29528|       |               by eval() */
29529|     30|            emit_op(s, OP_put_loc);
29530|     30|            emit_u16(s, s->cur_func->eval_ret_idx);
29531|     48|        } else {
29532|     48|            emit_op(s, OP_drop); /* drop the result */
29533|     48|        }
29534|     78|        if (js_parse_expect_semi(s))
  ------------------
  |  Branch (29534:13): [True: 1, False: 77]
  ------------------
29535|      1|            goto fail;
29536|     77|        break;
29537|    104|    }
29538|     93|done:
29539|     93|    JS_FreeAtom(ctx, label_name);
29540|     93|    return 0;
29541|     13|fail:
29542|     13|    JS_FreeAtom(ctx, label_name);
29543|     13|    return -1;
29544|    104|}
quickjs.c:is_label:
28496|    106|{
28497|    106|    return (s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved &&
  ------------------
  |  Branch (28497:13): [True: 77, False: 29]
  |  Branch (28497:42): [True: 77, False: 0]
  ------------------
28498|     77|            peek_token(s, FALSE) == ':');
  ------------------
  |  Branch (28498:13): [True: 16, False: 61]
  ------------------
28499|    106|}
quickjs.c:js_parse_block:
28379|      6|{
28380|      6|    if (js_parse_expect(s, '{'))
  ------------------
  |  Branch (28380:9): [True: 0, False: 6]
  ------------------
28381|      0|        return -1;
28382|      6|    if (s->token.val != '}') {
  ------------------
  |  Branch (28382:9): [True: 5, False: 1]
  ------------------
28383|      5|        push_scope(s);
28384|     18|        for(;;) {
28385|     18|            if (js_parse_statement_or_decl(s, DECL_MASK_ALL))
  ------------------
  |  |28368|     18|#define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28364|     18|#define DECL_MASK_FUNC  (1 << 0) /* allow normal function declaration */
  |  |  ------------------
  |  |               #define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28366|     18|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  |  |  ------------------
  |  |               #define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28367|     18|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  |  |  ------------------
  ------------------
  |  Branch (28385:17): [True: 5, False: 13]
  ------------------
28386|      5|                return -1;
28387|     13|            if (s->token.val == '}')
  ------------------
  |  Branch (28387:17): [True: 0, False: 13]
  ------------------
28388|      0|                break;
28389|     13|        }
28390|      0|        pop_scope(s);
28391|      0|    }
28392|      1|    if (next_token(s))
  ------------------
  |  Branch (28392:9): [True: 0, False: 1]
  ------------------
28393|      0|        return -1;
28394|      1|    return 0;
28395|      1|}
quickjs.c:set_eval_ret_undefined:
28776|     15|{
28777|     15|    if (s->cur_func->eval_ret_idx >= 0) {
  ------------------
  |  Branch (28777:9): [True: 10, False: 5]
  ------------------
28778|     10|        emit_op(s, OP_undefined);
28779|     10|        emit_op(s, OP_put_loc);
28780|     10|        emit_u16(s, s->cur_func->eval_ret_idx);
28781|     10|    }
28782|     15|}
quickjs.c:js_parse_statement:
28374|     15|{
28375|     15|    return js_parse_statement_or_decl(s, 0);
28376|     15|}
quickjs.c:js_parse_for_in_of:
28550|     15|{
28551|     15|    JSContext *ctx = s->ctx;
28552|     15|    JSFunctionDef *fd = s->cur_func;
28553|     15|    JSAtom var_name;
28554|     15|    BOOL has_initializer, is_for_of, has_destructuring;
28555|     15|    int tok, tok1, opcode, scope, block_scope_level;
28556|     15|    int label_next, label_expr, label_cont, label_body, label_break;
28557|     15|    int pos_next, pos_expr;
28558|     15|    BlockEnv break_entry;
28559|       |
28560|     15|    has_initializer = FALSE;
28561|     15|    has_destructuring = FALSE;
28562|     15|    is_for_of = FALSE;
28563|     15|    block_scope_level = fd->scope_level;
28564|     15|    label_cont = new_label(s);
28565|     15|    label_body = new_label(s);
28566|     15|    label_break = new_label(s);
28567|     15|    label_next = new_label(s);
28568|       |
28569|       |    /* create scope for the lexical variables declared in the enumeration
28570|       |       expressions. XXX: Not completely correct because of weird capturing
28571|       |       semantics in `for (i of o) a.push(function(){return i})` */
28572|     15|    push_scope(s);
28573|       |
28574|       |    /* local for_in scope starts here so individual elements
28575|       |       can be closed in statement. */
28576|     15|    push_break_entry(s->cur_func, &break_entry,
28577|     15|                     label_name, label_break, label_cont, 1);
28578|     15|    break_entry.scope_level = block_scope_level;
28579|       |
28580|     15|    label_expr = emit_goto(s, OP_goto, -1);
28581|       |
28582|     15|    pos_next = s->cur_func->byte_code.size;
28583|     15|    emit_label(s, label_next);
28584|       |
28585|     15|    tok = s->token.val;
28586|     15|    switch (is_let(s, DECL_MASK_OTHER)) {
  ------------------
  |  |28367|     15|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
28587|     14|    case TRUE:
  ------------------
  |  Branch (28587:5): [True: 14, False: 1]
  ------------------
28588|     14|        tok = TOK_LET;
28589|     14|        break;
28590|      1|    case FALSE:
  ------------------
  |  Branch (28590:5): [True: 1, False: 14]
  ------------------
28591|      1|        break;
28592|      0|    default:
  ------------------
  |  Branch (28592:5): [True: 0, False: 15]
  ------------------
28593|      0|        return -1;
28594|     15|    }
28595|     15|    if (tok == TOK_VAR || tok == TOK_LET || tok == TOK_CONST) {
  ------------------
  |  Branch (28595:9): [True: 0, False: 15]
  |  Branch (28595:27): [True: 14, False: 1]
  |  Branch (28595:45): [True: 0, False: 1]
  ------------------
28596|     14|        if (next_token(s))
  ------------------
  |  Branch (28596:13): [True: 0, False: 14]
  ------------------
28597|      0|            return -1;
28598|       |
28599|     14|        if (!(s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved)) {
  ------------------
  |  Branch (28599:15): [True: 14, False: 0]
  |  Branch (28599:44): [True: 14, False: 0]
  ------------------
28600|      0|            if (s->token.val == '[' || s->token.val == '{') {
  ------------------
  |  Branch (28600:17): [True: 0, False: 0]
  |  Branch (28600:40): [True: 0, False: 0]
  ------------------
28601|      0|                if (js_parse_destructuring_element(s, tok, 0, TRUE, -1, FALSE, FALSE) < 0)
  ------------------
  |  Branch (28601:21): [True: 0, False: 0]
  ------------------
28602|      0|                    return -1;
28603|      0|                has_destructuring = TRUE;
28604|      0|            } else {
28605|      0|                return js_parse_error(s, "variable name expected");
28606|      0|            }
28607|      0|            var_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
28608|     14|        } else {
28609|     14|            var_name = JS_DupAtom(ctx, s->token.u.ident.atom);
28610|     14|            if (next_token(s)) {
  ------------------
  |  Branch (28610:17): [True: 0, False: 14]
  ------------------
28611|      0|                JS_FreeAtom(s->ctx, var_name);
28612|      0|                return -1;
28613|      0|            }
28614|     14|            if (js_define_var(s, var_name, tok)) {
  ------------------
  |  Branch (28614:17): [True: 0, False: 14]
  ------------------
28615|      0|                JS_FreeAtom(s->ctx, var_name);
28616|      0|                return -1;
28617|      0|            }
28618|     14|            emit_op(s, (tok == TOK_CONST || tok == TOK_LET) ?
  ------------------
  |  Branch (28618:25): [True: 0, False: 14]
  |  Branch (28618:45): [True: 14, False: 0]
  ------------------
28619|     14|                    OP_scope_put_var_init : OP_scope_put_var);
28620|     14|            emit_atom(s, var_name);
28621|     14|            emit_u16(s, fd->scope_level);
28622|     14|        }
28623|     14|    } else if (!is_async && token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (28623:16): [True: 1, False: 0]
  |  Branch (28623:29): [True: 0, False: 1]
  ------------------
28624|      0|               peek_token(s, FALSE) == TOK_OF) {
  ------------------
  |  Branch (28624:16): [True: 0, False: 0]
  ------------------
28625|      0|        return js_parse_error(s, "'for of' expression cannot start with 'async'");
28626|      1|    } else {
28627|      1|        int skip_bits;
28628|      1|        if ((s->token.val == '[' || s->token.val == '{')
  ------------------
  |  Branch (28628:14): [True: 0, False: 1]
  |  Branch (28628:37): [True: 0, False: 1]
  ------------------
28629|      0|        &&  ((tok1 = js_parse_skip_parens_token(s, &skip_bits, FALSE)) == TOK_IN || tok1 == TOK_OF)) {
  ------------------
  |  Branch (28629:14): [True: 0, False: 0]
  |  Branch (28629:85): [True: 0, False: 0]
  ------------------
28630|      0|            if (js_parse_destructuring_element(s, 0, 0, TRUE, skip_bits & SKIP_HAS_ELLIPSIS, TRUE, FALSE) < 0)
  ------------------
  |  |24666|      0|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
  |  Branch (28630:17): [True: 0, False: 0]
  ------------------
28631|      0|                return -1;
28632|      1|        } else {
28633|      1|            int lvalue_label;
28634|      1|            if (js_parse_left_hand_side_expr(s))
  ------------------
  |  Branch (28634:17): [True: 0, False: 1]
  ------------------
28635|      0|                return -1;
28636|      1|            if (get_lvalue(s, &opcode, &scope, &var_name, &lvalue_label,
  ------------------
  |  Branch (28636:17): [True: 0, False: 1]
  ------------------
28637|      1|                           NULL, FALSE, TOK_FOR))
28638|      0|                return -1;
28639|      1|            put_lvalue(s, opcode, scope, var_name, lvalue_label,
28640|      1|                       PUT_LVALUE_NOKEEP_BOTTOM, FALSE);
28641|      1|        }
28642|      1|        var_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      1|#define JS_ATOM_NULL 0
  ------------------
28643|      1|    }
28644|     15|    emit_goto(s, OP_goto, label_body);
28645|       |
28646|     15|    pos_expr = s->cur_func->byte_code.size;
28647|     15|    emit_label(s, label_expr);
28648|     15|    if (s->token.val == '=') {
  ------------------
  |  Branch (28648:9): [True: 0, False: 15]
  ------------------
28649|       |        /* XXX: potential scoping issue if inside `with` statement */
28650|      0|        has_initializer = TRUE;
28651|       |        /* parse and evaluate initializer prior to evaluating the
28652|       |           object (only used with "for in" with a non lexical variable
28653|       |           in non strict mode */
28654|      0|        if (next_token(s) || js_parse_assign_expr2(s, 0)) {
  ------------------
  |  Branch (28654:13): [True: 0, False: 0]
  |  Branch (28654:30): [True: 0, False: 0]
  ------------------
28655|      0|            JS_FreeAtom(ctx, var_name);
28656|      0|            return -1;
28657|      0|        }
28658|      0|        if (var_name != JS_ATOM_NULL) {
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (28658:13): [True: 0, False: 0]
  ------------------
28659|      0|            emit_op(s, OP_scope_put_var);
28660|      0|            emit_atom(s, var_name);
28661|      0|            emit_u16(s, fd->scope_level);
28662|      0|        }
28663|      0|    }
28664|     15|    JS_FreeAtom(ctx, var_name);
28665|       |
28666|     15|    if (token_is_pseudo_keyword(s, JS_ATOM_of)) {
  ------------------
  |  Branch (28666:9): [True: 1, False: 14]
  ------------------
28667|      1|        is_for_of = TRUE;
28668|      1|        if (has_initializer)
  ------------------
  |  Branch (28668:13): [True: 0, False: 1]
  ------------------
28669|      0|            goto initializer_error;
28670|     14|    } else if (s->token.val == TOK_IN) {
  ------------------
  |  Branch (28670:16): [True: 14, False: 0]
  ------------------
28671|     14|        if (is_async)
  ------------------
  |  Branch (28671:13): [True: 0, False: 14]
  ------------------
28672|      0|            return js_parse_error(s, "'for await' loop should be used with 'of'");
28673|     14|        if (has_initializer &&
  ------------------
  |  Branch (28673:13): [True: 0, False: 14]
  ------------------
28674|      0|            (tok != TOK_VAR || (fd->js_mode & JS_MODE_STRICT) ||
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (28674:14): [True: 0, False: 0]
  |  Branch (28674:32): [True: 0, False: 0]
  ------------------
28675|      0|             has_destructuring)) {
  ------------------
  |  Branch (28675:14): [True: 0, False: 0]
  ------------------
28676|      0|        initializer_error:
28677|      0|            return js_parse_error(s, "a declaration in the head of a for-%s loop can't have an initializer",
28678|      0|                                  is_for_of ? "of" : "in");
  ------------------
  |  Branch (28678:35): [True: 0, False: 0]
  ------------------
28679|      0|        }
28680|     14|    } else {
28681|      0|        return js_parse_error(s, "expected 'of' or 'in' in for control expression");
28682|      0|    }
28683|     15|    if (next_token(s))
  ------------------
  |  Branch (28683:9): [True: 0, False: 15]
  ------------------
28684|      0|        return -1;
28685|     15|    if (is_for_of) {
  ------------------
  |  Branch (28685:9): [True: 1, False: 14]
  ------------------
28686|      1|        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (28686:13): [True: 0, False: 1]
  ------------------
28687|      0|            return -1;
28688|     14|    } else {
28689|     14|        if (js_parse_expr(s))
  ------------------
  |  Branch (28689:13): [True: 0, False: 14]
  ------------------
28690|      0|            return -1;
28691|     14|    }
28692|       |    /* close the scope after having evaluated the expression so that
28693|       |       the TDZ values are in the closures */
28694|     15|    close_scopes(s, s->cur_func->scope_level, block_scope_level);
28695|     15|    if (is_for_of) {
  ------------------
  |  Branch (28695:9): [True: 1, False: 14]
  ------------------
28696|       |        /* set has_iterator after the iterable expression is parsed so
28697|       |           that a yield in the expression does not try to close a
28698|       |           not-yet-created iterator */
28699|      1|        break_entry.has_iterator = TRUE;
28700|      1|        break_entry.drop_count += 2;
28701|      1|        if (is_async)
  ------------------
  |  Branch (28701:13): [True: 0, False: 1]
  ------------------
28702|      0|            emit_op(s, OP_for_await_of_start);
28703|      1|        else
28704|      1|            emit_op(s, OP_for_of_start);
28705|       |        /* on stack: enum_rec */
28706|     14|    } else {
28707|     14|        emit_op(s, OP_for_in_start);
28708|       |        /* on stack: enum_obj */
28709|     14|    }
28710|     15|    emit_goto(s, OP_goto, label_cont);
28711|       |
28712|     15|    if (js_parse_expect(s, ')'))
  ------------------
  |  Branch (28712:9): [True: 0, False: 15]
  ------------------
28713|      0|        return -1;
28714|       |
28715|     15|    if (OPTIMIZE) {
  ------------------
  |  |   50|     15|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 15, Folded]
  |  |  ------------------
  ------------------
28716|       |        /* move the `next` code here */
28717|     15|        DynBuf *bc = &s->cur_func->byte_code;
28718|     15|        int chunk_size = pos_expr - pos_next;
28719|     15|        int offset = bc->size - pos_next;
28720|     15|        int i;
28721|     15|        if (dbuf_claim(bc, chunk_size))
  ------------------
  |  Branch (28721:13): [True: 0, False: 15]
  ------------------
28722|      0|            return -1;
28723|     15|        dbuf_put(bc, bc->buf + pos_next, chunk_size);
28724|     15|        memset(bc->buf + pos_next, OP_nop, chunk_size);
28725|       |        /* `next` part ends with a goto */
28726|     15|        s->cur_func->last_opcode_pos = bc->size - 5;
28727|       |        /* relocate labels */
28728|     90|        for (i = label_cont; i < s->cur_func->label_count; i++) {
  ------------------
  |  Branch (28728:30): [True: 75, False: 15]
  ------------------
28729|     75|            LabelSlot *ls = &s->cur_func->label_slots[i];
28730|     75|            if (ls->pos >= pos_next && ls->pos < pos_expr)
  ------------------
  |  Branch (28730:17): [True: 30, False: 45]
  |  Branch (28730:40): [True: 15, False: 15]
  ------------------
28731|     15|                ls->pos += offset;
28732|     75|        }
28733|     15|    }
28734|       |
28735|     15|    emit_label(s, label_body);
28736|     15|    if (js_parse_statement(s))
  ------------------
  |  Branch (28736:9): [True: 2, False: 13]
  ------------------
28737|      2|        return -1;
28738|       |
28739|     13|    close_scopes(s, s->cur_func->scope_level, block_scope_level);
28740|       |
28741|     13|    emit_label(s, label_cont);
28742|     13|    if (is_for_of) {
  ------------------
  |  Branch (28742:9): [True: 1, False: 12]
  ------------------
28743|      1|        if (is_async) {
  ------------------
  |  Branch (28743:13): [True: 0, False: 1]
  ------------------
28744|       |            /* stack: iter_obj next catch_offset */
28745|       |            /* call the next method */
28746|      0|            emit_op(s, OP_for_await_of_next); 
28747|       |            /* get the result of the promise */
28748|      0|            emit_op(s, OP_await);
28749|       |            /* unwrap the value and done values */
28750|      0|            emit_op(s, OP_iterator_get_value_done);
28751|      1|        } else {
28752|      1|            emit_op(s, OP_for_of_next);
28753|      1|            emit_u8(s, 0);
28754|      1|        }
28755|     12|    } else {
28756|     12|        emit_op(s, OP_for_in_next);
28757|     12|    }
28758|       |    /* on stack: enum_rec / enum_obj value bool */
28759|     13|    emit_goto(s, OP_if_false, label_next);
28760|       |    /* drop the undefined value from for_xx_next */
28761|     13|    emit_op(s, OP_drop);
28762|       |
28763|     13|    emit_label(s, label_break);
28764|     13|    if (is_for_of) {
  ------------------
  |  Branch (28764:9): [True: 1, False: 12]
  ------------------
28765|       |        /* close and drop enum_rec */
28766|      1|        emit_op(s, OP_iterator_close);
28767|     12|    } else {
28768|     12|        emit_op(s, OP_drop);
28769|     12|    }
28770|     13|    pop_break_entry(s->cur_func);
28771|     13|    pop_scope(s);
28772|     13|    return 0;
28773|     15|}
quickjs.c:is_let:
28503|     76|{
28504|     76|    int res = FALSE;
28505|     76|    const uint8_t *last_token_ptr;
28506|       |    
28507|     76|    if (token_is_pseudo_keyword(s, JS_ATOM_let)) {
  ------------------
  |  Branch (28507:9): [True: 14, False: 62]
  ------------------
28508|     14|        JSParsePos pos;
28509|     14|        js_parse_get_pos(s, &pos);
28510|     14|        for (;;) {
28511|     14|            last_token_ptr = s->token.ptr;
28512|     14|            if (next_token(s)) {
  ------------------
  |  Branch (28512:17): [True: 0, False: 14]
  ------------------
28513|      0|                res = -1;
28514|      0|                break;
28515|      0|            }
28516|     14|            if (s->token.val == '[') {
  ------------------
  |  Branch (28516:17): [True: 0, False: 14]
  ------------------
28517|       |                /* let [ is a syntax restriction:
28518|       |                   it never introduces an ExpressionStatement */
28519|      0|                res = TRUE;
28520|      0|                break;
28521|      0|            }
28522|     14|            if (s->token.val == '{' ||
  ------------------
  |  Branch (28522:17): [True: 0, False: 14]
  ------------------
28523|     14|                (s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved) ||
  ------------------
  |  Branch (28523:18): [True: 14, False: 0]
  |  Branch (28523:47): [True: 14, False: 0]
  ------------------
28524|      0|                s->token.val == TOK_LET ||
  ------------------
  |  Branch (28524:17): [True: 0, False: 0]
  ------------------
28525|      0|                s->token.val == TOK_YIELD ||
  ------------------
  |  Branch (28525:17): [True: 0, False: 0]
  ------------------
28526|     14|                s->token.val == TOK_AWAIT) {
  ------------------
  |  Branch (28526:17): [True: 0, False: 0]
  ------------------
28527|       |                /* Check for possible ASI if not scanning for Declaration */
28528|       |                /* XXX: should also check that `{` introduces a BindingPattern,
28529|       |                   but Firefox does not and rejects eval("let=1;let\n{if(1)2;}") */
28530|     14|                if (!has_lf_in_range(last_token_ptr, s->token.ptr) ||
  ------------------
  |  Branch (28530:21): [True: 14, False: 0]
  ------------------
28531|     14|                    (decl_mask & DECL_MASK_OTHER)) {
  ------------------
  |  |28367|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (28531:21): [True: 0, False: 0]
  ------------------
28532|     14|                    res = TRUE;
28533|     14|                    break;
28534|     14|                }
28535|      0|                break;
28536|     14|            }
28537|      0|            break;
28538|     14|        }
28539|     14|        if (js_parse_seek_token(s, &pos)) {
  ------------------
  |  Branch (28539:13): [True: 0, False: 14]
  ------------------
28540|      0|            res = -1;
28541|      0|        }
28542|     14|    }
28543|     76|    return res;
28544|     76|}
quickjs.c:close_scopes:
24048|     28|{
24049|     56|    while (scope > scope_stop) {
  ------------------
  |  Branch (24049:12): [True: 28, False: 28]
  ------------------
24050|     28|        emit_op(s, OP_leave_scope);
24051|     28|        emit_u16(s, scope);
24052|     28|        scope = s->cur_func->scopes[scope].parent;
24053|     28|    }
24054|     28|}
quickjs.c:emit_atom:
23757|     63|{
23758|     63|    DynBuf *bc = &s->cur_func->byte_code;
23759|     63|    if (dbuf_claim(bc, 4))
  ------------------
  |  Branch (23759:9): [True: 0, False: 63]
  ------------------
23760|      0|        return; /* not enough memory : don't duplicate the atom */
23761|     63|    put_u32(bc->buf + bc->size, JS_DupAtom(s->ctx, name));
23762|     63|    bc->size += 4;
23763|     63|}
quickjs.c:emit_return:
28276|     30|{
28277|     30|    BlockEnv *top;
28278|       |
28279|     30|    if (s->cur_func->func_kind != JS_FUNC_NORMAL) {
  ------------------
  |  Branch (28279:9): [True: 17, False: 13]
  ------------------
28280|     17|        if (!hasval) {
  ------------------
  |  Branch (28280:13): [True: 17, False: 0]
  ------------------
28281|       |            /* no value: direct return in case of async generator */
28282|     17|            emit_op(s, OP_undefined);
28283|     17|            hasval = TRUE;
28284|     17|        } else if (s->cur_func->func_kind == JS_FUNC_ASYNC_GENERATOR) {
  ------------------
  |  Branch (28284:20): [True: 0, False: 0]
  ------------------
28285|       |            /* the await must be done before handling the "finally" in
28286|       |               case it raises an exception */
28287|      0|            emit_op(s, OP_await);
28288|      0|        }
28289|     17|    }
28290|       |
28291|     30|    top = s->cur_func->top_break;
28292|     30|    while (top != NULL) {
  ------------------
  |  Branch (28292:12): [True: 0, False: 30]
  ------------------
28293|      0|        if (top->has_iterator || top->label_finally != -1) {
  ------------------
  |  Branch (28293:13): [True: 0, False: 0]
  |  Branch (28293:34): [True: 0, False: 0]
  ------------------
28294|      0|            if (!hasval) {
  ------------------
  |  Branch (28294:17): [True: 0, False: 0]
  ------------------
28295|      0|                emit_op(s, OP_undefined);
28296|      0|                hasval = TRUE;
28297|      0|            }
28298|       |            /* Remove the stack elements up to and including the catch
28299|       |               offset. When 'yield' is used in an expression we have
28300|       |               no easy way to count them, so we use this specific
28301|       |               instruction instead. */
28302|      0|            emit_op(s, OP_nip_catch);
28303|       |            /* stack: iter_obj next ret_val */
28304|      0|            if (top->has_iterator) {
  ------------------
  |  Branch (28304:17): [True: 0, False: 0]
  ------------------
28305|      0|                if (s->cur_func->func_kind == JS_FUNC_ASYNC_GENERATOR) {
  ------------------
  |  Branch (28305:21): [True: 0, False: 0]
  ------------------
28306|      0|                    int label_next, label_next2;
28307|      0|                    emit_op(s, OP_nip); /* next */
28308|      0|                    emit_op(s, OP_swap);
28309|      0|                    emit_op(s, OP_get_field2);
28310|      0|                    emit_atom(s, JS_ATOM_return);
28311|       |                    /* stack: iter_obj return_func */
28312|      0|                    emit_op(s, OP_dup);
28313|      0|                    emit_op(s, OP_is_undefined_or_null);
28314|      0|                    label_next = emit_goto(s, OP_if_true, -1);
28315|      0|                    emit_op(s, OP_call_method);
28316|      0|                    emit_u16(s, 0);
28317|      0|                    emit_op(s, OP_iterator_check_object);
28318|      0|                    emit_op(s, OP_await);
28319|      0|                    label_next2 = emit_goto(s, OP_goto, -1);
28320|      0|                    emit_label(s, label_next);
28321|      0|                    emit_op(s, OP_drop);
28322|      0|                    emit_label(s, label_next2);
28323|      0|                    emit_op(s, OP_drop);
28324|      0|                } else {
28325|      0|                    emit_op(s, OP_rot3r);
28326|      0|                    emit_op(s, OP_undefined); /* dummy catch offset */
28327|      0|                    emit_op(s, OP_iterator_close);
28328|      0|                }
28329|      0|            } else {
28330|       |                /* execute the "finally" block */
28331|      0|                emit_goto(s, OP_gosub, top->label_finally);
28332|      0|            }
28333|      0|        }
28334|      0|        top = top->prev;
28335|      0|    }
28336|     30|    if (s->cur_func->is_derived_class_constructor) {
  ------------------
  |  Branch (28336:9): [True: 0, False: 30]
  ------------------
28337|      0|        int label_return;
28338|       |
28339|       |        /* 'this' can be uninitialized, so it may be accessed only if
28340|       |           the derived class constructor does not return an object */
28341|      0|        if (hasval) {
  ------------------
  |  Branch (28341:13): [True: 0, False: 0]
  ------------------
28342|      0|            emit_op(s, OP_check_ctor_return);
28343|      0|            label_return = emit_goto(s, OP_if_false, -1);
28344|      0|            emit_op(s, OP_drop);
28345|      0|        } else {
28346|      0|            label_return = -1;
28347|      0|        }
28348|       |
28349|       |        /* The error should be raised in the caller context, so we use
28350|       |           a specific opcode */
28351|      0|        emit_op(s, OP_scope_get_var_checkthis);
28352|      0|        emit_atom(s, JS_ATOM_this);
28353|      0|        emit_u16(s, 0);
28354|       |
28355|      0|        emit_label(s, label_return);
28356|      0|        emit_op(s, OP_return);
28357|     30|    } else if (s->cur_func->func_kind != JS_FUNC_NORMAL) {
  ------------------
  |  Branch (28357:16): [True: 17, False: 13]
  ------------------
28358|     17|        emit_op(s, OP_return_async);
28359|     17|    } else {
28360|     13|        emit_op(s, hasval ? OP_return : OP_return_undef);
  ------------------
  |  Branch (28360:20): [True: 12, False: 1]
  ------------------
28361|     13|    }
28362|     30|}
quickjs.c:js_free_function_def:
32046|      8|{
32047|      8|    int i;
32048|      8|    struct list_head *el, *el1;
32049|       |
32050|       |    /* free the child functions */
32051|      8|    list_for_each_safe(el, el1, &fd->child_list) {
  ------------------
  |  |   89|      9|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 1, False: 8]
  |  |  ------------------
  |  |   90|      8|        el = el1, el1 = el->next)
  ------------------
32052|      1|        JSFunctionDef *fd1;
32053|      1|        fd1 = list_entry(el, JSFunctionDef, link);
  ------------------
  |  |   39|      1|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      1|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
32054|      1|        js_free_function_def(ctx, fd1);
32055|      1|    }
32056|       |
32057|      8|    free_bytecode_atoms(ctx->rt, fd->byte_code.buf, fd->byte_code.size,
32058|      8|                        fd->use_short_opcodes);
32059|      8|    dbuf_free(&fd->byte_code);
32060|      8|    js_free(ctx, fd->jump_slots);
32061|      8|    js_free(ctx, fd->label_slots);
32062|      8|    js_free(ctx, fd->line_number_slots);
32063|       |
32064|      9|    for(i = 0; i < fd->cpool_count; i++) {
  ------------------
  |  Branch (32064:16): [True: 1, False: 8]
  ------------------
32065|      1|        JS_FreeValue(ctx, fd->cpool[i]);
32066|      1|    }
32067|      8|    js_free(ctx, fd->cpool);
32068|       |
32069|      8|    JS_FreeAtom(ctx, fd->func_name);
32070|       |
32071|     26|    for(i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (32071:16): [True: 18, False: 8]
  ------------------
32072|     18|        JS_FreeAtom(ctx, fd->vars[i].var_name);
32073|     18|    }
32074|      8|    js_free(ctx, fd->vars);
32075|     12|    for(i = 0; i < fd->arg_count; i++) {
  ------------------
  |  Branch (32075:16): [True: 4, False: 8]
  ------------------
32076|      4|        JS_FreeAtom(ctx, fd->args[i].var_name);
32077|      4|    }
32078|      8|    js_free(ctx, fd->args);
32079|       |
32080|      9|    for(i = 0; i < fd->global_var_count; i++) {
  ------------------
  |  Branch (32080:16): [True: 1, False: 8]
  ------------------
32081|      1|        JS_FreeAtom(ctx, fd->global_vars[i].var_name);
32082|      1|    }
32083|      8|    js_free(ctx, fd->global_vars);
32084|       |
32085|      8|    for(i = 0; i < fd->closure_var_count; i++) {
  ------------------
  |  Branch (32085:16): [True: 0, False: 8]
  ------------------
32086|      0|        JSClosureVar *cv = &fd->closure_var[i];
32087|      0|        JS_FreeAtom(ctx, cv->var_name);
32088|      0|    }
32089|      8|    js_free(ctx, fd->closure_var);
32090|       |
32091|      8|    if (fd->scopes != fd->def_scope_array)
  ------------------
  |  Branch (32091:9): [True: 2, False: 6]
  ------------------
32092|      2|        js_free(ctx, fd->scopes);
32093|       |
32094|      8|    JS_FreeAtom(ctx, fd->filename);
32095|      8|    dbuf_free(&fd->pc2line);
32096|       |
32097|      8|    js_free(ctx, fd->source);
32098|       |
32099|      8|    if (fd->parent) {
  ------------------
  |  Branch (32099:9): [True: 3, False: 5]
  ------------------
32100|       |        /* remove in parent list */
32101|      3|        list_del(&fd->link);
32102|      3|    }
32103|      8|    js_free(ctx, fd);
32104|      8|}
quickjs.c:js_create_function:
35908|     31|{
35909|     31|    JSValue func_obj;
35910|     31|    JSFunctionBytecode *b;
35911|     31|    struct list_head *el, *el1;
35912|     31|    int stack_size, scope, idx;
35913|     31|    int function_size, byte_code_offset, cpool_offset;
35914|     31|    int closure_var_offset, vardefs_offset;
35915|     31|    BOOL strip_var_debug;
35916|       |    
35917|       |    /* recompute scope linkage */
35918|     98|    for (scope = 0; scope < fd->scope_count; scope++) {
  ------------------
  |  Branch (35918:21): [True: 67, False: 31]
  ------------------
35919|     67|        fd->scopes[scope].first = -1;
35920|     67|    }
35921|     31|    if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (35921:9): [True: 2, False: 29]
  ------------------
35922|       |        /* special end of variable list marker for the argument scope */
35923|      2|        fd->scopes[ARG_SCOPE_INDEX].first = ARG_SCOPE_END;
  ------------------
  |  |  635|      2|#define ARG_SCOPE_INDEX 1
  ------------------
                      fd->scopes[ARG_SCOPE_INDEX].first = ARG_SCOPE_END;
  ------------------
  |  |  636|      2|#define ARG_SCOPE_END (-2)
  ------------------
35924|      2|    }
35925|     51|    for (idx = 0; idx < fd->var_count; idx++) {
  ------------------
  |  Branch (35925:19): [True: 20, False: 31]
  ------------------
35926|     20|        JSVarDef *vd = &fd->vars[idx];
35927|     20|        vd->scope_next = fd->scopes[vd->scope_level].first;
35928|     20|        fd->scopes[vd->scope_level].first = idx;
35929|     20|    }
35930|     36|    for (scope = 2; scope < fd->scope_count; scope++) {
  ------------------
  |  Branch (35930:21): [True: 5, False: 31]
  ------------------
35931|      5|        JSVarScope *sd = &fd->scopes[scope];
35932|      5|        if (sd->first < 0)
  ------------------
  |  Branch (35932:13): [True: 3, False: 2]
  ------------------
35933|      3|            sd->first = fd->scopes[sd->parent].first;
35934|      5|    }
35935|     51|    for (idx = 0; idx < fd->var_count; idx++) {
  ------------------
  |  Branch (35935:19): [True: 20, False: 31]
  ------------------
35936|     20|        JSVarDef *vd = &fd->vars[idx];
35937|     20|        if (vd->scope_next < 0 && vd->scope_level > 1) {
  ------------------
  |  Branch (35937:13): [True: 18, False: 2]
  |  Branch (35937:35): [True: 2, False: 16]
  ------------------
35938|      2|            scope = fd->scopes[vd->scope_level].parent;
35939|      2|            vd->scope_next = fd->scopes[scope].first;
35940|      2|        }
35941|     20|    }
35942|       |
35943|       |    /* if the function contains an eval call, the closure variables
35944|       |       are used to compile the eval and they must be ordered by scope,
35945|       |       so it is necessary to create the closure variables before any
35946|       |       other variable lookup is done. */
35947|     31|    if (fd->has_eval_call)
  ------------------
  |  Branch (35947:9): [True: 0, False: 31]
  ------------------
35948|      0|        add_eval_variables(ctx, fd);
35949|       |
35950|       |    /* add the module global variables in the closure */
35951|     31|    if (fd->is_eval) {
  ------------------
  |  Branch (35951:9): [True: 29, False: 2]
  ------------------
35952|     29|        if (add_global_variables(ctx, fd))
  ------------------
  |  Branch (35952:13): [True: 0, False: 29]
  ------------------
35953|      0|            goto fail;
35954|     29|    } 
35955|       |
35956|       |    /* first create all the child functions */
35957|     31|    list_for_each_safe(el, el1, &fd->child_list) {
  ------------------
  |  |   89|     33|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 2, False: 31]
  |  |  ------------------
  |  |   90|     31|        el = el1, el1 = el->next)
  ------------------
35958|      2|        JSFunctionDef *fd1;
35959|      2|        int cpool_idx;
35960|       |
35961|      2|        fd1 = list_entry(el, JSFunctionDef, link);
  ------------------
  |  |   39|      2|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|      2|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
35962|      2|        cpool_idx = fd1->parent_cpool_idx;
35963|      2|        func_obj = js_create_function(ctx, fd1);
35964|      2|        if (JS_IsException(func_obj))
  ------------------
  |  Branch (35964:13): [True: 0, False: 2]
  ------------------
35965|      0|            goto fail;
35966|       |        /* save it in the constant pool */
35967|      2|        assert(cpool_idx >= 0);
  ------------------
  |  Branch (35967:9): [True: 0, False: 2]
  |  Branch (35967:9): [True: 2, False: 0]
  ------------------
35968|      2|        fd->cpool[cpool_idx] = func_obj;
35969|      2|    }
35970|       |
35971|       |#if defined(DUMP_BYTECODE) && (DUMP_BYTECODE & 4)
35972|       |    if (!fd->strip_debug) {
35973|       |        printf("pass 1\n");
35974|       |        dump_byte_code(ctx, 1, fd->byte_code.buf, fd->byte_code.size,
35975|       |                       NULL, fd->args, fd->arg_count, fd->vars, fd->var_count,
35976|       |                       fd->closure_var, fd->closure_var_count,
35977|       |                       fd->cpool, fd->cpool_count, fd->source,
35978|       |                       fd->label_slots, NULL);
35979|       |        printf("\n");
35980|       |    }
35981|       |#endif
35982|       |
35983|     31|    if (resolve_variables(ctx, fd))
  ------------------
  |  Branch (35983:9): [True: 0, False: 31]
  ------------------
35984|      0|        goto fail;
35985|       |
35986|       |#if defined(DUMP_BYTECODE) && (DUMP_BYTECODE & 2)
35987|       |    if (!fd->strip_debug) {
35988|       |        printf("pass 2\n");
35989|       |        dump_byte_code(ctx, 2, fd->byte_code.buf, fd->byte_code.size,
35990|       |                       NULL, fd->args, fd->arg_count, fd->vars, fd->var_count,
35991|       |                       fd->closure_var, fd->closure_var_count,
35992|       |                       fd->cpool, fd->cpool_count, fd->source,
35993|       |                       fd->label_slots, NULL);
35994|       |        printf("\n");
35995|       |    }
35996|       |#endif
35997|       |
35998|     31|    if (resolve_labels(ctx, fd))
  ------------------
  |  Branch (35998:9): [True: 0, False: 31]
  ------------------
35999|      0|        goto fail;
36000|       |
36001|     31|    if (compute_stack_size(ctx, fd, &stack_size) < 0)
  ------------------
  |  Branch (36001:9): [True: 0, False: 31]
  ------------------
36002|      0|        goto fail;
36003|       |
36004|     31|    if (fd->strip_debug) {
  ------------------
  |  Branch (36004:9): [True: 0, False: 31]
  ------------------
36005|      0|        function_size = offsetof(JSFunctionBytecode, debug);
36006|     31|    } else {
36007|     31|        function_size = sizeof(*b);
36008|     31|    }
36009|     31|    cpool_offset = function_size;
36010|     31|    function_size += fd->cpool_count * sizeof(*fd->cpool);
36011|     31|    vardefs_offset = function_size;
36012|     31|    function_size += (fd->arg_count + fd->var_count) * sizeof(*b->vardefs);
36013|     31|    closure_var_offset = function_size;
36014|     31|    function_size += fd->closure_var_count * sizeof(*fd->closure_var);
36015|     31|    byte_code_offset = function_size;
36016|     31|    function_size += fd->byte_code.size;
36017|       |
36018|     31|    b = js_mallocz(ctx, function_size);
36019|     31|    if (!b)
  ------------------
  |  Branch (36019:9): [True: 0, False: 31]
  ------------------
36020|      0|        goto fail;
36021|     31|    js_rc(b)->ref_count = 1;
36022|       |
36023|     31|    b->byte_code_buf = (void *)((uint8_t*)b + byte_code_offset);
36024|     31|    b->byte_code_len = fd->byte_code.size;
36025|     31|    memcpy(b->byte_code_buf, fd->byte_code.buf, fd->byte_code.size);
36026|     31|    js_free(ctx, fd->byte_code.buf);
36027|     31|    fd->byte_code.buf = NULL;
36028|       |
36029|     31|    strip_var_debug = fd->strip_debug && !fd->has_eval_call; /* XXX: check */
  ------------------
  |  Branch (36029:23): [True: 0, False: 31]
  |  Branch (36029:42): [True: 0, False: 0]
  ------------------
36030|     31|    b->func_name = fd->func_name;
36031|     31|    if (fd->arg_count + fd->var_count > 0) {
  ------------------
  |  Branch (36031:9): [True: 14, False: 17]
  ------------------
36032|     14|        int i;
36033|     14|        b->vardefs = (void *)((uint8_t*)b + vardefs_offset);
36034|     18|        for(i = 0; i < fd->arg_count; i++) {
  ------------------
  |  Branch (36034:20): [True: 4, False: 14]
  ------------------
36035|      4|            JSVarDef *vd = &fd->args[i];
36036|      4|            JSBytecodeVarDef *vd1 = &b->vardefs[i];
36037|      4|            if (strip_var_debug) {
  ------------------
  |  Branch (36037:17): [True: 0, False: 4]
  ------------------
36038|      0|                JS_FreeAtom(ctx, vd->var_name);
36039|      0|                vd1->var_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
36040|      4|            } else {
36041|      4|                vd1->var_name = vd->var_name;
36042|      4|            }
36043|      4|            vd1->has_scope = (vd->scope_level != 0);
36044|      4|            vd1->scope_next = vd->scope_next;
36045|      4|            vd1->is_const = vd->is_const;
36046|      4|            vd1->is_lexical = vd->is_lexical;
36047|      4|            vd1->is_captured = vd->is_captured;
36048|      4|            vd1->var_kind = vd->var_kind;
36049|      4|            vd1->var_ref_idx = vd->var_ref_idx;
36050|      4|        }
36051|       |        
36052|     34|        for(i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (36052:20): [True: 20, False: 14]
  ------------------
36053|     20|            JSVarDef *vd = &fd->vars[i];
36054|     20|            JSBytecodeVarDef *vd1 = &b->vardefs[i + fd->arg_count];
36055|     20|            if (strip_var_debug) {
  ------------------
  |  Branch (36055:17): [True: 0, False: 20]
  ------------------
36056|      0|                JS_FreeAtom(ctx, vd->var_name);
36057|      0|                vd1->var_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
36058|     20|            } else {
36059|     20|                vd1->var_name = vd->var_name;
36060|     20|            }
36061|     20|            vd1->has_scope = (vd->scope_level != 0);
36062|     20|            vd1->scope_next = vd->scope_next;
36063|     20|            vd1->is_const = vd->is_const;
36064|     20|            vd1->is_lexical = vd->is_lexical;
36065|     20|            vd1->is_captured = vd->is_captured;
36066|     20|            vd1->var_kind = vd->var_kind;
36067|     20|            vd1->var_ref_idx = vd->var_ref_idx;
36068|     20|        }
36069|     14|        b->var_count = fd->var_count;
36070|     14|        b->arg_count = fd->arg_count;
36071|     14|        b->defined_arg_count = fd->defined_arg_count;
36072|     14|        b->var_ref_count = fd->var_ref_count;
36073|     14|        js_free(ctx, fd->args);
36074|     14|        js_free(ctx, fd->vars);
36075|     14|    }
36076|     31|    b->cpool_count = fd->cpool_count;
36077|     31|    if (b->cpool_count) {
  ------------------
  |  Branch (36077:9): [True: 10, False: 21]
  ------------------
36078|     10|        b->cpool = (void *)((uint8_t*)b + cpool_offset);
36079|     10|        memcpy(b->cpool, fd->cpool, b->cpool_count * sizeof(*b->cpool));
36080|     10|    }
36081|     31|    js_free(ctx, fd->cpool);
36082|     31|    fd->cpool = NULL;
36083|       |
36084|     31|    b->stack_size = stack_size;
36085|       |
36086|     31|    if (fd->strip_debug) {
  ------------------
  |  Branch (36086:9): [True: 0, False: 31]
  ------------------
36087|      0|        JS_FreeAtom(ctx, fd->filename);
36088|      0|        dbuf_free(&fd->pc2line);    // probably useless
36089|     31|    } else {
36090|       |        /* XXX: source and pc2line info should be packed at the end of the
36091|       |           JSFunctionBytecode structure, avoiding allocation overhead
36092|       |         */
36093|     31|        b->has_debug = 1;
36094|     31|        b->debug.filename = fd->filename;
36095|       |
36096|       |        //DynBuf pc2line;
36097|       |        //compute_pc2line_info(fd, &pc2line);
36098|       |        //js_free(ctx, fd->line_number_slots)
36099|     31|        b->debug.pc2line_buf = js_realloc(ctx, fd->pc2line.buf, fd->pc2line.size);
36100|     31|        if (!b->debug.pc2line_buf)
  ------------------
  |  Branch (36100:13): [True: 0, False: 31]
  ------------------
36101|      0|            b->debug.pc2line_buf = fd->pc2line.buf;
36102|     31|        b->debug.pc2line_len = fd->pc2line.size;
36103|     31|        b->debug.source = fd->source;
36104|     31|        b->debug.source_len = fd->source_len;
36105|     31|    }
36106|     31|    if (fd->scopes != fd->def_scope_array)
  ------------------
  |  Branch (36106:9): [True: 0, False: 31]
  ------------------
36107|      0|        js_free(ctx, fd->scopes);
36108|       |
36109|     31|    b->closure_var_count = fd->closure_var_count;
36110|     31|    if (b->closure_var_count) {
  ------------------
  |  Branch (36110:9): [True: 29, False: 2]
  ------------------
36111|     29|        if (strip_var_debug) {
  ------------------
  |  Branch (36111:13): [True: 0, False: 29]
  ------------------
36112|      0|            int i;
36113|      0|            for(i = 0; i < fd->closure_var_count; i++) {
  ------------------
  |  Branch (36113:24): [True: 0, False: 0]
  ------------------
36114|      0|                JSClosureVar *cv = &fd->closure_var[i];
36115|      0|                if (cv->closure_type != JS_CLOSURE_GLOBAL_REF &&
  ------------------
  |  Branch (36115:21): [True: 0, False: 0]
  ------------------
36116|      0|                    cv->closure_type != JS_CLOSURE_GLOBAL_DECL &&
  ------------------
  |  Branch (36116:21): [True: 0, False: 0]
  ------------------
36117|      0|                    cv->closure_type != JS_CLOSURE_GLOBAL &&
  ------------------
  |  Branch (36117:21): [True: 0, False: 0]
  ------------------
36118|      0|                    cv->closure_type != JS_CLOSURE_MODULE_DECL &&
  ------------------
  |  Branch (36118:21): [True: 0, False: 0]
  ------------------
36119|      0|                    cv->closure_type != JS_CLOSURE_MODULE_IMPORT) {
  ------------------
  |  Branch (36119:21): [True: 0, False: 0]
  ------------------
36120|      0|                    JS_FreeAtom(ctx, cv->var_name);
36121|      0|                    cv->var_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
36122|      0|                }
36123|      0|            }
36124|      0|        }
36125|     29|        b->closure_var = (void *)((uint8_t*)b + closure_var_offset);
36126|     29|        memcpy(b->closure_var, fd->closure_var, b->closure_var_count * sizeof(*b->closure_var));
36127|     29|    }
36128|     31|    js_free(ctx, fd->closure_var);
36129|     31|    fd->closure_var = NULL;
36130|       |
36131|     31|    b->has_prototype = fd->has_prototype;
36132|     31|    b->has_simple_parameter_list = fd->has_simple_parameter_list;
36133|     31|    b->js_mode = fd->js_mode;
36134|     31|    b->is_derived_class_constructor = fd->is_derived_class_constructor;
36135|     31|    b->func_kind = fd->func_kind;
36136|     31|    b->need_home_object = (fd->home_object_var_idx >= 0 ||
  ------------------
  |  Branch (36136:28): [True: 0, False: 31]
  ------------------
36137|     31|                           fd->need_home_object);
  ------------------
  |  Branch (36137:28): [True: 0, False: 31]
  ------------------
36138|     31|    b->new_target_allowed = fd->new_target_allowed;
36139|     31|    b->super_call_allowed = fd->super_call_allowed;
36140|     31|    b->super_allowed = fd->super_allowed;
36141|     31|    b->arguments_allowed = fd->arguments_allowed;
36142|     31|    b->is_direct_or_indirect_eval = (fd->eval_type == JS_EVAL_TYPE_DIRECT ||
  ------------------
  |  |  334|     62|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
  |  Branch (36142:38): [True: 0, False: 31]
  ------------------
36143|     31|                                     fd->eval_type == JS_EVAL_TYPE_INDIRECT);
  ------------------
  |  |  335|     31|#define JS_EVAL_TYPE_INDIRECT (3 << 0) /* indirect call (internal use) */
  ------------------
  |  Branch (36143:38): [True: 0, False: 31]
  ------------------
36144|     31|    b->realm = JS_DupContext(ctx);
36145|       |
36146|     31|    add_gc_object(ctx->rt, &b->header, JS_GC_OBJ_TYPE_FUNCTION_BYTECODE);
36147|       |
36148|       |#if defined(DUMP_BYTECODE) && (DUMP_BYTECODE & 1)
36149|       |    if (!fd->strip_debug) {
36150|       |        js_dump_function_bytecode(ctx, b);
36151|       |    }
36152|       |#endif
36153|       |
36154|     31|    if (fd->parent) {
  ------------------
  |  Branch (36154:9): [True: 2, False: 29]
  ------------------
36155|       |        /* remove from parent list */
36156|      2|        list_del(&fd->link);
36157|      2|    }
36158|       |
36159|     31|    js_free(ctx, fd);
36160|     31|    return JS_MKPTR(JS_TAG_FUNCTION_BYTECODE, b);
  ------------------
  |  |  248|     31|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
36161|      0| fail:
36162|      0|    js_free_function_def(ctx, fd);
36163|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
36164|     31|}
quickjs.c:get_closure_var:
32624|      8|{
32625|      8|    int i;
32626|       |
32627|      8|    if (fd != s->parent) {
  ------------------
  |  Branch (32627:9): [True: 3, False: 5]
  ------------------
32628|      3|        var_idx = get_closure_var(ctx, s->parent, fd, closure_type,
32629|      3|                                  var_idx, var_name,
32630|      3|                                  is_const, is_lexical, var_kind);
32631|      3|        if (var_idx < 0)
  ------------------
  |  Branch (32631:13): [True: 0, False: 3]
  ------------------
32632|      0|            return -1;
32633|      3|        if (closure_type != JS_CLOSURE_GLOBAL_REF)
  ------------------
  |  Branch (32633:13): [True: 0, False: 3]
  ------------------
32634|      0|            closure_type = JS_CLOSURE_REF;
32635|      3|    }
32636|     17|    for(i = 0; i < s->closure_var_count; i++) {
  ------------------
  |  Branch (32636:16): [True: 10, False: 7]
  ------------------
32637|     10|        JSClosureVar *cv = &s->closure_var[i];
32638|     10|        if (cv->var_idx == var_idx && cv->closure_type == closure_type)
  ------------------
  |  Branch (32638:13): [True: 1, False: 9]
  |  Branch (32638:39): [True: 1, False: 0]
  ------------------
32639|      1|            return i;
32640|     10|    }
32641|      7|    return add_closure_var(ctx, s, closure_type, var_idx, var_name,
32642|      7|                           is_const, is_lexical, var_kind);
32643|      8|}
quickjs.c:add_global_variables:
35838|     29|{
35839|     29|    int i, idx;
35840|     29|    JSModuleDef *m = fd->module;
35841|     29|    JSExportEntry *me;
35842|     29|    JSGlobalVar *hf;
35843|     29|    BOOL need_global_closures;
35844|       |    
35845|       |    /* Script: add the defined global variables. In the non strict
35846|       |       direct eval not in global scope, the global variables are
35847|       |       created in the enclosing scope so they are not created as
35848|       |       variable references.
35849|       |
35850|       |       In modules, the imported global variables were added as closure
35851|       |       global variables in js_parse_import().
35852|       |    */
35853|     29|    need_global_closures = TRUE;
35854|     29|    if (fd->eval_type == JS_EVAL_TYPE_DIRECT && !(fd->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  334|     58|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
                  if (fd->eval_type == JS_EVAL_TYPE_DIRECT && !(fd->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (35854:9): [True: 0, False: 29]
  |  Branch (35854:49): [True: 0, False: 0]
  ------------------
35855|       |        /* XXX: add a flag ? */
35856|      0|        for(idx = 0; idx < fd->closure_var_count; idx++) {
  ------------------
  |  Branch (35856:22): [True: 0, False: 0]
  ------------------
35857|      0|            JSClosureVar *cv = &fd->closure_var[idx];
35858|      0|            if (cv->var_name == JS_ATOM__var_ ||
  ------------------
  |  Branch (35858:17): [True: 0, False: 0]
  ------------------
35859|      0|                cv->var_name == JS_ATOM__arg_var_) {
  ------------------
  |  Branch (35859:17): [True: 0, False: 0]
  ------------------
35860|      0|                need_global_closures = FALSE;
35861|      0|                break;
35862|      0|            }
35863|      0|        }
35864|      0|    }
35865|       |
35866|     29|    if (need_global_closures) {
  ------------------
  |  Branch (35866:9): [True: 29, False: 0]
  ------------------
35867|     29|        JSClosureTypeEnum closure_type;
35868|     29|        if (fd->module)
  ------------------
  |  Branch (35868:13): [True: 17, False: 12]
  ------------------
35869|     17|            closure_type = JS_CLOSURE_MODULE_DECL;
35870|     12|        else
35871|     12|            closure_type = JS_CLOSURE_GLOBAL_DECL;
35872|     29|        for(i = 0; i < fd->global_var_count; i++) {
  ------------------
  |  Branch (35872:20): [True: 0, False: 29]
  ------------------
35873|      0|            JSVarKindEnum var_kind;
35874|      0|            hf = &fd->global_vars[i];
35875|      0|            if (hf->cpool_idx >= 0 && !hf->is_lexical) {
  ------------------
  |  Branch (35875:17): [True: 0, False: 0]
  |  Branch (35875:39): [True: 0, False: 0]
  ------------------
35876|      0|                var_kind = JS_VAR_GLOBAL_FUNCTION_DECL;
35877|      0|            } else {
35878|      0|                var_kind = JS_VAR_NORMAL;
35879|      0|            }
35880|      0|            if (add_closure_var(ctx, fd, closure_type, i, hf->var_name, hf->is_const,
  ------------------
  |  Branch (35880:17): [True: 0, False: 0]
  ------------------
35881|      0|                                hf->is_lexical, var_kind) < 0)
35882|      0|                return -1;
35883|      0|        }
35884|     29|    }
35885|       |
35886|     29|    if (fd->module) {
  ------------------
  |  Branch (35886:9): [True: 17, False: 12]
  ------------------
35887|       |        /* resolve the variable names of the local exports */
35888|     17|        for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (35888:20): [True: 0, False: 17]
  ------------------
35889|      0|            me = &m->export_entries[i];
35890|      0|            if (me->export_type == JS_EXPORT_TYPE_LOCAL) {
  ------------------
  |  Branch (35890:17): [True: 0, False: 0]
  ------------------
35891|      0|                idx = find_closure_var(ctx, fd, me->local_name);
35892|      0|                if (idx < 0) {
  ------------------
  |  Branch (35892:21): [True: 0, False: 0]
  ------------------
35893|      0|                    JS_ThrowSyntaxErrorAtom(ctx, "exported variable '%s' does not exist",
  ------------------
  |  | 7732|      0|#define JS_ThrowSyntaxErrorAtom(ctx, fmt, atom) __JS_ThrowSyntaxErrorAtom(ctx, atom, fmt, "")
  ------------------
35894|      0|                                            me->local_name);
35895|      0|                    return -1;
35896|      0|                }
35897|      0|                me->u.local.var_idx = idx;
35898|      0|            }
35899|      0|        }
35900|     17|    }
35901|     29|    return 0;
35902|     29|}
quickjs.c:resolve_variables:
34071|     31|{
34072|     31|    int pos, pos_next, bc_len, op, len, line_num, i, idx;
34073|     31|    uint8_t *bc_buf;
34074|     31|    JSAtom var_name;
34075|     31|    DynBuf bc_out;
34076|     31|    CodeContext cc;
34077|     31|    int scope;
34078|       |
34079|     31|    cc.bc_buf = bc_buf = s->byte_code.buf;
34080|     31|    cc.bc_len = bc_len = s->byte_code.size;
34081|     31|    js_dbuf_bytecode_init(ctx, &bc_out);
34082|       |
34083|       |    /* first pass for runtime checks (must be done before the
34084|       |       variables are created) */
34085|       |    /* XXX: inefficient */
34086|     31|    for(i = 0; i < s->global_var_count; i++) {
  ------------------
  |  Branch (34086:16): [True: 0, False: 31]
  ------------------
34087|      0|        JSGlobalVar *hf = &s->global_vars[i];
34088|       |
34089|       |        /* check if global variable (XXX: simplify) */
34090|      0|        for(idx = 0; idx < s->closure_var_count; idx++) {
  ------------------
  |  Branch (34090:22): [True: 0, False: 0]
  ------------------
34091|      0|            JSClosureVar *cv = &s->closure_var[idx];
34092|      0|            if (cv->closure_type == JS_CLOSURE_GLOBAL_REF ||
  ------------------
  |  Branch (34092:17): [True: 0, False: 0]
  ------------------
34093|      0|                cv->closure_type == JS_CLOSURE_GLOBAL_DECL ||
  ------------------
  |  Branch (34093:17): [True: 0, False: 0]
  ------------------
34094|      0|                cv->closure_type == JS_CLOSURE_GLOBAL ||
  ------------------
  |  Branch (34094:17): [True: 0, False: 0]
  ------------------
34095|      0|                cv->closure_type == JS_CLOSURE_MODULE_DECL ||
  ------------------
  |  Branch (34095:17): [True: 0, False: 0]
  ------------------
34096|      0|                cv->closure_type == JS_CLOSURE_MODULE_IMPORT)
  ------------------
  |  Branch (34096:17): [True: 0, False: 0]
  ------------------
34097|      0|                goto next; /* don't look at global variables (they are at the end) */
34098|      0|            if (cv->var_name == hf->var_name) {
  ------------------
  |  Branch (34098:17): [True: 0, False: 0]
  ------------------
34099|      0|                if (s->eval_type == JS_EVAL_TYPE_DIRECT &&
  ------------------
  |  |  334|      0|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
  |  Branch (34099:21): [True: 0, False: 0]
  ------------------
34100|      0|                    cv->is_lexical) {
  ------------------
  |  Branch (34100:21): [True: 0, False: 0]
  ------------------
34101|       |                    /* Check if a lexical variable is
34102|       |                       redefined as 'var'. XXX: Could abort
34103|       |                       compilation here, but for consistency
34104|       |                       with the other checks, we delay the
34105|       |                       error generation. */
34106|      0|                    dbuf_putc(&bc_out, OP_throw_error);
34107|      0|                    dbuf_put_u32(&bc_out, JS_DupAtom(ctx, hf->var_name));
34108|      0|                    dbuf_putc(&bc_out, JS_THROW_VAR_REDECL);
  ------------------
  |  |18360|      0|#define JS_THROW_VAR_REDECL         1
  ------------------
34109|      0|                }
34110|      0|                goto next;
34111|      0|            }
34112|      0|            if (cv->var_name == JS_ATOM__var_ ||
  ------------------
  |  Branch (34112:17): [True: 0, False: 0]
  ------------------
34113|      0|                cv->var_name == JS_ATOM__arg_var_)
  ------------------
  |  Branch (34113:17): [True: 0, False: 0]
  ------------------
34114|      0|                goto next;
34115|      0|        }
34116|      0|    next: ;
34117|      0|    }
34118|       |
34119|     31|    line_num = 0; /* avoid warning */
34120|    686|    for (pos = 0; pos < bc_len; pos = pos_next) {
  ------------------
  |  Branch (34120:19): [True: 655, False: 31]
  ------------------
34121|    655|        op = bc_buf[pos];
34122|    655|        len = opcode_info[op].size;
34123|    655|        pos_next = pos + len;
34124|    655|        switch(op) {
34125|    160|        case OP_line_num:
  ------------------
  |  Branch (34125:9): [True: 160, False: 495]
  ------------------
34126|    160|            line_num = get_u32(bc_buf + pos + 1);
34127|    160|            s->line_number_size++;
34128|    160|            goto no_change;
34129|       |
34130|      0|        case OP_eval: /* convert scope index to adjusted variable index */
  ------------------
  |  Branch (34130:9): [True: 0, False: 655]
  ------------------
34131|      0|            {
34132|      0|                int call_argc = get_u16(bc_buf + pos + 1);
34133|      0|                scope = get_u16(bc_buf + pos + 1 + 2);
34134|      0|                mark_eval_captured_variables(ctx, s, scope);
34135|      0|                dbuf_putc(&bc_out, op);
34136|      0|                dbuf_put_u16(&bc_out, call_argc);
34137|      0|                dbuf_put_u16(&bc_out, s->scopes[scope].first - ARG_SCOPE_END);
  ------------------
  |  |  636|      0|#define ARG_SCOPE_END (-2)
  ------------------
34138|      0|            }
34139|      0|            break;
34140|      0|        case OP_apply_eval: /* convert scope index to adjusted variable index */
  ------------------
  |  Branch (34140:9): [True: 0, False: 655]
  ------------------
34141|      0|            scope = get_u16(bc_buf + pos + 1);
34142|      0|            mark_eval_captured_variables(ctx, s, scope);
34143|      0|            dbuf_putc(&bc_out, op);
34144|      0|            dbuf_put_u16(&bc_out, s->scopes[scope].first - ARG_SCOPE_END);
  ------------------
  |  |  636|      0|#define ARG_SCOPE_END (-2)
  ------------------
34145|      0|            break;
34146|      0|        case OP_scope_get_var_checkthis:
  ------------------
  |  Branch (34146:9): [True: 0, False: 655]
  ------------------
34147|      0|        case OP_scope_get_var_undef:
  ------------------
  |  Branch (34147:9): [True: 0, False: 655]
  ------------------
34148|     88|        case OP_scope_get_var:
  ------------------
  |  Branch (34148:9): [True: 88, False: 567]
  ------------------
34149|    101|        case OP_scope_put_var:
  ------------------
  |  Branch (34149:9): [True: 13, False: 642]
  ------------------
34150|    101|        case OP_scope_delete_var:
  ------------------
  |  Branch (34150:9): [True: 0, False: 655]
  ------------------
34151|    101|        case OP_scope_get_ref:
  ------------------
  |  Branch (34151:9): [True: 0, False: 655]
  ------------------
34152|    107|        case OP_scope_put_var_init:
  ------------------
  |  Branch (34152:9): [True: 6, False: 649]
  ------------------
34153|    107|            var_name = get_u32(bc_buf + pos + 1);
34154|    107|            scope = get_u16(bc_buf + pos + 5);
34155|    107|            pos_next = resolve_scope_var(ctx, s, var_name, scope, op, &bc_out,
34156|    107|                                         NULL, NULL, pos_next);
34157|    107|            JS_FreeAtom(ctx, var_name);
34158|    107|            break;
34159|      0|        case OP_scope_make_ref:
  ------------------
  |  Branch (34159:9): [True: 0, False: 655]
  ------------------
34160|      0|            {
34161|      0|                int label;
34162|      0|                LabelSlot *ls;
34163|      0|                var_name = get_u32(bc_buf + pos + 1);
34164|      0|                label = get_u32(bc_buf + pos + 5);
34165|      0|                scope = get_u16(bc_buf + pos + 9);
34166|      0|                ls = &s->label_slots[label];
34167|      0|                ls->ref_count--;  /* always remove label reference */
34168|      0|                pos_next = resolve_scope_var(ctx, s, var_name, scope, op, &bc_out,
34169|      0|                                             bc_buf, ls, pos_next);
34170|      0|                JS_FreeAtom(ctx, var_name);
34171|      0|            }
34172|      0|            break;
34173|      0|        case OP_scope_get_private_field:
  ------------------
  |  Branch (34173:9): [True: 0, False: 655]
  ------------------
34174|      0|        case OP_scope_get_private_field2:
  ------------------
  |  Branch (34174:9): [True: 0, False: 655]
  ------------------
34175|      0|        case OP_scope_put_private_field:
  ------------------
  |  Branch (34175:9): [True: 0, False: 655]
  ------------------
34176|      0|        case OP_scope_in_private_field:
  ------------------
  |  Branch (34176:9): [True: 0, False: 655]
  ------------------
34177|      0|            {
34178|      0|                int ret;
34179|      0|                var_name = get_u32(bc_buf + pos + 1);
34180|      0|                scope = get_u16(bc_buf + pos + 5);
34181|      0|                ret = resolve_scope_private_field(ctx, s, var_name, scope, op, &bc_out);
34182|      0|                if (ret < 0)
  ------------------
  |  Branch (34182:21): [True: 0, False: 0]
  ------------------
34183|      0|                    goto fail;
34184|      0|                JS_FreeAtom(ctx, var_name);
34185|      0|            }
34186|      0|            break;
34187|      0|        case OP_gosub:
  ------------------
  |  Branch (34187:9): [True: 0, False: 655]
  ------------------
34188|      0|            s->jump_size++;
34189|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
34190|       |                /* remove calls to empty finalizers  */
34191|      0|                int label;
34192|      0|                LabelSlot *ls;
34193|       |
34194|      0|                label = get_u32(bc_buf + pos + 1);
34195|      0|                assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34195:17): [True: 0, False: 0]
  |  Branch (34195:17): [True: 0, False: 0]
  |  Branch (34195:17): [True: 0, False: 0]
  |  Branch (34195:17): [True: 0, False: 0]
  ------------------
34196|      0|                ls = &s->label_slots[label];
34197|      0|                if (code_match(&cc, ls->pos, OP_ret, -1)) {
  ------------------
  |  Branch (34197:21): [True: 0, False: 0]
  ------------------
34198|      0|                    ls->ref_count--;
34199|      0|                    break;
34200|      0|                }
34201|      0|            }
34202|      0|            goto no_change;
34203|     47|        case OP_drop:
  ------------------
  |  Branch (34203:9): [True: 47, False: 608]
  ------------------
34204|     47|            if (0) {
  ------------------
  |  Branch (34204:17): [Folded, False: 47]
  ------------------
34205|       |                /* remove drops before return_undef */
34206|       |                /* do not perform this optimization in pass2 because
34207|       |                   it breaks patterns recognised in resolve_labels */
34208|      0|                int pos1 = pos_next;
34209|      0|                int line1 = line_num;
34210|      0|                while (code_match(&cc, pos1, OP_drop, -1)) {
  ------------------
  |  Branch (34210:24): [True: 0, False: 0]
  ------------------
34211|      0|                    if (cc.line_num >= 0) line1 = cc.line_num;
  ------------------
  |  Branch (34211:25): [True: 0, False: 0]
  ------------------
34212|      0|                    pos1 = cc.pos;
34213|      0|                }
34214|      0|                if (code_match(&cc, pos1, OP_return_undef, -1)) {
  ------------------
  |  Branch (34214:21): [True: 0, False: 0]
  ------------------
34215|      0|                    pos_next = pos1;
34216|      0|                    if (line1 != -1 && line1 != line_num) {
  ------------------
  |  Branch (34216:25): [True: 0, False: 0]
  |  Branch (34216:40): [True: 0, False: 0]
  ------------------
34217|      0|                        line_num = line1;
34218|      0|                        s->line_number_size++;
34219|      0|                        dbuf_putc(&bc_out, OP_line_num);
34220|      0|                        dbuf_put_u32(&bc_out, line_num);
34221|      0|                    }
34222|      0|                    break;
34223|      0|                }
34224|      0|            }
34225|     47|            goto no_change;
34226|     47|        case OP_insert3:
  ------------------
  |  Branch (34226:9): [True: 0, False: 655]
  ------------------
34227|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
34228|       |                /* Transformation: insert3 put_array_el|put_ref_value drop -> put_array_el|put_ref_value */
34229|      0|                if (code_match(&cc, pos_next, M2(OP_put_array_el, OP_put_ref_value), OP_drop, -1)) {
  ------------------
  |  |33760|      0|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (34229:21): [True: 0, False: 0]
  ------------------
34230|      0|                    dbuf_putc(&bc_out, cc.op);
34231|      0|                    pos_next = cc.pos;
34232|      0|                    if (cc.line_num != -1 && cc.line_num != line_num) {
  ------------------
  |  Branch (34232:25): [True: 0, False: 0]
  |  Branch (34232:46): [True: 0, False: 0]
  ------------------
34233|      0|                        line_num = cc.line_num;
34234|      0|                        s->line_number_size++;
34235|      0|                        dbuf_putc(&bc_out, OP_line_num);
34236|      0|                        dbuf_put_u32(&bc_out, line_num);
34237|      0|                    }
34238|      0|                    break;
34239|      0|                }
34240|      0|            }
34241|      0|            goto no_change;
34242|       |
34243|     13|        case OP_goto:
  ------------------
  |  Branch (34243:9): [True: 13, False: 642]
  ------------------
34244|     13|            s->jump_size++;
34245|       |            /* fall thru */
34246|     13|        case OP_tail_call:
  ------------------
  |  Branch (34246:9): [True: 0, False: 655]
  ------------------
34247|     13|        case OP_tail_call_method:
  ------------------
  |  Branch (34247:9): [True: 0, False: 655]
  ------------------
34248|     27|        case OP_return:
  ------------------
  |  Branch (34248:9): [True: 14, False: 641]
  ------------------
34249|     27|        case OP_return_undef:
  ------------------
  |  Branch (34249:9): [True: 0, False: 655]
  ------------------
34250|     27|        case OP_throw:
  ------------------
  |  Branch (34250:9): [True: 0, False: 655]
  ------------------
34251|     27|        case OP_throw_error:
  ------------------
  |  Branch (34251:9): [True: 0, False: 655]
  ------------------
34252|     27|        case OP_ret:
  ------------------
  |  Branch (34252:9): [True: 0, False: 655]
  ------------------
34253|     27|            if (OPTIMIZE) {
  ------------------
  |  |   50|     27|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 27, Folded]
  |  |  ------------------
  ------------------
34254|       |                /* remove dead code */
34255|     27|                int line = -1;
34256|     27|                dbuf_put(&bc_out, bc_buf + pos, len);
34257|     27|                pos = skip_dead_code(s, bc_buf, bc_len, pos + len, &line);
34258|     27|                pos_next = pos;
34259|     27|                if (pos < bc_len && line >= 0 && line_num != line) {
  ------------------
  |  Branch (34259:21): [True: 13, False: 14]
  |  Branch (34259:37): [True: 0, False: 13]
  |  Branch (34259:50): [True: 0, False: 0]
  ------------------
34260|      0|                    line_num = line;
34261|      0|                    s->line_number_size++;
34262|      0|                    dbuf_putc(&bc_out, OP_line_num);
34263|      0|                    dbuf_put_u32(&bc_out, line_num);
34264|      0|                }
34265|     27|                break;
34266|     27|            }
34267|      0|            goto no_change;
34268|       |
34269|     23|        case OP_label:
  ------------------
  |  Branch (34269:9): [True: 23, False: 632]
  ------------------
34270|     23|            {
34271|     23|                int label;
34272|     23|                LabelSlot *ls;
34273|       |
34274|     23|                label = get_u32(bc_buf + pos + 1);
34275|     23|                assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34275:17): [True: 0, False: 23]
  |  Branch (34275:17): [True: 0, False: 0]
  |  Branch (34275:17): [True: 23, False: 0]
  |  Branch (34275:17): [True: 23, False: 0]
  ------------------
34276|     23|                ls = &s->label_slots[label];
34277|     23|                ls->pos2 = bc_out.size + opcode_info[op].size;
34278|     23|            }
34279|     23|            goto no_change;
34280|       |
34281|     36|        case OP_enter_scope:
  ------------------
  |  Branch (34281:9): [True: 36, False: 619]
  ------------------
34282|     36|            {
34283|     36|                int scope_idx, scope = get_u16(bc_buf + pos + 1);
34284|       |
34285|     36|                if (scope == s->body_scope) {
  ------------------
  |  Branch (34285:21): [True: 31, False: 5]
  ------------------
34286|     31|                    instantiate_hoisted_definitions(ctx, s, &bc_out);
34287|     31|                }
34288|       |
34289|     42|                for(scope_idx = s->scopes[scope].first; scope_idx >= 0;) {
  ------------------
  |  Branch (34289:57): [True: 8, False: 34]
  ------------------
34290|      8|                    JSVarDef *vd = &s->vars[scope_idx];
34291|      8|                    if (vd->scope_level == scope) {
  ------------------
  |  Branch (34291:25): [True: 6, False: 2]
  ------------------
34292|      6|                        if (scope_idx != s->arguments_arg_idx) {
  ------------------
  |  Branch (34292:29): [True: 6, False: 0]
  ------------------
34293|      6|                            if (vd->var_kind == JS_VAR_FUNCTION_DECL ||
  ------------------
  |  Branch (34293:33): [True: 0, False: 6]
  ------------------
34294|      6|                                vd->var_kind == JS_VAR_NEW_FUNCTION_DECL) {
  ------------------
  |  Branch (34294:33): [True: 0, False: 6]
  ------------------
34295|       |                                /* Initialize lexical variable upon entering scope */
34296|      0|                                dbuf_putc(&bc_out, OP_fclosure);
34297|      0|                                dbuf_put_u32(&bc_out, vd->func_pool_idx);
34298|      0|                                dbuf_putc(&bc_out, OP_put_loc);
34299|      0|                                dbuf_put_u16(&bc_out, scope_idx);
34300|      6|                            } else {
34301|       |                                /* XXX: should check if variable can be used
34302|       |                                   before initialization */
34303|      6|                                dbuf_putc(&bc_out, OP_set_loc_uninitialized);
34304|      6|                                dbuf_put_u16(&bc_out, scope_idx);
34305|      6|                            }
34306|      6|                        }
34307|      6|                        scope_idx = vd->scope_next;
34308|      6|                    } else {
34309|      2|                        break;
34310|      2|                    }
34311|      8|                }
34312|     36|            }
34313|     36|            break;
34314|       |
34315|     11|        case OP_leave_scope:
  ------------------
  |  Branch (34315:9): [True: 11, False: 644]
  ------------------
34316|     11|            {
34317|     11|                int scope_idx, scope = get_u16(bc_buf + pos + 1);
34318|       |
34319|     21|                for(scope_idx = s->scopes[scope].first; scope_idx >= 0;) {
  ------------------
  |  Branch (34319:57): [True: 10, False: 11]
  ------------------
34320|     10|                    JSVarDef *vd = &s->vars[scope_idx];
34321|     10|                    if (vd->scope_level == scope) {
  ------------------
  |  Branch (34321:25): [True: 10, False: 0]
  ------------------
34322|     10|                        if (vd->is_captured) {
  ------------------
  |  Branch (34322:29): [True: 0, False: 10]
  ------------------
34323|      0|                            dbuf_putc(&bc_out, OP_close_loc);
34324|      0|                            dbuf_put_u16(&bc_out, scope_idx);
34325|      0|                        }
34326|     10|                        scope_idx = vd->scope_next;
34327|     10|                    } else {
34328|      0|                        break;
34329|      0|                    }
34330|     10|                }
34331|     11|            }
34332|     11|            break;
34333|       |
34334|      2|        case OP_set_name:
  ------------------
  |  Branch (34334:9): [True: 2, False: 653]
  ------------------
34335|      2|            {
34336|       |                /* remove dummy set_name opcodes */
34337|      2|                JSAtom name = get_u32(bc_buf + pos + 1);
34338|      2|                if (name == JS_ATOM_NULL)
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (34338:21): [True: 0, False: 2]
  ------------------
34339|      0|                    break;
34340|      2|            }
34341|      2|            goto no_change;
34342|       |
34343|      3|        case OP_if_false:
  ------------------
  |  Branch (34343:9): [True: 3, False: 652]
  ------------------
34344|      5|        case OP_if_true:
  ------------------
  |  Branch (34344:9): [True: 2, False: 653]
  ------------------
34345|      5|        case OP_catch:
  ------------------
  |  Branch (34345:9): [True: 0, False: 655]
  ------------------
34346|      5|            s->jump_size++;
34347|      5|            goto no_change;
34348|       |
34349|     14|        case OP_dup:
  ------------------
  |  Branch (34349:9): [True: 14, False: 641]
  ------------------
34350|     14|            if (OPTIMIZE) {
  ------------------
  |  |   50|     14|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 14, Folded]
  |  |  ------------------
  ------------------
34351|       |                /* Transformation: dup if_false(l1) drop, l1: if_false(l2) -> if_false(l2) */
34352|       |                /* Transformation: dup if_true(l1) drop, l1: if_true(l2) -> if_true(l2) */
34353|     14|                if (code_match(&cc, pos_next, M2(OP_if_false, OP_if_true), OP_drop, -1)) {
  ------------------
  |  |33760|     14|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (34353:21): [True: 0, False: 14]
  ------------------
34354|      0|                    int lab0, lab1, op1, pos1, line1, pos2;
34355|      0|                    lab0 = lab1 = cc.label;
34356|      0|                    assert(lab1 >= 0 && lab1 < s->label_count);
  ------------------
  |  Branch (34356:21): [True: 0, False: 0]
  |  Branch (34356:21): [True: 0, False: 0]
  |  Branch (34356:21): [True: 0, False: 0]
  |  Branch (34356:21): [True: 0, False: 0]
  ------------------
34357|      0|                    op1 = cc.op;
34358|      0|                    pos1 = cc.pos;
34359|      0|                    line1 = cc.line_num;
34360|      0|                    while (code_match(&cc, (pos2 = get_label_pos(s, lab1)), OP_dup, op1, OP_drop, -1)) {
  ------------------
  |  Branch (34360:28): [True: 0, False: 0]
  ------------------
34361|      0|                        lab1 = cc.label;
34362|      0|                    }
34363|      0|                    if (code_match(&cc, pos2, op1, -1)) {
  ------------------
  |  Branch (34363:25): [True: 0, False: 0]
  ------------------
34364|      0|                        s->jump_size++;
34365|      0|                        update_label(s, lab0, -1);
34366|      0|                        update_label(s, cc.label, +1);
34367|      0|                        dbuf_putc(&bc_out, op1);
34368|      0|                        dbuf_put_u32(&bc_out, cc.label);
34369|      0|                        pos_next = pos1;
34370|      0|                        if (line1 != -1 && line1 != line_num) {
  ------------------
  |  Branch (34370:29): [True: 0, False: 0]
  |  Branch (34370:44): [True: 0, False: 0]
  ------------------
34371|      0|                            line_num = line1;
34372|      0|                            s->line_number_size++;
34373|      0|                            dbuf_putc(&bc_out, OP_line_num);
34374|      0|                            dbuf_put_u32(&bc_out, line_num);
34375|      0|                        }
34376|      0|                        break;
34377|      0|                    }
34378|      0|                }
34379|     14|            }
34380|     14|            goto no_change;
34381|       |
34382|     14|        case OP_nop:
  ------------------
  |  Branch (34382:9): [True: 0, False: 655]
  ------------------
34383|       |            /* remove erased code */
34384|      0|            break;
34385|      0|        case OP_set_class_name:
  ------------------
  |  Branch (34385:9): [True: 0, False: 655]
  ------------------
34386|       |            /* only used during parsing */
34387|      0|            break;
34388|       |
34389|      0|        case OP_get_field_opt_chain: /* equivalent to OP_get_field */
  ------------------
  |  Branch (34389:9): [True: 0, False: 655]
  ------------------
34390|      0|            {
34391|      0|                JSAtom name = get_u32(bc_buf + pos + 1);
34392|      0|                dbuf_putc(&bc_out, OP_get_field);
34393|      0|                dbuf_put_u32(&bc_out, name);
34394|      0|            }
34395|      0|            break;
34396|      0|        case OP_get_array_el_opt_chain: /* equivalent to OP_get_array_el */
  ------------------
  |  Branch (34396:9): [True: 0, False: 655]
  ------------------
34397|      0|            dbuf_putc(&bc_out, OP_get_array_el);
34398|      0|            break;
34399|       |
34400|    223|        default:
  ------------------
  |  Branch (34400:9): [True: 223, False: 432]
  ------------------
34401|    474|        no_change:
34402|    474|            dbuf_put(&bc_out, bc_buf + pos, len);
34403|    474|            break;
34404|    655|        }
34405|    655|    }
34406|       |
34407|       |    /* set the new byte code */
34408|     31|    dbuf_free(&s->byte_code);
34409|     31|    s->byte_code = bc_out;
34410|     31|    if (dbuf_error(&s->byte_code)) {
  ------------------
  |  Branch (34410:9): [True: 0, False: 31]
  ------------------
34411|      0|        JS_ThrowOutOfMemory(ctx);
34412|      0|        return -1;
34413|      0|    }
34414|     31|    return 0;
34415|      0| fail:
34416|       |    /* continue the copy to keep the atom refcounts consistent */
34417|       |    /* XXX: find a better solution ? */
34418|      0|    for (; pos < bc_len; pos = pos_next) {
  ------------------
  |  Branch (34418:12): [True: 0, False: 0]
  ------------------
34419|      0|        op = bc_buf[pos];
34420|      0|        len = opcode_info[op].size;
34421|      0|        pos_next = pos + len;
34422|      0|        dbuf_put(&bc_out, bc_buf + pos, len);
34423|      0|    }
34424|      0|    dbuf_free(&s->byte_code);
34425|      0|    s->byte_code = bc_out;
34426|      0|    return -1;
34427|     31|}
quickjs.c:resolve_scope_var:
32803|    107|{
32804|    107|    int idx, var_idx, is_put;
32805|    107|    int label_done;
32806|    107|    JSFunctionDef *fd;
32807|    107|    JSVarDef *vd;
32808|    107|    BOOL is_pseudo_var, is_arg_scope;
32809|       |
32810|    107|    label_done = -1;
32811|       |
32812|       |    /* XXX: could be simpler to use a specific function to
32813|       |       resolve the pseudo variables */
32814|    107|    is_pseudo_var = (var_name == JS_ATOM_home_object ||
  ------------------
  |  Branch (32814:22): [True: 0, False: 107]
  ------------------
32815|    107|                     var_name == JS_ATOM_this_active_func ||
  ------------------
  |  Branch (32815:22): [True: 0, False: 107]
  ------------------
32816|    107|                     var_name == JS_ATOM_new_target ||
  ------------------
  |  Branch (32816:22): [True: 0, False: 107]
  ------------------
32817|    107|                     var_name == JS_ATOM_this);
  ------------------
  |  Branch (32817:22): [True: 0, False: 107]
  ------------------
32818|       |
32819|       |    /* resolve local scoped variables */
32820|    107|    var_idx = -1;
32821|    125|    for (idx = s->scopes[scope_level].first; idx >= 0;) {
  ------------------
  |  Branch (32821:46): [True: 32, False: 93]
  ------------------
32822|     32|        vd = &s->vars[idx];
32823|     32|        if (vd->var_name == var_name) {
  ------------------
  |  Branch (32823:13): [True: 14, False: 18]
  ------------------
32824|     14|            if (op == OP_scope_put_var || op == OP_scope_make_ref) {
  ------------------
  |  Branch (32824:17): [True: 4, False: 10]
  |  Branch (32824:43): [True: 0, False: 10]
  ------------------
32825|      4|                if (vd->is_const) {
  ------------------
  |  Branch (32825:21): [True: 0, False: 4]
  ------------------
32826|      0|                    dbuf_putc(bc, OP_throw_error);
32827|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32828|      0|                    dbuf_putc(bc, JS_THROW_VAR_RO);
  ------------------
  |  |18359|      0|#define JS_THROW_VAR_RO             0
  ------------------
32829|      0|                    goto done;
32830|      0|                }
32831|      4|            }
32832|     14|            var_idx = idx;
32833|     14|            break;
32834|     14|        } else
32835|     18|        if (vd->var_name == JS_ATOM__with_ && !is_pseudo_var) {
  ------------------
  |  Branch (32835:13): [True: 0, False: 18]
  |  Branch (32835:47): [True: 0, False: 0]
  ------------------
32836|      0|            dbuf_putc(bc, OP_get_loc);
32837|      0|            dbuf_put_u16(bc, idx);
32838|      0|            var_object_test(ctx, s, var_name, op, bc, &label_done, 1);
32839|      0|        }
32840|     18|        idx = vd->scope_next;
32841|     18|    }
32842|    107|    is_arg_scope = (idx == ARG_SCOPE_END);
  ------------------
  |  |  636|    107|#define ARG_SCOPE_END (-2)
  ------------------
32843|    107|    if (var_idx < 0) {
  ------------------
  |  Branch (32843:9): [True: 93, False: 14]
  ------------------
32844|       |        /* argument scope: variables are not visible but pseudo
32845|       |           variables are visible */
32846|     93|        if (!is_arg_scope) {
  ------------------
  |  Branch (32846:13): [True: 91, False: 2]
  ------------------
32847|     91|            var_idx = find_var(ctx, s, var_name);
32848|     91|        }
32849|       |
32850|     93|        if (var_idx < 0 && is_pseudo_var)
  ------------------
  |  Branch (32850:13): [True: 88, False: 5]
  |  Branch (32850:28): [True: 0, False: 88]
  ------------------
32851|      0|            var_idx = resolve_pseudo_var(ctx, s, var_name);
32852|       |
32853|     93|        if (var_idx < 0 && var_name == JS_ATOM_arguments &&
  ------------------
  |  Branch (32853:13): [True: 88, False: 5]
  |  Branch (32853:28): [True: 0, False: 88]
  ------------------
32854|      0|            s->has_arguments_binding) {
  ------------------
  |  Branch (32854:13): [True: 0, False: 0]
  ------------------
32855|       |            /* 'arguments' pseudo variable */
32856|      0|            var_idx = add_arguments_var(ctx, s);
32857|      0|        }
32858|     93|        if (var_idx < 0 && s->is_func_expr && var_name == s->func_name) {
  ------------------
  |  Branch (32858:13): [True: 88, False: 5]
  |  Branch (32858:28): [True: 5, False: 83]
  |  Branch (32858:47): [True: 0, False: 5]
  ------------------
32859|       |            /* add a new variable with the function name */
32860|      0|            var_idx = add_func_var(ctx, s, var_name);
32861|      0|        }
32862|     93|    }
32863|    107|    if (var_idx >= 0) {
  ------------------
  |  Branch (32863:9): [True: 19, False: 88]
  ------------------
32864|     19|        if ((op == OP_scope_put_var || op == OP_scope_make_ref) &&
  ------------------
  |  Branch (32864:14): [True: 9, False: 10]
  |  Branch (32864:40): [True: 0, False: 10]
  ------------------
32865|      9|            !(var_idx & ARGUMENT_VAR_OFFSET) &&
  ------------------
  |  |16205|      9|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (32865:13): [True: 4, False: 5]
  ------------------
32866|      4|            s->vars[var_idx].is_const) {
  ------------------
  |  Branch (32866:13): [True: 0, False: 4]
  ------------------
32867|       |            /* only happens when assigning a function expression name
32868|       |               in strict mode */
32869|      0|            dbuf_putc(bc, OP_throw_error);
32870|      0|            dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32871|      0|            dbuf_putc(bc, JS_THROW_VAR_RO);
  ------------------
  |  |18359|      0|#define JS_THROW_VAR_RO             0
  ------------------
32872|      0|            goto done;
32873|      0|        }
32874|       |        /* OP_scope_put_var_init is only used to initialize a
32875|       |           lexical variable, so it is never used in a with or var object. It
32876|       |           can be used with a closure (module global variable case). */
32877|     19|        switch (op) {
  ------------------
  |  Branch (32877:17): [True: 19, False: 0]
  ------------------
32878|      0|        case OP_scope_make_ref:
  ------------------
  |  Branch (32878:9): [True: 0, False: 19]
  ------------------
32879|      0|            if (!(var_idx & ARGUMENT_VAR_OFFSET) &&
  ------------------
  |  |16205|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (32879:17): [True: 0, False: 0]
  ------------------
32880|      0|                s->vars[var_idx].var_kind == JS_VAR_FUNCTION_NAME) {
  ------------------
  |  Branch (32880:17): [True: 0, False: 0]
  ------------------
32881|       |                /* Create a dummy object reference for the func_var */
32882|      0|                dbuf_putc(bc, OP_object);
32883|      0|                dbuf_putc(bc, OP_get_loc);
32884|      0|                dbuf_put_u16(bc, var_idx);
32885|      0|                dbuf_putc(bc, OP_define_field);
32886|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32887|      0|                dbuf_putc(bc, OP_push_atom_value);
32888|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32889|      0|            } else
32890|      0|            if (label_done == -1 && can_opt_put_ref_value(bc_buf, ls->pos)) {
  ------------------
  |  Branch (32890:17): [True: 0, False: 0]
  |  Branch (32890:37): [True: 0, False: 0]
  ------------------
32891|      0|                int get_op;
32892|      0|                if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16205|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (32892:21): [True: 0, False: 0]
  ------------------
32893|      0|                    get_op = OP_get_arg;
32894|      0|                    var_idx -= ARGUMENT_VAR_OFFSET;
  ------------------
  |  |16205|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
32895|      0|                } else {
32896|      0|                    if (s->vars[var_idx].is_lexical)
  ------------------
  |  Branch (32896:25): [True: 0, False: 0]
  ------------------
32897|      0|                        get_op = OP_get_loc_check;
32898|      0|                    else
32899|      0|                        get_op = OP_get_loc;
32900|      0|                }
32901|      0|                pos_next = optimize_scope_make_ref(ctx, s, bc, bc_buf, ls,
32902|      0|                                                   pos_next, get_op, var_idx);
32903|      0|            } else {
32904|       |                /* Create a dummy object with a named slot that is
32905|       |                   a reference to the local variable */
32906|      0|                if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16205|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (32906:21): [True: 0, False: 0]
  ------------------
32907|      0|                    capture_var(s, &s->args[var_idx - ARGUMENT_VAR_OFFSET]);
  ------------------
  |  |16205|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
32908|      0|                    dbuf_putc(bc, OP_make_arg_ref);
32909|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32910|      0|                    dbuf_put_u16(bc, var_idx - ARGUMENT_VAR_OFFSET);
  ------------------
  |  |16205|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
32911|      0|                } else {
32912|      0|                    capture_var(s, &s->vars[var_idx]);
32913|      0|                    dbuf_putc(bc, OP_make_loc_ref);
32914|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32915|      0|                    dbuf_put_u16(bc, var_idx);
32916|      0|                }
32917|      0|            }
32918|      0|            break;
32919|      9|        case OP_scope_put_var:
  ------------------
  |  Branch (32919:9): [True: 9, False: 10]
  ------------------
32920|      9|            if (!(var_idx & ARGUMENT_VAR_OFFSET) &&
  ------------------
  |  |16205|      9|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (32920:17): [True: 4, False: 5]
  ------------------
32921|      4|                s->vars[var_idx].var_kind == JS_VAR_FUNCTION_NAME) {
  ------------------
  |  Branch (32921:17): [True: 0, False: 4]
  ------------------
32922|       |                /* in non strict mode, modifying the function name is ignored */
32923|      0|                dbuf_putc(bc, OP_drop);
32924|      0|                goto done;
32925|      0|            }
32926|      9|            goto local_scope_var;
32927|      9|        case OP_scope_get_ref:
  ------------------
  |  Branch (32927:9): [True: 0, False: 19]
  ------------------
32928|      0|            dbuf_putc(bc, OP_undefined);
32929|      0|            goto local_scope_var;
32930|      0|        case OP_scope_get_var_checkthis:
  ------------------
  |  Branch (32930:9): [True: 0, False: 19]
  ------------------
32931|      0|        case OP_scope_get_var_undef:
  ------------------
  |  Branch (32931:9): [True: 0, False: 19]
  ------------------
32932|      4|        case OP_scope_get_var:
  ------------------
  |  Branch (32932:9): [True: 4, False: 15]
  ------------------
32933|     10|        case OP_scope_put_var_init:
  ------------------
  |  Branch (32933:9): [True: 6, False: 13]
  ------------------
32934|     19|        local_scope_var:
32935|     19|            is_put = (op == OP_scope_put_var || op == OP_scope_put_var_init);
  ------------------
  |  Branch (32935:23): [True: 9, False: 10]
  |  Branch (32935:49): [True: 6, False: 4]
  ------------------
32936|     19|            if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16205|     19|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (32936:17): [True: 5, False: 14]
  ------------------
32937|      5|                dbuf_putc(bc, OP_get_arg + is_put);
32938|      5|                dbuf_put_u16(bc, var_idx - ARGUMENT_VAR_OFFSET);
  ------------------
  |  |16205|      5|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
32939|     14|            } else {
32940|     14|                if (is_put) {
  ------------------
  |  Branch (32940:21): [True: 10, False: 4]
  ------------------
32941|     10|                    if (s->vars[var_idx].is_lexical) {
  ------------------
  |  Branch (32941:25): [True: 6, False: 4]
  ------------------
32942|      6|                        if (op == OP_scope_put_var_init) {
  ------------------
  |  Branch (32942:29): [True: 6, False: 0]
  ------------------
32943|       |                            /* 'this' can only be initialized once */
32944|      6|                            if (var_name == JS_ATOM_this)
  ------------------
  |  Branch (32944:33): [True: 0, False: 6]
  ------------------
32945|      0|                                dbuf_putc(bc, OP_put_loc_check_init);
32946|      6|                            else
32947|      6|                                dbuf_putc(bc, OP_put_loc);
32948|      6|                        } else {
32949|      0|                            dbuf_putc(bc, OP_put_loc_check);
32950|      0|                        }
32951|      6|                    } else {
32952|      4|                        dbuf_putc(bc, OP_put_loc);
32953|      4|                    }
32954|     10|                } else {
32955|      4|                    if (s->vars[var_idx].is_lexical) {
  ------------------
  |  Branch (32955:25): [True: 2, False: 2]
  ------------------
32956|      2|                        if (op == OP_scope_get_var_checkthis) {
  ------------------
  |  Branch (32956:29): [True: 0, False: 2]
  ------------------
32957|       |                            /* only used for 'this' return in derived class constructors */
32958|      0|                            dbuf_putc(bc, OP_get_loc_checkthis);
32959|      2|                        } else {
32960|      2|                            dbuf_putc(bc, OP_get_loc_check);
32961|      2|                        }
32962|      2|                    } else {
32963|      2|                        dbuf_putc(bc, OP_get_loc);
32964|      2|                    }
32965|      4|                }
32966|     14|                dbuf_put_u16(bc, var_idx);
32967|     14|            }
32968|     19|            break;
32969|      0|        case OP_scope_delete_var:
  ------------------
  |  Branch (32969:9): [True: 0, False: 19]
  ------------------
32970|      0|            dbuf_putc(bc, OP_push_false);
32971|      0|            break;
32972|     19|        }
32973|     19|        goto done;
32974|     19|    }
32975|       |    /* check eval object */
32976|     88|    if (!is_arg_scope && s->var_object_idx >= 0 && !is_pseudo_var) {
  ------------------
  |  Branch (32976:9): [True: 86, False: 2]
  |  Branch (32976:26): [True: 0, False: 86]
  |  Branch (32976:52): [True: 0, False: 0]
  ------------------
32977|      0|        dbuf_putc(bc, OP_get_loc);
32978|      0|        dbuf_put_u16(bc, s->var_object_idx);
32979|      0|        var_object_test(ctx, s, var_name, op, bc, &label_done, 0);
32980|      0|    }
32981|       |    /* check eval object in argument scope */
32982|     88|    if (s->arg_var_object_idx >= 0 && !is_pseudo_var) {
  ------------------
  |  Branch (32982:9): [True: 0, False: 88]
  |  Branch (32982:39): [True: 0, False: 0]
  ------------------
32983|      0|        dbuf_putc(bc, OP_get_loc);
32984|      0|        dbuf_put_u16(bc, s->arg_var_object_idx);
32985|      0|        var_object_test(ctx, s, var_name, op, bc, &label_done, 0);
32986|      0|    }
32987|       |
32988|       |    /* check parent scopes */
32989|     91|    for (fd = s; fd->parent;) {
  ------------------
  |  Branch (32989:18): [True: 8, False: 83]
  ------------------
32990|      8|        scope_level = fd->parent_scope_level;
32991|      8|        fd = fd->parent;
32992|     11|        for (idx = fd->scopes[scope_level].first; idx >= 0;) {
  ------------------
  |  Branch (32992:51): [True: 3, False: 8]
  ------------------
32993|      3|            vd = &fd->vars[idx];
32994|      3|            if (vd->var_name == var_name) {
  ------------------
  |  Branch (32994:17): [True: 0, False: 3]
  ------------------
32995|      0|                if (op == OP_scope_put_var || op == OP_scope_make_ref) {
  ------------------
  |  Branch (32995:21): [True: 0, False: 0]
  |  Branch (32995:47): [True: 0, False: 0]
  ------------------
32996|      0|                    if (vd->is_const) {
  ------------------
  |  Branch (32996:25): [True: 0, False: 0]
  ------------------
32997|      0|                        dbuf_putc(bc, OP_throw_error);
32998|      0|                        dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32999|      0|                        dbuf_putc(bc, JS_THROW_VAR_RO);
  ------------------
  |  |18359|      0|#define JS_THROW_VAR_RO             0
  ------------------
33000|      0|                        goto done;
33001|      0|                    }
33002|      0|                }
33003|      0|                var_idx = idx;
33004|      0|                break;
33005|      3|            } else if (vd->var_name == JS_ATOM__with_ && !is_pseudo_var) {
  ------------------
  |  Branch (33005:24): [True: 0, False: 3]
  |  Branch (33005:58): [True: 0, False: 0]
  ------------------
33006|      0|                capture_var(fd, vd);
33007|      0|                idx = get_closure_var(ctx, s, fd, JS_CLOSURE_LOCAL, idx, vd->var_name, FALSE, FALSE, JS_VAR_NORMAL);
33008|      0|                if (idx >= 0) {
  ------------------
  |  Branch (33008:21): [True: 0, False: 0]
  ------------------
33009|      0|                    dbuf_putc(bc, OP_get_var_ref);
33010|      0|                    dbuf_put_u16(bc, idx);
33011|      0|                    var_object_test(ctx, s, var_name, op, bc, &label_done, 1);
33012|      0|                }
33013|      0|            }
33014|      3|            idx = vd->scope_next;
33015|      3|        }
33016|      8|        is_arg_scope = (idx == ARG_SCOPE_END);
  ------------------
  |  |  636|      8|#define ARG_SCOPE_END (-2)
  ------------------
33017|      8|        if (var_idx >= 0)
  ------------------
  |  Branch (33017:13): [True: 0, False: 8]
  ------------------
33018|      0|            break;
33019|       |
33020|      8|        if (!is_arg_scope) {
  ------------------
  |  Branch (33020:13): [True: 8, False: 0]
  ------------------
33021|      8|            var_idx = find_var(ctx, fd, var_name);
33022|      8|            if (var_idx >= 0)
  ------------------
  |  Branch (33022:17): [True: 0, False: 8]
  ------------------
33023|      0|                break;
33024|      8|        }
33025|      8|        if (is_pseudo_var) {
  ------------------
  |  Branch (33025:13): [True: 0, False: 8]
  ------------------
33026|      0|            var_idx = resolve_pseudo_var(ctx, fd, var_name);
33027|      0|            if (var_idx >= 0)
  ------------------
  |  Branch (33027:17): [True: 0, False: 0]
  ------------------
33028|      0|                break;
33029|      0|        }
33030|      8|        if (var_name == JS_ATOM_arguments && fd->has_arguments_binding) {
  ------------------
  |  Branch (33030:13): [True: 0, False: 8]
  |  Branch (33030:46): [True: 0, False: 0]
  ------------------
33031|      0|            var_idx = add_arguments_var(ctx, fd);
33032|      0|            break;
33033|      0|        }
33034|      8|        if (fd->is_func_expr && fd->func_name == var_name) {
  ------------------
  |  Branch (33034:13): [True: 3, False: 5]
  |  Branch (33034:33): [True: 0, False: 3]
  ------------------
33035|       |            /* add a new variable with the function name */
33036|      0|            var_idx = add_func_var(ctx, fd, var_name);
33037|      0|            break;
33038|      0|        }
33039|       |
33040|       |        /* check eval object */
33041|      8|        if (!is_arg_scope && fd->var_object_idx >= 0 && !is_pseudo_var) {
  ------------------
  |  Branch (33041:13): [True: 8, False: 0]
  |  Branch (33041:30): [True: 0, False: 8]
  |  Branch (33041:57): [True: 0, False: 0]
  ------------------
33042|      0|            vd = &fd->vars[fd->var_object_idx];
33043|      0|            capture_var(fd, vd);
33044|      0|            idx = get_closure_var(ctx, s, fd, JS_CLOSURE_LOCAL,
33045|      0|                                  fd->var_object_idx, vd->var_name,
33046|      0|                                  FALSE, FALSE, JS_VAR_NORMAL);
33047|      0|            dbuf_putc(bc, OP_get_var_ref);
33048|      0|            dbuf_put_u16(bc, idx);
33049|      0|            var_object_test(ctx, s, var_name, op, bc, &label_done, 0);
33050|      0|        }
33051|       |
33052|       |        /* check eval object in argument scope */
33053|      8|        if (fd->arg_var_object_idx >= 0 && !is_pseudo_var) {
  ------------------
  |  Branch (33053:13): [True: 0, False: 8]
  |  Branch (33053:44): [True: 0, False: 0]
  ------------------
33054|      0|            vd = &fd->vars[fd->arg_var_object_idx];
33055|      0|            capture_var(fd, vd);
33056|      0|            idx = get_closure_var(ctx, s, fd, JS_CLOSURE_LOCAL,
33057|      0|                                  fd->arg_var_object_idx, vd->var_name,
33058|      0|                                  FALSE, FALSE, JS_VAR_NORMAL);
33059|      0|            dbuf_putc(bc, OP_get_var_ref);
33060|      0|            dbuf_put_u16(bc, idx);
33061|      0|            var_object_test(ctx, s, var_name, op, bc, &label_done, 0);
33062|      0|        }
33063|       |
33064|      8|        if (fd->is_eval)
  ------------------
  |  Branch (33064:13): [True: 5, False: 3]
  ------------------
33065|      5|            break; /* it it necessarily the top level function */
33066|      8|    }
33067|       |
33068|       |    /* check direct eval scope (in the closure of the eval function
33069|       |       which is necessarily at the top level) */
33070|     88|    if (!fd)
  ------------------
  |  Branch (33070:9): [True: 0, False: 88]
  ------------------
33071|      0|        fd = s;
33072|     88|    if (var_idx < 0 && fd->is_eval) {
  ------------------
  |  Branch (33072:9): [True: 88, False: 0]
  |  Branch (33072:24): [True: 88, False: 0]
  ------------------
33073|     88|        int idx1;
33074|    190|        for (idx1 = 0; idx1 < fd->closure_var_count; idx1++) {
  ------------------
  |  Branch (33074:24): [True: 158, False: 32]
  ------------------
33075|    158|            JSClosureVar *cv = &fd->closure_var[idx1];
33076|    158|            if (var_name == cv->var_name) {
  ------------------
  |  Branch (33076:17): [True: 56, False: 102]
  ------------------
33077|     56|                if (fd != s) {
  ------------------
  |  Branch (33077:21): [True: 1, False: 55]
  ------------------
33078|      1|                    JSClosureTypeEnum closure_type;
33079|      1|                    if (cv->closure_type == JS_CLOSURE_GLOBAL ||
  ------------------
  |  Branch (33079:25): [True: 1, False: 0]
  ------------------
33080|      0|                        cv->closure_type == JS_CLOSURE_GLOBAL_DECL ||
  ------------------
  |  Branch (33080:25): [True: 0, False: 0]
  ------------------
33081|      0|                        cv->closure_type == JS_CLOSURE_GLOBAL_REF)
  ------------------
  |  Branch (33081:25): [True: 0, False: 0]
  ------------------
33082|      1|                        closure_type = JS_CLOSURE_GLOBAL_REF;
33083|      0|                    else
33084|      0|                        closure_type = JS_CLOSURE_REF;
33085|      1|                    idx = get_closure_var(ctx, s, fd,
33086|      1|                                          closure_type,
33087|      1|                                          idx1,
33088|      1|                                          cv->var_name, cv->is_const,
33089|      1|                                          cv->is_lexical, cv->var_kind);
33090|     55|                } else {
33091|     55|                    idx = idx1;
33092|     55|                }
33093|     56|                if (cv->closure_type == JS_CLOSURE_GLOBAL ||
  ------------------
  |  Branch (33093:21): [True: 22, False: 34]
  ------------------
33094|     34|                    cv->closure_type == JS_CLOSURE_GLOBAL_DECL ||
  ------------------
  |  Branch (33094:21): [True: 0, False: 34]
  ------------------
33095|     34|                    cv->closure_type == JS_CLOSURE_GLOBAL_REF)
  ------------------
  |  Branch (33095:21): [True: 0, False: 34]
  ------------------
33096|     22|                    goto has_global_idx;
33097|     34|                else
33098|     34|                    goto has_idx;
33099|    102|            } else if ((cv->var_name == JS_ATOM__var_ ||
  ------------------
  |  Branch (33099:25): [True: 0, False: 102]
  ------------------
33100|    102|                        cv->var_name == JS_ATOM__arg_var_ ||
  ------------------
  |  Branch (33100:25): [True: 0, False: 102]
  ------------------
33101|    102|                        cv->var_name == JS_ATOM__with_) && !is_pseudo_var) {
  ------------------
  |  Branch (33101:25): [True: 0, False: 102]
  |  Branch (33101:60): [True: 0, False: 0]
  ------------------
33102|      0|                int is_with = (cv->var_name == JS_ATOM__with_);
33103|      0|                if (fd != s) {
  ------------------
  |  Branch (33103:21): [True: 0, False: 0]
  ------------------
33104|      0|                    idx = get_closure_var(ctx, s, fd,
33105|      0|                                          JS_CLOSURE_REF,
33106|      0|                                          idx1,
33107|      0|                                          cv->var_name, FALSE, FALSE,
33108|      0|                                          JS_VAR_NORMAL);
33109|      0|                } else {
33110|      0|                    idx = idx1;
33111|      0|                }
33112|      0|                dbuf_putc(bc, OP_get_var_ref);
33113|      0|                dbuf_put_u16(bc, idx);
33114|      0|                var_object_test(ctx, s, var_name, op, bc, &label_done, is_with);
33115|      0|            }
33116|    158|        }
33117|       |
33118|       |        /* not found: add a closure for a global variable access */
33119|     32|        idx1 = add_closure_var(ctx, fd, JS_CLOSURE_GLOBAL, 0, var_name,
33120|     32|                              FALSE, FALSE, JS_VAR_NORMAL);
33121|     32|        if (idx1 < 0)
  ------------------
  |  Branch (33121:13): [True: 0, False: 32]
  ------------------
33122|      0|            return -1;
33123|     32|        if (fd != s) {
  ------------------
  |  Branch (33123:13): [True: 4, False: 28]
  ------------------
33124|      4|            idx = get_closure_var(ctx, s, fd,
33125|      4|                                  JS_CLOSURE_GLOBAL_REF,
33126|      4|                                  idx1,
33127|      4|                                  var_name, FALSE, FALSE, 
33128|      4|                                  JS_VAR_NORMAL);
33129|     28|        } else {
33130|     28|            idx = idx1;
33131|     28|        }
33132|     54|    has_global_idx:
33133|       |        /* global variable access */
33134|     54|        switch (op) {
  ------------------
  |  Branch (33134:17): [True: 54, False: 0]
  ------------------
33135|      0|        case OP_scope_make_ref:
  ------------------
  |  Branch (33135:9): [True: 0, False: 54]
  ------------------
33136|      0|            if (label_done == -1 && can_opt_put_global_ref_value(bc_buf, ls->pos)) {
  ------------------
  |  Branch (33136:17): [True: 0, False: 0]
  |  Branch (33136:37): [True: 0, False: 0]
  ------------------
33137|      0|                pos_next = optimize_scope_make_ref(ctx, s, bc, bc_buf, ls,
33138|      0|                                                   pos_next,
33139|      0|                                                   OP_get_var, idx);
33140|      0|            } else {
33141|      0|                dbuf_putc(bc, OP_make_var_ref);
33142|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33143|      0|            }
33144|      0|            break;
33145|      0|        case OP_scope_get_ref:
  ------------------
  |  Branch (33145:9): [True: 0, False: 54]
  ------------------
33146|       |            /* XXX: should create a dummy object with a named slot that is
33147|       |               a reference to the global variable */
33148|      0|            dbuf_putc(bc, OP_undefined);
33149|      0|            dbuf_putc(bc, OP_get_var);
33150|      0|            dbuf_put_u16(bc, idx);
33151|      0|            break;
33152|      0|        case OP_scope_get_var_undef:
  ------------------
  |  Branch (33152:9): [True: 0, False: 54]
  ------------------
33153|     50|        case OP_scope_get_var:
  ------------------
  |  Branch (33153:9): [True: 50, False: 4]
  ------------------
33154|     54|        case OP_scope_put_var:
  ------------------
  |  Branch (33154:9): [True: 4, False: 50]
  ------------------
33155|     54|            dbuf_putc(bc, OP_get_var_undef + (op - OP_scope_get_var_undef));
33156|     54|            dbuf_put_u16(bc, idx);
33157|     54|            break;
33158|      0|        case OP_scope_put_var_init:
  ------------------
  |  Branch (33158:9): [True: 0, False: 54]
  ------------------
33159|      0|            dbuf_putc(bc, OP_put_var_init);
33160|      0|            dbuf_put_u16(bc, idx);
33161|      0|            break;
33162|      0|        case OP_scope_delete_var:
  ------------------
  |  Branch (33162:9): [True: 0, False: 54]
  ------------------
33163|      0|            dbuf_putc(bc, OP_delete_var);
33164|      0|            dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33165|      0|            break;
33166|     54|        }
33167|     54|    } else {
33168|       |        /* find the corresponding closure variable */
33169|      0|        if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16205|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (33169:13): [True: 0, False: 0]
  ------------------
33170|      0|            capture_var(fd, &fd->args[var_idx - ARGUMENT_VAR_OFFSET]);
  ------------------
  |  |16205|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
33171|      0|            idx = get_closure_var(ctx, s, fd,
33172|      0|                                  JS_CLOSURE_ARG, var_idx - ARGUMENT_VAR_OFFSET,
  ------------------
  |  |16205|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
33173|      0|                                  var_name, FALSE, FALSE, JS_VAR_NORMAL);
33174|      0|        } else {
33175|      0|            capture_var(fd, &fd->vars[var_idx]);
33176|      0|            idx = get_closure_var(ctx, s, fd,
33177|      0|                                  JS_CLOSURE_LOCAL, var_idx,
33178|      0|                                  var_name,
33179|      0|                                  fd->vars[var_idx].is_const,
33180|      0|                                  fd->vars[var_idx].is_lexical,
33181|      0|                                  fd->vars[var_idx].var_kind);
33182|      0|        }
33183|      0|        if (idx >= 0) {
  ------------------
  |  Branch (33183:13): [True: 0, False: 0]
  ------------------
33184|     34|        has_idx:
33185|     34|            if ((op == OP_scope_put_var || op == OP_scope_make_ref) &&
  ------------------
  |  Branch (33185:18): [True: 0, False: 34]
  |  Branch (33185:44): [True: 0, False: 34]
  ------------------
33186|      0|                s->closure_var[idx].is_const) {
  ------------------
  |  Branch (33186:17): [True: 0, False: 0]
  ------------------
33187|      0|                dbuf_putc(bc, OP_throw_error);
33188|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33189|      0|                dbuf_putc(bc, JS_THROW_VAR_RO);
  ------------------
  |  |18359|      0|#define JS_THROW_VAR_RO             0
  ------------------
33190|      0|                goto done;
33191|      0|            }
33192|     34|            switch (op) {
  ------------------
  |  Branch (33192:21): [True: 34, False: 0]
  ------------------
33193|      0|            case OP_scope_make_ref:
  ------------------
  |  Branch (33193:13): [True: 0, False: 34]
  ------------------
33194|      0|                if (s->closure_var[idx].var_kind == JS_VAR_FUNCTION_NAME) {
  ------------------
  |  Branch (33194:21): [True: 0, False: 0]
  ------------------
33195|       |                    /* Create a dummy object reference for the func_var */
33196|      0|                    dbuf_putc(bc, OP_object);
33197|      0|                    dbuf_putc(bc, OP_get_var_ref);
33198|      0|                    dbuf_put_u16(bc, idx);
33199|      0|                    dbuf_putc(bc, OP_define_field);
33200|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33201|      0|                    dbuf_putc(bc, OP_push_atom_value);
33202|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33203|      0|                } else
33204|      0|                if (label_done == -1 &&
  ------------------
  |  Branch (33204:21): [True: 0, False: 0]
  ------------------
33205|      0|                    can_opt_put_ref_value(bc_buf, ls->pos)) {
  ------------------
  |  Branch (33205:21): [True: 0, False: 0]
  ------------------
33206|      0|                    int get_op;
33207|      0|                    if (s->closure_var[idx].is_lexical)
  ------------------
  |  Branch (33207:25): [True: 0, False: 0]
  ------------------
33208|      0|                        get_op = OP_get_var_ref_check;
33209|      0|                    else
33210|      0|                        get_op = OP_get_var_ref;
33211|      0|                    pos_next = optimize_scope_make_ref(ctx, s, bc, bc_buf, ls,
33212|      0|                                                       pos_next,
33213|      0|                                                       get_op, idx);
33214|      0|                } else {
33215|       |                    /* Create a dummy object with a named slot that is
33216|       |                       a reference to the closure variable */
33217|      0|                    dbuf_putc(bc, OP_make_var_ref_ref);
33218|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33219|      0|                    dbuf_put_u16(bc, idx);
33220|      0|                }
33221|      0|                break;
33222|      0|            case OP_scope_put_var:
  ------------------
  |  Branch (33222:13): [True: 0, False: 34]
  ------------------
33223|      0|                if (s->closure_var[idx].var_kind == JS_VAR_FUNCTION_NAME) {
  ------------------
  |  Branch (33223:21): [True: 0, False: 0]
  ------------------
33224|       |                    /* in non strict mode, modifying the function name is ignored */
33225|      0|                    dbuf_putc(bc, OP_drop);
33226|      0|                    goto done;
33227|      0|                }
33228|      0|                goto closure_scope_var;
33229|      0|            case OP_scope_get_ref:
  ------------------
  |  Branch (33229:13): [True: 0, False: 34]
  ------------------
33230|       |                /* XXX: should create a dummy object with a named slot that is
33231|       |                   a reference to the closure variable */
33232|      0|                dbuf_putc(bc, OP_undefined);
33233|      0|                goto closure_scope_var;
33234|      0|            case OP_scope_get_var_undef:
  ------------------
  |  Branch (33234:13): [True: 0, False: 34]
  ------------------
33235|     34|            case OP_scope_get_var:
  ------------------
  |  Branch (33235:13): [True: 34, False: 0]
  ------------------
33236|     34|            case OP_scope_put_var_init:
  ------------------
  |  Branch (33236:13): [True: 0, False: 34]
  ------------------
33237|     34|            closure_scope_var:
33238|     34|                is_put = (op == OP_scope_put_var ||
  ------------------
  |  Branch (33238:27): [True: 0, False: 34]
  ------------------
33239|     34|                          op == OP_scope_put_var_init);
  ------------------
  |  Branch (33239:27): [True: 0, False: 34]
  ------------------
33240|     34|                if (is_put) {
  ------------------
  |  Branch (33240:21): [True: 0, False: 34]
  ------------------
33241|      0|                    if (s->closure_var[idx].is_lexical) {
  ------------------
  |  Branch (33241:25): [True: 0, False: 0]
  ------------------
33242|      0|                        if (op == OP_scope_put_var_init) {
  ------------------
  |  Branch (33242:29): [True: 0, False: 0]
  ------------------
33243|       |                            /* 'this' can only be initialized once */
33244|      0|                            if (var_name == JS_ATOM_this)
  ------------------
  |  Branch (33244:33): [True: 0, False: 0]
  ------------------
33245|      0|                                dbuf_putc(bc, OP_put_var_ref_check_init);
33246|      0|                            else
33247|      0|                                dbuf_putc(bc, OP_put_var_ref);
33248|      0|                        } else {
33249|      0|                            dbuf_putc(bc, OP_put_var_ref_check);
33250|      0|                        }
33251|      0|                    } else {
33252|      0|                        dbuf_putc(bc, OP_put_var_ref);
33253|      0|                    }
33254|     34|                } else {
33255|     34|                    if (s->closure_var[idx].is_lexical) {
  ------------------
  |  Branch (33255:25): [True: 34, False: 0]
  ------------------
33256|     34|                        dbuf_putc(bc, OP_get_var_ref_check);
33257|     34|                    } else {
33258|      0|                        dbuf_putc(bc, OP_get_var_ref);
33259|      0|                    }
33260|     34|                }
33261|     34|                dbuf_put_u16(bc, idx);
33262|     34|                break;
33263|      0|            case OP_scope_delete_var:
  ------------------
  |  Branch (33263:13): [True: 0, False: 34]
  ------------------
33264|      0|                dbuf_putc(bc, OP_push_false);
33265|      0|                break;
33266|     34|            }
33267|     34|            goto done;
33268|     34|        }
33269|      0|    }
33270|       |
33271|    107|done:
33272|    107|    if (label_done >= 0) {
  ------------------
  |  Branch (33272:9): [True: 0, False: 107]
  ------------------
33273|      0|        dbuf_putc(bc, OP_label);
33274|      0|        dbuf_put_u32(bc, label_done);
33275|      0|        s->label_slots[label_done].pos2 = bc->size;
33276|      0|    }
33277|    107|    return pos_next;
33278|     88|}
quickjs.c:code_match:
33765|    290|{
33766|    290|    const uint8_t *tab = s->bc_buf;
33767|    290|    int op, len, op1, line_num, pos_next;
33768|    290|    va_list ap;
33769|    290|    BOOL ret = FALSE;
33770|       |
33771|    290|    line_num = -1;
33772|    290|    va_start(ap, pos);
33773|       |
33774|    380|    for(;;) {
33775|    380|        op1 = va_arg(ap, int);
33776|    380|        if (op1 == -1) {
  ------------------
  |  Branch (33776:13): [True: 56, False: 324]
  ------------------
33777|     56|            s->pos = pos;
33778|     56|            s->line_num = line_num;
33779|     56|            ret = TRUE;
33780|     56|            break;
33781|     56|        }
33782|    356|        for (;;) {
33783|    356|            if (pos >= s->bc_len)
  ------------------
  |  Branch (33783:17): [True: 0, False: 356]
  ------------------
33784|      0|                goto done;
33785|    356|            op = tab[pos];
33786|    356|            len = opcode_info[op].size;
33787|    356|            pos_next = pos + len;
33788|    356|            if (pos_next > s->bc_len)
  ------------------
  |  Branch (33788:17): [True: 0, False: 356]
  ------------------
33789|      0|                goto done;
33790|    356|            if (op == OP_line_num) {
  ------------------
  |  Branch (33790:17): [True: 32, False: 324]
  ------------------
33791|     32|                line_num = get_u32(tab + pos + 1);
33792|     32|                pos = pos_next;
33793|    324|            } else {
33794|    324|                break;
33795|    324|            }
33796|    356|        }
33797|    324|        if (op != op1) {
  ------------------
  |  Branch (33797:13): [True: 241, False: 83]
  ------------------
33798|    241|            if (op1 == (uint8_t)op1 || !op)
  ------------------
  |  Branch (33798:17): [True: 177, False: 64]
  |  Branch (33798:40): [True: 0, False: 64]
  ------------------
33799|    177|                break;
33800|     64|            if (op != (uint8_t)op1
  ------------------
  |  Branch (33800:17): [True: 62, False: 2]
  ------------------
33801|     62|            &&  op != (uint8_t)(op1 >> 8)
  ------------------
  |  Branch (33801:17): [True: 62, False: 0]
  ------------------
33802|     62|            &&  op != (uint8_t)(op1 >> 16)
  ------------------
  |  Branch (33802:17): [True: 57, False: 5]
  ------------------
33803|     57|            &&  op != (uint8_t)(op1 >> 24)) {
  ------------------
  |  Branch (33803:17): [True: 57, False: 0]
  ------------------
33804|     57|                break;
33805|     57|            }
33806|      7|            s->op = op;
33807|      7|        }
33808|       |
33809|     90|        pos++;
33810|     90|        switch(opcode_info[op].fmt) {
33811|      0|        case OP_FMT_loc8:
  ------------------
  |  Branch (33811:9): [True: 0, False: 90]
  ------------------
33812|      0|        case OP_FMT_u8:
  ------------------
  |  Branch (33812:9): [True: 0, False: 90]
  ------------------
33813|      0|            {
33814|      0|                int idx = tab[pos];
33815|      0|                int arg = va_arg(ap, int);
33816|      0|                if (arg == -1) {
  ------------------
  |  Branch (33816:21): [True: 0, False: 0]
  ------------------
33817|      0|                    s->idx = idx;
33818|      0|                } else {
33819|      0|                    if (arg != idx)
  ------------------
  |  Branch (33819:25): [True: 0, False: 0]
  ------------------
33820|      0|                        goto done;
33821|      0|                }
33822|      0|                break;
33823|      0|            }
33824|      0|        case OP_FMT_u16:
  ------------------
  |  Branch (33824:9): [True: 0, False: 90]
  ------------------
33825|      0|        case OP_FMT_npop:
  ------------------
  |  Branch (33825:9): [True: 0, False: 90]
  ------------------
33826|     13|        case OP_FMT_loc:
  ------------------
  |  Branch (33826:9): [True: 13, False: 77]
  ------------------
33827|     18|        case OP_FMT_arg:
  ------------------
  |  Branch (33827:9): [True: 5, False: 85]
  ------------------
33828|     18|        case OP_FMT_var_ref:
  ------------------
  |  Branch (33828:9): [True: 0, False: 90]
  ------------------
33829|     18|            {
33830|     18|                int idx = get_u16(tab + pos);
33831|     18|                int arg = va_arg(ap, int);
33832|     18|                if (arg == -1) {
  ------------------
  |  Branch (33832:21): [True: 7, False: 11]
  ------------------
33833|      7|                    s->idx = idx;
33834|     11|                } else {
33835|     11|                    if (arg != idx)
  ------------------
  |  Branch (33835:25): [True: 0, False: 11]
  ------------------
33836|      0|                        goto done;
33837|     11|                }
33838|     18|                break;
33839|     18|            }
33840|     18|        case OP_FMT_i32:
  ------------------
  |  Branch (33840:9): [True: 0, False: 90]
  ------------------
33841|      0|        case OP_FMT_u32:
  ------------------
  |  Branch (33841:9): [True: 0, False: 90]
  ------------------
33842|      0|        case OP_FMT_label:
  ------------------
  |  Branch (33842:9): [True: 0, False: 90]
  ------------------
33843|      0|        case OP_FMT_const:
  ------------------
  |  Branch (33843:9): [True: 0, False: 90]
  ------------------
33844|      0|            {
33845|      0|                s->label = get_u32(tab + pos);
33846|      0|                break;
33847|      0|            }
33848|      0|        case OP_FMT_label_u16:
  ------------------
  |  Branch (33848:9): [True: 0, False: 90]
  ------------------
33849|      0|            {
33850|      0|                s->label = get_u32(tab + pos);
33851|      0|                s->val = get_u16(tab + pos + 4);
33852|      0|                break;
33853|      0|            }
33854|     34|        case OP_FMT_atom:
  ------------------
  |  Branch (33854:9): [True: 34, False: 56]
  ------------------
33855|     34|            {
33856|     34|                s->atom = get_u32(tab + pos);
33857|     34|                break;
33858|      0|            }
33859|      0|        case OP_FMT_atom_u8:
  ------------------
  |  Branch (33859:9): [True: 0, False: 90]
  ------------------
33860|      0|            {
33861|      0|                s->atom = get_u32(tab + pos);
33862|      0|                s->val = get_u8(tab + pos + 4);
33863|      0|                break;
33864|      0|            }
33865|      0|        case OP_FMT_atom_u16:
  ------------------
  |  Branch (33865:9): [True: 0, False: 90]
  ------------------
33866|      0|            {
33867|      0|                s->atom = get_u32(tab + pos);
33868|      0|                s->val = get_u16(tab + pos + 4);
33869|      0|                break;
33870|      0|            }
33871|      0|        case OP_FMT_atom_label_u8:
  ------------------
  |  Branch (33871:9): [True: 0, False: 90]
  ------------------
33872|      0|            {
33873|      0|                s->atom = get_u32(tab + pos);
33874|      0|                s->label = get_u32(tab + pos + 4);
33875|      0|                s->val = get_u8(tab + pos + 8);
33876|      0|                break;
33877|      0|            }
33878|     38|        default:
  ------------------
  |  Branch (33878:9): [True: 38, False: 52]
  ------------------
33879|     38|            break;
33880|     90|        }
33881|     90|        pos = pos_next;
33882|     90|    }
33883|    290| done:
33884|       |    va_end(ap);
33885|    290|    return ret;
33886|    290|}
quickjs.c:skip_dead_code:
33997|     82|{
33998|     82|    int op, len, label;
33999|       |
34000|    138|    for (; pos < bc_len; pos += len) {
  ------------------
  |  Branch (34000:12): [True: 93, False: 45]
  ------------------
34001|     93|        op = bc_buf[pos];
34002|     93|        len = opcode_info[op].size;
34003|     93|        if (op == OP_line_num) {
  ------------------
  |  Branch (34003:13): [True: 0, False: 93]
  ------------------
34004|      0|            *linep = get_u32(bc_buf + pos + 1);
34005|      0|        } else
34006|     93|        if (op == OP_label) {
  ------------------
  |  Branch (34006:13): [True: 37, False: 56]
  ------------------
34007|     37|            label = get_u32(bc_buf + pos + 1);
34008|     37|            if (update_label(s, label, 0) > 0)
  ------------------
  |  Branch (34008:17): [True: 37, False: 0]
  ------------------
34009|     37|                break;
34010|       |#if 0
34011|       |            if (s->label_slots[label].first_reloc) {
34012|       |                printf("line %d: unreferenced label %d:%d has relocations\n",
34013|       |                       *linep, label, s->label_slots[label].pos2);
34014|       |            }
34015|       |#endif
34016|     37|            assert(s->label_slots[label].first_reloc == NULL);
  ------------------
  |  Branch (34016:13): [True: 0, False: 0]
  |  Branch (34016:13): [True: 0, False: 0]
  ------------------
34017|     56|        } else {
34018|       |            /* XXX: output a warning for unreachable code? */
34019|     56|            JSAtom atom;
34020|     56|            switch(opcode_info[op].fmt) {
34021|      0|            case OP_FMT_label:
  ------------------
  |  Branch (34021:13): [True: 0, False: 56]
  ------------------
34022|      0|            case OP_FMT_label_u16:
  ------------------
  |  Branch (34022:13): [True: 0, False: 56]
  ------------------
34023|      0|                label = get_u32(bc_buf + pos + 1);
34024|      0|                update_label(s, label, -1);
34025|      0|                break;
34026|      0|            case OP_FMT_atom_label_u8:
  ------------------
  |  Branch (34026:13): [True: 0, False: 56]
  ------------------
34027|      0|            case OP_FMT_atom_label_u16:
  ------------------
  |  Branch (34027:13): [True: 0, False: 56]
  ------------------
34028|      0|                label = get_u32(bc_buf + pos + 5);
34029|      0|                update_label(s, label, -1);
34030|       |                /* fall thru */
34031|      0|            case OP_FMT_atom:
  ------------------
  |  Branch (34031:13): [True: 0, False: 56]
  ------------------
34032|      0|            case OP_FMT_atom_u8:
  ------------------
  |  Branch (34032:13): [True: 0, False: 56]
  ------------------
34033|      0|            case OP_FMT_atom_u16:
  ------------------
  |  Branch (34033:13): [True: 0, False: 56]
  ------------------
34034|      0|                atom = get_u32(bc_buf + pos + 1);
34035|      0|                JS_FreeAtom(s->ctx, atom);
34036|      0|                break;
34037|     56|            default:
  ------------------
  |  Branch (34037:13): [True: 56, False: 0]
  ------------------
34038|     56|                break;
34039|     56|            }
34040|     56|        }
34041|     93|    }
34042|     82|    return pos;
34043|     82|}
quickjs.c:instantiate_hoisted_definitions:
33889|     31|{
33890|     31|    int i, idx, label_next = -1;
33891|       |
33892|       |    /* add the hoisted functions in arguments and local variables */
33893|     35|    for(i = 0; i < s->arg_count; i++) {
  ------------------
  |  Branch (33893:16): [True: 4, False: 31]
  ------------------
33894|      4|        JSVarDef *vd = &s->args[i];
33895|      4|        if (vd->func_pool_idx >= 0) {
  ------------------
  |  Branch (33895:13): [True: 0, False: 4]
  ------------------
33896|      0|            dbuf_putc(bc, OP_fclosure);
33897|      0|            dbuf_put_u32(bc, vd->func_pool_idx);
33898|      0|            dbuf_putc(bc, OP_put_arg);
33899|      0|            dbuf_put_u16(bc, i);
33900|      0|        }
33901|      4|    }
33902|     51|    for(i = 0; i < s->var_count; i++) {
  ------------------
  |  Branch (33902:16): [True: 20, False: 31]
  ------------------
33903|     20|        JSVarDef *vd = &s->vars[i];
33904|     20|        if (vd->scope_level == 0 && vd->func_pool_idx >= 0) {
  ------------------
  |  Branch (33904:13): [True: 14, False: 6]
  |  Branch (33904:37): [True: 0, False: 14]
  ------------------
33905|      0|            dbuf_putc(bc, OP_fclosure);
33906|      0|            dbuf_put_u32(bc, vd->func_pool_idx);
33907|      0|            dbuf_putc(bc, OP_put_loc);
33908|      0|            dbuf_put_u16(bc, i);
33909|      0|        }
33910|     20|    }
33911|       |
33912|       |    /* the module global variables must be initialized before
33913|       |       evaluating the module so that the exported functions are
33914|       |       visible if there are cyclic module references */
33915|     31|    if (s->module) {
  ------------------
  |  Branch (33915:9): [True: 17, False: 14]
  ------------------
33916|     17|        label_next = new_label_fd(s);
33917|     17|        if (label_next < 0) {
  ------------------
  |  Branch (33917:13): [True: 0, False: 17]
  ------------------
33918|      0|            dbuf_set_error(bc);
33919|      0|            return;
33920|      0|        }
33921|       |        /* if 'this' is true, initialize the global variables and return */
33922|     17|        dbuf_putc(bc, OP_push_this);
33923|     17|        dbuf_putc(bc, OP_if_false);
33924|     17|        dbuf_put_u32(bc, label_next);
33925|     17|        update_label(s, label_next, 1);
33926|     17|        s->jump_size++;
33927|     17|    }
33928|       |
33929|       |    /* add the global variables (only happens if s->is_global_var is
33930|       |       true) */
33931|       |    /* XXX: inefficient, add a closure index in JSGlobalVar */
33932|     31|    for(i = 0; i < s->global_var_count; i++) {
  ------------------
  |  Branch (33932:16): [True: 0, False: 31]
  ------------------
33933|      0|        JSGlobalVar *hf = &s->global_vars[i];
33934|      0|        BOOL has_var_obj = FALSE;
33935|      0|        BOOL force_init = hf->force_init;
33936|       |        /* we are in an eval, so the closure contains all the
33937|       |           enclosing variables */
33938|       |        /* If the outer function has a variable environment,
33939|       |           create a property for the variable there */
33940|      0|        for(idx = 0; idx < s->closure_var_count; idx++) {
  ------------------
  |  Branch (33940:22): [True: 0, False: 0]
  ------------------
33941|      0|            JSClosureVar *cv = &s->closure_var[idx];
33942|      0|            if (cv->var_name == hf->var_name) {
  ------------------
  |  Branch (33942:17): [True: 0, False: 0]
  ------------------
33943|      0|                force_init = FALSE;
33944|      0|                goto closure_found;
33945|      0|            }
33946|      0|            if (cv->var_name == JS_ATOM__var_ ||
  ------------------
  |  Branch (33946:17): [True: 0, False: 0]
  ------------------
33947|      0|                cv->var_name == JS_ATOM__arg_var_) {
  ------------------
  |  Branch (33947:17): [True: 0, False: 0]
  ------------------
33948|      0|                dbuf_putc(bc, OP_get_var_ref);
33949|      0|                dbuf_put_u16(bc, idx);
33950|      0|                has_var_obj = TRUE;
33951|      0|                force_init = TRUE;
33952|      0|                goto closure_found;
33953|      0|            }
33954|      0|        }
33955|      0|        abort();
33956|      0|    closure_found:
33957|      0|        if (hf->cpool_idx >= 0 || force_init) {
  ------------------
  |  Branch (33957:13): [True: 0, False: 0]
  |  Branch (33957:35): [True: 0, False: 0]
  ------------------
33958|      0|            if (hf->cpool_idx >= 0) {
  ------------------
  |  Branch (33958:17): [True: 0, False: 0]
  ------------------
33959|      0|                dbuf_putc(bc, OP_fclosure);
33960|      0|                dbuf_put_u32(bc, hf->cpool_idx);
33961|      0|                if (hf->var_name == JS_ATOM__default_) {
  ------------------
  |  Branch (33961:21): [True: 0, False: 0]
  ------------------
33962|       |                    /* set default export function name */
33963|      0|                    dbuf_putc(bc, OP_set_name);
33964|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, JS_ATOM_default));
33965|      0|                }
33966|      0|            } else {
33967|      0|                dbuf_putc(bc, OP_undefined);
33968|      0|            }
33969|      0|            if (!has_var_obj) {
  ------------------
  |  Branch (33969:17): [True: 0, False: 0]
  ------------------
33970|      0|                dbuf_putc(bc, OP_put_var_ref);
33971|      0|                dbuf_put_u16(bc, idx);
33972|      0|            } else {
33973|      0|                dbuf_putc(bc, OP_define_field);
33974|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, hf->var_name));
33975|      0|                dbuf_putc(bc, OP_drop);
33976|      0|            }
33977|      0|        }
33978|      0|        JS_FreeAtom(ctx, hf->var_name);
33979|      0|    }
33980|       |
33981|     31|    if (s->module) {
  ------------------
  |  Branch (33981:9): [True: 17, False: 14]
  ------------------
33982|     17|        dbuf_putc(bc, OP_return_undef);
33983|       |
33984|     17|        dbuf_putc(bc, OP_label);
33985|     17|        dbuf_put_u32(bc, label_next);
33986|     17|        s->label_slots[label_next].pos2 = bc->size;
33987|     17|    }
33988|       |
33989|     31|    js_free(ctx, s->global_vars);
33990|       |    s->global_vars = NULL;
33991|     31|    s->global_var_count = 0;
33992|     31|    s->global_var_size = 0;
33993|     31|}
quickjs.c:resolve_labels:
34680|     31|{
34681|     31|    int pos, pos_next, bc_len, op, op1, len, i, line_num;
34682|     31|    const uint8_t *bc_buf;
34683|     31|    DynBuf bc_out;
34684|     31|    LabelSlot *label_slots, *ls;
34685|     31|    RelocEntry *re, *re_next;
34686|     31|    CodeContext cc;
34687|     31|    int label;
34688|     31|#if SHORT_OPCODES
34689|     31|    JumpSlot *jp;
34690|     31|#endif
34691|       |
34692|     31|    label_slots = s->label_slots;
34693|       |
34694|     31|    line_num = s->source_pos;
34695|       |
34696|     31|    cc.bc_buf = bc_buf = s->byte_code.buf;
34697|     31|    cc.bc_len = bc_len = s->byte_code.size;
34698|     31|    js_dbuf_bytecode_init(ctx, &bc_out);
34699|       |
34700|     31|#if SHORT_OPCODES
34701|     31|    if (s->jump_size) {
  ------------------
  |  Branch (34701:9): [True: 22, False: 9]
  ------------------
34702|     22|        s->jump_slots = js_mallocz(s->ctx, sizeof(*s->jump_slots) * s->jump_size);
34703|     22|        if (s->jump_slots == NULL)
  ------------------
  |  Branch (34703:13): [True: 0, False: 22]
  ------------------
34704|      0|            return -1;
34705|     22|    }
34706|     31|#endif
34707|       |    /* XXX: Should skip this phase if not generating SHORT_OPCODES */
34708|     31|    if (s->line_number_size && !s->strip_debug) {
  ------------------
  |  Branch (34708:9): [True: 27, False: 4]
  |  Branch (34708:32): [True: 27, False: 0]
  ------------------
34709|     27|        s->line_number_slots = js_mallocz(s->ctx, sizeof(*s->line_number_slots) * s->line_number_size);
34710|     27|        if (s->line_number_slots == NULL)
  ------------------
  |  Branch (34710:13): [True: 0, False: 27]
  ------------------
34711|      0|            return -1;
34712|     27|        s->line_number_last = s->source_pos;
34713|     27|        s->line_number_last_pc = 0;
34714|     27|    }
34715|       |
34716|       |    /* initialize the 'home_object' variable if needed */
34717|     31|    if (s->home_object_var_idx >= 0) {
  ------------------
  |  Branch (34717:9): [True: 0, False: 31]
  ------------------
34718|      0|        dbuf_putc(&bc_out, OP_special_object);
34719|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_HOME_OBJECT);
34720|      0|        put_short_code(&bc_out, OP_put_loc, s->home_object_var_idx);
34721|      0|    }
34722|       |    /* initialize the 'this.active_func' variable if needed */
34723|     31|    if (s->this_active_func_var_idx >= 0) {
  ------------------
  |  Branch (34723:9): [True: 0, False: 31]
  ------------------
34724|      0|        dbuf_putc(&bc_out, OP_special_object);
34725|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_THIS_FUNC);
34726|      0|        put_short_code(&bc_out, OP_put_loc, s->this_active_func_var_idx);
34727|      0|    }
34728|       |    /* initialize the 'new.target' variable if needed */
34729|     31|    if (s->new_target_var_idx >= 0) {
  ------------------
  |  Branch (34729:9): [True: 0, False: 31]
  ------------------
34730|      0|        dbuf_putc(&bc_out, OP_special_object);
34731|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_NEW_TARGET);
34732|      0|        put_short_code(&bc_out, OP_put_loc, s->new_target_var_idx);
34733|      0|    }
34734|       |    /* initialize the 'this' variable if needed. In a derived class
34735|       |       constructor, this is initially uninitialized. */
34736|     31|    if (s->this_var_idx >= 0) {
  ------------------
  |  Branch (34736:9): [True: 0, False: 31]
  ------------------
34737|      0|        if (s->is_derived_class_constructor) {
  ------------------
  |  Branch (34737:13): [True: 0, False: 0]
  ------------------
34738|      0|            dbuf_putc(&bc_out, OP_set_loc_uninitialized);
34739|      0|            dbuf_put_u16(&bc_out, s->this_var_idx);
34740|      0|        } else {
34741|      0|            dbuf_putc(&bc_out, OP_push_this);
34742|      0|            put_short_code(&bc_out, OP_put_loc, s->this_var_idx);
34743|      0|        }
34744|      0|    }
34745|       |    /* initialize the 'arguments' variable if needed */
34746|     31|    if (s->arguments_var_idx >= 0) {
  ------------------
  |  Branch (34746:9): [True: 0, False: 31]
  ------------------
34747|      0|        if ((s->js_mode & JS_MODE_STRICT) || !s->has_simple_parameter_list) {
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (34747:13): [True: 0, False: 0]
  |  Branch (34747:46): [True: 0, False: 0]
  ------------------
34748|      0|            dbuf_putc(&bc_out, OP_special_object);
34749|      0|            dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_ARGUMENTS);
34750|      0|        } else {
34751|      0|            dbuf_putc(&bc_out, OP_special_object);
34752|      0|            dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_MAPPED_ARGUMENTS);
34753|       |            /* the arguments are implicitly captured because
34754|       |               references to them are created with the 'argument'
34755|       |               object */
34756|      0|            for(i = 0; i < s->arg_count; i++)
  ------------------
  |  Branch (34756:24): [True: 0, False: 0]
  ------------------
34757|      0|                capture_var(s, &s->args[i]);
34758|      0|        }
34759|      0|        if (s->arguments_arg_idx >= 0)
  ------------------
  |  Branch (34759:13): [True: 0, False: 0]
  ------------------
34760|      0|            put_short_code(&bc_out, OP_set_loc, s->arguments_arg_idx);
34761|      0|        put_short_code(&bc_out, OP_put_loc, s->arguments_var_idx);
34762|      0|    }
34763|       |    /* initialize a reference to the current function if needed */
34764|     31|    if (s->func_var_idx >= 0) {
  ------------------
  |  Branch (34764:9): [True: 0, False: 31]
  ------------------
34765|      0|        dbuf_putc(&bc_out, OP_special_object);
34766|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_THIS_FUNC);
34767|      0|        put_short_code(&bc_out, OP_put_loc, s->func_var_idx);
34768|      0|    }
34769|       |    /* initialize the variable environment object if needed */
34770|     31|    if (s->var_object_idx >= 0) {
  ------------------
  |  Branch (34770:9): [True: 0, False: 31]
  ------------------
34771|      0|        dbuf_putc(&bc_out, OP_special_object);
34772|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_VAR_OBJECT);
34773|      0|        put_short_code(&bc_out, OP_put_loc, s->var_object_idx);
34774|      0|    }
34775|     31|    if (s->arg_var_object_idx >= 0) {
  ------------------
  |  Branch (34775:9): [True: 0, False: 31]
  ------------------
34776|      0|        dbuf_putc(&bc_out, OP_special_object);
34777|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_VAR_OBJECT);
34778|      0|        put_short_code(&bc_out, OP_put_loc, s->arg_var_object_idx);
34779|      0|    }
34780|       |
34781|    617|    for (pos = 0; pos < bc_len; pos = pos_next) {
  ------------------
  |  Branch (34781:19): [True: 586, False: 31]
  ------------------
34782|    586|        int val;
34783|    586|        op = bc_buf[pos];
34784|    586|        len = opcode_info[op].size;
34785|    586|        pos_next = pos + len;
34786|    586|        switch(op) {
34787|    154|        case OP_line_num:
  ------------------
  |  Branch (34787:9): [True: 154, False: 432]
  ------------------
34788|       |            /* line number info (for debug). We put it in a separate
34789|       |               compressed table to reduce memory usage and get better
34790|       |               performance */
34791|    154|            line_num = get_u32(bc_buf + pos + 1);
34792|    154|            break;
34793|       |
34794|     40|        case OP_label:
  ------------------
  |  Branch (34794:9): [True: 40, False: 546]
  ------------------
34795|     40|            {
34796|     40|                label = get_u32(bc_buf + pos + 1);
34797|     40|                assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34797:17): [True: 0, False: 40]
  |  Branch (34797:17): [True: 0, False: 0]
  |  Branch (34797:17): [True: 40, False: 0]
  |  Branch (34797:17): [True: 40, False: 0]
  ------------------
34798|     40|                ls = &label_slots[label];
34799|     40|                assert(ls->addr == -1);
  ------------------
  |  Branch (34799:17): [True: 0, False: 40]
  |  Branch (34799:17): [True: 40, False: 0]
  ------------------
34800|     40|                ls->addr = bc_out.size;
34801|       |                /* resolve the relocation entries */
34802|     64|                for(re = ls->first_reloc; re != NULL; re = re_next) {
  ------------------
  |  Branch (34802:43): [True: 24, False: 40]
  ------------------
34803|     24|                    int diff = ls->addr - re->addr;
34804|     24|                    re_next = re->next;
34805|     24|                    switch (re->size) {
  ------------------
  |  Branch (34805:29): [True: 24, False: 0]
  ------------------
34806|      0|                    case 4:
  ------------------
  |  Branch (34806:21): [True: 0, False: 24]
  ------------------
34807|      0|                        put_u32(bc_out.buf + re->addr, diff);
34808|      0|                        break;
34809|      0|                    case 2:
  ------------------
  |  Branch (34809:21): [True: 0, False: 24]
  ------------------
34810|      0|                        assert(diff == (int16_t)diff);
  ------------------
  |  Branch (34810:25): [True: 0, False: 0]
  |  Branch (34810:25): [True: 0, False: 0]
  ------------------
34811|      0|                        put_u16(bc_out.buf + re->addr, diff);
34812|      0|                        break;
34813|     24|                    case 1:
  ------------------
  |  Branch (34813:21): [True: 24, False: 0]
  ------------------
34814|     24|                        assert(diff == (int8_t)diff);
  ------------------
  |  Branch (34814:25): [True: 0, False: 24]
  |  Branch (34814:25): [True: 24, False: 0]
  ------------------
34815|     24|                        put_u8(bc_out.buf + re->addr, diff);
34816|     24|                        break;
34817|     24|                    }
34818|     24|                    js_free(ctx, re);
34819|     24|                }
34820|     40|                ls->first_reloc = NULL;
34821|     40|            }
34822|      0|            break;
34823|       |
34824|      5|        case OP_call:
  ------------------
  |  Branch (34824:9): [True: 5, False: 581]
  ------------------
34825|      8|        case OP_call_method:
  ------------------
  |  Branch (34825:9): [True: 3, False: 583]
  ------------------
34826|      8|            {
34827|       |                /* detect and transform tail calls */
34828|      8|                int argc;
34829|      8|                argc = get_u16(bc_buf + pos + 1);
34830|      8|                if (code_match(&cc, pos_next, OP_return, -1)) {
  ------------------
  |  Branch (34830:21): [True: 0, False: 8]
  ------------------
34831|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (34831:25): [True: 0, False: 0]
  ------------------
34832|      0|                    add_pc2line_info(s, bc_out.size, line_num);
34833|      0|                    put_short_code(&bc_out, op + 1, argc);
34834|      0|                    pos_next = skip_dead_code(s, bc_buf, bc_len, cc.pos, &line_num);
34835|      0|                    break;
34836|      0|                }
34837|      8|                add_pc2line_info(s, bc_out.size, line_num);
34838|      8|                put_short_code(&bc_out, op, argc);
34839|      8|                break;
34840|      8|            }
34841|      0|            goto no_change;
34842|       |
34843|     14|        case OP_return:
  ------------------
  |  Branch (34843:9): [True: 14, False: 572]
  ------------------
34844|     31|        case OP_return_undef:
  ------------------
  |  Branch (34844:9): [True: 17, False: 569]
  ------------------
34845|     48|        case OP_return_async:
  ------------------
  |  Branch (34845:9): [True: 17, False: 569]
  ------------------
34846|     48|        case OP_throw:
  ------------------
  |  Branch (34846:9): [True: 0, False: 586]
  ------------------
34847|     48|        case OP_throw_error:
  ------------------
  |  Branch (34847:9): [True: 0, False: 586]
  ------------------
34848|     48|            pos_next = skip_dead_code(s, bc_buf, bc_len, pos_next, &line_num);
34849|     48|            goto no_change;
34850|       |
34851|     13|        case OP_goto:
  ------------------
  |  Branch (34851:9): [True: 13, False: 573]
  ------------------
34852|     13|            label = get_u32(bc_buf + pos + 1);
34853|     13|        has_goto:
34854|     13|            if (OPTIMIZE) {
  ------------------
  |  |   50|     13|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 13, Folded]
  |  |  ------------------
  ------------------
34855|     13|                int line1 = -1;
34856|       |                /* Use custom matcher because multiple labels can follow */
34857|     13|                label = find_jump_target(s, label, &op1, &line1);
34858|     13|                if (code_has_label(&cc, pos_next, label)) {
  ------------------
  |  Branch (34858:21): [True: 6, False: 7]
  ------------------
34859|       |                    /* jump to next instruction: remove jump */
34860|      6|                    update_label(s, label, -1);
34861|      6|                    break;
34862|      6|                }
34863|      7|                if (op1 == OP_return || op1 == OP_return_undef || op1 == OP_throw) {
  ------------------
  |  Branch (34863:21): [True: 0, False: 7]
  |  Branch (34863:41): [True: 0, False: 7]
  |  Branch (34863:67): [True: 0, False: 7]
  ------------------
34864|       |                    /* jump to return/throw: remove jump, append return/throw */
34865|       |                    /* updating the line number obfuscates assembly listing */
34866|       |                    //if (line1 != -1) line_num = line1;
34867|      0|                    update_label(s, label, -1);
34868|      0|                    add_pc2line_info(s, bc_out.size, line_num);
34869|      0|                    dbuf_putc(&bc_out, op1);
34870|      0|                    pos_next = skip_dead_code(s, bc_buf, bc_len, pos_next, &line_num);
34871|      0|                    break;
34872|      0|                }
34873|       |                /* XXX: should duplicate single instructions followed by goto or return */
34874|       |                /* For example, can match one of these followed by return:
34875|       |                   push_i32 / push_const / push_atom_value / get_var /
34876|       |                   undefined / null / push_false / push_true / get_ref_value /
34877|       |                   get_loc / get_arg / get_var_ref
34878|       |                 */
34879|      7|            }
34880|      7|            goto has_label;
34881|       |
34882|      7|        case OP_gosub:
  ------------------
  |  Branch (34882:9): [True: 0, False: 586]
  ------------------
34883|      0|            label = get_u32(bc_buf + pos + 1);
34884|      0|            if (0 && OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
  |  Branch (34884:17): [Folded, False: 0]
  ------------------
34885|      0|                label = find_jump_target(s, label, &op1, NULL);
34886|      0|                if (op1 == OP_ret) {
  ------------------
  |  Branch (34886:21): [True: 0, False: 0]
  ------------------
34887|      0|                    update_label(s, label, -1);
34888|       |                    /* empty finally clause: remove gosub */
34889|      0|                    break;
34890|      0|                }
34891|      0|            }
34892|      0|            goto has_label;
34893|       |
34894|      0|        case OP_catch:
  ------------------
  |  Branch (34894:9): [True: 0, False: 586]
  ------------------
34895|      0|            label = get_u32(bc_buf + pos + 1);
34896|      0|            goto has_label;
34897|       |
34898|      2|        case OP_if_true:
  ------------------
  |  Branch (34898:9): [True: 2, False: 584]
  ------------------
34899|     22|        case OP_if_false:
  ------------------
  |  Branch (34899:9): [True: 20, False: 566]
  ------------------
34900|     22|            label = get_u32(bc_buf + pos + 1);
34901|     22|            if (OPTIMIZE) {
  ------------------
  |  |   50|     22|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 22, Folded]
  |  |  ------------------
  ------------------
34902|     22|                label = find_jump_target(s, label, &op1, NULL);
34903|       |                /* transform if_false/if_true(l1) label(l1) -> drop label(l1) */
34904|     22|                if (code_has_label(&cc, pos_next, label)) {
  ------------------
  |  Branch (34904:21): [True: 0, False: 22]
  ------------------
34905|      0|                    update_label(s, label, -1);
34906|      0|                    dbuf_putc(&bc_out, OP_drop);
34907|      0|                    break;
34908|      0|                }
34909|       |                /* transform if_false(l1) goto(l2) label(l1) -> if_false(l2) label(l1) */
34910|     22|                if (code_match(&cc, pos_next, OP_goto, -1)) {
  ------------------
  |  Branch (34910:21): [True: 0, False: 22]
  ------------------
34911|      0|                    int pos1 = cc.pos;
34912|      0|                    int line1 = cc.line_num;
34913|      0|                    if (code_has_label(&cc, pos1, label)) {
  ------------------
  |  Branch (34913:25): [True: 0, False: 0]
  ------------------
34914|      0|                        if (line1 != -1) line_num = line1;
  ------------------
  |  Branch (34914:29): [True: 0, False: 0]
  ------------------
34915|      0|                        pos_next = pos1;
34916|      0|                        update_label(s, label, -1);
34917|      0|                        label = cc.label;
34918|      0|                        op ^= OP_if_true ^ OP_if_false;
34919|      0|                    }
34920|      0|                }
34921|     22|            }
34922|     29|        has_label:
34923|     29|            add_pc2line_info(s, bc_out.size, line_num);
34924|     29|            if (op == OP_goto) {
  ------------------
  |  Branch (34924:17): [True: 7, False: 22]
  ------------------
34925|      7|                pos_next = skip_dead_code(s, bc_buf, bc_len, pos_next, &line_num);
34926|      7|            }
34927|     29|            assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34927:13): [True: 0, False: 29]
  |  Branch (34927:13): [True: 0, False: 0]
  |  Branch (34927:13): [True: 29, False: 0]
  |  Branch (34927:13): [True: 29, False: 0]
  ------------------
34928|     29|            ls = &label_slots[label];
34929|     29|#if SHORT_OPCODES
34930|     29|            jp = &s->jump_slots[s->jump_count++];
34931|     29|            jp->op = op;
34932|     29|            jp->size = 4;
34933|     29|            jp->pos = bc_out.size + 1;
34934|     29|            jp->label = label;
34935|       |
34936|     29|            if (ls->addr == -1) {
  ------------------
  |  Branch (34936:17): [True: 24, False: 5]
  ------------------
34937|     24|                int diff = ls->pos2 - pos - 1;
34938|     24|                if (diff < 128 && (op == OP_if_false || op == OP_if_true || op == OP_goto)) {
  ------------------
  |  Branch (34938:21): [True: 24, False: 0]
  |  Branch (34938:36): [True: 17, False: 7]
  |  Branch (34938:57): [True: 2, False: 5]
  |  Branch (34938:77): [True: 5, False: 0]
  ------------------
34939|     24|                    jp->size = 1;
34940|     24|                    jp->op = OP_if_false8 + (op - OP_if_false);
34941|     24|                    dbuf_putc(&bc_out, OP_if_false8 + (op - OP_if_false));
34942|     24|                    dbuf_putc(&bc_out, 0);
34943|     24|                    if (!add_reloc(ctx, ls, bc_out.size - 1, 1))
  ------------------
  |  Branch (34943:25): [True: 0, False: 24]
  ------------------
34944|      0|                        goto fail;
34945|     24|                    break;
34946|     24|                }
34947|      0|                if (diff < 32768 && op == OP_goto) {
  ------------------
  |  Branch (34947:21): [True: 0, False: 0]
  |  Branch (34947:37): [True: 0, False: 0]
  ------------------
34948|      0|                    jp->size = 2;
34949|      0|                    jp->op = OP_goto16;
34950|      0|                    dbuf_putc(&bc_out, OP_goto16);
34951|      0|                    dbuf_put_u16(&bc_out, 0);
34952|      0|                    if (!add_reloc(ctx, ls, bc_out.size - 2, 2))
  ------------------
  |  Branch (34952:25): [True: 0, False: 0]
  ------------------
34953|      0|                        goto fail;
34954|      0|                    break;
34955|      0|                }
34956|      5|            } else {
34957|      5|                int diff = ls->addr - bc_out.size - 1;
34958|      5|                if (diff == (int8_t)diff && (op == OP_if_false || op == OP_if_true || op == OP_goto)) {
  ------------------
  |  Branch (34958:21): [True: 5, False: 0]
  |  Branch (34958:46): [True: 3, False: 2]
  |  Branch (34958:67): [True: 0, False: 2]
  |  Branch (34958:87): [True: 2, False: 0]
  ------------------
34959|      5|                    jp->size = 1;
34960|      5|                    jp->op = OP_if_false8 + (op - OP_if_false);
34961|      5|                    dbuf_putc(&bc_out, OP_if_false8 + (op - OP_if_false));
34962|      5|                    dbuf_putc(&bc_out, diff);
34963|      5|                    break;
34964|      5|                }
34965|      0|                if (diff == (int16_t)diff && op == OP_goto) {
  ------------------
  |  Branch (34965:21): [True: 0, False: 0]
  |  Branch (34965:46): [True: 0, False: 0]
  ------------------
34966|      0|                    jp->size = 2;
34967|      0|                    jp->op = OP_goto16;
34968|      0|                    dbuf_putc(&bc_out, OP_goto16);
34969|      0|                    dbuf_put_u16(&bc_out, diff);
34970|      0|                    break;
34971|      0|                }
34972|      0|            }
34973|      0|#endif
34974|      0|            dbuf_putc(&bc_out, op);
34975|      0|            dbuf_put_u32(&bc_out, ls->addr - bc_out.size);
34976|      0|            if (ls->addr == -1) {
  ------------------
  |  Branch (34976:17): [True: 0, False: 0]
  ------------------
34977|       |                /* unresolved yet: create a new relocation entry */
34978|      0|                if (!add_reloc(ctx, ls, bc_out.size - 4, 4))
  ------------------
  |  Branch (34978:21): [True: 0, False: 0]
  ------------------
34979|      0|                    goto fail;
34980|      0|            }
34981|      0|            break;
34982|      0|        case OP_with_get_var:
  ------------------
  |  Branch (34982:9): [True: 0, False: 586]
  ------------------
34983|      0|        case OP_with_put_var:
  ------------------
  |  Branch (34983:9): [True: 0, False: 586]
  ------------------
34984|      0|        case OP_with_delete_var:
  ------------------
  |  Branch (34984:9): [True: 0, False: 586]
  ------------------
34985|      0|        case OP_with_make_ref:
  ------------------
  |  Branch (34985:9): [True: 0, False: 586]
  ------------------
34986|      0|        case OP_with_get_ref:
  ------------------
  |  Branch (34986:9): [True: 0, False: 586]
  ------------------
34987|      0|            {
34988|      0|                JSAtom atom;
34989|      0|                int is_with;
34990|       |
34991|      0|                atom = get_u32(bc_buf + pos + 1);
34992|      0|                label = get_u32(bc_buf + pos + 5);
34993|      0|                is_with = bc_buf[pos + 9];
34994|      0|                if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
34995|      0|                    label = find_jump_target(s, label, &op1, NULL);
34996|      0|                }
34997|      0|                assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34997:17): [True: 0, False: 0]
  |  Branch (34997:17): [True: 0, False: 0]
  |  Branch (34997:17): [True: 0, False: 0]
  |  Branch (34997:17): [True: 0, False: 0]
  ------------------
34998|      0|                ls = &label_slots[label];
34999|      0|                add_pc2line_info(s, bc_out.size, line_num);
35000|      0|#if SHORT_OPCODES
35001|      0|                jp = &s->jump_slots[s->jump_count++];
35002|      0|                jp->op = op;
35003|      0|                jp->size = 4;
35004|      0|                jp->pos = bc_out.size + 5;
35005|      0|                jp->label = label;
35006|      0|#endif
35007|      0|                dbuf_putc(&bc_out, op);
35008|      0|                dbuf_put_u32(&bc_out, atom);
35009|      0|                dbuf_put_u32(&bc_out, ls->addr - bc_out.size);
35010|      0|                if (ls->addr == -1) {
  ------------------
  |  Branch (35010:21): [True: 0, False: 0]
  ------------------
35011|       |                    /* unresolved yet: create a new relocation entry */
35012|      0|                    if (!add_reloc(ctx, ls, bc_out.size - 4, 4))
  ------------------
  |  Branch (35012:25): [True: 0, False: 0]
  ------------------
35013|      0|                        goto fail;
35014|      0|                }
35015|      0|                dbuf_putc(&bc_out, is_with);
35016|      0|            }
35017|      0|            break;
35018|       |
35019|     11|        case OP_drop:
  ------------------
  |  Branch (35019:9): [True: 11, False: 575]
  ------------------
35020|     11|            if (OPTIMIZE) {
  ------------------
  |  |   50|     11|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 11, Folded]
  |  |  ------------------
  ------------------
35021|       |                /* remove useless drops before return */
35022|     11|                if (code_match(&cc, pos_next, OP_return_undef, -1)) {
  ------------------
  |  Branch (35022:21): [True: 0, False: 11]
  ------------------
35023|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35023:25): [True: 0, False: 0]
  ------------------
35024|      0|                    break;
35025|      0|                }
35026|     11|            }
35027|     11|            goto no_change;
35028|       |
35029|     11|        case OP_null:
  ------------------
  |  Branch (35029:9): [True: 0, False: 586]
  ------------------
35030|      0|#if SHORT_OPCODES
35031|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35032|       |                /* transform null strict_eq into is_null */
35033|      0|                if (code_match(&cc, pos_next, OP_strict_eq, -1)) {
  ------------------
  |  Branch (35033:21): [True: 0, False: 0]
  ------------------
35034|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35034:25): [True: 0, False: 0]
  ------------------
35035|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35036|      0|                    dbuf_putc(&bc_out, OP_is_null);
35037|      0|                    pos_next = cc.pos;
35038|      0|                    break;
35039|      0|                }
35040|       |                /* transform null strict_neq if_false/if_true -> is_null if_true/if_false */
35041|      0|                if (code_match(&cc, pos_next, OP_strict_neq, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33760|      0|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35041:21): [True: 0, False: 0]
  ------------------
35042|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35042:25): [True: 0, False: 0]
  ------------------
35043|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35044|      0|                    dbuf_putc(&bc_out, OP_is_null);
35045|      0|                    pos_next = cc.pos;
35046|      0|                    label = cc.label;
35047|      0|                    op = cc.op ^ OP_if_false ^ OP_if_true;
35048|      0|                    goto has_label;
35049|      0|                }
35050|      0|            }
35051|      0|#endif
35052|       |            /* fall thru */
35053|      0|        case OP_push_false:
  ------------------
  |  Branch (35053:9): [True: 0, False: 586]
  ------------------
35054|      0|        case OP_push_true:
  ------------------
  |  Branch (35054:9): [True: 0, False: 586]
  ------------------
35055|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35056|      0|                val = (op == OP_push_true);
35057|      0|                if (code_match(&cc, pos_next, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33760|      0|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35057:21): [True: 0, False: 0]
  ------------------
35058|      0|                has_constant_test:
35059|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35059:25): [True: 0, False: 0]
  ------------------
35060|      0|                    if (val == cc.op - OP_if_false) {
  ------------------
  |  Branch (35060:25): [True: 0, False: 0]
  ------------------
35061|       |                        /* transform null if_false(l1) -> goto l1 */
35062|       |                        /* transform false if_false(l1) -> goto l1 */
35063|       |                        /* transform true if_true(l1) -> goto l1 */
35064|      0|                        pos_next = cc.pos;
35065|      0|                        op = OP_goto;
35066|      0|                        label = cc.label;
35067|      0|                        goto has_goto;
35068|      0|                    } else {
35069|       |                        /* transform null if_true(l1) -> nop */
35070|       |                        /* transform false if_true(l1) -> nop */
35071|       |                        /* transform true if_false(l1) -> nop */
35072|      0|                        pos_next = cc.pos;
35073|      0|                        update_label(s, cc.label, -1);
35074|      0|                        break;
35075|      0|                    }
35076|      0|                }
35077|      0|            }
35078|      0|            goto no_change;
35079|       |
35080|      7|        case OP_push_i32:
  ------------------
  |  Branch (35080:9): [True: 7, False: 579]
  ------------------
35081|      7|            if (OPTIMIZE) {
  ------------------
  |  |   50|      7|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 7, Folded]
  |  |  ------------------
  ------------------
35082|       |                /* transform i32(val) neg -> i32(-val) */
35083|      7|                val = get_i32(bc_buf + pos + 1);
35084|      7|                if ((val != INT32_MIN && val != 0)
  ------------------
  |  Branch (35084:22): [True: 7, False: 0]
  |  Branch (35084:42): [True: 5, False: 2]
  ------------------
35085|      5|                &&  code_match(&cc, pos_next, OP_neg, -1)) {
  ------------------
  |  Branch (35085:21): [True: 0, False: 5]
  ------------------
35086|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35086:25): [True: 0, False: 0]
  ------------------
35087|      0|                    if (code_match(&cc, cc.pos, OP_drop, -1)) {
  ------------------
  |  Branch (35087:25): [True: 0, False: 0]
  ------------------
35088|      0|                        if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35088:29): [True: 0, False: 0]
  ------------------
35089|      0|                    } else {
35090|      0|                        add_pc2line_info(s, bc_out.size, line_num);
35091|      0|                        push_short_int(&bc_out, -val);
35092|      0|                    }
35093|      0|                    pos_next = cc.pos;
35094|      0|                    break;
35095|      0|                }
35096|       |                /* remove push/drop pairs generated by the parser */
35097|      7|                if (code_match(&cc, pos_next, OP_drop, -1)) {
  ------------------
  |  Branch (35097:21): [True: 2, False: 5]
  ------------------
35098|      2|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35098:25): [True: 0, False: 2]
  ------------------
35099|      2|                    pos_next = cc.pos;
35100|      2|                    break;
35101|      2|                }
35102|       |                /* Optimize constant tests: `if (0)`, `if (1)`, `if (!0)`... */
35103|      5|                if (code_match(&cc, pos_next, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33760|      5|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35103:21): [True: 0, False: 5]
  ------------------
35104|      0|                    val = (val != 0);
35105|      0|                    goto has_constant_test;
35106|      0|                }
35107|      5|                add_pc2line_info(s, bc_out.size, line_num);
35108|      5|                push_short_int(&bc_out, val);
35109|      5|                break;
35110|      5|            }
35111|      0|            goto no_change;
35112|       |
35113|      0|        case OP_push_bigint_i32:
  ------------------
  |  Branch (35113:9): [True: 0, False: 586]
  ------------------
35114|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35115|       |                /* transform i32(val) neg -> i32(-val) */
35116|      0|                val = get_i32(bc_buf + pos + 1);
35117|      0|                if (val != INT32_MIN
  ------------------
  |  Branch (35117:21): [True: 0, False: 0]
  ------------------
35118|      0|                &&  code_match(&cc, pos_next, OP_neg, -1)) {
  ------------------
  |  Branch (35118:21): [True: 0, False: 0]
  ------------------
35119|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35119:25): [True: 0, False: 0]
  ------------------
35120|      0|                    if (code_match(&cc, cc.pos, OP_drop, -1)) {
  ------------------
  |  Branch (35120:25): [True: 0, False: 0]
  ------------------
35121|      0|                        if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35121:29): [True: 0, False: 0]
  ------------------
35122|      0|                    } else {
35123|      0|                        add_pc2line_info(s, bc_out.size, line_num);
35124|      0|                        dbuf_putc(&bc_out, OP_push_bigint_i32);
35125|      0|                        dbuf_put_u32(&bc_out, -val);
35126|      0|                    }
35127|      0|                    pos_next = cc.pos;
35128|      0|                    break;
35129|      0|                }
35130|      0|            }
35131|      0|            goto no_change;
35132|       |
35133|      0|#if SHORT_OPCODES
35134|     13|        case OP_push_const:
  ------------------
  |  Branch (35134:9): [True: 13, False: 573]
  ------------------
35135|     15|        case OP_fclosure:
  ------------------
  |  Branch (35135:9): [True: 2, False: 584]
  ------------------
35136|     15|            if (OPTIMIZE) {
  ------------------
  |  |   50|     15|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 15, Folded]
  |  |  ------------------
  ------------------
35137|     15|                int idx = get_u32(bc_buf + pos + 1);
35138|     15|                if (idx < 256) {
  ------------------
  |  Branch (35138:21): [True: 15, False: 0]
  ------------------
35139|     15|                    add_pc2line_info(s, bc_out.size, line_num);
35140|     15|                    dbuf_putc(&bc_out, OP_push_const8 + op - OP_push_const);
35141|     15|                    dbuf_putc(&bc_out, idx);
35142|     15|                    break;
35143|     15|                }
35144|     15|            }
35145|      0|            goto no_change;
35146|       |
35147|      2|        case OP_get_field:
  ------------------
  |  Branch (35147:9): [True: 2, False: 584]
  ------------------
35148|      2|            if (OPTIMIZE) {
  ------------------
  |  |   50|      2|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 2, Folded]
  |  |  ------------------
  ------------------
35149|      2|                JSAtom atom = get_u32(bc_buf + pos + 1);
35150|      2|                if (atom == JS_ATOM_length) {
  ------------------
  |  Branch (35150:21): [True: 0, False: 2]
  ------------------
35151|      0|                    JS_FreeAtom(ctx, atom);
35152|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35153|      0|                    dbuf_putc(&bc_out, OP_get_length);
35154|      0|                    break;
35155|      0|                }
35156|      2|            }
35157|      2|            goto no_change;
35158|      2|#endif
35159|     10|        case OP_push_atom_value:
  ------------------
  |  Branch (35159:9): [True: 10, False: 576]
  ------------------
35160|     10|            if (OPTIMIZE) {
  ------------------
  |  |   50|     10|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 10, Folded]
  |  |  ------------------
  ------------------
35161|     10|                JSAtom atom = get_u32(bc_buf + pos + 1);
35162|       |                /* remove push/drop pairs generated by the parser */
35163|     10|                if (code_match(&cc, pos_next, OP_drop, -1)) {
  ------------------
  |  Branch (35163:21): [True: 0, False: 10]
  ------------------
35164|      0|                    JS_FreeAtom(ctx, atom);
35165|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35165:25): [True: 0, False: 0]
  ------------------
35166|      0|                    pos_next = cc.pos;
35167|      0|                    break;
35168|      0|                }
35169|     10|#if SHORT_OPCODES
35170|     10|                if (atom == JS_ATOM_empty_string) {
  ------------------
  |  Branch (35170:21): [True: 2, False: 8]
  ------------------
35171|      2|                    JS_FreeAtom(ctx, atom);
35172|      2|                    add_pc2line_info(s, bc_out.size, line_num);
35173|      2|                    dbuf_putc(&bc_out, OP_push_empty_string);
35174|      2|                    break;
35175|      2|                }
35176|     10|#endif
35177|     10|            }
35178|      8|            goto no_change;
35179|       |
35180|      8|        case OP_to_propkey:
  ------------------
  |  Branch (35180:9): [True: 0, False: 586]
  ------------------
35181|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35182|       |                /* remove redundant to_propkey opcodes when storing simple data */
35183|      0|                if (code_match(&cc, pos_next, M3(OP_get_loc, OP_get_arg, OP_get_var_ref), -1, OP_put_array_el, -1)
  ------------------
  |  |33761|      0|#define M3(op1, op2, op3)       ((op1) | ((op2) << 8) | ((op3) << 16))
  ------------------
  |  Branch (35183:21): [True: 0, False: 0]
  ------------------
35184|      0|                ||  code_match(&cc, pos_next, M3(OP_push_i32, OP_push_const, OP_push_atom_value), OP_put_array_el, -1)
  ------------------
  |  |33761|      0|#define M3(op1, op2, op3)       ((op1) | ((op2) << 8) | ((op3) << 16))
  ------------------
  |  Branch (35184:21): [True: 0, False: 0]
  ------------------
35185|      0|                ||  code_match(&cc, pos_next, M4(OP_undefined, OP_null, OP_push_true, OP_push_false), OP_put_array_el, -1)) {
  ------------------
  |  |33762|      0|#define M4(op1, op2, op3, op4)  ((op1) | ((op2) << 8) | ((op3) << 16) | ((op4) << 24))
  ------------------
  |  Branch (35185:21): [True: 0, False: 0]
  ------------------
35186|      0|                    break;
35187|      0|                }
35188|      0|            }
35189|      0|            goto no_change;
35190|       |
35191|     22|        case OP_undefined:
  ------------------
  |  Branch (35191:9): [True: 22, False: 564]
  ------------------
35192|     22|            if (OPTIMIZE) {
  ------------------
  |  |   50|     22|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 22, Folded]
  |  |  ------------------
  ------------------
35193|       |                /* remove push/drop pairs generated by the parser */
35194|     22|                if (code_match(&cc, pos_next, OP_drop, -1)) {
  ------------------
  |  Branch (35194:21): [True: 0, False: 22]
  ------------------
35195|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35195:25): [True: 0, False: 0]
  ------------------
35196|      0|                    pos_next = cc.pos;
35197|      0|                    break;
35198|      0|                }
35199|       |                /* transform undefined return -> return_undefined */
35200|     22|                if (code_match(&cc, pos_next, OP_return, -1)) {
  ------------------
  |  Branch (35200:21): [True: 0, False: 22]
  ------------------
35201|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35201:25): [True: 0, False: 0]
  ------------------
35202|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35203|      0|                    dbuf_putc(&bc_out, OP_return_undef);
35204|      0|                    pos_next = cc.pos;
35205|      0|                    break;
35206|      0|                }
35207|       |                /* transform undefined if_true(l1)/if_false(l1) -> nop/goto(l1) */
35208|     22|                if (code_match(&cc, pos_next, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33760|     22|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35208:21): [True: 0, False: 22]
  ------------------
35209|      0|                    val = 0;
35210|      0|                    goto has_constant_test;
35211|      0|                }
35212|     22|#if SHORT_OPCODES
35213|       |                /* transform undefined strict_eq -> is_undefined */
35214|     22|                if (code_match(&cc, pos_next, OP_strict_eq, -1)) {
  ------------------
  |  Branch (35214:21): [True: 2, False: 20]
  ------------------
35215|      2|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35215:25): [True: 0, False: 2]
  ------------------
35216|      2|                    add_pc2line_info(s, bc_out.size, line_num);
35217|      2|                    dbuf_putc(&bc_out, OP_is_undefined);
35218|      2|                    pos_next = cc.pos;
35219|      2|                    break;
35220|      2|                }
35221|       |                /* transform undefined strict_neq if_false/if_true -> is_undefined if_true/if_false */
35222|     20|                if (code_match(&cc, pos_next, OP_strict_neq, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33760|     20|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35222:21): [True: 0, False: 20]
  ------------------
35223|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35223:25): [True: 0, False: 0]
  ------------------
35224|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35225|      0|                    dbuf_putc(&bc_out, OP_is_undefined);
35226|      0|                    pos_next = cc.pos;
35227|      0|                    label = cc.label;
35228|      0|                    op = cc.op ^ OP_if_false ^ OP_if_true;
35229|      0|                    goto has_label;
35230|      0|                }
35231|     20|#endif
35232|     20|            }
35233|     20|            goto no_change;
35234|       |
35235|     34|        case OP_insert2:
  ------------------
  |  Branch (35235:9): [True: 34, False: 552]
  ------------------
35236|     34|            if (OPTIMIZE) {
  ------------------
  |  |   50|     34|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 34, Folded]
  |  |  ------------------
  ------------------
35237|       |                /* Transformation:
35238|       |                   insert2 put_field(a) drop -> put_field(a)
35239|       |                */
35240|     34|                if (code_match(&cc, pos_next, OP_put_field, OP_drop, -1)) {
  ------------------
  |  Branch (35240:21): [True: 34, False: 0]
  ------------------
35241|     34|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35241:25): [True: 0, False: 34]
  ------------------
35242|     34|                    add_pc2line_info(s, bc_out.size, line_num);
35243|     34|                    dbuf_putc(&bc_out, OP_put_field);
35244|     34|                    dbuf_put_u32(&bc_out, cc.atom);
35245|     34|                    pos_next = cc.pos;
35246|     34|                    break;
35247|     34|                }
35248|     34|            }
35249|      0|            goto no_change;
35250|       |
35251|     14|        case OP_dup:
  ------------------
  |  Branch (35251:9): [True: 14, False: 572]
  ------------------
35252|     14|            if (OPTIMIZE) {
  ------------------
  |  |   50|     14|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 14, Folded]
  |  |  ------------------
  ------------------
35253|       |                /* Transformation: dup put_x(n) drop -> put_x(n) */
35254|     14|                int op1, line2 = -1;
35255|       |                /* Transformation: dup put_x(n) -> set_x(n) */
35256|     14|                if (code_match(&cc, pos_next, M4(OP_put_loc, OP_put_loc_check, OP_put_arg, OP_put_var_ref), -1, -1)) {
  ------------------
  |  |33762|     14|#define M4(op1, op2, op3, op4)  ((op1) | ((op2) << 8) | ((op3) << 16) | ((op4) << 24))
  ------------------
  |  Branch (35256:21): [True: 7, False: 7]
  ------------------
35257|      7|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35257:25): [True: 0, False: 7]
  ------------------
35258|      7|                    op1 = cc.op + 1;  /* put_x -> set_x */
35259|      7|                    pos_next = cc.pos;
35260|      7|                    if (code_match(&cc, cc.pos, OP_drop, -1)) {
  ------------------
  |  Branch (35260:25): [True: 0, False: 7]
  ------------------
35261|      0|                        if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35261:29): [True: 0, False: 0]
  ------------------
35262|      0|                        op1 -= 1; /* set_x drop -> put_x */
35263|      0|                        pos_next = cc.pos;
35264|      0|                        if (code_match(&cc, cc.pos, op1 - 1, cc.idx, -1)) {
  ------------------
  |  Branch (35264:29): [True: 0, False: 0]
  ------------------
35265|      0|                            line2 = cc.line_num; /* delay line number update */
35266|      0|                            op1 += 1;   /* put_x(n) get_x(n) -> set_x(n) */
35267|      0|                            pos_next = cc.pos;
35268|      0|                        }
35269|      0|                    }
35270|      7|                    add_pc2line_info(s, bc_out.size, line_num);
35271|      7|                    put_short_code(&bc_out, op1, cc.idx);
35272|      7|                    if (line2 >= 0) line_num = line2;
  ------------------
  |  Branch (35272:25): [True: 0, False: 7]
  ------------------
35273|      7|                    break;
35274|      7|                }
35275|     14|            }
35276|      7|            goto no_change;
35277|       |
35278|      7|        case OP_get_loc:
  ------------------
  |  Branch (35278:9): [True: 3, False: 583]
  ------------------
35279|      3|            if (OPTIMIZE) {
  ------------------
  |  |   50|      3|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 3, Folded]
  |  |  ------------------
  ------------------
35280|       |                /* transformation:
35281|       |                   get_loc(n) post_dec put_loc(n) drop -> dec_loc(n)
35282|       |                   get_loc(n) post_inc put_loc(n) drop -> inc_loc(n)
35283|       |                   get_loc(n) dec dup put_loc(n) drop -> dec_loc(n)
35284|       |                   get_loc(n) inc dup put_loc(n) drop -> inc_loc(n)
35285|       |                 */
35286|      3|                int idx;
35287|      3|                idx = get_u16(bc_buf + pos + 1);
35288|      3|                if (idx >= 256)
  ------------------
  |  Branch (35288:21): [True: 0, False: 3]
  ------------------
35289|      0|                    goto no_change;
35290|      3|                if (code_match(&cc, pos_next, M2(OP_post_dec, OP_post_inc), OP_put_loc, idx, OP_drop, -1) ||
  ------------------
  |  |33760|      3|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35290:21): [True: 0, False: 3]
  ------------------
35291|      3|                    code_match(&cc, pos_next, M2(OP_dec, OP_inc), OP_dup, OP_put_loc, idx, OP_drop, -1)) {
  ------------------
  |  |33760|      3|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35291:21): [True: 0, False: 3]
  ------------------
35292|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35292:25): [True: 0, False: 0]
  ------------------
35293|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35294|      0|                    dbuf_putc(&bc_out, (cc.op == OP_inc || cc.op == OP_post_inc) ? OP_inc_loc : OP_dec_loc);
  ------------------
  |  Branch (35294:41): [True: 0, False: 0]
  |  Branch (35294:60): [True: 0, False: 0]
  ------------------
35295|      0|                    dbuf_putc(&bc_out, idx);
35296|      0|                    pos_next = cc.pos;
35297|      0|                    break;
35298|      0|                }
35299|       |                /* transformation:
35300|       |                   get_loc(n) push_atom_value(x) add dup put_loc(n) drop -> push_atom_value(x) add_loc(n)
35301|       |                 */
35302|      3|                if (code_match(&cc, pos_next, OP_push_atom_value, OP_add, OP_dup, OP_put_loc, idx, OP_drop, -1)) {
  ------------------
  |  Branch (35302:21): [True: 0, False: 3]
  ------------------
35303|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35303:25): [True: 0, False: 0]
  ------------------
35304|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35305|      0|#if SHORT_OPCODES
35306|      0|                    if (cc.atom == JS_ATOM_empty_string) {
  ------------------
  |  Branch (35306:25): [True: 0, False: 0]
  ------------------
35307|      0|                        JS_FreeAtom(ctx, cc.atom);
35308|      0|                        dbuf_putc(&bc_out, OP_push_empty_string);
35309|      0|                    } else
35310|      0|#endif
35311|      0|                    {
35312|      0|                        dbuf_putc(&bc_out, OP_push_atom_value);
35313|      0|                        dbuf_put_u32(&bc_out, cc.atom);
35314|      0|                    }
35315|      0|                    dbuf_putc(&bc_out, OP_add_loc);
35316|      0|                    dbuf_putc(&bc_out, idx);
35317|      0|                    pos_next = cc.pos;
35318|      0|                    break;
35319|      0|                }
35320|       |                /* transformation:
35321|       |                   get_loc(n) push_i32(x) add dup put_loc(n) drop -> push_i32(x) add_loc(n)
35322|       |                 */
35323|      3|                if (code_match(&cc, pos_next, OP_push_i32, OP_add, OP_dup, OP_put_loc, idx, OP_drop, -1)) {
  ------------------
  |  Branch (35323:21): [True: 0, False: 3]
  ------------------
35324|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35324:25): [True: 0, False: 0]
  ------------------
35325|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35326|      0|                    push_short_int(&bc_out, cc.label);
35327|      0|                    dbuf_putc(&bc_out, OP_add_loc);
35328|      0|                    dbuf_putc(&bc_out, idx);
35329|      0|                    pos_next = cc.pos;
35330|      0|                    break;
35331|      0|                }
35332|       |                /* transformation: XXX: also do these:
35333|       |                   get_loc(n) get_loc(x) add dup put_loc(n) drop -> get_loc(x) add_loc(n)
35334|       |                   get_loc(n) get_arg(x) add dup put_loc(n) drop -> get_arg(x) add_loc(n)
35335|       |                   get_loc(n) get_var_ref(x) add dup put_loc(n) drop -> get_var_ref(x) add_loc(n)
35336|       |                 */
35337|      3|                if (code_match(&cc, pos_next, M3(OP_get_loc, OP_get_arg, OP_get_var_ref), -1, OP_add, OP_dup, OP_put_loc, idx, OP_drop, -1)) {
  ------------------
  |  |33761|      3|#define M3(op1, op2, op3)       ((op1) | ((op2) << 8) | ((op3) << 16))
  ------------------
  |  Branch (35337:21): [True: 0, False: 3]
  ------------------
35338|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35338:25): [True: 0, False: 0]
  ------------------
35339|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35340|      0|                    put_short_code(&bc_out, cc.op, cc.idx);
35341|      0|                    dbuf_putc(&bc_out, OP_add_loc);
35342|      0|                    dbuf_putc(&bc_out, idx);
35343|      0|                    pos_next = cc.pos;
35344|      0|                    break;
35345|      0|                }
35346|      3|                add_pc2line_info(s, bc_out.size, line_num);
35347|      3|                put_short_code(&bc_out, op, idx);
35348|      3|                break;
35349|      3|            }
35350|      0|            goto no_change;
35351|      0|#if SHORT_OPCODES
35352|      4|        case OP_get_arg:
  ------------------
  |  Branch (35352:9): [True: 4, False: 582]
  ------------------
35353|      4|        case OP_get_var_ref:
  ------------------
  |  Branch (35353:9): [True: 0, False: 586]
  ------------------
35354|      4|            if (OPTIMIZE) {
  ------------------
  |  |   50|      4|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 4, Folded]
  |  |  ------------------
  ------------------
35355|      4|                int idx;
35356|      4|                idx = get_u16(bc_buf + pos + 1);
35357|      4|                add_pc2line_info(s, bc_out.size, line_num);
35358|      4|                put_short_code(&bc_out, op, idx);
35359|      4|                break;
35360|      4|            }
35361|      0|            goto no_change;
35362|      0|#endif
35363|     30|        case OP_put_loc:
  ------------------
  |  Branch (35363:9): [True: 30, False: 556]
  ------------------
35364|     30|        case OP_put_loc_check:
  ------------------
  |  Branch (35364:9): [True: 0, False: 586]
  ------------------
35365|     30|        case OP_put_arg:
  ------------------
  |  Branch (35365:9): [True: 0, False: 586]
  ------------------
35366|     30|        case OP_put_var_ref:
  ------------------
  |  Branch (35366:9): [True: 0, False: 586]
  ------------------
35367|     30|            if (OPTIMIZE) {
  ------------------
  |  |   50|     30|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 30, Folded]
  |  |  ------------------
  ------------------
35368|       |                /* transformation: put_x(n) get_x(n) -> set_x(n) */
35369|     30|                int idx;
35370|     30|                idx = get_u16(bc_buf + pos + 1);
35371|     30|                if (code_match(&cc, pos_next, op - 1, idx, -1)) {
  ------------------
  |  Branch (35371:21): [True: 11, False: 19]
  ------------------
35372|     11|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35372:25): [True: 2, False: 9]
  ------------------
35373|     11|                    add_pc2line_info(s, bc_out.size, line_num);
35374|     11|                    put_short_code(&bc_out, op + 1, idx);
35375|     11|                    pos_next = cc.pos;
35376|     11|                    break;
35377|     11|                }
35378|     19|                add_pc2line_info(s, bc_out.size, line_num);
35379|     19|                put_short_code(&bc_out, op, idx);
35380|     19|                break;
35381|     30|            }
35382|      0|            goto no_change;
35383|       |
35384|      0|        case OP_post_inc:
  ------------------
  |  Branch (35384:9): [True: 0, False: 586]
  ------------------
35385|      0|        case OP_post_dec:
  ------------------
  |  Branch (35385:9): [True: 0, False: 586]
  ------------------
35386|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35387|       |                /* transformation:
35388|       |                   post_inc put_x drop -> inc put_x
35389|       |                   post_inc perm3 put_field drop -> inc put_field
35390|       |                   post_inc perm4 put_array_el drop -> inc put_array_el
35391|       |                 */
35392|      0|                int op1, idx;
35393|      0|                if (code_match(&cc, pos_next, M3(OP_put_loc, OP_put_arg, OP_put_var_ref), -1, OP_drop, -1)) {
  ------------------
  |  |33761|      0|#define M3(op1, op2, op3)       ((op1) | ((op2) << 8) | ((op3) << 16))
  ------------------
  |  Branch (35393:21): [True: 0, False: 0]
  ------------------
35394|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35394:25): [True: 0, False: 0]
  ------------------
35395|      0|                    op1 = cc.op;
35396|      0|                    idx = cc.idx;
35397|      0|                    pos_next = cc.pos;
35398|      0|                    if (code_match(&cc, cc.pos, op1 - 1, idx, -1)) {
  ------------------
  |  Branch (35398:25): [True: 0, False: 0]
  ------------------
35399|      0|                        if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35399:29): [True: 0, False: 0]
  ------------------
35400|      0|                        op1 += 1;   /* put_x(n) get_x(n) -> set_x(n) */
35401|      0|                        pos_next = cc.pos;
35402|      0|                    }
35403|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35404|      0|                    dbuf_putc(&bc_out, OP_dec + (op - OP_post_dec));
35405|      0|                    put_short_code(&bc_out, op1, idx);
35406|      0|                    break;
35407|      0|                }
35408|      0|                if (code_match(&cc, pos_next, OP_perm3, OP_put_field, OP_drop, -1)) {
  ------------------
  |  Branch (35408:21): [True: 0, False: 0]
  ------------------
35409|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35409:25): [True: 0, False: 0]
  ------------------
35410|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35411|      0|                    dbuf_putc(&bc_out, OP_dec + (op - OP_post_dec));
35412|      0|                    dbuf_putc(&bc_out, OP_put_field);
35413|      0|                    dbuf_put_u32(&bc_out, cc.atom);
35414|      0|                    pos_next = cc.pos;
35415|      0|                    break;
35416|      0|                }
35417|      0|                if (code_match(&cc, pos_next, OP_perm4, OP_put_array_el, OP_drop, -1)) {
  ------------------
  |  Branch (35417:21): [True: 0, False: 0]
  ------------------
35418|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35418:25): [True: 0, False: 0]
  ------------------
35419|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35420|      0|                    dbuf_putc(&bc_out, OP_dec + (op - OP_post_dec));
35421|      0|                    dbuf_putc(&bc_out, OP_put_array_el);
35422|      0|                    pos_next = cc.pos;
35423|      0|                    break;
35424|      0|                }
35425|      0|            }
35426|      0|            goto no_change;
35427|       |
35428|      0|#if SHORT_OPCODES
35429|      0|        case OP_typeof:
  ------------------
  |  Branch (35429:9): [True: 0, False: 586]
  ------------------
35430|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35431|       |                /* simplify typeof tests */
35432|      0|                if (code_match(&cc, pos_next, OP_push_atom_value, M4(OP_strict_eq, OP_strict_neq, OP_eq, OP_neq), -1)) {
  ------------------
  |  |33762|      0|#define M4(op1, op2, op3, op4)  ((op1) | ((op2) << 8) | ((op3) << 16) | ((op4) << 24))
  ------------------
  |  Branch (35432:21): [True: 0, False: 0]
  ------------------
35433|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35433:25): [True: 0, False: 0]
  ------------------
35434|      0|                    int op1 = (cc.op == OP_strict_eq || cc.op == OP_eq) ? OP_strict_eq : OP_strict_neq;
  ------------------
  |  Branch (35434:32): [True: 0, False: 0]
  |  Branch (35434:57): [True: 0, False: 0]
  ------------------
35435|      0|                    int op2 = -1;
35436|      0|                    switch (cc.atom) {
  ------------------
  |  Branch (35436:29): [True: 0, False: 0]
  ------------------
35437|      0|                    case JS_ATOM_undefined:
  ------------------
  |  Branch (35437:21): [True: 0, False: 0]
  ------------------
35438|      0|                        op2 = OP_typeof_is_undefined;
35439|      0|                        break;
35440|      0|                    case JS_ATOM_function:
  ------------------
  |  Branch (35440:21): [True: 0, False: 0]
  ------------------
35441|      0|                        op2 = OP_typeof_is_function;
35442|      0|                        break;
35443|      0|                    }
35444|      0|                    if (op2 >= 0) {
  ------------------
  |  Branch (35444:25): [True: 0, False: 0]
  ------------------
35445|       |                        /* transform typeof(s) == "<type>" into is_<type> */
35446|      0|                        if (op1 == OP_strict_eq) {
  ------------------
  |  Branch (35446:29): [True: 0, False: 0]
  ------------------
35447|      0|                            add_pc2line_info(s, bc_out.size, line_num);
35448|      0|                            dbuf_putc(&bc_out, op2);
35449|      0|                            JS_FreeAtom(ctx, cc.atom);
35450|      0|                            pos_next = cc.pos;
35451|      0|                            break;
35452|      0|                        }
35453|      0|                        if (op1 == OP_strict_neq && code_match(&cc, cc.pos, OP_if_false, -1)) {
  ------------------
  |  Branch (35453:29): [True: 0, False: 0]
  |  Branch (35453:53): [True: 0, False: 0]
  ------------------
35454|       |                            /* transform typeof(s) != "<type>" if_false into is_<type> if_true */
35455|      0|                            if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35455:33): [True: 0, False: 0]
  ------------------
35456|      0|                            add_pc2line_info(s, bc_out.size, line_num);
35457|      0|                            dbuf_putc(&bc_out, op2);
35458|      0|                            JS_FreeAtom(ctx, cc.atom);
35459|      0|                            pos_next = cc.pos;
35460|      0|                            label = cc.label;
35461|      0|                            op = OP_if_true;
35462|      0|                            goto has_label;
35463|      0|                        }
35464|      0|                    }
35465|      0|                }
35466|      0|            }
35467|      0|            goto no_change;
35468|      0|#endif
35469|       |
35470|    149|        default:
  ------------------
  |  Branch (35470:9): [True: 149, False: 437]
  ------------------
35471|    245|        no_change:
35472|    245|            add_pc2line_info(s, bc_out.size, line_num);
35473|    245|            dbuf_put(&bc_out, bc_buf + pos, len);
35474|    245|            break;
35475|    586|        }
35476|    586|    }
35477|       |
35478|       |    /* check that there were no missing labels */
35479|     71|    for(i = 0; i < s->label_count; i++) {
  ------------------
  |  Branch (35479:16): [True: 40, False: 31]
  ------------------
35480|     40|        assert(label_slots[i].first_reloc == NULL);
  ------------------
  |  Branch (35480:9): [True: 0, False: 40]
  |  Branch (35480:9): [True: 40, False: 0]
  ------------------
35481|     40|    }
35482|     31|#if SHORT_OPCODES
35483|     31|    if (OPTIMIZE) {
  ------------------
  |  |   50|     31|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 31, Folded]
  |  |  ------------------
  ------------------
35484|       |        /* more jump optimizations */
35485|     31|        int patch_offsets = 0;
35486|     60|        for (i = 0, jp = s->jump_slots; i < s->jump_count; i++, jp++) {
  ------------------
  |  Branch (35486:41): [True: 29, False: 31]
  ------------------
35487|     29|            LabelSlot *ls;
35488|     29|            JumpSlot *jp1;
35489|     29|            int j, pos, diff, delta;
35490|       |
35491|     29|            delta = 3;
35492|     29|            switch (op = jp->op) {
  ------------------
  |  Branch (35492:21): [True: 0, False: 29]
  ------------------
35493|      0|            case OP_goto16:
  ------------------
  |  Branch (35493:13): [True: 0, False: 29]
  ------------------
35494|      0|                delta = 1;
35495|       |                /* fall thru */
35496|      0|            case OP_if_false:
  ------------------
  |  Branch (35496:13): [True: 0, False: 29]
  ------------------
35497|      0|            case OP_if_true:
  ------------------
  |  Branch (35497:13): [True: 0, False: 29]
  ------------------
35498|      0|            case OP_goto:
  ------------------
  |  Branch (35498:13): [True: 0, False: 29]
  ------------------
35499|      0|                pos = jp->pos;
35500|      0|                diff = s->label_slots[jp->label].addr - pos;
35501|      0|                if (diff >= -128 && diff <= 127 + delta) {
  ------------------
  |  Branch (35501:21): [True: 0, False: 0]
  |  Branch (35501:37): [True: 0, False: 0]
  ------------------
35502|       |                    //put_u8(bc_out.buf + pos, diff);
35503|      0|                    jp->size = 1;
35504|      0|                    if (op == OP_goto16) {
  ------------------
  |  Branch (35504:25): [True: 0, False: 0]
  ------------------
35505|      0|                        bc_out.buf[pos - 1] = jp->op = OP_goto8;
35506|      0|                    } else {
35507|      0|                        bc_out.buf[pos - 1] = jp->op = OP_if_false8 + (op - OP_if_false);
35508|      0|                    }
35509|      0|                    goto shrink;
35510|      0|                } else
35511|      0|                if (diff == (int16_t)diff && op == OP_goto) {
  ------------------
  |  Branch (35511:21): [True: 0, False: 0]
  |  Branch (35511:46): [True: 0, False: 0]
  ------------------
35512|       |                    //put_u16(bc_out.buf + pos, diff);
35513|      0|                    jp->size = 2;
35514|      0|                    delta = 2;
35515|      0|                    bc_out.buf[pos - 1] = jp->op = OP_goto16;
35516|      0|                shrink:
35517|       |                    /* XXX: should reduce complexity, using 2 finger copy scheme */
35518|      0|                    memmove(bc_out.buf + pos + jp->size, bc_out.buf + pos + jp->size + delta,
35519|      0|                            bc_out.size - pos - jp->size - delta);
35520|      0|                    bc_out.size -= delta;
35521|      0|                    patch_offsets++;
35522|      0|                    for (j = 0, ls = s->label_slots; j < s->label_count; j++, ls++) {
  ------------------
  |  Branch (35522:54): [True: 0, False: 0]
  ------------------
35523|      0|                        if (ls->addr > pos)
  ------------------
  |  Branch (35523:29): [True: 0, False: 0]
  ------------------
35524|      0|                            ls->addr -= delta;
35525|      0|                    }
35526|      0|                    for (j = i + 1, jp1 = jp + 1; j < s->jump_count; j++, jp1++) {
  ------------------
  |  Branch (35526:51): [True: 0, False: 0]
  ------------------
35527|      0|                        if (jp1->pos > pos)
  ------------------
  |  Branch (35527:29): [True: 0, False: 0]
  ------------------
35528|      0|                            jp1->pos -= delta;
35529|      0|                    }
35530|      0|                    for (j = 0; j < s->line_number_count; j++) {
  ------------------
  |  Branch (35530:33): [True: 0, False: 0]
  ------------------
35531|      0|                        if (s->line_number_slots[j].pc > pos)
  ------------------
  |  Branch (35531:29): [True: 0, False: 0]
  ------------------
35532|      0|                            s->line_number_slots[j].pc -= delta;
35533|      0|                    }
35534|      0|                    continue;
35535|      0|                }
35536|      0|                break;
35537|     29|            }
35538|     29|        }
35539|     31|        if (patch_offsets) {
  ------------------
  |  Branch (35539:13): [True: 0, False: 31]
  ------------------
35540|      0|            JumpSlot *jp1;
35541|      0|            int j;
35542|      0|            for (j = 0, jp1 = s->jump_slots; j < s->jump_count; j++, jp1++) {
  ------------------
  |  Branch (35542:46): [True: 0, False: 0]
  ------------------
35543|      0|                int diff1 = s->label_slots[jp1->label].addr - jp1->pos;
35544|      0|                switch (jp1->size) {
  ------------------
  |  Branch (35544:25): [True: 0, False: 0]
  ------------------
35545|      0|                case 1:
  ------------------
  |  Branch (35545:17): [True: 0, False: 0]
  ------------------
35546|      0|                    put_u8(bc_out.buf + jp1->pos, diff1);
35547|      0|                    break;
35548|      0|                case 2:
  ------------------
  |  Branch (35548:17): [True: 0, False: 0]
  ------------------
35549|      0|                    put_u16(bc_out.buf + jp1->pos, diff1);
35550|      0|                    break;
35551|      0|                case 4:
  ------------------
  |  Branch (35551:17): [True: 0, False: 0]
  ------------------
35552|      0|                    put_u32(bc_out.buf + jp1->pos, diff1);
35553|      0|                    break;
35554|      0|                }
35555|      0|            }
35556|      0|        }
35557|     31|    }
35558|     31|    js_free(ctx, s->jump_slots);
35559|     31|    s->jump_slots = NULL;
35560|     31|#endif
35561|     31|    js_free(ctx, s->label_slots);
35562|     31|    s->label_slots = NULL;
35563|       |    /* XXX: should delay until copying to runtime bytecode function */
35564|     31|    compute_pc2line_info(s);
35565|     31|    js_free(ctx, s->line_number_slots);
35566|     31|    s->line_number_slots = NULL;
35567|       |    /* set the new byte code */
35568|     31|    dbuf_free(&s->byte_code);
35569|     31|    s->byte_code = bc_out;
35570|     31|    s->use_short_opcodes = TRUE;
35571|     31|    if (dbuf_error(&s->byte_code)) {
  ------------------
  |  Branch (35571:9): [True: 0, False: 31]
  ------------------
35572|      0|        JS_ThrowOutOfMemory(ctx);
35573|      0|        return -1;
35574|      0|    }
35575|     31|    return 0;
35576|      0| fail:
35577|       |    /* XXX: not safe */
35578|      0|    dbuf_free(&bc_out);
35579|      0|    return -1;
35580|     31|}
quickjs.c:put_short_code:
34621|     52|{
34622|     52|#if SHORT_OPCODES
34623|     52|    if (idx < 4) {
  ------------------
  |  Branch (34623:9): [True: 52, False: 0]
  ------------------
34624|     52|        switch (op) {
  ------------------
  |  Branch (34624:17): [True: 49, False: 3]
  ------------------
34625|      3|        case OP_get_loc:
  ------------------
  |  Branch (34625:9): [True: 3, False: 49]
  ------------------
34626|      3|            dbuf_putc(bc_out, OP_get_loc0 + idx);
34627|      3|            return;
34628|     19|        case OP_put_loc:
  ------------------
  |  Branch (34628:9): [True: 19, False: 33]
  ------------------
34629|     19|            dbuf_putc(bc_out, OP_put_loc0 + idx);
34630|     19|            return;
34631|     13|        case OP_set_loc:
  ------------------
  |  Branch (34631:9): [True: 13, False: 39]
  ------------------
34632|     13|            dbuf_putc(bc_out, OP_set_loc0 + idx);
34633|     13|            return;
34634|      4|        case OP_get_arg:
  ------------------
  |  Branch (34634:9): [True: 4, False: 48]
  ------------------
34635|      4|            dbuf_putc(bc_out, OP_get_arg0 + idx);
34636|      4|            return;
34637|      0|        case OP_put_arg:
  ------------------
  |  Branch (34637:9): [True: 0, False: 52]
  ------------------
34638|      0|            dbuf_putc(bc_out, OP_put_arg0 + idx);
34639|      0|            return;
34640|      5|        case OP_set_arg:
  ------------------
  |  Branch (34640:9): [True: 5, False: 47]
  ------------------
34641|      5|            dbuf_putc(bc_out, OP_set_arg0 + idx);
34642|      5|            return;
34643|      0|        case OP_get_var_ref:
  ------------------
  |  Branch (34643:9): [True: 0, False: 52]
  ------------------
34644|      0|            dbuf_putc(bc_out, OP_get_var_ref0 + idx);
34645|      0|            return;
34646|      0|        case OP_put_var_ref:
  ------------------
  |  Branch (34646:9): [True: 0, False: 52]
  ------------------
34647|      0|            dbuf_putc(bc_out, OP_put_var_ref0 + idx);
34648|      0|            return;
34649|      0|        case OP_set_var_ref:
  ------------------
  |  Branch (34649:9): [True: 0, False: 52]
  ------------------
34650|      0|            dbuf_putc(bc_out, OP_set_var_ref0 + idx);
34651|      0|            return;
34652|      5|        case OP_call:
  ------------------
  |  Branch (34652:9): [True: 5, False: 47]
  ------------------
34653|      5|            dbuf_putc(bc_out, OP_call0 + idx);
34654|      5|            return;
34655|     52|        }
34656|     52|    }
34657|      3|    if (idx < 256) {
  ------------------
  |  Branch (34657:9): [True: 3, False: 0]
  ------------------
34658|      3|        switch (op) {
  ------------------
  |  Branch (34658:17): [True: 0, False: 3]
  ------------------
34659|      0|        case OP_get_loc:
  ------------------
  |  Branch (34659:9): [True: 0, False: 3]
  ------------------
34660|      0|            dbuf_putc(bc_out, OP_get_loc8);
34661|      0|            dbuf_putc(bc_out, idx);
34662|      0|            return;
34663|      0|        case OP_put_loc:
  ------------------
  |  Branch (34663:9): [True: 0, False: 3]
  ------------------
34664|      0|            dbuf_putc(bc_out, OP_put_loc8);
34665|      0|            dbuf_putc(bc_out, idx);
34666|      0|            return;
34667|      0|        case OP_set_loc:
  ------------------
  |  Branch (34667:9): [True: 0, False: 3]
  ------------------
34668|      0|            dbuf_putc(bc_out, OP_set_loc8);
34669|      0|            dbuf_putc(bc_out, idx);
34670|      0|            return;
34671|      3|        }
34672|      3|    }
34673|      3|#endif
34674|      3|    dbuf_putc(bc_out, op);
34675|      3|    dbuf_put_u16(bc_out, idx);
34676|      3|}
quickjs.c:add_pc2line_info:
34431|    384|{
34432|    384|    if (s->line_number_slots != NULL
  ------------------
  |  Branch (34432:9): [True: 372, False: 12]
  ------------------
34433|    372|    &&  s->line_number_count < s->line_number_size
  ------------------
  |  Branch (34433:9): [True: 352, False: 20]
  ------------------
34434|    352|    &&  pc >= s->line_number_last_pc
  ------------------
  |  Branch (34434:9): [True: 352, False: 0]
  ------------------
34435|    352|    &&  source_pos != s->line_number_last) {
  ------------------
  |  Branch (34435:9): [True: 118, False: 234]
  ------------------
34436|    118|        s->line_number_slots[s->line_number_count].pc = pc;
34437|    118|        s->line_number_slots[s->line_number_count].source_pos = source_pos;
34438|    118|        s->line_number_count++;
34439|    118|        s->line_number_last_pc = pc;
34440|    118|        s->line_number_last = source_pos;
34441|    118|    }
34442|    384|}
quickjs.c:find_jump_target:
34545|     35|{
34546|     35|    int i, pos, op, label;
34547|       |
34548|     35|    label = label0;
34549|     35|    update_label(s, label, -1);
34550|     35|    for (i = 0; i < 10; i++) {
  ------------------
  |  Branch (34550:17): [True: 35, False: 0]
  ------------------
34551|     35|        assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34551:9): [True: 0, False: 35]
  |  Branch (34551:9): [True: 0, False: 0]
  |  Branch (34551:9): [True: 35, False: 0]
  |  Branch (34551:9): [True: 35, False: 0]
  ------------------
34552|     35|        pos = s->label_slots[label].pos2;
34553|     58|        for (;;) {
34554|     58|            switch(op = s->byte_code.buf[pos]) {
34555|     23|            case OP_line_num:
  ------------------
  |  Branch (34555:13): [True: 23, False: 35]
  ------------------
34556|     23|                if (pline)
  ------------------
  |  Branch (34556:21): [True: 5, False: 18]
  ------------------
34557|      5|                    *pline = get_u32(s->byte_code.buf + pos + 1);
34558|       |                /* fall thru */
34559|     23|            case OP_label:
  ------------------
  |  Branch (34559:13): [True: 0, False: 58]
  ------------------
34560|     23|                pos += opcode_info[op].size;
34561|     23|                continue;
34562|      0|            case OP_goto:
  ------------------
  |  Branch (34562:13): [True: 0, False: 58]
  ------------------
34563|      0|                label = get_u32(s->byte_code.buf + pos + 1);
34564|      0|                break;
34565|      2|            case OP_drop:
  ------------------
  |  Branch (34565:13): [True: 2, False: 56]
  ------------------
34566|       |                /* ignore drop opcodes if followed by OP_return_undef */
34567|      2|                while (s->byte_code.buf[++pos] == OP_drop)
  ------------------
  |  Branch (34567:24): [True: 0, False: 2]
  ------------------
34568|      0|                    continue;
34569|      2|                if (s->byte_code.buf[pos] == OP_return_undef)
  ------------------
  |  Branch (34569:21): [True: 0, False: 2]
  ------------------
34570|      0|                    op = OP_return_undef;
34571|       |                /* fall thru */
34572|     35|            default:
  ------------------
  |  Branch (34572:13): [True: 33, False: 25]
  ------------------
34573|     35|                goto done;
34574|     58|            }
34575|      0|            break;
34576|     58|        }
34577|     35|    }
34578|       |    /* cycle detected, could issue a warning */
34579|       |    /* XXX: the combination of find_jump_target() and skip_dead_code()
34580|       |       seems incorrect with cyclic labels. See for exemple:
34581|       |
34582|       |       for (;;) {
34583|       |       l:break l;
34584|       |       l:break l;
34585|       |       l:break l;
34586|       |       l:break l;
34587|       |       }
34588|       |
34589|       |       Avoiding changing the target is just a workaround and might not
34590|       |       suffice to completely fix the problem. */
34591|      0|    label = label0;
34592|     35| done:
34593|     35|    *pop = op;
34594|     35|    update_label(s, label, +1);
34595|     35|    return label;
34596|      0|}
quickjs.c:code_has_label:
34517|     35|{
34518|     45|    while (pos < s->bc_len) {
  ------------------
  |  Branch (34518:12): [True: 45, False: 0]
  ------------------
34519|     45|        int op = s->bc_buf[pos];
34520|     45|        if (op == OP_line_num) {
  ------------------
  |  Branch (34520:13): [True: 1, False: 44]
  ------------------
34521|      1|            pos += 5;
34522|      1|            continue;
34523|      1|        }
34524|     44|        if (op == OP_label) {
  ------------------
  |  Branch (34524:13): [True: 15, False: 29]
  ------------------
34525|     15|            int lab = get_u32(s->bc_buf + pos + 1);
34526|     15|            if (lab == label)
  ------------------
  |  Branch (34526:17): [True: 6, False: 9]
  ------------------
34527|      6|                return TRUE;
34528|      9|            pos += 5;
34529|      9|            continue;
34530|     15|        }
34531|     29|        if (op == OP_goto) {
  ------------------
  |  Branch (34531:13): [True: 0, False: 29]
  ------------------
34532|      0|            int lab = get_u32(s->bc_buf + pos + 1);
34533|      0|            if (lab == label)
  ------------------
  |  Branch (34533:17): [True: 0, False: 0]
  ------------------
34534|      0|                return TRUE;
34535|      0|        }
34536|     29|        break;
34537|     29|    }
34538|     29|    return FALSE;
34539|     35|}
quickjs.c:add_reloc:
34504|     24|{
34505|     24|    RelocEntry *re;
34506|     24|    re = js_malloc(ctx, sizeof(*re));
34507|     24|    if (!re)
  ------------------
  |  Branch (34507:9): [True: 0, False: 24]
  ------------------
34508|      0|        return NULL;
34509|     24|    re->addr = addr;
34510|     24|    re->size = size;
34511|     24|    re->next = ls->first_reloc;
34512|     24|    ls->first_reloc = re;
34513|     24|    return re;
34514|     24|}
quickjs.c:push_short_int:
34599|      5|{
34600|      5|#if SHORT_OPCODES
34601|      5|    if (val >= -1 && val <= 7) {
  ------------------
  |  Branch (34601:9): [True: 5, False: 0]
  |  Branch (34601:22): [True: 4, False: 1]
  ------------------
34602|      4|        dbuf_putc(bc_out, OP_push_0 + val);
34603|      4|        return;
34604|      4|    }
34605|      1|    if (val == (int8_t)val) {
  ------------------
  |  Branch (34605:9): [True: 1, False: 0]
  ------------------
34606|      1|        dbuf_putc(bc_out, OP_push_i8);
34607|      1|        dbuf_putc(bc_out, val);
34608|      1|        return;
34609|      1|    }
34610|      0|    if (val == (int16_t)val) {
  ------------------
  |  Branch (34610:9): [True: 0, False: 0]
  ------------------
34611|      0|        dbuf_putc(bc_out, OP_push_i16);
34612|      0|        dbuf_put_u16(bc_out, val);
34613|      0|        return;
34614|      0|    }
34615|      0|#endif
34616|      0|    dbuf_putc(bc_out, OP_push_i32);
34617|      0|    dbuf_put_u32(bc_out, val);
34618|      0|}
quickjs.c:compute_pc2line_info:
34451|     31|{
34452|     31|    if (!s->strip_debug) {
  ------------------
  |  Branch (34452:9): [True: 31, False: 0]
  ------------------
34453|     31|        int last_line_num, last_col_num;
34454|     31|        uint32_t last_pc = 0;
34455|     31|        int i, line_num, col_num;
34456|     31|        const uint8_t *buf_start = s->get_line_col_cache->buf_start;
34457|     31|        js_dbuf_init(s->ctx, &s->pc2line);
34458|       |
34459|     31|        last_line_num = get_line_col_cached(s->get_line_col_cache,
34460|     31|                                            &last_col_num,
34461|     31|                                            buf_start + s->source_pos);
34462|     31|        dbuf_put_leb128(&s->pc2line, last_line_num); /* line number minus 1 */
34463|     31|        dbuf_put_leb128(&s->pc2line, last_col_num); /* column number minus 1 */
34464|       |
34465|    149|        for (i = 0; i < s->line_number_count; i++) {
  ------------------
  |  Branch (34465:21): [True: 118, False: 31]
  ------------------
34466|    118|            uint32_t pc = s->line_number_slots[i].pc;
34467|    118|            uint32_t source_pos = s->line_number_slots[i].source_pos;
34468|    118|            int diff_pc, diff_line, diff_col;
34469|       |
34470|    118|            if (source_pos == -1)
  ------------------
  |  Branch (34470:17): [True: 0, False: 118]
  ------------------
34471|      0|                continue;
34472|    118|            diff_pc = pc - last_pc;
34473|    118|            if (diff_pc < 0)
  ------------------
  |  Branch (34473:17): [True: 0, False: 118]
  ------------------
34474|      0|                continue;
34475|       |
34476|    118|            line_num = get_line_col_cached(s->get_line_col_cache, &col_num,
34477|    118|                                           buf_start + source_pos);
34478|    118|            diff_line = line_num - last_line_num;
34479|    118|            diff_col = col_num - last_col_num;
34480|    118|            if (diff_line == 0 && diff_col == 0)
  ------------------
  |  Branch (34480:17): [True: 62, False: 56]
  |  Branch (34480:35): [True: 0, False: 62]
  ------------------
34481|      0|                continue;
34482|       |
34483|    118|            if (diff_line >= PC2LINE_BASE &&
  ------------------
  |  |  673|    236|#define PC2LINE_BASE     (-1)
  ------------------
  |  Branch (34483:17): [True: 114, False: 4]
  ------------------
34484|    114|                diff_line < PC2LINE_BASE + PC2LINE_RANGE &&
  ------------------
  |  |  673|    114|#define PC2LINE_BASE     (-1)
  ------------------
                              diff_line < PC2LINE_BASE + PC2LINE_RANGE &&
  ------------------
  |  |  674|    232|#define PC2LINE_RANGE    5
  ------------------
  |  Branch (34484:17): [True: 104, False: 10]
  ------------------
34485|    104|                diff_pc <= PC2LINE_DIFF_PC_MAX) {
  ------------------
  |  |  676|    104|#define PC2LINE_DIFF_PC_MAX ((255 - PC2LINE_OP_FIRST) / PC2LINE_RANGE)
  |  |  ------------------
  |  |  |  |  675|    104|#define PC2LINE_OP_FIRST 1
  |  |  ------------------
  |  |               #define PC2LINE_DIFF_PC_MAX ((255 - PC2LINE_OP_FIRST) / PC2LINE_RANGE)
  |  |  ------------------
  |  |  |  |  674|    104|#define PC2LINE_RANGE    5
  |  |  ------------------
  ------------------
  |  Branch (34485:17): [True: 104, False: 0]
  ------------------
34486|    104|                dbuf_putc(&s->pc2line, (diff_line - PC2LINE_BASE) +
  ------------------
  |  |  673|    104|#define PC2LINE_BASE     (-1)
  ------------------
34487|    104|                          diff_pc * PC2LINE_RANGE + PC2LINE_OP_FIRST);
  ------------------
  |  |  674|    104|#define PC2LINE_RANGE    5
  ------------------
                                        diff_pc * PC2LINE_RANGE + PC2LINE_OP_FIRST);
  ------------------
  |  |  675|    104|#define PC2LINE_OP_FIRST 1
  ------------------
34488|    104|            } else {
34489|       |                /* longer encoding */
34490|     14|                dbuf_putc(&s->pc2line, 0);
34491|     14|                dbuf_put_leb128(&s->pc2line, diff_pc);
34492|     14|                dbuf_put_sleb128(&s->pc2line, diff_line);
34493|     14|            }
34494|    118|            dbuf_put_sleb128(&s->pc2line, diff_col);
34495|       |                
34496|    118|            last_pc = pc;
34497|    118|            last_line_num = line_num;
34498|    118|            last_col_num = col_num;
34499|    118|        }
34500|     31|    }
34501|     31|}
quickjs.c:get_line_col_cached:
22184|    149|{
22185|    149|    int line_num, col_num;
22186|    149|    if (ptr >= s->ptr) {
  ------------------
  |  Branch (22186:9): [True: 136, False: 13]
  ------------------
22187|    136|        line_num = get_line_col(&col_num, s->ptr, ptr - s->ptr);
22188|    136|        if (line_num == 0) {
  ------------------
  |  Branch (22188:13): [True: 84, False: 52]
  ------------------
22189|     84|            s->col_num += col_num;
22190|     84|        } else {
22191|     52|            s->line_num += line_num;
22192|     52|            s->col_num = col_num;
22193|     52|        }
22194|    136|    } else {
22195|     13|        line_num = get_line_col(&col_num, ptr, s->ptr - ptr);
22196|     13|        if (line_num == 0) {
  ------------------
  |  Branch (22196:13): [True: 6, False: 7]
  ------------------
22197|      6|            s->col_num -= col_num;
22198|      7|        } else {
22199|      7|            const uint8_t *p;
22200|      7|            s->line_num -= line_num;
22201|       |            /* find the absolute column position */
22202|      7|            col_num = 0;
22203|    135|            for(p = ptr - 1; p >= s->buf_start; p--) {
  ------------------
  |  Branch (22203:30): [True: 131, False: 4]
  ------------------
22204|    131|                if (*p == '\n') {
  ------------------
  |  Branch (22204:21): [True: 3, False: 128]
  ------------------
22205|      3|                    break;
22206|    128|                } else if (*p < 0x80 || *p >= 0xc0) {
  ------------------
  |  Branch (22206:28): [True: 121, False: 7]
  |  Branch (22206:41): [True: 0, False: 7]
  ------------------
22207|    121|                    col_num++;
22208|    121|                }
22209|    131|            }
22210|      7|            s->col_num = col_num;
22211|      7|        }
22212|     13|    }
22213|    149|    s->ptr = ptr;
22214|    149|    *pcol_num = s->col_num;
22215|    149|    return s->line_num;
22216|    149|}
quickjs.c:compute_stack_size:
35639|     31|{
35640|     31|    StackSizeState s_s, *s = &s_s;
35641|     31|    int i, diff, n_pop, pos_next, stack_len, pos, op, catch_pos, catch_level;
35642|     31|    const JSOpCode *oi;
35643|     31|    const uint8_t *bc_buf;
35644|       |
35645|     31|    bc_buf = fd->byte_code.buf;
35646|     31|    s->bc_len = fd->byte_code.size;
35647|       |    /* bc_len > 0 */
35648|     31|    s->stack_level_tab = js_malloc(ctx, sizeof(s->stack_level_tab[0]) *
35649|     31|                                   s->bc_len);
35650|     31|    if (!s->stack_level_tab)
  ------------------
  |  Branch (35650:9): [True: 0, False: 31]
  ------------------
35651|      0|        return -1;
35652|    855|    for(i = 0; i < s->bc_len; i++)
  ------------------
  |  Branch (35652:16): [True: 824, False: 31]
  ------------------
35653|    824|        s->stack_level_tab[i] = 0xffff;
35654|     31|    s->pc_stack = NULL;
35655|     31|    s->catch_pos_tab = js_malloc(ctx, sizeof(s->catch_pos_tab[0]) *
35656|     31|                                   s->bc_len);
35657|     31|    if (!s->catch_pos_tab)
  ------------------
  |  Branch (35657:9): [True: 0, False: 31]
  ------------------
35658|      0|        goto fail;
35659|       |
35660|     31|    s->stack_len_max = 0;
35661|     31|    s->pc_stack_len = 0;
35662|     31|    s->pc_stack_size = 0;
35663|       |
35664|       |    /* breadth-first graph exploration */
35665|     31|    if (ss_check(ctx, s, 0, OP_invalid, 0, -1))
  ------------------
  |  Branch (35665:9): [True: 0, False: 31]
  ------------------
35666|      0|        goto fail;
35667|       |
35668|    415|    while (s->pc_stack_len > 0) {
  ------------------
  |  Branch (35668:12): [True: 384, False: 31]
  ------------------
35669|    384|        pos = s->pc_stack[--s->pc_stack_len];
35670|    384|        stack_len = s->stack_level_tab[pos];
35671|    384|        catch_pos = s->catch_pos_tab[pos];
35672|    384|        op = bc_buf[pos];
35673|    384|        if (op == 0 || op >= OP_COUNT) {
  ------------------
  |  Branch (35673:13): [True: 0, False: 384]
  |  Branch (35673:24): [True: 0, False: 384]
  ------------------
35674|      0|            JS_ThrowInternalError(ctx, "invalid opcode (op=%d, pc=%d)", op, pos);
35675|      0|            goto fail;
35676|      0|        }
35677|    384|        oi = &short_opcode_info(op);
  ------------------
  |  |22065|    384|    opcode_info[(op) >= OP_TEMP_START ? \
  |  |  ------------------
  |  |  |  Branch (22065:17): [True: 102, False: 282]
  |  |  ------------------
  |  |22066|    384|                (op) + (OP_TEMP_END - OP_TEMP_START) : (op)]
  ------------------
35678|       |#if defined(DUMP_BYTECODE) && (DUMP_BYTECODE & 64)
35679|       |        printf("%5d: %10s %5d %5d\n", pos, oi->name, stack_len, catch_pos);
35680|       |#endif
35681|    384|        pos_next = pos + oi->size;
35682|    384|        if (pos_next > s->bc_len) {
  ------------------
  |  Branch (35682:13): [True: 0, False: 384]
  ------------------
35683|      0|            JS_ThrowInternalError(ctx, "bytecode buffer overflow (op=%d, pc=%d)", op, pos);
35684|      0|            goto fail;
35685|      0|        }
35686|    384|        n_pop = oi->n_pop;
35687|       |        /* call pops a variable number of arguments */
35688|    384|        if (oi->fmt == OP_FMT_npop || oi->fmt == OP_FMT_npop_u16) {
  ------------------
  |  Branch (35688:13): [True: 3, False: 381]
  |  Branch (35688:39): [True: 0, False: 381]
  ------------------
35689|      3|            n_pop += get_u16(bc_buf + pos + 1);
35690|    381|        } else {
35691|    381|#if SHORT_OPCODES
35692|    381|            if (oi->fmt == OP_FMT_npopx) {
  ------------------
  |  Branch (35692:17): [True: 5, False: 376]
  ------------------
35693|      5|                n_pop += op - OP_call0;
35694|      5|            }
35695|    381|#endif
35696|    381|        }
35697|       |
35698|    384|        if (stack_len < n_pop) {
  ------------------
  |  Branch (35698:13): [True: 0, False: 384]
  ------------------
35699|      0|            JS_ThrowInternalError(ctx, "stack underflow (op=%d, pc=%d)", op, pos);
35700|      0|            goto fail;
35701|      0|        }
35702|    384|        stack_len += oi->n_push - n_pop;
35703|    384|        if (stack_len > s->stack_len_max) {
  ------------------
  |  Branch (35703:13): [True: 68, False: 316]
  ------------------
35704|     68|            s->stack_len_max = stack_len;
35705|     68|            if (s->stack_len_max > JS_STACK_SIZE_MAX) {
  ------------------
  |  |  211|     68|#define JS_STACK_SIZE_MAX 65534
  ------------------
  |  Branch (35705:17): [True: 0, False: 68]
  ------------------
35706|      0|                JS_ThrowInternalError(ctx, "stack overflow (op=%d, pc=%d)", op, pos);
35707|      0|                goto fail;
35708|      0|            }
35709|     68|        }
35710|    384|        switch(op) {
35711|      0|        case OP_tail_call:
  ------------------
  |  Branch (35711:9): [True: 0, False: 384]
  ------------------
35712|      0|        case OP_tail_call_method:
  ------------------
  |  Branch (35712:9): [True: 0, False: 384]
  ------------------
35713|     14|        case OP_return:
  ------------------
  |  Branch (35713:9): [True: 14, False: 370]
  ------------------
35714|     31|        case OP_return_undef:
  ------------------
  |  Branch (35714:9): [True: 17, False: 367]
  ------------------
35715|     48|        case OP_return_async:
  ------------------
  |  Branch (35715:9): [True: 17, False: 367]
  ------------------
35716|     48|        case OP_throw:
  ------------------
  |  Branch (35716:9): [True: 0, False: 384]
  ------------------
35717|     48|        case OP_throw_error:
  ------------------
  |  Branch (35717:9): [True: 0, False: 384]
  ------------------
35718|     48|        case OP_ret:
  ------------------
  |  Branch (35718:9): [True: 0, False: 384]
  ------------------
35719|     48|            goto done_insn;
35720|      0|        case OP_goto:
  ------------------
  |  Branch (35720:9): [True: 0, False: 384]
  ------------------
35721|      0|            diff = get_u32(bc_buf + pos + 1);
35722|      0|            pos_next = pos + 1 + diff;
35723|      0|            break;
35724|      0|#if SHORT_OPCODES
35725|      0|        case OP_goto16:
  ------------------
  |  Branch (35725:9): [True: 0, False: 384]
  ------------------
35726|      0|            diff = (int16_t)get_u16(bc_buf + pos + 1);
35727|      0|            pos_next = pos + 1 + diff;
35728|      0|            break;
35729|      7|        case OP_goto8:
  ------------------
  |  Branch (35729:9): [True: 7, False: 377]
  ------------------
35730|      7|            diff = (int8_t)bc_buf[pos + 1];
35731|      7|            pos_next = pos + 1 + diff;
35732|      7|            break;
35733|      2|        case OP_if_true8:
  ------------------
  |  Branch (35733:9): [True: 2, False: 382]
  ------------------
35734|     22|        case OP_if_false8:
  ------------------
  |  Branch (35734:9): [True: 20, False: 364]
  ------------------
35735|     22|            diff = (int8_t)bc_buf[pos + 1];
35736|     22|            if (ss_check(ctx, s, pos + 1 + diff, op, stack_len, catch_pos))
  ------------------
  |  Branch (35736:17): [True: 0, False: 22]
  ------------------
35737|      0|                goto fail;
35738|     22|            break;
35739|     22|#endif
35740|     22|        case OP_if_true:
  ------------------
  |  Branch (35740:9): [True: 0, False: 384]
  ------------------
35741|      0|        case OP_if_false:
  ------------------
  |  Branch (35741:9): [True: 0, False: 384]
  ------------------
35742|      0|            diff = get_u32(bc_buf + pos + 1);
35743|      0|            if (ss_check(ctx, s, pos + 1 + diff, op, stack_len, catch_pos))
  ------------------
  |  Branch (35743:17): [True: 0, False: 0]
  ------------------
35744|      0|                goto fail;
35745|      0|            break;
35746|      0|        case OP_gosub:
  ------------------
  |  Branch (35746:9): [True: 0, False: 384]
  ------------------
35747|      0|            diff = get_u32(bc_buf + pos + 1);
35748|      0|            if (ss_check(ctx, s, pos + 1 + diff, op, stack_len + 1, catch_pos))
  ------------------
  |  Branch (35748:17): [True: 0, False: 0]
  ------------------
35749|      0|                goto fail;
35750|      0|            break;
35751|      0|        case OP_with_get_var:
  ------------------
  |  Branch (35751:9): [True: 0, False: 384]
  ------------------
35752|      0|        case OP_with_delete_var:
  ------------------
  |  Branch (35752:9): [True: 0, False: 384]
  ------------------
35753|      0|            diff = get_u32(bc_buf + pos + 5);
35754|      0|            if (ss_check(ctx, s, pos + 5 + diff, op, stack_len + 1, catch_pos))
  ------------------
  |  Branch (35754:17): [True: 0, False: 0]
  ------------------
35755|      0|                goto fail;
35756|      0|            break;
35757|      0|        case OP_with_make_ref:
  ------------------
  |  Branch (35757:9): [True: 0, False: 384]
  ------------------
35758|      0|        case OP_with_get_ref:
  ------------------
  |  Branch (35758:9): [True: 0, False: 384]
  ------------------
35759|      0|            diff = get_u32(bc_buf + pos + 5);
35760|      0|            if (ss_check(ctx, s, pos + 5 + diff, op, stack_len + 2, catch_pos))
  ------------------
  |  Branch (35760:17): [True: 0, False: 0]
  ------------------
35761|      0|                goto fail;
35762|      0|            break;
35763|      0|        case OP_with_put_var:
  ------------------
  |  Branch (35763:9): [True: 0, False: 384]
  ------------------
35764|      0|            diff = get_u32(bc_buf + pos + 5);
35765|      0|            if (ss_check(ctx, s, pos + 5 + diff, op, stack_len - 1, catch_pos))
  ------------------
  |  Branch (35765:17): [True: 0, False: 0]
  ------------------
35766|      0|                goto fail;
35767|      0|            break;
35768|      0|        case OP_catch:
  ------------------
  |  Branch (35768:9): [True: 0, False: 384]
  ------------------
35769|      0|            diff = get_u32(bc_buf + pos + 1);
35770|      0|            if (ss_check(ctx, s, pos + 1 + diff, op, stack_len, catch_pos))
  ------------------
  |  Branch (35770:17): [True: 0, False: 0]
  ------------------
35771|      0|                goto fail;
35772|      0|            catch_pos = pos;
35773|      0|            break;
35774|      1|        case OP_for_of_start:
  ------------------
  |  Branch (35774:9): [True: 1, False: 383]
  ------------------
35775|      1|        case OP_for_await_of_start:
  ------------------
  |  Branch (35775:9): [True: 0, False: 384]
  ------------------
35776|      1|            catch_pos = pos;
35777|      1|            break;
35778|       |            /* we assume the catch offset entry is only removed with
35779|       |               some op codes */
35780|     11|        case OP_drop:
  ------------------
  |  Branch (35780:9): [True: 11, False: 373]
  ------------------
35781|     11|            catch_level = stack_len;
35782|     11|            goto check_catch;
35783|      0|        case OP_nip:
  ------------------
  |  Branch (35783:9): [True: 0, False: 384]
  ------------------
35784|      0|            catch_level = stack_len - 1;
35785|      0|            goto check_catch;
35786|      0|        case OP_nip1:
  ------------------
  |  Branch (35786:9): [True: 0, False: 384]
  ------------------
35787|      0|            catch_level = stack_len - 1;
35788|      0|            goto check_catch;
35789|      1|        case OP_iterator_close:
  ------------------
  |  Branch (35789:9): [True: 1, False: 383]
  ------------------
35790|      1|            catch_level = stack_len + 2;
35791|     12|        check_catch:
35792|       |            /* Note: for for_of_start/for_await_of_start we consider
35793|       |               the catch offset is on the first stack entry instead of
35794|       |               the thirst */
35795|     12|            if (catch_pos >= 0) {
  ------------------
  |  Branch (35795:17): [True: 2, False: 10]
  ------------------
35796|      2|                int level;
35797|      2|                level = s->stack_level_tab[catch_pos];
35798|      2|                if (bc_buf[catch_pos] != OP_catch)
  ------------------
  |  Branch (35798:21): [True: 2, False: 0]
  ------------------
35799|      2|                    level++; /* for_of_start, for_wait_of_start */
35800|       |                /* catch_level = stack_level before op_catch is executed ? */
35801|      2|                if (catch_level == level) {
  ------------------
  |  Branch (35801:21): [True: 1, False: 1]
  ------------------
35802|      1|                    catch_pos = s->catch_pos_tab[catch_pos];
35803|      1|                }
35804|      2|            }
35805|     12|            break;
35806|      0|        case OP_nip_catch:
  ------------------
  |  Branch (35806:9): [True: 0, False: 384]
  ------------------
35807|      0|            if (catch_pos < 0) {
  ------------------
  |  Branch (35807:17): [True: 0, False: 0]
  ------------------
35808|      0|                JS_ThrowInternalError(ctx, "nip_catch: no catch op (pc=%d)", pos);
35809|      0|                goto fail;
35810|      0|            }
35811|      0|            stack_len = s->stack_level_tab[catch_pos];
35812|      0|            if (bc_buf[catch_pos] != OP_catch)
  ------------------
  |  Branch (35812:17): [True: 0, False: 0]
  ------------------
35813|      0|                stack_len++; /* for_of_start, for_wait_of_start */
35814|      0|            stack_len++; /* no stack overflow is possible by construction */
35815|      0|            catch_pos = s->catch_pos_tab[catch_pos];
35816|      0|            break;
35817|    294|        default:
  ------------------
  |  Branch (35817:9): [True: 294, False: 90]
  ------------------
35818|    294|            break;
35819|    384|        }
35820|    336|        if (ss_check(ctx, s, pos_next, op, stack_len, catch_pos))
  ------------------
  |  Branch (35820:13): [True: 0, False: 336]
  ------------------
35821|      0|            goto fail;
35822|    384|    done_insn: ;
35823|    384|    }
35824|     31|    js_free(ctx, s->pc_stack);
35825|     31|    js_free(ctx, s->catch_pos_tab);
35826|     31|    js_free(ctx, s->stack_level_tab);
35827|     31|    *pstack_size = s->stack_len_max;
35828|     31|    return 0;
35829|      0| fail:
35830|      0|    js_free(ctx, s->pc_stack);
35831|      0|    js_free(ctx, s->catch_pos_tab);
35832|      0|    js_free(ctx, s->stack_level_tab);
35833|      0|    *pstack_size = 0;
35834|      0|    return -1;
35835|     31|}
quickjs.c:ss_check:
35597|    389|{
35598|    389|    if ((unsigned)pos >= s->bc_len) {
  ------------------
  |  Branch (35598:9): [True: 0, False: 389]
  ------------------
35599|      0|        JS_ThrowInternalError(ctx, "bytecode buffer overflow (op=%d, pc=%d)", op, pos);
35600|      0|        return -1;
35601|      0|    }
35602|    389|    if (stack_len > s->stack_len_max) {
  ------------------
  |  Branch (35602:9): [True: 0, False: 389]
  ------------------
35603|      0|        s->stack_len_max = stack_len;
35604|      0|        if (s->stack_len_max > JS_STACK_SIZE_MAX) {
  ------------------
  |  |  211|      0|#define JS_STACK_SIZE_MAX 65534
  ------------------
  |  Branch (35604:13): [True: 0, False: 0]
  ------------------
35605|      0|            JS_ThrowInternalError(ctx, "stack overflow (op=%d, pc=%d)", op, pos);
35606|      0|            return -1;
35607|      0|        }
35608|      0|    }
35609|    389|    if (s->stack_level_tab[pos] != 0xffff) {
  ------------------
  |  Branch (35609:9): [True: 5, False: 384]
  ------------------
35610|       |        /* already explored: check that the stack size is consistent */
35611|      5|        if (s->stack_level_tab[pos] != stack_len) {
  ------------------
  |  Branch (35611:13): [True: 0, False: 5]
  ------------------
35612|      0|            JS_ThrowInternalError(ctx, "inconsistent stack size: %d %d (pc=%d)",
35613|      0|                                  s->stack_level_tab[pos], stack_len, pos);
35614|      0|            return -1;
35615|      5|        } else if (s->catch_pos_tab[pos] != catch_pos) {
  ------------------
  |  Branch (35615:20): [True: 0, False: 5]
  ------------------
35616|      0|            JS_ThrowInternalError(ctx, "inconsistent catch position: %d %d (pc=%d)",
35617|      0|                                  s->catch_pos_tab[pos], catch_pos, pos);
35618|      0|            return -1;
35619|      5|        } else {
35620|      5|            return 0;
35621|      5|        }
35622|      5|    }
35623|       |
35624|       |    /* mark as explored and store the stack size */
35625|    384|    s->stack_level_tab[pos] = stack_len;
35626|    384|    s->catch_pos_tab[pos] = catch_pos;
35627|       |
35628|       |    /* queue the new PC to explore */
35629|    384|    if (js_resize_array(ctx, (void **)&s->pc_stack, sizeof(s->pc_stack[0]),
  ------------------
  |  Branch (35629:9): [True: 0, False: 384]
  ------------------
35630|    384|                        &s->pc_stack_size, s->pc_stack_len + 1))
35631|      0|        return -1;
35632|    384|    s->pc_stack[s->pc_stack_len++] = pos;
35633|    384|    return 0;
35634|    384|}
quickjs.c:JS_AddIntrinsicBasicObjects:
56153|     17|{
56154|     17|    JSValue obj;
56155|     17|    JSCFunctionType ft;
56156|     17|    int i;
56157|       |
56158|       |    /* warning: ordering is tricky */
56159|     17|    ctx->class_proto[JS_CLASS_OBJECT] =
56160|     17|        JS_NewObjectProtoClassAlloc(ctx, JS_NULL, JS_CLASS_OBJECT,
  ------------------
  |  |  290|     17|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56161|     17|                                    countof(js_object_proto_funcs) + 1);
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56162|     17|    if (JS_IsException(ctx->class_proto[JS_CLASS_OBJECT]))
  ------------------
  |  Branch (56162:9): [True: 0, False: 17]
  ------------------
56163|      0|        return -1;
56164|     17|    JS_SetImmutablePrototype(ctx, ctx->class_proto[JS_CLASS_OBJECT]);
56165|       |
56166|       |    /* 2 more properties: caller and arguments */
56167|     17|    ctx->function_proto = JS_NewCFunction3(ctx, js_function_proto, "", 0,
56168|     17|                                           JS_CFUNC_generic, 0,
56169|     17|                                           ctx->class_proto[JS_CLASS_OBJECT],
56170|     17|                                           countof(js_function_proto_funcs) + 3 + 2);
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56171|     17|    if (JS_IsException(ctx->function_proto))
  ------------------
  |  Branch (56171:9): [True: 0, False: 17]
  ------------------
56172|      0|        return -1;
56173|     17|    ctx->class_proto[JS_CLASS_BYTECODE_FUNCTION] = JS_DupValue(ctx, ctx->function_proto);
56174|       |
56175|     17|    ctx->global_obj = JS_NewObjectProtoClassAlloc(ctx, ctx->class_proto[JS_CLASS_OBJECT],
56176|     17|                                                  JS_CLASS_GLOBAL_OBJECT, 64);
56177|     17|    if (JS_IsException(ctx->global_obj))
  ------------------
  |  Branch (56177:9): [True: 0, False: 17]
  ------------------
56178|      0|        return -1;
56179|     17|    {
56180|     17|        JSObject *p;
56181|     17|        obj = JS_NewObjectProtoClassAlloc(ctx, JS_NULL, JS_CLASS_OBJECT, 4);
  ------------------
  |  |  290|     17|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56182|     17|        p = JS_VALUE_GET_OBJ(ctx->global_obj);
  ------------------
  |  |  229|     17|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     17|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
56183|     17|        p->u.global_object.uninitialized_vars = obj;
56184|     17|    }
56185|     17|    ctx->global_var_obj = JS_NewObjectProtoClassAlloc(ctx, JS_NULL,
  ------------------
  |  |  290|     17|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56186|     17|                                                      JS_CLASS_OBJECT, 16);
56187|     17|    if (JS_IsException(ctx->global_var_obj))
  ------------------
  |  Branch (56187:9): [True: 0, False: 17]
  ------------------
56188|      0|        return -1;
56189|       |
56190|       |    /* Error */
56191|     17|    ft.generic_magic = js_error_constructor;
56192|     17|    obj = JS_NewCConstructor(ctx, JS_CLASS_ERROR, "Error",
56193|     17|                                    ft.generic, 1, JS_CFUNC_constructor_or_func_magic, -1,
56194|     17|                                    JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56195|     17|                                    js_error_funcs, countof(js_error_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56196|     17|                                    js_error_proto_funcs, countof(js_error_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56197|     17|                                    0);
56198|     17|    if (JS_IsException(obj))
  ------------------
  |  Branch (56198:9): [True: 0, False: 17]
  ------------------
56199|      0|        return -1;
56200|       |
56201|    153|    for(i = 0; i < JS_NATIVE_ERROR_COUNT; i++) {
  ------------------
  |  Branch (56201:16): [True: 136, False: 17]
  ------------------
56202|    136|        JSValue func_obj;
56203|    136|        const JSCFunctionListEntry *funcs;
56204|    136|        int n_args;
56205|    136|        char buf[ATOM_GET_STR_BUF_SIZE];
56206|    136|        const char *name = JS_AtomGetStr(ctx, buf, sizeof(buf),
56207|    136|                                         JS_ATOM_EvalError + i);
56208|    136|        n_args = 1 + (i == JS_AGGREGATE_ERROR);
56209|    136|        funcs = js_native_error_proto_funcs + 2 * i;
56210|    136|        func_obj = JS_NewCConstructor(ctx, -1, name,
56211|    136|                                      ft.generic, n_args, JS_CFUNC_constructor_or_func_magic, i,
56212|    136|                                      obj,
56213|    136|                                      NULL, 0,
56214|    136|                                      funcs, 2,
56215|    136|                                      0);
56216|    136|        if (JS_IsException(func_obj)) {
  ------------------
  |  Branch (56216:13): [True: 0, False: 136]
  ------------------
56217|      0|            JS_FreeValue(ctx, obj);
56218|      0|            return -1;
56219|      0|        }
56220|    136|        ctx->native_error_proto[i] = JS_GetProperty(ctx, func_obj, JS_ATOM_prototype);
56221|    136|        JS_FreeValue(ctx, func_obj);
56222|    136|        if (JS_IsException(ctx->native_error_proto[i])) {
  ------------------
  |  Branch (56222:13): [True: 0, False: 136]
  ------------------
56223|      0|            JS_FreeValue(ctx, obj);
56224|      0|            return -1;
56225|      0|        }
56226|    136|    }
56227|     17|    JS_FreeValue(ctx, obj);
56228|       |
56229|       |    /* Array */
56230|     17|    obj = JS_NewCConstructor(ctx, JS_CLASS_ARRAY, "Array",
56231|     17|                                    js_array_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56232|     17|                                    JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56233|     17|                                    js_array_funcs, countof(js_array_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56234|     17|                                    js_array_proto_funcs, countof(js_array_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56235|     17|                                    JS_NEW_CTOR_PROTO_CLASS);
  ------------------
  |  |39686|     17|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
56236|     17|    if (JS_IsException(obj))
  ------------------
  |  Branch (56236:9): [True: 0, False: 17]
  ------------------
56237|      0|        return -1;
56238|     17|    ctx->array_ctor = obj;
56239|       |
56240|     17|    {
56241|     17|        JSObject *p = JS_VALUE_GET_OBJ(ctx->class_proto[JS_CLASS_ARRAY]);
  ------------------
  |  |  229|     17|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     17|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
56242|     17|        p->is_std_array_prototype = TRUE;
56243|     17|    }
56244|       |    
56245|     17|    ctx->array_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_ARRAY]),
56246|     17|                                     JS_PROP_INITIAL_HASH_SIZE, 1);
  ------------------
  |  |  966|     17|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
56247|     17|    if (!ctx->array_shape)
  ------------------
  |  Branch (56247:9): [True: 0, False: 17]
  ------------------
56248|      0|        return -1;
56249|     17|    if (add_shape_property(ctx, &ctx->array_shape, NULL,
  ------------------
  |  Branch (56249:9): [True: 0, False: 17]
  ------------------
56250|     17|                           JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_LENGTH))
  ------------------
  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_LENGTH))
  ------------------
  |  |  302|     17|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
56251|      0|        return -1;
56252|       |
56253|     17|    ctx->arguments_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_OBJECT]),
56254|     17|                                         JS_PROP_INITIAL_HASH_SIZE, 3);
  ------------------
  |  |  966|     17|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
56255|     17|    if (!ctx->arguments_shape)
  ------------------
  |  Branch (56255:9): [True: 0, False: 17]
  ------------------
56256|      0|        return -1;
56257|     17|    if (add_shape_property(ctx, &ctx->arguments_shape, NULL,
  ------------------
  |  Branch (56257:9): [True: 0, False: 17]
  ------------------
56258|     17|                           JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56259|      0|        return -1;
56260|     17|    if (add_shape_property(ctx, &ctx->arguments_shape, NULL,
  ------------------
  |  Branch (56260:9): [True: 0, False: 17]
  ------------------
56261|     17|                           JS_ATOM_Symbol_iterator, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_Symbol_iterator, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56262|      0|        return -1;
56263|     17|    if (add_shape_property(ctx, &ctx->arguments_shape, NULL,
  ------------------
  |  Branch (56263:9): [True: 0, False: 17]
  ------------------
56264|     17|                           JS_ATOM_callee, JS_PROP_GETSET))
  ------------------
  |  |  305|     17|#define JS_PROP_GETSET         (1 << 4)
  ------------------
56265|      0|        return -1;
56266|       |
56267|     17|    ctx->mapped_arguments_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_OBJECT]),
56268|     17|                                         JS_PROP_INITIAL_HASH_SIZE, 3);
  ------------------
  |  |  966|     17|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
56269|     17|    if (!ctx->mapped_arguments_shape)
  ------------------
  |  Branch (56269:9): [True: 0, False: 17]
  ------------------
56270|      0|        return -1;
56271|     17|    if (add_shape_property(ctx, &ctx->mapped_arguments_shape, NULL,
  ------------------
  |  Branch (56271:9): [True: 0, False: 17]
  ------------------
56272|     17|                           JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56273|      0|        return -1;
56274|     17|    if (add_shape_property(ctx, &ctx->mapped_arguments_shape, NULL,
  ------------------
  |  Branch (56274:9): [True: 0, False: 17]
  ------------------
56275|     17|                           JS_ATOM_Symbol_iterator, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_Symbol_iterator, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56276|      0|        return -1;
56277|     17|    if (add_shape_property(ctx, &ctx->mapped_arguments_shape, NULL,
  ------------------
  |  Branch (56277:9): [True: 0, False: 17]
  ------------------
56278|     17|                           JS_ATOM_callee, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  299|     17|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_callee, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|     17|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56279|      0|        return -1;
56280|       |    
56281|     17|    return 0;
56282|     17|}
quickjs.c:JS_SetImmutablePrototype:
 7887|     17|{
 7888|     17|    JSObject *p;
 7889|     17|    if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|     17|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (7889:9): [True: 0, False: 17]
  ------------------
 7890|      0|        return;
 7891|     17|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|     17|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     17|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 7892|     17|    p->has_immutable_prototype = TRUE;
 7893|     17|}
quickjs.c:js_array_join:
42507|      7|{
42508|      7|    JSValue obj, sep = JS_UNDEFINED, el;
  ------------------
  |  |  291|      7|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      7|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
42509|      7|    StringBuffer b_s, *b = &b_s;
42510|      7|    JSString *p = NULL;
42511|      7|    int64_t i, n;
42512|      7|    int c;
42513|       |
42514|      7|    obj = JS_ToObject(ctx, this_val);
42515|      7|    if (js_get_length64(ctx, &n, obj))
  ------------------
  |  Branch (42515:9): [True: 0, False: 7]
  ------------------
42516|      0|        goto exception;
42517|       |
42518|      7|    c = ',';    /* default separator */
42519|      7|    if (!toLocaleString && argc > 0 && !JS_IsUndefined(argv[0])) {
  ------------------
  |  Branch (42519:9): [True: 7, False: 0]
  |  Branch (42519:28): [True: 0, False: 7]
  |  Branch (42519:40): [True: 0, False: 0]
  ------------------
42520|      0|        sep = JS_ToString(ctx, argv[0]);
42521|      0|        if (JS_IsException(sep))
  ------------------
  |  Branch (42521:13): [True: 0, False: 0]
  ------------------
42522|      0|            goto exception;
42523|      0|        p = JS_VALUE_GET_STRING(sep);
  ------------------
  |  |  230|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
42524|      0|        if (p->len == 1 && !p->is_wide_char)
  ------------------
  |  Branch (42524:13): [True: 0, False: 0]
  |  Branch (42524:28): [True: 0, False: 0]
  ------------------
42525|      0|            c = p->u.str8[0];
42526|      0|        else
42527|      0|            c = -1;
42528|      0|    }
42529|      7|    string_buffer_init(ctx, b, 0);
42530|       |
42531|   343k|    for(i = 0; i < n; i++) {
  ------------------
  |  Branch (42531:16): [True: 343k, False: 7]
  ------------------
42532|   343k|        if (i > 0) {
  ------------------
  |  Branch (42532:13): [True: 343k, False: 7]
  ------------------
42533|   343k|            if (c >= 0) {
  ------------------
  |  Branch (42533:17): [True: 343k, False: 0]
  ------------------
42534|   343k|                string_buffer_putc8(b, c);
42535|   343k|            } else {
42536|      0|                string_buffer_concat(b, p, 0, p->len);
42537|      0|            }
42538|   343k|        }
42539|   343k|        el = JS_GetPropertyUint32(ctx, obj, i);
42540|   343k|        if (JS_IsException(el))
  ------------------
  |  Branch (42540:13): [True: 0, False: 343k]
  ------------------
42541|      0|            goto fail;
42542|   343k|        if (!JS_IsNull(el) && !JS_IsUndefined(el)) {
  ------------------
  |  Branch (42542:13): [True: 343k, False: 0]
  |  Branch (42542:31): [True: 343k, False: 0]
  ------------------
42543|   343k|            if (toLocaleString) {
  ------------------
  |  Branch (42543:17): [True: 0, False: 343k]
  ------------------
42544|      0|                el = JS_ToLocaleStringFree(ctx, el);
42545|      0|            }
42546|   343k|            if (string_buffer_concat_value_free(b, el))
  ------------------
  |  Branch (42546:17): [True: 0, False: 343k]
  ------------------
42547|      0|                goto fail;
42548|   343k|        }
42549|   343k|    }
42550|      7|    JS_FreeValue(ctx, sep);
42551|      7|    JS_FreeValue(ctx, obj);
42552|      7|    return string_buffer_end(b);
42553|       |
42554|      0|fail:
42555|      0|    string_buffer_free(b);
42556|      0|    JS_FreeValue(ctx, sep);
42557|      0|exception:
42558|      0|    JS_FreeValue(ctx, obj);
42559|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
42560|      0|}
quickjs.c:js_array_toString:
42484|      7|{
42485|      7|    JSValue obj, method, ret;
42486|       |
42487|      7|    obj = JS_ToObject(ctx, this_val);
42488|      7|    if (JS_IsException(obj))
  ------------------
  |  Branch (42488:9): [True: 0, False: 7]
  ------------------
42489|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
42490|      7|    method = JS_GetProperty(ctx, obj, JS_ATOM_join);
42491|      7|    if (JS_IsException(method)) {
  ------------------
  |  Branch (42491:9): [True: 0, False: 7]
  ------------------
42492|      0|        ret = JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
42493|      0|    } else
42494|      7|    if (!JS_IsFunction(ctx, method)) {
  ------------------
  |  Branch (42494:9): [True: 0, False: 7]
  ------------------
42495|       |        /* Use intrinsic Object.prototype.toString */
42496|      0|        JS_FreeValue(ctx, method);
42497|      0|        ret = js_object_toString(ctx, obj, 0, NULL);
42498|      7|    } else {
42499|       |        ret = JS_CallFree(ctx, method, obj, 0, NULL);
42500|      7|    }
42501|      7|    JS_FreeValue(ctx, obj);
42502|      7|    return ret;
42503|      7|}
quickjs.c:js_object_seal:
40551|     17|{
40552|     17|    JSValueConst obj = argv[0];
  ------------------
  |  |  234|     17|#define JSValueConst JSValue
  ------------------
40553|     17|    JSObject *p;
40554|     17|    JSPropertyEnum *props;
40555|     17|    uint32_t len, i;
40556|     17|    int flags, desc_flags, res;
40557|       |
40558|     17|    if (!JS_IsObject(obj))
  ------------------
  |  Branch (40558:9): [True: 0, False: 17]
  ------------------
40559|      0|        return JS_DupValue(ctx, obj);
40560|       |
40561|     17|    res = JS_PreventExtensions(ctx, obj);
40562|     17|    if (res < 0)
  ------------------
  |  Branch (40562:9): [True: 0, False: 17]
  ------------------
40563|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
40564|     17|    if (!res) {
  ------------------
  |  Branch (40564:9): [True: 0, False: 17]
  ------------------
40565|      0|        return JS_ThrowTypeError(ctx, "proxy preventExtensions handler returned false");
40566|      0|    }
40567|       |
40568|     17|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|     17|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     17|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
40569|     17|    flags = JS_GPN_STRING_MASK | JS_GPN_SYMBOL_MASK;
  ------------------
  |  |  810|     17|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
                  flags = JS_GPN_STRING_MASK | JS_GPN_SYMBOL_MASK;
  ------------------
  |  |  811|     17|#define JS_GPN_SYMBOL_MASK  (1 << 1)
  ------------------
40570|     17|    if (JS_GetOwnPropertyNamesInternal(ctx, &props, &len, p, flags))
  ------------------
  |  Branch (40570:9): [True: 0, False: 17]
  ------------------
40571|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
40572|       |
40573|     51|    for(i = 0; i < len; i++) {
  ------------------
  |  Branch (40573:16): [True: 34, False: 17]
  ------------------
40574|     34|        JSPropertyDescriptor desc;
40575|     34|        JSAtom prop = props[i].atom;
40576|       |
40577|     34|        desc_flags = JS_PROP_THROW | JS_PROP_HAS_CONFIGURABLE;
  ------------------
  |  |  320|     34|#define JS_PROP_THROW            (1 << 14)
  ------------------
                      desc_flags = JS_PROP_THROW | JS_PROP_HAS_CONFIGURABLE;
  ------------------
  |  |  311|     34|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
40578|     34|        if (freeze_flag) {
  ------------------
  |  Branch (40578:13): [True: 34, False: 0]
  ------------------
40579|     34|            res = JS_GetOwnPropertyInternal(ctx, &desc, p, prop);
40580|     34|            if (res < 0)
  ------------------
  |  Branch (40580:17): [True: 0, False: 34]
  ------------------
40581|      0|                goto exception;
40582|     34|            if (res) {
  ------------------
  |  Branch (40582:17): [True: 34, False: 0]
  ------------------
40583|     34|                if (desc.flags & JS_PROP_WRITABLE)
  ------------------
  |  |  299|     34|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (40583:21): [True: 0, False: 34]
  ------------------
40584|      0|                    desc_flags |= JS_PROP_HAS_WRITABLE;
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
40585|     34|                js_free_desc(ctx, &desc);
40586|     34|            }
40587|     34|        }
40588|     34|        if (JS_DefineProperty(ctx, obj, prop, JS_UNDEFINED,
  ------------------
  |  |  291|     34|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     34|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
  |  Branch (40588:13): [True: 0, False: 34]
  ------------------
40589|     34|                              JS_UNDEFINED, JS_UNDEFINED, desc_flags) < 0)
  ------------------
  |  |  291|     34|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     34|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
                                            JS_UNDEFINED, JS_UNDEFINED, desc_flags) < 0)
  ------------------
  |  |  291|     34|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     34|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
40590|      0|            goto exception;
40591|     34|    }
40592|     17|    JS_FreePropertyEnum(ctx, props, len);
40593|     17|    return JS_DupValue(ctx, obj);
40594|       |
40595|      0| exception:
40596|      0|    JS_FreePropertyEnum(ctx, props, len);
40597|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
40598|     17|}
quickjs.c:js_object_valueOf:
40456|      4|{
40457|      4|    return JS_ToObject(ctx, this_val);
40458|      4|}
quickjs.c:js_function_toString:
41220|      1|{
41221|      1|    JSObject *p;
41222|      1|    JSFunctionKindEnum func_kind = JS_FUNC_NORMAL;
41223|       |
41224|      1|    if (check_function(ctx, this_val))
  ------------------
  |  Branch (41224:9): [True: 0, False: 1]
  ------------------
41225|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
41226|       |
41227|      1|    p = JS_VALUE_GET_OBJ(this_val);
  ------------------
  |  |  229|      1|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
41228|      1|    if (js_class_has_bytecode(p->class_id)) {
  ------------------
  |  Branch (41228:9): [True: 1, False: 0]
  ------------------
41229|      1|        JSFunctionBytecode *b = p->u.func.function_bytecode;
41230|      1|        if (b->has_debug && b->debug.source) {
  ------------------
  |  Branch (41230:13): [True: 1, False: 0]
  |  Branch (41230:29): [True: 1, False: 0]
  ------------------
41231|      1|            return JS_NewStringLen(ctx, b->debug.source, b->debug.source_len);
41232|      1|        }
41233|      0|        func_kind = b->func_kind;
41234|      0|    }
41235|      0|    {
41236|      0|        JSValue name;
41237|      0|        const char *pref, *suff;
41238|       |
41239|      0|        switch(func_kind) {
41240|      0|        default:
  ------------------
  |  Branch (41240:9): [True: 0, False: 0]
  ------------------
41241|      0|        case JS_FUNC_NORMAL:
  ------------------
  |  Branch (41241:9): [True: 0, False: 0]
  ------------------
41242|      0|            pref = "function ";
41243|      0|            break;
41244|      0|        case JS_FUNC_GENERATOR:
  ------------------
  |  Branch (41244:9): [True: 0, False: 0]
  ------------------
41245|      0|            pref = "function *";
41246|      0|            break;
41247|      0|        case JS_FUNC_ASYNC:
  ------------------
  |  Branch (41247:9): [True: 0, False: 0]
  ------------------
41248|      0|            pref = "async function ";
41249|      0|            break;
41250|      0|        case JS_FUNC_ASYNC_GENERATOR:
  ------------------
  |  Branch (41250:9): [True: 0, False: 0]
  ------------------
41251|      0|            pref = "async function *";
41252|      0|            break;
41253|      0|        }
41254|      0|        suff = "() {\n    [native code]\n}";
41255|      0|        name = JS_GetProperty(ctx, this_val, JS_ATOM_name);
41256|      0|        if (JS_IsUndefined(name))
  ------------------
  |  Branch (41256:13): [True: 0, False: 0]
  ------------------
41257|      0|            name = JS_AtomToString(ctx, JS_ATOM_empty_string);
41258|      0|        return JS_ConcatString3(ctx, pref, name, suff);
41259|      0|    }
41260|      0|}
quickjs.c:string_get_hex:
54493|  34.7k|static int string_get_hex(JSString *p, int k, int n) {
54494|  34.7k|    int c = 0, h;
54495|   100k|    while (n-- > 0) {
  ------------------
  |  Branch (54495:12): [True: 73.4k, False: 27.0k]
  ------------------
54496|  73.4k|        if ((h = from_hex(string_get(p, k++))) < 0)
  ------------------
  |  Branch (54496:13): [True: 7.78k, False: 65.6k]
  ------------------
54497|  7.78k|            return -1;
54498|  65.6k|        c = (c << 4) | h;
54499|  65.6k|    }
54500|  27.0k|    return c;
54501|  34.7k|}
quickjs.c:js_global_unescape:
54732|      2|{
54733|      2|    JSValue str;
54734|      2|    StringBuffer b_s, *b = &b_s;
54735|      2|    JSString *p;
54736|      2|    int i, len, c, n;
54737|       |
54738|      2|    str = JS_ToString(ctx, argv[0]);
54739|      2|    if (JS_IsException(str))
  ------------------
  |  Branch (54739:9): [True: 0, False: 2]
  ------------------
54740|      0|        return str;
54741|       |
54742|      2|    string_buffer_init(ctx, b, 0);
54743|      2|    p = JS_VALUE_GET_STRING(str);
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
54744|  1.61M|    for (i = 0, len = p->len; i < len; i++) {
  ------------------
  |  Branch (54744:31): [True: 1.61M, False: 2]
  ------------------
54745|  1.61M|        c = string_get(p, i);
54746|  1.61M|        if (c == '%') {
  ------------------
  |  Branch (54746:13): [True: 30.9k, False: 1.58M]
  ------------------
54747|  30.9k|            if (i + 6 <= len
  ------------------
  |  Branch (54747:17): [True: 30.9k, False: 0]
  ------------------
54748|  30.9k|            &&  string_get(p, i + 1) == 'u'
  ------------------
  |  Branch (54748:17): [True: 7.75k, False: 23.1k]
  ------------------
54749|  7.75k|            &&  (n = string_get_hex(p, i + 2, 4)) >= 0) {
  ------------------
  |  Branch (54749:17): [True: 3.87k, False: 3.88k]
  ------------------
54750|  3.87k|                c = n;
54751|  3.87k|                i += 6 - 1;
54752|  3.87k|            } else
54753|  27.0k|            if (i + 3 <= len
  ------------------
  |  Branch (54753:17): [True: 27.0k, False: 0]
  ------------------
54754|  27.0k|            &&  (n = string_get_hex(p, i + 1, 2)) >= 0) {
  ------------------
  |  Branch (54754:17): [True: 23.1k, False: 3.90k]
  ------------------
54755|  23.1k|                c = n;
54756|  23.1k|                i += 3 - 1;
54757|  23.1k|            }
54758|  30.9k|        }
54759|  1.61M|        string_buffer_putc16(b, c);
54760|  1.61M|    }
54761|      2|    JS_FreeValue(ctx, str);
54762|      2|    return string_buffer_end(b);
54763|      2|}
quickjs.c:string_cmp:
45317|   421k|{
45318|   421k|    int i, c1, c2;
45319|   765k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (45319:17): [True: 421k, False: 343k]
  ------------------
45320|   421k|        if ((c1 = string_get(p1, x1 + i)) != (c2 = string_get(p2, x2 + i)))
  ------------------
  |  Branch (45320:13): [True: 78.4k, False: 343k]
  ------------------
45321|  78.4k|            return c1 - c2;
45322|   421k|    }
45323|   343k|    return 0;
45324|   421k|}
quickjs.c:js_string_split:
45896|      4|{
45897|       |    // split(sep, limit)
45898|      4|    JSValueConst O = this_val, separator = argv[0], limit = argv[1];
  ------------------
  |  |  234|      4|#define JSValueConst JSValue
  ------------------
45899|      4|    JSValueConst args[2];
  ------------------
  |  |  234|      4|#define JSValueConst JSValue
  ------------------
45900|      4|    JSValue S, A, R, T;
45901|      4|    uint32_t lim, lengthA;
45902|      4|    int64_t p, q, s, r, e;
45903|      4|    JSString *sp, *rp;
45904|       |
45905|      4|    if (JS_IsUndefined(O) || JS_IsNull(O))
  ------------------
  |  Branch (45905:9): [True: 0, False: 4]
  |  Branch (45905:30): [True: 0, False: 4]
  ------------------
45906|      0|        return JS_ThrowTypeError(ctx, "cannot convert to object");
45907|       |
45908|      4|    S = JS_UNDEFINED;
  ------------------
  |  |  291|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
45909|      4|    A = JS_UNDEFINED;
  ------------------
  |  |  291|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
45910|      4|    R = JS_UNDEFINED;
  ------------------
  |  |  291|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
45911|       |
45912|      4|    if (JS_IsObject(separator)) {
  ------------------
  |  Branch (45912:9): [True: 4, False: 0]
  ------------------
45913|      4|        JSValue splitter;
45914|      4|        splitter = JS_GetProperty(ctx, separator, JS_ATOM_Symbol_split);
45915|      4|        if (JS_IsException(splitter))
  ------------------
  |  Branch (45915:13): [True: 0, False: 4]
  ------------------
45916|      0|            return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
45917|      4|        if (!JS_IsUndefined(splitter) && !JS_IsNull(splitter)) {
  ------------------
  |  Branch (45917:13): [True: 2, False: 2]
  |  Branch (45917:42): [True: 2, False: 0]
  ------------------
45918|      2|            args[0] = O;
45919|      2|            args[1] = limit;
45920|      2|            return JS_CallFree(ctx, splitter, separator, 2, args);
45921|      2|        }
45922|      4|    }
45923|      2|    S = JS_ToString(ctx, O);
45924|      2|    if (JS_IsException(S))
  ------------------
  |  Branch (45924:9): [True: 0, False: 2]
  ------------------
45925|      0|        goto exception;
45926|      2|    A = JS_NewArray(ctx);
45927|      2|    if (JS_IsException(A))
  ------------------
  |  Branch (45927:9): [True: 0, False: 2]
  ------------------
45928|      0|        goto exception;
45929|      2|    lengthA = 0;
45930|      2|    if (JS_IsUndefined(limit)) {
  ------------------
  |  Branch (45930:9): [True: 2, False: 0]
  ------------------
45931|      2|        lim = 0xffffffff;
45932|      2|    } else {
45933|      0|        if (JS_ToUint32(ctx, &lim, limit) < 0)
  ------------------
  |  Branch (45933:13): [True: 0, False: 0]
  ------------------
45934|      0|            goto exception;
45935|      0|    }
45936|      2|    sp = JS_VALUE_GET_STRING(S);
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
45937|      2|    s = sp->len;
45938|      2|    R = JS_ToString(ctx, separator);
45939|      2|    if (JS_IsException(R))
  ------------------
  |  Branch (45939:9): [True: 0, False: 2]
  ------------------
45940|      0|        goto exception;
45941|      2|    rp = JS_VALUE_GET_STRING(R);
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
45942|      2|    r = rp->len;
45943|      2|    p = 0;
45944|      2|    if (lim == 0)
  ------------------
  |  Branch (45944:9): [True: 0, False: 2]
  ------------------
45945|      0|        goto done;
45946|      2|    if (JS_IsUndefined(separator))
  ------------------
  |  Branch (45946:9): [True: 0, False: 2]
  ------------------
45947|      0|        goto add_tail;
45948|      2|    if (s == 0) {
  ------------------
  |  Branch (45948:9): [True: 0, False: 2]
  ------------------
45949|      0|        if (r != 0)
  ------------------
  |  Branch (45949:13): [True: 0, False: 0]
  ------------------
45950|      0|            goto add_tail;
45951|      0|        goto done;
45952|      0|    }
45953|   343k|    for (q = p; (q += !r) <= s - r - !r; q = p = e + r) {
  ------------------
  |  Branch (45953:17): [True: 343k, False: 0]
  ------------------
45954|   343k|        e = string_indexof(sp, rp, q);
45955|   343k|        if (e < 0)
  ------------------
  |  Branch (45955:13): [True: 2, False: 343k]
  ------------------
45956|      2|            break;
45957|   343k|        T = js_sub_string(ctx, sp, p, e);
45958|   343k|        if (JS_IsException(T))
  ------------------
  |  Branch (45958:13): [True: 0, False: 343k]
  ------------------
45959|      0|            goto exception;
45960|   343k|        if (JS_CreateDataPropertyUint32(ctx, A, lengthA++, T, 0) < 0)
  ------------------
  |  Branch (45960:13): [True: 0, False: 343k]
  ------------------
45961|      0|            goto exception;
45962|   343k|        if (lengthA == lim)
  ------------------
  |  Branch (45962:13): [True: 0, False: 343k]
  ------------------
45963|      0|            goto done;
45964|   343k|    }
45965|      2|add_tail:
45966|      2|    T = js_sub_string(ctx, sp, p, s);
45967|      2|    if (JS_IsException(T))
  ------------------
  |  Branch (45967:9): [True: 0, False: 2]
  ------------------
45968|      0|        goto exception;
45969|      2|    if (JS_CreateDataPropertyUint32(ctx, A, lengthA++, T,0 ) < 0)
  ------------------
  |  Branch (45969:9): [True: 0, False: 2]
  ------------------
45970|      0|        goto exception;
45971|      2|done:
45972|      2|    JS_FreeValue(ctx, S);
45973|      2|    JS_FreeValue(ctx, R);
45974|      2|    return A;
45975|       |
45976|      0|exception:
45977|      0|    JS_FreeValue(ctx, A);
45978|      0|    JS_FreeValue(ctx, S);
45979|      0|    JS_FreeValue(ctx, R);
45980|      0|    return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
45981|      2|}
quickjs.c:string_indexof:
45347|   343k|{
45348|       |    /* assuming 0 <= from <= p1->len */
45349|   343k|    int c, i, j, len1 = p1->len, len2 = p2->len;
45350|   343k|    if (len2 == 0)
  ------------------
  |  Branch (45350:9): [True: 0, False: 343k]
  ------------------
45351|      0|        return from;
45352|   421k|    for (i = from, c = string_get(p2, 0); i + len2 <= len1; i = j + 1) {
  ------------------
  |  Branch (45352:43): [True: 421k, False: 0]
  ------------------
45353|   421k|        j = string_indexof_char(p1, c, i);
45354|   421k|        if (j < 0 || j + len2 > len1)
  ------------------
  |  Branch (45354:13): [True: 2, False: 421k]
  |  Branch (45354:22): [True: 0, False: 421k]
  ------------------
45355|      2|            break;
45356|   421k|        if (!string_cmp(p1, p2, j + 1, 1, len2 - 1))
  ------------------
  |  Branch (45356:13): [True: 343k, False: 78.4k]
  ------------------
45357|   343k|            return j;
45358|   421k|    }
45359|      2|    return -1;
45360|   343k|}
quickjs.c:js_string_iterator_next:
46513|      2|{
46514|      2|    JSArrayIteratorData *it;
46515|      2|    uint32_t idx, c, start;
46516|      2|    JSString *p;
46517|       |
46518|      2|    it = JS_GetOpaque2(ctx, this_val, JS_CLASS_STRING_ITERATOR);
46519|      2|    if (!it) {
  ------------------
  |  Branch (46519:9): [True: 0, False: 2]
  ------------------
46520|      0|        *pdone = FALSE;
46521|      0|        return JS_EXCEPTION;
  ------------------
  |  |  294|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
46522|      0|    }
46523|      2|    if (JS_IsUndefined(it->obj))
  ------------------
  |  Branch (46523:9): [True: 0, False: 2]
  ------------------
46524|      0|        goto done;
46525|      2|    p = JS_VALUE_GET_STRING(it->obj);
  ------------------
  |  |  230|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
46526|      2|    idx = it->idx;
46527|      2|    if (idx >= p->len) {
  ------------------
  |  Branch (46527:9): [True: 0, False: 2]
  ------------------
46528|      0|        JS_FreeValue(ctx, it->obj);
46529|      0|        it->obj = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
46530|      0|    done:
46531|      0|        *pdone = TRUE;
46532|      0|        return JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
46533|      0|    }
46534|       |
46535|      2|    start = idx;
46536|      2|    c = string_getc(p, (int *)&idx);
46537|      2|    it->idx = idx;
46538|      2|    *pdone = FALSE;
46539|      2|    if (c <= 0xffff) {
  ------------------
  |  Branch (46539:9): [True: 2, False: 0]
  ------------------
46540|      2|        return js_new_string_char(ctx, c);
46541|      2|    } else {
46542|      0|        return js_new_string16_len(ctx, p->u.str16 + start, 2);
46543|      0|    }
46544|      2|}
quickjs.c:js_random_init:
47147|     17|{
47148|     17|    struct timeval tv;
47149|     17|    gettimeofday(&tv, NULL);
47150|     17|    ctx->random_state = ((int64_t)tv.tv_sec * 1000000) + tv.tv_usec;
47151|       |    /* the state must be non zero */
47152|     17|    if (ctx->random_state == 0)
  ------------------
  |  Branch (47152:9): [True: 0, False: 17]
  ------------------
47153|      0|        ctx->random_state = 1;
47154|     17|}
quickjs.c:JS_AddIntrinsicBigInt:
56135|     17|{
56136|     17|    JSValue obj1;
56137|       |
56138|     17|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_BIG_INT, "BigInt",
56139|     17|                                     js_bigint_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56140|     17|                                     JS_UNDEFINED,
  ------------------
  |  |  291|     17|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     17|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56141|     17|                                     js_bigint_funcs, countof(js_bigint_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56142|     17|                                     js_bigint_proto_funcs, countof(js_bigint_proto_funcs),
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56143|     17|                                     0);
56144|     17|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56144:9): [True: 0, False: 17]
  ------------------
56145|      0|        return -1;
56146|     17|    JS_FreeValue(ctx, obj1);
56147|     17|    return 0;
56148|     17|}
quickjs.c:JS_AddIntrinsicAtomics:
60797|     17|{
60798|       |    /* add Atomics as autoinit object */
60799|     17|    return JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_atomics_obj, countof(js_atomics_obj));
  ------------------
  |  |   47|     17|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60800|     17|}

fuzz_eval.c:JS_IsException:
  642|     17|{
  643|     17|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_EXCEPTION);
  ------------------
  |  |   38|     17|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  644|     17|}
fuzz_eval.c:JS_FreeValue:
  688|      2|{
  689|      2|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  287|      2|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (287:35): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  690|      0|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  691|      0|        if (--p->ref_count <= 0) {
  ------------------
  |  Branch (691:13): [True: 0, False: 0]
  ------------------
  692|      0|            __JS_FreeValue(ctx, v);
  693|      0|        }
  694|      0|    }
  695|      2|}
fuzz_common.c:JS_IsException:
  642|     17|{
  643|     17|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_EXCEPTION);
  ------------------
  |  |   38|     17|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  644|     17|}
fuzz_common.c:JS_FreeValue:
  688|     17|{
  689|     17|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  287|     17|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|     17|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (287:35): [True: 0, False: 17]
  |  |  ------------------
  ------------------
  690|      0|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  691|      0|        if (--p->ref_count <= 0) {
  ------------------
  |  Branch (691:13): [True: 0, False: 0]
  ------------------
  692|      0|            __JS_FreeValue(ctx, v);
  693|      0|        }
  694|      0|    }
  695|     17|}
quickjs.c:JS_FreeValue:
  688|  10.1M|{
  689|  10.1M|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  287|  10.1M|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|  10.1M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (287:35): [True: 2.73M, False: 7.42M]
  |  |  ------------------
  ------------------
  690|  2.73M|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|  2.73M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  691|  2.73M|        if (--p->ref_count <= 0) {
  ------------------
  |  Branch (691:13): [True: 1.30k, False: 2.73M]
  ------------------
  692|  1.30k|            __JS_FreeValue(ctx, v);
  693|  1.30k|        }
  694|  2.73M|    }
  695|  10.1M|}
quickjs.c:__js_rc:
  683|  6.10M|{
  684|  6.10M|    return (JSRefCountHeader *)((uint32_t *)ptr - 1);
  685|  6.10M|}
quickjs.c:JS_IsException:
  642|  4.75M|{
  643|  4.75M|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_EXCEPTION);
  ------------------
  |  |   38|  4.75M|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  644|  4.75M|}
quickjs.c:JS_FreeValueRT:
  698|   360k|{
  699|   360k|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  287|   360k|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|   360k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (287:35): [True: 355k, False: 4.87k]
  |  |  ------------------
  ------------------
  700|   355k|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|   355k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  701|   355k|        if (--p->ref_count <= 0) {
  ------------------
  |  Branch (701:13): [True: 76.2k, False: 279k]
  ------------------
  702|  76.2k|            __JS_FreeValueRT(rt, v);
  703|  76.2k|        }
  704|   355k|    }
  705|   360k|}
quickjs.c:JS_DupValue:
  708|  3.01M|{
  709|  3.01M|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  287|  3.01M|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|  3.01M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (287:35): [True: 3.01M, False: 3.88k]
  |  |  ------------------
  ------------------
  710|  3.01M|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|  3.01M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  711|  3.01M|        p->ref_count++;
  712|  3.01M|    }
  713|  3.01M|    return (JSValue)v;
  714|  3.01M|}
quickjs.c:JS_ToCStringLen:
  753|    104|{
  754|    104|    return JS_ToCStringLen2(ctx, plen, val1, 0);
  755|    104|}
quickjs.c:JS_IsObject:
  663|  1.01M|{
  664|  1.01M|    return JS_VALUE_GET_TAG(v) == JS_TAG_OBJECT;
  ------------------
  |  |  236|  1.01M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  665|  1.01M|}
quickjs.c:JS_IsUninitialized:
  647|    136|{
  648|    136|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_UNINITIALIZED);
  ------------------
  |  |   38|    136|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  649|    136|}
quickjs.c:JS_ToCString:
  757|     13|{
  758|       |    return JS_ToCStringLen2(ctx, NULL, val1, 0);
  759|     13|}
quickjs.c:JS_AtomToCString:
  463|     79|{
  464|       |    return JS_AtomToCStringLen(ctx, NULL, atom);
  465|     79|}
quickjs.c:JS_GetProperty:
  781|  1.01M|{
  782|  1.01M|    return JS_GetPropertyInternal(ctx, this_obj, prop, this_obj, 0);
  783|  1.01M|}
quickjs.c:JS_IsNull:
  632|  2.36M|{
  633|  2.36M|    return JS_VALUE_GET_TAG(v) == JS_TAG_NULL;
  ------------------
  |  |  236|  2.36M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  634|  2.36M|}
quickjs.c:JS_IsUndefined:
  637|   344k|{
  638|   344k|    return JS_VALUE_GET_TAG(v) == JS_TAG_UNDEFINED;
  ------------------
  |  |  236|   344k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  639|   344k|}
quickjs.c:JS_NewInt32:
  561|  3.05M|{
  562|  3.05M|    return JS_MKVAL(JS_TAG_INT, val);
  ------------------
  |  |  247|  3.05M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  ------------------
  563|  3.05M|}
quickjs.c:JS_NewUint32:
  582|   343k|{
  583|   343k|    JSValue v;
  584|   343k|    if (val <= 0x7fffffff) {
  ------------------
  |  Branch (584:9): [True: 343k, False: 0]
  ------------------
  585|   343k|        v = JS_NewInt32(ctx, val);
  586|   343k|    } else {
  587|      0|        v = __JS_NewFloat64(ctx, val);
  588|      0|    }
  589|   343k|    return v;
  590|   343k|}
quickjs.c:JS_SetProperty:
  794|  1.00M|{
  795|  1.00M|    return JS_SetPropertyInternal(ctx, this_obj, prop, val, this_obj, JS_PROP_THROW);
  ------------------
  |  |  320|  1.00M|#define JS_PROP_THROW            (1 << 14)
  ------------------
  796|  1.00M|}
quickjs.c:JS_NewInt64:
  571|   343k|{
  572|   343k|    JSValue v;
  573|   343k|    if (val == (int32_t)val) {
  ------------------
  |  Branch (573:9): [True: 343k, False: 0]
  ------------------
  574|   343k|        v = JS_NewInt32(ctx, val);
  575|   343k|    } else {
  576|      0|        v = __JS_NewFloat64(ctx, val);
  577|      0|    }
  578|   343k|    return v;
  579|   343k|}
quickjs.c:JS_NewFloat64:
  596|     24|{
  597|     24|    int32_t val;
  598|     24|    union {
  599|     24|        double d;
  600|     24|        uint64_t u;
  601|     24|    } u, t;
  602|     24|    if (d >= INT32_MIN && d <= INT32_MAX) {
  ------------------
  |  Branch (602:9): [True: 24, False: 0]
  |  Branch (602:27): [True: 21, False: 3]
  ------------------
  603|     21|        u.d = d;
  604|     21|        val = (int32_t)d;
  605|     21|        t.d = val;
  606|       |        /* -0 cannot be represented as integer, so we compare the bit
  607|       |           representation */
  608|     21|        if (u.u == t.u)
  ------------------
  |  Branch (608:13): [True: 19, False: 2]
  ------------------
  609|     19|            return JS_MKVAL(JS_TAG_INT, val);
  ------------------
  |  |  247|     19|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  ------------------
  610|     21|    }
  611|      5|    return __JS_NewFloat64(ctx, d);
  612|     24|}
quickjs.c:JS_VALUE_IS_NAN:
  263|     22|{
  264|     22|    union {
  265|     22|        double d;
  266|     22|        uint64_t u64;
  267|     22|    } u;
  268|     22|    if (v.tag != JS_TAG_FLOAT64)
  ------------------
  |  Branch (268:9): [True: 17, False: 5]
  ------------------
  269|     17|        return 0;
  270|      5|    u.d = v.u.float64;
  271|      5|    return (u.u64 & 0x7fffffffffffffff) > 0x7ff0000000000000;
  272|     22|}
quickjs.c:JS_NewCatchOffset:
  566|      1|{
  567|      1|    return JS_MKVAL(JS_TAG_CATCH_OFFSET, val);
  ------------------
  |  |  247|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  ------------------
  568|      1|}
quickjs.c:JS_NewString:
  745|     87|{
  746|     87|    return JS_NewStringLen(ctx, str, strlen(str));
  747|     87|}
quickjs.c:__JS_NewFloat64:
  255|    180|{
  256|    180|    JSValue v;
  257|    180|    v.tag = JS_TAG_FLOAT64;
  258|    180|    v.u.float64 = d;
  259|    180|    return v;
  260|    180|}
quickjs.c:JS_ToUint32:
  732|     12|{
  733|     12|    return JS_ToInt32(ctx, (int32_t*)pres, val);
  734|     12|}
quickjs.c:JS_IsString:
  652|      2|{
  653|      2|    return JS_VALUE_GET_TAG(v) == JS_TAG_STRING ||
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (653:12): [True: 1, False: 1]
  ------------------
  654|      1|        JS_VALUE_GET_TAG(v) == JS_TAG_STRING_ROPE;
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (654:9): [True: 0, False: 1]
  ------------------
  655|      2|}
quickjs.c:JS_NewCFunction:
 1052|     17|{
 1053|     17|    return JS_NewCFunction2(ctx, func, name, length, JS_CFUNC_generic, 0);
 1054|     17|}
quickjs.c:JS_NewBool:
  556|     37|{
  557|     37|    return JS_MKVAL(JS_TAG_BOOL, (val != 0));
  ------------------
  |  |  247|     37|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  ------------------
  558|     37|}
quickjs-libc.c:JS_AtomToCString:
  463|     17|{
  464|       |    return JS_AtomToCStringLen(ctx, NULL, atom);
  465|     17|}
quickjs-libc.c:JS_IsException:
  642|     48|{
  643|     48|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_EXCEPTION);
  ------------------
  |  |   38|     48|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  644|     48|}
quickjs-libc.c:JS_FreeValue:
  688|     33|{
  689|     33|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  287|     33|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|     33|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (287:35): [True: 33, False: 0]
  |  |  ------------------
  ------------------
  690|     33|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|     33|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  691|     33|        if (--p->ref_count <= 0) {
  ------------------
  |  Branch (691:13): [True: 0, False: 33]
  ------------------
  692|      0|            __JS_FreeValue(ctx, v);
  693|      0|        }
  694|     33|    }
  695|     33|}
quickjs-libc.c:__js_rc:
  683|     33|{
  684|     33|    return (JSRefCountHeader *)((uint32_t *)ptr - 1);
  685|     33|}
quickjs-libc.c:JS_NewCFunction:
 1052|     68|{
 1053|     68|    return JS_NewCFunction2(ctx, func, name, length, JS_CFUNC_generic, 0);
 1054|     68|}

