strstart:
   60|     24|{
   61|     24|    const char *p, *q;
   62|     24|    p = str;
   63|     24|    q = val;
   64|     24|    while (*q != '\0') {
  ------------------
  |  Branch (64:12): [True: 24, False: 0]
  ------------------
   65|     24|        if (*p != *q)
  ------------------
  |  Branch (65:13): [True: 24, False: 0]
  ------------------
   66|     24|            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|     24|}
dbuf_init2:
   90|    135|{
   91|    135|    memset(s, 0, sizeof(*s));
   92|    135|    if (!realloc_func)
  ------------------
  |  Branch (92:9): [True: 0, False: 135]
  ------------------
   93|      0|        realloc_func = dbuf_default_realloc;
   94|    135|    s->opaque = opaque;
   95|    135|    s->realloc_func = realloc_func;
   96|    135|}
dbuf_claim:
  105|    812|{
  106|    812|    size_t new_size, size;
  107|    812|    uint8_t *new_buf;
  108|    812|    new_size = s->size + len;
  109|    812|    if (new_size < len)
  ------------------
  |  Branch (109:9): [True: 0, False: 812]
  ------------------
  110|      0|        return -1; /* overflow case */
  111|    812|    if (new_size > s->allocated_size) {
  ------------------
  |  Branch (111:9): [True: 764, False: 48]
  ------------------
  112|    764|        if (s->error)
  ------------------
  |  Branch (112:13): [True: 0, False: 764]
  ------------------
  113|      0|            return -1;
  114|    764|        size = s->allocated_size + (s->allocated_size / 2);
  115|    764|        if (size < s->allocated_size)
  ------------------
  |  Branch (115:13): [True: 0, False: 764]
  ------------------
  116|      0|            return -1; /* overflow case */
  117|    764|        if (size > new_size)
  ------------------
  |  Branch (117:13): [True: 403, False: 361]
  ------------------
  118|    403|            new_size = size;
  119|    764|        new_buf = s->realloc_func(s->opaque, s->buf, new_size);
  120|    764|        if (!new_buf) {
  ------------------
  |  Branch (120:13): [True: 0, False: 764]
  ------------------
  121|      0|            s->error = TRUE;
  122|      0|            return -1;
  123|      0|        }
  124|    764|        s->buf = new_buf;
  125|    764|        s->allocated_size = new_size;
  126|    764|    }
  127|    812|    return 0;
  128|    812|}
dbuf_put:
  131|  1.06k|{
  132|  1.06k|    if (unlikely((s->allocated_size - s->size) < len)) {
  ------------------
  |  |   33|  1.06k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 752, False: 308]
  |  |  ------------------
  ------------------
  133|    752|        if (dbuf_claim(s, len))
  ------------------
  |  Branch (133:13): [True: 0, False: 752]
  ------------------
  134|      0|            return -1;
  135|    752|    }
  136|  1.06k|    memcpy_no_ub(s->buf + s->size, data, len);
  137|  1.06k|    s->size += len;
  138|  1.06k|    return 0;
  139|  1.06k|}
__dbuf_putc:
  153|    345|{
  154|    345|    return dbuf_put(s, &c, 1);
  155|    345|}
__dbuf_put_u16:
  158|     61|{
  159|     61|    return dbuf_put(s, (uint8_t *)&val, 2);
  160|     61|}
__dbuf_put_u32:
  163|    137|{
  164|    137|    return dbuf_put(s, (uint8_t *)&val, 4);
  165|    137|}
dbuf_printf:
  179|     29|{
  180|     29|    va_list ap;
  181|     29|    char buf[128];
  182|     29|    int len;
  183|       |
  184|     29|    va_start(ap, fmt);
  185|     29|    len = vsnprintf(buf, sizeof(buf), fmt, ap);
  186|     29|    va_end(ap);
  187|     29|    if (len < 0)
  ------------------
  |  Branch (187:9): [True: 0, False: 29]
  ------------------
  188|      0|        return -1;
  189|     29|    if (len < sizeof(buf)) {
  ------------------
  |  Branch (189:9): [True: 29, False: 0]
  ------------------
  190|       |        /* fast case */
  191|     29|        return dbuf_put(s, (uint8_t *)buf, len);
  192|     29|    } 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|     29|}
dbuf_free:
  205|     75|{
  206|       |    /* we test s->buf as a fail safe to avoid crashing if dbuf_free()
  207|       |       is called twice */
  208|     75|    if (s->buf) {
  ------------------
  |  Branch (208:9): [True: 68, False: 7]
  ------------------
  209|     68|        s->realloc_func(s->opaque, s->buf, 0);
  210|     68|    }
  211|     75|    memset(s, 0, sizeof(*s));
  212|     75|}
unicode_to_utf8:
  217|    643|{
  218|    643|    uint8_t *q = buf;
  219|       |
  220|    643|    if (c < 0x80) {
  ------------------
  |  Branch (220:9): [True: 0, False: 643]
  ------------------
  221|      0|        *q++ = c;
  222|    643|    } else {
  223|    643|        if (c < 0x800) {
  ------------------
  |  Branch (223:13): [True: 640, False: 3]
  ------------------
  224|    640|            *q++ = (c >> 6) | 0xc0;
  225|    640|        } else {
  226|      3|            if (c < 0x10000) {
  ------------------
  |  Branch (226:17): [True: 3, False: 0]
  ------------------
  227|      3|                *q++ = (c >> 12) | 0xe0;
  228|      3|            } 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|      3|            *q++ = ((c >> 6) & 0x3f) | 0x80;
  245|      3|        }
  246|    643|        *q++ = (c & 0x3f) | 0x80;
  247|    643|    }
  248|    643|    return q - buf;
  249|    643|}
unicode_from_utf8:
  262|  1.90k|{
  263|  1.90k|    int l, c, b, i;
  264|       |
  265|  1.90k|    c = *p++;
  266|  1.90k|    if (c < 0x80) {
  ------------------
  |  Branch (266:9): [True: 15, False: 1.89k]
  ------------------
  267|     15|        *pp = p;
  268|     15|        return c;
  269|     15|    }
  270|  1.89k|    switch(c) {
  271|     41|    case 0xc0: case 0xc1: case 0xc2: case 0xc3:
  ------------------
  |  Branch (271:5): [True: 0, False: 1.89k]
  |  Branch (271:16): [True: 0, False: 1.89k]
  |  Branch (271:27): [True: 3, False: 1.88k]
  |  Branch (271:38): [True: 38, False: 1.85k]
  ------------------
  272|     52|    case 0xc4: case 0xc5: case 0xc6: case 0xc7:
  ------------------
  |  Branch (272:5): [True: 0, False: 1.89k]
  |  Branch (272:16): [True: 0, False: 1.89k]
  |  Branch (272:27): [True: 11, False: 1.87k]
  |  Branch (272:38): [True: 0, False: 1.89k]
  ------------------
  273|  1.35k|    case 0xc8: case 0xc9: case 0xca: case 0xcb:
  ------------------
  |  Branch (273:5): [True: 0, False: 1.89k]
  |  Branch (273:16): [True: 0, False: 1.89k]
  |  Branch (273:27): [True: 11, False: 1.87k]
  |  Branch (273:38): [True: 1.29k, False: 596]
  ------------------
  274|  1.45k|    case 0xcc: case 0xcd: case 0xce: case 0xcf:
  ------------------
  |  Branch (274:5): [True: 61, False: 1.82k]
  |  Branch (274:16): [True: 0, False: 1.89k]
  |  Branch (274:27): [True: 0, False: 1.89k]
  |  Branch (274:38): [True: 32, False: 1.85k]
  ------------------
  275|  1.46k|    case 0xd0: case 0xd1: case 0xd2: case 0xd3:
  ------------------
  |  Branch (275:5): [True: 11, False: 1.87k]
  |  Branch (275:16): [True: 0, False: 1.89k]
  |  Branch (275:27): [True: 0, False: 1.89k]
  |  Branch (275:38): [True: 0, False: 1.89k]
  ------------------
  276|  1.47k|    case 0xd4: case 0xd5: case 0xd6: case 0xd7:
  ------------------
  |  Branch (276:5): [True: 0, False: 1.89k]
  |  Branch (276:16): [True: 0, False: 1.89k]
  |  Branch (276:27): [True: 12, False: 1.87k]
  |  Branch (276:38): [True: 0, False: 1.89k]
  ------------------
  277|  1.47k|    case 0xd8: case 0xd9: case 0xda: case 0xdb:
  ------------------
  |  Branch (277:5): [True: 0, False: 1.89k]
  |  Branch (277:16): [True: 0, False: 1.89k]
  |  Branch (277:27): [True: 0, False: 1.89k]
  |  Branch (277:38): [True: 0, False: 1.89k]
  ------------------
  278|  1.48k|    case 0xdc: case 0xdd: case 0xde: case 0xdf:
  ------------------
  |  Branch (278:5): [True: 0, False: 1.89k]
  |  Branch (278:16): [True: 5, False: 1.88k]
  |  Branch (278:27): [True: 0, False: 1.89k]
  |  Branch (278:38): [True: 11, False: 1.87k]
  ------------------
  279|  1.48k|        l = 1;
  280|  1.48k|        break;
  281|     17|    case 0xe0: case 0xe1: case 0xe2: case 0xe3:
  ------------------
  |  Branch (281:5): [True: 17, False: 1.87k]
  |  Branch (281:16): [True: 0, False: 1.89k]
  |  Branch (281:27): [True: 0, False: 1.89k]
  |  Branch (281:38): [True: 0, False: 1.89k]
  ------------------
  282|     28|    case 0xe4: case 0xe5: case 0xe6: case 0xe7:
  ------------------
  |  Branch (282:5): [True: 0, False: 1.89k]
  |  Branch (282:16): [True: 0, False: 1.89k]
  |  Branch (282:27): [True: 11, False: 1.87k]
  |  Branch (282:38): [True: 0, False: 1.89k]
  ------------------
  283|     28|    case 0xe8: case 0xe9: case 0xea: case 0xeb:
  ------------------
  |  Branch (283:5): [True: 0, False: 1.89k]
  |  Branch (283:16): [True: 0, False: 1.89k]
  |  Branch (283:27): [True: 0, False: 1.89k]
  |  Branch (283:38): [True: 0, False: 1.89k]
  ------------------
  284|     30|    case 0xec: case 0xed: case 0xee: case 0xef:
  ------------------
  |  Branch (284:5): [True: 0, False: 1.89k]
  |  Branch (284:16): [True: 0, False: 1.89k]
  |  Branch (284:27): [True: 0, False: 1.89k]
  |  Branch (284:38): [True: 2, False: 1.88k]
  ------------------
  285|     30|        l = 2;
  286|     30|        break;
  287|     37|    case 0xf0: case 0xf1: case 0xf2: case 0xf3:
  ------------------
  |  Branch (287:5): [True: 20, False: 1.87k]
  |  Branch (287:16): [True: 0, False: 1.89k]
  |  Branch (287:27): [True: 0, False: 1.89k]
  |  Branch (287:38): [True: 17, False: 1.87k]
  ------------------
  288|     38|    case 0xf4: case 0xf5: case 0xf6: case 0xf7:
  ------------------
  |  Branch (288:5): [True: 0, False: 1.89k]
  |  Branch (288:16): [True: 0, False: 1.89k]
  |  Branch (288:27): [True: 0, False: 1.89k]
  |  Branch (288:38): [True: 1, False: 1.88k]
  ------------------
  289|     38|        l = 3;
  290|     38|        break;
  291|      0|    case 0xf8: case 0xf9: case 0xfa: case 0xfb:
  ------------------
  |  Branch (291:5): [True: 0, False: 1.89k]
  |  Branch (291:16): [True: 0, False: 1.89k]
  |  Branch (291:27): [True: 0, False: 1.89k]
  |  Branch (291:38): [True: 0, False: 1.89k]
  ------------------
  292|      0|        l = 4;
  293|      0|        break;
  294|      0|    case 0xfc: case 0xfd:
  ------------------
  |  Branch (294:5): [True: 0, False: 1.89k]
  |  Branch (294:16): [True: 0, False: 1.89k]
  ------------------
  295|      0|        l = 5;
  296|      0|        break;
  297|    333|    default:
  ------------------
  |  Branch (297:5): [True: 333, False: 1.55k]
  ------------------
  298|    333|        return -1;
  299|  1.89k|    }
  300|       |    /* check that we have enough characters */
  301|  1.55k|    if (l > (max_len - 1))
  ------------------
  |  Branch (301:9): [True: 0, False: 1.55k]
  ------------------
  302|      0|        return -1;
  303|  1.55k|    c &= utf8_first_code_mask[l - 1];
  304|  2.92k|    for(i = 0; i < l; i++) {
  ------------------
  |  Branch (304:16): [True: 1.58k, False: 1.34k]
  ------------------
  305|  1.58k|        b = *p++;
  306|  1.58k|        if (b < 0x80 || b >= 0xc0)
  ------------------
  |  Branch (306:13): [True: 89, False: 1.49k]
  |  Branch (306:25): [True: 126, False: 1.36k]
  ------------------
  307|    215|            return -1;
  308|  1.36k|        c = (c << 6) | (b & 0x3f);
  309|  1.36k|    }
  310|  1.34k|    if (c < utf8_min_code[l - 1])
  ------------------
  |  Branch (310:9): [True: 0, False: 1.34k]
  ------------------
  311|      0|        return -1;
  312|  1.34k|    *pp = p;
  313|  1.34k|    return c;
  314|  1.34k|}
rqsort:
  523|     22|{
  524|     22|    struct { uint8_t *base; size_t count; int depth; } stack[50], *sp = stack;
  525|     22|    uint8_t *ptr, *pi, *pj, *plt, *pgt, *top, *m;
  526|     22|    size_t m4, i, lt, gt, span, span2;
  527|     22|    int c, depth;
  528|     22|    exchange_f swap = exchange_func(base, size);
  529|     22|    exchange_f swap_block = exchange_func(base, size | 128);
  530|       |
  531|     22|    if (nmemb < 2 || size <= 0)
  ------------------
  |  Branch (531:9): [True: 0, False: 22]
  |  Branch (531:22): [True: 0, False: 22]
  ------------------
  532|      0|        return;
  533|       |
  534|     22|    sp->base = (uint8_t *)base;
  535|     22|    sp->count = nmemb;
  536|     22|    sp->depth = 0;
  537|     22|    sp++;
  538|       |
  539|    242|    while (sp > stack) {
  ------------------
  |  Branch (539:12): [True: 220, False: 22]
  ------------------
  540|    220|        sp--;
  541|    220|        ptr = sp->base;
  542|    220|        nmemb = sp->count;
  543|    220|        depth = sp->depth;
  544|       |
  545|    418|        while (nmemb > 6) {
  ------------------
  |  Branch (545:16): [True: 198, False: 220]
  ------------------
  546|    198|            if (++depth > 50) {
  ------------------
  |  Branch (546:17): [True: 0, False: 198]
  ------------------
  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|    198|            m4 = (nmemb >> 2) * size;
  555|    198|            m = med3(ptr + m4, ptr + 2 * m4, ptr + 3 * m4, cmp, opaque);
  556|    198|            swap(ptr, m, size);  /* move the pivot to the start or the array */
  557|    198|            i = lt = 1;
  558|    198|            pi = plt = ptr + size;
  559|    198|            gt = nmemb;
  560|    198|            pj = pgt = top = ptr + nmemb * size;
  561|  1.00k|            for (;;) {
  562|  1.94k|                while (pi < pj && (c = cmp(ptr, pi, opaque)) >= 0) {
  ------------------
  |  Branch (562:24): [True: 1.85k, False: 88]
  |  Branch (562:35): [True: 946, False: 913]
  ------------------
  563|    946|                    if (c == 0) {
  ------------------
  |  Branch (563:25): [True: 0, False: 946]
  ------------------
  564|      0|                        swap(plt, pi, size);
  565|      0|                        lt++;
  566|      0|                        plt += size;
  567|      0|                    }
  568|    946|                    i++;
  569|    946|                    pi += size;
  570|    946|                }
  571|  2.09k|                while (pi < (pj -= size) && (c = cmp(ptr, pj, opaque)) <= 0) {
  ------------------
  |  Branch (571:24): [True: 1.89k, False: 198]
  |  Branch (571:45): [True: 1.08k, False: 803]
  ------------------
  572|  1.08k|                    if (c == 0) {
  ------------------
  |  Branch (572:25): [True: 0, False: 1.08k]
  ------------------
  573|      0|                        gt--;
  574|      0|                        pgt -= size;
  575|      0|                        swap(pgt, pj, size);
  576|      0|                    }
  577|  1.08k|                }
  578|  1.00k|                if (pi >= pj)
  ------------------
  |  Branch (578:21): [True: 198, False: 803]
  ------------------
  579|    198|                    break;
  580|    803|                swap(pi, pj, size);
  581|    803|                i++;
  582|    803|                pi += size;
  583|    803|            }
  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|    198|            span = plt - ptr;
  595|    198|            span2 = pi - plt;
  596|    198|            lt = i - lt;
  597|    198|            if (span > span2)
  ------------------
  |  Branch (597:17): [True: 0, False: 198]
  ------------------
  598|      0|                span = span2;
  599|    198|            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|    198|            span = top - pgt;
  604|    198|            span2 = pgt - pi;
  605|    198|            pgt = top - span2;
  606|    198|            gt = nmemb - (gt - i);
  607|    198|            if (span > span2)
  ------------------
  |  Branch (607:17): [True: 0, False: 198]
  ------------------
  608|      0|                span = span2;
  609|    198|            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|    198|            if (lt > nmemb - gt) {
  ------------------
  |  Branch (618:17): [True: 66, False: 132]
  ------------------
  619|     66|                sp->base = ptr;
  620|     66|                sp->count = lt;
  621|     66|                sp->depth = depth;
  622|     66|                sp++;
  623|     66|                ptr = pgt;
  624|     66|                nmemb -= gt;
  625|    132|            } else {
  626|    132|                sp->base = pgt;
  627|    132|                sp->count = nmemb - gt;
  628|    132|                sp->depth = depth;
  629|    132|                sp++;
  630|    132|                nmemb = lt;
  631|    132|            }
  632|    198|        }
  633|       |        /* Use insertion sort for small fragments */
  634|    880|        for (pi = ptr + size, top = ptr + nmemb * size; pi < top; pi += size) {
  ------------------
  |  Branch (634:57): [True: 660, False: 220]
  ------------------
  635|  1.25k|            for (pj = pi; pj > ptr && cmp(pj - size, pj, opaque) > 0; pj -= size)
  ------------------
  |  Branch (635:27): [True: 1.07k, False: 176]
  |  Branch (635:39): [True: 594, False: 484]
  ------------------
  636|    594|                swap(pj, pj - size, size);
  637|    660|        }
  638|    220|    }
  639|     22|}
cutils.c:exchange_func:
  446|     44|static inline exchange_f exchange_func(const void *base, size_t size) {
  447|     44|    switch (((uintptr_t)base | (uintptr_t)size) & 15) {
  448|     22|    case 0:
  ------------------
  |  Branch (448:5): [True: 22, False: 22]
  ------------------
  449|     22|        if (size == sizeof(uint64_t) * 2)
  ------------------
  |  Branch (449:13): [True: 11, False: 11]
  ------------------
  450|     11|            return exchange_one_int128;
  451|     11|        else
  452|     11|            return exchange_int128s;
  453|     22|    case 8:
  ------------------
  |  Branch (453:5): [True: 22, False: 22]
  ------------------
  454|     22|        if (size == sizeof(uint64_t))
  ------------------
  |  Branch (454:13): [True: 0, False: 22]
  ------------------
  455|      0|            return exchange_one_int64;
  456|     22|        else
  457|     22|            return exchange_int64s;
  458|      0|    case 4:
  ------------------
  |  Branch (458:5): [True: 0, False: 44]
  ------------------
  459|      0|    case 12:
  ------------------
  |  Branch (459:5): [True: 0, False: 44]
  ------------------
  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: 44]
  ------------------
  465|      0|    case 6:
  ------------------
  |  Branch (465:5): [True: 0, False: 44]
  ------------------
  466|      0|    case 10:
  ------------------
  |  Branch (466:5): [True: 0, False: 44]
  ------------------
  467|      0|    case 14:
  ------------------
  |  Branch (467:5): [True: 0, False: 44]
  ------------------
  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: 44]
  ------------------
  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|     44|    }
  478|     44|}
cutils.c:exchange_one_int128:
  435|    440|static void exchange_one_int128(void *a, void *b, size_t size) {
  436|    440|    uint64_t *ap = (uint64_t *)a;
  437|    440|    uint64_t *bp = (uint64_t *)b;
  438|    440|    uint64_t t = ap[0];
  439|    440|    uint64_t u = ap[1];
  440|    440|    ap[0] = bp[0];
  441|    440|    ap[1] = bp[1];
  442|    440|    bp[0] = t;
  443|    440|    bp[1] = u;
  444|    440|}
cutils.c:exchange_int128s:
  421|     88|static void exchange_int128s(void *a, void *b, size_t size) {
  422|     88|    uint64_t *ap = (uint64_t *)a;
  423|     88|    uint64_t *bp = (uint64_t *)b;
  424|       |
  425|    132|    for (size /= sizeof(uint64_t) * 2; size-- != 0; ap += 2, bp += 2) {
  ------------------
  |  Branch (425:40): [True: 44, False: 88]
  ------------------
  426|     44|        uint64_t t = ap[0];
  427|     44|        uint64_t u = ap[1];
  428|     44|        ap[0] = bp[0];
  429|     44|        ap[1] = bp[1];
  430|     44|        bp[0] = t;
  431|     44|        bp[1] = u;
  432|     44|    }
  433|     88|}
cutils.c:exchange_int64s:
  402|  1.46k|static void exchange_int64s(void *a, void *b, size_t size) {
  403|  1.46k|    uint64_t *ap = (uint64_t *)a;
  404|  1.46k|    uint64_t *bp = (uint64_t *)b;
  405|       |
  406|  4.08k|    for (size /= sizeof(uint64_t); size-- != 0;) {
  ------------------
  |  Branch (406:36): [True: 2.61k, False: 1.46k]
  ------------------
  407|  2.61k|        uint64_t t = *ap;
  408|  2.61k|        *ap++ = *bp;
  409|  2.61k|        *bp++ = t;
  410|  2.61k|    }
  411|  1.46k|}
cutils.c:med3:
  515|    198|{
  516|    198|    return cmp(a, b, opaque) < 0 ?
  ------------------
  |  Branch (516:12): [True: 110, False: 88]
  ------------------
  517|    110|        (cmp(b, c, opaque) < 0 ? b : (cmp(a, c, opaque) < 0 ? c : a )) :
  ------------------
  |  Branch (517:10): [True: 44, False: 66]
  |  Branch (517:39): [True: 33, False: 33]
  ------------------
  518|    198|        (cmp(b, c, opaque) > 0 ? b : (cmp(a, c, opaque) < 0 ? a : c ));
  ------------------
  |  Branch (518:10): [True: 33, False: 55]
  |  Branch (518:39): [True: 22, False: 33]
  ------------------
  519|    198|}

quickjs.c:max_int:
   81|  1.37k|{
   82|  1.37k|    if (a > b)
  ------------------
  |  Branch (82:9): [True: 327, False: 1.04k]
  ------------------
   83|    327|        return a;
   84|  1.04k|    else
   85|  1.04k|        return b;
   86|  1.37k|}
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|    627|{
  342|    627|    return (c >> 10) == (0xD800 >> 10); // 0xD800-0xDBFF
  343|    627|}
quickjs.c:clz32:
  130|    968|{
  131|    968|    return __builtin_clz(a);
  132|    968|}
quickjs.c:get_u32:
  180|    588|{
  181|    588|    return ((const struct packed_u32 *)tab)->v;
  182|    588|}
quickjs.c:dbuf_putc:
  277|  1.30k|{
  278|  1.30k|    if (unlikely((s->allocated_size - s->size) < 1)) {
  ------------------
  |  |   33|  1.30k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 345, False: 958]
  |  |  ------------------
  ------------------
  279|    345|        return __dbuf_putc(s, val);
  280|    958|    } else {
  281|    958|        s->buf[s->size++] = val;
  282|    958|        return 0;
  283|    958|    }
  284|  1.30k|}
quickjs.c:dbuf_error:
  322|    191|static inline BOOL dbuf_error(DynBuf *s) {
  323|    191|    return s->error;
  324|    191|}
quickjs.c:get_u16:
  195|    230|{
  196|    230|    return ((const struct packed_u16 *)tab)->v;
  197|    230|}
quickjs.c:dbuf_put_u16:
  287|    341|{
  288|    341|    if (unlikely((s->allocated_size - s->size) < 2)) {
  ------------------
  |  |   33|    341|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 61, False: 280]
  |  |  ------------------
  ------------------
  289|     61|        return __dbuf_put_u16(s, val);
  290|    280|    } else {
  291|    280|        put_u16(s->buf + s->size, val);
  292|    280|        s->size += 2;
  293|    280|        return 0;
  294|    280|    }
  295|    341|}
quickjs.c:put_u16:
  205|    280|{
  206|    280|    ((struct packed_u16 *)tab)->v = val;
  207|    280|}
quickjs.c:put_u32:
  190|    390|{
  191|    390|    ((struct packed_u32 *)tab)->v = val;
  192|    390|}
quickjs.c:from_hex:
  366|  36.6k|{
  367|  36.6k|    if (c >= '0' && c <= '9')
  ------------------
  |  Branch (367:9): [True: 36.6k, False: 0]
  |  Branch (367:21): [True: 26.9k, False: 9.70k]
  ------------------
  368|  26.9k|        return c - '0';
  369|  9.70k|    else if (c >= 'A' && c <= 'F')
  ------------------
  |  Branch (369:14): [True: 7.75k, False: 1.95k]
  |  Branch (369:26): [True: 0, False: 7.75k]
  ------------------
  370|      0|        return c - 'A' + 10;
  371|  9.70k|    else if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (371:14): [True: 7.75k, False: 1.95k]
  |  Branch (371:26): [True: 5.81k, False: 1.93k]
  ------------------
  372|  5.81k|        return c - 'a' + 10;
  373|  3.88k|    else
  374|  3.88k|        return -1;
  375|  36.6k|}
quickjs.c:min_int:
   89|  5.75k|{
   90|  5.75k|    if (a < b)
  ------------------
  |  Branch (90:9): [True: 2.10k, False: 3.65k]
  ------------------
   91|  2.10k|        return a;
   92|  3.65k|    else
   93|  3.65k|        return b;
   94|  5.75k|}
quickjs.c:dbuf_put_u32:
  298|    480|{
  299|    480|    if (unlikely((s->allocated_size - s->size) < 4)) {
  ------------------
  |  |   33|    480|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 137, False: 343]
  |  |  ------------------
  ------------------
  300|    137|        return __dbuf_put_u32(s, val);
  301|    343|    } else {
  302|    343|        put_u32(s->buf + s->size, val);
  303|    343|        s->size += 4;
  304|    343|        return 0;
  305|    343|    }
  306|    480|}
quickjs.c:put_u8:
  220|     16|{
  221|     16|    *tab = val;
  222|     16|}
quickjs.c:get_i32:
  185|      3|{
  186|      3|    return (int32_t)((const struct packed_u32 *)tab)->v;
  187|      3|}
dtoa.c:clz32:
  130|     14|{
  131|     14|    return __builtin_clz(a);
  132|     14|}
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|      2|{
   82|      2|    if (a > b)
  ------------------
  |  Branch (82:9): [True: 2, False: 0]
  ------------------
   83|      2|        return a;
   84|      0|    else
   85|      0|        return b;
   86|      2|}
dtoa.c:ctz32:
  142|     17|{
  143|     17|    return __builtin_ctz(a);
  144|     17|}
dtoa.c:min_int:
   89|      3|{
   90|      3|    if (a < b)
  ------------------
  |  Branch (90:9): [True: 3, False: 0]
  ------------------
   91|      3|        return a;
   92|      0|    else
   93|      0|        return b;
   94|      3|}
dtoa.c:uint64_as_float64:
  392|     16|{
  393|     16|    union {
  394|     16|        double d;
  395|     16|        uint64_t u64;
  396|     16|    } u;
  397|     16|    u.u64 = u64;
  398|     16|    return u.d;
  399|     16|}
cutils.c:memcpy_no_ub:
   75|  1.06k|static inline void memcpy_no_ub(void *dest, const void *src, size_t n) {
   76|  1.06k|    if (n)
  ------------------
  |  Branch (76:9): [True: 1.06k, False: 0]
  ------------------
   77|  1.06k|        memcpy(dest, src, n);
   78|  1.06k|}

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|     16|{
 1357|     16|    uint64_t *mptr = tmp_mem->mem;
 1358|     16|    const char *p, *p_start;
 1359|     16|    limb_t cur_limb, radix_base, extra_digits;
 1360|     16|    int is_neg, digit_count, limb_digit_count, digits_per_limb, sep, radix1, radix_shift;
 1361|     16|    int radix_bits, expn, e, max_digits, expn_offset, dot_pos, sig_pos, pos;
 1362|     16|    mpb_t *tmp0;
 1363|     16|    double dval;
 1364|     16|    BOOL is_bin_exp, is_zero, expn_overflow;
 1365|     16|    uint64_t m, a;
 1366|       |
 1367|     16|    tmp0 = dtoa_malloc(&mptr, sizeof(mpb_t) + sizeof(limb_t) * DBIGNUM_LEN_MAX);
  ------------------
  |  |   64|     16|#define DBIGNUM_LEN_MAX 52 /* ~ 2^(1072+53)*36^100 (dtoa) */
  ------------------
 1368|     16|    assert((mptr - tmp_mem->mem) <= sizeof(JSATODTempMem) / sizeof(mptr[0]));
  ------------------
  |  Branch (1368:5): [True: 0, False: 16]
  |  Branch (1368:5): [True: 16, False: 0]
  ------------------
 1369|       |    /* optional separator between digits */
 1370|     16|    sep = (flags & JS_ATOD_ACCEPT_UNDERSCORES) ? '_' : 256;
  ------------------
  |  |   55|     16|#define JS_ATOD_ACCEPT_UNDERSCORES  (1 << 3)
  ------------------
  |  Branch (1370:11): [True: 0, False: 16]
  ------------------
 1371|       |
 1372|     16|    p = str;
 1373|     16|    is_neg = 0;
 1374|     16|    if (p[0] == '+') {
  ------------------
  |  Branch (1374:9): [True: 0, False: 16]
  ------------------
 1375|      0|        p++;
 1376|      0|        p_start = p;
 1377|     16|    } else if (p[0] == '-') {
  ------------------
  |  Branch (1377:16): [True: 0, False: 16]
  ------------------
 1378|      0|        is_neg = 1;
 1379|      0|        p++;
 1380|      0|        p_start = p;
 1381|     16|    } else {
 1382|     16|        p_start = p;
 1383|     16|    }
 1384|       |    
 1385|     16|    if (p[0] == '0') {
  ------------------
  |  Branch (1385:9): [True: 2, False: 14]
  ------------------
 1386|      2|        if ((p[1] == 'x' || p[1] == 'X') &&
  ------------------
  |  Branch (1386:14): [True: 0, False: 2]
  |  Branch (1386:29): [True: 0, False: 2]
  ------------------
 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|      2|        } else if ((p[1] == 'o' || p[1] == 'O') &&
  ------------------
  |  Branch (1390:21): [True: 0, False: 2]
  |  Branch (1390:36): [True: 0, False: 2]
  ------------------
 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|      2|        } else if ((p[1] == 'b' || p[1] == 'B') &&
  ------------------
  |  Branch (1394:21): [True: 0, False: 2]
  |  Branch (1394:36): [True: 0, False: 2]
  ------------------
 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|      2|        } else if ((p[1] >= '0' && p[1] <= '9') &&
  ------------------
  |  Branch (1398:21): [True: 0, False: 2]
  |  Branch (1398:36): [True: 0, False: 0]
  ------------------
 1399|      0|                   radix == 0 && (flags & JS_ATOD_ACCEPT_LEGACY_OCTAL)) {
  ------------------
  |  |   53|      0|#define JS_ATOD_ACCEPT_LEGACY_OCTAL  (1 << 2)
  ------------------
  |  Branch (1399:20): [True: 0, False: 0]
  |  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|      2|        } else {
 1409|      2|            goto no_prefix;
 1410|      2|        }
 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|      2|    no_prefix: ;
 1415|     14|    } else {
 1416|     14|        if (!(flags & JS_ATOD_INT_ONLY) && strstart(p, "Infinity", &p))
  ------------------
  |  |   49|     14|#define JS_ATOD_INT_ONLY       (1 << 0)
  ------------------
  |  Branch (1416:13): [True: 10, False: 4]
  |  Branch (1416:44): [True: 0, False: 10]
  ------------------
 1417|      0|            goto overflow;
 1418|     14|    }
 1419|     16|    if (radix == 0)
  ------------------
  |  Branch (1419:9): [True: 0, False: 16]
  ------------------
 1420|      0|        radix = 10;
 1421|       |
 1422|     16|    cur_limb = 0;
 1423|     16|    expn_offset = 0;
 1424|     16|    digit_count = 0;
 1425|     16|    limb_digit_count = 0;
 1426|     16|    max_digits = atod_max_digits_table[radix - 2];
 1427|     16|    digits_per_limb = digits_per_limb_table[radix - 2];
 1428|     16|    radix_base = radix_base_table[radix - 2];
 1429|     16|    radix_shift = ctz32(radix);
 1430|     16|    radix1 = radix >> radix_shift;
 1431|     16|    if (radix1 == 1) {
  ------------------
  |  Branch (1431:9): [True: 1, False: 15]
  ------------------
 1432|       |        /* radix = 2^radix_bits */
 1433|      1|        radix_bits = radix_shift;
 1434|     15|    } else {
 1435|     15|        radix_bits = 0;
 1436|     15|    }
 1437|     16|    tmp0->len = 1;
 1438|     16|    tmp0->tab[0] = 0;
 1439|     16|    extra_digits = 0;
 1440|     16|    pos = 0;
 1441|     16|    dot_pos = -1;
 1442|       |    /* skip leading zeros */
 1443|     18|    for(;;) {
 1444|     18|        if (*p == '.' && (p > p_start || to_digit(p[1]) < radix) &&
  ------------------
  |  Branch (1444:13): [True: 0, False: 18]
  |  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|     18|        if (*p == sep && p > p_start && p[1] == '0')
  ------------------
  |  Branch (1453:13): [True: 0, False: 18]
  |  Branch (1453:26): [True: 0, False: 0]
  |  Branch (1453:41): [True: 0, False: 0]
  ------------------
 1454|      0|            p++;
 1455|     18|        if (*p != '0')
  ------------------
  |  Branch (1455:13): [True: 16, False: 2]
  ------------------
 1456|     16|            break;
 1457|      2|        p++;
 1458|      2|        pos++;
 1459|      2|    }
 1460|       |    
 1461|     16|    sig_pos = pos;
 1462|  2.09M|    for(;;) {
 1463|  2.09M|        limb_t c;
 1464|  2.09M|        if (*p == '.' && (p > p_start || to_digit(p[1]) < radix) &&
  ------------------
  |  Branch (1464:13): [True: 10, False: 2.09M]
  |  Branch (1464:27): [True: 10, False: 0]
  |  Branch (1464:42): [True: 0, False: 0]
  ------------------
 1465|     10|            !(flags & JS_ATOD_INT_ONLY)) {
  ------------------
  |  |   49|     10|#define JS_ATOD_INT_ONLY       (1 << 0)
  ------------------
  |  Branch (1465:13): [True: 10, False: 0]
  ------------------
 1466|     10|            if (*p == sep)
  ------------------
  |  Branch (1466:17): [True: 0, False: 10]
  ------------------
 1467|      0|                goto fail;
 1468|     10|            if (dot_pos >= 0)
  ------------------
  |  Branch (1468:17): [True: 0, False: 10]
  ------------------
 1469|      0|                break;
 1470|     10|            dot_pos = pos;
 1471|     10|            p++;
 1472|     10|        }
 1473|  2.09M|        if (*p == sep && p > p_start && to_digit(p[1]) < radix)
  ------------------
  |  Branch (1473:13): [True: 0, False: 2.09M]
  |  Branch (1473:26): [True: 0, False: 0]
  |  Branch (1473:41): [True: 0, False: 0]
  ------------------
 1474|      0|            p++;
 1475|  2.09M|        c = to_digit(*p);
 1476|  2.09M|        if (c >= radix)
  ------------------
  |  Branch (1476:13): [True: 16, False: 2.09M]
  ------------------
 1477|     16|            break;
 1478|  2.09M|        p++;
 1479|  2.09M|        pos++;
 1480|  2.09M|        if (digit_count < max_digits) {
  ------------------
  |  Branch (1480:13): [True: 73, False: 2.09M]
  ------------------
 1481|       |            /* XXX: could be faster when radix_bits != 0 */
 1482|     73|            cur_limb = cur_limb * radix + c;
 1483|     73|            limb_digit_count++;
 1484|     73|            if (limb_digit_count == digits_per_limb) {
  ------------------
  |  Branch (1484:17): [True: 6, False: 67]
  ------------------
 1485|      6|                mpb_mul1_base(tmp0, radix_base, cur_limb);
 1486|      6|                cur_limb = 0;
 1487|      6|                limb_digit_count = 0;
 1488|      6|            }
 1489|     73|            digit_count++;
 1490|  2.09M|        } else {
 1491|  2.09M|            extra_digits |= c;
 1492|  2.09M|        }
 1493|  2.09M|    }
 1494|     16|    if (limb_digit_count != 0) {
  ------------------
  |  Branch (1494:9): [True: 13, False: 3]
  ------------------
 1495|     13|        mpb_mul1_base(tmp0, pow_ui(radix, limb_digit_count), cur_limb);
 1496|     13|    }
 1497|     16|    if (digit_count == 0) {
  ------------------
  |  Branch (1497:9): [True: 2, False: 14]
  ------------------
 1498|      2|        is_zero = TRUE;
 1499|      2|        expn_offset = 0;
 1500|     14|    } else {
 1501|     14|        is_zero = FALSE;
 1502|     14|        if (dot_pos < 0)
  ------------------
  |  Branch (1502:13): [True: 4, False: 10]
  ------------------
 1503|      4|            dot_pos = pos;
 1504|     14|        expn_offset = sig_pos + digit_count - dot_pos;
 1505|     14|    }
 1506|       |    
 1507|       |    /* Use the extra digits for rounding if the base is a power of
 1508|       |       two. Otherwise they are just truncated. */
 1509|     16|    if (radix_bits != 0 && extra_digits != 0) {
  ------------------
  |  Branch (1509:9): [True: 1, False: 15]
  |  Branch (1509:28): [True: 1, False: 0]
  ------------------
 1510|      1|        tmp0->tab[0] |= 1;
 1511|      1|    }
 1512|       |    
 1513|       |    /* parse the exponent, if any */
 1514|     16|    expn = 0;
 1515|     16|    expn_overflow = FALSE;
 1516|     16|    is_bin_exp = FALSE;
 1517|     16|    if (!(flags & JS_ATOD_INT_ONLY) &&
  ------------------
  |  |   49|     16|#define JS_ATOD_INT_ONLY       (1 << 0)
  ------------------
  |  Branch (1517:9): [True: 10, False: 6]
  ------------------
 1518|     10|        ((radix == 10 && (*p == 'e' || *p == 'E')) ||
  ------------------
  |  Branch (1518:11): [True: 10, False: 0]
  |  Branch (1518:27): [True: 0, False: 10]
  |  Branch (1518:40): [True: 0, False: 10]
  ------------------
 1519|     10|         (radix != 10 && (*p == '@' ||
  ------------------
  |  Branch (1519:11): [True: 0, False: 10]
  |  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|     16|    if (p == p_start)
  ------------------
  |  Branch (1565:9): [True: 0, False: 16]
  ------------------
 1566|      0|        goto fail;
 1567|       |
 1568|     16|    if (is_zero) {
  ------------------
  |  Branch (1568:9): [True: 2, False: 14]
  ------------------
 1569|      2|        a = 0;
 1570|     14|    } else {
 1571|     14|        int expn1;
 1572|     14|        if (radix_bits != 0) {
  ------------------
  |  Branch (1572:13): [True: 1, False: 13]
  ------------------
 1573|      1|            if (!is_bin_exp)
  ------------------
  |  Branch (1573:17): [True: 1, False: 0]
  ------------------
 1574|      1|                expn *= radix_bits;
 1575|      1|            expn -= expn_offset * radix_bits;
 1576|      1|            expn1 = expn + digit_count * radix_bits;
 1577|      1|            if (expn1 >= 1024 + radix_bits)
  ------------------
  |  Branch (1577:17): [True: 1, False: 0]
  ------------------
 1578|      1|                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|     13|        } else {
 1583|     13|            expn -= expn_offset;
 1584|     13|            expn1 = expn + digit_count;
 1585|     13|            if (expn1 >= max_exponent[radix - 2] + 1)
  ------------------
  |  Branch (1585:17): [True: 1, False: 12]
  ------------------
 1586|      1|                goto overflow;
 1587|     12|            else if (expn1 <= min_exponent[radix - 2])
  ------------------
  |  Branch (1587:22): [True: 0, False: 12]
  ------------------
 1588|      0|                goto underflow;
 1589|     12|            m = mul_pow_round_to_d(&e, tmp0, radix1, radix_shift, expn, JS_RNDN);
 1590|     12|        }
 1591|     12|        if (m == 0) {
  ------------------
  |  Branch (1591:13): [True: 0, False: 12]
  ------------------
 1592|      0|        underflow:
 1593|      0|            a = 0;
 1594|     12|        } else if (e > 1024) {
  ------------------
  |  Branch (1594:20): [True: 0, False: 12]
  ------------------
 1595|      2|        overflow:
 1596|       |            /* overflow */
 1597|      2|            a = (uint64_t)0x7ff << 52;
 1598|     12|        } else if (e < -1073) {
  ------------------
  |  Branch (1598:20): [True: 0, False: 12]
  ------------------
 1599|       |            /* underflow */
 1600|       |            /* XXX: check rounding */
 1601|      0|            a = 0;
 1602|     12|        } else if (e < -1021) {
  ------------------
  |  Branch (1602:20): [True: 0, False: 12]
  ------------------
 1603|       |            /* subnormal */
 1604|      0|            a = m >> (-e - 1021);
 1605|     12|        } else {
 1606|     12|            a = ((uint64_t)(e + 1022) << 52) | (m & (((uint64_t)1 << 52) - 1));
 1607|     12|        }
 1608|     12|    }
 1609|     16| done:
 1610|     16|    a |= (uint64_t)is_neg << 63;
 1611|     16|    dval = uint64_as_float64(a);
 1612|     16| done1:
 1613|     16|    if (pnext)
  ------------------
  |  Branch (1613:9): [True: 0, False: 16]
  ------------------
 1614|      0|        *pnext = p;
 1615|     16|    dtoa_free(tmp0);
 1616|     16|    return dval;
 1617|      0| fail:
 1618|       |    dval = NAN;
 1619|      0|    goto done1;
 1620|     16|}
dtoa.c:dtoa_malloc:
 1095|     18|{
 1096|     18|    void *ret;
 1097|     18|    ret = *pptr;
 1098|     18|    *pptr += (size + 7) / 8;
 1099|     18|    return ret;
 1100|     18|}
dtoa.c:pow_ui:
  243|     13|{
  244|     13|    int i, n_bits;
  245|     13|    uint64_t r;
  246|     13|    if (b == 0)
  ------------------
  |  Branch (246:9): [True: 0, False: 13]
  ------------------
  247|      0|        return 1;
  248|     13|    if (b == 1)
  ------------------
  |  Branch (248:9): [True: 10, False: 3]
  ------------------
  249|     10|        return a;
  250|      3|#ifdef USE_POW5_TABLE
  251|      3|    if ((a == 5 || a == 10) && b <= 17) {
  ------------------
  |  Branch (251:10): [True: 0, False: 3]
  |  Branch (251:20): [True: 3, False: 0]
  |  Branch (251:32): [True: 3, False: 0]
  ------------------
  252|      3|        r = pow5_table[b - 1];
  253|      3|        if (b >= 14) {
  ------------------
  |  Branch (253:13): [True: 0, False: 3]
  ------------------
  254|      0|            r |= (uint64_t)pow5h_table[b - 14] << 32;
  255|      0|        }
  256|      3|        if (a == 10)
  ------------------
  |  Branch (256:13): [True: 3, False: 0]
  ------------------
  257|      3|            r <<= b;
  258|      3|        return r;
  259|      3|    }
  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|      3|}
dtoa.c:mpb_get_u64:
  435|     12|{
  436|       |#if LIMB_BITS == 64
  437|       |    return r->tab[0];
  438|       |#else
  439|     12|    if (r->len == 1) {
  ------------------
  |  Branch (439:9): [True: 0, False: 12]
  ------------------
  440|      0|        return r->tab[0];
  441|     12|    } else {
  442|     12|        return r->tab[0] | ((uint64_t)r->tab[1] << LIMB_BITS);
  ------------------
  |  |   54|     12|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|     12|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  443|     12|    }
  444|     12|#endif
  445|     12|}
dtoa.c:mul_pow_round_to_d:
 1008|     12|{
 1009|     12|    int e_offset;
 1010|       |
 1011|     12|    e_offset = mul_pow(a, radix1, radix_shift, f, FALSE, 55);
 1012|     12|    return round_to_d(pe, a, e_offset, rnd_mode);
 1013|     12|}
dtoa.c:mpb_renorm:
  215|     19|{
  216|     32|    while (r->len > 1 && r->tab[r->len - 1] == 0)
  ------------------
  |  Branch (216:12): [True: 20, False: 12]
  |  Branch (216:26): [True: 13, False: 7]
  ------------------
  217|     13|        r->len--;
  218|     19|}
dtoa.c:mul_pow:
  894|     12|{
  895|     12|    int e_offset, d, n, n0;
  896|       |
  897|     12|    e_offset = -f * radix_shift;
  898|     12|    if (radix1 != 1) {
  ------------------
  |  Branch (898:9): [True: 12, False: 0]
  ------------------
  899|     12|        d = digits_per_limb_table[radix1 - 2];
  900|     12|        if (f >= 0) {
  ------------------
  |  Branch (900:13): [True: 11, False: 1]
  ------------------
  901|     11|            limb_t h, b;
  902|       |            
  903|     11|            b = 0;
  904|     11|            n0 = 0;
  905|     11|            while (f != 0) {
  ------------------
  |  Branch (905:20): [True: 0, False: 11]
  ------------------
  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|     11|        } else {
  918|      1|            int extra_bits, l, shift;
  919|      1|            limb_t r, rem, b, b_inv;
  920|       |            
  921|      1|            f = -f;
  922|      1|            l = (f + d - 1) / d; /* high bound for the number of limbs (XXX: make it better) */
  923|      1|            e_offset += l * LIMB_BITS;
  ------------------
  |  |   54|      1|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      1|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  924|      1|            if (!is_int) {
  ------------------
  |  Branch (924:17): [True: 1, False: 0]
  ------------------
  925|       |                /* at least 'e' bits are needed in the final result for rounding */
  926|      1|                extra_bits = max_int(e - mpb_floor_log2(a), 0);
  927|      1|            } 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|      1|            e_offset += extra_bits;
  933|      1|            mpb_shr_round(a, -(l * LIMB_BITS + extra_bits), JS_RNDZ);
  ------------------
  |  |   54|      1|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      1|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  934|       |            
  935|      1|            b = 0;
  936|      1|            b_inv = 0;
  937|      1|            shift = 0;
  938|      1|            n0 = 0;
  939|      1|            rem = 0;
  940|      2|            while (f != 0) {
  ------------------
  |  Branch (940:20): [True: 1, False: 1]
  ------------------
  941|      1|                n = min_int(f, d);
  942|      1|                if (n != n0) {
  ------------------
  |  Branch (942:21): [True: 1, False: 0]
  ------------------
  943|      1|                    b = pow_ui_inv(&b_inv, &shift, radix1, n);
  944|      1|                    n0 = n;
  945|      1|                }
  946|      1|                r = mp_div1norm(a->tab, a->tab, a->len, b, 0, b_inv, shift);
  947|      1|                rem |= r;
  948|      1|                mpb_renorm(a);
  949|      1|                f -= n;
  950|      1|            }
  951|       |            /* if the remainder is non zero, use it for rounding */
  952|      1|            a->tab[0] |= (rem != 0);
  953|      1|        }
  954|     12|    }
  955|     12|    return e_offset;
  956|     12|}
dtoa.c:mp_mul1:
   94|      4|{
   95|      4|    limb_t i;
   96|      4|    dlimb_t t;
   97|       |
   98|     14|    for(i = 0; i < n; i++) {
  ------------------
  |  Branch (98:16): [True: 10, False: 4]
  ------------------
   99|     10|        t = (dlimb_t)taba[i] * (dlimb_t)b + l;
  100|     10|        tabr[i] = t;
  101|     10|        l = t >> LIMB_BITS;
  ------------------
  |  |   54|     10|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|     10|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  102|     10|    }
  103|      4|    return l;
  104|      4|}
dtoa.c:mpb_floor_log2:
  449|     13|{
  450|     13|    limb_t v;
  451|     13|    v = a->tab[a->len - 1];
  452|     13|    if (v == 0)
  ------------------
  |  Branch (452:9): [True: 0, False: 13]
  ------------------
  453|      0|        return -1;
  454|     13|    else
  455|     13|        return a->len * LIMB_BITS - 1 - clz32(v);
  ------------------
  |  |   54|     13|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|     13|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  456|     13|}
dtoa.c:pow_ui_inv:
  272|      1|{
  273|      1|    uint32_t r_inv, r;
  274|      1|    int shift;
  275|      1|#ifdef USE_POW5_TABLE
  276|      1|    if (a == 5 && b >= 1 && b <= 13) {
  ------------------
  |  Branch (276:9): [True: 1, False: 0]
  |  Branch (276:19): [True: 1, False: 0]
  |  Branch (276:29): [True: 1, False: 0]
  ------------------
  277|      1|        r = pow5_table[b - 1];
  278|      1|        shift = clz32(r);
  279|      1|        r <<= shift;
  280|      1|        r_inv = pow5_inv_table[b - 1];
  281|      1|    } 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|      1|    *pshift = shift;
  290|      1|    *pr_inv = r_inv;
  291|      1|    return r;
  292|      1|}
dtoa.c:mp_div1norm:
  188|      1|{
  189|      1|    slimb_t i;
  190|       |
  191|      1|    if (shift != 0) {
  ------------------
  |  Branch (191:9): [True: 1, False: 0]
  ------------------
  192|      1|        r = (r << shift) | mp_shl(tabr, taba, n, shift, 0);
  193|      1|    }
  194|      4|    for(i = n - 1; i >= 0; i--) {
  ------------------
  |  Branch (194:20): [True: 3, False: 1]
  ------------------
  195|      3|        tabr[i] = udiv1norm(&r, r, taba[i], b, b_inv);
  196|      3|    }
  197|      1|    r >>= shift;
  198|      1|    return r;
  199|      1|}
dtoa.c:mp_shl:
  172|     13|{
  173|     13|    mp_size_t i;
  174|     13|    limb_t l, a;
  175|       |
  176|     13|    assert(shift >= 1 && shift < LIMB_BITS);
  ------------------
  |  Branch (176:5): [True: 0, False: 13]
  |  Branch (176:5): [True: 0, False: 0]
  |  Branch (176:5): [True: 13, False: 0]
  |  Branch (176:5): [True: 13, False: 0]
  ------------------
  177|     13|    l = low;
  178|     28|    for(i = 0; i < n; i++) {
  ------------------
  |  Branch (178:16): [True: 15, False: 13]
  ------------------
  179|     15|        a = tab[i];
  180|     15|        tab_r[i] = (a << shift) | l;
  181|     15|        l = (a >> (LIMB_BITS - shift)); 
  ------------------
  |  |   54|     15|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|     15|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  182|     15|    }
  183|     13|    return l;
  184|     13|}
dtoa.c:udiv1norm:
  119|      3|{
  120|      3|    limb_t n1m, n_adj, q, r, ah;
  121|      3|    dlimb_t a;
  122|      3|    n1m = ((slimb_t)a0 >> (LIMB_BITS - 1));
  ------------------
  |  |   54|      3|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      3|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  123|      3|    n_adj = a0 + (n1m & d);
  124|      3|    a = (dlimb_t)d_inv * (a1 - n1m) + n_adj;
  125|      3|    q = (a >> LIMB_BITS) + a1;
  ------------------
  |  |   54|      3|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      3|#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|      3|    a = ((dlimb_t)a1 << LIMB_BITS) | a0;
  ------------------
  |  |   54|      3|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      3|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  129|      3|    a = a - (dlimb_t)q * d - d;
  130|      3|    ah = a >> LIMB_BITS;
  ------------------
  |  |   54|      3|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      3|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  131|      3|    q += 1 + ah;
  132|      3|    r = (limb_t)a + (ah & d);
  133|      3|    *pr = r;
  134|      3|    return q;
  135|      3|}
dtoa.c:mpb_shr_round:
  314|     13|{
  315|     13|    int l, i;
  316|       |
  317|     13|    if (shift == 0)
  ------------------
  |  Branch (317:9): [True: 0, False: 13]
  ------------------
  318|      0|        return;
  319|     13|    if (shift < 0) {
  ------------------
  |  Branch (319:9): [True: 12, False: 1]
  ------------------
  320|     12|        shift = -shift;
  321|     12|        l = (unsigned)shift / LIMB_BITS;
  ------------------
  |  |   54|     12|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|     12|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  322|     12|        shift = shift & (LIMB_BITS - 1);
  ------------------
  |  |   54|     12|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|     12|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  323|     12|        if (shift != 0) {
  ------------------
  |  Branch (323:13): [True: 12, False: 0]
  ------------------
  324|     12|            r->tab[r->len] = mp_shl(r->tab, r->tab, r->len, shift, 0);
  325|     12|            r->len++;
  326|     12|            mpb_renorm(r);
  327|     12|        }
  328|     12|        if (l > 0) {
  ------------------
  |  Branch (328:13): [True: 12, False: 0]
  ------------------
  329|     24|            for(i = r->len - 1; i >= 0; i--)
  ------------------
  |  Branch (329:33): [True: 12, False: 12]
  ------------------
  330|     12|                r->tab[i + l] = r->tab[i];
  331|     25|            for(i = 0; i < l; i++)
  ------------------
  |  Branch (331:24): [True: 13, False: 12]
  ------------------
  332|     13|                r->tab[i] = 0;
  333|     12|            r->len += l;
  334|     12|        }
  335|     12|    } else {
  336|      1|        limb_t bit1, bit2;
  337|      1|        int k, add_one;
  338|       |        
  339|      1|        switch(rnd_mode) {
  340|      0|        default:
  ------------------
  |  Branch (340:9): [True: 0, False: 1]
  ------------------
  341|      0|        case JS_RNDZ:
  ------------------
  |  Branch (341:9): [True: 0, False: 1]
  ------------------
  342|      0|            add_one = 0;
  343|      0|            break;
  344|      1|        case JS_RNDN:
  ------------------
  |  Branch (344:9): [True: 1, False: 0]
  ------------------
  345|      1|        case JS_RNDNA:
  ------------------
  |  Branch (345:9): [True: 0, False: 1]
  ------------------
  346|      1|            bit1 = mpb_get_bit(r, shift - 1);
  347|      1|            if (bit1) {
  ------------------
  |  Branch (347:17): [True: 1, False: 0]
  ------------------
  348|      1|                if (rnd_mode == JS_RNDNA) {
  ------------------
  |  Branch (348:21): [True: 0, False: 1]
  ------------------
  349|      0|                    bit2 = 1;
  350|      1|                } else {
  351|       |                    /* bit2 = oring of all the bits after bit1 */
  352|      1|                    bit2 = 0;
  353|      1|                    if (shift >= 2) {
  ------------------
  |  Branch (353:25): [True: 1, False: 0]
  ------------------
  354|      1|                        k = shift - 1;
  355|      1|                        l = (unsigned)k / LIMB_BITS;
  ------------------
  |  |   54|      1|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      1|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  356|      1|                        k = k & (LIMB_BITS - 1);
  ------------------
  |  |   54|      1|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      1|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  357|      2|                        for(i = 0; i < min_int(l, r->len); i++)
  ------------------
  |  Branch (357:36): [True: 1, False: 1]
  ------------------
  358|      1|                            bit2 |= r->tab[i];
  359|      1|                        if (l < r->len)
  ------------------
  |  Branch (359:29): [True: 1, False: 0]
  ------------------
  360|      1|                            bit2 |= r->tab[l] & (((limb_t)1 << k) - 1);
  361|      1|                    }
  362|      1|                }
  363|      1|                if (bit2) {
  ------------------
  |  Branch (363:21): [True: 1, False: 0]
  ------------------
  364|      1|                    add_one = 1;
  365|      1|                } else {
  366|       |                    /* round to even */
  367|      0|                    add_one = mpb_get_bit(r, shift);
  368|      0|                }
  369|      1|            } else {
  370|      0|                add_one = 0;
  371|      0|            }
  372|      1|            break;
  373|      1|        }
  374|       |
  375|      1|        l = (unsigned)shift / LIMB_BITS;
  ------------------
  |  |   54|      1|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      1|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  376|      1|        shift = shift & (LIMB_BITS - 1);
  ------------------
  |  |   54|      1|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      1|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  377|      1|        if (l >= r->len) {
  ------------------
  |  Branch (377:13): [True: 0, False: 1]
  ------------------
  378|      0|            r->len = 1;
  379|      0|            r->tab[0] = add_one;
  380|      1|        } else {
  381|      1|            if (l > 0) {
  ------------------
  |  Branch (381:17): [True: 1, False: 0]
  ------------------
  382|      1|                r->len -= l;
  383|      3|                for(i = 0; i < r->len; i++)
  ------------------
  |  Branch (383:28): [True: 2, False: 1]
  ------------------
  384|      2|                    r->tab[i] = r->tab[i + l];
  385|      1|            }
  386|      1|            if (shift != 0) {
  ------------------
  |  Branch (386:17): [True: 1, False: 0]
  ------------------
  387|      1|                mp_shr(r->tab, r->tab, r->len, shift, 0);
  388|      1|                mpb_renorm(r);
  389|      1|            }
  390|      1|            if (add_one) {
  ------------------
  |  Branch (390:17): [True: 1, False: 0]
  ------------------
  391|      1|                limb_t a;
  392|      1|                a = mp_add_ui(r->tab, 1, r->len);
  393|      1|                if (a)
  ------------------
  |  Branch (393:21): [True: 0, False: 1]
  ------------------
  394|      0|                    r->tab[r->len++] = a;
  395|      1|            }
  396|      1|        }
  397|      1|    }
  398|     13|}
dtoa.c:mpb_get_bit:
  301|      1|{
  302|      1|    int l;
  303|       |    
  304|      1|    l = (unsigned)k / LIMB_BITS;
  ------------------
  |  |   54|      1|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      1|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  305|      1|    k = k & (LIMB_BITS - 1);
  ------------------
  |  |   54|      1|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      1|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  306|      1|    if (l >= r->len)
  ------------------
  |  Branch (306:9): [True: 0, False: 1]
  ------------------
  307|      0|        return 0;
  308|      1|    else
  309|      1|        return (r->tab[l] >> k) & 1;
  310|      1|}
dtoa.c:mp_shr:
  154|      1|{
  155|      1|    mp_size_t i;
  156|      1|    limb_t l, a;
  157|       |
  158|      1|    assert(shift >= 1 && shift < LIMB_BITS);
  ------------------
  |  Branch (158:5): [True: 0, False: 1]
  |  Branch (158:5): [True: 0, False: 0]
  |  Branch (158:5): [True: 1, False: 0]
  |  Branch (158:5): [True: 1, False: 0]
  ------------------
  159|      1|    l = high;
  160|      3|    for(i = n - 1; i >= 0; i--) {
  ------------------
  |  Branch (160:20): [True: 2, False: 1]
  ------------------
  161|      2|        a = tab[i];
  162|      2|        tab_r[i] = (a >> shift) | (l << (LIMB_BITS - shift));
  ------------------
  |  |   54|      2|#define LIMB_BITS (1 << LIMB_LOG2_BITS)
  |  |  ------------------
  |  |  |  |   52|      2|#define LIMB_LOG2_BITS 5
  |  |  ------------------
  ------------------
  163|      2|        l = a;
  164|      2|    }
  165|      1|    return l & (((limb_t)1 << shift) - 1);
  166|      1|}
dtoa.c:mp_add_ui:
   76|      1|{
   77|      1|    size_t i;
   78|      1|    limb_t k, a;
   79|       |
   80|      1|    k=b;
   81|      2|    for(i=0;i<n;i++) {
  ------------------
  |  Branch (81:13): [True: 2, False: 0]
  ------------------
   82|      2|        if (k == 0)
  ------------------
  |  Branch (82:13): [True: 1, False: 1]
  ------------------
   83|      1|            break;
   84|      1|        a = tab[i] + k;
   85|      1|        k = (a < k);
   86|      1|        tab[i] = a;
   87|      1|    }
   88|      1|    return k;
   89|      1|}
dtoa.c:dtoa_free:
 1103|     18|{
 1104|     18|}
dtoa.c:to_digit:
 1321|  2.09M|{
 1322|  2.09M|    if (c >= '0' && c <= '9')
  ------------------
  |  Branch (1322:9): [True: 2.09M, False: 16]
  |  Branch (1322:21): [True: 1.04M, False: 1.04M]
  ------------------
 1323|  1.04M|        return c - '0';
 1324|  1.04M|    else if (c >= 'A' && c <= 'Z')
  ------------------
  |  Branch (1324:14): [True: 1.04M, False: 16]
  |  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: 16]
  |  Branch (1326:26): [True: 1.04M, False: 0]
  ------------------
 1327|  1.04M|        return c - 'a' + 10;
 1328|     16|    else
 1329|     16|        return 36;
 1330|  2.09M|}
dtoa.c:mpb_mul1_base:
 1334|     19|{
 1335|     19|    int i;
 1336|     19|    if (r->tab[0] == 0 && r->len == 1) {
  ------------------
  |  Branch (1336:9): [True: 14, False: 5]
  |  Branch (1336:27): [True: 14, False: 0]
  ------------------
 1337|     14|        r->tab[0] = a;
 1338|     14|    } else {
 1339|      5|        if (radix_base == 0) {
  ------------------
  |  Branch (1339:13): [True: 1, False: 4]
  ------------------
 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|      4|        } else {
 1345|      4|            r->tab[r->len] = mp_mul1(r->tab, r->tab, r->len,
 1346|      4|                                     radix_base, a);
 1347|      4|        }
 1348|      5|        r->len++;
 1349|      5|        mpb_renorm(r);
 1350|      5|    }
 1351|     19|}
dtoa.c:round_to_d:
  971|     12|{
  972|     12|    int e;
  973|     12|    uint64_t m;
  974|       |
  975|     12|    if (a->tab[0] == 0 && a->len == 1) {
  ------------------
  |  Branch (975:9): [True: 0, False: 12]
  |  Branch (975:27): [True: 0, False: 0]
  ------------------
  976|       |        /* zero result */
  977|      0|        m = 0;
  978|      0|        e = 0; /* don't care */
  979|     12|    } else {
  980|     12|        int prec, prec1, e_min;
  981|     12|        e = mpb_floor_log2(a) + 1 - e_offset;
  982|     12|        prec1 = 53;
  983|     12|        e_min = -1021;
  984|     12|        if (e < e_min) {
  ------------------
  |  Branch (984:13): [True: 0, False: 12]
  ------------------
  985|       |            /* subnormal result or zero */
  986|      0|            prec = prec1 - (e_min - e);
  987|     12|        } else {
  988|     12|            prec = prec1;
  989|     12|        }
  990|     12|        mpb_shr_round(a, e + e_offset - prec, rnd_mode);
  991|     12|        m = mpb_get_u64(a);
  992|     12|        m <<= (53 - prec);
  993|       |        /* mantissa overflow due to rounding */
  994|     12|        if (m >= (uint64_t)1 << 53) {
  ------------------
  |  Branch (994:13): [True: 0, False: 12]
  ------------------
  995|      0|            m >>= 1;
  996|      0|            e++;
  997|      0|        }
  998|     12|    }
  999|     12|    *pe = e;
 1000|     12|    return m;
 1001|     12|}

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

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

lre_parse_escape:
  736|  29.8k|{
  737|  29.8k|    const uint8_t *p;
  738|  29.8k|    uint32_t c;
  739|       |
  740|  29.8k|    p = *pp;
  741|  29.8k|    c = *p++;
  742|  29.8k|    switch(c) {
  743|  1.34k|    case 'b':
  ------------------
  |  Branch (743:5): [True: 1.34k, False: 28.4k]
  ------------------
  744|  1.34k|        c = '\b';
  745|  1.34k|        break;
  746|      0|    case 'f':
  ------------------
  |  Branch (746:5): [True: 0, False: 29.8k]
  ------------------
  747|      0|        c = '\f';
  748|      0|        break;
  749|     11|    case 'n':
  ------------------
  |  Branch (749:5): [True: 11, False: 29.7k]
  ------------------
  750|     11|        c = '\n';
  751|     11|        break;
  752|      0|    case 'r':
  ------------------
  |  Branch (752:5): [True: 0, False: 29.8k]
  ------------------
  753|      0|        c = '\r';
  754|      0|        break;
  755|      0|    case 't':
  ------------------
  |  Branch (755:5): [True: 0, False: 29.8k]
  ------------------
  756|      0|        c = '\t';
  757|      0|        break;
  758|    320|    case 'v':
  ------------------
  |  Branch (758:5): [True: 320, False: 29.4k]
  ------------------
  759|    320|        c = '\v';
  760|    320|        break;
  761|      0|    case 'x':
  ------------------
  |  Branch (761:5): [True: 0, False: 29.8k]
  ------------------
  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|      0|    case 'u':
  ------------------
  |  Branch (774:5): [True: 0, False: 29.8k]
  ------------------
  775|      0|        {
  776|      0|            int h, i;
  777|      0|            uint32_t c1;
  778|       |
  779|      0|            if (*p == '{' && allow_utf16) {
  ------------------
  |  Branch (779:17): [True: 0, False: 0]
  |  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|      0|            } else {
  794|      0|                c = 0;
  795|      0|                for(i = 0; i < 4; i++) {
  ------------------
  |  Branch (795:28): [True: 0, False: 0]
  ------------------
  796|      0|                    h = from_hex(*p++);
  797|      0|                    if (h < 0) {
  ------------------
  |  Branch (797:25): [True: 0, False: 0]
  ------------------
  798|      0|                        return -1;
  799|      0|                    }
  800|      0|                    c = (c << 4) | h;
  801|      0|                }
  802|      0|                if (is_hi_surrogate(c) &&
  ------------------
  |  Branch (802:21): [True: 0, False: 0]
  ------------------
  803|      0|                    allow_utf16 == 2 && p[0] == '\\' && p[1] == 'u') {
  ------------------
  |  Branch (803:21): [True: 0, False: 0]
  |  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|      0|            }
  819|      0|        }
  820|      0|        break;
  821|      0|    case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (821:5): [True: 0, False: 29.8k]
  |  Branch (821:15): [True: 0, False: 29.8k]
  |  Branch (821:25): [True: 0, False: 29.8k]
  |  Branch (821:35): [True: 0, False: 29.8k]
  ------------------
  822|      0|    case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (822:5): [True: 0, False: 29.8k]
  |  Branch (822:15): [True: 0, False: 29.8k]
  |  Branch (822:25): [True: 0, False: 29.8k]
  |  Branch (822:35): [True: 0, False: 29.8k]
  ------------------
  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|  28.1k|    default:
  ------------------
  |  Branch (845:5): [True: 28.1k, False: 1.67k]
  ------------------
  846|  28.1k|        return -2;
  847|  29.8k|    }
  848|  1.67k|    *pp = p;
  849|  1.67k|    return c;
  850|  29.8k|}

lre_is_id_start:
  747|     29|{
  748|     29|    return lre_is_in_table(c, unicode_prop_ID_Start_table,
  749|     29|                           unicode_prop_ID_Start_index,
  750|     29|                           sizeof(unicode_prop_ID_Start_index) / 3);
  751|     29|}
lre_is_id_continue:
  754|     27|{
  755|     27|    return lre_is_id_start(c) ||
  ------------------
  |  Branch (755:12): [True: 27, 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|     27|}
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|     29|{
  307|     29|    uint32_t code, b, bit;
  308|     29|    int pos;
  309|     29|    const uint8_t *p;
  310|       |
  311|     29|    pos = get_index_pos(&code, c, index_table, index_table_len);
  312|     29|    if (pos < 0)
  ------------------
  |  Branch (312:9): [True: 1, False: 28]
  ------------------
  313|      1|        return FALSE; /* outside the table */
  314|     28|    p = table + pos;
  315|     28|    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|    320|    for(;;) {
  325|    320|        b = *p++;
  326|    320|        if (b < 64) {
  ------------------
  |  Branch (326:13): [True: 52, False: 268]
  ------------------
  327|     52|            code += (b >> 3) + 1;
  328|     52|            if (c < code)
  ------------------
  |  Branch (328:17): [True: 0, False: 52]
  ------------------
  329|      0|                return bit;
  330|     52|            bit ^= 1;
  331|     52|            code += (b & 7) + 1;
  332|    268|        } else if (b >= 0x80) {
  ------------------
  |  Branch (332:20): [True: 266, False: 2]
  ------------------
  333|    266|            code += b - 0x80 + 1;
  334|    266|        } else if (b < 0x60) {
  ------------------
  |  Branch (334:20): [True: 1, False: 1]
  ------------------
  335|      1|            code += (((b - 0x40) << 8) | p[0]) + 1;
  336|      1|            p++;
  337|      1|        } else {
  338|      1|            code += (((b - 0x60) << 16) | (p[0] << 8) | p[1]) + 1;
  339|      1|            p += 2;
  340|      1|        }
  341|    320|        if (c < code)
  ------------------
  |  Branch (341:13): [True: 28, False: 292]
  ------------------
  342|     28|            return bit;
  343|    292|        bit ^= 1;
  344|    292|    }
  345|     28|}
libunicode.c:get_index_pos:
  273|     29|{
  274|     29|    uint32_t code, v;
  275|     29|    int idx_min, idx_max, idx;
  276|       |
  277|     29|    idx_min = 0;
  278|     29|    v = get_le24(index_table);
  279|     29|    code = v & ((1 << 21) - 1);
  280|     29|    if (c < code) {
  ------------------
  |  Branch (280:9): [True: 25, False: 4]
  ------------------
  281|     25|        *pcode = 0;
  282|     25|        return 0;
  283|     25|    }
  284|      4|    idx_max = index_table_len - 1;
  285|      4|    code = get_le24(index_table + idx_max * 3);
  286|      4|    if (c >= code)
  ------------------
  |  Branch (286:9): [True: 1, False: 3]
  ------------------
  287|      1|        return -1;
  288|       |    /* invariant: tab[idx_min] <= c < tab2[idx_max] */
  289|     19|    while ((idx_max - idx_min) > 1) {
  ------------------
  |  Branch (289:12): [True: 16, False: 3]
  ------------------
  290|     16|        idx = (idx_max + idx_min) / 2;
  291|     16|        v = get_le24(index_table + idx * 3);
  292|     16|        code = v & ((1 << 21) - 1);
  293|     16|        if (c < code) {
  ------------------
  |  Branch (293:13): [True: 9, False: 7]
  ------------------
  294|      9|            idx_max = idx;
  295|      9|        } else {
  296|      7|            idx_min = idx;
  297|      7|        }
  298|     16|    }
  299|      3|    v = get_le24(index_table + idx_min * 3);
  300|      3|    *pcode = v & ((1 << 21) - 1);
  301|      3|    return (idx_min + 1) * UNICODE_INDEX_BLOCK_LEN + (v >> 21);
  ------------------
  |  |  268|      3|#define UNICODE_INDEX_BLOCK_LEN 32
  ------------------
  302|      4|}
libunicode.c:get_le24:
  264|     52|{
  265|     52|    return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16);
  266|     52|}

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

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

js_module_set_import_meta:
  550|     11|{
  551|     11|    JSModuleDef *m;
  552|     11|    char buf[PATH_MAX + 16];
  553|     11|    JSValue meta_obj;
  554|     11|    JSAtom module_name_atom;
  555|     11|    const char *module_name;
  556|       |
  557|     11|    assert(JS_VALUE_GET_TAG(func_val) == JS_TAG_MODULE);
  ------------------
  |  Branch (557:5): [True: 0, False: 11]
  |  Branch (557:5): [True: 11, False: 0]
  ------------------
  558|     11|    m = JS_VALUE_GET_PTR(func_val);
  ------------------
  |  |  243|     11|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  559|       |
  560|     11|    module_name_atom = JS_GetModuleName(ctx, m);
  561|     11|    module_name = JS_AtomToCString(ctx, module_name_atom);
  562|     11|    JS_FreeAtom(ctx, module_name_atom);
  563|     11|    if (!module_name)
  ------------------
  |  Branch (563:9): [True: 0, False: 11]
  ------------------
  564|      0|        return -1;
  565|     11|    if (!strchr(module_name, ':')) {
  ------------------
  |  Branch (565:9): [True: 11, False: 0]
  ------------------
  566|     11|        strcpy(buf, "file://");
  567|     11|#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|     11|        if (use_realpath) {
  ------------------
  |  Branch (571:13): [True: 11, False: 0]
  ------------------
  572|     11|            char *res = realpath(module_name, buf + strlen(buf));
  573|     11|            if (!res) {
  ------------------
  |  Branch (573:17): [True: 11, False: 0]
  ------------------
  574|     11|                JS_ThrowTypeError(ctx, "realpath failure");
  575|     11|                JS_FreeCString(ctx, module_name);
  576|     11|                return -1;
  577|     11|            }
  578|     11|        } else
  579|      0|#endif
  580|      0|        {
  581|      0|            pstrcat(buf, sizeof(buf), module_name);
  582|      0|        }
  583|     11|    } 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|     11|{
 1721|     11|    JSModuleDef *m;
 1722|     11|    m = JS_NewCModule(ctx, module_name, js_std_init);
 1723|     11|    if (!m)
  ------------------
  |  Branch (1723:9): [True: 0, False: 11]
  ------------------
 1724|      0|        return NULL;
 1725|     11|    JS_AddModuleExportList(ctx, m, js_std_funcs, countof(js_std_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 1726|     11|    JS_AddModuleExport(ctx, m, "in");
 1727|     11|    JS_AddModuleExport(ctx, m, "out");
 1728|     11|    JS_AddModuleExport(ctx, m, "err");
 1729|     11|    return m;
 1730|     11|}
js_init_module_os:
 4049|     11|{
 4050|     11|    JSModuleDef *m;
 4051|     11|    m = JS_NewCModule(ctx, module_name, js_os_init);
 4052|     11|    if (!m)
  ------------------
  |  Branch (4052:9): [True: 0, False: 11]
  ------------------
 4053|      0|        return NULL;
 4054|     11|    JS_AddModuleExportList(ctx, m, js_os_funcs, countof(js_os_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 4055|       |#ifdef USE_WORKER
 4056|       |    JS_AddModuleExport(ctx, m, "Worker");
 4057|       |#endif
 4058|     11|    return m;
 4059|     11|}
js_std_add_helpers:
 4099|     11|{
 4100|     11|    JSValue global_obj, console, args, performance;
 4101|     11|    int i;
 4102|       |
 4103|       |    /* XXX: should these global definitions be enumerable? */
 4104|     11|    global_obj = JS_GetGlobalObject(ctx);
 4105|       |
 4106|     11|    console = JS_NewObject(ctx);
 4107|     11|    JS_SetPropertyStr(ctx, console, "log",
 4108|     11|                      JS_NewCFunction(ctx, js_console_log, "log", 1));
 4109|     11|    JS_SetPropertyStr(ctx, global_obj, "console", console);
 4110|       |
 4111|     11|    performance = JS_NewObject(ctx);
 4112|     11|    JS_SetPropertyStr(ctx, performance, "now",
 4113|     11|                      JS_NewCFunction(ctx, js_os_now, "now", 0));
 4114|     11|    JS_SetPropertyStr(ctx, global_obj, "performance", performance);
 4115|       |
 4116|       |    /* same methods as the mozilla JS shell */
 4117|     11|    if (argc >= 0) {
  ------------------
  |  Branch (4117:9): [True: 11, False: 0]
  ------------------
 4118|     11|        args = JS_NewArray(ctx);
 4119|     11|        for(i = 0; i < argc; i++) {
  ------------------
  |  Branch (4119:20): [True: 0, False: 11]
  ------------------
 4120|      0|            JS_SetPropertyUint32(ctx, args, i, JS_NewString(ctx, argv[i]));
 4121|      0|        }
 4122|     11|        JS_SetPropertyStr(ctx, global_obj, "scriptArgs", args);
 4123|     11|    }
 4124|       |
 4125|     11|    JS_SetPropertyStr(ctx, global_obj, "print",
 4126|     11|                      JS_NewCFunction(ctx, js_print, "print", 1));
 4127|     11|    JS_SetPropertyStr(ctx, global_obj, "__loadScript",
 4128|     11|                      JS_NewCFunction(ctx, js_loadScript, "__loadScript", 1));
 4129|       |
 4130|     11|    JS_FreeValue(ctx, global_obj);
 4131|     11|}
js_std_init_handlers:
 4134|     11|{
 4135|     11|    JSThreadState *ts;
 4136|       |
 4137|     11|    ts = malloc(sizeof(*ts));
 4138|     11|    if (!ts) {
  ------------------
  |  Branch (4138:9): [True: 0, False: 11]
  ------------------
 4139|      0|        fprintf(stderr, "Could not allocate memory for the worker");
 4140|      0|        exit(1);
 4141|      0|    }
 4142|     11|    memset(ts, 0, sizeof(*ts));
 4143|     11|    init_list_head(&ts->os_rw_handlers);
 4144|     11|    init_list_head(&ts->os_signal_handlers);
 4145|     11|    init_list_head(&ts->os_timers);
 4146|     11|    init_list_head(&ts->port_list);
 4147|     11|    init_list_head(&ts->rejected_promise_list);
 4148|     11|    ts->next_timer_id = 1;
 4149|       |
 4150|     11|    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|     11|}
js_std_free_handlers:
 4166|     11|{
 4167|     11|    JSThreadState *ts = JS_GetRuntimeOpaque(rt);
 4168|     11|    struct list_head *el, *el1;
 4169|       |
 4170|     11|    list_for_each_safe(el, el1, &ts->os_rw_handlers) {
  ------------------
  |  |   89|     11|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 11]
  |  |  ------------------
  |  |   90|     11|        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|     11|    list_for_each_safe(el, el1, &ts->os_signal_handlers) {
  ------------------
  |  |   89|     11|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 11]
  |  |  ------------------
  |  |   90|     11|        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|     11|    list_for_each_safe(el, el1, &ts->os_timers) {
  ------------------
  |  |   89|     11|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 11]
  |  |  ------------------
  |  |   90|     11|        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|     11|    list_for_each_safe(el, el1, &ts->rejected_promise_list) {
  ------------------
  |  |   89|     11|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 11]
  |  |  ------------------
  |  |   90|     11|        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|     11|#if !defined(_WIN32)
 4205|     11|    free(ts->poll_fds);
 4206|     11|#endif
 4207|       |
 4208|     11|    free(ts);
 4209|       |    JS_SetRuntimeOpaque(rt, NULL); /* fail safe */
 4210|     11|}
js_std_loop:
 4293|      1|{
 4294|      1|    int err;
 4295|       |
 4296|      1|    for(;;) {
 4297|       |        /* execute the pending jobs */
 4298|      1|        for(;;) {
 4299|      1|            err = JS_ExecutePendingJob(JS_GetRuntime(ctx), NULL);
 4300|      1|            if (err <= 0) {
  ------------------
  |  Branch (4300:17): [True: 1, False: 0]
  ------------------
 4301|      1|                if (err < 0)
  ------------------
  |  Branch (4301:21): [True: 0, False: 1]
  ------------------
 4302|      0|                    js_std_dump_error(ctx);
 4303|      1|                break;
 4304|      1|            }
 4305|      1|        }
 4306|       |
 4307|      1|        js_std_promise_rejection_check(ctx);
 4308|       |        
 4309|      1|        if (!os_poll_func || os_poll_func(ctx))
  ------------------
  |  Branch (4309:13): [True: 0, False: 1]
  |  Branch (4309:30): [True: 1, False: 0]
  ------------------
 4310|      1|            break;
 4311|      1|    }
 4312|      1|}
js_std_await:
 4318|     11|{
 4319|     11|    JSValue ret;
 4320|     11|    int state;
 4321|       |
 4322|     11|    for(;;) {
 4323|     11|        state = JS_PromiseState(ctx, obj);
 4324|     11|        if (state == JS_PROMISE_FULFILLED) {
  ------------------
  |  Branch (4324:13): [True: 11, False: 0]
  ------------------
 4325|     11|            ret = JS_PromiseResult(ctx, obj);
 4326|     11|            JS_FreeValue(ctx, obj);
 4327|     11|            break;
 4328|     11|        } else if (state == JS_PROMISE_REJECTED) {
  ------------------
  |  Branch (4328:20): [True: 0, False: 0]
  ------------------
 4329|      0|            ret = JS_Throw(ctx, JS_PromiseResult(ctx, obj));
 4330|      0|            JS_FreeValue(ctx, obj);
 4331|      0|            break;
 4332|      0|        } else if (state == JS_PROMISE_PENDING) {
  ------------------
  |  Branch (4332:20): [True: 0, False: 0]
  ------------------
 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|      0|        } else {
 4345|       |            /* not a promise */
 4346|      0|            ret = obj;
 4347|      0|            break;
 4348|      0|        }
 4349|     11|    }
 4350|     11|    return ret;
 4351|     11|}
quickjs-libc.c:js_std_init:
 1698|     11|{
 1699|     11|    JSValue proto;
 1700|       |
 1701|       |    /* FILE class */
 1702|       |    /* the class ID is created once */
 1703|     11|    JS_NewClassID(&js_std_file_class_id);
 1704|       |    /* the class is created once per runtime */
 1705|     11|    JS_NewClass(JS_GetRuntime(ctx), js_std_file_class_id, &js_std_file_class);
 1706|     11|    proto = JS_NewObject(ctx);
 1707|     11|    JS_SetPropertyFunctionList(ctx, proto, js_std_file_proto_funcs,
 1708|     11|                               countof(js_std_file_proto_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 1709|     11|    JS_SetClassProto(ctx, js_std_file_class_id, proto);
 1710|       |
 1711|     11|    JS_SetModuleExportList(ctx, m, js_std_funcs,
 1712|     11|                           countof(js_std_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 1713|     11|    JS_SetModuleExport(ctx, m, "in", js_new_std_file(ctx, stdin, FALSE, FALSE));
 1714|     11|    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|     11|    return 0;
 1717|     11|}
quickjs-libc.c:js_std_file_finalizer:
  938|     33|{
  939|     33|    JSSTDFile *s = JS_GetOpaque(val, js_std_file_class_id);
  940|     33|    if (s) {
  ------------------
  |  Branch (940:9): [True: 33, False: 0]
  ------------------
  941|     33|        if (s->f && s->close_in_finalizer) {
  ------------------
  |  Branch (941:13): [True: 33, False: 0]
  |  Branch (941:21): [True: 0, False: 33]
  ------------------
  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|     33|        js_free_rt(rt, s);
  948|     33|    }
  949|     33|}
quickjs-libc.c:js_new_std_file:
  985|     33|{
  986|     33|    JSSTDFile *s;
  987|     33|    JSValue obj;
  988|     33|    obj = JS_NewObjectClass(ctx, js_std_file_class_id);
  989|     33|    if (JS_IsException(obj))
  ------------------
  |  Branch (989:9): [True: 0, False: 33]
  ------------------
  990|      0|        return obj;
  991|     33|    s = js_mallocz(ctx, sizeof(*s));
  992|     33|    if (!s) {
  ------------------
  |  Branch (992:9): [True: 0, False: 33]
  ------------------
  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|     33|    s->close_in_finalizer = close_in_finalizer;
  997|     33|    s->is_popen = is_popen;
  998|     33|    s->f = f;
  999|     33|    JS_SetOpaque(obj, s);
 1000|     33|    return obj;
 1001|     33|}
quickjs-libc.c:js_os_init:
 4013|     11|{
 4014|     11|    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|     11|    return JS_SetModuleExportList(ctx, m, js_os_funcs,
 4045|     11|                                  countof(js_os_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 4046|     11|}
quickjs-libc.c:js_os_poll:
 2548|      1|{
 2549|      1|    JSRuntime *rt = JS_GetRuntime(ctx);
 2550|      1|    JSThreadState *ts = JS_GetRuntimeOpaque(rt);
 2551|      1|    int min_delay, nfds;
 2552|      1|    int64_t cur_time, delay;
 2553|      1|    JSOSRWHandler *rh;
 2554|      1|    struct list_head *el;
 2555|       |
 2556|       |    /* only check signals in the main thread */
 2557|      1|    if (!ts->recv_pipe &&
  ------------------
  |  Branch (2557:9): [True: 1, False: 0]
  ------------------
 2558|      1|        unlikely(os_pending_signals != 0)) {
  ------------------
  |  |   33|      1|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 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|      1|    if (list_empty(&ts->os_rw_handlers) && list_empty(&ts->os_timers) &&
  ------------------
  |  Branch (2573:9): [True: 1, False: 0]
  |  Branch (2573:44): [True: 1, False: 0]
  ------------------
 2574|      1|        list_empty(&ts->port_list))
  ------------------
  |  Branch (2574:9): [True: 1, False: 0]
  ------------------
 2575|      1|        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|      1|{
 4277|      1|    JSRuntime *rt = JS_GetRuntime(ctx);
 4278|      1|    JSThreadState *ts = JS_GetRuntimeOpaque(rt);
 4279|      1|    struct list_head *el;
 4280|       |
 4281|      1|    if (unlikely(!list_empty(&ts->rejected_promise_list))) {
  ------------------
  |  |   33|      1|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 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|      1|}

js_malloc_rt:
 1801|  54.3k|{
 1802|  54.3k|    return __js_malloc(&rt->malloc_ctx, size);
 1803|  54.3k|}
js_free_rt:
 1806|  54.8k|{
 1807|  54.8k|    __js_free(&rt->malloc_ctx, ptr);
 1808|  54.8k|}
js_realloc_rt:
 1811|  2.31k|{
 1812|  2.31k|    return __js_realloc(&rt->malloc_ctx, ptr, size);
 1813|  2.31k|}
js_malloc_usable_size_rt:
 1816|    936|{
 1817|    936|    return __js_malloc_usable_size(&rt->malloc_ctx, ptr);
 1818|    936|}
js_mallocz_rt:
 1821|    242|{
 1822|    242|    void *ptr;
 1823|    242|    ptr = js_malloc_rt(rt, size);
 1824|    242|    if (unlikely(!ptr))
  ------------------
  |  |   33|    242|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 242]
  |  |  ------------------
  ------------------
 1825|      0|        return NULL;
 1826|    242|    return memset(ptr, 0, size);
 1827|    242|}
js_malloc:
 1831|  10.4k|{
 1832|  10.4k|    void *ptr;
 1833|  10.4k|    ptr = js_malloc_rt(ctx->rt, size);
 1834|  10.4k|    if (unlikely(!ptr)) {
  ------------------
  |  |   33|  10.4k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 10.4k]
  |  |  ------------------
  ------------------
 1835|      0|        JS_ThrowOutOfMemory(ctx);
 1836|      0|        return NULL;
 1837|      0|    }
 1838|  10.4k|    return ptr;
 1839|  10.4k|}
js_mallocz:
 1843|    186|{
 1844|    186|    void *ptr;
 1845|    186|    ptr = js_mallocz_rt(ctx->rt, size);
 1846|    186|    if (unlikely(!ptr)) {
  ------------------
  |  |   33|    186|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 186]
  |  |  ------------------
  ------------------
 1847|      0|        JS_ThrowOutOfMemory(ctx);
 1848|      0|        return NULL;
 1849|      0|    }
 1850|    186|    return ptr;
 1851|    186|}
js_free:
 1854|    789|{
 1855|    789|    js_free_rt(ctx->rt, ptr);
 1856|    789|}
js_realloc:
 1860|    407|{
 1861|    407|    void *ret;
 1862|    407|    ret = js_realloc_rt(ctx->rt, ptr, size);
 1863|    407|    if (unlikely(!ret && size != 0)) {
  ------------------
  |  |   33|    407|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 407]
  |  |  |  Branch (33:45): [True: 0, False: 407]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1864|      0|        JS_ThrowOutOfMemory(ctx);
 1865|      0|        return NULL;
 1866|      0|    }
 1867|    407|    return ret;
 1868|    407|}
js_realloc2:
 1872|    936|{
 1873|    936|    void *ret;
 1874|    936|    ret = js_realloc_rt(ctx->rt, ptr, size);
 1875|    936|    if (unlikely(!ret && size != 0)) {
  ------------------
  |  |   33|    936|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 936]
  |  |  |  Branch (33:45): [True: 0, False: 936]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1876|      0|        JS_ThrowOutOfMemory(ctx);
 1877|      0|        return NULL;
 1878|      0|    }
 1879|    936|    if (pslack) {
  ------------------
  |  Branch (1879:9): [True: 936, False: 0]
  ------------------
 1880|    936|        size_t new_size = js_malloc_usable_size_rt(ctx->rt, ret);
 1881|    936|        *pslack = (new_size > size) ? new_size - size : 0;
  ------------------
  |  Branch (1881:19): [True: 441, False: 495]
  ------------------
 1882|    936|    }
 1883|    936|    return ret;
 1884|    936|}
js_strndup:
 1893|     25|{
 1894|     25|    char *ptr;
 1895|     25|    ptr = js_malloc(ctx, n + 1);
 1896|     25|    if (ptr) {
  ------------------
  |  Branch (1896:9): [True: 25, False: 0]
  ------------------
 1897|     25|        memcpy(ptr, s, n);
 1898|     25|        ptr[n] = '\0';
 1899|     25|    }
 1900|     25|    return ptr;
 1901|     25|}
js_strdup:
 1904|     22|{
 1905|     22|    return js_strndup(ctx, str, strlen(str));
 1906|     22|}
JS_NewRuntime2:
 2068|     11|{
 2069|     11|    JSRuntime *rt;
 2070|     11|    JSMallocState ms;
 2071|       |
 2072|     11|    memset(&ms, 0, sizeof(ms));
 2073|     11|    ms.opaque = opaque;
 2074|     11|    ms.malloc_limit = -1;
 2075|       |
 2076|     11|    rt = mf->js_malloc(&ms, sizeof(JSRuntime));
 2077|     11|    if (!rt)
  ------------------
  |  Branch (2077:9): [True: 0, False: 11]
  ------------------
 2078|      0|        return NULL;
 2079|     11|    memset(rt, 0, sizeof(*rt));
 2080|     11|    js_malloc_init(&rt->malloc_ctx);
 2081|     11|    rt->malloc_ctx.mf = *mf;
 2082|     11|    rt->malloc_ctx.malloc_state = ms;
 2083|     11|    rt->malloc_gc_threshold = 256 * 1024;
 2084|       |
 2085|     11|    init_list_head(&rt->context_list);
 2086|     11|    init_list_head(&rt->gc_obj_list);
 2087|     11|    init_list_head(&rt->gc_zero_ref_count_list);
 2088|     11|    rt->gc_phase = JS_GC_PHASE_NONE;
 2089|     11|    init_list_head(&rt->weakref_list);
 2090|       |
 2091|       |#ifdef DUMP_LEAKS
 2092|       |    init_list_head(&rt->string_list);
 2093|       |#endif
 2094|     11|    init_list_head(&rt->job_list);
 2095|       |
 2096|     11|    if (JS_InitAtoms(rt))
  ------------------
  |  Branch (2096:9): [True: 0, False: 11]
  ------------------
 2097|      0|        goto fail;
 2098|       |
 2099|       |    /* create the object, array and function classes */
 2100|     11|    if (init_class_range(rt, js_std_class_def, JS_CLASS_OBJECT,
  ------------------
  |  Branch (2100:9): [True: 0, False: 11]
  ------------------
 2101|     11|                         countof(js_std_class_def)) < 0)
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 2102|      0|        goto fail;
 2103|     11|    rt->class_array[JS_CLASS_ARGUMENTS].exotic = &js_arguments_exotic_methods;
 2104|     11|    rt->class_array[JS_CLASS_MAPPED_ARGUMENTS].exotic = &js_arguments_exotic_methods;
 2105|     11|    rt->class_array[JS_CLASS_STRING].exotic = &js_string_exotic_methods;
 2106|     11|    rt->class_array[JS_CLASS_MODULE_NS].exotic = &js_module_ns_exotic_methods;
 2107|       |
 2108|     11|    rt->class_array[JS_CLASS_C_FUNCTION].call = js_call_c_function;
 2109|     11|    rt->class_array[JS_CLASS_C_FUNCTION_DATA].call = js_c_function_data_call;
 2110|     11|    rt->class_array[JS_CLASS_BOUND_FUNCTION].call = js_call_bound_function;
 2111|     11|    rt->class_array[JS_CLASS_GENERATOR_FUNCTION].call = js_generator_function_call;
 2112|     11|    if (init_shape_hash(rt))
  ------------------
  |  Branch (2112:9): [True: 0, False: 11]
  ------------------
 2113|      0|        goto fail;
 2114|       |
 2115|     11|    rt->stack_size = JS_DEFAULT_STACK_SIZE;
  ------------------
  |  |  328|     11|#define JS_DEFAULT_STACK_SIZE (1024 * 1024)
  ------------------
 2116|     11|    JS_UpdateStackTop(rt);
 2117|       |
 2118|     11|    rt->current_exception = JS_UNINITIALIZED;
  ------------------
  |  |  295|     11|#define JS_UNINITIALIZED JS_MKVAL(JS_TAG_UNINITIALIZED, 0)
  |  |  ------------------
  |  |  |  |  247|     11|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 2119|       |
 2120|     11|    return rt;
 2121|      0| fail:
 2122|      0|    JS_FreeRuntime(rt);
 2123|       |    return NULL;
 2124|     11|}
JS_GetRuntimeOpaque:
 2127|     13|{
 2128|     13|    return rt->user_opaque;
 2129|     13|}
JS_SetRuntimeOpaque:
 2132|     22|{
 2133|     22|    rt->user_opaque = opaque;
 2134|     22|}
JS_NewRuntime:
 2217|     11|{
 2218|       |    return JS_NewRuntime2(&def_malloc_funcs, NULL);
 2219|     11|}
JS_SetMemoryLimit:
 2222|     11|{
 2223|     11|    rt->malloc_ctx.malloc_state.malloc_limit = limit;
 2224|     11|}
JS_SetInterruptHandler:
 2237|     11|{
 2238|     11|    rt->interrupt_handler = cb;
 2239|     11|    rt->interrupt_opaque = opaque;
 2240|     11|}
JS_ExecutePendingJob:
 2304|      1|{
 2305|      1|    JSContext *ctx;
 2306|      1|    JSJobEntry *e;
 2307|      1|    JSValue res;
 2308|      1|    int i, ret;
 2309|       |
 2310|      1|    if (list_empty(&rt->job_list)) {
  ------------------
  |  Branch (2310:9): [True: 1, False: 0]
  ------------------
 2311|      1|        if (pctx)
  ------------------
  |  Branch (2311:13): [True: 0, False: 1]
  ------------------
 2312|      0|            *pctx = NULL;
 2313|      1|        return 0;
 2314|      1|    }
 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|      1|}
JS_FreeRuntime:
 2406|     11|{
 2407|     11|    struct list_head *el, *el1;
 2408|     11|    int i;
 2409|       |
 2410|     11|    JS_FreeValueRT(rt, rt->current_exception);
 2411|       |
 2412|     11|    list_for_each_safe(el, el1, &rt->job_list) {
  ------------------
  |  |   89|     11|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 11]
  |  |  ------------------
  |  |   90|     11|        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|     11|    init_list_head(&rt->job_list);
 2420|       |
 2421|       |    /* don't remove the weak objects to avoid create new jobs with
 2422|       |       FinalizationRegistry */
 2423|     11|    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|     11|    assert(list_empty(&rt->gc_obj_list));
  ------------------
  |  Branch (2464:5): [True: 0, False: 11]
  |  Branch (2464:5): [True: 11, False: 0]
  ------------------
 2465|     11|    assert(list_empty(&rt->weakref_list));
  ------------------
  |  Branch (2465:5): [True: 0, False: 11]
  |  Branch (2465:5): [True: 11, False: 0]
  ------------------
 2466|       |
 2467|       |    /* free the classes */
 2468|  1.04k|    for(i = 0; i < rt->class_count; i++) {
  ------------------
  |  Branch (2468:16): [True: 1.03k, False: 11]
  ------------------
 2469|  1.03k|        JSClass *cl = &rt->class_array[i];
 2470|  1.03k|        if (cl->class_id != 0) {
  ------------------
  |  Branch (2470:13): [True: 693, False: 341]
  ------------------
 2471|    693|            JS_FreeAtomRT(rt, cl->class_name);
 2472|    693|        }
 2473|  1.03k|    }
 2474|     11|    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|  7.83k|    for(i = 0; i < rt->atom_size; i++) {
  ------------------
  |  Branch (2535:16): [True: 7.82k, False: 11]
  ------------------
 2536|  7.82k|        JSAtomStruct *p = rt->atom_array[i];
 2537|  7.82k|        if (!atom_is_free(p)) {
  ------------------
  |  Branch (2537:13): [True: 2.67k, False: 5.14k]
  ------------------
 2538|       |#ifdef DUMP_LEAKS
 2539|       |            list_del(&p->link);
 2540|       |#endif
 2541|  2.67k|            js_free_rt(rt, p);
 2542|  2.67k|        }
 2543|  7.82k|    }
 2544|     11|    js_free_rt(rt, rt->atom_array);
 2545|     11|    js_free_rt(rt, rt->atom_hash);
 2546|     11|    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|     11|    {
 2588|     11|        JSMallocState ms = rt->malloc_ctx.malloc_state;
 2589|     11|        rt->malloc_ctx.mf.js_free(&ms, rt);
 2590|     11|    }
 2591|     11|}
JS_NewContextRaw:
 2594|     11|{
 2595|     11|    JSContext *ctx;
 2596|     11|    int i;
 2597|       |
 2598|     11|    ctx = js_mallocz_rt(rt, sizeof(JSContext));
 2599|     11|    if (!ctx)
  ------------------
  |  Branch (2599:9): [True: 0, False: 11]
  ------------------
 2600|      0|        return NULL;
 2601|     11|    js_rc(ctx)->ref_count = 1;
 2602|     11|    add_gc_object(rt, &ctx->header, JS_GC_OBJ_TYPE_JS_CONTEXT);
 2603|       |
 2604|     11|    ctx->class_proto = js_malloc_rt(rt, sizeof(ctx->class_proto[0]) *
 2605|     11|                                    rt->class_count);
 2606|     11|    if (!ctx->class_proto) {
  ------------------
  |  Branch (2606:9): [True: 0, False: 11]
  ------------------
 2607|      0|        js_free_rt(rt, ctx);
 2608|      0|        return NULL;
 2609|      0|    }
 2610|     11|    ctx->rt = rt;
 2611|     11|    list_add_tail(&ctx->link, &rt->context_list);
 2612|    704|    for(i = 0; i < rt->class_count; i++)
  ------------------
  |  Branch (2612:16): [True: 693, False: 11]
  ------------------
 2613|    693|        ctx->class_proto[i] = JS_NULL;
  ------------------
  |  |  290|    693|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|    704|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 2614|     11|    ctx->array_ctor = JS_NULL;
  ------------------
  |  |  290|     11|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|     11|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 2615|     11|    ctx->iterator_ctor = JS_NULL;
  ------------------
  |  |  290|     11|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|     11|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 2616|     11|    ctx->regexp_ctor = JS_NULL;
  ------------------
  |  |  290|     11|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|     11|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 2617|     11|    ctx->promise_ctor = JS_NULL;
  ------------------
  |  |  290|     11|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|     11|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 2618|     11|    init_list_head(&ctx->loaded_modules);
 2619|       |
 2620|     11|    if (JS_AddIntrinsicBasicObjects(ctx)) {
  ------------------
  |  Branch (2620:9): [True: 0, False: 11]
  ------------------
 2621|      0|        JS_FreeContext(ctx);
 2622|      0|        return NULL;
 2623|      0|    }
 2624|     11|    return ctx;
 2625|     11|}
JS_NewContext:
 2628|     11|{
 2629|     11|    JSContext *ctx;
 2630|       |
 2631|     11|    ctx = JS_NewContextRaw(rt);
 2632|     11|    if (!ctx)
  ------------------
  |  Branch (2632:9): [True: 0, False: 11]
  ------------------
 2633|      0|        return NULL;
 2634|       |
 2635|     11|    if (JS_AddIntrinsicBaseObjects(ctx) ||
  ------------------
  |  Branch (2635:9): [True: 0, False: 11]
  ------------------
 2636|     11|        JS_AddIntrinsicDate(ctx) ||
  ------------------
  |  Branch (2636:9): [True: 0, False: 11]
  ------------------
 2637|     11|        JS_AddIntrinsicEval(ctx) ||
  ------------------
  |  Branch (2637:9): [True: 0, False: 11]
  ------------------
 2638|     11|        JS_AddIntrinsicStringNormalize(ctx) ||
  ------------------
  |  Branch (2638:9): [True: 0, False: 11]
  ------------------
 2639|     11|        JS_AddIntrinsicRegExp(ctx) ||
  ------------------
  |  Branch (2639:9): [True: 0, False: 11]
  ------------------
 2640|     11|        JS_AddIntrinsicJSON(ctx) ||
  ------------------
  |  Branch (2640:9): [True: 0, False: 11]
  ------------------
 2641|     11|        JS_AddIntrinsicProxy(ctx) ||
  ------------------
  |  Branch (2641:9): [True: 0, False: 11]
  ------------------
 2642|     11|        JS_AddIntrinsicMapSet(ctx) ||
  ------------------
  |  Branch (2642:9): [True: 0, False: 11]
  ------------------
 2643|     11|        JS_AddIntrinsicTypedArrays(ctx) ||
  ------------------
  |  Branch (2643:9): [True: 0, False: 11]
  ------------------
 2644|     11|        JS_AddIntrinsicPromise(ctx) ||
  ------------------
  |  Branch (2644:9): [True: 0, False: 11]
  ------------------
 2645|     11|        JS_AddIntrinsicWeakRef(ctx)) {
  ------------------
  |  Branch (2645:9): [True: 0, False: 11]
  ------------------
 2646|      0|        JS_FreeContext(ctx);
 2647|      0|        return NULL;
 2648|      0|    }
 2649|     11|    return ctx;
 2650|     11|}
JS_SetClassProto:
 2673|     11|{
 2674|     11|    JSRuntime *rt = ctx->rt;
 2675|     11|    assert(class_id < rt->class_count);
  ------------------
  |  Branch (2675:5): [True: 0, False: 11]
  |  Branch (2675:5): [True: 11, False: 0]
  ------------------
 2676|     11|    set_value(ctx, &ctx->class_proto[class_id], obj);
 2677|     11|}
JS_DupContext:
 2711|  6.58k|{
 2712|  6.58k|    js_rc(ctx)->ref_count++;
 2713|  6.58k|    return ctx;
 2714|  6.58k|}
JS_FreeContext:
 2766|  6.59k|{
 2767|  6.59k|    JSRuntime *rt = ctx->rt;
 2768|  6.59k|    int i;
 2769|       |
 2770|  6.59k|    if (--js_rc(ctx)->ref_count > 0)
  ------------------
  |  Branch (2770:9): [True: 6.58k, False: 11]
  ------------------
 2771|  6.58k|        return;
 2772|  6.59k|    assert(js_rc(ctx)->ref_count == 0);
  ------------------
  |  Branch (2772:5): [True: 0, False: 11]
  |  Branch (2772:5): [True: 11, 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|     11|    js_free_modules(ctx, JS_FREE_MODULE_ALL);
 2802|       |
 2803|     11|    JS_FreeValue(ctx, ctx->global_obj);
 2804|     11|    JS_FreeValue(ctx, ctx->global_var_obj);
 2805|       |
 2806|     11|    JS_FreeValue(ctx, ctx->throw_type_error);
 2807|     11|    JS_FreeValue(ctx, ctx->eval_obj);
 2808|       |
 2809|     11|    JS_FreeValue(ctx, ctx->array_proto_values);
 2810|     99|    for(i = 0; i < JS_NATIVE_ERROR_COUNT; i++) {
  ------------------
  |  Branch (2810:16): [True: 88, False: 11]
  ------------------
 2811|     88|        JS_FreeValue(ctx, ctx->native_error_proto[i]);
 2812|     88|    }
 2813|  1.04k|    for(i = 0; i < rt->class_count; i++) {
  ------------------
  |  Branch (2813:16): [True: 1.03k, False: 11]
  ------------------
 2814|  1.03k|        JS_FreeValue(ctx, ctx->class_proto[i]);
 2815|  1.03k|    }
 2816|     11|    js_free_rt(rt, ctx->class_proto);
 2817|     11|    JS_FreeValue(ctx, ctx->iterator_ctor);
 2818|     11|    JS_FreeValue(ctx, ctx->async_iterator_proto);
 2819|     11|    JS_FreeValue(ctx, ctx->promise_ctor);
 2820|     11|    JS_FreeValue(ctx, ctx->array_ctor);
 2821|     11|    JS_FreeValue(ctx, ctx->regexp_ctor);
 2822|     11|    JS_FreeValue(ctx, ctx->function_ctor);
 2823|     11|    JS_FreeValue(ctx, ctx->function_proto);
 2824|       |
 2825|     11|    js_free_shape_null(ctx->rt, ctx->array_shape);
 2826|     11|    js_free_shape_null(ctx->rt, ctx->arguments_shape);
 2827|     11|    js_free_shape_null(ctx->rt, ctx->mapped_arguments_shape);
 2828|     11|    js_free_shape_null(ctx->rt, ctx->regexp_shape);
 2829|     11|    js_free_shape_null(ctx->rt, ctx->regexp_result_shape);
 2830|       |
 2831|     11|    list_del(&ctx->link);
 2832|     11|    remove_gc_object(&ctx->header);
 2833|     11|    js_free_rt(ctx->rt, ctx);
 2834|     11|}
JS_GetRuntime:
 2837|     25|{
 2838|     25|    return ctx->rt;
 2839|     25|}
JS_SetMaxStackSize:
 2851|     11|{
 2852|     11|    rt->stack_size = stack_size;
 2853|     11|    update_stack_limit(rt);
 2854|     11|}
JS_UpdateStackTop:
 2857|     11|{
 2858|     11|    rt->stack_top = js_get_stack_pointer();
 2859|     11|    update_stack_limit(rt);
 2860|     11|}
JS_DupAtom:
 3119|  14.6k|{
 3120|  14.6k|    JSRuntime *rt;
 3121|  14.6k|    JSAtomStruct *p;
 3122|       |
 3123|  14.6k|    if (!__JS_AtomIsConst(v)) {
  ------------------
  |  Branch (3123:9): [True: 6.38k, False: 8.23k]
  ------------------
 3124|  6.38k|        rt = ctx->rt;
 3125|  6.38k|        p = rt->atom_array[v];
 3126|  6.38k|        js_rc(p)->ref_count++;
 3127|  6.38k|    }
 3128|  14.6k|    return v;
 3129|  14.6k|}
JS_NewAtomLen:
 3461|  10.5k|{
 3462|  10.5k|    JSValue val;
 3463|       |
 3464|  10.5k|    if (len == 0 ||
  ------------------
  |  Branch (3464:9): [True: 22, False: 10.5k]
  ------------------
 3465|  10.5k|        (!is_digit(*str) &&
  ------------------
  |  Branch (3465:10): [True: 10.5k, False: 0]
  ------------------
 3466|  10.5k|         count_ascii((const uint8_t *)str, len) == len)) {
  ------------------
  |  Branch (3466:10): [True: 10.5k, False: 16]
  ------------------
 3467|  10.5k|        JSAtom atom = __JS_FindAtom(ctx->rt, str, len, JS_ATOM_TYPE_STRING);
 3468|  10.5k|        if (atom)
  ------------------
  |  Branch (3468:13): [True: 6.16k, False: 4.40k]
  ------------------
 3469|  6.16k|            return atom;
 3470|  10.5k|    }
 3471|  4.42k|    val = JS_NewStringLen(ctx, str, len);
 3472|  4.42k|    if (JS_IsException(val))
  ------------------
  |  Branch (3472:9): [True: 0, False: 4.42k]
  ------------------
 3473|      0|        return JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
 3474|  4.42k|    return JS_NewAtomStr(ctx, JS_VALUE_GET_STRING(val));
  ------------------
  |  |  230|  4.42k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  4.42k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 3475|  4.42k|}
JS_NewAtom:
 3478|  10.2k|{
 3479|  10.2k|    return JS_NewAtomLen(ctx, str, strlen(str));
 3480|  10.2k|}
JS_AtomToValue:
 3623|    233|{
 3624|    233|    return __JS_AtomToValue(ctx, atom, FALSE);
 3625|    233|}
JS_AtomToString:
 3628|   148k|{
 3629|   148k|    return __JS_AtomToValue(ctx, atom, TRUE);
 3630|   148k|}
JS_FreeAtom:
 3725|   183k|{
 3726|   183k|    if (!__JS_AtomIsConst(v))
  ------------------
  |  Branch (3726:9): [True: 7.73k, False: 175k]
  ------------------
 3727|  7.73k|        __JS_FreeAtom(ctx->rt, v);
 3728|   183k|}
JS_FreeAtomRT:
 3731|  14.6k|{
 3732|  14.6k|    if (!__JS_AtomIsConst(v))
  ------------------
  |  Branch (3732:9): [True: 6.34k, False: 8.30k]
  ------------------
 3733|  6.34k|        __JS_FreeAtom(rt, v);
 3734|  14.6k|}
JS_AtomToCStringLen:
 3754|     62|{
 3755|     62|    JSValue str;
 3756|     62|    const char *cstr;
 3757|       |
 3758|     62|    str = JS_AtomToString(ctx, atom);
 3759|     62|    if (JS_IsException(str)) {
  ------------------
  |  Branch (3759:9): [True: 0, False: 62]
  ------------------
 3760|      0|        if (plen)
  ------------------
  |  Branch (3760:13): [True: 0, False: 0]
  ------------------
 3761|      0|            *plen = 0;
 3762|      0|        return NULL;
 3763|      0|    }
 3764|     62|    cstr = JS_ToCStringLen(ctx, plen, str);
 3765|     62|    JS_FreeValue(ctx, str);
 3766|     62|    return cstr;
 3767|     62|}
JS_NewClassID:
 3824|     11|{
 3825|     11|    JSClassID class_id;
 3826|     11|#ifdef CONFIG_ATOMICS
 3827|     11|    pthread_mutex_lock(&js_class_id_mutex);
 3828|     11|#endif
 3829|     11|    class_id = *pclass_id;
 3830|     11|    if (class_id == 0) {
  ------------------
  |  Branch (3830:9): [True: 1, False: 10]
  ------------------
 3831|      1|        class_id = js_class_id_alloc++;
 3832|      1|        *pclass_id = class_id;
 3833|      1|    }
 3834|     11|#ifdef CONFIG_ATOMICS
 3835|     11|    pthread_mutex_unlock(&js_class_id_mutex);
 3836|     11|#endif
 3837|     11|    return class_id;
 3838|     11|}
JS_IsRegisteredClass:
 3850|     44|{
 3851|     44|    return (class_id < rt->class_count &&
  ------------------
  |  Branch (3851:13): [True: 44, False: 0]
  ------------------
 3852|     44|            rt->class_array[class_id].class_id != 0);
  ------------------
  |  Branch (3852:13): [True: 0, False: 44]
  ------------------
 3853|     44|}
JS_NewClass:
 3907|     11|{
 3908|     11|    int ret, len;
 3909|     11|    JSAtom name;
 3910|       |
 3911|     11|    len = strlen(class_def->class_name);
 3912|     11|    name = __JS_FindAtom(rt, class_def->class_name, len, JS_ATOM_TYPE_STRING);
 3913|     11|    if (name == JS_ATOM_NULL) {
  ------------------
  |  |  451|     11|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (3913:9): [True: 11, False: 0]
  ------------------
 3914|     11|        name = __JS_NewAtomInit(rt, class_def->class_name, len, JS_ATOM_TYPE_STRING);
 3915|     11|        if (name == JS_ATOM_NULL)
  ------------------
  |  |  451|     11|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (3915:13): [True: 0, False: 11]
  ------------------
 3916|      0|            return -1;
 3917|     11|    }
 3918|     11|    ret = JS_NewClass1(rt, class_id, class_def, name);
 3919|     11|    JS_FreeAtomRT(rt, name);
 3920|     11|    return ret;
 3921|     11|}
JS_NewStringLen:
 4358|  4.47k|{
 4359|  4.47k|    const uint8_t *p, *p_end, *p_start, *p_next;
 4360|  4.47k|    uint32_t c;
 4361|  4.47k|    StringBuffer b_s, *b = &b_s;
 4362|  4.47k|    size_t len1;
 4363|       |
 4364|  4.47k|    p_start = (const uint8_t *)buf;
 4365|  4.47k|    p_end = p_start + buf_len;
 4366|  4.47k|    len1 = count_ascii(p_start, buf_len);
 4367|  4.47k|    p = p_start + len1;
 4368|  4.47k|    if (len1 > JS_STRING_LEN_MAX)
  ------------------
  |  |  212|  4.47k|#define JS_STRING_LEN_MAX ((1 << 30) - 1)
  ------------------
  |  Branch (4368:9): [True: 0, False: 4.47k]
  ------------------
 4369|      0|        return JS_ThrowInternalError(ctx, "string too long");
 4370|  4.47k|    if (p == p_end) {
  ------------------
  |  Branch (4370:9): [True: 4.46k, False: 17]
  ------------------
 4371|       |        /* ASCII string */
 4372|  4.46k|        return js_new_string8_len(ctx, buf, buf_len);
 4373|  4.46k|    } else {
 4374|     17|        if (string_buffer_init(ctx, b, buf_len))
  ------------------
  |  Branch (4374:13): [True: 0, False: 17]
  ------------------
 4375|      0|            goto fail;
 4376|     17|        string_buffer_write8(b, p_start, len1);
 4377|  1.04M|        while (p < p_end) {
  ------------------
  |  Branch (4377:16): [True: 1.04M, False: 17]
  ------------------
 4378|  1.04M|            if (*p < 128) {
  ------------------
  |  Branch (4378:17): [True: 1.04M, False: 18]
  ------------------
 4379|  1.04M|                string_buffer_putc8(b, *p++);
 4380|  1.04M|            } else {
 4381|       |                /* parse utf-8 sequence, return 0xFFFFFFFF for error */
 4382|     18|                c = unicode_from_utf8(p, p_end - p, &p_next);
 4383|     18|                if (c < 0x10000) {
  ------------------
  |  Branch (4383:21): [True: 16, False: 2]
  ------------------
 4384|     16|                    p = p_next;
 4385|     16|                } 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|     18|                string_buffer_putc16(b, c);
 4404|     18|            }
 4405|  1.04M|        }
 4406|     17|    }
 4407|     17|    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|  4.47k|}
JS_ToCStringLen2:
 4459|     71|{
 4460|     71|    JSValue val;
 4461|     71|    JSString *str, *str_new;
 4462|     71|    int pos, len, c, c1;
 4463|     71|    uint8_t *q;
 4464|       |
 4465|     71|    if (JS_VALUE_GET_TAG(val1) != JS_TAG_STRING) {
  ------------------
  |  |  236|     71|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (4465:9): [True: 0, False: 71]
  ------------------
 4466|      0|        val = JS_ToString(ctx, val1);
 4467|      0|        if (JS_IsException(val))
  ------------------
  |  Branch (4467:13): [True: 0, False: 0]
  ------------------
 4468|      0|            goto fail;
 4469|     71|    } else {
 4470|     71|        val = JS_DupValue(ctx, val1);
 4471|     71|    }
 4472|       |
 4473|     71|    str = JS_VALUE_GET_STRING(val);
  ------------------
  |  |  230|     71|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     71|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4474|     71|    len = str->len;
 4475|     71|    if (!str->is_wide_char) {
  ------------------
  |  Branch (4475:9): [True: 69, False: 2]
  ------------------
 4476|     69|        const uint8_t *src = str->u.str8;
 4477|     69|        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|     69|        count = 0;
 4486|    434|        for (pos = 0; pos < len; pos++) {
  ------------------
  |  Branch (4486:23): [True: 365, False: 69]
  ------------------
 4487|    365|            count += src[pos] >> 7;
 4488|    365|        }
 4489|     69|        if (count == 0) {
  ------------------
  |  Branch (4489:13): [True: 69, False: 0]
  ------------------
 4490|     69|            if (plen)
  ------------------
  |  Branch (4490:17): [True: 0, False: 69]
  ------------------
 4491|      0|                *plen = len;
 4492|     69|            return (const char *)src;
 4493|     69|        }
 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|      2|    } else {
 4508|      2|        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|      2|        str_new = js_alloc_string(ctx, len * 3, 0);
 4513|      2|        if (!str_new)
  ------------------
  |  Branch (4513:13): [True: 0, False: 2]
  ------------------
 4514|      0|            goto fail;
 4515|      2|        q = str_new->u.str8;
 4516|      2|        pos = 0;
 4517|   807k|        while (pos < len) {
  ------------------
  |  Branch (4517:16): [True: 807k, False: 2]
  ------------------
 4518|   807k|            c = src[pos++];
 4519|   807k|            if (c < 0x80) {
  ------------------
  |  Branch (4519:17): [True: 807k, False: 627]
  ------------------
 4520|   807k|                *q++ = c;
 4521|   807k|            } else {
 4522|    627|                if (is_hi_surrogate(c)) {
  ------------------
  |  Branch (4522:21): [True: 0, False: 627]
  ------------------
 4523|      0|                    if (pos < len && !cesu8) {
  ------------------
  |  Branch (4523:25): [True: 0, False: 0]
  |  Branch (4523:38): [True: 0, False: 0]
  ------------------
 4524|      0|                        c1 = src[pos];
 4525|      0|                        if (is_lo_surrogate(c1)) {
  ------------------
  |  Branch (4525:29): [True: 0, False: 0]
  ------------------
 4526|      0|                            pos++;
 4527|      0|                            c = from_surrogate(c, c1);
 4528|      0|                        } else {
 4529|       |                            /* Keep unmatched surrogate code points */
 4530|       |                            /* c = 0xfffd; */ /* error */
 4531|      0|                        }
 4532|      0|                    } else {
 4533|       |                        /* Keep unmatched surrogate code points */
 4534|       |                        /* c = 0xfffd; */ /* error */
 4535|      0|                    }
 4536|      0|                }
 4537|    627|                q += unicode_to_utf8(q, c);
 4538|    627|            }
 4539|   807k|        }
 4540|      2|    }
 4541|       |
 4542|      2|    *q = '\0';
 4543|      2|    str_new->len = q - str_new->u.str8;
 4544|      2|    JS_FreeValue(ctx, val);
 4545|      2|    if (plen)
  ------------------
  |  Branch (4545:9): [True: 2, False: 0]
  ------------------
 4546|      2|        *plen = str_new->len;
 4547|      2|    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|     71|}
JS_FreeCString:
 4555|     71|{
 4556|     71|    JSString *p;
 4557|     71|    if (!ptr)
  ------------------
  |  Branch (4557:9): [True: 0, False: 71]
  ------------------
 4558|      0|        return;
 4559|       |    /* purposely removing constness */
 4560|     71|    p = container_of(ptr, JSString, u);
  ------------------
  |  |   51|     71|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 4561|     71|    JS_FreeValue(ctx, JS_MKPTR(JS_TAG_STRING, p));
  ------------------
  |  |  248|     71|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 4562|     71|}
JS_NewObjectProtoClass:
 5745|  1.49k|{
 5746|  1.49k|    JSShape *sh;
 5747|  1.49k|    JSObject *proto;
 5748|       |
 5749|  1.49k|    proto = get_proto_obj(proto_val);
 5750|  1.49k|    sh = find_hashed_shape_proto(ctx->rt, proto);
 5751|  1.49k|    if (likely(sh)) {
  ------------------
  |  |   32|  1.49k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 720, False: 771]
  |  |  ------------------
  ------------------
 5752|    720|        sh = js_dup_shape(sh);
 5753|    771|    } else {
 5754|    771|        sh = js_new_shape(ctx, proto);
 5755|    771|        if (!sh)
  ------------------
  |  Branch (5755:13): [True: 0, False: 771]
  ------------------
 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|    771|    }
 5758|  1.49k|    return JS_NewObjectFromShape(ctx, sh, class_id, NULL);
 5759|  1.49k|}
JS_NewObjectClass:
 5832|     65|{
 5833|     65|    return JS_NewObjectProtoClass(ctx, ctx->class_proto[class_id], class_id);
 5834|     65|}
JS_NewArray:
 5842|     20|{
 5843|     20|    return JS_NewObjectFromShape(ctx, js_dup_shape(ctx->array_shape),
 5844|       |                                 JS_CLASS_ARRAY, NULL);
 5845|     20|}
JS_NewObject:
 5848|     33|{
 5849|       |    /* inline JS_NewObjectClass(ctx, JS_CLASS_OBJECT); */
 5850|     33|    return JS_NewObjectProtoClass(ctx, ctx->class_proto[JS_CLASS_OBJECT], JS_CLASS_OBJECT);
 5851|     33|}
JS_NewCFunction2:
 5986|  1.26k|{
 5987|  1.26k|    return JS_NewCFunction3(ctx, func, name, length, cproto, magic,
 5988|  1.26k|                            ctx->function_proto, 0);
 5989|  1.26k|}
JS_NewCFunctionData:
 6050|     33|{
 6051|     33|    JSCFunctionDataRecord *s;
 6052|     33|    JSValue func_obj;
 6053|     33|    int i;
 6054|       |
 6055|     33|    func_obj = JS_NewObjectProtoClass(ctx, ctx->function_proto,
 6056|     33|                                      JS_CLASS_C_FUNCTION_DATA);
 6057|     33|    if (JS_IsException(func_obj))
  ------------------
  |  Branch (6057:9): [True: 0, False: 33]
  ------------------
 6058|      0|        return func_obj;
 6059|     33|    s = js_malloc(ctx, sizeof(*s) + data_len * sizeof(JSValue));
 6060|     33|    if (!s) {
  ------------------
  |  Branch (6060:9): [True: 0, False: 33]
  ------------------
 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|     33|    s->func = func;
 6065|     33|    s->length = length;
 6066|     33|    s->data_len = data_len;
 6067|     33|    s->magic = magic;
 6068|     88|    for(i = 0; i < data_len; i++)
  ------------------
  |  Branch (6068:16): [True: 55, False: 33]
  ------------------
 6069|     55|        s->data[i] = JS_DupValue(ctx, data[i]);
 6070|     33|    JS_SetOpaque(func_obj, s);
 6071|     33|    js_function_set_properties(ctx, func_obj,
 6072|     33|                               JS_ATOM_empty_string, length);
 6073|     33|    return func_obj;
 6074|     33|}
__JS_FreeValueRT:
 6433|  39.5k|{
 6434|  39.5k|    uint32_t tag = JS_VALUE_GET_TAG(v);
  ------------------
  |  |  236|  39.5k|#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|  39.5k|    switch(tag) {
 6449|  36.8k|    case JS_TAG_STRING:
  ------------------
  |  Branch (6449:5): [True: 36.8k, False: 2.73k]
  ------------------
 6450|  36.8k|        {
 6451|  36.8k|            JSString *p = JS_VALUE_GET_STRING(v);
  ------------------
  |  |  230|  36.8k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  36.8k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6452|  36.8k|            if (p->atom_type) {
  ------------------
  |  Branch (6452:17): [True: 359, False: 36.4k]
  ------------------
 6453|    359|                JS_FreeAtomStruct(rt, p);
 6454|  36.4k|            } else {
 6455|       |#ifdef DUMP_LEAKS
 6456|       |                list_del(&p->link);
 6457|       |#endif
 6458|  36.4k|                js_free_rt(rt, p);
 6459|  36.4k|            }
 6460|  36.8k|        }
 6461|  36.8k|        break;
 6462|      0|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (6462:5): [True: 0, False: 39.5k]
  ------------------
 6463|       |        /* Note: recursion is acceptable because the rope depth is bounded */
 6464|      0|        {
 6465|      0|            JSStringRope *p = JS_VALUE_GET_STRING_ROPE(v);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
 6466|      0|            JS_FreeValueRT(rt, p->left);
 6467|      0|            JS_FreeValueRT(rt, p->right);
 6468|      0|            js_free_rt(rt, p);
 6469|      0|        }
 6470|      0|        break;
 6471|  2.71k|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (6471:5): [True: 2.71k, False: 36.8k]
  ------------------
 6472|  2.73k|    case JS_TAG_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6472:5): [True: 20, False: 39.5k]
  ------------------
 6473|  2.73k|    case JS_TAG_MODULE:
  ------------------
  |  Branch (6473:5): [True: 0, False: 39.5k]
  ------------------
 6474|  2.73k|        {
 6475|  2.73k|            JSGCObjectHeader *p = JS_VALUE_GET_PTR(v);
  ------------------
  |  |  243|  2.73k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
 6476|  2.73k|            if (rt->gc_phase != JS_GC_PHASE_REMOVE_CYCLES) {
  ------------------
  |  Branch (6476:17): [True: 103, False: 2.62k]
  ------------------
 6477|    103|                list_del(&p->link);
 6478|    103|                list_add(&p->link, &rt->gc_zero_ref_count_list);
 6479|    103|                js_rc(p)->mark = 1; /* indicate that the object is about to be freed */
 6480|    103|                if (rt->gc_phase == JS_GC_PHASE_NONE) {
  ------------------
  |  Branch (6480:21): [True: 64, False: 39]
  ------------------
 6481|     64|                    free_zero_refcount(rt);
 6482|     64|                }
 6483|    103|            }
 6484|  2.73k|        }
 6485|  2.73k|        break;
 6486|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (6486:5): [True: 0, False: 39.5k]
  ------------------
 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: 39.5k]
  ------------------
 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: 39.5k]
  ------------------
 6499|      0|        abort();
 6500|  39.5k|    }
 6501|  39.5k|}
__JS_FreeValue:
 6504|    844|{
 6505|    844|    __JS_FreeValueRT(ctx->rt, v);
 6506|    844|}
JS_MarkValue:
 6554|   371k|{
 6555|   371k|    if (JS_VALUE_HAS_REF_COUNT(val)) {
  ------------------
  |  |  287|   371k|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|   371k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (287:35): [True: 360k, False: 10.9k]
  |  |  ------------------
  ------------------
 6556|   360k|        switch(JS_VALUE_GET_TAG(val)) {
  ------------------
  |  |  236|   360k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
 6557|  10.5k|        case JS_TAG_OBJECT:
  ------------------
  |  Branch (6557:9): [True: 10.5k, False: 350k]
  ------------------
 6558|  10.6k|        case JS_TAG_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6558:9): [True: 38, False: 360k]
  ------------------
 6559|  10.7k|        case JS_TAG_MODULE:
  ------------------
  |  Branch (6559:9): [True: 102, False: 360k]
  ------------------
 6560|  10.7k|            mark_func(rt, JS_VALUE_GET_PTR(val));
  ------------------
  |  |  243|  10.7k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
 6561|  10.7k|            break;
 6562|   349k|        default:
  ------------------
  |  Branch (6562:9): [True: 349k, False: 10.7k]
  ------------------
 6563|   349k|            break;
 6564|   360k|        }
 6565|   360k|    }
 6566|   371k|}
JS_RunGC:
 6836|      6|{
 6837|      6|    JS_RunGCInternal(rt, TRUE);
 6838|      6|}
JS_GetGlobalObject:
 7350|     11|{
 7351|     11|    return JS_DupValue(ctx, ctx->global_obj);
 7352|     11|}
JS_Throw:
 7356|     21|{
 7357|     21|    JSRuntime *rt = ctx->rt;
 7358|     21|    JS_FreeValue(ctx, rt->current_exception);
 7359|     21|    rt->current_exception = obj;
 7360|     21|    rt->current_exception_is_uncatchable = FALSE;
 7361|     21|    return JS_EXCEPTION;
  ------------------
  |  |  294|     21|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|     21|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 7362|     21|}
JS_ThrowTypeError:
 7688|     11|{
 7689|     11|    JSValue val;
 7690|     11|    va_list ap;
 7691|       |
 7692|     11|    va_start(ap, fmt);
 7693|     11|    val = JS_ThrowError(ctx, JS_TYPE_ERROR, fmt, ap);
 7694|       |    va_end(ap);
 7695|     11|    return val;
 7696|     11|}
JS_ThrowReferenceError:
 7746|      6|{
 7747|      6|    JSValue val;
 7748|      6|    va_list ap;
 7749|       |
 7750|      6|    va_start(ap, fmt);
 7751|      6|    val = JS_ThrowError(ctx, JS_REFERENCE_ERROR, fmt, ap);
 7752|       |    va_end(ap);
 7753|      6|    return val;
 7754|      6|}
JS_GetPrototype:
 8028|      3|{
 8029|      3|    JSValue val;
 8030|      3|    if (JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT) {
  ------------------
  |  |  236|      3|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (8030:9): [True: 3, False: 0]
  ------------------
 8031|      3|        JSObject *p;
 8032|      3|        p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|      3|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      3|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8033|      3|        if (unlikely(p->is_exotic)) {
  ------------------
  |  |   33|      3|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 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|      3|        p = p->shape->proto;
 8040|      3|        if (!p)
  ------------------
  |  Branch (8040:13): [True: 1, False: 2]
  ------------------
 8041|      1|            val = JS_NULL;
  ------------------
  |  |  290|      1|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8042|      2|        else
 8043|      2|            val = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|      2|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8044|      3|    } else {
 8045|      0|        val = JS_DupValue(ctx, JS_GetPrototypePrimitive(ctx, obj));
 8046|      0|    }
 8047|      3|    return val;
 8048|      3|}
JS_GetPropertyInternal:
 8213|    523|{
 8214|    523|    JSObject *p;
 8215|    523|    JSProperty *pr;
 8216|    523|    JSShapeProperty *prs;
 8217|    523|    uint32_t tag;
 8218|       |
 8219|    523|    tag = JS_VALUE_GET_TAG(obj);
  ------------------
  |  |  236|    523|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
 8220|    523|    if (unlikely(tag != JS_TAG_OBJECT)) {
  ------------------
  |  |   33|    523|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1, False: 522]
  |  |  ------------------
  ------------------
 8221|      1|        switch(tag) {
 8222|      0|        case JS_TAG_NULL:
  ------------------
  |  Branch (8222:9): [True: 0, False: 1]
  ------------------
 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: 1]
  ------------------
 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: 1]
  ------------------
 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|      1|        case JS_TAG_STRING:
  ------------------
  |  Branch (8228:9): [True: 1, False: 0]
  ------------------
 8229|      1|            {
 8230|      1|                JSString *p1 = JS_VALUE_GET_STRING(obj);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
 8231|      1|                if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (8231:21): [True: 0, False: 1]
  ------------------
 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|      1|                } else if (prop == JS_ATOM_length) {
  ------------------
  |  Branch (8237:28): [True: 0, False: 1]
  ------------------
 8238|      0|                    return JS_NewInt32(ctx, p1->len);
 8239|      0|                }
 8240|      1|            }
 8241|      1|            break;
 8242|      1|        case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (8242:9): [True: 0, False: 1]
  ------------------
 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: 1]
  ------------------
 8257|      0|            break;
 8258|      1|        }
 8259|       |        /* cannot raise an exception */
 8260|      1|        p = JS_VALUE_GET_OBJ(JS_GetPrototypePrimitive(ctx, obj));
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
 8261|      1|        if (!p)
  ------------------
  |  Branch (8261:13): [True: 0, False: 1]
  ------------------
 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|    522|    } else {
 8264|    522|        p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|    522|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    522|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8265|    522|    }
 8266|       |
 8267|    681|    for(;;) {
 8268|    681|        prs = find_own_property(&pr, p, prop);
 8269|    681|        if (prs) {
  ------------------
  |  Branch (8269:13): [True: 637, False: 44]
  ------------------
 8270|       |            /* found */
 8271|    637|            if (unlikely(prs->flags & JS_PROP_TMASK)) {
  ------------------
  |  |   33|    637|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 160, False: 477]
  |  |  ------------------
  ------------------
 8272|    160|                if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|    160|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  305|    160|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (8272:21): [True: 0, False: 160]
  ------------------
 8273|      0|                    if (unlikely(!pr->u.getset.getter)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 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|      0|                    } else {
 8276|      0|                        JSValue func = JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.getter);
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8277|       |                        /* Note: the field could be removed in the getter */
 8278|      0|                        func = JS_DupValue(ctx, func);
 8279|      0|                        return JS_CallFree(ctx, func, this_obj, 0, NULL);
 8280|      0|                    }
 8281|    160|                } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  303|    160|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  306|    160|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (8281:28): [True: 33, False: 127]
  ------------------
 8282|     33|                    JSValue val = *pr->u.var_ref->pvalue;
 8283|     33|                    if (unlikely(JS_IsUninitialized(val)))
  ------------------
  |  |   33|     33|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 33]
  |  |  ------------------
  ------------------
 8284|      0|                        return JS_ThrowReferenceErrorUninitialized(ctx, prs->atom);
 8285|     33|                    return JS_DupValue(ctx, val);
 8286|    127|                } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  303|    127|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  307|    127|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (8286:28): [True: 127, False: 0]
  ------------------
 8287|       |                    /* Instantiate property and retry */
 8288|    127|                    if (JS_AutoInitProperty(ctx, p, prop, pr, prs))
  ------------------
  |  Branch (8288:25): [True: 0, False: 127]
  ------------------
 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|    127|                    continue;
 8291|    127|                }
 8292|    477|            } else {
 8293|    477|                return JS_DupValue(ctx, pr->u.value);
 8294|    477|            }
 8295|    637|        }
 8296|     44|        if (unlikely(p->is_exotic)) {
  ------------------
  |  |   33|     44|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 20, False: 24]
  |  |  ------------------
  ------------------
 8297|       |            /* exotic behaviors */
 8298|     20|            if (p->fast_array) {
  ------------------
  |  Branch (8298:17): [True: 11, False: 9]
  ------------------
 8299|     11|                if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (8299:21): [True: 2, False: 9]
  ------------------
 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|      9|                } else if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (8308:28): [True: 0, False: 9]
  ------------------
 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|     11|            } else {
 8319|      9|                const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8320|      9|                if (em) {
  ------------------
  |  Branch (8320:21): [True: 0, False: 9]
  ------------------
 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|      9|            }
 8354|     20|        }
 8355|     44|        p = p->shape->proto;
 8356|     44|        if (!p)
  ------------------
  |  Branch (8356:13): [True: 13, False: 31]
  ------------------
 8357|     13|            break;
 8358|     44|    }
 8359|     13|    if (unlikely(throw_ref_error)) {
  ------------------
  |  |   33|     13|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 6, False: 7]
  |  |  ------------------
  ------------------
 8360|      6|        return JS_ThrowReferenceErrorNotDefined(ctx, prop);
 8361|      7|    } else {
 8362|      7|        return JS_UNDEFINED;
  ------------------
  |  |  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 }
  |  |  ------------------
  ------------------
 8363|      7|    }
 8364|     13|}
JS_FreePropertyEnum:
 8587|     13|{
 8588|     13|    uint32_t i;
 8589|     13|    if (tab) {
  ------------------
  |  Branch (8589:9): [True: 13, False: 0]
  ------------------
 8590|     35|        for(i = 0; i < len; i++)
  ------------------
  |  Branch (8590:20): [True: 22, False: 13]
  ------------------
 8591|     22|            JS_FreeAtom(ctx, tab[i].atom);
 8592|     13|        js_free(ctx, tab);
 8593|     13|    }
 8594|     13|}
JS_IsExtensible:
 8907|     22|{
 8908|     22|    JSObject *p;
 8909|       |
 8910|     22|    if (unlikely(JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT))
  ------------------
  |  |   33|     22|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 22]
  |  |  ------------------
  ------------------
 8911|      0|        return FALSE;
 8912|     22|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|     22|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     22|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8913|     22|    if (unlikely(p->is_exotic)) {
  ------------------
  |  |   33|     22|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 22, False: 0]
  |  |  ------------------
  ------------------
 8914|     22|        const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8915|     22|        if (em && em->is_extensible) {
  ------------------
  |  Branch (8915:13): [True: 22, False: 0]
  |  Branch (8915:19): [True: 0, False: 22]
  ------------------
 8916|      0|            return em->is_extensible(ctx, obj);
 8917|      0|        }
 8918|     22|    }
 8919|     22|    return p->extensible;
 8920|     22|}
JS_PreventExtensions:
 8924|     11|{
 8925|     11|    JSObject *p;
 8926|       |
 8927|     11|    if (unlikely(JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT))
  ------------------
  |  |   33|     11|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 11]
  |  |  ------------------
  ------------------
 8928|      0|        return FALSE;
 8929|     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)
  |  |  ------------------
  ------------------
 8930|     11|    if (unlikely(p->is_exotic)) {
  ------------------
  |  |   33|     11|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 11]
  |  |  ------------------
  ------------------
 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|     11|    p->extensible = FALSE;
 8949|     11|    return TRUE;
 8950|     11|}
JS_HasProperty:
 8954|      1|{
 8955|      1|    JSObject *p;
 8956|      1|    int ret;
 8957|      1|    JSValue obj1;
 8958|       |
 8959|      1|    if (unlikely(JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT))
  ------------------
  |  |   33|      1|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 8960|      0|        return FALSE;
 8961|      1|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
 8962|      2|    for(;;) {
 8963|      2|        if (p->is_exotic) {
  ------------------
  |  Branch (8963:13): [True: 0, False: 2]
  ------------------
 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|      2|        JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|      2|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8975|      2|        ret = JS_GetOwnPropertyInternal(ctx, NULL, p, prop);
 8976|      2|        JS_FreeValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|      2|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8977|      2|        if (ret != 0)
  ------------------
  |  Branch (8977:13): [True: 0, False: 2]
  ------------------
 8978|      0|            return ret;
 8979|      2|        if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (8979:13): [True: 1, False: 1]
  ------------------
 8980|      1|            p->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (8980:13): [True: 0, False: 1]
  ------------------
 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|      2|        p = p->shape->proto;
 8989|      2|        if (!p)
  ------------------
  |  Branch (8989:13): [True: 1, False: 1]
  ------------------
 8990|      1|            break;
 8991|      2|    }
 8992|      1|    return FALSE;
 8993|      1|}
JS_ValueToAtom:
 9004|   171k|{
 9005|   171k|    JSAtom atom;
 9006|   171k|    uint32_t tag;
 9007|   171k|    tag = JS_VALUE_GET_TAG(val);
  ------------------
  |  |  236|   171k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
 9008|   171k|    if (tag == JS_TAG_INT &&
  ------------------
  |  Branch (9008:9): [True: 171k, False: 22]
  ------------------
 9009|   171k|        (uint32_t)JS_VALUE_GET_INT(val) <= JS_ATOM_MAX_INT) {
  ------------------
  |  |  239|   171k|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
                      (uint32_t)JS_VALUE_GET_INT(val) <= JS_ATOM_MAX_INT) {
  ------------------
  |  | 2871|   171k|#define JS_ATOM_MAX_INT (JS_ATOM_TAG_INT - 1)
  |  |  ------------------
  |  |  |  | 2870|   171k|#define JS_ATOM_TAG_INT (1U << 31)
  |  |  ------------------
  ------------------
  |  Branch (9009:9): [True: 171k, False: 0]
  ------------------
 9010|       |        /* fast path for integer values */
 9011|   171k|        atom = __JS_AtomFromUInt32(JS_VALUE_GET_INT(val));
  ------------------
  |  |  239|   171k|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
 9012|   171k|    } else if (tag == JS_TAG_SYMBOL) {
  ------------------
  |  Branch (9012:16): [True: 0, False: 22]
  ------------------
 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|     22|    } else {
 9016|     22|        JSValue str;
 9017|     22|        str = JS_ToPropertyKey(ctx, val);
 9018|     22|        if (JS_IsException(str))
  ------------------
  |  Branch (9018:13): [True: 0, False: 22]
  ------------------
 9019|      0|            return JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
 9020|     22|        if (JS_VALUE_GET_TAG(str) == JS_TAG_SYMBOL) {
  ------------------
  |  |  236|     22|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (9020:13): [True: 0, False: 22]
  ------------------
 9021|      0|            atom = js_symbol_to_atom(ctx, str);
 9022|     22|        } else {
 9023|     22|            atom = JS_NewAtomStr(ctx, JS_VALUE_GET_STRING(str));
  ------------------
  |  |  230|     22|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     22|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9024|     22|        }
 9025|     22|    }
 9026|   171k|    return atom;
 9027|   171k|}
JS_GetPropertyUint32:
 9106|   171k|{
 9107|   171k|    return JS_GetPropertyValue(ctx, this_obj, JS_NewUint32(ctx, idx));
 9108|   171k|}
JS_SetPropertyInternal:
 9665|    100|{
 9666|    100|    JSObject *p, *p1;
 9667|    100|    JSShapeProperty *prs;
 9668|    100|    JSProperty *pr;
 9669|    100|    uint32_t tag;
 9670|    100|    JSPropertyDescriptor desc;
 9671|    100|    int ret;
 9672|       |#if 0
 9673|       |    printf("JS_SetPropertyInternal: "); print_atom(ctx, prop); printf("\n");
 9674|       |#endif
 9675|    100|    tag = JS_VALUE_GET_TAG(this_obj);
  ------------------
  |  |  236|    100|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
 9676|    100|    if (unlikely(tag != JS_TAG_OBJECT)) {
  ------------------
  |  |   33|    100|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 100]
  |  |  ------------------
  ------------------
 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|    100|    } else {
 9699|    100|        p = JS_VALUE_GET_OBJ(this_obj);
  ------------------
  |  |  229|    100|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    100|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9700|    100|        p1 = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|    100|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    100|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9701|    100|        if (unlikely(p != p1))
  ------------------
  |  |   33|    100|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 100]
  |  |  ------------------
  ------------------
 9702|      0|            goto retry2;
 9703|    100|    }
 9704|       |
 9705|       |    /* fast path if obj == this_obj */
 9706|    100| retry:
 9707|    100|    prs = find_own_property(&pr, p1, prop);
 9708|    100|    if (prs) {
  ------------------
  |  Branch (9708:9): [True: 0, False: 100]
  ------------------
 9709|      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]
  |  |  ------------------
  ------------------
 9710|      0|                                  JS_PROP_LENGTH)) == JS_PROP_WRITABLE)) {
 9711|       |            /* fast case */
 9712|      0|            set_value(ctx, &pr->u.value, val);
 9713|      0|            return TRUE;
 9714|      0|        } 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|      0|    }
 9738|       |
 9739|    200|    for(;;) {
 9740|    200|        if (p1->is_exotic) {
  ------------------
  |  Branch (9740:13): [True: 0, False: 200]
  ------------------
 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|    200|        p1 = p1->shape->proto;
 9835|    200|    prototype_lookup:
 9836|    200|        if (!p1)
  ------------------
  |  Branch (9836:13): [True: 100, False: 100]
  ------------------
 9837|    100|            break;
 9838|       |
 9839|    100|    retry2:
 9840|    100|        prs = find_own_property(&pr, p1, prop);
 9841|    100|        if (prs) {
  ------------------
  |  Branch (9841:13): [True: 0, False: 100]
  ------------------
 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|    100|    }
 9856|       |
 9857|    100|    if (unlikely(!p)) {
  ------------------
  |  |   33|    100|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 100]
  |  |  ------------------
  ------------------
 9858|      0|        JS_FreeValue(ctx, val);
 9859|      0|        return JS_ThrowTypeErrorOrFalse(ctx, flags, "not an object");
 9860|      0|    }
 9861|       |
 9862|    100|    if (unlikely(!p->extensible)) {
  ------------------
  |  |   33|    100|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 100]
  |  |  ------------------
  ------------------
 9863|      0|        JS_FreeValue(ctx, val);
 9864|      0|        return JS_ThrowTypeErrorOrFalse(ctx, flags, "object is not extensible");
 9865|      0|    }
 9866|       |
 9867|    100|    if (likely(p == JS_VALUE_GET_OBJ(obj))) {
  ------------------
  |  |   32|    100|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 100, False: 0]
  |  |  ------------------
  ------------------
 9868|    100|        if (p->is_exotic) {
  ------------------
  |  Branch (9868:13): [True: 0, False: 100]
  ------------------
 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|    100|        } else {
 9882|    100|            if (unlikely(p->class_id == JS_CLASS_GLOBAL_OBJECT))
  ------------------
  |  |   33|    100|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 78, False: 22]
  |  |  ------------------
  ------------------
 9883|     78|                goto generic_create_prop;
 9884|     22|            pr = add_property(ctx, p, prop, JS_PROP_C_W_E);
  ------------------
  |  |  301|     22|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     22|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|     22|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|     22|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
 9885|     22|            if (unlikely(!pr)) {
  ------------------
  |  |   33|     22|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 22]
  |  |  ------------------
  ------------------
 9886|      0|                JS_FreeValue(ctx, val);
 9887|      0|                return -1;
 9888|      0|            }
 9889|     22|            pr->u.value = val;
 9890|     22|            return TRUE;
 9891|     22|        }
 9892|    100|    } 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|     78|        generic_create_prop:
 9921|     78|            ret = JS_CreateProperty(ctx, p, prop, val, JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  291|     78|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     78|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
                          ret = JS_CreateProperty(ctx, p, prop, val, JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  291|     78|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     78|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 9922|     78|                                    flags |
 9923|     78|                                    JS_PROP_HAS_VALUE |
  ------------------
  |  |  316|     78|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
 9924|     78|                                    JS_PROP_HAS_ENUMERABLE |
  ------------------
  |  |  313|     78|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
 9925|     78|                                    JS_PROP_HAS_WRITABLE |
  ------------------
  |  |  312|     78|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
 9926|     78|                                    JS_PROP_HAS_CONFIGURABLE |
  ------------------
  |  |  311|     78|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
 9927|     78|                                    JS_PROP_C_W_E);
  ------------------
  |  |  301|     78|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     78|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|     78|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|     78|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
 9928|     78|            JS_FreeValue(ctx, val);
 9929|     78|            return ret;
 9930|      0|        }
 9931|      0|    }
 9932|    100|}
JS_SetPropertyStr:
10102|     77|{
10103|     77|    JSAtom atom;
10104|     77|    int ret;
10105|     77|    atom = JS_NewAtom(ctx, prop);
10106|     77|    if (atom == JS_ATOM_NULL) {
  ------------------
  |  |  451|     77|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (10106:9): [True: 0, False: 77]
  ------------------
10107|      0|        JS_FreeValue(ctx, val);
10108|      0|        return -1;
10109|      0|    }
10110|     77|    ret = JS_SetPropertyInternal(ctx, this_obj, atom, val, this_obj, JS_PROP_THROW);
  ------------------
  |  |  320|     77|#define JS_PROP_THROW            (1 << 14)
  ------------------
10111|     77|    JS_FreeAtom(ctx, atom);
10112|     77|    return ret;
10113|     77|}
JS_DefineProperty:
10353|   178k|{
10354|   178k|    JSObject *p;
10355|   178k|    JSShapeProperty *prs;
10356|   178k|    JSProperty *pr;
10357|   178k|    int mask, res;
10358|       |
10359|   178k|    if (JS_VALUE_GET_TAG(this_obj) != JS_TAG_OBJECT) {
  ------------------
  |  |  236|   178k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10359:9): [True: 0, False: 178k]
  ------------------
10360|      0|        JS_ThrowTypeErrorNotAnObject(ctx);
10361|      0|        return -1;
10362|      0|    }
10363|   178k|    p = JS_VALUE_GET_OBJ(this_obj);
  ------------------
  |  |  229|   178k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|   178k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10364|       |
10365|   178k| redo_prop_update:
10366|   178k|    prs = find_own_property(&pr, p, prop);
10367|   178k|    if (prs) {
  ------------------
  |  Branch (10367:9): [True: 35, False: 178k]
  ------------------
10368|       |        /* the range of the Array length property is always tested before */
10369|     35|        if ((prs->flags & JS_PROP_LENGTH) && (flags & JS_PROP_HAS_VALUE)) {
  ------------------
  |  |  302|     35|#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: 35]
  |  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|     35|        if (!check_define_prop_flags(prs->flags, flags)) {
  ------------------
  |  Branch (10382:13): [True: 0, False: 35]
  ------------------
10383|      0|        not_configurable:
10384|      0|            return JS_ThrowTypeErrorOrFalse(ctx, flags, "property is not configurable");
10385|      0|        }
10386|       |
10387|     35|        if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  303|     35|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  307|     35|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (10387:13): [True: 0, False: 35]
  ------------------
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|     35|        if (flags & (JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE |
  ------------------
  |  |  316|     35|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
                      if (flags & (JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE |
  ------------------
  |  |  312|     35|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
  |  Branch (10394:13): [True: 13, False: 22]
  ------------------
10395|     35|                     JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  314|     35|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                   JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  315|     35|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
10396|     13|            if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  314|     13|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                          if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  315|     13|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10396:17): [True: 11, False: 2]
  ------------------
10397|     11|                JSObject *new_getter, *new_setter;
10398|       |
10399|     11|                if (JS_IsFunction(ctx, getter)) {
  ------------------
  |  Branch (10399:21): [True: 11, False: 0]
  ------------------
10400|     11|                    new_getter = JS_VALUE_GET_OBJ(getter);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
10401|     11|                } else {
10402|      0|                    new_getter = NULL;
10403|      0|                }
10404|     11|                if (JS_IsFunction(ctx, setter)) {
  ------------------
  |  Branch (10404:21): [True: 11, False: 0]
  ------------------
10405|     11|                    new_setter = JS_VALUE_GET_OBJ(setter);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
10406|     11|                } else {
10407|      0|                    new_setter = NULL;
10408|      0|                }
10409|       |
10410|     11|                if ((prs->flags & JS_PROP_TMASK) != JS_PROP_GETSET) {
  ------------------
  |  |  303|     11|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              if ((prs->flags & JS_PROP_TMASK) != JS_PROP_GETSET) {
  ------------------
  |  |  305|     11|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (10410:21): [True: 11, False: 0]
  ------------------
10411|     11|                    if (js_shape_prepare_update(ctx, p, &prs))
  ------------------
  |  Branch (10411:25): [True: 0, False: 11]
  ------------------
10412|      0|                        return -1;
10413|       |                    /* convert to getset */
10414|     11|                    if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  303|     11|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                  if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  306|     11|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (10414:25): [True: 0, False: 11]
  ------------------
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|     11|                    } else {
10421|     11|                        JS_FreeValue(ctx, pr->u.value);
10422|     11|                    }
10423|     11|                    prs->flags = (prs->flags &
10424|     11|                                  (JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE)) |
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                                (JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE)) |
  ------------------
  |  |  300|     11|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
10425|     11|                        JS_PROP_GETSET;
  ------------------
  |  |  305|     11|#define JS_PROP_GETSET         (1 << 4)
  ------------------
10426|     11|                    pr->u.getset.getter = NULL;
10427|     11|                    pr->u.getset.setter = NULL;
10428|     11|                } 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|     11|                if (flags & JS_PROP_HAS_GET) {
  ------------------
  |  |  314|     11|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
  |  Branch (10440:21): [True: 11, False: 0]
  ------------------
10441|     11|                    if (pr->u.getset.getter)
  ------------------
  |  Branch (10441:25): [True: 0, False: 11]
  ------------------
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|     11|                    if (new_getter)
  ------------------
  |  Branch (10443:25): [True: 11, False: 0]
  ------------------
10444|     11|                        JS_DupValue(ctx, getter);
10445|     11|                    pr->u.getset.getter = new_getter;
10446|     11|                }
10447|     11|                if (flags & JS_PROP_HAS_SET) {
  ------------------
  |  |  315|     11|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10447:21): [True: 11, False: 0]
  ------------------
10448|     11|                    if (pr->u.getset.setter)
  ------------------
  |  Branch (10448:25): [True: 0, False: 11]
  ------------------
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|     11|                    if (new_setter)
  ------------------
  |  Branch (10450:25): [True: 11, False: 0]
  ------------------
10451|     11|                        JS_DupValue(ctx, setter);
10452|     11|                    pr->u.getset.setter = new_setter;
10453|     11|                }
10454|     11|            } 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|     13|        }
10562|     35|        mask = 0;
10563|     35|        if (flags & JS_PROP_HAS_CONFIGURABLE)
  ------------------
  |  |  311|     35|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
  |  Branch (10563:13): [True: 24, False: 11]
  ------------------
10564|     24|            mask |= JS_PROP_CONFIGURABLE;
  ------------------
  |  |  298|     24|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
10565|     35|        if (flags & JS_PROP_HAS_ENUMERABLE)
  ------------------
  |  |  313|     35|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
  |  Branch (10565:13): [True: 2, False: 33]
  ------------------
10566|      2|            mask |= JS_PROP_ENUMERABLE;
  ------------------
  |  |  300|      2|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
10567|     35|        if (js_update_property_flags(ctx, p, &prs,
  ------------------
  |  Branch (10567:13): [True: 0, False: 35]
  ------------------
10568|     35|                                     (prs->flags & ~mask) | (flags & mask)))
10569|      0|            return -1;
10570|     35|        return TRUE;
10571|     35|    }
10572|       |
10573|       |    /* handle modification of fast array elements */
10574|   178k|    if (p->fast_array) {
  ------------------
  |  Branch (10574:9): [True: 171k, False: 6.73k]
  ------------------
10575|   171k|        uint32_t idx;
10576|   171k|        uint32_t prop_flags;
10577|   171k|        if (p->class_id == JS_CLASS_ARRAY) {
  ------------------
  |  Branch (10577:13): [True: 171k, False: 0]
  ------------------
10578|   171k|            if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (10578:17): [True: 171k, False: 26]
  ------------------
10579|   171k|                idx = __JS_AtomToUInt32(prop);
10580|   171k|                if (idx < p->u.array.count) {
  ------------------
  |  Branch (10580:21): [True: 0, False: 171k]
  ------------------
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|   171k|            }
10597|   171k|        } 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|   171k|    }
10644|       |
10645|   178k|    return JS_CreateProperty(ctx, p, prop, val, getter, setter, flags);
10646|   178k|}
JS_DefinePropertyValue:
10681|   177k|{
10682|   177k|    int ret;
10683|   177k|    ret = JS_DefineProperty(ctx, this_obj, prop, val, JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  291|   177k|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|   177k|#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|   177k|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|   177k|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
10684|   177k|                            flags | JS_PROP_HAS_VALUE | JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_WRITABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  316|   177k|#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|   177k|#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|   177k|#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|   177k|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
10685|   177k|    JS_FreeValue(ctx, val);
10686|   177k|    return ret;
10687|   177k|}
JS_DefinePropertyValueValue:
10691|   171k|{
10692|   171k|    JSAtom atom;
10693|   171k|    int ret;
10694|   171k|    atom = JS_ValueToAtom(ctx, prop);
10695|   171k|    JS_FreeValue(ctx, prop);
10696|   171k|    if (unlikely(atom == JS_ATOM_NULL)) {
  ------------------
  |  |   33|   171k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 171k]
  |  |  ------------------
  ------------------
10697|      0|        JS_FreeValue(ctx, val);
10698|      0|        return -1;
10699|      0|    }
10700|   171k|    ret = JS_DefinePropertyValue(ctx, this_obj, atom, val, flags);
10701|   171k|    JS_FreeAtom(ctx, atom);
10702|   171k|    return ret;
10703|   171k|}
JS_DefinePropertyValueUint32:
10707|      8|{
10708|      8|    return JS_DefinePropertyValueValue(ctx, this_obj, JS_NewUint32(ctx, idx),
10709|      8|                                       val, flags);
10710|      8|}
JS_DefinePropertyValueStr:
10721|    473|{
10722|    473|    JSAtom atom;
10723|    473|    int ret;
10724|    473|    atom = JS_NewAtom(ctx, prop);
10725|    473|    if (atom == JS_ATOM_NULL) {
  ------------------
  |  |  451|    473|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (10725:9): [True: 0, False: 473]
  ------------------
10726|      0|        JS_FreeValue(ctx, val);
10727|      0|        return -1;
10728|      0|    }
10729|    473|    ret = JS_DefinePropertyValue(ctx, this_obj, atom, val, flags);
10730|    473|    JS_FreeAtom(ctx, atom);
10731|    473|    return ret;
10732|    473|}
JS_DefinePropertyGetSet:
10738|    451|{
10739|    451|    int ret;
10740|    451|    ret = JS_DefineProperty(ctx, this_obj, prop, JS_UNDEFINED, getter, setter,
  ------------------
  |  |  291|    451|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|    451|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
10741|    451|                            flags | JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  314|    451|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                          flags | JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  315|    451|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
10742|    451|                            JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  311|    451|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                                          JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  313|    451|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
10743|    451|    JS_FreeValue(ctx, getter);
10744|    451|    JS_FreeValue(ctx, setter);
10745|    451|    return ret;
10746|    451|}
JS_IsFunction:
10960|  1.04k|{
10961|  1.04k|    JSObject *p;
10962|  1.04k|    if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|  1.04k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10962:9): [True: 429, False: 615]
  ------------------
10963|    429|        return FALSE;
10964|    615|    p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|    615|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    615|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10965|    615|    switch(p->class_id) {
10966|      1|    case JS_CLASS_BYTECODE_FUNCTION:
  ------------------
  |  Branch (10966:5): [True: 1, False: 614]
  ------------------
10967|      1|        return TRUE;
10968|      0|    case JS_CLASS_PROXY:
  ------------------
  |  Branch (10968:5): [True: 0, False: 615]
  ------------------
10969|      0|        return p->u.proxy_data->is_func;
10970|    614|    default:
  ------------------
  |  Branch (10970:5): [True: 614, False: 1]
  ------------------
10971|       |        return (ctx->rt->class_array[p->class_id].call != NULL);
10972|    615|    }
10973|    615|}
JS_SetConstructorBit:
10997|     11|{
10998|     11|    JSObject *p;
10999|     11|    if (JS_VALUE_GET_TAG(func_obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|     11|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10999:9): [True: 0, False: 11]
  ------------------
11000|      0|        return FALSE;
11001|     11|    p = JS_VALUE_GET_OBJ(func_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)
  |  |  ------------------
  ------------------
11002|     11|    p->is_constructor = val;
11003|     11|    return TRUE;
11004|     11|}
JS_SetOpaque:
11022|    132|{
11023|    132|   JSObject *p;
11024|    132|    if (JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT) {
  ------------------
  |  |  236|    132|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (11024:9): [True: 132, False: 0]
  ------------------
11025|    132|        p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|    132|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    132|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
11026|    132|        p->u.opaque = opaque;
11027|    132|    }
11028|    132|}
JS_GetOpaque:
11032|    255|{
11033|    255|    JSObject *p;
11034|    255|    if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|    255|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (11034:9): [True: 0, False: 255]
  ------------------
11035|      0|        return NULL;
11036|    255|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|    255|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    255|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
11037|    255|    if (p->class_id != class_id)
  ------------------
  |  Branch (11037:9): [True: 0, False: 255]
  ------------------
11038|      0|        return NULL;
11039|    255|    return p->u.opaque;
11040|    255|}
JS_ToInt64Clamp:
13239|      3|{
13240|      3|    int res = JS_ToInt64SatFree(ctx, pres, JS_DupValue(ctx, val));
13241|      3|    if (res == 0) {
  ------------------
  |  Branch (13241:9): [True: 3, False: 0]
  ------------------
13242|      3|        if (*pres < 0)
  ------------------
  |  Branch (13242:13): [True: 0, False: 3]
  ------------------
13243|      0|            *pres += neg_offset;
13244|      3|        if (*pres < min)
  ------------------
  |  Branch (13244:13): [True: 0, False: 3]
  ------------------
13245|      0|            *pres = min;
13246|      3|        else if (*pres > max)
  ------------------
  |  Branch (13246:18): [True: 0, False: 3]
  ------------------
13247|      0|            *pres = max;
13248|      3|    }
13249|      3|    return res;
13250|      3|}
JS_ToInt32:
13372|      8|{
13373|      8|    return JS_ToInt32Free(ctx, pres, JS_DupValue(ctx, val));
13374|      8|}
JS_ToString:
13646|      4|{
13647|      4|    return JS_ToStringInternal(ctx, val, FALSE);
13648|      4|}
JS_ToPropertyKey:
13666|     22|{
13667|     22|    return JS_ToStringInternal(ctx, val, TRUE);
13668|     22|}
JS_Call:
20719|     55|{
20720|     55|    return JS_CallInternal(ctx, func_obj, this_obj, JS_UNDEFINED,
  ------------------
  |  |  291|     55|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     55|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20721|     55|                           argc, (JSValue *)argv, JS_CALL_FLAG_COPY_ARGV);
  ------------------
  |  |17559|     55|#define JS_CALL_FLAG_COPY_ARGV   (1 << 1)
  ------------------
20722|     55|}
JS_NewCModule:
29854|     22|{
29855|     22|    JSModuleDef *m;
29856|     22|    JSAtom name;
29857|     22|    name = JS_NewAtom(ctx, name_str);
29858|     22|    if (name == JS_ATOM_NULL)
  ------------------
  |  |  451|     22|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (29858:9): [True: 0, False: 22]
  ------------------
29859|      0|        return NULL;
29860|     22|    m = js_new_module_def(ctx, name);
29861|     22|    if (!m)
  ------------------
  |  Branch (29861:9): [True: 0, False: 22]
  ------------------
29862|      0|        return NULL;
29863|     22|    m->init_func = func;
29864|     22|    return m;
29865|     22|}
JS_AddModuleExport:
29868|  1.07k|{
29869|  1.07k|    JSExportEntry *me;
29870|  1.07k|    JSAtom name;
29871|  1.07k|    name = JS_NewAtom(ctx, export_name);
29872|  1.07k|    if (name == JS_ATOM_NULL)
  ------------------
  |  |  451|  1.07k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (29872:9): [True: 0, False: 1.07k]
  ------------------
29873|      0|        return -1;
29874|  1.07k|    me = add_export_entry2(ctx, NULL, m, JS_ATOM_NULL, name,
  ------------------
  |  |  451|  1.07k|#define JS_ATOM_NULL 0
  ------------------
29875|  1.07k|                           JS_EXPORT_TYPE_LOCAL);
29876|  1.07k|    JS_FreeAtom(ctx, name);
29877|  1.07k|    if (!me)
  ------------------
  |  Branch (29877:9): [True: 0, False: 1.07k]
  ------------------
29878|      0|        return -1;
29879|  1.07k|    else
29880|  1.07k|        return 0;
29881|  1.07k|}
JS_SetModuleExport:
29885|  1.07k|{
29886|  1.07k|    JSExportEntry *me;
29887|  1.07k|    JSAtom name;
29888|  1.07k|    name = JS_NewAtom(ctx, export_name);
29889|  1.07k|    if (name == JS_ATOM_NULL)
  ------------------
  |  |  451|  1.07k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (29889:9): [True: 0, False: 1.07k]
  ------------------
29890|      0|        goto fail;
29891|  1.07k|    me = find_export_entry(ctx, m, name);
29892|  1.07k|    JS_FreeAtom(ctx, name);
29893|  1.07k|    if (!me)
  ------------------
  |  Branch (29893:9): [True: 0, False: 1.07k]
  ------------------
29894|      0|        goto fail;
29895|  1.07k|    set_value(ctx, me->u.local.var_ref->pvalue, val);
29896|  1.07k|    return 0;
29897|      0| fail:
29898|      0|    JS_FreeValue(ctx, val);
29899|      0|    return -1;
29900|  1.07k|}
JS_SetModuleLoaderFunc:
29916|     11|{
29917|     11|    rt->module_normalize_func = module_normalize;
29918|     11|    rt->module_loader_has_attr = FALSE;
29919|     11|    rt->u.module_loader_func = module_loader;
29920|       |    rt->module_check_attrs = NULL;
29921|     11|    rt->module_loader_opaque = opaque;
29922|     11|}
JS_GetModuleNamespace:
30513|     22|{
30514|     22|    if (JS_IsUndefined(m->module_ns)) {
  ------------------
  |  Branch (30514:9): [True: 22, False: 0]
  ------------------
30515|     22|        JSValue val;
30516|     22|        val = js_build_module_ns(ctx, m);
30517|     22|        if (JS_IsException(val))
  ------------------
  |  Branch (30517:13): [True: 0, False: 22]
  ------------------
30518|      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 }
  |  |  ------------------
  ------------------
30519|     22|        m->module_ns = val;
30520|     22|    }
30521|     22|    return JS_DupValue(ctx, m->module_ns);
30522|     22|}
JS_GetModuleName:
30890|     11|{
30891|     11|    return JS_DupAtom(ctx, m->module_name);
30892|     11|}
JS_EvalFunction:
37183|     11|{
37184|     11|    return JS_EvalFunctionInternal(ctx, fun_obj, ctx->global_obj, NULL, NULL);
37185|     11|}
JS_EvalThis:
37346|     22|{
37347|     22|    int eval_type = eval_flags & JS_EVAL_TYPE_MASK;
  ------------------
  |  |  336|     22|#define JS_EVAL_TYPE_MASK     (3 << 0)
  ------------------
37348|     22|    JSValue ret;
37349|       |
37350|     22|    assert(eval_type == JS_EVAL_TYPE_GLOBAL ||
  ------------------
  |  Branch (37350:5): [True: 22, False: 0]
  |  Branch (37350:5): [True: 0, False: 0]
  |  Branch (37350:5): [True: 11, False: 11]
  |  Branch (37350:5): [True: 11, False: 0]
  ------------------
37351|     22|           eval_type == JS_EVAL_TYPE_MODULE);
37352|     22|    ret = JS_EvalInternal(ctx, this_obj, input, input_len, filename,
37353|     22|                          eval_flags, -1);
37354|     22|    return ret;
37355|     22|}
JS_Eval:
37359|     22|{
37360|     22|    return JS_EvalThis(ctx, ctx->global_obj, input, input_len, filename,
37361|     22|                       eval_flags);
37362|     22|}
JS_SetPropertyFunctionList:
39711|  1.24k|{
39712|  1.24k|    int i, ret;
39713|       |
39714|  7.32k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (39714:17): [True: 6.08k, False: 1.24k]
  ------------------
39715|  6.08k|        const JSCFunctionListEntry *e = &tab[i];
39716|  6.08k|        JSAtom atom = find_atom(ctx, e->name);
39717|  6.08k|        if (atom == JS_ATOM_NULL)
  ------------------
  |  |  451|  6.08k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (39717:13): [True: 0, False: 6.08k]
  ------------------
39718|      0|            return -1;
39719|  6.08k|        ret = JS_InstantiateFunctionListItem(ctx, obj, atom, e);
39720|  6.08k|        JS_FreeAtom(ctx, atom);
39721|  6.08k|        if (ret)
  ------------------
  |  Branch (39721:13): [True: 0, False: 6.08k]
  ------------------
39722|      0|            return -1;
39723|  6.08k|    }
39724|  1.24k|    return 0;
39725|  1.24k|}
JS_AddModuleExportList:
39729|     22|{
39730|     22|    int i;
39731|  1.06k|    for(i = 0; i < len; i++) {
  ------------------
  |  Branch (39731:16): [True: 1.04k, False: 22]
  ------------------
39732|  1.04k|        if (JS_AddModuleExport(ctx, m, tab[i].name))
  ------------------
  |  Branch (39732:13): [True: 0, False: 1.04k]
  ------------------
39733|      0|            return -1;
39734|  1.04k|    }
39735|     22|    return 0;
39736|     22|}
JS_SetModuleExportList:
39740|     22|{
39741|     22|    int i;
39742|     22|    JSValue val;
39743|       |
39744|  1.06k|    for(i = 0; i < len; i++) {
  ------------------
  |  Branch (39744:16): [True: 1.04k, False: 22]
  ------------------
39745|  1.04k|        const JSCFunctionListEntry *e = &tab[i];
39746|  1.04k|        switch(e->def_type) {
39747|    605|        case JS_DEF_CFUNC:
  ------------------
  |  | 1099|    605|#define JS_DEF_CFUNC          0
  ------------------
  |  Branch (39747:9): [True: 605, False: 440]
  ------------------
39748|    605|            val = JS_NewCFunction2(ctx, e->u.func.cfunc.generic,
39749|    605|                                   e->name, e->u.func.length, e->u.func.cproto, e->magic);
39750|    605|            break;
39751|     11|        case JS_DEF_PROP_STRING:
  ------------------
  |  | 1102|     11|#define JS_DEF_PROP_STRING    3
  ------------------
  |  Branch (39751:9): [True: 11, False: 1.03k]
  ------------------
39752|     11|            val = JS_NewString(ctx, e->u.str);
39753|     11|            break;
39754|    418|        case JS_DEF_PROP_INT32:
  ------------------
  |  | 1103|    418|#define JS_DEF_PROP_INT32     4
  ------------------
  |  Branch (39754:9): [True: 418, False: 627]
  ------------------
39755|    418|            val = JS_NewInt32(ctx, e->u.i32);
39756|    418|            break;
39757|      0|        case JS_DEF_PROP_INT64:
  ------------------
  |  | 1104|      0|#define JS_DEF_PROP_INT64     5
  ------------------
  |  Branch (39757:9): [True: 0, False: 1.04k]
  ------------------
39758|      0|            val = JS_NewInt64(ctx, e->u.i64);
39759|      0|            break;
39760|      0|        case JS_DEF_PROP_DOUBLE:
  ------------------
  |  | 1105|      0|#define JS_DEF_PROP_DOUBLE    6
  ------------------
  |  Branch (39760:9): [True: 0, False: 1.04k]
  ------------------
39761|      0|            val = __JS_NewFloat64(ctx, e->u.f64);
39762|      0|            break;
39763|     11|        case JS_DEF_OBJECT:
  ------------------
  |  | 1107|     11|#define JS_DEF_OBJECT         8
  ------------------
  |  Branch (39763:9): [True: 11, False: 1.03k]
  ------------------
39764|     11|            val = JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_OBJECT],
39765|     11|                                        e->u.prop_list.tab, e->u.prop_list.len);
39766|     11|            break;
39767|      0|        default:
  ------------------
  |  Branch (39767:9): [True: 0, False: 1.04k]
  ------------------
39768|      0|            abort();
39769|  1.04k|        }
39770|  1.04k|        if (JS_SetModuleExport(ctx, m, e->name, val))
  ------------------
  |  Branch (39770:13): [True: 0, False: 1.04k]
  ------------------
39771|      0|            return -1;
39772|  1.04k|    }
39773|     22|    return 0;
39774|     22|}
JS_AddIntrinsicStringNormalize:
46917|     11|{
46918|     11|    return JS_SetPropertyFunctionList(ctx, ctx->class_proto[JS_CLASS_STRING], js_string_proto_normalize,
46919|     11|                                      countof(js_string_proto_normalize));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
46920|     11|}
JS_AddIntrinsicRegExpCompiler:
49262|     11|{
49263|     11|    ctx->compile_regexp = js_compile_regexp;
49264|     11|}
JS_AddIntrinsicRegExp:
49267|     11|{
49268|     11|    JSValue obj;
49269|       |
49270|     11|    JS_AddIntrinsicRegExpCompiler(ctx);
49271|       |
49272|     11|    obj = JS_NewCConstructor(ctx, JS_CLASS_REGEXP, "RegExp",
49273|     11|                                    js_regexp_constructor, 2, JS_CFUNC_constructor_or_func, 0,
49274|     11|                                    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 }
  |  |  ------------------
  ------------------
49275|     11|                                    js_regexp_funcs, countof(js_regexp_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
49276|     11|                                    js_regexp_proto_funcs, countof(js_regexp_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
49277|     11|                                    0);
49278|     11|    if (JS_IsException(obj))
  ------------------
  |  Branch (49278:9): [True: 0, False: 11]
  ------------------
49279|      0|        return -1;
49280|     11|    ctx->regexp_ctor = obj;
49281|       |    
49282|     11|    ctx->class_proto[JS_CLASS_REGEXP_STRING_ITERATOR] =
49283|     11|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR],
49284|     11|                              js_regexp_string_iterator_proto_funcs,
49285|     11|                              countof(js_regexp_string_iterator_proto_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
49286|     11|    if (JS_IsException(ctx->class_proto[JS_CLASS_REGEXP_STRING_ITERATOR]))
  ------------------
  |  Branch (49286:9): [True: 0, False: 11]
  ------------------
49287|      0|        return -1;
49288|       |
49289|     11|    ctx->regexp_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_REGEXP]),
49290|     11|                                     JS_PROP_INITIAL_HASH_SIZE, 1);
  ------------------
  |  |  966|     11|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
49291|     11|    if (!ctx->regexp_shape)
  ------------------
  |  Branch (49291:9): [True: 0, False: 11]
  ------------------
49292|      0|        return -1;
49293|     11|    if (add_shape_property(ctx, &ctx->regexp_shape, NULL,
  ------------------
  |  Branch (49293:9): [True: 0, False: 11]
  ------------------
49294|     11|                           JS_ATOM_lastIndex, JS_PROP_WRITABLE))
  ------------------
  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
49295|      0|        return -1;
49296|       |
49297|     11|    ctx->regexp_result_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_ARRAY]),
49298|     11|                                     JS_PROP_INITIAL_HASH_SIZE, 4);
  ------------------
  |  |  966|     11|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
49299|     11|    if (!ctx->regexp_result_shape)
  ------------------
  |  Branch (49299:9): [True: 0, False: 11]
  ------------------
49300|      0|        return -1;
49301|     11|    if (add_shape_property(ctx, &ctx->regexp_result_shape, NULL,
  ------------------
  |  Branch (49301:9): [True: 0, False: 11]
  ------------------
49302|     11|                           JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_LENGTH))
  ------------------
  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_LENGTH))
  ------------------
  |  |  302|     11|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
49303|      0|        return -1;
49304|     11|    if (add_shape_property(ctx, &ctx->regexp_result_shape, NULL,
  ------------------
  |  Branch (49304:9): [True: 0, False: 11]
  ------------------
49305|     11|                           JS_ATOM_index, JS_PROP_C_W_E))
  ------------------
  |  |  301|     11|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|     11|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
49306|      0|        return -1;
49307|     11|    if (add_shape_property(ctx, &ctx->regexp_result_shape, NULL,
  ------------------
  |  Branch (49307:9): [True: 0, False: 11]
  ------------------
49308|     11|                           JS_ATOM_input, JS_PROP_C_W_E))
  ------------------
  |  |  301|     11|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|     11|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
49309|      0|        return -1;
49310|     11|    if (add_shape_property(ctx, &ctx->regexp_result_shape, NULL,
  ------------------
  |  Branch (49310:9): [True: 0, False: 11]
  ------------------
49311|     11|                           JS_ATOM_groups, JS_PROP_C_W_E))
  ------------------
  |  |  301|     11|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|     11|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
49312|      0|        return -1;
49313|       |
49314|     11|    return 0;
49315|     11|}
JS_AddIntrinsicJSON:
50405|     11|{
50406|       |    /* add JSON as autoinit object */
50407|     11|    return JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_json_obj, countof(js_json_obj));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
50408|     11|}
JS_AddIntrinsicProxy:
51535|     11|{
51536|     11|    JSRuntime *rt = ctx->rt;
51537|     11|    JSValue obj1;
51538|       |
51539|     11|    if (!JS_IsRegisteredClass(rt, JS_CLASS_PROXY)) {
  ------------------
  |  Branch (51539:9): [True: 11, False: 0]
  ------------------
51540|     11|        if (init_class_range(rt, js_proxy_class_def, JS_CLASS_PROXY,
  ------------------
  |  Branch (51540:13): [True: 0, False: 11]
  ------------------
51541|     11|                             countof(js_proxy_class_def)))
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
51542|      0|            return -1;
51543|     11|        rt->class_array[JS_CLASS_PROXY].exotic = &js_proxy_exotic_methods;
51544|     11|        rt->class_array[JS_CLASS_PROXY].call = js_proxy_call;
51545|     11|    }
51546|       |
51547|       |    /* additional fields: name, length */
51548|     11|    obj1 = JS_NewCFunction3(ctx, js_proxy_constructor, "Proxy", 2,
51549|     11|                            JS_CFUNC_constructor, 0,
51550|     11|                            ctx->function_proto, countof(js_proxy_funcs) + 2);
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
51551|     11|    if (JS_IsException(obj1))
  ------------------
  |  Branch (51551:9): [True: 0, False: 11]
  ------------------
51552|      0|        return -1;
51553|     11|    JS_SetConstructorBit(ctx, obj1, TRUE);
51554|     11|    if (JS_SetPropertyFunctionList(ctx, obj1, js_proxy_funcs,
  ------------------
  |  Branch (51554:9): [True: 0, False: 11]
  ------------------
51555|     11|                                   countof(js_proxy_funcs)))
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
51556|      0|        goto fail;
51557|     11|    if (JS_DefinePropertyValueStr(ctx, ctx->global_obj, "Proxy",
  ------------------
  |  Branch (51557:9): [True: 0, False: 11]
  ------------------
51558|     11|                                  obj1, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                obj1, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
51559|      0|        goto fail;
51560|     11|    return 0;
51561|      0| fail:
51562|      0|    JS_FreeValue(ctx, obj1);
51563|      0|    return -1;
51564|     11|}
JS_AddIntrinsicMapSet:
53288|     11|{
53289|     11|    int i;
53290|     11|    JSValue obj1;
53291|     11|    char buf[ATOM_GET_STR_BUF_SIZE];
53292|       |
53293|     55|    for(i = 0; i < 4; i++) {
  ------------------
  |  Branch (53293:16): [True: 44, False: 11]
  ------------------
53294|     44|        JSCFunctionType ft;
53295|     44|        const char *name = JS_AtomGetStr(ctx, buf, sizeof(buf),
53296|     44|                                         JS_ATOM_Map + i);
53297|     44|        ft.constructor_magic = js_map_constructor;
53298|     44|        obj1 = JS_NewCConstructor(ctx, JS_CLASS_MAP + i, name,
53299|     44|                                  ft.generic, 0, JS_CFUNC_constructor_magic, i,
53300|     44|                                  JS_UNDEFINED,
  ------------------
  |  |  291|     44|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     44|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53301|     44|                                  js_map_funcs, i < 2 ? countof(js_map_funcs) : 0,
  ------------------
  |  |   47|     22|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (53301:49): [True: 22, False: 22]
  ------------------
53302|     44|                                  js_map_proto_funcs_ptr[i], js_map_proto_funcs_count[i],
53303|     44|                                  0);
53304|     44|        if (JS_IsException(obj1))
  ------------------
  |  Branch (53304:13): [True: 0, False: 44]
  ------------------
53305|      0|            return -1;
53306|     44|        JS_FreeValue(ctx, obj1);
53307|     44|    }
53308|       |
53309|     33|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53309:16): [True: 22, False: 11]
  ------------------
53310|     22|        ctx->class_proto[JS_CLASS_MAP_ITERATOR + i] =
53311|     22|            JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
53312|     22|                                  js_map_proto_funcs_ptr[i + 4],
53313|     22|                                  js_map_proto_funcs_count[i + 4]);
53314|     22|        if (JS_IsException(ctx->class_proto[JS_CLASS_MAP_ITERATOR + i]))
  ------------------
  |  Branch (53314:13): [True: 0, False: 22]
  ------------------
53315|      0|            return -1;
53316|     22|    }
53317|     11|    return 0;
53318|     11|}
JS_PromiseState:
53359|     22|{
53360|     22|    JSPromiseData *s = JS_GetOpaque(promise, JS_CLASS_PROMISE);
53361|     22|    if (!s)
  ------------------
  |  Branch (53361:9): [True: 0, False: 22]
  ------------------
53362|      0|        return -1;
53363|     22|    return s->promise_state;
53364|     22|}
JS_PromiseResult:
53367|     11|{
53368|     11|    JSPromiseData *s = JS_GetOpaque(promise, JS_CLASS_PROMISE);
53369|     11|    if (!s)
  ------------------
  |  Branch (53369:9): [True: 0, False: 11]
  ------------------
53370|      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 }
  |  |  ------------------
  ------------------
53371|     11|    return JS_DupValue(ctx, s->promise_result);
53372|     11|}
JS_NewPromiseCapability:
53782|     22|{
53783|     22|    return js_new_promise_capability(ctx, resolving_funcs, JS_UNDEFINED);
  ------------------
  |  |  291|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53784|     22|}
JS_AddIntrinsicPromise:
54637|     11|{
54638|     11|    JSRuntime *rt = ctx->rt;
54639|     11|    JSValue obj1;
54640|     11|    JSCFunctionType ft;
54641|       |
54642|     11|    if (!JS_IsRegisteredClass(rt, JS_CLASS_PROMISE)) {
  ------------------
  |  Branch (54642:9): [True: 11, False: 0]
  ------------------
54643|     11|        if (init_class_range(rt, js_async_class_def, JS_CLASS_PROMISE,
  ------------------
  |  Branch (54643:13): [True: 0, False: 11]
  ------------------
54644|     11|                             countof(js_async_class_def)))
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54645|      0|            return -1;
54646|     11|        rt->class_array[JS_CLASS_PROMISE_RESOLVE_FUNCTION].call = js_promise_resolve_function_call;
54647|     11|        rt->class_array[JS_CLASS_PROMISE_REJECT_FUNCTION].call = js_promise_resolve_function_call;
54648|     11|        rt->class_array[JS_CLASS_ASYNC_FUNCTION].call = js_async_function_call;
54649|     11|        rt->class_array[JS_CLASS_ASYNC_FUNCTION_RESOLVE].call = js_async_function_resolve_call;
54650|     11|        rt->class_array[JS_CLASS_ASYNC_FUNCTION_REJECT].call = js_async_function_resolve_call;
54651|     11|        rt->class_array[JS_CLASS_ASYNC_GENERATOR_FUNCTION].call = js_async_generator_function_call;
54652|     11|    }
54653|       |
54654|       |    /* Promise */
54655|     11|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_PROMISE, "Promise",
54656|     11|                                     js_promise_constructor, 1, JS_CFUNC_constructor, 0,
54657|     11|                                     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 }
  |  |  ------------------
  ------------------
54658|     11|                                     js_promise_funcs, countof(js_promise_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54659|     11|                                     js_promise_proto_funcs, countof(js_promise_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54660|     11|                                     0);
54661|     11|    if (JS_IsException(obj1))
  ------------------
  |  Branch (54661:9): [True: 0, False: 11]
  ------------------
54662|      0|        return -1;
54663|     11|    ctx->promise_ctor = obj1;
54664|       |    
54665|       |    /* AsyncFunction */
54666|     11|    ft.generic_magic = js_function_constructor;
54667|     11|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_ASYNC_FUNCTION, "AsyncFunction",
54668|     11|                                     ft.generic, 1, JS_CFUNC_constructor_or_func_magic, JS_FUNC_ASYNC,
54669|     11|                                     ctx->function_ctor,
54670|     11|                                     NULL, 0,
54671|     11|                                     js_async_function_proto_funcs, countof(js_async_function_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54672|     11|                                     JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39802|     11|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
                                                   JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39805|     11|#define JS_NEW_CTOR_READONLY    (1 << 3) /* read-only constructor field */
  ------------------
54673|     11|    if (JS_IsException(obj1))
  ------------------
  |  Branch (54673:9): [True: 0, False: 11]
  ------------------
54674|      0|        return -1;
54675|     11|    JS_FreeValue(ctx, obj1);
54676|       |    
54677|       |    /* AsyncIteratorPrototype */
54678|     11|    ctx->async_iterator_proto =
54679|     11|        JS_NewObjectProtoList(ctx,  ctx->class_proto[JS_CLASS_OBJECT],
54680|     11|                              js_async_iterator_proto_funcs,
54681|     11|                              countof(js_async_iterator_proto_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54682|     11|    if (JS_IsException(ctx->async_iterator_proto))
  ------------------
  |  Branch (54682:9): [True: 0, False: 11]
  ------------------
54683|      0|        return -1;
54684|       |
54685|       |    /* AsyncFromSyncIteratorPrototype */
54686|     11|    ctx->class_proto[JS_CLASS_ASYNC_FROM_SYNC_ITERATOR] =
54687|     11|        JS_NewObjectProtoList(ctx, ctx->async_iterator_proto,
54688|     11|                              js_async_from_sync_iterator_proto_funcs,
54689|     11|                              countof(js_async_from_sync_iterator_proto_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54690|     11|    if (JS_IsException(ctx->class_proto[JS_CLASS_ASYNC_FROM_SYNC_ITERATOR]))
  ------------------
  |  Branch (54690:9): [True: 0, False: 11]
  ------------------
54691|      0|        return -1;
54692|       |    
54693|       |    /* AsyncGeneratorPrototype */
54694|     11|    ctx->class_proto[JS_CLASS_ASYNC_GENERATOR] =
54695|     11|        JS_NewObjectProtoList(ctx, ctx->async_iterator_proto, 
54696|     11|                              js_async_generator_proto_funcs,
54697|     11|                              countof(js_async_generator_proto_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54698|     11|    if (JS_IsException(ctx->class_proto[JS_CLASS_ASYNC_GENERATOR]))
  ------------------
  |  Branch (54698:9): [True: 0, False: 11]
  ------------------
54699|      0|        return -1;
54700|       |
54701|       |    /* AsyncGeneratorFunction */
54702|     11|    ft.generic_magic = js_function_constructor;
54703|     11|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_ASYNC_GENERATOR_FUNCTION, "AsyncGeneratorFunction",
54704|     11|                                     ft.generic, 1, JS_CFUNC_constructor_or_func_magic, JS_FUNC_ASYNC_GENERATOR,
54705|     11|                                     ctx->function_ctor,
54706|     11|                                     NULL, 0,
54707|     11|                                     js_async_generator_function_proto_funcs, countof(js_async_generator_function_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54708|     11|                                     JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39802|     11|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
                                                   JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39805|     11|#define JS_NEW_CTOR_READONLY    (1 << 3) /* read-only constructor field */
  ------------------
54709|     11|    if (JS_IsException(obj1))
  ------------------
  |  Branch (54709:9): [True: 0, False: 11]
  ------------------
54710|      0|        return -1;
54711|     11|    JS_FreeValue(ctx, obj1);
54712|       |
54713|     11|    return JS_SetConstructor2(ctx, ctx->class_proto[JS_CLASS_ASYNC_GENERATOR_FUNCTION],
54714|     11|                              ctx->class_proto[JS_CLASS_ASYNC_GENERATOR],
54715|     11|                              JS_PROP_CONFIGURABLE, JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                            JS_PROP_CONFIGURABLE, JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
54716|     11|}
JS_AddIntrinsicDate:
56156|     11|{
56157|     11|    JSValue obj;
56158|       |
56159|       |    /* Date */
56160|     11|    obj = JS_NewCConstructor(ctx, JS_CLASS_DATE, "Date",
56161|     11|                                    js_date_constructor, 7, JS_CFUNC_constructor_or_func, 0,
56162|     11|                                    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 }
  |  |  ------------------
  ------------------
56163|     11|                                    js_date_funcs, countof(js_date_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56164|     11|                                    js_date_proto_funcs, countof(js_date_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56165|     11|                                    0);
56166|     11|    if (JS_IsException(obj))
  ------------------
  |  Branch (56166:9): [True: 0, False: 11]
  ------------------
56167|      0|        return -1;
56168|     11|    JS_FreeValue(ctx, obj);
56169|     11|    return 0;
56170|     11|}
JS_AddIntrinsicEval:
56175|     11|{
56176|     11|    ctx->eval_internal = __JS_EvalInternal;
56177|     11|    return 0;
56178|     11|}
JS_AddIntrinsicBaseObjects:
56512|     11|{
56513|     11|    JSValue obj1, obj2;
56514|     11|    JSCFunctionType ft;
56515|       |
56516|     11|    ctx->throw_type_error = JS_NewCFunction(ctx, js_throw_type_error, NULL, 0);
56517|     11|    if (JS_IsException(ctx->throw_type_error))
  ------------------
  |  Branch (56517:9): [True: 0, False: 11]
  ------------------
56518|      0|        return -1;
56519|       |    /* add caller and arguments properties to throw a TypeError */
56520|     11|    if (JS_DefineProperty(ctx, ctx->function_proto, JS_ATOM_caller, 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 }
  |  |  ------------------
  ------------------
  |  Branch (56520:9): [True: 0, False: 11]
  ------------------
56521|     11|                          ctx->throw_type_error, ctx->throw_type_error,
56522|     11|                          JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  314|     11|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                        JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  315|     11|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
56523|     11|                          JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  311|     11|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                                        JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56524|      0|        return -1;
56525|     11|    if (JS_DefineProperty(ctx, ctx->function_proto, JS_ATOM_arguments, 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 }
  |  |  ------------------
  ------------------
  |  Branch (56525:9): [True: 0, False: 11]
  ------------------
56526|     11|                          ctx->throw_type_error, ctx->throw_type_error,
56527|     11|                          JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  314|     11|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                        JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  315|     11|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
56528|     11|                          JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  311|     11|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                                        JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56529|      0|        return -1;
56530|     11|    JS_FreeValue(ctx, js_object_seal(ctx, JS_UNDEFINED, 1, (JSValueConst *)&ctx->throw_type_error, 1));
  ------------------
  |  |  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 }
  |  |  ------------------
  ------------------
56531|       |
56532|       |    /* Object */
56533|     11|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_OBJECT, "Object",
56534|     11|                              js_object_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56535|     11|                              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 }
  |  |  ------------------
  ------------------
56536|     11|                              js_object_funcs, countof(js_object_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56537|     11|                              js_object_proto_funcs, countof(js_object_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56538|     11|                              JS_NEW_CTOR_PROTO_EXIST);
  ------------------
  |  |39804|     11|#define JS_NEW_CTOR_PROTO_EXIST (1 << 2) /* the prototype is already defined */
  ------------------
56539|     11|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56539:9): [True: 0, False: 11]
  ------------------
56540|      0|        return -1;
56541|     11|    JS_FreeValue(ctx, obj1);
56542|       |    
56543|       |    /* Function */
56544|     11|    ft.generic_magic = js_function_constructor;
56545|     11|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_BYTECODE_FUNCTION, "Function",
56546|     11|                              ft.generic, 1, JS_CFUNC_constructor_or_func_magic, JS_FUNC_NORMAL,
56547|     11|                              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 }
  |  |  ------------------
  ------------------
56548|     11|                              NULL, 0,
56549|     11|                              js_function_proto_funcs, countof(js_function_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56550|     11|                              JS_NEW_CTOR_PROTO_EXIST);
  ------------------
  |  |39804|     11|#define JS_NEW_CTOR_PROTO_EXIST (1 << 2) /* the prototype is already defined */
  ------------------
56551|     11|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56551:9): [True: 0, False: 11]
  ------------------
56552|      0|        return -1;
56553|     11|    ctx->function_ctor = obj1;
56554|       |
56555|       |    /* Iterator */
56556|     11|    obj2 = JS_NewCConstructor(ctx, JS_CLASS_ITERATOR, "Iterator",
56557|     11|                                     js_iterator_constructor, 0, JS_CFUNC_constructor_or_func, 0,
56558|     11|                                     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 }
  |  |  ------------------
  ------------------
56559|     11|                                     js_iterator_funcs, countof(js_iterator_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56560|     11|                                     js_iterator_proto_funcs, countof(js_iterator_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56561|     11|                                     0);
56562|     11|    if (JS_IsException(obj2))
  ------------------
  |  Branch (56562:9): [True: 0, False: 11]
  ------------------
56563|      0|        return -1;
56564|       |    // quirk: Iterator.prototype.constructor is an accessor property
56565|       |    // TODO(bnoordhuis) mildly inefficient because JS_NewGlobalCConstructor
56566|       |    // first creates a .constructor value property that we then replace with
56567|       |    // an accessor
56568|     11|    obj1 = JS_NewCFunctionData(ctx, js_iterator_constructor_getset,
56569|     11|                               0, 0, 1, (JSValueConst *)&obj2);
56570|     11|    if (JS_IsException(obj1)) {
  ------------------
  |  Branch (56570:9): [True: 0, False: 11]
  ------------------
56571|      0|        JS_FreeValue(ctx, obj2);
56572|      0|        return -1;
56573|      0|    }
56574|     11|    if (JS_DefineProperty(ctx, ctx->class_proto[JS_CLASS_ITERATOR],
  ------------------
  |  Branch (56574:9): [True: 0, False: 11]
  ------------------
56575|     11|                          JS_ATOM_constructor, 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 }
  |  |  ------------------
  ------------------
56576|     11|                          obj1, obj1,
56577|     11|                          JS_PROP_HAS_GET | JS_PROP_HAS_SET | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  314|     11|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                        JS_PROP_HAS_GET | JS_PROP_HAS_SET | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  315|     11|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
                                        JS_PROP_HAS_GET | JS_PROP_HAS_SET | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56578|      0|        JS_FreeValue(ctx, obj2);
56579|      0|        JS_FreeValue(ctx, obj1);
56580|      0|        return -1;
56581|      0|    }
56582|     11|    JS_FreeValue(ctx, obj1);
56583|     11|    ctx->iterator_ctor = obj2;
56584|       |    
56585|     11|    ctx->class_proto[JS_CLASS_ITERATOR_CONCAT] =
56586|     11|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56587|     11|                              js_iterator_concat_proto_funcs,
56588|     11|                              countof(js_iterator_concat_proto_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56589|     11|    if (JS_IsException(ctx->class_proto[JS_CLASS_ITERATOR_CONCAT]))
  ------------------
  |  Branch (56589:9): [True: 0, False: 11]
  ------------------
56590|      0|        return -1;
56591|     11|    ctx->class_proto[JS_CLASS_ITERATOR_HELPER] =
56592|     11|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56593|     11|                              js_iterator_helper_proto_funcs,
56594|     11|                              countof(js_iterator_helper_proto_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56595|     11|    if (JS_IsException(ctx->class_proto[JS_CLASS_ITERATOR_HELPER]))
  ------------------
  |  Branch (56595:9): [True: 0, False: 11]
  ------------------
56596|      0|        return -1;
56597|       |                       
56598|     11|    ctx->class_proto[JS_CLASS_ITERATOR_WRAP] =
56599|     11|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56600|     11|                              js_iterator_wrap_proto_funcs,
56601|     11|                              countof(js_iterator_wrap_proto_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56602|     11|    if (JS_IsException(ctx->class_proto[JS_CLASS_ITERATOR_WRAP]))
  ------------------
  |  Branch (56602:9): [True: 0, False: 11]
  ------------------
56603|      0|        return -1;
56604|       |
56605|       |    /* needed to initialize arguments[Symbol.iterator] */
56606|     11|    ctx->array_proto_values =
56607|     11|        JS_GetProperty(ctx, ctx->class_proto[JS_CLASS_ARRAY], JS_ATOM_values);
56608|     11|    if (JS_IsException(ctx->array_proto_values))
  ------------------
  |  Branch (56608:9): [True: 0, False: 11]
  ------------------
56609|      0|        return -1;
56610|       |
56611|     11|    ctx->class_proto[JS_CLASS_ARRAY_ITERATOR] =
56612|     11|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56613|     11|                              js_array_iterator_proto_funcs,
56614|     11|                              countof(js_array_iterator_proto_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56615|     11|    if (JS_IsException(ctx->class_proto[JS_CLASS_ARRAY_ITERATOR]))
  ------------------
  |  Branch (56615:9): [True: 0, False: 11]
  ------------------
56616|      0|        return -1;
56617|       |
56618|       |    /* parseFloat and parseInteger must be defined before Number
56619|       |       because of the Number.parseFloat and Number.parseInteger
56620|       |       aliases */
56621|     11|    if (JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_global_funcs,
  ------------------
  |  Branch (56621:9): [True: 0, False: 11]
  ------------------
56622|     11|                                   countof(js_global_funcs)))
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56623|      0|        return -1;
56624|       |
56625|       |    /* Number */
56626|     11|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_NUMBER, "Number",
56627|     11|                                     js_number_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56628|     11|                                     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 }
  |  |  ------------------
  ------------------
56629|     11|                                     js_number_funcs, countof(js_number_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56630|     11|                                     js_number_proto_funcs, countof(js_number_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56631|     11|                                     JS_NEW_CTOR_PROTO_CLASS);
  ------------------
  |  |39803|     11|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
56632|     11|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56632:9): [True: 0, False: 11]
  ------------------
56633|      0|        return -1;
56634|     11|    JS_FreeValue(ctx, obj1);
56635|     11|    if (JS_SetObjectData(ctx, ctx->class_proto[JS_CLASS_NUMBER], JS_NewInt32(ctx, 0)))
  ------------------
  |  Branch (56635:9): [True: 0, False: 11]
  ------------------
56636|      0|        return -1;
56637|       |    
56638|       |    /* Boolean */
56639|     11|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_BOOLEAN, "Boolean",
56640|     11|                                     js_boolean_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56641|     11|                                     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 }
  |  |  ------------------
  ------------------
56642|     11|                                     NULL, 0,
56643|     11|                                     js_boolean_proto_funcs, countof(js_boolean_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56644|     11|                                     JS_NEW_CTOR_PROTO_CLASS);
  ------------------
  |  |39803|     11|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
56645|     11|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56645:9): [True: 0, False: 11]
  ------------------
56646|      0|        return -1;
56647|     11|    JS_FreeValue(ctx, obj1);
56648|     11|    if (JS_SetObjectData(ctx, ctx->class_proto[JS_CLASS_BOOLEAN], JS_NewBool(ctx, FALSE)))
  ------------------
  |  Branch (56648:9): [True: 0, False: 11]
  ------------------
56649|      0|        return -1;
56650|       |
56651|       |    /* String */
56652|     11|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_STRING, "String",
56653|     11|                                     js_string_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56654|     11|                                     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 }
  |  |  ------------------
  ------------------
56655|     11|                                     js_string_funcs, countof(js_string_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56656|     11|                                     js_string_proto_funcs, countof(js_string_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56657|     11|                                     JS_NEW_CTOR_PROTO_CLASS);
  ------------------
  |  |39803|     11|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
56658|     11|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56658:9): [True: 0, False: 11]
  ------------------
56659|      0|        return -1;
56660|     11|    JS_FreeValue(ctx, obj1);
56661|     11|    if (JS_SetObjectData(ctx, ctx->class_proto[JS_CLASS_STRING], JS_AtomToString(ctx, JS_ATOM_empty_string)))
  ------------------
  |  Branch (56661:9): [True: 0, False: 11]
  ------------------
56662|      0|        return -1;
56663|       |
56664|     11|    ctx->class_proto[JS_CLASS_STRING_ITERATOR] =
56665|     11|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56666|     11|                              js_string_iterator_proto_funcs,
56667|     11|                              countof(js_string_iterator_proto_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56668|     11|    if (JS_IsException(ctx->class_proto[JS_CLASS_STRING_ITERATOR]))
  ------------------
  |  Branch (56668:9): [True: 0, False: 11]
  ------------------
56669|      0|        return -1;
56670|       |
56671|       |    /* Math: create as autoinit object */
56672|     11|    js_random_init(ctx);
56673|     11|    if (JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_math_obj, countof(js_math_obj)))
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (56673:9): [True: 0, False: 11]
  ------------------
56674|      0|        return -1;
56675|       |
56676|       |    /* ES6 Reflect: create as autoinit object */
56677|     11|    if (JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_reflect_obj, countof(js_reflect_obj)))
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (56677:9): [True: 0, False: 11]
  ------------------
56678|      0|        return -1;
56679|       |
56680|       |    /* ES6 Symbol */
56681|     11|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_SYMBOL, "Symbol",
56682|     11|                                     js_symbol_constructor, 0, JS_CFUNC_constructor_or_func, 0,
56683|     11|                                     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 }
  |  |  ------------------
  ------------------
56684|     11|                                     js_symbol_funcs, countof(js_symbol_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56685|     11|                                     js_symbol_proto_funcs, countof(js_symbol_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56686|     11|                                     0);
56687|     11|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56687:9): [True: 0, False: 11]
  ------------------
56688|      0|        return -1;
56689|     11|    JS_FreeValue(ctx, obj1);
56690|       |    
56691|       |    /* ES6 Generator */
56692|     11|    ctx->class_proto[JS_CLASS_GENERATOR] =
56693|     11|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR],
56694|     11|                              js_generator_proto_funcs,
56695|     11|                              countof(js_generator_proto_funcs));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56696|     11|    if (JS_IsException(ctx->class_proto[JS_CLASS_GENERATOR]))
  ------------------
  |  Branch (56696:9): [True: 0, False: 11]
  ------------------
56697|      0|        return -1;
56698|       |
56699|     11|    ft.generic_magic = js_function_constructor;
56700|     11|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_GENERATOR_FUNCTION, "GeneratorFunction",
56701|     11|                                     ft.generic, 1, JS_CFUNC_constructor_or_func_magic, JS_FUNC_GENERATOR,
56702|     11|                                     ctx->function_ctor,
56703|     11|                                     NULL, 0,
56704|     11|                                     js_generator_function_proto_funcs,
56705|     11|                                     countof(js_generator_function_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56706|     11|                                     JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39802|     11|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
                                                   JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39805|     11|#define JS_NEW_CTOR_READONLY    (1 << 3) /* read-only constructor field */
  ------------------
56707|     11|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56707:9): [True: 0, False: 11]
  ------------------
56708|      0|        return -1;
56709|     11|    JS_FreeValue(ctx, obj1);
56710|     11|    if (JS_SetConstructor2(ctx, ctx->class_proto[JS_CLASS_GENERATOR_FUNCTION],
  ------------------
  |  Branch (56710:9): [True: 0, False: 11]
  ------------------
56711|     11|                           ctx->class_proto[JS_CLASS_GENERATOR],
56712|     11|                           JS_PROP_CONFIGURABLE, JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                         JS_PROP_CONFIGURABLE, JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56713|      0|        return -1;
56714|       |    
56715|       |    /* global properties */
56716|     11|    ctx->eval_obj = JS_GetProperty(ctx, ctx->global_obj, JS_ATOM_eval);
56717|     11|    if (JS_IsException(ctx->eval_obj))
  ------------------
  |  Branch (56717:9): [True: 0, False: 11]
  ------------------
56718|      0|        return -1;
56719|       |    
56720|     11|    if (JS_DefinePropertyValue(ctx, ctx->global_obj, JS_ATOM_globalThis,
  ------------------
  |  Branch (56720:9): [True: 0, False: 11]
  ------------------
56721|     11|                               JS_DupValue(ctx, ctx->global_obj),
56722|     11|                               JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE) < 0)
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                             JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE) < 0)
  ------------------
  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
56723|      0|        return -1;
56724|       |
56725|       |    /* BigInt */
56726|     11|    if (JS_AddIntrinsicBigInt(ctx))
  ------------------
  |  Branch (56726:9): [True: 0, False: 11]
  ------------------
56727|      0|        return -1;
56728|     11|    return 0;
56729|     11|}
JS_AddIntrinsicTypedArrays:
61032|     11|{
61033|     11|    JSValue typed_array_base_func, typed_array_base_proto, obj;
61034|     11|    int i, ret;
61035|       |
61036|     11|    obj = JS_NewCConstructor(ctx, JS_CLASS_ARRAY_BUFFER, "ArrayBuffer",
61037|     11|                                    js_array_buffer_constructor, 1, JS_CFUNC_constructor, 0,
61038|     11|                                    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 }
  |  |  ------------------
  ------------------
61039|     11|                                    js_array_buffer_funcs, countof(js_array_buffer_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61040|     11|                                    js_array_buffer_proto_funcs, countof(js_array_buffer_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61041|     11|                                    0);
61042|     11|    if (JS_IsException(obj))
  ------------------
  |  Branch (61042:9): [True: 0, False: 11]
  ------------------
61043|      0|        return -1;
61044|     11|    JS_FreeValue(ctx, obj);
61045|       |
61046|     11|    obj = JS_NewCConstructor(ctx, JS_CLASS_SHARED_ARRAY_BUFFER, "SharedArrayBuffer",
61047|     11|                                    js_shared_array_buffer_constructor, 1, JS_CFUNC_constructor, 0,
61048|     11|                                    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 }
  |  |  ------------------
  ------------------
61049|     11|                                    js_shared_array_buffer_funcs, countof(js_shared_array_buffer_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61050|     11|                                    js_shared_array_buffer_proto_funcs, countof(js_shared_array_buffer_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61051|     11|                                    0);
61052|     11|    if (JS_IsException(obj))
  ------------------
  |  Branch (61052:9): [True: 0, False: 11]
  ------------------
61053|      0|        return -1;
61054|     11|    JS_FreeValue(ctx, obj);
61055|       |
61056|       |
61057|     11|    typed_array_base_func =
61058|     11|        JS_NewCConstructor(ctx, -1, "TypedArray",
61059|     11|                                  js_typed_array_base_constructor, 0, JS_CFUNC_constructor_or_func, 0,
61060|     11|                                  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 }
  |  |  ------------------
  ------------------
61061|     11|                                  js_typed_array_base_funcs, countof(js_typed_array_base_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61062|     11|                                  js_typed_array_base_proto_funcs, countof(js_typed_array_base_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61063|     11|                                  JS_NEW_CTOR_NO_GLOBAL);
  ------------------
  |  |39802|     11|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
61064|     11|    if (JS_IsException(typed_array_base_func))
  ------------------
  |  Branch (61064:9): [True: 0, False: 11]
  ------------------
61065|      0|        return -1;
61066|       |
61067|       |    /* TypedArray.prototype.toString must be the same object as Array.prototype.toString */
61068|     11|    obj = JS_GetProperty(ctx, ctx->class_proto[JS_CLASS_ARRAY], JS_ATOM_toString);
61069|     11|    if (JS_IsException(obj))
  ------------------
  |  Branch (61069:9): [True: 0, False: 11]
  ------------------
61070|      0|        goto fail;
61071|       |    /* XXX: should use alias method in JSCFunctionListEntry */ //@@@
61072|     11|    typed_array_base_proto = JS_GetProperty(ctx, typed_array_base_func, JS_ATOM_prototype);
61073|     11|    if (JS_IsException(typed_array_base_proto))
  ------------------
  |  Branch (61073:9): [True: 0, False: 11]
  ------------------
61074|      0|        goto fail;
61075|     11|    ret = JS_DefinePropertyValue(ctx, typed_array_base_proto, JS_ATOM_toString, obj,
61076|     11|                                 JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                               JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
61077|     11|    JS_FreeValue(ctx, typed_array_base_proto);
61078|     11|    if (ret < 0)
  ------------------
  |  Branch (61078:9): [True: 0, False: 11]
  ------------------
61079|      0|        goto fail;
61080|       |    
61081|       |    /* Used to squelch a -Wcast-function-type warning. */
61082|     11|    JSCFunctionType ft = { .generic_magic = js_typed_array_constructor };
61083|    143|    for(i = JS_CLASS_UINT8C_ARRAY; i < JS_CLASS_UINT8C_ARRAY + JS_TYPED_ARRAY_COUNT; i++) {
  ------------------
  |  |  191|    143|#define JS_TYPED_ARRAY_COUNT  (JS_CLASS_FLOAT64_ARRAY - JS_CLASS_UINT8C_ARRAY + 1)
  ------------------
  |  Branch (61083:36): [True: 132, False: 11]
  ------------------
61084|    132|        char buf[ATOM_GET_STR_BUF_SIZE];
61085|    132|        const char *name;
61086|       |            
61087|    132|        name = JS_AtomGetStr(ctx, buf, sizeof(buf),
61088|    132|                             JS_ATOM_Uint8ClampedArray + i - JS_CLASS_UINT8C_ARRAY);
61089|    132|        if (i == JS_CLASS_UINT8_ARRAY) {
  ------------------
  |  Branch (61089:13): [True: 11, False: 121]
  ------------------
61090|     11|            obj = JS_NewCConstructor(ctx, i, name,
61091|     11|                                     ft.generic, 3, JS_CFUNC_constructor_magic, i,
61092|     11|                                     typed_array_base_func,
61093|     11|                                     js_uint8array_funcs, countof(js_uint8array_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61094|     11|                                     js_uint8array_proto_funcs, countof(js_uint8array_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61095|     11|                                     0);
61096|    121|        } else {
61097|    121|            const JSCFunctionListEntry *bpe = js_typed_array_funcs + typed_array_size_log2(i);
  ------------------
  |  |  193|    121|#define typed_array_size_log2(classid)  (typed_array_size_log2[(classid)- JS_CLASS_UINT8C_ARRAY])
  ------------------
61098|    121|            obj = JS_NewCConstructor(ctx, i, name,
61099|    121|                                     ft.generic, 3, JS_CFUNC_constructor_magic, i,
61100|    121|                                     typed_array_base_func,
61101|    121|                                     bpe, 1,
61102|    121|                                     bpe, 1,
61103|    121|                                     0);
61104|    121|        }
61105|    132|        if (JS_IsException(obj)) {
  ------------------
  |  Branch (61105:13): [True: 0, False: 132]
  ------------------
61106|      0|        fail:
61107|      0|            JS_FreeValue(ctx, typed_array_base_func);
61108|      0|            return -1;
61109|      0|        }
61110|    132|        JS_FreeValue(ctx, obj);
61111|    132|    }
61112|     11|    JS_FreeValue(ctx, typed_array_base_func);
61113|       |
61114|       |    /* DataView */
61115|     11|    obj = JS_NewCConstructor(ctx, JS_CLASS_DATAVIEW, "DataView",
61116|     11|                                    js_dataview_constructor, 1, JS_CFUNC_constructor, 0,
61117|     11|                                    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 }
  |  |  ------------------
  ------------------
61118|     11|                                    NULL, 0,
61119|     11|                                    js_dataview_proto_funcs, countof(js_dataview_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61120|     11|                                    0);
61121|     11|    if (JS_IsException(obj))
  ------------------
  |  Branch (61121:9): [True: 0, False: 11]
  ------------------
61122|      0|        return -1;
61123|     11|    JS_FreeValue(ctx, obj);
61124|       |
61125|       |    /* Atomics */
61126|     11|#ifdef CONFIG_ATOMICS
61127|     11|    if (JS_AddIntrinsicAtomics(ctx))
  ------------------
  |  Branch (61127:9): [True: 0, False: 11]
  ------------------
61128|      0|        return -1;
61129|     11|#endif
61130|     11|    return 0;
61131|     11|}
JS_AddIntrinsicWeakRef:
61387|     11|{
61388|     11|    JSRuntime *rt = ctx->rt;
61389|     11|    JSValue obj;
61390|       |    
61391|       |    /* WeakRef */
61392|     11|    if (!JS_IsRegisteredClass(rt, JS_CLASS_WEAK_REF)) {
  ------------------
  |  Branch (61392:9): [True: 11, False: 0]
  ------------------
61393|     11|        if (init_class_range(rt, js_weakref_class_def, JS_CLASS_WEAK_REF,
  ------------------
  |  Branch (61393:13): [True: 0, False: 11]
  ------------------
61394|     11|                             countof(js_weakref_class_def)))
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61395|      0|            return -1;
61396|     11|    }
61397|     11|    obj = JS_NewCConstructor(ctx, JS_CLASS_WEAK_REF, "WeakRef",
61398|     11|                             js_weakref_constructor, 1, JS_CFUNC_constructor_or_func, 0,
61399|     11|                             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 }
  |  |  ------------------
  ------------------
61400|     11|                             NULL, 0,
61401|     11|                             js_weakref_proto_funcs, countof(js_weakref_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61402|     11|                             0);
61403|     11|    if (JS_IsException(obj))
  ------------------
  |  Branch (61403:9): [True: 0, False: 11]
  ------------------
61404|      0|        return -1;
61405|     11|    JS_FreeValue(ctx, obj);
61406|       |
61407|       |    /* FinalizationRegistry */
61408|     11|    if (!JS_IsRegisteredClass(rt, JS_CLASS_FINALIZATION_REGISTRY)) {
  ------------------
  |  Branch (61408:9): [True: 11, False: 0]
  ------------------
61409|     11|        if (init_class_range(rt, js_finrec_class_def, JS_CLASS_FINALIZATION_REGISTRY,
  ------------------
  |  Branch (61409:13): [True: 0, False: 11]
  ------------------
61410|     11|                             countof(js_finrec_class_def)))
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61411|      0|            return -1;
61412|     11|    }
61413|       |
61414|     11|    obj = JS_NewCConstructor(ctx, JS_CLASS_FINALIZATION_REGISTRY, "FinalizationRegistry",
61415|     11|                             js_finrec_constructor, 1, JS_CFUNC_constructor_or_func, 0,
61416|     11|                             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 }
  |  |  ------------------
  ------------------
61417|     11|                             NULL, 0,
61418|     11|                             js_finrec_proto_funcs, countof(js_finrec_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61419|     11|                             0);
61420|     11|    if (JS_IsException(obj))
  ------------------
  |  Branch (61420:9): [True: 0, False: 11]
  ------------------
61421|      0|        return -1;
61422|     11|    JS_FreeValue(ctx, obj);
61423|     11|    return 0;
61424|     11|}
quickjs.c:__js_malloc:
 1550|  55.7k|{
 1551|  55.7k|    size_t total_size;
 1552|  55.7k|    if (unlikely(size == 0)) {
  ------------------
  |  |   33|  55.7k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 55.7k]
  |  |  ------------------
  ------------------
 1553|      0|        JSMallocBlockHeader *b = get_zero_size_block(s);
 1554|      0|        return b->user_data;
 1555|  55.7k|    } else {
 1556|  55.7k|        total_size = ((size + JS_MALLOC_ALIGN - 1) & ~(JS_MALLOC_ALIGN - 1)) +
  ------------------
  |  |  243|  55.7k|#define JS_MALLOC_ALIGN 8
  ------------------
                      total_size = ((size + JS_MALLOC_ALIGN - 1) & ~(JS_MALLOC_ALIGN - 1)) +
  ------------------
  |  |  243|  55.7k|#define JS_MALLOC_ALIGN 8
  ------------------
 1557|  55.7k|            sizeof(JSMallocBlockHeader);
 1558|  55.7k|        if (!JS_MALLOC_LARGE_BLOCKS_ONLY &&
  ------------------
  |  |  252|   111k|#define JS_MALLOC_LARGE_BLOCKS_ONLY 0
  ------------------
  |  Branch (1558:13): [True: 55.7k, Folded]
  ------------------
 1559|  55.7k|            total_size <= JS_MALLOC_MAX_SMALL_SIZE) {
  ------------------
  |  |  247|  55.7k|#define JS_MALLOC_MAX_SMALL_SIZE 512
  ------------------
  |  Branch (1559:13): [True: 55.4k, False: 322]
  ------------------
 1560|  55.4k|            int block_size_idx;
 1561|  55.4k|            unsigned int block_idx, block_size;
 1562|  55.4k|            JSMallocBlockHeader *b;
 1563|  55.4k|            JSMallocArena *ar;
 1564|  55.4k|            struct list_head *el, *head;
 1565|       |            
 1566|  55.4k|            block_size_idx = get_block_size_index(total_size);
 1567|  55.4k|            block_size = js_malloc_block_sizes[block_size_idx];
 1568|  55.4k|            head = &s->free_arena_list[block_size_idx];
 1569|  55.4k|            el = head->next;
 1570|  55.4k|            if (unlikely(el == head)) {
  ------------------
  |  |   33|  55.4k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 935, False: 54.5k]
  |  |  ------------------
  ------------------
 1571|    935|                ar = js_malloc_new_arena(s, block_size_idx);
 1572|    935|                if (!ar)
  ------------------
  |  Branch (1572:21): [True: 0, False: 935]
  ------------------
 1573|      0|                    return NULL;
 1574|  54.5k|            } else {
 1575|  54.5k|                ar = list_entry(el, JSMallocArena, free_link);
  ------------------
  |  |   39|  54.5k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  54.5k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 1576|  54.5k|            }
 1577|  55.4k|            block_idx = ar->first_free_block;
 1578|  55.4k|            b = get_arena_block(ar, ar->first_free_block, block_size);
 1579|  55.4k|            ar->first_free_block = b->u.free_next;
 1580|  55.4k|            b->u.block_idx = block_idx;
 1581|  55.4k|            ar->n_used_blocks++;
 1582|  55.4k|            if (unlikely(ar->n_used_blocks == ar->n_blocks)) {
  ------------------
  |  |   33|  55.4k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 535, False: 54.9k]
  |  |  ------------------
  ------------------
 1583|    535|                list_del(&ar->free_link);
 1584|    535|            }
 1585|       |#ifdef JS_MALLOC_USE_ITER
 1586|       |            ar->bitmap[block_idx / 32] |= 1 << (block_idx % 32);
 1587|       |#endif
 1588|  55.4k|            return b->user_data;
 1589|  55.4k|        } else {
 1590|    322|            return js_malloc_large(s, size);
 1591|    322|        }
 1592|  55.7k|    }
 1593|  55.7k|}
quickjs.c:get_zero_size_block:
 1469|  1.01k|{
 1470|  1.01k|    return (JSMallocBlockHeader *)s->zero_size_block;
 1471|  1.01k|}
quickjs.c:get_block_size_index:
 1454|  55.4k|{
 1455|  55.4k|    if (size <= 16) {
  ------------------
  |  Branch (1455:9): [True: 214, False: 55.2k]
  ------------------
 1456|    214|        return 0;
 1457|  55.2k|    } else if (size <= 128) {
  ------------------
  |  Branch (1457:16): [True: 52.9k, False: 2.32k]
  ------------------
 1458|  52.9k|        return (size + 7) / 8 - 2;
 1459|  52.9k|    } else if (size <= 256) {
  ------------------
  |  Branch (1459:16): [True: 1.77k, False: 554]
  ------------------
 1460|  1.77k|        return (size + 15) / 16 + 6;
 1461|  1.77k|    } else if (size <= 512) {
  ------------------
  |  Branch (1461:16): [True: 554, False: 0]
  ------------------
 1462|    554|        return (size + 31) / 32 + 14;
 1463|    554|    } else {
 1464|      0|        return JS_MALLOC_BLOCK_SIZE_COUNT;
  ------------------
  |  |  245|      0|#define JS_MALLOC_BLOCK_SIZE_COUNT 31
  ------------------
 1465|      0|    }
 1466|  55.4k|}
quickjs.c:js_malloc_new_arena:
 1498|    935|{
 1499|    935|    JSMallocBlockHeader *b;
 1500|    935|    JSMallocArena *ar;
 1501|    935|    int n_blocks, block_size, i;
 1502|       |
 1503|    935|    block_size = js_malloc_block_sizes[block_size_idx];
 1504|    935|    n_blocks = (JS_MALLOC_ARENA_SIZE - sizeof(JSMallocArena)) / block_size;
  ------------------
  |  |  244|    935|#define JS_MALLOC_ARENA_SIZE 4096
  ------------------
 1505|    935|    ar = s->mf.js_malloc(&s->malloc_state, sizeof(JSMallocArena) + n_blocks * block_size);
 1506|    935|    if (!ar)
  ------------------
  |  Branch (1506:9): [True: 0, False: 935]
  ------------------
 1507|      0|        return NULL;
 1508|       |
 1509|    935|    ar->block_size_idx = block_size_idx;
 1510|    935|    ar->n_blocks = n_blocks;
 1511|    935|    ar->n_used_blocks = 0;
 1512|    935|    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|  90.9k|    for(i = 0; i < n_blocks - 1; i++) {
  ------------------
  |  Branch (1520:16): [True: 90.0k, False: 935]
  ------------------
 1521|  90.0k|        b = get_arena_block(ar, i, block_size);
 1522|  90.0k|        b->u.free_next = i + 1;
 1523|  90.0k|        b->block_size_idx = block_size_idx;
 1524|  90.0k|    }
 1525|    935|    b = get_arena_block(ar, n_blocks - 1, block_size);
 1526|    935|    b->u.free_next = FREE_NIL;
  ------------------
  |  |  259|    935|#define FREE_NIL 0xffff
  ------------------
 1527|    935|    b->block_size_idx = block_size_idx;
 1528|       |    
 1529|       |    /* add to the head */
 1530|    935|    list_add(&ar->link, &s->arena_list[block_size_idx]);
 1531|    935|    list_add(&ar->free_link, &s->free_arena_list[block_size_idx]);
 1532|    935|    return ar;
 1533|    935|}
quickjs.c:get_arena_block:
 1488|   146k|{
 1489|   146k|    return ar->blocks + idx * block_size;
 1490|   146k|}
quickjs.c:js_malloc_large:
 1536|    322|{
 1537|    322|    JSMallocLargeBlockHeader *b;
 1538|    322|    b = s->mf.js_malloc(&s->malloc_state, sizeof(JSMallocLargeBlockHeader) + size);
 1539|    322|    if (!b)
  ------------------
  |  Branch (1539:9): [True: 0, False: 322]
  ------------------
 1540|      0|        return NULL;
 1541|    322|    b->header.u.block_idx = FREE_NIL;
  ------------------
  |  |  259|    322|#define FREE_NIL 0xffff
  ------------------
 1542|    322|    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|    322|    return b->header.user_data;
 1547|    322|}
quickjs.c:__js_free:
 1596|  56.0k|{
 1597|  56.0k|    JSMallocBlockHeader *b;
 1598|       |
 1599|  56.0k|    if (!ptr)
  ------------------
  |  Branch (1599:9): [True: 295, False: 55.7k]
  ------------------
 1600|    295|        return;
 1601|  55.7k|    b = container_of(ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|  55.7k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1602|  55.7k|    if (unlikely(b->u.block_idx == FREE_NIL)) {
  ------------------
  |  |   33|  55.7k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 322, False: 55.4k]
  |  |  ------------------
  ------------------
 1603|       |        /* large or zero size block */
 1604|    322|        if (b == get_zero_size_block(s)) {
  ------------------
  |  Branch (1604:13): [True: 0, False: 322]
  ------------------
 1605|       |            /* nothing to do */
 1606|    322|        } else {
 1607|    322|            JSMallocLargeBlockHeader *lb = container_of(ptr, JSMallocLargeBlockHeader, header.user_data);
  ------------------
  |  |   51|    322|#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|    322|            s->mf.js_free(&s->malloc_state, lb);
 1612|    322|        }
 1613|  55.4k|    } else {
 1614|  55.4k|        unsigned int block_idx = b->u.block_idx;
 1615|  55.4k|        unsigned int block_size_idx = b->block_size_idx;
 1616|  55.4k|        unsigned int block_size = js_malloc_block_sizes[block_size_idx];
 1617|  55.4k|        JSMallocArena *ar = (JSMallocArena *)((uint8_t *)b - block_size * block_idx - sizeof(JSMallocArena));
 1618|  55.4k|        b->u.free_next = ar->first_free_block;
 1619|  55.4k|        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|  55.4k|        if (unlikely(ar->n_used_blocks == ar->n_blocks)) {
  ------------------
  |  |   33|  55.4k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 535, False: 54.9k]
  |  |  ------------------
  ------------------
 1625|    535|            list_add(&ar->free_link, &s->free_arena_list[block_size_idx]);
 1626|    535|        }
 1627|  55.4k|        ar->n_used_blocks--;
 1628|  55.4k|        if (unlikely(ar->n_used_blocks == 0)) {
  ------------------
  |  |   33|  55.4k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 935, False: 54.5k]
  |  |  ------------------
  ------------------
 1629|    935|            list_del(&ar->link);
 1630|    935|            list_del(&ar->free_link);
 1631|    935|            s->mf.js_free(&s->malloc_state, ar);
 1632|    935|        }
 1633|  55.4k|    }
 1634|  55.7k|}
quickjs.c:__js_realloc:
 1637|  2.31k|{
 1638|  2.31k|    JSMallocBlockHeader *b;
 1639|  2.31k|    if (ptr == NULL) {
  ------------------
  |  Branch (1639:9): [True: 303, False: 2.01k]
  ------------------
 1640|    303|        return __js_malloc(s, size);
 1641|  2.01k|    } else if (size == 0) {
  ------------------
  |  Branch (1641:16): [True: 68, False: 1.94k]
  ------------------
 1642|     68|        __js_free(s, ptr);
 1643|     68|        return NULL;
 1644|     68|    }
 1645|  1.94k|    b = container_of(ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|  1.94k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1646|  1.94k|    if (b->u.block_idx == FREE_NIL) {
  ------------------
  |  |  259|  1.94k|#define FREE_NIL 0xffff
  ------------------
  |  Branch (1646:9): [True: 374, False: 1.57k]
  ------------------
 1647|    374|        if (b == get_zero_size_block(s)) {
  ------------------
  |  Branch (1647:13): [True: 0, False: 374]
  ------------------
 1648|      0|            return __js_malloc(s, size);
 1649|    374|        } else {
 1650|    374|            JSMallocLargeBlockHeader *lb, *new_lb;
 1651|    374|            lb = container_of(ptr, JSMallocLargeBlockHeader, header.user_data);
  ------------------
  |  |   51|    374|#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|    374|            new_lb = s->mf.js_realloc(&s->malloc_state, lb, sizeof(JSMallocLargeBlockHeader) + size);
 1656|    374|            if (!new_lb) {
  ------------------
  |  Branch (1656:17): [True: 0, False: 374]
  ------------------
 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|    374|            new_lb->header.u.block_idx = FREE_NIL;
  ------------------
  |  |  259|    374|#define FREE_NIL 0xffff
  ------------------
 1664|    374|            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|    374|            return new_lb->header.user_data;
 1669|    374|        }
 1670|  1.57k|    } else {
 1671|  1.57k|        unsigned int block_size_idx = b->block_size_idx;
 1672|  1.57k|        size_t block_size = js_malloc_block_sizes[block_size_idx];
 1673|  1.57k|        size_t total_size, old_size;
 1674|  1.57k|        void *new_ptr;
 1675|  1.57k|        JSMallocBlockHeader *new_b;
 1676|       |
 1677|  1.57k|        total_size = ((size + JS_MALLOC_ALIGN - 1) & ~(JS_MALLOC_ALIGN - 1)) +
  ------------------
  |  |  243|  1.57k|#define JS_MALLOC_ALIGN 8
  ------------------
                      total_size = ((size + JS_MALLOC_ALIGN - 1) & ~(JS_MALLOC_ALIGN - 1)) +
  ------------------
  |  |  243|  1.57k|#define JS_MALLOC_ALIGN 8
  ------------------
 1678|  1.57k|            sizeof(JSMallocBlockHeader);
 1679|  1.57k|        if (total_size <= block_size)
  ------------------
  |  Branch (1679:13): [True: 414, False: 1.15k]
  ------------------
 1680|    414|            return ptr;
 1681|  1.15k|        new_ptr = __js_malloc(s, size);
 1682|  1.15k|        if (!new_ptr)
  ------------------
  |  Branch (1682:13): [True: 0, False: 1.15k]
  ------------------
 1683|      0|            return NULL;
 1684|  1.15k|        new_b = container_of(new_ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|  1.15k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1685|       |        /* copy the GC data */
 1686|  1.15k|        new_b->gc_obj_type = b->gc_obj_type;
 1687|  1.15k|        new_b->mark = b->mark;
 1688|  1.15k|        new_b->ref_count = b->ref_count;
 1689|       |        /* copy the data */
 1690|  1.15k|        old_size = block_size - sizeof(JSMallocBlockHeader);
 1691|  1.15k|        if (size > old_size)
  ------------------
  |  Branch (1691:13): [True: 1.15k, False: 0]
  ------------------
 1692|  1.15k|            size = old_size;
 1693|  1.15k|        memcpy(new_ptr, ptr, size);
 1694|  1.15k|        __js_free(s, ptr);
 1695|  1.15k|        return new_ptr;
 1696|  1.15k|    }
 1697|  1.94k|}
quickjs.c:__js_malloc_usable_size:
 1700|    936|{
 1701|    936|    JSMallocBlockHeader *b;
 1702|    936|    if (!ptr)
  ------------------
  |  Branch (1702:9): [True: 0, False: 936]
  ------------------
 1703|      0|        return 0;
 1704|    936|    b = container_of(ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|    936|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1705|    936|    if (b->u.block_idx == FREE_NIL) {
  ------------------
  |  |  259|    936|#define FREE_NIL 0xffff
  ------------------
  |  Branch (1705:9): [True: 303, False: 633]
  ------------------
 1706|    303|        if (b == get_zero_size_block(s)) {
  ------------------
  |  Branch (1706:13): [True: 0, False: 303]
  ------------------
 1707|      0|            return 0;
 1708|    303|        } else {
 1709|    303|            JSMallocLargeBlockHeader *lb;
 1710|    303|            size_t size;
 1711|    303|            lb = container_of(ptr, JSMallocLargeBlockHeader, header.user_data);
  ------------------
  |  |   51|    303|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1712|    303|            if (s->mf.js_malloc_usable_size) {
  ------------------
  |  Branch (1712:17): [True: 303, False: 0]
  ------------------
 1713|    303|                size = s->mf.js_malloc_usable_size(lb);
 1714|    303|                if (size != 0)
  ------------------
  |  Branch (1714:21): [True: 303, False: 0]
  ------------------
 1715|    303|                    size -= sizeof(JSMallocLargeBlockHeader);
 1716|    303|                return size;
 1717|    303|            } else {
 1718|      0|                return 0;
 1719|      0|            }
 1720|    303|        }
 1721|    633|    } else {
 1722|    633|        size_t block_size = js_malloc_block_sizes[b->block_size_idx];
 1723|    633|        return block_size - sizeof(*b);
 1724|    633|    }
 1725|    936|}
quickjs.c:js_malloc_init:
 1474|     11|{
 1475|     11|    int i;
 1476|     11|    memset(s, 0, sizeof(*s));
 1477|     11|    get_zero_size_block(s)->u.block_idx = FREE_NIL;
  ------------------
  |  |  259|     11|#define FREE_NIL 0xffff
  ------------------
 1478|    352|    for(i = 0; i < JS_MALLOC_BLOCK_SIZE_COUNT; i++) {
  ------------------
  |  |  245|    352|#define JS_MALLOC_BLOCK_SIZE_COUNT 31
  ------------------
  |  Branch (1478:16): [True: 341, False: 11]
  ------------------
 1479|    341|        init_list_head(&s->arena_list[i]);
 1480|    341|        init_list_head(&s->free_arena_list[i]);
 1481|    341|    }
 1482|       |#ifdef JS_MALLOC_USE_ITER
 1483|       |    init_list_head(&s->large_block_list);
 1484|       |#endif
 1485|     11|}
quickjs.c:init_class_range:
 2026|     55|{
 2027|     55|    JSClassDef cm_s, *cm = &cm_s;
 2028|     55|    int i, class_id;
 2029|       |
 2030|    737|    for(i = 0; i < count; i++) {
  ------------------
  |  Branch (2030:16): [True: 682, False: 55]
  ------------------
 2031|    682|        class_id = i + start;
 2032|    682|        memset(cm, 0, sizeof(*cm));
 2033|    682|        cm->finalizer = tab[i].finalizer;
 2034|    682|        cm->gc_mark = tab[i].gc_mark;
 2035|    682|        if (JS_NewClass1(rt, class_id, cm, tab[i].class_name) < 0)
  ------------------
  |  Branch (2035:13): [True: 0, False: 682]
  ------------------
 2036|      0|            return -1;
 2037|    682|    }
 2038|     55|    return 0;
 2039|     55|}
quickjs.c:js_array_finalizer:
 6187|     31|{
 6188|     31|    JSObject *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)
  |  |  ------------------
  ------------------
 6189|     31|    int i;
 6190|       |
 6191|   171k|    for(i = 0; i < p->u.array.count; i++) {
  ------------------
  |  Branch (6191:16): [True: 171k, False: 31]
  ------------------
 6192|   171k|        JS_FreeValueRT(rt, p->u.array.u.values[i]);
 6193|   171k|    }
 6194|     31|    js_free_rt(rt, p->u.array.u.values);
 6195|     31|}
quickjs.c:js_array_mark:
 6199|     78|{
 6200|     78|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|     78|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     78|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6201|     78|    int i;
 6202|       |
 6203|   343k|    for(i = 0; i < p->u.array.count; i++) {
  ------------------
  |  Branch (6203:16): [True: 343k, False: 78]
  ------------------
 6204|   343k|        JS_MarkValue(rt, p->u.array.u.values[i], mark_func);
 6205|   343k|    }
 6206|     78|}
quickjs.c:js_object_data_finalizer:
 6209|     34|{
 6210|     34|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
 6211|     34|    JS_FreeValueRT(rt, p->u.object_data);
 6212|     34|    p->u.object_data = 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 }
  |  |  ------------------
  ------------------
 6213|     34|}
quickjs.c:js_object_data_mark:
 6217|    102|{
 6218|    102|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|    102|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    102|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6219|    102|    JS_MarkValue(rt, p->u.object_data, mark_func);
 6220|    102|}
quickjs.c:js_c_function_finalizer:
 6223|  1.78k|{
 6224|  1.78k|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|  1.78k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.78k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6225|       |
 6226|  1.78k|    if (p->u.cfunc.realm)
  ------------------
  |  Branch (6226:9): [True: 1.78k, False: 0]
  ------------------
 6227|  1.78k|        JS_FreeContext(p->u.cfunc.realm);
 6228|  1.78k|}
quickjs.c:js_c_function_mark:
 6232|  5.52k|{
 6233|  5.52k|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|  5.52k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  5.52k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6234|       |
 6235|  5.52k|    if (p->u.cfunc.realm)
  ------------------
  |  Branch (6235:9): [True: 5.52k, False: 0]
  ------------------
 6236|  5.52k|        mark_func(rt, &p->u.cfunc.realm->header);
 6237|  5.52k|}
quickjs.c:js_bytecode_function_finalizer:
 6240|     20|{
 6241|     20|    JSObject *p1, *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|     20|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     20|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6242|     20|    JSFunctionBytecode *b;
 6243|     20|    JSVarRef **var_refs;
 6244|     20|    int i;
 6245|       |
 6246|     20|    p1 = p->u.func.home_object;
 6247|     20|    if (p1) {
  ------------------
  |  Branch (6247:9): [True: 0, False: 20]
  ------------------
 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|     20|    b = p->u.func.function_bytecode;
 6251|     20|    if (b) {
  ------------------
  |  Branch (6251:9): [True: 20, False: 0]
  ------------------
 6252|     20|        var_refs = p->u.func.var_refs;
 6253|     20|        if (var_refs) {
  ------------------
  |  Branch (6253:13): [True: 19, False: 1]
  ------------------
 6254|     69|            for(i = 0; i < b->closure_var_count; i++)
  ------------------
  |  Branch (6254:24): [True: 50, False: 19]
  ------------------
 6255|     50|                free_var_ref(rt, var_refs[i]);
 6256|     19|            js_free_rt(rt, var_refs);
 6257|     19|        }
 6258|     20|        JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_FUNCTION_BYTECODE, b));
  ------------------
  |  |  248|     20|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6259|     20|    }
 6260|     20|}
quickjs.c:js_bytecode_function_mark:
 6264|     38|{
 6265|     38|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  229|     38|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     38|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6266|     38|    JSVarRef **var_refs = p->u.func.var_refs;
 6267|     38|    JSFunctionBytecode *b = p->u.func.function_bytecode;
 6268|     38|    int i;
 6269|       |
 6270|     38|    if (p->u.func.home_object) {
  ------------------
  |  Branch (6270:9): [True: 0, False: 38]
  ------------------
 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|     38|    if (b) {
  ------------------
  |  Branch (6274:9): [True: 38, False: 0]
  ------------------
 6275|     38|        if (var_refs) {
  ------------------
  |  Branch (6275:13): [True: 38, False: 0]
  ------------------
 6276|    148|            for(i = 0; i < b->closure_var_count; i++) {
  ------------------
  |  Branch (6276:24): [True: 110, False: 38]
  ------------------
 6277|    110|                JSVarRef *var_ref = var_refs[i];
 6278|    110|                if (var_ref) {
  ------------------
  |  Branch (6278:21): [True: 110, False: 0]
  ------------------
 6279|    110|                    mark_func(rt, &var_ref->header);
 6280|    110|                }
 6281|    110|            }
 6282|     38|        }
 6283|       |        /* must mark the function bytecode because template objects may be
 6284|       |           part of a cycle */
 6285|     38|        JS_MarkValue(rt, JS_MKPTR(JS_TAG_FUNCTION_BYTECODE, b), mark_func);
  ------------------
  |  |  248|     38|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6286|     38|    }
 6287|     38|}
quickjs.c:js_c_function_data_finalizer:
 6000|     33|{
 6001|     33|    JSCFunctionDataRecord *s = JS_GetOpaque(val, JS_CLASS_C_FUNCTION_DATA);
 6002|     33|    int i;
 6003|       |
 6004|     33|    if (s) {
  ------------------
  |  Branch (6004:9): [True: 33, False: 0]
  ------------------
 6005|     88|        for(i = 0; i < s->data_len; i++) {
  ------------------
  |  Branch (6005:20): [True: 55, False: 33]
  ------------------
 6006|     55|            JS_FreeValueRT(rt, s->data[i]);
 6007|     55|        }
 6008|     33|        js_free_rt(rt, s);
 6009|     33|    }
 6010|     33|}
quickjs.c:js_c_function_data_mark:
 6014|     34|{
 6015|     34|    JSCFunctionDataRecord *s = JS_GetOpaque(val, JS_CLASS_C_FUNCTION_DATA);
 6016|     34|    int i;
 6017|       |
 6018|     34|    if (s) {
  ------------------
  |  Branch (6018:9): [True: 34, False: 0]
  ------------------
 6019|     68|        for(i = 0; i < s->data_len; i++) {
  ------------------
  |  Branch (6019:20): [True: 34, False: 34]
  ------------------
 6020|     34|            JS_MarkValue(rt, s->data[i], mark_func);
 6021|     34|        }
 6022|     34|    }
 6023|     34|}
quickjs.c:js_for_in_iterator_finalizer:
 6317|      1|{
 6318|      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)
  |  |  ------------------
  ------------------
 6319|      1|    JSForInIterator *it = p->u.for_in_iterator;
 6320|      1|    int i;
 6321|       |
 6322|      1|    JS_FreeValueRT(rt, it->obj);
 6323|      1|    if (!it->is_array) {
  ------------------
  |  Branch (6323:9): [True: 1, False: 0]
  ------------------
 6324|      1|        for(i = 0; i < it->atom_count; i++) {
  ------------------
  |  Branch (6324:20): [True: 0, False: 1]
  ------------------
 6325|      0|            JS_FreeAtomRT(rt, it->tab_atom[i].atom);
 6326|      0|        }
 6327|      1|        js_free_rt(rt, it->tab_atom);
 6328|      1|    }
 6329|      1|    js_free_rt(rt, it);
 6330|      1|}
quickjs.c:async_func_free:
21008|     11|{
21009|     11|    if (--js_rc(s)->ref_count == 0) {
  ------------------
  |  Branch (21009:9): [True: 11, False: 0]
  ------------------
21010|     11|        if (rt->gc_phase != JS_GC_PHASE_REMOVE_CYCLES) {
  ------------------
  |  Branch (21010:13): [True: 11, False: 0]
  ------------------
21011|     11|            list_del(&s->header.link);
21012|     11|            list_add(&s->header.link, &rt->gc_zero_ref_count_list);
21013|     11|            if (rt->gc_phase == JS_GC_PHASE_NONE) {
  ------------------
  |  Branch (21013:17): [True: 11, False: 0]
  ------------------
21014|     11|                free_zero_refcount(rt);
21015|     11|            }
21016|     11|        }
21017|     11|    }
21018|     11|}
quickjs.c:js_global_object_finalizer:
17057|     11|{
17058|     11|    JSObject *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)
  |  |  ------------------
  ------------------
17059|     11|    JS_FreeValueRT(rt, p->u.global_object.uninitialized_vars);
17060|     11|}
quickjs.c:js_global_object_mark:
17064|     34|{
17065|     34|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
17066|     34|    JS_MarkValue(rt, p->u.global_object.uninitialized_vars, mark_func);
17067|     34|}
quickjs.c:js_def_malloc:
 2154|  1.26k|{
 2155|  1.26k|    void *ptr;
 2156|       |
 2157|       |    /* Do not allocate zero bytes: behavior is platform dependent */
 2158|  1.26k|    assert(size != 0);
  ------------------
  |  Branch (2158:5): [True: 0, False: 1.26k]
  |  Branch (2158:5): [True: 1.26k, False: 0]
  ------------------
 2159|       |
 2160|  1.26k|    if (unlikely(s->malloc_size + size > s->malloc_limit))
  ------------------
  |  |   33|  1.26k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.26k]
  |  |  ------------------
  ------------------
 2161|      0|        return NULL;
 2162|       |
 2163|  1.26k|    ptr = malloc(size);
 2164|  1.26k|    if (!ptr)
  ------------------
  |  Branch (2164:9): [True: 0, False: 1.26k]
  ------------------
 2165|      0|        return NULL;
 2166|       |
 2167|  1.26k|    s->malloc_count++;
 2168|  1.26k|    s->malloc_size += js_def_malloc_usable_size(ptr) + MALLOC_OVERHEAD;
  ------------------
  |  |   61|  1.26k|#define MALLOC_OVERHEAD  8
  ------------------
 2169|  1.26k|    return ptr;
 2170|  1.26k|}
quickjs.c:js_def_free:
 2173|  1.26k|{
 2174|  1.26k|    if (!ptr)
  ------------------
  |  Branch (2174:9): [True: 0, False: 1.26k]
  ------------------
 2175|      0|        return;
 2176|       |
 2177|  1.26k|    s->malloc_count--;
 2178|  1.26k|    s->malloc_size -= js_def_malloc_usable_size(ptr) + MALLOC_OVERHEAD;
  ------------------
  |  |   61|  1.26k|#define MALLOC_OVERHEAD  8
  ------------------
 2179|  1.26k|    free(ptr);
 2180|  1.26k|}
quickjs.c:js_def_realloc:
 2183|    374|{
 2184|    374|    size_t old_size;
 2185|       |
 2186|    374|    if (!ptr) {
  ------------------
  |  Branch (2186:9): [True: 0, False: 374]
  ------------------
 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|    374|    old_size = js_def_malloc_usable_size(ptr);
 2192|    374|    if (size == 0) {
  ------------------
  |  Branch (2192:9): [True: 0, False: 374]
  ------------------
 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|    374|    if (s->malloc_size + size - old_size > s->malloc_limit)
  ------------------
  |  Branch (2198:9): [True: 0, False: 374]
  ------------------
 2199|      0|        return NULL;
 2200|       |
 2201|    374|    ptr = realloc(ptr, size);
 2202|    374|    if (!ptr)
  ------------------
  |  Branch (2202:9): [True: 0, False: 374]
  ------------------
 2203|      0|        return NULL;
 2204|       |
 2205|    374|    s->malloc_size += js_def_malloc_usable_size(ptr) - old_size;
 2206|    374|    return ptr;
 2207|    374|}
quickjs.c:js_def_malloc_usable_size:
 2138|  3.58k|{
 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|  3.58k|}
quickjs.c:js_rc:
 1493|   328k|{
 1494|       |    return container_of(ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|   328k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1495|   328k|}
quickjs.c:atom_is_free:
 2345|  8.09k|{
 2346|  8.09k|    return (uintptr_t)p & 1;
 2347|  8.09k|}
quickjs.c:set_value:
 2665|  1.16k|{
 2666|  1.16k|    JSValue old_val;
 2667|  1.16k|    old_val = *pval;
 2668|  1.16k|    *pval = new_val;
 2669|  1.16k|    JS_FreeValue(ctx, old_val);
 2670|  1.16k|}
quickjs.c:js_free_modules:
 2693|     11|{
 2694|     11|    struct list_head *el, *el1;
 2695|     11|    list_for_each_safe(el, el1, &ctx->loaded_modules) {
  ------------------
  |  |   89|     11|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 11]
  |  |  ------------------
  |  |   90|     11|        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|     11|}
quickjs.c:update_stack_limit:
 2842|     22|{
 2843|     22|    if (rt->stack_size == 0) {
  ------------------
  |  Branch (2843:9): [True: 0, False: 22]
  ------------------
 2844|      0|        rt->stack_limit = 0; /* no limit */
 2845|     22|    } else {
 2846|     22|        rt->stack_limit = rt->stack_top - rt->stack_size;
 2847|     22|    }
 2848|     22|}
quickjs.c:js_get_stack_pointer:
 2055|    906|{
 2056|    906|    return (uintptr_t)__builtin_frame_address(0);
 2057|    906|}
quickjs.c:JS_InitAtoms:
 3079|     11|{
 3080|     11|    int i, len, atom_type;
 3081|     11|    const char *p;
 3082|       |
 3083|     11|    rt->atom_hash_size = 0;
 3084|     11|    rt->atom_hash = NULL;
 3085|     11|    rt->atom_count = 0;
 3086|     11|    rt->atom_size = 0;
 3087|     11|    rt->atom_free_index = 0;
 3088|     11|    if (JS_ResizeAtomHash(rt, 512))     /* there are at least 504 predefined atoms */
  ------------------
  |  Branch (3088:9): [True: 0, False: 11]
  ------------------
 3089|      0|        return -1;
 3090|       |
 3091|     11|    p = js_atom_init;
 3092|  2.67k|    for(i = 1; i < JS_ATOM_END; i++) {
  ------------------
  |  Branch (3092:16): [True: 2.66k, False: 11]
  ------------------
 3093|  2.66k|        if (i == JS_ATOM_Private_brand)
  ------------------
  |  Branch (3093:13): [True: 11, False: 2.65k]
  ------------------
 3094|     11|            atom_type = JS_ATOM_TYPE_PRIVATE;
 3095|  2.65k|        else if (i >= JS_ATOM_Symbol_toPrimitive)
  ------------------
  |  Branch (3095:18): [True: 143, False: 2.50k]
  ------------------
 3096|    143|            atom_type = JS_ATOM_TYPE_SYMBOL;
 3097|  2.50k|        else
 3098|  2.50k|            atom_type = JS_ATOM_TYPE_STRING;
 3099|  2.66k|        len = strlen(p);
 3100|  2.66k|        if (__JS_NewAtomInit(rt, p, len, atom_type) == JS_ATOM_NULL)
  ------------------
  |  |  451|  2.66k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (3100:13): [True: 0, False: 2.66k]
  ------------------
 3101|      0|            return -1;
 3102|  2.66k|        p = p + len + 1;
 3103|  2.66k|    }
 3104|     11|    return 0;
 3105|     11|}
quickjs.c:JS_ResizeAtomHash:
 3049|     11|{
 3050|     11|    JSAtomStruct *p;
 3051|     11|    uint32_t new_hash_mask, h, i, hash_next1, j, *new_hash;
 3052|       |
 3053|     11|    assert((new_hash_size & (new_hash_size - 1)) == 0); /* power of two */
  ------------------
  |  Branch (3053:5): [True: 0, False: 11]
  |  Branch (3053:5): [True: 11, False: 0]
  ------------------
 3054|     11|    new_hash_mask = new_hash_size - 1;
 3055|     11|    new_hash = js_mallocz_rt(rt, sizeof(rt->atom_hash[0]) * new_hash_size);
 3056|     11|    if (!new_hash)
  ------------------
  |  Branch (3056:9): [True: 0, False: 11]
  ------------------
 3057|      0|        return -1;
 3058|     11|    for(i = 0; i < rt->atom_hash_size; i++) {
  ------------------
  |  Branch (3058:16): [True: 0, False: 11]
  ------------------
 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|     11|    js_free_rt(rt, rt->atom_hash);
 3071|     11|    rt->atom_hash = new_hash;
 3072|     11|    rt->atom_hash_size = new_hash_size;
 3073|     11|    rt->atom_count_resize = JS_ATOM_COUNT_RESIZE(new_hash_size);
  ------------------
  |  | 2875|     11|#define JS_ATOM_COUNT_RESIZE(n) ((n) * 2)
  ------------------
 3074|       |    //    JS_DumpAtoms(rt);
 3075|     11|    return 0;
 3076|     11|}
quickjs.c:__JS_AtomIsConst:
 2878|   219k|{
 2879|       |#if defined(DUMP_LEAKS) && DUMP_LEAKS > 1
 2880|       |        return (int32_t)v <= 0;
 2881|       |#else
 2882|   219k|        return (int32_t)v < JS_ATOM_END;
 2883|   219k|#endif
 2884|   219k|}
quickjs.c:is_digit:
 1957|  10.5k|static inline int is_digit(int c) {
 1958|  10.5k|    return c >= '0' && c <= '9';
  ------------------
  |  Branch (1958:12): [True: 10.5k, False: 2]
  |  Branch (1958:24): [True: 0, False: 10.5k]
  ------------------
 1959|  10.5k|}
quickjs.c:count_ascii:
 3450|  15.0k|{
 3451|  15.0k|    const uint8_t *p, *p_end;
 3452|  15.0k|    p = buf;
 3453|  15.0k|    p_end = buf + len;
 3454|   141k|    while (p < p_end && *p < 128)
  ------------------
  |  Branch (3454:12): [True: 126k, False: 15.0k]
  |  Branch (3454:25): [True: 126k, False: 33]
  ------------------
 3455|   126k|        p++;
 3456|  15.0k|    return p - buf;
 3457|  15.0k|}
quickjs.c:__JS_FindAtom:
 3350|  10.5k|{
 3351|  10.5k|    uint32_t h, h1, i;
 3352|  10.5k|    JSAtomStruct *p;
 3353|       |
 3354|  10.5k|    h = hash_string8((const uint8_t *)str, len, JS_ATOM_TYPE_STRING);
 3355|  10.5k|    h &= JS_ATOM_HASH_MASK;
  ------------------
  |  |  580|  10.5k|#define JS_ATOM_HASH_MASK  ((1 << 30) - 1)
  ------------------
 3356|  10.5k|    h1 = h & (rt->atom_hash_size - 1);
 3357|  10.5k|    i = rt->atom_hash[h1];
 3358|  16.8k|    while (i != 0) {
  ------------------
  |  Branch (3358:12): [True: 12.4k, False: 4.41k]
  ------------------
 3359|  12.4k|        p = rt->atom_array[i];
 3360|  12.4k|        if (p->hash == h &&
  ------------------
  |  Branch (3360:13): [True: 6.16k, False: 6.26k]
  ------------------
 3361|  6.16k|            p->atom_type == JS_ATOM_TYPE_STRING &&
  ------------------
  |  Branch (3361:13): [True: 6.16k, False: 0]
  ------------------
 3362|  6.16k|            p->len == len &&
  ------------------
  |  Branch (3362:13): [True: 6.16k, False: 0]
  ------------------
 3363|  6.16k|            p->is_wide_char == 0 &&
  ------------------
  |  Branch (3363:13): [True: 6.16k, False: 0]
  ------------------
 3364|  6.16k|            memcmp(p->u.str8, str, len) == 0) {
  ------------------
  |  Branch (3364:13): [True: 6.16k, False: 0]
  ------------------
 3365|  6.16k|            if (!__JS_AtomIsConst(i))
  ------------------
  |  Branch (3365:17): [True: 3.20k, False: 2.96k]
  ------------------
 3366|  3.20k|                js_rc(p)->ref_count++;
 3367|  6.16k|            return i;
 3368|  6.16k|        }
 3369|  6.26k|        i = p->hash_next;
 3370|  6.26k|    }
 3371|  4.41k|    return JS_ATOM_NULL;
  ------------------
  |  |  451|  4.41k|#define JS_ATOM_NULL 0
  ------------------
 3372|  10.5k|}
quickjs.c:hash_string8:
 2943|  17.5k|{
 2944|  17.5k|    size_t i;
 2945|       |
 2946|   161k|    for(i = 0; i < len; i++)
  ------------------
  |  Branch (2946:16): [True: 144k, False: 17.5k]
  ------------------
 2947|   144k|        h = h * 263 + str[i];
 2948|  17.5k|    return h;
 2949|  17.5k|}
quickjs.c:JS_NewAtomStr:
 3435|  4.46k|{
 3436|  4.46k|    JSRuntime *rt = ctx->rt;
 3437|  4.46k|    uint32_t n;
 3438|  4.46k|    if (is_num_string(&n, p)) {
  ------------------
  |  Branch (3438:9): [True: 0, False: 4.46k]
  ------------------
 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|  4.46k|    return __JS_NewAtom(rt, p, JS_ATOM_TYPE_STRING);
 3446|  4.46k|}
quickjs.c:is_num_string:
 2908|  4.52k|{
 2909|  4.52k|    uint32_t n;
 2910|  4.52k|    uint64_t n64;
 2911|  4.52k|    int c, i, len;
 2912|       |
 2913|  4.52k|    len = p->len;
 2914|  4.52k|    if (len == 0 || len > 10)
  ------------------
  |  Branch (2914:9): [True: 2, False: 4.52k]
  |  Branch (2914:21): [True: 1.18k, False: 3.34k]
  ------------------
 2915|  1.18k|        return FALSE;
 2916|  3.34k|    c = string_get(p, 0);
 2917|  3.34k|    if (is_num(c)) {
  ------------------
  |  Branch (2917:9): [True: 0, False: 3.34k]
  ------------------
 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|  3.34k|    } else {
 2937|  3.34k|        return FALSE;
 2938|  3.34k|    }
 2939|  3.34k|}
quickjs.c:is_num:
 2902|  3.34k|{
 2903|  3.34k|    return c >= '0' && c <= '9';
  ------------------
  |  Branch (2903:12): [True: 3.32k, False: 12]
  |  Branch (2903:24): [True: 0, False: 3.32k]
  ------------------
 2904|  3.34k|}
quickjs.c:js_free_string:
 2386|     49|{
 2387|     49|    if (--js_rc(str)->ref_count <= 0) {
  ------------------
  |  Branch (2387:9): [True: 11, False: 38]
  ------------------
 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|     49|}
quickjs.c:__JS_AtomFromUInt32:
 2892|   171k|{
 2893|   171k|    return v | JS_ATOM_TAG_INT;
  ------------------
  |  | 2870|   171k|#define JS_ATOM_TAG_INT (1U << 31)
  ------------------
 2894|   171k|}
quickjs.c:__JS_NewAtom:
 3180|  7.14k|{
 3181|  7.14k|    uint32_t h, h1, i;
 3182|  7.14k|    JSAtomStruct *p;
 3183|  7.14k|    int len;
 3184|       |
 3185|       |#if 0
 3186|       |    printf("__JS_NewAtom: ");  JS_DumpString(rt, str); printf("\n");
 3187|       |#endif
 3188|  7.14k|    if (atom_type < JS_ATOM_TYPE_SYMBOL) {
  ------------------
  |  Branch (3188:9): [True: 6.98k, False: 154]
  ------------------
 3189|       |        /* str is not NULL */
 3190|  6.98k|        if (str->atom_type == atom_type) {
  ------------------
  |  Branch (3190:13): [True: 2, False: 6.98k]
  ------------------
 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|  6.98k|        len = str->len;
 3200|  6.98k|        h = hash_string(str, atom_type);
 3201|  6.98k|        h &= JS_ATOM_HASH_MASK;
  ------------------
  |  |  580|  6.98k|#define JS_ATOM_HASH_MASK  ((1 << 30) - 1)
  ------------------
 3202|  6.98k|        h1 = h & (rt->atom_hash_size - 1);
 3203|  6.98k|        i = rt->atom_hash[h1];
 3204|  11.6k|        while (i != 0) {
  ------------------
  |  Branch (3204:16): [True: 4.67k, False: 6.93k]
  ------------------
 3205|  4.67k|            p = rt->atom_array[i];
 3206|  4.67k|            if (p->hash == h &&
  ------------------
  |  Branch (3206:17): [True: 49, False: 4.62k]
  ------------------
 3207|     49|                p->atom_type == atom_type &&
  ------------------
  |  Branch (3207:17): [True: 49, False: 0]
  ------------------
 3208|     49|                p->len == len &&
  ------------------
  |  Branch (3208:17): [True: 49, False: 0]
  ------------------
 3209|     49|                js_string_memcmp(p, 0, str, 0, len) == 0) {
  ------------------
  |  Branch (3209:17): [True: 49, False: 0]
  ------------------
 3210|     49|                if (!__JS_AtomIsConst(i))
  ------------------
  |  Branch (3210:21): [True: 49, False: 0]
  ------------------
 3211|     49|                    js_rc(p)->ref_count++;
 3212|     49|                goto done;
 3213|     49|            }
 3214|  4.62k|            i = p->hash_next;
 3215|  4.62k|        }
 3216|  6.98k|    } else {
 3217|    154|        h1 = 0; /* avoid warning */
 3218|    154|        if (atom_type == JS_ATOM_TYPE_SYMBOL) {
  ------------------
  |  Branch (3218:13): [True: 143, False: 11]
  ------------------
 3219|    143|            h = 0;
 3220|    143|        } else {
 3221|     11|            h = JS_ATOM_HASH_PRIVATE;
  ------------------
  |  |  581|     11|#define JS_ATOM_HASH_PRIVATE JS_ATOM_HASH_MASK
  |  |  ------------------
  |  |  |  |  580|     11|#define JS_ATOM_HASH_MASK  ((1 << 30) - 1)
  |  |  ------------------
  ------------------
 3222|     11|            atom_type = JS_ATOM_TYPE_SYMBOL;
 3223|     11|        }
 3224|    154|    }
 3225|       |
 3226|  7.08k|    if (rt->atom_free_index == 0) {
  ------------------
  |  Branch (3226:9): [True: 11, False: 7.07k]
  ------------------
 3227|       |        /* allow new atom entries */
 3228|     11|        uint32_t new_size, start;
 3229|     11|        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|     11|        new_size = max_int(711, rt->atom_size * 3 / 2);
 3236|     11|        if (new_size > JS_ATOM_MAX)
  ------------------
  |  | 2872|     11|#define JS_ATOM_MAX     ((1U << 30) - 1)
  ------------------
  |  Branch (3236:13): [True: 0, False: 11]
  ------------------
 3237|      0|            goto fail;
 3238|       |        /* XXX: should use realloc2 to use slack space */
 3239|     11|        new_array = js_realloc_rt(rt, rt->atom_array, sizeof(*new_array) * new_size);
 3240|     11|        if (!new_array)
  ------------------
  |  Branch (3240:13): [True: 0, False: 11]
  ------------------
 3241|      0|            goto fail;
 3242|       |        /* Note: the atom 0 is not used */
 3243|     11|        start = rt->atom_size;
 3244|     11|        if (start == 0) {
  ------------------
  |  Branch (3244:13): [True: 11, False: 0]
  ------------------
 3245|       |            /* JS_ATOM_NULL entry */
 3246|     11|            p = js_mallocz_rt(rt, sizeof(JSAtomStruct));
 3247|     11|            if (!p) {
  ------------------
  |  Branch (3247:17): [True: 0, False: 11]
  ------------------
 3248|      0|                js_free_rt(rt, new_array);
 3249|      0|                goto fail;
 3250|      0|            }
 3251|     11|            js_rc(p)->ref_count = 1;  /* not refcounted */
 3252|     11|            p->atom_type = JS_ATOM_TYPE_SYMBOL;
 3253|       |#ifdef DUMP_LEAKS
 3254|       |            list_add_tail(&p->link, &rt->string_list);
 3255|       |#endif
 3256|     11|            new_array[0] = p;
 3257|     11|            rt->atom_count++;
 3258|     11|            start = 1;
 3259|     11|        }
 3260|     11|        rt->atom_size = new_size;
 3261|     11|        rt->atom_array = new_array;
 3262|     11|        rt->atom_free_index = start;
 3263|  7.82k|        for(i = start; i < new_size; i++) {
  ------------------
  |  Branch (3263:24): [True: 7.81k, False: 11]
  ------------------
 3264|  7.81k|            uint32_t next;
 3265|  7.81k|            if (i == (new_size - 1))
  ------------------
  |  Branch (3265:17): [True: 11, False: 7.79k]
  ------------------
 3266|     11|                next = 0;
 3267|  7.79k|            else
 3268|  7.79k|                next = i + 1;
 3269|  7.81k|            rt->atom_array[i] = atom_set_free(next);
 3270|  7.81k|        }
 3271|     11|    }
 3272|       |
 3273|  7.08k|    if (str) {
  ------------------
  |  Branch (3273:9): [True: 7.08k, False: 0]
  ------------------
 3274|  7.08k|        if (str->atom_type == 0) {
  ------------------
  |  Branch (3274:13): [True: 7.08k, False: 0]
  ------------------
 3275|  7.08k|            p = str;
 3276|  7.08k|            p->atom_type = atom_type;
 3277|  7.08k|        } 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|  7.08k|    } 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|  7.08k|    i = rt->atom_free_index;
 3307|  7.08k|    rt->atom_free_index = atom_get_free(rt->atom_array[i]);
 3308|  7.08k|    rt->atom_array[i] = p;
 3309|       |
 3310|  7.08k|    p->hash = h;
 3311|  7.08k|    p->hash_next = i;   /* atom_index */
 3312|  7.08k|    p->atom_type = atom_type;
 3313|       |
 3314|  7.08k|    rt->atom_count++;
 3315|       |
 3316|  7.08k|    if (atom_type != JS_ATOM_TYPE_SYMBOL) {
  ------------------
  |  Branch (3316:9): [True: 6.93k, False: 154]
  ------------------
 3317|  6.93k|        p->hash_next = rt->atom_hash[h1];
 3318|  6.93k|        rt->atom_hash[h1] = i;
 3319|  6.93k|        if (unlikely(rt->atom_count >= rt->atom_count_resize))
  ------------------
  |  |   33|  6.93k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 6.93k]
  |  |  ------------------
  ------------------
 3320|      0|            JS_ResizeAtomHash(rt, rt->atom_hash_size * 2);
 3321|  6.93k|    }
 3322|       |
 3323|       |    //    JS_DumpAtoms(rt);
 3324|  7.08k|    return i;
 3325|       |
 3326|      0| fail:
 3327|      0|    i = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
 3328|     49| done:
 3329|     49|    if (str)
  ------------------
  |  Branch (3329:9): [True: 49, False: 0]
  ------------------
 3330|     49|        js_free_string(rt, str);
 3331|     49|    return i;
 3332|      0|}
quickjs.c:hash_string:
 2962|  6.98k|{
 2963|  6.98k|    if (str->is_wide_char)
  ------------------
  |  Branch (2963:9): [True: 4, False: 6.98k]
  ------------------
 2964|      4|        h = hash_string16(str->u.str16, str->len, h);
 2965|  6.98k|    else
 2966|  6.98k|        h = hash_string8(str->u.str8, str->len, h);
 2967|  6.98k|    return h;
 2968|  6.98k|}
quickjs.c:hash_string16:
 2953|      4|{
 2954|      4|    size_t i;
 2955|       |
 2956|  2.02M|    for(i = 0; i < len; i++)
  ------------------
  |  Branch (2956:16): [True: 2.02M, False: 4]
  ------------------
 2957|  2.02M|        h = h * 263 + str[i];
 2958|      4|    return h;
 2959|      4|}
quickjs.c:js_string_memcmp:
 4588|  5.39k|{
 4589|  5.39k|    int res;
 4590|       |
 4591|  5.39k|    if (likely(!p1->is_wide_char)) {
  ------------------
  |  |   32|  5.39k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 5.39k, False: 0]
  |  |  ------------------
  ------------------
 4592|  5.39k|        if (likely(!p2->is_wide_char))
  ------------------
  |  |   32|  5.39k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 5.39k, False: 0]
  |  |  ------------------
  ------------------
 4593|  5.39k|            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|  5.39k|    } 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|  5.39k|    return res;
 4603|  5.39k|}
quickjs.c:atom_set_free:
 2350|  12.2k|{
 2351|  12.2k|    return (JSAtomStruct *)(((uintptr_t)v << 1) | 1);
 2352|  12.2k|}
quickjs.c:atom_get_free:
 2340|  7.08k|{
 2341|  7.08k|    return (uintptr_t)p >> 1;
 2342|  7.08k|}
quickjs.c:__JS_AtomToValue:
 3596|   148k|{
 3597|   148k|    char buf[ATOM_GET_STR_BUF_SIZE];
 3598|       |
 3599|   148k|    if (__JS_AtomIsTaggedInt(atom)) {
  ------------------
  |  Branch (3599:9): [True: 0, False: 148k]
  ------------------
 3600|      0|        size_t len = u32toa(buf, __JS_AtomToUInt32(atom));
 3601|      0|        return js_new_string8_len(ctx, buf, len);
 3602|   148k|    } else {
 3603|   148k|        JSRuntime *rt = ctx->rt;
 3604|   148k|        JSAtomStruct *p;
 3605|   148k|        assert(atom < rt->atom_size);
  ------------------
  |  Branch (3605:9): [True: 0, False: 148k]
  |  Branch (3605:9): [True: 148k, False: 0]
  ------------------
 3606|   148k|        p = rt->atom_array[atom];
 3607|   148k|        if (p->atom_type == JS_ATOM_TYPE_STRING) {
  ------------------
  |  Branch (3607:13): [True: 148k, False: 143]
  ------------------
 3608|   148k|            goto ret_string;
 3609|   148k|        } else if (force_string) {
  ------------------
  |  Branch (3609:20): [True: 0, False: 143]
  ------------------
 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|   148k|        ret_string:
 3615|   148k|            return JS_DupValue(ctx, JS_MKPTR(JS_TAG_STRING, p));
  ------------------
  |  |  248|   148k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3616|    143|        } else {
 3617|    143|            return JS_DupValue(ctx, JS_MKPTR(JS_TAG_SYMBOL, p));
  ------------------
  |  |  248|    143|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3618|    143|        }
 3619|   148k|    }
 3620|   148k|}
quickjs.c:__JS_FreeAtom:
 3424|  14.0k|{
 3425|  14.0k|    JSAtomStruct *p;
 3426|       |
 3427|  14.0k|    p = rt->atom_array[i];
 3428|  14.0k|    if (--js_rc(p)->ref_count > 0)
  ------------------
  |  Branch (3428:9): [True: 10.0k, False: 4.06k]
  ------------------
 3429|  10.0k|        return;
 3430|  4.06k|    JS_FreeAtomStruct(rt, p);
 3431|  4.06k|}
quickjs.c:__JS_NewAtomInit:
 3337|  2.67k|{
 3338|  2.67k|    JSString *p;
 3339|  2.67k|    p = js_alloc_string_rt(rt, len, 0);
 3340|  2.67k|    if (!p)
  ------------------
  |  Branch (3340:9): [True: 0, False: 2.67k]
  ------------------
 3341|      0|        return JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
 3342|  2.67k|    memcpy(p->u.str8, str, len);
 3343|  2.67k|    p->u.str8[len] = '\0';
 3344|  2.67k|    return __JS_NewAtom(rt, p, atom_type);
 3345|  2.67k|}
quickjs.c:js_alloc_string_rt:
 2356|  43.5k|{
 2357|  43.5k|    JSString *str;
 2358|  43.5k|    str = js_malloc_rt(rt, sizeof(JSString) + (max_len << is_wide_char) + 1 - is_wide_char);
 2359|  43.5k|    if (unlikely(!str))
  ------------------
  |  |   33|  43.5k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 43.5k]
  |  |  ------------------
  ------------------
 2360|      0|        return NULL;
 2361|  43.5k|    js_rc(str)->ref_count = 1;
 2362|  43.5k|    str->is_wide_char = is_wide_char;
 2363|  43.5k|    str->len = max_len;
 2364|  43.5k|    str->atom_type = 0;
 2365|  43.5k|    str->hash = 0;          /* optional but costless */
 2366|  43.5k|    str->hash_next = 0;     /* optional */
 2367|       |#ifdef DUMP_LEAKS
 2368|       |    list_add_tail(&str->link, &rt->string_list);
 2369|       |#endif
 2370|  43.5k|    return str;
 2371|  43.5k|}
quickjs.c:JS_NewClass1:
 3859|    693|{
 3860|    693|    int new_size, i;
 3861|    693|    JSClass *cl, *new_class_array;
 3862|    693|    struct list_head *el;
 3863|       |
 3864|    693|    if (class_id >= (1 << 16))
  ------------------
  |  Branch (3864:9): [True: 0, False: 693]
  ------------------
 3865|      0|        return -1;
 3866|    693|    if (class_id < rt->class_count &&
  ------------------
  |  Branch (3866:9): [True: 671, False: 22]
  ------------------
 3867|    671|        rt->class_array[class_id].class_id != 0)
  ------------------
  |  Branch (3867:9): [True: 0, False: 671]
  ------------------
 3868|      0|        return -1;
 3869|       |
 3870|    693|    if (class_id >= rt->class_count) {
  ------------------
  |  Branch (3870:9): [True: 22, False: 671]
  ------------------
 3871|     22|        new_size = max_int(JS_CLASS_INIT_COUNT,
 3872|     22|                           max_int(class_id + 1, rt->class_count * 3 / 2));
 3873|       |
 3874|       |        /* reallocate the context class prototype array, if any */
 3875|     22|        list_for_each(el, &rt->context_list) {
  ------------------
  |  |   86|     33|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 11, False: 22]
  |  |  ------------------
  ------------------
 3876|     11|            JSContext *ctx = list_entry(el, JSContext, link);
  ------------------
  |  |   39|     11|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|     11|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 3877|     11|            JSValue *new_tab;
 3878|     11|            new_tab = js_realloc_rt(rt, ctx->class_proto,
 3879|     11|                                    sizeof(ctx->class_proto[0]) * new_size);
 3880|     11|            if (!new_tab)
  ------------------
  |  Branch (3880:17): [True: 0, False: 11]
  ------------------
 3881|      0|                return -1;
 3882|    352|            for(i = rt->class_count; i < new_size; i++)
  ------------------
  |  Branch (3882:38): [True: 341, False: 11]
  ------------------
 3883|    341|                new_tab[i] = JS_NULL;
  ------------------
  |  |  290|    341|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|    352|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 3884|     11|            ctx->class_proto = new_tab;
 3885|     11|        }
 3886|       |        /* reallocate the class array */
 3887|     22|        new_class_array = js_realloc_rt(rt, rt->class_array,
 3888|     22|                                        sizeof(JSClass) * new_size);
 3889|     22|        if (!new_class_array)
  ------------------
  |  Branch (3889:13): [True: 0, False: 22]
  ------------------
 3890|      0|            return -1;
 3891|     22|        memset(new_class_array + rt->class_count, 0,
 3892|     22|               (new_size - rt->class_count) * sizeof(JSClass));
 3893|     22|        rt->class_array = new_class_array;
 3894|     22|        rt->class_count = new_size;
 3895|     22|    }
 3896|    693|    cl = &rt->class_array[class_id];
 3897|    693|    cl->class_id = class_id;
 3898|    693|    cl->class_name = JS_DupAtomRT(rt, name);
 3899|    693|    cl->finalizer = class_def->finalizer;
 3900|    693|    cl->gc_mark = class_def->gc_mark;
 3901|    693|    cl->call = class_def->call;
 3902|    693|    cl->exotic = class_def->exotic;
 3903|    693|    return 0;
 3904|    693|}
quickjs.c:JS_DupAtomRT:
 3108|    693|{
 3109|    693|    JSAtomStruct *p;
 3110|       |
 3111|    693|    if (!__JS_AtomIsConst(v)) {
  ------------------
  |  Branch (3111:9): [True: 11, False: 682]
  ------------------
 3112|     11|        p = rt->atom_array[v];
 3113|     11|        js_rc(p)->ref_count++;
 3114|     11|    }
 3115|    693|    return v;
 3116|    693|}
quickjs.c:js_new_string8_len:
 3924|   139k|{
 3925|   139k|    JSString *str;
 3926|       |
 3927|   139k|    if (len <= 0) {
  ------------------
  |  Branch (3927:9): [True: 135k, False: 4.45k]
  ------------------
 3928|   135k|        return JS_AtomToString(ctx, JS_ATOM_empty_string);
 3929|   135k|    }
 3930|  4.45k|    str = js_alloc_string(ctx, len, 0);
 3931|  4.45k|    if (!str)
  ------------------
  |  Branch (3931:9): [True: 0, False: 4.45k]
  ------------------
 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|  4.45k|    memcpy(str->u.str8, buf, len);
 3934|  4.45k|    str->u.str8[len] = '\0';
 3935|  4.45k|    return JS_MKPTR(JS_TAG_STRING, str);
  ------------------
  |  |  248|  4.45k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3936|  4.45k|}
quickjs.c:string_buffer_init:
 4027|    108|{
 4028|    108|    return string_buffer_init2(ctx, s, size, 0);
 4029|    108|}
quickjs.c:string_buffer_write8:
 4196|  35.7k|{
 4197|  35.7k|    int i;
 4198|       |
 4199|  35.7k|    if (s->len + len > s->size) {
  ------------------
  |  Branch (4199:9): [True: 21, False: 35.7k]
  ------------------
 4200|     21|        if (string_buffer_realloc(s, s->len + len, 0))
  ------------------
  |  Branch (4200:13): [True: 0, False: 21]
  ------------------
 4201|      0|            return -1;
 4202|     21|    }
 4203|  35.7k|    if (s->is_wide_char) {
  ------------------
  |  Branch (4203:9): [True: 35.7k, False: 20]
  ------------------
 4204|   658k|        for (i = 0; i < len; i++) {
  ------------------
  |  Branch (4204:21): [True: 622k, False: 35.7k]
  ------------------
 4205|   622k|            s->str->u.str16[s->len + i] = p[i];
 4206|   622k|        }
 4207|  35.7k|        s->len += len;
 4208|  35.7k|    } else {
 4209|     20|        memcpy(&s->str->u.str8[s->len], p, len);
 4210|     20|        s->len += len;
 4211|     20|    }
 4212|  35.7k|    return 0;
 4213|  35.7k|}
quickjs.c:string_buffer_realloc:
 4069|    203|{
 4070|    203|    JSString *new_str;
 4071|    203|    int new_size;
 4072|    203|    size_t new_size_bytes, slack;
 4073|       |
 4074|    203|    if (s->error_status)
  ------------------
  |  Branch (4074:9): [True: 0, False: 203]
  ------------------
 4075|      0|        return -1;
 4076|       |
 4077|    203|    if (new_len > JS_STRING_LEN_MAX) {
  ------------------
  |  |  212|    203|#define JS_STRING_LEN_MAX ((1 << 30) - 1)
  ------------------
  |  Branch (4077:9): [True: 0, False: 203]
  ------------------
 4078|      0|        JS_ThrowInternalError(s->ctx, "string too long");
 4079|      0|        return string_buffer_set_error(s);
 4080|      0|    }
 4081|    203|    new_size = min_int(max_int(new_len, s->size * 3 / 2), JS_STRING_LEN_MAX);
  ------------------
  |  |  212|    203|#define JS_STRING_LEN_MAX ((1 << 30) - 1)
  ------------------
 4082|    203|    if (!s->is_wide_char && c >= 0x100) {
  ------------------
  |  Branch (4082:9): [True: 101, False: 102]
  |  Branch (4082:29): [True: 2, False: 99]
  ------------------
 4083|      2|        return string_buffer_widen(s, new_size);
 4084|      2|    }
 4085|    201|    new_size_bytes = sizeof(JSString) + (new_size << s->is_wide_char) + 1 - s->is_wide_char;
 4086|    201|    new_str = js_realloc2(s->ctx, s->str, new_size_bytes, &slack);
 4087|    201|    if (!new_str)
  ------------------
  |  Branch (4087:9): [True: 0, False: 201]
  ------------------
 4088|      0|        return string_buffer_set_error(s);
 4089|    201|    new_size = min_int(new_size + (slack >> s->is_wide_char), JS_STRING_LEN_MAX);
  ------------------
  |  |  212|    201|#define JS_STRING_LEN_MAX ((1 << 30) - 1)
  ------------------
 4090|    201|    s->size = new_size;
 4091|    201|    s->str = new_str;
 4092|    201|    return 0;
 4093|    201|}
quickjs.c:string_buffer_widen:
 4047|     12|{
 4048|     12|    JSString *str;
 4049|     12|    size_t slack;
 4050|     12|    int i;
 4051|       |
 4052|     12|    if (s->error_status)
  ------------------
  |  Branch (4052:9): [True: 0, False: 12]
  ------------------
 4053|      0|        return -1;
 4054|       |
 4055|     12|    str = js_realloc2(s->ctx, s->str, sizeof(JSString) + (size << 1), &slack);
 4056|     12|    if (!str)
  ------------------
  |  Branch (4056:9): [True: 0, False: 12]
  ------------------
 4057|      0|        return string_buffer_set_error(s);
 4058|     12|    size += slack >> 1;
 4059|  96.5k|    for(i = s->len; i-- > 0;) {
  ------------------
  |  Branch (4059:21): [True: 96.5k, False: 12]
  ------------------
 4060|  96.5k|        str->u.str16[i] = str->u.str8[i];
 4061|  96.5k|    }
 4062|     12|    s->is_wide_char = 1;
 4063|     12|    s->size = size;
 4064|     12|    s->str = str;
 4065|     12|    return 0;
 4066|     12|}
quickjs.c:string_buffer_putc8:
 4115|  1.24M|{
 4116|  1.24M|    if (unlikely(s->len >= s->size)) {
  ------------------
  |  |   33|  1.24M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1, False: 1.24M]
  |  |  ------------------
  ------------------
 4117|      1|        if (string_buffer_realloc(s, s->len + 1, c))
  ------------------
  |  Branch (4117:13): [True: 0, False: 1]
  ------------------
 4118|      0|            return -1;
 4119|      1|    }
 4120|  1.24M|    if (s->is_wide_char) {
  ------------------
  |  Branch (4120:9): [True: 1.24M, False: 14]
  ------------------
 4121|  1.24M|        s->str->u.str16[s->len++] = c;
 4122|  1.24M|    } else {
 4123|     14|        s->str->u.str8[s->len++] = c;
 4124|     14|    }
 4125|  1.24M|    return 0;
 4126|  1.24M|}
quickjs.c:string_buffer_putc16:
 4130|   808k|{
 4131|   808k|    if (likely(s->len < s->size)) {
  ------------------
  |  |   32|   808k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 808k, False: 179]
  |  |  ------------------
  ------------------
 4132|   808k|        if (s->is_wide_char) {
  ------------------
  |  Branch (4132:13): [True: 808k, False: 465]
  ------------------
 4133|   808k|            s->str->u.str16[s->len++] = c;
 4134|   808k|            return 0;
 4135|   808k|        } else if (c < 0x100) {
  ------------------
  |  Branch (4135:20): [True: 455, False: 10]
  ------------------
 4136|    455|            s->str->u.str8[s->len++] = c;
 4137|    455|            return 0;
 4138|    455|        }
 4139|   808k|    }
 4140|    189|    return string_buffer_putc16_slow(s, c);
 4141|   808k|}
quickjs.c:string_buffer_putc16_slow:
 4096|    189|{
 4097|    189|    if (unlikely(s->len >= s->size)) {
  ------------------
  |  |   33|    189|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 179, False: 10]
  |  |  ------------------
  ------------------
 4098|    179|        if (string_buffer_realloc(s, s->len + 1, c))
  ------------------
  |  Branch (4098:13): [True: 0, False: 179]
  ------------------
 4099|      0|            return -1;
 4100|    179|    }
 4101|    189|    if (s->is_wide_char) {
  ------------------
  |  Branch (4101:9): [True: 83, False: 106]
  ------------------
 4102|     83|        s->str->u.str16[s->len++] = c;
 4103|    106|    } else if (c < 0x100) {
  ------------------
  |  Branch (4103:16): [True: 96, False: 10]
  ------------------
 4104|     96|        s->str->u.str8[s->len++] = c;
 4105|     96|    } else {
 4106|     10|        if (string_buffer_widen(s, s->size))
  ------------------
  |  Branch (4106:13): [True: 0, False: 10]
  ------------------
 4107|      0|            return -1;
 4108|     10|        s->str->u.str16[s->len++] = c;
 4109|     10|    }
 4110|    189|    return 0;
 4111|    189|}
quickjs.c:string_buffer_end:
 4325|    107|{
 4326|    107|    JSString *str;
 4327|    107|    str = s->str;
 4328|    107|    if (s->error_status)
  ------------------
  |  Branch (4328:9): [True: 0, False: 107]
  ------------------
 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|    107|    if (s->len == 0) {
  ------------------
  |  Branch (4330:9): [True: 8, False: 99]
  ------------------
 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|     99|    if (s->len < s->size) {
  ------------------
  |  Branch (4335:9): [True: 97, False: 2]
  ------------------
 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|     97|        str = js_realloc_rt(s->ctx->rt, str, sizeof(JSString) +
 4340|     97|                            (s->len << s->is_wide_char) + 1 - s->is_wide_char);
 4341|     97|        if (str == NULL)
  ------------------
  |  Branch (4341:13): [True: 0, False: 97]
  ------------------
 4342|      0|            str = s->str;
 4343|     97|        s->str = str;
 4344|     97|    }
 4345|     99|    if (!s->is_wide_char)
  ------------------
  |  Branch (4345:9): [True: 87, False: 12]
  ------------------
 4346|     87|        str->u.str8[s->len] = 0;
 4347|       |#ifdef DUMP_LEAKS
 4348|       |    list_add_tail(&str->link, &s->ctx->rt->string_list);
 4349|       |#endif
 4350|     99|    str->is_wide_char = s->is_wide_char;
 4351|     99|    str->len = s->len;
 4352|     99|    s->str = NULL;
 4353|     99|    return JS_MKPTR(JS_TAG_STRING, str);
  ------------------
  |  |  248|     99|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 4354|    107|}
quickjs.c:string_buffer_free:
 4032|      1|{
 4033|      1|    js_free(s->ctx, s->str);
 4034|       |    s->str = NULL;
 4035|      1|}
quickjs.c:js_alloc_string:
 2374|  40.9k|{
 2375|  40.9k|    JSString *p;
 2376|  40.9k|    p = js_alloc_string_rt(ctx->rt, max_len, is_wide_char);
 2377|  40.9k|    if (unlikely(!p)) {
  ------------------
  |  |   33|  40.9k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 40.9k]
  |  |  ------------------
  ------------------
 2378|      0|        JS_ThrowOutOfMemory(ctx);
 2379|      0|        return NULL;
 2380|      0|    }
 2381|  40.9k|    return p;
 2382|  40.9k|}
quickjs.c:init_shape_hash:
 5133|     11|{
 5134|     11|    rt->shape_hash_bits = 4;   /* 16 shapes */
 5135|     11|    rt->shape_hash_size = 1 << rt->shape_hash_bits;
 5136|     11|    rt->shape_hash_count = 0;
 5137|     11|    rt->shape_hash = js_mallocz_rt(rt, sizeof(rt->shape_hash[0]) *
 5138|     11|                                   rt->shape_hash_size);
 5139|     11|    if (!rt->shape_hash)
  ------------------
  |  Branch (5139:9): [True: 0, False: 11]
  ------------------
 5140|      0|        return -1;
 5141|     11|    return 0;
 5142|     11|}
quickjs.c:js_free_shape_null:
 5328|     55|{
 5329|     55|    if (sh)
  ------------------
  |  Branch (5329:9): [True: 55, False: 0]
  ------------------
 5330|     55|        js_free_shape(rt, sh);
 5331|     55|}
quickjs.c:js_free_shape:
 5321|  4.80k|{
 5322|  4.80k|    if (unlikely(--js_rc(sh)->ref_count <= 0)) {
  ------------------
  |  |   33|  4.80k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2.73k, False: 2.07k]
  |  |  ------------------
  ------------------
 5323|  2.73k|        js_free_shape0(rt, sh);
 5324|  2.73k|    }
 5325|  4.80k|}
quickjs.c:js_free_shape0:
 5301|  2.73k|{
 5302|  2.73k|    uint32_t i;
 5303|  2.73k|    JSShapeProperty *pr;
 5304|       |
 5305|  2.73k|    assert(js_rc(sh)->ref_count == 0);
  ------------------
  |  Branch (5305:5): [True: 0, False: 2.73k]
  |  Branch (5305:5): [True: 2.73k, False: 0]
  ------------------
 5306|  2.73k|    if (sh->is_hashed)
  ------------------
  |  Branch (5306:9): [True: 1.51k, False: 1.21k]
  ------------------
 5307|  1.51k|        js_shape_hash_unlink(rt, sh);
 5308|  2.73k|    if (sh->proto != NULL) {
  ------------------
  |  Branch (5308:9): [True: 2.67k, False: 56]
  ------------------
 5309|  2.67k|        JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_OBJECT, sh->proto));
  ------------------
  |  |  248|  2.67k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 5310|  2.67k|    }
 5311|  2.73k|    pr = get_shape_prop(sh);
 5312|  14.2k|    for(i = 0; i < sh->prop_count; i++) {
  ------------------
  |  Branch (5312:16): [True: 11.5k, False: 2.73k]
  ------------------
 5313|  11.5k|        JS_FreeAtomRT(rt, pr->atom);
 5314|  11.5k|        pr++;
 5315|  11.5k|    }
 5316|  2.73k|    remove_gc_object(&sh->header);
 5317|  2.73k|    js_free_rt(rt, sh);
 5318|  2.73k|}
quickjs.c:js_shape_hash_unlink:
 5201|  4.37k|{
 5202|  4.37k|    uint32_t h;
 5203|  4.37k|    JSShape **psh;
 5204|       |
 5205|  4.37k|    h = get_shape_hash(sh->hash, rt->shape_hash_bits);
 5206|  4.37k|    psh = &rt->shape_hash[h];
 5207|  4.39k|    while (*psh != sh)
  ------------------
  |  Branch (5207:12): [True: 23, False: 4.37k]
  ------------------
 5208|     23|        psh = &(*psh)->shape_hash_next;
 5209|  4.37k|    *psh = sh->shape_hash_next;
 5210|  4.37k|    rt->shape_hash_count--;
 5211|  4.37k|}
quickjs.c:get_shape_hash:
 5152|  14.4k|{
 5153|  14.4k|    return h >> (32 - hash_bits);
 5154|  14.4k|}
quickjs.c:get_proto_obj:
 5735|  2.74k|{
 5736|  2.74k|    if (JS_VALUE_GET_TAG(proto_val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|  2.74k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5736:9): [True: 56, False: 2.68k]
  ------------------
 5737|     56|        return NULL;
 5738|  2.68k|    else
 5739|  2.68k|        return JS_VALUE_GET_OBJ(proto_val);
  ------------------
  |  |  229|  2.68k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  2.68k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5740|  2.74k|}
quickjs.c:find_hashed_shape_proto:
 5515|  1.49k|{
 5516|  1.49k|    JSShape *sh1;
 5517|  1.49k|    uint32_t h, h1;
 5518|       |
 5519|  1.49k|    h = shape_initial_hash(proto);
 5520|  1.49k|    h1 = get_shape_hash(h, rt->shape_hash_bits);
 5521|  2.14k|    for(sh1 = rt->shape_hash[h1]; sh1 != NULL; sh1 = sh1->shape_hash_next) {
  ------------------
  |  Branch (5521:35): [True: 1.37k, False: 771]
  ------------------
 5522|  1.37k|        if (sh1->hash == h &&
  ------------------
  |  Branch (5522:13): [True: 720, False: 654]
  ------------------
 5523|    720|            sh1->proto == proto &&
  ------------------
  |  Branch (5523:13): [True: 720, False: 0]
  ------------------
 5524|    720|            sh1->prop_count == 0) {
  ------------------
  |  Branch (5524:13): [True: 720, False: 0]
  ------------------
 5525|    720|            return sh1;
 5526|    720|        }
 5527|  1.37k|    }
 5528|    771|    return NULL;
 5529|  1.49k|}
quickjs.c:shape_initial_hash:
 5157|  2.31k|{
 5158|  2.31k|    uint32_t h;
 5159|  2.31k|    h = shape_hash(1, (uintptr_t)proto);
 5160|  2.31k|    if (sizeof(proto) > 4)
  ------------------
  |  Branch (5160:9): [True: 2.31k, Folded]
  ------------------
 5161|  2.31k|        h = shape_hash(h, (uint64_t)(uintptr_t)proto >> 32);
 5162|  2.31k|    return h;
 5163|  2.31k|}
quickjs.c:shape_hash:
 5146|  18.4k|{
 5147|  18.4k|    return (h + val) * 0x9e370001;
 5148|  18.4k|}
quickjs.c:js_dup_shape:
 5295|  2.07k|{
 5296|  2.07k|    js_rc(sh)->ref_count++;
 5297|  2.07k|    return sh;
 5298|  2.07k|}
quickjs.c:js_new_shape:
 5261|    771|{
 5262|    771|    return js_new_shape2(ctx, proto, JS_PROP_INITIAL_HASH_SIZE,
  ------------------
  |  |  966|    771|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
 5263|    771|                         JS_PROP_INITIAL_SIZE);
  ------------------
  |  |  965|    771|#define JS_PROP_INITIAL_SIZE 2
  ------------------
 5264|    771|}
quickjs.c:JS_NewObjectFromShape:
 5615|  2.71k|{
 5616|  2.71k|    JSObject *p;
 5617|  2.71k|    int i;
 5618|       |    
 5619|  2.71k|    js_trigger_gc(ctx->rt, sizeof(JSObject));
 5620|  2.71k|    p = js_malloc(ctx, sizeof(JSObject));
 5621|  2.71k|    if (unlikely(!p))
  ------------------
  |  |   33|  2.71k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2.71k]
  |  |  ------------------
  ------------------
 5622|      0|        goto fail;
 5623|  2.71k|    p->class_id = class_id;
 5624|  2.71k|    p->is_std_array_prototype = 0;
 5625|  2.71k|    p->extensible = TRUE;
 5626|  2.71k|    p->free_mark = 0;
 5627|  2.71k|    p->is_exotic = 0;
 5628|  2.71k|    p->fast_array = 0;
 5629|  2.71k|    p->is_constructor = 0;
 5630|  2.71k|    p->has_immutable_prototype = 0;
 5631|  2.71k|    p->tmp_mark = 0;
 5632|  2.71k|    p->is_HTMLDDA = 0;
 5633|  2.71k|    p->weakref_count = 0;
 5634|  2.71k|    p->u.opaque = NULL;
 5635|  2.71k|    p->shape = sh;
 5636|  2.71k|    p->prop = js_malloc(ctx, sizeof(JSProperty) * sh->prop_size);
 5637|  2.71k|    if (unlikely(!p->prop)) {
  ------------------
  |  |   33|  2.71k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2.71k]
  |  |  ------------------
  ------------------
 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|  2.71k|    switch(class_id) {
 5652|    649|    case JS_CLASS_OBJECT:
  ------------------
  |  Branch (5652:5): [True: 649, False: 2.06k]
  ------------------
 5653|    649|        break;
 5654|     31|    case JS_CLASS_ARRAY:
  ------------------
  |  Branch (5654:5): [True: 31, False: 2.67k]
  ------------------
 5655|     31|        {
 5656|     31|            JSProperty *pr;
 5657|     31|            p->is_exotic = 1;
 5658|     31|            p->fast_array = 1;
 5659|     31|            p->u.array.u.values = NULL;
 5660|     31|            p->u.array.count = 0;
 5661|     31|            p->u.array.u1.size = 0;
 5662|     31|            if (!props) {
  ------------------
  |  Branch (5662:17): [True: 31, False: 0]
  ------------------
 5663|       |                /* XXX: remove */
 5664|       |                /* the length property is always the first one */
 5665|     31|                if (likely(sh == ctx->array_shape)) {
  ------------------
  |  |   32|     31|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 20, False: 11]
  |  |  ------------------
  ------------------
 5666|     20|                    pr = &p->prop[0];
 5667|     20|                } else {
 5668|       |                    /* only used for the first array */
 5669|       |                    /* cannot fail */
 5670|     11|                    pr = add_property(ctx, p, JS_ATOM_length,
 5671|     11|                                      JS_PROP_WRITABLE | JS_PROP_LENGTH);
  ------------------
  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                    JS_PROP_WRITABLE | JS_PROP_LENGTH);
  ------------------
  |  |  302|     11|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
 5672|     11|                }
 5673|     31|                pr->u.value = JS_NewInt32(ctx, 0);
 5674|     31|            }
 5675|     31|        }
 5676|     31|        break;
 5677|  1.78k|    case JS_CLASS_C_FUNCTION:
  ------------------
  |  Branch (5677:5): [True: 1.78k, False: 921]
  ------------------
 5678|  1.78k|        p->prop[0].u.value = JS_UNDEFINED;
  ------------------
  |  |  291|  1.78k|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|  1.78k|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 5679|  1.78k|        break;
 5680|      0|    case JS_CLASS_ARGUMENTS:
  ------------------
  |  Branch (5680:5): [True: 0, False: 2.71k]
  ------------------
 5681|      0|    case JS_CLASS_MAPPED_ARGUMENTS:
  ------------------
  |  Branch (5681:5): [True: 0, False: 2.71k]
  ------------------
 5682|      0|    case JS_CLASS_UINT8C_ARRAY:
  ------------------
  |  Branch (5682:5): [True: 0, False: 2.71k]
  ------------------
 5683|      0|    case JS_CLASS_INT8_ARRAY:
  ------------------
  |  Branch (5683:5): [True: 0, False: 2.71k]
  ------------------
 5684|      0|    case JS_CLASS_UINT8_ARRAY:
  ------------------
  |  Branch (5684:5): [True: 0, False: 2.71k]
  ------------------
 5685|      0|    case JS_CLASS_INT16_ARRAY:
  ------------------
  |  Branch (5685:5): [True: 0, False: 2.71k]
  ------------------
 5686|      0|    case JS_CLASS_UINT16_ARRAY:
  ------------------
  |  Branch (5686:5): [True: 0, False: 2.71k]
  ------------------
 5687|      0|    case JS_CLASS_INT32_ARRAY:
  ------------------
  |  Branch (5687:5): [True: 0, False: 2.71k]
  ------------------
 5688|      0|    case JS_CLASS_UINT32_ARRAY:
  ------------------
  |  Branch (5688:5): [True: 0, False: 2.71k]
  ------------------
 5689|      0|    case JS_CLASS_BIG_INT64_ARRAY:
  ------------------
  |  Branch (5689:5): [True: 0, False: 2.71k]
  ------------------
 5690|      0|    case JS_CLASS_BIG_UINT64_ARRAY:
  ------------------
  |  Branch (5690:5): [True: 0, False: 2.71k]
  ------------------
 5691|      0|    case JS_CLASS_FLOAT16_ARRAY:
  ------------------
  |  Branch (5691:5): [True: 0, False: 2.71k]
  ------------------
 5692|      0|    case JS_CLASS_FLOAT32_ARRAY:
  ------------------
  |  Branch (5692:5): [True: 0, False: 2.71k]
  ------------------
 5693|      0|    case JS_CLASS_FLOAT64_ARRAY:
  ------------------
  |  Branch (5693:5): [True: 0, False: 2.71k]
  ------------------
 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: 2.71k]
  ------------------
 5700|      0|        p->u.array.u.ptr = NULL;
 5701|      0|        p->u.array.count = 0;
 5702|      0|        break;
 5703|     11|    case JS_CLASS_NUMBER:
  ------------------
  |  Branch (5703:5): [True: 11, False: 2.69k]
  ------------------
 5704|     22|    case JS_CLASS_STRING:
  ------------------
  |  Branch (5704:5): [True: 11, False: 2.69k]
  ------------------
 5705|     34|    case JS_CLASS_BOOLEAN:
  ------------------
  |  Branch (5705:5): [True: 12, False: 2.69k]
  ------------------
 5706|     34|    case JS_CLASS_SYMBOL:
  ------------------
  |  Branch (5706:5): [True: 0, False: 2.71k]
  ------------------
 5707|     34|    case JS_CLASS_DATE:
  ------------------
  |  Branch (5707:5): [True: 0, False: 2.71k]
  ------------------
 5708|     34|    case JS_CLASS_BIG_INT:
  ------------------
  |  Branch (5708:5): [True: 0, False: 2.71k]
  ------------------
 5709|     34|        p->u.object_data = 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 }
  |  |  ------------------
  ------------------
 5710|     34|        goto set_exotic;
 5711|      0|    case JS_CLASS_REGEXP:
  ------------------
  |  Branch (5711:5): [True: 0, False: 2.71k]
  ------------------
 5712|      0|        p->u.regexp.pattern = NULL;
 5713|      0|        p->u.regexp.bytecode = NULL;
 5714|      0|        break;
 5715|     11|    case JS_CLASS_GLOBAL_OBJECT:
  ------------------
  |  Branch (5715:5): [True: 11, False: 2.69k]
  ------------------
 5716|     11|        p->u.global_object.uninitialized_vars = 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 }
  |  |  ------------------
  ------------------
 5717|     11|        break;
 5718|    196|    default:
  ------------------
  |  Branch (5718:5): [True: 196, False: 2.51k]
  ------------------
 5719|    230|    set_exotic:
 5720|    230|        if (ctx->rt->class_array[class_id].exotic) {
  ------------------
  |  Branch (5720:13): [True: 33, False: 197]
  ------------------
 5721|     33|            p->is_exotic = 1;
 5722|     33|        }
 5723|    230|        break;
 5724|  2.71k|    }
 5725|  2.71k|    js_rc(p)->ref_count = 1;
 5726|  2.71k|    add_gc_object(ctx->rt, &p->header, JS_GC_OBJ_TYPE_JS_OBJECT);
 5727|  2.71k|    if (props) {
  ------------------
  |  Branch (5727:9): [True: 0, False: 2.71k]
  ------------------
 5728|      0|        for(i = 0; i < sh->prop_count; i++)
  ------------------
  |  Branch (5728:20): [True: 0, False: 0]
  ------------------
 5729|      0|            p->prop[i] = props[i];
 5730|      0|    }
 5731|  2.71k|    return JS_MKPTR(JS_TAG_OBJECT, p);
  ------------------
  |  |  248|  2.71k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 5732|  2.71k|}
quickjs.c:js_trigger_gc:
 1781|  2.71k|{
 1782|  2.71k|    BOOL force_gc;
 1783|       |#ifdef FORCE_GC_AT_MALLOC
 1784|       |    force_gc = TRUE;
 1785|       |#else
 1786|  2.71k|    force_gc = ((rt->malloc_ctx.malloc_state.malloc_size + size) >
 1787|  2.71k|                rt->malloc_gc_threshold);
 1788|  2.71k|#endif
 1789|  2.71k|    if (force_gc) {
  ------------------
  |  Branch (1789:9): [True: 6, False: 2.70k]
  ------------------
 1790|       |#ifdef DUMP_GC
 1791|       |        printf("GC: size=%" PRIu64 "\n",
 1792|       |               (uint64_t)rt->malloc_ctx.malloc_state.malloc_size);
 1793|       |#endif
 1794|      6|        JS_RunGC(rt);
 1795|      6|        rt->malloc_gc_threshold = rt->malloc_ctx.malloc_state.malloc_size +
 1796|      6|            (rt->malloc_ctx.malloc_state.malloc_size >> 1);
 1797|      6|    }
 1798|  2.71k|}
quickjs.c:free_property:
 6098|  12.7k|{
 6099|  12.7k|    if (unlikely(prop_flags & JS_PROP_TMASK)) {
  ------------------
  |  |   33|  12.7k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 6.84k, False: 5.86k]
  |  |  ------------------
  ------------------
 6100|  6.84k|        if ((prop_flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|  6.84k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      if ((prop_flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  305|  6.84k|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (6100:13): [True: 484, False: 6.36k]
  ------------------
 6101|    484|            if (pr->u.getset.getter)
  ------------------
  |  Branch (6101:17): [True: 484, False: 0]
  ------------------
 6102|    484|                JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.getter));
  ------------------
  |  |  248|    484|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6103|    484|            if (pr->u.getset.setter)
  ------------------
  |  Branch (6103:17): [True: 55, False: 429]
  ------------------
 6104|     55|                JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.setter));
  ------------------
  |  |  248|     55|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6105|  6.36k|        } else if ((prop_flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  303|  6.36k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      } else if ((prop_flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  306|  6.36k|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (6105:20): [True: 1.71k, False: 4.64k]
  ------------------
 6106|  1.71k|            free_var_ref(rt, pr->u.var_ref);
 6107|  4.64k|        } else if ((prop_flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  303|  4.64k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      } else if ((prop_flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  307|  4.64k|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (6107:20): [True: 4.64k, False: 0]
  ------------------
 6108|  4.64k|            js_autoinit_free(rt, pr);
 6109|  4.64k|        }
 6110|  6.84k|    } else {
 6111|  5.86k|        JS_FreeValueRT(rt, pr->u.value);
 6112|  5.86k|    }
 6113|  12.7k|}
quickjs.c:js_autoinit_free:
 6087|  4.77k|{
 6088|  4.77k|    JS_FreeContext(js_autoinit_get_realm(pr));
 6089|  4.77k|}
quickjs.c:js_autoinit_get_realm:
 6077|  19.2k|{
 6078|  19.2k|    return (JSContext *)(pr->u.init.realm_and_id & ~3);
 6079|  19.2k|}
quickjs.c:JS_NewCFunction3:
 5948|  1.78k|{
 5949|  1.78k|    JSValue func_obj;
 5950|  1.78k|    JSObject *p;
 5951|  1.78k|    JSAtom name_atom;
 5952|       |
 5953|  1.78k|    if (n_fields > 0) {
  ------------------
  |  Branch (5953:9): [True: 528, False: 1.26k]
  ------------------
 5954|    528|        func_obj = JS_NewObjectProtoClassAlloc(ctx, proto_val, JS_CLASS_C_FUNCTION, n_fields);
 5955|  1.26k|    } else {
 5956|  1.26k|        func_obj = JS_NewObjectProtoClass(ctx, proto_val, JS_CLASS_C_FUNCTION);
 5957|  1.26k|    }
 5958|  1.78k|    if (JS_IsException(func_obj))
  ------------------
  |  Branch (5958:9): [True: 0, False: 1.78k]
  ------------------
 5959|      0|        return func_obj;
 5960|  1.78k|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  229|  1.78k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.78k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5961|  1.78k|    p->u.cfunc.realm = JS_DupContext(ctx);
 5962|  1.78k|    p->u.cfunc.c_function.generic = func;
 5963|  1.78k|    p->u.cfunc.length = length;
 5964|  1.78k|    p->u.cfunc.cproto = cproto;
 5965|  1.78k|    p->u.cfunc.magic = magic;
 5966|  1.78k|    p->is_constructor = (cproto == JS_CFUNC_constructor ||
  ------------------
  |  Branch (5966:26): [True: 55, False: 1.73k]
  ------------------
 5967|  1.73k|                         cproto == JS_CFUNC_constructor_magic ||
  ------------------
  |  Branch (5967:26): [True: 176, False: 1.55k]
  ------------------
 5968|  1.55k|                         cproto == JS_CFUNC_constructor_or_func ||
  ------------------
  |  Branch (5968:26): [True: 143, False: 1.41k]
  ------------------
 5969|  1.41k|                         cproto == JS_CFUNC_constructor_or_func_magic);
  ------------------
  |  Branch (5969:26): [True: 143, False: 1.27k]
  ------------------
 5970|  1.78k|    if (!name)
  ------------------
  |  Branch (5970:9): [True: 11, False: 1.77k]
  ------------------
 5971|     11|        name = "";
 5972|  1.78k|    name_atom = JS_NewAtom(ctx, name);
 5973|  1.78k|    if (name_atom == JS_ATOM_NULL) {
  ------------------
  |  |  451|  1.78k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (5973:9): [True: 0, False: 1.78k]
  ------------------
 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|  1.78k|    js_function_set_properties(ctx, func_obj, name_atom, length);
 5978|  1.78k|    JS_FreeAtom(ctx, name_atom);
 5979|  1.78k|    return func_obj;
 5980|  1.78k|}
quickjs.c:JS_NewObjectProtoClassAlloc:
 5765|  1.19k|{
 5766|  1.19k|    JSShape *sh;
 5767|  1.19k|    JSObject *proto;
 5768|  1.19k|    int hash_size, hash_bits;
 5769|       |    
 5770|  1.19k|    if (n_alloc_props <= JS_PROP_INITIAL_SIZE) {
  ------------------
  |  |  965|  1.19k|#define JS_PROP_INITIAL_SIZE 2
  ------------------
  |  Branch (5770:9): [True: 231, False: 968]
  ------------------
 5771|    231|        n_alloc_props = JS_PROP_INITIAL_SIZE;
  ------------------
  |  |  965|    231|#define JS_PROP_INITIAL_SIZE 2
  ------------------
 5772|    231|        hash_size = JS_PROP_INITIAL_HASH_SIZE;
  ------------------
  |  |  966|    231|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
 5773|    968|    } else {
 5774|    968|        hash_bits = 32 - clz32(n_alloc_props - 1); /* ceil(log2(radix)) */
 5775|    968|        hash_size = 1 << hash_bits;
 5776|    968|    }
 5777|  1.19k|    proto = get_proto_obj(proto_val);
 5778|  1.19k|    sh = js_new_shape_nohash(ctx, proto, hash_size, n_alloc_props);
 5779|  1.19k|    if (!sh)
  ------------------
  |  Branch (5779:9): [True: 0, False: 1.19k]
  ------------------
 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.19k|    return JS_NewObjectFromShape(ctx, sh, class_id, NULL);
 5782|  1.19k|}
quickjs.c:js_new_shape_nohash:
 5216|  2.02k|{
 5217|  2.02k|    JSRuntime *rt = ctx->rt;
 5218|  2.02k|    JSShape *sh;
 5219|       |
 5220|  2.02k|    sh = js_malloc(ctx, get_shape_size(hash_size, prop_size));
 5221|  2.02k|    if (!sh)
  ------------------
  |  Branch (5221:9): [True: 0, False: 2.02k]
  ------------------
 5222|      0|        return NULL;
 5223|  2.02k|    js_rc(sh)->ref_count = 1;
 5224|  2.02k|    add_gc_object(rt, &sh->header, JS_GC_OBJ_TYPE_SHAPE);
 5225|  2.02k|    if (proto)
  ------------------
  |  Branch (5225:9): [True: 1.96k, False: 56]
  ------------------
 5226|  1.96k|        JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, proto));
  ------------------
  |  |  248|  1.96k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 5227|  2.02k|    sh->proto = proto;
 5228|  2.02k|    memset(sh->hash_table, 0, sizeof(sh->hash_table[0]) * hash_size);
 5229|  2.02k|    sh->prop_hash_mask = hash_size - 1;
 5230|  2.02k|    sh->prop_size = prop_size;
 5231|  2.02k|    sh->prop_count = 0;
 5232|  2.02k|    sh->deleted_prop_count = 0;
 5233|  2.02k|    sh->is_hashed = FALSE;
 5234|  2.02k|    return sh;
 5235|  2.02k|}
quickjs.c:js_c_function_data_call:
 6028|     22|{
 6029|     22|    JSCFunctionDataRecord *s = JS_GetOpaque(func_obj, JS_CLASS_C_FUNCTION_DATA);
 6030|     22|    JSValueConst *arg_buf;
  ------------------
  |  |  234|     22|#define JSValueConst JSValue
  ------------------
 6031|     22|    int i;
 6032|       |
 6033|       |    /* XXX: could add the function on the stack for debug */
 6034|     22|    if (unlikely(argc < s->length)) {
  ------------------
  |  |   33|     22|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 22]
  |  |  ------------------
  ------------------
 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|     22|    } else {
 6041|     22|        arg_buf = argv;
 6042|     22|    }
 6043|       |
 6044|     22|    return s->func(ctx, this_val, argc, arg_buf, s->magic, s->data);
 6045|     22|}
quickjs.c:js_function_set_properties:
 5855|  1.87k|{
 5856|       |    /* ES6 feature non compatible with ES5.1: length is configurable */
 5857|  1.87k|    JS_DefinePropertyValue(ctx, func_obj, JS_ATOM_length, JS_NewInt32(ctx, len),
 5858|  1.87k|                           JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|  1.87k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 5859|  1.87k|    JS_DefinePropertyValue(ctx, func_obj, JS_ATOM_name,
 5860|  1.87k|                           JS_AtomToString(ctx, name), JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|  1.87k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 5861|  1.87k|}
quickjs.c:JS_FreeAtomStruct:
 3375|  4.42k|{
 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|  4.42k|    uint32_t i = p->hash_next;  /* atom_index */
 3383|  4.42k|    if (p->atom_type != JS_ATOM_TYPE_SYMBOL) {
  ------------------
  |  Branch (3383:9): [True: 4.42k, False: 0]
  ------------------
 3384|  4.42k|        JSAtomStruct *p0, *p1;
 3385|  4.42k|        uint32_t h0;
 3386|       |
 3387|  4.42k|        h0 = p->hash & (rt->atom_hash_size - 1);
 3388|  4.42k|        i = rt->atom_hash[h0];
 3389|  4.42k|        p1 = rt->atom_array[i];
 3390|  4.42k|        if (p1 == p) {
  ------------------
  |  Branch (3390:13): [True: 3.21k, False: 1.21k]
  ------------------
 3391|  3.21k|            rt->atom_hash[h0] = p1->hash_next;
 3392|  3.21k|        } else {
 3393|  1.67k|            for(;;) {
 3394|  1.67k|                assert(i != 0);
  ------------------
  |  Branch (3394:17): [True: 0, False: 1.67k]
  |  Branch (3394:17): [True: 1.67k, False: 0]
  ------------------
 3395|  1.67k|                p0 = p1;
 3396|  1.67k|                i = p1->hash_next;
 3397|  1.67k|                p1 = rt->atom_array[i];
 3398|  1.67k|                if (p1 == p) {
  ------------------
  |  Branch (3398:21): [True: 1.21k, False: 459]
  ------------------
 3399|  1.21k|                    p0->hash_next = p1->hash_next;
 3400|  1.21k|                    break;
 3401|  1.21k|                }
 3402|  1.67k|            }
 3403|  1.21k|        }
 3404|  4.42k|    }
 3405|       |    /* insert in free atom list */
 3406|  4.42k|    rt->atom_array[i] = atom_set_free(rt->atom_free_index);
 3407|  4.42k|    rt->atom_free_index = i;
 3408|       |    /* free the string structure */
 3409|       |#ifdef DUMP_LEAKS
 3410|       |    list_del(&p->link);
 3411|       |#endif
 3412|  4.42k|    if (p->atom_type == JS_ATOM_TYPE_SYMBOL &&
  ------------------
  |  Branch (3412:9): [True: 0, False: 4.42k]
  ------------------
 3413|      0|        p->hash != JS_ATOM_HASH_PRIVATE && p->hash != 0) {
  ------------------
  |  |  581|      0|#define JS_ATOM_HASH_PRIVATE JS_ATOM_HASH_MASK
  |  |  ------------------
  |  |  |  |  580|  4.42k|#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|  4.42k|    } else {
 3417|  4.42k|        js_free_rt(rt, p);
 3418|  4.42k|    }
 3419|  4.42k|    rt->atom_count--;
 3420|       |    assert(rt->atom_count >= 0);
  ------------------
  |  Branch (3420:5): [True: 0, False: 4.42k]
  |  Branch (3420:5): [True: 4.42k, False: 0]
  ------------------
 3421|  4.42k|}
quickjs.c:free_zero_refcount:
 6415|     81|{
 6416|     81|    struct list_head *el;
 6417|     81|    JSGCObjectHeader *p;
 6418|       |
 6419|     81|    rt->gc_phase = JS_GC_PHASE_DECREF;
 6420|    195|    for(;;) {
 6421|    195|        el = rt->gc_zero_ref_count_list.next;
 6422|    195|        if (el == &rt->gc_zero_ref_count_list)
  ------------------
  |  Branch (6422:13): [True: 81, False: 114]
  ------------------
 6423|     81|            break;
 6424|    114|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|    114|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|    114|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6425|    114|        assert(js_rc(p)->ref_count == 0);
  ------------------
  |  Branch (6425:9): [True: 0, False: 114]
  |  Branch (6425:9): [True: 114, False: 0]
  ------------------
 6426|    114|        free_gc_object(rt, p);
 6427|    114|    }
 6428|     81|    rt->gc_phase = JS_GC_PHASE_NONE;
 6429|     81|}
quickjs.c:free_gc_object:
 6395|  2.77k|{
 6396|  2.77k|    switch(js_rc(gp)->gc_obj_type) {
 6397|  2.71k|    case JS_GC_OBJ_TYPE_JS_OBJECT:
  ------------------
  |  Branch (6397:5): [True: 2.71k, False: 64]
  ------------------
 6398|  2.71k|        free_object(rt, (JSObject *)gp);
 6399|  2.71k|        break;
 6400|     20|    case JS_GC_OBJ_TYPE_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6400:5): [True: 20, False: 2.75k]
  ------------------
 6401|     20|        free_function_bytecode(rt, (JSFunctionBytecode *)gp);
 6402|     20|        break;
 6403|     11|    case JS_GC_OBJ_TYPE_ASYNC_FUNCTION:
  ------------------
  |  Branch (6403:5): [True: 11, False: 2.76k]
  ------------------
 6404|     11|        __async_func_free(rt, (JSAsyncFunctionState *)gp);
 6405|     11|        break;
 6406|     33|    case JS_GC_OBJ_TYPE_MODULE:
  ------------------
  |  Branch (6406:5): [True: 33, False: 2.74k]
  ------------------
 6407|     33|        js_free_module_def(rt, (JSModuleDef *)gp);
 6408|     33|        break;
 6409|      0|    default:
  ------------------
  |  Branch (6409:5): [True: 0, False: 2.77k]
  ------------------
 6410|      0|        abort();
 6411|  2.77k|    }
 6412|  2.77k|}
quickjs.c:free_object:
 6341|  2.71k|{
 6342|  2.71k|    int i;
 6343|  2.71k|    JSClassFinalizer *finalizer;
 6344|  2.71k|    JSShape *sh;
 6345|  2.71k|    JSShapeProperty *pr;
 6346|       |
 6347|  2.71k|    p->free_mark = 1; /* used to tell the object is invalid when
 6348|       |                         freeing cycles */
 6349|       |    /* free all the fields */
 6350|  2.71k|    sh = p->shape;
 6351|  2.71k|    pr = get_shape_prop(sh);
 6352|  15.4k|    for(i = 0; i < sh->prop_count; i++) {
  ------------------
  |  Branch (6352:16): [True: 12.7k, False: 2.71k]
  ------------------
 6353|  12.7k|        free_property(rt, &p->prop[i], pr->flags);
 6354|  12.7k|        pr++;
 6355|  12.7k|    }
 6356|  2.71k|    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|  2.71k|    js_free_shape(rt, sh);
 6360|       |
 6361|       |    /* fail safe */
 6362|  2.71k|    p->shape = NULL;
 6363|  2.71k|    p->prop = NULL;
 6364|       |
 6365|  2.71k|    finalizer = rt->class_array[p->class_id].finalizer;
 6366|  2.71k|    if (finalizer)
  ------------------
  |  Branch (6366:9): [True: 2.01k, False: 692]
  ------------------
 6367|  2.01k|        (*finalizer)(rt, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|  2.01k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6368|       |
 6369|       |    /* fail safe */
 6370|  2.71k|    p->class_id = 0;
 6371|  2.71k|    p->u.opaque = NULL;
 6372|  2.71k|    p->u.func.var_refs = NULL;
 6373|  2.71k|    p->u.func.home_object = NULL;
 6374|       |
 6375|  2.71k|    remove_gc_object(&p->header);
 6376|  2.71k|    if (rt->gc_phase == JS_GC_PHASE_REMOVE_CYCLES) {
  ------------------
  |  Branch (6376:9): [True: 2.61k, False: 95]
  ------------------
 6377|  2.61k|        if (js_rc(p)->ref_count == 0 && p->weakref_count == 0) {
  ------------------
  |  Branch (6377:13): [True: 562, False: 2.05k]
  |  Branch (6377:41): [True: 562, False: 0]
  ------------------
 6378|    562|            js_free_rt(rt, p);
 6379|  2.05k|        } else {
 6380|       |            /* keep the object structure because there are may be
 6381|       |               references to it */
 6382|  2.05k|            list_add_tail(&p->header.link, &rt->gc_zero_ref_count_list);
 6383|  2.05k|        }
 6384|  2.61k|    } else {
 6385|       |        /* keep the object structure in case there are weak references to it */
 6386|     95|        if (p->weakref_count == 0) {
  ------------------
  |  Branch (6386:13): [True: 95, False: 0]
  ------------------
 6387|     95|            js_free_rt(rt, p);
 6388|     95|        } else {
 6389|      0|            js_rc(p)->mark = 0; /* reset the mark so that the weakref can be freed */
 6390|      0|        }
 6391|     95|    }
 6392|  2.71k|}
quickjs.c:free_function_bytecode:
36284|     20|{
36285|     20|    int i;
36286|       |
36287|       |#if 0
36288|       |    {
36289|       |        char buf[ATOM_GET_STR_BUF_SIZE];
36290|       |        printf("freeing %s\n",
36291|       |               JS_AtomGetStrRT(rt, buf, sizeof(buf), b->func_name));
36292|       |    }
36293|       |#endif
36294|     20|    if (b->byte_code_buf)
  ------------------
  |  Branch (36294:9): [True: 20, False: 0]
  ------------------
36295|     20|        free_bytecode_atoms(rt, b->byte_code_buf, b->byte_code_len, TRUE);
36296|       |
36297|     20|    if (b->vardefs) {
  ------------------
  |  Branch (36297:9): [True: 9, False: 11]
  ------------------
36298|     27|        for(i = 0; i < b->arg_count + b->var_count; i++) {
  ------------------
  |  Branch (36298:20): [True: 18, False: 9]
  ------------------
36299|     18|            JS_FreeAtomRT(rt, b->vardefs[i].var_name);
36300|     18|        }
36301|      9|    }
36302|     29|    for(i = 0; i < b->cpool_count; i++)
  ------------------
  |  Branch (36302:16): [True: 9, False: 20]
  ------------------
36303|      9|        JS_FreeValueRT(rt, b->cpool[i]);
36304|       |
36305|     70|    for(i = 0; i < b->closure_var_count; i++) {
  ------------------
  |  Branch (36305:16): [True: 50, False: 20]
  ------------------
36306|     50|        JSClosureVar *cv = &b->closure_var[i];
36307|     50|        JS_FreeAtomRT(rt, cv->var_name);
36308|     50|    }
36309|     20|    if (b->realm)
  ------------------
  |  Branch (36309:9): [True: 20, False: 0]
  ------------------
36310|     20|        JS_FreeContext(b->realm);
36311|       |
36312|     20|    JS_FreeAtomRT(rt, b->func_name);
36313|     20|    if (b->has_debug) {
  ------------------
  |  Branch (36313:9): [True: 20, False: 0]
  ------------------
36314|     20|        JS_FreeAtomRT(rt, b->debug.filename);
36315|     20|        js_free_rt(rt, b->debug.pc2line_buf);
36316|     20|        js_free_rt(rt, b->debug.source);
36317|     20|    }
36318|       |
36319|     20|    remove_gc_object(&b->header);
36320|     20|    if (rt->gc_phase == JS_GC_PHASE_REMOVE_CYCLES && js_rc(b)->ref_count != 0) {
  ------------------
  |  Branch (36320:9): [True: 12, False: 8]
  |  Branch (36320:54): [True: 8, False: 4]
  ------------------
36321|      8|        list_add_tail(&b->header.link, &rt->gc_zero_ref_count_list);
36322|     12|    } else {
36323|     12|        js_free_rt(rt, b);
36324|     12|    }
36325|     20|}
quickjs.c:free_bytecode_atoms:
32130|     27|{
32131|     27|    int pos, len, op;
32132|     27|    JSAtom atom;
32133|     27|    const JSOpCode *oi;
32134|       |
32135|     27|    pos = 0;
32136|    831|    while (pos < bc_len) {
  ------------------
  |  Branch (32136:12): [True: 804, False: 27]
  ------------------
32137|    804|        op = bc_buf[pos];
32138|    804|        if (use_short_opcodes)
  ------------------
  |  Branch (32138:13): [True: 250, False: 554]
  ------------------
32139|    250|            oi = &short_opcode_info(op);
  ------------------
  |  |22182|    250|    opcode_info[(op) >= OP_TEMP_START ? \
  |  |  ------------------
  |  |  |  Branch (22182:17): [True: 69, False: 181]
  |  |  ------------------
  |  |22183|    250|                (op) + (OP_TEMP_END - OP_TEMP_START) : (op)]
  ------------------
32140|    554|        else
32141|    554|            oi = &opcode_info[op];
32142|       |
32143|    804|        len = oi->size;
32144|    804|        switch(oi->fmt) {
32145|     50|        case OP_FMT_atom:
  ------------------
  |  Branch (32145:9): [True: 50, False: 754]
  ------------------
32146|     50|        case OP_FMT_atom_u8:
  ------------------
  |  Branch (32146:9): [True: 0, False: 804]
  ------------------
32147|     89|        case OP_FMT_atom_u16:
  ------------------
  |  Branch (32147:9): [True: 39, False: 765]
  ------------------
32148|     89|        case OP_FMT_atom_label_u8:
  ------------------
  |  Branch (32148:9): [True: 0, False: 804]
  ------------------
32149|     89|        case OP_FMT_atom_label_u16:
  ------------------
  |  Branch (32149:9): [True: 0, False: 804]
  ------------------
32150|     89|            if ((pos + 1 + 4) > bc_len)
  ------------------
  |  Branch (32150:17): [True: 0, False: 89]
  ------------------
32151|      0|                break; /* may happen if there is not enough memory when emiting bytecode */
32152|     89|            atom = get_u32(bc_buf + pos + 1);
32153|     89|            JS_FreeAtomRT(rt, atom);
32154|     89|            break;
32155|    715|        default:
  ------------------
  |  Branch (32155:9): [True: 715, False: 89]
  ------------------
32156|    715|            break;
32157|    804|        }
32158|    804|        pos += len;
32159|    804|    }
32160|     27|}
quickjs.c:__async_func_free:
20989|     11|{
20990|       |    /* cannot close the closure variables here because it would
20991|       |       potentially modify the object graph */
20992|     11|    if (!s->is_completed) {
  ------------------
  |  Branch (20992:9): [True: 0, False: 11]
  ------------------
20993|      0|        async_func_free_frame(rt, s);
20994|      0|    }
20995|       |
20996|     11|    JS_FreeValueRT(rt, s->resolving_funcs[0]);
20997|     11|    JS_FreeValueRT(rt, s->resolving_funcs[1]);
20998|       |
20999|     11|    remove_gc_object(&s->header);
21000|     11|    if (rt->gc_phase == JS_GC_PHASE_REMOVE_CYCLES && js_rc(s)->ref_count != 0) {
  ------------------
  |  Branch (21000:9): [True: 0, False: 11]
  |  Branch (21000:54): [True: 0, False: 0]
  ------------------
21001|      0|        list_add_tail(&s->header.link, &rt->gc_zero_ref_count_list);
21002|     11|    } else {
21003|     11|        js_free_rt(rt, s);
21004|     11|    }
21005|     11|}
quickjs.c:async_func_free_frame:
20938|     11|{
20939|     11|    JSStackFrame *sf = &s->frame;
20940|     11|    JSValue *sp;
20941|       |
20942|       |    /* cannot free the function if it is running */
20943|     11|    assert(sf->cur_sp != NULL);
  ------------------
  |  Branch (20943:5): [True: 0, False: 11]
  |  Branch (20943:5): [True: 11, False: 0]
  ------------------
20944|     22|    for(sp = sf->arg_buf; sp < sf->cur_sp; sp++) {
  ------------------
  |  Branch (20944:27): [True: 11, False: 11]
  ------------------
20945|     11|        JS_FreeValueRT(rt, *sp);
20946|     11|    }
20947|     11|    JS_FreeValueRT(rt, sf->cur_func);
20948|     11|    JS_FreeValueRT(rt, s->this_val);
20949|     11|}
quickjs.c:js_free_module_def:
29716|     33|{
29717|     33|    int i;
29718|       |
29719|     33|    JS_FreeAtomRT(rt, m->module_name);
29720|       |
29721|     55|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (29721:16): [True: 22, False: 33]
  ------------------
29722|     22|        JSReqModuleEntry *rme = &m->req_module_entries[i];
29723|     22|        JS_FreeAtomRT(rt, rme->module_name);
29724|     22|        JS_FreeValueRT(rt, rme->attributes);
29725|     22|    }
29726|     33|    js_free_rt(rt, m->req_module_entries);
29727|       |
29728|  1.11k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (29728:16): [True: 1.07k, False: 33]
  ------------------
29729|  1.07k|        JSExportEntry *me = &m->export_entries[i];
29730|  1.07k|        if (me->export_type == JS_EXPORT_TYPE_LOCAL)
  ------------------
  |  Branch (29730:13): [True: 1.07k, False: 0]
  ------------------
29731|  1.07k|            free_var_ref(rt, me->u.local.var_ref);
29732|  1.07k|        JS_FreeAtomRT(rt, me->export_name);
29733|  1.07k|        JS_FreeAtomRT(rt, me->local_name);
29734|  1.07k|    }
29735|     33|    js_free_rt(rt, m->export_entries);
29736|       |
29737|     33|    js_free_rt(rt, m->star_export_entries);
29738|       |
29739|     55|    for(i = 0; i < m->import_entries_count; i++) {
  ------------------
  |  Branch (29739:16): [True: 22, False: 33]
  ------------------
29740|     22|        JSImportEntry *mi = &m->import_entries[i];
29741|     22|        JS_FreeAtomRT(rt, mi->import_name);
29742|     22|    }
29743|     33|    js_free_rt(rt, m->import_entries);
29744|     33|    js_free_rt(rt, m->async_parent_modules);
29745|       |
29746|     33|    JS_FreeValueRT(rt, m->module_ns);
29747|     33|    JS_FreeValueRT(rt, m->func_obj);
29748|     33|    JS_FreeValueRT(rt, m->eval_exception);
29749|     33|    JS_FreeValueRT(rt, m->meta_obj);
29750|     33|    JS_FreeValueRT(rt, m->promise);
29751|     33|    JS_FreeValueRT(rt, m->resolving_funcs[0]);
29752|     33|    JS_FreeValueRT(rt, m->resolving_funcs[1]);
29753|     33|    JS_FreeValueRT(rt, m->private_value);
29754|       |    /* during the GC the finalizers are called in an arbitrary
29755|       |       order so the module may no longer be referenced by the JSContext list */
29756|     33|    if (m->link.next) {
  ------------------
  |  Branch (29756:9): [True: 33, False: 0]
  ------------------
29757|     33|        list_del(&m->link);
29758|     33|    }
29759|     33|    remove_gc_object(&m->header);
29760|     33|    if (rt->gc_phase == JS_GC_PHASE_REMOVE_CYCLES && js_rc(m)->ref_count != 0) {
  ------------------
  |  Branch (29760:9): [True: 33, False: 0]
  |  Branch (29760:54): [True: 33, False: 0]
  ------------------
29761|     33|        list_add_tail(&m->header.link, &rt->gc_zero_ref_count_list);
29762|     33|    } else {
29763|      0|        js_free_rt(rt, m);
29764|      0|    }
29765|     33|}
quickjs.c:add_gc_object:
 6542|  7.61k|{
 6543|  7.61k|    js_rc(h)->mark = 0;
 6544|  7.61k|    js_rc(h)->gc_obj_type = type;
 6545|  7.61k|    list_add_tail(&h->link, &rt->gc_obj_list);
 6546|  7.61k|}
quickjs.c:remove_gc_object:
 6549|  7.61k|{
 6550|  7.61k|    list_del(&h->link);
 6551|  7.61k|}
quickjs.c:JS_RunGCInternal:
 6816|     17|{
 6817|     17|    if (remove_weak_objects) {
  ------------------
  |  Branch (6817:9): [True: 6, False: 11]
  ------------------
 6818|       |        /* free the weakly referenced object or symbol structures, delete
 6819|       |           the associated Map/Set entries and queue the finalization
 6820|       |           registry callbacks. */
 6821|      6|        gc_remove_weak_objects(rt);
 6822|      6|    }
 6823|       |    
 6824|       |    /* decrement the reference of the children of each object. mark =
 6825|       |       1 after this pass. */
 6826|     17|    gc_decref(rt);
 6827|       |
 6828|       |    /* keep the GC objects with a non zero refcount and their childs */
 6829|     17|    gc_scan(rt);
 6830|       |
 6831|       |    /* free the GC objects in a cycle */
 6832|     17|    gc_free_cycles(rt);
 6833|     17|}
quickjs.c:gc_remove_weak_objects:
 6511|      6|{
 6512|      6|    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|      6|    rt->gc_phase = JS_GC_PHASE_DECREF; 
 6517|       |        
 6518|      6|    list_for_each(el, &rt->weakref_list) {
  ------------------
  |  |   86|      6|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 0, False: 6]
  |  |  ------------------
  ------------------
 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|      6|    rt->gc_phase = JS_GC_PHASE_NONE;
 6536|       |    /* free the freed objects here. */
 6537|      6|    free_zero_refcount(rt);
 6538|      6|}
quickjs.c:gc_decref:
 6698|     17|{
 6699|     17|    struct list_head *el, *el1;
 6700|     17|    JSGCObjectHeader *p;
 6701|       |
 6702|     17|    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|  8.93k|    list_for_each_safe(el, el1, &rt->gc_obj_list) {
  ------------------
  |  |   89|  8.95k|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 8.93k, False: 17]
  |  |  ------------------
  |  |   90|  8.93k|        el = el1, el1 = el->next)
  ------------------
 6708|  8.93k|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  8.93k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  8.93k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6709|  8.93k|        assert(js_rc(p)->mark == 0);
  ------------------
  |  Branch (6709:9): [True: 0, False: 8.93k]
  |  Branch (6709:9): [True: 8.93k, False: 0]
  ------------------
 6710|  8.93k|        mark_children(rt, p, gc_decref_child);
 6711|  8.93k|        js_rc(p)->mark = 1;
 6712|  8.93k|        if (js_rc(p)->ref_count == 0) {
  ------------------
  |  Branch (6712:13): [True: 4.46k, False: 4.47k]
  ------------------
 6713|  4.46k|            list_del(&p->link);
 6714|  4.46k|            list_add_tail(&p->link, &rt->tmp_obj_list);
 6715|  4.46k|        }
 6716|  8.93k|    }
 6717|     17|}
quickjs.c:mark_children:
 6570|  17.8k|{
 6571|  17.8k|    switch(js_rc(gp)->gc_obj_type) {
 6572|  8.10k|    case JS_GC_OBJ_TYPE_JS_OBJECT:
  ------------------
  |  Branch (6572:5): [True: 8.10k, False: 9.77k]
  ------------------
 6573|  8.10k|        {
 6574|  8.10k|            JSObject *p = (JSObject *)gp;
 6575|  8.10k|            JSShapeProperty *prs;
 6576|  8.10k|            JSShape *sh;
 6577|  8.10k|            int i;
 6578|  8.10k|            sh = p->shape;
 6579|  8.10k|            mark_func(rt, &sh->header);
 6580|       |            /* mark all the fields */
 6581|  8.10k|            prs = get_shape_prop(sh);
 6582|  46.8k|            for(i = 0; i < sh->prop_count; i++) {
  ------------------
  |  Branch (6582:24): [True: 38.7k, False: 8.10k]
  ------------------
 6583|  38.7k|                JSProperty *pr = &p->prop[i];
 6584|  38.7k|                if (prs->atom != JS_ATOM_NULL) {
  ------------------
  |  |  451|  38.7k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (6584:21): [True: 38.7k, False: 2]
  ------------------
 6585|  38.7k|                    if (prs->flags & JS_PROP_TMASK) {
  ------------------
  |  |  303|  38.7k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
  |  Branch (6585:25): [True: 21.1k, False: 17.6k]
  ------------------
 6586|  21.1k|                        if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|  21.1k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                      if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  305|  21.1k|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (6586:29): [True: 1.49k, False: 19.6k]
  ------------------
 6587|  1.49k|                            if (pr->u.getset.getter)
  ------------------
  |  Branch (6587:33): [True: 1.49k, False: 0]
  ------------------
 6588|  1.49k|                                mark_func(rt, &pr->u.getset.getter->header);
 6589|  1.49k|                            if (pr->u.getset.setter)
  ------------------
  |  Branch (6589:33): [True: 170, False: 1.32k]
  ------------------
 6590|    170|                                mark_func(rt, &pr->u.getset.setter->header);
 6591|  19.6k|                        } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  303|  19.6k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                      } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  306|  19.6k|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (6591:36): [True: 5.29k, False: 14.3k]
  ------------------
 6592|       |                            /* Note: the tag does not matter
 6593|       |                               provided it is a GC object */
 6594|  5.29k|                            mark_func(rt, &pr->u.var_ref->header);
 6595|  14.3k|                        } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  303|  14.3k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                      } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  307|  14.3k|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (6595:36): [True: 14.3k, False: 0]
  ------------------
 6596|  14.3k|                            js_autoinit_mark(rt, pr, mark_func);
 6597|  14.3k|                        }
 6598|  21.1k|                    } else {
 6599|  17.6k|                        JS_MarkValue(rt, pr->u.value, mark_func);
 6600|  17.6k|                    }
 6601|  38.7k|                }
 6602|  38.7k|                prs++;
 6603|  38.7k|            }
 6604|       |
 6605|  8.10k|            if (p->class_id != JS_CLASS_OBJECT) {
  ------------------
  |  Branch (6605:17): [True: 6.09k, False: 2.00k]
  ------------------
 6606|  6.09k|                JSClassGCMark *gc_mark;
 6607|  6.09k|                gc_mark = rt->class_array[p->class_id].gc_mark;
 6608|  6.09k|                if (gc_mark)
  ------------------
  |  Branch (6608:21): [True: 5.91k, False: 182]
  ------------------
 6609|  5.91k|                    gc_mark(rt, JS_MKPTR(JS_TAG_OBJECT, p), mark_func);
  ------------------
  |  |  248|  5.91k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6610|  6.09k|            }
 6611|  8.10k|        }
 6612|  8.10k|        break;
 6613|     42|    case JS_GC_OBJ_TYPE_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6613:5): [True: 42, False: 17.8k]
  ------------------
 6614|       |        /* the template objects can be part of a cycle */
 6615|     42|        {
 6616|     42|            JSFunctionBytecode *b = (JSFunctionBytecode *)gp;
 6617|     42|            int i;
 6618|     48|            for(i = 0; i < b->cpool_count; i++) {
  ------------------
  |  Branch (6618:24): [True: 6, False: 42]
  ------------------
 6619|      6|                JS_MarkValue(rt, b->cpool[i], mark_func);
 6620|      6|            }
 6621|     42|            if (b->realm)
  ------------------
  |  Branch (6621:17): [True: 42, False: 0]
  ------------------
 6622|     42|                mark_func(rt, &b->realm->header);
 6623|     42|        }
 6624|     42|        break;
 6625|  5.36k|    case JS_GC_OBJ_TYPE_VAR_REF:
  ------------------
  |  Branch (6625:5): [True: 5.36k, False: 12.5k]
  ------------------
 6626|  5.36k|        {
 6627|  5.36k|            JSVarRef *var_ref = (JSVarRef *)gp;
 6628|  5.36k|            if (var_ref->is_detached) {
  ------------------
  |  Branch (6628:17): [True: 5.36k, False: 0]
  ------------------
 6629|  5.36k|                JS_MarkValue(rt, *var_ref->pvalue, mark_func);
 6630|  5.36k|            } 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|  5.36k|        }
 6638|  5.36k|        break;
 6639|      0|    case JS_GC_OBJ_TYPE_ASYNC_FUNCTION:
  ------------------
  |  Branch (6639:5): [True: 0, False: 17.8k]
  ------------------
 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|  4.23k|    case JS_GC_OBJ_TYPE_SHAPE:
  ------------------
  |  Branch (6662:5): [True: 4.23k, False: 13.6k]
  ------------------
 6663|  4.23k|        {
 6664|  4.23k|            JSShape *sh = (JSShape *)gp;
 6665|  4.23k|            if (sh->proto != NULL) {
  ------------------
  |  Branch (6665:17): [True: 4.06k, False: 170]
  ------------------
 6666|  4.06k|                mark_func(rt, &sh->proto->header);
 6667|  4.06k|            }
 6668|  4.23k|        }
 6669|  4.23k|        break;
 6670|     34|    case JS_GC_OBJ_TYPE_JS_CONTEXT:
  ------------------
  |  Branch (6670:5): [True: 34, False: 17.8k]
  ------------------
 6671|     34|        {
 6672|     34|            JSContext *ctx = (JSContext *)gp;
 6673|     34|            JS_MarkContext(rt, ctx, mark_func);
 6674|     34|        }
 6675|     34|        break;
 6676|    102|    case JS_GC_OBJ_TYPE_MODULE:
  ------------------
  |  Branch (6676:5): [True: 102, False: 17.7k]
  ------------------
 6677|    102|        {
 6678|    102|            JSModuleDef *m = (JSModuleDef *)gp;
 6679|    102|            js_mark_module_def(rt, m, mark_func);
 6680|    102|        }
 6681|    102|        break;
 6682|      0|    default:
  ------------------
  |  Branch (6682:5): [True: 0, False: 17.8k]
  ------------------
 6683|      0|        abort();
 6684|  17.8k|    }
 6685|  17.8k|}
quickjs.c:js_autoinit_mark:
 6093|  14.3k|{
 6094|  14.3k|    mark_func(rt, &js_autoinit_get_realm(pr)->header);
 6095|  14.3k|}
quickjs.c:JS_MarkContext:
 2719|     34|{
 2720|     34|    int i;
 2721|     34|    struct list_head *el;
 2722|       |
 2723|    102|    list_for_each(el, &ctx->loaded_modules) {
  ------------------
  |  |   86|    136|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 102, False: 34]
  |  |  ------------------
  ------------------
 2724|    102|        JSModuleDef *m = list_entry(el, JSModuleDef, link);
  ------------------
  |  |   39|    102|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|    102|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 2725|    102|        JS_MarkValue(rt, JS_MKPTR(JS_TAG_MODULE, m), mark_func);
  ------------------
  |  |  248|    102|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 2726|    102|    }
 2727|       |
 2728|     34|    JS_MarkValue(rt, ctx->global_obj, mark_func);
 2729|     34|    JS_MarkValue(rt, ctx->global_var_obj, mark_func);
 2730|       |
 2731|     34|    JS_MarkValue(rt, ctx->throw_type_error, mark_func);
 2732|     34|    JS_MarkValue(rt, ctx->eval_obj, mark_func);
 2733|       |
 2734|     34|    JS_MarkValue(rt, ctx->array_proto_values, mark_func);
 2735|    306|    for(i = 0; i < JS_NATIVE_ERROR_COUNT; i++) {
  ------------------
  |  Branch (2735:16): [True: 272, False: 34]
  ------------------
 2736|    272|        JS_MarkValue(rt, ctx->native_error_proto[i], mark_func);
 2737|    272|    }
 2738|  3.23k|    for(i = 0; i < rt->class_count; i++) {
  ------------------
  |  Branch (2738:16): [True: 3.19k, False: 34]
  ------------------
 2739|  3.19k|        JS_MarkValue(rt, ctx->class_proto[i], mark_func);
 2740|  3.19k|    }
 2741|     34|    JS_MarkValue(rt, ctx->iterator_ctor, mark_func);
 2742|     34|    JS_MarkValue(rt, ctx->async_iterator_proto, mark_func);
 2743|     34|    JS_MarkValue(rt, ctx->promise_ctor, mark_func);
 2744|     34|    JS_MarkValue(rt, ctx->array_ctor, mark_func);
 2745|     34|    JS_MarkValue(rt, ctx->regexp_ctor, mark_func);
 2746|     34|    JS_MarkValue(rt, ctx->function_ctor, mark_func);
 2747|     34|    JS_MarkValue(rt, ctx->function_proto, mark_func);
 2748|       |
 2749|     34|    if (ctx->array_shape)
  ------------------
  |  Branch (2749:9): [True: 34, False: 0]
  ------------------
 2750|     34|        mark_func(rt, &ctx->array_shape->header);
 2751|       |
 2752|     34|    if (ctx->arguments_shape)
  ------------------
  |  Branch (2752:9): [True: 34, False: 0]
  ------------------
 2753|     34|        mark_func(rt, &ctx->arguments_shape->header);
 2754|       |
 2755|     34|    if (ctx->mapped_arguments_shape)
  ------------------
  |  Branch (2755:9): [True: 34, False: 0]
  ------------------
 2756|     34|        mark_func(rt, &ctx->mapped_arguments_shape->header);
 2757|       |
 2758|     34|    if (ctx->regexp_shape)
  ------------------
  |  Branch (2758:9): [True: 34, False: 0]
  ------------------
 2759|     34|        mark_func(rt, &ctx->regexp_shape->header);
 2760|       |
 2761|     34|    if (ctx->regexp_result_shape)
  ------------------
  |  Branch (2761:9): [True: 34, False: 0]
  ------------------
 2762|     34|        mark_func(rt, &ctx->regexp_result_shape->header);
 2763|     34|}
quickjs.c:js_mark_module_def:
29689|    102|{
29690|    102|    int i;
29691|       |
29692|    170|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (29692:16): [True: 68, False: 102]
  ------------------
29693|     68|        JSReqModuleEntry *rme = &m->req_module_entries[i];
29694|     68|        JS_MarkValue(rt, rme->attributes, mark_func);
29695|     68|    }
29696|       |    
29697|  3.43k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (29697:16): [True: 3.33k, False: 102]
  ------------------
29698|  3.33k|        JSExportEntry *me = &m->export_entries[i];
29699|  3.33k|        if (me->export_type == JS_EXPORT_TYPE_LOCAL &&
  ------------------
  |  Branch (29699:13): [True: 3.33k, False: 0]
  ------------------
29700|  3.33k|            me->u.local.var_ref) {
  ------------------
  |  Branch (29700:13): [True: 3.33k, False: 0]
  ------------------
29701|  3.33k|            mark_func(rt, &me->u.local.var_ref->header);
29702|  3.33k|        }
29703|  3.33k|    }
29704|       |
29705|    102|    JS_MarkValue(rt, m->module_ns, mark_func);
29706|    102|    JS_MarkValue(rt, m->func_obj, mark_func);
29707|    102|    JS_MarkValue(rt, m->eval_exception, mark_func);
29708|    102|    JS_MarkValue(rt, m->meta_obj, mark_func);
29709|    102|    JS_MarkValue(rt, m->promise, mark_func);
29710|    102|    JS_MarkValue(rt, m->resolving_funcs[0], mark_func);
29711|    102|    JS_MarkValue(rt, m->resolving_funcs[1], mark_func);
29712|    102|    JS_MarkValue(rt, m->private_value, mark_func);
29713|    102|}
quickjs.c:gc_decref_child:
 6688|  26.6k|{
 6689|  26.6k|    assert(js_rc(p)->ref_count > 0);
  ------------------
  |  Branch (6689:5): [True: 0, False: 26.6k]
  |  Branch (6689:5): [True: 26.6k, False: 0]
  ------------------
 6690|  26.6k|    js_rc(p)->ref_count--;
 6691|  26.6k|    if (js_rc(p)->ref_count == 0 && js_rc(p)->mark == 1) {
  ------------------
  |  Branch (6691:9): [True: 8.91k, False: 17.7k]
  |  Branch (6691:37): [True: 4.45k, False: 4.46k]
  ------------------
 6692|  4.45k|        list_del(&p->link);
 6693|  4.45k|        list_add_tail(&p->link, &rt->tmp_obj_list);
 6694|  4.45k|    }
 6695|  26.6k|}
quickjs.c:gc_scan:
 6737|     17|{
 6738|     17|    struct list_head *el;
 6739|     17|    JSGCObjectHeader *p;
 6740|       |
 6741|       |    /* keep the objects with a refcount > 0 and their children. */
 6742|  3.16k|    list_for_each(el, &rt->gc_obj_list) {
  ------------------
  |  |   86|  3.18k|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 3.16k, False: 17]
  |  |  ------------------
  ------------------
 6743|  3.16k|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  3.16k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  3.16k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6744|  3.16k|        assert(js_rc(p)->ref_count > 0);
  ------------------
  |  Branch (6744:9): [True: 0, False: 3.16k]
  |  Branch (6744:9): [True: 3.16k, False: 0]
  ------------------
 6745|  3.16k|        js_rc(p)->mark = 0; /* reset the mark for the next GC call */
 6746|  3.16k|        mark_children(rt, p, gc_scan_incref_child);
 6747|  3.16k|    }
 6748|       |
 6749|       |    /* restore the refcount of the objects to be deleted. */
 6750|  5.77k|    list_for_each(el, &rt->tmp_obj_list) {
  ------------------
  |  |   86|  5.78k|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 5.77k, False: 17]
  |  |  ------------------
  ------------------
 6751|       |        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  5.77k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  5.77k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6752|  5.77k|        mark_children(rt, p, gc_scan_incref_child2);
 6753|  5.77k|    }
 6754|     17|}
quickjs.c:gc_scan_incref_child:
 6720|  9.43k|{
 6721|  9.43k|    js_rc(p)->ref_count++;
 6722|  9.43k|    if (js_rc(p)->ref_count == 1) {
  ------------------
  |  Branch (6722:9): [True: 3.14k, False: 6.28k]
  ------------------
 6723|       |        /* ref_count was 0: remove from tmp_obj_list and add at the
 6724|       |           end of gc_obj_list */
 6725|  3.14k|        list_del(&p->link);
 6726|  3.14k|        list_add_tail(&p->link, &rt->gc_obj_list);
 6727|  3.14k|        js_rc(p)->mark = 0; /* reset the mark for the next GC call */
 6728|  3.14k|    }
 6729|  9.43k|}
quickjs.c:gc_scan_incref_child2:
 6732|  17.2k|{
 6733|  17.2k|    js_rc(p)->ref_count++;
 6734|  17.2k|}
quickjs.c:gc_free_cycles:
 6757|     17|{
 6758|     17|    struct list_head *el, *el1;
 6759|     17|    JSGCObjectHeader *p;
 6760|       |#ifdef DUMP_GC_FREE
 6761|       |    BOOL header_done = FALSE;
 6762|       |#endif
 6763|       |
 6764|     17|    rt->gc_phase = JS_GC_PHASE_REMOVE_CYCLES;
 6765|       |
 6766|  5.07k|    for(;;) {
 6767|  5.07k|        el = rt->tmp_obj_list.next;
 6768|  5.07k|        if (el == &rt->tmp_obj_list)
  ------------------
  |  Branch (6768:13): [True: 17, False: 5.05k]
  ------------------
 6769|     17|            break;
 6770|  5.05k|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  5.05k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  5.05k|#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|  5.05k|        switch(js_rc(p)->gc_obj_type) {
 6775|  2.61k|        case JS_GC_OBJ_TYPE_JS_OBJECT:
  ------------------
  |  Branch (6775:9): [True: 2.61k, False: 2.44k]
  ------------------
 6776|  2.62k|        case JS_GC_OBJ_TYPE_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6776:9): [True: 12, False: 5.04k]
  ------------------
 6777|  2.62k|        case JS_GC_OBJ_TYPE_ASYNC_FUNCTION:
  ------------------
  |  Branch (6777:9): [True: 0, False: 5.05k]
  ------------------
 6778|  2.66k|        case JS_GC_OBJ_TYPE_MODULE:
  ------------------
  |  Branch (6778:9): [True: 33, False: 5.02k]
  ------------------
 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|  2.66k|            free_gc_object(rt, p);
 6788|  2.66k|            break;
 6789|  2.39k|        default:
  ------------------
  |  Branch (6789:9): [True: 2.39k, False: 2.66k]
  ------------------
 6790|  2.39k|            list_del(&p->link);
 6791|  2.39k|            list_add_tail(&p->link, &rt->gc_zero_ref_count_list);
 6792|  2.39k|            break;
 6793|  5.05k|        }
 6794|  5.05k|    }
 6795|     17|    rt->gc_phase = JS_GC_PHASE_NONE;
 6796|       |
 6797|  2.09k|    list_for_each_safe(el, el1, &rt->gc_zero_ref_count_list) {
  ------------------
  |  |   89|  2.11k|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 2.09k, False: 17]
  |  |  ------------------
  |  |   90|  2.09k|        el = el1, el1 = el->next)
  ------------------
 6798|  2.09k|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  2.09k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  2.09k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6799|  2.09k|        assert(js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_JS_OBJECT ||
  ------------------
  |  Branch (6799:9): [True: 2.09k, 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: 2.05k, False: 41]
  |  Branch (6799:9): [True: 8, False: 33]
  |  Branch (6799:9): [True: 0, False: 33]
  |  Branch (6799:9): [True: 33, False: 0]
  ------------------
 6800|  2.09k|               js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_FUNCTION_BYTECODE ||
 6801|  2.09k|               js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_ASYNC_FUNCTION ||
 6802|  2.09k|               js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_MODULE);
 6803|  2.09k|        if (js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_JS_OBJECT &&
  ------------------
  |  Branch (6803:13): [True: 2.05k, False: 41]
  ------------------
 6804|  2.05k|            ((JSObject *)p)->weakref_count != 0) {
  ------------------
  |  Branch (6804:13): [True: 0, False: 2.05k]
  ------------------
 6805|       |            /* keep the object because there are weak references to it */
 6806|      0|            js_rc(p)->mark = 0;
 6807|  2.09k|        } else {
 6808|  2.09k|            js_free_rt(rt, p);
 6809|  2.09k|        }
 6810|  2.09k|    }
 6811|       |
 6812|     17|    init_list_head(&rt->gc_zero_ref_count_list);
 6813|     17|}
quickjs.c:get_shape_size:
 5122|  3.09k|{
 5123|  3.09k|    return sizeof(JSShape) + hash_size * sizeof(uint32_t) +
 5124|  3.09k|        prop_size * sizeof(JSShapeProperty);
 5125|  3.09k|}
quickjs.c:get_shape_prop:
 5128|   385k|{
 5129|   385k|    return (JSShapeProperty *)((uint32_t *)(sh + 1) + sh->prop_hash_mask + 1);
 5130|   385k|}
quickjs.c:JS_AtomGetStrRT:
 3546|    270|{
 3547|    270|    if (__JS_AtomIsTaggedInt(atom)) {
  ------------------
  |  Branch (3547:9): [True: 0, False: 270]
  ------------------
 3548|      0|        snprintf(buf, buf_size, "%u", __JS_AtomToUInt32(atom));
 3549|    270|    } else {
 3550|    270|        JSAtomStruct *p;
 3551|    270|        assert(atom < rt->atom_size);
  ------------------
  |  Branch (3551:9): [True: 0, False: 270]
  |  Branch (3551:9): [True: 270, False: 0]
  ------------------
 3552|    270|        if (atom == JS_ATOM_NULL) {
  ------------------
  |  |  451|    270|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (3552:13): [True: 0, False: 270]
  ------------------
 3553|      0|            snprintf(buf, buf_size, "<null>");
 3554|    270|        } else {
 3555|    270|            int i, c;
 3556|    270|            char *q;
 3557|    270|            JSString *str;
 3558|       |
 3559|    270|            q = buf;
 3560|    270|            p = rt->atom_array[atom];
 3561|    270|            assert(!atom_is_free(p));
  ------------------
  |  Branch (3561:13): [True: 0, False: 270]
  |  Branch (3561:13): [True: 270, False: 0]
  ------------------
 3562|    270|            str = p;
 3563|    270|            if (str) {
  ------------------
  |  Branch (3563:17): [True: 270, False: 0]
  ------------------
 3564|    270|                if (!str->is_wide_char) {
  ------------------
  |  Branch (3564:21): [True: 269, False: 1]
  ------------------
 3565|       |                    /* special case ASCII strings */
 3566|    269|                    c = 0;
 3567|  3.02k|                    for(i = 0; i < str->len; i++) {
  ------------------
  |  Branch (3567:32): [True: 2.75k, False: 269]
  ------------------
 3568|  2.75k|                        c |= str->u.str8[i];
 3569|  2.75k|                    }
 3570|    269|                    if (c < 0x80)
  ------------------
  |  Branch (3570:25): [True: 269, False: 0]
  ------------------
 3571|    269|                        return (const char *)str->u.str8;
 3572|    269|                }
 3573|     59|                for(i = 0; i < str->len; i++) {
  ------------------
  |  Branch (3573:28): [True: 59, False: 0]
  ------------------
 3574|     59|                    c = string_get(str, i);
 3575|     59|                    if ((q - buf) >= buf_size - UTF8_CHAR_LEN_MAX)
  ------------------
  |  |  330|     59|#define UTF8_CHAR_LEN_MAX 6
  ------------------
  |  Branch (3575:25): [True: 1, False: 58]
  ------------------
 3576|      1|                        break;
 3577|     58|                    if (c < 128) {
  ------------------
  |  Branch (3577:25): [True: 58, False: 0]
  ------------------
 3578|     58|                        *q++ = c;
 3579|     58|                    } else {
 3580|      0|                        q += unicode_to_utf8((uint8_t *)q, c);
 3581|      0|                    }
 3582|     58|                }
 3583|      1|            }
 3584|      1|            *q = '\0';
 3585|      1|        }
 3586|    270|    }
 3587|      1|    return buf;
 3588|    270|}
quickjs.c:JS_ThrowError:
 7664|     17|{
 7665|     17|    JSRuntime *rt = ctx->rt;
 7666|     17|    JSStackFrame *sf;
 7667|     17|    BOOL add_backtrace;
 7668|       |
 7669|       |    /* the backtrace is added later if called from a bytecode function */
 7670|     17|    sf = rt->current_stack_frame;
 7671|     17|    add_backtrace = !rt->in_out_of_memory &&
  ------------------
  |  Branch (7671:21): [True: 17, False: 0]
  ------------------
 7672|     17|        (!sf || (JS_GetFunctionBytecode(sf->cur_func) == NULL));
  ------------------
  |  Branch (7672:10): [True: 11, False: 6]
  |  Branch (7672:17): [True: 0, False: 6]
  ------------------
 7673|     17|    return JS_ThrowError2(ctx, error_num, fmt, ap, add_backtrace);
 7674|     17|}
quickjs.c:JS_GetFunctionBytecode:
 5873|      6|{
 5874|      6|    JSObject *p;
 5875|      6|    if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      6|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5875:9): [True: 0, False: 6]
  ------------------
 5876|      0|        return NULL;
 5877|      6|    p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
 5878|      6|    if (!js_class_has_bytecode(p->class_id))
  ------------------
  |  Branch (5878:9): [True: 0, False: 6]
  ------------------
 5879|      0|        return NULL;
 5880|      6|    return p->u.func.function_bytecode;
 5881|      6|}
quickjs.c:JS_ThrowError2:
 7640|     21|{
 7641|     21|    char buf[256];
 7642|     21|    JSValue obj, ret;
 7643|       |
 7644|     21|    vsnprintf(buf, sizeof(buf), fmt, ap);
 7645|     21|    obj = JS_NewObjectProtoClass(ctx, ctx->native_error_proto[error_num],
 7646|     21|                                 JS_CLASS_ERROR);
 7647|     21|    if (unlikely(JS_IsException(obj))) {
  ------------------
  |  |   33|     21|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 21]
  |  |  ------------------
  ------------------
 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|     21|    } else {
 7651|     21|        JS_DefinePropertyValue(ctx, obj, JS_ATOM_message,
 7652|     21|                               JS_NewString(ctx, buf),
 7653|     21|                               JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  299|     21|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                             JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|     21|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7654|     21|        if (add_backtrace) {
  ------------------
  |  Branch (7654:13): [True: 11, False: 10]
  ------------------
 7655|       |            build_backtrace(ctx, obj, NULL, 0, 0, 0);
 7656|     11|        }
 7657|     21|    }
 7658|     21|    ret = JS_Throw(ctx, obj);
 7659|     21|    return ret;
 7660|     21|}
quickjs.c:build_backtrace:
 7541|     21|{
 7542|     21|    JSStackFrame *sf;
 7543|     21|    JSValue str;
 7544|     21|    DynBuf dbuf;
 7545|     21|    const char *func_name_str;
 7546|     21|    const char *str1;
 7547|     21|    JSObject *p;
 7548|       |
 7549|     21|    if (!JS_IsObject(error_obj))
  ------------------
  |  Branch (7549:9): [True: 0, False: 21]
  ------------------
 7550|      0|        return; /* protection in the out of memory case */
 7551|       |    
 7552|     21|    js_dbuf_init(ctx, &dbuf);
 7553|     21|    if (filename) {
  ------------------
  |  Branch (7553:9): [True: 4, False: 17]
  ------------------
 7554|      4|        dbuf_printf(&dbuf, "    at %s", filename);
 7555|      4|        if (line_num != -1)
  ------------------
  |  Branch (7555:13): [True: 4, False: 0]
  ------------------
 7556|      4|            dbuf_printf(&dbuf, ":%d:%d", line_num, col_num);
 7557|      4|        dbuf_putc(&dbuf, '\n');
 7558|      4|        str = JS_NewString(ctx, filename);
 7559|      4|        if (JS_IsException(str))
  ------------------
  |  Branch (7559:13): [True: 0, False: 4]
  ------------------
 7560|      0|            return;
 7561|       |        /* Note: SpiderMonkey does that, could update once there is a standard */
 7562|      4|        if (JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_fileName, str,
  ------------------
  |  Branch (7562:13): [True: 0, False: 4]
  ------------------
 7563|      4|                                   JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0 ||
  ------------------
  |  |  299|      4|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                 JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0 ||
  ------------------
  |  |  298|      4|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7564|      4|            JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_lineNumber, JS_NewInt32(ctx, line_num),
  ------------------
  |  Branch (7564:13): [True: 0, False: 4]
  ------------------
 7565|      4|                                   JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0 ||
  ------------------
  |  |  299|      4|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                 JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0 ||
  ------------------
  |  |  298|      4|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7566|      4|            JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_columnNumber, JS_NewInt32(ctx, col_num),
  ------------------
  |  Branch (7566:13): [True: 0, False: 4]
  ------------------
 7567|      4|                                   JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  299|      4|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                 JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  298|      4|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7568|      0|            return;
 7569|      0|        }
 7570|      4|    }
 7571|     28|    for(sf = ctx->rt->current_stack_frame; sf != NULL; sf = sf->prev_frame) {
  ------------------
  |  Branch (7571:44): [True: 7, False: 21]
  ------------------
 7572|      7|        if (sf->js_mode & JS_MODE_BACKTRACE_BARRIER)
  ------------------
  |  |  405|      7|#define JS_MODE_BACKTRACE_BARRIER (1 << 3) /* stop backtrace before this frame */
  ------------------
  |  Branch (7572:13): [True: 0, False: 7]
  ------------------
 7573|      0|            break;
 7574|      7|        if (backtrace_flags & JS_BACKTRACE_FLAG_SKIP_FIRST_LEVEL) {
  ------------------
  |  | 7534|      7|#define JS_BACKTRACE_FLAG_SKIP_FIRST_LEVEL (1 << 0)
  ------------------
  |  Branch (7574:13): [True: 0, False: 7]
  ------------------
 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|      7|        func_name_str = get_prop_string(ctx, sf->cur_func, JS_ATOM_name);
 7579|      7|        if (!func_name_str || func_name_str[0] == '\0')
  ------------------
  |  Branch (7579:13): [True: 0, False: 7]
  |  Branch (7579:31): [True: 0, False: 7]
  ------------------
 7580|      0|            str1 = "<anonymous>";
 7581|      7|        else
 7582|      7|            str1 = func_name_str;
 7583|      7|        dbuf_printf(&dbuf, "    at %s", str1);
 7584|      7|        JS_FreeCString(ctx, func_name_str);
 7585|       |
 7586|      7|        p = JS_VALUE_GET_OBJ(sf->cur_func);
  ------------------
  |  |  229|      7|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      7|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 7587|      7|        if (js_class_has_bytecode(p->class_id)) {
  ------------------
  |  Branch (7587:13): [True: 7, False: 0]
  ------------------
 7588|      7|            JSFunctionBytecode *b;
 7589|      7|            const char *atom_str;
 7590|      7|            int line_num1, col_num1;
 7591|       |
 7592|      7|            b = p->u.func.function_bytecode;
 7593|      7|            if (b->has_debug) {
  ------------------
  |  Branch (7593:17): [True: 7, False: 0]
  ------------------
 7594|      7|                line_num1 = find_line_num(ctx, b,
 7595|      7|                                          sf->cur_pc - b->byte_code_buf - 1, &col_num1);
 7596|      7|                atom_str = JS_AtomToCString(ctx, b->debug.filename);
 7597|      7|                dbuf_printf(&dbuf, " (%s",
 7598|      7|                            atom_str ? atom_str : "<null>");
  ------------------
  |  Branch (7598:29): [True: 7, False: 0]
  ------------------
 7599|      7|                JS_FreeCString(ctx, atom_str);
 7600|      7|                if (line_num1 != 0)
  ------------------
  |  Branch (7600:21): [True: 7, False: 0]
  ------------------
 7601|      7|                    dbuf_printf(&dbuf, ":%d:%d", line_num1, col_num1);
 7602|      7|                dbuf_putc(&dbuf, ')');
 7603|      7|            }
 7604|      7|        } else {
 7605|      0|            dbuf_printf(&dbuf, " (native)");
 7606|      0|        }
 7607|      7|        dbuf_putc(&dbuf, '\n');
 7608|      7|    }
 7609|     21|    dbuf_putc(&dbuf, '\0');
 7610|     21|    if (dbuf_error(&dbuf))
  ------------------
  |  Branch (7610:9): [True: 0, False: 21]
  ------------------
 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|     21|    else
 7613|     21|        str = JS_NewString(ctx, (char *)dbuf.buf);
 7614|     21|    dbuf_free(&dbuf);
 7615|     21|    JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_stack, str,
 7616|     21|                           JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  299|     21|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|     21|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7617|     21|}
quickjs.c:get_prop_string:
 7505|      7|{
 7506|      7|    JSObject *p;
 7507|      7|    JSProperty *pr;
 7508|      7|    JSShapeProperty *prs;
 7509|      7|    JSValueConst val;
  ------------------
  |  |  234|      7|#define JSValueConst JSValue
  ------------------
 7510|       |
 7511|      7|    if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      7|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (7511:9): [True: 0, False: 7]
  ------------------
 7512|      0|        return NULL;
 7513|      7|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|      7|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      7|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 7514|      7|    prs = find_own_property(&pr, p, prop);
 7515|      7|    if (!prs) {
  ------------------
  |  Branch (7515:9): [True: 0, False: 7]
  ------------------
 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|      7|    if ((prs->flags & JS_PROP_TMASK) != JS_PROP_NORMAL)
  ------------------
  |  |  303|      7|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                  if ((prs->flags & JS_PROP_TMASK) != JS_PROP_NORMAL)
  ------------------
  |  |  304|      7|#define JS_PROP_NORMAL         (0 << 4)
  ------------------
  |  Branch (7526:9): [True: 0, False: 7]
  ------------------
 7527|      0|        return NULL;
 7528|      7|    val = pr->u.value;
 7529|      7|    if (JS_VALUE_GET_TAG(val) != JS_TAG_STRING)
  ------------------
  |  |  236|      7|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (7529:9): [True: 0, False: 7]
  ------------------
 7530|      0|        return NULL;
 7531|      7|    return JS_ToCString(ctx, val);
 7532|      7|}
quickjs.c:find_line_num:
 7437|      7|{
 7438|      7|    const uint8_t *p_end, *p;
 7439|      7|    int new_line_num, line_num, pc, v, ret, new_col_num, col_num;
 7440|      7|    uint32_t val;
 7441|      7|    unsigned int op;
 7442|       |
 7443|      7|    if (!b->has_debug || !b->debug.pc2line_buf)
  ------------------
  |  Branch (7443:9): [True: 0, False: 7]
  |  Branch (7443:26): [True: 0, False: 7]
  ------------------
 7444|      0|        goto fail; /* function was stripped */
 7445|       |
 7446|      7|    p = b->debug.pc2line_buf;
 7447|      7|    p_end = p + b->debug.pc2line_len;
 7448|       |
 7449|       |    /* get the function line and column numbers */
 7450|      7|    ret = get_leb128(&val, p, p_end);
 7451|      7|    if (ret < 0)
  ------------------
  |  Branch (7451:9): [True: 0, False: 7]
  ------------------
 7452|      0|        goto fail;
 7453|      7|    p += ret;
 7454|      7|    line_num = val + 1;
 7455|       |
 7456|      7|    ret = get_leb128(&val, p, p_end);
 7457|      7|    if (ret < 0)
  ------------------
  |  Branch (7457:9): [True: 0, False: 7]
  ------------------
 7458|      0|        goto fail;
 7459|      7|    p += ret;
 7460|      7|    col_num = val + 1;
 7461|       |
 7462|      7|    if (pc_value != -1) {
  ------------------
  |  Branch (7462:9): [True: 7, False: 0]
  ------------------
 7463|      7|        pc = 0;
 7464|     29|        while (p < p_end) {
  ------------------
  |  Branch (7464:16): [True: 25, False: 4]
  ------------------
 7465|     25|            op = *p++;
 7466|     25|            if (op == 0) {
  ------------------
  |  Branch (7466:17): [True: 6, False: 19]
  ------------------
 7467|      6|                ret = get_leb128(&val, p, p_end);
 7468|      6|                if (ret < 0)
  ------------------
  |  Branch (7468:21): [True: 0, False: 6]
  ------------------
 7469|      0|                    goto fail;
 7470|      6|                pc += val;
 7471|      6|                p += ret;
 7472|      6|                ret = get_sleb128(&v, p, p_end);
 7473|      6|                if (ret < 0)
  ------------------
  |  Branch (7473:21): [True: 0, False: 6]
  ------------------
 7474|      0|                    goto fail;
 7475|      6|                p += ret;
 7476|      6|                new_line_num = line_num + v;
 7477|     19|            } else {
 7478|     19|                op -= PC2LINE_OP_FIRST;
  ------------------
  |  |  675|     19|#define PC2LINE_OP_FIRST 1
  ------------------
 7479|     19|                pc += (op / PC2LINE_RANGE);
  ------------------
  |  |  674|     19|#define PC2LINE_RANGE    5
  ------------------
 7480|     19|                new_line_num = line_num + (op % PC2LINE_RANGE) + PC2LINE_BASE;
  ------------------
  |  |  674|     19|#define PC2LINE_RANGE    5
  ------------------
                              new_line_num = line_num + (op % PC2LINE_RANGE) + PC2LINE_BASE;
  ------------------
  |  |  673|     19|#define PC2LINE_BASE     (-1)
  ------------------
 7481|     19|            }
 7482|     25|            ret = get_sleb128(&v, p, p_end);
 7483|     25|            if (ret < 0)
  ------------------
  |  Branch (7483:17): [True: 0, False: 25]
  ------------------
 7484|      0|                goto fail;
 7485|     25|            p += ret;
 7486|     25|            new_col_num = col_num + v;
 7487|       |            
 7488|     25|            if (pc_value < pc)
  ------------------
  |  Branch (7488:17): [True: 3, False: 22]
  ------------------
 7489|      3|                goto done;
 7490|     22|            line_num = new_line_num;
 7491|     22|            col_num = new_col_num;
 7492|     22|        }
 7493|      7|    }
 7494|      7| done:
 7495|      7|    *pcol_num = col_num;
 7496|      7|    return line_num;
 7497|      0| fail:
 7498|      0|    *pcol_num = 0;
 7499|      0|    return 0;
 7500|      7|}
quickjs.c:get_leb128:
 7402|     51|{
 7403|     51|    const uint8_t *ptr = buf;
 7404|     51|    uint32_t v, a, i;
 7405|     51|    v = 0;
 7406|     61|    for(i = 0; i < 5; i++) {
  ------------------
  |  Branch (7406:16): [True: 61, False: 0]
  ------------------
 7407|     61|        if (unlikely(ptr >= buf_end))
  ------------------
  |  |   33|     61|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 61]
  |  |  ------------------
  ------------------
 7408|      0|            break;
 7409|     61|        a = *ptr++;
 7410|     61|        v |= (a & 0x7f) << (i * 7);
 7411|     61|        if (!(a & 0x80)) {
  ------------------
  |  Branch (7411:13): [True: 51, False: 10]
  ------------------
 7412|     51|            *pval = v;
 7413|     51|            return ptr - buf;
 7414|     51|        }
 7415|     61|    }
 7416|      0|    *pval = 0;
 7417|      0|    return -1;
 7418|     51|}
quickjs.c:get_sleb128:
 7422|     31|{
 7423|     31|    int ret;
 7424|     31|    uint32_t val;
 7425|     31|    ret = get_leb128(&val, buf, buf_end);
 7426|     31|    if (ret < 0) {
  ------------------
  |  Branch (7426:9): [True: 0, False: 31]
  ------------------
 7427|      0|        *pval = 0;
 7428|      0|        return -1;
 7429|      0|    }
 7430|     31|    *pval = (val >> 1) ^ -(val & 1);
 7431|     31|    return ret;
 7432|     31|}
quickjs.c:JS_GetPrototypePrimitive:
 7996|      1|{
 7997|      1|    switch(JS_VALUE_GET_NORM_TAG(val)) {
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
 7998|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (7998:5): [True: 0, False: 1]
  ------------------
 7999|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (7999:5): [True: 0, False: 1]
  ------------------
 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: 1]
  ------------------
 8003|      0|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (8003:5): [True: 0, False: 1]
  ------------------
 8004|      0|        val = ctx->class_proto[JS_CLASS_NUMBER];
 8005|      0|        break;
 8006|      0|    case JS_TAG_BOOL:
  ------------------
  |  Branch (8006:5): [True: 0, False: 1]
  ------------------
 8007|      0|        val = ctx->class_proto[JS_CLASS_BOOLEAN];
 8008|      0|        break;
 8009|      1|    case JS_TAG_STRING:
  ------------------
  |  Branch (8009:5): [True: 1, False: 0]
  ------------------
 8010|      1|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (8010:5): [True: 0, False: 1]
  ------------------
 8011|      1|        val = ctx->class_proto[JS_CLASS_STRING];
 8012|      1|        break;
 8013|      0|    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (8013:5): [True: 0, False: 1]
  ------------------
 8014|      0|        val = ctx->class_proto[JS_CLASS_SYMBOL];
 8015|      0|        break;
 8016|      0|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (8016:5): [True: 0, False: 1]
  ------------------
 8017|      0|    case JS_TAG_NULL:
  ------------------
  |  Branch (8017:5): [True: 0, False: 1]
  ------------------
 8018|      0|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (8018:5): [True: 0, False: 1]
  ------------------
 8019|      0|    default:
  ------------------
  |  Branch (8019:5): [True: 0, False: 1]
  ------------------
 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|      1|    }
 8023|      1|    return val;
 8024|      1|}
quickjs.c:JS_GetPrototypeFree:
 8051|      3|{
 8052|      3|    JSValue obj1;
 8053|      3|    obj1 = JS_GetPrototype(ctx, obj);
 8054|      3|    JS_FreeValue(ctx, obj);
 8055|      3|    return obj1;
 8056|      3|}
quickjs.c:js_poll_interrupts:
 7878|    116|{
 7879|    116|    if (unlikely(--ctx->interrupt_counter <= 0)) {
  ------------------
  |  |   33|    116|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 11, False: 105]
  |  |  ------------------
  ------------------
 7880|     11|        return __js_poll_interrupts(ctx);
 7881|    105|    } else {
 7882|    105|        return 0;
 7883|    105|    }
 7884|    116|}
quickjs.c:__js_poll_interrupts:
 7865|     11|{
 7866|     11|    JSRuntime *rt = ctx->rt;
 7867|     11|    ctx->interrupt_counter = JS_INTERRUPT_COUNTER_INIT;
  ------------------
  |  |  512|     11|#define JS_INTERRUPT_COUNTER_INIT 10000
  ------------------
 7868|     11|    if (rt->interrupt_handler) {
  ------------------
  |  Branch (7868:9): [True: 11, False: 0]
  ------------------
 7869|     11|        if (rt->interrupt_handler(rt, rt->interrupt_opaque)) {
  ------------------
  |  Branch (7869:13): [True: 0, False: 11]
  ------------------
 7870|      0|            JS_ThrowInterrupted(ctx);
 7871|      0|            return -1;
 7872|      0|        }
 7873|     11|    }
 7874|     11|    return 0;
 7875|     11|}
quickjs.c:__JS_AtomIsTaggedInt:
 2887|   504k|{
 2888|   504k|    return (v & JS_ATOM_TAG_INT) != 0;
  ------------------
  |  | 2870|   504k|#define JS_ATOM_TAG_INT (1U << 31)
  ------------------
 2889|   504k|}
quickjs.c:__JS_AtomToUInt32:
 2897|   343k|{
 2898|   343k|    return atom & ~JS_ATOM_TAG_INT;
  ------------------
  |  | 2870|   343k|#define JS_ATOM_TAG_INT (1U << 31)
  ------------------
 2899|   343k|}
quickjs.c:js_new_string16_len:
 3944|    625|{
 3945|    625|    JSString *str;
 3946|    625|    str = js_alloc_string(ctx, len, 1);
 3947|    625|    if (!str)
  ------------------
  |  Branch (3947:9): [True: 0, False: 625]
  ------------------
 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|    625|    memcpy(str->u.str16, buf, len * 2);
 3950|    625|    return JS_MKPTR(JS_TAG_STRING, str);
  ------------------
  |  |  248|    625|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3951|    625|}
quickjs.c:string_get:
 1961|  1.45M|static inline int string_get(const JSString *p, int idx) {
 1962|  1.45M|    return p->is_wide_char ? p->u.str16[idx] : p->u.str8[idx];
  ------------------
  |  Branch (1962:12): [True: 1.07M, False: 385k]
  ------------------
 1963|  1.45M|}
quickjs.c:find_own_property:
 6138|   184k|{
 6139|   184k|    JSShape *sh;
 6140|   184k|    JSShapeProperty *pr, *prop;
 6141|   184k|    intptr_t h;
 6142|   184k|    sh = p->shape;
 6143|   184k|    h = (uintptr_t)atom & sh->prop_hash_mask;
 6144|   184k|    h = sh->hash_table[h];
 6145|   184k|    prop = get_shape_prop(sh);
 6146|   231k|    while (h) {
  ------------------
  |  Branch (6146:12): [True: 47.0k, False: 184k]
  ------------------
 6147|  47.0k|        pr = &prop[h - 1];
 6148|  47.0k|        if (likely(pr->atom == atom)) {
  ------------------
  |  |   32|  47.0k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 717, False: 46.3k]
  |  |  ------------------
  ------------------
 6149|    717|            *ppr = &p->prop[h - 1];
 6150|       |            /* the compiler should be able to assume that pr != NULL here */
 6151|    717|            return pr;
 6152|    717|        }
 6153|  46.3k|        h = pr->hash_next;
 6154|  46.3k|    }
 6155|   184k|    *ppr = NULL;
 6156|       |    return NULL;
 6157|   184k|}
quickjs.c:JS_AutoInitProperty:
 8169|    128|{
 8170|    128|    JSValue val;
 8171|    128|    JSContext *realm;
 8172|    128|    JSAutoInitFunc *func;
 8173|    128|    JSAutoInitIDEnum id;
 8174|       |    
 8175|    128|    if (js_shape_prepare_update(ctx, p, &prs))
  ------------------
  |  Branch (8175:9): [True: 0, False: 128]
  ------------------
 8176|      0|        return -1;
 8177|       |
 8178|    128|    realm = js_autoinit_get_realm(pr);
 8179|    128|    id = js_autoinit_get_id(pr);
 8180|    128|    func = js_autoinit_func_table[id];
 8181|       |    /* 'func' shall not modify the object properties 'pr' */
 8182|    128|    val = func(realm, p, prop, pr->u.init.opaque);
 8183|    128|    js_autoinit_free(ctx->rt, pr);
 8184|    128|    prs->flags &= ~JS_PROP_TMASK;
  ------------------
  |  |  303|    128|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
 8185|    128|    pr->u.value = JS_UNDEFINED;
  ------------------
  |  |  291|    128|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|    128|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8186|    128|    if (JS_IsException(val))
  ------------------
  |  Branch (8186:9): [True: 0, False: 128]
  ------------------
 8187|      0|        return -1;
 8188|    128|    if (id == JS_AUTOINIT_ID_MODULE_NS &&
  ------------------
  |  Branch (8188:9): [True: 0, False: 128]
  ------------------
 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|    128|    } else if (p->class_id == JS_CLASS_GLOBAL_OBJECT) {
  ------------------
  |  Branch (8194:16): [True: 34, False: 94]
  ------------------
 8195|     34|        JSVarRef *var_ref;
 8196|       |        /* in the global object we use references */
 8197|     34|        var_ref = js_create_var_ref(ctx, FALSE);
 8198|     34|        if (!var_ref)
  ------------------
  |  Branch (8198:13): [True: 0, False: 34]
  ------------------
 8199|      0|            return -1;
 8200|     34|        prs->flags |= JS_PROP_VARREF;
  ------------------
  |  |  306|     34|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
 8201|     34|        pr->u.var_ref = var_ref;
 8202|     34|        var_ref->value = val; 
 8203|     34|        var_ref->is_const = !(prs->flags & JS_PROP_WRITABLE);
  ------------------
  |  |  299|     34|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
 8204|     94|    } else {
 8205|     94|        pr->u.value = val;
 8206|     94|    }
 8207|    128|    return 0;
 8208|    128|}
quickjs.c:js_autoinit_get_id:
 6082|    128|{
 6083|    128|    return pr->u.init.realm_and_id & 3;
 6084|    128|}
quickjs.c:set_cycle_flag:
 6161|  1.05k|{
 6162|  1.05k|}
quickjs.c:js_resize_array:
 1928|  2.65k|{
 1929|  2.65k|    if (unlikely(req_size > *psize))
  ------------------
  |  |   33|  2.65k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 687, False: 1.96k]
  |  |  ------------------
  ------------------
 1930|    687|        return js_realloc_array(ctx, parray, elem_size, psize, req_size);
 1931|  1.96k|    else
 1932|  1.96k|        return 0;
 1933|  2.65k|}
quickjs.c:js_realloc_array:
 1910|    687|{
 1911|    687|    int new_size;
 1912|    687|    size_t slack;
 1913|    687|    void *new_array;
 1914|       |    /* XXX: potential arithmetic overflow */
 1915|    687|    new_size = max_int(req_size, *psize * 3 / 2);
 1916|    687|    new_array = js_realloc2(ctx, *parray, new_size * elem_size, &slack);
 1917|    687|    if (!new_array)
  ------------------
  |  Branch (1917:9): [True: 0, False: 687]
  ------------------
 1918|      0|        return -1;
 1919|    687|    new_size += slack / elem_size;
 1920|    687|    *psize = new_size;
 1921|    687|    *parray = new_array;
 1922|    687|    return 0;
 1923|    687|}
quickjs.c:JS_InstantiateFunctionListItem2:
39571|    128|{
39572|    128|    const JSCFunctionListEntry *e = opaque;
39573|    128|    JSValue val, proto;
39574|       |
39575|    128|    switch(e->def_type) {
39576|    128|    case JS_DEF_CFUNC:
  ------------------
  |  | 1099|    128|#define JS_DEF_CFUNC          0
  ------------------
  |  Branch (39576:5): [True: 128, False: 0]
  ------------------
39577|    128|        val = JS_NewCFunction2(ctx, e->u.func.cfunc.generic,
39578|    128|                               e->name, e->u.func.length, e->u.func.cproto, e->magic);
39579|    128|        break;
39580|      0|    case JS_DEF_PROP_STRING:
  ------------------
  |  | 1102|      0|#define JS_DEF_PROP_STRING    3
  ------------------
  |  Branch (39580:5): [True: 0, False: 128]
  ------------------
39581|      0|        val = JS_NewAtomString(ctx, e->u.str);
39582|      0|        break;
39583|      0|    case JS_DEF_OBJECT:
  ------------------
  |  | 1107|      0|#define JS_DEF_OBJECT         8
  ------------------
  |  Branch (39583:5): [True: 0, False: 128]
  ------------------
39584|       |        /* XXX: could add a flag */
39585|      0|        if (atom == JS_ATOM_Symbol_unscopables)
  ------------------
  |  Branch (39585:13): [True: 0, False: 0]
  ------------------
39586|      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 }
  |  |  ------------------
  ------------------
39587|      0|        else
39588|      0|            proto = ctx->class_proto[JS_CLASS_OBJECT];
39589|      0|        val = JS_NewObjectProtoList(ctx, proto,
39590|      0|                                    e->u.prop_list.tab, e->u.prop_list.len);
39591|      0|        break;
39592|      0|    default:
  ------------------
  |  Branch (39592:5): [True: 0, False: 128]
  ------------------
39593|      0|        abort();
39594|    128|    }
39595|    128|    return val;
39596|    128|}
quickjs.c:js_create_var_ref:
16979|  1.73k|{
16980|  1.73k|    JSVarRef *var_ref;
16981|  1.73k|    var_ref = js_malloc(ctx, sizeof(JSVarRef));
16982|  1.73k|    if (!var_ref)
  ------------------
  |  Branch (16982:9): [True: 0, False: 1.73k]
  ------------------
16983|      0|        return NULL;
16984|  1.73k|    js_rc(var_ref)->ref_count = 1;
16985|  1.73k|    if (is_lexical)
  ------------------
  |  Branch (16985:9): [True: 31, False: 1.70k]
  ------------------
16986|     31|        var_ref->value = JS_UNINITIALIZED;
  ------------------
  |  |  295|     31|#define JS_UNINITIALIZED JS_MKVAL(JS_TAG_UNINITIALIZED, 0)
  |  |  ------------------
  |  |  |  |  247|     31|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16987|  1.70k|    else
16988|  1.70k|        var_ref->value = JS_UNDEFINED;
  ------------------
  |  |  291|  1.70k|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|  1.70k|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16989|  1.73k|    var_ref->pvalue = &var_ref->value;
16990|  1.73k|    var_ref->is_detached = TRUE;
16991|  1.73k|    var_ref->is_lexical = FALSE;
16992|  1.73k|    var_ref->is_const = FALSE;
16993|  1.73k|    add_gc_object(ctx->rt, &var_ref->header, JS_GC_OBJ_TYPE_VAR_REF);
16994|  1.73k|    return var_ref;
16995|  1.73k|}
quickjs.c:JS_ThrowReferenceErrorNotDefined:
 7821|      6|{
 7822|      6|    char buf[ATOM_GET_STR_BUF_SIZE];
 7823|      6|    return JS_ThrowReferenceError(ctx, "'%s' is not defined",
 7824|      6|                                  JS_AtomGetStr(ctx, buf, sizeof(buf), name));
 7825|      6|}
quickjs.c:JS_GetOwnPropertyNamesInternal:
 8602|     14|{
 8603|     14|    int i, j;
 8604|     14|    JSShape *sh;
 8605|     14|    JSShapeProperty *prs;
 8606|     14|    JSPropertyEnum *tab_atom, *tab_exotic;
 8607|     14|    JSAtom atom;
 8608|     14|    uint32_t num_keys_count, str_keys_count, sym_keys_count, atom_count;
 8609|     14|    uint32_t num_index, str_index, sym_index, exotic_count, exotic_keys_count;
 8610|     14|    BOOL is_enumerable, num_sorted;
 8611|     14|    uint32_t num_key;
 8612|     14|    JSAtomKindEnum kind;
 8613|       |
 8614|       |    /* clear pointer for consistency in case of failure */
 8615|     14|    *ptab = NULL;
 8616|     14|    *plen = 0;
 8617|       |
 8618|       |    /* compute the number of returned properties */
 8619|     14|    num_keys_count = 0;
 8620|     14|    str_keys_count = 0;
 8621|     14|    sym_keys_count = 0;
 8622|     14|    exotic_keys_count = 0;
 8623|     14|    exotic_count = 0;
 8624|     14|    tab_exotic = NULL;
 8625|     14|    sh = p->shape;
 8626|     51|    for(i = 0, prs = get_shape_prop(sh); i < sh->prop_count; i++, prs++) {
  ------------------
  |  Branch (8626:42): [True: 37, False: 14]
  ------------------
 8627|     37|        atom = prs->atom;
 8628|     37|        if (atom != JS_ATOM_NULL) {
  ------------------
  |  |  451|     37|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (8628:13): [True: 37, False: 0]
  ------------------
 8629|     37|            is_enumerable = ((prs->flags & JS_PROP_ENUMERABLE) != 0);
  ------------------
  |  |  300|     37|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
 8630|     37|            kind = JS_AtomGetKind(ctx, atom);
 8631|     37|            if ((!(flags & JS_GPN_ENUM_ONLY) || is_enumerable) &&
  ------------------
  |  |  814|     37|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
  |  Branch (8631:18): [True: 22, False: 15]
  |  Branch (8631:49): [True: 0, False: 15]
  ------------------
 8632|     22|                ((flags >> kind) & 1) != 0) {
  ------------------
  |  Branch (8632:17): [True: 22, False: 0]
  ------------------
 8633|       |                /* need to raise an exception in case of the module
 8634|       |                   name space (implicit GetOwnProperty) */
 8635|     22|                if (unlikely((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) &&
  ------------------
  |  |   33|     44|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 22]
  |  |  ------------------
  ------------------
 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|     22|                if (JS_AtomIsArrayIndex(ctx, &num_key, atom)) {
  ------------------
  |  Branch (8643:21): [True: 0, False: 22]
  ------------------
 8644|      0|                    num_keys_count++;
 8645|     22|                } else if (kind == JS_ATOM_KIND_STRING) {
  ------------------
  |  Branch (8645:28): [True: 22, False: 0]
  ------------------
 8646|     22|                    str_keys_count++;
 8647|     22|                } else {
 8648|      0|                    sym_keys_count++;
 8649|      0|                }
 8650|     22|            }
 8651|     37|        }
 8652|     37|    }
 8653|       |
 8654|     14|    if (p->is_exotic) {
  ------------------
  |  Branch (8654:9): [True: 0, False: 14]
  ------------------
 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|     14|    atom_count = num_keys_count + str_keys_count;
 8702|     14|    if (atom_count < str_keys_count)
  ------------------
  |  Branch (8702:9): [True: 0, False: 14]
  ------------------
 8703|      0|        goto add_overflow;
 8704|     14|    atom_count += sym_keys_count;
 8705|     14|    if (atom_count < sym_keys_count)
  ------------------
  |  Branch (8705:9): [True: 0, False: 14]
  ------------------
 8706|      0|        goto add_overflow;
 8707|     14|    atom_count += exotic_keys_count;
 8708|     14|    if (atom_count < exotic_keys_count || atom_count > INT32_MAX) {
  ------------------
  |  Branch (8708:9): [True: 0, False: 14]
  |  Branch (8708:43): [True: 0, False: 14]
  ------------------
 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|     14|    tab_atom = js_malloc(ctx, sizeof(tab_atom[0]) * max_int(atom_count, 1));
 8718|     14|    if (!tab_atom) {
  ------------------
  |  Branch (8718:9): [True: 0, False: 14]
  ------------------
 8719|      0|        JS_FreePropertyEnum(ctx, tab_exotic, exotic_count);
 8720|      0|        return -1;
 8721|      0|    }
 8722|       |
 8723|     14|    num_index = 0;
 8724|     14|    str_index = num_keys_count;
 8725|     14|    sym_index = str_index + str_keys_count;
 8726|       |
 8727|     14|    num_sorted = TRUE;
 8728|     14|    sh = p->shape;
 8729|     51|    for(i = 0, prs = get_shape_prop(sh); i < sh->prop_count; i++, prs++) {
  ------------------
  |  Branch (8729:42): [True: 37, False: 14]
  ------------------
 8730|     37|        atom = prs->atom;
 8731|     37|        if (atom != JS_ATOM_NULL) {
  ------------------
  |  |  451|     37|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (8731:13): [True: 37, False: 0]
  ------------------
 8732|     37|            is_enumerable = ((prs->flags & JS_PROP_ENUMERABLE) != 0);
  ------------------
  |  |  300|     37|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
 8733|     37|            kind = JS_AtomGetKind(ctx, atom);
 8734|     37|            if ((!(flags & JS_GPN_ENUM_ONLY) || is_enumerable) &&
  ------------------
  |  |  814|     37|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
  |  Branch (8734:18): [True: 22, False: 15]
  |  Branch (8734:49): [True: 0, False: 15]
  ------------------
 8735|     22|                ((flags >> kind) & 1) != 0) {
  ------------------
  |  Branch (8735:17): [True: 22, False: 0]
  ------------------
 8736|     22|                if (JS_AtomIsArrayIndex(ctx, &num_key, atom)) {
  ------------------
  |  Branch (8736:21): [True: 0, False: 22]
  ------------------
 8737|      0|                    j = num_index++;
 8738|      0|                    num_sorted = FALSE;
 8739|     22|                } else if (kind == JS_ATOM_KIND_STRING) {
  ------------------
  |  Branch (8739:28): [True: 22, False: 0]
  ------------------
 8740|     22|                    j = str_index++;
 8741|     22|                } else {
 8742|      0|                    j = sym_index++;
 8743|      0|                }
 8744|     22|                tab_atom[j].atom = JS_DupAtom(ctx, atom);
 8745|     22|                tab_atom[j].is_enumerable = is_enumerable;
 8746|     22|            }
 8747|     37|        }
 8748|     37|    }
 8749|       |
 8750|     14|    if (p->is_exotic) {
  ------------------
  |  Branch (8750:9): [True: 0, False: 14]
  ------------------
 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|     14|    assert(num_index == num_keys_count);
  ------------------
  |  Branch (8790:5): [True: 0, False: 14]
  |  Branch (8790:5): [True: 14, False: 0]
  ------------------
 8791|     14|    assert(str_index == num_keys_count + str_keys_count);
  ------------------
  |  Branch (8791:5): [True: 0, False: 14]
  |  Branch (8791:5): [True: 14, False: 0]
  ------------------
 8792|     14|    assert(sym_index == atom_count);
  ------------------
  |  Branch (8792:5): [True: 0, False: 14]
  |  Branch (8792:5): [True: 14, False: 0]
  ------------------
 8793|       |
 8794|     14|    if (num_keys_count != 0 && !num_sorted) {
  ------------------
  |  Branch (8794:9): [True: 0, False: 14]
  |  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|     14|    *ptab = tab_atom;
 8799|     14|    *plen = atom_count;
 8800|     14|    return 0;
 8801|     14|}
quickjs.c:JS_AtomGetKind:
 3132|     74|{
 3133|     74|    JSRuntime *rt;
 3134|     74|    JSAtomStruct *p;
 3135|       |
 3136|     74|    rt = ctx->rt;
 3137|     74|    if (__JS_AtomIsTaggedInt(v))
  ------------------
  |  Branch (3137:9): [True: 0, False: 74]
  ------------------
 3138|      0|        return JS_ATOM_KIND_STRING;
 3139|     74|    p = rt->atom_array[v];
 3140|     74|    switch(p->atom_type) {
 3141|     74|    case JS_ATOM_TYPE_STRING:
  ------------------
  |  Branch (3141:5): [True: 74, False: 0]
  ------------------
 3142|     74|        return JS_ATOM_KIND_STRING;
 3143|      0|    case JS_ATOM_TYPE_GLOBAL_SYMBOL:
  ------------------
  |  Branch (3143:5): [True: 0, False: 74]
  ------------------
 3144|      0|        return JS_ATOM_KIND_SYMBOL;
 3145|      0|    case JS_ATOM_TYPE_SYMBOL:
  ------------------
  |  Branch (3145:5): [True: 0, False: 74]
  ------------------
 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: 74]
  ------------------
 3151|      0|        abort();
 3152|     74|    }
 3153|     74|}
quickjs.c:JS_AtomIsArrayIndex:
 3635|     70|{
 3636|     70|    if (__JS_AtomIsTaggedInt(atom)) {
  ------------------
  |  Branch (3636:9): [True: 0, False: 70]
  ------------------
 3637|      0|        *pval = __JS_AtomToUInt32(atom);
 3638|      0|        return TRUE;
 3639|     70|    } else {
 3640|     70|        JSRuntime *rt = ctx->rt;
 3641|     70|        JSAtomStruct *p;
 3642|     70|        uint32_t val;
 3643|       |
 3644|     70|        assert(atom < rt->atom_size);
  ------------------
  |  Branch (3644:9): [True: 0, False: 70]
  |  Branch (3644:9): [True: 70, False: 0]
  ------------------
 3645|     70|        p = rt->atom_array[atom];
 3646|     70|        if (p->atom_type == JS_ATOM_TYPE_STRING &&
  ------------------
  |  Branch (3646:13): [True: 59, False: 11]
  ------------------
 3647|     59|            is_num_string(&val, p) && val != -1) {
  ------------------
  |  Branch (3647:13): [True: 0, False: 59]
  |  Branch (3647:39): [True: 0, False: 0]
  ------------------
 3648|      0|            *pval = val;
 3649|      0|            return TRUE;
 3650|     70|        } else {
 3651|     70|            *pval = 0;
 3652|     70|            return FALSE;
 3653|     70|        }
 3654|     70|    }
 3655|     70|}
quickjs.c:js_free_desc:
 9653|     22|{
 9654|     22|    JS_FreeValue(ctx, desc->getter);
 9655|     22|    JS_FreeValue(ctx, desc->setter);
 9656|     22|    JS_FreeValue(ctx, desc->value);
 9657|     22|}
quickjs.c:JS_GetOwnPropertyInternal:
 8819|     24|{
 8820|     24|    JSShapeProperty *prs;
 8821|     24|    JSProperty *pr;
 8822|       |
 8823|     24|retry:
 8824|     24|    prs = find_own_property(&pr, p, prop);
 8825|     24|    if (prs) {
  ------------------
  |  Branch (8825:9): [True: 22, False: 2]
  ------------------
 8826|     22|        if (desc) {
  ------------------
  |  Branch (8826:13): [True: 22, False: 0]
  ------------------
 8827|     22|            desc->flags = prs->flags & JS_PROP_C_W_E;
  ------------------
  |  |  301|     22|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     22|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|     22|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|     22|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
 8828|     22|            desc->getter = JS_UNDEFINED;
  ------------------
  |  |  291|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8829|     22|            desc->setter = JS_UNDEFINED;
  ------------------
  |  |  291|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8830|     22|            desc->value = JS_UNDEFINED;
  ------------------
  |  |  291|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 8831|     22|            if (unlikely(prs->flags & JS_PROP_TMASK)) {
  ------------------
  |  |   33|     22|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 22]
  |  |  ------------------
  ------------------
 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|     22|            } else {
 8852|     22|                desc->value = JS_DupValue(ctx, pr->u.value);
 8853|     22|            }
 8854|     22|        } 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|     22|        return TRUE;
 8866|     22|    }
 8867|      2|    if (p->is_exotic) {
  ------------------
  |  Branch (8867:9): [True: 0, False: 2]
  ------------------
 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|      2|    return FALSE;
 8893|      2|}
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|   171k|{
 9032|   171k|    JSAtom atom;
 9033|   171k|    JSValue ret;
 9034|       |
 9035|   171k|    if (likely(JS_VALUE_GET_TAG(this_obj) == JS_TAG_OBJECT &&
  ------------------
  |  |   32|   343k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 171k, False: 0]
  |  |  |  Branch (32:45): [True: 171k, False: 0]
  |  |  |  Branch (32:45): [True: 171k, False: 0]
  |  |  ------------------
  ------------------
 9036|   171k|               JS_VALUE_GET_TAG(prop) == JS_TAG_INT)) {
 9037|   171k|        JSObject *p;
 9038|   171k|        uint32_t idx;
 9039|       |        /* fast path for array access */
 9040|   171k|        p = JS_VALUE_GET_OBJ(this_obj);
  ------------------
  |  |  229|   171k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|   171k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9041|   171k|        idx = JS_VALUE_GET_INT(prop);
  ------------------
  |  |  239|   171k|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
 9042|   171k|        switch(p->class_id) {
 9043|   171k|        case JS_CLASS_ARRAY:
  ------------------
  |  Branch (9043:9): [True: 171k, False: 0]
  ------------------
 9044|   171k|        case JS_CLASS_ARGUMENTS:
  ------------------
  |  Branch (9044:9): [True: 0, False: 171k]
  ------------------
 9045|   171k|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|   171k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 171k]
  |  |  ------------------
  ------------------
 9046|   171k|            return JS_DupValue(ctx, p->u.array.u.values[idx]);
 9047|      0|        case JS_CLASS_MAPPED_ARGUMENTS:
  ------------------
  |  Branch (9047:9): [True: 0, False: 171k]
  ------------------
 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: 171k]
  ------------------
 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: 171k]
  ------------------
 9054|      0|        case JS_CLASS_UINT8_ARRAY:
  ------------------
  |  Branch (9054:9): [True: 0, False: 171k]
  ------------------
 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: 171k]
  ------------------
 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: 171k]
  ------------------
 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: 171k]
  ------------------
 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: 171k]
  ------------------
 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: 171k]
  ------------------
 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: 171k]
  ------------------
 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: 171k]
  ------------------
 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: 171k]
  ------------------
 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: 171k]
  ------------------
 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: 171k]
  ------------------
 9085|      0|            goto slow_path;
 9086|   171k|        }
 9087|   171k|    } else {
 9088|      2|    slow_path:
 9089|       |        /* ToObject() must be done before ToPropertyKey() */
 9090|      2|        if (JS_IsNull(this_obj) || JS_IsUndefined(this_obj)) {
  ------------------
  |  Branch (9090:13): [True: 0, False: 2]
  |  Branch (9090:36): [True: 0, False: 2]
  ------------------
 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|      2|        atom = JS_ValueToAtom(ctx, prop);
 9095|      2|        JS_FreeValue(ctx, prop);
 9096|      2|        if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 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|      2|        ret = JS_GetProperty(ctx, this_obj, atom);
 9099|      2|        JS_FreeAtom(ctx, atom);
 9100|      2|        return ret;
 9101|      2|    }
 9102|   171k|}
quickjs.c:add_fast_array_element:
 9544|   171k|{
 9545|   171k|    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|   171k|    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|   171k|    if (likely(JS_VALUE_GET_TAG(p->prop[0].u.value) == JS_TAG_INT)) {
  ------------------
  |  |   32|   171k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 171k, False: 0]
  |  |  ------------------
  ------------------
 9552|   171k|        array_len = JS_VALUE_GET_INT(p->prop[0].u.value);
  ------------------
  |  |  239|   171k|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
 9553|   171k|        if (new_len > array_len) {
  ------------------
  |  Branch (9553:13): [True: 171k, False: 0]
  ------------------
 9554|   171k|            if (unlikely(!(get_shape_prop(p->shape)->flags & JS_PROP_WRITABLE))) {
  ------------------
  |  |   33|   171k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 171k]
  |  |  ------------------
  ------------------
 9555|      0|                JS_FreeValue(ctx, val);
 9556|      0|                return JS_ThrowTypeErrorReadOnly(ctx, flags, JS_ATOM_length);
 9557|      0|            }
 9558|   171k|            p->prop[0].u.value = JS_NewInt32(ctx, new_len);
 9559|   171k|        }
 9560|   171k|    }
 9561|   171k|    if (unlikely(new_len > p->u.array.u1.size)) {
  ------------------
  |  |   33|   171k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 31, False: 171k]
  |  |  ------------------
  ------------------
 9562|     31|        if (expand_fast_array(ctx, p, new_len)) {
  ------------------
  |  Branch (9562:13): [True: 0, False: 31]
  ------------------
 9563|      0|            JS_FreeValue(ctx, val);
 9564|      0|            return -1;
 9565|      0|        }
 9566|     31|    }
 9567|   171k|    p->u.array.u.values[new_len - 1] = val;
 9568|   171k|    p->u.array.count = new_len;
 9569|   171k|    return TRUE;
 9570|   171k|}
quickjs.c:expand_fast_array:
 9525|     31|{
 9526|     31|    uint32_t new_size;
 9527|     31|    size_t slack;
 9528|     31|    JSValue *new_array_prop;
 9529|       |    /* XXX: potential arithmetic overflow */
 9530|     31|    new_size = max_int(new_len, p->u.array.u1.size * 3 / 2);
 9531|     31|    new_array_prop = js_realloc2(ctx, p->u.array.u.values, sizeof(JSValue) * new_size, &slack);
 9532|     31|    if (!new_array_prop)
  ------------------
  |  Branch (9532:9): [True: 0, False: 31]
  ------------------
 9533|      0|        return -1;
 9534|     31|    new_size += slack / sizeof(*new_array_prop);
 9535|     31|    p->u.array.u.values = new_array_prop;
 9536|     31|    p->u.array.u1.size = new_size;
 9537|     31|    return 0;
 9538|     31|}
quickjs.c:add_property:
 9181|  12.6k|{
 9182|  12.6k|    JSShape *sh, *new_sh;
 9183|       |
 9184|  12.6k|    if (unlikely(__JS_AtomIsTaggedInt(prop))) {
  ------------------
  |  |   33|  12.6k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 8, False: 12.6k]
  |  |  ------------------
  ------------------
 9185|       |        /* update is_std_array_prototype */
 9186|      8|        if (unlikely(p->is_std_array_prototype)) {
  ------------------
  |  |   33|      8|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 8]
  |  |  ------------------
  ------------------
 9187|      0|            p->is_std_array_prototype = FALSE;
 9188|      8|        } else if (unlikely(p->has_immutable_prototype)) {
  ------------------
  |  |   33|      8|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 8]
  |  |  ------------------
  ------------------
 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|      8|    }
 9205|  12.6k|    sh = p->shape;
 9206|  12.6k|    if (sh->is_hashed) {
  ------------------
  |  Branch (9206:9): [True: 4.06k, False: 8.63k]
  ------------------
 9207|       |        /* try to find an existing shape */
 9208|  4.06k|        new_sh = find_hashed_shape_prop(ctx->rt, sh, prop, prop_flags);
 9209|  4.06k|        if (new_sh) {
  ------------------
  |  Branch (9209:13): [True: 1.33k, False: 2.72k]
  ------------------
 9210|       |            /* matching shape found: use it */
 9211|       |            /*  the property array may need to be resized */
 9212|  1.33k|            if (new_sh->prop_size != sh->prop_size) {
  ------------------
  |  Branch (9212:17): [True: 0, False: 1.33k]
  ------------------
 9213|      0|                JSProperty *new_prop;
 9214|      0|                new_prop = js_realloc(ctx, p->prop, sizeof(p->prop[0]) *
 9215|      0|                                      new_sh->prop_size);
 9216|      0|                if (!new_prop)
  ------------------
  |  Branch (9216:21): [True: 0, False: 0]
  ------------------
 9217|      0|                    return NULL;
 9218|      0|                p->prop = new_prop;
 9219|      0|            }
 9220|  1.33k|            p->shape = js_dup_shape(new_sh);
 9221|  1.33k|            js_free_shape(ctx->rt, sh);
 9222|  1.33k|            return &p->prop[new_sh->prop_count - 1];
 9223|  2.72k|        } else if (js_rc(sh)->ref_count != 1) {
  ------------------
  |  Branch (9223:20): [True: 691, False: 2.03k]
  ------------------
 9224|       |            /* if the shape is shared, clone it */
 9225|    691|            new_sh = js_clone_shape(ctx, sh);
 9226|    691|            if (!new_sh)
  ------------------
  |  Branch (9226:17): [True: 0, False: 691]
  ------------------
 9227|      0|                return NULL;
 9228|       |            /* hash the cloned shape */
 9229|    691|            new_sh->is_hashed = TRUE;
 9230|    691|            js_shape_hash_link(ctx->rt, new_sh);
 9231|    691|            js_free_shape(ctx->rt, p->shape);
 9232|    691|            p->shape = new_sh;
 9233|    691|        }
 9234|  4.06k|    }
 9235|  12.6k|    assert(js_rc(p->shape)->ref_count == 1);
  ------------------
  |  Branch (9235:5): [True: 0, False: 11.3k]
  |  Branch (9235:5): [True: 11.3k, False: 0]
  ------------------
 9236|  11.3k|    if (add_shape_property(ctx, &p->shape, p, prop, prop_flags))
  ------------------
  |  Branch (9236:9): [True: 0, False: 11.3k]
  ------------------
 9237|      0|        return NULL;
 9238|  11.3k|    return &p->prop[p->shape->prop_count - 1];
 9239|  11.3k|}
quickjs.c:find_hashed_shape_prop:
 5535|  4.06k|{
 5536|  4.06k|    JSShape *sh1;
 5537|  4.06k|    uint32_t h, h1, i, n;
 5538|       |
 5539|  4.06k|    h = sh->hash;
 5540|  4.06k|    h = shape_hash(h, atom);
 5541|  4.06k|    h = shape_hash(h, prop_flags);
 5542|  4.06k|    h1 = get_shape_hash(h, rt->shape_hash_bits);
 5543|  5.05k|    for(sh1 = rt->shape_hash[h1]; sh1 != NULL; sh1 = sh1->shape_hash_next) {
  ------------------
  |  Branch (5543:35): [True: 2.32k, False: 2.72k]
  ------------------
 5544|       |        /* we test the hash first so that the rest is done only if the
 5545|       |           shapes really match */
 5546|  2.32k|        if (sh1->hash == h &&
  ------------------
  |  Branch (5546:13): [True: 1.33k, False: 990]
  ------------------
 5547|  1.33k|            sh1->proto == sh->proto &&
  ------------------
  |  Branch (5547:13): [True: 1.33k, False: 0]
  ------------------
 5548|  1.33k|            sh1->prop_count == ((n = sh->prop_count) + 1)) {
  ------------------
  |  Branch (5548:13): [True: 1.33k, False: 0]
  ------------------
 5549|  1.33k|            JSShapeProperty *prop = get_shape_prop(sh);
 5550|  1.33k|            JSShapeProperty *prop1 = get_shape_prop(sh1);
 5551|  2.67k|            for(i = 0; i < n; i++) {
  ------------------
  |  Branch (5551:24): [True: 1.33k, False: 1.33k]
  ------------------
 5552|  1.33k|                if (unlikely(prop1[i].atom != prop[i].atom) ||
  ------------------
  |  |   33|  2.67k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.33k]
  |  |  ------------------
  ------------------
 5553|  1.33k|                    unlikely(prop1[i].flags != prop[i].flags))
  ------------------
  |  |   33|  1.33k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.33k]
  |  |  ------------------
  ------------------
 5554|      0|                    goto next;
 5555|  1.33k|            }
 5556|  1.33k|            if (unlikely(prop1[n].atom != atom) ||
  ------------------
  |  |   33|  2.67k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.33k]
  |  |  ------------------
  ------------------
 5557|  1.33k|                unlikely(prop1[n].flags != prop_flags))
  ------------------
  |  |   33|  1.33k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.33k]
  |  |  ------------------
  ------------------
 5558|      0|                goto next;
 5559|  1.33k|            return sh1;
 5560|  1.33k|        }
 5561|    990|    next: ;
 5562|    990|    }
 5563|  2.72k|    return NULL;
 5564|  4.06k|}
quickjs.c:js_clone_shape:
 5269|    706|{
 5270|    706|    JSShape *sh;
 5271|    706|    size_t size;
 5272|    706|    JSShapeProperty *pr;
 5273|    706|    uint32_t i, hash_size;
 5274|       |
 5275|    706|    hash_size = sh1->prop_hash_mask + 1;
 5276|    706|    size = get_shape_size(hash_size, sh1->prop_size);
 5277|    706|    sh = js_malloc(ctx, size);
 5278|    706|    if (!sh)
  ------------------
  |  Branch (5278:9): [True: 0, False: 706]
  ------------------
 5279|      0|        return NULL;
 5280|    706|    memcpy(&sh->header + 1, &sh1->header + 1,
 5281|    706|           size - sizeof(JSGCObjectHeader));
 5282|    706|    js_rc(sh)->ref_count = 1;
 5283|    706|    add_gc_object(ctx->rt, &sh->header, JS_GC_OBJ_TYPE_SHAPE);
 5284|    706|    sh->is_hashed = FALSE;
 5285|    706|    if (sh->proto) {
  ------------------
  |  Branch (5285:9): [True: 706, False: 0]
  ------------------
 5286|    706|        JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, sh->proto));
  ------------------
  |  |  248|    706|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 5287|    706|    }
 5288|    736|    for(i = 0, pr = get_shape_prop(sh); i < sh->prop_count; i++, pr++) {
  ------------------
  |  Branch (5288:41): [True: 30, False: 706]
  ------------------
 5289|     30|        JS_DupAtom(ctx, pr->atom);
 5290|     30|    }
 5291|    706|    return sh;
 5292|    706|}
quickjs.c:js_shape_hash_link:
 5192|  4.37k|{
 5193|  4.37k|    uint32_t h;
 5194|  4.37k|    h = get_shape_hash(sh->hash, rt->shape_hash_bits);
 5195|  4.37k|    sh->shape_hash_next = rt->shape_hash[h];
 5196|  4.37k|    rt->shape_hash[h] = sh;
 5197|  4.37k|    rt->shape_hash_count++;
 5198|  4.37k|}
quickjs.c:JS_CreateProperty:
10130|   178k|{
10131|   178k|    JSProperty *pr;
10132|   178k|    int ret, prop_flags;
10133|   178k|    JSVarRef *var_ref;
10134|   178k|    JSObject *delete_obj;
10135|       |    
10136|       |    /* add a new property or modify an existing exotic one */
10137|   178k|    if (p->is_exotic) {
  ------------------
  |  Branch (10137:9): [True: 171k, False: 6.69k]
  ------------------
10138|   171k|        if (p->class_id == JS_CLASS_ARRAY) {
  ------------------
  |  Branch (10138:13): [True: 171k, False: 110]
  ------------------
10139|   171k|            uint32_t idx, len;
10140|       |
10141|   171k|            if (p->fast_array) {
  ------------------
  |  Branch (10141:17): [True: 171k, False: 0]
  ------------------
10142|   171k|                if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (10142:21): [True: 171k, False: 26]
  ------------------
10143|   171k|                    idx = __JS_AtomToUInt32(prop);
10144|   171k|                    if (idx == p->u.array.count) {
  ------------------
  |  Branch (10144:25): [True: 171k, False: 0]
  ------------------
10145|   171k|                        if (!p->extensible)
  ------------------
  |  Branch (10145:29): [True: 0, False: 171k]
  ------------------
10146|      0|                            goto not_extensible;
10147|   171k|                        if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET))
  ------------------
  |  |  314|   171k|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                      if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET))
  ------------------
  |  |  315|   171k|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10147:29): [True: 0, False: 171k]
  ------------------
10148|      0|                            goto convert_to_array;
10149|   171k|                        prop_flags = get_prop_flags(flags, 0);
10150|   171k|                        if (prop_flags != JS_PROP_C_W_E)
  ------------------
  |  |  301|   171k|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|   171k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|   171k|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|   171k|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
  |  Branch (10150:29): [True: 8, False: 171k]
  ------------------
10151|      8|                            goto convert_to_array;
10152|   171k|                        return add_fast_array_element(ctx, p,
10153|   171k|                                                      JS_DupValue(ctx, val), flags);
10154|   171k|                    } else {
10155|      0|                        goto convert_to_array;
10156|      0|                    }
10157|   171k|                } else if (JS_AtomIsArrayIndex(ctx, &idx, prop)) {
  ------------------
  |  Branch (10157:28): [True: 0, False: 26]
  ------------------
10158|       |                    /* convert the fast array to normal array */
10159|      8|                convert_to_array:
10160|      8|                    if (convert_fast_array_to_array(ctx, p))
  ------------------
  |  Branch (10160:25): [True: 0, False: 8]
  ------------------
10161|      0|                        return -1;
10162|      8|                    goto generic_array;
10163|      8|                }
10164|   171k|            } else if (JS_AtomIsArrayIndex(ctx, &idx, prop)) {
  ------------------
  |  Branch (10164:24): [True: 0, False: 0]
  ------------------
10165|      0|                JSProperty *plen;
10166|      0|                JSShapeProperty *pslen;
10167|      8|            generic_array:
10168|       |                /* update the length field */
10169|      8|                plen = &p->prop[0];
10170|      8|                JS_ToUint32(ctx, &len, plen->u.value);
10171|      8|                if ((idx + 1) > len) {
  ------------------
  |  Branch (10171:21): [True: 8, False: 0]
  ------------------
10172|      8|                    pslen = get_shape_prop(p->shape);
10173|      8|                    if (unlikely(!(pslen->flags & JS_PROP_WRITABLE)))
  ------------------
  |  |   33|      8|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 8]
  |  |  ------------------
  ------------------
10174|      0|                        return JS_ThrowTypeErrorReadOnly(ctx, flags, JS_ATOM_length);
10175|       |                    /* XXX: should update the length after defining
10176|       |                       the property */
10177|      8|                    len = idx + 1;
10178|      8|                    set_value(ctx, &plen->u.value, JS_NewUint32(ctx, len));
10179|      8|                }
10180|      8|            }
10181|   171k|        } else if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (10181:20): [True: 0, False: 110]
  ------------------
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|    110|        } else if (!(flags & JS_PROP_NO_EXOTIC)) {
  ------------------
  |  |  325|    110|#define JS_PROP_NO_EXOTIC        (1 << 16) /* internal use */
  ------------------
  |  Branch (10189:20): [True: 66, False: 44]
  ------------------
10190|     66|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
10191|     66|            if (em) {
  ------------------
  |  Branch (10191:17): [True: 66, False: 0]
  ------------------
10192|     66|                if (em->define_own_property) {
  ------------------
  |  Branch (10192:21): [True: 44, False: 22]
  ------------------
10193|     44|                    return em->define_own_property(ctx, JS_MKPTR(JS_TAG_OBJECT, p),
  ------------------
  |  |  248|     44|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
10194|     44|                                                   prop, val, getter, setter, flags);
10195|     44|                }
10196|     22|                ret = JS_IsExtensible(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  248|     22|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
10197|     22|                if (ret < 0)
  ------------------
  |  Branch (10197:21): [True: 0, False: 22]
  ------------------
10198|      0|                    return -1;
10199|     22|                if (!ret)
  ------------------
  |  Branch (10199:21): [True: 0, False: 22]
  ------------------
10200|      0|                    goto not_extensible;
10201|     22|            }
10202|     66|        }
10203|   171k|    }
10204|       |
10205|  6.79k|    if (!p->extensible) {
  ------------------
  |  Branch (10205:9): [True: 0, False: 6.79k]
  ------------------
10206|      0|    not_extensible:
10207|      0|        return JS_ThrowTypeErrorOrFalse(ctx, flags, "object is not extensible");
10208|      0|    }
10209|       |
10210|  6.79k|    var_ref = NULL;
10211|  6.79k|    delete_obj = NULL;
10212|  6.79k|    if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  314|  6.79k|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                  if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  315|  6.79k|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10212:9): [True: 473, False: 6.32k]
  ------------------
10213|    473|        prop_flags = (flags & (JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE)) |
  ------------------
  |  |  298|    473|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                      prop_flags = (flags & (JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE)) |
  ------------------
  |  |  300|    473|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
10214|    473|            JS_PROP_GETSET;
  ------------------
  |  |  305|    473|#define JS_PROP_GETSET         (1 << 4)
  ------------------
10215|  6.32k|    } else {
10216|  6.32k|        prop_flags = flags & JS_PROP_C_W_E;
  ------------------
  |  |  301|  6.32k|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|  6.32k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|  6.32k|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|  6.32k|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
10217|  6.32k|        if (p->class_id == JS_CLASS_GLOBAL_OBJECT) {
  ------------------
  |  Branch (10217:13): [True: 595, False: 5.73k]
  ------------------
10218|    595|            JSObject *p1 = JS_VALUE_GET_OBJ(p->u.global_object.uninitialized_vars);
  ------------------
  |  |  229|    595|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    595|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10219|    595|            JSShapeProperty *prs1;
10220|    595|            JSProperty *pr1;
10221|    595|            prs1 = find_own_property(&pr1, p1, prop);
10222|    595|            if (prs1) {
  ------------------
  |  Branch (10222:17): [True: 1, False: 594]
  ------------------
10223|      1|                delete_obj = p1;
10224|      1|                var_ref = pr1->u.var_ref;
10225|      1|                js_rc(var_ref)->ref_count++;
10226|    594|            } else {
10227|    594|                var_ref = js_create_var_ref(ctx, FALSE);
10228|    594|                if (!var_ref)
  ------------------
  |  Branch (10228:21): [True: 0, False: 594]
  ------------------
10229|      0|                    return -1;
10230|    594|            }
10231|    595|            var_ref->is_const = !(prop_flags & JS_PROP_WRITABLE);
  ------------------
  |  |  299|    595|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10232|    595|            prop_flags |= JS_PROP_VARREF;
  ------------------
  |  |  306|    595|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
10233|    595|        }
10234|  6.32k|    }
10235|  6.79k|    pr = add_property(ctx, p, prop, prop_flags);
10236|  6.79k|    if (unlikely(!pr)) {
  ------------------
  |  |   33|  6.79k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 6.79k]
  |  |  ------------------
  ------------------
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|  6.79k|    if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  314|  6.79k|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                  if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  315|  6.79k|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10241:9): [True: 473, False: 6.32k]
  ------------------
10242|    473|        pr->u.getset.getter = NULL;
10243|    473|        if ((flags & JS_PROP_HAS_GET) && JS_IsFunction(ctx, getter)) {
  ------------------
  |  |  314|    473|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
  |  Branch (10243:13): [True: 473, False: 0]
  |  Branch (10243:42): [True: 473, False: 0]
  ------------------
10244|    473|            pr->u.getset.getter =
10245|    473|                JS_VALUE_GET_OBJ(JS_DupValue(ctx, getter));
  ------------------
  |  |  229|    473|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    473|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10246|    473|        }
10247|    473|        pr->u.getset.setter = NULL;
10248|    473|        if ((flags & JS_PROP_HAS_SET) && JS_IsFunction(ctx, setter)) {
  ------------------
  |  |  315|    473|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10248:13): [True: 473, False: 0]
  |  Branch (10248:42): [True: 44, False: 429]
  ------------------
10249|     44|            pr->u.getset.setter =
10250|     44|                JS_VALUE_GET_OBJ(JS_DupValue(ctx, setter));
  ------------------
  |  |  229|     44|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     44|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10251|     44|        }
10252|  6.32k|    } else if (p->class_id == JS_CLASS_GLOBAL_OBJECT) {
  ------------------
  |  Branch (10252:16): [True: 595, False: 5.73k]
  ------------------
10253|    595|        if (delete_obj)
  ------------------
  |  Branch (10253:13): [True: 1, False: 594]
  ------------------
10254|      1|            delete_property(ctx, delete_obj, prop);
10255|    595|        pr->u.var_ref = var_ref;
10256|    595|        if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  316|    595|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10256:13): [True: 595, False: 0]
  ------------------
10257|    595|            *var_ref->pvalue = JS_DupValue(ctx, val);
10258|    595|        } 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|  5.73k|    } else {
10262|  5.73k|        if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  316|  5.73k|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10262:13): [True: 5.73k, False: 0]
  ------------------
10263|  5.73k|            pr->u.value = JS_DupValue(ctx, val);
10264|  5.73k|        } 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|  5.73k|    }
10268|  6.79k|    return TRUE;
10269|  6.79k|}
quickjs.c:check_define_prop_flags:
10273|     35|{
10274|     35|    BOOL has_accessor, is_getset;
10275|       |
10276|     35|    if (!(prop_flags & JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  298|     35|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
  |  Branch (10276:9): [True: 0, False: 35]
  ------------------
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|     35|    return TRUE;
10299|     35|}
quickjs.c:js_shape_prepare_update:
10304|    178|{
10305|    178|    JSShape *sh;
10306|    178|    uint32_t idx = 0;    /* prevent warning */
10307|       |
10308|    178|    sh = p->shape;
10309|    178|    if (sh->is_hashed) {
  ------------------
  |  Branch (10309:9): [True: 19, False: 159]
  ------------------
10310|     19|        if (js_rc(sh)->ref_count != 1) {
  ------------------
  |  Branch (10310:13): [True: 15, False: 4]
  ------------------
10311|     15|            if (pprs)
  ------------------
  |  Branch (10311:17): [True: 11, False: 4]
  ------------------
10312|     11|                idx = *pprs - get_shape_prop(sh);
10313|       |            /* clone the shape (the resulting one is no longer hashed) */
10314|     15|            sh = js_clone_shape(ctx, sh);
10315|     15|            if (!sh)
  ------------------
  |  Branch (10315:17): [True: 0, False: 15]
  ------------------
10316|      0|                return -1;
10317|     15|            js_free_shape(ctx->rt, p->shape);
10318|     15|            p->shape = sh;
10319|     15|            if (pprs)
  ------------------
  |  Branch (10319:17): [True: 11, False: 4]
  ------------------
10320|     11|                *pprs = get_shape_prop(sh) + idx;
10321|     15|        } else {
10322|      4|            js_shape_hash_unlink(ctx->rt, sh);
10323|      4|            sh->is_hashed = FALSE;
10324|      4|        }
10325|     19|    }
10326|    178|    return 0;
10327|    178|}
quickjs.c:free_var_ref:
 6165|  2.84k|{
 6166|  2.84k|    if (var_ref) {
  ------------------
  |  Branch (6166:9): [True: 2.84k, False: 0]
  ------------------
 6167|  2.84k|        assert(js_rc(var_ref)->ref_count > 0);
  ------------------
  |  Branch (6167:9): [True: 0, False: 2.84k]
  |  Branch (6167:9): [True: 2.84k, False: 0]
  ------------------
 6168|  2.84k|        if (--js_rc(var_ref)->ref_count == 0) {
  ------------------
  |  Branch (6168:13): [True: 1.73k, False: 1.10k]
  ------------------
 6169|  1.73k|            if (var_ref->is_detached) {
  ------------------
  |  Branch (6169:17): [True: 1.73k, False: 0]
  ------------------
 6170|  1.73k|                JS_FreeValueRT(rt, var_ref->value);
 6171|  1.73k|            } 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|  1.73k|            remove_gc_object(&var_ref->header);
 6181|  1.73k|            js_free_rt(rt, var_ref);
 6182|  1.73k|        }
 6183|  2.84k|    }
 6184|  2.84k|}
quickjs.c:js_update_property_flags:
10331|     45|{
10332|     45|    if (flags != (*pprs)->flags) {
  ------------------
  |  Branch (10332:9): [True: 30, False: 15]
  ------------------
10333|     30|        if (js_shape_prepare_update(ctx, p, pprs))
  ------------------
  |  Branch (10333:13): [True: 0, False: 30]
  ------------------
10334|      0|            return -1;
10335|     30|        (*pprs)->flags = flags;
10336|     30|    }
10337|     45|    return 0;
10338|     45|}
quickjs.c:get_prop_flags:
10120|   171k|{
10121|   171k|    int mask;
10122|   171k|    mask = (flags >> JS_PROP_HAS_SHIFT) & JS_PROP_C_W_E;
  ------------------
  |  |  310|   171k|#define JS_PROP_HAS_SHIFT        8
  ------------------
                  mask = (flags >> JS_PROP_HAS_SHIFT) & JS_PROP_C_W_E;
  ------------------
  |  |  301|   171k|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|   171k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|   171k|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|   171k|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
10123|   171k|    return (flags & mask) | (def_flags & ~mask);
10124|   171k|}
quickjs.c:convert_fast_array_to_array:
 9246|      8|{
 9247|      8|    JSProperty *pr;
 9248|      8|    JSShape *sh;
 9249|      8|    uint32_t i, len, new_count;
 9250|       |
 9251|      8|    if (js_shape_prepare_update(ctx, p, NULL))
  ------------------
  |  Branch (9251:9): [True: 0, False: 8]
  ------------------
 9252|      0|        return -1;
 9253|      8|    len = p->u.array.count;
 9254|       |    /* resize the properties once to simplify the error handling */
 9255|      8|    sh = p->shape;
 9256|      8|    new_count = sh->prop_count + len;
 9257|      8|    if (new_count > sh->prop_size) {
  ------------------
  |  Branch (9257:9): [True: 0, False: 8]
  ------------------
 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|      8|    if (p->class_id == JS_CLASS_MAPPED_ARGUMENTS) {
  ------------------
  |  Branch (9262:9): [True: 0, False: 8]
  ------------------
 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|      8|    } else {
 9271|      8|        JSValue *tab = p->u.array.u.values;
 9272|      8|        for(i = 0; i < len; i++) {
  ------------------
  |  Branch (9272:20): [True: 0, False: 8]
  ------------------
 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|      8|    }
 9279|      8|    js_free(ctx, p->u.array.u.values);
 9280|      8|    p->u.array.count = 0;
 9281|       |    p->u.array.u.values = NULL; /* fail safe */
 9282|      8|    p->u.array.u1.size = 0;
 9283|      8|    p->fast_array = 0;
 9284|      8|    p->is_std_array_prototype = FALSE;
 9285|      8|    return 0;
 9286|      8|}
quickjs.c:resize_properties:
 5336|    365|{
 5337|    365|    JSShape *sh;
 5338|    365|    uint32_t new_size, new_hash_size, new_hash_mask, i;
 5339|    365|    JSShapeProperty *pr;
 5340|    365|    intptr_t h;
 5341|    365|    JSShape *old_sh;
 5342|       |
 5343|    365|    sh = *psh;
 5344|    365|    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|    365|    if (p) {
  ------------------
  |  Branch (5347:9): [True: 365, False: 0]
  ------------------
 5348|    365|        JSProperty *new_prop;
 5349|    365|        new_prop = js_realloc(ctx, p->prop, sizeof(new_prop[0]) * new_size);
 5350|    365|        if (unlikely(!new_prop))
  ------------------
  |  |   33|    365|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 365]
  |  |  ------------------
  ------------------
 5351|      0|            return -1;
 5352|    365|        p->prop = new_prop;
 5353|    365|    }
 5354|    365|    new_hash_size = sh->prop_hash_mask + 1;
 5355|    534|    while (new_hash_size < new_size)
  ------------------
  |  Branch (5355:12): [True: 169, False: 365]
  ------------------
 5356|    169|        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|    365|    old_sh = sh;
 5360|    365|    sh = js_malloc(ctx, get_shape_size(new_hash_size, new_size));
 5361|    365|    if (!sh)
  ------------------
  |  Branch (5361:9): [True: 0, False: 365]
  ------------------
 5362|      0|        return -1;
 5363|    365|    remove_gc_object(&old_sh->header);
 5364|       |
 5365|    365|    js_rc(sh)->ref_count = 1;
 5366|    365|    add_gc_object(ctx->rt, &sh->header, JS_GC_OBJ_TYPE_SHAPE);
 5367|       |
 5368|    365|    memcpy(&sh->header + 1, &old_sh->header + 1,
 5369|    365|           sizeof(JSShape) - sizeof(JSGCObjectHeader));
 5370|       |    
 5371|    365|    if (new_hash_size != (sh->prop_hash_mask + 1)) {
  ------------------
  |  Branch (5371:9): [True: 169, False: 196]
  ------------------
 5372|       |        /* resize the hash table and the properties */
 5373|    169|        new_hash_mask = new_hash_size - 1;
 5374|    169|        sh->prop_hash_mask = new_hash_mask;
 5375|    169|        memset(sh->hash_table, 0,
 5376|    169|               sizeof(sh->hash_table[0]) * new_hash_size);
 5377|    169|        memcpy(get_shape_prop(sh), get_shape_prop(old_sh),
 5378|    169|               sizeof(JSShapeProperty) * old_sh->prop_count);
 5379|  3.29k|        for(i = 0, pr = get_shape_prop(sh); i < sh->prop_count; i++, pr++) {
  ------------------
  |  Branch (5379:45): [True: 3.12k, False: 169]
  ------------------
 5380|  3.12k|            if (pr->atom != JS_ATOM_NULL) {
  ------------------
  |  |  451|  3.12k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (5380:17): [True: 3.12k, False: 0]
  ------------------
 5381|  3.12k|                h = ((uintptr_t)pr->atom & new_hash_mask);
 5382|  3.12k|                pr->hash_next = sh->hash_table[h];
 5383|  3.12k|                sh->hash_table[h] = i + 1;
 5384|  3.12k|            }
 5385|  3.12k|        }
 5386|    196|    } else {
 5387|       |        /* just copy the previous hash table and the properties */
 5388|    196|        memcpy(sh->hash_table, old_sh->hash_table,
 5389|    196|               sizeof(sh->hash_table[0]) * new_hash_size);
 5390|       |
 5391|    196|        memcpy(get_shape_prop(sh), get_shape_prop(old_sh),
 5392|    196|               sizeof(JSShapeProperty) * old_sh->prop_count);
 5393|    196|    }
 5394|    365|    js_free(ctx, old_sh);
 5395|    365|    *psh = sh;
 5396|    365|    sh->prop_size = new_size;
 5397|    365|    return 0;
 5398|    365|}
quickjs.c:delete_property:
 9312|      1|{
 9313|      1|    JSShape *sh;
 9314|      1|    JSShapeProperty *pr, *lpr, *prop;
 9315|      1|    JSProperty *pr1;
 9316|      1|    uint32_t lpr_idx;
 9317|      1|    intptr_t h, h1;
 9318|       |
 9319|      1| redo:
 9320|      1|    sh = p->shape;
 9321|      1|    h1 = atom & sh->prop_hash_mask;
 9322|      1|    h = sh->hash_table[h1];
 9323|      1|    prop = get_shape_prop(sh);
 9324|      1|    lpr = NULL;
 9325|      1|    lpr_idx = 0;   /* prevent warning */
 9326|      1|    while (h != 0) {
  ------------------
  |  Branch (9326:12): [True: 1, False: 0]
  ------------------
 9327|      1|        pr = &prop[h - 1];
 9328|      1|        if (likely(pr->atom == atom)) {
  ------------------
  |  |   32|      1|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 9329|       |            /* found ! */
 9330|      1|            if (!(pr->flags & JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|      1|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
  |  Branch (9330:17): [True: 0, False: 1]
  ------------------
 9331|      0|                return FALSE;
 9332|       |            /* realloc the shape if needed */
 9333|      1|            if (lpr)
  ------------------
  |  Branch (9333:17): [True: 0, False: 1]
  ------------------
 9334|      0|                lpr_idx = lpr - get_shape_prop(sh);
 9335|      1|            if (js_shape_prepare_update(ctx, p, &pr))
  ------------------
  |  Branch (9335:17): [True: 0, False: 1]
  ------------------
 9336|      0|                return -1;
 9337|      1|            sh = p->shape;
 9338|       |            /* remove property */
 9339|      1|            if (lpr) {
  ------------------
  |  Branch (9339:17): [True: 0, False: 1]
  ------------------
 9340|      0|                lpr = get_shape_prop(sh) + lpr_idx;
 9341|      0|                lpr->hash_next = pr->hash_next;
 9342|      1|            } else {
 9343|      1|                sh->hash_table[h1] = pr->hash_next;
 9344|      1|            }
 9345|      1|            sh->deleted_prop_count++;
 9346|       |            /* free the entry */
 9347|      1|            pr1 = &p->prop[h - 1];
 9348|      1|            if (unlikely(p->class_id == JS_CLASS_GLOBAL_OBJECT)) {
  ------------------
  |  |   33|      1|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 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|      1|            free_property(ctx->rt, pr1, pr->flags);
 9354|      1|            JS_FreeAtom(ctx, pr->atom);
 9355|       |            /* put default values */
 9356|      1|            pr->flags = 0;
 9357|      1|            pr->atom = JS_ATOM_NULL;
  ------------------
  |  |  451|      1|#define JS_ATOM_NULL 0
  ------------------
 9358|      1|            pr1->u.value = JS_UNDEFINED;
  ------------------
  |  |  291|      1|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
 9359|       |
 9360|       |            /* compact the properties if too many deleted properties */
 9361|      1|            if (sh->deleted_prop_count >= 8 &&
  ------------------
  |  Branch (9361:17): [True: 0, False: 1]
  ------------------
 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|      1|            return TRUE;
 9366|      1|        }
 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|      1|{
 2864|      1|    JSStackFrame *sf = ctx->rt->current_stack_frame;
 2865|      1|    return (sf && (sf->js_mode & JS_MODE_STRICT));
  ------------------
  |  |  403|      1|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (2865:13): [True: 1, False: 0]
  |  Branch (2865:19): [True: 0, False: 1]
  ------------------
 2866|      1|}
quickjs.c:JS_ToBoolFree:
11161|      1|{
11162|      1|    uint32_t tag = JS_VALUE_GET_TAG(val);
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
11163|      1|    switch(tag) {
11164|      0|    case JS_TAG_INT:
  ------------------
  |  Branch (11164:5): [True: 0, False: 1]
  ------------------
11165|      0|        return JS_VALUE_GET_INT(val) != 0;
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
11166|      0|    case JS_TAG_BOOL:
  ------------------
  |  Branch (11166:5): [True: 0, False: 1]
  ------------------
11167|      0|    case JS_TAG_NULL:
  ------------------
  |  Branch (11167:5): [True: 0, False: 1]
  ------------------
11168|      0|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (11168:5): [True: 0, False: 1]
  ------------------
11169|      0|        return JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
11170|      0|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (11170:5): [True: 0, False: 1]
  ------------------
11171|      0|        return -1;
11172|      1|    case JS_TAG_STRING:
  ------------------
  |  Branch (11172:5): [True: 1, False: 0]
  ------------------
11173|      1|        {
11174|      1|            BOOL ret = JS_VALUE_GET_STRING(val)->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)
  |  |  ------------------
  ------------------
11175|      1|            JS_FreeValue(ctx, val);
11176|      1|            return ret;
11177|      0|        }
11178|      0|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (11178:5): [True: 0, False: 1]
  ------------------
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|      0|        }
11184|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (11184:5): [True: 0, False: 1]
  ------------------
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: 1]
  ------------------
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|      0|        }
11205|      0|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (11205:5): [True: 0, False: 1]
  ------------------
11206|      0|        {
11207|      0|            JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
11208|      0|            BOOL ret;
11209|      0|            ret = !p->is_HTMLDDA;
11210|      0|            JS_FreeValue(ctx, val);
11211|      0|            return ret;
11212|      0|        }
11213|      0|        break;
11214|      0|    default:
  ------------------
  |  Branch (11214:5): [True: 0, False: 1]
  ------------------
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|      1|    }
11223|      1|}
quickjs.c:JS_ToNumberHintFree:
12948|      5|{
12949|      5|    uint32_t tag;
12950|      5|    JSValue ret;
12951|       |
12952|      7| redo:
12953|      7|    tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  238|      7|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      7|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
12954|      7|    switch(tag) {
12955|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (12955:5): [True: 0, False: 7]
  ------------------
12956|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (12956:5): [True: 0, False: 7]
  ------------------
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|      1|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (12963:5): [True: 1, False: 6]
  ------------------
12964|      2|    case JS_TAG_INT:
  ------------------
  |  Branch (12964:5): [True: 1, False: 6]
  ------------------
12965|      2|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (12965:5): [True: 0, False: 7]
  ------------------
12966|      2|        ret = val;
12967|      2|        break;
12968|      0|    case JS_TAG_BOOL:
  ------------------
  |  Branch (12968:5): [True: 0, False: 7]
  ------------------
12969|      0|    case JS_TAG_NULL:
  ------------------
  |  Branch (12969:5): [True: 0, False: 7]
  ------------------
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: 6]
  ------------------
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|      2|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (12975:5): [True: 2, False: 5]
  ------------------
12976|      2|        val = JS_ToPrimitiveFree(ctx, val, HINT_NUMBER);
  ------------------
  |  | 1245|      2|#define HINT_NUMBER  1
  ------------------
12977|      2|        if (JS_IsException(val))
  ------------------
  |  Branch (12977:13): [True: 0, False: 2]
  ------------------
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|      2|        goto redo;
12980|      2|    case JS_TAG_STRING:
  ------------------
  |  Branch (12980:5): [True: 2, False: 5]
  ------------------
12981|      2|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (12981:5): [True: 0, False: 7]
  ------------------
12982|      2|        {
12983|      2|            const char *str;
12984|      2|            const char *p;
12985|      2|            size_t len;
12986|       |
12987|      2|            str = JS_ToCStringLen(ctx, &len, val);
12988|      2|            JS_FreeValue(ctx, val);
12989|      2|            if (!str)
  ------------------
  |  Branch (12989:17): [True: 0, False: 2]
  ------------------
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|      2|            p = str;
12992|      2|            p += skip_spaces(p);
12993|      2|            if ((p - str) == len) {
  ------------------
  |  Branch (12993:17): [True: 0, False: 2]
  ------------------
12994|      0|                ret = JS_NewInt32(ctx, 0);
12995|      2|            } else {
12996|      2|                int flags = ATOD_ACCEPT_BIN_OCT;
  ------------------
  |  |12746|      2|#define ATOD_ACCEPT_BIN_OCT  (1 << 2)
  ------------------
12997|      2|                ret = js_atof(ctx, p, &p, 0, flags);
12998|      2|                if (!JS_IsException(ret)) {
  ------------------
  |  Branch (12998:21): [True: 2, False: 0]
  ------------------
12999|      2|                    p += skip_spaces(p);
13000|      2|                    if ((p - str) != len) {
  ------------------
  |  Branch (13000:25): [True: 2, False: 0]
  ------------------
13001|      2|                        JS_FreeValue(ctx, ret);
13002|      2|                        ret = JS_NAN;
  ------------------
  |  |  252|      2|#define JS_NAN (JSValue){ .u.float64 = JS_FLOAT64_NAN, JS_TAG_FLOAT64 }
  |  |  ------------------
  |  |  |  |  103|      2|#define JS_FLOAT64_NAN NAN
  |  |  ------------------
  ------------------
13003|      2|                    }
13004|      2|                }
13005|      2|            }
13006|      2|            JS_FreeCString(ctx, str);
13007|      2|        }
13008|      0|        break;
13009|      0|    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (13009:5): [True: 0, False: 7]
  ------------------
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: 7]
  ------------------
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|      7|    }
13017|      5|    return ret;
13018|      7|}
quickjs.c:JS_ToPrimitiveFree:
11064|      4|{
11065|      4|    int i;
11066|      4|    BOOL force_ordinary;
11067|       |
11068|      4|    JSAtom method_name;
11069|      4|    JSValue method, ret;
11070|      4|    if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      4|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (11070:9): [True: 0, False: 4]
  ------------------
11071|      0|        return val;
11072|      4|    force_ordinary = hint & HINT_FORCE_ORDINARY;
  ------------------
  |  | 1247|      4|#define HINT_FORCE_ORDINARY (1 << 4) // don't try Symbol.toPrimitive
  ------------------
11073|      4|    hint &= ~HINT_FORCE_ORDINARY;
  ------------------
  |  | 1247|      4|#define HINT_FORCE_ORDINARY (1 << 4) // don't try Symbol.toPrimitive
  ------------------
11074|      4|    if (!force_ordinary) {
  ------------------
  |  Branch (11074:9): [True: 4, False: 0]
  ------------------
11075|      4|        method = JS_GetProperty(ctx, val, JS_ATOM_Symbol_toPrimitive);
11076|      4|        if (JS_IsException(method))
  ------------------
  |  Branch (11076:13): [True: 0, False: 4]
  ------------------
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|      4|        if (!JS_IsUndefined(method) && !JS_IsNull(method)) {
  ------------------
  |  Branch (11080:13): [True: 0, False: 4]
  |  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|      4|    }
11107|      4|    if (hint != HINT_STRING)
  ------------------
  |  | 1244|      4|#define HINT_STRING  0
  ------------------
  |  Branch (11107:9): [True: 2, False: 2]
  ------------------
11108|      2|        hint = HINT_NUMBER;
  ------------------
  |  | 1245|      2|#define HINT_NUMBER  1
  ------------------
11109|      6|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (11109:16): [True: 6, False: 0]
  ------------------
11110|      6|        if ((i ^ hint) == 0) {
  ------------------
  |  Branch (11110:13): [True: 4, False: 2]
  ------------------
11111|      4|            method_name = JS_ATOM_toString;
11112|      4|        } else {
11113|      2|            method_name = JS_ATOM_valueOf;
11114|      2|        }
11115|      6|        method = JS_GetProperty(ctx, val, method_name);
11116|      6|        if (JS_IsException(method))
  ------------------
  |  Branch (11116:13): [True: 0, False: 6]
  ------------------
11117|      0|            goto exception;
11118|      6|        if (JS_IsFunction(ctx, method)) {
  ------------------
  |  Branch (11118:13): [True: 6, False: 0]
  ------------------
11119|      6|            ret = JS_CallFree(ctx, method, val, 0, NULL);
11120|      6|            if (JS_IsException(ret))
  ------------------
  |  Branch (11120:17): [True: 0, False: 6]
  ------------------
11121|      0|                goto exception;
11122|      6|            if (JS_VALUE_GET_TAG(ret) != JS_TAG_OBJECT) {
  ------------------
  |  |  236|      6|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (11122:17): [True: 4, False: 2]
  ------------------
11123|      4|                JS_FreeValue(ctx, val);
11124|      4|                return ret;
11125|      4|            }
11126|      2|            JS_FreeValue(ctx, ret);
11127|      2|        } else {
11128|      0|            JS_FreeValue(ctx, method);
11129|      0|        }
11130|      6|    }
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|      4|{
11232|      4|    const uint8_t *p, *p_next, *p_start;
11233|      4|    uint32_t c;
11234|       |
11235|      4|    p = p_start = (const uint8_t *)pc;
11236|      4|    for (;;) {
11237|      4|        c = *p;
11238|      4|        if (c < 128) {
  ------------------
  |  Branch (11238:13): [True: 4, False: 0]
  ------------------
11239|      4|            if (!((c >= 0x09 && c <= 0x0d) || (c == 0x20)))
  ------------------
  |  Branch (11239:20): [True: 4, False: 0]
  |  Branch (11239:33): [True: 0, False: 4]
  |  Branch (11239:47): [True: 0, False: 4]
  ------------------
11240|      4|                break;
11241|      0|            p++;
11242|      0|        } 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|      4|    }
11249|      4|    return p - p_start;
11250|      4|}
quickjs.c:js_atof:
12765|     17|{
12766|     17|    const char *p, *p_start;
12767|     17|    int sep, is_neg;
12768|     17|    BOOL is_float, has_legacy_octal;
12769|     17|    int atod_type = flags & ATOD_TYPE_MASK;
  ------------------
  |  |12754|     17|#define ATOD_TYPE_MASK        (3 << 7)
  ------------------
12770|     17|    char buf1[64], *buf;
12771|     17|    int i, j, len;
12772|     17|    BOOL buf_allocated = FALSE;
12773|     17|    JSValue val;
12774|     17|    JSATODTempMem atod_mem;
12775|       |    
12776|       |    /* optional separator between digits */
12777|     17|    sep = (flags & ATOD_ACCEPT_UNDERSCORES) ? '_' : 256;
  ------------------
  |  |12750|     17|#define ATOD_ACCEPT_UNDERSCORES  (1 << 5)
  ------------------
  |  Branch (12777:11): [True: 15, False: 2]
  ------------------
12778|     17|    has_legacy_octal = FALSE;
12779|       |
12780|     17|    p = str;
12781|     17|    p_start = p;
12782|     17|    is_neg = 0;
12783|     17|    if (p[0] == '+') {
  ------------------
  |  Branch (12783:9): [True: 0, False: 17]
  ------------------
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|     17|    } else if (p[0] == '-') {
  ------------------
  |  Branch (12788:16): [True: 0, False: 17]
  ------------------
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|     17|    if (p[0] == '0') {
  ------------------
  |  Branch (12795:9): [True: 3, False: 14]
  ------------------
12796|      3|        if ((p[1] == 'x' || p[1] == 'X') &&
  ------------------
  |  Branch (12796:14): [True: 0, False: 3]
  |  Branch (12796:29): [True: 1, False: 2]
  ------------------
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|      2|        } else if ((p[1] == 'o' || p[1] == 'O') &&
  ------------------
  |  Branch (12800:21): [True: 0, False: 2]
  |  Branch (12800:36): [True: 0, False: 2]
  ------------------
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|      2|        } else if ((p[1] == 'b' || p[1] == 'B') &&
  ------------------
  |  Branch (12804:21): [True: 0, False: 2]
  |  Branch (12804:36): [True: 0, False: 2]
  ------------------
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|      2|        } else if ((p[1] >= '0' && p[1] <= '9') &&
  ------------------
  |  Branch (12808:21): [True: 0, False: 2]
  |  Branch (12808:36): [True: 0, False: 0]
  ------------------
12809|      0|                   radix == 0 && (flags & ATOD_ACCEPT_LEGACY_OCTAL)) {
  ------------------
  |  |12748|      0|#define ATOD_ACCEPT_LEGACY_OCTAL  (1 << 4)
  ------------------
  |  Branch (12809:20): [True: 0, False: 0]
  |  Branch (12809:34): [True: 0, False: 0]
  ------------------
12810|      0|            int i;
12811|      0|            has_legacy_octal = TRUE;
12812|      0|            sep = 256;
12813|      0|            for (i = 1; (p[i] >= '0' && p[i] <= '7'); i++)
  ------------------
  |  Branch (12813:26): [True: 0, False: 0]
  |  Branch (12813:41): [True: 0, False: 0]
  ------------------
12814|      0|                continue;
12815|      0|            if (p[i] == '8' || p[i] == '9')
  ------------------
  |  Branch (12815:17): [True: 0, False: 0]
  |  Branch (12815:32): [True: 0, False: 0]
  ------------------
12816|      0|                goto no_prefix;
12817|      0|            p += 1;
12818|      0|            radix = 8;
12819|      2|        } else {
12820|      2|            goto no_prefix;
12821|      2|        }
12822|       |        /* there must be a digit after the prefix */
12823|      1|        if (to_digit((uint8_t)*p) >= radix)
  ------------------
  |  Branch (12823:13): [True: 0, False: 1]
  ------------------
12824|      0|            goto fail;
12825|      3|    no_prefix: ;
12826|     14|    } else {
12827|     14| no_radix_prefix:
12828|     14|        if (!(flags & ATOD_INT_ONLY) &&
  ------------------
  |  |12744|     14|#define ATOD_INT_ONLY        (1 << 0)
  ------------------
  |  Branch (12828:13): [True: 14, False: 0]
  ------------------
12829|     14|            (atod_type == ATOD_TYPE_FLOAT64) &&
  ------------------
  |  |12755|     14|#define ATOD_TYPE_FLOAT64     (0 << 7)
  ------------------
  |  Branch (12829:13): [True: 14, False: 0]
  ------------------
12830|     14|            strstart(p, "Infinity", &p)) {
  ------------------
  |  Branch (12830:13): [True: 0, False: 14]
  ------------------
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|     14|    }
12838|     17|    if (radix == 0)
  ------------------
  |  Branch (12838:9): [True: 16, False: 1]
  ------------------
12839|     16|        radix = 10;
12840|     17|    is_float = FALSE;
12841|     17|    p_start = p;
12842|  2.09M|    while (to_digit((uint8_t)*p) < radix
  ------------------
  |  Branch (12842:12): [True: 2.09M, False: 17]
  ------------------
12843|     17|           ||  (*p == sep && (radix != 10 ||
  ------------------
  |  Branch (12843:17): [True: 0, False: 17]
  |  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|  2.09M|                to_digit((uint8_t)p[1]) < radix)) {
  ------------------
  |  Branch (12845:17): [True: 0, False: 0]
  ------------------
12846|  2.09M|        p++;
12847|  2.09M|    }
12848|     17|    if (!(flags & ATOD_INT_ONLY) && radix == 10) {
  ------------------
  |  |12744|     17|#define ATOD_INT_ONLY        (1 << 0)
  ------------------
  |  Branch (12848:9): [True: 17, False: 0]
  |  Branch (12848:37): [True: 16, False: 1]
  ------------------
12849|     16|        if (*p == '.' && (p > p_start || to_digit((uint8_t)p[1]) < radix)) {
  ------------------
  |  Branch (12849:13): [True: 10, False: 6]
  |  Branch (12849:27): [True: 10, False: 0]
  |  Branch (12849:42): [True: 0, False: 0]
  ------------------
12850|     10|            is_float = TRUE;
12851|     10|            p++;
12852|     10|            if (*p == sep)
  ------------------
  |  Branch (12852:17): [True: 0, False: 10]
  ------------------
12853|      0|                goto fail;
12854|     11|            while (to_digit((uint8_t)*p) < radix ||
  ------------------
  |  Branch (12854:20): [True: 1, False: 10]
  ------------------
12855|     10|                   (*p == sep && to_digit((uint8_t)p[1]) < radix))
  ------------------
  |  Branch (12855:21): [True: 0, False: 10]
  |  Branch (12855:34): [True: 0, False: 0]
  ------------------
12856|      1|                p++;
12857|     10|        }
12858|     16|        if (p > p_start && (*p == 'e' || *p == 'E')) {
  ------------------
  |  Branch (12858:13): [True: 15, False: 1]
  |  Branch (12858:29): [True: 0, False: 15]
  |  Branch (12858:42): [True: 0, False: 15]
  ------------------
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|     16|    }
12873|     17|    if (p == p_start)
  ------------------
  |  Branch (12873:9): [True: 1, False: 16]
  ------------------
12874|      1|        goto fail;
12875|       |
12876|     16|    buf = buf1;
12877|     16|    buf_allocated = FALSE;
12878|     16|    len = p - p_start;
12879|     16|    if (unlikely((len + 2) > sizeof(buf1))) {
  ------------------
  |  |   33|     16|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 14]
  |  |  ------------------
  ------------------
12880|      2|        buf = js_malloc_rt(ctx->rt, len + 2); /* no exception raised */
12881|      2|        if (!buf)
  ------------------
  |  Branch (12881:13): [True: 0, False: 2]
  ------------------
12882|      0|            goto mem_error;
12883|      2|        buf_allocated = TRUE;
12884|      2|    }
12885|       |    /* remove the separators and the radix prefixes */
12886|     16|    j = 0;
12887|     16|    if (is_neg)
  ------------------
  |  Branch (12887:9): [True: 0, False: 16]
  ------------------
12888|      0|        buf[j++] = '-';
12889|  2.09M|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (12889:17): [True: 2.09M, False: 16]
  ------------------
12890|  2.09M|        if (p_start[i] != '_')
  ------------------
  |  Branch (12890:13): [True: 2.09M, False: 0]
  ------------------
12891|  2.09M|            buf[j++] = p_start[i];
12892|  2.09M|    }
12893|     16|    buf[j] = '\0';
12894|       |
12895|     16|    if ((flags & ATOD_ACCEPT_SUFFIX) && *p == 'n') {
  ------------------
  |  |12752|     16|#define ATOD_ACCEPT_SUFFIX    (1 << 6)
  ------------------
  |  Branch (12895:9): [True: 15, False: 1]
  |  Branch (12895:41): [True: 0, False: 15]
  ------------------
12896|      0|        p++;
12897|      0|        atod_type = ATOD_TYPE_BIG_INT;
  ------------------
  |  |12756|      0|#define ATOD_TYPE_BIG_INT     (1 << 7)
  ------------------
12898|      0|    }
12899|       |
12900|     16|    switch(atod_type) {
12901|     16|    case ATOD_TYPE_FLOAT64:
  ------------------
  |  |12755|     16|#define ATOD_TYPE_FLOAT64     (0 << 7)
  ------------------
  |  Branch (12901:5): [True: 16, False: 0]
  ------------------
12902|     16|        {
12903|     16|            double d;
12904|     16|            d = js_atod(buf, NULL, radix, is_float ? 0 : JS_ATOD_INT_ONLY,
  ------------------
  |  |   49|      6|#define JS_ATOD_INT_ONLY       (1 << 0)
  ------------------
  |  Branch (12904:43): [True: 10, False: 6]
  ------------------
12905|     16|                        &atod_mem);
12906|       |            /* return int or float64 */
12907|     16|            val = JS_NewFloat64(ctx, d);
12908|     16|        }
12909|     16|        break;
12910|      0|    case ATOD_TYPE_BIG_INT:
  ------------------
  |  |12756|      0|#define ATOD_TYPE_BIG_INT     (1 << 7)
  ------------------
  |  Branch (12910:5): [True: 0, False: 16]
  ------------------
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: 16]
  ------------------
12924|      0|        abort();
12925|     16|    }
12926|       |
12927|     17|done:
12928|     17|    if (buf_allocated)
  ------------------
  |  Branch (12928:9): [True: 2, False: 15]
  ------------------
12929|      2|        js_free_rt(ctx->rt, buf);
12930|     17|    if (pp)
  ------------------
  |  Branch (12930:9): [True: 17, False: 0]
  ------------------
12931|     17|        *pp = p;
12932|     17|    return val;
12933|      1| fail:
12934|      1|    val = JS_NAN;
  ------------------
  |  |  252|      1|#define JS_NAN (JSValue){ .u.float64 = JS_FLOAT64_NAN, JS_TAG_FLOAT64 }
  |  |  ------------------
  |  |  |  |  103|      1|#define JS_FLOAT64_NAN NAN
  |  |  ------------------
  ------------------
12935|      1|    goto done;
12936|      0| mem_error:
12937|      0|    val = JS_ThrowOutOfMemory(ctx);
12938|      0|    goto done;
12939|     16|}
quickjs.c:to_digit:
11253|  2.09M|{
11254|  2.09M|    if (c >= '0' && c <= '9')
  ------------------
  |  Branch (11254:9): [True: 2.09M, False: 27]
  |  Branch (11254:21): [True: 1.04M, False: 1.04M]
  ------------------
11255|  1.04M|        return c - '0';
11256|  1.04M|    else if (c >= 'A' && c <= 'Z')
  ------------------
  |  Branch (11256:14): [True: 1.04M, False: 27]
  |  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: 27]
  |  Branch (11258:26): [True: 1.04M, False: 0]
  ------------------
11259|  1.04M|        return c - 'a' + 10;
11260|     27|    else
11261|     27|        return 36;
11262|  2.09M|}
quickjs.c:JS_ToFloat64Free:
13063|      4|{
13064|      4|    uint32_t tag;
13065|       |
13066|      4|    tag = JS_VALUE_GET_TAG(val);
  ------------------
  |  |  236|      4|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
13067|      4|    if (tag <= JS_TAG_NULL) {
  ------------------
  |  Branch (13067:9): [True: 1, False: 3]
  ------------------
13068|      1|        *pres = JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|      1|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
13069|      1|        return 0;
13070|      3|    } else if (JS_TAG_IS_FLOAT64(tag)) {
  ------------------
  |  |  250|      3|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 3, False: 0]
  |  |  ------------------
  ------------------
13071|      3|        *pres = JS_VALUE_GET_FLOAT64(val);
  ------------------
  |  |  241|      3|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
13072|      3|        return 0;
13073|      3|    } else {
13074|      0|        return __JS_ToFloat64Free(ctx, pres, val);
13075|      0|    }
13076|      4|}
quickjs.c:JS_ToInt64SatFree:
13192|      3|{
13193|      3|    uint32_t tag;
13194|       |
13195|      3| redo:
13196|      3|    tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
13197|      3|    switch(tag) {
13198|      3|    case JS_TAG_INT:
  ------------------
  |  Branch (13198:5): [True: 3, False: 0]
  ------------------
13199|      3|    case JS_TAG_BOOL:
  ------------------
  |  Branch (13199:5): [True: 0, False: 3]
  ------------------
13200|      3|    case JS_TAG_NULL:
  ------------------
  |  Branch (13200:5): [True: 0, False: 3]
  ------------------
13201|      3|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (13201:5): [True: 0, False: 3]
  ------------------
13202|      3|        *pres = JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|      3|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
13203|      3|        return 0;
13204|      0|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (13204:5): [True: 0, False: 3]
  ------------------
13205|      0|        *pres = 0;
13206|      0|        return -1;
13207|      0|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (13207:5): [True: 0, False: 3]
  ------------------
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: 3]
  ------------------
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|      3|    }
13230|      3|}
quickjs.c:JS_ToInt32Free:
13320|      8|{
13321|      8|    uint32_t tag;
13322|      8|    int32_t ret;
13323|       |
13324|      8| redo:
13325|      8|    tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  238|      8|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      8|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
13326|      8|    switch(tag) {
13327|      8|    case JS_TAG_INT:
  ------------------
  |  Branch (13327:5): [True: 8, False: 0]
  ------------------
13328|      8|    case JS_TAG_BOOL:
  ------------------
  |  Branch (13328:5): [True: 0, False: 8]
  ------------------
13329|      8|    case JS_TAG_NULL:
  ------------------
  |  Branch (13329:5): [True: 0, False: 8]
  ------------------
13330|      8|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (13330:5): [True: 0, False: 8]
  ------------------
13331|      8|        ret = JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|      8|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
13332|      8|        break;
13333|      0|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (13333:5): [True: 0, False: 8]
  ------------------
13334|      0|        {
13335|      0|            JSFloat64Union u;
13336|      0|            double d;
13337|      0|            int e;
13338|      0|            d = JS_VALUE_GET_FLOAT64(val);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
13339|      0|            u.d = d;
13340|       |            /* we avoid doing fmod(x, 2^32) */
13341|      0|            e = (u.u64 >> 52) & 0x7ff;
13342|      0|            if (likely(e <= (1023 + 30))) {
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
13343|       |                /* fast case */
13344|      0|                ret = (int32_t)d;
13345|      0|            } else if (e <= (1023 + 30 + 53)) {
  ------------------
  |  Branch (13345:24): [True: 0, False: 0]
  ------------------
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|      0|            } else {
13355|      0|                ret = 0; /* also handles NaN and +inf */
13356|      0|            }
13357|      0|        }
13358|      0|        break;
13359|      0|    default:
  ------------------
  |  Branch (13359:5): [True: 0, False: 8]
  ------------------
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|      8|    }
13367|      8|    *pres = ret;
13368|      8|    return 0;
13369|      8|}
quickjs.c:JS_ToStringInternal:
13589|     28|{
13590|     28|    uint32_t tag;
13591|     28|    char buf[32];
13592|       |
13593|     28|    tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  238|     28|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|     28|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
13594|     28|    switch(tag) {
13595|     25|    case JS_TAG_STRING:
  ------------------
  |  Branch (13595:5): [True: 25, False: 3]
  ------------------
13596|     25|        return JS_DupValue(ctx, val);
13597|      0|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (13597:5): [True: 0, False: 28]
  ------------------
13598|      0|        return js_linearize_string_rope(ctx, JS_DupValue(ctx, val));
13599|      0|    case JS_TAG_INT:
  ------------------
  |  Branch (13599:5): [True: 0, False: 28]
  ------------------
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: 28]
  ------------------
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: 28]
  ------------------
13610|      0|        return JS_AtomToString(ctx, JS_ATOM_null);
13611|      0|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (13611:5): [True: 0, False: 28]
  ------------------
13612|      0|        return JS_AtomToString(ctx, JS_ATOM_undefined);
13613|      0|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (13613:5): [True: 0, False: 28]
  ------------------
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|      2|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (13615:5): [True: 2, False: 26]
  ------------------
13616|      2|        {
13617|      2|            JSValue val1, ret;
13618|      2|            val1 = JS_ToPrimitive(ctx, val, HINT_STRING);
  ------------------
  |  | 1244|      2|#define HINT_STRING  0
  ------------------
13619|      2|            if (JS_IsException(val1))
  ------------------
  |  Branch (13619:17): [True: 0, False: 2]
  ------------------
13620|      0|                return val1;
13621|      2|            ret = JS_ToStringInternal(ctx, val1, is_ToPropertyKey);
13622|      2|            JS_FreeValue(ctx, val1);
13623|      2|            return ret;
13624|      2|        }
13625|      0|        break;
13626|      0|    case JS_TAG_FUNCTION_BYTECODE:
  ------------------
  |  Branch (13626:5): [True: 0, False: 28]
  ------------------
13627|      0|        return js_new_string8(ctx, "[function bytecode]");
13628|      0|    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (13628:5): [True: 0, False: 28]
  ------------------
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: 27]
  ------------------
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: 28]
  ------------------
13638|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (13638:5): [True: 0, False: 28]
  ------------------
13639|      0|        return js_bigint_to_string(ctx, val);
13640|      0|    default:
  ------------------
  |  Branch (13640:5): [True: 0, False: 28]
  ------------------
13641|      0|        return js_new_string8(ctx, "[unsupported type]");
13642|     28|    }
13643|     28|}
quickjs.c:string_buffer_concat:
 4249|   171k|{
 4250|   171k|    if (to <= from)
  ------------------
  |  Branch (4250:9): [True: 135k, False: 36.3k]
  ------------------
 4251|   135k|        return 0;
 4252|  36.3k|    if (p->is_wide_char)
  ------------------
  |  Branch (4252:9): [True: 626, False: 35.7k]
  ------------------
 4253|    626|        return string_buffer_write16(s, p->u.str16 + from, to - from);
 4254|  35.7k|    else
 4255|  35.7k|        return string_buffer_write8(s, p->u.str8 + from, to - from);
 4256|  36.3k|}
quickjs.c:string_buffer_write16:
 4216|    626|{
 4217|    626|    int c = 0, i;
 4218|       |
 4219|   855k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (4219:17): [True: 855k, False: 626]
  ------------------
 4220|   855k|        c |= p[i];
 4221|   855k|    }
 4222|    626|    if (s->len + len > s->size) {
  ------------------
  |  Branch (4222:9): [True: 2, False: 624]
  ------------------
 4223|      2|        if (string_buffer_realloc(s, s->len + len, c))
  ------------------
  |  Branch (4223:13): [True: 0, False: 2]
  ------------------
 4224|      0|            return -1;
 4225|    624|    } else if (!s->is_wide_char && c >= 0x100) {
  ------------------
  |  Branch (4225:16): [True: 0, False: 624]
  |  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|    626|    if (s->is_wide_char) {
  ------------------
  |  Branch (4229:9): [True: 626, False: 0]
  ------------------
 4230|    626|        memcpy(&s->str->u.str16[s->len], p, len << 1);
 4231|    626|        s->len += len;
 4232|    626|    } 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|    626|    return 0;
 4239|    626|}
quickjs.c:JS_ToPrimitive:
11138|      2|{
11139|      2|    return JS_ToPrimitiveFree(ctx, JS_DupValue(ctx, val), hint);
11140|      2|}
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|      2|{
15095|      2|    return tag == JS_TAG_STRING || tag == JS_TAG_STRING_ROPE;
  ------------------
  |  Branch (15095:12): [True: 1, False: 1]
  |  Branch (15095:36): [True: 0, False: 1]
  ------------------
15096|      2|}
quickjs.c:js_call_c_function:
17565|     11|{
17566|     11|    JSRuntime *rt = ctx->rt;
17567|     11|    JSCFunctionType func;
17568|     11|    JSObject *p;
17569|     11|    JSStackFrame sf_s, *sf = &sf_s, *prev_sf;
17570|     11|    JSValue ret_val;
17571|     11|    JSValueConst *arg_buf;
  ------------------
  |  |  234|     11|#define JSValueConst JSValue
  ------------------
17572|     11|    int arg_count, i;
17573|     11|    JSCFunctionEnum cproto;
17574|       |
17575|     11|    p = JS_VALUE_GET_OBJ(func_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)
  |  |  ------------------
  ------------------
17576|     11|    cproto = p->u.cfunc.cproto;
17577|     11|    arg_count = p->u.cfunc.length;
17578|       |
17579|       |    /* better to always check stack overflow */
17580|     11|    if (js_check_stack_overflow(rt, sizeof(arg_buf[0]) * arg_count))
  ------------------
  |  Branch (17580:9): [True: 0, False: 11]
  ------------------
17581|      0|        return JS_ThrowStackOverflow(ctx);
17582|       |
17583|     11|    prev_sf = rt->current_stack_frame;
17584|     11|    sf->prev_frame = prev_sf;
17585|     11|    rt->current_stack_frame = sf;
17586|     11|    ctx = p->u.cfunc.realm; /* change the current realm */
17587|     11|    sf->js_mode = 0;
17588|     11|    sf->cur_func = (JSValue)func_obj;
17589|     11|    sf->arg_count = argc;
17590|     11|    arg_buf = argv;
17591|       |
17592|     11|    if (unlikely(argc < arg_count)) {
  ------------------
  |  |   33|     11|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 4, False: 7]
  |  |  ------------------
  ------------------
17593|       |        /* ensure that at least argc_count arguments are readable */
17594|      4|        arg_buf = alloca(sizeof(arg_buf[0]) * arg_count);
17595|      5|        for(i = 0; i < argc; i++)
  ------------------
  |  Branch (17595:20): [True: 1, False: 4]
  ------------------
17596|      1|            arg_buf[i] = argv[i];
17597|      8|        for(i = argc; i < arg_count; i++)
  ------------------
  |  Branch (17597:23): [True: 4, False: 4]
  ------------------
17598|      4|            arg_buf[i] = 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 }
  |  |  ------------------
  ------------------
17599|      4|        sf->arg_count = arg_count;
17600|      4|    }
17601|     11|    sf->arg_buf = (JSValue*)arg_buf;
17602|       |
17603|     11|    func = p->u.cfunc.c_function;
17604|     11|    switch(cproto) {
17605|      0|    case JS_CFUNC_constructor:
  ------------------
  |  Branch (17605:5): [True: 0, False: 11]
  ------------------
17606|      0|    case JS_CFUNC_constructor_or_func:
  ------------------
  |  Branch (17606:5): [True: 0, False: 11]
  ------------------
17607|      0|        if (!(flags & JS_CALL_FLAG_CONSTRUCTOR)) {
  ------------------
  |  |  526|      0|#define JS_CALL_FLAG_CONSTRUCTOR (1 << 0)
  ------------------
  |  Branch (17607:13): [True: 0, False: 0]
  ------------------
17608|      0|            if (cproto == JS_CFUNC_constructor) {
  ------------------
  |  Branch (17608:17): [True: 0, False: 0]
  ------------------
17609|      0|            not_a_constructor:
17610|      0|                ret_val = JS_ThrowTypeError(ctx, "must be called with new");
17611|      0|                break;
17612|      0|            } else {
17613|      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 }
  |  |  ------------------
  ------------------
17614|      0|            }
17615|      0|        }
17616|       |        /* here this_obj is new_target */
17617|       |        /* fall thru */
17618|      8|    case JS_CFUNC_generic:
  ------------------
  |  Branch (17618:5): [True: 8, False: 3]
  ------------------
17619|      8|        ret_val = func.generic(ctx, this_obj, argc, arg_buf);
17620|      8|        break;
17621|      0|    case JS_CFUNC_constructor_magic:
  ------------------
  |  Branch (17621:5): [True: 0, False: 11]
  ------------------
17622|      0|    case JS_CFUNC_constructor_or_func_magic:
  ------------------
  |  Branch (17622:5): [True: 0, False: 11]
  ------------------
17623|      0|        if (!(flags & JS_CALL_FLAG_CONSTRUCTOR)) {
  ------------------
  |  |  526|      0|#define JS_CALL_FLAG_CONSTRUCTOR (1 << 0)
  ------------------
  |  Branch (17623:13): [True: 0, False: 0]
  ------------------
17624|      0|            if (cproto == JS_CFUNC_constructor_magic) {
  ------------------
  |  Branch (17624:17): [True: 0, False: 0]
  ------------------
17625|      0|                goto not_a_constructor;
17626|      0|            } else {
17627|      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 }
  |  |  ------------------
  ------------------
17628|      0|            }
17629|      0|        }
17630|       |        /* fall thru */
17631|      3|    case JS_CFUNC_generic_magic:
  ------------------
  |  Branch (17631:5): [True: 3, False: 8]
  ------------------
17632|      3|        ret_val = func.generic_magic(ctx, this_obj, argc, arg_buf,
17633|      3|                                     p->u.cfunc.magic);
17634|      3|        break;
17635|      0|    case JS_CFUNC_getter:
  ------------------
  |  Branch (17635:5): [True: 0, False: 11]
  ------------------
17636|      0|        ret_val = func.getter(ctx, this_obj);
17637|      0|        break;
17638|      0|    case JS_CFUNC_setter:
  ------------------
  |  Branch (17638:5): [True: 0, False: 11]
  ------------------
17639|      0|        ret_val = func.setter(ctx, this_obj, arg_buf[0]);
17640|      0|        break;
17641|      0|    case JS_CFUNC_getter_magic:
  ------------------
  |  Branch (17641:5): [True: 0, False: 11]
  ------------------
17642|      0|        ret_val = func.getter_magic(ctx, this_obj, p->u.cfunc.magic);
17643|      0|        break;
17644|      0|    case JS_CFUNC_setter_magic:
  ------------------
  |  Branch (17644:5): [True: 0, False: 11]
  ------------------
17645|      0|        ret_val = func.setter_magic(ctx, this_obj, arg_buf[0], p->u.cfunc.magic);
17646|      0|        break;
17647|      0|    case JS_CFUNC_f_f:
  ------------------
  |  Branch (17647:5): [True: 0, False: 11]
  ------------------
17648|      0|        {
17649|      0|            double d1;
17650|       |
17651|      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]
  |  |  ------------------
  ------------------
17652|      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 }
  |  |  ------------------
  ------------------
17653|      0|                break;
17654|      0|            }
17655|      0|            ret_val = JS_NewFloat64(ctx, func.f_f(d1));
17656|      0|        }
17657|      0|        break;
17658|      0|    case JS_CFUNC_f_f_f:
  ------------------
  |  Branch (17658:5): [True: 0, False: 11]
  ------------------
17659|      0|        {
17660|      0|            double d1, d2;
17661|       |
17662|      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]
  |  |  ------------------
  ------------------
17663|      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 }
  |  |  ------------------
  ------------------
17664|      0|                break;
17665|      0|            }
17666|      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]
  |  |  ------------------
  ------------------
17667|      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 }
  |  |  ------------------
  ------------------
17668|      0|                break;
17669|      0|            }
17670|      0|            ret_val = JS_NewFloat64(ctx, func.f_f_f(d1, d2));
17671|      0|        }
17672|      0|        break;
17673|      0|    case JS_CFUNC_iterator_next:
  ------------------
  |  Branch (17673:5): [True: 0, False: 11]
  ------------------
17674|      0|        {
17675|      0|            int done;
17676|      0|            ret_val = func.iterator_next(ctx, this_obj, argc, arg_buf,
17677|      0|                                         &done, p->u.cfunc.magic);
17678|      0|            if (!JS_IsException(ret_val) && done != 2) {
  ------------------
  |  Branch (17678:17): [True: 0, False: 0]
  |  Branch (17678:45): [True: 0, False: 0]
  ------------------
17679|      0|                ret_val = js_create_iterator_result(ctx, ret_val, done);
17680|      0|            }
17681|      0|        }
17682|      0|        break;
17683|      0|    default:
  ------------------
  |  Branch (17683:5): [True: 0, False: 11]
  ------------------
17684|      0|        abort();
17685|     11|    }
17686|       |
17687|     11|    rt->current_stack_frame = sf->prev_frame;
17688|     11|    return ret_val;
17689|     11|}
quickjs.c:JS_CallInternal:
17749|     86|{
17750|     86|    JSRuntime *rt = caller_ctx->rt;
17751|     86|    JSContext *ctx;
17752|     86|    JSObject *p;
17753|     86|    JSFunctionBytecode *b;
17754|     86|    JSStackFrame sf_s, *sf = &sf_s;
17755|     86|    const uint8_t *pc;
17756|     86|    int opcode, arg_allocated_size, i;
17757|     86|    JSValue *local_buf, *stack_buf, *var_buf, *arg_buf, *sp, ret_val, *pval;
17758|     86|    JSVarRef **var_refs;
17759|     86|    size_t alloca_size;
17760|       |
17761|       |#if !DIRECT_DISPATCH
17762|       |#define SWITCH(pc)      switch (opcode = *pc++)
17763|       |#define CASE(op)        case op
17764|       |#define DEFAULT         default
17765|       |#define BREAK           break
17766|       |#else
17767|     86|    static const void * const dispatch_table[256] = {
17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
17769|     86|#if SHORT_OPCODES
17770|     86|#define def(id, size, n_pop, n_push, f)
17771|       |#else
17772|       |#define def(id, size, n_pop, n_push, f) && case_default,
17773|       |#endif
17774|     86|#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|     86|#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|     86|DEF(invalid, 1, 0, 0, none) /* never emitted */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   66|       |
  |  |   67|       |/* push values */
  |  |   68|     86|DEF(       push_i32, 5, 0, 1, i32)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   69|     86|DEF(     push_const, 5, 0, 1, const)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   70|     86|DEF(       fclosure, 5, 0, 1, const) /* must follow push_const */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   71|     86|DEF(push_atom_value, 5, 0, 1, atom)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   72|     86|DEF( private_symbol, 5, 0, 1, atom)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   73|     86|DEF(      undefined, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   74|     86|DEF(           null, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   75|     86|DEF(      push_this, 1, 0, 1, none) /* only used at the start of a function */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   76|     86|DEF(     push_false, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   77|     86|DEF(      push_true, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   78|     86|DEF(         object, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   79|     86|DEF( special_object, 2, 0, 1, u8) /* only used at the start of a function */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   80|     86|DEF(           rest, 3, 0, 1, u16) /* only used at the start of a function */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   81|       |
  |  |   82|     86|DEF(           drop, 1, 1, 0, none) /* a -> */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   83|     86|DEF(            nip, 1, 2, 1, none) /* a b -> b */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   84|     86|DEF(           nip1, 1, 3, 2, none) /* a b c -> b c */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   85|     86|DEF(            dup, 1, 1, 2, none) /* a -> a a */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   86|     86|DEF(           dup1, 1, 2, 3, none) /* a b -> a a b */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   87|     86|DEF(           dup2, 1, 2, 4, none) /* a b -> a b a b */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   88|     86|DEF(           dup3, 1, 3, 6, none) /* a b c -> a b c a b c */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   89|     86|DEF(        insert2, 1, 2, 3, none) /* obj a -> a obj a (dup_x1) */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   90|     86|DEF(        insert3, 1, 3, 4, none) /* obj prop a -> a obj prop a (dup_x2) */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   91|     86|DEF(        insert4, 1, 4, 5, none) /* this obj prop a -> a this obj prop a */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   92|     86|DEF(          perm3, 1, 3, 3, none) /* obj a b -> a obj b */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   93|     86|DEF(          perm4, 1, 4, 4, none) /* obj prop a b -> a obj prop b */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   94|     86|DEF(          perm5, 1, 5, 5, none) /* this obj prop a b -> a this obj prop b */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   95|     86|DEF(           swap, 1, 2, 2, none) /* a b -> b a */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   96|     86|DEF(          swap2, 1, 4, 4, none) /* a b c d -> c d a b */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   97|     86|DEF(          rot3l, 1, 3, 3, none) /* x a b -> a b x */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   98|     86|DEF(          rot3r, 1, 3, 3, none) /* a b x -> x a b */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   99|     86|DEF(          rot4l, 1, 4, 4, none) /* x a b c -> a b c x */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  100|     86|DEF(          rot5l, 1, 5, 5, none) /* x a b c d -> a b c d x */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  101|       |
  |  |  102|     86|DEF(call_constructor, 3, 2, 1, npop) /* func new.target args -> ret. arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  103|     86|DEF(           call, 3, 1, 1, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  104|     86|DEF(      tail_call, 3, 1, 0, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  105|     86|DEF(    call_method, 3, 2, 1, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  106|     86|DEF(tail_call_method, 3, 2, 0, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  107|     86|DEF(     array_from, 3, 0, 1, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  108|     86|DEF(          apply, 3, 3, 1, u16)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  109|     86|DEF(         return, 1, 1, 0, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  110|     86|DEF(   return_undef, 1, 0, 0, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  111|     86|DEF(check_ctor_return, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  112|     86|DEF(     check_ctor, 1, 0, 0, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  113|     86|DEF(      init_ctor, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  114|     86|DEF(    check_brand, 1, 2, 2, none) /* this_obj func -> this_obj func */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  115|     86|DEF(      add_brand, 1, 2, 0, none) /* this_obj home_obj -> */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  116|     86|DEF(   return_async, 1, 1, 0, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  117|     86|DEF(          throw, 1, 1, 0, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  118|     86|DEF(    throw_error, 6, 0, 0, atom_u8)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  119|     86|DEF(           eval, 5, 1, 1, npop_u16) /* func args... -> ret_val */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  120|     86|DEF(     apply_eval, 3, 2, 1, u16) /* func array -> ret_eval */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  121|     86|DEF(         regexp, 1, 2, 1, none) /* create a RegExp object from the pattern and a
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  122|       |                                       bytecode string */
  |  |  123|     86|DEF(      get_super, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  124|     86|DEF(         import, 1, 2, 1, none) /* dynamic module import */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  125|       |
  |  |  126|     86|DEF(  get_var_undef, 3, 0, 1, var_ref) /* push undefined if the variable does not exist */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  127|     86|DEF(        get_var, 3, 0, 1, var_ref) /* throw an exception if the variable does not exist */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  128|     86|DEF(        put_var, 3, 1, 0, var_ref) /* must come after get_var */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  129|     86|DEF(   put_var_init, 3, 1, 0, var_ref) /* must come after put_var. Used to initialize a global lexical variable */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  130|       |
  |  |  131|     86|DEF(  get_ref_value, 1, 2, 3, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  132|     86|DEF(  put_ref_value, 1, 3, 0, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  133|       |
  |  |  134|     86|DEF(      get_field, 5, 1, 1, atom)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  135|     86|DEF(     get_field2, 5, 1, 2, atom)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  136|     86|DEF(      put_field, 5, 2, 0, atom)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  137|     86|DEF( get_private_field, 1, 2, 1, none) /* obj prop -> value */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  138|     86|DEF( put_private_field, 1, 3, 0, none) /* obj value prop -> */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  139|     86|DEF(define_private_field, 1, 3, 1, none) /* obj prop value -> obj */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  140|     86|DEF(   get_array_el, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  141|     86|DEF(  get_array_el2, 1, 2, 2, none) /* obj prop -> obj value */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  142|     86|DEF(  get_array_el3, 1, 2, 3, none) /* obj prop -> obj prop1 value */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  143|     86|DEF(   put_array_el, 1, 3, 0, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  144|     86|DEF(get_super_value, 1, 3, 1, none) /* this obj prop -> value */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  145|     86|DEF(put_super_value, 1, 4, 0, none) /* this obj prop value -> */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  146|     86|DEF(   define_field, 5, 2, 1, atom)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  147|     86|DEF(       set_name, 5, 1, 1, atom)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  148|     86|DEF(set_name_computed, 1, 2, 2, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  149|     86|DEF(      set_proto, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  150|     86|DEF(set_home_object, 1, 2, 2, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  151|     86|DEF(define_array_el, 1, 3, 2, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  152|     86|DEF(         append, 1, 3, 2, none) /* append enumerated object, update length */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  153|     86|DEF(copy_data_properties, 2, 3, 3, u8)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  154|     86|DEF(  define_method, 6, 2, 1, atom_u8)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  155|     86|DEF(define_method_computed, 2, 3, 1, u8) /* must come after define_method */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  156|     86|DEF(   define_class, 6, 2, 2, atom_u8) /* parent ctor -> ctor proto */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  157|     86|DEF(   define_class_computed, 6, 3, 3, atom_u8) /* field_name parent ctor -> field_name ctor proto (class with computed name) */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  158|       |
  |  |  159|     86|DEF(        get_loc, 3, 0, 1, loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  160|     86|DEF(        put_loc, 3, 1, 0, loc) /* must come after get_loc */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  161|     86|DEF(        set_loc, 3, 1, 1, loc) /* must come after put_loc */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  162|     86|DEF(        get_arg, 3, 0, 1, arg)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  163|     86|DEF(        put_arg, 3, 1, 0, arg) /* must come after get_arg */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  164|     86|DEF(        set_arg, 3, 1, 1, arg) /* must come after put_arg */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  165|     86|DEF(    get_var_ref, 3, 0, 1, var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  166|     86|DEF(    put_var_ref, 3, 1, 0, var_ref) /* must come after get_var_ref */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  167|     86|DEF(    set_var_ref, 3, 1, 1, var_ref) /* must come after put_var_ref */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  168|     86|DEF(set_loc_uninitialized, 3, 0, 0, loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  169|     86|DEF(  get_loc_check, 3, 0, 1, loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  170|     86|DEF(  put_loc_check, 3, 1, 0, loc) /* must come after get_loc_check */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  171|     86|DEF(  set_loc_check, 3, 1, 1, loc) /* must come after put_loc_check */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  172|     86|DEF(  put_loc_check_init, 3, 1, 0, loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  173|     86|DEF(get_loc_checkthis, 3, 0, 1, loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  174|     86|DEF(get_var_ref_check, 3, 0, 1, var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  175|     86|DEF(put_var_ref_check, 3, 1, 0, var_ref) /* must come after get_var_ref_check */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  176|     86|DEF(put_var_ref_check_init, 3, 1, 0, var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  177|     86|DEF(      close_loc, 3, 0, 0, loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  178|     86|DEF(       if_false, 5, 1, 0, label)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  179|     86|DEF(        if_true, 5, 1, 0, label) /* must come after if_false */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  180|     86|DEF(           goto, 5, 0, 0, label) /* must come after if_true */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  181|     86|DEF(          catch, 5, 0, 1, label)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  182|     86|DEF(          gosub, 5, 0, 0, label) /* used to execute the finally block */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  183|     86|DEF(            ret, 1, 1, 0, none) /* used to return from the finally block */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  184|     86|DEF(      nip_catch, 1, 2, 1, none) /* catch ... a -> a */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  185|       |
  |  |  186|     86|DEF(      to_object, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  187|       |//DEF(      to_string, 1, 1, 1, none)
  |  |  188|     86|DEF(     to_propkey, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  189|       |
  |  |  190|     86|DEF(   with_get_var, 10, 1, 0, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  191|     86|DEF(   with_put_var, 10, 2, 1, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  192|     86|DEF(with_delete_var, 10, 1, 0, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  193|     86|DEF(  with_make_ref, 10, 1, 0, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  194|     86|DEF(   with_get_ref, 10, 1, 0, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  195|       |
  |  |  196|     86|DEF(   make_loc_ref, 7, 0, 2, atom_u16)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  197|     86|DEF(   make_arg_ref, 7, 0, 2, atom_u16)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  198|     86|DEF(make_var_ref_ref, 7, 0, 2, atom_u16)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  199|     86|DEF(   make_var_ref, 5, 0, 2, atom)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  200|       |
  |  |  201|     86|DEF(   for_in_start, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  202|     86|DEF(   for_of_start, 1, 1, 3, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  203|     86|DEF(for_await_of_start, 1, 1, 3, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  204|     86|DEF(    for_in_next, 1, 1, 3, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  205|     86|DEF(    for_of_next, 2, 3, 5, u8)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  206|     86|DEF(for_await_of_next, 1, 3, 4, none) /* iter next catch_offset -> iter next catch_offset obj */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  207|     86|DEF(iterator_check_object, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  208|     86|DEF(iterator_get_value_done, 1, 2, 3, none) /* catch_offset obj -> catch_offset value done */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  209|     86|DEF( iterator_close, 1, 3, 0, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  210|     86|DEF(  iterator_next, 1, 4, 4, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  211|     86|DEF(  iterator_call, 2, 4, 5, u8)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  212|     86|DEF(  initial_yield, 1, 0, 0, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  213|     86|DEF(          yield, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  214|     86|DEF(     yield_star, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  215|     86|DEF(async_yield_star, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  216|     86|DEF(          await, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  217|       |
  |  |  218|       |/* arithmetic/logic operations */
  |  |  219|     86|DEF(            neg, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  220|     86|DEF(           plus, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  221|     86|DEF(            dec, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  222|     86|DEF(            inc, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  223|     86|DEF(       post_dec, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  224|     86|DEF(       post_inc, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  225|     86|DEF(        dec_loc, 2, 0, 0, loc8)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  226|     86|DEF(        inc_loc, 2, 0, 0, loc8)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  227|     86|DEF(        add_loc, 2, 1, 0, loc8)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  228|     86|DEF(            not, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  229|     86|DEF(           lnot, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  230|     86|DEF(         typeof, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  231|     86|DEF(         delete, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  232|     86|DEF(     delete_var, 5, 0, 1, atom)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  233|       |
  |  |  234|     86|DEF(            mul, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  235|     86|DEF(            div, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  236|     86|DEF(            mod, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  237|     86|DEF(            add, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  238|     86|DEF(            sub, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  239|     86|DEF(            pow, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  240|     86|DEF(            shl, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  241|     86|DEF(            sar, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  242|     86|DEF(            shr, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  243|     86|DEF(             lt, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  244|     86|DEF(            lte, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  245|     86|DEF(             gt, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  246|     86|DEF(            gte, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  247|     86|DEF(     instanceof, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  248|     86|DEF(             in, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  249|     86|DEF(             eq, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  250|     86|DEF(            neq, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  251|     86|DEF(      strict_eq, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  252|     86|DEF(     strict_neq, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  253|     86|DEF(            and, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  254|     86|DEF(            xor, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  255|     86|DEF(             or, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  256|     86|DEF(is_undefined_or_null, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  257|     86|DEF(     private_in, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  258|     86|DEF(push_bigint_i32, 5, 0, 1, i32)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  259|       |/* must be the last non short and non temporary opcode */
  |  |  260|     86|DEF(            nop, 1, 0, 0, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  261|       |
  |  |  262|       |/* temporary opcodes: never emitted in the final bytecode */
  |  |  263|       |
  |  |  264|     86|def(    enter_scope, 3, 0, 0, u16)  /* emitted in phase 1, removed in phase 2 */
  |  |  265|     86|def(    leave_scope, 3, 0, 0, u16)  /* emitted in phase 1, removed in phase 2 */
  |  |  266|       |
  |  |  267|     86|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|     86|def(scope_get_var_undef, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  272|     86|def(  scope_get_var, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  273|     86|def(  scope_put_var, 7, 1, 0, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  274|     86|def(scope_delete_var, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  275|     86|def( scope_make_ref, 11, 0, 2, atom_label_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  276|     86|def(  scope_get_ref, 7, 0, 2, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  277|     86|def(scope_put_var_init, 7, 0, 2, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  278|     86|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|     86|def(scope_get_private_field, 7, 1, 1, atom_u16) /* obj -> value, emitted in phase 1, removed in phase 2 */
  |  |  280|     86|def(scope_get_private_field2, 7, 1, 2, atom_u16) /* obj -> obj value, emitted in phase 1, removed in phase 2 */
  |  |  281|     86|def(scope_put_private_field, 7, 2, 0, atom_u16) /* obj value ->, emitted in phase 1, removed in phase 2 */
  |  |  282|     86|def(scope_in_private_field, 7, 1, 1, atom_u16) /* obj -> res emitted in phase 1, removed in phase 2 */
  |  |  283|     86|def(get_field_opt_chain, 5, 1, 1, atom) /* emitted in phase 1, removed in phase 2 */
  |  |  284|     86|def(get_array_el_opt_chain, 1, 2, 1, none) /* emitted in phase 1, removed in phase 2 */
  |  |  285|     86|def( set_class_name, 5, 1, 1, u32) /* emitted in phase 1, removed in phase 2 */
  |  |  286|       |
  |  |  287|     86|def(       line_num, 5, 0, 0, u32) /* emitted in phase 1, removed in phase 3 */
  |  |  288|       |
  |  |  289|     86|#if SHORT_OPCODES
  |  |  290|     86|DEF(    push_minus1, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  291|     86|DEF(         push_0, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  292|     86|DEF(         push_1, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  293|     86|DEF(         push_2, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  294|     86|DEF(         push_3, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  295|     86|DEF(         push_4, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  296|     86|DEF(         push_5, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  297|     86|DEF(         push_6, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  298|     86|DEF(         push_7, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  299|     86|DEF(        push_i8, 2, 0, 1, i8)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  300|     86|DEF(       push_i16, 3, 0, 1, i16)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  301|     86|DEF(    push_const8, 2, 0, 1, const8)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  302|     86|DEF(      fclosure8, 2, 0, 1, const8) /* must follow push_const8 */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  303|     86|DEF(push_empty_string, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  304|       |
  |  |  305|     86|DEF(       get_loc8, 2, 0, 1, loc8)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  306|     86|DEF(       put_loc8, 2, 1, 0, loc8)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  307|     86|DEF(       set_loc8, 2, 1, 1, loc8)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  308|       |
  |  |  309|     86|DEF(       get_loc0, 1, 0, 1, none_loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  310|     86|DEF(       get_loc1, 1, 0, 1, none_loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  311|     86|DEF(       get_loc2, 1, 0, 1, none_loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  312|     86|DEF(       get_loc3, 1, 0, 1, none_loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  313|     86|DEF(       put_loc0, 1, 1, 0, none_loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  314|     86|DEF(       put_loc1, 1, 1, 0, none_loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  315|     86|DEF(       put_loc2, 1, 1, 0, none_loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  316|     86|DEF(       put_loc3, 1, 1, 0, none_loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  317|     86|DEF(       set_loc0, 1, 1, 1, none_loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  318|     86|DEF(       set_loc1, 1, 1, 1, none_loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  319|     86|DEF(       set_loc2, 1, 1, 1, none_loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  320|     86|DEF(       set_loc3, 1, 1, 1, none_loc)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  321|     86|DEF(       get_arg0, 1, 0, 1, none_arg)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  322|     86|DEF(       get_arg1, 1, 0, 1, none_arg)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  323|     86|DEF(       get_arg2, 1, 0, 1, none_arg)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  324|     86|DEF(       get_arg3, 1, 0, 1, none_arg)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  325|     86|DEF(       put_arg0, 1, 1, 0, none_arg)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  326|     86|DEF(       put_arg1, 1, 1, 0, none_arg)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  327|     86|DEF(       put_arg2, 1, 1, 0, none_arg)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  328|     86|DEF(       put_arg3, 1, 1, 0, none_arg)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  329|     86|DEF(       set_arg0, 1, 1, 1, none_arg)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  330|     86|DEF(       set_arg1, 1, 1, 1, none_arg)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  331|     86|DEF(       set_arg2, 1, 1, 1, none_arg)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  332|     86|DEF(       set_arg3, 1, 1, 1, none_arg)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  333|     86|DEF(   get_var_ref0, 1, 0, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  334|     86|DEF(   get_var_ref1, 1, 0, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  335|     86|DEF(   get_var_ref2, 1, 0, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  336|     86|DEF(   get_var_ref3, 1, 0, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  337|     86|DEF(   put_var_ref0, 1, 1, 0, none_var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  338|     86|DEF(   put_var_ref1, 1, 1, 0, none_var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  339|     86|DEF(   put_var_ref2, 1, 1, 0, none_var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  340|     86|DEF(   put_var_ref3, 1, 1, 0, none_var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  341|     86|DEF(   set_var_ref0, 1, 1, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  342|     86|DEF(   set_var_ref1, 1, 1, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  343|     86|DEF(   set_var_ref2, 1, 1, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  344|     86|DEF(   set_var_ref3, 1, 1, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  345|       |
  |  |  346|     86|DEF(     get_length, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  347|       |
  |  |  348|     86|DEF(      if_false8, 2, 1, 0, label8)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  349|     86|DEF(       if_true8, 2, 1, 0, label8) /* must come after if_false8 */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  350|     86|DEF(          goto8, 2, 0, 0, label8) /* must come after if_true8 */
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  351|     86|DEF(         goto16, 3, 0, 0, label16)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  352|       |
  |  |  353|     86|DEF(          call0, 1, 1, 1, npopx)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  354|     86|DEF(          call1, 1, 1, 1, npopx)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  355|     86|DEF(          call2, 1, 1, 1, npopx)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  356|     86|DEF(          call3, 1, 1, 1, npopx)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  357|       |
  |  |  358|     86|DEF(   is_undefined, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  359|     86|DEF(        is_null, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  360|     86|DEF(typeof_is_undefined, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  361|     86|DEF( typeof_is_function, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17768|     86|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  362|     86|#endif
  |  |  363|       |
  |  |  364|     86|#undef DEF
  |  |  365|     86|#undef def
  |  |  366|     86|#endif  /* DEF */
  ------------------
17775|     86|        [ OP_COUNT ... 255 ] = &&case_default
17776|     86|    };
17777|     86|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
17778|       |#ifdef OPCODE_ASM_LABEL
17779|       |#define CASE(op)        case_ ## op: asm volatile("label_" #op ":\n.globl label_" #op); dummy_case_ ## op
17780|       |#else
17781|     86|#define CASE(op)        case_ ## op
17782|     86|#endif
17783|     86|#define DEFAULT         case_default
17784|     86|#define BREAK           SWITCH(pc)
17785|     86|#endif
17786|       |
17787|     86|    if (js_poll_interrupts(caller_ctx))
  ------------------
  |  Branch (17787:9): [True: 0, False: 86]
  ------------------
17788|      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 }
  |  |  ------------------
  ------------------
17789|     86|    if (unlikely(JS_VALUE_GET_TAG(func_obj) != JS_TAG_OBJECT)) {
  ------------------
  |  |   33|     86|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 11, False: 75]
  |  |  ------------------
  ------------------
17790|     11|        if (flags & JS_CALL_FLAG_GENERATOR) {
  ------------------
  |  |17560|     11|#define JS_CALL_FLAG_GENERATOR   (1 << 2)
  ------------------
  |  Branch (17790:13): [True: 11, False: 0]
  ------------------
17791|     11|            JSAsyncFunctionState *s = JS_VALUE_GET_PTR(func_obj);
  ------------------
  |  |  243|     11|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
17792|       |            /* func_obj get contains a pointer to JSFuncAsyncState */
17793|       |            /* the stack frame is already allocated */
17794|     11|            sf = &s->frame;
17795|     11|            p = JS_VALUE_GET_OBJ(sf->cur_func);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
17796|     11|            b = p->u.func.function_bytecode;
17797|     11|            ctx = b->realm;
17798|     11|            var_refs = p->u.func.var_refs;
17799|     11|            local_buf = arg_buf = sf->arg_buf;
17800|     11|            var_buf = sf->var_buf;
17801|     11|            stack_buf = sf->var_buf + b->var_count;
17802|     11|            sp = sf->cur_sp;
17803|     11|            sf->cur_sp = NULL; /* cur_sp is NULL if the function is running */
17804|     11|            pc = sf->cur_pc;
17805|     11|            sf->prev_frame = rt->current_stack_frame;
17806|     11|            rt->current_stack_frame = sf;
17807|     11|            if (s->throw_flag)
  ------------------
  |  Branch (17807:17): [True: 0, False: 11]
  ------------------
17808|      0|                goto exception;
17809|     11|            else
17810|     11|                goto restart;
17811|     11|        } else {
17812|      0|            goto not_a_function;
17813|      0|        }
17814|     11|    }
17815|     75|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  229|     75|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     75|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17816|     75|    if (unlikely(p->class_id != JS_CLASS_BYTECODE_FUNCTION)) {
  ------------------
  |  |   33|     75|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 55, False: 20]
  |  |  ------------------
  ------------------
17817|     55|        JSClassCall *call_func;
17818|     55|        call_func = rt->class_array[p->class_id].call;
17819|     55|        if (!call_func) {
  ------------------
  |  Branch (17819:13): [True: 0, False: 55]
  ------------------
17820|      0|        not_a_function:
17821|      0|            return JS_ThrowTypeError(caller_ctx, "not a function");
17822|      0|        }
17823|     55|        return call_func(caller_ctx, func_obj, this_obj, argc,
17824|     55|                         (JSValueConst *)argv, flags);
17825|     55|    }
17826|     20|    b = p->u.func.function_bytecode;
17827|       |
17828|     20|    if (unlikely(argc < b->arg_count || (flags & JS_CALL_FLAG_COPY_ARGV))) {
  ------------------
  |  |   33|     38|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 20, False: 0]
  |  |  |  Branch (33:45): [True: 2, False: 18]
  |  |  |  Branch (33:45): [True: 18, False: 0]
  |  |  ------------------
  ------------------
17829|     20|        arg_allocated_size = b->arg_count;
17830|     20|    } else {
17831|      0|        arg_allocated_size = 0;
17832|      0|    }
17833|       |
17834|     20|    alloca_size = sizeof(JSValue) * (arg_allocated_size + b->var_count +
17835|     20|                                     b->stack_size) +
17836|     20|        sizeof(JSVarRef *) * b->var_ref_count;
17837|     20|    if (js_check_stack_overflow(rt, alloca_size))
  ------------------
  |  Branch (17837:9): [True: 0, False: 20]
  ------------------
17838|      0|        return JS_ThrowStackOverflow(caller_ctx);
17839|       |
17840|     20|    sf->js_mode = b->js_mode;
17841|     20|    arg_buf = argv;
17842|     20|    sf->arg_count = argc;
17843|     20|    sf->cur_func = (JSValue)func_obj;
17844|     20|    var_refs = p->u.func.var_refs;
17845|       |
17846|     20|    local_buf = alloca(alloca_size);
17847|     20|    if (unlikely(arg_allocated_size)) {
  ------------------
  |  |   33|     20|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 18]
  |  |  ------------------
  ------------------
17848|      2|        int n = min_int(argc, b->arg_count);
17849|      2|        arg_buf = local_buf;
17850|      4|        for(i = 0; i < n; i++)
  ------------------
  |  Branch (17850:20): [True: 2, False: 2]
  ------------------
17851|      2|            arg_buf[i] = JS_DupValue(caller_ctx, argv[i]);
17852|      4|        for(; i < b->arg_count; i++)
  ------------------
  |  Branch (17852:15): [True: 2, False: 2]
  ------------------
17853|      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 }
  |  |  ------------------
  ------------------
17854|      2|        sf->arg_count = b->arg_count;
17855|      2|    }
17856|     20|    var_buf = local_buf + arg_allocated_size;
17857|     20|    sf->var_buf = var_buf;
17858|     20|    sf->arg_buf = arg_buf;
17859|       |
17860|     34|    for(i = 0; i < b->var_count; i++)
  ------------------
  |  Branch (17860:16): [True: 14, False: 20]
  ------------------
17861|     20|        var_buf[i] = JS_UNDEFINED;
  ------------------
  |  |  291|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     34|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
17862|       |
17863|     20|    stack_buf = var_buf + b->var_count;
17864|     20|    sf->var_refs = (JSVarRef **)(stack_buf + b->stack_size);
17865|     20|    for(i = 0; i < b->var_ref_count; i++)
  ------------------
  |  Branch (17865:16): [True: 0, False: 20]
  ------------------
17866|      0|        sf->var_refs[i] = NULL;
17867|     20|    sp = stack_buf;
17868|     20|    pc = b->byte_code_buf;
17869|     20|    sf->prev_frame = rt->current_stack_frame;
17870|     20|    rt->current_stack_frame = sf;
17871|     20|    ctx = b->realm; /* set the current realm */
17872|       |
17873|     31| restart:
17874|     31|    for(;;) {
17875|     31|        int call_argc;
17876|     31|        JSValue *call_argv;
17877|       |
17878|     31|        SWITCH(pc) {
  ------------------
  |  |17777|     31|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  ------------------
17879|     31|        CASE(OP_push_i32):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
17880|      0|            *sp++ = JS_NewInt32(ctx, get_u32(pc));
17881|      0|            pc += 4;
17882|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17883|      0|        CASE(OP_push_bigint_i32):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
17884|      0|            *sp++ = __JS_NewShortBigInt(ctx, (int)get_u32(pc));
17885|      0|            pc += 4;
17886|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17887|      0|        CASE(OP_push_const):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
17888|      0|            *sp++ = JS_DupValue(ctx, b->cpool[get_u32(pc)]);
17889|      0|            pc += 4;
17890|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17891|      0|#if SHORT_OPCODES
17892|      0|        CASE(OP_push_minus1):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
17893|      0|        CASE(OP_push_0):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
17894|      1|        CASE(OP_push_1):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
17895|      1|        CASE(OP_push_2):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
17896|      1|        CASE(OP_push_3):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
17897|      1|        CASE(OP_push_4):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
17898|      1|        CASE(OP_push_5):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
17899|      1|        CASE(OP_push_6):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
17900|      1|        CASE(OP_push_7):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
17901|      1|            *sp++ = JS_NewInt32(ctx, opcode - OP_push_0);
17902|      1|            BREAK;
  ------------------
  |  |17784|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17903|      1|        CASE(OP_push_i8):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
17904|      0|            *sp++ = JS_NewInt32(ctx, get_i8(pc));
17905|      0|            pc += 1;
17906|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17907|      0|        CASE(OP_push_i16):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
17908|      0|            *sp++ = JS_NewInt32(ctx, get_i16(pc));
17909|      0|            pc += 2;
17910|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17911|      5|        CASE(OP_push_const8):
  ------------------
  |  |17781|      5|#define CASE(op)        case_ ## op
  ------------------
17912|      5|            *sp++ = JS_DupValue(ctx, b->cpool[*pc++]);
17913|      5|            BREAK;
  ------------------
  |  |17784|      5|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      5|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17914|      5|        CASE(OP_fclosure8):
  ------------------
  |  |17781|      2|#define CASE(op)        case_ ## op
  ------------------
17915|      2|            *sp++ = js_closure(ctx, JS_DupValue(ctx, b->cpool[*pc++]), var_refs, sf, FALSE);
17916|      2|            if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
17917|      0|                goto exception;
17918|      2|            BREAK;
  ------------------
  |  |17784|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17919|      2|        CASE(OP_push_empty_string):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
17920|      1|            *sp++ = JS_AtomToString(ctx, JS_ATOM_empty_string);
17921|      1|            BREAK;
  ------------------
  |  |17784|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17922|      1|#endif
17923|      2|        CASE(OP_push_atom_value):
  ------------------
  |  |17781|      2|#define CASE(op)        case_ ## op
  ------------------
17924|      2|            *sp++ = JS_AtomToValue(ctx, get_u32(pc));
17925|      2|            pc += 4;
17926|      2|            BREAK;
  ------------------
  |  |17784|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17927|     12|        CASE(OP_undefined):
  ------------------
  |  |17781|     12|#define CASE(op)        case_ ## op
  ------------------
17928|     12|            *sp++ = 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 }
  |  |  ------------------
  ------------------
17929|     12|            BREAK;
  ------------------
  |  |17784|     12|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|     12|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17930|     12|        CASE(OP_null):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
17931|      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 }
  |  |  ------------------
  ------------------
17932|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17933|     22|        CASE(OP_push_this):
  ------------------
  |  |17781|     22|#define CASE(op)        case_ ## op
  ------------------
17934|       |            /* OP_push_this is only called at the start of a function */
17935|     22|            {
17936|     22|                JSValue val;
17937|     22|                if (!(b->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  403|     22|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (17937:21): [True: 0, False: 22]
  ------------------
17938|      0|                    uint32_t tag = JS_VALUE_GET_TAG(this_obj);
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
17939|      0|                    if (likely(tag == JS_TAG_OBJECT))
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17940|      0|                        goto normal_this;
17941|      0|                    if (tag == JS_TAG_NULL || tag == JS_TAG_UNDEFINED) {
  ------------------
  |  Branch (17941:25): [True: 0, False: 0]
  |  Branch (17941:47): [True: 0, False: 0]
  ------------------
17942|      0|                        val = JS_DupValue(ctx, ctx->global_obj);
17943|      0|                    } else {
17944|      0|                        val = JS_ToObject(ctx, this_obj);
17945|      0|                        if (JS_IsException(val))
  ------------------
  |  Branch (17945:29): [True: 0, False: 0]
  ------------------
17946|      0|                            goto exception;
17947|      0|                    }
17948|     22|                } else {
17949|     22|                normal_this:
17950|     22|                    val = JS_DupValue(ctx, this_obj);
17951|     22|                }
17952|     22|                *sp++ = val;
17953|     22|            }
17954|     22|            BREAK;
  ------------------
  |  |17784|     22|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|     22|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17955|     22|        CASE(OP_push_false):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
17956|      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 }
  |  |  ------------------
  ------------------
17957|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17958|      0|        CASE(OP_push_true):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
17959|      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 }
  |  |  ------------------
  ------------------
17960|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17961|      0|        CASE(OP_object):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
17962|      0|            *sp++ = JS_NewObject(ctx);
17963|      0|            if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17964|      0|                goto exception;
17965|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17966|      0|        CASE(OP_special_object):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
17967|      0|            {
17968|      0|                int arg = *pc++;
17969|      0|                switch(arg) {
17970|      0|                case OP_SPECIAL_OBJECT_ARGUMENTS:
  ------------------
  |  Branch (17970:17): [True: 0, False: 0]
  ------------------
17971|      0|                    *sp++ = js_build_arguments(ctx, argc, (JSValueConst *)argv);
17972|      0|                    if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17973|      0|                        goto exception;
17974|      0|                    break;
17975|      0|                case OP_SPECIAL_OBJECT_MAPPED_ARGUMENTS:
  ------------------
  |  Branch (17975:17): [True: 0, False: 0]
  ------------------
17976|      0|                    *sp++ = js_build_mapped_arguments(ctx, argc, (JSValueConst *)argv,
17977|      0|                                                      sf, min_int(argc, b->arg_count));
17978|      0|                    if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17979|      0|                        goto exception;
17980|      0|                    break;
17981|      0|                case OP_SPECIAL_OBJECT_THIS_FUNC:
  ------------------
  |  Branch (17981:17): [True: 0, False: 0]
  ------------------
17982|      0|                    *sp++ = JS_DupValue(ctx, sf->cur_func);
17983|      0|                    break;
17984|      0|                case OP_SPECIAL_OBJECT_NEW_TARGET:
  ------------------
  |  Branch (17984:17): [True: 0, False: 0]
  ------------------
17985|      0|                    *sp++ = JS_DupValue(ctx, new_target);
17986|      0|                    break;
17987|      0|                case OP_SPECIAL_OBJECT_HOME_OBJECT:
  ------------------
  |  Branch (17987:17): [True: 0, False: 0]
  ------------------
17988|      0|                    {
17989|      0|                        JSObject *p1;
17990|      0|                        p1 = p->u.func.home_object;
17991|      0|                        if (unlikely(!p1))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17992|      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 }
  |  |  ------------------
  ------------------
17993|      0|                        else
17994|      0|                            *sp++ = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p1));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
17995|      0|                    }
17996|      0|                    break;
17997|      0|                case OP_SPECIAL_OBJECT_VAR_OBJECT:
  ------------------
  |  Branch (17997:17): [True: 0, False: 0]
  ------------------
17998|      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 }
  |  |  ------------------
  ------------------
17999|      0|                    if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18000|      0|                        goto exception;
18001|      0|                    break;
18002|      0|                case OP_SPECIAL_OBJECT_IMPORT_META:
  ------------------
  |  Branch (18002:17): [True: 0, False: 0]
  ------------------
18003|      0|                    *sp++ = js_import_meta(ctx);
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|                default:
  ------------------
  |  Branch (18007:17): [True: 0, False: 0]
  ------------------
18008|      0|                    abort();
18009|      0|                }
18010|      0|            }
18011|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18012|      0|        CASE(OP_rest):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18013|      0|            {
18014|      0|                int first = get_u16(pc);
18015|      0|                pc += 2;
18016|      0|                first = min_int(first, argc);
18017|      0|                *sp++ = js_create_array(ctx, argc - first, (JSValueConst *)(argv + first));
18018|      0|                if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18019|      0|                    goto exception;
18020|      0|            }
18021|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18022|       |
18023|      6|        CASE(OP_drop):
  ------------------
  |  |17781|      6|#define CASE(op)        case_ ## op
  ------------------
18024|      6|            JS_FreeValue(ctx, sp[-1]);
18025|      6|            sp--;
18026|      6|            BREAK;
  ------------------
  |  |17784|      6|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      6|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18027|      6|        CASE(OP_nip):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18028|      0|            JS_FreeValue(ctx, sp[-2]);
18029|      0|            sp[-2] = sp[-1];
18030|      0|            sp--;
18031|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18032|      0|        CASE(OP_nip1): /* a b c -> b c */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18033|      0|            JS_FreeValue(ctx, sp[-3]);
18034|      0|            sp[-3] = sp[-2];
18035|      0|            sp[-2] = sp[-1];
18036|      0|            sp--;
18037|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18038|      6|        CASE(OP_dup):
  ------------------
  |  |17781|      6|#define CASE(op)        case_ ## op
  ------------------
18039|      6|            sp[0] = JS_DupValue(ctx, sp[-1]);
18040|      6|            sp++;
18041|      6|            BREAK;
  ------------------
  |  |17784|      6|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      6|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18042|      6|        CASE(OP_dup2): /* a b -> a b a b */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18043|      0|            sp[0] = JS_DupValue(ctx, sp[-2]);
18044|      0|            sp[1] = JS_DupValue(ctx, sp[-1]);
18045|      0|            sp += 2;
18046|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18047|      0|        CASE(OP_dup3): /* a b c -> a b c a b c */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18048|      0|            sp[0] = JS_DupValue(ctx, sp[-3]);
18049|      0|            sp[1] = JS_DupValue(ctx, sp[-2]);
18050|      0|            sp[2] = JS_DupValue(ctx, sp[-1]);
18051|      0|            sp += 3;
18052|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18053|      0|        CASE(OP_dup1): /* a b -> a a b */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18054|      0|            sp[0] = sp[-1];
18055|      0|            sp[-1] = JS_DupValue(ctx, sp[-2]);
18056|      0|            sp++;
18057|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18058|      0|        CASE(OP_insert2): /* obj a -> a obj a (dup_x1) */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18059|      0|            sp[0] = sp[-1];
18060|      0|            sp[-1] = sp[-2];
18061|      0|            sp[-2] = JS_DupValue(ctx, sp[0]);
18062|      0|            sp++;
18063|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18064|      0|        CASE(OP_insert3): /* obj prop a -> a obj prop a (dup_x2) */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18065|      0|            sp[0] = sp[-1];
18066|      0|            sp[-1] = sp[-2];
18067|      0|            sp[-2] = sp[-3];
18068|      0|            sp[-3] = JS_DupValue(ctx, sp[0]);
18069|      0|            sp++;
18070|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18071|      0|        CASE(OP_insert4): /* this obj prop a -> a this obj prop a */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18072|      0|            sp[0] = sp[-1];
18073|      0|            sp[-1] = sp[-2];
18074|      0|            sp[-2] = sp[-3];
18075|      0|            sp[-3] = sp[-4];
18076|      0|            sp[-4] = JS_DupValue(ctx, sp[0]);
18077|      0|            sp++;
18078|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18079|      0|        CASE(OP_perm3): /* obj a b -> a obj b (213) */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18080|      0|            {
18081|      0|                JSValue tmp;
18082|      0|                tmp = sp[-2];
18083|      0|                sp[-2] = sp[-3];
18084|      0|                sp[-3] = tmp;
18085|      0|            }
18086|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18087|      0|        CASE(OP_rot3l): /* x a b -> a b x (231) */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18088|      0|            {
18089|      0|                JSValue tmp;
18090|      0|                tmp = sp[-3];
18091|      0|                sp[-3] = sp[-2];
18092|      0|                sp[-2] = sp[-1];
18093|      0|                sp[-1] = tmp;
18094|      0|            }
18095|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18096|      0|        CASE(OP_rot4l): /* x a b c -> a b c x */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18097|      0|            {
18098|      0|                JSValue tmp;
18099|      0|                tmp = sp[-4];
18100|      0|                sp[-4] = sp[-3];
18101|      0|                sp[-3] = sp[-2];
18102|      0|                sp[-2] = sp[-1];
18103|      0|                sp[-1] = tmp;
18104|      0|            }
18105|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18106|      0|        CASE(OP_rot5l): /* x a b c d -> a b c d x */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18107|      0|            {
18108|      0|                JSValue tmp;
18109|      0|                tmp = sp[-5];
18110|      0|                sp[-5] = sp[-4];
18111|      0|                sp[-4] = sp[-3];
18112|      0|                sp[-3] = sp[-2];
18113|      0|                sp[-2] = sp[-1];
18114|      0|                sp[-1] = tmp;
18115|      0|            }
18116|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18117|      0|        CASE(OP_rot3r): /* a b x -> x a b (312) */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18118|      0|            {
18119|      0|                JSValue tmp;
18120|      0|                tmp = sp[-1];
18121|      0|                sp[-1] = sp[-2];
18122|      0|                sp[-2] = sp[-3];
18123|      0|                sp[-3] = tmp;
18124|      0|            }
18125|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18126|      0|        CASE(OP_perm4): /* obj prop a b -> a obj prop b */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18127|      0|            {
18128|      0|                JSValue tmp;
18129|      0|                tmp = sp[-2];
18130|      0|                sp[-2] = sp[-3];
18131|      0|                sp[-3] = sp[-4];
18132|      0|                sp[-4] = tmp;
18133|      0|            }
18134|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18135|      0|        CASE(OP_perm5): /* this obj prop a b -> a this obj prop b */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18136|      0|            {
18137|      0|                JSValue tmp;
18138|      0|                tmp = sp[-2];
18139|      0|                sp[-2] = sp[-3];
18140|      0|                sp[-3] = sp[-4];
18141|      0|                sp[-4] = sp[-5];
18142|      0|                sp[-5] = tmp;
18143|      0|            }
18144|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18145|      0|        CASE(OP_swap): /* a b -> b a */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18146|      0|            {
18147|      0|                JSValue tmp;
18148|      0|                tmp = sp[-2];
18149|      0|                sp[-2] = sp[-1];
18150|      0|                sp[-1] = tmp;
18151|      0|            }
18152|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18153|      0|        CASE(OP_swap2): /* a b c d -> c d a b */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18154|      0|            {
18155|      0|                JSValue tmp1, tmp2;
18156|      0|                tmp1 = sp[-4];
18157|      0|                tmp2 = sp[-3];
18158|      0|                sp[-4] = sp[-2];
18159|      0|                sp[-3] = sp[-1];
18160|      0|                sp[-2] = tmp1;
18161|      0|                sp[-1] = tmp2;
18162|      0|            }
18163|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18164|       |
18165|      0|        CASE(OP_fclosure):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18166|      0|            {
18167|      0|                JSValue bfunc = JS_DupValue(ctx, b->cpool[get_u32(pc)]);
18168|      0|                pc += 4;
18169|      0|                *sp++ = js_closure(ctx, bfunc, var_refs, sf, FALSE);
18170|      0|                if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18171|      0|                    goto exception;
18172|      0|            }
18173|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18174|      0|#if SHORT_OPCODES
18175|      0|        CASE(OP_call0):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18176|      3|        CASE(OP_call1):
  ------------------
  |  |17781|      3|#define CASE(op)        case_ ## op
  ------------------
18177|      3|        CASE(OP_call2):
  ------------------
  |  |17781|      3|#define CASE(op)        case_ ## op
  ------------------
18178|      3|        CASE(OP_call3):
  ------------------
  |  |17781|      3|#define CASE(op)        case_ ## op
  ------------------
18179|      3|            call_argc = opcode - OP_call0;
18180|      3|            goto has_call_argc;
18181|      0|#endif
18182|      0|        CASE(OP_call):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18183|      0|        CASE(OP_tail_call):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18184|      0|            {
18185|      0|                call_argc = get_u16(pc);
18186|      0|                pc += 2;
18187|      0|                goto has_call_argc;
18188|      3|            has_call_argc:
18189|      3|                call_argv = sp - call_argc;
18190|      3|                sf->cur_pc = pc;
18191|      3|                ret_val = JS_CallInternal(ctx, call_argv[-1], JS_UNDEFINED,
  ------------------
  |  |  291|      3|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      3|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18192|      3|                                          JS_UNDEFINED, call_argc, call_argv, 0);
  ------------------
  |  |  291|      3|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      3|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18193|      3|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      3|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1, False: 2]
  |  |  ------------------
  ------------------
18194|      1|                    goto exception;
18195|      2|                if (opcode == OP_tail_call)
  ------------------
  |  Branch (18195:21): [True: 0, False: 2]
  ------------------
18196|      0|                    goto done;
18197|      6|                for(i = -1; i < call_argc; i++)
  ------------------
  |  Branch (18197:29): [True: 4, False: 2]
  ------------------
18198|      4|                    JS_FreeValue(ctx, call_argv[i]);
18199|      2|                sp -= call_argc + 1;
18200|      2|                *sp++ = ret_val;
18201|      2|            }
18202|      2|            BREAK;
  ------------------
  |  |17784|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18203|      2|        CASE(OP_call_constructor):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18204|      0|            {
18205|      0|                call_argc = get_u16(pc);
18206|      0|                pc += 2;
18207|      0|                call_argv = sp - call_argc;
18208|      0|                sf->cur_pc = pc;
18209|      0|                ret_val = JS_CallConstructorInternal(ctx, call_argv[-2],
18210|      0|                                                     call_argv[-1],
18211|      0|                                                     call_argc, call_argv, 0);
18212|      0|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18213|      0|                    goto exception;
18214|      0|                for(i = -2; i < call_argc; i++)
  ------------------
  |  Branch (18214:29): [True: 0, False: 0]
  ------------------
18215|      0|                    JS_FreeValue(ctx, call_argv[i]);
18216|      0|                sp -= call_argc + 2;
18217|      0|                *sp++ = ret_val;
18218|      0|            }
18219|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18220|      1|        CASE(OP_call_method):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
18221|      1|        CASE(OP_tail_call_method):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
18222|      1|            {
18223|      1|                call_argc = get_u16(pc);
18224|      1|                pc += 2;
18225|      1|                call_argv = sp - call_argc;
18226|      1|                sf->cur_pc = pc;
18227|      1|                ret_val = JS_CallInternal(ctx, call_argv[-1], call_argv[-2],
18228|      1|                                          JS_UNDEFINED, call_argc, call_argv, 0);
  ------------------
  |  |  291|      1|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18229|      1|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      1|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1]
  |  |  ------------------
  ------------------
18230|      0|                    goto exception;
18231|      1|                if (opcode == OP_tail_call_method)
  ------------------
  |  Branch (18231:21): [True: 0, False: 1]
  ------------------
18232|      0|                    goto done;
18233|      4|                for(i = -2; i < call_argc; i++)
  ------------------
  |  Branch (18233:29): [True: 3, False: 1]
  ------------------
18234|      3|                    JS_FreeValue(ctx, call_argv[i]);
18235|      1|                sp -= call_argc + 2;
18236|      1|                *sp++ = ret_val;
18237|      1|            }
18238|      1|            BREAK;
  ------------------
  |  |17784|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18239|      1|        CASE(OP_array_from):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18240|      0|            call_argc = get_u16(pc);
18241|      0|            pc += 2;
18242|      0|            ret_val = js_create_array_free(ctx, call_argc, sp - call_argc);
18243|      0|            sp -= call_argc;
18244|      0|            if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18245|      0|                goto exception;
18246|      0|            *sp++ = ret_val;
18247|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18248|       |
18249|      0|        CASE(OP_apply):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18250|      0|            {
18251|      0|                int magic;
18252|      0|                magic = get_u16(pc);
18253|      0|                pc += 2;
18254|      0|                sf->cur_pc = pc;
18255|       |
18256|      0|                ret_val = js_function_apply(ctx, sp[-3], 2, (JSValueConst *)&sp[-2], magic);
18257|      0|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18258|      0|                    goto exception;
18259|      0|                JS_FreeValue(ctx, sp[-3]);
18260|      0|                JS_FreeValue(ctx, sp[-2]);
18261|      0|                JS_FreeValue(ctx, sp[-1]);
18262|      0|                sp -= 3;
18263|      0|                *sp++ = ret_val;
18264|      0|            }
18265|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18266|      2|        CASE(OP_return):
  ------------------
  |  |17781|      2|#define CASE(op)        case_ ## op
  ------------------
18267|      2|            ret_val = *--sp;
18268|      2|            goto done;
18269|     11|        CASE(OP_return_undef):
  ------------------
  |  |17781|     11|#define CASE(op)        case_ ## op
  ------------------
18270|     11|            ret_val = 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 }
  |  |  ------------------
  ------------------
18271|     11|            goto done;
18272|       |
18273|      0|        CASE(OP_check_ctor_return):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18274|       |            /* return TRUE if 'this' should be returned */
18275|      0|            if (!JS_IsObject(sp[-1])) {
  ------------------
  |  Branch (18275:17): [True: 0, False: 0]
  ------------------
18276|      0|                if (!JS_IsUndefined(sp[-1])) {
  ------------------
  |  Branch (18276:21): [True: 0, False: 0]
  ------------------
18277|      0|                    JS_ThrowTypeError(caller_ctx, "derived class constructor must return an object or undefined");
18278|      0|                    goto exception;
18279|      0|                }
18280|      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 }
  |  |  ------------------
  ------------------
18281|      0|            } else {
18282|      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 }
  |  |  ------------------
  ------------------
18283|      0|            }
18284|      0|            sp++;
18285|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18286|      0|        CASE(OP_check_ctor):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18287|      0|            if (JS_IsUndefined(new_target)) {
  ------------------
  |  Branch (18287:17): [True: 0, False: 0]
  ------------------
18288|      0|            non_ctor_call:
18289|      0|                JS_ThrowTypeError(ctx, "class constructors must be invoked with 'new'");
18290|      0|                goto exception;
18291|      0|            }
18292|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18293|      0|        CASE(OP_init_ctor):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18294|      0|            {
18295|      0|                JSValue super, ret;
18296|      0|                sf->cur_pc = pc;
18297|      0|                if (JS_IsUndefined(new_target))
  ------------------
  |  Branch (18297:21): [True: 0, False: 0]
  ------------------
18298|      0|                    goto non_ctor_call;
18299|      0|                super = JS_GetPrototype(ctx, func_obj);
18300|      0|                if (JS_IsException(super))
  ------------------
  |  Branch (18300:21): [True: 0, False: 0]
  ------------------
18301|      0|                    goto exception;
18302|      0|                ret = JS_CallConstructor2(ctx, super, new_target, argc, (JSValueConst *)argv);
18303|      0|                JS_FreeValue(ctx, super);
18304|      0|                if (JS_IsException(ret))
  ------------------
  |  Branch (18304:21): [True: 0, False: 0]
  ------------------
18305|      0|                    goto exception;
18306|      0|                *sp++ = ret;
18307|      0|            }
18308|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18309|      0|        CASE(OP_check_brand):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18310|      0|            {
18311|      0|                int ret = JS_CheckBrand(ctx, sp[-2], sp[-1]);
18312|      0|                if (ret < 0)
  ------------------
  |  Branch (18312:21): [True: 0, False: 0]
  ------------------
18313|      0|                    goto exception;
18314|      0|                if (!ret) {
  ------------------
  |  Branch (18314:21): [True: 0, False: 0]
  ------------------
18315|      0|                    JS_ThrowTypeError(ctx, "invalid brand on object");
18316|      0|                    goto exception;
18317|      0|                }
18318|      0|            }
18319|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18320|      0|        CASE(OP_add_brand):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18321|      0|            if (JS_AddBrand(ctx, sp[-2], sp[-1]) < 0)
  ------------------
  |  Branch (18321:17): [True: 0, False: 0]
  ------------------
18322|      0|                goto exception;
18323|      0|            JS_FreeValue(ctx, sp[-2]);
18324|      0|            JS_FreeValue(ctx, sp[-1]);
18325|      0|            sp -= 2;
18326|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18327|       |
18328|      0|        CASE(OP_throw):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18329|      0|            JS_Throw(ctx, *--sp);
18330|      0|            goto exception;
18331|       |
18332|      0|        CASE(OP_throw_error):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18333|      0|#define JS_THROW_VAR_RO             0
18334|      0|#define JS_THROW_VAR_REDECL         1
18335|      0|#define JS_THROW_VAR_UNINITIALIZED  2
18336|      0|#define JS_THROW_ERROR_DELETE_SUPER   3
18337|      0|#define JS_THROW_ERROR_ITERATOR_THROW 4
18338|      0|            {
18339|      0|                JSAtom atom;
18340|      0|                int type;
18341|      0|                atom = get_u32(pc);
18342|      0|                type = pc[4];
18343|      0|                pc += 5;
18344|      0|                if (type == JS_THROW_VAR_RO)
  ------------------
  |  |18333|      0|#define JS_THROW_VAR_RO             0
  ------------------
  |  Branch (18344:21): [True: 0, False: 0]
  ------------------
18345|      0|                    JS_ThrowTypeErrorReadOnly(ctx, JS_PROP_THROW, atom);
  ------------------
  |  |  320|      0|#define JS_PROP_THROW            (1 << 14)
  ------------------
18346|      0|                else
18347|      0|                if (type == JS_THROW_VAR_REDECL)
  ------------------
  |  |18334|      0|#define JS_THROW_VAR_REDECL         1
  ------------------
  |  Branch (18347:21): [True: 0, False: 0]
  ------------------
18348|      0|                    JS_ThrowSyntaxErrorVarRedeclaration(ctx, atom);
18349|      0|                else
18350|      0|                if (type == JS_THROW_VAR_UNINITIALIZED)
  ------------------
  |  |18335|      0|#define JS_THROW_VAR_UNINITIALIZED  2
  ------------------
  |  Branch (18350:21): [True: 0, False: 0]
  ------------------
18351|      0|                    JS_ThrowReferenceErrorUninitialized(ctx, atom);
18352|      0|                else
18353|      0|                if (type == JS_THROW_ERROR_DELETE_SUPER)
  ------------------
  |  |18336|      0|#define JS_THROW_ERROR_DELETE_SUPER   3
  ------------------
  |  Branch (18353:21): [True: 0, False: 0]
  ------------------
18354|      0|                    JS_ThrowReferenceError(ctx, "unsupported reference to 'super'");
18355|      0|                else
18356|      0|                if (type == JS_THROW_ERROR_ITERATOR_THROW)
  ------------------
  |  |18337|      0|#define JS_THROW_ERROR_ITERATOR_THROW 4
  ------------------
  |  Branch (18356:21): [True: 0, False: 0]
  ------------------
18357|      0|                    JS_ThrowTypeError(ctx, "iterator does not have a throw method");
18358|      0|                else
18359|      0|                    JS_ThrowInternalError(ctx, "invalid throw var type %d", type);
18360|      0|            }
18361|      0|            goto exception;
18362|       |
18363|      0|        CASE(OP_eval):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18364|      0|            {
18365|      0|                JSValueConst obj;
  ------------------
  |  |  234|      0|#define JSValueConst JSValue
  ------------------
18366|      0|                int scope_idx;
18367|      0|                call_argc = get_u16(pc);
18368|      0|                scope_idx = get_u16(pc + 2) + ARG_SCOPE_END;
  ------------------
  |  |  636|      0|#define ARG_SCOPE_END (-2)
  ------------------
18369|      0|                pc += 4;
18370|      0|                call_argv = sp - call_argc;
18371|      0|                sf->cur_pc = pc;
18372|      0|                if (js_same_value(ctx, call_argv[-1], ctx->eval_obj)) {
  ------------------
  |  Branch (18372:21): [True: 0, False: 0]
  ------------------
18373|      0|                    if (call_argc >= 1)
  ------------------
  |  Branch (18373:25): [True: 0, False: 0]
  ------------------
18374|      0|                        obj = call_argv[0];
18375|      0|                    else
18376|      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 }
  |  |  ------------------
  ------------------
18377|      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 }
  |  |  ------------------
  ------------------
18378|      0|                                            JS_EVAL_TYPE_DIRECT, scope_idx);
  ------------------
  |  |  334|      0|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
18379|      0|                } else {
18380|      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 }
  |  |  ------------------
  ------------------
18381|      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 }
  |  |  ------------------
  ------------------
18382|      0|                }
18383|      0|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18384|      0|                    goto exception;
18385|      0|                for(i = -1; i < call_argc; i++)
  ------------------
  |  Branch (18385:29): [True: 0, False: 0]
  ------------------
18386|      0|                    JS_FreeValue(ctx, call_argv[i]);
18387|      0|                sp -= call_argc + 1;
18388|      0|                *sp++ = ret_val;
18389|      0|            }
18390|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18391|       |            /* could merge with OP_apply */
18392|      0|        CASE(OP_apply_eval):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18393|      0|            {
18394|      0|                int scope_idx;
18395|      0|                uint32_t len;
18396|      0|                JSValue *tab;
18397|      0|                JSValueConst obj;
  ------------------
  |  |  234|      0|#define JSValueConst JSValue
  ------------------
18398|       |
18399|      0|                scope_idx = get_u16(pc) + ARG_SCOPE_END;
  ------------------
  |  |  636|      0|#define ARG_SCOPE_END (-2)
  ------------------
18400|      0|                pc += 2;
18401|      0|                sf->cur_pc = pc;
18402|      0|                tab = build_arg_list(ctx, &len, sp[-1]);
18403|      0|                if (!tab)
  ------------------
  |  Branch (18403:21): [True: 0, False: 0]
  ------------------
18404|      0|                    goto exception;
18405|      0|                if (js_same_value(ctx, sp[-2], ctx->eval_obj)) {
  ------------------
  |  Branch (18405:21): [True: 0, False: 0]
  ------------------
18406|      0|                    if (len >= 1)
  ------------------
  |  Branch (18406:25): [True: 0, False: 0]
  ------------------
18407|      0|                        obj = tab[0];
18408|      0|                    else
18409|      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 }
  |  |  ------------------
  ------------------
18410|      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 }
  |  |  ------------------
  ------------------
18411|      0|                                            JS_EVAL_TYPE_DIRECT, scope_idx);
  ------------------
  |  |  334|      0|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
18412|      0|                } else {
18413|      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 }
  |  |  ------------------
  ------------------
18414|      0|                                      (JSValueConst *)tab);
18415|      0|                }
18416|      0|                free_arg_list(ctx, tab, len);
18417|      0|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18418|      0|                    goto exception;
18419|      0|                JS_FreeValue(ctx, sp[-2]);
18420|      0|                JS_FreeValue(ctx, sp[-1]);
18421|      0|                sp -= 2;
18422|      0|                *sp++ = ret_val;
18423|      0|            }
18424|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18425|       |
18426|      0|        CASE(OP_regexp):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18427|      0|            {
18428|      0|                sp[-2] = JS_NewRegexp(ctx, sp[-2], sp[-1]);
18429|      0|                sp--;
18430|      0|                if (JS_IsException(sp[-1]))
  ------------------
  |  Branch (18430:21): [True: 0, False: 0]
  ------------------
18431|      0|                    goto exception;
18432|      0|            }
18433|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18434|       |
18435|      0|        CASE(OP_get_super):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18436|      0|            {
18437|      0|                JSValue proto;
18438|      0|                sf->cur_pc = pc;
18439|      0|                proto = JS_GetPrototype(ctx, sp[-1]);
18440|      0|                if (JS_IsException(proto))
  ------------------
  |  Branch (18440:21): [True: 0, False: 0]
  ------------------
18441|      0|                    goto exception;
18442|      0|                JS_FreeValue(ctx, sp[-1]);
18443|      0|                sp[-1] = proto;
18444|      0|            }
18445|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18446|       |
18447|      0|        CASE(OP_import):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18448|      0|            {
18449|      0|                JSValue val;
18450|      0|                sf->cur_pc = pc;
18451|      0|                val = js_dynamic_import(ctx, sp[-2], sp[-1]);
18452|      0|                if (JS_IsException(val))
  ------------------
  |  Branch (18452:21): [True: 0, False: 0]
  ------------------
18453|      0|                    goto exception;
18454|      0|                JS_FreeValue(ctx, sp[-2]);
18455|      0|                JS_FreeValue(ctx, sp[-1]);
18456|      0|                sp--;
18457|      0|                sp[-1] = val;
18458|      0|            }
18459|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18460|       |
18461|      0|        CASE(OP_get_var_undef):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18462|     31|        CASE(OP_get_var):
  ------------------
  |  |17781|     31|#define CASE(op)        case_ ## op
  ------------------
18463|     31|            {
18464|     31|                int idx;
18465|     31|                JSValue val;
18466|     31|                idx = get_u16(pc);
18467|     31|                pc += 2;
18468|     31|                val = *var_refs[idx]->pvalue;
18469|     31|                if (unlikely(JS_IsUninitialized(val))) {
  ------------------
  |  |   33|     31|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 6, False: 25]
  |  |  ------------------
  ------------------
18470|      6|                    JSClosureVar *cv = &b->closure_var[idx];
18471|      6|                    if (cv->is_lexical) {
  ------------------
  |  Branch (18471:25): [True: 0, False: 6]
  ------------------
18472|      0|                        JS_ThrowReferenceErrorUninitialized(ctx, cv->var_name);
18473|      0|                        goto exception;
18474|      6|                    } else {
18475|      6|                        sf->cur_pc = pc;
18476|      6|                        sp[0] = JS_GetPropertyInternal(ctx, ctx->global_obj,
18477|      6|                                                       cv->var_name,
18478|      6|                                                       ctx->global_obj,
18479|      6|                                                       opcode - OP_get_var_undef);
18480|      6|                        if (JS_IsException(sp[0]))
  ------------------
  |  Branch (18480:29): [True: 6, False: 0]
  ------------------
18481|      6|                            goto exception;
18482|      6|                    }
18483|     25|                } else {
18484|     25|                    sp[0] = JS_DupValue(ctx, val);
18485|     25|                }
18486|     25|                sp++;
18487|     25|            }
18488|     25|            BREAK;
  ------------------
  |  |17784|     25|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|     25|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18489|       |
18490|     25|        CASE(OP_put_var):
  ------------------
  |  |17781|      2|#define CASE(op)        case_ ## op
  ------------------
18491|      2|        CASE(OP_put_var_init):
  ------------------
  |  |17781|      2|#define CASE(op)        case_ ## op
  ------------------
18492|      2|            {
18493|      2|                int idx, ret;
18494|      2|                JSVarRef *var_ref;
18495|      2|                idx = get_u16(pc);
18496|      2|                pc += 2;
18497|      2|                var_ref = var_refs[idx];
18498|      2|                if (unlikely(JS_IsUninitialized(*var_ref->pvalue) ||
  ------------------
  |  |   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: 0, False: 1]
  |  |  ------------------
  ------------------
18499|      2|                             var_ref->is_const)) {
18500|      1|                    JSClosureVar *cv = &b->closure_var[idx];
18501|      1|                    if (var_ref->is_lexical) {
  ------------------
  |  Branch (18501:25): [True: 0, False: 1]
  ------------------
18502|      0|                        if (opcode == OP_put_var_init)
  ------------------
  |  Branch (18502:29): [True: 0, False: 0]
  ------------------
18503|      0|                            goto put_var_ok;
18504|      0|                        if (JS_IsUninitialized(*var_ref->pvalue))
  ------------------
  |  Branch (18504:29): [True: 0, False: 0]
  ------------------
18505|      0|                            JS_ThrowReferenceErrorUninitialized(ctx, cv->var_name);
18506|      0|                        else
18507|      0|                            JS_ThrowTypeErrorReadOnly(ctx, JS_PROP_THROW, cv->var_name);
  ------------------
  |  |  320|      0|#define JS_PROP_THROW            (1 << 14)
  ------------------
18508|      0|                        goto exception;
18509|      1|                    } else {
18510|      1|                        sf->cur_pc = pc;
18511|      1|                        ret = JS_HasProperty(ctx, ctx->global_obj, cv->var_name);
18512|      1|                        if (ret < 0)
  ------------------
  |  Branch (18512:29): [True: 0, False: 1]
  ------------------
18513|      0|                            goto exception;
18514|      1|                        if (ret == 0 && is_strict_mode(ctx)) {
  ------------------
  |  Branch (18514:29): [True: 1, False: 0]
  |  Branch (18514:41): [True: 0, False: 1]
  ------------------
18515|      0|                            JS_ThrowReferenceErrorNotDefined(ctx, cv->var_name);
18516|      0|                            goto exception;
18517|      0|                        }
18518|      1|                        ret = JS_SetPropertyInternal(ctx, ctx->global_obj, cv->var_name, sp[-1],
18519|      1|                                                     ctx->global_obj, JS_PROP_THROW_STRICT);
  ------------------
  |  |  323|      1|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
18520|      1|                        sp--;
18521|      1|                        if (ret < 0)
  ------------------
  |  Branch (18521:29): [True: 0, False: 1]
  ------------------
18522|      0|                            goto exception;
18523|      1|                    }
18524|      1|                } else {
18525|      1|                put_var_ok:
18526|      1|                   set_value(ctx, var_ref->pvalue, sp[-1]);
18527|      1|                   sp--;
18528|      1|                }
18529|      2|            }
18530|      2|            BREAK;
  ------------------
  |  |17784|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18531|      2|        CASE(OP_get_loc):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18532|      0|            {
18533|      0|                int idx;
18534|      0|                idx = get_u16(pc);
18535|      0|                pc += 2;
18536|      0|                sp[0] = JS_DupValue(ctx, var_buf[idx]);
18537|      0|                sp++;
18538|      0|            }
18539|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18540|      0|        CASE(OP_put_loc):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18541|      0|            {
18542|      0|                int idx;
18543|      0|                idx = get_u16(pc);
18544|      0|                pc += 2;
18545|      0|                set_value(ctx, &var_buf[idx], sp[-1]);
18546|      0|                sp--;
18547|      0|            }
18548|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18549|      0|        CASE(OP_set_loc):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18550|      0|            {
18551|      0|                int idx;
18552|      0|                idx = get_u16(pc);
18553|      0|                pc += 2;
18554|      0|                set_value(ctx, &var_buf[idx], JS_DupValue(ctx, sp[-1]));
18555|      0|            }
18556|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18557|      0|        CASE(OP_get_arg):
  ------------------
  |  |17781|      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, arg_buf[idx]);
18563|      0|                sp++;
18564|      0|            }
18565|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18566|      0|        CASE(OP_put_arg):
  ------------------
  |  |17781|      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, &arg_buf[idx], sp[-1]);
18572|      0|                sp--;
18573|      0|            }
18574|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18575|      0|        CASE(OP_set_arg):
  ------------------
  |  |17781|      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, &arg_buf[idx], JS_DupValue(ctx, sp[-1]));
18581|      0|            }
18582|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18583|       |
18584|      0|#if SHORT_OPCODES
18585|      0|        CASE(OP_get_loc8): *sp++ = JS_DupValue(ctx, var_buf[*pc++]); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc8): *sp++ = JS_DupValue(ctx, var_buf[*pc++]); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18586|      0|        CASE(OP_put_loc8): set_value(ctx, &var_buf[*pc++], *--sp); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc8): set_value(ctx, &var_buf[*pc++], *--sp); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18587|      0|        CASE(OP_set_loc8): set_value(ctx, &var_buf[*pc++], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc8): set_value(ctx, &var_buf[*pc++], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18588|       |
18589|      0|        CASE(OP_get_loc0): *sp++ = JS_DupValue(ctx, var_buf[0]); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc0): *sp++ = JS_DupValue(ctx, var_buf[0]); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18590|      0|        CASE(OP_get_loc1): *sp++ = JS_DupValue(ctx, var_buf[1]); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc1): *sp++ = JS_DupValue(ctx, var_buf[1]); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18591|      0|        CASE(OP_get_loc2): *sp++ = JS_DupValue(ctx, var_buf[2]); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc2): *sp++ = JS_DupValue(ctx, var_buf[2]); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18592|      0|        CASE(OP_get_loc3): *sp++ = JS_DupValue(ctx, var_buf[3]); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc3): *sp++ = JS_DupValue(ctx, var_buf[3]); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18593|      5|        CASE(OP_put_loc0): set_value(ctx, &var_buf[0], *--sp); BREAK;
  ------------------
  |  |17781|      5|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc0): set_value(ctx, &var_buf[0], *--sp); BREAK;
  ------------------
  |  |17784|      5|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      5|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18594|      5|        CASE(OP_put_loc1): set_value(ctx, &var_buf[1], *--sp); BREAK;
  ------------------
  |  |17781|      2|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc1): set_value(ctx, &var_buf[1], *--sp); BREAK;
  ------------------
  |  |17784|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18595|      2|        CASE(OP_put_loc2): set_value(ctx, &var_buf[2], *--sp); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc2): set_value(ctx, &var_buf[2], *--sp); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18596|      0|        CASE(OP_put_loc3): set_value(ctx, &var_buf[3], *--sp); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc3): set_value(ctx, &var_buf[3], *--sp); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18597|      1|        CASE(OP_set_loc0): set_value(ctx, &var_buf[0], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc0): set_value(ctx, &var_buf[0], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17784|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18598|      1|        CASE(OP_set_loc1): set_value(ctx, &var_buf[1], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc1): set_value(ctx, &var_buf[1], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18599|      3|        CASE(OP_set_loc2): set_value(ctx, &var_buf[2], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17781|      3|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc2): set_value(ctx, &var_buf[2], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17784|      3|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      3|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18600|      3|        CASE(OP_set_loc3): set_value(ctx, &var_buf[3], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc3): set_value(ctx, &var_buf[3], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18601|      2|        CASE(OP_get_arg0): *sp++ = JS_DupValue(ctx, arg_buf[0]); BREAK;
  ------------------
  |  |17781|      2|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_arg0): *sp++ = JS_DupValue(ctx, arg_buf[0]); BREAK;
  ------------------
  |  |17784|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18602|      2|        CASE(OP_get_arg1): *sp++ = JS_DupValue(ctx, arg_buf[1]); BREAK;
  ------------------
  |  |17781|      2|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_arg1): *sp++ = JS_DupValue(ctx, arg_buf[1]); BREAK;
  ------------------
  |  |17784|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18603|      2|        CASE(OP_get_arg2): *sp++ = JS_DupValue(ctx, arg_buf[2]); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_arg2): *sp++ = JS_DupValue(ctx, arg_buf[2]); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18604|      0|        CASE(OP_get_arg3): *sp++ = JS_DupValue(ctx, arg_buf[3]); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_arg3): *sp++ = JS_DupValue(ctx, arg_buf[3]); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18605|      0|        CASE(OP_put_arg0): set_value(ctx, &arg_buf[0], *--sp); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_arg0): set_value(ctx, &arg_buf[0], *--sp); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18606|      0|        CASE(OP_put_arg1): set_value(ctx, &arg_buf[1], *--sp); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_arg1): set_value(ctx, &arg_buf[1], *--sp); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18607|      0|        CASE(OP_put_arg2): set_value(ctx, &arg_buf[2], *--sp); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_arg2): set_value(ctx, &arg_buf[2], *--sp); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18608|      0|        CASE(OP_put_arg3): set_value(ctx, &arg_buf[3], *--sp); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_arg3): set_value(ctx, &arg_buf[3], *--sp); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18609|      0|        CASE(OP_set_arg0): set_value(ctx, &arg_buf[0], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_arg0): set_value(ctx, &arg_buf[0], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18610|      3|        CASE(OP_set_arg1): set_value(ctx, &arg_buf[1], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17781|      3|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_arg1): set_value(ctx, &arg_buf[1], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17784|      3|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      3|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18611|      3|        CASE(OP_set_arg2): set_value(ctx, &arg_buf[2], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_arg2): set_value(ctx, &arg_buf[2], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18612|      0|        CASE(OP_set_arg3): set_value(ctx, &arg_buf[3], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_arg3): set_value(ctx, &arg_buf[3], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18613|      0|        CASE(OP_get_var_ref0): *sp++ = JS_DupValue(ctx, *var_refs[0]->pvalue); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_var_ref0): *sp++ = JS_DupValue(ctx, *var_refs[0]->pvalue); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18614|      0|        CASE(OP_get_var_ref1): *sp++ = JS_DupValue(ctx, *var_refs[1]->pvalue); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_var_ref1): *sp++ = JS_DupValue(ctx, *var_refs[1]->pvalue); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18615|      0|        CASE(OP_get_var_ref2): *sp++ = JS_DupValue(ctx, *var_refs[2]->pvalue); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_var_ref2): *sp++ = JS_DupValue(ctx, *var_refs[2]->pvalue); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18616|      0|        CASE(OP_get_var_ref3): *sp++ = JS_DupValue(ctx, *var_refs[3]->pvalue); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_var_ref3): *sp++ = JS_DupValue(ctx, *var_refs[3]->pvalue); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18617|      0|        CASE(OP_put_var_ref0): set_value(ctx, var_refs[0]->pvalue, *--sp); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_var_ref0): set_value(ctx, var_refs[0]->pvalue, *--sp); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18618|      0|        CASE(OP_put_var_ref1): set_value(ctx, var_refs[1]->pvalue, *--sp); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_var_ref1): set_value(ctx, var_refs[1]->pvalue, *--sp); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18619|      0|        CASE(OP_put_var_ref2): set_value(ctx, var_refs[2]->pvalue, *--sp); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_var_ref2): set_value(ctx, var_refs[2]->pvalue, *--sp); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18620|      0|        CASE(OP_put_var_ref3): set_value(ctx, var_refs[3]->pvalue, *--sp); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_var_ref3): set_value(ctx, var_refs[3]->pvalue, *--sp); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18621|      0|        CASE(OP_set_var_ref0): set_value(ctx, var_refs[0]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_var_ref0): set_value(ctx, var_refs[0]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18622|      0|        CASE(OP_set_var_ref1): set_value(ctx, var_refs[1]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_var_ref1): set_value(ctx, var_refs[1]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18623|      0|        CASE(OP_set_var_ref2): set_value(ctx, var_refs[2]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_var_ref2): set_value(ctx, var_refs[2]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18624|      0|        CASE(OP_set_var_ref3): set_value(ctx, var_refs[3]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_var_ref3): set_value(ctx, var_refs[3]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18625|      0|#endif
18626|       |
18627|      0|        CASE(OP_get_var_ref):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18628|      0|            {
18629|      0|                int idx;
18630|      0|                JSValue val;
18631|      0|                idx = get_u16(pc);
18632|      0|                pc += 2;
18633|      0|                val = *var_refs[idx]->pvalue;
18634|      0|                sp[0] = JS_DupValue(ctx, val);
18635|      0|                sp++;
18636|      0|            }
18637|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18638|      0|        CASE(OP_put_var_ref):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18639|      0|            {
18640|      0|                int idx;
18641|      0|                idx = get_u16(pc);
18642|      0|                pc += 2;
18643|      0|                set_value(ctx, var_refs[idx]->pvalue, sp[-1]);
18644|      0|                sp--;
18645|      0|            }
18646|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18647|      0|        CASE(OP_set_var_ref):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18648|      0|            {
18649|      0|                int idx;
18650|      0|                idx = get_u16(pc);
18651|      0|                pc += 2;
18652|      0|                set_value(ctx, var_refs[idx]->pvalue, JS_DupValue(ctx, sp[-1]));
18653|      0|            }
18654|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18655|     22|        CASE(OP_get_var_ref_check):
  ------------------
  |  |17781|     22|#define CASE(op)        case_ ## op
  ------------------
18656|     22|            {
18657|     22|                int idx;
18658|     22|                JSValue val;
18659|     22|                idx = get_u16(pc);
18660|     22|                pc += 2;
18661|     22|                val = *var_refs[idx]->pvalue;
18662|     22|                if (unlikely(JS_IsUninitialized(val))) {
  ------------------
  |  |   33|     22|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 22]
  |  |  ------------------
  ------------------
18663|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, TRUE);
18664|      0|                    goto exception;
18665|      0|                }
18666|     22|                sp[0] = JS_DupValue(ctx, val);
18667|     22|                sp++;
18668|     22|            }
18669|     22|            BREAK;
  ------------------
  |  |17784|     22|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|     22|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18670|     22|        CASE(OP_put_var_ref_check):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18671|      0|            {
18672|      0|                int idx;
18673|      0|                idx = get_u16(pc);
18674|      0|                pc += 2;
18675|      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]
  |  |  ------------------
  ------------------
18676|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, TRUE);
18677|      0|                    goto exception;
18678|      0|                }
18679|      0|                set_value(ctx, var_refs[idx]->pvalue, sp[-1]);
18680|      0|                sp--;
18681|      0|            }
18682|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18683|      0|        CASE(OP_put_var_ref_check_init):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18684|      0|            {
18685|      0|                int idx;
18686|      0|                idx = get_u16(pc);
18687|      0|                pc += 2;
18688|      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]
  |  |  ------------------
  ------------------
18689|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, TRUE);
18690|      0|                    goto exception;
18691|      0|                }
18692|      0|                set_value(ctx, var_refs[idx]->pvalue, sp[-1]);
18693|      0|                sp--;
18694|      0|            }
18695|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18696|      5|        CASE(OP_set_loc_uninitialized):
  ------------------
  |  |17781|      5|#define CASE(op)        case_ ## op
  ------------------
18697|      5|            {
18698|      5|                int idx;
18699|      5|                idx = get_u16(pc);
18700|      5|                pc += 2;
18701|      5|                set_value(ctx, &var_buf[idx], JS_UNINITIALIZED);
  ------------------
  |  |  295|      5|#define JS_UNINITIALIZED JS_MKVAL(JS_TAG_UNINITIALIZED, 0)
  |  |  ------------------
  |  |  |  |  247|      5|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
18702|      5|            }
18703|      5|            BREAK;
  ------------------
  |  |17784|      5|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      5|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18704|      5|        CASE(OP_get_loc_check):
  ------------------
  |  |17781|      2|#define CASE(op)        case_ ## op
  ------------------
18705|      2|            {
18706|      2|                int idx;
18707|      2|                idx = get_u16(pc);
18708|      2|                pc += 2;
18709|      2|                if (unlikely(JS_IsUninitialized(var_buf[idx]))) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
18710|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, FALSE);
18711|      0|                    goto exception;
18712|      0|                }
18713|      2|                sp[0] = JS_DupValue(ctx, var_buf[idx]);
18714|      2|                sp++;
18715|      2|            }
18716|      2|            BREAK;
  ------------------
  |  |17784|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18717|      2|        CASE(OP_get_loc_checkthis):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18718|      0|            {
18719|      0|                int idx;
18720|      0|                idx = get_u16(pc);
18721|      0|                pc += 2;
18722|      0|                if (unlikely(JS_IsUninitialized(var_buf[idx]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18723|      0|                    JS_ThrowReferenceErrorUninitialized2(caller_ctx, b, idx, FALSE);
18724|      0|                    goto exception;
18725|      0|                }
18726|      0|                sp[0] = JS_DupValue(ctx, var_buf[idx]);
18727|      0|                sp++;
18728|      0|            }
18729|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18730|      0|        CASE(OP_put_loc_check):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18731|      0|            {
18732|      0|                int idx;
18733|      0|                idx = get_u16(pc);
18734|      0|                pc += 2;
18735|      0|                if (unlikely(JS_IsUninitialized(var_buf[idx]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18736|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, FALSE);
18737|      0|                    goto exception;
18738|      0|                }
18739|      0|                set_value(ctx, &var_buf[idx], sp[-1]);
18740|      0|                sp--;
18741|      0|            }
18742|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18743|      0|        CASE(OP_set_loc_check):
  ------------------
  |  |17781|      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(ctx, b, idx, FALSE);
18750|      0|                    goto exception;
18751|      0|                }
18752|      0|                set_value(ctx, &var_buf[idx], JS_DupValue(ctx, sp[-1]));
18753|      0|            }
18754|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18755|      0|        CASE(OP_put_loc_check_init):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18756|      0|            {
18757|      0|                int idx;
18758|      0|                idx = get_u16(pc);
18759|      0|                pc += 2;
18760|      0|                if (unlikely(!JS_IsUninitialized(var_buf[idx]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18761|      0|                    JS_ThrowReferenceError(ctx, "'this' can be initialized only once");
18762|      0|                    goto exception;
18763|      0|                }
18764|      0|                set_value(ctx, &var_buf[idx], sp[-1]);
18765|      0|                sp--;
18766|      0|            }
18767|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18768|      0|        CASE(OP_close_loc):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18769|      0|            {
18770|      0|                int idx;
18771|      0|                idx = get_u16(pc);
18772|      0|                pc += 2;
18773|      0|                close_lexical_var(ctx, b, sf, idx);
18774|      0|            }
18775|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18776|       |
18777|      0|        CASE(OP_make_loc_ref):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18778|      0|        CASE(OP_make_arg_ref):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18779|      0|        CASE(OP_make_var_ref_ref):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18780|      0|            {
18781|      0|                JSVarRef *var_ref;
18782|      0|                JSProperty *pr;
18783|      0|                JSAtom atom;
18784|      0|                int idx;
18785|      0|                atom = get_u32(pc);
18786|      0|                idx = get_u16(pc + 4);
18787|      0|                pc += 6;
18788|      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 }
  |  |  ------------------
  ------------------
18789|      0|                if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18790|      0|                    goto exception;
18791|      0|                if (opcode == OP_make_var_ref_ref) {
  ------------------
  |  Branch (18791:21): [True: 0, False: 0]
  ------------------
18792|      0|                    var_ref = var_refs[idx];
18793|      0|                    js_rc(var_ref)->ref_count++;
18794|      0|                } else {
18795|      0|                    var_ref = get_var_ref(ctx, sf, idx, opcode == OP_make_arg_ref);
18796|      0|                    if (!var_ref)
  ------------------
  |  Branch (18796:25): [True: 0, False: 0]
  ------------------
18797|      0|                        goto exception;
18798|      0|                }
18799|      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)
  |  |  ------------------
  ------------------
18800|      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 */
  ------------------
18801|      0|                if (!pr) {
  ------------------
  |  Branch (18801:21): [True: 0, False: 0]
  ------------------
18802|      0|                    free_var_ref(rt, var_ref);
18803|      0|                    goto exception;
18804|      0|                }
18805|      0|                pr->u.var_ref = var_ref;
18806|      0|                *sp++ = JS_AtomToValue(ctx, atom);
18807|      0|            }
18808|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18809|      0|        CASE(OP_make_var_ref):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18810|      0|            {
18811|      0|                JSAtom atom;
18812|      0|                atom = get_u32(pc);
18813|      0|                pc += 4;
18814|      0|                sf->cur_pc = pc;
18815|       |
18816|      0|                if (JS_GetGlobalVarRef(ctx, atom, sp))
  ------------------
  |  Branch (18816:21): [True: 0, False: 0]
  ------------------
18817|      0|                    goto exception;
18818|      0|                sp += 2;
18819|      0|            }
18820|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18821|       |
18822|      0|        CASE(OP_goto):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18823|      0|            pc += (int32_t)get_u32(pc);
18824|      0|            if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18825|      0|                goto exception;
18826|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18827|      0|#if SHORT_OPCODES
18828|      0|        CASE(OP_goto16):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18829|      0|            pc += (int16_t)get_u16(pc);
18830|      0|            if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18831|      0|                goto exception;
18832|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18833|      3|        CASE(OP_goto8):
  ------------------
  |  |17781|      3|#define CASE(op)        case_ ## op
  ------------------
18834|      3|            pc += (int8_t)pc[0];
18835|      3|            if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      3|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 3]
  |  |  ------------------
  ------------------
18836|      0|                goto exception;
18837|      3|            BREAK;
  ------------------
  |  |17784|      3|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      3|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18838|      3|#endif
18839|      3|        CASE(OP_if_true):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18840|      0|            {
18841|      0|                int res;
18842|      0|                JSValue op1;
18843|       |
18844|      0|                op1 = sp[-1];
18845|      0|                pc += 4;
18846|      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 (18846:21): [True: 0, False: 0]
  ------------------
18847|      0|                    res = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
18848|      0|                } else {
18849|      0|                    res = JS_ToBoolFree(ctx, op1);
18850|      0|                }
18851|      0|                sp--;
18852|      0|                if (res) {
  ------------------
  |  Branch (18852:21): [True: 0, False: 0]
  ------------------
18853|      0|                    pc += (int32_t)get_u32(pc - 4) - 4;
18854|      0|                }
18855|      0|                if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18856|      0|                    goto exception;
18857|      0|            }
18858|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18859|      0|        CASE(OP_if_false):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18860|      0|            {
18861|      0|                int res;
18862|      0|                JSValue op1;
18863|       |
18864|      0|                op1 = sp[-1];
18865|      0|                pc += 4;
18866|       |                /* quick and dirty test for JS_TAG_INT, JS_TAG_BOOL, JS_TAG_NULL and JS_TAG_UNDEFINED */
18867|      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 (18867:21): [True: 0, False: 0]
  ------------------
18868|      0|                    res = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
18869|      0|                } else {
18870|      0|                    res = JS_ToBoolFree(ctx, op1);
18871|      0|                }
18872|      0|                sp--;
18873|      0|                if (!res) {
  ------------------
  |  Branch (18873:21): [True: 0, False: 0]
  ------------------
18874|      0|                    pc += (int32_t)get_u32(pc - 4) - 4;
18875|      0|                }
18876|      0|                if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18877|      0|                    goto exception;
18878|      0|            }
18879|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18880|      0|#if SHORT_OPCODES
18881|      2|        CASE(OP_if_true8):
  ------------------
  |  |17781|      2|#define CASE(op)        case_ ## op
  ------------------
18882|      2|            {
18883|      2|                int res;
18884|      2|                JSValue op1;
18885|       |
18886|      2|                op1 = sp[-1];
18887|      2|                pc += 1;
18888|      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 (18888:21): [True: 2, False: 0]
  ------------------
18889|      2|                    res = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      2|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
18890|      2|                } else {
18891|      0|                    res = JS_ToBoolFree(ctx, op1);
18892|      0|                }
18893|      2|                sp--;
18894|      2|                if (res) {
  ------------------
  |  Branch (18894:21): [True: 0, False: 2]
  ------------------
18895|      0|                    pc += (int8_t)pc[-1] - 1;
18896|      0|                }
18897|      2|                if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
18898|      0|                    goto exception;
18899|      2|            }
18900|      2|            BREAK;
  ------------------
  |  |17784|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18901|     23|        CASE(OP_if_false8):
  ------------------
  |  |17781|     23|#define CASE(op)        case_ ## op
  ------------------
18902|     23|            {
18903|     23|                int res;
18904|     23|                JSValue op1;
18905|       |
18906|     23|                op1 = sp[-1];
18907|     23|                pc += 1;
18908|     23|                if ((uint32_t)JS_VALUE_GET_TAG(op1) <= JS_TAG_UNDEFINED) {
  ------------------
  |  |  236|     23|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (18908:21): [True: 23, False: 0]
  ------------------
18909|     23|                    res = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|     23|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
18910|     23|                } else {
18911|      0|                    res = JS_ToBoolFree(ctx, op1);
18912|      0|                }
18913|     23|                sp--;
18914|     23|                if (!res) {
  ------------------
  |  Branch (18914:21): [True: 11, False: 12]
  ------------------
18915|     11|                    pc += (int8_t)pc[-1] - 1;
18916|     11|                }
18917|     23|                if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|     23|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 23]
  |  |  ------------------
  ------------------
18918|      0|                    goto exception;
18919|     23|            }
18920|     23|            BREAK;
  ------------------
  |  |17784|     23|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|     23|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18921|     23|#endif
18922|     23|        CASE(OP_catch):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18923|      0|            {
18924|      0|                int32_t diff;
18925|      0|                diff = get_u32(pc);
18926|      0|                sp[0] = JS_NewCatchOffset(ctx, pc + diff - b->byte_code_buf);
18927|      0|                sp++;
18928|      0|                pc += 4;
18929|      0|            }
18930|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18931|      0|        CASE(OP_gosub):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18932|      0|            {
18933|      0|                int32_t diff;
18934|      0|                diff = get_u32(pc);
18935|       |                /* XXX: should have a different tag to avoid security flaw */
18936|      0|                sp[0] = JS_NewInt32(ctx, pc + 4 - b->byte_code_buf);
18937|      0|                sp++;
18938|      0|                pc += diff;
18939|      0|            }
18940|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18941|      0|        CASE(OP_ret):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18942|      0|            {
18943|      0|                JSValue op1;
18944|      0|                uint32_t pos;
18945|      0|                op1 = sp[-1];
18946|      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]
  |  |  ------------------
  ------------------
18947|      0|                    goto ret_fail;
18948|      0|                pos = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
18949|      0|                if (unlikely(pos >= b->byte_code_len)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18950|      0|                ret_fail:
18951|      0|                    JS_ThrowInternalError(ctx, "invalid ret value");
18952|      0|                    goto exception;
18953|      0|                }
18954|      0|                sp--;
18955|      0|                pc = b->byte_code_buf + pos;
18956|      0|            }
18957|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18958|       |
18959|      1|        CASE(OP_for_in_start):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
18960|      1|            sf->cur_pc = pc;
18961|      1|            if (js_for_in_start(ctx, sp))
  ------------------
  |  Branch (18961:17): [True: 0, False: 1]
  ------------------
18962|      0|                goto exception;
18963|      1|            BREAK;
  ------------------
  |  |17784|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18964|      1|        CASE(OP_for_in_next):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
18965|      1|            sf->cur_pc = pc;
18966|      1|            if (js_for_in_next(ctx, sp))
  ------------------
  |  Branch (18966:17): [True: 0, False: 1]
  ------------------
18967|      0|                goto exception;
18968|      1|            sp += 2;
18969|      1|            BREAK;
  ------------------
  |  |17784|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18970|      1|        CASE(OP_for_of_start):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18971|      0|            sf->cur_pc = pc;
18972|      0|            if (js_for_of_start(ctx, sp, FALSE))
  ------------------
  |  Branch (18972:17): [True: 0, False: 0]
  ------------------
18973|      0|                goto exception;
18974|      0|            sp += 1;
18975|      0|            *sp++ = JS_NewCatchOffset(ctx, 0);
18976|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18977|      0|        CASE(OP_for_of_next):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18978|      0|            {
18979|      0|                int offset = -3 - pc[0];
18980|      0|                pc += 1;
18981|      0|                sf->cur_pc = pc;
18982|      0|                if (js_for_of_next(ctx, sp, offset))
  ------------------
  |  Branch (18982:21): [True: 0, False: 0]
  ------------------
18983|      0|                    goto exception;
18984|      0|                sp += 2;
18985|      0|            }
18986|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18987|      0|        CASE(OP_for_await_of_next):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18988|      0|            sf->cur_pc = pc;
18989|      0|            if (js_for_await_of_next(ctx, sp))
  ------------------
  |  Branch (18989:17): [True: 0, False: 0]
  ------------------
18990|      0|                goto exception;
18991|      0|            sp++;
18992|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18993|      0|        CASE(OP_for_await_of_start):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
18994|      0|            sf->cur_pc = pc;
18995|      0|            if (js_for_of_start(ctx, sp, TRUE))
  ------------------
  |  Branch (18995:17): [True: 0, False: 0]
  ------------------
18996|      0|                goto exception;
18997|      0|            sp += 1;
18998|      0|            *sp++ = JS_NewCatchOffset(ctx, 0);
18999|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19000|      0|        CASE(OP_iterator_get_value_done):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19001|      0|            sf->cur_pc = pc;
19002|      0|            if (js_iterator_get_value_done(ctx, sp))
  ------------------
  |  Branch (19002:17): [True: 0, False: 0]
  ------------------
19003|      0|                goto exception;
19004|      0|            sp += 1;
19005|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19006|      0|        CASE(OP_iterator_check_object):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19007|      0|            if (unlikely(!JS_IsObject(sp[-1]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19008|      0|                JS_ThrowTypeError(ctx, "iterator must return an object");
19009|      0|                goto exception;
19010|      0|            }
19011|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19012|       |
19013|      0|        CASE(OP_iterator_close):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19014|       |            /* iter_obj next catch_offset -> */
19015|      0|            sp--; /* drop the catch offset to avoid getting caught by exception */
19016|      0|            JS_FreeValue(ctx, sp[-1]); /* drop the next method */
19017|      0|            sp--;
19018|      0|            if (!JS_IsUndefined(sp[-1])) {
  ------------------
  |  Branch (19018:17): [True: 0, False: 0]
  ------------------
19019|      0|                sf->cur_pc = pc;
19020|      0|                if (JS_IteratorClose(ctx, sp[-1], FALSE))
  ------------------
  |  Branch (19020:21): [True: 0, False: 0]
  ------------------
19021|      0|                    goto exception;
19022|      0|                JS_FreeValue(ctx, sp[-1]);
19023|      0|            }
19024|      0|            sp--;
19025|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19026|      0|        CASE(OP_nip_catch):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19027|      0|            {
19028|      0|                JSValue ret_val;
19029|       |                /* catch_offset ... ret_val -> ret_eval */
19030|      0|                ret_val = *--sp;
19031|      0|                while (sp > stack_buf &&
  ------------------
  |  Branch (19031:24): [True: 0, False: 0]
  ------------------
19032|      0|                       JS_VALUE_GET_TAG(sp[-1]) != JS_TAG_CATCH_OFFSET) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19032:24): [True: 0, False: 0]
  ------------------
19033|      0|                    JS_FreeValue(ctx, *--sp);
19034|      0|                }
19035|      0|                if (unlikely(sp == stack_buf)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19036|      0|                    JS_ThrowInternalError(ctx, "nip_catch");
19037|      0|                    JS_FreeValue(ctx, ret_val);
19038|      0|                    goto exception;
19039|      0|                }
19040|      0|                sp[-1] = ret_val;
19041|      0|            }
19042|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19043|       |
19044|      0|        CASE(OP_iterator_next):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19045|       |            /* stack: iter_obj next catch_offset val */
19046|      0|            {
19047|      0|                JSValue ret;
19048|      0|                sf->cur_pc = pc;
19049|      0|                ret = JS_Call(ctx, sp[-3], sp[-4],
19050|      0|                              1, (JSValueConst *)(sp - 1));
19051|      0|                if (JS_IsException(ret))
  ------------------
  |  Branch (19051:21): [True: 0, False: 0]
  ------------------
19052|      0|                    goto exception;
19053|      0|                JS_FreeValue(ctx, sp[-1]);
19054|      0|                sp[-1] = ret;
19055|      0|            }
19056|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19057|       |
19058|      0|        CASE(OP_iterator_call):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19059|       |            /* stack: iter_obj next catch_offset val */
19060|      0|            {
19061|      0|                JSValue method, ret;
19062|      0|                BOOL ret_flag;
19063|      0|                int flags;
19064|      0|                flags = *pc++;
19065|      0|                sf->cur_pc = pc;
19066|      0|                method = JS_GetProperty(ctx, sp[-4], (flags & 1) ?
  ------------------
  |  Branch (19066:54): [True: 0, False: 0]
  ------------------
19067|      0|                                        JS_ATOM_throw : JS_ATOM_return);
19068|      0|                if (JS_IsException(method))
  ------------------
  |  Branch (19068:21): [True: 0, False: 0]
  ------------------
19069|      0|                    goto exception;
19070|      0|                if (JS_IsUndefined(method) || JS_IsNull(method)) {
  ------------------
  |  Branch (19070:21): [True: 0, False: 0]
  |  Branch (19070:47): [True: 0, False: 0]
  ------------------
19071|      0|                    ret_flag = TRUE;
19072|      0|                } else {
19073|      0|                    if (flags & 2) {
  ------------------
  |  Branch (19073:25): [True: 0, False: 0]
  ------------------
19074|       |                        /* no argument */
19075|      0|                        ret = JS_CallFree(ctx, method, sp[-4],
19076|      0|                                          0, NULL);
19077|      0|                    } else {
19078|      0|                        ret = JS_CallFree(ctx, method, sp[-4],
19079|      0|                                          1, (JSValueConst *)(sp - 1));
19080|      0|                    }
19081|      0|                    if (JS_IsException(ret))
  ------------------
  |  Branch (19081:25): [True: 0, False: 0]
  ------------------
19082|      0|                        goto exception;
19083|      0|                    JS_FreeValue(ctx, sp[-1]);
19084|      0|                    sp[-1] = ret;
19085|      0|                    ret_flag = FALSE;
19086|      0|                }
19087|      0|                sp[0] = JS_NewBool(ctx, ret_flag);
19088|      0|                sp += 1;
19089|      0|            }
19090|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19091|       |
19092|      1|        CASE(OP_lnot):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
19093|      1|            {
19094|      1|                int res;
19095|      1|                JSValue op1;
19096|       |
19097|      1|                op1 = sp[-1];
19098|      1|                if ((uint32_t)JS_VALUE_GET_TAG(op1) <= JS_TAG_UNDEFINED) {
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19098:21): [True: 0, False: 1]
  ------------------
19099|      0|                    res = JS_VALUE_GET_INT(op1) != 0;
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19100|      1|                } else {
19101|      1|                    res = JS_ToBoolFree(ctx, op1);
19102|      1|                }
19103|      1|                sp[-1] = JS_NewBool(ctx, !res);
19104|      1|            }
19105|      1|            BREAK;
  ------------------
  |  |17784|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19106|       |
19107|      1|#define GET_FIELD_INLINE(name, keep, is_length)                         \
19108|      1|            {                                                           \
19109|      1|                JSValue val, obj;                                       \
19110|      1|                JSAtom atom;                                            \
19111|      1|                JSObject *p;                                            \
19112|      1|                JSProperty *pr;                                         \
19113|      1|                JSShapeProperty *prs;                                   \
19114|      1|                                                                        \
19115|      1|                if (is_length) {                                        \
19116|      1|                    atom = JS_ATOM_length;                              \
19117|      1|                } else {                                                \
19118|      1|                    atom = get_u32(pc);                                 \
19119|      1|                    pc += 4;                                            \
19120|      1|                }                                                       \
19121|      1|                                                                        \
19122|      1|                obj = sp[-1];                                           \
19123|      1|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT)) {   \
19124|      1|                    p = JS_VALUE_GET_OBJ(obj);                          \
19125|      1|                    for(;;) {                                           \
19126|      1|                        prs = find_own_property(&pr, p, atom);          \
19127|      1|                        if (prs) {                                      \
19128|       |                            /* found */                                 \
19129|      1|                            if (unlikely(prs->flags & JS_PROP_TMASK))   \
19130|      1|                                    goto name ## _slow_path;            \
19131|      1|                            val = JS_DupValue(ctx, pr->u.value);        \
19132|      1|                            break;                                      \
19133|      1|                        }                                               \
19134|      1|                        if (unlikely(p->is_exotic)) {                   \
19135|       |                            /* XXX: should avoid the slow path for arrays \
19136|       |                               and typed arrays by ensuring that 'prop' is \
19137|       |                               not numeric */                           \
19138|      1|                            obj = JS_MKPTR(JS_TAG_OBJECT, p);           \
19139|      1|                            goto name ## _slow_path;                    \
19140|      1|                        }                                               \
19141|      1|                        p = p->shape->proto;                            \
19142|      1|                        if (!p) {                                       \
19143|      1|                            val = JS_UNDEFINED;                         \
19144|      1|                            break;                                      \
19145|      1|                        }                                               \
19146|      1|                    }                                                   \
19147|      1|                } else {                                                \
19148|      1|                name ## _slow_path:                                     \
19149|      1|                    sf->cur_pc = pc;                                    \
19150|      1|                    val = JS_GetPropertyInternal(ctx, obj, atom, sp[-1], 0); \
19151|      1|                    if (unlikely(JS_IsException(val)))                  \
19152|      1|                        goto exception;                                 \
19153|      1|                }                                                       \
19154|      1|                if (keep) {                                             \
19155|      1|                    *sp++ = val;                                        \
19156|      1|                } else {                                                \
19157|      1|                    JS_FreeValue(ctx, sp[-1]);                          \
19158|      1|                    sp[-1] = val;                                       \
19159|      1|                }                                                       \
19160|      1|            }
19161|       |
19162|       |            
19163|      2|        CASE(OP_get_field):
  ------------------
  |  |17781|      2|#define CASE(op)        case_ ## op
  ------------------
19164|      2|            GET_FIELD_INLINE(get_field, 0, 0);
  ------------------
  |  |19108|      2|            {                                                           \
  |  |19109|      2|                JSValue val, obj;                                       \
  |  |19110|      2|                JSAtom atom;                                            \
  |  |19111|      2|                JSObject *p;                                            \
  |  |19112|      2|                JSProperty *pr;                                         \
  |  |19113|      2|                JSShapeProperty *prs;                                   \
  |  |19114|      2|                                                                        \
  |  |19115|      2|                if (is_length) {                                        \
  |  |  ------------------
  |  |  |  Branch (19115:21): [Folded, False: 2]
  |  |  ------------------
  |  |19116|      0|                    atom = JS_ATOM_length;                              \
  |  |19117|      2|                } else {                                                \
  |  |19118|      2|                    atom = get_u32(pc);                                 \
  |  |19119|      2|                    pc += 4;                                            \
  |  |19120|      2|                }                                                       \
  |  |19121|      2|                                                                        \
  |  |19122|      2|                obj = sp[-1];                                           \
  |  |19123|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19124|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19125|      2|                    for(;;) {                                           \
  |  |19126|      2|                        prs = find_own_property(&pr, p, atom);          \
  |  |19127|      2|                        if (prs) {                                      \
  |  |  ------------------
  |  |  |  Branch (19127:29): [True: 0, False: 2]
  |  |  ------------------
  |  |19128|      0|                            /* found */                                 \
  |  |19129|      0|                            if (unlikely(prs->flags & JS_PROP_TMASK))   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19130|      0|                                    goto name ## _slow_path;            \
  |  |19131|      0|                            val = JS_DupValue(ctx, pr->u.value);        \
  |  |19132|      0|                            break;                                      \
  |  |19133|      0|                        }                                               \
  |  |19134|      2|                        if (unlikely(p->is_exotic)) {                   \
  |  |  ------------------
  |  |  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19135|      2|                            /* XXX: should avoid the slow path for arrays \
  |  |19136|      2|                               and typed arrays by ensuring that 'prop' is \
  |  |19137|      2|                               not numeric */                           \
  |  |19138|      2|                            obj = JS_MKPTR(JS_TAG_OBJECT, p);           \
  |  |  ------------------
  |  |  |  |  248|      2|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  |  |  ------------------
  |  |19139|      2|                            goto name ## _slow_path;                    \
  |  |19140|      2|                        }                                               \
  |  |19141|      2|                        p = p->shape->proto;                            \
  |  |19142|      0|                        if (!p) {                                       \
  |  |  ------------------
  |  |  |  Branch (19142:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19143|      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 }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19144|      0|                            break;                                      \
  |  |19145|      0|                        }                                               \
  |  |19146|      0|                    }                                                   \
  |  |19147|      2|                } else {                                                \
  |  |19148|      2|                name ## _slow_path:                                     \
  |  |19149|      2|                    sf->cur_pc = pc;                                    \
  |  |19150|      2|                    val = JS_GetPropertyInternal(ctx, obj, atom, sp[-1], 0); \
  |  |19151|      2|                    if (unlikely(JS_IsException(val)))                  \
  |  |  ------------------
  |  |  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19152|      2|                        goto exception;                                 \
  |  |19153|      2|                }                                                       \
  |  |19154|      2|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19154:21): [Folded, False: 2]
  |  |  ------------------
  |  |19155|      0|                    *sp++ = val;                                        \
  |  |19156|      2|                } else {                                                \
  |  |19157|      2|                    JS_FreeValue(ctx, sp[-1]);                          \
  |  |19158|      2|                    sp[-1] = val;                                       \
  |  |19159|      2|                }                                                       \
  |  |19160|      2|            }
  ------------------
19165|      2|            BREAK;
  ------------------
  |  |17784|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19166|       |
19167|      2|        CASE(OP_get_field2):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
19168|      1|            GET_FIELD_INLINE(get_field2, 1, 0);
  ------------------
  |  |19108|      1|            {                                                           \
  |  |19109|      1|                JSValue val, obj;                                       \
  |  |19110|      1|                JSAtom atom;                                            \
  |  |19111|      1|                JSObject *p;                                            \
  |  |19112|      1|                JSProperty *pr;                                         \
  |  |19113|      1|                JSShapeProperty *prs;                                   \
  |  |19114|      1|                                                                        \
  |  |19115|      1|                if (is_length) {                                        \
  |  |  ------------------
  |  |  |  Branch (19115:21): [Folded, False: 1]
  |  |  ------------------
  |  |19116|      0|                    atom = JS_ATOM_length;                              \
  |  |19117|      1|                } else {                                                \
  |  |19118|      1|                    atom = get_u32(pc);                                 \
  |  |19119|      1|                    pc += 4;                                            \
  |  |19120|      1|                }                                                       \
  |  |19121|      1|                                                                        \
  |  |19122|      1|                obj = sp[-1];                                           \
  |  |19123|      1|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT)) {   \
  |  |  ------------------
  |  |  |  |   32|      1|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19124|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19125|      0|                    for(;;) {                                           \
  |  |19126|      0|                        prs = find_own_property(&pr, p, atom);          \
  |  |19127|      0|                        if (prs) {                                      \
  |  |  ------------------
  |  |  |  Branch (19127:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19128|      0|                            /* found */                                 \
  |  |19129|      0|                            if (unlikely(prs->flags & JS_PROP_TMASK))   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19130|      0|                                    goto name ## _slow_path;            \
  |  |19131|      0|                            val = JS_DupValue(ctx, pr->u.value);        \
  |  |19132|      0|                            break;                                      \
  |  |19133|      0|                        }                                               \
  |  |19134|      0|                        if (unlikely(p->is_exotic)) {                   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19135|      0|                            /* XXX: should avoid the slow path for arrays \
  |  |19136|      0|                               and typed arrays by ensuring that 'prop' is \
  |  |19137|      0|                               not numeric */                           \
  |  |19138|      0|                            obj = JS_MKPTR(JS_TAG_OBJECT, p);           \
  |  |  ------------------
  |  |  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  |  |  ------------------
  |  |19139|      0|                            goto name ## _slow_path;                    \
  |  |19140|      0|                        }                                               \
  |  |19141|      0|                        p = p->shape->proto;                            \
  |  |19142|      0|                        if (!p) {                                       \
  |  |  ------------------
  |  |  |  Branch (19142:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19143|      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 }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19144|      0|                            break;                                      \
  |  |19145|      0|                        }                                               \
  |  |19146|      0|                    }                                                   \
  |  |19147|      1|                } else {                                                \
  |  |19148|      1|                name ## _slow_path:                                     \
  |  |19149|      1|                    sf->cur_pc = pc;                                    \
  |  |19150|      1|                    val = JS_GetPropertyInternal(ctx, obj, atom, sp[-1], 0); \
  |  |19151|      1|                    if (unlikely(JS_IsException(val)))                  \
  |  |  ------------------
  |  |  |  |   33|      1|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19152|      1|                        goto exception;                                 \
  |  |19153|      1|                }                                                       \
  |  |19154|      1|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19154:21): [True: 1, Folded]
  |  |  ------------------
  |  |19155|      1|                    *sp++ = val;                                        \
  |  |19156|      1|                } else {                                                \
  |  |19157|      0|                    JS_FreeValue(ctx, sp[-1]);                          \
  |  |19158|      0|                    sp[-1] = val;                                       \
  |  |19159|      0|                }                                                       \
  |  |19160|      1|            }
  ------------------
19169|      1|            BREAK;
  ------------------
  |  |17784|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19170|       |
19171|      1|#if SHORT_OPCODES
19172|      1|        CASE(OP_get_length):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19173|      0|            GET_FIELD_INLINE(get_length, 0, 1);
  ------------------
  |  |19108|      0|            {                                                           \
  |  |19109|      0|                JSValue val, obj;                                       \
  |  |19110|      0|                JSAtom atom;                                            \
  |  |19111|      0|                JSObject *p;                                            \
  |  |19112|      0|                JSProperty *pr;                                         \
  |  |19113|      0|                JSShapeProperty *prs;                                   \
  |  |19114|      0|                                                                        \
  |  |19115|      0|                if (is_length) {                                        \
  |  |  ------------------
  |  |  |  Branch (19115:21): [True: 0, Folded]
  |  |  ------------------
  |  |19116|      0|                    atom = JS_ATOM_length;                              \
  |  |19117|      0|                } else {                                                \
  |  |19118|      0|                    atom = get_u32(pc);                                 \
  |  |19119|      0|                    pc += 4;                                            \
  |  |19120|      0|                }                                                       \
  |  |19121|      0|                                                                        \
  |  |19122|      0|                obj = sp[-1];                                           \
  |  |19123|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19124|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19125|      0|                    for(;;) {                                           \
  |  |19126|      0|                        prs = find_own_property(&pr, p, atom);          \
  |  |19127|      0|                        if (prs) {                                      \
  |  |  ------------------
  |  |  |  Branch (19127:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19128|      0|                            /* found */                                 \
  |  |19129|      0|                            if (unlikely(prs->flags & JS_PROP_TMASK))   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19130|      0|                                    goto name ## _slow_path;            \
  |  |19131|      0|                            val = JS_DupValue(ctx, pr->u.value);        \
  |  |19132|      0|                            break;                                      \
  |  |19133|      0|                        }                                               \
  |  |19134|      0|                        if (unlikely(p->is_exotic)) {                   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19135|      0|                            /* XXX: should avoid the slow path for arrays \
  |  |19136|      0|                               and typed arrays by ensuring that 'prop' is \
  |  |19137|      0|                               not numeric */                           \
  |  |19138|      0|                            obj = JS_MKPTR(JS_TAG_OBJECT, p);           \
  |  |  ------------------
  |  |  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  |  |  ------------------
  |  |19139|      0|                            goto name ## _slow_path;                    \
  |  |19140|      0|                        }                                               \
  |  |19141|      0|                        p = p->shape->proto;                            \
  |  |19142|      0|                        if (!p) {                                       \
  |  |  ------------------
  |  |  |  Branch (19142:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19143|      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 }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19144|      0|                            break;                                      \
  |  |19145|      0|                        }                                               \
  |  |19146|      0|                    }                                                   \
  |  |19147|      0|                } else {                                                \
  |  |19148|      0|                name ## _slow_path:                                     \
  |  |19149|      0|                    sf->cur_pc = pc;                                    \
  |  |19150|      0|                    val = JS_GetPropertyInternal(ctx, obj, atom, sp[-1], 0); \
  |  |19151|      0|                    if (unlikely(JS_IsException(val)))                  \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19152|      0|                        goto exception;                                 \
  |  |19153|      0|                }                                                       \
  |  |19154|      0|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19154:21): [Folded, False: 0]
  |  |  ------------------
  |  |19155|      0|                    *sp++ = val;                                        \
  |  |19156|      0|                } else {                                                \
  |  |19157|      0|                    JS_FreeValue(ctx, sp[-1]);                          \
  |  |19158|      0|                    sp[-1] = val;                                       \
  |  |19159|      0|                }                                                       \
  |  |19160|      0|            }
  ------------------
19174|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19175|      0|#endif
19176|       |            
19177|     22|        CASE(OP_put_field):
  ------------------
  |  |17781|     22|#define CASE(op)        case_ ## op
  ------------------
19178|     22|            {
19179|     22|                int ret;
19180|     22|                JSValue obj;
19181|     22|                JSAtom atom;
19182|     22|                JSObject *p;
19183|     22|                JSProperty *pr;
19184|     22|                JSShapeProperty *prs;
19185|       |
19186|     22|                atom = get_u32(pc);
19187|     22|                pc += 4;
19188|       |
19189|     22|                obj = sp[-2];
19190|     22|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT)) {
  ------------------
  |  |   32|     22|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 22, False: 0]
  |  |  ------------------
  ------------------
19191|     22|                    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|     22|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     22|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
19192|     22|                    prs = find_own_property(&pr, p, atom);
19193|     22|                    if (!prs)
  ------------------
  |  Branch (19193:25): [True: 22, False: 0]
  ------------------
19194|     22|                        goto put_field_slow_path;
19195|      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]
  |  |  ------------------
  ------------------
19196|      0|                                              JS_PROP_LENGTH)) == JS_PROP_WRITABLE)) {
19197|       |                        /* fast path */
19198|      0|                        set_value(ctx, &pr->u.value, sp[-1]);
19199|      0|                    } else {
19200|      0|                        goto put_field_slow_path;
19201|      0|                    }
19202|      0|                    JS_FreeValue(ctx, obj);
19203|      0|                    sp -= 2;
19204|      0|                } else {
19205|     22|                put_field_slow_path:
19206|     22|                    sf->cur_pc = pc;
19207|     22|                    ret = JS_SetPropertyInternal(ctx, obj, atom, sp[-1], obj,
19208|     22|                                                 JS_PROP_THROW_STRICT);
  ------------------
  |  |  323|     22|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
19209|     22|                    JS_FreeValue(ctx, obj);
19210|     22|                    sp -= 2;
19211|     22|                    if (unlikely(ret < 0))
  ------------------
  |  |   33|     22|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 22]
  |  |  ------------------
  ------------------
19212|      0|                        goto exception;
19213|     22|                }
19214|       |                
19215|     22|            }
19216|     22|            BREAK;
  ------------------
  |  |17784|     22|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|     22|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19217|       |
19218|     22|        CASE(OP_private_symbol):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19219|      0|            {
19220|      0|                JSAtom atom;
19221|      0|                JSValue val;
19222|       |
19223|      0|                atom = get_u32(pc);
19224|      0|                pc += 4;
19225|      0|                val = JS_NewSymbolFromAtom(ctx, atom, JS_ATOM_TYPE_PRIVATE);
19226|      0|                if (JS_IsException(val))
  ------------------
  |  Branch (19226:21): [True: 0, False: 0]
  ------------------
19227|      0|                    goto exception;
19228|      0|                *sp++ = val;
19229|      0|            }
19230|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19231|       |
19232|      0|        CASE(OP_get_private_field):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19233|      0|            {
19234|      0|                JSValue val;
19235|       |
19236|      0|                val = JS_GetPrivateField(ctx, sp[-2], sp[-1]);
19237|      0|                JS_FreeValue(ctx, sp[-1]);
19238|      0|                JS_FreeValue(ctx, sp[-2]);
19239|      0|                sp[-2] = val;
19240|      0|                sp--;
19241|      0|                if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19242|      0|                    goto exception;
19243|      0|            }
19244|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19245|       |
19246|      0|        CASE(OP_put_private_field):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19247|      0|            {
19248|      0|                int ret;
19249|      0|                ret = JS_SetPrivateField(ctx, sp[-3], sp[-1], sp[-2]);
19250|      0|                JS_FreeValue(ctx, sp[-3]);
19251|      0|                JS_FreeValue(ctx, sp[-1]);
19252|      0|                sp -= 3;
19253|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19254|      0|                    goto exception;
19255|      0|            }
19256|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19257|       |
19258|      0|        CASE(OP_define_private_field):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19259|      0|            {
19260|      0|                int ret;
19261|      0|                ret = JS_DefinePrivateField(ctx, sp[-3], sp[-2], sp[-1]);
19262|      0|                JS_FreeValue(ctx, sp[-2]);
19263|      0|                sp -= 2;
19264|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19265|      0|                    goto exception;
19266|      0|            }
19267|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19268|       |
19269|      0|        CASE(OP_define_field):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19270|      0|            {
19271|      0|                int ret;
19272|      0|                JSAtom atom;
19273|      0|                atom = get_u32(pc);
19274|      0|                pc += 4;
19275|       |
19276|      0|                ret = JS_DefinePropertyValue(ctx, sp[-2], atom, sp[-1],
19277|      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)
  ------------------
19278|      0|                sp--;
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;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19283|       |
19284|      2|        CASE(OP_set_name):
  ------------------
  |  |17781|      2|#define CASE(op)        case_ ## op
  ------------------
19285|      2|            {
19286|      2|                int ret;
19287|      2|                JSAtom atom;
19288|      2|                atom = get_u32(pc);
19289|      2|                pc += 4;
19290|       |
19291|      2|                ret = JS_DefineObjectName(ctx, sp[-1], atom, JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|      2|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
19292|      2|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
19293|      0|                    goto exception;
19294|      2|            }
19295|      2|            BREAK;
  ------------------
  |  |17784|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19296|      2|        CASE(OP_set_name_computed):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19297|      0|            {
19298|      0|                int ret;
19299|      0|                ret = JS_DefineObjectNameComputed(ctx, sp[-1], sp[-2], JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
19300|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19301|      0|                    goto exception;
19302|      0|            }
19303|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19304|      0|        CASE(OP_set_proto):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19305|      0|            {
19306|      0|                JSValue proto;
19307|      0|                sf->cur_pc = pc;
19308|      0|                proto = sp[-1];
19309|      0|                if (JS_IsObject(proto) || JS_IsNull(proto)) {
  ------------------
  |  Branch (19309:21): [True: 0, False: 0]
  |  Branch (19309:43): [True: 0, False: 0]
  ------------------
19310|      0|                    if (JS_SetPrototypeInternal(ctx, sp[-2], proto, TRUE) < 0)
  ------------------
  |  Branch (19310:25): [True: 0, False: 0]
  ------------------
19311|      0|                        goto exception;
19312|      0|                }
19313|      0|                JS_FreeValue(ctx, proto);
19314|      0|                sp--;
19315|      0|            }
19316|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19317|      0|        CASE(OP_set_home_object):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19318|      0|            js_method_set_home_object(ctx, sp[-1], sp[-2]);
19319|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19320|      0|        CASE(OP_define_method):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19321|      0|        CASE(OP_define_method_computed):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19322|      0|            {
19323|      0|                JSValue getter, setter, value;
19324|      0|                JSValueConst obj;
  ------------------
  |  |  234|      0|#define JSValueConst JSValue
  ------------------
19325|      0|                JSAtom atom;
19326|      0|                int flags, ret, op_flags;
19327|      0|                BOOL is_computed;
19328|      0|#define OP_DEFINE_METHOD_METHOD 0
19329|      0|#define OP_DEFINE_METHOD_GETTER 1
19330|      0|#define OP_DEFINE_METHOD_SETTER 2
19331|      0|#define OP_DEFINE_METHOD_ENUMERABLE 4
19332|       |
19333|      0|                is_computed = (opcode == OP_define_method_computed);
19334|      0|                if (is_computed) {
  ------------------
  |  Branch (19334:21): [True: 0, False: 0]
  ------------------
19335|      0|                    atom = JS_ValueToAtom(ctx, sp[-2]);
19336|      0|                    if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19337|      0|                        goto exception;
19338|      0|                    opcode += OP_define_method - OP_define_method_computed;
19339|      0|                } else {
19340|      0|                    atom = get_u32(pc);
19341|      0|                    pc += 4;
19342|      0|                }
19343|      0|                op_flags = *pc++;
19344|       |
19345|      0|                obj = sp[-2 - is_computed];
19346|      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)
  ------------------
19347|      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)
  ------------------
19348|      0|                if (op_flags & OP_DEFINE_METHOD_ENUMERABLE)
  ------------------
  |  |19331|      0|#define OP_DEFINE_METHOD_ENUMERABLE 4
  ------------------
  |  Branch (19348:21): [True: 0, False: 0]
  ------------------
19349|      0|                    flags |= JS_PROP_ENUMERABLE;
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
19350|      0|                op_flags &= 3;
19351|      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 }
  |  |  ------------------
  ------------------
19352|      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 }
  |  |  ------------------
  ------------------
19353|      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 }
  |  |  ------------------
  ------------------
19354|      0|                if (op_flags == OP_DEFINE_METHOD_METHOD) {
  ------------------
  |  |19328|      0|#define OP_DEFINE_METHOD_METHOD 0
  ------------------
  |  Branch (19354:21): [True: 0, False: 0]
  ------------------
19355|      0|                    value = sp[-1];
19356|      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)
  ------------------
19357|      0|                } else if (op_flags == OP_DEFINE_METHOD_GETTER) {
  ------------------
  |  |19329|      0|#define OP_DEFINE_METHOD_GETTER 1
  ------------------
  |  Branch (19357:28): [True: 0, False: 0]
  ------------------
19358|      0|                    getter = sp[-1];
19359|      0|                    flags |= JS_PROP_HAS_GET;
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
19360|      0|                } else {
19361|      0|                    setter = sp[-1];
19362|      0|                    flags |= JS_PROP_HAS_SET;
  ------------------
  |  |  315|      0|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
19363|      0|                }
19364|      0|                ret = js_method_set_properties(ctx, sp[-1], atom, flags, obj);
19365|      0|                if (ret >= 0) {
  ------------------
  |  Branch (19365:21): [True: 0, False: 0]
  ------------------
19366|      0|                    ret = JS_DefineProperty(ctx, obj, atom, value,
19367|      0|                                            getter, setter, flags);
19368|      0|                }
19369|      0|                JS_FreeValue(ctx, sp[-1]);
19370|      0|                if (is_computed) {
  ------------------
  |  Branch (19370:21): [True: 0, False: 0]
  ------------------
19371|      0|                    JS_FreeAtom(ctx, atom);
19372|      0|                    JS_FreeValue(ctx, sp[-2]);
19373|      0|                }
19374|      0|                sp -= 1 + is_computed;
19375|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19376|      0|                    goto exception;
19377|      0|            }
19378|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19379|       |
19380|      0|        CASE(OP_define_class):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19381|      0|        CASE(OP_define_class_computed):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19382|      0|            {
19383|      0|                int class_flags;
19384|      0|                JSAtom atom;
19385|       |
19386|      0|                atom = get_u32(pc);
19387|      0|                class_flags = pc[4];
19388|      0|                pc += 5;
19389|      0|                if (js_op_define_class(ctx, sp, atom, class_flags,
  ------------------
  |  Branch (19389:21): [True: 0, False: 0]
  ------------------
19390|      0|                                       var_refs, sf,
19391|      0|                                       (opcode == OP_define_class_computed)) < 0)
19392|      0|                    goto exception;
19393|      0|            }
19394|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19395|       |
19396|      0|#define GET_ARRAY_EL_INLINE(name, keep)                                 \
19397|      0|            {                                                           \
19398|      0|                JSValue val, obj, prop;                                 \
19399|      0|                JSObject *p;                                            \
19400|      0|                uint32_t idx;                                           \
19401|      0|                                                                        \
19402|      0|                obj = sp[-2];                                           \
19403|      0|                prop = sp[-1];                                          \
19404|      0|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT &&    \
19405|      0|                           JS_VALUE_GET_TAG(prop) == JS_TAG_INT)) {     \
19406|      0|                    p = JS_VALUE_GET_OBJ(obj);                          \
19407|      0|                    idx = JS_VALUE_GET_INT(prop);                       \
19408|      0|                    if (unlikely(p->class_id != JS_CLASS_ARRAY))        \
19409|      0|                        goto name ## _slow_path;                        \
19410|      0|                    if (unlikely(idx >= p->u.array.count))              \
19411|      0|                        goto name ## _slow_path;                        \
19412|      0|                    val = JS_DupValue(ctx, p->u.array.u.values[idx]);   \
19413|      0|                } else {                                                \
19414|      0|                    name ## _slow_path:                                 \
19415|      0|                    sf->cur_pc = pc;                                    \
19416|      0|                    val = JS_GetPropertyValue(ctx, obj, prop);          \
19417|      0|                    if (unlikely(JS_IsException(val))) {                \
19418|      0|                        if (keep)                                       \
19419|      0|                            sp[-1] = JS_UNDEFINED;                      \
19420|      0|                        else                                            \
19421|      0|                            sp--;                                       \
19422|      0|                        goto exception;                                 \
19423|      0|                    }                                                   \
19424|      0|                }                                                       \
19425|      0|                if (keep) {                                             \
19426|      0|                    sp[-1] = val;                                       \
19427|      0|                } else {                                                \
19428|      0|                    JS_FreeValue(ctx, obj);                             \
19429|      0|                    sp[-2] = val;                                       \
19430|      0|                    sp--;                                               \
19431|      0|                }                                                       \
19432|      0|            }
19433|       |            
19434|      0|        CASE(OP_get_array_el):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19435|      0|            GET_ARRAY_EL_INLINE(get_array_el, 0);
  ------------------
  |  |19397|      0|            {                                                           \
  |  |19398|      0|                JSValue val, obj, prop;                                 \
  |  |19399|      0|                JSObject *p;                                            \
  |  |19400|      0|                uint32_t idx;                                           \
  |  |19401|      0|                                                                        \
  |  |19402|      0|                obj = sp[-2];                                           \
  |  |19403|      0|                prop = sp[-1];                                          \
  |  |19404|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19405|      0|                           JS_VALUE_GET_TAG(prop) == JS_TAG_INT)) {     \
  |  |19406|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19407|      0|                    idx = JS_VALUE_GET_INT(prop);                       \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |19408|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19409|      0|                        goto name ## _slow_path;                        \
  |  |19410|      0|                    if (unlikely(idx >= p->u.array.count))              \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19411|      0|                        goto name ## _slow_path;                        \
  |  |19412|      0|                    val = JS_DupValue(ctx, p->u.array.u.values[idx]);   \
  |  |19413|      0|                } else {                                                \
  |  |19414|      0|                    name ## _slow_path:                                 \
  |  |19415|      0|                    sf->cur_pc = pc;                                    \
  |  |19416|      0|                    val = JS_GetPropertyValue(ctx, obj, prop);          \
  |  |19417|      0|                    if (unlikely(JS_IsException(val))) {                \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19418|      0|                        if (keep)                                       \
  |  |  ------------------
  |  |  |  Branch (19418:29): [Folded, False: 0]
  |  |  ------------------
  |  |19419|      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 }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19420|      0|                        else                                            \
  |  |19421|      0|                            sp--;                                       \
  |  |19422|      0|                        goto exception;                                 \
  |  |19423|      0|                    }                                                   \
  |  |19424|      0|                }                                                       \
  |  |19425|      0|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19425:21): [Folded, False: 0]
  |  |  ------------------
  |  |19426|      0|                    sp[-1] = val;                                       \
  |  |19427|      0|                } else {                                                \
  |  |19428|      0|                    JS_FreeValue(ctx, obj);                             \
  |  |19429|      0|                    sp[-2] = val;                                       \
  |  |19430|      0|                    sp--;                                               \
  |  |19431|      0|                }                                                       \
  |  |19432|      0|            }
  ------------------
19436|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19437|       |
19438|      0|        CASE(OP_get_array_el2):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19439|      0|            GET_ARRAY_EL_INLINE(get_array_el2, 1);
  ------------------
  |  |19397|      0|            {                                                           \
  |  |19398|      0|                JSValue val, obj, prop;                                 \
  |  |19399|      0|                JSObject *p;                                            \
  |  |19400|      0|                uint32_t idx;                                           \
  |  |19401|      0|                                                                        \
  |  |19402|      0|                obj = sp[-2];                                           \
  |  |19403|      0|                prop = sp[-1];                                          \
  |  |19404|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19405|      0|                           JS_VALUE_GET_TAG(prop) == JS_TAG_INT)) {     \
  |  |19406|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19407|      0|                    idx = JS_VALUE_GET_INT(prop);                       \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |19408|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19409|      0|                        goto name ## _slow_path;                        \
  |  |19410|      0|                    if (unlikely(idx >= p->u.array.count))              \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19411|      0|                        goto name ## _slow_path;                        \
  |  |19412|      0|                    val = JS_DupValue(ctx, p->u.array.u.values[idx]);   \
  |  |19413|      0|                } else {                                                \
  |  |19414|      0|                    name ## _slow_path:                                 \
  |  |19415|      0|                    sf->cur_pc = pc;                                    \
  |  |19416|      0|                    val = JS_GetPropertyValue(ctx, obj, prop);          \
  |  |19417|      0|                    if (unlikely(JS_IsException(val))) {                \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19418|      0|                        if (keep)                                       \
  |  |  ------------------
  |  |  |  Branch (19418:29): [True: 0, Folded]
  |  |  ------------------
  |  |19419|      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 }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19420|      0|                        else                                            \
  |  |19421|      0|                            sp--;                                       \
  |  |19422|      0|                        goto exception;                                 \
  |  |19423|      0|                    }                                                   \
  |  |19424|      0|                }                                                       \
  |  |19425|      0|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19425:21): [True: 0, Folded]
  |  |  ------------------
  |  |19426|      0|                    sp[-1] = val;                                       \
  |  |19427|      0|                } else {                                                \
  |  |19428|      0|                    JS_FreeValue(ctx, obj);                             \
  |  |19429|      0|                    sp[-2] = val;                                       \
  |  |19430|      0|                    sp--;                                               \
  |  |19431|      0|                }                                                       \
  |  |19432|      0|            }
  ------------------
19440|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19441|       |
19442|      0|        CASE(OP_get_array_el3):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19443|      0|            {
19444|      0|                JSValue val;
19445|      0|                JSObject *p;
19446|      0|                uint32_t idx;
19447|       |
19448|      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]
  |  |  ------------------
  ------------------
19449|      0|                           JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_INT)) {
19450|      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)
  |  |  ------------------
  ------------------
19451|      0|                    idx = JS_VALUE_GET_INT(sp[-1]);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19452|      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]
  |  |  ------------------
  ------------------
19453|      0|                        goto get_array_el3_slow_path;
19454|      0|                    if (unlikely(idx >= p->u.array.count))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19455|      0|                        goto get_array_el3_slow_path;
19456|      0|                    val = JS_DupValue(ctx, p->u.array.u.values[idx]);
19457|      0|                } else {
19458|      0|                get_array_el3_slow_path:
19459|      0|                    switch (JS_VALUE_GET_TAG(sp[-1])) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
19460|      0|                    case JS_TAG_INT:
  ------------------
  |  Branch (19460:21): [True: 0, False: 0]
  ------------------
19461|      0|                    case JS_TAG_STRING:
  ------------------
  |  Branch (19461:21): [True: 0, False: 0]
  ------------------
19462|      0|                    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (19462:21): [True: 0, False: 0]
  ------------------
19463|       |                        /* undefined and null are tested in JS_GetPropertyValue() */
19464|      0|                        break;
19465|      0|                    default:
  ------------------
  |  Branch (19465:21): [True: 0, False: 0]
  ------------------
19466|       |                        /* must be tested before JS_ToPropertyKey */
19467|      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]
  |  |  ------------------
  ------------------
19468|      0|                            JS_ThrowTypeError(ctx, "value has no property");
19469|      0|                            goto exception;
19470|      0|                        }
19471|      0|                        sf->cur_pc = pc;
19472|      0|                        ret_val = JS_ToPropertyKey(ctx, sp[-1]);
19473|      0|                        if (JS_IsException(ret_val))
  ------------------
  |  Branch (19473:29): [True: 0, False: 0]
  ------------------
19474|      0|                            goto exception;
19475|      0|                        JS_FreeValue(ctx, sp[-1]);
19476|      0|                        sp[-1] = ret_val;
19477|      0|                        break;
19478|      0|                    }
19479|      0|                    sf->cur_pc = pc;
19480|      0|                    val = JS_GetPropertyValue(ctx, sp[-2], JS_DupValue(ctx, sp[-1]));
19481|      0|                    if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19482|      0|                        goto exception;
19483|      0|                }
19484|      0|                *sp++ = val;
19485|      0|            }
19486|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19487|       |            
19488|      0|        CASE(OP_get_ref_value):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19489|      0|            {
19490|      0|                JSValue val;
19491|      0|                JSAtom atom;
19492|      0|                int ret;
19493|       |                
19494|      0|                sf->cur_pc = pc;
19495|      0|                atom = JS_ValueToAtom(ctx, sp[-1]);
19496|      0|                if (atom == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (19496:21): [True: 0, False: 0]
  ------------------
19497|      0|                    goto exception;
19498|      0|                if (unlikely(JS_IsUndefined(sp[-2]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19499|      0|                    JS_ThrowReferenceErrorNotDefined(ctx, atom);
19500|      0|                    JS_FreeAtom(ctx, atom);
19501|      0|                    goto exception;
19502|      0|                }
19503|      0|                ret = JS_HasProperty(ctx, sp[-2], atom);
19504|      0|                if (unlikely(ret <= 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19505|      0|                    if (ret < 0) {
  ------------------
  |  Branch (19505:25): [True: 0, False: 0]
  ------------------
19506|      0|                        JS_FreeAtom(ctx, atom);
19507|      0|                        goto exception;
19508|      0|                    }
19509|      0|                    if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (19509:25): [True: 0, False: 0]
  ------------------
19510|      0|                        JS_ThrowReferenceErrorNotDefined(ctx, atom);
19511|      0|                        JS_FreeAtom(ctx, atom);
19512|      0|                        goto exception;
19513|      0|                    } 
19514|      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 }
  |  |  ------------------
  ------------------
19515|      0|                } else {
19516|      0|                    val = JS_GetProperty(ctx, sp[-2], atom);
19517|      0|                }
19518|      0|                JS_FreeAtom(ctx, atom);
19519|      0|                if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19520|      0|                    goto exception;
19521|      0|                sp[0] = val;
19522|      0|                sp++;
19523|      0|            }
19524|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19525|       |
19526|      0|        CASE(OP_get_super_value):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19527|      0|            {
19528|      0|                JSValue val;
19529|      0|                JSAtom atom;
19530|      0|                sf->cur_pc = pc;
19531|      0|                atom = JS_ValueToAtom(ctx, sp[-1]);
19532|      0|                if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19533|      0|                    goto exception;
19534|      0|                val = JS_GetPropertyInternal(ctx, sp[-2], atom, sp[-3], FALSE);
19535|      0|                JS_FreeAtom(ctx, atom);
19536|      0|                if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19537|      0|                    goto exception;
19538|      0|                JS_FreeValue(ctx, sp[-1]);
19539|      0|                JS_FreeValue(ctx, sp[-2]);
19540|      0|                JS_FreeValue(ctx, sp[-3]);
19541|      0|                sp[-3] = val;
19542|      0|                sp -= 2;
19543|      0|            }
19544|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19545|       |
19546|      0|        CASE(OP_put_array_el):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19547|      0|            {
19548|      0|                int ret;
19549|      0|                JSObject *p;
19550|      0|                uint32_t idx;
19551|       |
19552|      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]
  |  |  ------------------
  ------------------
19553|      0|                           JS_VALUE_GET_TAG(sp[-2]) == JS_TAG_INT)) {
19554|      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)
  |  |  ------------------
  ------------------
19555|      0|                    idx = JS_VALUE_GET_INT(sp[-2]);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19556|      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]
  |  |  ------------------
  ------------------
19557|      0|                        goto put_array_el_slow_path;
19558|      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]
  |  |  ------------------
  ------------------
19559|      0|                        uint32_t new_len, array_len;
19560|      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]
  |  |  ------------------
  ------------------
19561|      0|                                     !p->fast_array ||
19562|      0|                                     !can_extend_fast_array(p))) {
19563|      0|                            goto put_array_el_slow_path;
19564|      0|                        }
19565|      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]
  |  |  ------------------
  ------------------
19566|      0|                            goto put_array_el_slow_path;
19567|       |                        /* cannot overflow otherwise the length would not be an integer */
19568|      0|                        new_len = idx + 1;
19569|      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]
  |  |  ------------------
  ------------------
19570|      0|                            goto put_array_el_slow_path;
19571|      0|                        array_len = JS_VALUE_GET_INT(p->prop[0].u.value);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19572|      0|                        if (new_len > array_len) {
  ------------------
  |  Branch (19572:29): [True: 0, False: 0]
  ------------------
19573|      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]
  |  |  ------------------
  ------------------
19574|      0|                                goto put_array_el_slow_path;
19575|      0|                            p->prop[0].u.value = JS_NewInt32(ctx, new_len);
19576|      0|                        }
19577|      0|                        p->u.array.count = new_len;
19578|      0|                        p->u.array.u.values[idx] = sp[-1];
19579|      0|                    } else {
19580|      0|                        set_value(ctx, &p->u.array.u.values[idx], sp[-1]);
19581|      0|                    }
19582|      0|                    JS_FreeValue(ctx, sp[-3]);
19583|      0|                    sp -= 3;
19584|      0|                } else {
19585|      0|                put_array_el_slow_path:
19586|      0|                    sf->cur_pc = pc;
19587|      0|                    ret = JS_SetPropertyValue(ctx, sp[-3], sp[-2], sp[-1], JS_PROP_THROW_STRICT);
  ------------------
  |  |  323|      0|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
19588|      0|                    JS_FreeValue(ctx, sp[-3]);
19589|      0|                    sp -= 3;
19590|      0|                    if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19591|      0|                        goto exception;
19592|      0|                }
19593|      0|            }
19594|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19595|       |
19596|      0|        CASE(OP_put_ref_value):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19597|      0|            {
19598|      0|                int ret;
19599|      0|                JSAtom atom;
19600|      0|                sf->cur_pc = pc;
19601|      0|                atom = JS_ValueToAtom(ctx, sp[-2]);
19602|      0|                if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19603|      0|                    goto exception;
19604|      0|                if (unlikely(JS_IsUndefined(sp[-3]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19605|      0|                    if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (19605:25): [True: 0, False: 0]
  ------------------
19606|      0|                        JS_ThrowReferenceErrorNotDefined(ctx, atom);
19607|      0|                        JS_FreeAtom(ctx, atom);
19608|      0|                        goto exception;
19609|      0|                    } else {
19610|      0|                        sp[-3] = JS_DupValue(ctx, ctx->global_obj);
19611|      0|                    }
19612|      0|                }
19613|      0|                ret = JS_HasProperty(ctx, sp[-3], atom);
19614|      0|                if (unlikely(ret <= 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19615|      0|                    if (unlikely(ret < 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19616|      0|                        JS_FreeAtom(ctx, atom);
19617|      0|                        goto exception;
19618|      0|                    }
19619|      0|                    if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (19619:25): [True: 0, False: 0]
  ------------------
19620|      0|                        JS_ThrowReferenceErrorNotDefined(ctx, atom);
19621|      0|                        JS_FreeAtom(ctx, atom);
19622|      0|                        goto exception;
19623|      0|                    }
19624|      0|                }
19625|      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)
  ------------------
19626|      0|                JS_FreeAtom(ctx, atom);
19627|      0|                JS_FreeValue(ctx, sp[-2]);
19628|      0|                JS_FreeValue(ctx, sp[-3]);
19629|      0|                sp -= 3;
19630|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19631|      0|                    goto exception;
19632|      0|            }
19633|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19634|       |
19635|      0|        CASE(OP_put_super_value):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19636|      0|            {
19637|      0|                int ret;
19638|      0|                JSAtom atom;
19639|      0|                sf->cur_pc = pc;
19640|      0|                if (JS_VALUE_GET_TAG(sp[-3]) != JS_TAG_OBJECT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19640:21): [True: 0, False: 0]
  ------------------
19641|      0|                    JS_ThrowTypeErrorNotAnObject(ctx);
19642|      0|                    goto exception;
19643|      0|                }
19644|      0|                atom = JS_ValueToAtom(ctx, sp[-2]);
19645|      0|                if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19646|      0|                    goto exception;
19647|      0|                ret = JS_SetPropertyInternal(ctx, sp[-3], atom, sp[-1], sp[-4],
19648|      0|                                             JS_PROP_THROW_STRICT);
  ------------------
  |  |  323|      0|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
19649|      0|                JS_FreeAtom(ctx, atom);
19650|      0|                JS_FreeValue(ctx, sp[-4]);
19651|      0|                JS_FreeValue(ctx, sp[-3]);
19652|      0|                JS_FreeValue(ctx, sp[-2]);
19653|      0|                sp -= 4;
19654|      0|                if (ret < 0)
  ------------------
  |  Branch (19654:21): [True: 0, False: 0]
  ------------------
19655|      0|                    goto exception;
19656|      0|            }
19657|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19658|       |
19659|      0|        CASE(OP_define_array_el):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19660|      0|            {
19661|      0|                int ret;
19662|      0|                ret = JS_DefinePropertyValueValue(ctx, sp[-3], JS_DupValue(ctx, sp[-2]), sp[-1],
19663|      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)
  ------------------
19664|      0|                sp -= 1;
19665|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19666|      0|                    goto exception;
19667|      0|            }
19668|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19669|       |
19670|      0|        CASE(OP_append):    /* array pos enumobj -- array pos */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19671|      0|            {
19672|      0|                sf->cur_pc = pc;
19673|      0|                if (js_append_enumerate(ctx, sp))
  ------------------
  |  Branch (19673:21): [True: 0, False: 0]
  ------------------
19674|      0|                    goto exception;
19675|      0|                JS_FreeValue(ctx, *--sp);
19676|      0|            }
19677|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19678|       |
19679|      0|        CASE(OP_copy_data_properties):    /* target source excludeList */
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19680|      0|            {
19681|       |                /* stack offsets (-1 based):
19682|       |                   2 bits for target,
19683|       |                   3 bits for source,
19684|       |                   2 bits for exclusionList */
19685|      0|                int mask;
19686|       |
19687|      0|                mask = *pc++;
19688|      0|                sf->cur_pc = pc;
19689|      0|                if (JS_CopyDataProperties(ctx, sp[-1 - (mask & 3)],
  ------------------
  |  Branch (19689:21): [True: 0, False: 0]
  ------------------
19690|      0|                                          sp[-1 - ((mask >> 2) & 7)],
19691|      0|                                          sp[-1 - ((mask >> 5) & 7)], 0))
19692|      0|                    goto exception;
19693|      0|            }
19694|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19695|       |
19696|      1|        CASE(OP_add):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
19697|      1|            {
19698|      1|                JSValue op1, op2;
19699|      1|                op1 = sp[-2];
19700|      1|                op2 = sp[-1];
19701|      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]
  |  |  ------------------
  ------------------
19702|      0|                    int64_t r;
19703|      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)
  ------------------
19704|      0|                    if (unlikely((int)r != r)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19705|      0|                        sp[-2] = __JS_NewFloat64(ctx, (double)r);
19706|      0|                    } else {
19707|      0|                        sp[-2] = JS_NewInt32(ctx, r);
19708|      0|                    }
19709|      0|                    sp--;
19710|      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: 1, False: 0]
  |  |  ------------------
  ------------------
19711|      1|                           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]
  |  |  ------------------
  ------------------
19712|      1|                    double d1, d2;
19713|      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]
  |  |  ------------------
  ------------------
19714|      1|                        d1 = JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      1|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19715|      1|                    } else if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19715:32): [True: 0, False: 0]
  ------------------
19716|      0|                        d1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19717|      0|                    } else {
19718|      0|                        goto add_slow_case;
19719|      0|                    }
19720|      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]
  |  |  ------------------
  ------------------
19721|      0|                        d2 = JS_VALUE_GET_FLOAT64(op2);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19722|      1|                    } else if (JS_VALUE_GET_TAG(op2) == JS_TAG_INT) {
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19722:32): [True: 0, False: 1]
  ------------------
19723|      0|                        d2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19724|      1|                    } else {
19725|      1|                        goto add_slow_case;
19726|      1|                    }
19727|      0|                    sp[-2] = __JS_NewFloat64(ctx, d1 + d2);
19728|      0|                    sp--;
19729|      0|                } else if (JS_IsString(op1) && JS_IsString(op2)) {
  ------------------
  |  Branch (19729:28): [True: 0, False: 0]
  |  Branch (19729:48): [True: 0, False: 0]
  ------------------
19730|      0|                    sp[-2] = JS_ConcatString(ctx, op1, op2);
19731|      0|                    sp--;
19732|      0|                    if (JS_IsException(sp[-1]))
  ------------------
  |  Branch (19732:25): [True: 0, False: 0]
  ------------------
19733|      0|                        goto exception;
19734|      0|                } else {
19735|      1|                add_slow_case:
19736|      1|                    sf->cur_pc = pc;
19737|      1|                    if (js_add_slow(ctx, sp))
  ------------------
  |  Branch (19737:25): [True: 0, False: 1]
  ------------------
19738|      0|                        goto exception;
19739|      1|                    sp--;
19740|      1|                }
19741|      1|            }
19742|      1|            BREAK;
  ------------------
  |  |17784|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19743|      1|        CASE(OP_add_loc):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19744|      0|            {
19745|      0|                JSValue op2;
19746|      0|                JSValue *pv;
19747|      0|                int idx;
19748|      0|                idx = *pc;
19749|      0|                pc += 1;
19750|       |
19751|      0|                op2 = sp[-1];
19752|      0|                pv = &var_buf[idx];
19753|      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]
  |  |  ------------------
  ------------------
19754|      0|                    int64_t r;
19755|      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)
  ------------------
19756|      0|                    if (unlikely((int)r != r)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19757|      0|                        *pv = __JS_NewFloat64(ctx, (double)r);
19758|      0|                    } else {
19759|      0|                        *pv = JS_NewInt32(ctx, r);
19760|      0|                    }
19761|      0|                    sp--;
19762|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
19763|      0|                    *pv = __JS_NewFloat64(ctx, JS_VALUE_GET_FLOAT64(*pv) +
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19764|      0|                                               JS_VALUE_GET_FLOAT64(op2));
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19765|      0|                    sp--;
19766|      0|                } else if (JS_VALUE_GET_TAG(*pv) == JS_TAG_STRING &&
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19766:28): [True: 0, False: 0]
  ------------------
19767|      0|                           JS_VALUE_GET_TAG(op2) == JS_TAG_STRING) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19767:28): [True: 0, False: 0]
  ------------------
19768|      0|                    sp--;
19769|      0|                    sf->cur_pc = pc;
19770|      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 (19770:25): [True: 0, False: 0]
  ------------------
19771|      0|                        JS_FreeValue(ctx, op2);
19772|      0|                    } else {
19773|      0|                        op2 = JS_ConcatString(ctx, JS_DupValue(ctx, *pv), op2);
19774|      0|                        if (JS_IsException(op2))
  ------------------
  |  Branch (19774:29): [True: 0, False: 0]
  ------------------
19775|      0|                            goto exception;
19776|      0|                        set_value(ctx, pv, op2);
19777|      0|                    }
19778|      0|                } else {
19779|      0|                    JSValue ops[2];
19780|       |                    /* In case of exception, js_add_slow frees ops[0]
19781|       |                       and ops[1], so we must duplicate *pv */
19782|      0|                    sf->cur_pc = pc;
19783|      0|                    ops[0] = JS_DupValue(ctx, *pv);
19784|      0|                    ops[1] = op2;
19785|      0|                    sp--;
19786|      0|                    if (js_add_slow(ctx, ops + 2))
  ------------------
  |  Branch (19786:25): [True: 0, False: 0]
  ------------------
19787|      0|                        goto exception;
19788|      0|                    set_value(ctx, pv, ops[0]);
19789|      0|                }
19790|      0|            }
19791|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19792|      0|        CASE(OP_sub):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19793|      0|            {
19794|      0|                JSValue op1, op2;
19795|      0|                op1 = sp[-2];
19796|      0|                op2 = sp[-1];
19797|      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]
  |  |  ------------------
  ------------------
19798|      0|                    int64_t r;
19799|      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)
  ------------------
19800|      0|                    if (unlikely((int)r != r)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19801|      0|                        sp[-2] = __JS_NewFloat64(ctx, (double)r);
19802|      0|                    } else {
19803|      0|                        sp[-2] = JS_NewInt32(ctx, r);
19804|      0|                    }
19805|      0|                    sp--;
19806|      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]
  |  |  ------------------
  ------------------
19807|      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]
  |  |  ------------------
  ------------------
19808|      0|                    double d1, d2;
19809|      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]
  |  |  ------------------
  ------------------
19810|      0|                        d1 = JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19811|      0|                    } else if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19811:32): [True: 0, False: 0]
  ------------------
19812|      0|                        d1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19813|      0|                    } else {
19814|      0|                        goto binary_arith_slow;
19815|      0|                    }
19816|      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]
  |  |  ------------------
  ------------------
19817|      0|                        d2 = JS_VALUE_GET_FLOAT64(op2);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19818|      0|                    } else if (JS_VALUE_GET_TAG(op2) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19818:32): [True: 0, False: 0]
  ------------------
19819|      0|                        d2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19820|      0|                    } else {
19821|      0|                        goto binary_arith_slow;
19822|      0|                    }
19823|      0|                    sp[-2] = __JS_NewFloat64(ctx, d1 - d2);
19824|      0|                    sp--;
19825|      0|                } else {
19826|      0|                    goto binary_arith_slow;
19827|      0|                }
19828|      0|            }
19829|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19830|      1|        CASE(OP_mul):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
19831|      1|            {
19832|      1|                JSValue op1, op2;
19833|      1|                double d;
19834|      1|                op1 = sp[-2];
19835|      1|                op2 = sp[-1];
19836|      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]
  |  |  ------------------
  ------------------
19837|      0|                    int32_t v1, v2;
19838|      0|                    int64_t r;
19839|      0|                    v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19840|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19841|      0|                    r = (int64_t)v1 * v2;
19842|      0|                    if (unlikely((int)r != r)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19843|      0|                        d = (double)r;
19844|      0|                        goto mul_fp_res;
19845|      0|                    }
19846|       |                    /* need to test zero case for -0 result */
19847|      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]
  |  |  ------------------
  ------------------
19848|      0|                        d = -0.0;
19849|      0|                        goto mul_fp_res;
19850|      0|                    }
19851|      0|                    sp[-2] = JS_NewInt32(ctx, r);
19852|      0|                    sp--;
19853|      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]
  |  |  ------------------
  ------------------
19854|      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]
  |  |  ------------------
  ------------------
19855|      0|                    double d1, d2;
19856|      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]
  |  |  ------------------
  ------------------
19857|      0|                        d1 = JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19858|      0|                    } else if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19858:32): [True: 0, False: 0]
  ------------------
19859|      0|                        d1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19860|      0|                    } else {
19861|      0|                        goto binary_arith_slow;
19862|      0|                    }
19863|      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]
  |  |  ------------------
  ------------------
19864|      0|                        d2 = JS_VALUE_GET_FLOAT64(op2);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19865|      0|                    } else if (JS_VALUE_GET_TAG(op2) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19865:32): [True: 0, False: 0]
  ------------------
19866|      0|                        d2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19867|      0|                    } else {
19868|      0|                        goto binary_arith_slow;
19869|      0|                    }
19870|      0|                    d = d1 * d2;
19871|      0|                mul_fp_res:
19872|      0|                    sp[-2] = __JS_NewFloat64(ctx, d);
19873|      0|                    sp--;
19874|      1|                } else {
19875|      1|                    goto binary_arith_slow;
19876|      1|                }
19877|      1|            }
19878|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19879|      0|        CASE(OP_div):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19880|      0|            {
19881|      0|                JSValue op1, op2;
19882|      0|                op1 = sp[-2];
19883|      0|                op2 = sp[-1];
19884|      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]
  |  |  ------------------
  ------------------
19885|      0|                    int v1, v2;
19886|      0|                    v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19887|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19888|      0|                    sp[-2] = JS_NewFloat64(ctx, (double)v1 / (double)v2);
19889|      0|                    sp--;
19890|      0|                } else {
19891|      0|                    goto binary_arith_slow;
19892|      0|                }
19893|      0|            }
19894|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19895|      1|        CASE(OP_mod):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
19896|      1|            {
19897|      1|                JSValue op1, op2;
19898|      1|                op1 = sp[-2];
19899|      1|                op2 = sp[-1];
19900|      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]
  |  |  ------------------
  ------------------
19901|      0|                    int v1, v2, r;
19902|      0|                    v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19903|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19904|       |                    /* We must avoid v2 = 0, v1 = INT32_MIN and v2 =
19905|       |                       -1 and the cases where the result is -0. */
19906|      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]
  |  |  ------------------
  ------------------
19907|      0|                        goto binary_arith_slow;
19908|      0|                    r = v1 % v2;
19909|      0|                    sp[-2] = JS_NewInt32(ctx, r);
19910|      0|                    sp--;
19911|      1|                } else {
19912|      1|                    goto binary_arith_slow;
19913|      1|                }
19914|      1|            }
19915|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19916|      0|        CASE(OP_pow):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19917|      2|        binary_arith_slow:
19918|      2|            sf->cur_pc = pc;
19919|      2|            if (js_binary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (19919:17): [True: 0, False: 2]
  ------------------
19920|      0|                goto exception;
19921|      2|            sp--;
19922|      2|            BREAK;
  ------------------
  |  |17784|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19923|       |
19924|      2|        CASE(OP_plus):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19925|      0|            {
19926|      0|                JSValue op1;
19927|      0|                uint32_t tag;
19928|      0|                op1 = sp[-1];
19929|      0|                tag = JS_VALUE_GET_TAG(op1);
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
19930|      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 (19930:21): [True: 0, False: 0]
  ------------------
19931|      0|                } else if (tag == JS_TAG_NULL || tag == JS_TAG_BOOL) {
  ------------------
  |  Branch (19931:28): [True: 0, False: 0]
  |  Branch (19931:50): [True: 0, False: 0]
  ------------------
19932|      0|                    sp[-1] = JS_NewInt32(ctx, JS_VALUE_GET_INT(op1));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19933|      0|                } else {
19934|      0|                    sf->cur_pc = pc;
19935|      0|                    if (js_unary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (19935:25): [True: 0, False: 0]
  ------------------
19936|      0|                        goto exception;
19937|      0|                }
19938|      0|            }
19939|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19940|      1|        CASE(OP_neg):
  ------------------
  |  |17781|      1|#define CASE(op)        case_ ## op
  ------------------
19941|      1|            {
19942|      1|                JSValue op1;
19943|      1|                uint32_t tag;
19944|      1|                int val;
19945|      1|                double d;
19946|      1|                op1 = sp[-1];
19947|      1|                tag = JS_VALUE_GET_TAG(op1);
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
19948|      1|                if (tag == JS_TAG_INT ||
  ------------------
  |  Branch (19948:21): [True: 0, False: 1]
  ------------------
19949|      1|                    tag == JS_TAG_BOOL ||
  ------------------
  |  Branch (19949:21): [True: 0, False: 1]
  ------------------
19950|      1|                    tag == JS_TAG_NULL) {
  ------------------
  |  Branch (19950:21): [True: 0, False: 1]
  ------------------
19951|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19952|       |                    /* Note: -0 cannot be expressed as integer */
19953|      0|                    if (unlikely(val == 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19954|      0|                        d = -0.0;
19955|      0|                        goto neg_fp_res;
19956|      0|                    }
19957|      0|                    if (unlikely(val == INT32_MIN)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19958|      0|                        d = -(double)val;
19959|      0|                        goto neg_fp_res;
19960|      0|                    }
19961|      0|                    sp[-1] = JS_NewInt32(ctx, -val);
19962|      1|                } else if (JS_TAG_IS_FLOAT64(tag)) {
  ------------------
  |  |  250|      1|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (250:32): [True: 0, False: 1]
  |  |  ------------------
  ------------------
19963|      0|                    d = -JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19964|      0|                neg_fp_res:
19965|      0|                    sp[-1] = __JS_NewFloat64(ctx, d);
19966|      1|                } else {
19967|      1|                    sf->cur_pc = pc;
19968|      1|                    if (js_unary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (19968:25): [True: 0, False: 1]
  ------------------
19969|      0|                        goto exception;
19970|      1|                }
19971|      1|            }
19972|      1|            BREAK;
  ------------------
  |  |17784|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19973|      1|        CASE(OP_inc):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19974|      0|            {
19975|      0|                JSValue op1;
19976|      0|                int val;
19977|      0|                op1 = sp[-1];
19978|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19978:21): [True: 0, False: 0]
  ------------------
19979|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19980|      0|                    if (unlikely(val == INT32_MAX))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19981|      0|                        goto inc_slow;
19982|      0|                    sp[-1] = JS_NewInt32(ctx, val + 1);
19983|      0|                } else {
19984|      0|                inc_slow:
19985|      0|                    sf->cur_pc = pc;
19986|      0|                    if (js_unary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (19986:25): [True: 0, False: 0]
  ------------------
19987|      0|                        goto exception;
19988|      0|                }
19989|      0|            }
19990|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19991|      0|        CASE(OP_dec):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
19992|      0|            {
19993|      0|                JSValue op1;
19994|      0|                int val;
19995|      0|                op1 = sp[-1];
19996|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19996:21): [True: 0, False: 0]
  ------------------
19997|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
19998|      0|                    if (unlikely(val == INT32_MIN))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19999|      0|                        goto dec_slow;
20000|      0|                    sp[-1] = JS_NewInt32(ctx, val - 1);
20001|      0|                } else {
20002|      0|                dec_slow:
20003|      0|                    sf->cur_pc = pc;
20004|      0|                    if (js_unary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20004:25): [True: 0, False: 0]
  ------------------
20005|      0|                        goto exception;
20006|      0|                }
20007|      0|            }
20008|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20009|      0|        CASE(OP_post_inc):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20010|      0|            {
20011|      0|                JSValue op1;
20012|      0|                int val;
20013|      0|                op1 = sp[-1];
20014|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20014:21): [True: 0, False: 0]
  ------------------
20015|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20016|      0|                    if (unlikely(val == INT32_MAX))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20017|      0|                        goto post_inc_slow;
20018|      0|                    sp[0] = JS_NewInt32(ctx, val + 1);
20019|      0|                } else {
20020|      0|                post_inc_slow:
20021|      0|                    sf->cur_pc = pc;
20022|      0|                    if (js_post_inc_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20022:25): [True: 0, False: 0]
  ------------------
20023|      0|                        goto exception;
20024|      0|                }
20025|      0|                sp++;
20026|      0|            }
20027|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20028|      0|        CASE(OP_post_dec):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20029|      0|            {
20030|      0|                JSValue op1;
20031|      0|                int val;
20032|      0|                op1 = sp[-1];
20033|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20033:21): [True: 0, False: 0]
  ------------------
20034|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20035|      0|                    if (unlikely(val == INT32_MIN))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20036|      0|                        goto post_dec_slow;
20037|      0|                    sp[0] = JS_NewInt32(ctx, val - 1);
20038|      0|                } else {
20039|      0|                post_dec_slow:
20040|      0|                    sf->cur_pc = pc;
20041|      0|                    if (js_post_inc_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20041:25): [True: 0, False: 0]
  ------------------
20042|      0|                        goto exception;
20043|      0|                }
20044|      0|                sp++;
20045|      0|            }
20046|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20047|      0|        CASE(OP_inc_loc):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20048|      0|            {
20049|      0|                JSValue op1;
20050|      0|                int val;
20051|      0|                int idx;
20052|      0|                idx = *pc;
20053|      0|                pc += 1;
20054|       |
20055|      0|                op1 = var_buf[idx];
20056|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20056:21): [True: 0, False: 0]
  ------------------
20057|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20058|      0|                    if (unlikely(val == INT32_MAX))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20059|      0|                        goto inc_loc_slow;
20060|      0|                    var_buf[idx] = JS_NewInt32(ctx, val + 1);
20061|      0|                } else {
20062|      0|                inc_loc_slow:
20063|      0|                    sf->cur_pc = pc;
20064|       |                    /* must duplicate otherwise the variable value may
20065|       |                       be destroyed before JS code accesses it */
20066|      0|                    op1 = JS_DupValue(ctx, op1);
20067|      0|                    if (js_unary_arith_slow(ctx, &op1 + 1, OP_inc))
  ------------------
  |  Branch (20067:25): [True: 0, False: 0]
  ------------------
20068|      0|                        goto exception;
20069|      0|                    set_value(ctx, &var_buf[idx], op1);
20070|      0|                }
20071|      0|            }
20072|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20073|      0|        CASE(OP_dec_loc):
  ------------------
  |  |17781|      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_MIN))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20085|      0|                        goto dec_loc_slow;
20086|      0|                    var_buf[idx] = JS_NewInt32(ctx, val - 1);
20087|      0|                } else {
20088|      0|                dec_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_dec))
  ------------------
  |  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;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20099|      0|        CASE(OP_not):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20100|      0|            {
20101|      0|                JSValue op1;
20102|      0|                op1 = sp[-1];
20103|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20103:21): [True: 0, False: 0]
  ------------------
20104|      0|                    sp[-1] = JS_NewInt32(ctx, ~JS_VALUE_GET_INT(op1));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20105|      0|                } else {
20106|      0|                    sf->cur_pc = pc;
20107|      0|                    if (js_not_slow(ctx, sp))
  ------------------
  |  Branch (20107:25): [True: 0, False: 0]
  ------------------
20108|      0|                        goto exception;
20109|      0|                }
20110|      0|            }
20111|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20112|       |
20113|      0|        CASE(OP_shl):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20114|      0|            {
20115|      0|                JSValue op1, op2;
20116|      0|                op1 = sp[-2];
20117|      0|                op2 = sp[-1];
20118|      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]
  |  |  ------------------
  ------------------
20119|      0|                    uint32_t v1, v2;
20120|      0|                    v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20121|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20122|      0|                    v2 &= 0x1f;
20123|      0|                    sp[-2] = JS_NewInt32(ctx, v1 << v2);
20124|      0|                    sp--;
20125|      0|                } else {
20126|      0|                    sf->cur_pc = pc;
20127|      0|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20127:25): [True: 0, False: 0]
  ------------------
20128|      0|                        goto exception;
20129|      0|                    sp--;
20130|      0|                }
20131|      0|            }
20132|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20133|      0|        CASE(OP_shr):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20134|      0|            {
20135|      0|                JSValue op1, op2;
20136|      0|                op1 = sp[-2];
20137|      0|                op2 = sp[-1];
20138|      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]
  |  |  ------------------
  ------------------
20139|      0|                    uint32_t v2;
20140|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20141|      0|                    v2 &= 0x1f;
20142|      0|                    sp[-2] = JS_NewUint32(ctx,
20143|      0|                                          (uint32_t)JS_VALUE_GET_INT(op1) >>
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20144|      0|                                          v2);
20145|      0|                    sp--;
20146|      0|                } else {
20147|      0|                    sf->cur_pc = pc;
20148|      0|                    if (js_shr_slow(ctx, sp))
  ------------------
  |  Branch (20148:25): [True: 0, False: 0]
  ------------------
20149|      0|                        goto exception;
20150|      0|                    sp--;
20151|      0|                }
20152|      0|            }
20153|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20154|      0|        CASE(OP_sar):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20155|      0|            {
20156|      0|                JSValue op1, op2;
20157|      0|                op1 = sp[-2];
20158|      0|                op2 = sp[-1];
20159|      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]
  |  |  ------------------
  ------------------
20160|      0|                    uint32_t v2;
20161|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20162|      0|                    v2 &= 0x1f;
20163|      0|                    sp[-2] = JS_NewInt32(ctx,
20164|      0|                                          (int)JS_VALUE_GET_INT(op1) >> v2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20165|      0|                    sp--;
20166|      0|                } else {
20167|      0|                    sf->cur_pc = pc;
20168|      0|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20168:25): [True: 0, False: 0]
  ------------------
20169|      0|                        goto exception;
20170|      0|                    sp--;
20171|      0|                }
20172|      0|            }
20173|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20174|      0|        CASE(OP_and):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20175|      0|            {
20176|      0|                JSValue op1, op2;
20177|      0|                op1 = sp[-2];
20178|      0|                op2 = sp[-1];
20179|      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]
  |  |  ------------------
  ------------------
20180|      0|                    sp[-2] = JS_NewInt32(ctx,
20181|      0|                                         JS_VALUE_GET_INT(op1) &
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20182|      0|                                         JS_VALUE_GET_INT(op2));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20183|      0|                    sp--;
20184|      0|                } else {
20185|      0|                    sf->cur_pc = pc;
20186|      0|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20186:25): [True: 0, False: 0]
  ------------------
20187|      0|                        goto exception;
20188|      0|                    sp--;
20189|      0|                }
20190|      0|            }
20191|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20192|      0|        CASE(OP_or):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20193|      0|            {
20194|      0|                JSValue op1, op2;
20195|      0|                op1 = sp[-2];
20196|      0|                op2 = sp[-1];
20197|      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]
  |  |  ------------------
  ------------------
20198|      0|                    sp[-2] = JS_NewInt32(ctx,
20199|      0|                                         JS_VALUE_GET_INT(op1) |
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20200|      0|                                         JS_VALUE_GET_INT(op2));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20201|      0|                    sp--;
20202|      0|                } else {
20203|      0|                    sf->cur_pc = pc;
20204|      0|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20204:25): [True: 0, False: 0]
  ------------------
20205|      0|                        goto exception;
20206|      0|                    sp--;
20207|      0|                }
20208|      0|            }
20209|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20210|      0|        CASE(OP_xor):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20211|      0|            {
20212|      0|                JSValue op1, op2;
20213|      0|                op1 = sp[-2];
20214|      0|                op2 = sp[-1];
20215|      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]
  |  |  ------------------
  ------------------
20216|      0|                    sp[-2] = JS_NewInt32(ctx,
20217|      0|                                         JS_VALUE_GET_INT(op1) ^
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20218|      0|                                         JS_VALUE_GET_INT(op2));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20219|      0|                    sp--;
20220|      0|                } else {
20221|      0|                    sf->cur_pc = pc;
20222|      0|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20222:25): [True: 0, False: 0]
  ------------------
20223|      0|                        goto exception;
20224|      0|                    sp--;
20225|      0|                }
20226|      0|            }
20227|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20228|       |
20229|       |
20230|      0|#define OP_CMP(opcode, binary_op, slow_call)                            \
20231|      0|            CASE(opcode):                                               \
20232|      0|                {                                                       \
20233|      0|                JSValue op1, op2;                                       \
20234|      0|                op1 = sp[-2];                                           \
20235|      0|                op2 = sp[-1];                                           \
20236|      0|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {           \
20237|      0|                    sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
20238|      0|                    sp--;                                               \
20239|      0|                } else if (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op1)) ||  \
20240|      0|                           JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op2))) {  \
20241|      0|                    double d1, d2;                                      \
20242|      0|                    if (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op1))) {     \
20243|      0|                        d1 = JS_VALUE_GET_FLOAT64(op1);                 \
20244|      0|                    } else if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {   \
20245|      0|                        d1 = JS_VALUE_GET_INT(op1);                     \
20246|      0|                    } else {                                            \
20247|      0|                        goto opcode ## _slow_case;                      \
20248|      0|                    }                                                   \
20249|      0|                    if (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op2))) {     \
20250|      0|                        d2 = JS_VALUE_GET_FLOAT64(op2);                 \
20251|      0|                    } else if (JS_VALUE_GET_TAG(op2) == JS_TAG_INT) {   \
20252|      0|                        d2 = JS_VALUE_GET_INT(op2);                     \
20253|      0|                    } else {                                            \
20254|      0|                        goto opcode ## _slow_case;                      \
20255|      0|                    }                                                   \
20256|      0|                    sp[-2] = JS_NewBool(ctx, d1 binary_op d2);          \
20257|      0|                    sp--;                                               \
20258|      0|                } else {                                                \
20259|      0|                opcode ## _slow_case:                                   \
20260|      0|                    sf->cur_pc = pc;                                    \
20261|      0|                    if (slow_call)                                      \
20262|      0|                        goto exception;                                 \
20263|      0|                    sp--;                                               \
20264|      0|                }                                                       \
20265|      0|                }                                                       \
20266|      0|            BREAK
20267|       |
20268|      0|            OP_CMP(OP_lt, <, js_relational_slow(ctx, sp, opcode));
  ------------------
  |  |20231|      0|            CASE(opcode):                                               \
  |  |  ------------------
  |  |  |  |17781|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20232|      0|                {                                                       \
  |  |20233|      0|                JSValue op1, op2;                                       \
  |  |20234|      0|                op1 = sp[-2];                                           \
  |  |20235|      0|                op2 = sp[-1];                                           \
  |  |20236|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20237|      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)
  |  |  ------------------
  |  |20238|      0|                    sp--;                                               \
  |  |20239|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20240|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20241|      0|                    double d1, d2;                                      \
  |  |20242|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20243|      0|                        d1 = JS_VALUE_GET_FLOAT64(op1);                 \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20244|      0|                    } else if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {   \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (20244:32): [True: 0, False: 0]
  |  |  ------------------
  |  |20245|      0|                        d1 = JS_VALUE_GET_INT(op1);                     \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20246|      0|                    } else {                                            \
  |  |20247|      0|                        goto opcode ## _slow_case;                      \
  |  |20248|      0|                    }                                                   \
  |  |20249|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20250|      0|                        d2 = JS_VALUE_GET_FLOAT64(op2);                 \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20251|      0|                    } else if (JS_VALUE_GET_TAG(op2) == JS_TAG_INT) {   \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (20251:32): [True: 0, False: 0]
  |  |  ------------------
  |  |20252|      0|                        d2 = JS_VALUE_GET_INT(op2);                     \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20253|      0|                    } else {                                            \
  |  |20254|      0|                        goto opcode ## _slow_case;                      \
  |  |20255|      0|                    }                                                   \
  |  |20256|      0|                    sp[-2] = JS_NewBool(ctx, d1 binary_op d2);          \
  |  |20257|      0|                    sp--;                                               \
  |  |20258|      0|                } else {                                                \
  |  |20259|      0|                opcode ## _slow_case:                                   \
  |  |20260|      0|                    sf->cur_pc = pc;                                    \
  |  |20261|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20261:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20262|      0|                        goto exception;                                 \
  |  |20263|      0|                    sp--;                                               \
  |  |20264|      0|                }                                                       \
  |  |20265|      0|                }                                                       \
  |  |20266|      0|            BREAK
  |  |  ------------------
  |  |  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20269|      0|            OP_CMP(OP_lte, <=, js_relational_slow(ctx, sp, opcode));
  ------------------
  |  |20231|      0|            CASE(opcode):                                               \
  |  |  ------------------
  |  |  |  |17781|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20232|      0|                {                                                       \
  |  |20233|      0|                JSValue op1, op2;                                       \
  |  |20234|      0|                op1 = sp[-2];                                           \
  |  |20235|      0|                op2 = sp[-1];                                           \
  |  |20236|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20237|      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)
  |  |  ------------------
  |  |20238|      0|                    sp--;                                               \
  |  |20239|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20240|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20241|      0|                    double d1, d2;                                      \
  |  |20242|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20243|      0|                        d1 = JS_VALUE_GET_FLOAT64(op1);                 \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20244|      0|                    } else if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {   \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (20244:32): [True: 0, False: 0]
  |  |  ------------------
  |  |20245|      0|                        d1 = JS_VALUE_GET_INT(op1);                     \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20246|      0|                    } else {                                            \
  |  |20247|      0|                        goto opcode ## _slow_case;                      \
  |  |20248|      0|                    }                                                   \
  |  |20249|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20250|      0|                        d2 = JS_VALUE_GET_FLOAT64(op2);                 \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20251|      0|                    } else if (JS_VALUE_GET_TAG(op2) == JS_TAG_INT) {   \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (20251:32): [True: 0, False: 0]
  |  |  ------------------
  |  |20252|      0|                        d2 = JS_VALUE_GET_INT(op2);                     \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20253|      0|                    } else {                                            \
  |  |20254|      0|                        goto opcode ## _slow_case;                      \
  |  |20255|      0|                    }                                                   \
  |  |20256|      0|                    sp[-2] = JS_NewBool(ctx, d1 binary_op d2);          \
  |  |20257|      0|                    sp--;                                               \
  |  |20258|      0|                } else {                                                \
  |  |20259|      0|                opcode ## _slow_case:                                   \
  |  |20260|      0|                    sf->cur_pc = pc;                                    \
  |  |20261|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20261:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20262|      0|                        goto exception;                                 \
  |  |20263|      0|                    sp--;                                               \
  |  |20264|      0|                }                                                       \
  |  |20265|      0|                }                                                       \
  |  |20266|      0|            BREAK
  |  |  ------------------
  |  |  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20270|      0|            OP_CMP(OP_gt, >, js_relational_slow(ctx, sp, opcode));
  ------------------
  |  |20231|      0|            CASE(opcode):                                               \
  |  |  ------------------
  |  |  |  |17781|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20232|      0|                {                                                       \
  |  |20233|      0|                JSValue op1, op2;                                       \
  |  |20234|      0|                op1 = sp[-2];                                           \
  |  |20235|      0|                op2 = sp[-1];                                           \
  |  |20236|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20237|      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)
  |  |  ------------------
  |  |20238|      0|                    sp--;                                               \
  |  |20239|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20240|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20241|      0|                    double d1, d2;                                      \
  |  |20242|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20243|      0|                        d1 = JS_VALUE_GET_FLOAT64(op1);                 \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20244|      0|                    } else if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {   \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (20244:32): [True: 0, False: 0]
  |  |  ------------------
  |  |20245|      0|                        d1 = JS_VALUE_GET_INT(op1);                     \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20246|      0|                    } else {                                            \
  |  |20247|      0|                        goto opcode ## _slow_case;                      \
  |  |20248|      0|                    }                                                   \
  |  |20249|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20250|      0|                        d2 = JS_VALUE_GET_FLOAT64(op2);                 \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20251|      0|                    } else if (JS_VALUE_GET_TAG(op2) == JS_TAG_INT) {   \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (20251:32): [True: 0, False: 0]
  |  |  ------------------
  |  |20252|      0|                        d2 = JS_VALUE_GET_INT(op2);                     \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20253|      0|                    } else {                                            \
  |  |20254|      0|                        goto opcode ## _slow_case;                      \
  |  |20255|      0|                    }                                                   \
  |  |20256|      0|                    sp[-2] = JS_NewBool(ctx, d1 binary_op d2);          \
  |  |20257|      0|                    sp--;                                               \
  |  |20258|      0|                } else {                                                \
  |  |20259|      0|                opcode ## _slow_case:                                   \
  |  |20260|      0|                    sf->cur_pc = pc;                                    \
  |  |20261|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20261:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20262|      0|                        goto exception;                                 \
  |  |20263|      0|                    sp--;                                               \
  |  |20264|      0|                }                                                       \
  |  |20265|      0|                }                                                       \
  |  |20266|      0|            BREAK
  |  |  ------------------
  |  |  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20271|      0|            OP_CMP(OP_gte, >=, js_relational_slow(ctx, sp, opcode));
  ------------------
  |  |20231|      0|            CASE(opcode):                                               \
  |  |  ------------------
  |  |  |  |17781|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20232|      0|                {                                                       \
  |  |20233|      0|                JSValue op1, op2;                                       \
  |  |20234|      0|                op1 = sp[-2];                                           \
  |  |20235|      0|                op2 = sp[-1];                                           \
  |  |20236|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20237|      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)
  |  |  ------------------
  |  |20238|      0|                    sp--;                                               \
  |  |20239|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20240|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20241|      0|                    double d1, d2;                                      \
  |  |20242|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20243|      0|                        d1 = JS_VALUE_GET_FLOAT64(op1);                 \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20244|      0|                    } else if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {   \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (20244:32): [True: 0, False: 0]
  |  |  ------------------
  |  |20245|      0|                        d1 = JS_VALUE_GET_INT(op1);                     \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20246|      0|                    } else {                                            \
  |  |20247|      0|                        goto opcode ## _slow_case;                      \
  |  |20248|      0|                    }                                                   \
  |  |20249|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20250|      0|                        d2 = JS_VALUE_GET_FLOAT64(op2);                 \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20251|      0|                    } else if (JS_VALUE_GET_TAG(op2) == JS_TAG_INT) {   \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (20251:32): [True: 0, False: 0]
  |  |  ------------------
  |  |20252|      0|                        d2 = JS_VALUE_GET_INT(op2);                     \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20253|      0|                    } else {                                            \
  |  |20254|      0|                        goto opcode ## _slow_case;                      \
  |  |20255|      0|                    }                                                   \
  |  |20256|      0|                    sp[-2] = JS_NewBool(ctx, d1 binary_op d2);          \
  |  |20257|      0|                    sp--;                                               \
  |  |20258|      0|                } else {                                                \
  |  |20259|      0|                opcode ## _slow_case:                                   \
  |  |20260|      0|                    sf->cur_pc = pc;                                    \
  |  |20261|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20261:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20262|      0|                        goto exception;                                 \
  |  |20263|      0|                    sp--;                                               \
  |  |20264|      0|                }                                                       \
  |  |20265|      0|                }                                                       \
  |  |20266|      0|            BREAK
  |  |  ------------------
  |  |  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20272|       |
20273|      0|#define OP_CMP_EQ(opcode, inv)                                          \
20274|      0|            CASE(opcode):                                               \
20275|      0|                {                                                       \
20276|      0|                JSValue op1, op2;                                       \
20277|      0|                int res;                                                \
20278|      0|                uint32_t tag1, tag2;                                    \
20279|      0|                op1 = sp[-2];                                           \
20280|      0|                op2 = sp[-1];                                           \
20281|      0|                tag1 = JS_VALUE_GET_TAG(op1);                           \
20282|      0|                tag2 = JS_VALUE_GET_TAG(op2);                           \
20283|      0|                if (likely(tag1 == JS_TAG_INT)) {                       \
20284|      0|                    if (tag2 == JS_TAG_INT) {                           \
20285|      0|                        res = JS_VALUE_GET_INT(op1) == JS_VALUE_GET_INT(op2); \
20286|      0|                    } else if (JS_TAG_IS_FLOAT64(tag2)) {               \
20287|      0|                        res = (JS_VALUE_GET_INT(op1) == JS_VALUE_GET_FLOAT64(op2)); \
20288|      0|                    } else {                                            \
20289|      0|                        goto slow_eq ## inv;                            \
20290|      0|                    }                                                   \
20291|      0|                } else if (JS_TAG_IS_FLOAT64(tag1)) {                   \
20292|      0|                    if (tag2 == JS_TAG_INT) {                           \
20293|      0|                        res = JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_INT(op2); \
20294|      0|                    } else if (JS_TAG_IS_FLOAT64(tag2)) {               \
20295|      0|                        res = (JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_FLOAT64(op2)); \
20296|      0|                    } else {                                            \
20297|      0|                        goto slow_eq ## inv;                            \
20298|      0|                    }                                                   \
20299|      0|                } else if (tag1 == JS_TAG_OBJECT) {                     \
20300|      0|                    if (tag2 == JS_TAG_NULL || tag2 == JS_TAG_UNDEFINED) { \
20301|      0|                        JSObject *p = JS_VALUE_GET_OBJ(op1);            \
20302|      0|                        res = p->is_HTMLDDA;                            \
20303|      0|                        JS_FreeValue(ctx, op1);                         \
20304|      0|                    } else if (tag2 == JS_TAG_OBJECT) {                 \
20305|      0|                        res = JS_VALUE_GET_OBJ(op1) == JS_VALUE_GET_OBJ(op2); \
20306|      0|                        JS_FreeValue(ctx, op1);                         \
20307|      0|                        JS_FreeValue(ctx, op2);                         \
20308|      0|                    } else {                                            \
20309|      0|                        goto slow_eq ## inv;                            \
20310|      0|                    }                                                   \
20311|      0|                } else if (tag1 == JS_TAG_NULL || tag1 == JS_TAG_UNDEFINED) { \
20312|      0|                    if (tag2 == JS_TAG_NULL || tag2 == JS_TAG_UNDEFINED) { \
20313|      0|                        res = TRUE;                                     \
20314|      0|                    } else if (tag2 == JS_TAG_OBJECT) {                 \
20315|      0|                        JSObject *p = JS_VALUE_GET_OBJ(op2);            \
20316|      0|                        res = p->is_HTMLDDA;                            \
20317|      0|                        JS_FreeValue(ctx, op2);                         \
20318|      0|                    } else {                                            \
20319|      0|                        goto slow_eq ## inv;                            \
20320|      0|                    }                                                   \
20321|      0|                } else if (tag1 == JS_TAG_STRING && tag2 == JS_TAG_STRING) { \
20322|      0|                    res = js_string_eq(ctx, JS_VALUE_GET_STRING(op1),   \
20323|      0|                                       JS_VALUE_GET_STRING(op2));       \
20324|      0|                    JS_FreeValue(ctx, op1);                             \
20325|      0|                    JS_FreeValue(ctx, op2);                             \
20326|      0|                } else {                                                \
20327|      0|                    slow_eq ## inv:                                     \
20328|      0|                    sf->cur_pc = pc;                                    \
20329|      0|                    if (js_eq_slow(ctx, sp, inv))                       \
20330|      0|                        goto exception;                                 \
20331|      0|                    sp--;                                               \
20332|      0|                    goto slow_eq_done ## inv;                           \
20333|      0|                }                                                       \
20334|      0|                sp[-2] = JS_NewBool(ctx, res ^ inv);                    \
20335|      0|                sp--;                                                   \
20336|      0|                slow_eq_done ## inv: ;                                  \
20337|      0|                }                                                       \
20338|      0|            BREAK
20339|       |
20340|      0|            OP_CMP_EQ(OP_eq, 0);
  ------------------
  |  |20274|      0|            CASE(opcode):                                               \
  |  |  ------------------
  |  |  |  |17781|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20275|      0|                {                                                       \
  |  |20276|      0|                JSValue op1, op2;                                       \
  |  |20277|      0|                int res;                                                \
  |  |20278|      0|                uint32_t tag1, tag2;                                    \
  |  |20279|      0|                op1 = sp[-2];                                           \
  |  |20280|      0|                op2 = sp[-1];                                           \
  |  |20281|      0|                tag1 = JS_VALUE_GET_TAG(op1);                           \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |20282|      0|                tag2 = JS_VALUE_GET_TAG(op2);                           \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |20283|      0|                if (likely(tag1 == JS_TAG_INT)) {                       \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20284|      0|                    if (tag2 == JS_TAG_INT) {                           \
  |  |  ------------------
  |  |  |  Branch (20284:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20285|      0|                        res = JS_VALUE_GET_INT(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                       res = JS_VALUE_GET_INT(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20286|      0|                    } else if (JS_TAG_IS_FLOAT64(tag2)) {               \
  |  |  ------------------
  |  |  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20287|      0|                        res = (JS_VALUE_GET_INT(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                       res = (JS_VALUE_GET_INT(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20288|      0|                    } else {                                            \
  |  |20289|      0|                        goto slow_eq ## inv;                            \
  |  |20290|      0|                    }                                                   \
  |  |20291|      0|                } else if (JS_TAG_IS_FLOAT64(tag1)) {                   \
  |  |  ------------------
  |  |  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20292|      0|                    if (tag2 == JS_TAG_INT) {                           \
  |  |  ------------------
  |  |  |  Branch (20292:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20293|      0|                        res = JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |                                       res = JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20294|      0|                    } else if (JS_TAG_IS_FLOAT64(tag2)) {               \
  |  |  ------------------
  |  |  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20295|      0|                        res = (JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |                                       res = (JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20296|      0|                    } else {                                            \
  |  |20297|      0|                        goto slow_eq ## inv;                            \
  |  |20298|      0|                    }                                                   \
  |  |20299|      0|                } else if (tag1 == JS_TAG_OBJECT) {                     \
  |  |  ------------------
  |  |  |  Branch (20299:28): [True: 0, False: 0]
  |  |  ------------------
  |  |20300|      0|                    if (tag2 == JS_TAG_NULL || tag2 == JS_TAG_UNDEFINED) { \
  |  |  ------------------
  |  |  |  Branch (20300:25): [True: 0, False: 0]
  |  |  |  Branch (20300:48): [True: 0, False: 0]
  |  |  ------------------
  |  |20301|      0|                        JSObject *p = JS_VALUE_GET_OBJ(op1);            \
  |  |  ------------------
  |  |  |  |  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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20302|      0|                        res = p->is_HTMLDDA;                            \
  |  |20303|      0|                        JS_FreeValue(ctx, op1);                         \
  |  |20304|      0|                    } else if (tag2 == JS_TAG_OBJECT) {                 \
  |  |  ------------------
  |  |  |  Branch (20304:32): [True: 0, False: 0]
  |  |  ------------------
  |  |20305|      0|                        res = JS_VALUE_GET_OBJ(op1) == JS_VALUE_GET_OBJ(op2); \
  |  |  ------------------
  |  |  |  |  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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                                       res = JS_VALUE_GET_OBJ(op1) == JS_VALUE_GET_OBJ(op2); \
  |  |  ------------------
  |  |  |  |  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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20306|      0|                        JS_FreeValue(ctx, op1);                         \
  |  |20307|      0|                        JS_FreeValue(ctx, op2);                         \
  |  |20308|      0|                    } else {                                            \
  |  |20309|      0|                        goto slow_eq ## inv;                            \
  |  |20310|      0|                    }                                                   \
  |  |20311|      0|                } else if (tag1 == JS_TAG_NULL || tag1 == JS_TAG_UNDEFINED) { \
  |  |  ------------------
  |  |  |  Branch (20311:28): [True: 0, False: 0]
  |  |  |  Branch (20311:51): [True: 0, False: 0]
  |  |  ------------------
  |  |20312|      0|                    if (tag2 == JS_TAG_NULL || tag2 == JS_TAG_UNDEFINED) { \
  |  |  ------------------
  |  |  |  Branch (20312:25): [True: 0, False: 0]
  |  |  |  Branch (20312:48): [True: 0, False: 0]
  |  |  ------------------
  |  |20313|      0|                        res = TRUE;                                     \
  |  |20314|      0|                    } else if (tag2 == JS_TAG_OBJECT) {                 \
  |  |  ------------------
  |  |  |  Branch (20314:32): [True: 0, False: 0]
  |  |  ------------------
  |  |20315|      0|                        JSObject *p = JS_VALUE_GET_OBJ(op2);            \
  |  |  ------------------
  |  |  |  |  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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20316|      0|                        res = p->is_HTMLDDA;                            \
  |  |20317|      0|                        JS_FreeValue(ctx, op2);                         \
  |  |20318|      0|                    } else {                                            \
  |  |20319|      0|                        goto slow_eq ## inv;                            \
  |  |20320|      0|                    }                                                   \
  |  |20321|      0|                } else if (tag1 == JS_TAG_STRING && tag2 == JS_TAG_STRING) { \
  |  |  ------------------
  |  |  |  Branch (20321:28): [True: 0, False: 0]
  |  |  |  Branch (20321:53): [True: 0, False: 0]
  |  |  ------------------
  |  |20322|      0|                    res = js_string_eq(ctx, 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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20323|      0|                                       JS_VALUE_GET_STRING(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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20324|      0|                    JS_FreeValue(ctx, op1);                             \
  |  |20325|      0|                    JS_FreeValue(ctx, op2);                             \
  |  |20326|      0|                } else {                                                \
  |  |20327|      0|                    slow_eq ## inv:                                     \
  |  |20328|      0|                    sf->cur_pc = pc;                                    \
  |  |20329|      0|                    if (js_eq_slow(ctx, sp, inv))                       \
  |  |  ------------------
  |  |  |  Branch (20329:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20330|      0|                        goto exception;                                 \
  |  |20331|      0|                    sp--;                                               \
  |  |20332|      0|                    goto slow_eq_done ## inv;                           \
  |  |20333|      0|                }                                                       \
  |  |20334|      0|                sp[-2] = JS_NewBool(ctx, res ^ inv);                    \
  |  |20335|      0|                sp--;                                                   \
  |  |20336|      0|                slow_eq_done ## inv: ;                                  \
  |  |20337|      0|                }                                                       \
  |  |20338|      0|            BREAK
  |  |  ------------------
  |  |  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20341|      0|            OP_CMP_EQ(OP_neq, 1);
  ------------------
  |  |20274|      0|            CASE(opcode):                                               \
  |  |  ------------------
  |  |  |  |17781|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20275|      0|                {                                                       \
  |  |20276|      0|                JSValue op1, op2;                                       \
  |  |20277|      0|                int res;                                                \
  |  |20278|      0|                uint32_t tag1, tag2;                                    \
  |  |20279|      0|                op1 = sp[-2];                                           \
  |  |20280|      0|                op2 = sp[-1];                                           \
  |  |20281|      0|                tag1 = JS_VALUE_GET_TAG(op1);                           \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |20282|      0|                tag2 = JS_VALUE_GET_TAG(op2);                           \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |20283|      0|                if (likely(tag1 == JS_TAG_INT)) {                       \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20284|      0|                    if (tag2 == JS_TAG_INT) {                           \
  |  |  ------------------
  |  |  |  Branch (20284:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20285|      0|                        res = JS_VALUE_GET_INT(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                       res = JS_VALUE_GET_INT(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20286|      0|                    } else if (JS_TAG_IS_FLOAT64(tag2)) {               \
  |  |  ------------------
  |  |  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20287|      0|                        res = (JS_VALUE_GET_INT(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                       res = (JS_VALUE_GET_INT(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20288|      0|                    } else {                                            \
  |  |20289|      0|                        goto slow_eq ## inv;                            \
  |  |20290|      0|                    }                                                   \
  |  |20291|      0|                } else if (JS_TAG_IS_FLOAT64(tag1)) {                   \
  |  |  ------------------
  |  |  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20292|      0|                    if (tag2 == JS_TAG_INT) {                           \
  |  |  ------------------
  |  |  |  Branch (20292:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20293|      0|                        res = JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |                                       res = JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20294|      0|                    } else if (JS_TAG_IS_FLOAT64(tag2)) {               \
  |  |  ------------------
  |  |  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20295|      0|                        res = (JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |                                       res = (JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20296|      0|                    } else {                                            \
  |  |20297|      0|                        goto slow_eq ## inv;                            \
  |  |20298|      0|                    }                                                   \
  |  |20299|      0|                } else if (tag1 == JS_TAG_OBJECT) {                     \
  |  |  ------------------
  |  |  |  Branch (20299:28): [True: 0, False: 0]
  |  |  ------------------
  |  |20300|      0|                    if (tag2 == JS_TAG_NULL || tag2 == JS_TAG_UNDEFINED) { \
  |  |  ------------------
  |  |  |  Branch (20300:25): [True: 0, False: 0]
  |  |  |  Branch (20300:48): [True: 0, False: 0]
  |  |  ------------------
  |  |20301|      0|                        JSObject *p = JS_VALUE_GET_OBJ(op1);            \
  |  |  ------------------
  |  |  |  |  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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20302|      0|                        res = p->is_HTMLDDA;                            \
  |  |20303|      0|                        JS_FreeValue(ctx, op1);                         \
  |  |20304|      0|                    } else if (tag2 == JS_TAG_OBJECT) {                 \
  |  |  ------------------
  |  |  |  Branch (20304:32): [True: 0, False: 0]
  |  |  ------------------
  |  |20305|      0|                        res = JS_VALUE_GET_OBJ(op1) == JS_VALUE_GET_OBJ(op2); \
  |  |  ------------------
  |  |  |  |  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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                                       res = JS_VALUE_GET_OBJ(op1) == JS_VALUE_GET_OBJ(op2); \
  |  |  ------------------
  |  |  |  |  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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20306|      0|                        JS_FreeValue(ctx, op1);                         \
  |  |20307|      0|                        JS_FreeValue(ctx, op2);                         \
  |  |20308|      0|                    } else {                                            \
  |  |20309|      0|                        goto slow_eq ## inv;                            \
  |  |20310|      0|                    }                                                   \
  |  |20311|      0|                } else if (tag1 == JS_TAG_NULL || tag1 == JS_TAG_UNDEFINED) { \
  |  |  ------------------
  |  |  |  Branch (20311:28): [True: 0, False: 0]
  |  |  |  Branch (20311:51): [True: 0, False: 0]
  |  |  ------------------
  |  |20312|      0|                    if (tag2 == JS_TAG_NULL || tag2 == JS_TAG_UNDEFINED) { \
  |  |  ------------------
  |  |  |  Branch (20312:25): [True: 0, False: 0]
  |  |  |  Branch (20312:48): [True: 0, False: 0]
  |  |  ------------------
  |  |20313|      0|                        res = TRUE;                                     \
  |  |20314|      0|                    } else if (tag2 == JS_TAG_OBJECT) {                 \
  |  |  ------------------
  |  |  |  Branch (20314:32): [True: 0, False: 0]
  |  |  ------------------
  |  |20315|      0|                        JSObject *p = JS_VALUE_GET_OBJ(op2);            \
  |  |  ------------------
  |  |  |  |  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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20316|      0|                        res = p->is_HTMLDDA;                            \
  |  |20317|      0|                        JS_FreeValue(ctx, op2);                         \
  |  |20318|      0|                    } else {                                            \
  |  |20319|      0|                        goto slow_eq ## inv;                            \
  |  |20320|      0|                    }                                                   \
  |  |20321|      0|                } else if (tag1 == JS_TAG_STRING && tag2 == JS_TAG_STRING) { \
  |  |  ------------------
  |  |  |  Branch (20321:28): [True: 0, False: 0]
  |  |  |  Branch (20321:53): [True: 0, False: 0]
  |  |  ------------------
  |  |20322|      0|                    res = js_string_eq(ctx, 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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20323|      0|                                       JS_VALUE_GET_STRING(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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20324|      0|                    JS_FreeValue(ctx, op1);                             \
  |  |20325|      0|                    JS_FreeValue(ctx, op2);                             \
  |  |20326|      0|                } else {                                                \
  |  |20327|      0|                    slow_eq ## inv:                                     \
  |  |20328|      0|                    sf->cur_pc = pc;                                    \
  |  |20329|      0|                    if (js_eq_slow(ctx, sp, inv))                       \
  |  |  ------------------
  |  |  |  Branch (20329:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20330|      0|                        goto exception;                                 \
  |  |20331|      0|                    sp--;                                               \
  |  |20332|      0|                    goto slow_eq_done ## inv;                           \
  |  |20333|      0|                }                                                       \
  |  |20334|      0|                sp[-2] = JS_NewBool(ctx, res ^ inv);                    \
  |  |20335|      0|                sp--;                                                   \
  |  |20336|      0|                slow_eq_done ## inv: ;                                  \
  |  |20337|      0|                }                                                       \
  |  |20338|      0|            BREAK
  |  |  ------------------
  |  |  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20342|       |
20343|      0|#define OP_CMP_STRICT_EQ(opcode, inv)                                   \
20344|      0|            CASE(opcode):                                               \
20345|      0|                {                                                       \
20346|      0|                JSValue op1, op2;                                       \
20347|      0|                int res;                                                \
20348|      0|                uint32_t tag1, tag2;                                    \
20349|      0|                op1 = sp[-2];                                           \
20350|      0|                op2 = sp[-1];                                           \
20351|      0|                tag1 = JS_VALUE_GET_TAG(op1);                           \
20352|      0|                tag2 = JS_VALUE_GET_TAG(op2);                           \
20353|      0|                if (likely(tag1 == JS_TAG_INT)) {                       \
20354|      0|                    if (tag2 == JS_TAG_INT) {                           \
20355|      0|                        res = JS_VALUE_GET_INT(op1) == JS_VALUE_GET_INT(op2); \
20356|      0|                    } else if (JS_TAG_IS_FLOAT64(tag2)) {               \
20357|      0|                        res = (JS_VALUE_GET_INT(op1) == JS_VALUE_GET_FLOAT64(op2)); \
20358|      0|                    } else {                                            \
20359|      0|                        JS_FreeValue(ctx, op2);                         \
20360|      0|                        res = FALSE;                                    \
20361|      0|                    }                                                   \
20362|      0|                } else if (JS_TAG_IS_FLOAT64(tag1)) {                   \
20363|      0|                    if (tag2 == JS_TAG_INT) {                           \
20364|      0|                        res = JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_INT(op2); \
20365|      0|                    } else if (JS_TAG_IS_FLOAT64(tag2)) {               \
20366|      0|                        res = (JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_FLOAT64(op2)); \
20367|      0|                    } else {                                            \
20368|      0|                        JS_FreeValue(ctx, op2);                         \
20369|      0|                        res = FALSE;                                    \
20370|      0|                    }                                                   \
20371|      0|                } else if (tag1 == JS_TAG_OBJECT) {                     \
20372|      0|                    if (tag2 == JS_TAG_OBJECT) {                        \
20373|      0|                        res = JS_VALUE_GET_OBJ(op1) == JS_VALUE_GET_OBJ(op2); \
20374|      0|                    } else {                                            \
20375|      0|                        res = FALSE;                                    \
20376|      0|                    }                                                   \
20377|      0|                    JS_FreeValue(ctx, op1);                             \
20378|      0|                    JS_FreeValue(ctx, op2);                             \
20379|      0|                } else if (tag1 == JS_TAG_NULL || tag1 == JS_TAG_UNDEFINED) { \
20380|      0|                    res = (tag1 == tag2);                               \
20381|      0|                    JS_FreeValue(ctx, op2);                             \
20382|      0|                } else if (tag1 == JS_TAG_STRING && tag2 == JS_TAG_STRING) { \
20383|      0|                    res = js_string_eq(ctx, JS_VALUE_GET_STRING(op1),   \
20384|      0|                                       JS_VALUE_GET_STRING(op2));       \
20385|      0|                    JS_FreeValue(ctx, op1);                             \
20386|      0|                    JS_FreeValue(ctx, op2);                             \
20387|      0|                } else {                                                \
20388|      0|                    res = js_strict_eq2(ctx, op1, op2, JS_EQ_STRICT);   \
20389|      0|                    JS_FreeValue(ctx, op1);                             \
20390|      0|                    JS_FreeValue(ctx, op2);                             \
20391|      0|                }                                                       \
20392|      0|                sp[-2] = JS_NewBool(ctx, res ^ inv);                    \
20393|      0|                sp--;                                                   \
20394|      0|                }                                                       \
20395|      0|            BREAK
20396|       |
20397|      0|            OP_CMP_STRICT_EQ(OP_strict_eq, 0);
  ------------------
  |  |20344|      0|            CASE(opcode):                                               \
  |  |  ------------------
  |  |  |  |17781|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20345|      0|                {                                                       \
  |  |20346|      0|                JSValue op1, op2;                                       \
  |  |20347|      0|                int res;                                                \
  |  |20348|      0|                uint32_t tag1, tag2;                                    \
  |  |20349|      0|                op1 = sp[-2];                                           \
  |  |20350|      0|                op2 = sp[-1];                                           \
  |  |20351|      0|                tag1 = JS_VALUE_GET_TAG(op1);                           \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |20352|      0|                tag2 = JS_VALUE_GET_TAG(op2);                           \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |20353|      0|                if (likely(tag1 == JS_TAG_INT)) {                       \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20354|      0|                    if (tag2 == JS_TAG_INT) {                           \
  |  |  ------------------
  |  |  |  Branch (20354:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20355|      0|                        res = JS_VALUE_GET_INT(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                       res = JS_VALUE_GET_INT(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20356|      0|                    } else if (JS_TAG_IS_FLOAT64(tag2)) {               \
  |  |  ------------------
  |  |  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20357|      0|                        res = (JS_VALUE_GET_INT(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                       res = (JS_VALUE_GET_INT(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20358|      0|                    } else {                                            \
  |  |20359|      0|                        JS_FreeValue(ctx, op2);                         \
  |  |20360|      0|                        res = FALSE;                                    \
  |  |20361|      0|                    }                                                   \
  |  |20362|      0|                } else if (JS_TAG_IS_FLOAT64(tag1)) {                   \
  |  |  ------------------
  |  |  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20363|      0|                    if (tag2 == JS_TAG_INT) {                           \
  |  |  ------------------
  |  |  |  Branch (20363:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20364|      0|                        res = JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |                                       res = JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20365|      0|                    } else if (JS_TAG_IS_FLOAT64(tag2)) {               \
  |  |  ------------------
  |  |  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20366|      0|                        res = (JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |                                       res = (JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20367|      0|                    } else {                                            \
  |  |20368|      0|                        JS_FreeValue(ctx, op2);                         \
  |  |20369|      0|                        res = FALSE;                                    \
  |  |20370|      0|                    }                                                   \
  |  |20371|      0|                } else if (tag1 == JS_TAG_OBJECT) {                     \
  |  |  ------------------
  |  |  |  Branch (20371:28): [True: 0, False: 0]
  |  |  ------------------
  |  |20372|      0|                    if (tag2 == JS_TAG_OBJECT) {                        \
  |  |  ------------------
  |  |  |  Branch (20372:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20373|      0|                        res = JS_VALUE_GET_OBJ(op1) == JS_VALUE_GET_OBJ(op2); \
  |  |  ------------------
  |  |  |  |  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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                                       res = JS_VALUE_GET_OBJ(op1) == JS_VALUE_GET_OBJ(op2); \
  |  |  ------------------
  |  |  |  |  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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20374|      0|                    } else {                                            \
  |  |20375|      0|                        res = FALSE;                                    \
  |  |20376|      0|                    }                                                   \
  |  |20377|      0|                    JS_FreeValue(ctx, op1);                             \
  |  |20378|      0|                    JS_FreeValue(ctx, op2);                             \
  |  |20379|      0|                } else if (tag1 == JS_TAG_NULL || tag1 == JS_TAG_UNDEFINED) { \
  |  |  ------------------
  |  |  |  Branch (20379:28): [True: 0, False: 0]
  |  |  |  Branch (20379:51): [True: 0, False: 0]
  |  |  ------------------
  |  |20380|      0|                    res = (tag1 == tag2);                               \
  |  |20381|      0|                    JS_FreeValue(ctx, op2);                             \
  |  |20382|      0|                } else if (tag1 == JS_TAG_STRING && tag2 == JS_TAG_STRING) { \
  |  |  ------------------
  |  |  |  Branch (20382:28): [True: 0, False: 0]
  |  |  |  Branch (20382:53): [True: 0, False: 0]
  |  |  ------------------
  |  |20383|      0|                    res = js_string_eq(ctx, 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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20384|      0|                                       JS_VALUE_GET_STRING(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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20385|      0|                    JS_FreeValue(ctx, op1);                             \
  |  |20386|      0|                    JS_FreeValue(ctx, op2);                             \
  |  |20387|      0|                } else {                                                \
  |  |20388|      0|                    res = js_strict_eq2(ctx, op1, op2, JS_EQ_STRICT);   \
  |  |20389|      0|                    JS_FreeValue(ctx, op1);                             \
  |  |20390|      0|                    JS_FreeValue(ctx, op2);                             \
  |  |20391|      0|                }                                                       \
  |  |20392|      0|                sp[-2] = JS_NewBool(ctx, res ^ inv);                    \
  |  |20393|      0|                sp--;                                                   \
  |  |20394|      0|                }                                                       \
  |  |20395|      0|            BREAK
  |  |  ------------------
  |  |  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20398|      0|            OP_CMP_STRICT_EQ(OP_strict_neq, 1);
  ------------------
  |  |20344|      0|            CASE(opcode):                                               \
  |  |  ------------------
  |  |  |  |17781|      0|#define CASE(op)        case_ ## op
  |  |  ------------------
  |  |20345|      0|                {                                                       \
  |  |20346|      0|                JSValue op1, op2;                                       \
  |  |20347|      0|                int res;                                                \
  |  |20348|      0|                uint32_t tag1, tag2;                                    \
  |  |20349|      0|                op1 = sp[-2];                                           \
  |  |20350|      0|                op2 = sp[-1];                                           \
  |  |20351|      0|                tag1 = JS_VALUE_GET_TAG(op1);                           \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |20352|      0|                tag2 = JS_VALUE_GET_TAG(op2);                           \
  |  |  ------------------
  |  |  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |20353|      0|                if (likely(tag1 == JS_TAG_INT)) {                       \
  |  |  ------------------
  |  |  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20354|      0|                    if (tag2 == JS_TAG_INT) {                           \
  |  |  ------------------
  |  |  |  Branch (20354:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20355|      0|                        res = JS_VALUE_GET_INT(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                       res = JS_VALUE_GET_INT(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20356|      0|                    } else if (JS_TAG_IS_FLOAT64(tag2)) {               \
  |  |  ------------------
  |  |  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20357|      0|                        res = (JS_VALUE_GET_INT(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |                                       res = (JS_VALUE_GET_INT(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20358|      0|                    } else {                                            \
  |  |20359|      0|                        JS_FreeValue(ctx, op2);                         \
  |  |20360|      0|                        res = FALSE;                                    \
  |  |20361|      0|                    }                                                   \
  |  |20362|      0|                } else if (JS_TAG_IS_FLOAT64(tag1)) {                   \
  |  |  ------------------
  |  |  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20363|      0|                    if (tag2 == JS_TAG_INT) {                           \
  |  |  ------------------
  |  |  |  Branch (20363:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20364|      0|                        res = JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |                                       res = JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_INT(op2); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  |  |  ------------------
  |  |20365|      0|                    } else if (JS_TAG_IS_FLOAT64(tag2)) {               \
  |  |  ------------------
  |  |  |  |  250|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (250:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20366|      0|                        res = (JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |                                       res = (JS_VALUE_GET_FLOAT64(op1) == JS_VALUE_GET_FLOAT64(op2)); \
  |  |  ------------------
  |  |  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  |  |  ------------------
  |  |20367|      0|                    } else {                                            \
  |  |20368|      0|                        JS_FreeValue(ctx, op2);                         \
  |  |20369|      0|                        res = FALSE;                                    \
  |  |20370|      0|                    }                                                   \
  |  |20371|      0|                } else if (tag1 == JS_TAG_OBJECT) {                     \
  |  |  ------------------
  |  |  |  Branch (20371:28): [True: 0, False: 0]
  |  |  ------------------
  |  |20372|      0|                    if (tag2 == JS_TAG_OBJECT) {                        \
  |  |  ------------------
  |  |  |  Branch (20372:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20373|      0|                        res = JS_VALUE_GET_OBJ(op1) == JS_VALUE_GET_OBJ(op2); \
  |  |  ------------------
  |  |  |  |  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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                                       res = JS_VALUE_GET_OBJ(op1) == JS_VALUE_GET_OBJ(op2); \
  |  |  ------------------
  |  |  |  |  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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20374|      0|                    } else {                                            \
  |  |20375|      0|                        res = FALSE;                                    \
  |  |20376|      0|                    }                                                   \
  |  |20377|      0|                    JS_FreeValue(ctx, op1);                             \
  |  |20378|      0|                    JS_FreeValue(ctx, op2);                             \
  |  |20379|      0|                } else if (tag1 == JS_TAG_NULL || tag1 == JS_TAG_UNDEFINED) { \
  |  |  ------------------
  |  |  |  Branch (20379:28): [True: 0, False: 0]
  |  |  |  Branch (20379:51): [True: 0, False: 0]
  |  |  ------------------
  |  |20380|      0|                    res = (tag1 == tag2);                               \
  |  |20381|      0|                    JS_FreeValue(ctx, op2);                             \
  |  |20382|      0|                } else if (tag1 == JS_TAG_STRING && tag2 == JS_TAG_STRING) { \
  |  |  ------------------
  |  |  |  Branch (20382:28): [True: 0, False: 0]
  |  |  |  Branch (20382:53): [True: 0, False: 0]
  |  |  ------------------
  |  |20383|      0|                    res = js_string_eq(ctx, 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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20384|      0|                                       JS_VALUE_GET_STRING(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)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |20385|      0|                    JS_FreeValue(ctx, op1);                             \
  |  |20386|      0|                    JS_FreeValue(ctx, op2);                             \
  |  |20387|      0|                } else {                                                \
  |  |20388|      0|                    res = js_strict_eq2(ctx, op1, op2, JS_EQ_STRICT);   \
  |  |20389|      0|                    JS_FreeValue(ctx, op1);                             \
  |  |20390|      0|                    JS_FreeValue(ctx, op2);                             \
  |  |20391|      0|                }                                                       \
  |  |20392|      0|                sp[-2] = JS_NewBool(ctx, res ^ inv);                    \
  |  |20393|      0|                sp--;                                                   \
  |  |20394|      0|                }                                                       \
  |  |20395|      0|            BREAK
  |  |  ------------------
  |  |  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20399|       |
20400|      0|        CASE(OP_in):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20401|      0|            sf->cur_pc = pc;
20402|      0|            if (js_operator_in(ctx, sp))
  ------------------
  |  Branch (20402:17): [True: 0, False: 0]
  ------------------
20403|      0|                goto exception;
20404|      0|            sp--;
20405|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20406|      0|        CASE(OP_private_in):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20407|      0|            sf->cur_pc = pc;
20408|      0|            if (js_operator_private_in(ctx, sp))
  ------------------
  |  Branch (20408:17): [True: 0, False: 0]
  ------------------
20409|      0|                goto exception;
20410|      0|            sp--;
20411|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20412|      0|        CASE(OP_instanceof):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20413|      0|            sf->cur_pc = pc;
20414|      0|            if (js_operator_instanceof(ctx, sp))
  ------------------
  |  Branch (20414:17): [True: 0, False: 0]
  ------------------
20415|      0|                goto exception;
20416|      0|            sp--;
20417|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20418|      0|        CASE(OP_typeof):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20419|      0|            {
20420|      0|                JSValue op1;
20421|      0|                JSAtom atom;
20422|       |
20423|      0|                op1 = sp[-1];
20424|      0|                atom = js_operator_typeof(ctx, op1);
20425|      0|                JS_FreeValue(ctx, op1);
20426|      0|                sp[-1] = JS_AtomToString(ctx, atom);
20427|      0|            }
20428|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20429|      0|        CASE(OP_delete):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20430|      0|            sf->cur_pc = pc;
20431|      0|            if (js_operator_delete(ctx, sp))
  ------------------
  |  Branch (20431:17): [True: 0, False: 0]
  ------------------
20432|      0|                goto exception;
20433|      0|            sp--;
20434|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20435|      0|        CASE(OP_delete_var):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20436|      0|            {
20437|      0|                JSAtom atom;
20438|      0|                int ret;
20439|       |
20440|      0|                atom = get_u32(pc);
20441|      0|                pc += 4;
20442|      0|                sf->cur_pc = pc;
20443|       |
20444|      0|                ret = JS_DeleteGlobalVar(ctx, atom);
20445|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20446|      0|                    goto exception;
20447|      0|                *sp++ = JS_NewBool(ctx, ret);
20448|      0|            }
20449|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20450|       |
20451|      2|        CASE(OP_to_object):
  ------------------
  |  |17781|      2|#define CASE(op)        case_ ## op
  ------------------
20452|      2|            if (JS_VALUE_GET_TAG(sp[-1]) != JS_TAG_OBJECT) {
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20452:17): [True: 0, False: 2]
  ------------------
20453|      0|                sf->cur_pc = pc;
20454|      0|                ret_val = JS_ToObject(ctx, sp[-1]);
20455|      0|                if (JS_IsException(ret_val))
  ------------------
  |  Branch (20455:21): [True: 0, False: 0]
  ------------------
20456|      0|                    goto exception;
20457|      0|                JS_FreeValue(ctx, sp[-1]);
20458|      0|                sp[-1] = ret_val;
20459|      0|            }
20460|      2|            BREAK;
  ------------------
  |  |17784|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20461|       |
20462|      2|        CASE(OP_to_propkey):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20463|      0|            switch (JS_VALUE_GET_TAG(sp[-1])) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
20464|      0|            case JS_TAG_INT:
  ------------------
  |  Branch (20464:13): [True: 0, False: 0]
  ------------------
20465|      0|            case JS_TAG_STRING:
  ------------------
  |  Branch (20465:13): [True: 0, False: 0]
  ------------------
20466|      0|            case JS_TAG_SYMBOL:
  ------------------
  |  Branch (20466:13): [True: 0, False: 0]
  ------------------
20467|      0|                break;
20468|      0|            default:
  ------------------
  |  Branch (20468:13): [True: 0, False: 0]
  ------------------
20469|      0|                sf->cur_pc = pc;
20470|      0|                ret_val = JS_ToPropertyKey(ctx, sp[-1]);
20471|      0|                if (JS_IsException(ret_val))
  ------------------
  |  Branch (20471:21): [True: 0, False: 0]
  ------------------
20472|      0|                    goto exception;
20473|      0|                JS_FreeValue(ctx, sp[-1]);
20474|      0|                sp[-1] = ret_val;
20475|      0|                break;
20476|      0|            }
20477|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20478|       |
20479|       |#if 0
20480|       |        CASE(OP_to_string):
20481|       |            if (JS_VALUE_GET_TAG(sp[-1]) != JS_TAG_STRING) {
20482|       |                ret_val = JS_ToString(ctx, sp[-1]);
20483|       |                if (JS_IsException(ret_val))
20484|       |                    goto exception;
20485|       |                JS_FreeValue(ctx, sp[-1]);
20486|       |                sp[-1] = ret_val;
20487|       |            }
20488|       |            BREAK;
20489|       |#endif
20490|      0|        CASE(OP_with_get_var):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20491|      0|        CASE(OP_with_put_var):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20492|      0|        CASE(OP_with_delete_var):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20493|      0|        CASE(OP_with_make_ref):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20494|      0|        CASE(OP_with_get_ref):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20495|      0|            {
20496|      0|                JSAtom atom;
20497|      0|                int32_t diff;
20498|      0|                JSValue obj, val;
20499|      0|                int ret, is_with;
20500|      0|                atom = get_u32(pc);
20501|      0|                diff = get_u32(pc + 4);
20502|      0|                is_with = pc[8];
20503|      0|                pc += 9;
20504|      0|                sf->cur_pc = pc;
20505|       |
20506|      0|                obj = sp[-1];
20507|      0|                ret = JS_HasProperty(ctx, obj, atom);
20508|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20509|      0|                    goto exception;
20510|      0|                if (ret) {
  ------------------
  |  Branch (20510:21): [True: 0, False: 0]
  ------------------
20511|      0|                    if (is_with) {
  ------------------
  |  Branch (20511:25): [True: 0, False: 0]
  ------------------
20512|      0|                        ret = js_has_unscopable(ctx, obj, atom);
20513|      0|                        if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20514|      0|                            goto exception;
20515|      0|                        if (ret)
  ------------------
  |  Branch (20515:29): [True: 0, False: 0]
  ------------------
20516|      0|                            goto no_with;
20517|      0|                    }
20518|      0|                    switch (opcode) {
  ------------------
  |  Branch (20518:29): [True: 0, False: 0]
  ------------------
20519|      0|                    case OP_with_get_var:
  ------------------
  |  Branch (20519:21): [True: 0, False: 0]
  ------------------
20520|       |                        /* in Object Environment Records, GetBindingValue() calls HasProperty() */
20521|      0|                        ret = JS_HasProperty(ctx, obj, atom);
20522|      0|                        if (unlikely(ret <= 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20523|      0|                            if (ret < 0)
  ------------------
  |  Branch (20523:33): [True: 0, False: 0]
  ------------------
20524|      0|                                goto exception;
20525|      0|                            if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (20525:33): [True: 0, False: 0]
  ------------------
20526|      0|                                JS_ThrowReferenceErrorNotDefined(ctx, atom);
20527|      0|                                goto exception;
20528|      0|                            } 
20529|      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 }
  |  |  ------------------
  ------------------
20530|      0|                        } else {
20531|      0|                            val = JS_GetProperty(ctx, obj, atom);
20532|      0|                            if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20533|      0|                                goto exception;
20534|      0|                        }
20535|      0|                        set_value(ctx, &sp[-1], val);
20536|      0|                        break;
20537|      0|                    case OP_with_put_var: /* used e.g. in for in/of */
  ------------------
  |  Branch (20537:21): [True: 0, False: 0]
  ------------------
20538|       |                        /* in Object Environment Records, SetMutableBinding() calls HasProperty() */
20539|      0|                        ret = JS_HasProperty(ctx, obj, atom);
20540|      0|                        if (unlikely(ret <= 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20541|      0|                            if (ret < 0)
  ------------------
  |  Branch (20541:33): [True: 0, False: 0]
  ------------------
20542|      0|                                goto exception;
20543|      0|                            if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (20543:33): [True: 0, False: 0]
  ------------------
20544|      0|                                JS_ThrowReferenceErrorNotDefined(ctx, atom);
20545|      0|                                goto exception;
20546|      0|                            } 
20547|      0|                        }
20548|      0|                        ret = JS_SetPropertyInternal(ctx, obj, atom, sp[-2], obj,
20549|      0|                                                     JS_PROP_THROW_STRICT);
  ------------------
  |  |  323|      0|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
20550|      0|                        JS_FreeValue(ctx, sp[-1]);
20551|      0|                        sp -= 2;
20552|      0|                        if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20553|      0|                            goto exception;
20554|      0|                        break;
20555|      0|                    case OP_with_delete_var:
  ------------------
  |  Branch (20555:21): [True: 0, False: 0]
  ------------------
20556|      0|                        ret = JS_DeleteProperty(ctx, obj, atom, 0);
20557|      0|                        if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20558|      0|                            goto exception;
20559|      0|                        JS_FreeValue(ctx, sp[-1]);
20560|      0|                        sp[-1] = JS_NewBool(ctx, ret);
20561|      0|                        break;
20562|      0|                    case OP_with_make_ref:
  ------------------
  |  Branch (20562:21): [True: 0, False: 0]
  ------------------
20563|       |                        /* produce a pair object/propname on the stack */
20564|      0|                        *sp++ = JS_AtomToValue(ctx, atom);
20565|      0|                        break;
20566|      0|                    case OP_with_get_ref:
  ------------------
  |  Branch (20566:21): [True: 0, False: 0]
  ------------------
20567|       |                        /* produce a pair object/method on the stack */
20568|       |                        /* in Object Environment Records, GetBindingValue() calls HasProperty() */
20569|      0|                        ret = JS_HasProperty(ctx, obj, atom);
20570|      0|                        if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20571|      0|                            goto exception;
20572|      0|                        if (!ret) {
  ------------------
  |  Branch (20572:29): [True: 0, False: 0]
  ------------------
20573|      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 }
  |  |  ------------------
  ------------------
20574|      0|                        } else {
20575|      0|                            val = JS_GetProperty(ctx, obj, atom);
20576|      0|                            if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20577|      0|                                goto exception;
20578|      0|                        }
20579|      0|                        *sp++ = val;
20580|      0|                        break;
20581|      0|                    }
20582|      0|                    pc += diff - 5;
20583|      0|                } else {
20584|      0|                no_with:
20585|       |                    /* if not jumping, drop the object argument */
20586|      0|                    JS_FreeValue(ctx, sp[-1]);
20587|      0|                    sp--;
20588|      0|                }
20589|      0|            }
20590|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20591|       |
20592|      0|        CASE(OP_await):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20593|      0|            ret_val = JS_NewInt32(ctx, FUNC_RET_AWAIT);
  ------------------
  |  |17735|      0|#define FUNC_RET_AWAIT         0
  ------------------
20594|      0|            goto done_generator;
20595|      0|        CASE(OP_yield):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20596|      0|            ret_val = JS_NewInt32(ctx, FUNC_RET_YIELD);
  ------------------
  |  |17736|      0|#define FUNC_RET_YIELD         1
  ------------------
20597|      0|            goto done_generator;
20598|      0|        CASE(OP_yield_star):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20599|      0|        CASE(OP_async_yield_star):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20600|      0|            ret_val = JS_NewInt32(ctx, FUNC_RET_YIELD_STAR);
  ------------------
  |  |17737|      0|#define FUNC_RET_YIELD_STAR    2
  ------------------
20601|      0|            goto done_generator;
20602|     11|        CASE(OP_return_async):
  ------------------
  |  |17781|     11|#define CASE(op)        case_ ## op
  ------------------
20603|     11|            ret_val = 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 }
  |  |  ------------------
  ------------------
20604|     11|            goto done_generator;
20605|      0|        CASE(OP_initial_yield):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20606|      0|            ret_val = JS_NewInt32(ctx, FUNC_RET_INITIAL_YIELD);
  ------------------
  |  |17738|      0|#define FUNC_RET_INITIAL_YIELD 3
  ------------------
20607|      0|            goto done_generator;
20608|       |
20609|      0|        CASE(OP_nop):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20610|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20611|      0|        CASE(OP_is_undefined_or_null):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20612|      0|            if (JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_UNDEFINED ||
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20612:17): [True: 0, False: 0]
  ------------------
20613|      0|                JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_NULL) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20613:17): [True: 0, False: 0]
  ------------------
20614|      0|                goto set_true;
20615|      0|            } else {
20616|      0|                goto free_and_set_false;
20617|      0|            }
20618|      0|#if SHORT_OPCODES
20619|      2|        CASE(OP_is_undefined):
  ------------------
  |  |17781|      2|#define CASE(op)        case_ ## op
  ------------------
20620|      2|            if (JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_UNDEFINED) {
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20620:17): [True: 0, False: 2]
  ------------------
20621|      0|                goto set_true;
20622|      2|            } else {
20623|      2|                goto free_and_set_false;
20624|      2|            }
20625|      0|        CASE(OP_is_null):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20626|      0|            if (JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_NULL) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20626:17): [True: 0, False: 0]
  ------------------
20627|      0|                goto set_true;
20628|      0|            } else {
20629|      0|                goto free_and_set_false;
20630|      0|            }
20631|       |            /* XXX: could merge to a single opcode */
20632|      0|        CASE(OP_typeof_is_undefined):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20633|       |            /* different from OP_is_undefined because of isHTMLDDA */
20634|      0|            if (js_operator_typeof(ctx, sp[-1]) == JS_ATOM_undefined) {
  ------------------
  |  Branch (20634:17): [True: 0, False: 0]
  ------------------
20635|      0|                goto free_and_set_true;
20636|      0|            } else {
20637|      0|                goto free_and_set_false;
20638|      0|            }
20639|      0|        CASE(OP_typeof_is_function):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20640|      0|            if (js_operator_typeof(ctx, sp[-1]) == JS_ATOM_function) {
  ------------------
  |  Branch (20640:17): [True: 0, False: 0]
  ------------------
20641|      0|                goto free_and_set_true;
20642|      0|            } else {
20643|      0|                goto free_and_set_false;
20644|      0|            }
20645|      0|        free_and_set_true:
20646|      0|            JS_FreeValue(ctx, sp[-1]);
20647|      0|#endif
20648|      0|        set_true:
20649|      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 }
  |  |  ------------------
  ------------------
20650|      0|            BREAK;
  ------------------
  |  |17784|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20651|      2|        free_and_set_false:
20652|      2|            JS_FreeValue(ctx, sp[-1]);
20653|      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 }
  |  |  ------------------
  ------------------
20654|      2|            BREAK;
  ------------------
  |  |17784|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17777|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20655|      2|        CASE(OP_invalid):
  ------------------
  |  |17781|      0|#define CASE(op)        case_ ## op
  ------------------
20656|      0|        DEFAULT:
  ------------------
  |  |17783|      0|#define DEFAULT         case_default
  ------------------
20657|      0|            JS_ThrowInternalError(ctx, "invalid opcode: pc=%u opcode=0x%02x",
20658|      0|                                  (int)(pc - b->byte_code_buf - 1), opcode);
20659|      0|            goto exception;
20660|      0|        }
20661|      0|    }
20662|      7| exception:
20663|      7|    if (is_backtrace_needed(ctx, rt->current_exception)) {
  ------------------
  |  Branch (20663:9): [True: 6, False: 1]
  ------------------
20664|       |        /* add the backtrace information now (it is not done
20665|       |           before if the exception happens in a bytecode
20666|       |           operation */
20667|      6|        sf->cur_pc = pc;
20668|      6|        build_backtrace(ctx, rt->current_exception, NULL, 0, 0, 0);
20669|      6|    }
20670|      7|    if (!rt->current_exception_is_uncatchable) {
  ------------------
  |  Branch (20670:9): [True: 7, False: 0]
  ------------------
20671|     10|        while (sp > stack_buf) {
  ------------------
  |  Branch (20671:16): [True: 3, False: 7]
  ------------------
20672|      3|            JSValue val = *--sp;
20673|      3|            JS_FreeValue(ctx, val);
20674|      3|            if (JS_VALUE_GET_TAG(val) == JS_TAG_CATCH_OFFSET) {
  ------------------
  |  |  236|      3|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20674:17): [True: 0, False: 3]
  ------------------
20675|      0|                int pos = JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
20676|      0|                if (pos == 0) {
  ------------------
  |  Branch (20676:21): [True: 0, False: 0]
  ------------------
20677|       |                    /* enumerator: close it with a throw */
20678|      0|                    JS_FreeValue(ctx, sp[-1]); /* drop the next method */
20679|      0|                    sp--;
20680|      0|                    JS_IteratorClose(ctx, sp[-1], TRUE);
20681|      0|                } else {
20682|      0|                    *sp++ = rt->current_exception;
20683|      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 }
  |  |  ------------------
  ------------------
20684|      0|                    pc = b->byte_code_buf + pos;
20685|      0|                    goto restart;
20686|      0|                }
20687|      0|            }
20688|      3|        }
20689|      7|    }
20690|      7|    ret_val = JS_EXCEPTION;
  ------------------
  |  |  294|      7|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      7|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20691|       |    /* the local variables are freed by the caller in the generator
20692|       |       case. Hence the label 'done' should never be reached in a
20693|       |       generator function. */
20694|      7|    if (b->func_kind != JS_FUNC_NORMAL) {
  ------------------
  |  Branch (20694:9): [True: 0, False: 7]
  ------------------
20695|     11|    done_generator:
20696|     11|        sf->cur_pc = pc;
20697|     11|        sf->cur_sp = sp;
20698|     11|    } else {
20699|     20|    done:
20700|     20|        if (unlikely(b->var_ref_count != 0)) {
  ------------------
  |  |   33|     20|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 20]
  |  |  ------------------
  ------------------
20701|       |            /* variable references reference the stack: must close them */
20702|      0|            close_var_refs(rt, b, sf);
20703|      0|        }
20704|       |        /* free the local variables and stack */
20705|     38|        for(pval = local_buf; pval < sp; pval++) {
  ------------------
  |  Branch (20705:31): [True: 18, False: 20]
  ------------------
20706|     18|            JS_FreeValue(ctx, *pval);
20707|     18|        }
20708|     20|    }
20709|     31|    rt->current_stack_frame = sf->prev_frame;
20710|     31|    return ret_val;
20711|      7|}
quickjs.c:js_closure:
17372|      9|{
17373|      9|    JSFunctionBytecode *b;
17374|      9|    JSValue func_obj;
17375|      9|    JSAtom name_atom;
17376|       |
17377|      9|    b = JS_VALUE_GET_PTR(bfunc);
  ------------------
  |  |  243|      9|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
17378|      9|    func_obj = JS_NewObjectClass(ctx, func_kind_to_class_id[b->func_kind]);
17379|      9|    if (JS_IsException(func_obj)) {
  ------------------
  |  Branch (17379:9): [True: 0, False: 9]
  ------------------
17380|      0|        JS_FreeValue(ctx, bfunc);
17381|      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 }
  |  |  ------------------
  ------------------
17382|      0|    }
17383|      9|    func_obj = js_closure2(ctx, func_obj, b, cur_var_refs, sf, is_eval, NULL);
17384|      9|    if (JS_IsException(func_obj)) {
  ------------------
  |  Branch (17384:9): [True: 0, False: 9]
  ------------------
17385|       |        /* bfunc has been freed */
17386|      0|        goto fail;
17387|      0|    }
17388|      9|    name_atom = b->func_name;
17389|      9|    if (name_atom == JS_ATOM_NULL)
  ------------------
  |  |  451|      9|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (17389:9): [True: 2, False: 7]
  ------------------
17390|      2|        name_atom = JS_ATOM_empty_string;
17391|      9|    js_function_set_properties(ctx, func_obj, name_atom,
17392|      9|                               b->defined_arg_count);
17393|       |
17394|      9|    if (b->func_kind & JS_FUNC_GENERATOR) {
  ------------------
  |  Branch (17394:9): [True: 0, False: 9]
  ------------------
17395|      0|        JSValue proto;
17396|      0|        int proto_class_id;
17397|       |        /* generators have a prototype field which is used as
17398|       |           prototype for the generator object */
17399|      0|        if (b->func_kind == JS_FUNC_ASYNC_GENERATOR)
  ------------------
  |  Branch (17399:13): [True: 0, False: 0]
  ------------------
17400|      0|            proto_class_id = JS_CLASS_ASYNC_GENERATOR;
17401|      0|        else
17402|      0|            proto_class_id = JS_CLASS_GENERATOR;
17403|      0|        proto = JS_NewObjectProto(ctx, ctx->class_proto[proto_class_id]);
17404|      0|        if (JS_IsException(proto))
  ------------------
  |  Branch (17404:13): [True: 0, False: 0]
  ------------------
17405|      0|            goto fail;
17406|      0|        JS_DefinePropertyValue(ctx, func_obj, JS_ATOM_prototype, proto,
17407|      0|                               JS_PROP_WRITABLE);
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
17408|      9|    } else if (b->has_prototype) {
  ------------------
  |  Branch (17408:16): [True: 0, False: 9]
  ------------------
17409|       |        /* add the 'prototype' property: delay instantiation to avoid
17410|       |           creating cycles for every javascript function. The prototype
17411|       |           object is created on the fly when first accessed */
17412|      0|        JS_SetConstructorBit(ctx, func_obj, TRUE);
17413|      0|        JS_DefineAutoInitProperty(ctx, func_obj, JS_ATOM_prototype,
17414|      0|                                  JS_AUTOINIT_ID_PROTOTYPE, NULL,
17415|      0|                                  JS_PROP_WRITABLE);
  ------------------
  |  |  299|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
17416|      0|    }
17417|      9|    return func_obj;
17418|      0| fail:
17419|       |    /* bfunc is freed when func_obj is freed */
17420|      0|    JS_FreeValue(ctx, func_obj);
17421|      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 }
  |  |  ------------------
  ------------------
17422|      9|}
quickjs.c:js_closure2:
17267|     20|{
17268|     20|    JSObject *p;
17269|     20|    JSVarRef **var_refs;
17270|     20|    int i;
17271|       |
17272|     20|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  229|     20|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     20|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17273|     20|    p->u.func.function_bytecode = b;
17274|     20|    p->u.func.home_object = NULL;
17275|     20|    p->u.func.var_refs = NULL;
17276|     20|    if (b->closure_var_count) {
  ------------------
  |  Branch (17276:9): [True: 19, False: 1]
  ------------------
17277|     19|        var_refs = js_mallocz(ctx, sizeof(var_refs[0]) * b->closure_var_count);
17278|     19|        if (!var_refs)
  ------------------
  |  Branch (17278:13): [True: 0, False: 19]
  ------------------
17279|      0|            goto fail;
17280|     19|        p->u.func.var_refs = var_refs;
17281|     19|        if (is_eval) {
  ------------------
  |  Branch (17281:13): [True: 17, False: 2]
  ------------------
17282|       |            /* first pass to check the global variable definitions */
17283|     60|            for(i = 0; i < b->closure_var_count; i++) {
  ------------------
  |  Branch (17283:24): [True: 43, False: 17]
  ------------------
17284|     43|                JSClosureVar *cv = &b->closure_var[i];
17285|     43|                if (cv->closure_type == JS_CLOSURE_GLOBAL_DECL) {
  ------------------
  |  Branch (17285:21): [True: 0, False: 43]
  ------------------
17286|      0|                    int flags;
17287|      0|                    flags = 0;
17288|      0|                    if (cv->is_lexical)
  ------------------
  |  Branch (17288:25): [True: 0, False: 0]
  ------------------
17289|      0|                        flags |= DEFINE_GLOBAL_LEX_VAR;
  ------------------
  |  |10809|      0|#define DEFINE_GLOBAL_LEX_VAR (1 << 7)
  ------------------
17290|      0|                    if (cv->var_kind == JS_VAR_GLOBAL_FUNCTION_DECL)
  ------------------
  |  Branch (17290:25): [True: 0, False: 0]
  ------------------
17291|      0|                        flags |= DEFINE_GLOBAL_FUNC_VAR;
  ------------------
  |  |10810|      0|#define DEFINE_GLOBAL_FUNC_VAR (1 << 6)
  ------------------
17292|      0|                    if (JS_CheckDefineGlobalVar(ctx, cv->var_name, flags))
  ------------------
  |  Branch (17292:25): [True: 0, False: 0]
  ------------------
17293|      0|                        goto fail;
17294|      0|                }
17295|     43|            }
17296|     17|        }
17297|     69|        for(i = 0; i < b->closure_var_count; i++) {
  ------------------
  |  Branch (17297:20): [True: 50, False: 19]
  ------------------
17298|     50|            JSClosureVar *cv = &b->closure_var[i];
17299|     50|            JSVarRef *var_ref;
17300|     50|            switch(cv->closure_type) {
17301|      0|            case JS_CLOSURE_MODULE_IMPORT:
  ------------------
  |  Branch (17301:13): [True: 0, False: 50]
  ------------------
17302|       |                /* imported from other modules */
17303|      0|                continue;
17304|     22|            case JS_CLOSURE_MODULE_DECL:
  ------------------
  |  Branch (17304:13): [True: 22, False: 28]
  ------------------
17305|     22|                var_ref = js_create_var_ref(ctx, cv->is_lexical);
17306|     22|                break;
17307|      0|            case JS_CLOSURE_GLOBAL_DECL:
  ------------------
  |  Branch (17307:13): [True: 0, False: 50]
  ------------------
17308|      0|                var_ref = js_closure_define_global_var(ctx, cv, b->is_direct_or_indirect_eval);
17309|      0|                break;
17310|     21|            case JS_CLOSURE_GLOBAL:
  ------------------
  |  Branch (17310:13): [True: 21, False: 29]
  ------------------
17311|     21|                var_ref = js_closure_global_var(ctx, cv);
17312|     21|                break;
17313|      0|            case JS_CLOSURE_LOCAL:
  ------------------
  |  Branch (17313:13): [True: 0, False: 50]
  ------------------
17314|       |                /* reuse the existing variable reference if it already exists */
17315|      0|                var_ref = get_var_ref(ctx, sf, cv->var_idx, FALSE);
17316|      0|                break;
17317|      0|            case JS_CLOSURE_ARG:
  ------------------
  |  Branch (17317:13): [True: 0, False: 50]
  ------------------
17318|       |                /* reuse the existing variable reference if it already exists */
17319|      0|                var_ref = get_var_ref(ctx, sf, cv->var_idx, TRUE);
17320|      0|                break;
17321|      0|            case JS_CLOSURE_REF:
  ------------------
  |  Branch (17321:13): [True: 0, False: 50]
  ------------------
17322|      7|            case JS_CLOSURE_GLOBAL_REF:
  ------------------
  |  Branch (17322:13): [True: 7, False: 43]
  ------------------
17323|      7|                var_ref = cur_var_refs[cv->var_idx];
17324|      7|                js_rc(var_ref)->ref_count++;
17325|      7|                break;
17326|      0|            default:
  ------------------
  |  Branch (17326:13): [True: 0, False: 50]
  ------------------
17327|      0|                abort();
17328|     50|            }
17329|     50|            if (!var_ref)
  ------------------
  |  Branch (17329:17): [True: 0, False: 50]
  ------------------
17330|      0|                goto fail;
17331|     50|            var_refs[i] = var_ref;
17332|     50|        }
17333|     19|    }
17334|     20|    return func_obj;
17335|      0| fail:
17336|       |    /* bfunc is freed when func_obj is freed */
17337|      0|    JS_FreeValue(ctx, func_obj);
17338|      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 }
  |  |  ------------------
  ------------------
17339|     20|}
quickjs.c:find_own_property1:
 6117|     15|{
 6118|     15|    JSShape *sh;
 6119|     15|    JSShapeProperty *pr, *prop;
 6120|     15|    intptr_t h;
 6121|     15|    sh = p->shape;
 6122|     15|    h = (uintptr_t)atom & sh->prop_hash_mask;
 6123|     15|    h = sh->hash_table[h];
 6124|     15|    prop = get_shape_prop(sh);
 6125|     15|    while (h) {
  ------------------
  |  Branch (6125:12): [True: 9, False: 6]
  ------------------
 6126|      9|        pr = &prop[h - 1];
 6127|      9|        if (likely(pr->atom == atom)) {
  ------------------
  |  |   32|      9|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 9, False: 0]
  |  |  ------------------
  ------------------
 6128|      9|            return pr;
 6129|      9|        }
 6130|      0|        h = pr->hash_next;
 6131|      0|    }
 6132|      6|    return NULL;
 6133|     15|}
quickjs.c:js_global_object_get_uninitialized_var:
17071|      9|{
17072|      9|    JSObject *p = JS_VALUE_GET_OBJ(p1->u.global_object.uninitialized_vars);
  ------------------
  |  |  229|      9|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      9|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17073|      9|    JSShapeProperty *prs;
17074|      9|    JSProperty *pr;
17075|      9|    JSVarRef *var_ref;
17076|       |    
17077|      9|    prs = find_own_property(&pr, p, atom);
17078|      9|    if (prs) {
  ------------------
  |  Branch (17078:9): [True: 0, False: 9]
  ------------------
17079|      0|        assert((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF);
  ------------------
  |  Branch (17079:9): [True: 0, False: 0]
  |  Branch (17079:9): [True: 0, False: 0]
  ------------------
17080|      0|        var_ref = pr->u.var_ref;
17081|      0|        js_rc(var_ref)->ref_count++;
17082|      0|        return var_ref;
17083|      0|    }
17084|       |
17085|      9|    var_ref = js_create_var_ref(ctx, TRUE);
17086|      9|    if (!var_ref)
  ------------------
  |  Branch (17086:9): [True: 0, False: 9]
  ------------------
17087|      0|        return NULL;
17088|      9|    pr = add_property(ctx, p, atom, JS_PROP_C_W_E | JS_PROP_VARREF);
  ------------------
  |  |  301|      9|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      9|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|      9|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|      9|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                  pr = add_property(ctx, p, atom, JS_PROP_C_W_E | JS_PROP_VARREF);
  ------------------
  |  |  306|      9|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
17089|      9|    if (unlikely(!pr)) {
  ------------------
  |  |   33|      9|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 9]
  |  |  ------------------
  ------------------
17090|      0|        free_var_ref(ctx->rt, var_ref);
17091|      0|        return NULL;
17092|      0|    }
17093|      9|    pr->u.var_ref = var_ref;
17094|      9|    js_rc(var_ref)->ref_count++;
17095|      9|    return var_ref;
17096|      9|}
quickjs.c:js_closure_global_var:
17229|     21|{
17230|     21|    JSObject *p;
17231|     21|    JSShapeProperty *prs;
17232|     21|    JSProperty *pr;
17233|     21|    JSVarRef *var_ref;
17234|       |    
17235|     21|    p = JS_VALUE_GET_OBJ(ctx->global_var_obj);
  ------------------
  |  |  229|     21|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     21|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17236|     21|    prs = find_own_property(&pr, p, cv->var_name);
17237|     21|    if (prs) {
  ------------------
  |  Branch (17237:9): [True: 0, False: 21]
  ------------------
17238|      0|        assert((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF);
  ------------------
  |  Branch (17238:9): [True: 0, False: 0]
  |  Branch (17238:9): [True: 0, False: 0]
  ------------------
17239|      0|        var_ref = pr->u.var_ref;
17240|      0|        js_rc(var_ref)->ref_count++;
17241|      0|        return var_ref;
17242|      0|    }
17243|     21|    p = JS_VALUE_GET_OBJ(ctx->global_obj);
  ------------------
  |  |  229|     21|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     21|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17244|     22| redo:
17245|     22|    prs = find_own_property(&pr, p, cv->var_name);
17246|     22|    if (prs) {
  ------------------
  |  Branch (17246:9): [True: 13, False: 9]
  ------------------
17247|     13|        if (unlikely((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT)) {
  ------------------
  |  |   33|     13|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1, False: 12]
  |  |  ------------------
  ------------------
17248|       |            /* Instantiate property and retry */
17249|      1|            if (JS_AutoInitProperty(ctx, p, cv->var_name, pr, prs))
  ------------------
  |  Branch (17249:17): [True: 0, False: 1]
  ------------------
17250|      0|                return NULL;
17251|      1|            goto redo;
17252|      1|        }
17253|     12|        if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  303|     12|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  306|     12|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (17253:13): [True: 12, False: 0]
  ------------------
17254|     12|            var_ref = pr->u.var_ref;
17255|     12|            js_rc(var_ref)->ref_count++;
17256|     12|            return var_ref;
17257|     12|        }
17258|     12|    }
17259|      9|    return js_global_object_get_uninitialized_var(ctx, p, cv->var_name);
17260|     22|}
quickjs.c:JS_DefineAutoInitProperty:
10651|  4.77k|{
10652|  4.77k|    JSObject *p;
10653|  4.77k|    JSProperty *pr;
10654|       |
10655|  4.77k|    if (JS_VALUE_GET_TAG(this_obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|  4.77k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10655:9): [True: 0, False: 4.77k]
  ------------------
10656|      0|        return FALSE;
10657|       |
10658|  4.77k|    p = JS_VALUE_GET_OBJ(this_obj);
  ------------------
  |  |  229|  4.77k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  4.77k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10659|       |
10660|  4.77k|    if (find_own_property(&pr, p, prop)) {
  ------------------
  |  Branch (10660:9): [True: 0, False: 4.77k]
  ------------------
10661|       |        /* property already exists */
10662|      0|        abort();
10663|      0|        return FALSE;
10664|      0|    }
10665|       |
10666|       |    /* Specialized CreateProperty */
10667|  4.77k|    pr = add_property(ctx, p, prop, (flags & JS_PROP_C_W_E) | JS_PROP_AUTOINIT);
  ------------------
  |  |  301|  4.77k|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|  4.77k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  299|  4.77k|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  300|  4.77k|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                  pr = add_property(ctx, p, prop, (flags & JS_PROP_C_W_E) | JS_PROP_AUTOINIT);
  ------------------
  |  |  307|  4.77k|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
10668|  4.77k|    if (unlikely(!pr))
  ------------------
  |  |   33|  4.77k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 4.77k]
  |  |  ------------------
  ------------------
10669|      0|        return -1;
10670|  4.77k|    pr->u.init.realm_and_id = (uintptr_t)JS_DupContext(ctx);
10671|  4.77k|    assert((pr->u.init.realm_and_id & 3) == 0);
  ------------------
  |  Branch (10671:5): [True: 0, False: 4.77k]
  |  Branch (10671:5): [True: 4.77k, False: 0]
  ------------------
10672|  4.77k|    assert(id <= 3);
  ------------------
  |  Branch (10672:5): [True: 0, False: 4.77k]
  |  Branch (10672:5): [True: 4.77k, False: 0]
  ------------------
10673|  4.77k|    pr->u.init.realm_and_id |= id;
10674|  4.77k|    pr->u.init.opaque = opaque;
10675|  4.77k|    return TRUE;
10676|  4.77k|}
quickjs.c:js_find_loaded_module:
29998|     22|{
29999|     22|    struct list_head *el;
30000|     22|    JSModuleDef *m;
30001|       |
30002|       |    /* first look at the loaded modules */
30003|     33|    list_for_each(el, &ctx->loaded_modules) {
  ------------------
  |  |   86|     33|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 33, False: 0]
  |  |  ------------------
  ------------------
30004|     33|        m = list_entry(el, JSModuleDef, link);
  ------------------
  |  |   39|     33|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|     33|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
30005|     33|        if (m->module_name == name)
  ------------------
  |  Branch (30005:13): [True: 22, False: 11]
  ------------------
30006|     22|            return m;
30007|     33|    }
30008|      0|    return NULL;
30009|     22|}
quickjs.c:check_function:
39519|     67|{
39520|     67|    if (likely(JS_IsFunction(ctx, obj)))
  ------------------
  |  |   32|     67|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 67, False: 0]
  |  |  ------------------
  ------------------
39521|     67|        return 0;
39522|      0|    JS_ThrowTypeError(ctx, "not a function");
39523|      0|    return -1;
39524|     67|}
quickjs.c:js_for_in_start:
16333|      1|{
16334|      1|    sp[-1] = build_for_in_iterator(ctx, sp[-1]);
16335|      1|    if (JS_IsException(sp[-1]))
  ------------------
  |  Branch (16335:9): [True: 0, False: 1]
  ------------------
16336|      0|        return -1;
16337|      1|    return 0;
16338|      1|}
quickjs.c:build_for_in_iterator:
16269|      1|{
16270|      1|    JSObject *p, *p1;
16271|      1|    JSPropertyEnum *tab_atom;
16272|      1|    int i;
16273|      1|    JSValue enum_obj;
16274|      1|    JSForInIterator *it;
16275|      1|    uint32_t tag, tab_atom_count;
16276|       |
16277|      1|    tag = JS_VALUE_GET_TAG(obj);
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
16278|      1|    if (tag != JS_TAG_OBJECT && tag != JS_TAG_NULL && tag != JS_TAG_UNDEFINED) {
  ------------------
  |  Branch (16278:9): [True: 1, False: 0]
  |  Branch (16278:33): [True: 1, False: 0]
  |  Branch (16278:55): [True: 1, False: 0]
  ------------------
16279|      1|        obj = JS_ToObjectFree(ctx, obj);
16280|      1|    }
16281|       |
16282|      1|    it = js_malloc(ctx, sizeof(*it));
16283|      1|    if (!it) {
  ------------------
  |  Branch (16283:9): [True: 0, False: 1]
  ------------------
16284|      0|        JS_FreeValue(ctx, obj);
16285|      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 }
  |  |  ------------------
  ------------------
16286|      0|    }
16287|      1|    enum_obj = JS_NewObjectProtoClass(ctx, JS_NULL, JS_CLASS_FOR_IN_ITERATOR);
  ------------------
  |  |  290|      1|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16288|      1|    if (JS_IsException(enum_obj)) {
  ------------------
  |  Branch (16288:9): [True: 0, False: 1]
  ------------------
16289|      0|        js_free(ctx, it);
16290|      0|        JS_FreeValue(ctx, obj);
16291|      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 }
  |  |  ------------------
  ------------------
16292|      0|    }
16293|      1|    it->is_array = FALSE;
16294|      1|    it->obj = obj;
16295|      1|    it->idx = 0;
16296|      1|    it->tab_atom = NULL;
16297|      1|    it->atom_count = 0;
16298|      1|    it->in_prototype_chain = FALSE;
16299|      1|    p1 = JS_VALUE_GET_OBJ(enum_obj);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
16300|      1|    p1->u.for_in_iterator = it;
16301|       |
16302|      1|    if (tag == JS_TAG_NULL || tag == JS_TAG_UNDEFINED)
  ------------------
  |  Branch (16302:9): [True: 0, False: 1]
  |  Branch (16302:31): [True: 0, False: 1]
  ------------------
16303|      0|        return enum_obj;
16304|       |
16305|      1|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
16306|      1|    if (p->fast_array) {
  ------------------
  |  Branch (16306:9): [True: 0, False: 1]
  ------------------
16307|      0|        JSShape *sh;
16308|      0|        JSShapeProperty *prs;
16309|       |        /* check that there are no enumerable normal fields */
16310|      0|        sh = p->shape;
16311|      0|        for(i = 0, prs = get_shape_prop(sh); i < sh->prop_count; i++, prs++) {
  ------------------
  |  Branch (16311:46): [True: 0, False: 0]
  ------------------
16312|      0|            if (prs->flags & JS_PROP_ENUMERABLE)
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
  |  Branch (16312:17): [True: 0, False: 0]
  ------------------
16313|      0|                goto normal_case;
16314|      0|        }
16315|       |        /* for fast arrays, we only store the number of elements */
16316|      0|        it->is_array = TRUE;
16317|      0|        it->atom_count = p->u.array.count;
16318|      1|    } else {
16319|      1|    normal_case:
16320|      1|        if (JS_GetOwnPropertyNamesInternal(ctx, &tab_atom, &tab_atom_count, p,
  ------------------
  |  Branch (16320:13): [True: 0, False: 1]
  ------------------
16321|      1|                                           JS_GPN_STRING_MASK | JS_GPN_SET_ENUM)) {
  ------------------
  |  |  810|      1|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
                                                         JS_GPN_STRING_MASK | JS_GPN_SET_ENUM)) {
  ------------------
  |  |  816|      1|#define JS_GPN_SET_ENUM     (1 << 5)
  ------------------
16322|      0|            JS_FreeValue(ctx, enum_obj);
16323|      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 }
  |  |  ------------------
  ------------------
16324|      0|        }
16325|      1|        it->tab_atom = tab_atom;
16326|      1|        it->atom_count = tab_atom_count;
16327|      1|    }
16328|      1|    return enum_obj;
16329|      1|}
quickjs.c:JS_ToObjectFree:
39958|      1|{
39959|      1|    JSValue obj = JS_ToObject(ctx, val);
39960|      1|    JS_FreeValue(ctx, val);
39961|      1|    return obj;
39962|      1|}
quickjs.c:js_for_in_next:
16405|      1|{
16406|      1|    JSValueConst enum_obj;
  ------------------
  |  |  234|      1|#define JSValueConst JSValue
  ------------------
16407|      1|    JSObject *p;
16408|      1|    JSAtom prop;
16409|      1|    JSForInIterator *it;
16410|      1|    JSPropertyEnum *tab_atom;
16411|      1|    uint32_t tab_atom_count;
16412|      1|    int ret;
16413|       |
16414|      1|    enum_obj = sp[-1];
16415|       |    /* fail safe */
16416|      1|    if (JS_VALUE_GET_TAG(enum_obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (16416:9): [True: 0, False: 1]
  ------------------
16417|      0|        goto done;
16418|      1|    p = JS_VALUE_GET_OBJ(enum_obj);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
16419|      1|    if (p->class_id != JS_CLASS_FOR_IN_ITERATOR)
  ------------------
  |  Branch (16419:9): [True: 0, False: 1]
  ------------------
16420|      0|        goto done;
16421|      1|    it = p->u.for_in_iterator;
16422|       |
16423|      1|    for(;;) {
16424|      1|        if (it->idx >= it->atom_count) {
  ------------------
  |  Branch (16424:13): [True: 1, False: 0]
  ------------------
16425|      1|            if (JS_IsNull(it->obj) || JS_IsUndefined(it->obj))
  ------------------
  |  Branch (16425:17): [True: 0, False: 1]
  |  Branch (16425:39): [True: 0, False: 1]
  ------------------
16426|      0|                goto done; /* not an object */
16427|       |            /* no more property in the current object: look in the prototype */
16428|      1|            if (!it->in_prototype_chain) {
  ------------------
  |  Branch (16428:17): [True: 1, False: 0]
  ------------------
16429|      1|                ret = js_for_in_prepare_prototype_chain_enum(ctx, enum_obj);
16430|      1|                if (ret < 0)
  ------------------
  |  Branch (16430:21): [True: 0, False: 1]
  ------------------
16431|      0|                    return -1;
16432|      1|                if (ret)
  ------------------
  |  Branch (16432:21): [True: 1, False: 0]
  ------------------
16433|      1|                    goto done;
16434|      0|                it->in_prototype_chain = TRUE;
16435|      0|            }
16436|      0|            it->obj = JS_GetPrototypeFree(ctx, it->obj);
16437|      0|            if (JS_IsException(it->obj))
  ------------------
  |  Branch (16437:17): [True: 0, False: 0]
  ------------------
16438|      0|                return -1;
16439|      0|            if (JS_IsNull(it->obj))
  ------------------
  |  Branch (16439:17): [True: 0, False: 0]
  ------------------
16440|      0|                goto done; /* no more prototype */
16441|       |
16442|       |            /* must check for timeout to avoid infinite loop */
16443|      0|            if (js_poll_interrupts(ctx))
  ------------------
  |  Branch (16443:17): [True: 0, False: 0]
  ------------------
16444|      0|                return -1;
16445|       |
16446|      0|            if (JS_GetOwnPropertyNamesInternal(ctx, &tab_atom, &tab_atom_count,
  ------------------
  |  Branch (16446:17): [True: 0, False: 0]
  ------------------
16447|      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)
  |  |  ------------------
  ------------------
16448|      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)
  ------------------
16449|      0|                return -1;
16450|      0|            }
16451|      0|            JS_FreePropertyEnum(ctx, it->tab_atom, it->atom_count);
16452|      0|            it->tab_atom = tab_atom;
16453|      0|            it->atom_count = tab_atom_count;
16454|      0|            it->idx = 0;
16455|      0|        } else {
16456|      0|            if (it->is_array) {
  ------------------
  |  Branch (16456:17): [True: 0, False: 0]
  ------------------
16457|      0|                prop = __JS_AtomFromUInt32(it->idx);
16458|      0|                it->idx++;
16459|      0|            } else {
16460|      0|                BOOL is_enumerable;
16461|      0|                prop = it->tab_atom[it->idx].atom;
16462|      0|                is_enumerable = it->tab_atom[it->idx].is_enumerable;
16463|      0|                it->idx++;
16464|      0|                if (it->in_prototype_chain) {
  ------------------
  |  Branch (16464:21): [True: 0, False: 0]
  ------------------
16465|       |                    /* slow case: we are in the prototype chain */
16466|      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)
  |  |  ------------------
  ------------------
16467|      0|                    if (ret < 0)
  ------------------
  |  Branch (16467:25): [True: 0, False: 0]
  ------------------
16468|      0|                        return ret;
16469|      0|                    if (ret)
  ------------------
  |  Branch (16469:25): [True: 0, False: 0]
  ------------------
16470|      0|                        continue; /* already visited */
16471|       |                    /* add to the visited property list */
16472|      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 (16472:25): [True: 0, False: 0]
  ------------------
16473|      0|                                               JS_PROP_ENUMERABLE) < 0)
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
16474|      0|                        return -1;
16475|      0|                }
16476|      0|                if (!is_enumerable)
  ------------------
  |  Branch (16476:21): [True: 0, False: 0]
  ------------------
16477|      0|                    continue;
16478|      0|            }
16479|       |            /* check if the property was deleted */
16480|      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)
  |  |  ------------------
  ------------------
16481|      0|            if (ret < 0)
  ------------------
  |  Branch (16481:17): [True: 0, False: 0]
  ------------------
16482|      0|                return ret;
16483|      0|            if (ret)
  ------------------
  |  Branch (16483:17): [True: 0, False: 0]
  ------------------
16484|      0|                break;
16485|      0|        }
16486|      1|    }
16487|       |    /* return the property */
16488|      0|    sp[0] = JS_AtomToValue(ctx, prop);
16489|      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 }
  |  |  ------------------
  ------------------
16490|      0|    return 0;
16491|      1| done:
16492|       |    /* return the end */
16493|      1|    sp[0] = JS_UNDEFINED;
  ------------------
  |  |  291|      1|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16494|      1|    sp[1] = JS_TRUE;
  ------------------
  |  |  293|      1|#define JS_TRUE      JS_MKVAL(JS_TAG_BOOL, 1)
  |  |  ------------------
  |  |  |  |  247|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
16495|      1|    return 0;
16496|      1|}
quickjs.c:js_for_in_prepare_prototype_chain_enum:
16343|      1|{
16344|      1|    JSObject *p;
16345|      1|    JSForInIterator *it;
16346|      1|    JSPropertyEnum *tab_atom;
16347|      1|    uint32_t tab_atom_count, i;
16348|      1|    JSValue obj1;
16349|       |
16350|      1|    p = JS_VALUE_GET_OBJ(enum_obj);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
16351|      1|    it = p->u.for_in_iterator;
16352|       |
16353|       |    /* check if there are enumerable properties in the prototype chain (fast path) */
16354|      1|    obj1 = JS_DupValue(ctx, it->obj);
16355|      3|    for(;;) {
16356|      3|        obj1 = JS_GetPrototypeFree(ctx, obj1);
16357|      3|        if (JS_IsNull(obj1))
  ------------------
  |  Branch (16357:13): [True: 1, False: 2]
  ------------------
16358|      1|            break;
16359|      2|        if (JS_IsException(obj1))
  ------------------
  |  Branch (16359:13): [True: 0, False: 2]
  ------------------
16360|      0|            goto fail;
16361|      2|        if (JS_GetOwnPropertyNamesInternal(ctx, &tab_atom, &tab_atom_count,
  ------------------
  |  Branch (16361:13): [True: 0, False: 2]
  ------------------
16362|      2|                                           JS_VALUE_GET_OBJ(obj1),
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
16363|      2|                                           JS_GPN_STRING_MASK | JS_GPN_ENUM_ONLY)) {
  ------------------
  |  |  810|      2|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
                                                         JS_GPN_STRING_MASK | JS_GPN_ENUM_ONLY)) {
  ------------------
  |  |  814|      2|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
16364|      0|            JS_FreeValue(ctx, obj1);
16365|      0|            goto fail;
16366|      0|        }
16367|      2|        JS_FreePropertyEnum(ctx, tab_atom, tab_atom_count);
16368|      2|        if (tab_atom_count != 0) {
  ------------------
  |  Branch (16368:13): [True: 0, False: 2]
  ------------------
16369|      0|            JS_FreeValue(ctx, obj1);
16370|      0|            goto slow_path;
16371|      0|        }
16372|       |        /* must check for timeout to avoid infinite loop */
16373|      2|        if (js_poll_interrupts(ctx)) {
  ------------------
  |  Branch (16373:13): [True: 0, False: 2]
  ------------------
16374|      0|            JS_FreeValue(ctx, obj1);
16375|      0|            goto fail;
16376|      0|        }
16377|      2|    }
16378|      1|    JS_FreeValue(ctx, obj1);
16379|      1|    return 1;
16380|       |
16381|      0| slow_path:
16382|       |    /* add the visited properties, even if they are not enumerable */
16383|      0|    if (it->is_array) {
  ------------------
  |  Branch (16383:9): [True: 0, False: 0]
  ------------------
16384|      0|        if (JS_GetOwnPropertyNamesInternal(ctx, &tab_atom, &tab_atom_count,
  ------------------
  |  Branch (16384:13): [True: 0, False: 0]
  ------------------
16385|      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)
  |  |  ------------------
  ------------------
16386|      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)
  ------------------
16387|      0|            goto fail;
16388|      0|        }
16389|      0|        it->is_array = FALSE;
16390|      0|        it->tab_atom = tab_atom;
16391|      0|        it->atom_count = tab_atom_count;
16392|      0|    }
16393|       |
16394|      0|    for(i = 0; i < it->atom_count; i++) {
  ------------------
  |  Branch (16394:16): [True: 0, False: 0]
  ------------------
16395|      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 (16395:13): [True: 0, False: 0]
  ------------------
16396|      0|            goto fail;
16397|      0|    }
16398|      0|    return 0;
16399|      0| fail:
16400|      0|    return -1;
16401|      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_ConcatString:
 5043|      1|{
 5044|      1|    JSString *p1, *p2;
 5045|       |
 5046|      1|    if (unlikely(JS_VALUE_GET_TAG(op1) != JS_TAG_STRING &&
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1, False: 0]
  |  |  |  Branch (33:45): [True: 1, False: 0]
  |  |  |  Branch (33:45): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 5047|      1|                 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|      1|    if (unlikely(JS_VALUE_GET_TAG(op2) != JS_TAG_STRING &&
  ------------------
  |  |   33|      1|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1]
  |  |  |  Branch (33:45): [True: 0, False: 1]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5055|      1|                 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|      1|    if (JS_VALUE_GET_TAG(op2) == JS_TAG_STRING) {
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5064:9): [True: 1, False: 0]
  ------------------
 5065|      1|        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)
  |  |  ------------------
  ------------------
 5066|      1|        if (p2->len == 0) {
  ------------------
  |  Branch (5066:13): [True: 1, False: 0]
  ------------------
 5067|      1|            JS_FreeValue(ctx, op2);
 5068|      1|            return op1;
 5069|      1|        }
 5070|      0|        if (p2->len <= JS_STRING_ROPE_SHORT_LEN) {
  ------------------
  |  |  216|      0|#define JS_STRING_ROPE_SHORT_LEN  512
  ------------------
  |  Branch (5070:13): [True: 0, False: 0]
  ------------------
 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|      0|    } 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|      0|    return js_new_string_rope(ctx, op1, op2);
 5117|      1|}
quickjs.c:js_add_slow:
15099|      1|{
15100|      1|    JSValue op1, op2;
15101|      1|    uint32_t tag1, tag2;
15102|       |
15103|      1|    op1 = sp[-2];
15104|      1|    op2 = sp[-1];
15105|       |
15106|      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)
  |  |  ------------------
  ------------------
15107|      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)
  |  |  ------------------
  ------------------
15108|       |    /* fast path for float64 */
15109|      1|    if (tag1 == JS_TAG_FLOAT64 && tag2 == JS_TAG_FLOAT64) {
  ------------------
  |  Branch (15109:9): [True: 1, False: 0]
  |  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|      1|    if (tag1 == JS_TAG_SHORT_BIG_INT && tag2 == JS_TAG_SHORT_BIG_INT) {
  ------------------
  |  Branch (15117:9): [True: 0, False: 1]
  |  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|      1|    if (tag1 == JS_TAG_OBJECT || tag2 == JS_TAG_OBJECT) {
  ------------------
  |  Branch (15134:9): [True: 0, False: 1]
  |  Branch (15134:34): [True: 0, False: 1]
  ------------------
15135|      0|        op1 = JS_ToPrimitiveFree(ctx, op1, HINT_NONE);
  ------------------
  |  | 1246|      0|#define HINT_NONE    2
  ------------------
15136|      0|        if (JS_IsException(op1)) {
  ------------------
  |  Branch (15136:13): [True: 0, False: 0]
  ------------------
15137|      0|            JS_FreeValue(ctx, op2);
15138|      0|            goto exception;
15139|      0|        }
15140|       |
15141|      0|        op2 = JS_ToPrimitiveFree(ctx, op2, HINT_NONE);
  ------------------
  |  | 1246|      0|#define HINT_NONE    2
  ------------------
15142|      0|        if (JS_IsException(op2)) {
  ------------------
  |  Branch (15142:13): [True: 0, False: 0]
  ------------------
15143|      0|            JS_FreeValue(ctx, op1);
15144|      0|            goto exception;
15145|      0|        }
15146|      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)
  |  |  ------------------
  ------------------
15147|      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)
  |  |  ------------------
  ------------------
15148|      0|    }
15149|       |
15150|      1|    if (tag_is_string(tag1) || tag_is_string(tag2)) {
  ------------------
  |  Branch (15150:9): [True: 0, False: 1]
  |  Branch (15150:32): [True: 1, False: 0]
  ------------------
15151|      1|        sp[-2] = JS_ConcatString(ctx, op1, op2);
15152|      1|        if (JS_IsException(sp[-2]))
  ------------------
  |  Branch (15152:13): [True: 0, False: 1]
  ------------------
15153|      0|            goto exception;
15154|      1|        return 0;
15155|      1|    }
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|      5|{
13027|      5|    return JS_ToNumberHintFree(ctx, val, TON_FLAG_NUMERIC);
13028|      5|}
quickjs.c:js_binary_arith_slow:
14908|      2|{
14909|      2|    JSValue op1, op2;
14910|      2|    uint32_t tag1, tag2;
14911|      2|    double d1, d2;
14912|       |
14913|      2|    op1 = sp[-2];
14914|      2|    op2 = sp[-1];
14915|      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)
  |  |  ------------------
  ------------------
14916|      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)
  |  |  ------------------
  ------------------
14917|       |    /* fast path for float operations */
14918|      2|    if (tag1 == JS_TAG_FLOAT64 && tag2 == JS_TAG_FLOAT64) {
  ------------------
  |  Branch (14918:9): [True: 0, False: 2]
  |  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|      2|    if (tag1 == JS_TAG_SHORT_BIG_INT && tag2 == JS_TAG_SHORT_BIG_INT) {
  ------------------
  |  Branch (14924:9): [True: 0, False: 2]
  |  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|      2|    op1 = JS_ToNumericFree(ctx, op1);
14968|      2|    if (JS_IsException(op1)) {
  ------------------
  |  Branch (14968:9): [True: 0, False: 2]
  ------------------
14969|      0|        JS_FreeValue(ctx, op2);
14970|      0|        goto exception;
14971|      0|    }
14972|      2|    op2 = JS_ToNumericFree(ctx, op2);
14973|      2|    if (JS_IsException(op2)) {
  ------------------
  |  Branch (14973:9): [True: 0, False: 2]
  ------------------
14974|      0|        JS_FreeValue(ctx, op1);
14975|      0|        goto exception;
14976|      0|    }
14977|      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)
  |  |  ------------------
  ------------------
14978|      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)
  |  |  ------------------
  ------------------
14979|       |
14980|      2|    if (tag1 == JS_TAG_INT && tag2 == JS_TAG_INT) {
  ------------------
  |  Branch (14980:9): [True: 1, False: 1]
  |  Branch (14980:31): [True: 0, False: 1]
  ------------------
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|      2|    } else if ((tag1 == JS_TAG_SHORT_BIG_INT || tag1 == JS_TAG_BIG_INT) &&
  ------------------
  |  Branch (15014:17): [True: 0, False: 2]
  |  Branch (15014:49): [True: 0, False: 2]
  ------------------
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|      2|    } else {
15056|      2|        double dr;
15057|       |        /* float64 result */
15058|      2|        if (JS_ToFloat64Free(ctx, &d1, op1)) {
  ------------------
  |  Branch (15058:13): [True: 0, False: 2]
  ------------------
15059|      0|            JS_FreeValue(ctx, op2);
15060|      0|            goto exception;
15061|      0|        }
15062|      2|        if (JS_ToFloat64Free(ctx, &d2, op2))
  ------------------
  |  Branch (15062:13): [True: 0, False: 2]
  ------------------
15063|      0|            goto exception;
15064|      2|    handle_float64:
15065|      2|        switch(op) {
15066|      0|        case OP_sub:
  ------------------
  |  Branch (15066:9): [True: 0, False: 2]
  ------------------
15067|      0|            dr = d1 - d2;
15068|      0|            break;
15069|      1|        case OP_mul:
  ------------------
  |  Branch (15069:9): [True: 1, False: 1]
  ------------------
15070|      1|            dr = d1 * d2;
15071|      1|            break;
15072|      0|        case OP_div:
  ------------------
  |  Branch (15072:9): [True: 0, False: 2]
  ------------------
15073|      0|            dr = d1 / d2;
15074|      0|            break;
15075|      1|        case OP_mod:
  ------------------
  |  Branch (15075:9): [True: 1, False: 1]
  ------------------
15076|      1|            dr = fmod(d1, d2);
15077|      1|            break;
15078|      0|        case OP_pow:
  ------------------
  |  Branch (15078:9): [True: 0, False: 2]
  ------------------
15079|      0|            dr = js_pow(d1, d2);
15080|      0|            break;
15081|      0|        default:
  ------------------
  |  Branch (15081:9): [True: 0, False: 2]
  ------------------
15082|      0|            abort();
15083|      2|        }
15084|      2|        sp[-2] = __JS_NewFloat64(ctx, dr);
15085|      2|    }
15086|      2|    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|      2|}
quickjs.c:js_unary_arith_slow:
14723|      1|{
14724|      1|    JSValue op1;
14725|      1|    int v;
14726|      1|    uint32_t tag;
14727|      1|    JSBigIntBuf buf1;
14728|      1|    JSBigInt *p1;
14729|       |
14730|      1|    op1 = sp[-1];
14731|       |    /* fast path for float64 */
14732|      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: 0, False: 1]
  |  |  ------------------
  ------------------
14733|      0|        goto handle_float64;
14734|      1|    op1 = JS_ToNumericFree(ctx, op1);
14735|      1|    if (JS_IsException(op1))
  ------------------
  |  Branch (14735:9): [True: 0, False: 1]
  ------------------
14736|      0|        goto exception;
14737|      1|    tag = JS_VALUE_GET_TAG(op1);
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
14738|      1|    switch(tag) {
14739|      0|    case JS_TAG_INT:
  ------------------
  |  Branch (14739:5): [True: 0, False: 1]
  ------------------
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: 1]
  ------------------
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: 1]
  ------------------
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|      1|    default:
  ------------------
  |  Branch (14831:5): [True: 1, False: 0]
  ------------------
14832|      1|    handle_float64:
14833|      1|        {
14834|      1|            double d;
14835|      1|            d = JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      1|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
14836|      1|            switch(op) {
14837|      0|            case OP_inc:
  ------------------
  |  Branch (14837:13): [True: 0, False: 1]
  ------------------
14838|      0|            case OP_dec:
  ------------------
  |  Branch (14838:13): [True: 0, False: 1]
  ------------------
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: 1]
  ------------------
14843|      0|                break;
14844|      1|            case OP_neg:
  ------------------
  |  Branch (14844:13): [True: 1, False: 0]
  ------------------
14845|      1|                d = -d;
14846|      1|                break;
14847|      0|            default:
  ------------------
  |  Branch (14847:13): [True: 0, False: 1]
  ------------------
14848|      0|                abort();
14849|      1|            }
14850|      1|            sp[-1] = __JS_NewFloat64(ctx, d);
14851|      1|        }
14852|      0|        break;
14853|      1|    }
14854|      1|    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|      1|}
quickjs.c:js_string_compare:
 4618|  5.34k|{
 4619|  5.34k|    int res, len;
 4620|  5.34k|    len = min_int(p1->len, p2->len);
 4621|  5.34k|    res = js_string_memcmp(p1, 0, p2, 0, len);
 4622|  5.34k|    if (res == 0) {
  ------------------
  |  Branch (4622:9): [True: 66, False: 5.28k]
  ------------------
 4623|     66|        if (p1->len == p2->len)
  ------------------
  |  Branch (4623:13): [True: 0, False: 66]
  ------------------
 4624|      0|            res = 0;
 4625|     66|        else if (p1->len < p2->len)
  ------------------
  |  Branch (4625:18): [True: 33, False: 33]
  ------------------
 4626|     33|            res = -1;
 4627|     33|        else
 4628|     33|            res = 1;
 4629|     66|    }
 4630|  5.34k|    return res;
 4631|  5.34k|}
quickjs.c:is_backtrace_needed:
 7621|      7|{
 7622|      7|    JSObject *p;
 7623|      7|    if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      7|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (7623:9): [True: 0, False: 7]
  ------------------
 7624|      0|        return FALSE;
 7625|      7|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|      7|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      7|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 7626|      7|    if (p->class_id != JS_CLASS_ERROR)
  ------------------
  |  Branch (7626:9): [True: 0, False: 7]
  ------------------
 7627|      0|        return FALSE;
 7628|      7|    if (find_own_property1(p, JS_ATOM_stack))
  ------------------
  |  Branch (7628:9): [True: 1, False: 6]
  ------------------
 7629|      1|        return FALSE;
 7630|      6|    return TRUE;
 7631|      7|}
quickjs.c:close_var_refs:
17534|     11|{
17535|     11|    JSVarRef *var_ref;
17536|     11|    int i;
17537|       |
17538|     11|    for(i = 0; i < b->var_ref_count; i++) {
  ------------------
  |  Branch (17538:16): [True: 0, False: 11]
  ------------------
17539|      0|        var_ref = sf->var_refs[i];
17540|      0|        if (var_ref)
  ------------------
  |  Branch (17540:13): [True: 0, False: 0]
  ------------------
17541|      0|            close_var_ref(rt, sf, var_ref);
17542|      0|    }
17543|     11|}
quickjs.c:JS_CallFree:
20726|     16|{
20727|     16|    JSValue res = JS_CallInternal(ctx, func_obj, this_obj, 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 }
  |  |  ------------------
  ------------------
20728|     16|                                  argc, (JSValue *)argv, JS_CALL_FLAG_COPY_ARGV);
  ------------------
  |  |17559|     16|#define JS_CALL_FLAG_COPY_ARGV   (1 << 1)
  ------------------
20729|     16|    JS_FreeValue(ctx, func_obj);
20730|     16|    return res;
20731|     16|}
quickjs.c:async_func_init:
20896|     11|{
20897|     11|    JSAsyncFunctionState *s;
20898|     11|    JSObject *p;
20899|     11|    JSFunctionBytecode *b;
20900|     11|    JSStackFrame *sf;
20901|     11|    int i, arg_buf_len, n;
20902|       |
20903|     11|    p = JS_VALUE_GET_OBJ(func_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)
  |  |  ------------------
  ------------------
20904|     11|    b = p->u.func.function_bytecode;
20905|     11|    arg_buf_len = max_int(b->arg_count, argc);
20906|     11|    s = js_malloc(ctx, sizeof(*s) + sizeof(JSValue) * (arg_buf_len + b->var_count + b->stack_size) + sizeof(JSVarRef *) * b->var_ref_count);
20907|     11|    if (!s)
  ------------------
  |  Branch (20907:9): [True: 0, False: 11]
  ------------------
20908|      0|        return NULL;
20909|     11|    memset(s, 0, sizeof(*s));
20910|     11|    js_rc(s)->ref_count = 1;
20911|     11|    add_gc_object(ctx->rt, &s->header, JS_GC_OBJ_TYPE_ASYNC_FUNCTION);
20912|       |
20913|     11|    sf = &s->frame;
20914|     11|    sf->js_mode = b->js_mode | JS_MODE_ASYNC;
  ------------------
  |  |  404|     11|#define JS_MODE_ASYNC  (1 << 2) /* async function */
  ------------------
20915|     11|    sf->cur_pc = b->byte_code_buf;
20916|     11|    sf->arg_buf = (JSValue *)(s + 1);
20917|     11|    sf->cur_func = JS_DupValue(ctx, func_obj);
20918|     11|    s->this_val = JS_DupValue(ctx, this_obj);
20919|     11|    s->argc = argc;
20920|     11|    sf->arg_count = arg_buf_len;
20921|     11|    sf->var_buf = sf->arg_buf + arg_buf_len;
20922|     11|    sf->cur_sp = sf->var_buf + b->var_count;
20923|     11|    sf->var_refs = (JSVarRef **)(sf->cur_sp + b->stack_size);
20924|     11|    for(i = 0; i < b->var_ref_count; i++)
  ------------------
  |  Branch (20924:16): [True: 0, False: 11]
  ------------------
20925|      0|        sf->var_refs[i] = NULL;
20926|     11|    for(i = 0; i < argc; i++)
  ------------------
  |  Branch (20926:16): [True: 0, False: 11]
  ------------------
20927|      0|        sf->arg_buf[i] = JS_DupValue(ctx, argv[i]);
20928|     11|    n = arg_buf_len + b->var_count;
20929|     11|    for(i = argc; i < n; i++)
  ------------------
  |  Branch (20929:19): [True: 0, False: 11]
  ------------------
20930|     11|        sf->arg_buf[i] = JS_UNDEFINED;
  ------------------
  |  |  291|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     11|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
20931|     11|    s->resolving_funcs[0] = 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 }
  |  |  ------------------
  ------------------
20932|     11|    s->resolving_funcs[1] = 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 }
  |  |  ------------------
  ------------------
20933|     11|    s->is_completed = FALSE;
20934|     11|    return s;
20935|     11|}
quickjs.c:async_func_resume:
20952|     11|{
20953|     11|    JSRuntime *rt = ctx->rt;
20954|     11|    JSStackFrame *sf = &s->frame;
20955|     11|    JSValue func_obj, ret;
20956|       |
20957|     11|    assert(!s->is_completed);
  ------------------
  |  Branch (20957:5): [True: 0, False: 11]
  |  Branch (20957:5): [True: 11, False: 0]
  ------------------
20958|     11|    if (js_check_stack_overflow(ctx->rt, 0)) {
  ------------------
  |  Branch (20958:9): [True: 0, False: 11]
  ------------------
20959|      0|        ret = JS_ThrowStackOverflow(ctx);
20960|     11|    } else {
20961|       |        /* the tag does not matter provided it is not an object */
20962|     11|        func_obj = JS_MKPTR(JS_TAG_INT, s);
  ------------------
  |  |  248|     11|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
20963|     11|        ret = JS_CallInternal(ctx, func_obj, s->this_val, 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 }
  |  |  ------------------
  ------------------
20964|     11|                              s->argc, sf->arg_buf, JS_CALL_FLAG_GENERATOR);
  ------------------
  |  |17560|     11|#define JS_CALL_FLAG_GENERATOR   (1 << 2)
  ------------------
20965|     11|    }
20966|     11|    if (JS_IsException(ret) || JS_IsUndefined(ret)) {
  ------------------
  |  Branch (20966:9): [True: 0, False: 11]
  |  Branch (20966:32): [True: 11, False: 0]
  ------------------
20967|     11|        JSObject *p;
20968|     11|        JSFunctionBytecode *b;
20969|       |        
20970|     11|        p = JS_VALUE_GET_OBJ(sf->cur_func);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
20971|     11|        b = p->u.func.function_bytecode;
20972|       |        
20973|     11|        if (JS_IsUndefined(ret)) {
  ------------------
  |  Branch (20973:13): [True: 11, False: 0]
  ------------------
20974|     11|            ret = sf->cur_sp[-1];
20975|     11|            sf->cur_sp[-1] = 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 }
  |  |  ------------------
  ------------------
20976|     11|        }
20977|       |        /* end of execution */
20978|     11|        s->is_completed = TRUE;
20979|       |
20980|       |        /* close the closure variables. */
20981|     11|        close_var_refs(rt, b, sf);
20982|       |        
20983|     11|        async_func_free_frame(rt, s);
20984|     11|    }
20985|     11|    return ret;
20986|     11|}
quickjs.c:skip_shebang:
23762|     22|{
23763|     22|    const uint8_t *p = *pp;
23764|     22|    int c;
23765|       |
23766|     22|    if (p[0] == '#' && p[1] == '!') {
  ------------------
  |  Branch (23766:9): [True: 0, False: 22]
  |  Branch (23766:24): [True: 0, False: 0]
  ------------------
23767|      0|        p += 2;
23768|      0|        while (p < buf_end) {
  ------------------
  |  Branch (23768:16): [True: 0, False: 0]
  ------------------
23769|      0|            if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (23769:17): [True: 0, False: 0]
  |  Branch (23769:31): [True: 0, False: 0]
  ------------------
23770|      0|                break;
23771|      0|            } else if (*p >= 0x80) {
  ------------------
  |  Branch (23771:24): [True: 0, False: 0]
  ------------------
23772|      0|                c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
23773|      0|                if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21889|      0|#define CP_LS   0x2028
  ------------------
                              if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21890|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (23773:21): [True: 0, False: 0]
  |  Branch (23773:35): [True: 0, False: 0]
  ------------------
23774|      0|                    break;
23775|      0|                } else if (c == -1) {
  ------------------
  |  Branch (23775:28): [True: 0, False: 0]
  ------------------
23776|      0|                    p++; /* skip invalid UTF-8 */
23777|      0|                }
23778|      0|            } else {
23779|      0|                p++;
23780|      0|            }
23781|      0|        }
23782|      0|        *pp = p;
23783|      0|    }
23784|     22|}
quickjs.c:simple_next_token:
23671|    168|{
23672|    168|    const uint8_t *p;
23673|    168|    uint32_t c;
23674|       |
23675|       |    /* skip spaces and comments */
23676|    168|    p = *pp;
23677|    209|    for (;;) {
23678|    209|        switch(c = *p++) {
23679|      0|        case '\r':
  ------------------
  |  Branch (23679:9): [True: 0, False: 209]
  ------------------
23680|     31|        case '\n':
  ------------------
  |  Branch (23680:9): [True: 31, False: 178]
  ------------------
23681|     31|            if (no_line_terminator)
  ------------------
  |  Branch (23681:17): [True: 14, False: 17]
  ------------------
23682|     14|                return '\n';
23683|     17|            continue;
23684|     22|        case ' ':
  ------------------
  |  Branch (23684:9): [True: 22, False: 187]
  ------------------
23685|     22|        case '\t':
  ------------------
  |  Branch (23685:9): [True: 0, False: 209]
  ------------------
23686|     22|        case '\v':
  ------------------
  |  Branch (23686:9): [True: 0, False: 209]
  ------------------
23687|     22|        case '\f':
  ------------------
  |  Branch (23687:9): [True: 0, False: 209]
  ------------------
23688|     22|            continue;
23689|      4|        case '/':
  ------------------
  |  Branch (23689:9): [True: 4, False: 205]
  ------------------
23690|      4|            if (*p == '/') {
  ------------------
  |  Branch (23690:17): [True: 4, False: 0]
  ------------------
23691|      4|                if (no_line_terminator)
  ------------------
  |  Branch (23691:21): [True: 2, False: 2]
  ------------------
23692|      2|                    return '\n';
23693|     11|                while (*p && *p != '\r' && *p != '\n')
  ------------------
  |  Branch (23693:24): [True: 10, False: 1]
  |  Branch (23693:30): [True: 10, False: 0]
  |  Branch (23693:44): [True: 9, False: 1]
  ------------------
23694|      9|                    p++;
23695|      2|                continue;
23696|      4|            }
23697|      0|            if (*p == '*') {
  ------------------
  |  Branch (23697:17): [True: 0, False: 0]
  ------------------
23698|      0|                while (*++p) {
  ------------------
  |  Branch (23698:24): [True: 0, False: 0]
  ------------------
23699|      0|                    if ((*p == '\r' || *p == '\n') && no_line_terminator)
  ------------------
  |  Branch (23699:26): [True: 0, False: 0]
  |  Branch (23699:40): [True: 0, False: 0]
  |  Branch (23699:55): [True: 0, False: 0]
  ------------------
23700|      0|                        return '\n';
23701|      0|                    if (*p == '*' && p[1] == '/') {
  ------------------
  |  Branch (23701:25): [True: 0, False: 0]
  |  Branch (23701:38): [True: 0, False: 0]
  ------------------
23702|      0|                        p += 2;
23703|      0|                        break;
23704|      0|                    }
23705|      0|                }
23706|      0|                continue;
23707|      0|            }
23708|      0|            break;
23709|      9|        case '=':
  ------------------
  |  Branch (23709:9): [True: 9, False: 200]
  ------------------
23710|      9|            if (*p == '>')
  ------------------
  |  Branch (23710:17): [True: 0, False: 9]
  ------------------
23711|      0|                return TOK_ARROW;
23712|      9|            break;
23713|     12|        case 'i':
  ------------------
  |  Branch (23713:9): [True: 12, False: 197]
  ------------------
23714|     12|            if (match_identifier(p, "n"))
  ------------------
  |  Branch (23714:17): [True: 0, False: 12]
  ------------------
23715|      0|                return TOK_IN;
23716|     12|            if (match_identifier(p, "mport")) {
  ------------------
  |  Branch (23716:17): [True: 0, False: 12]
  ------------------
23717|      0|                *pp = p + 5;
23718|      0|                return TOK_IMPORT;
23719|      0|            }
23720|     12|            return TOK_IDENT;
23721|      0|        case 'o':
  ------------------
  |  Branch (23721:9): [True: 0, False: 209]
  ------------------
23722|      0|            if (match_identifier(p, "f"))
  ------------------
  |  Branch (23722:17): [True: 0, False: 0]
  ------------------
23723|      0|                return TOK_OF;
23724|      0|            return TOK_IDENT;
23725|      0|        case 'e':
  ------------------
  |  Branch (23725:9): [True: 0, False: 209]
  ------------------
23726|      0|            if (match_identifier(p, "xport"))
  ------------------
  |  Branch (23726:17): [True: 0, False: 0]
  ------------------
23727|      0|                return TOK_EXPORT;
23728|      0|            return TOK_IDENT;
23729|      2|        case 'f':
  ------------------
  |  Branch (23729:9): [True: 2, False: 207]
  ------------------
23730|      2|            if (match_identifier(p, "unction"))
  ------------------
  |  Branch (23730:17): [True: 1, False: 1]
  ------------------
23731|      1|                return TOK_FUNCTION;
23732|      1|            return TOK_IDENT;
23733|      0|        case '\\':
  ------------------
  |  Branch (23733:9): [True: 0, False: 209]
  ------------------
23734|      0|            if (*p == 'u') {
  ------------------
  |  Branch (23734:17): [True: 0, False: 0]
  ------------------
23735|      0|                if (lre_js_is_ident_first(lre_parse_escape(&p, TRUE)))
  ------------------
  |  Branch (23735:21): [True: 0, False: 0]
  ------------------
23736|      0|                    return TOK_IDENT;
23737|      0|            }
23738|      0|            break;
23739|    129|        default:
  ------------------
  |  Branch (23739:9): [True: 129, False: 80]
  ------------------
23740|    129|            if (c >= 128) {
  ------------------
  |  Branch (23740:17): [True: 0, False: 129]
  ------------------
23741|      0|                c = unicode_from_utf8(p - 1, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
23742|      0|                if (no_line_terminator && (c == CP_PS || c == CP_LS))
  ------------------
  |  |21890|      0|#define CP_PS   0x2029
  ------------------
                              if (no_line_terminator && (c == CP_PS || c == CP_LS))
  ------------------
  |  |21889|      0|#define CP_LS   0x2028
  ------------------
  |  Branch (23742:21): [True: 0, False: 0]
  |  Branch (23742:44): [True: 0, False: 0]
  |  Branch (23742:58): [True: 0, False: 0]
  ------------------
23743|      0|                    return '\n';
23744|      0|            }
23745|    129|            if (lre_is_space(c))
  ------------------
  |  Branch (23745:17): [True: 0, False: 129]
  ------------------
23746|      0|                continue;
23747|    129|            if (lre_js_is_ident_first(c))
  ------------------
  |  Branch (23747:17): [True: 1, False: 128]
  ------------------
23748|      1|                return TOK_IDENT;
23749|    128|            break;
23750|    209|        }
23751|    137|        return c;
23752|    209|    }
23753|    168|}
quickjs.c:match_identifier:
23647|     26|static int match_identifier(const uint8_t *p, const char *s) {
23648|     26|    uint32_t c;
23649|     99|    while (*s) {
  ------------------
  |  Branch (23649:12): [True: 86, False: 13]
  ------------------
23650|     86|        if ((uint8_t)*s++ != *p++)
  ------------------
  |  Branch (23650:13): [True: 13, False: 73]
  ------------------
23651|     13|            return 0;
23652|     86|    }
23653|     13|    c = *p;
23654|     13|    if (c >= 128)
  ------------------
  |  Branch (23654:9): [True: 12, False: 1]
  ------------------
23655|     12|        c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|     12|#define UTF8_CHAR_LEN_MAX 6
  ------------------
23656|     13|    return !lre_js_is_ident_next(c);
23657|     26|}
quickjs.c:js_new_module_def:
29665|     33|{
29666|     33|    JSModuleDef *m;
29667|     33|    m = js_mallocz(ctx, sizeof(*m));
29668|     33|    if (!m) {
  ------------------
  |  Branch (29668:9): [True: 0, False: 33]
  ------------------
29669|      0|        JS_FreeAtom(ctx, name);
29670|      0|        return NULL;
29671|      0|    }
29672|     33|    js_rc(m)->ref_count = 1;
29673|     33|    add_gc_object(ctx->rt, &m->header, JS_GC_OBJ_TYPE_MODULE);
29674|     33|    m->module_name = name;
29675|     33|    m->module_ns = JS_UNDEFINED;
  ------------------
  |  |  291|     33|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     33|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29676|     33|    m->func_obj = JS_UNDEFINED;
  ------------------
  |  |  291|     33|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     33|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29677|     33|    m->eval_exception = JS_UNDEFINED;
  ------------------
  |  |  291|     33|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     33|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29678|     33|    m->meta_obj = JS_UNDEFINED;
  ------------------
  |  |  291|     33|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     33|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29679|     33|    m->promise = JS_UNDEFINED;
  ------------------
  |  |  291|     33|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     33|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29680|     33|    m->resolving_funcs[0] = JS_UNDEFINED;
  ------------------
  |  |  291|     33|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     33|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29681|     33|    m->resolving_funcs[1] = JS_UNDEFINED;
  ------------------
  |  |  291|     33|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     33|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29682|     33|    m->private_value = JS_UNDEFINED;
  ------------------
  |  |  291|     33|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     33|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29683|     33|    list_add_tail(&m->link, &ctx->loaded_modules);
29684|     33|    return m;
29685|     33|}
quickjs.c:add_export_entry2:
29801|  1.07k|{
29802|  1.07k|    JSExportEntry *me;
29803|       |
29804|  1.07k|    if (find_export_entry(ctx, m, export_name)) {
  ------------------
  |  Branch (29804:9): [True: 0, False: 1.07k]
  ------------------
29805|      0|        char buf1[ATOM_GET_STR_BUF_SIZE];
29806|      0|        if (s) {
  ------------------
  |  Branch (29806:13): [True: 0, False: 0]
  ------------------
29807|      0|            js_parse_error(s, "duplicate exported name '%s'",
29808|      0|                           JS_AtomGetStr(ctx, buf1, sizeof(buf1), export_name));
29809|      0|        } else {
29810|      0|            JS_ThrowSyntaxErrorAtom(ctx, "duplicate exported name '%s'", export_name);
  ------------------
  |  | 7732|      0|#define JS_ThrowSyntaxErrorAtom(ctx, fmt, atom) __JS_ThrowSyntaxErrorAtom(ctx, atom, fmt, "")
  ------------------
29811|      0|        }
29812|      0|        return NULL;
29813|      0|    }
29814|       |
29815|  1.07k|    if (js_resize_array(ctx, (void **)&m->export_entries,
  ------------------
  |  Branch (29815:9): [True: 0, False: 1.07k]
  ------------------
29816|  1.07k|                        sizeof(JSExportEntry),
29817|  1.07k|                        &m->export_entries_size,
29818|  1.07k|                        m->export_entries_count + 1))
29819|      0|        return NULL;
29820|  1.07k|    me = &m->export_entries[m->export_entries_count++];
29821|  1.07k|    memset(me, 0, sizeof(*me));
29822|  1.07k|    me->local_name = JS_DupAtom(ctx, local_name);
29823|  1.07k|    me->export_name = JS_DupAtom(ctx, export_name);
29824|  1.07k|    me->export_type = export_type;
29825|  1.07k|    return me;
29826|  1.07k|}
quickjs.c:find_export_entry:
29786|  2.15k|{
29787|  2.15k|    JSExportEntry *me;
29788|  2.15k|    int i;
29789|  64.5k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (29789:16): [True: 63.4k, False: 1.07k]
  ------------------
29790|  63.4k|        me = &m->export_entries[i];
29791|  63.4k|        if (me->export_name == export_name)
  ------------------
  |  Branch (29791:13): [True: 1.07k, False: 62.3k]
  ------------------
29792|  1.07k|            return me;
29793|  63.4k|    }
29794|  1.07k|    return NULL;
29795|  2.15k|}
quickjs.c:js_build_module_ns:
30408|     22|{
30409|     22|    JSValue obj;
30410|     22|    JSObject *p;
30411|     22|    GetExportNamesState s_s, *s = &s_s;
30412|     22|    int i, ret;
30413|     22|    JSProperty *pr;
30414|       |
30415|     22|    obj = JS_NewObjectClass(ctx, JS_CLASS_MODULE_NS);
30416|     22|    if (JS_IsException(obj))
  ------------------
  |  Branch (30416:9): [True: 0, False: 22]
  ------------------
30417|      0|        return obj;
30418|     22|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|     22|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     22|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30419|       |
30420|     22|    memset(s, 0, sizeof(*s));
30421|     22|    ret = get_exported_names(ctx, s, m, FALSE);
30422|     22|    js_free(ctx, s->modules);
30423|     22|    if (ret)
  ------------------
  |  Branch (30423:9): [True: 0, False: 22]
  ------------------
30424|      0|        goto fail;
30425|       |
30426|       |    /* Resolve the exported names. The ambiguous exports are removed */
30427|  1.10k|    for(i = 0; i < s->exported_names_count; i++) {
  ------------------
  |  Branch (30427:16): [True: 1.07k, False: 22]
  ------------------
30428|  1.07k|        ExportedNameEntry *en = &s->exported_names[i];
30429|  1.07k|        JSResolveResultEnum res;
30430|  1.07k|        JSExportEntry *res_me;
30431|  1.07k|        JSModuleDef *res_m;
30432|       |
30433|  1.07k|        if (en->u.me) {
  ------------------
  |  Branch (30433:13): [True: 1.07k, False: 0]
  ------------------
30434|  1.07k|            res_me = en->u.me; /* fast case: no resolution needed */
30435|  1.07k|            res_m = m;
30436|  1.07k|            res = JS_RESOLVE_RES_FOUND;
30437|  1.07k|        } else {
30438|      0|            res = js_resolve_export(ctx, &res_m, &res_me, m,
30439|      0|                                    en->export_name);
30440|      0|        }
30441|  1.07k|        if (res != JS_RESOLVE_RES_FOUND) {
  ------------------
  |  Branch (30441:13): [True: 0, False: 1.07k]
  ------------------
30442|      0|            if (res != JS_RESOLVE_RES_AMBIGUOUS) {
  ------------------
  |  Branch (30442:17): [True: 0, False: 0]
  ------------------
30443|      0|                js_resolve_export_throw_error(ctx, res, m, en->export_name);
30444|      0|                goto fail;
30445|      0|            }
30446|      0|            en->export_type = EXPORTED_NAME_AMBIGUOUS;
30447|  1.07k|        } else {
30448|  1.07k|            if (res_me->local_name == JS_ATOM__star_) {
  ------------------
  |  Branch (30448:17): [True: 0, False: 1.07k]
  ------------------
30449|      0|                en->export_type = EXPORTED_NAME_DELAYED;
30450|  1.07k|            } else {
30451|  1.07k|                if (res_me->u.local.var_ref) {
  ------------------
  |  Branch (30451:21): [True: 1.07k, False: 0]
  ------------------
30452|  1.07k|                    en->u.var_ref = res_me->u.local.var_ref;
30453|  1.07k|                } else {
30454|      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)
  |  |  ------------------
  ------------------
30455|      0|                    en->u.var_ref = p1->u.func.var_refs[res_me->u.local.var_idx];
30456|      0|                }
30457|  1.07k|                if (en->u.var_ref == NULL)
  ------------------
  |  Branch (30457:21): [True: 0, False: 1.07k]
  ------------------
30458|      0|                    en->export_type = EXPORTED_NAME_DELAYED;
30459|  1.07k|                else
30460|  1.07k|                    en->export_type = EXPORTED_NAME_NORMAL;
30461|  1.07k|            }
30462|  1.07k|        }
30463|  1.07k|    }
30464|       |
30465|       |    /* sort the exported names */
30466|     22|    rqsort(s->exported_names, s->exported_names_count,
30467|     22|           sizeof(s->exported_names[0]), exported_names_cmp, ctx);
30468|       |
30469|  1.10k|    for(i = 0; i < s->exported_names_count; i++) {
  ------------------
  |  Branch (30469:16): [True: 1.07k, False: 22]
  ------------------
30470|  1.07k|        ExportedNameEntry *en = &s->exported_names[i];
30471|  1.07k|        switch(en->export_type) {
30472|  1.07k|        case EXPORTED_NAME_NORMAL:
  ------------------
  |  Branch (30472:9): [True: 1.07k, False: 0]
  ------------------
30473|  1.07k|            {
30474|  1.07k|                JSVarRef *var_ref = en->u.var_ref;
30475|  1.07k|                pr = add_property(ctx, p, en->export_name,
30476|  1.07k|                                  JS_PROP_ENUMERABLE | JS_PROP_WRITABLE |
  ------------------
  |  |  300|  1.07k|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                                                JS_PROP_ENUMERABLE | JS_PROP_WRITABLE |
  ------------------
  |  |  299|  1.07k|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
30477|  1.07k|                                  JS_PROP_VARREF);
  ------------------
  |  |  306|  1.07k|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
30478|  1.07k|                if (!pr)
  ------------------
  |  Branch (30478:21): [True: 0, False: 1.07k]
  ------------------
30479|      0|                    goto fail;
30480|  1.07k|                js_rc(var_ref)->ref_count++;
30481|  1.07k|                pr->u.var_ref = var_ref;
30482|  1.07k|            }
30483|      0|            break;
30484|      0|        case EXPORTED_NAME_DELAYED:
  ------------------
  |  Branch (30484:9): [True: 0, False: 1.07k]
  ------------------
30485|       |            /* the exported namespace or reference may depend on
30486|       |               circular references, so we resolve it lazily */
30487|      0|            if (JS_DefineAutoInitProperty(ctx, obj,
  ------------------
  |  Branch (30487:17): [True: 0, False: 0]
  ------------------
30488|      0|                                          en->export_name,
30489|      0|                                          JS_AUTOINIT_ID_MODULE_NS,
30490|      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)
  ------------------
30491|      0|                goto fail;
30492|      0|            break;
30493|      0|        default:
  ------------------
  |  Branch (30493:9): [True: 0, False: 1.07k]
  ------------------
30494|      0|            break;
30495|  1.07k|        }
30496|  1.07k|    }
30497|       |
30498|     22|    js_free(ctx, s->exported_names);
30499|       |
30500|     22|    JS_DefinePropertyValue(ctx, obj, JS_ATOM_Symbol_toStringTag,
30501|     22|                           JS_AtomToString(ctx, JS_ATOM_Module),
30502|     22|                           0);
30503|       |
30504|     22|    p->extensible = FALSE;
30505|     22|    return obj;
30506|      0| fail:
30507|      0|    js_free(ctx, s->exported_names);
30508|      0|    JS_FreeValue(ctx, obj);
30509|      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 }
  |  |  ------------------
  ------------------
30510|     22|}
quickjs.c:get_exported_names:
30299|     22|{
30300|     22|    ExportedNameEntry *en;
30301|     22|    int i, j;
30302|       |
30303|       |    /* check circular reference */
30304|     22|    for(i = 0; i < s->modules_count; i++) {
  ------------------
  |  Branch (30304:16): [True: 0, False: 22]
  ------------------
30305|      0|        if (s->modules[i] == m)
  ------------------
  |  Branch (30305:13): [True: 0, False: 0]
  ------------------
30306|      0|            return 0;
30307|      0|    }
30308|     22|    if (js_resize_array(ctx, (void **)&s->modules, sizeof(s->modules[0]),
  ------------------
  |  Branch (30308:9): [True: 0, False: 22]
  ------------------
30309|     22|                        &s->modules_size, s->modules_count + 1))
30310|      0|        return -1;
30311|     22|    s->modules[s->modules_count++] = m;
30312|       |
30313|  1.10k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (30313:16): [True: 1.07k, False: 22]
  ------------------
30314|  1.07k|        JSExportEntry *me = &m->export_entries[i];
30315|  1.07k|        if (from_star && me->export_name == JS_ATOM_default)
  ------------------
  |  Branch (30315:13): [True: 0, False: 1.07k]
  |  Branch (30315:26): [True: 0, False: 0]
  ------------------
30316|      0|            continue;
30317|  1.07k|        j = find_exported_name(s, me->export_name);
30318|  1.07k|        if (j < 0) {
  ------------------
  |  Branch (30318:13): [True: 1.07k, False: 0]
  ------------------
30319|  1.07k|            if (js_resize_array(ctx, (void **)&s->exported_names, sizeof(s->exported_names[0]),
  ------------------
  |  Branch (30319:17): [True: 0, False: 1.07k]
  ------------------
30320|  1.07k|                                &s->exported_names_size,
30321|  1.07k|                                s->exported_names_count + 1))
30322|      0|                return -1;
30323|  1.07k|            en = &s->exported_names[s->exported_names_count++];
30324|  1.07k|            en->export_name = me->export_name;
30325|       |            /* avoid a second lookup for simple module exports */
30326|  1.07k|            if (from_star || me->export_type != JS_EXPORT_TYPE_LOCAL)
  ------------------
  |  Branch (30326:17): [True: 0, False: 1.07k]
  |  Branch (30326:30): [True: 0, False: 1.07k]
  ------------------
30327|      0|                en->u.me = NULL;
30328|  1.07k|            else
30329|  1.07k|                en->u.me = me;
30330|  1.07k|        } else {
30331|      0|            en = &s->exported_names[j];
30332|      0|            en->u.me = NULL;
30333|      0|        }
30334|  1.07k|    }
30335|     22|    for(i = 0; i < m->star_export_entries_count; i++) {
  ------------------
  |  Branch (30335:16): [True: 0, False: 22]
  ------------------
30336|      0|        JSStarExportEntry *se = &m->star_export_entries[i];
30337|      0|        JSModuleDef *m1;
30338|      0|        m1 = m->req_module_entries[se->req_module_idx].module;
30339|      0|        if (get_exported_names(ctx, s, m1, TRUE))
  ------------------
  |  Branch (30339:13): [True: 0, False: 0]
  ------------------
30340|      0|            return -1;
30341|      0|    }
30342|     22|    return 0;
30343|     22|}
quickjs.c:find_exported_name:
30287|  1.07k|{
30288|  1.07k|    int i;
30289|  32.2k|    for(i = 0; i < s->exported_names_count; i++) {
  ------------------
  |  Branch (30289:16): [True: 31.1k, False: 1.07k]
  ------------------
30290|  31.1k|        if (s->exported_names[i].export_name == name)
  ------------------
  |  Branch (30290:13): [True: 0, False: 31.1k]
  ------------------
30291|      0|            return i;
30292|  31.1k|    }
30293|  1.07k|    return -1;
30294|  1.07k|}
quickjs.c:exported_names_cmp:
30356|  5.34k|{
30357|  5.34k|    JSContext *ctx = opaque;
30358|  5.34k|    const ExportedNameEntry *me1 = p1;
30359|  5.34k|    const ExportedNameEntry *me2 = p2;
30360|  5.34k|    JSValue str1, str2;
30361|  5.34k|    int ret;
30362|       |
30363|       |    /* XXX: should avoid allocation memory in atom comparison */
30364|  5.34k|    str1 = JS_AtomToString(ctx, me1->export_name);
30365|  5.34k|    str2 = JS_AtomToString(ctx, me2->export_name);
30366|  5.34k|    if (JS_IsException(str1) || JS_IsException(str2)) {
  ------------------
  |  Branch (30366:9): [True: 0, False: 5.34k]
  |  Branch (30366:33): [True: 0, False: 5.34k]
  ------------------
30367|       |        /* XXX: raise an error ? */
30368|      0|        ret = 0;
30369|  5.34k|    } else {
30370|  5.34k|        ret = js_string_compare(ctx, JS_VALUE_GET_STRING(str1),
  ------------------
  |  |  230|  5.34k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  5.34k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30371|  5.34k|                                JS_VALUE_GET_STRING(str2));
  ------------------
  |  |  230|  5.34k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  5.34k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30372|  5.34k|    }
30373|  5.34k|    JS_FreeValue(ctx, str1);
30374|  5.34k|    JS_FreeValue(ctx, str2);
30375|  5.34k|    return ret;
30376|  5.34k|}
quickjs.c:js_class_has_bytecode:
 5864|     14|{
 5865|     14|    return (class_id == JS_CLASS_BYTECODE_FUNCTION ||
  ------------------
  |  Branch (5865:13): [True: 14, False: 0]
  ------------------
 5866|      0|            class_id == JS_CLASS_GENERATOR_FUNCTION ||
  ------------------
  |  Branch (5866:13): [True: 0, False: 0]
  ------------------
 5867|      0|            class_id == JS_CLASS_ASYNC_FUNCTION ||
  ------------------
  |  Branch (5867:13): [True: 0, False: 0]
  ------------------
 5868|      0|            class_id == JS_CLASS_ASYNC_GENERATOR_FUNCTION);
  ------------------
  |  Branch (5868:13): [True: 0, False: 0]
  ------------------
 5869|     14|}
quickjs.c:js_host_resolve_imported_module:
30016|     22|{
30017|     22|    JSRuntime *rt = ctx->rt;
30018|     22|    JSModuleDef *m;
30019|     22|    char *cname;
30020|     22|    JSAtom module_name;
30021|       |
30022|     22|    if (!rt->module_normalize_func) {
  ------------------
  |  Branch (30022:9): [True: 22, False: 0]
  ------------------
30023|     22|        cname = js_default_module_normalize_name(ctx, base_cname, cname1);
30024|     22|    } else {
30025|      0|        cname = rt->module_normalize_func(ctx, base_cname, cname1,
30026|      0|                                          rt->module_loader_opaque);
30027|      0|    }
30028|     22|    if (!cname)
  ------------------
  |  Branch (30028:9): [True: 0, False: 22]
  ------------------
30029|      0|        return NULL;
30030|       |
30031|     22|    module_name = JS_NewAtom(ctx, cname);
30032|     22|    if (module_name == JS_ATOM_NULL) {
  ------------------
  |  |  451|     22|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (30032:9): [True: 0, False: 22]
  ------------------
30033|      0|        js_free(ctx, cname);
30034|      0|        return NULL;
30035|      0|    }
30036|       |
30037|       |    /* first look at the loaded modules */
30038|     22|    m = js_find_loaded_module(ctx, module_name);
30039|     22|    if (m) {
  ------------------
  |  Branch (30039:9): [True: 22, False: 0]
  ------------------
30040|     22|        js_free(ctx, cname);
30041|     22|        JS_FreeAtom(ctx, module_name);
30042|     22|        return m;
30043|     22|    }
30044|       |
30045|      0|    JS_FreeAtom(ctx, module_name);
30046|       |
30047|       |    /* load the module */
30048|      0|    if (!rt->u.module_loader_func) {
  ------------------
  |  Branch (30048:9): [True: 0, False: 0]
  ------------------
30049|       |        /* XXX: use a syntax error ? */
30050|      0|        JS_ThrowReferenceError(ctx, "could not load module '%s'",
30051|      0|                               cname);
30052|      0|        js_free(ctx, cname);
30053|      0|        return NULL;
30054|      0|    }
30055|      0|    if (rt->module_loader_has_attr) {
  ------------------
  |  Branch (30055:9): [True: 0, False: 0]
  ------------------
30056|      0|        m = rt->u.module_loader_func2(ctx, cname, rt->module_loader_opaque, attributes);
30057|      0|    } else {
30058|      0|        m = rt->u.module_loader_func(ctx, cname, rt->module_loader_opaque);
30059|      0|    }
30060|      0|    js_free(ctx, cname);
30061|      0|    return m;
30062|      0|}
quickjs.c:js_default_module_normalize_name:
29941|     22|{
29942|     22|    char *filename, *p;
29943|     22|    const char *r;
29944|     22|    int cap;
29945|     22|    int len;
29946|       |
29947|     22|    if (name[0] != '.') {
  ------------------
  |  Branch (29947:9): [True: 22, False: 0]
  ------------------
29948|       |        /* if no initial dot, the module name is not modified */
29949|     22|        return js_strdup(ctx, name);
29950|     22|    }
29951|       |
29952|      0|    p = strrchr(base_name, '/');
29953|      0|    if (p)
  ------------------
  |  Branch (29953:9): [True: 0, False: 0]
  ------------------
29954|      0|        len = p - base_name;
29955|      0|    else
29956|      0|        len = 0;
29957|       |
29958|      0|    cap = len + strlen(name) + 1 + 1;
29959|      0|    filename = js_malloc(ctx, cap);
29960|      0|    if (!filename)
  ------------------
  |  Branch (29960:9): [True: 0, False: 0]
  ------------------
29961|      0|        return NULL;
29962|      0|    memcpy(filename, base_name, len);
29963|      0|    filename[len] = '\0';
29964|       |
29965|       |    /* we only normalize the leading '..' or '.' */
29966|      0|    r = name;
29967|      0|    for(;;) {
29968|      0|        if (r[0] == '.' && r[1] == '/') {
  ------------------
  |  Branch (29968:13): [True: 0, False: 0]
  |  Branch (29968:28): [True: 0, False: 0]
  ------------------
29969|      0|            r += 2;
29970|      0|        } else if (r[0] == '.' && r[1] == '.' && r[2] == '/') {
  ------------------
  |  Branch (29970:20): [True: 0, False: 0]
  |  Branch (29970:35): [True: 0, False: 0]
  |  Branch (29970:50): [True: 0, False: 0]
  ------------------
29971|       |            /* remove the last path element of filename, except if "."
29972|       |               or ".." */
29973|      0|            if (filename[0] == '\0')
  ------------------
  |  Branch (29973:17): [True: 0, False: 0]
  ------------------
29974|      0|                break;
29975|      0|            p = strrchr(filename, '/');
29976|      0|            if (!p)
  ------------------
  |  Branch (29976:17): [True: 0, False: 0]
  ------------------
29977|      0|                p = filename;
29978|      0|            else
29979|      0|                p++;
29980|      0|            if (!strcmp(p, ".") || !strcmp(p, ".."))
  ------------------
  |  Branch (29980:17): [True: 0, False: 0]
  |  Branch (29980:36): [True: 0, False: 0]
  ------------------
29981|      0|                break;
29982|      0|            if (p > filename)
  ------------------
  |  Branch (29982:17): [True: 0, False: 0]
  ------------------
29983|      0|                p--;
29984|      0|            *p = '\0';
29985|      0|            r += 3;
29986|      0|        } else {
29987|      0|            break;
29988|      0|        }
29989|      0|    }
29990|      0|    if (filename[0] != '\0')
  ------------------
  |  Branch (29990:9): [True: 0, False: 0]
  ------------------
29991|      0|        pstrcat(filename, cap, "/");
29992|      0|    pstrcat(filename, cap, r);
29993|       |    //    printf("normalize: %s %s -> %s\n", base_name, name, filename);
29994|      0|    return filename;
29995|      0|}
quickjs.c:JS_NewModuleValue:
30930|     11|{
30931|     11|    return JS_DupValue(ctx, JS_MKPTR(JS_TAG_MODULE, m));
  ------------------
  |  |  248|     11|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
30932|     11|}
quickjs.c:JS_EvalFunctionInternal:
37151|     18|{
37152|     18|    JSValue ret_val;
37153|     18|    uint32_t tag;
37154|       |
37155|     18|    tag = JS_VALUE_GET_TAG(fun_obj);
  ------------------
  |  |  236|     18|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
37156|     18|    if (tag == JS_TAG_FUNCTION_BYTECODE) {
  ------------------
  |  Branch (37156:9): [True: 7, False: 11]
  ------------------
37157|      7|        fun_obj = js_closure(ctx, fun_obj, var_refs, sf, TRUE);
37158|      7|        if (JS_IsException(fun_obj))
  ------------------
  |  Branch (37158:13): [True: 0, False: 7]
  ------------------
37159|      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 }
  |  |  ------------------
  ------------------
37160|      7|        ret_val = JS_CallFree(ctx, fun_obj, this_obj, 0, NULL);
37161|     11|    } else if (tag == JS_TAG_MODULE) {
  ------------------
  |  Branch (37161:16): [True: 11, False: 0]
  ------------------
37162|     11|        JSModuleDef *m;
37163|     11|        m = JS_VALUE_GET_PTR(fun_obj);
  ------------------
  |  |  243|     11|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
37164|       |        /* the module refcount should be >= 2 */
37165|     11|        JS_FreeValue(ctx, fun_obj);
37166|     11|        if (js_create_module_function(ctx, m) < 0)
  ------------------
  |  Branch (37166:13): [True: 0, False: 11]
  ------------------
37167|      0|            goto fail;
37168|     11|        if (js_link_module(ctx, m) < 0)
  ------------------
  |  Branch (37168:13): [True: 0, False: 11]
  ------------------
37169|      0|            goto fail;
37170|     11|        ret_val = js_evaluate_module(ctx, m);
37171|     11|        if (JS_IsException(ret_val)) {
  ------------------
  |  Branch (37171:13): [True: 0, False: 11]
  ------------------
37172|      0|        fail:
37173|      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 }
  |  |  ------------------
  ------------------
37174|      0|        }
37175|     11|    } else {
37176|      0|        JS_FreeValue(ctx, fun_obj);
37177|      0|        ret_val = JS_ThrowTypeError(ctx, "bytecode function expected");
37178|      0|    }
37179|     18|    return ret_val;
37180|     18|}
quickjs.c:js_create_module_function:
30581|     33|{
30582|     33|    BOOL is_c_module;
30583|     33|    int i;
30584|     33|    JSVarRef *var_ref;
30585|       |
30586|     33|    if (m->func_created)
  ------------------
  |  Branch (30586:9): [True: 0, False: 33]
  ------------------
30587|      0|        return 0;
30588|       |
30589|     33|    is_c_module = (m->init_func != NULL);
30590|       |
30591|     33|    if (is_c_module) {
  ------------------
  |  Branch (30591:9): [True: 22, False: 11]
  ------------------
30592|       |        /* initialize the exported variables */
30593|  1.10k|        for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (30593:20): [True: 1.07k, False: 22]
  ------------------
30594|  1.07k|            JSExportEntry *me = &m->export_entries[i];
30595|  1.07k|            if (me->export_type == JS_EXPORT_TYPE_LOCAL) {
  ------------------
  |  Branch (30595:17): [True: 1.07k, False: 0]
  ------------------
30596|  1.07k|                var_ref = js_create_var_ref(ctx, FALSE);
30597|  1.07k|                if (!var_ref)
  ------------------
  |  Branch (30597:21): [True: 0, False: 1.07k]
  ------------------
30598|      0|                    return -1;
30599|  1.07k|                me->u.local.var_ref = var_ref;
30600|  1.07k|            }
30601|  1.07k|        }
30602|     22|    } else {
30603|     11|        if (js_create_module_bytecode_function(ctx, m))
  ------------------
  |  Branch (30603:13): [True: 0, False: 11]
  ------------------
30604|      0|            return -1;
30605|     11|    }
30606|     33|    m->func_created = TRUE;
30607|       |
30608|       |    /* do it on the dependencies */
30609|       |
30610|     55|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (30610:16): [True: 22, False: 33]
  ------------------
30611|     22|        JSReqModuleEntry *rme = &m->req_module_entries[i];
30612|     22|        if (js_create_module_function(ctx, rme->module) < 0)
  ------------------
  |  Branch (30612:13): [True: 0, False: 22]
  ------------------
30613|      0|            return -1;
30614|     22|    }
30615|       |
30616|     33|    return 0;
30617|     33|}
quickjs.c:js_create_module_bytecode_function:
30558|     11|{
30559|     11|    JSFunctionBytecode *b;
30560|     11|    JSValue func_obj, bfunc;
30561|       |
30562|     11|    bfunc = m->func_obj;
30563|     11|    func_obj = JS_NewObjectProtoClass(ctx, ctx->function_proto,
30564|     11|                                      JS_CLASS_BYTECODE_FUNCTION);
30565|       |
30566|     11|    if (JS_IsException(func_obj))
  ------------------
  |  Branch (30566:9): [True: 0, False: 11]
  ------------------
30567|      0|        return -1;
30568|     11|    m->func_obj = func_obj;
30569|     11|    b = JS_VALUE_GET_PTR(bfunc);
  ------------------
  |  |  243|     11|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
30570|     11|    func_obj = js_closure2(ctx, func_obj, b, NULL, NULL, TRUE, m);
30571|     11|    if (JS_IsException(func_obj)) {
  ------------------
  |  Branch (30571:9): [True: 0, False: 11]
  ------------------
30572|      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 }
  |  |  ------------------
  ------------------
30573|      0|        JS_FreeValue(ctx, func_obj);
30574|      0|        return -1;
30575|      0|    }
30576|     11|    return 0;
30577|     11|}
quickjs.c:js_link_module:
30822|     11|{
30823|     11|    JSModuleDef *stack_top, *m1;
30824|       |
30825|       |#ifdef DUMP_MODULE_RESOLVE
30826|       |    {
30827|       |        char buf1[ATOM_GET_STR_BUF_SIZE];
30828|       |        printf("js_link_module '%s':\n", JS_AtomGetStr(ctx, buf1, sizeof(buf1), m->module_name));
30829|       |    }
30830|       |#endif
30831|     11|    assert(m->status == JS_MODULE_STATUS_UNLINKED ||
  ------------------
  |  Branch (30831:5): [True: 11, False: 0]
  |  Branch (30831:5): [True: 0, False: 0]
  |  Branch (30831:5): [True: 0, False: 0]
  |  Branch (30831:5): [True: 0, False: 0]
  |  Branch (30831:5): [True: 11, False: 0]
  |  Branch (30831:5): [True: 0, False: 0]
  |  Branch (30831:5): [True: 0, False: 0]
  |  Branch (30831:5): [True: 0, False: 0]
  ------------------
30832|     11|           m->status == JS_MODULE_STATUS_LINKED ||
30833|     11|           m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
30834|     11|           m->status == JS_MODULE_STATUS_EVALUATED);
30835|     11|    stack_top = NULL;
30836|     11|    if (js_inner_module_linking(ctx, m, &stack_top, 0) < 0) {
  ------------------
  |  Branch (30836:9): [True: 0, False: 11]
  ------------------
30837|      0|        while (stack_top != NULL) {
  ------------------
  |  Branch (30837:16): [True: 0, False: 0]
  ------------------
30838|      0|            m1 = stack_top;
30839|      0|            assert(m1->status == JS_MODULE_STATUS_LINKING);
  ------------------
  |  Branch (30839:13): [True: 0, False: 0]
  |  Branch (30839:13): [True: 0, False: 0]
  ------------------
30840|      0|            m1->status = JS_MODULE_STATUS_UNLINKED;
30841|      0|            stack_top = m1->stack_prev;
30842|      0|        }
30843|      0|        return -1;
30844|      0|    }
30845|     11|    assert(stack_top == NULL);
  ------------------
  |  Branch (30845:5): [True: 0, False: 11]
  |  Branch (30845:5): [True: 11, False: 0]
  ------------------
30846|     11|    assert(m->status == JS_MODULE_STATUS_LINKED ||
  ------------------
  |  Branch (30846:5): [True: 11, False: 0]
  |  Branch (30846:5): [True: 0, False: 0]
  |  Branch (30846:5): [True: 0, False: 0]
  |  Branch (30846:5): [True: 11, False: 0]
  |  Branch (30846:5): [True: 0, False: 0]
  |  Branch (30846:5): [True: 0, False: 0]
  ------------------
30847|     11|           m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
30848|     11|           m->status == JS_MODULE_STATUS_EVALUATED);
30849|     11|    return 0;
30850|     11|}
quickjs.c:js_inner_module_linking:
30624|     33|{
30625|     33|    int i;
30626|     33|    JSImportEntry *mi;
30627|     33|    JSModuleDef *m1;
30628|     33|    JSVarRef **var_refs, *var_ref;
30629|     33|    JSObject *p;
30630|     33|    BOOL is_c_module;
30631|     33|    JSValue ret_val;
30632|       |
30633|     33|    if (js_check_stack_overflow(ctx->rt, 0)) {
  ------------------
  |  Branch (30633:9): [True: 0, False: 33]
  ------------------
30634|      0|        JS_ThrowStackOverflow(ctx);
30635|      0|        return -1;
30636|      0|    }
30637|       |
30638|       |#ifdef DUMP_MODULE_RESOLVE
30639|       |    {
30640|       |        char buf1[ATOM_GET_STR_BUF_SIZE];
30641|       |        printf("js_inner_module_linking '%s':\n", JS_AtomGetStr(ctx, buf1, sizeof(buf1), m->module_name));
30642|       |    }
30643|       |#endif
30644|       |
30645|     33|    if (m->status == JS_MODULE_STATUS_LINKING ||
  ------------------
  |  Branch (30645:9): [True: 0, False: 33]
  ------------------
30646|     33|        m->status == JS_MODULE_STATUS_LINKED ||
  ------------------
  |  Branch (30646:9): [True: 0, False: 33]
  ------------------
30647|     33|        m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (30647:9): [True: 0, False: 33]
  ------------------
30648|     33|        m->status == JS_MODULE_STATUS_EVALUATED)
  ------------------
  |  Branch (30648:9): [True: 0, False: 33]
  ------------------
30649|      0|        return index;
30650|       |
30651|     33|    assert(m->status == JS_MODULE_STATUS_UNLINKED);
  ------------------
  |  Branch (30651:5): [True: 0, False: 33]
  |  Branch (30651:5): [True: 33, False: 0]
  ------------------
30652|     33|    m->status = JS_MODULE_STATUS_LINKING;
30653|     33|    m->dfs_index = index;
30654|     33|    m->dfs_ancestor_index = index;
30655|     33|    index++;
30656|       |    /* push 'm' on stack */
30657|     33|    m->stack_prev = *pstack_top;
30658|     33|    *pstack_top = m;
30659|       |
30660|     55|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (30660:16): [True: 22, False: 33]
  ------------------
30661|     22|        JSReqModuleEntry *rme = &m->req_module_entries[i];
30662|     22|        m1 = rme->module;
30663|     22|        index = js_inner_module_linking(ctx, m1, pstack_top, index);
30664|     22|        if (index < 0)
  ------------------
  |  Branch (30664:13): [True: 0, False: 22]
  ------------------
30665|      0|            goto fail;
30666|     22|        assert(m1->status == JS_MODULE_STATUS_LINKING ||
  ------------------
  |  Branch (30666:9): [True: 22, False: 0]
  |  Branch (30666:9): [True: 0, False: 0]
  |  Branch (30666:9): [True: 0, False: 0]
  |  Branch (30666:9): [True: 0, False: 0]
  |  Branch (30666:9): [True: 0, False: 22]
  |  Branch (30666:9): [True: 22, False: 0]
  |  Branch (30666:9): [True: 0, False: 0]
  |  Branch (30666:9): [True: 0, False: 0]
  ------------------
30667|     22|               m1->status == JS_MODULE_STATUS_LINKED ||
30668|     22|               m1->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
30669|     22|               m1->status == JS_MODULE_STATUS_EVALUATED);
30670|     22|        if (m1->status == JS_MODULE_STATUS_LINKING) {
  ------------------
  |  Branch (30670:13): [True: 0, False: 22]
  ------------------
30671|      0|            m->dfs_ancestor_index = min_int(m->dfs_ancestor_index,
30672|      0|                                            m1->dfs_ancestor_index);
30673|      0|        }
30674|     22|    }
30675|       |
30676|       |#ifdef DUMP_MODULE_RESOLVE
30677|       |    {
30678|       |        char buf1[ATOM_GET_STR_BUF_SIZE];
30679|       |        printf("instantiating module '%s':\n", JS_AtomGetStr(ctx, buf1, sizeof(buf1), m->module_name));
30680|       |    }
30681|       |#endif
30682|       |    /* check the indirect exports */
30683|  1.11k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (30683:16): [True: 1.07k, False: 33]
  ------------------
30684|  1.07k|        JSExportEntry *me = &m->export_entries[i];
30685|  1.07k|        if (me->export_type == JS_EXPORT_TYPE_INDIRECT &&
  ------------------
  |  Branch (30685:13): [True: 0, False: 1.07k]
  ------------------
30686|      0|            me->local_name != JS_ATOM__star_) {
  ------------------
  |  Branch (30686:13): [True: 0, False: 0]
  ------------------
30687|      0|            JSResolveResultEnum ret;
30688|      0|            JSExportEntry *res_me;
30689|      0|            JSModuleDef *res_m, *m1;
30690|      0|            m1 = m->req_module_entries[me->u.req_module_idx].module;
30691|      0|            ret = js_resolve_export(ctx, &res_m, &res_me, m1, me->local_name);
30692|      0|            if (ret != JS_RESOLVE_RES_FOUND) {
  ------------------
  |  Branch (30692:17): [True: 0, False: 0]
  ------------------
30693|      0|                js_resolve_export_throw_error(ctx, ret, m, me->export_name);
30694|      0|                goto fail;
30695|      0|            }
30696|      0|        }
30697|  1.07k|    }
30698|       |
30699|       |#ifdef DUMP_MODULE_RESOLVE
30700|       |    {
30701|       |        printf("exported bindings:\n");
30702|       |        for(i = 0; i < m->export_entries_count; i++) {
30703|       |            JSExportEntry *me = &m->export_entries[i];
30704|       |            printf(" name="); print_atom(ctx, me->export_name);
30705|       |            printf(" local="); print_atom(ctx, me->local_name);
30706|       |            printf(" type=%d idx=%d\n", me->export_type, me->u.local.var_idx);
30707|       |        }
30708|       |    }
30709|       |#endif
30710|       |
30711|     33|    is_c_module = (m->init_func != NULL);
30712|       |
30713|     33|    if (!is_c_module) {
  ------------------
  |  Branch (30713:9): [True: 11, False: 22]
  ------------------
30714|     11|        p = JS_VALUE_GET_OBJ(m->func_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)
  |  |  ------------------
  ------------------
30715|     11|        var_refs = p->u.func.var_refs;
30716|       |
30717|     33|        for(i = 0; i < m->import_entries_count; i++) {
  ------------------
  |  Branch (30717:20): [True: 22, False: 11]
  ------------------
30718|     22|            mi = &m->import_entries[i];
30719|       |#ifdef DUMP_MODULE_RESOLVE
30720|       |            printf("import var_idx=%d name=", mi->var_idx);
30721|       |            print_atom(ctx, mi->import_name);
30722|       |            printf(": ");
30723|       |#endif
30724|     22|            m1 = m->req_module_entries[mi->req_module_idx].module;
30725|     22|            if (mi->is_star) {
  ------------------
  |  Branch (30725:17): [True: 22, False: 0]
  ------------------
30726|     22|                JSValue val;
30727|       |                /* name space import */
30728|     22|                val = JS_GetModuleNamespace(ctx, m1);
30729|     22|                if (JS_IsException(val))
  ------------------
  |  Branch (30729:21): [True: 0, False: 22]
  ------------------
30730|      0|                    goto fail;
30731|     22|                set_value(ctx, &var_refs[mi->var_idx]->value, val);
30732|       |#ifdef DUMP_MODULE_RESOLVE
30733|       |                printf("namespace\n");
30734|       |#endif
30735|     22|            } else {
30736|      0|                JSResolveResultEnum ret;
30737|      0|                JSExportEntry *res_me;
30738|      0|                JSModuleDef *res_m;
30739|      0|                JSObject *p1;
30740|       |
30741|      0|                ret = js_resolve_export(ctx, &res_m,
30742|      0|                                        &res_me, m1, mi->import_name);
30743|      0|                if (ret != JS_RESOLVE_RES_FOUND) {
  ------------------
  |  Branch (30743:21): [True: 0, False: 0]
  ------------------
30744|      0|                    js_resolve_export_throw_error(ctx, ret, m1, mi->import_name);
30745|      0|                    goto fail;
30746|      0|                }
30747|      0|                if (res_me->local_name == JS_ATOM__star_) {
  ------------------
  |  Branch (30747:21): [True: 0, False: 0]
  ------------------
30748|      0|                    JSValue val;
30749|      0|                    JSModuleDef *m2;
30750|       |                    /* name space import from */
30751|      0|                    m2 = res_m->req_module_entries[res_me->u.req_module_idx].module;
30752|      0|                    val = JS_GetModuleNamespace(ctx, m2);
30753|      0|                    if (JS_IsException(val))
  ------------------
  |  Branch (30753:25): [True: 0, False: 0]
  ------------------
30754|      0|                        goto fail;
30755|      0|                    var_ref = js_create_var_ref(ctx, TRUE);
30756|      0|                    if (!var_ref) {
  ------------------
  |  Branch (30756:25): [True: 0, False: 0]
  ------------------
30757|      0|                        JS_FreeValue(ctx, val);
30758|      0|                        goto fail;
30759|      0|                    }
30760|      0|                    set_value(ctx, &var_ref->value, val);
30761|      0|                    var_refs[mi->var_idx] = var_ref;
30762|       |#ifdef DUMP_MODULE_RESOLVE
30763|       |                    printf("namespace from\n");
30764|       |#endif
30765|      0|                } else {
30766|      0|                    var_ref = res_me->u.local.var_ref;
30767|      0|                    if (!var_ref) {
  ------------------
  |  Branch (30767:25): [True: 0, False: 0]
  ------------------
30768|      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)
  |  |  ------------------
  ------------------
30769|      0|                        var_ref = p1->u.func.var_refs[res_me->u.local.var_idx];
30770|      0|                    }
30771|      0|                    js_rc(var_ref)->ref_count++;
30772|      0|                    var_refs[mi->var_idx] = var_ref;
30773|       |#ifdef DUMP_MODULE_RESOLVE
30774|       |                    printf("local export (var_ref=%p)\n", var_ref);
30775|       |#endif
30776|      0|                }
30777|      0|            }
30778|     22|        }
30779|       |
30780|       |        /* keep the exported variables in the module export entries (they
30781|       |           are used when the eval function is deleted and cannot be
30782|       |           initialized before in case imports are exported) */
30783|     11|        for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (30783:20): [True: 0, False: 11]
  ------------------
30784|      0|            JSExportEntry *me = &m->export_entries[i];
30785|      0|            if (me->export_type == JS_EXPORT_TYPE_LOCAL) {
  ------------------
  |  Branch (30785:17): [True: 0, False: 0]
  ------------------
30786|      0|                var_ref = var_refs[me->u.local.var_idx];
30787|      0|                js_rc(var_ref)->ref_count++;
30788|      0|                me->u.local.var_ref = var_ref;
30789|      0|            }
30790|      0|        }
30791|       |
30792|       |        /* initialize the global variables */
30793|     11|        ret_val = JS_Call(ctx, m->func_obj, JS_TRUE, 0, NULL);
  ------------------
  |  |  293|     11|#define JS_TRUE      JS_MKVAL(JS_TAG_BOOL, 1)
  |  |  ------------------
  |  |  |  |  247|     11|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
30794|     11|        if (JS_IsException(ret_val))
  ------------------
  |  Branch (30794:13): [True: 0, False: 11]
  ------------------
30795|      0|            goto fail;
30796|     11|        JS_FreeValue(ctx, ret_val);
30797|     11|    }
30798|       |
30799|     33|    assert(m->dfs_ancestor_index <= m->dfs_index);
  ------------------
  |  Branch (30799:5): [True: 0, False: 33]
  |  Branch (30799:5): [True: 33, False: 0]
  ------------------
30800|     33|    if (m->dfs_index == m->dfs_ancestor_index) {
  ------------------
  |  Branch (30800:9): [True: 33, False: 0]
  ------------------
30801|     33|        for(;;) {
30802|       |            /* pop m1 from stack */
30803|     33|            m1 = *pstack_top;
30804|     33|            *pstack_top = m1->stack_prev;
30805|     33|            m1->status = JS_MODULE_STATUS_LINKED;
30806|     33|            if (m1 == m)
  ------------------
  |  Branch (30806:17): [True: 33, False: 0]
  ------------------
30807|     33|                break;
30808|     33|        }
30809|     33|    }
30810|       |
30811|       |#ifdef DUMP_MODULE_RESOLVE
30812|       |    printf("js_inner_module_linking done\n");
30813|       |#endif
30814|     33|    return index;
30815|      0| fail:
30816|      0|    return -1;
30817|     33|}
quickjs.c:js_evaluate_module:
31536|     11|{
31537|     11|    JSModuleDef *m1, *stack_top;
31538|     11|    JSValue ret_val, result;
31539|       |
31540|       |#ifdef DUMP_MODULE_EXEC
31541|       |    js_dump_module(ctx, __func__, m);
31542|       |#endif
31543|     11|    assert(m->status == JS_MODULE_STATUS_LINKED ||
  ------------------
  |  Branch (31543:5): [True: 11, False: 0]
  |  Branch (31543:5): [True: 0, False: 0]
  |  Branch (31543:5): [True: 0, False: 0]
  |  Branch (31543:5): [True: 11, False: 0]
  |  Branch (31543:5): [True: 0, False: 0]
  |  Branch (31543:5): [True: 0, False: 0]
  ------------------
31544|     11|           m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
31545|     11|           m->status == JS_MODULE_STATUS_EVALUATED);
31546|     11|    if (m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (31546:9): [True: 0, False: 11]
  ------------------
31547|     11|        m->status == JS_MODULE_STATUS_EVALUATED) {
  ------------------
  |  Branch (31547:9): [True: 0, False: 11]
  ------------------
31548|      0|        m = m->cycle_root;
31549|      0|    }
31550|       |    /* a promise may be created only on the cycle_root of a cycle */
31551|     11|    if (!JS_IsUndefined(m->promise))
  ------------------
  |  Branch (31551:9): [True: 0, False: 11]
  ------------------
31552|      0|        return JS_DupValue(ctx, m->promise);
31553|     11|    m->promise = JS_NewPromiseCapability(ctx, m->resolving_funcs);
31554|     11|    if (JS_IsException(m->promise))
  ------------------
  |  Branch (31554:9): [True: 0, False: 11]
  ------------------
31555|      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 }
  |  |  ------------------
  ------------------
31556|       |
31557|     11|    stack_top = NULL;
31558|     11|    if (js_inner_module_evaluation(ctx, m, 0, &stack_top, &result) < 0) {
  ------------------
  |  Branch (31558:9): [True: 0, False: 11]
  ------------------
31559|      0|        while (stack_top != NULL) {
  ------------------
  |  Branch (31559:16): [True: 0, False: 0]
  ------------------
31560|      0|            m1 = stack_top;
31561|      0|            assert(m1->status == JS_MODULE_STATUS_EVALUATING);
  ------------------
  |  Branch (31561:13): [True: 0, False: 0]
  |  Branch (31561:13): [True: 0, False: 0]
  ------------------
31562|      0|            m1->status = JS_MODULE_STATUS_EVALUATED;
31563|      0|            m1->eval_has_exception = TRUE;
31564|      0|            m1->eval_exception = JS_DupValue(ctx, result);
31565|      0|            m1->cycle_root = m; /* spec bug: should be present */
31566|      0|            stack_top = m1->stack_prev;
31567|      0|        }
31568|      0|        JS_FreeValue(ctx, result);
31569|      0|        assert(m->status == JS_MODULE_STATUS_EVALUATED);
  ------------------
  |  Branch (31569:9): [True: 0, False: 0]
  |  Branch (31569:9): [True: 0, False: 0]
  ------------------
31570|      0|        assert(m->eval_has_exception);
  ------------------
  |  Branch (31570:9): [True: 0, False: 0]
  |  Branch (31570:9): [True: 0, False: 0]
  ------------------
31571|      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 }
  |  |  ------------------
  ------------------
31572|      0|                          1, (JSValueConst *)&m->eval_exception);
31573|      0|        JS_FreeValue(ctx, ret_val);
31574|     11|    } else {
31575|       |#ifdef DUMP_MODULE_EXEC
31576|       |        js_dump_module(ctx, "  done", m);
31577|       |#endif
31578|     11|        assert(m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (31578:9): [True: 11, False: 0]
  |  Branch (31578:9): [True: 0, False: 0]
  |  Branch (31578:9): [True: 0, False: 11]
  |  Branch (31578:9): [True: 11, False: 0]
  ------------------
31579|     11|               m->status == JS_MODULE_STATUS_EVALUATED);
31580|     11|        assert(!m->eval_has_exception);
  ------------------
  |  Branch (31580:9): [True: 0, False: 11]
  |  Branch (31580:9): [True: 11, False: 0]
  ------------------
31581|     11|        if (!m->async_evaluation) {
  ------------------
  |  Branch (31581:13): [True: 11, False: 0]
  ------------------
31582|     11|            JSValue value;
31583|     11|            assert(m->status == JS_MODULE_STATUS_EVALUATED);
  ------------------
  |  Branch (31583:13): [True: 0, False: 11]
  |  Branch (31583:13): [True: 11, False: 0]
  ------------------
31584|     11|            value = 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 }
  |  |  ------------------
  ------------------
31585|     11|            ret_val = JS_Call(ctx, m->resolving_funcs[0], 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 }
  |  |  ------------------
  ------------------
31586|     11|                              1, (JSValueConst *)&value);
31587|     11|            JS_FreeValue(ctx, ret_val);
31588|     11|        }
31589|     11|        assert(stack_top == NULL);
  ------------------
  |  Branch (31589:9): [True: 0, False: 11]
  |  Branch (31589:9): [True: 11, False: 0]
  ------------------
31590|     11|    }
31591|     11|    return JS_DupValue(ctx, m->promise);
31592|     11|}
quickjs.c:js_inner_module_evaluation:
31426|     33|{
31427|     33|    JSModuleDef *m1;
31428|     33|    int i;
31429|       |
31430|       |#ifdef DUMP_MODULE_EXEC
31431|       |    js_dump_module(ctx, __func__, m);
31432|       |#endif
31433|       |
31434|     33|    if (js_check_stack_overflow(ctx->rt, 0)) {
  ------------------
  |  Branch (31434:9): [True: 0, False: 33]
  ------------------
31435|      0|        JS_ThrowStackOverflow(ctx);
31436|      0|        *pvalue = JS_GetException(ctx);
31437|      0|        return -1;
31438|      0|    }
31439|       |
31440|     33|    if (m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (31440:9): [True: 0, False: 33]
  ------------------
31441|     33|        m->status == JS_MODULE_STATUS_EVALUATED) {
  ------------------
  |  Branch (31441:9): [True: 0, False: 33]
  ------------------
31442|      0|        if (m->eval_has_exception) {
  ------------------
  |  Branch (31442:13): [True: 0, False: 0]
  ------------------
31443|      0|            *pvalue = JS_DupValue(ctx, m->eval_exception);
31444|      0|            return -1;
31445|      0|        } else {
31446|      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 }
  |  |  ------------------
  ------------------
31447|      0|            return index;
31448|      0|        }
31449|      0|    }
31450|     33|    if (m->status == JS_MODULE_STATUS_EVALUATING) {
  ------------------
  |  Branch (31450:9): [True: 0, False: 33]
  ------------------
31451|      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 }
  |  |  ------------------
  ------------------
31452|      0|        return index;
31453|      0|    }
31454|     33|    assert(m->status == JS_MODULE_STATUS_LINKED);
  ------------------
  |  Branch (31454:5): [True: 0, False: 33]
  |  Branch (31454:5): [True: 33, False: 0]
  ------------------
31455|       |
31456|     33|    m->status = JS_MODULE_STATUS_EVALUATING;
31457|     33|    m->dfs_index = index;
31458|     33|    m->dfs_ancestor_index = index;
31459|     33|    m->pending_async_dependencies = 0;
31460|     33|    index++;
31461|       |    /* push 'm' on stack */
31462|     33|    m->stack_prev = *pstack_top;
31463|     33|    *pstack_top = m;
31464|       |
31465|     55|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (31465:16): [True: 22, False: 33]
  ------------------
31466|     22|        JSReqModuleEntry *rme = &m->req_module_entries[i];
31467|     22|        m1 = rme->module;
31468|     22|        index = js_inner_module_evaluation(ctx, m1, index, pstack_top, pvalue);
31469|     22|        if (index < 0)
  ------------------
  |  Branch (31469:13): [True: 0, False: 22]
  ------------------
31470|      0|            return -1;
31471|     22|        assert(m1->status == JS_MODULE_STATUS_EVALUATING ||
  ------------------
  |  Branch (31471:9): [True: 22, False: 0]
  |  Branch (31471:9): [True: 0, False: 0]
  |  Branch (31471:9): [True: 0, False: 0]
  |  Branch (31471:9): [True: 0, False: 22]
  |  Branch (31471:9): [True: 0, False: 22]
  |  Branch (31471:9): [True: 22, False: 0]
  ------------------
31472|     22|               m1->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
31473|     22|               m1->status == JS_MODULE_STATUS_EVALUATED);
31474|     22|        if (m1->status == JS_MODULE_STATUS_EVALUATING) {
  ------------------
  |  Branch (31474:13): [True: 0, False: 22]
  ------------------
31475|      0|            m->dfs_ancestor_index = min_int(m->dfs_ancestor_index,
31476|      0|                                            m1->dfs_ancestor_index);
31477|     22|        } else {
31478|     22|            m1 = m1->cycle_root;
31479|     22|            assert(m1->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (31479:13): [True: 22, False: 0]
  |  Branch (31479:13): [True: 0, False: 0]
  |  Branch (31479:13): [True: 0, False: 22]
  |  Branch (31479:13): [True: 22, False: 0]
  ------------------
31480|     22|                   m1->status == JS_MODULE_STATUS_EVALUATED);
31481|     22|            if (m1->eval_has_exception) {
  ------------------
  |  Branch (31481:17): [True: 0, False: 22]
  ------------------
31482|      0|                *pvalue = JS_DupValue(ctx, m1->eval_exception);
31483|      0|                return -1;
31484|      0|            }
31485|     22|        }
31486|     22|        if (m1->async_evaluation) {
  ------------------
  |  Branch (31486:13): [True: 0, False: 22]
  ------------------
31487|      0|            m->pending_async_dependencies++;
31488|      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 (31488:17): [True: 0, False: 0]
  ------------------
31489|      0|                *pvalue = JS_GetException(ctx);
31490|      0|                return -1;
31491|      0|            }
31492|      0|            m1->async_parent_modules[m1->async_parent_modules_count++] = m;
31493|      0|        }
31494|     22|    }
31495|       |
31496|     33|    if (m->pending_async_dependencies > 0) {
  ------------------
  |  Branch (31496:9): [True: 0, False: 33]
  ------------------
31497|      0|        assert(!m->async_evaluation);
  ------------------
  |  Branch (31497:9): [True: 0, False: 0]
  |  Branch (31497:9): [True: 0, False: 0]
  ------------------
31498|      0|        m->async_evaluation = TRUE;
31499|      0|        m->async_evaluation_timestamp =
31500|      0|            ctx->rt->module_async_evaluation_next_timestamp++;
31501|     33|    } else if (m->has_tla) {
  ------------------
  |  Branch (31501:16): [True: 0, False: 33]
  ------------------
31502|      0|        assert(!m->async_evaluation);
  ------------------
  |  Branch (31502:9): [True: 0, False: 0]
  |  Branch (31502:9): [True: 0, False: 0]
  ------------------
31503|      0|        m->async_evaluation = TRUE;
31504|      0|        m->async_evaluation_timestamp =
31505|      0|            ctx->rt->module_async_evaluation_next_timestamp++;
31506|      0|        js_execute_async_module(ctx, m);
31507|     33|    } else {
31508|     33|        if (js_execute_sync_module(ctx, m, pvalue) < 0)
  ------------------
  |  Branch (31508:13): [True: 0, False: 33]
  ------------------
31509|      0|            return -1;
31510|     33|    }
31511|       |
31512|     33|    assert(m->dfs_ancestor_index <= m->dfs_index);
  ------------------
  |  Branch (31512:5): [True: 0, False: 33]
  |  Branch (31512:5): [True: 33, False: 0]
  ------------------
31513|     33|    if (m->dfs_index == m->dfs_ancestor_index) {
  ------------------
  |  Branch (31513:9): [True: 33, False: 0]
  ------------------
31514|     33|        for(;;) {
31515|       |            /* pop m1 from stack */
31516|     33|            m1 = *pstack_top;
31517|     33|            *pstack_top = m1->stack_prev;
31518|     33|            if (!m1->async_evaluation) {
  ------------------
  |  Branch (31518:17): [True: 33, False: 0]
  ------------------
31519|     33|                m1->status = JS_MODULE_STATUS_EVALUATED;
31520|     33|            } else {
31521|      0|                m1->status = JS_MODULE_STATUS_EVALUATING_ASYNC;
31522|      0|            }
31523|       |            /* spec bug: cycle_root must be assigned before the test */
31524|     33|            m1->cycle_root = m;
31525|     33|            if (m1 == m)
  ------------------
  |  Branch (31525:17): [True: 33, False: 0]
  ------------------
31526|     33|                break;
31527|     33|        }
31528|     33|    }
31529|     33|    *pvalue = JS_UNDEFINED;
  ------------------
  |  |  291|     33|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     33|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
31530|     33|    return index;
31531|     33|}
quickjs.c:js_execute_sync_module:
31387|     33|{
31388|       |#ifdef DUMP_MODULE_EXEC
31389|       |    js_dump_module(ctx, __func__, m);
31390|       |#endif
31391|     33|    if (m->init_func) {
  ------------------
  |  Branch (31391:9): [True: 22, False: 11]
  ------------------
31392|       |        /* C module init : no asynchronous execution */
31393|     22|        if (m->init_func(ctx, m) < 0)
  ------------------
  |  Branch (31393:13): [True: 0, False: 22]
  ------------------
31394|      0|            goto fail;
31395|     22|    } else {
31396|     11|        JSValue promise;
31397|     11|        JSPromiseStateEnum state;
31398|       |
31399|     11|        promise = js_async_function_call(ctx, m->func_obj, JS_UNDEFINED, 0, NULL, 0);
  ------------------
  |  |  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 }
  |  |  ------------------
  ------------------
31400|     11|        if (JS_IsException(promise))
  ------------------
  |  Branch (31400:13): [True: 0, False: 11]
  ------------------
31401|      0|            goto fail;
31402|     11|        state = JS_PromiseState(ctx, promise);
31403|     11|        if (state == JS_PROMISE_FULFILLED) {
  ------------------
  |  Branch (31403:13): [True: 11, False: 0]
  ------------------
31404|     11|            JS_FreeValue(ctx, promise);
31405|     11|        } else if (state == JS_PROMISE_REJECTED) {
  ------------------
  |  Branch (31405:20): [True: 0, False: 0]
  ------------------
31406|      0|            *pvalue = JS_PromiseResult(ctx, promise);
31407|      0|            JS_FreeValue(ctx, promise);
31408|      0|            return -1;
31409|      0|        } else {
31410|      0|            JS_FreeValue(ctx, promise);
31411|      0|            JS_ThrowTypeError(ctx, "promise is pending");
31412|      0|        fail:
31413|      0|            *pvalue = JS_GetException(ctx);
31414|      0|            return -1;
31415|      0|        }
31416|     11|    }
31417|     33|    *pvalue = JS_UNDEFINED;
  ------------------
  |  |  291|     33|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     33|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
31418|     33|    return 0;
31419|     33|}
quickjs.c:JS_EvalInternal:
37307|     22|{
37308|     22|    BOOL backtrace_barrier = ((flags & JS_EVAL_FLAG_BACKTRACE_BARRIER) != 0);
  ------------------
  |  |  344|     22|#define JS_EVAL_FLAG_BACKTRACE_BARRIER (1 << 6)
  ------------------
37309|     22|    int saved_js_mode = 0;
37310|     22|    JSValue ret;
37311|       |    
37312|     22|    if (unlikely(!ctx->eval_internal)) {
  ------------------
  |  |   33|     22|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 22]
  |  |  ------------------
  ------------------
37313|      0|        return JS_ThrowTypeError(ctx, "eval is not supported");
37314|      0|    }
37315|     22|    if (backtrace_barrier && ctx->rt->current_stack_frame) {
  ------------------
  |  Branch (37315:9): [True: 0, False: 22]
  |  Branch (37315:30): [True: 0, False: 0]
  ------------------
37316|      0|        saved_js_mode = ctx->rt->current_stack_frame->js_mode;
37317|      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 */
  ------------------
37318|      0|    }
37319|     22|    ret = ctx->eval_internal(ctx, this_obj, input, input_len, filename,
37320|     22|                             flags, scope_idx);
37321|     22|    if (backtrace_barrier && ctx->rt->current_stack_frame)
  ------------------
  |  Branch (37321:9): [True: 0, False: 22]
  |  Branch (37321:30): [True: 0, False: 0]
  ------------------
37322|      0|        ctx->rt->current_stack_frame->js_mode = saved_js_mode;
37323|     22|    return ret;
37324|     22|}
quickjs.c:js_resolve_module:
30526|     33|{
30527|     33|    int i;
30528|     33|    JSModuleDef *m1;
30529|       |
30530|     33|    if (m->resolved)
  ------------------
  |  Branch (30530:9): [True: 0, False: 33]
  ------------------
30531|      0|        return 0;
30532|       |#ifdef DUMP_MODULE_RESOLVE
30533|       |    {
30534|       |        char buf1[ATOM_GET_STR_BUF_SIZE];
30535|       |        printf("resolving module '%s':\n", JS_AtomGetStr(ctx, buf1, sizeof(buf1), m->module_name));
30536|       |    }
30537|       |#endif
30538|     33|    m->resolved = TRUE;
30539|       |    /* resolve each requested module */
30540|     55|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (30540:16): [True: 22, False: 33]
  ------------------
30541|     22|        JSReqModuleEntry *rme = &m->req_module_entries[i];
30542|     22|        m1 = js_host_resolve_imported_module_atom(ctx, m->module_name,
30543|     22|                                                  rme->module_name,
30544|     22|                                                  rme->attributes);
30545|     22|        if (!m1)
  ------------------
  |  Branch (30545:13): [True: 0, False: 22]
  ------------------
30546|      0|            return -1;
30547|     22|        rme->module = m1;
30548|       |        /* already done in js_host_resolve_imported_module() except if
30549|       |           the module was loaded with JS_EvalBinary() */
30550|     22|        if (js_resolve_module(ctx, m1) < 0)
  ------------------
  |  Branch (30550:13): [True: 0, False: 22]
  ------------------
30551|      0|            return -1;
30552|     22|    }
30553|     33|    return 0;
30554|     33|}
quickjs.c:js_host_resolve_imported_module_atom:
30068|     22|{
30069|     22|    const char *base_cname, *cname;
30070|     22|    JSModuleDef *m;
30071|       |
30072|     22|    base_cname = JS_AtomToCString(ctx, base_module_name);
30073|     22|    if (!base_cname)
  ------------------
  |  Branch (30073:9): [True: 0, False: 22]
  ------------------
30074|      0|        return NULL;
30075|     22|    cname = JS_AtomToCString(ctx, module_name1);
30076|     22|    if (!cname) {
  ------------------
  |  Branch (30076:9): [True: 0, False: 22]
  ------------------
30077|      0|        JS_FreeCString(ctx, base_cname);
30078|      0|        return NULL;
30079|      0|    }
30080|     22|    m = js_host_resolve_imported_module(ctx, base_cname, cname, attributes);
30081|     22|    JS_FreeCString(ctx, base_cname);
30082|     22|    JS_FreeCString(ctx, cname);
30083|     22|    return m;
30084|     22|}
quickjs.c:js_dbuf_init:
 1936|     68|{
 1937|     68|    dbuf_init2(s, ctx->rt, (DynBufReallocFunc *)js_realloc_rt);
 1938|     68|}
quickjs.c:dbuf_put_sleb128:
 7395|     82|{
 7396|     82|    uint32_t v = v1;
 7397|     82|    dbuf_put_leb128(s, (2 * v) ^ -(v >> 31));
 7398|     82|}
quickjs.c:dbuf_put_leb128:
 7380|    129|{
 7381|    129|    uint32_t a;
 7382|    139|    for(;;) {
 7383|    139|        a = v & 0x7f;
 7384|    139|        v >>= 7;
 7385|    139|        if (v != 0) {
  ------------------
  |  Branch (7385:13): [True: 10, False: 129]
  ------------------
 7386|     10|            dbuf_putc(s, a | 0x80);
 7387|    129|        } else {
 7388|    129|            dbuf_putc(s, a);
 7389|    129|            break;
 7390|    129|        }
 7391|    139|    }
 7392|    129|}
quickjs.c:find_atom:
39533|  6.19k|{
39534|  6.19k|    JSAtom atom;
39535|  6.19k|    int len;
39536|       |
39537|  6.19k|    if (*name == '[') {
  ------------------
  |  Branch (39537:9): [True: 561, False: 5.63k]
  ------------------
39538|    561|        name++;
39539|    561|        len = strlen(name) - 1;
39540|       |        /* We assume 8 bit non null strings, which is the case for these
39541|       |           symbols */
39542|  4.15k|        for(atom = JS_ATOM_Symbol_toPrimitive; atom < JS_ATOM_END; atom++) {
  ------------------
  |  Branch (39542:48): [True: 4.15k, False: 0]
  ------------------
39543|  4.15k|            JSAtomStruct *p = ctx->rt->atom_array[atom];
39544|  4.15k|            JSString *str = p;
39545|  4.15k|            if (str->len == len && !memcmp(str->u.str8, name, len))
  ------------------
  |  Branch (39545:17): [True: 1.02k, False: 3.13k]
  |  Branch (39545:36): [True: 561, False: 462]
  ------------------
39546|    561|                return JS_DupAtom(ctx, atom);
39547|  4.15k|        }
39548|      0|        abort();
39549|  5.63k|    } else {
39550|  5.63k|        atom = JS_NewAtom(ctx, name);
39551|  5.63k|    }
39552|  5.63k|    return atom;
39553|  6.19k|}
quickjs.c:JS_InstantiateFunctionListItem:
39601|  6.08k|{
39602|  6.08k|    JSValue val;
39603|  6.08k|    int prop_flags = e->prop_flags;
39604|       |
39605|  6.08k|    switch(e->def_type) {
39606|    110|    case JS_DEF_ALIAS: /* using autoinit for aliases is not safe */
  ------------------
  |  | 1108|    110|#define JS_DEF_ALIAS          9
  ------------------
  |  Branch (39606:5): [True: 110, False: 5.97k]
  ------------------
39607|    110|        {
39608|    110|            JSAtom atom1 = find_atom(ctx, e->u.alias.name);
39609|    110|            switch (e->u.alias.base) {
39610|     88|            case -1:
  ------------------
  |  Branch (39610:13): [True: 88, False: 22]
  ------------------
39611|     88|                val = JS_GetProperty(ctx, obj, atom1);
39612|     88|                break;
39613|     22|            case 0:
  ------------------
  |  Branch (39613:13): [True: 22, False: 88]
  ------------------
39614|     22|                val = JS_GetProperty(ctx, ctx->global_obj, atom1);
39615|     22|                break;
39616|      0|            case 1:
  ------------------
  |  Branch (39616:13): [True: 0, False: 110]
  ------------------
39617|      0|                val = JS_GetProperty(ctx, ctx->class_proto[JS_CLASS_ARRAY], atom1);
39618|      0|                break;
39619|      0|            default:
  ------------------
  |  Branch (39619:13): [True: 0, False: 110]
  ------------------
39620|      0|                abort();
39621|    110|            }
39622|    110|            JS_FreeAtom(ctx, atom1);
39623|    110|            if (JS_IsException(val))
  ------------------
  |  Branch (39623:17): [True: 0, False: 110]
  ------------------
39624|      0|                return -1;
39625|    110|            if (atom == JS_ATOM_Symbol_toPrimitive) {
  ------------------
  |  Branch (39625:17): [True: 0, False: 110]
  ------------------
39626|       |                /* Symbol.toPrimitive functions are not writable */
39627|      0|                prop_flags = JS_PROP_CONFIGURABLE;
  ------------------
  |  |  298|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39628|    110|            } else if (atom == JS_ATOM_Symbol_hasInstance) {
  ------------------
  |  Branch (39628:24): [True: 0, False: 110]
  ------------------
39629|       |                /* Function.prototype[Symbol.hasInstance] is not writable nor configurable */
39630|      0|                prop_flags = 0;
39631|      0|            }
39632|    110|        }
39633|      0|        break;
39634|  4.33k|    case JS_DEF_CFUNC:
  ------------------
  |  | 1099|  4.33k|#define JS_DEF_CFUNC          0
  ------------------
  |  Branch (39634:5): [True: 4.33k, False: 1.74k]
  ------------------
39635|  4.33k|        if (atom == JS_ATOM_Symbol_toPrimitive) {
  ------------------
  |  Branch (39635:13): [True: 22, False: 4.31k]
  ------------------
39636|       |            /* Symbol.toPrimitive functions are not writable */
39637|     22|            prop_flags = JS_PROP_CONFIGURABLE;
  ------------------
  |  |  298|     22|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39638|  4.31k|        } else if (atom == JS_ATOM_Symbol_hasInstance) {
  ------------------
  |  Branch (39638:20): [True: 11, False: 4.30k]
  ------------------
39639|       |            /* Function.prototype[Symbol.hasInstance] is not writable nor configurable */
39640|     11|            prop_flags = 0;
39641|     11|        }
39642|  4.33k|        if (JS_DefineAutoInitProperty(ctx, obj, atom, JS_AUTOINIT_ID_PROP,
  ------------------
  |  Branch (39642:13): [True: 0, False: 4.33k]
  ------------------
39643|  4.33k|                                      (void *)e, prop_flags) < 0)
39644|      0|            return -1;
39645|  4.33k|        return 0;
39646|    253|    case JS_DEF_CGETSET: /* XXX: use autoinit again ? */
  ------------------
  |  | 1100|    253|#define JS_DEF_CGETSET        1
  ------------------
  |  Branch (39646:5): [True: 253, False: 5.83k]
  ------------------
39647|    451|    case JS_DEF_CGETSET_MAGIC:
  ------------------
  |  | 1101|    451|#define JS_DEF_CGETSET_MAGIC  2
  ------------------
  |  Branch (39647:5): [True: 198, False: 5.88k]
  ------------------
39648|    451|        {
39649|    451|            JSValue getter, setter;
39650|    451|            char buf[64];
39651|       |
39652|    451|            getter = JS_UNDEFINED;
  ------------------
  |  |  291|    451|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|    451|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
39653|    451|            if (e->u.getset.get.generic) {
  ------------------
  |  Branch (39653:17): [True: 451, False: 0]
  ------------------
39654|    451|                snprintf(buf, sizeof(buf), "get %s", e->name);
39655|    451|                getter = JS_NewCFunction2(ctx, e->u.getset.get.generic,
39656|    451|                                          buf, 0, e->def_type == JS_DEF_CGETSET_MAGIC ? JS_CFUNC_getter_magic : JS_CFUNC_getter,
  ------------------
  |  | 1101|    451|#define JS_DEF_CGETSET_MAGIC  2
  ------------------
  |  Branch (39656:51): [True: 198, False: 253]
  ------------------
39657|    451|                                          e->magic);
39658|    451|                if (JS_IsException(getter))
  ------------------
  |  Branch (39658:21): [True: 0, False: 451]
  ------------------
39659|      0|                    return -1;
39660|    451|            }
39661|    451|            setter = JS_UNDEFINED;
  ------------------
  |  |  291|    451|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|    451|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
39662|    451|            if (e->u.getset.set.generic) {
  ------------------
  |  Branch (39662:17): [True: 22, False: 429]
  ------------------
39663|     22|                snprintf(buf, sizeof(buf), "set %s", e->name);
39664|     22|                setter = JS_NewCFunction2(ctx, e->u.getset.set.generic,
39665|     22|                                          buf, 1, e->def_type == JS_DEF_CGETSET_MAGIC ? JS_CFUNC_setter_magic : JS_CFUNC_setter,
  ------------------
  |  | 1101|     22|#define JS_DEF_CGETSET_MAGIC  2
  ------------------
  |  Branch (39665:51): [True: 0, False: 22]
  ------------------
39666|     22|                                          e->magic);
39667|     22|                if (JS_IsException(setter)) {
  ------------------
  |  Branch (39667:21): [True: 0, False: 22]
  ------------------
39668|      0|                    JS_FreeValue(ctx, getter);
39669|      0|                    return -1;
39670|      0|                }
39671|     22|            }
39672|    451|            if (JS_DefinePropertyGetSet(ctx, obj, atom, getter, setter, prop_flags) < 0)
  ------------------
  |  Branch (39672:17): [True: 0, False: 451]
  ------------------
39673|      0|                return -1;
39674|    451|            return 0;
39675|    451|        }
39676|      0|        break;
39677|    396|    case JS_DEF_PROP_INT32:
  ------------------
  |  | 1103|    396|#define JS_DEF_PROP_INT32     4
  ------------------
  |  Branch (39677:5): [True: 396, False: 5.68k]
  ------------------
39678|    396|        val = JS_NewInt32(ctx, e->u.i32);
39679|    396|        break;
39680|      0|    case JS_DEF_PROP_INT64:
  ------------------
  |  | 1104|      0|#define JS_DEF_PROP_INT64     5
  ------------------
  |  Branch (39680:5): [True: 0, False: 6.08k]
  ------------------
39681|      0|        val = JS_NewInt64(ctx, e->u.i64);
39682|      0|        break;
39683|    110|    case JS_DEF_PROP_DOUBLE:
  ------------------
  |  | 1105|    110|#define JS_DEF_PROP_DOUBLE    6
  ------------------
  |  Branch (39683:5): [True: 110, False: 5.97k]
  ------------------
39684|    110|        val = __JS_NewFloat64(ctx, e->u.f64);
39685|    110|        break;
39686|     11|    case JS_DEF_PROP_UNDEFINED:
  ------------------
  |  | 1106|     11|#define JS_DEF_PROP_UNDEFINED 7
  ------------------
  |  Branch (39686:5): [True: 11, False: 6.07k]
  ------------------
39687|     11|        val = 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 }
  |  |  ------------------
  ------------------
39688|     11|        break;
39689|    231|    case JS_DEF_PROP_ATOM:
  ------------------
  |  | 1109|    231|#define JS_DEF_PROP_ATOM     10
  ------------------
  |  Branch (39689:5): [True: 231, False: 5.85k]
  ------------------
39690|    231|        val = JS_AtomToValue(ctx, e->u.i32);
39691|    231|        break;
39692|      0|    case JS_DEF_PROP_BOOL:
  ------------------
  |  | 1110|      0|#define JS_DEF_PROP_BOOL     11
  ------------------
  |  Branch (39692:5): [True: 0, False: 6.08k]
  ------------------
39693|      0|        val = JS_NewBool(ctx, e->u.i32);
39694|      0|        break;
39695|    385|    case JS_DEF_PROP_STRING:
  ------------------
  |  | 1102|    385|#define JS_DEF_PROP_STRING    3
  ------------------
  |  Branch (39695:5): [True: 385, False: 5.69k]
  ------------------
39696|    440|    case JS_DEF_OBJECT:
  ------------------
  |  | 1107|    440|#define JS_DEF_OBJECT         8
  ------------------
  |  Branch (39696:5): [True: 55, False: 6.02k]
  ------------------
39697|    440|        if (JS_DefineAutoInitProperty(ctx, obj, atom, JS_AUTOINIT_ID_PROP,
  ------------------
  |  Branch (39697:13): [True: 0, False: 440]
  ------------------
39698|    440|                                      (void *)e, prop_flags) < 0)
39699|      0|            return -1;
39700|    440|        return 0;
39701|      0|    default:
  ------------------
  |  Branch (39701:5): [True: 0, False: 6.08k]
  ------------------
39702|      0|        abort();
39703|  6.08k|    }
39704|    858|    if (JS_DefinePropertyValue(ctx, obj, atom, val, prop_flags) < 0)
  ------------------
  |  Branch (39704:9): [True: 0, False: 858]
  ------------------
39705|      0|        return -1;
39706|    858|    return 0;
39707|    858|}
quickjs.c:JS_NewObjectProtoList:
39557|    143|{
39558|    143|    JSValue obj;
39559|    143|    obj = JS_NewObjectProtoClassAlloc(ctx, proto, JS_CLASS_OBJECT, n_fields);
39560|    143|    if (JS_IsException(obj))
  ------------------
  |  Branch (39560:9): [True: 0, False: 143]
  ------------------
39561|      0|        return obj;
39562|    143|    if (JS_SetPropertyFunctionList(ctx, obj, fields, n_fields)) {
  ------------------
  |  Branch (39562:9): [True: 0, False: 143]
  ------------------
39563|      0|        JS_FreeValue(ctx, obj);
39564|      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 }
  |  |  ------------------
  ------------------
39565|      0|    }
39566|    143|    return obj;
39567|    143|}
quickjs.c:JS_SetConstructor2:
39781|    528|{
39782|    528|    if (JS_DefinePropertyValue(ctx, func_obj, JS_ATOM_prototype,
  ------------------
  |  Branch (39782:9): [True: 0, False: 528]
  ------------------
39783|    528|                               JS_DupValue(ctx, proto), proto_flags) < 0)
39784|      0|        return -1;
39785|    528|    if (JS_DefinePropertyValue(ctx, proto, JS_ATOM_constructor,
  ------------------
  |  Branch (39785:9): [True: 0, False: 528]
  ------------------
39786|    528|                               JS_DupValue(ctx, func_obj),
39787|    528|                               ctor_flags) < 0)
39788|      0|        return -1;
39789|    528|    set_cycle_flag(ctx, func_obj);
39790|    528|    set_cycle_flag(ctx, proto);
39791|    528|    return 0;
39792|    528|}
quickjs.c:JS_ToObject:
39908|      9|{
39909|      9|    int tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  238|      9|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      9|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
39910|      9|    JSValue obj;
39911|       |
39912|      9|    switch(tag) {
39913|      0|    default:
  ------------------
  |  Branch (39913:5): [True: 0, False: 9]
  ------------------
39914|      0|    case JS_TAG_NULL:
  ------------------
  |  Branch (39914:5): [True: 0, False: 9]
  ------------------
39915|      0|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (39915:5): [True: 0, False: 9]
  ------------------
39916|      0|        return JS_ThrowTypeError(ctx, "cannot convert to object");
39917|      8|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (39917:5): [True: 8, False: 1]
  ------------------
39918|      8|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (39918:5): [True: 0, False: 9]
  ------------------
39919|      8|        return JS_DupValue(ctx, val);
39920|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (39920:5): [True: 0, False: 9]
  ------------------
39921|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (39921:5): [True: 0, False: 9]
  ------------------
39922|      0|        obj = JS_NewObjectClass(ctx, JS_CLASS_BIG_INT);
39923|      0|        goto set_value;
39924|      0|    case JS_TAG_INT:
  ------------------
  |  Branch (39924:5): [True: 0, False: 9]
  ------------------
39925|      0|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (39925:5): [True: 0, False: 9]
  ------------------
39926|      0|        obj = JS_NewObjectClass(ctx, JS_CLASS_NUMBER);
39927|      0|        goto set_value;
39928|      0|    case JS_TAG_STRING:
  ------------------
  |  Branch (39928:5): [True: 0, False: 9]
  ------------------
39929|      0|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (39929:5): [True: 0, False: 9]
  ------------------
39930|       |        /* XXX: should call the string constructor */
39931|      0|        {
39932|      0|            JSValue str;
39933|      0|            str = JS_ToString(ctx, val); /* ensure that we never store a rope */
39934|      0|            if (JS_IsException(str))
  ------------------
  |  Branch (39934:17): [True: 0, False: 0]
  ------------------
39935|      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 }
  |  |  ------------------
  ------------------
39936|      0|            obj = JS_NewObjectClass(ctx, JS_CLASS_STRING);
39937|      0|            if (!JS_IsException(obj)) {
  ------------------
  |  Branch (39937:17): [True: 0, False: 0]
  ------------------
39938|      0|                JS_DefinePropertyValue(ctx, obj, JS_ATOM_length,
39939|      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)
  |  |  ------------------
  ------------------
39940|      0|                JS_SetObjectData(ctx, obj, JS_DupValue(ctx, str));
39941|      0|            }
39942|      0|            JS_FreeValue(ctx, str);
39943|      0|            return obj;
39944|      0|        }
39945|      1|    case JS_TAG_BOOL:
  ------------------
  |  Branch (39945:5): [True: 1, False: 8]
  ------------------
39946|      1|        obj = JS_NewObjectClass(ctx, JS_CLASS_BOOLEAN);
39947|      1|        goto set_value;
39948|      0|    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (39948:5): [True: 0, False: 9]
  ------------------
39949|      0|        obj = JS_NewObjectClass(ctx, JS_CLASS_SYMBOL);
39950|      1|    set_value:
39951|      1|        if (!JS_IsException(obj))
  ------------------
  |  Branch (39951:13): [True: 1, False: 0]
  ------------------
39952|      1|            JS_SetObjectData(ctx, obj, JS_DupValue(ctx, val));
39953|      1|        return obj;
39954|      9|    }
39955|      9|}
quickjs.c:js_string_define_own_property:
45212|     44|{
45213|     44|    uint32_t idx;
45214|     44|    JSObject *p;
45215|     44|    JSString *p1, *p2;
45216|       |
45217|     44|    if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (45217:9): [True: 0, False: 44]
  ------------------
45218|      0|        idx = __JS_AtomToUInt32(prop);
45219|      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)
  |  |  ------------------
  ------------------
45220|      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 (45220:13): [True: 0, False: 0]
  ------------------
45221|      0|            goto def;
45222|      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)
  |  |  ------------------
  ------------------
45223|      0|        if (idx >= p1->len)
  ------------------
  |  Branch (45223:13): [True: 0, False: 0]
  ------------------
45224|      0|            goto def;
45225|      0|        if (!check_define_prop_flags(JS_PROP_ENUMERABLE, flags))
  ------------------
  |  |  300|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
  |  Branch (45225:13): [True: 0, False: 0]
  ------------------
45226|      0|            goto fail;
45227|       |        /* check that the same value is configured */
45228|      0|        if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  316|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (45228:13): [True: 0, False: 0]
  ------------------
45229|      0|            if (JS_VALUE_GET_TAG(val) != JS_TAG_STRING)
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (45229:17): [True: 0, False: 0]
  ------------------
45230|      0|                goto fail;
45231|      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)
  |  |  ------------------
  ------------------
45232|      0|            if (p2->len != 1)
  ------------------
  |  Branch (45232:17): [True: 0, False: 0]
  ------------------
45233|      0|                goto fail;
45234|      0|            if (string_get(p1, idx) != string_get(p2, 0)) {
  ------------------
  |  Branch (45234:17): [True: 0, False: 0]
  ------------------
45235|      0|            fail:
45236|      0|                return JS_ThrowTypeErrorOrFalse(ctx, flags, "property is not configurable");
45237|      0|            }
45238|      0|        }
45239|      0|        return TRUE;
45240|     44|    } else {
45241|     44|    def:
45242|     44|        return JS_DefineProperty(ctx, this_obj, prop, val, getter, setter,
45243|     44|                                 flags | JS_PROP_NO_EXOTIC);
  ------------------
  |  |  325|     44|#define JS_PROP_NO_EXOTIC        (1 << 16) /* internal use */
  ------------------
45244|     44|    }
45245|     44|}
quickjs.c:string_buffer_init2:
 4008|    108|{
 4009|    108|    s->ctx = ctx;
 4010|    108|    s->size = size;
 4011|    108|    s->len = 0;
 4012|    108|    s->is_wide_char = is_wide;
 4013|    108|    s->error_status = 0;
 4014|    108|    s->str = js_alloc_string(ctx, size, is_wide);
 4015|    108|    if (unlikely(!s->str)) {
  ------------------
  |  |   33|    108|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 108]
  |  |  ------------------
  ------------------
 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|    108|    return 0;
 4024|    108|}
quickjs.c:string_buffer_putc:
 4156|  5.53M|{
 4157|  5.53M|    if (likely(s->len < s->size)) {
  ------------------
  |  |   32|  5.53M|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 5.53M, False: 150]
  |  |  ------------------
  ------------------
 4158|  5.53M|        if (s->is_wide_char) {
  ------------------
  |  Branch (4158:13): [True: 4.38M, False: 1.14M]
  ------------------
 4159|  4.38M|            if (c < 0x10000) {
  ------------------
  |  Branch (4159:17): [True: 4.38M, False: 3]
  ------------------
 4160|  4.38M|                s->str->u.str16[s->len++] = c;
 4161|  4.38M|                return 0;
 4162|  4.38M|            } 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|  4.38M|        } else if (c < 0x100) {
  ------------------
  |  Branch (4167:20): [True: 1.14M, False: 5]
  ------------------
 4168|  1.14M|            s->str->u.str8[s->len++] = c;
 4169|  1.14M|            return 0;
 4170|  1.14M|        }
 4171|  5.53M|    }
 4172|    155|    return string_buffer_putc_slow(s, c);
 4173|  5.53M|}
quickjs.c:string_buffer_putc_slow:
 4144|    155|{
 4145|    155|    if (unlikely(c >= 0x10000)) {
  ------------------
  |  |   33|    155|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 3, False: 152]
  |  |  ------------------
  ------------------
 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|    155|    return string_buffer_putc16(s, c);
 4152|    155|}
quickjs.c:js_check_stack_overflow:
 2060|    895|{
 2061|    895|    uintptr_t sp;
 2062|    895|    sp = js_get_stack_pointer() - alloca_size;
 2063|    895|    return unlikely(sp < rt->stack_limit);
  ------------------
  |  |   33|    895|#define unlikely(x)     __builtin_expect(!!(x), 0)
  ------------------
 2064|    895|}
quickjs.c:JS_NewCConstructor:
39817|    506|{
39818|    506|    JSValue ctor = JS_UNDEFINED, proto, parent_proto;
  ------------------
  |  |  291|    506|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|    506|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
39819|    506|    int proto_class_id, proto_flags, ctor_flags;
39820|       |
39821|    506|    proto_flags = 0;
39822|    506|    if (flags & JS_NEW_CTOR_READONLY) {
  ------------------
  |  |39805|    506|#define JS_NEW_CTOR_READONLY    (1 << 3) /* read-only constructor field */
  ------------------
  |  Branch (39822:9): [True: 33, False: 473]
  ------------------
39823|     33|        ctor_flags = JS_PROP_CONFIGURABLE;
  ------------------
  |  |  298|     33|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39824|    473|    } else {
39825|    473|        ctor_flags = JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE;
  ------------------
  |  |  299|    473|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                      ctor_flags = JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE;
  ------------------
  |  |  298|    473|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39826|    473|    }
39827|       |    
39828|    506|    if (JS_IsUndefined(parent_ctor)) {
  ------------------
  |  Branch (39828:9): [True: 253, False: 253]
  ------------------
39829|    253|        parent_proto = JS_DupValue(ctx, ctx->class_proto[JS_CLASS_OBJECT]);
39830|    253|        parent_ctor = ctx->function_proto;
39831|    253|    } else {
39832|    253|        parent_proto = JS_GetProperty(ctx, parent_ctor, JS_ATOM_prototype);
39833|    253|        if (JS_IsException(parent_proto))
  ------------------
  |  Branch (39833:13): [True: 0, False: 253]
  ------------------
39834|      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 }
  |  |  ------------------
  ------------------
39835|    253|    }
39836|       |    
39837|    506|    if (flags & JS_NEW_CTOR_PROTO_EXIST) {
  ------------------
  |  |39804|    506|#define JS_NEW_CTOR_PROTO_EXIST (1 << 2) /* the prototype is already defined */
  ------------------
  |  Branch (39837:9): [True: 22, False: 484]
  ------------------
39838|     22|        proto = JS_DupValue(ctx, ctx->class_proto[class_id]);
39839|    484|    } else {
39840|    484|        if (flags & JS_NEW_CTOR_PROTO_CLASS)
  ------------------
  |  |39803|    484|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
  |  Branch (39840:13): [True: 44, False: 440]
  ------------------
39841|     44|            proto_class_id = class_id;
39842|    440|        else
39843|    440|            proto_class_id = JS_CLASS_OBJECT;
39844|       |        /* one additional field: constructor */
39845|    484|        proto = JS_NewObjectProtoClassAlloc(ctx, parent_proto, proto_class_id,
39846|    484|                                            n_proto_fields + 1);
39847|    484|        if (JS_IsException(proto))
  ------------------
  |  Branch (39847:13): [True: 0, False: 484]
  ------------------
39848|      0|            goto fail;
39849|    484|        if (class_id >= 0)
  ------------------
  |  Branch (39849:13): [True: 385, False: 99]
  ------------------
39850|    385|            ctx->class_proto[class_id] = JS_DupValue(ctx, proto);
39851|    484|    }
39852|    506|    if (JS_SetPropertyFunctionList(ctx, proto, proto_fields, n_proto_fields))
  ------------------
  |  Branch (39852:9): [True: 0, False: 506]
  ------------------
39853|      0|        goto fail;
39854|       |
39855|       |    /* additional fields: name, length, prototype */
39856|    506|    ctor = JS_NewCFunction3(ctx, func, name, length, cproto, magic, parent_ctor,
39857|    506|                            n_ctor_fields + 3);
39858|    506|    if (JS_IsException(ctor))
  ------------------
  |  Branch (39858:9): [True: 0, False: 506]
  ------------------
39859|      0|        goto fail;
39860|    506|    if (JS_SetPropertyFunctionList(ctx, ctor, ctor_fields, n_ctor_fields))
  ------------------
  |  Branch (39860:9): [True: 0, False: 506]
  ------------------
39861|      0|        goto fail;
39862|    506|    if (!(flags & JS_NEW_CTOR_NO_GLOBAL)) {
  ------------------
  |  |39802|    506|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
  |  Branch (39862:9): [True: 462, False: 44]
  ------------------
39863|    462|        if (JS_DefinePropertyValueStr(ctx, ctx->global_obj, name,
  ------------------
  |  Branch (39863:13): [True: 0, False: 462]
  ------------------
39864|    462|                                      JS_DupValue(ctx, ctor),
39865|    462|                                      JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  299|    462|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                    JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  298|    462|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39866|      0|            goto fail;
39867|    462|    }
39868|    506|    JS_SetConstructor2(ctx, ctor, proto, proto_flags, ctor_flags);
39869|       |
39870|    506|    JS_FreeValue(ctx, proto);
39871|    506|    JS_FreeValue(ctx, parent_proto);
39872|    506|    return ctor;
39873|      0| fail:
39874|      0|    JS_FreeValue(ctx, proto);
39875|      0|    JS_FreeValue(ctx, parent_proto);
39876|      0|    JS_FreeValue(ctx, ctor);
39877|      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 }
  |  |  ------------------
  ------------------
39878|    506|}
quickjs.c:JS_ToLengthFree:
13511|      3|{
13512|      3|    int res = JS_ToInt64Clamp(ctx, plen, val, 0, MAX_SAFE_INTEGER, 0);
  ------------------
  |  |13485|      3|#define MAX_SAFE_INTEGER (((int64_t)1 << 53) - 1)
  ------------------
13513|      3|    JS_FreeValue(ctx, val);
13514|      3|    return res;
13515|      3|}
quickjs.c:string_buffer_concat_value_free:
 4290|   171k|{
 4291|   171k|    JSString *p;
 4292|   171k|    int res;
 4293|       |
 4294|   171k|    if (s->error_status) {
  ------------------
  |  Branch (4294:9): [True: 0, False: 171k]
  ------------------
 4295|       |        /* prevent exception overload */
 4296|      0|        JS_FreeValue(s->ctx, v);
 4297|      0|        return -1;
 4298|      0|    }
 4299|   171k|    if (unlikely(JS_VALUE_GET_TAG(v) != JS_TAG_STRING)) {
  ------------------
  |  |   33|   171k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 171k]
  |  |  ------------------
  ------------------
 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|   171k|    p = JS_VALUE_GET_STRING(v);
  ------------------
  |  |  230|   171k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|   171k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4305|   171k|    res = string_buffer_concat(s, p, 0, p->len);
 4306|   171k|    JS_FreeValue(s->ctx, v);
 4307|   171k|    return res;
 4308|   171k|}
quickjs.c:string_indexof_char:
45554|   210k|{
45555|       |    /* assuming 0 <= from <= p->len */
45556|   210k|    int i, len = p->len;
45557|   210k|    if (p->is_wide_char) {
  ------------------
  |  Branch (45557:9): [True: 210k, False: 0]
  ------------------
45558|   807k|        for (i = from; i < len; i++) {
  ------------------
  |  Branch (45558:24): [True: 807k, False: 1]
  ------------------
45559|   807k|            if (p->u.str16[i] == c)
  ------------------
  |  Branch (45559:17): [True: 210k, False: 596k]
  ------------------
45560|   210k|                return i;
45561|   807k|        }
45562|   210k|    } else {
45563|      0|        if ((c & ~0xff) == 0) {
  ------------------
  |  Branch (45563:13): [True: 0, False: 0]
  ------------------
45564|      0|            for (i = from; i < len; i++) {
  ------------------
  |  Branch (45564:28): [True: 0, False: 0]
  ------------------
45565|      0|                if (p->u.str8[i] == (uint8_t)c)
  ------------------
  |  Branch (45565:21): [True: 0, False: 0]
  ------------------
45566|      0|                    return i;
45567|      0|            }
45568|      0|        }
45569|      0|    }
45570|      1|    return -1;
45571|   210k|}
quickjs.c:js_new_shape2:
 5240|    826|{
 5241|    826|    JSRuntime *rt = ctx->rt;
 5242|    826|    JSShape *sh;
 5243|       |
 5244|       |    /* resize the shape hash table if necessary */
 5245|    826|    if (2 * (rt->shape_hash_count + 1) > rt->shape_hash_size) {
  ------------------
  |  Branch (5245:9): [True: 12, False: 814]
  ------------------
 5246|     12|        resize_shape_hash(rt, rt->shape_hash_bits + 1);
 5247|     12|    }
 5248|       |
 5249|    826|    sh = js_new_shape_nohash(ctx, proto, hash_size, prop_size);
 5250|    826|    if (!sh)
  ------------------
  |  Branch (5250:9): [True: 0, False: 826]
  ------------------
 5251|      0|        return NULL;
 5252|       |    
 5253|       |    /* insert in the hash table */
 5254|    826|    sh->hash = shape_initial_hash(proto);
 5255|    826|    sh->is_hashed = TRUE;
 5256|    826|    js_shape_hash_link(ctx->rt, sh);
 5257|    826|    return sh;
 5258|    826|}
quickjs.c:resize_shape_hash:
 5166|     12|{
 5167|     12|    int new_shape_hash_size, i;
 5168|     12|    uint32_t h;
 5169|     12|    JSShape **new_shape_hash, *sh, *sh_next;
 5170|       |
 5171|     12|    new_shape_hash_size = 1 << new_shape_hash_bits;
 5172|     12|    new_shape_hash = js_mallocz_rt(rt, sizeof(rt->shape_hash[0]) *
 5173|     12|                                   new_shape_hash_size);
 5174|     12|    if (!new_shape_hash)
  ------------------
  |  Branch (5174:9): [True: 0, False: 12]
  ------------------
 5175|      0|        return -1;
 5176|    220|    for(i = 0; i < rt->shape_hash_size; i++) {
  ------------------
  |  Branch (5176:16): [True: 208, False: 12]
  ------------------
 5177|    312|        for(sh = rt->shape_hash[i]; sh != NULL; sh = sh_next) {
  ------------------
  |  Branch (5177:37): [True: 104, False: 208]
  ------------------
 5178|    104|            sh_next = sh->shape_hash_next;
 5179|    104|            h = get_shape_hash(sh->hash, new_shape_hash_bits);
 5180|    104|            sh->shape_hash_next = new_shape_hash[h];
 5181|    104|            new_shape_hash[h] = sh;
 5182|    104|        }
 5183|    208|    }
 5184|     12|    js_free_rt(rt, rt->shape_hash);
 5185|     12|    rt->shape_hash_bits = new_shape_hash_bits;
 5186|     12|    rt->shape_hash_size = new_shape_hash_size;
 5187|     12|    rt->shape_hash = new_shape_hash;
 5188|     12|    return 0;
 5189|     12|}
quickjs.c:add_shape_property:
 5471|  11.4k|{
 5472|  11.4k|    JSRuntime *rt = ctx->rt;
 5473|  11.4k|    JSShape *sh = *psh;
 5474|  11.4k|    JSShapeProperty *pr, *prop;
 5475|  11.4k|    uint32_t hash_mask, new_shape_hash = 0;
 5476|  11.4k|    intptr_t h;
 5477|       |
 5478|       |    /* update the shape hash */
 5479|  11.4k|    if (sh->is_hashed) {
  ------------------
  |  Branch (5479:9): [True: 2.85k, False: 8.63k]
  ------------------
 5480|  2.85k|        js_shape_hash_unlink(rt, sh);
 5481|  2.85k|        new_shape_hash = shape_hash(shape_hash(sh->hash, atom), prop_flags);
 5482|  2.85k|    }
 5483|       |
 5484|  11.4k|    if (unlikely(sh->prop_count >= sh->prop_size)) {
  ------------------
  |  |   33|  11.4k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 365, False: 11.1k]
  |  |  ------------------
  ------------------
 5485|    365|        if (resize_properties(ctx, psh, p, sh->prop_count + 1)) {
  ------------------
  |  Branch (5485:13): [True: 0, False: 365]
  ------------------
 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|    365|        sh = *psh;
 5493|    365|    }
 5494|  11.4k|    if (sh->is_hashed) {
  ------------------
  |  Branch (5494:9): [True: 2.85k, False: 8.63k]
  ------------------
 5495|  2.85k|        sh->hash = new_shape_hash;
 5496|  2.85k|        js_shape_hash_link(rt, sh);
 5497|  2.85k|    }
 5498|       |    /* Initialize the new shape property.
 5499|       |       The object property at p->prop[sh->prop_count] is uninitialized */
 5500|  11.4k|    prop = get_shape_prop(sh);
 5501|  11.4k|    pr = &prop[sh->prop_count++];
 5502|  11.4k|    pr->atom = JS_DupAtom(ctx, atom);
 5503|  11.4k|    pr->flags = prop_flags;
 5504|       |    /* add in hash table */
 5505|  11.4k|    hash_mask = sh->prop_hash_mask;
 5506|  11.4k|    h = atom & hash_mask;
 5507|  11.4k|    pr->hash_next = sh->hash_table[h];
 5508|  11.4k|    sh->hash_table[h] = sh->prop_count;
 5509|  11.4k|    return 0;
 5510|  11.4k|}
quickjs.c:js_parse_init:
37133|     22|{
37134|     22|    memset(s, 0, sizeof(*s));
37135|     22|    s->ctx = ctx;
37136|     22|    s->filename = filename;
37137|     22|    s->buf_start = s->buf_ptr = (const uint8_t *)input;
37138|     22|    s->buf_end = s->buf_ptr + input_len;
37139|     22|    s->token.val = ' ';
37140|     22|    s->token.ptr = s->buf_ptr;
37141|       |
37142|     22|    s->get_line_col_cache.ptr = s->buf_start;
37143|     22|    s->get_line_col_cache.buf_start = s->buf_start;
37144|     22|    s->get_line_col_cache.line_num = 0;
37145|     22|    s->get_line_col_cache.col_num = 0;
37146|     22|}
quickjs.c:js_parse_error_v:
22337|      4|{
22338|      4|    JSContext *ctx = s->ctx;
22339|      4|    int line_num, col_num;
22340|      4|    line_num = get_line_col(&col_num, s->buf_start, ptr - s->buf_start);
22341|      4|    JS_ThrowError2(ctx, JS_SYNTAX_ERROR, fmt, ap, FALSE);
22342|      4|    build_backtrace(ctx, ctx->rt->current_exception, s->filename,
22343|      4|                    line_num + 1, col_num + 1, 0);
22344|      4|    return -1;
22345|      4|}
quickjs.c:get_line_col:
22281|     99|{
22282|     99|    int line_num, col_num, c;
22283|     99|    size_t i;
22284|       |    
22285|     99|    line_num = 0;
22286|     99|    col_num = 0;
22287|  5.76M|    for(i = 0; i < len; i++) {
  ------------------
  |  Branch (22287:16): [True: 5.76M, False: 99]
  ------------------
22288|  5.76M|        c = buf[i];
22289|  5.76M|        if (c == '\n') {
  ------------------
  |  Branch (22289:13): [True: 1.07M, False: 4.68M]
  ------------------
22290|  1.07M|            line_num++;
22291|  1.07M|            col_num = 0;
22292|  4.68M|        } else if (c < 0x80 || c >= 0xc0) {
  ------------------
  |  Branch (22292:20): [True: 4.68M, False: 4.24k]
  |  Branch (22292:32): [True: 2.12k, False: 2.11k]
  ------------------
22293|  4.68M|            col_num++;
22294|  4.68M|        }
22295|  5.76M|    }
22296|     99|    *pcol_num = col_num;
22297|     99|    return line_num;
22298|     99|}
quickjs.c:ident_realloc:
22713|     23|{
22714|     23|    char *buf, *new_buf;
22715|     23|    size_t size, new_size;
22716|       |
22717|     23|    buf = *pbuf;
22718|     23|    size = *psize;
22719|     23|    if (size >= (SIZE_MAX / 3) * 2)
  ------------------
  |  Branch (22719:9): [True: 0, False: 23]
  ------------------
22720|      0|        new_size = SIZE_MAX;
22721|     23|    else
22722|     23|        new_size = size + (size >> 1);
22723|     23|    if (buf == static_buf) {
  ------------------
  |  Branch (22723:9): [True: 1, False: 22]
  ------------------
22724|      1|        new_buf = js_malloc(ctx, new_size);
22725|      1|        if (!new_buf)
  ------------------
  |  Branch (22725:13): [True: 0, False: 1]
  ------------------
22726|      0|            return -1;
22727|      1|        memcpy(new_buf, buf, size);
22728|     22|    } else {
22729|     22|        new_buf = js_realloc(ctx, buf, new_size);
22730|     22|        if (!new_buf)
  ------------------
  |  Branch (22730:13): [True: 0, False: 22]
  ------------------
22731|      0|            return -1;
22732|     22|    }
22733|     23|    *pbuf = new_buf;
22734|     23|    *psize = new_size;
22735|     23|    return 0;
22736|     23|}
quickjs.c:js_parse_error:
22359|      4|{
22360|      4|    va_list ap;
22361|      4|    int ret;
22362|       |    
22363|      4|    va_start(ap, fmt);
22364|      4|    ret = js_parse_error_v(s, s->token.ptr, fmt, ap);
22365|       |    va_end(ap);
22366|      4|    return ret;
22367|      4|}
quickjs.c:free_token:
22191|    791|{
22192|    791|    switch(token->val) {
22193|     15|    case TOK_NUMBER:
  ------------------
  |  Branch (22193:5): [True: 15, False: 776]
  ------------------
22194|     15|        JS_FreeValue(s->ctx, token->u.num.val);
22195|     15|        break;
22196|     31|    case TOK_STRING:
  ------------------
  |  Branch (22196:5): [True: 31, False: 760]
  ------------------
22197|     65|    case TOK_TEMPLATE:
  ------------------
  |  Branch (22197:5): [True: 34, False: 757]
  ------------------
22198|     65|        JS_FreeValue(s->ctx, token->u.str.str);
22199|     65|        break;
22200|      0|    case TOK_REGEXP:
  ------------------
  |  Branch (22200:5): [True: 0, False: 791]
  ------------------
22201|      0|        JS_FreeValue(s->ctx, token->u.regexp.body);
22202|      0|        JS_FreeValue(s->ctx, token->u.regexp.flags);
22203|      0|        break;
22204|    316|    case TOK_IDENT:
  ------------------
  |  Branch (22204:5): [True: 316, False: 475]
  ------------------
22205|    316|    case TOK_PRIVATE_NAME:
  ------------------
  |  Branch (22205:5): [True: 0, False: 791]
  ------------------
22206|    316|        JS_FreeAtom(s->ctx, token->u.ident.atom);
22207|    316|        break;
22208|    395|    default:
  ------------------
  |  Branch (22208:5): [True: 395, False: 396]
  ------------------
22209|    395|        if (token->val >= TOK_FIRST_KEYWORD &&
  ------------------
  |  |21882|    790|#define TOK_FIRST_KEYWORD   TOK_NULL
  ------------------
  |  Branch (22209:13): [True: 383, False: 12]
  ------------------
22210|    383|            token->val <= TOK_LAST_KEYWORD) {
  ------------------
  |  |21883|    383|#define TOK_LAST_KEYWORD    TOK_AWAIT
  ------------------
  |  Branch (22210:13): [True: 64, False: 319]
  ------------------
22211|     64|            JS_FreeAtom(s->ctx, token->u.ident.atom);
22212|     64|        }
22213|    395|        break;
22214|    791|    }
22215|    791|}
quickjs.c:js_get_length64:
41139|      3|{
41140|      3|    JSValue len_val;
41141|      3|    len_val = JS_GetProperty(ctx, obj, JS_ATOM_length);
41142|      3|    if (JS_IsException(len_val)) {
  ------------------
  |  Branch (41142:9): [True: 0, False: 3]
  ------------------
41143|      0|        *pres = 0;
41144|      0|        return -1;
41145|      0|    }
41146|      3|    return JS_ToLengthFree(ctx, pres, len_val);
41147|      3|}
quickjs.c:JS_ToStringFree:
13651|      1|{
13652|      1|    JSValue ret;
13653|      1|    ret = JS_ToString(ctx, val);
13654|      1|    JS_FreeValue(ctx, val);
13655|      1|    return ret;
13656|      1|}
quickjs.c:js_sub_string:
 3965|   171k|{
 3966|   171k|    int len = end - start;
 3967|   171k|    if (start == 0 && end == p->len) {
  ------------------
  |  Branch (3967:9): [True: 1, False: 171k]
  |  Branch (3967:23): [True: 0, False: 1]
  ------------------
 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|   171k|    if (p->is_wide_char && len > 0) {
  ------------------
  |  Branch (3970:9): [True: 171k, False: 0]
  |  Branch (3970:28): [True: 36.3k, False: 135k]
  ------------------
 3971|  36.3k|        JSString *str;
 3972|  36.3k|        int i;
 3973|  36.3k|        uint16_t c = 0;
 3974|   672k|        for (i = start; i < end; i++) {
  ------------------
  |  Branch (3974:25): [True: 636k, False: 36.3k]
  ------------------
 3975|   636k|            c |= p->u.str16[i];
 3976|   636k|        }
 3977|  36.3k|        if (c > 0xFF)
  ------------------
  |  Branch (3977:13): [True: 625, False: 35.7k]
  ------------------
 3978|    625|            return js_new_string16_len(ctx, p->u.str16 + start, len);
 3979|       |
 3980|  35.7k|        str = js_alloc_string(ctx, len, 0);
 3981|  35.7k|        if (!str)
  ------------------
  |  Branch (3981:13): [True: 0, False: 35.7k]
  ------------------
 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|   658k|        for (i = 0; i < len; i++) {
  ------------------
  |  Branch (3983:21): [True: 622k, False: 35.7k]
  ------------------
 3984|   622k|            str->u.str8[i] = p->u.str16[start + i];
 3985|   622k|        }
 3986|  35.7k|        str->u.str8[len] = '\0';
 3987|  35.7k|        return JS_MKPTR(JS_TAG_STRING, str);
  ------------------
  |  |  248|  35.7k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3988|   135k|    } else {
 3989|   135k|        return js_new_string8_len(ctx, (const char *)(p->u.str8 + start), len);
 3990|   135k|    }
 3991|   171k|}
quickjs.c:JS_CreateDataPropertyUint32:
10750|   171k|{
10751|   171k|    return JS_DefinePropertyValueValue(ctx, this_obj, JS_NewInt64(ctx, idx),
10752|   171k|                                       val, flags | JS_PROP_CONFIGURABLE |
  ------------------
  |  |  298|   171k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
10753|   171k|                                       JS_PROP_ENUMERABLE | JS_PROP_WRITABLE);
  ------------------
  |  |  300|   171k|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                                                     JS_PROP_ENUMERABLE | JS_PROP_WRITABLE);
  ------------------
  |  |  299|   171k|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10754|   171k|}
quickjs.c:JS_AtomGetStr:
 3591|    270|{
 3592|    270|    return JS_AtomGetStrRT(ctx->rt, buf, buf_size, atom);
 3593|    270|}
quickjs.c:js_new_promise_capability:
53748|     22|{
53749|     22|    JSValue executor, result_promise;
53750|     22|    JSCFunctionDataRecord *s;
53751|     22|    int i;
53752|       |
53753|     22|    executor = js_promise_executor_new(ctx);
53754|     22|    if (JS_IsException(executor))
  ------------------
  |  Branch (53754:9): [True: 0, False: 22]
  ------------------
53755|      0|        return executor;
53756|       |
53757|     22|    if (JS_IsUndefined(ctor)) {
  ------------------
  |  Branch (53757:9): [True: 22, False: 0]
  ------------------
53758|     22|        result_promise = js_promise_constructor(ctx, ctor, 1,
53759|     22|                                                (JSValueConst *)&executor);
53760|     22|    } else {
53761|      0|        result_promise = JS_CallConstructor(ctx, ctor, 1,
53762|      0|                                            (JSValueConst *)&executor);
53763|      0|    }
53764|     22|    if (JS_IsException(result_promise))
  ------------------
  |  Branch (53764:9): [True: 0, False: 22]
  ------------------
53765|      0|        goto fail;
53766|     22|    s = JS_GetOpaque(executor, JS_CLASS_C_FUNCTION_DATA);
53767|     66|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53767:16): [True: 44, False: 22]
  ------------------
53768|     44|        if (check_function(ctx, s->data[i]))
  ------------------
  |  Branch (53768:13): [True: 0, False: 44]
  ------------------
53769|      0|            goto fail;
53770|     44|    }
53771|     66|    for(i = 0; i < 2; i++)
  ------------------
  |  Branch (53771:16): [True: 44, False: 22]
  ------------------
53772|     44|        resolving_funcs[i] = JS_DupValue(ctx, s->data[i]);
53773|     22|    JS_FreeValue(ctx, executor);
53774|     22|    return result_promise;
53775|      0| fail:
53776|      0|    JS_FreeValue(ctx, executor);
53777|      0|    JS_FreeValue(ctx, result_promise);
53778|      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 }
  |  |  ------------------
  ------------------
53779|     22|}
quickjs.c:js_promise_executor_new:
53736|     22|{
53737|     22|    JSValueConst func_data[2];
  ------------------
  |  |  234|     22|#define JSValueConst JSValue
  ------------------
53738|       |
53739|     22|    func_data[0] = JS_UNDEFINED;
  ------------------
  |  |  291|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53740|     22|    func_data[1] = JS_UNDEFINED;
  ------------------
  |  |  291|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53741|     22|    return JS_NewCFunctionData(ctx, js_promise_executor, 2,
53742|     22|                               0, 2, func_data);
53743|     22|}
quickjs.c:js_promise_executor:
53724|     22|{
53725|     22|    int i;
53726|       |
53727|     66|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53727:16): [True: 44, False: 22]
  ------------------
53728|     44|        if (!JS_IsUndefined(func_data[i]))
  ------------------
  |  Branch (53728:13): [True: 0, False: 44]
  ------------------
53729|      0|            return JS_ThrowTypeError(ctx, "resolving function already set");
53730|     44|        func_data[i] = JS_DupValue(ctx, argv[i]);
53731|     44|    }
53732|     22|    return JS_UNDEFINED;
  ------------------
  |  |  291|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53733|     22|}
quickjs.c:js_promise_finalizer:
53633|     22|{
53634|     22|    JSPromiseData *s = JS_GetOpaque(val, JS_CLASS_PROMISE);
53635|     22|    struct list_head *el, *el1;
53636|     22|    int i;
53637|       |
53638|     22|    if (!s)
  ------------------
  |  Branch (53638:9): [True: 0, False: 22]
  ------------------
53639|      0|        return;
53640|     66|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53640:16): [True: 44, False: 22]
  ------------------
53641|     44|        list_for_each_safe(el, el1, &s->promise_reactions[i]) {
  ------------------
  |  |   89|     44|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 44]
  |  |  ------------------
  |  |   90|     44|        el = el1, el1 = el->next)
  ------------------
53642|      0|            JSPromiseReactionData *rd =
53643|       |                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)))
  |  |  ------------------
  ------------------
53644|      0|            promise_reaction_data_free(rt, rd);
53645|      0|        }
53646|     44|    }
53647|     22|    JS_FreeValueRT(rt, s->promise_result);
53648|     22|    js_free_rt(rt, s);
53649|     22|}
quickjs.c:js_promise_mark:
53653|     34|{
53654|     34|    JSPromiseData *s = JS_GetOpaque(val, JS_CLASS_PROMISE);
53655|     34|    struct list_head *el;
53656|     34|    int i;
53657|       |
53658|     34|    if (!s)
  ------------------
  |  Branch (53658:9): [True: 0, False: 34]
  ------------------
53659|      0|        return;
53660|    102|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53660:16): [True: 68, False: 34]
  ------------------
53661|     68|        list_for_each(el, &s->promise_reactions[i]) {
  ------------------
  |  |   86|     68|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 0, False: 68]
  |  |  ------------------
  ------------------
53662|      0|            JSPromiseReactionData *rd =
53663|       |                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)))
  |  |  ------------------
  ------------------
53664|      0|            JS_MarkValue(rt, rd->resolving_funcs[0], mark_func);
53665|      0|            JS_MarkValue(rt, rd->resolving_funcs[1], mark_func);
53666|      0|            JS_MarkValue(rt, rd->handler, mark_func);
53667|      0|        }
53668|     68|    }
53669|     34|    JS_MarkValue(rt, s->promise_result, mark_func);
53670|     34|}
quickjs.c:js_promise_resolve_function_finalizer:
53561|     44|{
53562|     44|    JSPromiseFunctionData *s = JS_VALUE_GET_OBJ(val)->u.promise_function_data;
  ------------------
  |  |  229|     44|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     44|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
53563|     44|    if (s) {
  ------------------
  |  Branch (53563:9): [True: 44, False: 0]
  ------------------
53564|     44|        js_promise_resolve_function_free_resolved(rt, s->presolved);
53565|     44|        JS_FreeValueRT(rt, s->promise);
53566|     44|        js_free_rt(rt, s);
53567|     44|    }
53568|     44|}
quickjs.c:js_promise_resolve_function_free_resolved:
53512|     66|{
53513|     66|    if (--sr->ref_count == 0) {
  ------------------
  |  Branch (53513:9): [True: 22, False: 44]
  ------------------
53514|     22|        js_free_rt(rt, sr);
53515|     22|    }
53516|     66|}
quickjs.c:js_promise_resolve_function_mark:
53572|     68|{
53573|     68|    JSPromiseFunctionData *s = JS_VALUE_GET_OBJ(val)->u.promise_function_data;
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
53574|     68|    if (s) {
  ------------------
  |  Branch (53574:9): [True: 68, False: 0]
  ------------------
53575|     68|        JS_MarkValue(rt, s->promise, mark_func);
53576|     68|    }
53577|     68|}
quickjs.c:js_promise_resolve_function_call:
53584|     22|{
53585|     22|    JSObject *p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  229|     22|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     22|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
53586|     22|    JSPromiseFunctionData *s;
53587|     22|    JSValueConst resolution, args[3];
  ------------------
  |  |  234|     22|#define JSValueConst JSValue
  ------------------
53588|     22|    JSValue then;
53589|     22|    BOOL is_reject;
53590|       |
53591|     22|    s = p->u.promise_function_data;
53592|     22|    if (!s || s->presolved->already_resolved)
  ------------------
  |  Branch (53592:9): [True: 0, False: 22]
  |  Branch (53592:15): [True: 0, False: 22]
  ------------------
53593|      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 }
  |  |  ------------------
  ------------------
53594|     22|    s->presolved->already_resolved = TRUE;
53595|     22|    is_reject = p->class_id - JS_CLASS_PROMISE_RESOLVE_FUNCTION;
53596|     22|    if (argc > 0)
  ------------------
  |  Branch (53596:9): [True: 22, False: 0]
  ------------------
53597|     22|        resolution = argv[0];
53598|      0|    else
53599|      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 }
  |  |  ------------------
  ------------------
53600|       |#ifdef DUMP_PROMISE
53601|       |    printf("js_promise_resolving_function_call: is_reject=%d ", is_reject);
53602|       |    JS_DumpValue(ctx, "resolution", resolution);
53603|       |    printf("\n");
53604|       |#endif
53605|     22|    if (is_reject || !JS_IsObject(resolution)) {
  ------------------
  |  Branch (53605:9): [True: 0, False: 22]
  |  Branch (53605:22): [True: 22, False: 0]
  ------------------
53606|     22|        goto done;
53607|     22|    } else if (js_same_value(ctx, resolution, s->promise)) {
  ------------------
  |  Branch (53607:16): [True: 0, False: 0]
  ------------------
53608|      0|        JS_ThrowTypeError(ctx, "promise self resolution");
53609|      0|        goto fail_reject;
53610|      0|    }
53611|      0|    then = JS_GetProperty(ctx, resolution, JS_ATOM_then);
53612|      0|    if (JS_IsException(then)) {
  ------------------
  |  Branch (53612:9): [True: 0, False: 0]
  ------------------
53613|      0|        JSValue error;
53614|      0|    fail_reject:
53615|      0|        error = JS_GetException(ctx);
53616|      0|        reject_promise(ctx, s->promise, error);
53617|      0|        JS_FreeValue(ctx, error);
53618|      0|    } else if (!JS_IsFunction(ctx, then)) {
  ------------------
  |  Branch (53618:16): [True: 0, False: 0]
  ------------------
53619|      0|        JS_FreeValue(ctx, then);
53620|     22|    done:
53621|     22|        fulfill_or_reject_promise(ctx, s->promise, resolution, is_reject);
53622|     22|    } else {
53623|      0|        args[0] = s->promise;
53624|      0|        args[1] = resolution;
53625|      0|        args[2] = then;
53626|      0|        JS_EnqueueJob(ctx, js_promise_resolve_thenable_job, 3, args);
53627|      0|        JS_FreeValue(ctx, then);
53628|      0|    }
53629|     22|    return JS_UNDEFINED;
  ------------------
  |  |  291|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53630|      0|}
quickjs.c:fulfill_or_reject_promise:
53438|     22|{
53439|     22|    JSPromiseData *s = JS_GetOpaque(promise, JS_CLASS_PROMISE);
53440|     22|    struct list_head *el, *el1;
53441|     22|    JSPromiseReactionData *rd;
53442|     22|    JSValueConst args[5];
  ------------------
  |  |  234|     22|#define JSValueConst JSValue
  ------------------
53443|       |
53444|     22|    if (!s || s->promise_state != JS_PROMISE_PENDING)
  ------------------
  |  Branch (53444:9): [True: 0, False: 22]
  |  Branch (53444:15): [True: 0, False: 22]
  ------------------
53445|      0|        return; /* should never happen */
53446|     22|    set_value(ctx, &s->promise_result, JS_DupValue(ctx, value));
53447|     22|    s->promise_state = JS_PROMISE_FULFILLED + is_reject;
53448|       |#ifdef DUMP_PROMISE
53449|       |    printf("fulfill_or_reject_promise: is_reject=%d\n", is_reject);
53450|       |#endif
53451|     22|    if (s->promise_state == JS_PROMISE_REJECTED && !s->is_handled) {
  ------------------
  |  Branch (53451:9): [True: 0, False: 22]
  |  Branch (53451:52): [True: 0, False: 0]
  ------------------
53452|      0|        JSRuntime *rt = ctx->rt;
53453|      0|        if (rt->host_promise_rejection_tracker) {
  ------------------
  |  Branch (53453:13): [True: 0, False: 0]
  ------------------
53454|      0|            rt->host_promise_rejection_tracker(ctx, promise, value, FALSE,
53455|      0|                                               rt->host_promise_rejection_tracker_opaque);
53456|      0|        }
53457|      0|    }
53458|       |
53459|     22|    list_for_each_safe(el, el1, &s->promise_reactions[is_reject]) {
  ------------------
  |  |   89|     22|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 22]
  |  |  ------------------
  |  |   90|     22|        el = el1, el1 = el->next)
  ------------------
53460|      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)))
  |  |  ------------------
  ------------------
53461|      0|        args[0] = rd->resolving_funcs[0];
53462|      0|        args[1] = rd->resolving_funcs[1];
53463|      0|        args[2] = rd->handler;
53464|      0|        args[3] = JS_NewBool(ctx, is_reject);
53465|      0|        args[4] = value;
53466|      0|        JS_EnqueueJob(ctx, promise_reaction_job, 5, args);
53467|      0|        list_del(&rd->link);
53468|      0|        promise_reaction_data_free(ctx->rt, rd);
53469|      0|    }
53470|       |
53471|     22|    list_for_each_safe(el, el1, &s->promise_reactions[1 - is_reject]) {
  ------------------
  |  |   89|     22|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 22]
  |  |  ------------------
  |  |   90|     22|        el = el1, el1 = el->next)
  ------------------
53472|       |        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)))
  |  |  ------------------
  ------------------
53473|      0|        list_del(&rd->link);
53474|      0|        promise_reaction_data_free(ctx->rt, rd);
53475|      0|    }
53476|     22|}
quickjs.c:js_create_resolving_functions:
53522|     22|{
53523|     22|    JSValue obj;
53524|     22|    JSPromiseFunctionData *s;
53525|     22|    JSPromiseFunctionDataResolved *sr;
53526|     22|    int i, ret;
53527|       |
53528|     22|    sr = js_malloc(ctx, sizeof(*sr));
53529|     22|    if (!sr)
  ------------------
  |  Branch (53529:9): [True: 0, False: 22]
  ------------------
53530|      0|        return -1;
53531|     22|    sr->ref_count = 1;
53532|     22|    sr->already_resolved = FALSE; /* must be shared between the two functions */
53533|     22|    ret = 0;
53534|     66|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53534:16): [True: 44, False: 22]
  ------------------
53535|     44|        obj = JS_NewObjectProtoClass(ctx, ctx->function_proto,
53536|     44|                                     JS_CLASS_PROMISE_RESOLVE_FUNCTION + i);
53537|     44|        if (JS_IsException(obj))
  ------------------
  |  Branch (53537:13): [True: 0, False: 44]
  ------------------
53538|      0|            goto fail;
53539|     44|        s = js_malloc(ctx, sizeof(*s));
53540|     44|        if (!s) {
  ------------------
  |  Branch (53540:13): [True: 0, False: 44]
  ------------------
53541|      0|            JS_FreeValue(ctx, obj);
53542|      0|        fail:
53543|       |
53544|      0|            if (i != 0)
  ------------------
  |  Branch (53544:17): [True: 0, False: 0]
  ------------------
53545|      0|                JS_FreeValue(ctx, resolving_funcs[0]);
53546|      0|            ret = -1;
53547|      0|            break;
53548|      0|        }
53549|     44|        sr->ref_count++;
53550|     44|        s->presolved = sr;
53551|     44|        s->promise = JS_DupValue(ctx, promise);
53552|     44|        JS_SetOpaque(obj, s);
53553|     44|        js_function_set_properties(ctx, obj, JS_ATOM_empty_string, 1);
53554|     44|        resolving_funcs[i] = obj;
53555|     44|    }
53556|     22|    js_promise_resolve_function_free_resolved(ctx->rt, sr);
53557|     22|    return ret;
53558|     22|}
quickjs.c:js_async_function_call:
21322|     11|{
21323|     11|    JSValue promise;
21324|     11|    JSAsyncFunctionState *s;
21325|       |
21326|     11|    s = async_func_init(ctx, func_obj, this_obj, argc, argv);
21327|     11|    if (!s)
  ------------------
  |  Branch (21327:9): [True: 0, False: 11]
  ------------------
21328|      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 }
  |  |  ------------------
  ------------------
21329|       |
21330|     11|    promise = JS_NewPromiseCapability(ctx, s->resolving_funcs);
21331|     11|    if (JS_IsException(promise)) {
  ------------------
  |  Branch (21331:9): [True: 0, False: 11]
  ------------------
21332|      0|        async_func_free(ctx->rt, s);
21333|      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 }
  |  |  ------------------
  ------------------
21334|      0|    }
21335|       |
21336|     11|    js_async_function_resume(ctx, s);
21337|       |
21338|     11|    async_func_free(ctx->rt, s);
21339|       |
21340|     11|    return promise;
21341|     11|}
quickjs.c:js_async_function_resume:
21239|     11|{
21240|     11|    JSValue func_ret, ret2;
21241|       |
21242|     11|    func_ret = async_func_resume(ctx, s);
21243|     11|    if (s->is_completed) {
  ------------------
  |  Branch (21243:9): [True: 11, False: 0]
  ------------------
21244|     11|        if (JS_IsException(func_ret)) {
  ------------------
  |  Branch (21244:13): [True: 0, False: 11]
  ------------------
21245|      0|            JSValue error;
21246|      0|        fail:
21247|      0|            error = JS_GetException(ctx);
21248|      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 }
  |  |  ------------------
  ------------------
21249|      0|                           1, (JSValueConst *)&error);
21250|      0|            JS_FreeValue(ctx, error);
21251|      0|            JS_FreeValue(ctx, ret2); /* XXX: what to do if exception ? */
21252|     11|        } else {
21253|       |            /* normal return */
21254|     11|            ret2 = JS_Call(ctx, s->resolving_funcs[0], 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 }
  |  |  ------------------
  ------------------
21255|     11|                           1, (JSValueConst *)&func_ret);
21256|     11|            JS_FreeValue(ctx, func_ret);
21257|     11|            JS_FreeValue(ctx, ret2); /* XXX: what to do if exception ? */
21258|     11|        }
21259|     11|    } else {
21260|      0|        JSValue value, promise, resolving_funcs[2], resolving_funcs1[2];
21261|      0|        int i, res;
21262|       |
21263|      0|        value = s->frame.cur_sp[-1];
21264|      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 }
  |  |  ------------------
  ------------------
21265|       |
21266|       |        /* await */
21267|      0|        JS_FreeValue(ctx, func_ret); /* not used */
21268|      0|        promise = js_promise_resolve(ctx, ctx->promise_ctor,
21269|      0|                                     1, (JSValueConst *)&value, 0);
21270|      0|        JS_FreeValue(ctx, value);
21271|      0|        if (JS_IsException(promise))
  ------------------
  |  Branch (21271:13): [True: 0, False: 0]
  ------------------
21272|      0|            goto fail;
21273|      0|        if (js_async_function_resolve_create(ctx, s, resolving_funcs)) {
  ------------------
  |  Branch (21273:13): [True: 0, False: 0]
  ------------------
21274|      0|            JS_FreeValue(ctx, promise);
21275|      0|            goto fail;
21276|      0|        }
21277|       |
21278|       |        /* Note: no need to create 'thrownawayCapability' as in
21279|       |           the spec */
21280|      0|        for(i = 0; i < 2; i++)
  ------------------
  |  Branch (21280:20): [True: 0, False: 0]
  ------------------
21281|      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 }
  |  |  ------------------
  ------------------
21282|      0|        res = perform_promise_then(ctx, promise,
21283|      0|                                   (JSValueConst *)resolving_funcs,
21284|      0|                                   (JSValueConst *)resolving_funcs1);
21285|      0|        JS_FreeValue(ctx, promise);
21286|      0|        for(i = 0; i < 2; i++)
  ------------------
  |  Branch (21286:20): [True: 0, False: 0]
  ------------------
21287|      0|            JS_FreeValue(ctx, resolving_funcs[i]);
21288|      0|        if (res)
  ------------------
  |  Branch (21288:13): [True: 0, False: 0]
  ------------------
21289|      0|            goto fail;
21290|      0|    }
21291|     11|}
quickjs.c:js_promise_constructor:
53674|     22|{
53675|     22|    JSValueConst executor;
  ------------------
  |  |  234|     22|#define JSValueConst JSValue
  ------------------
53676|     22|    JSValue obj;
53677|     22|    JSPromiseData *s;
53678|     22|    JSValue args[2], ret;
53679|     22|    int i;
53680|       |
53681|     22|    executor = argv[0];
53682|     22|    if (check_function(ctx, executor))
  ------------------
  |  Branch (53682:9): [True: 0, False: 22]
  ------------------
53683|      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 }
  |  |  ------------------
  ------------------
53684|     22|    obj = js_create_from_ctor(ctx, new_target, JS_CLASS_PROMISE);
53685|     22|    if (JS_IsException(obj))
  ------------------
  |  Branch (53685:9): [True: 0, False: 22]
  ------------------
53686|      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 }
  |  |  ------------------
  ------------------
53687|     22|    s = js_mallocz(ctx, sizeof(*s));
53688|     22|    if (!s)
  ------------------
  |  Branch (53688:9): [True: 0, False: 22]
  ------------------
53689|      0|        goto fail;
53690|     22|    s->promise_state = JS_PROMISE_PENDING;
53691|     22|    s->is_handled = FALSE;
53692|     66|    for(i = 0; i < 2; i++)
  ------------------
  |  Branch (53692:16): [True: 44, False: 22]
  ------------------
53693|     44|        init_list_head(&s->promise_reactions[i]);
53694|     22|    s->promise_result = JS_UNDEFINED;
  ------------------
  |  |  291|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53695|     22|    JS_SetOpaque(obj, s);
53696|     22|    if (js_create_resolving_functions(ctx, args, obj))
  ------------------
  |  Branch (53696:9): [True: 0, False: 22]
  ------------------
53697|      0|        goto fail;
53698|     22|    ret = JS_Call(ctx, executor, JS_UNDEFINED, 2, (JSValueConst *)args);
  ------------------
  |  |  291|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
53699|     22|    if (JS_IsException(ret)) {
  ------------------
  |  Branch (53699:9): [True: 0, False: 22]
  ------------------
53700|      0|        JSValue ret2, error;
53701|      0|        error = JS_GetException(ctx);
53702|      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 }
  |  |  ------------------
  ------------------
53703|      0|        JS_FreeValue(ctx, error);
53704|      0|        if (JS_IsException(ret2))
  ------------------
  |  Branch (53704:13): [True: 0, False: 0]
  ------------------
53705|      0|            goto fail1;
53706|      0|        JS_FreeValue(ctx, ret2);
53707|      0|    }
53708|     22|    JS_FreeValue(ctx, ret);
53709|     22|    JS_FreeValue(ctx, args[0]);
53710|     22|    JS_FreeValue(ctx, args[1]);
53711|     22|    return obj;
53712|      0| fail1:
53713|      0|    JS_FreeValue(ctx, args[0]);
53714|      0|    JS_FreeValue(ctx, args[1]);
53715|      0| fail:
53716|      0|    JS_FreeValue(ctx, obj);
53717|      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 }
  |  |  ------------------
  ------------------
53718|      0|}
quickjs.c:js_create_from_ctor:
20785|     22|{
20786|     22|    JSValue proto, obj;
20787|     22|    JSContext *realm;
20788|       |
20789|     22|    if (JS_IsUndefined(ctor)) {
  ------------------
  |  Branch (20789:9): [True: 22, False: 0]
  ------------------
20790|     22|        proto = JS_DupValue(ctx, ctx->class_proto[class_id]);
20791|     22|    } else {
20792|      0|        proto = JS_GetProperty(ctx, ctor, JS_ATOM_prototype);
20793|      0|        if (JS_IsException(proto))
  ------------------
  |  Branch (20793:13): [True: 0, False: 0]
  ------------------
20794|      0|            return proto;
20795|      0|        if (!JS_IsObject(proto)) {
  ------------------
  |  Branch (20795:13): [True: 0, False: 0]
  ------------------
20796|      0|            JS_FreeValue(ctx, proto);
20797|      0|            realm = JS_GetFunctionRealm(ctx, ctor);
20798|      0|            if (!realm)
  ------------------
  |  Branch (20798:17): [True: 0, False: 0]
  ------------------
20799|      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 }
  |  |  ------------------
  ------------------
20800|      0|            proto = JS_DupValue(ctx, realm->class_proto[class_id]);
20801|      0|        }
20802|      0|    }
20803|     22|    obj = JS_NewObjectProtoClass(ctx, proto, class_id);
20804|     22|    JS_FreeValue(ctx, proto);
20805|     22|    return obj;
20806|     22|}
quickjs.c:JS_SetObjectData:
 5806|     34|{
 5807|     34|    JSObject *p;
 5808|       |
 5809|     34|    if (JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT) {
  ------------------
  |  |  236|     34|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5809:9): [True: 34, False: 0]
  ------------------
 5810|     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)
  |  |  ------------------
  ------------------
 5811|     34|        switch(p->class_id) {
  ------------------
  |  Branch (5811:16): [True: 34, False: 0]
  ------------------
 5812|     11|        case JS_CLASS_NUMBER:
  ------------------
  |  Branch (5812:9): [True: 11, False: 23]
  ------------------
 5813|     22|        case JS_CLASS_STRING:
  ------------------
  |  Branch (5813:9): [True: 11, False: 23]
  ------------------
 5814|     34|        case JS_CLASS_BOOLEAN:
  ------------------
  |  Branch (5814:9): [True: 12, False: 22]
  ------------------
 5815|     34|        case JS_CLASS_SYMBOL:
  ------------------
  |  Branch (5815:9): [True: 0, False: 34]
  ------------------
 5816|     34|        case JS_CLASS_DATE:
  ------------------
  |  Branch (5816:9): [True: 0, False: 34]
  ------------------
 5817|     34|        case JS_CLASS_BIG_INT:
  ------------------
  |  Branch (5817:9): [True: 0, False: 34]
  ------------------
 5818|     34|            JS_FreeValue(ctx, p->u.object_data);
 5819|     34|            p->u.object_data = val; /* for JS_CLASS_STRING, 'val' must
 5820|       |                                       be JS_TAG_STRING (and not a
 5821|       |                                       rope) */
 5822|     34|            return 0;
 5823|     34|        }
 5824|     34|    }
 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|     34|}
quickjs.c:__JS_EvalInternal:
37191|     22|{
37192|     22|    JSParseState s1, *s = &s1;
37193|     22|    int err, js_mode, eval_type;
37194|     22|    JSValue fun_obj, ret_val;
37195|     22|    JSStackFrame *sf;
37196|     22|    JSVarRef **var_refs;
37197|     22|    JSFunctionBytecode *b;
37198|     22|    JSFunctionDef *fd;
37199|     22|    JSModuleDef *m;
37200|       |
37201|     22|    js_parse_init(ctx, s, input, input_len, filename);
37202|     22|    skip_shebang(&s->buf_ptr, s->buf_end);
37203|       |
37204|     22|    eval_type = flags & JS_EVAL_TYPE_MASK;
  ------------------
  |  |  336|     22|#define JS_EVAL_TYPE_MASK     (3 << 0)
  ------------------
37205|     22|    m = NULL;
37206|     22|    if (eval_type == JS_EVAL_TYPE_DIRECT) {
  ------------------
  |  |  334|     22|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
  |  Branch (37206:9): [True: 0, False: 22]
  ------------------
37207|      0|        JSObject *p;
37208|      0|        sf = ctx->rt->current_stack_frame;
37209|      0|        assert(sf != NULL);
  ------------------
  |  Branch (37209:9): [True: 0, False: 0]
  |  Branch (37209:9): [True: 0, False: 0]
  ------------------
37210|      0|        assert(JS_VALUE_GET_TAG(sf->cur_func) == JS_TAG_OBJECT);
  ------------------
  |  Branch (37210:9): [True: 0, False: 0]
  |  Branch (37210:9): [True: 0, False: 0]
  ------------------
37211|      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)
  |  |  ------------------
  ------------------
37212|      0|        assert(js_class_has_bytecode(p->class_id));
  ------------------
  |  Branch (37212:9): [True: 0, False: 0]
  |  Branch (37212:9): [True: 0, False: 0]
  ------------------
37213|      0|        b = p->u.func.function_bytecode;
37214|      0|        var_refs = p->u.func.var_refs;
37215|      0|        js_mode = b->js_mode;
37216|     22|    } else {
37217|     22|        sf = NULL;
37218|     22|        b = NULL;
37219|     22|        var_refs = NULL;
37220|     22|        js_mode = 0;
37221|     22|        if (flags & JS_EVAL_FLAG_STRICT)
  ------------------
  |  |  338|     22|#define JS_EVAL_FLAG_STRICT   (1 << 3) /* force 'strict' mode */
  ------------------
  |  Branch (37221:13): [True: 0, False: 22]
  ------------------
37222|      0|            js_mode |= JS_MODE_STRICT;
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
37223|     22|        if (eval_type == JS_EVAL_TYPE_MODULE) {
  ------------------
  |  |  333|     22|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (37223:13): [True: 11, False: 11]
  ------------------
37224|     11|            JSAtom module_name = JS_NewAtom(ctx, filename);
37225|     11|            if (module_name == JS_ATOM_NULL)
  ------------------
  |  |  451|     11|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (37225:17): [True: 0, False: 11]
  ------------------
37226|      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 }
  |  |  ------------------
  ------------------
37227|     11|            m = js_new_module_def(ctx, module_name);
37228|     11|            if (!m)
  ------------------
  |  Branch (37228:17): [True: 0, False: 11]
  ------------------
37229|      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 }
  |  |  ------------------
  ------------------
37230|     11|            js_mode |= JS_MODE_STRICT;
  ------------------
  |  |  403|     11|#define JS_MODE_STRICT (1 << 0)
  ------------------
37231|     11|        }
37232|     22|    }
37233|     22|    fd = js_new_function_def(ctx, NULL, TRUE, FALSE, filename,
37234|     22|                             s->buf_start, &s->get_line_col_cache);
37235|     22|    if (!fd)
  ------------------
  |  Branch (37235:9): [True: 0, False: 22]
  ------------------
37236|      0|        goto fail1;
37237|     22|    s->cur_func = fd;
37238|     22|    fd->eval_type = eval_type;
37239|     22|    fd->has_this_binding = (eval_type != JS_EVAL_TYPE_DIRECT);
  ------------------
  |  |  334|     22|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
37240|     22|    if (eval_type == JS_EVAL_TYPE_DIRECT) {
  ------------------
  |  |  334|     22|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
  |  Branch (37240:9): [True: 0, False: 22]
  ------------------
37241|      0|        fd->new_target_allowed = b->new_target_allowed;
37242|      0|        fd->super_call_allowed = b->super_call_allowed;
37243|      0|        fd->super_allowed = b->super_allowed;
37244|      0|        fd->arguments_allowed = b->arguments_allowed;
37245|     22|    } else {
37246|     22|        fd->new_target_allowed = FALSE;
37247|     22|        fd->super_call_allowed = FALSE;
37248|     22|        fd->super_allowed = FALSE;
37249|     22|        fd->arguments_allowed = TRUE;
37250|     22|    }
37251|     22|    fd->js_mode = js_mode;
37252|     22|    fd->func_name = JS_DupAtom(ctx, JS_ATOM__eval_);
37253|     22|    if (b) {
  ------------------
  |  Branch (37253:9): [True: 0, False: 22]
  ------------------
37254|      0|        if (add_closure_variables(ctx, fd, b, scope_idx))
  ------------------
  |  Branch (37254:13): [True: 0, False: 0]
  ------------------
37255|      0|            goto fail;
37256|      0|    }
37257|     22|    fd->module = m;
37258|     22|    if (m != NULL || (flags & JS_EVAL_FLAG_ASYNC)) {
  ------------------
  |  |  347|     11|#define JS_EVAL_FLAG_ASYNC (1 << 7)
  ------------------
  |  Branch (37258:9): [True: 11, False: 11]
  |  Branch (37258:22): [True: 0, False: 11]
  ------------------
37259|     11|        fd->in_function_body = TRUE;
37260|     11|        fd->func_kind = JS_FUNC_ASYNC;
37261|     11|    }
37262|     22|    s->is_module = (m != NULL);
37263|     22|    s->allow_html_comments = !s->is_module;
37264|       |
37265|     22|    push_scope(s); /* body scope */
37266|     22|    fd->body_scope = fd->scope_level;
37267|       |
37268|     22|    err = js_parse_program(s);
37269|     22|    if (err) {
  ------------------
  |  Branch (37269:9): [True: 4, False: 18]
  ------------------
37270|      4|    fail:
37271|      4|        free_token(s, &s->token);
37272|      4|        js_free_function_def(ctx, fd);
37273|      4|        goto fail1;
37274|      4|    }
37275|       |
37276|     18|    if (m != NULL)
  ------------------
  |  Branch (37276:9): [True: 11, False: 7]
  ------------------
37277|     11|        m->has_tla = fd->has_await;
37278|       |
37279|       |    /* create the function object and all the enclosed functions */
37280|     18|    fun_obj = js_create_function(ctx, fd);
37281|     18|    if (JS_IsException(fun_obj))
  ------------------
  |  Branch (37281:9): [True: 0, False: 18]
  ------------------
37282|      0|        goto fail1;
37283|       |    /* Could add a flag to avoid resolution if necessary */
37284|     18|    if (m) {
  ------------------
  |  Branch (37284:9): [True: 11, False: 7]
  ------------------
37285|     11|        m->func_obj = fun_obj;
37286|     11|        if (js_resolve_module(ctx, m) < 0)
  ------------------
  |  Branch (37286:13): [True: 0, False: 11]
  ------------------
37287|      0|            goto fail1;
37288|     11|        fun_obj = JS_NewModuleValue(ctx, m);
37289|     11|    }
37290|     18|    if (flags & JS_EVAL_FLAG_COMPILE_ONLY) {
  ------------------
  |  |  342|     18|#define JS_EVAL_FLAG_COMPILE_ONLY (1 << 5)
  ------------------
  |  Branch (37290:9): [True: 11, False: 7]
  ------------------
37291|     11|        ret_val = fun_obj;
37292|     11|    } else {
37293|      7|        ret_val = JS_EvalFunctionInternal(ctx, fun_obj, this_obj, var_refs, sf);
37294|      7|    }
37295|     18|    return ret_val;
37296|      4| fail1:
37297|       |    /* XXX: should free all the unresolved dependencies */
37298|      4|    if (m)
  ------------------
  |  Branch (37298:9): [True: 0, False: 4]
  ------------------
37299|      0|        JS_FreeValue(ctx, JS_MKPTR(JS_TAG_MODULE, m));
  ------------------
  |  |  248|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
37300|      4|    return JS_EXCEPTION;
  ------------------
  |  |  294|      4|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  247|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
37301|     18|}
quickjs.c:js_new_function_def:
32069|     27|{
32070|     27|    JSFunctionDef *fd;
32071|       |
32072|     27|    fd = js_mallocz(ctx, sizeof(*fd));
32073|     27|    if (!fd)
  ------------------
  |  Branch (32073:9): [True: 0, False: 27]
  ------------------
32074|      0|        return NULL;
32075|       |
32076|     27|    fd->ctx = ctx;
32077|     27|    init_list_head(&fd->child_list);
32078|       |
32079|       |    /* insert in parent list */
32080|     27|    fd->parent = parent;
32081|     27|    fd->parent_cpool_idx = -1;
32082|     27|    if (parent) {
  ------------------
  |  Branch (32082:9): [True: 5, False: 22]
  ------------------
32083|      5|        list_add_tail(&fd->link, &parent->child_list);
32084|      5|        fd->js_mode = parent->js_mode;
32085|      5|        fd->parent_scope_level = parent->scope_level;
32086|      5|    }
32087|     27|    fd->strip_debug = ((ctx->rt->strip_flags & JS_STRIP_DEBUG) != 0);
  ------------------
  |  |  931|     27|#define JS_STRIP_DEBUG  (1 << 1) /* strip all debug info including source code */
  ------------------
32088|     27|    fd->strip_source = ((ctx->rt->strip_flags & (JS_STRIP_DEBUG | JS_STRIP_SOURCE)) != 0);
  ------------------
  |  |  931|     27|#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|     27|#define JS_STRIP_SOURCE (1 << 0) /* strip source code */
  ------------------
32089|       |
32090|     27|    fd->is_eval = is_eval;
32091|     27|    fd->is_func_expr = is_func_expr;
32092|     27|    js_dbuf_bytecode_init(ctx, &fd->byte_code);
32093|     27|    fd->last_opcode_pos = -1;
32094|     27|    fd->func_name = JS_ATOM_NULL;
  ------------------
  |  |  451|     27|#define JS_ATOM_NULL 0
  ------------------
32095|     27|    fd->var_object_idx = -1;
32096|     27|    fd->arg_var_object_idx = -1;
32097|     27|    fd->arguments_var_idx = -1;
32098|     27|    fd->arguments_arg_idx = -1;
32099|     27|    fd->func_var_idx = -1;
32100|     27|    fd->eval_ret_idx = -1;
32101|     27|    fd->this_var_idx = -1;
32102|     27|    fd->new_target_var_idx = -1;
32103|     27|    fd->this_active_func_var_idx = -1;
32104|     27|    fd->home_object_var_idx = -1;
32105|       |
32106|       |    /* XXX: should distinguish arg, var and var object and body scopes */
32107|     27|    fd->scopes = fd->def_scope_array;
32108|     27|    fd->scope_size = countof(fd->def_scope_array);
  ------------------
  |  |   47|     27|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
32109|     27|    fd->scope_count = 1;
32110|     27|    fd->scopes[0].first = -1;
32111|     27|    fd->scopes[0].parent = -1;
32112|     27|    fd->scope_level = 0;  /* 0: var/arg scope */
32113|     27|    fd->scope_first = -1;
32114|     27|    fd->body_scope = -1;
32115|       |
32116|     27|    fd->filename = JS_NewAtom(ctx, filename);
32117|     27|    fd->source_pos = source_ptr - get_line_col_cache->buf_start;
32118|     27|    fd->get_line_col_cache = get_line_col_cache;
32119|       |    
32120|     27|    js_dbuf_init(ctx, &fd->pc2line);
32121|       |    //fd->pc2line_last_line_num = line_num;
32122|       |    //fd->pc2line_last_pc = 0;
32123|     27|    fd->last_opcode_source_ptr = source_ptr;
32124|     27|    return fd;
32125|     27|}
quickjs.c:js_dbuf_bytecode_init:
 1953|     67|{
 1954|     67|    dbuf_init2(s, ctx->rt, js_realloc_bytecode_rt);
 1955|     67|}
quickjs.c:js_realloc_bytecode_rt:
 1941|    635|{
 1942|    635|    JSRuntime *rt = opaque;
 1943|    635|    if (size > (INT32_MAX / 2)) {
  ------------------
  |  Branch (1943:9): [True: 0, False: 635]
  ------------------
 1944|       |        /* the bytecode cannot be larger than 2G. Leave some slack to 
 1945|       |           avoid some overflows. */
 1946|      0|        return NULL;
 1947|    635|    } else {
 1948|    635|        return js_realloc_rt(rt, ptr, size);
 1949|    635|    }
 1950|    635|}
quickjs.c:push_scope:
24106|     47|static int push_scope(JSParseState *s) {
24107|     47|    if (s->cur_func) {
  ------------------
  |  Branch (24107:9): [True: 47, False: 0]
  ------------------
24108|     47|        JSFunctionDef *fd = s->cur_func;
24109|     47|        int scope = fd->scope_count;
24110|       |        /* XXX: should check for scope overflow */
24111|     47|        if ((fd->scope_count + 1) > fd->scope_size) {
  ------------------
  |  Branch (24111:13): [True: 5, False: 42]
  ------------------
24112|      5|            int new_size;
24113|      5|            size_t slack;
24114|      5|            JSVarScope *new_buf;
24115|       |            /* XXX: potential arithmetic overflow */
24116|      5|            new_size = max_int(fd->scope_count + 1, fd->scope_size * 3 / 2);
24117|      5|            if (fd->scopes == fd->def_scope_array) {
  ------------------
  |  Branch (24117:17): [True: 2, False: 3]
  ------------------
24118|      2|                new_buf = js_realloc2(s->ctx, NULL, new_size * sizeof(*fd->scopes), &slack);
24119|      2|                if (!new_buf)
  ------------------
  |  Branch (24119:21): [True: 0, False: 2]
  ------------------
24120|      0|                    return -1;
24121|      2|                memcpy(new_buf, fd->scopes, fd->scope_count * sizeof(*fd->scopes));
24122|      3|            } else {
24123|      3|                new_buf = js_realloc2(s->ctx, fd->scopes, new_size * sizeof(*fd->scopes), &slack);
24124|      3|                if (!new_buf)
  ------------------
  |  Branch (24124:21): [True: 0, False: 3]
  ------------------
24125|      0|                    return -1;
24126|      3|            }
24127|      5|            new_size += slack / sizeof(*new_buf);
24128|      5|            fd->scopes = new_buf;
24129|      5|            fd->scope_size = new_size;
24130|      5|        }
24131|     47|        fd->scope_count++;
24132|     47|        fd->scopes[scope].parent = fd->scope_level;
24133|     47|        fd->scopes[scope].first = fd->scope_first;
24134|     47|        emit_op(s, OP_enter_scope);
24135|     47|        emit_u16(s, scope);
24136|     47|        return fd->scope_level = scope;
24137|     47|    }
24138|      0|    return 0;
24139|     47|}
quickjs.c:emit_op:
23865|    659|{
23866|    659|    JSFunctionDef *fd = s->cur_func;
23867|    659|    DynBuf *bc = &fd->byte_code;
23868|       |
23869|    659|    fd->last_opcode_pos = bc->size;
23870|    659|    dbuf_putc(bc, val);
23871|    659|}
quickjs.c:emit_u16:
23843|    259|{
23844|    259|    dbuf_put_u16(&s->cur_func->byte_code, val);
23845|    259|}
quickjs.c:js_parse_program:
37079|     22|{
37080|     22|    JSFunctionDef *fd = s->cur_func;
37081|     22|    int idx;
37082|       |
37083|     22|    if (next_token(s))
  ------------------
  |  Branch (37083:9): [True: 1, False: 21]
  ------------------
37084|      1|        return -1;
37085|       |
37086|     21|    if (js_parse_directives(s))
  ------------------
  |  Branch (37086:9): [True: 0, False: 21]
  ------------------
37087|      0|        return -1;
37088|       |
37089|     21|    fd->is_global_var = (fd->eval_type == JS_EVAL_TYPE_GLOBAL) ||
  ------------------
  |  |  332|     21|#define JS_EVAL_TYPE_GLOBAL   (0 << 0) /* global code (default) */
  ------------------
  |  Branch (37089:25): [True: 10, False: 11]
  ------------------
37090|     11|        (fd->eval_type == JS_EVAL_TYPE_MODULE) ||
  ------------------
  |  |  333|     11|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (37090:9): [True: 11, False: 0]
  ------------------
37091|      0|        !(fd->js_mode & JS_MODE_STRICT);
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (37091:9): [True: 0, False: 0]
  ------------------
37092|       |
37093|     21|    if (!s->is_module) {
  ------------------
  |  Branch (37093:9): [True: 10, False: 11]
  ------------------
37094|       |        /* hidden variable for the return value */
37095|     10|        fd->eval_ret_idx = idx = add_var(s->ctx, fd, JS_ATOM__ret_);
37096|     10|        if (idx < 0)
  ------------------
  |  Branch (37096:13): [True: 0, False: 10]
  ------------------
37097|      0|            return -1;
37098|     10|    }
37099|       |
37100|     84|    while (s->token.val != TOK_EOF) {
  ------------------
  |  Branch (37100:12): [True: 66, False: 18]
  ------------------
37101|     66|        if (js_parse_source_element(s))
  ------------------
  |  Branch (37101:13): [True: 3, False: 63]
  ------------------
37102|      3|            return -1;
37103|     66|    }
37104|       |
37105|     18|    if (!s->is_module) {
  ------------------
  |  Branch (37105:9): [True: 7, False: 11]
  ------------------
37106|       |        /* return the value of the hidden variable eval_ret_idx  */
37107|      7|        if (fd->func_kind == JS_FUNC_ASYNC) {
  ------------------
  |  Branch (37107:13): [True: 0, False: 7]
  ------------------
37108|       |            /* wrap the return value in an object so that promises can
37109|       |               be safely returned */
37110|      0|            emit_op(s, OP_object);
37111|      0|            emit_op(s, OP_dup);
37112|       |
37113|      0|            emit_op(s, OP_get_loc);
37114|      0|            emit_u16(s, fd->eval_ret_idx);
37115|       |
37116|      0|            emit_op(s, OP_put_field);
37117|      0|            emit_atom(s, JS_ATOM_value);
37118|      7|        } else {
37119|      7|            emit_op(s, OP_get_loc);
37120|      7|            emit_u16(s, fd->eval_ret_idx);
37121|      7|        }
37122|      7|        emit_return(s, TRUE);
37123|     11|    } else {
37124|     11|        emit_return(s, FALSE);
37125|     11|    }
37126|       |
37127|     18|    return 0;
37128|     21|}
quickjs.c:next_token:
22830|    787|{
22831|    787|    const uint8_t *p;
22832|    787|    int c;
22833|    787|    BOOL ident_has_escape;
22834|    787|    JSAtom atom;
22835|       |
22836|    787|    if (js_check_stack_overflow(s->ctx->rt, 0)) {
  ------------------
  |  Branch (22836:9): [True: 0, False: 787]
  ------------------
22837|      0|        return js_parse_error(s, "stack overflow");
22838|      0|    }
22839|       |
22840|    787|    free_token(s, &s->token);
22841|       |
22842|    787|    p = s->last_ptr = s->buf_ptr;
22843|    787|    s->got_lf = FALSE;
22844|  1.04M| redo:
22845|  1.04M|    s->token.ptr = p;
22846|  1.04M|    c = *p;
22847|  1.04M|    switch(c) {
22848|     21|    case 0:
  ------------------
  |  Branch (22848:5): [True: 21, False: 1.04M]
  ------------------
22849|     21|        if (p >= s->buf_end) {
  ------------------
  |  Branch (22849:13): [True: 20, False: 1]
  ------------------
22850|     20|            s->token.val = TOK_EOF;
22851|     20|        } else {
22852|      1|            goto def_token;
22853|      1|        }
22854|     20|        break;
22855|     35|    case '`':
  ------------------
  |  Branch (22855:5): [True: 35, False: 1.04M]
  ------------------
22856|     35|        if (js_parse_template_part(s, p + 1))
  ------------------
  |  Branch (22856:13): [True: 1, False: 34]
  ------------------
22857|      1|            goto fail;
22858|     34|        p = s->buf_ptr;
22859|     34|        break;
22860|     31|    case '\'':
  ------------------
  |  Branch (22860:5): [True: 31, False: 1.04M]
  ------------------
22861|     31|    case '\"':
  ------------------
  |  Branch (22861:5): [True: 0, False: 1.04M]
  ------------------
22862|     31|        if (js_parse_string(s, c, TRUE, p + 1, &s->token, &p))
  ------------------
  |  Branch (22862:13): [True: 0, False: 31]
  ------------------
22863|      0|            goto fail;
22864|     31|        break;
22865|     31|    case '\r':  /* accept DOS and MAC newline sequences */
  ------------------
  |  Branch (22865:5): [True: 6, False: 1.04M]
  ------------------
22866|      6|        if (p[1] == '\n') {
  ------------------
  |  Branch (22866:13): [True: 0, False: 6]
  ------------------
22867|      0|            p++;
22868|      0|        }
22869|       |        /* fall thru */
22870|  1.04M|    case '\n':
  ------------------
  |  Branch (22870:5): [True: 1.04M, False: 1.11k]
  ------------------
22871|  1.04M|        p++;
22872|  1.04M|    line_terminator:
22873|  1.04M|        s->got_lf = TRUE;
22874|  1.04M|        goto redo;
22875|      4|    case '\f':
  ------------------
  |  Branch (22875:5): [True: 4, False: 1.04M]
  ------------------
22876|      6|    case '\v':
  ------------------
  |  Branch (22876:5): [True: 2, False: 1.04M]
  ------------------
22877|    168|    case ' ':
  ------------------
  |  Branch (22877:5): [True: 162, False: 1.04M]
  ------------------
22878|    266|    case '\t':
  ------------------
  |  Branch (22878:5): [True: 98, False: 1.04M]
  ------------------
22879|    266|        p++;
22880|    266|        goto redo;
22881|     59|    case '/':
  ------------------
  |  Branch (22881:5): [True: 59, False: 1.04M]
  ------------------
22882|     59|        if (p[1] == '*') {
  ------------------
  |  Branch (22882:13): [True: 0, False: 59]
  ------------------
22883|       |            /* comment */
22884|      0|            p += 2;
22885|      0|            for(;;) {
22886|      0|                if (*p == '\0' && p >= s->buf_end) {
  ------------------
  |  Branch (22886:21): [True: 0, False: 0]
  |  Branch (22886:35): [True: 0, False: 0]
  ------------------
22887|      0|                    js_parse_error(s, "unexpected end of comment");
22888|      0|                    goto fail;
22889|      0|                }
22890|      0|                if (p[0] == '*' && p[1] == '/') {
  ------------------
  |  Branch (22890:21): [True: 0, False: 0]
  |  Branch (22890:36): [True: 0, False: 0]
  ------------------
22891|      0|                    p += 2;
22892|      0|                    break;
22893|      0|                }
22894|      0|                if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (22894:21): [True: 0, False: 0]
  |  Branch (22894:35): [True: 0, False: 0]
  ------------------
22895|      0|                    s->got_lf = TRUE; /* considered as LF for ASI */
22896|      0|                    p++;
22897|      0|                } else if (*p >= 0x80) {
  ------------------
  |  Branch (22897:28): [True: 0, False: 0]
  ------------------
22898|      0|                    c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22899|      0|                    if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21889|      0|#define CP_LS   0x2028
  ------------------
                                  if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21890|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (22899:25): [True: 0, False: 0]
  |  Branch (22899:39): [True: 0, False: 0]
  ------------------
22900|      0|                        s->got_lf = TRUE; /* considered as LF for ASI */
22901|      0|                    } else if (c == -1) {
  ------------------
  |  Branch (22901:32): [True: 0, False: 0]
  ------------------
22902|      0|                        p++; /* skip invalid UTF-8 */
22903|      0|                    }
22904|      0|                } else {
22905|      0|                    p++;
22906|      0|                }
22907|      0|            }
22908|      0|            goto redo;
22909|     59|        } else if (p[1] == '/') {
  ------------------
  |  Branch (22909:20): [True: 59, False: 0]
  ------------------
22910|       |            /* line comment */
22911|     59|            p += 2;
22912|     59|        skip_line_comment:
22913|  2.04M|            for(;;) {
22914|  2.04M|                if (*p == '\0' && p >= s->buf_end)
  ------------------
  |  Branch (22914:21): [True: 2.04M, False: 5.16k]
  |  Branch (22914:35): [True: 5, False: 2.04M]
  ------------------
22915|      5|                    break;
22916|  2.04M|                if (*p == '\r' || *p == '\n')
  ------------------
  |  Branch (22916:21): [True: 3, False: 2.04M]
  |  Branch (22916:35): [True: 51, False: 2.04M]
  ------------------
22917|     54|                    break;
22918|  2.04M|                if (*p >= 0x80) {
  ------------------
  |  Branch (22918:21): [True: 587, False: 2.04M]
  ------------------
22919|    587|                    c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|    587|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22920|       |                    /* LS or PS are considered as line terminator */
22921|    587|                    if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21889|  1.17k|#define CP_LS   0x2028
  ------------------
                                  if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21890|    587|#define CP_PS   0x2029
  ------------------
  |  Branch (22921:25): [True: 0, False: 587]
  |  Branch (22921:39): [True: 0, False: 587]
  ------------------
22922|      0|                        break;
22923|    587|                    } else if (c == -1) {
  ------------------
  |  Branch (22923:32): [True: 545, False: 42]
  ------------------
22924|    545|                        p++; /* skip invalid UTF-8 */
22925|    545|                    }
22926|  2.04M|                } else {
22927|  2.04M|                    p++;
22928|  2.04M|                }
22929|  2.04M|            }
22930|     59|            goto redo;
22931|     59|        } else if (p[1] == '=') {
  ------------------
  |  Branch (22931:20): [True: 0, False: 0]
  ------------------
22932|      0|            p += 2;
22933|      0|            s->token.val = TOK_DIV_ASSIGN;
22934|      0|        } else {
22935|      0|            p++;
22936|      0|            s->token.val = c;
22937|      0|        }
22938|      0|        break;
22939|      0|    case '\\':
  ------------------
  |  Branch (22939:5): [True: 0, False: 1.04M]
  ------------------
22940|      0|        if (p[1] == 'u') {
  ------------------
  |  Branch (22940:13): [True: 0, False: 0]
  ------------------
22941|      0|            const uint8_t *p1 = p + 1;
22942|      0|            int c1 = lre_parse_escape(&p1, TRUE);
22943|      0|            if (c1 >= 0 && lre_js_is_ident_first(c1)) {
  ------------------
  |  Branch (22943:17): [True: 0, False: 0]
  |  Branch (22943:28): [True: 0, False: 0]
  ------------------
22944|      0|                c = c1;
22945|      0|                p = p1;
22946|      0|                ident_has_escape = TRUE;
22947|      0|                goto has_ident;
22948|      0|            } else {
22949|       |                /* XXX: syntax error? */
22950|      0|            }
22951|      0|        }
22952|      0|        goto def_token;
22953|     27|    case 'a': case 'b': case 'c': case 'd':
  ------------------
  |  Branch (22953:5): [True: 26, False: 1.04M]
  |  Branch (22953:15): [True: 0, False: 1.04M]
  |  Branch (22953:25): [True: 0, False: 1.04M]
  |  Branch (22953:35): [True: 1, False: 1.04M]
  ------------------
22954|     93|    case 'e': case 'f': case 'g': case 'h':
  ------------------
  |  Branch (22954:5): [True: 4, False: 1.04M]
  |  Branch (22954:15): [True: 40, False: 1.04M]
  |  Branch (22954:25): [True: 22, False: 1.04M]
  |  Branch (22954:35): [True: 0, False: 1.04M]
  ------------------
22955|    253|    case 'i': case 'j': case 'k': case 'l':
  ------------------
  |  Branch (22955:5): [True: 99, False: 1.04M]
  |  Branch (22955:15): [True: 0, False: 1.04M]
  |  Branch (22955:25): [True: 22, False: 1.04M]
  |  Branch (22955:35): [True: 39, False: 1.04M]
  ------------------
22956|    301|    case 'm': case 'n': case 'o': case 'p':
  ------------------
  |  Branch (22956:5): [True: 3, False: 1.04M]
  |  Branch (22956:15): [True: 11, False: 1.04M]
  |  Branch (22956:25): [True: 34, False: 1.04M]
  |  Branch (22956:35): [True: 0, False: 1.04M]
  ------------------
22957|    339|    case 'q': case 'r': case 's': case 't':
  ------------------
  |  Branch (22957:5): [True: 4, False: 1.04M]
  |  Branch (22957:15): [True: 0, False: 1.04M]
  |  Branch (22957:25): [True: 34, False: 1.04M]
  |  Branch (22957:35): [True: 0, False: 1.04M]
  ------------------
22958|    349|    case 'u': case 'v': case 'w': case 'x':
  ------------------
  |  Branch (22958:5): [True: 3, False: 1.04M]
  |  Branch (22958:15): [True: 7, False: 1.04M]
  |  Branch (22958:25): [True: 0, False: 1.04M]
  |  Branch (22958:35): [True: 0, False: 1.04M]
  ------------------
22959|    351|    case 'y': case 'z':
  ------------------
  |  Branch (22959:5): [True: 0, False: 1.04M]
  |  Branch (22959:15): [True: 2, False: 1.04M]
  ------------------
22960|    351|    case 'A': case 'B': case 'C': case 'D':
  ------------------
  |  Branch (22960:5): [True: 0, False: 1.04M]
  |  Branch (22960:15): [True: 0, False: 1.04M]
  |  Branch (22960:25): [True: 0, False: 1.04M]
  |  Branch (22960:35): [True: 0, False: 1.04M]
  ------------------
22961|    352|    case 'E': case 'F': case 'G': case 'H':
  ------------------
  |  Branch (22961:5): [True: 0, False: 1.04M]
  |  Branch (22961:15): [True: 1, False: 1.04M]
  |  Branch (22961:25): [True: 0, False: 1.04M]
  |  Branch (22961:35): [True: 0, False: 1.04M]
  ------------------
22962|    353|    case 'I': case 'J': case 'K': case 'L':
  ------------------
  |  Branch (22962:5): [True: 0, False: 1.04M]
  |  Branch (22962:15): [True: 0, False: 1.04M]
  |  Branch (22962:25): [True: 0, False: 1.04M]
  |  Branch (22962:35): [True: 1, False: 1.04M]
  ------------------
22963|    359|    case 'M': case 'N': case 'O': case 'P':
  ------------------
  |  Branch (22963:5): [True: 0, False: 1.04M]
  |  Branch (22963:15): [True: 1, False: 1.04M]
  |  Branch (22963:25): [True: 5, False: 1.04M]
  |  Branch (22963:35): [True: 0, False: 1.04M]
  ------------------
22964|    359|    case 'Q': case 'R': case 'S': case 'T':
  ------------------
  |  Branch (22964:5): [True: 0, False: 1.04M]
  |  Branch (22964:15): [True: 0, False: 1.04M]
  |  Branch (22964:25): [True: 0, False: 1.04M]
  |  Branch (22964:35): [True: 0, False: 1.04M]
  ------------------
22965|    363|    case 'U': case 'V': case 'W': case 'X':
  ------------------
  |  Branch (22965:5): [True: 0, False: 1.04M]
  |  Branch (22965:15): [True: 0, False: 1.04M]
  |  Branch (22965:25): [True: 0, False: 1.04M]
  |  Branch (22965:35): [True: 4, False: 1.04M]
  ------------------
22966|    379|    case 'Y': case 'Z':
  ------------------
  |  Branch (22966:5): [True: 0, False: 1.04M]
  |  Branch (22966:15): [True: 16, False: 1.04M]
  ------------------
22967|    379|    case '_':
  ------------------
  |  Branch (22967:5): [True: 0, False: 1.04M]
  ------------------
22968|    379|    case '$':
  ------------------
  |  Branch (22968:5): [True: 0, False: 1.04M]
  ------------------
22969|       |        /* identifier */
22970|    379|        p++;
22971|    379|        ident_has_escape = FALSE;
22972|    380|    has_ident:
22973|    380|        atom = parse_ident(s, &p, &ident_has_escape, c, FALSE);
22974|    380|        if (atom == JS_ATOM_NULL)
  ------------------
  |  |  451|    380|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (22974:13): [True: 0, False: 380]
  ------------------
22975|      0|            goto fail;
22976|    380|        s->token.u.ident.atom = atom;
22977|    380|        s->token.u.ident.has_escape = ident_has_escape;
22978|    380|        s->token.u.ident.is_reserved = FALSE;
22979|    380|        s->token.val = TOK_IDENT;
22980|    380|        update_token_ident(s);
22981|    380|        break;
22982|      0|    case '#':
  ------------------
  |  Branch (22982:5): [True: 0, False: 1.04M]
  ------------------
22983|       |        /* private name */
22984|      0|        {
22985|      0|            const uint8_t *p1;
22986|      0|            p++;
22987|      0|            p1 = p;
22988|      0|            c = *p1++;
22989|      0|            if (c == '\\' && *p1 == 'u') {
  ------------------
  |  Branch (22989:17): [True: 0, False: 0]
  |  Branch (22989:30): [True: 0, False: 0]
  ------------------
22990|      0|                c = lre_parse_escape(&p1, TRUE);
22991|      0|            } else if (c >= 128) {
  ------------------
  |  Branch (22991:24): [True: 0, False: 0]
  ------------------
22992|      0|                c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p1);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22993|      0|            }
22994|      0|            if (!lre_js_is_ident_first(c)) {
  ------------------
  |  Branch (22994:17): [True: 0, False: 0]
  ------------------
22995|      0|                js_parse_error(s, "invalid first character of private name");
22996|      0|                goto fail;
22997|      0|            }
22998|      0|            p = p1;
22999|      0|            ident_has_escape = FALSE; /* not used */
23000|      0|            atom = parse_ident(s, &p, &ident_has_escape, c, TRUE);
23001|      0|            if (atom == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (23001:17): [True: 0, False: 0]
  ------------------
23002|      0|                goto fail;
23003|      0|            s->token.u.ident.atom = atom;
23004|      0|            s->token.val = TOK_PRIVATE_NAME;
23005|      0|        }
23006|      0|        break;
23007|     32|    case '.':
  ------------------
  |  Branch (23007:5): [True: 32, False: 1.04M]
  ------------------
23008|     32|        if (p[1] == '.' && p[2] == '.') {
  ------------------
  |  Branch (23008:13): [True: 0, False: 32]
  |  Branch (23008:28): [True: 0, False: 0]
  ------------------
23009|      0|            p += 3;
23010|      0|            s->token.val = TOK_ELLIPSIS;
23011|      0|            break;
23012|      0|        }
23013|     32|        if (p[1] >= '0' && p[1] <= '9') {
  ------------------
  |  Branch (23013:13): [True: 32, False: 0]
  |  Branch (23013:28): [True: 0, False: 32]
  ------------------
23014|      0|            goto parse_number;
23015|     32|        } else {
23016|     32|            goto def_token;
23017|     32|        }
23018|      0|        break;
23019|      3|    case '0':
  ------------------
  |  Branch (23019:5): [True: 3, False: 1.04M]
  ------------------
23020|       |        /* in strict mode, octal literals are not accepted */
23021|      3|        if (is_digit(p[1]) && (s->cur_func->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (23021:13): [True: 0, False: 3]
  |  Branch (23021:31): [True: 0, False: 0]
  ------------------
23022|      0|            js_parse_error(s, "octal literals are deprecated in strict mode");
23023|      0|            goto fail;
23024|      0|        }
23025|      3|        goto parse_number;
23026|     11|    case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (23026:5): [True: 9, False: 1.04M]
  |  Branch (23026:15): [True: 1, False: 1.04M]
  |  Branch (23026:25): [True: 1, False: 1.04M]
  |  Branch (23026:35): [True: 0, False: 1.04M]
  ------------------
23027|     12|    case '5': case '6': case '7': case '8':
  ------------------
  |  Branch (23027:5): [True: 0, False: 1.04M]
  |  Branch (23027:15): [True: 0, False: 1.04M]
  |  Branch (23027:25): [True: 0, False: 1.04M]
  |  Branch (23027:35): [True: 1, False: 1.04M]
  ------------------
23028|     12|    case '9':
  ------------------
  |  Branch (23028:5): [True: 0, False: 1.04M]
  ------------------
23029|       |        /* number */
23030|     15|    parse_number:
23031|     15|        {
23032|     15|            JSValue ret;
23033|     15|            const uint8_t *p1;
23034|     15|            int flags;
23035|     15|            flags = ATOD_ACCEPT_BIN_OCT | ATOD_ACCEPT_LEGACY_OCTAL |
  ------------------
  |  |12746|     15|#define ATOD_ACCEPT_BIN_OCT  (1 << 2)
  ------------------
                          flags = ATOD_ACCEPT_BIN_OCT | ATOD_ACCEPT_LEGACY_OCTAL |
  ------------------
  |  |12748|     15|#define ATOD_ACCEPT_LEGACY_OCTAL  (1 << 4)
  ------------------
23036|     15|                ATOD_ACCEPT_UNDERSCORES | ATOD_ACCEPT_SUFFIX;
  ------------------
  |  |12750|     15|#define ATOD_ACCEPT_UNDERSCORES  (1 << 5)
  ------------------
                              ATOD_ACCEPT_UNDERSCORES | ATOD_ACCEPT_SUFFIX;
  ------------------
  |  |12752|     15|#define ATOD_ACCEPT_SUFFIX    (1 << 6)
  ------------------
23037|     15|            ret = js_atof(s->ctx, (const char *)p, (const char **)&p, 0,
23038|     15|                          flags);
23039|     15|            if (JS_IsException(ret))
  ------------------
  |  Branch (23039:17): [True: 0, False: 15]
  ------------------
23040|      0|                goto fail;
23041|       |            /* reject `10instanceof Number` */
23042|     15|            if (JS_VALUE_IS_NAN(ret) ||
  ------------------
  |  Branch (23042:17): [True: 0, False: 15]
  ------------------
23043|     15|                lre_js_is_ident_next(unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p1))) {
  ------------------
  |  |  330|     15|#define UTF8_CHAR_LEN_MAX 6
  ------------------
  |  Branch (23043:17): [True: 0, False: 15]
  ------------------
23044|      0|                JS_FreeValue(s->ctx, ret);
23045|      0|                js_parse_error(s, "invalid number literal");
23046|      0|                goto fail;
23047|      0|            }
23048|     15|            s->token.val = TOK_NUMBER;
23049|     15|            s->token.u.num.val = ret;
23050|     15|        }
23051|      0|        break;
23052|     30|    case '*':
  ------------------
  |  Branch (23052:5): [True: 30, False: 1.04M]
  ------------------
23053|     30|        if (p[1] == '=') {
  ------------------
  |  Branch (23053:13): [True: 2, False: 28]
  ------------------
23054|      2|            p += 2;
23055|      2|            s->token.val = TOK_MUL_ASSIGN;
23056|     28|        } else if (p[1] == '*') {
  ------------------
  |  Branch (23056:20): [True: 0, False: 28]
  ------------------
23057|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (23057:17): [True: 0, False: 0]
  ------------------
23058|      0|                p += 3;
23059|      0|                s->token.val = TOK_POW_ASSIGN;
23060|      0|            } else {
23061|      0|                p += 2;
23062|      0|                s->token.val = TOK_POW;
23063|      0|            }
23064|     28|        } else {
23065|     28|            goto def_token;
23066|     28|        }
23067|      2|        break;
23068|      2|    case '%':
  ------------------
  |  Branch (23068:5): [True: 2, False: 1.04M]
  ------------------
23069|      2|        if (p[1] == '=') {
  ------------------
  |  Branch (23069:13): [True: 0, False: 2]
  ------------------
23070|      0|            p += 2;
23071|      0|            s->token.val = TOK_MOD_ASSIGN;
23072|      2|        } else {
23073|      2|            goto def_token;
23074|      2|        }
23075|      0|        break;
23076|      2|    case '+':
  ------------------
  |  Branch (23076:5): [True: 2, False: 1.04M]
  ------------------
23077|      2|        if (p[1] == '=') {
  ------------------
  |  Branch (23077:13): [True: 0, False: 2]
  ------------------
23078|      0|            p += 2;
23079|      0|            s->token.val = TOK_PLUS_ASSIGN;
23080|      2|        } else if (p[1] == '+') {
  ------------------
  |  Branch (23080:20): [True: 0, False: 2]
  ------------------
23081|      0|            p += 2;
23082|      0|            s->token.val = TOK_INC;
23083|      2|        } else {
23084|      2|            goto def_token;
23085|      2|        }
23086|      0|        break;
23087|      3|    case '-':
  ------------------
  |  Branch (23087:5): [True: 3, False: 1.04M]
  ------------------
23088|      3|        if (p[1] == '=') {
  ------------------
  |  Branch (23088:13): [True: 0, False: 3]
  ------------------
23089|      0|            p += 2;
23090|      0|            s->token.val = TOK_MINUS_ASSIGN;
23091|      3|        } else if (p[1] == '-') {
  ------------------
  |  Branch (23091:20): [True: 0, False: 3]
  ------------------
23092|      0|            if (s->allow_html_comments && p[2] == '>' &&
  ------------------
  |  Branch (23092:17): [True: 0, False: 0]
  |  Branch (23092:43): [True: 0, False: 0]
  ------------------
23093|      0|                (s->got_lf || s->last_ptr == s->buf_start)) {
  ------------------
  |  Branch (23093:18): [True: 0, False: 0]
  |  Branch (23093:31): [True: 0, False: 0]
  ------------------
23094|       |                /* Annex B: `-->` at beginning of line is an html comment end.
23095|       |                   It extends to the end of the line.
23096|       |                 */
23097|      0|                goto skip_line_comment;
23098|      0|            }
23099|      0|            p += 2;
23100|      0|            s->token.val = TOK_DEC;
23101|      3|        } else {
23102|      3|            goto def_token;
23103|      3|        }
23104|      0|        break;
23105|      0|    case '<':
  ------------------
  |  Branch (23105:5): [True: 0, False: 1.04M]
  ------------------
23106|      0|        if (p[1] == '=') {
  ------------------
  |  Branch (23106:13): [True: 0, False: 0]
  ------------------
23107|      0|            p += 2;
23108|      0|            s->token.val = TOK_LTE;
23109|      0|        } else if (p[1] == '<') {
  ------------------
  |  Branch (23109:20): [True: 0, False: 0]
  ------------------
23110|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (23110:17): [True: 0, False: 0]
  ------------------
23111|      0|                p += 3;
23112|      0|                s->token.val = TOK_SHL_ASSIGN;
23113|      0|            } else {
23114|      0|                p += 2;
23115|      0|                s->token.val = TOK_SHL;
23116|      0|            }
23117|      0|        } else if (s->allow_html_comments &&
  ------------------
  |  Branch (23117:20): [True: 0, False: 0]
  ------------------
23118|      0|                   p[1] == '!' && p[2] == '-' && p[3] == '-') {
  ------------------
  |  Branch (23118:20): [True: 0, False: 0]
  |  Branch (23118:35): [True: 0, False: 0]
  |  Branch (23118:50): [True: 0, False: 0]
  ------------------
23119|       |            /* Annex B: handle `<!--` single line html comments */
23120|      0|            goto skip_line_comment;
23121|      0|        } else {
23122|      0|            goto def_token;
23123|      0|        }
23124|      0|        break;
23125|      0|    case '>':
  ------------------
  |  Branch (23125:5): [True: 0, False: 1.04M]
  ------------------
23126|      0|        if (p[1] == '=') {
  ------------------
  |  Branch (23126:13): [True: 0, False: 0]
  ------------------
23127|      0|            p += 2;
23128|      0|            s->token.val = TOK_GTE;
23129|      0|        } else if (p[1] == '>') {
  ------------------
  |  Branch (23129:20): [True: 0, False: 0]
  ------------------
23130|      0|            if (p[2] == '>') {
  ------------------
  |  Branch (23130:17): [True: 0, False: 0]
  ------------------
23131|      0|                if (p[3] == '=') {
  ------------------
  |  Branch (23131:21): [True: 0, False: 0]
  ------------------
23132|      0|                    p += 4;
23133|      0|                    s->token.val = TOK_SHR_ASSIGN;
23134|      0|                } else {
23135|      0|                    p += 3;
23136|      0|                    s->token.val = TOK_SHR;
23137|      0|                }
23138|      0|            } else if (p[2] == '=') {
  ------------------
  |  Branch (23138:24): [True: 0, False: 0]
  ------------------
23139|      0|                p += 3;
23140|      0|                s->token.val = TOK_SAR_ASSIGN;
23141|      0|            } else {
23142|      0|                p += 2;
23143|      0|                s->token.val = TOK_SAR;
23144|      0|            }
23145|      0|        } else {
23146|      0|            goto def_token;
23147|      0|        }
23148|      0|        break;
23149|     44|    case '=':
  ------------------
  |  Branch (23149:5): [True: 44, False: 1.04M]
  ------------------
23150|     44|        if (p[1] == '=') {
  ------------------
  |  Branch (23150:13): [True: 0, False: 44]
  ------------------
23151|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (23151:17): [True: 0, False: 0]
  ------------------
23152|      0|                p += 3;
23153|      0|                s->token.val = TOK_STRICT_EQ;
23154|      0|            } else {
23155|      0|                p += 2;
23156|      0|                s->token.val = TOK_EQ;
23157|      0|            }
23158|     44|        } else if (p[1] == '>') {
  ------------------
  |  Branch (23158:20): [True: 6, False: 38]
  ------------------
23159|      6|            p += 2;
23160|      6|            s->token.val = TOK_ARROW;
23161|     38|        } else {
23162|     38|            goto def_token;
23163|     38|        }
23164|      6|        break;
23165|      6|    case '!':
  ------------------
  |  Branch (23165:5): [True: 2, False: 1.04M]
  ------------------
23166|      2|        if (p[1] == '=') {
  ------------------
  |  Branch (23166:13): [True: 0, False: 2]
  ------------------
23167|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (23167:17): [True: 0, False: 0]
  ------------------
23168|      0|                p += 3;
23169|      0|                s->token.val = TOK_STRICT_NEQ;
23170|      0|            } else {
23171|      0|                p += 2;
23172|      0|                s->token.val = TOK_NEQ;
23173|      0|            }
23174|      2|        } else {
23175|      2|            goto def_token;
23176|      2|        }
23177|      0|        break;
23178|      0|    case '&':
  ------------------
  |  Branch (23178:5): [True: 0, False: 1.04M]
  ------------------
23179|      0|        if (p[1] == '=') {
  ------------------
  |  Branch (23179:13): [True: 0, False: 0]
  ------------------
23180|      0|            p += 2;
23181|      0|            s->token.val = TOK_AND_ASSIGN;
23182|      0|        } else if (p[1] == '&') {
  ------------------
  |  Branch (23182:20): [True: 0, False: 0]
  ------------------
23183|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (23183:17): [True: 0, False: 0]
  ------------------
23184|      0|                p += 3;
23185|      0|                s->token.val = TOK_LAND_ASSIGN;
23186|      0|            } else {
23187|      0|                p += 2;
23188|      0|                s->token.val = TOK_LAND;
23189|      0|            }
23190|      0|        } else {
23191|      0|            goto def_token;
23192|      0|        }
23193|      0|        break;
23194|      0|    case '^':
  ------------------
  |  Branch (23194:5): [True: 0, False: 1.04M]
  ------------------
23195|      0|        if (p[1] == '=') {
  ------------------
  |  Branch (23195:13): [True: 0, False: 0]
  ------------------
23196|      0|            p += 2;
23197|      0|            s->token.val = TOK_XOR_ASSIGN;
23198|      0|        } else {
23199|      0|            goto def_token;
23200|      0|        }
23201|      0|        break;
23202|      0|    case '|':
  ------------------
  |  Branch (23202:5): [True: 0, False: 1.04M]
  ------------------
23203|      0|        if (p[1] == '=') {
  ------------------
  |  Branch (23203:13): [True: 0, False: 0]
  ------------------
23204|      0|            p += 2;
23205|      0|            s->token.val = TOK_OR_ASSIGN;
23206|      0|        } else if (p[1] == '|') {
  ------------------
  |  Branch (23206:20): [True: 0, False: 0]
  ------------------
23207|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (23207:17): [True: 0, False: 0]
  ------------------
23208|      0|                p += 3;
23209|      0|                s->token.val = TOK_LOR_ASSIGN;
23210|      0|            } else {
23211|      0|                p += 2;
23212|      0|                s->token.val = TOK_LOR;
23213|      0|            }
23214|      0|        } else {
23215|      0|            goto def_token;
23216|      0|        }
23217|      0|        break;
23218|      0|    case '?':
  ------------------
  |  Branch (23218:5): [True: 0, False: 1.04M]
  ------------------
23219|      0|        if (p[1] == '?') {
  ------------------
  |  Branch (23219:13): [True: 0, False: 0]
  ------------------
23220|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (23220:17): [True: 0, False: 0]
  ------------------
23221|      0|                p += 3;
23222|      0|                s->token.val = TOK_DOUBLE_QUESTION_MARK_ASSIGN;
23223|      0|            } else {
23224|      0|                p += 2;
23225|      0|                s->token.val = TOK_DOUBLE_QUESTION_MARK;
23226|      0|            }
23227|      0|        } else if (p[1] == '.' && !(p[2] >= '0' && p[2] <= '9')) {
  ------------------
  |  Branch (23227:20): [True: 0, False: 0]
  |  Branch (23227:37): [True: 0, False: 0]
  |  Branch (23227:52): [True: 0, False: 0]
  ------------------
23228|      0|            p += 2;
23229|      0|            s->token.val = TOK_QUESTION_MARK_DOT;
23230|      0|        } else {
23231|      0|            goto def_token;
23232|      0|        }
23233|      0|        break;
23234|    191|    default:
  ------------------
  |  Branch (23234:5): [True: 191, False: 1.04M]
  ------------------
23235|    191|        if (c >= 128) {
  ------------------
  |  Branch (23235:13): [True: 2, False: 189]
  ------------------
23236|       |            /* unicode value */
23237|      2|            c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|      2|#define UTF8_CHAR_LEN_MAX 6
  ------------------
23238|      2|            switch(c) {
23239|      0|            case CP_PS:
  ------------------
  |  |21890|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (23239:13): [True: 0, False: 2]
  ------------------
23240|      0|            case CP_LS:
  ------------------
  |  |21889|      0|#define CP_LS   0x2028
  ------------------
  |  Branch (23240:13): [True: 0, False: 2]
  ------------------
23241|       |                /* XXX: should avoid incrementing line_number, but
23242|       |                   needed to handle HTML comments */
23243|      0|                goto line_terminator;
23244|      2|            default:
  ------------------
  |  Branch (23244:13): [True: 2, False: 0]
  ------------------
23245|      2|                if (lre_is_space(c)) {
  ------------------
  |  Branch (23245:21): [True: 0, False: 2]
  ------------------
23246|      0|                    goto redo;
23247|      2|                } else if (lre_js_is_ident_first(c)) {
  ------------------
  |  Branch (23247:28): [True: 1, False: 1]
  ------------------
23248|      1|                    ident_has_escape = FALSE;
23249|      1|                    goto has_ident;
23250|      1|                } else {
23251|      1|                    js_parse_error(s, "unexpected character");
23252|      1|                    goto fail;
23253|      1|                }
23254|      2|            }
23255|      2|        }
23256|    297|    def_token:
23257|    297|        s->token.val = c;
23258|    297|        p++;
23259|    297|        break;
23260|  1.04M|    }
23261|    785|    s->buf_ptr = p;
23262|       |
23263|       |    //    dump_token(s, &s->token);
23264|    785|    return 0;
23265|       |
23266|      2| fail:
23267|      2|    s->token.val = TOK_ERROR;
23268|      2|    return -1;
23269|  1.04M|}
quickjs.c:js_parse_template_part:
22399|     35|{
22400|     35|    uint32_t c;
22401|     35|    StringBuffer b_s, *b = &b_s;
22402|     35|    JSValue str;
22403|       |
22404|       |    /* p points to the first byte of the template part */
22405|     35|    if (string_buffer_init(s->ctx, b, 32))
  ------------------
  |  Branch (22405:9): [True: 0, False: 35]
  ------------------
22406|      0|        goto fail;
22407|  3.71M|    for(;;) {
22408|  3.71M|        if (p >= s->buf_end)
  ------------------
  |  Branch (22408:13): [True: 1, False: 3.71M]
  ------------------
22409|      1|            goto unexpected_eof;
22410|  3.71M|        c = *p++;
22411|  3.71M|        if (c == '`') {
  ------------------
  |  Branch (22411:13): [True: 34, False: 3.71M]
  ------------------
22412|       |            /* template end part */
22413|     34|            break;
22414|     34|        }
22415|  3.71M|        if (c == '$' && *p == '{') {
  ------------------
  |  Branch (22415:13): [True: 1.02k, False: 3.71M]
  |  Branch (22415:25): [True: 0, False: 1.02k]
  ------------------
22416|       |            /* template start or middle part */
22417|      0|            p++;
22418|      0|            break;
22419|      0|        }
22420|  3.71M|        if (c == '\\') {
  ------------------
  |  Branch (22420:13): [True: 30.1k, False: 3.68M]
  ------------------
22421|  30.1k|            if (string_buffer_putc8(b, c))
  ------------------
  |  Branch (22421:17): [True: 0, False: 30.1k]
  ------------------
22422|      0|                goto fail;
22423|  30.1k|            if (p >= s->buf_end)
  ------------------
  |  Branch (22423:17): [True: 0, False: 30.1k]
  ------------------
22424|      0|                goto unexpected_eof;
22425|  30.1k|            c = *p++;
22426|  30.1k|        }
22427|       |        /* newline sequences are normalized as single '\n' bytes */
22428|  3.71M|        if (c == '\r') {
  ------------------
  |  Branch (22428:13): [True: 0, False: 3.71M]
  ------------------
22429|      0|            if (*p == '\n')
  ------------------
  |  Branch (22429:17): [True: 0, False: 0]
  ------------------
22430|      0|                p++;
22431|      0|            c = '\n';
22432|      0|        }
22433|  3.71M|        if (c >= 0x80) {
  ------------------
  |  Branch (22433:13): [True: 629, False: 3.71M]
  ------------------
22434|    629|            const uint8_t *p_next;
22435|    629|            c = unicode_from_utf8(p - 1, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|    629|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22436|    629|            if (c > 0x10FFFF) {
  ------------------
  |  Branch (22436:17): [True: 0, False: 629]
  ------------------
22437|      0|                js_parse_error_pos(s, p - 1, "invalid UTF-8 sequence");
22438|      0|                goto fail;
22439|      0|            }
22440|    629|            p = p_next;
22441|    629|        }
22442|  3.71M|        if (string_buffer_putc(b, c))
  ------------------
  |  Branch (22442:13): [True: 0, False: 3.71M]
  ------------------
22443|      0|            goto fail;
22444|  3.71M|    }
22445|     34|    str = string_buffer_end(b);
22446|     34|    if (JS_IsException(str))
  ------------------
  |  Branch (22446:9): [True: 0, False: 34]
  ------------------
22447|      0|        return -1;
22448|     34|    s->token.val = TOK_TEMPLATE;
22449|     34|    s->token.u.str.sep = c;
22450|     34|    s->token.u.str.str = str;
22451|     34|    s->buf_ptr = p;
22452|     34|    return 0;
22453|       |
22454|      1| unexpected_eof:
22455|      1|    js_parse_error(s, "unexpected end of string");
22456|      1| fail:
22457|      1|    string_buffer_free(b);
22458|      1|    return -1;
22459|      1|}
quickjs.c:js_parse_string:
22464|     52|{
22465|     52|    int ret;
22466|     52|    uint32_t c;
22467|     52|    StringBuffer b_s, *b = &b_s;
22468|     52|    const uint8_t *p_escape;
22469|     52|    JSValue str;
22470|       |
22471|       |    /* string */
22472|     52|    if (string_buffer_init(s->ctx, b, 32))
  ------------------
  |  Branch (22472:9): [True: 0, False: 52]
  ------------------
22473|      0|        goto fail;
22474|  1.82M|    for(;;) {
22475|  1.82M|        if (p >= s->buf_end)
  ------------------
  |  Branch (22475:13): [True: 0, False: 1.82M]
  ------------------
22476|      0|            goto invalid_char;
22477|  1.82M|        c = *p;
22478|  1.82M|        if (c < 0x20) {
  ------------------
  |  Branch (22478:13): [True: 510k, False: 1.31M]
  ------------------
22479|   510k|            if (sep == '`') {
  ------------------
  |  Branch (22479:17): [True: 510k, False: 6]
  ------------------
22480|   510k|                if (c == '\r') {
  ------------------
  |  Branch (22480:21): [True: 0, False: 510k]
  ------------------
22481|      0|                    if (p[1] == '\n')
  ------------------
  |  Branch (22481:25): [True: 0, False: 0]
  ------------------
22482|      0|                        p++;
22483|      0|                    c = '\n';
22484|      0|                }
22485|       |                /* do not update s->line_num */
22486|   510k|            } else if (c == '\n' || c == '\r')
  ------------------
  |  Branch (22486:24): [True: 0, False: 6]
  |  Branch (22486:37): [True: 0, False: 6]
  ------------------
22487|      0|                goto invalid_char;
22488|   510k|        }
22489|  1.82M|        p++;
22490|  1.82M|        if (c == sep)
  ------------------
  |  Branch (22490:13): [True: 52, False: 1.82M]
  ------------------
22491|     52|            break;
22492|  1.82M|        if (c == '$' && *p == '{' && sep == '`') {
  ------------------
  |  Branch (22492:13): [True: 1.02k, False: 1.82M]
  |  Branch (22492:25): [True: 0, False: 1.02k]
  |  Branch (22492:38): [True: 0, False: 0]
  ------------------
22493|       |            /* template start or middle part */
22494|      0|            p++;
22495|      0|            break;
22496|      0|        }
22497|  1.82M|        if (c == '\\') {
  ------------------
  |  Branch (22497:13): [True: 30.1k, False: 1.79M]
  ------------------
22498|  30.1k|            p_escape = p - 1;
22499|  30.1k|            c = *p;
22500|       |            /* XXX: need a specific JSON case to avoid
22501|       |               accepting invalid escapes */
22502|  30.1k|            switch(c) {
22503|      0|            case '\0':
  ------------------
  |  Branch (22503:13): [True: 0, False: 30.1k]
  ------------------
22504|      0|                if (p >= s->buf_end)
  ------------------
  |  Branch (22504:21): [True: 0, False: 0]
  ------------------
22505|      0|                    goto invalid_char;
22506|      0|                p++;
22507|      0|                break;
22508|      0|            case '\'':
  ------------------
  |  Branch (22508:13): [True: 0, False: 30.1k]
  ------------------
22509|      0|            case '\"':
  ------------------
  |  Branch (22509:13): [True: 0, False: 30.1k]
  ------------------
22510|    320|            case '\\':
  ------------------
  |  Branch (22510:13): [True: 320, False: 29.8k]
  ------------------
22511|    320|                p++;
22512|    320|                break;
22513|      0|            case '\r':  /* accept DOS and MAC newline sequences */
  ------------------
  |  Branch (22513:13): [True: 0, False: 30.1k]
  ------------------
22514|      0|                if (p[1] == '\n') {
  ------------------
  |  Branch (22514:21): [True: 0, False: 0]
  ------------------
22515|      0|                    p++;
22516|      0|                }
22517|       |                /* fall thru */
22518|      0|            case '\n':
  ------------------
  |  Branch (22518:13): [True: 0, False: 30.1k]
  ------------------
22519|       |                /* ignore escaped newline sequence */
22520|      0|                p++;
22521|      0|                continue;
22522|  29.8k|            default:
  ------------------
  |  Branch (22522:13): [True: 29.8k, False: 320]
  ------------------
22523|  29.8k|                if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (22523:21): [True: 28.1k, False: 1.66k]
  |  Branch (22523:33): [True: 0, False: 28.1k]
  ------------------
22524|      0|                    if (!(s->cur_func->js_mode & JS_MODE_STRICT) && sep != '`')
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (22524:25): [True: 0, False: 0]
  |  Branch (22524:69): [True: 0, False: 0]
  ------------------
22525|      0|                        goto parse_escape;
22526|      0|                    if (c == '0' && !(p[1] >= '0' && p[1] <= '9')) {
  ------------------
  |  Branch (22526:25): [True: 0, False: 0]
  |  Branch (22526:39): [True: 0, False: 0]
  |  Branch (22526:54): [True: 0, False: 0]
  ------------------
22527|      0|                        p++;
22528|      0|                        c = '\0';
22529|      0|                    } else {
22530|      0|                        if (c >= '8' || sep == '`') {
  ------------------
  |  Branch (22530:29): [True: 0, False: 0]
  |  Branch (22530:41): [True: 0, False: 0]
  ------------------
22531|       |                            /* Note: according to ES2021, \8 and \9 are not
22532|       |                               accepted in strict mode or in templates. */
22533|      0|                            goto invalid_escape;
22534|      0|                        } else {
22535|      0|                            if (do_throw)
  ------------------
  |  Branch (22535:33): [True: 0, False: 0]
  ------------------
22536|      0|                                js_parse_error_pos(s, p_escape, "octal escape sequences are not allowed in strict mode");
22537|      0|                        }
22538|      0|                        goto fail;
22539|      0|                    }
22540|  29.8k|                } else if (c >= 0x80) {
  ------------------
  |  Branch (22540:28): [True: 0, False: 29.8k]
  ------------------
22541|      0|                    const uint8_t *p_next;
22542|      0|                    c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22543|      0|                    if (c > 0x10FFFF) {
  ------------------
  |  Branch (22543:25): [True: 0, False: 0]
  ------------------
22544|      0|                        goto invalid_utf8;
22545|      0|                    }
22546|      0|                    p = p_next;
22547|       |                    /* LS or PS are skipped */
22548|      0|                    if (c == CP_LS || c == CP_PS)
  ------------------
  |  |21889|      0|#define CP_LS   0x2028
  ------------------
                                  if (c == CP_LS || c == CP_PS)
  ------------------
  |  |21890|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (22548:25): [True: 0, False: 0]
  |  Branch (22548:39): [True: 0, False: 0]
  ------------------
22549|      0|                        continue;
22550|  29.8k|                } else {
22551|  29.8k|                parse_escape:
22552|  29.8k|                    ret = lre_parse_escape(&p, TRUE);
22553|  29.8k|                    if (ret == -1) {
  ------------------
  |  Branch (22553:25): [True: 0, False: 29.8k]
  ------------------
22554|      0|                    invalid_escape:
22555|      0|                        if (do_throw)
  ------------------
  |  Branch (22555:29): [True: 0, False: 0]
  ------------------
22556|      0|                            js_parse_error_pos(s, p_escape, "malformed escape sequence in string literal");
22557|      0|                        goto fail;
22558|  29.8k|                    } else if (ret < 0) {
  ------------------
  |  Branch (22558:32): [True: 28.1k, False: 1.67k]
  ------------------
22559|       |                        /* ignore the '\' (could output a warning) */
22560|  28.1k|                        p++;
22561|  28.1k|                    } else {
22562|  1.67k|                        c = ret;
22563|  1.67k|                    }
22564|  29.8k|                }
22565|  29.8k|                break;
22566|  30.1k|            }
22567|  1.79M|        } else if (c >= 0x80) {
  ------------------
  |  Branch (22567:20): [True: 627, False: 1.79M]
  ------------------
22568|    627|            const uint8_t *p_next;
22569|    627|            c = unicode_from_utf8(p - 1, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|    627|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22570|    627|            if (c > 0x10FFFF)
  ------------------
  |  Branch (22570:17): [True: 0, False: 627]
  ------------------
22571|      0|                goto invalid_utf8;
22572|    627|            p = p_next;
22573|    627|        }
22574|  1.82M|        if (string_buffer_putc(b, c))
  ------------------
  |  Branch (22574:13): [True: 0, False: 1.82M]
  ------------------
22575|      0|            goto fail;
22576|  1.82M|    }
22577|     52|    str = string_buffer_end(b);
22578|     52|    if (JS_IsException(str))
  ------------------
  |  Branch (22578:9): [True: 0, False: 52]
  ------------------
22579|      0|        return -1;
22580|     52|    token->val = TOK_STRING;
22581|     52|    token->u.str.sep = c;
22582|     52|    token->u.str.str = str;
22583|     52|    *pp = p;
22584|     52|    return 0;
22585|       |
22586|      0| invalid_utf8:
22587|      0|    if (do_throw)
  ------------------
  |  Branch (22587:9): [True: 0, False: 0]
  ------------------
22588|      0|        js_parse_error(s, "invalid UTF-8 sequence");
22589|      0|    goto fail;
22590|      0| invalid_char:
22591|      0|    if (do_throw)
  ------------------
  |  Branch (22591:9): [True: 0, False: 0]
  ------------------
22592|      0|        js_parse_error(s, "unexpected end of string");
22593|      0| fail:
22594|      0|    string_buffer_free(b);
22595|      0|    return -1;
22596|      0|}
quickjs.c:parse_ident:
22783|    380|{
22784|    380|    const uint8_t *p, *p1;
22785|    380|    char ident_buf[128], *buf;
22786|    380|    size_t ident_size, ident_pos;
22787|    380|    JSAtom atom;
22788|       |
22789|    380|    p = *pp;
22790|    380|    buf = ident_buf;
22791|    380|    ident_size = sizeof(ident_buf);
22792|    380|    ident_pos = 0;
22793|    380|    if (is_private)
  ------------------
  |  Branch (22793:9): [True: 0, False: 380]
  ------------------
22794|      0|        buf[ident_pos++] = '#';
22795|  1.04M|    for(;;) {
22796|  1.04M|        p1 = p;
22797|       |
22798|  1.04M|        if (c < 128) {
  ------------------
  |  Branch (22798:13): [True: 1.04M, False: 16]
  ------------------
22799|  1.04M|            buf[ident_pos++] = c;
22800|  1.04M|        } else {
22801|     16|            ident_pos += unicode_to_utf8((uint8_t*)buf + ident_pos, c);
22802|     16|        }
22803|  1.04M|        c = *p1++;
22804|  1.04M|        if (c == '\\' && *p1 == 'u') {
  ------------------
  |  Branch (22804:13): [True: 0, False: 1.04M]
  |  Branch (22804:26): [True: 0, False: 0]
  ------------------
22805|      0|            c = lre_parse_escape(&p1, TRUE);
22806|      0|            *pident_has_escape = TRUE;
22807|  1.04M|        } else if (c >= 128) {
  ------------------
  |  Branch (22807:20): [True: 15, False: 1.04M]
  ------------------
22808|     15|            c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p1);
  ------------------
  |  |  330|     15|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22809|     15|        }
22810|  1.04M|        if (!lre_js_is_ident_next(c))
  ------------------
  |  Branch (22810:13): [True: 380, False: 1.04M]
  ------------------
22811|    380|            break;
22812|  1.04M|        p = p1;
22813|  1.04M|        if (unlikely(ident_pos >= ident_size - UTF8_CHAR_LEN_MAX)) {
  ------------------
  |  |   33|  1.04M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 23, False: 1.04M]
  |  |  ------------------
  ------------------
22814|     23|            if (ident_realloc(s->ctx, &buf, &ident_size, ident_buf)) {
  ------------------
  |  Branch (22814:17): [True: 0, False: 23]
  ------------------
22815|      0|                atom = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
22816|      0|                goto done;
22817|      0|            }
22818|     23|        }
22819|  1.04M|    }
22820|    380|    atom = JS_NewAtomLen(s->ctx, buf, ident_pos);
22821|    380| done:
22822|    380|    if (unlikely(buf != ident_buf))
  ------------------
  |  |   33|    380|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1, False: 379]
  |  |  ------------------
  ------------------
22823|      1|        js_free(s->ctx, buf);
22824|    380|    *pp = p;
22825|    380|    return atom;
22826|    380|}
quickjs.c:update_token_ident:
22740|    381|{
22741|    381|    if (s->token.u.ident.atom <= JS_ATOM_LAST_KEYWORD ||
  ------------------
  |  | 1107|    762|#define JS_ATOM_LAST_KEYWORD JS_ATOM_super
  ------------------
  |  Branch (22741:9): [True: 64, False: 317]
  ------------------
22742|    317|        (s->token.u.ident.atom <= JS_ATOM_LAST_STRICT_KEYWORD &&
  ------------------
  |  | 1108|    634|#define JS_ATOM_LAST_STRICT_KEYWORD JS_ATOM_yield
  ------------------
  |  Branch (22742:10): [True: 39, False: 278]
  ------------------
22743|     39|         (s->cur_func->js_mode & JS_MODE_STRICT)) ||
  ------------------
  |  |  403|     39|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (22743:10): [True: 0, False: 39]
  ------------------
22744|    317|        (s->token.u.ident.atom == JS_ATOM_yield &&
  ------------------
  |  Branch (22744:10): [True: 0, False: 317]
  ------------------
22745|      0|         ((s->cur_func->func_kind & JS_FUNC_GENERATOR) ||
  ------------------
  |  Branch (22745:11): [True: 0, False: 0]
  ------------------
22746|      0|          (s->cur_func->func_type == JS_PARSE_FUNC_ARROW &&
  ------------------
  |  Branch (22746:12): [True: 0, False: 0]
  ------------------
22747|      0|           !s->cur_func->in_function_body && s->cur_func->parent &&
  ------------------
  |  Branch (22747:12): [True: 0, False: 0]
  |  Branch (22747:46): [True: 0, False: 0]
  ------------------
22748|      0|           (s->cur_func->parent->func_kind & JS_FUNC_GENERATOR)))) ||
  ------------------
  |  Branch (22748:12): [True: 0, False: 0]
  ------------------
22749|    317|        (s->token.u.ident.atom == JS_ATOM_await &&
  ------------------
  |  Branch (22749:10): [True: 0, False: 317]
  ------------------
22750|      0|         (s->is_module ||
  ------------------
  |  Branch (22750:11): [True: 0, False: 0]
  ------------------
22751|      0|          (s->cur_func->func_kind & JS_FUNC_ASYNC) ||
  ------------------
  |  Branch (22751:11): [True: 0, False: 0]
  ------------------
22752|      0|          s->cur_func->func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT ||
  ------------------
  |  Branch (22752:11): [True: 0, False: 0]
  ------------------
22753|      0|          (s->cur_func->func_type == JS_PARSE_FUNC_ARROW &&
  ------------------
  |  Branch (22753:12): [True: 0, False: 0]
  ------------------
22754|      0|           !s->cur_func->in_function_body && s->cur_func->parent &&
  ------------------
  |  Branch (22754:12): [True: 0, False: 0]
  |  Branch (22754:46): [True: 0, False: 0]
  ------------------
22755|      0|           ((s->cur_func->parent->func_kind & JS_FUNC_ASYNC) ||
  ------------------
  |  Branch (22755:13): [True: 0, False: 0]
  ------------------
22756|     64|            s->cur_func->parent->func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT))))) {
  ------------------
  |  Branch (22756:13): [True: 0, False: 0]
  ------------------
22757|     64|        if (s->token.u.ident.has_escape) {
  ------------------
  |  Branch (22757:13): [True: 0, False: 64]
  ------------------
22758|      0|            s->token.u.ident.is_reserved = TRUE;
22759|      0|            s->token.val = TOK_IDENT;
22760|     64|        } else {
22761|       |            /* The keywords atoms are pre allocated */
22762|     64|            s->token.val = s->token.u.ident.atom - 1 + TOK_FIRST_KEYWORD;
  ------------------
  |  |21882|     64|#define TOK_FIRST_KEYWORD   TOK_NULL
  ------------------
22763|     64|        }
22764|     64|    }
22765|    381|}
quickjs.c:js_parse_directives:
36328|     24|{
36329|     24|    char str[20];
36330|     24|    JSParsePos pos;
36331|     24|    BOOL has_semi;
36332|       |
36333|     24|    if (s->token.val != TOK_STRING)
  ------------------
  |  Branch (36333:9): [True: 22, False: 2]
  ------------------
36334|     22|        return 0;
36335|       |
36336|      2|    js_parse_get_pos(s, &pos);
36337|       |
36338|      4|    while(s->token.val == TOK_STRING) {
  ------------------
  |  Branch (36338:11): [True: 2, False: 2]
  ------------------
36339|       |        /* Copy actual source string representation */
36340|      2|        snprintf(str, sizeof str, "%.*s",
36341|      2|                 (int)(s->buf_ptr - s->token.ptr - 2), s->token.ptr + 1);
36342|       |
36343|      2|        if (next_token(s))
  ------------------
  |  Branch (36343:13): [True: 0, False: 2]
  ------------------
36344|      0|            return -1;
36345|       |
36346|      2|        has_semi = FALSE;
36347|      2|        switch (s->token.val) {
36348|      0|        case ';':
  ------------------
  |  Branch (36348:9): [True: 0, False: 2]
  ------------------
36349|      0|            if (next_token(s))
  ------------------
  |  Branch (36349:17): [True: 0, False: 0]
  ------------------
36350|      0|                return -1;
36351|      0|            has_semi = TRUE;
36352|      0|            break;
36353|      0|        case '}':
  ------------------
  |  Branch (36353:9): [True: 0, False: 2]
  ------------------
36354|      0|        case TOK_EOF:
  ------------------
  |  Branch (36354:9): [True: 0, False: 2]
  ------------------
36355|      0|            has_semi = TRUE;
36356|      0|            break;
36357|      0|        case TOK_NUMBER:
  ------------------
  |  Branch (36357:9): [True: 0, False: 2]
  ------------------
36358|      0|        case TOK_STRING:
  ------------------
  |  Branch (36358:9): [True: 0, False: 2]
  ------------------
36359|      0|        case TOK_TEMPLATE:
  ------------------
  |  Branch (36359:9): [True: 0, False: 2]
  ------------------
36360|      2|        case TOK_IDENT:
  ------------------
  |  Branch (36360:9): [True: 2, False: 0]
  ------------------
36361|      2|        case TOK_REGEXP:
  ------------------
  |  Branch (36361:9): [True: 0, False: 2]
  ------------------
36362|      2|        case TOK_DEC:
  ------------------
  |  Branch (36362:9): [True: 0, False: 2]
  ------------------
36363|      2|        case TOK_INC:
  ------------------
  |  Branch (36363:9): [True: 0, False: 2]
  ------------------
36364|      2|        case TOK_NULL:
  ------------------
  |  Branch (36364:9): [True: 0, False: 2]
  ------------------
36365|      2|        case TOK_FALSE:
  ------------------
  |  Branch (36365:9): [True: 0, False: 2]
  ------------------
36366|      2|        case TOK_TRUE:
  ------------------
  |  Branch (36366:9): [True: 0, False: 2]
  ------------------
36367|      2|        case TOK_IF:
  ------------------
  |  Branch (36367:9): [True: 0, False: 2]
  ------------------
36368|      2|        case TOK_RETURN:
  ------------------
  |  Branch (36368:9): [True: 0, False: 2]
  ------------------
36369|      2|        case TOK_VAR:
  ------------------
  |  Branch (36369:9): [True: 0, False: 2]
  ------------------
36370|      2|        case TOK_THIS:
  ------------------
  |  Branch (36370:9): [True: 0, False: 2]
  ------------------
36371|      2|        case TOK_DELETE:
  ------------------
  |  Branch (36371:9): [True: 0, False: 2]
  ------------------
36372|      2|        case TOK_TYPEOF:
  ------------------
  |  Branch (36372:9): [True: 0, False: 2]
  ------------------
36373|      2|        case TOK_NEW:
  ------------------
  |  Branch (36373:9): [True: 0, False: 2]
  ------------------
36374|      2|        case TOK_DO:
  ------------------
  |  Branch (36374:9): [True: 0, False: 2]
  ------------------
36375|      2|        case TOK_WHILE:
  ------------------
  |  Branch (36375:9): [True: 0, False: 2]
  ------------------
36376|      2|        case TOK_FOR:
  ------------------
  |  Branch (36376:9): [True: 0, False: 2]
  ------------------
36377|      2|        case TOK_SWITCH:
  ------------------
  |  Branch (36377:9): [True: 0, False: 2]
  ------------------
36378|      2|        case TOK_THROW:
  ------------------
  |  Branch (36378:9): [True: 0, False: 2]
  ------------------
36379|      2|        case TOK_TRY:
  ------------------
  |  Branch (36379:9): [True: 0, False: 2]
  ------------------
36380|      2|        case TOK_FUNCTION:
  ------------------
  |  Branch (36380:9): [True: 0, False: 2]
  ------------------
36381|      2|        case TOK_DEBUGGER:
  ------------------
  |  Branch (36381:9): [True: 0, False: 2]
  ------------------
36382|      2|        case TOK_WITH:
  ------------------
  |  Branch (36382:9): [True: 0, False: 2]
  ------------------
36383|      2|        case TOK_CLASS:
  ------------------
  |  Branch (36383:9): [True: 0, False: 2]
  ------------------
36384|      2|        case TOK_CONST:
  ------------------
  |  Branch (36384:9): [True: 0, False: 2]
  ------------------
36385|      2|        case TOK_ENUM:
  ------------------
  |  Branch (36385:9): [True: 0, False: 2]
  ------------------
36386|      2|        case TOK_EXPORT:
  ------------------
  |  Branch (36386:9): [True: 0, False: 2]
  ------------------
36387|      2|        case TOK_IMPORT:
  ------------------
  |  Branch (36387:9): [True: 0, False: 2]
  ------------------
36388|      2|        case TOK_SUPER:
  ------------------
  |  Branch (36388:9): [True: 0, False: 2]
  ------------------
36389|      2|        case TOK_INTERFACE:
  ------------------
  |  Branch (36389:9): [True: 0, False: 2]
  ------------------
36390|      2|        case TOK_LET:
  ------------------
  |  Branch (36390:9): [True: 0, False: 2]
  ------------------
36391|      2|        case TOK_PACKAGE:
  ------------------
  |  Branch (36391:9): [True: 0, False: 2]
  ------------------
36392|      2|        case TOK_PRIVATE:
  ------------------
  |  Branch (36392:9): [True: 0, False: 2]
  ------------------
36393|      2|        case TOK_PROTECTED:
  ------------------
  |  Branch (36393:9): [True: 0, False: 2]
  ------------------
36394|      2|        case TOK_PUBLIC:
  ------------------
  |  Branch (36394:9): [True: 0, False: 2]
  ------------------
36395|      2|        case TOK_STATIC:
  ------------------
  |  Branch (36395:9): [True: 0, False: 2]
  ------------------
36396|       |            /* automatic insertion of ';' */
36397|      2|            if (s->got_lf)
  ------------------
  |  Branch (36397:17): [True: 2, False: 0]
  ------------------
36398|      2|                has_semi = TRUE;
36399|      2|            break;
36400|      0|        default:
  ------------------
  |  Branch (36400:9): [True: 0, False: 2]
  ------------------
36401|      0|            break;
36402|      2|        }
36403|      2|        if (!has_semi)
  ------------------
  |  Branch (36403:13): [True: 0, False: 2]
  ------------------
36404|      0|            break;
36405|      2|        if (!strcmp(str, "use strict")) {
  ------------------
  |  Branch (36405:13): [True: 0, False: 2]
  ------------------
36406|      0|            s->cur_func->has_use_strict = TRUE;
36407|      0|            s->cur_func->js_mode |= JS_MODE_STRICT;
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
36408|      0|        }
36409|      2|    }
36410|      2|    return js_parse_seek_token(s, &pos);
36411|      2|}
quickjs.c:js_parse_get_pos:
24746|     37|{
24747|     37|    sp->ptr = s->token.ptr;
24748|     37|    sp->got_lf = s->got_lf;
24749|     37|    return 0;
24750|     37|}
quickjs.c:js_parse_seek_token:
24753|     37|{
24754|     37|    s->buf_ptr = sp->ptr;
24755|     37|    s->got_lf = sp->got_lf;
24756|     37|    return next_token(s);
24757|     37|}
quickjs.c:add_var:
24175|     31|{
24176|     31|    JSVarDef *vd;
24177|       |
24178|       |    /* the local variable indexes are currently stored on 16 bits */
24179|     31|    if (fd->var_count >= JS_MAX_LOCAL_VARS) {
  ------------------
  |  |  210|     31|#define JS_MAX_LOCAL_VARS 65534
  ------------------
  |  Branch (24179:9): [True: 0, False: 31]
  ------------------
24180|      0|        JS_ThrowInternalError(ctx, "too many local variables");
24181|      0|        return -1;
24182|      0|    }
24183|     31|    if (js_resize_array(ctx, (void **)&fd->vars, sizeof(fd->vars[0]),
  ------------------
  |  Branch (24183:9): [True: 0, False: 31]
  ------------------
24184|     31|                        &fd->var_size, fd->var_count + 1))
24185|      0|        return -1;
24186|     31|    vd = &fd->vars[fd->var_count++];
24187|     31|    memset(vd, 0, sizeof(*vd));
24188|     31|    vd->var_name = JS_DupAtom(ctx, name);
24189|     31|    vd->func_pool_idx = -1;
24190|     31|    return fd->var_count - 1;
24191|     31|}
quickjs.c:js_parse_source_element:
32035|     73|{
32036|     73|    JSFunctionDef *fd = s->cur_func;
32037|     73|    int tok;
32038|       |
32039|     73|    if (s->token.val == TOK_FUNCTION ||
  ------------------
  |  Branch (32039:9): [True: 1, False: 72]
  ------------------
32040|     72|        (token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (32040:10): [True: 0, False: 72]
  ------------------
32041|      1|         peek_token(s, TRUE) == TOK_FUNCTION)) {
  ------------------
  |  Branch (32041:10): [True: 0, False: 0]
  ------------------
32042|      1|        if (js_parse_function_decl(s, JS_PARSE_FUNC_STATEMENT,
  ------------------
  |  Branch (32042:13): [True: 0, False: 1]
  ------------------
32043|      1|                                   JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  451|      1|#define JS_ATOM_NULL 0
  ------------------
32044|      1|                                   s->token.ptr))
32045|      0|            return -1;
32046|     72|    } else if (s->token.val == TOK_EXPORT && fd->module) {
  ------------------
  |  Branch (32046:16): [True: 0, False: 72]
  |  Branch (32046:46): [True: 0, False: 0]
  ------------------
32047|      0|        if (js_parse_export(s))
  ------------------
  |  Branch (32047:13): [True: 0, False: 0]
  ------------------
32048|      0|            return -1;
32049|     72|    } else if (s->token.val == TOK_IMPORT && fd->module &&
  ------------------
  |  Branch (32049:16): [True: 22, False: 50]
  |  Branch (32049:46): [True: 22, False: 0]
  ------------------
32050|     22|               ((tok = peek_token(s, FALSE)) != '(' && tok != '.'))  {
  ------------------
  |  Branch (32050:17): [True: 22, False: 0]
  |  Branch (32050:56): [True: 22, False: 0]
  ------------------
32051|       |        /* the peek_token is needed to avoid confusion with ImportCall
32052|       |           (dynamic import) or import.meta */
32053|     22|        if (js_parse_import(s))
  ------------------
  |  Branch (32053:13): [True: 0, False: 22]
  ------------------
32054|      0|            return -1;
32055|     50|    } else {
32056|     50|        if (js_parse_statement_or_decl(s, DECL_MASK_ALL))
  ------------------
  |  |28485|     50|#define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28481|     50|#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)
  |  |  ------------------
  |  |  |  |28483|     50|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  |  |  ------------------
  |  |               #define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28484|     50|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  |  |  ------------------
  ------------------
  |  Branch (32056:13): [True: 5, False: 45]
  ------------------
32057|      5|            return -1;
32058|     50|    }
32059|     68|    return 0;
32060|     73|}
quickjs.c:token_is_pseudo_keyword:
22598|    555|static inline BOOL token_is_pseudo_keyword(JSParseState *s, JSAtom atom) {
22599|    555|    return s->token.val == TOK_IDENT && s->token.u.ident.atom == atom &&
  ------------------
  |  Branch (22599:12): [True: 468, False: 87]
  |  Branch (22599:41): [True: 57, False: 411]
  ------------------
22600|     57|        !s->token.u.ident.has_escape;
  ------------------
  |  Branch (22600:9): [True: 57, False: 0]
  ------------------
22601|    555|}
quickjs.c:peek_token:
23756|    168|{
23757|    168|    const uint8_t *p = s->buf_ptr;
23758|    168|    return simple_next_token(&p, no_line_terminator);
23759|    168|}
quickjs.c:js_parse_function_decl:
37073|      5|{
37074|      5|    return js_parse_function_decl2(s, func_type, func_kind, func_name, ptr,
37075|       |                                   JS_PARSE_EXPORT_NONE, NULL);
37076|      5|}
quickjs.c:js_parse_function_decl2:
36507|      5|{
36508|      5|    JSContext *ctx = s->ctx;
36509|      5|    JSFunctionDef *fd = s->cur_func;
36510|      5|    BOOL is_expr;
36511|      5|    int func_idx, lexical_func_idx = -1;
36512|      5|    BOOL has_opt_arg;
36513|      5|    BOOL create_func_var = FALSE;
36514|       |
36515|      5|    is_expr = (func_type != JS_PARSE_FUNC_STATEMENT &&
  ------------------
  |  Branch (36515:16): [True: 4, False: 1]
  ------------------
36516|      4|               func_type != JS_PARSE_FUNC_VAR);
  ------------------
  |  Branch (36516:16): [True: 2, False: 2]
  ------------------
36517|       |
36518|      5|    if (func_type == JS_PARSE_FUNC_STATEMENT ||
  ------------------
  |  Branch (36518:9): [True: 1, False: 4]
  ------------------
36519|      4|        func_type == JS_PARSE_FUNC_VAR ||
  ------------------
  |  Branch (36519:9): [True: 2, False: 2]
  ------------------
36520|      3|        func_type == JS_PARSE_FUNC_EXPR) {
  ------------------
  |  Branch (36520:9): [True: 0, False: 2]
  ------------------
36521|      3|        if (func_kind == JS_FUNC_NORMAL &&
  ------------------
  |  Branch (36521:13): [True: 3, False: 0]
  ------------------
36522|      3|            token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (36522:13): [True: 0, False: 3]
  ------------------
36523|      0|            peek_token(s, TRUE) != '\n') {
  ------------------
  |  Branch (36523:13): [True: 0, False: 0]
  ------------------
36524|      0|            if (next_token(s))
  ------------------
  |  Branch (36524:17): [True: 0, False: 0]
  ------------------
36525|      0|                return -1;
36526|      0|            func_kind = JS_FUNC_ASYNC;
36527|      0|        }
36528|      3|        if (next_token(s))
  ------------------
  |  Branch (36528:13): [True: 0, False: 3]
  ------------------
36529|      0|            return -1;
36530|      3|        if (s->token.val == '*') {
  ------------------
  |  Branch (36530:13): [True: 1, False: 2]
  ------------------
36531|      1|            if (next_token(s))
  ------------------
  |  Branch (36531:17): [True: 0, False: 1]
  ------------------
36532|      0|                return -1;
36533|      1|            func_kind |= JS_FUNC_GENERATOR;
36534|      1|        }
36535|       |
36536|      3|        if (s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (36536:13): [True: 3, False: 0]
  ------------------
36537|      3|            if (s->token.u.ident.is_reserved ||
  ------------------
  |  Branch (36537:17): [True: 0, False: 3]
  ------------------
36538|      3|                (s->token.u.ident.atom == JS_ATOM_yield &&
  ------------------
  |  Branch (36538:18): [True: 0, False: 3]
  ------------------
36539|      0|                 func_type == JS_PARSE_FUNC_EXPR &&
  ------------------
  |  Branch (36539:18): [True: 0, False: 0]
  ------------------
36540|      0|                 (func_kind & JS_FUNC_GENERATOR)) ||
  ------------------
  |  Branch (36540:18): [True: 0, False: 0]
  ------------------
36541|      3|                (s->token.u.ident.atom == JS_ATOM_await &&
  ------------------
  |  Branch (36541:18): [True: 0, False: 3]
  ------------------
36542|      0|                 ((func_type == JS_PARSE_FUNC_EXPR &&
  ------------------
  |  Branch (36542:20): [True: 0, False: 0]
  ------------------
36543|      0|                   (func_kind & JS_FUNC_ASYNC)) ||
  ------------------
  |  Branch (36543:20): [True: 0, False: 0]
  ------------------
36544|      0|                  func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT))) {
  ------------------
  |  Branch (36544:19): [True: 0, False: 0]
  ------------------
36545|      0|                return js_parse_error_reserved_identifier(s);
36546|      0|            }
36547|      3|        }
36548|      3|        if (s->token.val == TOK_IDENT ||
  ------------------
  |  Branch (36548:13): [True: 3, False: 0]
  ------------------
36549|      0|            (((s->token.val == TOK_YIELD && !(fd->js_mode & JS_MODE_STRICT)) ||
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (36549:16): [True: 0, False: 0]
  |  Branch (36549:45): [True: 0, False: 0]
  ------------------
36550|      0|             (s->token.val == TOK_AWAIT && !s->is_module)) &&
  ------------------
  |  Branch (36550:15): [True: 0, False: 0]
  |  Branch (36550:44): [True: 0, False: 0]
  ------------------
36551|      3|             func_type == JS_PARSE_FUNC_EXPR)) {
  ------------------
  |  Branch (36551:14): [True: 0, False: 0]
  ------------------
36552|      3|            func_name = JS_DupAtom(ctx, s->token.u.ident.atom);
36553|      3|            if (next_token(s)) {
  ------------------
  |  Branch (36553:17): [True: 0, False: 3]
  ------------------
36554|      0|                JS_FreeAtom(ctx, func_name);
36555|      0|                return -1;
36556|      0|            }
36557|      3|        } else {
36558|      0|            if (func_type != JS_PARSE_FUNC_EXPR &&
  ------------------
  |  Branch (36558:17): [True: 0, False: 0]
  ------------------
36559|      0|                export_flag != JS_PARSE_EXPORT_DEFAULT) {
  ------------------
  |  Branch (36559:17): [True: 0, False: 0]
  ------------------
36560|      0|                return js_parse_error(s, "function name expected");
36561|      0|            }
36562|      0|        }
36563|      3|    } else if (func_type != JS_PARSE_FUNC_ARROW) {
  ------------------
  |  Branch (36563:16): [True: 0, False: 2]
  ------------------
36564|      0|        func_name = JS_DupAtom(ctx, func_name);
36565|      0|    }
36566|       |
36567|      5|    if (fd->is_eval && fd->eval_type == JS_EVAL_TYPE_MODULE &&
  ------------------
  |  |  333|      8|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (36567:9): [True: 3, False: 2]
  |  Branch (36567:24): [True: 0, False: 3]
  ------------------
36568|      0|        (func_type == JS_PARSE_FUNC_STATEMENT || func_type == JS_PARSE_FUNC_VAR)) {
  ------------------
  |  Branch (36568:10): [True: 0, False: 0]
  |  Branch (36568:50): [True: 0, False: 0]
  ------------------
36569|      0|        JSGlobalVar *hf;
36570|      0|        hf = find_global_var(fd, func_name);
36571|       |        /* XXX: should check scope chain */
36572|      0|        if (hf && hf->scope_level == fd->scope_level) {
  ------------------
  |  Branch (36572:13): [True: 0, False: 0]
  |  Branch (36572:19): [True: 0, False: 0]
  ------------------
36573|      0|            js_parse_error(s, "invalid redefinition of global identifier in module code");
36574|      0|            JS_FreeAtom(ctx, func_name);
36575|      0|            return -1;
36576|      0|        }
36577|      0|    }
36578|       |
36579|      5|    if (func_type == JS_PARSE_FUNC_VAR) {
  ------------------
  |  Branch (36579:9): [True: 2, False: 3]
  ------------------
36580|      2|        if (!(fd->js_mode & JS_MODE_STRICT)
  ------------------
  |  |  403|      2|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (36580:13): [True: 2, False: 0]
  ------------------
36581|      2|        && func_kind == JS_FUNC_NORMAL
  ------------------
  |  Branch (36581:12): [True: 1, False: 1]
  ------------------
36582|      1|        &&  find_lexical_decl(ctx, fd, func_name, fd->scope_first, FALSE) < 0
  ------------------
  |  Branch (36582:13): [True: 1, False: 0]
  ------------------
36583|      1|        &&  !((func_idx = find_var(ctx, fd, func_name)) >= 0 && (func_idx & ARGUMENT_VAR_OFFSET))
  ------------------
  |  |16191|      1|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (36583:15): [True: 1, False: 0]
  |  Branch (36583:65): [True: 1, False: 0]
  ------------------
36584|      0|        &&  !(func_name == JS_ATOM_arguments && fd->has_arguments_binding)) {
  ------------------
  |  Branch (36584:15): [True: 0, False: 0]
  |  Branch (36584:49): [True: 0, False: 0]
  ------------------
36585|      0|            create_func_var = TRUE;
36586|      0|        }
36587|       |        /* Create the lexical name here so that the function closure
36588|       |           contains it */
36589|      2|        if (fd->is_eval &&
  ------------------
  |  Branch (36589:13): [True: 1, False: 1]
  ------------------
36590|      1|            (fd->eval_type == JS_EVAL_TYPE_GLOBAL ||
  ------------------
  |  |  332|      2|#define JS_EVAL_TYPE_GLOBAL   (0 << 0) /* global code (default) */
  ------------------
  |  Branch (36590:14): [True: 1, False: 0]
  ------------------
36591|      0|             fd->eval_type == JS_EVAL_TYPE_MODULE) &&
  ------------------
  |  |  333|      0|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (36591:14): [True: 0, False: 0]
  ------------------
36592|      1|            fd->scope_level == fd->body_scope) {
  ------------------
  |  Branch (36592:13): [True: 0, False: 1]
  ------------------
36593|       |            /* avoid creating a lexical variable in the global
36594|       |               scope. XXX: check annex B */
36595|      0|            JSGlobalVar *hf;
36596|      0|            hf = find_global_var(fd, func_name);
36597|       |            /* XXX: should check scope chain */
36598|      0|            if (hf && hf->scope_level == fd->scope_level) {
  ------------------
  |  Branch (36598:17): [True: 0, False: 0]
  |  Branch (36598:23): [True: 0, False: 0]
  ------------------
36599|      0|                js_parse_error(s, "invalid redefinition of global identifier");
36600|      0|                JS_FreeAtom(ctx, func_name);
36601|      0|                return -1;
36602|      0|            }
36603|      2|        } else {
36604|       |            /* Always create a lexical name, fail if at the same scope as
36605|       |               existing name */
36606|       |            /* Lexical variable will be initialized upon entering scope */
36607|      2|            lexical_func_idx = define_var(s, fd, func_name,
36608|      2|                                          func_kind != JS_FUNC_NORMAL ?
  ------------------
  |  Branch (36608:43): [True: 1, False: 1]
  ------------------
36609|      1|                                          JS_VAR_DEF_NEW_FUNCTION_DECL :
36610|      2|                                          JS_VAR_DEF_FUNCTION_DECL);
36611|      2|            if (lexical_func_idx < 0) {
  ------------------
  |  Branch (36611:17): [True: 0, False: 2]
  ------------------
36612|      0|                JS_FreeAtom(ctx, func_name);
36613|      0|                return -1;
36614|      0|            }
36615|      2|        }
36616|      2|    }
36617|       |
36618|      5|    fd = js_new_function_def(ctx, fd, FALSE, is_expr,
36619|      5|                             s->filename, ptr,
36620|      5|                             &s->get_line_col_cache);
36621|      5|    if (!fd) {
  ------------------
  |  Branch (36621:9): [True: 0, False: 5]
  ------------------
36622|      0|        JS_FreeAtom(ctx, func_name);
36623|      0|        return -1;
36624|      0|    }
36625|      5|    if (pfd)
  ------------------
  |  Branch (36625:9): [True: 0, False: 5]
  ------------------
36626|      0|        *pfd = fd;
36627|      5|    s->cur_func = fd;
36628|      5|    fd->func_name = func_name;
36629|       |    /* XXX: test !fd->is_generator is always false */
36630|      5|    fd->has_prototype = (func_type == JS_PARSE_FUNC_STATEMENT ||
  ------------------
  |  Branch (36630:26): [True: 1, False: 4]
  ------------------
36631|      4|                         func_type == JS_PARSE_FUNC_VAR ||
  ------------------
  |  Branch (36631:26): [True: 2, False: 2]
  ------------------
36632|      2|                         func_type == JS_PARSE_FUNC_EXPR) &&
  ------------------
  |  Branch (36632:26): [True: 0, False: 2]
  ------------------
36633|      3|                        func_kind == JS_FUNC_NORMAL;
  ------------------
  |  Branch (36633:25): [True: 2, False: 1]
  ------------------
36634|      5|    fd->has_home_object = (func_type == JS_PARSE_FUNC_METHOD ||
  ------------------
  |  Branch (36634:28): [True: 0, False: 5]
  ------------------
36635|      5|                           func_type == JS_PARSE_FUNC_GETTER ||
  ------------------
  |  Branch (36635:28): [True: 0, False: 5]
  ------------------
36636|      5|                           func_type == JS_PARSE_FUNC_SETTER ||
  ------------------
  |  Branch (36636:28): [True: 0, False: 5]
  ------------------
36637|      5|                           func_type == JS_PARSE_FUNC_CLASS_CONSTRUCTOR ||
  ------------------
  |  Branch (36637:28): [True: 0, False: 5]
  ------------------
36638|      5|                           func_type == JS_PARSE_FUNC_DERIVED_CLASS_CONSTRUCTOR);
  ------------------
  |  Branch (36638:28): [True: 0, False: 5]
  ------------------
36639|      5|    fd->has_arguments_binding = (func_type != JS_PARSE_FUNC_ARROW &&
  ------------------
  |  Branch (36639:34): [True: 3, False: 2]
  ------------------
36640|      3|                                 func_type != JS_PARSE_FUNC_CLASS_STATIC_INIT);
  ------------------
  |  Branch (36640:34): [True: 3, False: 0]
  ------------------
36641|      5|    fd->has_this_binding = fd->has_arguments_binding;
36642|      5|    fd->is_derived_class_constructor = (func_type == JS_PARSE_FUNC_DERIVED_CLASS_CONSTRUCTOR);
36643|      5|    if (func_type == JS_PARSE_FUNC_ARROW) {
  ------------------
  |  Branch (36643:9): [True: 2, False: 3]
  ------------------
36644|      2|        fd->new_target_allowed = fd->parent->new_target_allowed;
36645|      2|        fd->super_call_allowed = fd->parent->super_call_allowed;
36646|      2|        fd->super_allowed = fd->parent->super_allowed;
36647|      2|        fd->arguments_allowed = fd->parent->arguments_allowed;
36648|      3|    } else if (func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT) {
  ------------------
  |  Branch (36648:16): [True: 0, False: 3]
  ------------------
36649|      0|        fd->new_target_allowed = TRUE; // although new.target === undefined
36650|      0|        fd->super_call_allowed = FALSE;
36651|      0|        fd->super_allowed = TRUE;
36652|      0|        fd->arguments_allowed = FALSE;
36653|      3|    } else {
36654|      3|        fd->new_target_allowed = TRUE;
36655|      3|        fd->super_call_allowed = fd->is_derived_class_constructor;
36656|      3|        fd->super_allowed = fd->has_home_object;
36657|      3|        fd->arguments_allowed = TRUE;
36658|      3|    }
36659|       |
36660|       |    /* fd->in_function_body == FALSE prevents yield/await during the parsing
36661|       |       of the arguments in generator/async functions. They are parsed as
36662|       |       regular identifiers for other function kinds. */
36663|      5|    fd->func_kind = func_kind;
36664|      5|    fd->func_type = func_type;
36665|       |
36666|      5|    if (func_type == JS_PARSE_FUNC_CLASS_CONSTRUCTOR ||
  ------------------
  |  Branch (36666:9): [True: 0, False: 5]
  ------------------
36667|      5|        func_type == JS_PARSE_FUNC_DERIVED_CLASS_CONSTRUCTOR) {
  ------------------
  |  Branch (36667:9): [True: 0, False: 5]
  ------------------
36668|       |        /* error if not invoked as a constructor */
36669|      0|        emit_op(s, OP_check_ctor);
36670|      0|    }
36671|       |
36672|      5|    if (func_type == JS_PARSE_FUNC_CLASS_CONSTRUCTOR) {
  ------------------
  |  Branch (36672:9): [True: 0, False: 5]
  ------------------
36673|      0|        emit_class_field_init(s);
36674|      0|    }
36675|       |
36676|       |    /* parse arguments */
36677|      5|    fd->has_simple_parameter_list = TRUE;
36678|      5|    fd->has_parameter_expressions = FALSE;
36679|      5|    has_opt_arg = FALSE;
36680|      5|    if (func_type == JS_PARSE_FUNC_ARROW && s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (36680:9): [True: 2, False: 3]
  |  Branch (36680:45): [True: 0, False: 2]
  ------------------
36681|      0|        JSAtom name;
36682|      0|        if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (36682:13): [True: 0, False: 0]
  ------------------
36683|      0|            js_parse_error_reserved_identifier(s);
36684|      0|            goto fail;
36685|      0|        }
36686|      0|        name = s->token.u.ident.atom;
36687|      0|        if (add_arg(ctx, fd, name) < 0)
  ------------------
  |  Branch (36687:13): [True: 0, False: 0]
  ------------------
36688|      0|            goto fail;
36689|      0|        fd->defined_arg_count = 1;
36690|      5|    } else if (func_type != JS_PARSE_FUNC_CLASS_STATIC_INIT) {
  ------------------
  |  Branch (36690:16): [True: 5, False: 0]
  ------------------
36691|      5|        if (s->token.val == '(') {
  ------------------
  |  Branch (36691:13): [True: 5, False: 0]
  ------------------
36692|      5|            int skip_bits;
36693|       |            /* if there is an '=' inside the parameter list, we
36694|       |               consider there is a parameter expression inside */
36695|      5|            js_parse_skip_parens_token(s, &skip_bits, FALSE);
36696|      5|            if (skip_bits & SKIP_HAS_ASSIGNMENT)
  ------------------
  |  |24784|      5|#define SKIP_HAS_ASSIGNMENT (1 << 2)
  ------------------
  |  Branch (36696:17): [True: 2, False: 3]
  ------------------
36697|      2|                fd->has_parameter_expressions = TRUE;
36698|      5|            if (next_token(s))
  ------------------
  |  Branch (36698:17): [True: 0, False: 5]
  ------------------
36699|      0|                goto fail;
36700|      5|        } else {
36701|      0|            if (js_parse_expect(s, '('))
  ------------------
  |  Branch (36701:17): [True: 0, False: 0]
  ------------------
36702|      0|                goto fail;
36703|      0|        }
36704|       |
36705|      5|        if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36705:13): [True: 2, False: 3]
  ------------------
36706|      2|            fd->scope_level = -1; /* force no parent scope */
36707|      2|            if (push_scope(s) < 0)
  ------------------
  |  Branch (36707:17): [True: 0, False: 2]
  ------------------
36708|      0|                return -1;
36709|      2|        }
36710|       |
36711|      9|        while (s->token.val != ')') {
  ------------------
  |  Branch (36711:16): [True: 8, False: 1]
  ------------------
36712|      8|            JSAtom name;
36713|      8|            BOOL rest = FALSE;
36714|      8|            int idx, has_initializer;
36715|       |
36716|      8|            if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (36716:17): [True: 0, False: 8]
  ------------------
36717|      0|                if (func_type == JS_PARSE_FUNC_SETTER)
  ------------------
  |  Branch (36717:21): [True: 0, False: 0]
  ------------------
36718|      0|                    goto fail_accessor;
36719|      0|                fd->has_simple_parameter_list = FALSE;
36720|      0|                rest = TRUE;
36721|      0|                if (next_token(s))
  ------------------
  |  Branch (36721:21): [True: 0, False: 0]
  ------------------
36722|      0|                    goto fail;
36723|      0|            }
36724|      8|            if (s->token.val == '[' || s->token.val == '{') {
  ------------------
  |  Branch (36724:17): [True: 0, False: 8]
  |  Branch (36724:40): [True: 2, False: 6]
  ------------------
36725|      2|                fd->has_simple_parameter_list = FALSE;
36726|      2|                if (rest) {
  ------------------
  |  Branch (36726:21): [True: 0, False: 2]
  ------------------
36727|      0|                    emit_op(s, OP_rest);
36728|      0|                    emit_u16(s, fd->arg_count);
36729|      2|                } else {
36730|       |                    /* unnamed arg for destructuring */
36731|      2|                    idx = add_arg(ctx, fd, JS_ATOM_NULL);
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
36732|      2|                    emit_op(s, OP_get_arg);
36733|      2|                    emit_u16(s, idx);
36734|      2|                }
36735|      2|                has_initializer = js_parse_destructuring_element(s, fd->has_parameter_expressions ? TOK_LET : TOK_VAR, 1, TRUE, -1, TRUE, FALSE);
  ------------------
  |  Branch (36735:69): [True: 2, False: 0]
  ------------------
36736|      2|                if (has_initializer < 0)
  ------------------
  |  Branch (36736:21): [True: 0, False: 2]
  ------------------
36737|      0|                    goto fail;
36738|      2|                if (has_initializer)
  ------------------
  |  Branch (36738:21): [True: 2, False: 0]
  ------------------
36739|      2|                    has_opt_arg = TRUE;
36740|      2|                if (!has_opt_arg)
  ------------------
  |  Branch (36740:21): [True: 0, False: 2]
  ------------------
36741|      0|                    fd->defined_arg_count++;
36742|      6|            } else if (s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (36742:24): [True: 6, False: 0]
  ------------------
36743|      6|                if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (36743:21): [True: 0, False: 6]
  ------------------
36744|      0|                    js_parse_error_reserved_identifier(s);
36745|      0|                    goto fail;
36746|      0|                }
36747|      6|                name = s->token.u.ident.atom;
36748|      6|                if (name == JS_ATOM_yield && fd->func_kind == JS_FUNC_GENERATOR) {
  ------------------
  |  Branch (36748:21): [True: 0, False: 6]
  |  Branch (36748:46): [True: 0, False: 0]
  ------------------
36749|      0|                    js_parse_error_reserved_identifier(s);
36750|      0|                    goto fail;
36751|      0|                }
36752|      6|                if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36752:21): [True: 2, False: 4]
  ------------------
36753|      2|                    if (js_parse_check_duplicate_parameter(s, name))
  ------------------
  |  Branch (36753:25): [True: 0, False: 2]
  ------------------
36754|      0|                        goto fail;
36755|      2|                    if (define_var(s, fd, name, JS_VAR_DEF_LET) < 0)
  ------------------
  |  Branch (36755:25): [True: 0, False: 2]
  ------------------
36756|      0|                        goto fail;
36757|      2|                }
36758|       |                /* XXX: could avoid allocating an argument if rest is true */
36759|      6|                idx = add_arg(ctx, fd, name);
36760|      6|                if (idx < 0)
  ------------------
  |  Branch (36760:21): [True: 0, False: 6]
  ------------------
36761|      0|                    goto fail;
36762|      6|                if (next_token(s))
  ------------------
  |  Branch (36762:21): [True: 0, False: 6]
  ------------------
36763|      0|                    goto fail;
36764|      6|                if (rest) {
  ------------------
  |  Branch (36764:21): [True: 0, False: 6]
  ------------------
36765|      0|                    emit_op(s, OP_rest);
36766|      0|                    emit_u16(s, idx);
36767|      0|                    if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36767:25): [True: 0, False: 0]
  ------------------
36768|      0|                        emit_op(s, OP_dup);
36769|      0|                        emit_op(s, OP_scope_put_var_init);
36770|      0|                        emit_atom(s, name);
36771|      0|                        emit_u16(s, fd->scope_level);
36772|      0|                    }
36773|      0|                    emit_op(s, OP_put_arg);
36774|      0|                    emit_u16(s, idx);
36775|      0|                    fd->has_simple_parameter_list = FALSE;
36776|      0|                    has_opt_arg = TRUE;
36777|      6|                } else if (s->token.val == '=') {
  ------------------
  |  Branch (36777:28): [True: 0, False: 6]
  ------------------
36778|      0|                    int label;
36779|       |
36780|      0|                    fd->has_simple_parameter_list = FALSE;
36781|      0|                    has_opt_arg = TRUE;
36782|       |
36783|      0|                    if (next_token(s))
  ------------------
  |  Branch (36783:25): [True: 0, False: 0]
  ------------------
36784|      0|                        goto fail;
36785|       |
36786|      0|                    label = new_label(s);
36787|      0|                    emit_op(s, OP_get_arg);
36788|      0|                    emit_u16(s, idx);
36789|      0|                    emit_op(s, OP_dup);
36790|      0|                    emit_op(s, OP_undefined);
36791|      0|                    emit_op(s, OP_strict_eq);
36792|      0|                    emit_goto(s, OP_if_false, label);
36793|      0|                    emit_op(s, OP_drop);
36794|      0|                    if (js_parse_assign_expr(s))
  ------------------
  |  Branch (36794:25): [True: 0, False: 0]
  ------------------
36795|      0|                        goto fail;
36796|      0|                    set_object_name(s, name);
36797|      0|                    emit_op(s, OP_dup);
36798|      0|                    emit_op(s, OP_put_arg);
36799|      0|                    emit_u16(s, idx);
36800|      0|                    emit_label(s, label);
36801|      0|                    emit_op(s, OP_scope_put_var_init);
36802|      0|                    emit_atom(s, name);
36803|      0|                    emit_u16(s, fd->scope_level);
36804|      6|                } else {
36805|      6|                    if (!has_opt_arg) {
  ------------------
  |  Branch (36805:25): [True: 4, False: 2]
  ------------------
36806|      4|                        fd->defined_arg_count++;
36807|      4|                    }
36808|      6|                    if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36808:25): [True: 2, False: 4]
  ------------------
36809|       |                        /* copy the argument to the argument scope */
36810|      2|                        emit_op(s, OP_get_arg);
36811|      2|                        emit_u16(s, idx);
36812|      2|                        emit_op(s, OP_scope_put_var_init);
36813|      2|                        emit_atom(s, name);
36814|      2|                        emit_u16(s, fd->scope_level);
36815|      2|                    }
36816|      6|                }
36817|      6|            } else {
36818|      0|                js_parse_error(s, "missing formal parameter");
36819|      0|                goto fail;
36820|      0|            }
36821|      8|            if (rest && s->token.val != ')') {
  ------------------
  |  Branch (36821:17): [True: 0, False: 8]
  |  Branch (36821:25): [True: 0, False: 0]
  ------------------
36822|      0|                js_parse_expect(s, ')');
36823|      0|                goto fail;
36824|      0|            }
36825|      8|            if (s->token.val == ')')
  ------------------
  |  Branch (36825:17): [True: 4, False: 4]
  ------------------
36826|      4|                break;
36827|      4|            if (js_parse_expect(s, ','))
  ------------------
  |  Branch (36827:17): [True: 0, False: 4]
  ------------------
36828|      0|                goto fail;
36829|      4|        }
36830|      5|        if ((func_type == JS_PARSE_FUNC_GETTER && fd->arg_count != 0) ||
  ------------------
  |  Branch (36830:14): [True: 0, False: 5]
  |  Branch (36830:51): [True: 0, False: 0]
  ------------------
36831|      5|            (func_type == JS_PARSE_FUNC_SETTER && fd->arg_count != 1)) {
  ------------------
  |  Branch (36831:14): [True: 0, False: 5]
  |  Branch (36831:51): [True: 0, False: 0]
  ------------------
36832|      0|        fail_accessor:
36833|      0|            js_parse_error(s, "invalid number of arguments for getter or setter");
36834|      0|            goto fail;
36835|      0|        }
36836|      5|    }
36837|       |
36838|      5|    if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36838:9): [True: 2, False: 3]
  ------------------
36839|      2|        int idx;
36840|       |
36841|       |        /* Copy the variables in the argument scope to the variable
36842|       |           scope (see FunctionDeclarationInstantiation() in spec). The
36843|       |           normal arguments are already present, so no need to copy
36844|       |           them. */
36845|      2|        idx = fd->scopes[fd->scope_level].first;
36846|      6|        while (idx >= 0) {
  ------------------
  |  Branch (36846:16): [True: 4, False: 2]
  ------------------
36847|      4|            JSVarDef *vd = &fd->vars[idx];
36848|      4|            if (vd->scope_level != fd->scope_level)
  ------------------
  |  Branch (36848:17): [True: 0, False: 4]
  ------------------
36849|      0|                break;
36850|      4|            if (find_var(ctx, fd, vd->var_name) < 0) {
  ------------------
  |  Branch (36850:17): [True: 2, False: 2]
  ------------------
36851|      2|                if (add_var(ctx, fd, vd->var_name) < 0)
  ------------------
  |  Branch (36851:21): [True: 0, False: 2]
  ------------------
36852|      0|                    goto fail;
36853|      2|                vd = &fd->vars[idx]; /* fd->vars may have been reallocated */
36854|      2|                emit_op(s, OP_scope_get_var);
36855|      2|                emit_atom(s, vd->var_name);
36856|      2|                emit_u16(s, fd->scope_level);
36857|      2|                emit_op(s, OP_scope_put_var);
36858|      2|                emit_atom(s, vd->var_name);
36859|      2|                emit_u16(s, 0);
36860|      2|            }
36861|      4|            idx = vd->scope_next;
36862|      4|        }
36863|       |
36864|       |        /* the argument scope has no parent, hence we don't use pop_scope(s) */
36865|      2|        emit_op(s, OP_leave_scope);
36866|      2|        emit_u16(s, fd->scope_level);
36867|       |
36868|       |        /* set the variable scope as the current scope */
36869|      2|        fd->scope_level = 0;
36870|      2|        fd->scope_first = fd->scopes[fd->scope_level].first;
36871|      2|    }
36872|       |
36873|      5|    if (next_token(s))
  ------------------
  |  Branch (36873:9): [True: 0, False: 5]
  ------------------
36874|      0|        goto fail;
36875|       |
36876|       |    /* generator function: yield after the parameters are evaluated */
36877|      5|    if (func_kind == JS_FUNC_GENERATOR ||
  ------------------
  |  Branch (36877:9): [True: 1, False: 4]
  ------------------
36878|      4|        func_kind == JS_FUNC_ASYNC_GENERATOR)
  ------------------
  |  Branch (36878:9): [True: 0, False: 4]
  ------------------
36879|      1|        emit_op(s, OP_initial_yield);
36880|       |
36881|       |    /* in generators, yield expression is forbidden during the parsing
36882|       |       of the arguments */
36883|      5|    fd->in_function_body = TRUE;
36884|      5|    push_scope(s);  /* enter body scope */
36885|      5|    fd->body_scope = fd->scope_level;
36886|       |
36887|      5|    if (s->token.val == TOK_ARROW && func_type == JS_PARSE_FUNC_ARROW) {
  ------------------
  |  Branch (36887:9): [True: 2, False: 3]
  |  Branch (36887:38): [True: 2, False: 0]
  ------------------
36888|      2|        if (next_token(s))
  ------------------
  |  Branch (36888:13): [True: 0, False: 2]
  ------------------
36889|      0|            goto fail;
36890|       |
36891|      2|        if (s->token.val != '{') {
  ------------------
  |  Branch (36891:13): [True: 2, False: 0]
  ------------------
36892|      2|            if (js_parse_function_check_names(s, fd, func_name))
  ------------------
  |  Branch (36892:17): [True: 0, False: 2]
  ------------------
36893|      0|                goto fail;
36894|       |
36895|      2|            if (js_parse_assign_expr(s))
  ------------------
  |  Branch (36895:17): [True: 0, False: 2]
  ------------------
36896|      0|                goto fail;
36897|       |
36898|      2|            if (func_kind != JS_FUNC_NORMAL)
  ------------------
  |  Branch (36898:17): [True: 0, False: 2]
  ------------------
36899|      0|                emit_op(s, OP_return_async);
36900|      2|            else
36901|      2|                emit_op(s, OP_return);
36902|       |
36903|      2|            if (!fd->strip_source) {
  ------------------
  |  Branch (36903:17): [True: 2, False: 0]
  ------------------
36904|       |                /* save the function source code */
36905|       |                /* the end of the function source code is after the last
36906|       |                   token of the function source stored into s->last_ptr */
36907|      2|                fd->source_len = s->last_ptr - ptr;
36908|      2|                fd->source = js_strndup(ctx, (const char *)ptr, fd->source_len);
36909|      2|                if (!fd->source)
  ------------------
  |  Branch (36909:21): [True: 0, False: 2]
  ------------------
36910|      0|                    goto fail;
36911|      2|            }
36912|      2|            goto done;
36913|      2|        }
36914|      2|    }
36915|       |
36916|      3|    if (func_type != JS_PARSE_FUNC_CLASS_STATIC_INIT) {
  ------------------
  |  Branch (36916:9): [True: 3, False: 0]
  ------------------
36917|      3|        if (js_parse_expect(s, '{'))
  ------------------
  |  Branch (36917:13): [True: 0, False: 3]
  ------------------
36918|      0|            goto fail;
36919|      3|    }
36920|       |
36921|      3|    if (js_parse_directives(s))
  ------------------
  |  Branch (36921:9): [True: 0, False: 3]
  ------------------
36922|      0|        goto fail;
36923|       |
36924|       |    /* in strict_mode, check function and argument names */
36925|      3|    if (js_parse_function_check_names(s, fd, func_name))
  ------------------
  |  Branch (36925:9): [True: 0, False: 3]
  ------------------
36926|      0|        goto fail;
36927|       |
36928|      8|    while (s->token.val != '}') {
  ------------------
  |  Branch (36928:12): [True: 7, False: 1]
  ------------------
36929|      7|        if (js_parse_source_element(s))
  ------------------
  |  Branch (36929:13): [True: 2, False: 5]
  ------------------
36930|      2|            goto fail;
36931|      7|    }
36932|      1|    if (!fd->strip_source) {
  ------------------
  |  Branch (36932:9): [True: 1, False: 0]
  ------------------
36933|       |        /* save the function source code */
36934|      1|        fd->source_len = s->buf_ptr - ptr;
36935|      1|        fd->source = js_strndup(ctx, (const char *)ptr, fd->source_len);
36936|      1|        if (!fd->source)
  ------------------
  |  Branch (36936:13): [True: 0, False: 1]
  ------------------
36937|      0|            goto fail;
36938|      1|    }
36939|       |
36940|      1|    if (next_token(s)) {
  ------------------
  |  Branch (36940:9): [True: 0, False: 1]
  ------------------
36941|       |        /* consume the '}' */
36942|      0|        goto fail;
36943|      0|    }
36944|       |
36945|       |    /* in case there is no return, add one */
36946|      1|    if (js_is_live_code(s)) {
  ------------------
  |  Branch (36946:9): [True: 1, False: 0]
  ------------------
36947|      1|        emit_return(s, FALSE);
36948|      1|    }
36949|      3| done:
36950|      3|    s->cur_func = fd->parent;
36951|       |
36952|       |    /* Reparse identifiers after the function is terminated so that
36953|       |       the token is parsed in the englobing function. It could be done
36954|       |       by just using next_token() here for normal functions, but it is
36955|       |       necessary for arrow functions with an expression body. */
36956|      3|    reparse_ident_token(s);
36957|       |
36958|       |    /* create the function object */
36959|      3|    {
36960|      3|        int idx;
36961|      3|        JSAtom func_name = fd->func_name;
36962|       |
36963|       |        /* the real object will be set at the end of the compilation */
36964|      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 }
  |  |  ------------------
  ------------------
36965|      3|        fd->parent_cpool_idx = idx;
36966|       |
36967|      3|        if (is_expr) {
  ------------------
  |  Branch (36967:13): [True: 2, False: 1]
  ------------------
36968|       |            /* for constructors, no code needs to be generated here */
36969|      2|            if (func_type != JS_PARSE_FUNC_CLASS_CONSTRUCTOR &&
  ------------------
  |  Branch (36969:17): [True: 2, False: 0]
  ------------------
36970|      2|                func_type != JS_PARSE_FUNC_DERIVED_CLASS_CONSTRUCTOR) {
  ------------------
  |  Branch (36970:17): [True: 2, False: 0]
  ------------------
36971|       |                /* OP_fclosure creates the function object from the bytecode
36972|       |                   and adds the scope information */
36973|      2|                emit_op(s, OP_fclosure);
36974|      2|                emit_u32(s, idx);
36975|      2|                if (func_name == JS_ATOM_NULL) {
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (36975:21): [True: 2, False: 0]
  ------------------
36976|      2|                    emit_op(s, OP_set_name);
36977|      2|                    emit_u32(s, JS_ATOM_NULL);
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
36978|      2|                }
36979|      2|            }
36980|      2|        } else if (func_type == JS_PARSE_FUNC_VAR) {
  ------------------
  |  Branch (36980:20): [True: 0, False: 1]
  ------------------
36981|      0|            emit_op(s, OP_fclosure);
36982|      0|            emit_u32(s, idx);
36983|      0|            if (create_func_var) {
  ------------------
  |  Branch (36983:17): [True: 0, False: 0]
  ------------------
36984|      0|                if (s->cur_func->is_global_var) {
  ------------------
  |  Branch (36984:21): [True: 0, False: 0]
  ------------------
36985|      0|                    JSGlobalVar *hf;
36986|       |                    /* the global variable must be defined at the start of the
36987|       |                       function */
36988|      0|                    hf = add_global_var(ctx, s->cur_func, func_name);
36989|      0|                    if (!hf)
  ------------------
  |  Branch (36989:25): [True: 0, False: 0]
  ------------------
36990|      0|                        goto fail;
36991|       |                    /* it is considered as defined at the top level
36992|       |                       (needed for annex B.3.3.4 and B.3.3.5
36993|       |                       checks) */
36994|      0|                    hf->scope_level = 0;
36995|      0|                    hf->force_init = ((s->cur_func->js_mode & JS_MODE_STRICT) != 0);
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
36996|       |                    /* store directly into global var, bypass lexical scope */
36997|      0|                    emit_op(s, OP_dup);
36998|      0|                    emit_op(s, OP_scope_put_var);
36999|      0|                    emit_atom(s, func_name);
37000|      0|                    emit_u16(s, 0);
37001|      0|                } else {
37002|       |                    /* do not call define_var to bypass lexical scope check */
37003|      0|                    func_idx = find_var(ctx, s->cur_func, func_name);
37004|      0|                    if (func_idx < 0) {
  ------------------
  |  Branch (37004:25): [True: 0, False: 0]
  ------------------
37005|      0|                        func_idx = add_var(ctx, s->cur_func, func_name);
37006|      0|                        if (func_idx < 0)
  ------------------
  |  Branch (37006:29): [True: 0, False: 0]
  ------------------
37007|      0|                            goto fail;
37008|      0|                    }
37009|       |                    /* store directly into local var, bypass lexical catch scope */
37010|      0|                    emit_op(s, OP_dup);
37011|      0|                    emit_op(s, OP_scope_put_var);
37012|      0|                    emit_atom(s, func_name);
37013|      0|                    emit_u16(s, 0);
37014|      0|                }
37015|      0|            }
37016|      0|            if (lexical_func_idx >= 0) {
  ------------------
  |  Branch (37016:17): [True: 0, False: 0]
  ------------------
37017|       |                /* lexical variable will be initialized upon entering scope */
37018|      0|                s->cur_func->vars[lexical_func_idx].func_pool_idx = idx;
37019|      0|                emit_op(s, OP_drop);
37020|      0|            } else {
37021|       |                /* store function object into its lexical name */
37022|       |                /* XXX: could use OP_put_loc directly */
37023|      0|                emit_op(s, OP_scope_put_var_init);
37024|      0|                emit_atom(s, func_name);
37025|      0|                emit_u16(s, s->cur_func->scope_level);
37026|      0|            }
37027|      1|        } else {
37028|      1|            if (!s->cur_func->is_global_var) {
  ------------------
  |  Branch (37028:17): [True: 0, False: 1]
  ------------------
37029|      0|                int var_idx = define_var(s, s->cur_func, func_name, JS_VAR_DEF_VAR);
37030|       |
37031|      0|                if (var_idx < 0)
  ------------------
  |  Branch (37031:21): [True: 0, False: 0]
  ------------------
37032|      0|                    goto fail;
37033|       |                /* the variable will be assigned at the top of the function */
37034|      0|                if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16191|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (37034:21): [True: 0, False: 0]
  ------------------
37035|      0|                    s->cur_func->args[var_idx - ARGUMENT_VAR_OFFSET].func_pool_idx = idx;
  ------------------
  |  |16191|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
37036|      0|                } else {
37037|      0|                    s->cur_func->vars[var_idx].func_pool_idx = idx;
37038|      0|                }
37039|      1|            } else {
37040|      1|                JSAtom func_var_name;
37041|      1|                JSGlobalVar *hf;
37042|      1|                if (func_name == JS_ATOM_NULL)
  ------------------
  |  |  451|      1|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (37042:21): [True: 0, False: 1]
  ------------------
37043|      0|                    func_var_name = JS_ATOM__default_; /* export default */
37044|      1|                else
37045|      1|                    func_var_name = func_name;
37046|       |                /* the variable will be assigned at the top of the function */
37047|      1|                hf = add_global_var(ctx, s->cur_func, func_var_name);
37048|      1|                if (!hf)
  ------------------
  |  Branch (37048:21): [True: 0, False: 1]
  ------------------
37049|      0|                    goto fail;
37050|      1|                hf->cpool_idx = idx;
37051|      1|                if (export_flag != JS_PARSE_EXPORT_NONE) {
  ------------------
  |  Branch (37051:21): [True: 0, False: 1]
  ------------------
37052|      0|                    if (!add_export_entry(s, s->cur_func->module, func_var_name,
  ------------------
  |  Branch (37052:25): [True: 0, False: 0]
  ------------------
37053|      0|                                          export_flag == JS_PARSE_EXPORT_NAMED ? func_var_name : JS_ATOM_default, JS_EXPORT_TYPE_LOCAL))
  ------------------
  |  Branch (37053:43): [True: 0, False: 0]
  ------------------
37054|      0|                        goto fail;
37055|      0|                }
37056|      1|            }
37057|      1|        }
37058|      3|    }
37059|      3|    return 0;
37060|      2| fail:
37061|      2|    s->cur_func = fd->parent;
37062|      2|    js_free_function_def(ctx, fd);
37063|      2|    if (pfd)
  ------------------
  |  Branch (37063:9): [True: 0, False: 2]
  ------------------
37064|      0|        *pfd = NULL;
37065|      2|    return -1;
37066|      3|}
quickjs.c:find_global_var:
24067|     18|{
24068|     18|    int i;
24069|     34|    for(i = 0; i < fd->global_var_count; i++) {
  ------------------
  |  Branch (24069:16): [True: 16, False: 18]
  ------------------
24070|     16|        JSGlobalVar *hf = &fd->global_vars[i];
24071|     16|        if (hf->var_name == name)
  ------------------
  |  Branch (24071:13): [True: 0, False: 16]
  ------------------
24072|      0|            return hf;
24073|     16|    }
24074|     18|    return NULL;
24075|       |
24076|     18|}
quickjs.c:find_lexical_decl:
24089|     20|{
24090|     23|    while (scope_idx >= 0) {
  ------------------
  |  Branch (24090:12): [True: 3, False: 20]
  ------------------
24091|      3|        JSVarDef *vd = &fd->vars[scope_idx];
24092|      3|        if (vd->var_name == name &&
  ------------------
  |  Branch (24092:13): [True: 0, False: 3]
  ------------------
24093|      0|            (vd->is_lexical || (vd->var_kind == JS_VAR_CATCH &&
  ------------------
  |  Branch (24093:14): [True: 0, False: 0]
  |  Branch (24093:33): [True: 0, False: 0]
  ------------------
24094|      0|                                check_catch_var)))
  ------------------
  |  Branch (24094:33): [True: 0, False: 0]
  ------------------
24095|      0|            return scope_idx;
24096|      3|        scope_idx = vd->scope_next;
24097|      3|    }
24098|       |
24099|     20|    if (fd->is_eval && fd->eval_type == JS_EVAL_TYPE_GLOBAL) {
  ------------------
  |  |  332|      9|#define JS_EVAL_TYPE_GLOBAL   (0 << 0) /* global code (default) */
  ------------------
  |  Branch (24099:9): [True: 9, False: 11]
  |  Branch (24099:24): [True: 9, False: 0]
  ------------------
24100|      9|        if (find_lexical_global_var(fd, name))
  ------------------
  |  Branch (24100:13): [True: 0, False: 9]
  ------------------
24101|      0|            return GLOBAL_VAR_OFFSET;
  ------------------
  |  |16190|      0|#define GLOBAL_VAR_OFFSET 0x40000000
  ------------------
24102|      9|    }
24103|     20|    return -1;
24104|     20|}
quickjs.c:find_lexical_global_var:
24079|      9|{
24080|      9|    JSGlobalVar *hf = find_global_var(fd, name);
24081|      9|    if (hf && hf->is_lexical)
  ------------------
  |  Branch (24081:9): [True: 0, False: 9]
  |  Branch (24081:15): [True: 0, False: 0]
  ------------------
24082|      0|        return hf;
24083|      9|    else
24084|      9|        return NULL;
24085|      9|}
quickjs.c:find_var:
24012|     74|{
24013|     74|    int i;
24014|    131|    for(i = fd->var_count; i-- > 0;) {
  ------------------
  |  Branch (24014:28): [True: 57, False: 74]
  ------------------
24015|     57|        if (fd->vars[i].var_name == name && fd->vars[i].scope_level == 0)
  ------------------
  |  Branch (24015:13): [True: 9, False: 48]
  |  Branch (24015:45): [True: 0, False: 9]
  ------------------
24016|      0|            return i;
24017|     57|    }
24018|     74|    return find_arg(ctx, fd, name);
24019|     74|}
quickjs.c:find_arg:
24002|     74|{
24003|     74|    int i;
24004|     90|    for(i = fd->arg_count; i-- > 0;) {
  ------------------
  |  Branch (24004:28): [True: 24, False: 66]
  ------------------
24005|     24|        if (fd->args[i].var_name == name)
  ------------------
  |  Branch (24005:13): [True: 8, False: 16]
  ------------------
24006|      8|            return i | ARGUMENT_VAR_OFFSET;
  ------------------
  |  |16191|      8|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
24007|     24|    }
24008|     66|    return -1;
24009|     74|}
quickjs.c:define_var:
24305|     19|{
24306|     19|    JSContext *ctx = s->ctx;
24307|     19|    JSVarDef *vd;
24308|     19|    int idx;
24309|       |
24310|     19|    switch (var_def_type) {
24311|      0|    case JS_VAR_DEF_WITH:
  ------------------
  |  Branch (24311:5): [True: 0, False: 19]
  ------------------
24312|      0|        idx = add_scope_var(ctx, fd, name, JS_VAR_NORMAL);
24313|      0|        break;
24314|       |
24315|     17|    case JS_VAR_DEF_LET:
  ------------------
  |  Branch (24315:5): [True: 17, False: 2]
  ------------------
24316|     17|    case JS_VAR_DEF_CONST:
  ------------------
  |  Branch (24316:5): [True: 0, False: 19]
  ------------------
24317|     18|    case JS_VAR_DEF_FUNCTION_DECL:
  ------------------
  |  Branch (24317:5): [True: 1, False: 18]
  ------------------
24318|     19|    case JS_VAR_DEF_NEW_FUNCTION_DECL:
  ------------------
  |  Branch (24318:5): [True: 1, False: 18]
  ------------------
24319|     19|        idx = find_lexical_decl(ctx, fd, name, fd->scope_first, TRUE);
24320|     19|        if (idx >= 0) {
  ------------------
  |  Branch (24320:13): [True: 0, False: 19]
  ------------------
24321|      0|            if (idx < GLOBAL_VAR_OFFSET) {
  ------------------
  |  |16190|      0|#define GLOBAL_VAR_OFFSET 0x40000000
  ------------------
  |  Branch (24321:17): [True: 0, False: 0]
  ------------------
24322|      0|                if (fd->vars[idx].scope_level == fd->scope_level) {
  ------------------
  |  Branch (24322:21): [True: 0, False: 0]
  ------------------
24323|       |                    /* same scope: in non strict mode, functions
24324|       |                       can be redefined (annex B.3.3.4). */
24325|      0|                    if (!(!(fd->js_mode & JS_MODE_STRICT) &&
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (24325:27): [True: 0, False: 0]
  ------------------
24326|      0|                          var_def_type == JS_VAR_DEF_FUNCTION_DECL &&
  ------------------
  |  Branch (24326:27): [True: 0, False: 0]
  ------------------
24327|      0|                          fd->vars[idx].var_kind == JS_VAR_FUNCTION_DECL)) {
  ------------------
  |  Branch (24327:27): [True: 0, False: 0]
  ------------------
24328|      0|                        goto redef_lex_error;
24329|      0|                    }
24330|      0|                } else if (fd->vars[idx].var_kind == JS_VAR_CATCH && (fd->vars[idx].scope_level + 2) == fd->scope_level) {
  ------------------
  |  Branch (24330:28): [True: 0, False: 0]
  |  Branch (24330:70): [True: 0, False: 0]
  ------------------
24331|      0|                    goto redef_lex_error;
24332|      0|                }
24333|      0|            } else {
24334|      0|                if (fd->scope_level == fd->body_scope) {
  ------------------
  |  Branch (24334:21): [True: 0, False: 0]
  ------------------
24335|      0|                redef_lex_error:
24336|       |                    /* redefining a scoped var in the same scope: error */
24337|      0|                    return js_parse_error(s, "invalid redefinition of lexical identifier");
24338|      0|                }
24339|      0|            }
24340|      0|        }
24341|     19|        if (var_def_type != JS_VAR_DEF_FUNCTION_DECL &&
  ------------------
  |  Branch (24341:13): [True: 18, False: 1]
  ------------------
24342|     18|            var_def_type != JS_VAR_DEF_NEW_FUNCTION_DECL &&
  ------------------
  |  Branch (24342:13): [True: 17, False: 1]
  ------------------
24343|     17|            fd->scope_level == fd->body_scope &&
  ------------------
  |  Branch (24343:13): [True: 0, False: 17]
  ------------------
24344|      0|            find_arg(ctx, fd, name) >= 0) {
  ------------------
  |  Branch (24344:13): [True: 0, False: 0]
  ------------------
24345|       |            /* lexical variable redefines a parameter name */
24346|      0|            return js_parse_error(s, "invalid redefinition of parameter name");
24347|      0|        }
24348|       |
24349|     19|        if (find_var_in_child_scope(ctx, fd, name, fd->scope_level) >= 0) {
  ------------------
  |  Branch (24349:13): [True: 0, False: 19]
  ------------------
24350|      0|            return js_parse_error(s, "invalid redefinition of a variable");
24351|      0|        }
24352|       |
24353|     19|        if (fd->is_global_var) {
  ------------------
  |  Branch (24353:13): [True: 9, False: 10]
  ------------------
24354|      9|            JSGlobalVar *hf;
24355|      9|            hf = find_global_var(fd, name);
24356|      9|            if (hf && is_child_scope(ctx, fd, hf->scope_level,
  ------------------
  |  Branch (24356:17): [True: 0, False: 9]
  |  Branch (24356:23): [True: 0, False: 0]
  ------------------
24357|      0|                                     fd->scope_level)) {
24358|      0|                return js_parse_error(s, "invalid redefinition of global identifier");
24359|      0|            }
24360|      9|        }
24361|       |
24362|     19|        if (fd->is_eval &&
  ------------------
  |  Branch (24362:13): [True: 9, False: 10]
  ------------------
24363|      9|            (fd->eval_type == JS_EVAL_TYPE_GLOBAL ||
  ------------------
  |  |  332|     18|#define JS_EVAL_TYPE_GLOBAL   (0 << 0) /* global code (default) */
  ------------------
  |  Branch (24363:14): [True: 9, False: 0]
  ------------------
24364|      0|             fd->eval_type == JS_EVAL_TYPE_MODULE) &&
  ------------------
  |  |  333|      0|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (24364:14): [True: 0, False: 0]
  ------------------
24365|      9|            fd->scope_level == fd->body_scope) {
  ------------------
  |  Branch (24365:13): [True: 0, False: 9]
  ------------------
24366|      0|            JSGlobalVar *hf;
24367|      0|            hf = add_global_var(s->ctx, fd, name);
24368|      0|            if (!hf)
  ------------------
  |  Branch (24368:17): [True: 0, False: 0]
  ------------------
24369|      0|                return -1;
24370|      0|            hf->is_lexical = TRUE;
24371|      0|            hf->is_const = (var_def_type == JS_VAR_DEF_CONST);
24372|      0|            idx = GLOBAL_VAR_OFFSET;
  ------------------
  |  |16190|      0|#define GLOBAL_VAR_OFFSET 0x40000000
  ------------------
24373|     19|        } else {
24374|     19|            JSVarKindEnum var_kind;
24375|     19|            if (var_def_type == JS_VAR_DEF_FUNCTION_DECL)
  ------------------
  |  Branch (24375:17): [True: 1, False: 18]
  ------------------
24376|      1|                var_kind = JS_VAR_FUNCTION_DECL;
24377|     18|            else if (var_def_type == JS_VAR_DEF_NEW_FUNCTION_DECL)
  ------------------
  |  Branch (24377:22): [True: 1, False: 17]
  ------------------
24378|      1|                var_kind = JS_VAR_NEW_FUNCTION_DECL;
24379|     17|            else
24380|     17|                var_kind = JS_VAR_NORMAL;
24381|     19|            idx = add_scope_var(ctx, fd, name, var_kind);
24382|     19|            if (idx >= 0) {
  ------------------
  |  Branch (24382:17): [True: 19, False: 0]
  ------------------
24383|     19|                vd = &fd->vars[idx];
24384|     19|                vd->is_lexical = 1;
24385|     19|                vd->is_const = (var_def_type == JS_VAR_DEF_CONST);
24386|     19|            }
24387|     19|        }
24388|     19|        break;
24389|       |
24390|     19|    case JS_VAR_DEF_CATCH:
  ------------------
  |  Branch (24390:5): [True: 0, False: 19]
  ------------------
24391|      0|        idx = add_scope_var(ctx, fd, name, JS_VAR_CATCH);
24392|      0|        break;
24393|       |
24394|      0|    case JS_VAR_DEF_VAR:
  ------------------
  |  Branch (24394:5): [True: 0, False: 19]
  ------------------
24395|      0|        if (find_lexical_decl(ctx, fd, name, fd->scope_first,
  ------------------
  |  Branch (24395:13): [True: 0, False: 0]
  ------------------
24396|      0|                              FALSE) >= 0) {
24397|      0|       invalid_lexical_redefinition:
24398|       |            /* error to redefine a var that inside a lexical scope */
24399|      0|            return js_parse_error(s, "invalid redefinition of lexical identifier");
24400|      0|        }
24401|      0|        if (fd->is_global_var) {
  ------------------
  |  Branch (24401:13): [True: 0, False: 0]
  ------------------
24402|      0|            JSGlobalVar *hf;
24403|      0|            hf = find_global_var(fd, name);
24404|      0|            if (hf && hf->is_lexical && hf->scope_level == fd->scope_level &&
  ------------------
  |  Branch (24404:17): [True: 0, False: 0]
  |  Branch (24404:23): [True: 0, False: 0]
  |  Branch (24404:41): [True: 0, False: 0]
  ------------------
24405|      0|                fd->eval_type == JS_EVAL_TYPE_MODULE) {
  ------------------
  |  |  333|      0|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (24405:17): [True: 0, False: 0]
  ------------------
24406|      0|                goto invalid_lexical_redefinition;
24407|      0|            }
24408|      0|            hf = add_global_var(s->ctx, fd, name);
24409|      0|            if (!hf)
  ------------------
  |  Branch (24409:17): [True: 0, False: 0]
  ------------------
24410|      0|                return -1;
24411|      0|            idx = GLOBAL_VAR_OFFSET;
  ------------------
  |  |16190|      0|#define GLOBAL_VAR_OFFSET 0x40000000
  ------------------
24412|      0|        } else {
24413|       |            /* if the variable already exists, don't add it again  */
24414|      0|            idx = find_var(ctx, fd, name);
24415|      0|            if (idx >= 0)
  ------------------
  |  Branch (24415:17): [True: 0, False: 0]
  ------------------
24416|      0|                break;
24417|      0|            idx = add_var(ctx, fd, name);
24418|      0|            if (idx >= 0) {
  ------------------
  |  Branch (24418:17): [True: 0, False: 0]
  ------------------
24419|      0|                if (name == JS_ATOM_arguments && fd->has_arguments_binding)
  ------------------
  |  Branch (24419:21): [True: 0, False: 0]
  |  Branch (24419:50): [True: 0, False: 0]
  ------------------
24420|      0|                    fd->arguments_var_idx = idx;
24421|      0|                fd->vars[idx].scope_next = fd->scope_level;
24422|      0|            }
24423|      0|        }
24424|      0|        break;
24425|      0|    default:
  ------------------
  |  Branch (24425:5): [True: 0, False: 19]
  ------------------
24426|      0|        abort();
24427|     19|    }
24428|     19|    return idx;
24429|     19|}
quickjs.c:add_scope_var:
24195|     19|{
24196|     19|    int idx = add_var(ctx, fd, name);
24197|     19|    if (idx >= 0) {
  ------------------
  |  Branch (24197:9): [True: 19, False: 0]
  ------------------
24198|     19|        JSVarDef *vd = &fd->vars[idx];
24199|     19|        vd->var_kind = var_kind;
24200|     19|        vd->scope_level = fd->scope_level;
24201|     19|        vd->scope_next = fd->scope_first;
24202|     19|        fd->scopes[fd->scope_level].first = idx;
24203|     19|        fd->scope_first = idx;
24204|     19|    }
24205|     19|    return idx;
24206|     19|}
quickjs.c:find_var_in_child_scope:
24052|     19|{
24053|     19|    int i;
24054|     68|    for(i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (24054:16): [True: 49, False: 19]
  ------------------
24055|     49|        JSVarDef *vd = &fd->vars[i];
24056|     49|        if (vd->var_name == name && vd->scope_level == 0) {
  ------------------
  |  Branch (24056:13): [True: 31, False: 18]
  |  Branch (24056:37): [True: 0, False: 31]
  ------------------
24057|      0|            if (is_child_scope(ctx, fd, vd->scope_next,
  ------------------
  |  Branch (24057:17): [True: 0, False: 0]
  ------------------
24058|      0|                               scope_level))
24059|      0|                return i;
24060|      0|        }
24061|     49|    }
24062|     19|    return -1;
24063|     19|}
quickjs.c:add_arg:
24255|      8|{
24256|      8|    JSVarDef *vd;
24257|       |
24258|       |    /* the local variable indexes are currently stored on 16 bits */
24259|      8|    if (fd->arg_count >= JS_MAX_LOCAL_VARS) {
  ------------------
  |  |  210|      8|#define JS_MAX_LOCAL_VARS 65534
  ------------------
  |  Branch (24259:9): [True: 0, False: 8]
  ------------------
24260|      0|        JS_ThrowInternalError(ctx, "too many arguments");
24261|      0|        return -1;
24262|      0|    }
24263|      8|    if (js_resize_array(ctx, (void **)&fd->args, sizeof(fd->args[0]),
  ------------------
  |  Branch (24263:9): [True: 0, False: 8]
  ------------------
24264|      8|                        &fd->arg_size, fd->arg_count + 1))
24265|      0|        return -1;
24266|      8|    vd = &fd->args[fd->arg_count++];
24267|      8|    memset(vd, 0, sizeof(*vd));
24268|      8|    vd->var_name = JS_DupAtom(ctx, name);
24269|      8|    vd->func_pool_idx = -1;
24270|      8|    return fd->arg_count - 1;
24271|      8|}
quickjs.c:js_parse_skip_parens_token:
24801|     22|{
24802|     22|    char state[256];
24803|     22|    size_t level = 0;
24804|     22|    JSParsePos pos;
24805|     22|    int last_tok, tok = TOK_EOF;
24806|     22|    int c, tok_len, bits = 0;
24807|     22|    const uint8_t *last_token_ptr;
24808|       |    
24809|       |    /* protect from underflow */
24810|     22|    state[level++] = 0;
24811|       |
24812|     22|    js_parse_get_pos(s, &pos);
24813|     22|    last_tok = 0;
24814|    146|    for (;;) {
24815|    146|        switch(s->token.val) {
  ------------------
  |  Branch (24815:16): [True: 69, False: 77]
  ------------------
24816|     20|        case '(':
  ------------------
  |  Branch (24816:9): [True: 20, False: 126]
  ------------------
24817|     20|        case '[':
  ------------------
  |  Branch (24817:9): [True: 0, False: 146]
  ------------------
24818|     26|        case '{':
  ------------------
  |  Branch (24818:9): [True: 6, False: 140]
  ------------------
24819|     26|            if (level >= sizeof(state))
  ------------------
  |  Branch (24819:17): [True: 0, False: 26]
  ------------------
24820|      0|                goto done;
24821|     26|            state[level++] = s->token.val;
24822|     26|            break;
24823|     20|        case ')':
  ------------------
  |  Branch (24823:9): [True: 20, False: 126]
  ------------------
24824|     20|            if (state[--level] != '(')
  ------------------
  |  Branch (24824:17): [True: 0, False: 20]
  ------------------
24825|      0|                goto done;
24826|     20|            break;
24827|     20|        case ']':
  ------------------
  |  Branch (24827:9): [True: 0, False: 146]
  ------------------
24828|      0|            if (state[--level] != '[')
  ------------------
  |  Branch (24828:17): [True: 0, False: 0]
  ------------------
24829|      0|                goto done;
24830|      0|            break;
24831|      6|        case '}':
  ------------------
  |  Branch (24831:9): [True: 6, False: 140]
  ------------------
24832|      6|            c = state[--level];
24833|      6|            if (c == '`') {
  ------------------
  |  Branch (24833:17): [True: 0, False: 6]
  ------------------
24834|       |                /* continue the parsing of the template */
24835|      0|                free_token(s, &s->token);
24836|       |                /* Resume TOK_TEMPLATE parsing (s->token.line_num and
24837|       |                 * s->token.ptr are OK) */
24838|      0|                s->got_lf = FALSE;
24839|      0|                if (js_parse_template_part(s, s->buf_ptr))
  ------------------
  |  Branch (24839:21): [True: 0, False: 0]
  ------------------
24840|      0|                    goto done;
24841|      0|                goto handle_template;
24842|      6|            } else if (c != '{') {
  ------------------
  |  Branch (24842:24): [True: 0, False: 6]
  ------------------
24843|      0|                goto done;
24844|      0|            }
24845|      6|            break;
24846|     13|        case TOK_TEMPLATE:
  ------------------
  |  Branch (24846:9): [True: 13, False: 133]
  ------------------
24847|     13|        handle_template:
24848|     13|            if (s->token.u.str.sep != '`') {
  ------------------
  |  Branch (24848:17): [True: 0, False: 13]
  ------------------
24849|       |                /* '${' inside the template : closing '}' and continue
24850|       |                   parsing the template */
24851|      0|                if (level >= sizeof(state))
  ------------------
  |  Branch (24851:21): [True: 0, False: 0]
  ------------------
24852|      0|                    goto done;
24853|      0|                state[level++] = '`';
24854|      0|            }
24855|     13|            break;
24856|     13|        case TOK_EOF:
  ------------------
  |  Branch (24856:9): [True: 0, False: 146]
  ------------------
24857|      0|            goto done;
24858|      0|        case ';':
  ------------------
  |  Branch (24858:9): [True: 0, False: 146]
  ------------------
24859|      0|            if (level == 2) {
  ------------------
  |  Branch (24859:17): [True: 0, False: 0]
  ------------------
24860|      0|                bits |= SKIP_HAS_SEMI;
  ------------------
  |  |24782|      0|#define SKIP_HAS_SEMI       (1 << 0)
  ------------------
24861|      0|            }
24862|      0|            break;
24863|      0|        case TOK_ELLIPSIS:
  ------------------
  |  Branch (24863:9): [True: 0, False: 146]
  ------------------
24864|      0|            if (level == 2) {
  ------------------
  |  Branch (24864:17): [True: 0, False: 0]
  ------------------
24865|      0|                bits |= SKIP_HAS_ELLIPSIS;
  ------------------
  |  |24783|      0|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
24866|      0|            }
24867|      0|            break;
24868|      4|        case '=':
  ------------------
  |  Branch (24868:9): [True: 4, False: 142]
  ------------------
24869|      4|            bits |= SKIP_HAS_ASSIGNMENT;
  ------------------
  |  |24784|      4|#define SKIP_HAS_ASSIGNMENT (1 << 2)
  ------------------
24870|      4|            break;
24871|       |
24872|      0|        case TOK_DIV_ASSIGN:
  ------------------
  |  Branch (24872:9): [True: 0, False: 146]
  ------------------
24873|      0|            tok_len = 2;
24874|      0|            goto parse_regexp;
24875|      0|        case '/':
  ------------------
  |  Branch (24875:9): [True: 0, False: 146]
  ------------------
24876|      0|            tok_len = 1;
24877|      0|        parse_regexp:
24878|      0|            if (is_regexp_allowed(last_tok)) {
  ------------------
  |  Branch (24878:17): [True: 0, False: 0]
  ------------------
24879|      0|                s->buf_ptr -= tok_len;
24880|      0|                if (js_parse_regexp(s)) {
  ------------------
  |  Branch (24880:21): [True: 0, False: 0]
  ------------------
24881|       |                    /* XXX: should clear the exception */
24882|      0|                    goto done;
24883|      0|                }
24884|      0|            }
24885|      0|            break;
24886|    146|        }
24887|       |        /* last_tok is only used to recognize regexps */
24888|    146|        if (s->token.val == TOK_IDENT &&
  ------------------
  |  Branch (24888:13): [True: 45, False: 101]
  ------------------
24889|     45|            (token_is_pseudo_keyword(s, JS_ATOM_of) ||
  ------------------
  |  Branch (24889:14): [True: 0, False: 45]
  ------------------
24890|     45|             token_is_pseudo_keyword(s, JS_ATOM_yield))) {
  ------------------
  |  Branch (24890:14): [True: 0, False: 45]
  ------------------
24891|      0|            last_tok = TOK_OF;
24892|    146|        } else {
24893|    146|            last_tok = s->token.val;
24894|    146|        }
24895|    146|        last_token_ptr = s->token.ptr;
24896|    146|        if (next_token(s)) {
  ------------------
  |  Branch (24896:13): [True: 0, False: 146]
  ------------------
24897|       |            /* XXX: should clear the exception generated by next_token() */
24898|      0|            break;
24899|      0|        }
24900|    146|        if (level <= 1) {
  ------------------
  |  Branch (24900:13): [True: 22, False: 124]
  ------------------
24901|     22|            tok = s->token.val;
24902|     22|            if (token_is_pseudo_keyword(s, JS_ATOM_of))
  ------------------
  |  Branch (24902:17): [True: 0, False: 22]
  ------------------
24903|      0|                tok = TOK_OF;
24904|     22|            if (no_line_terminator && has_lf_in_range(last_token_ptr, s->token.ptr))
  ------------------
  |  Branch (24904:17): [True: 2, False: 20]
  |  Branch (24904:39): [True: 0, False: 2]
  ------------------
24905|      0|                tok = '\n';
24906|     22|            break;
24907|     22|        }
24908|    146|    }
24909|     22| done:
24910|     22|    if (pbits) {
  ------------------
  |  Branch (24910:9): [True: 20, False: 2]
  ------------------
24911|     20|        *pbits = bits;
24912|     20|    }
24913|     22|    if (js_parse_seek_token(s, &pos))
  ------------------
  |  Branch (24913:9): [True: 0, False: 22]
  ------------------
24914|      0|        return -1;
24915|     22|    return tok;
24916|     22|}
quickjs.c:has_lf_in_range:
24787|     15|{
24788|     15|    const uint8_t *tmp;
24789|     15|    if (p1 > p2) {
  ------------------
  |  Branch (24789:9): [True: 0, False: 15]
  ------------------
24790|      0|        tmp = p1;
24791|      0|        p1 = p2;
24792|      0|        p2 = tmp;
24793|      0|    }
24794|       |    return (memchr(p1, '\n', p2 - p1) != NULL);
24795|     15|}
quickjs.c:js_parse_expect:
22370|     53|{
22371|     53|    if (s->token.val != tok) {
  ------------------
  |  Branch (22371:9): [True: 0, False: 53]
  ------------------
22372|       |        /* XXX: dump token correctly in all cases */
22373|      0|        return js_parse_error(s, "expecting '%c'", tok);
22374|      0|    }
22375|     53|    return next_token(s);
22376|     53|}
quickjs.c:js_parse_destructuring_element:
26341|      2|{
26342|      2|    int label_parse, label_assign, label_done, label_lvalue, depth_lvalue;
26343|      2|    int start_addr, assign_addr;
26344|      2|    JSAtom prop_name, var_name;
26345|      2|    int opcode, scope, tok1, skip_bits;
26346|      2|    BOOL has_initializer;
26347|       |
26348|      2|    if (has_ellipsis < 0) {
  ------------------
  |  Branch (26348:9): [True: 2, False: 0]
  ------------------
26349|       |        /* pre-parse destructuration target for spread detection */
26350|      2|        js_parse_skip_parens_token(s, &skip_bits, FALSE);
26351|      2|        has_ellipsis = skip_bits & SKIP_HAS_ELLIPSIS;
  ------------------
  |  |24783|      2|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
26352|      2|    }
26353|       |
26354|      2|    label_parse = new_label(s);
26355|      2|    label_assign = new_label(s);
26356|       |
26357|      2|    start_addr = s->cur_func->byte_code.size;
26358|      2|    if (hasval) {
  ------------------
  |  Branch (26358:9): [True: 2, False: 0]
  ------------------
26359|       |        /* consume value from the stack */
26360|      2|        emit_op(s, OP_dup);
26361|      2|        emit_op(s, OP_undefined);
26362|      2|        emit_op(s, OP_strict_eq);
26363|      2|        emit_goto(s, OP_if_true, label_parse);
26364|      2|        emit_label(s, label_assign);
26365|      2|    } else {
26366|      0|        emit_goto(s, OP_goto, label_parse);
26367|      0|        emit_label(s, label_assign);
26368|       |        /* leave value on the stack */
26369|      0|        emit_op(s, OP_dup);
26370|      0|    }
26371|      2|    assign_addr = s->cur_func->byte_code.size;
26372|      2|    if (s->token.val == '{') {
  ------------------
  |  Branch (26372:9): [True: 2, False: 0]
  ------------------
26373|      2|        if (next_token(s))
  ------------------
  |  Branch (26373:13): [True: 0, False: 2]
  ------------------
26374|      0|            return -1;
26375|       |        /* throw an exception if the value cannot be converted to an object */
26376|      2|        emit_op(s, OP_to_object);
26377|      2|        if (has_ellipsis) {
  ------------------
  |  Branch (26377:13): [True: 0, False: 2]
  ------------------
26378|       |            /* add excludeList on stack just below src object */
26379|      0|            emit_op(s, OP_object);
26380|      0|            emit_op(s, OP_swap);
26381|      0|        }
26382|      2|        while (s->token.val != '}') {
  ------------------
  |  Branch (26382:16): [True: 2, False: 0]
  ------------------
26383|      2|            int prop_type;
26384|      2|            if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (26384:17): [True: 0, False: 2]
  ------------------
26385|      0|                if (!has_ellipsis) {
  ------------------
  |  Branch (26385:21): [True: 0, False: 0]
  ------------------
26386|      0|                    JS_ThrowInternalError(s->ctx, "unexpected ellipsis token");
26387|      0|                    return -1;
26388|      0|                }
26389|      0|                if (next_token(s))
  ------------------
  |  Branch (26389:21): [True: 0, False: 0]
  ------------------
26390|      0|                    return -1;
26391|      0|                if (tok) {
  ------------------
  |  Branch (26391:21): [True: 0, False: 0]
  ------------------
26392|      0|                    var_name = js_parse_destructuring_var(s, tok, is_arg);
26393|      0|                    if (var_name == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26393:25): [True: 0, False: 0]
  ------------------
26394|      0|                        return -1;
26395|      0|                    if (need_var_reference(s, tok)) {
  ------------------
  |  Branch (26395:25): [True: 0, False: 0]
  ------------------
26396|       |                        /* Must make a reference for proper `with` semantics */
26397|      0|                        emit_op(s, OP_scope_get_var);
26398|      0|                        emit_atom(s, var_name);
26399|      0|                        emit_u16(s, s->cur_func->scope_level);
26400|      0|                        JS_FreeAtom(s->ctx, var_name);
26401|      0|                        goto lvalue0;
26402|      0|                    } else {
26403|      0|                        opcode = OP_scope_get_var;
26404|      0|                        scope = s->cur_func->scope_level;
26405|      0|                        label_lvalue = -1;
26406|      0|                        depth_lvalue = 0;
26407|      0|                    }
26408|      0|                } else {
26409|      0|                    if (js_parse_left_hand_side_expr(s))
  ------------------
  |  Branch (26409:25): [True: 0, False: 0]
  ------------------
26410|      0|                        return -1;
26411|      0|                lvalue0:
26412|      0|                    if (get_lvalue(s, &opcode, &scope, &var_name,
  ------------------
  |  Branch (26412:25): [True: 0, False: 0]
  ------------------
26413|      0|                                   &label_lvalue, &depth_lvalue, FALSE, '{'))
26414|      0|                        return -1;
26415|      0|                }
26416|      0|                if (s->token.val != '}') {
  ------------------
  |  Branch (26416:21): [True: 0, False: 0]
  ------------------
26417|      0|                    js_parse_error(s, "assignment rest property must be last");
26418|      0|                    goto var_error;
26419|      0|                }
26420|      0|                emit_op(s, OP_object);  /* target */
26421|      0|                emit_op(s, OP_copy_data_properties);
26422|      0|                emit_u8(s, 0 | ((depth_lvalue + 1) << 2) | ((depth_lvalue + 2) << 5));
26423|      0|                goto set_val;
26424|      0|            }
26425|      2|            prop_type = js_parse_property_name(s, &prop_name, FALSE, TRUE, FALSE);
26426|      2|            if (prop_type < 0)
  ------------------
  |  Branch (26426:17): [True: 0, False: 2]
  ------------------
26427|      0|                return -1;
26428|      2|            var_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
26429|      2|            if (prop_type == PROP_TYPE_IDENT) {
  ------------------
  |  |24602|      2|#define PROP_TYPE_IDENT 0
  ------------------
  |  Branch (26429:17): [True: 2, False: 0]
  ------------------
26430|      2|                if (next_token(s))
  ------------------
  |  Branch (26430:21): [True: 0, False: 2]
  ------------------
26431|      0|                    goto prop_error;
26432|      2|                if ((s->token.val == '[' || s->token.val == '{')
  ------------------
  |  Branch (26432:22): [True: 0, False: 2]
  |  Branch (26432:45): [True: 0, False: 2]
  ------------------
26433|      0|                    &&  ((tok1 = js_parse_skip_parens_token(s, &skip_bits, FALSE)) == ',' ||
  ------------------
  |  Branch (26433:26): [True: 0, False: 0]
  ------------------
26434|      0|                         tok1 == '=' || tok1 == '}')) {
  ------------------
  |  Branch (26434:26): [True: 0, False: 0]
  |  Branch (26434:41): [True: 0, False: 0]
  ------------------
26435|      0|                    if (prop_name == JS_ATOM_NULL) {
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26435:25): [True: 0, False: 0]
  ------------------
26436|       |                        /* computed property name on stack */
26437|      0|                        if (has_ellipsis) {
  ------------------
  |  Branch (26437:29): [True: 0, False: 0]
  ------------------
26438|       |                            /* define the property in excludeList */
26439|      0|                            emit_op(s, OP_to_propkey); /* avoid calling ToString twice */
26440|      0|                            emit_op(s, OP_perm3); /* TOS: src excludeList prop */
26441|      0|                            emit_op(s, OP_null); /* TOS: src excludeList prop null */
26442|      0|                            emit_op(s, OP_define_array_el); /* TOS: src excludeList prop */
26443|      0|                            emit_op(s, OP_perm3); /* TOS: excludeList src prop */
26444|      0|                        }
26445|       |                        /* get the computed property from the source object */
26446|      0|                        emit_op(s, OP_get_array_el2);
26447|      0|                    } else {
26448|       |                        /* named property */
26449|      0|                        if (has_ellipsis) {
  ------------------
  |  Branch (26449:29): [True: 0, False: 0]
  ------------------
26450|       |                            /* define the property in excludeList */
26451|      0|                            emit_op(s, OP_swap); /* TOS: src excludeList */
26452|      0|                            emit_op(s, OP_null); /* TOS: src excludeList null */
26453|      0|                            emit_op(s, OP_define_field); /* TOS: src excludeList */
26454|      0|                            emit_atom(s, prop_name);
26455|      0|                            emit_op(s, OP_swap); /* TOS: excludeList src */
26456|      0|                        }
26457|       |                        /* get the named property from the source object */
26458|      0|                        emit_op(s, OP_get_field2);
26459|      0|                        emit_u32(s, prop_name);
26460|      0|                    }
26461|      0|                    if (js_parse_destructuring_element(s, tok, is_arg, TRUE, -1, TRUE, export_flag) < 0)
  ------------------
  |  Branch (26461:25): [True: 0, False: 0]
  ------------------
26462|      0|                        return -1;
26463|      0|                    if (s->token.val == '}')
  ------------------
  |  Branch (26463:25): [True: 0, False: 0]
  ------------------
26464|      0|                        break;
26465|       |                    /* accept a trailing comma before the '}' */
26466|      0|                    if (js_parse_expect(s, ','))
  ------------------
  |  Branch (26466:25): [True: 0, False: 0]
  ------------------
26467|      0|                        return -1;
26468|      0|                    continue;
26469|      0|                }
26470|      2|                if (prop_name == JS_ATOM_NULL) {
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26470:21): [True: 0, False: 2]
  ------------------
26471|      0|                    emit_op(s, OP_to_propkey);
26472|      0|                    if (has_ellipsis) {
  ------------------
  |  Branch (26472:25): [True: 0, False: 0]
  ------------------
26473|       |                        /* define the property in excludeList */
26474|      0|                        emit_op(s, OP_perm3);
26475|      0|                        emit_op(s, OP_null);
26476|      0|                        emit_op(s, OP_define_array_el);
26477|      0|                        emit_op(s, OP_perm3);
26478|      0|                    }
26479|       |                    /* source prop -- source source prop */
26480|      0|                    emit_op(s, OP_dup1);
26481|      2|                } else {
26482|      2|                    if (has_ellipsis) {
  ------------------
  |  Branch (26482:25): [True: 0, False: 2]
  ------------------
26483|       |                        /* define the property in excludeList */
26484|      0|                        emit_op(s, OP_swap);
26485|      0|                        emit_op(s, OP_null);
26486|      0|                        emit_op(s, OP_define_field);
26487|      0|                        emit_atom(s, prop_name);
26488|      0|                        emit_op(s, OP_swap);
26489|      0|                    }
26490|       |                    /* source -- source source */
26491|      2|                    emit_op(s, OP_dup);
26492|      2|                }
26493|      2|                if (tok) {
  ------------------
  |  Branch (26493:21): [True: 2, False: 0]
  ------------------
26494|      2|                    var_name = js_parse_destructuring_var(s, tok, is_arg);
26495|      2|                    if (var_name == JS_ATOM_NULL)
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26495:25): [True: 0, False: 2]
  ------------------
26496|      0|                        goto prop_error;
26497|      2|                    if (need_var_reference(s, tok)) {
  ------------------
  |  Branch (26497:25): [True: 0, False: 2]
  ------------------
26498|       |                        /* Must make a reference for proper `with` semantics */
26499|      0|                        emit_op(s, OP_scope_get_var);
26500|      0|                        emit_atom(s, var_name);
26501|      0|                        emit_u16(s, s->cur_func->scope_level);
26502|      0|                        JS_FreeAtom(s->ctx, var_name);
26503|      0|                        goto lvalue1;
26504|      2|                    } else {
26505|       |                        /* no need to make a reference for let/const */
26506|      2|                        opcode = OP_scope_get_var;
26507|      2|                        scope = s->cur_func->scope_level;
26508|      2|                        label_lvalue = -1;
26509|      2|                        depth_lvalue = 0;
26510|      2|                    }
26511|      2|                } else {
26512|      0|                    if (js_parse_left_hand_side_expr(s))
  ------------------
  |  Branch (26512:25): [True: 0, False: 0]
  ------------------
26513|      0|                        goto prop_error;
26514|      0|                lvalue1:
26515|      0|                    if (get_lvalue(s, &opcode, &scope, &var_name,
  ------------------
  |  Branch (26515:25): [True: 0, False: 0]
  ------------------
26516|      0|                                   &label_lvalue, &depth_lvalue, FALSE, '{'))
26517|      0|                        goto prop_error;
26518|       |                    /* swap ref and lvalue object if any */
26519|      0|                    if (prop_name == JS_ATOM_NULL) {
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26519:25): [True: 0, False: 0]
  ------------------
26520|      0|                        switch(depth_lvalue) {
26521|      0|                        case 0:
  ------------------
  |  Branch (26521:25): [True: 0, False: 0]
  ------------------
26522|      0|                            break;
26523|      0|                        case 1:
  ------------------
  |  Branch (26523:25): [True: 0, False: 0]
  ------------------
26524|       |                            /* source prop x -> x source prop */
26525|      0|                            emit_op(s, OP_rot3r);
26526|      0|                            break;
26527|      0|                        case 2:
  ------------------
  |  Branch (26527:25): [True: 0, False: 0]
  ------------------
26528|       |                            /* source prop x y -> x y source prop */
26529|      0|                            emit_op(s, OP_swap2);   /* t p2 s p1 */
26530|      0|                            break;
26531|      0|                        case 3:
  ------------------
  |  Branch (26531:25): [True: 0, False: 0]
  ------------------
26532|       |                            /* source prop x y z -> x y z source prop */
26533|      0|                            emit_op(s, OP_rot5l);
26534|      0|                            emit_op(s, OP_rot5l);
26535|      0|                            break;
26536|      0|                        default:
  ------------------
  |  Branch (26536:25): [True: 0, False: 0]
  ------------------
26537|      0|                            abort();
26538|      0|                        }
26539|      0|                    } else {
26540|      0|                        switch(depth_lvalue) {
26541|      0|                        case 0:
  ------------------
  |  Branch (26541:25): [True: 0, False: 0]
  ------------------
26542|      0|                            break;
26543|      0|                        case 1:
  ------------------
  |  Branch (26543:25): [True: 0, False: 0]
  ------------------
26544|       |                            /* source x -> x source */
26545|      0|                            emit_op(s, OP_swap);
26546|      0|                            break;
26547|      0|                        case 2:
  ------------------
  |  Branch (26547:25): [True: 0, False: 0]
  ------------------
26548|       |                            /* source x y -> x y source */
26549|      0|                            emit_op(s, OP_rot3l);
26550|      0|                            break;
26551|      0|                        case 3:
  ------------------
  |  Branch (26551:25): [True: 0, False: 0]
  ------------------
26552|       |                            /* source x y z -> x y z source */
26553|      0|                            emit_op(s, OP_rot4l);
26554|      0|                            break;
26555|      0|                        default:
  ------------------
  |  Branch (26555:25): [True: 0, False: 0]
  ------------------
26556|      0|                            abort();
26557|      0|                        }
26558|      0|                    }
26559|      0|                }
26560|      2|                if (prop_name == JS_ATOM_NULL) {
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26560:21): [True: 0, False: 2]
  ------------------
26561|       |                    /* computed property name on stack */
26562|       |                    /* XXX: should have OP_get_array_el2x with depth */
26563|       |                    /* source prop -- val */
26564|      0|                    emit_op(s, OP_get_array_el);
26565|      2|                } else {
26566|       |                    /* named property */
26567|       |                    /* XXX: should have OP_get_field2x with depth */
26568|       |                    /* source -- val */
26569|      2|                    emit_op(s, OP_get_field);
26570|      2|                    emit_u32(s, prop_name);
26571|      2|                }
26572|      2|            } else {
26573|       |                /* prop_type = PROP_TYPE_VAR, cannot be a computed property */
26574|      0|                if (is_arg && js_parse_check_duplicate_parameter(s, prop_name))
  ------------------
  |  Branch (26574:21): [True: 0, False: 0]
  |  Branch (26574:31): [True: 0, False: 0]
  ------------------
26575|      0|                    goto prop_error;
26576|      0|                if ((s->cur_func->js_mode & JS_MODE_STRICT) &&
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (26576:21): [True: 0, False: 0]
  ------------------
26577|      0|                    (prop_name == JS_ATOM_eval || prop_name == JS_ATOM_arguments)) {
  ------------------
  |  Branch (26577:22): [True: 0, False: 0]
  |  Branch (26577:51): [True: 0, False: 0]
  ------------------
26578|      0|                    js_parse_error(s, "invalid destructuring target");
26579|      0|                    goto prop_error;
26580|      0|                }
26581|      0|                if (has_ellipsis) {
  ------------------
  |  Branch (26581:21): [True: 0, False: 0]
  ------------------
26582|       |                    /* define the property in excludeList */
26583|      0|                    emit_op(s, OP_swap);
26584|      0|                    emit_op(s, OP_null);
26585|      0|                    emit_op(s, OP_define_field);
26586|      0|                    emit_atom(s, prop_name);
26587|      0|                    emit_op(s, OP_swap);
26588|      0|                }
26589|      0|                if (!tok || need_var_reference(s, tok)) {
  ------------------
  |  Branch (26589:21): [True: 0, False: 0]
  |  Branch (26589:29): [True: 0, False: 0]
  ------------------
26590|       |                    /* generate reference */
26591|       |                    /* source -- source source */
26592|      0|                    emit_op(s, OP_dup);
26593|      0|                    emit_op(s, OP_scope_get_var);
26594|      0|                    emit_atom(s, prop_name);
26595|      0|                    emit_u16(s, s->cur_func->scope_level);
26596|      0|                    goto lvalue1;
26597|      0|                } else {
26598|       |                    /* no need to make a reference for let/const */
26599|      0|                    var_name = JS_DupAtom(s->ctx, prop_name);
26600|      0|                    opcode = OP_scope_get_var;
26601|      0|                    scope = s->cur_func->scope_level;
26602|      0|                    label_lvalue = -1;
26603|      0|                    depth_lvalue = 0;
26604|       |                    
26605|       |                    /* source -- source val */
26606|      0|                    emit_op(s, OP_get_field2);
26607|      0|                    emit_u32(s, prop_name);
26608|      0|                }
26609|      0|            }
26610|      2|        set_val:
26611|      2|            if (tok) {
  ------------------
  |  Branch (26611:17): [True: 2, False: 0]
  ------------------
26612|      2|                if (js_define_var(s, var_name, tok))
  ------------------
  |  Branch (26612:21): [True: 0, False: 2]
  ------------------
26613|      0|                    goto var_error;
26614|      2|                if (export_flag) {
  ------------------
  |  Branch (26614:21): [True: 0, False: 2]
  ------------------
26615|      0|                    if (!add_export_entry(s, s->cur_func->module, var_name, var_name,
  ------------------
  |  Branch (26615:25): [True: 0, False: 0]
  ------------------
26616|      0|                                          JS_EXPORT_TYPE_LOCAL))
26617|      0|                        goto var_error;
26618|      0|                }
26619|      2|                scope = s->cur_func->scope_level; /* XXX: check */
26620|      2|            }
26621|      2|            if (s->token.val == '=') {  /* handle optional default value */
  ------------------
  |  Branch (26621:17): [True: 0, False: 2]
  ------------------
26622|      0|                int label_hasval;
26623|      0|                emit_op(s, OP_dup);
26624|      0|                emit_op(s, OP_undefined);
26625|      0|                emit_op(s, OP_strict_eq);
26626|      0|                label_hasval = emit_goto(s, OP_if_false, -1);
26627|      0|                if (next_token(s))
  ------------------
  |  Branch (26627:21): [True: 0, False: 0]
  ------------------
26628|      0|                    goto var_error;
26629|      0|                emit_op(s, OP_drop);
26630|      0|                if (js_parse_assign_expr(s))
  ------------------
  |  Branch (26630:21): [True: 0, False: 0]
  ------------------
26631|      0|                    goto var_error;
26632|      0|                if (opcode == OP_scope_get_var || opcode == OP_get_ref_value)
  ------------------
  |  Branch (26632:21): [True: 0, False: 0]
  |  Branch (26632:51): [True: 0, False: 0]
  ------------------
26633|      0|                    set_object_name(s, var_name);
26634|      0|                emit_label(s, label_hasval);
26635|      0|            }
26636|       |            /* store value into lvalue object */
26637|      2|            put_lvalue(s, opcode, scope, var_name, label_lvalue,
26638|      2|                       PUT_LVALUE_NOKEEP_DEPTH,
26639|      2|                       (tok == TOK_CONST || tok == TOK_LET));
  ------------------
  |  Branch (26639:25): [True: 0, False: 2]
  |  Branch (26639:45): [True: 2, False: 0]
  ------------------
26640|      2|            if (s->token.val == '}')
  ------------------
  |  Branch (26640:17): [True: 2, False: 0]
  ------------------
26641|      2|                break;
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|       |        /* drop the source object */
26647|      2|        emit_op(s, OP_drop);
26648|      2|        if (has_ellipsis) {
  ------------------
  |  Branch (26648:13): [True: 0, False: 2]
  ------------------
26649|      0|            emit_op(s, OP_drop); /* pop excludeList */
26650|      0|        }
26651|      2|        if (next_token(s))
  ------------------
  |  Branch (26651:13): [True: 0, False: 2]
  ------------------
26652|      0|            return -1;
26653|      2|    } else if (s->token.val == '[') {
  ------------------
  |  Branch (26653:16): [True: 0, False: 0]
  ------------------
26654|      0|        BOOL has_spread;
26655|      0|        int enum_depth;
26656|      0|        BlockEnv block_env;
26657|       |
26658|      0|        if (next_token(s))
  ------------------
  |  Branch (26658:13): [True: 0, False: 0]
  ------------------
26659|      0|            return -1;
26660|       |        /* the block environment is only needed in generators in case
26661|       |           'yield' triggers a 'return' */
26662|      0|        push_break_entry(s->cur_func, &block_env,
26663|      0|                         JS_ATOM_NULL, -1, -1, 2);
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
26664|      0|        block_env.has_iterator = TRUE;
26665|      0|        emit_op(s, OP_for_of_start);
26666|      0|        has_spread = FALSE;
26667|      0|        while (s->token.val != ']') {
  ------------------
  |  Branch (26667:16): [True: 0, False: 0]
  ------------------
26668|       |            /* get the next value */
26669|      0|            if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (26669:17): [True: 0, False: 0]
  ------------------
26670|      0|                if (next_token(s))
  ------------------
  |  Branch (26670:21): [True: 0, False: 0]
  ------------------
26671|      0|                    return -1;
26672|      0|                if (s->token.val == ',' || s->token.val == ']')
  ------------------
  |  Branch (26672:21): [True: 0, False: 0]
  |  Branch (26672:44): [True: 0, False: 0]
  ------------------
26673|      0|                    return js_parse_error(s, "missing binding pattern...");
26674|      0|                has_spread = TRUE;
26675|      0|            }
26676|      0|            if (s->token.val == ',') {
  ------------------
  |  Branch (26676:17): [True: 0, False: 0]
  ------------------
26677|       |                /* do nothing, skip the value, has_spread is false */
26678|      0|                emit_op(s, OP_for_of_next);
26679|      0|                emit_u8(s, 0);
26680|      0|                emit_op(s, OP_drop);
26681|      0|                emit_op(s, OP_drop);
26682|      0|            } else if ((s->token.val == '[' || s->token.val == '{')
  ------------------
  |  Branch (26682:25): [True: 0, False: 0]
  |  Branch (26682:48): [True: 0, False: 0]
  ------------------
26683|      0|                   &&  ((tok1 = js_parse_skip_parens_token(s, &skip_bits, FALSE)) == ',' ||
  ------------------
  |  Branch (26683:25): [True: 0, False: 0]
  ------------------
26684|      0|                        tok1 == '=' || tok1 == ']')) {
  ------------------
  |  Branch (26684:25): [True: 0, False: 0]
  |  Branch (26684:40): [True: 0, False: 0]
  ------------------
26685|      0|                if (has_spread) {
  ------------------
  |  Branch (26685:21): [True: 0, False: 0]
  ------------------
26686|      0|                    if (tok1 == '=')
  ------------------
  |  Branch (26686:25): [True: 0, False: 0]
  ------------------
26687|      0|                        return js_parse_error(s, "rest element cannot have a default value");
26688|      0|                    js_emit_spread_code(s, 0);
26689|      0|                } else {
26690|      0|                    emit_op(s, OP_for_of_next);
26691|      0|                    emit_u8(s, 0);
26692|      0|                    emit_op(s, OP_drop);
26693|      0|                }
26694|      0|                if (js_parse_destructuring_element(s, tok, is_arg, TRUE, skip_bits & SKIP_HAS_ELLIPSIS, TRUE, export_flag) < 0)
  ------------------
  |  |24783|      0|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
  |  Branch (26694:21): [True: 0, False: 0]
  ------------------
26695|      0|                    return -1;
26696|      0|            } else {
26697|      0|                var_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
26698|      0|                if (tok) {
  ------------------
  |  Branch (26698:21): [True: 0, False: 0]
  ------------------
26699|      0|                    var_name = js_parse_destructuring_var(s, tok, is_arg);
26700|      0|                    if (var_name == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26700:25): [True: 0, False: 0]
  ------------------
26701|      0|                        goto var_error;
26702|      0|                    if (js_define_var(s, var_name, tok))
  ------------------
  |  Branch (26702:25): [True: 0, False: 0]
  ------------------
26703|      0|                        goto var_error;
26704|      0|                    if (need_var_reference(s, tok)) {
  ------------------
  |  Branch (26704:25): [True: 0, False: 0]
  ------------------
26705|       |                        /* Must make a reference for proper `with` semantics */
26706|      0|                        emit_op(s, OP_scope_get_var);
26707|      0|                        emit_atom(s, var_name);
26708|      0|                        emit_u16(s, s->cur_func->scope_level);
26709|      0|                        JS_FreeAtom(s->ctx, var_name);
26710|      0|                        goto lvalue2;
26711|      0|                    } else {
26712|       |                        /* no need to make a reference for let/const */
26713|      0|                        opcode = OP_scope_get_var;
26714|      0|                        scope = s->cur_func->scope_level;
26715|      0|                        label_lvalue = -1;
26716|      0|                        enum_depth = 0;
26717|      0|                    }
26718|      0|                } else {
26719|      0|                    if (js_parse_left_hand_side_expr(s))
  ------------------
  |  Branch (26719:25): [True: 0, False: 0]
  ------------------
26720|      0|                        return -1;
26721|      0|                lvalue2:
26722|      0|                    if (get_lvalue(s, &opcode, &scope, &var_name,
  ------------------
  |  Branch (26722:25): [True: 0, False: 0]
  ------------------
26723|      0|                                   &label_lvalue, &enum_depth, FALSE, '[')) {
26724|      0|                        return -1;
26725|      0|                    }
26726|      0|                }
26727|      0|                if (has_spread) {
  ------------------
  |  Branch (26727:21): [True: 0, False: 0]
  ------------------
26728|      0|                    js_emit_spread_code(s, enum_depth);
26729|      0|                } else {
26730|      0|                    emit_op(s, OP_for_of_next);
26731|      0|                    emit_u8(s, enum_depth);
26732|      0|                    emit_op(s, OP_drop);
26733|      0|                }
26734|      0|                if (s->token.val == '=' && !has_spread) {
  ------------------
  |  Branch (26734:21): [True: 0, False: 0]
  |  Branch (26734:44): [True: 0, False: 0]
  ------------------
26735|       |                    /* handle optional default value */
26736|      0|                    int label_hasval;
26737|      0|                    emit_op(s, OP_dup);
26738|      0|                    emit_op(s, OP_undefined);
26739|      0|                    emit_op(s, OP_strict_eq);
26740|      0|                    label_hasval = emit_goto(s, OP_if_false, -1);
26741|      0|                    if (next_token(s))
  ------------------
  |  Branch (26741:25): [True: 0, False: 0]
  ------------------
26742|      0|                        goto var_error;
26743|      0|                    emit_op(s, OP_drop);
26744|      0|                    if (js_parse_assign_expr(s))
  ------------------
  |  Branch (26744:25): [True: 0, False: 0]
  ------------------
26745|      0|                        goto var_error;
26746|      0|                    if (opcode == OP_scope_get_var || opcode == OP_get_ref_value)
  ------------------
  |  Branch (26746:25): [True: 0, False: 0]
  |  Branch (26746:55): [True: 0, False: 0]
  ------------------
26747|      0|                        set_object_name(s, var_name);
26748|      0|                    emit_label(s, label_hasval);
26749|      0|                }
26750|       |                /* store value into lvalue object */
26751|      0|                put_lvalue(s, opcode, scope, var_name,
26752|      0|                           label_lvalue, PUT_LVALUE_NOKEEP_DEPTH,
26753|      0|                           (tok == TOK_CONST || tok == TOK_LET));
  ------------------
  |  Branch (26753:29): [True: 0, False: 0]
  |  Branch (26753:49): [True: 0, False: 0]
  ------------------
26754|      0|            }
26755|      0|            if (s->token.val == ']')
  ------------------
  |  Branch (26755:17): [True: 0, False: 0]
  ------------------
26756|      0|                break;
26757|      0|            if (has_spread)
  ------------------
  |  Branch (26757:17): [True: 0, False: 0]
  ------------------
26758|      0|                return js_parse_error(s, "rest element must be the last one");
26759|       |            /* accept a trailing comma before the ']' */
26760|      0|            if (js_parse_expect(s, ','))
  ------------------
  |  Branch (26760:17): [True: 0, False: 0]
  ------------------
26761|      0|                return -1;
26762|      0|        }
26763|       |        /* close iterator object:
26764|       |           if completed, enum_obj has been replaced by undefined */
26765|      0|        emit_op(s, OP_iterator_close);
26766|      0|        pop_break_entry(s->cur_func);
26767|      0|        if (next_token(s))
  ------------------
  |  Branch (26767:13): [True: 0, False: 0]
  ------------------
26768|      0|            return -1;
26769|      0|    } else {
26770|      0|        return js_parse_error(s, "invalid assignment syntax");
26771|      0|    }
26772|      2|    if (s->token.val == '=' && allow_initializer) {
  ------------------
  |  Branch (26772:9): [True: 2, False: 0]
  |  Branch (26772:32): [True: 2, False: 0]
  ------------------
26773|      2|        label_done = emit_goto(s, OP_goto, -1);
26774|      2|        if (next_token(s))
  ------------------
  |  Branch (26774:13): [True: 0, False: 2]
  ------------------
26775|      0|            return -1;
26776|      2|        emit_label(s, label_parse);
26777|      2|        if (hasval)
  ------------------
  |  Branch (26777:13): [True: 2, False: 0]
  ------------------
26778|      2|            emit_op(s, OP_drop);
26779|      2|        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (26779:13): [True: 0, False: 2]
  ------------------
26780|      0|            return -1;
26781|      2|        emit_goto(s, OP_goto, label_assign);
26782|      2|        emit_label(s, label_done);
26783|      2|        has_initializer = TRUE;
26784|      2|    } else {
26785|       |        /* normally hasval is true except if
26786|       |           js_parse_skip_parens_token() was wrong in the parsing */
26787|       |        //        assert(hasval);
26788|      0|        if (!hasval) {
  ------------------
  |  Branch (26788:13): [True: 0, False: 0]
  ------------------
26789|      0|            js_parse_error(s, "too complicated destructuring expression");
26790|      0|            return -1;
26791|      0|        }
26792|       |        /* remove test and decrement label ref count */
26793|      0|        memset(s->cur_func->byte_code.buf + start_addr, OP_nop,
26794|      0|               assign_addr - start_addr);
26795|      0|        s->cur_func->label_slots[label_parse].ref_count--;
26796|      0|        has_initializer = FALSE;
26797|      0|    }
26798|      2|    return has_initializer;
26799|       |
26800|      0| prop_error:
26801|      0|    JS_FreeAtom(s->ctx, prop_name);
26802|      0| var_error:
26803|      0|    JS_FreeAtom(s->ctx, var_name);
26804|      0|    return -1;
26805|      0|}
quickjs.c:js_parse_destructuring_var:
26315|      2|{
26316|      2|    JSAtom name;
26317|       |
26318|      2|    if (!(s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved)
  ------------------
  |  Branch (26318:11): [True: 2, False: 0]
  |  Branch (26318:40): [True: 2, False: 0]
  ------------------
26319|      2|    ||  ((s->cur_func->js_mode & JS_MODE_STRICT) &&
  ------------------
  |  |  403|      2|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (26319:10): [True: 0, False: 2]
  ------------------
26320|      0|         (s->token.u.ident.atom == JS_ATOM_eval || s->token.u.ident.atom == JS_ATOM_arguments))) {
  ------------------
  |  Branch (26320:11): [True: 0, False: 0]
  |  Branch (26320:52): [True: 0, False: 0]
  ------------------
26321|      0|        js_parse_error(s, "invalid destructuring target");
26322|      0|        return JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
26323|      0|    }
26324|      2|    name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
26325|      2|    if (is_arg && js_parse_check_duplicate_parameter(s, name))
  ------------------
  |  Branch (26325:9): [True: 2, False: 0]
  |  Branch (26325:19): [True: 0, False: 2]
  ------------------
26326|      0|        goto fail;
26327|      2|    if (next_token(s))
  ------------------
  |  Branch (26327:9): [True: 0, False: 2]
  ------------------
26328|      0|        goto fail;
26329|       |
26330|      2|    return name;
26331|      0|fail:
26332|      0|    JS_FreeAtom(s->ctx, name);
26333|      0|    return JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
26334|      2|}
quickjs.c:need_var_reference:
26301|      2|{
26302|      2|    JSFunctionDef *fd = s->cur_func;
26303|      2|    if (tok != TOK_VAR)
  ------------------
  |  Branch (26303:9): [True: 2, False: 0]
  ------------------
26304|      2|        return FALSE; /* no reference for let/const */
26305|      0|    if (fd->js_mode & JS_MODE_STRICT) {
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (26305:9): [True: 0, False: 0]
  ------------------
26306|      0|        if (!fd->is_global_var)
  ------------------
  |  Branch (26306:13): [True: 0, False: 0]
  ------------------
26307|      0|            return FALSE; /* local definitions in strict mode in function or direct eval */
26308|      0|        if (s->is_module)
  ------------------
  |  Branch (26308:13): [True: 0, False: 0]
  ------------------
26309|      0|            return FALSE; /* in a module global variables are like closure variables */
26310|      0|    }
26311|      0|    return TRUE;
26312|      0|}
quickjs.c:js_parse_postfix_expr:
26833|    123|{
26834|    123|    FuncCallType call_type;
26835|    123|    int optional_chaining_label;
26836|    123|    BOOL accept_lparen = (parse_flags & PF_POSTFIX_CALL) != 0;
  ------------------
  |  |25087|    123|#define PF_POSTFIX_CALL (1 << 1)
  ------------------
26837|    123|    const uint8_t *op_token_ptr;
26838|       |    
26839|    123|    call_type = FUNC_CALL_NORMAL;
26840|    123|    switch(s->token.val) {
26841|      6|    case TOK_NUMBER:
  ------------------
  |  Branch (26841:5): [True: 6, False: 117]
  ------------------
26842|      6|        {
26843|      6|            JSValue val;
26844|      6|            val = s->token.u.num.val;
26845|       |
26846|      6|            if (JS_VALUE_GET_TAG(val) == JS_TAG_INT) {
  ------------------
  |  |  236|      6|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (26846:17): [True: 3, False: 3]
  ------------------
26847|      3|                emit_op(s, OP_push_i32);
26848|      3|                emit_u32(s, JS_VALUE_GET_INT(val));
  ------------------
  |  |  239|      3|#define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
  ------------------
26849|      3|            } else if (JS_VALUE_GET_TAG(val) == JS_TAG_SHORT_BIG_INT) {
  ------------------
  |  |  236|      3|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (26849:24): [True: 0, False: 3]
  ------------------
26850|      0|                int64_t v;
26851|      0|                v = JS_VALUE_GET_SHORT_BIG_INT(val);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
26852|      0|                if (v >= INT32_MIN && v <= INT32_MAX) {
  ------------------
  |  Branch (26852:21): [True: 0, False: 0]
  |  Branch (26852:39): [True: 0, False: 0]
  ------------------
26853|      0|                    emit_op(s, OP_push_bigint_i32);
26854|      0|                    emit_u32(s, v);
26855|      0|                } else {
26856|      0|                    goto large_number;
26857|      0|                }
26858|      3|            } else {
26859|      3|            large_number:
26860|      3|                if (emit_push_const(s, val, 0) < 0)
  ------------------
  |  Branch (26860:21): [True: 0, False: 3]
  ------------------
26861|      0|                    return -1;
26862|      3|            }
26863|      6|        }
26864|      6|        if (next_token(s))
  ------------------
  |  Branch (26864:13): [True: 0, False: 6]
  ------------------
26865|      0|            return -1;
26866|      6|        break;
26867|     17|    case TOK_TEMPLATE:
  ------------------
  |  Branch (26867:5): [True: 17, False: 106]
  ------------------
26868|     17|        if (js_parse_template(s, 0, NULL))
  ------------------
  |  Branch (26868:13): [True: 0, False: 17]
  ------------------
26869|      0|            return -1;
26870|     17|        break;
26871|     17|    case TOK_STRING:
  ------------------
  |  Branch (26871:5): [True: 7, False: 116]
  ------------------
26872|      7|        if (emit_push_const(s, s->token.u.str.str, 1))
  ------------------
  |  Branch (26872:13): [True: 0, False: 7]
  ------------------
26873|      0|            return -1;
26874|      7|        if (next_token(s))
  ------------------
  |  Branch (26874:13): [True: 0, False: 7]
  ------------------
26875|      0|            return -1;
26876|      7|        break;
26877|       |
26878|      7|    case TOK_DIV_ASSIGN:
  ------------------
  |  Branch (26878:5): [True: 0, False: 123]
  ------------------
26879|      0|        s->buf_ptr -= 2;
26880|      0|        goto parse_regexp;
26881|      0|    case '/':
  ------------------
  |  Branch (26881:5): [True: 0, False: 123]
  ------------------
26882|      0|        s->buf_ptr--;
26883|      0|    parse_regexp:
26884|      0|        {
26885|      0|            JSValue str;
26886|      0|            int ret;
26887|      0|            if (!s->ctx->compile_regexp)
  ------------------
  |  Branch (26887:17): [True: 0, False: 0]
  ------------------
26888|      0|                return js_parse_error(s, "RegExp are not supported");
26889|       |            /* the previous token is '/' or '/=', so no need to free */
26890|      0|            if (js_parse_regexp(s))
  ------------------
  |  Branch (26890:17): [True: 0, False: 0]
  ------------------
26891|      0|                return -1;
26892|      0|            ret = emit_push_const(s, s->token.u.regexp.body, 0);
26893|      0|            str = s->ctx->compile_regexp(s->ctx, s->token.u.regexp.body,
26894|      0|                                         s->token.u.regexp.flags);
26895|      0|            if (JS_IsException(str)) {
  ------------------
  |  Branch (26895:17): [True: 0, False: 0]
  ------------------
26896|       |                /* add the line number info */
26897|      0|                int line_num, col_num;
26898|      0|                line_num = get_line_col(&col_num, s->buf_start, s->token.ptr - s->buf_start);
26899|      0|                build_backtrace(s->ctx, s->ctx->rt->current_exception,
26900|      0|                                s->filename, line_num + 1, col_num + 1, 0);
26901|      0|                return -1;
26902|      0|            }
26903|      0|            ret = emit_push_const(s, str, 0);
26904|      0|            JS_FreeValue(s->ctx, str);
26905|      0|            if (ret)
  ------------------
  |  Branch (26905:17): [True: 0, False: 0]
  ------------------
26906|      0|                return -1;
26907|       |            /* we use a specific opcode to be sure the correct
26908|       |               function is called (otherwise the bytecode would have
26909|       |               to be verified by the RegExp constructor) */
26910|      0|            emit_op(s, OP_regexp);
26911|      0|            if (next_token(s))
  ------------------
  |  Branch (26911:17): [True: 0, False: 0]
  ------------------
26912|      0|                return -1;
26913|      0|        }
26914|      0|        break;
26915|      0|    case '(':
  ------------------
  |  Branch (26915:5): [True: 0, False: 123]
  ------------------
26916|      0|        if (js_parse_expr_paren(s))
  ------------------
  |  Branch (26916:13): [True: 0, False: 0]
  ------------------
26917|      0|            return -1;
26918|      0|        break;
26919|      0|    case TOK_FUNCTION:
  ------------------
  |  Branch (26919:5): [True: 0, False: 123]
  ------------------
26920|      0|        if (js_parse_function_decl(s, JS_PARSE_FUNC_EXPR,
  ------------------
  |  Branch (26920:13): [True: 0, False: 0]
  ------------------
26921|      0|                                   JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
26922|      0|                                   s->token.ptr))
26923|      0|            return -1;
26924|      0|        break;
26925|      0|    case TOK_CLASS:
  ------------------
  |  Branch (26925:5): [True: 0, False: 123]
  ------------------
26926|      0|        if (js_parse_class(s, TRUE, JS_PARSE_EXPORT_NONE))
  ------------------
  |  Branch (26926:13): [True: 0, False: 0]
  ------------------
26927|      0|            return -1;
26928|      0|        break;
26929|      0|    case TOK_NULL:
  ------------------
  |  Branch (26929:5): [True: 0, False: 123]
  ------------------
26930|      0|        if (next_token(s))
  ------------------
  |  Branch (26930:13): [True: 0, False: 0]
  ------------------
26931|      0|            return -1;
26932|      0|        emit_op(s, OP_null);
26933|      0|        break;
26934|      0|    case TOK_THIS:
  ------------------
  |  Branch (26934:5): [True: 0, False: 123]
  ------------------
26935|      0|        if (next_token(s))
  ------------------
  |  Branch (26935:13): [True: 0, False: 0]
  ------------------
26936|      0|            return -1;
26937|      0|        emit_op(s, OP_scope_get_var);
26938|      0|        emit_atom(s, JS_ATOM_this);
26939|      0|        emit_u16(s, 0);
26940|      0|        break;
26941|      0|    case TOK_FALSE:
  ------------------
  |  Branch (26941:5): [True: 0, False: 123]
  ------------------
26942|      0|        if (next_token(s))
  ------------------
  |  Branch (26942:13): [True: 0, False: 0]
  ------------------
26943|      0|            return -1;
26944|      0|        emit_op(s, OP_push_false);
26945|      0|        break;
26946|      0|    case TOK_TRUE:
  ------------------
  |  Branch (26946:5): [True: 0, False: 123]
  ------------------
26947|      0|        if (next_token(s))
  ------------------
  |  Branch (26947:13): [True: 0, False: 0]
  ------------------
26948|      0|            return -1;
26949|      0|        emit_op(s, OP_push_true);
26950|      0|        break;
26951|     92|    case TOK_IDENT:
  ------------------
  |  Branch (26951:5): [True: 92, False: 31]
  ------------------
26952|     92|        {
26953|     92|            JSAtom name;
26954|     92|            const uint8_t *source_ptr;
26955|     92|            if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (26955:17): [True: 0, False: 92]
  ------------------
26956|      0|                return js_parse_error_reserved_identifier(s);
26957|      0|            }
26958|     92|            source_ptr = s->token.ptr;
26959|     92|            if (token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (26959:17): [True: 0, False: 92]
  ------------------
26960|      0|                peek_token(s, TRUE) != '\n') {
  ------------------
  |  Branch (26960:17): [True: 0, False: 0]
  ------------------
26961|      0|                if (next_token(s))
  ------------------
  |  Branch (26961:21): [True: 0, False: 0]
  ------------------
26962|      0|                    return -1;
26963|      0|                if (s->token.val == TOK_FUNCTION) {
  ------------------
  |  Branch (26963:21): [True: 0, False: 0]
  ------------------
26964|      0|                    if (js_parse_function_decl(s, JS_PARSE_FUNC_EXPR,
  ------------------
  |  Branch (26964:25): [True: 0, False: 0]
  ------------------
26965|      0|                                               JS_FUNC_ASYNC, JS_ATOM_NULL,
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
26966|      0|                                               source_ptr))
26967|      0|                        return -1;
26968|      0|                } else {
26969|      0|                    name = JS_DupAtom(s->ctx, JS_ATOM_async);
26970|      0|                    goto do_get_var;
26971|      0|                }
26972|     92|            } else {
26973|     92|                if (s->token.u.ident.atom == JS_ATOM_arguments &&
  ------------------
  |  Branch (26973:21): [True: 0, False: 92]
  ------------------
26974|      0|                    !s->cur_func->arguments_allowed) {
  ------------------
  |  Branch (26974:21): [True: 0, False: 0]
  ------------------
26975|      0|                    js_parse_error(s, "'arguments' identifier is not allowed in class field initializer");
26976|      0|                    return -1;
26977|      0|                }
26978|     92|                name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
26979|     92|                if (next_token(s)) {
  ------------------
  |  Branch (26979:21): [True: 0, False: 92]
  ------------------
26980|      0|                    JS_FreeAtom(s->ctx, name);
26981|      0|                    return -1;
26982|      0|                }
26983|     92|            do_get_var:
26984|     92|                emit_source_pos(s, source_ptr);
26985|     92|                emit_op(s, OP_scope_get_var);
26986|     92|                emit_u32(s, name);
26987|     92|                emit_u16(s, s->cur_func->scope_level);
26988|     92|            }
26989|     92|        }
26990|     92|        break;
26991|     92|    case '{':
  ------------------
  |  Branch (26991:5): [True: 0, False: 123]
  ------------------
26992|      0|    case '[':
  ------------------
  |  Branch (26992:5): [True: 0, False: 123]
  ------------------
26993|      0|        if (s->token.val == '{') {
  ------------------
  |  Branch (26993:13): [True: 0, False: 0]
  ------------------
26994|      0|            if (js_parse_object_literal(s))
  ------------------
  |  Branch (26994:17): [True: 0, False: 0]
  ------------------
26995|      0|                return -1;
26996|      0|        } else {
26997|      0|            if (js_parse_array_literal(s))
  ------------------
  |  Branch (26997:17): [True: 0, False: 0]
  ------------------
26998|      0|                return -1;
26999|      0|        }
27000|      0|        break;
27001|      0|    case TOK_NEW:
  ------------------
  |  Branch (27001:5): [True: 0, False: 123]
  ------------------
27002|      0|        if (next_token(s))
  ------------------
  |  Branch (27002:13): [True: 0, False: 0]
  ------------------
27003|      0|            return -1;
27004|      0|        if (s->token.val == '.') {
  ------------------
  |  Branch (27004:13): [True: 0, False: 0]
  ------------------
27005|      0|            if (next_token(s))
  ------------------
  |  Branch (27005:17): [True: 0, False: 0]
  ------------------
27006|      0|                return -1;
27007|      0|            if (!token_is_pseudo_keyword(s, JS_ATOM_target))
  ------------------
  |  Branch (27007:17): [True: 0, False: 0]
  ------------------
27008|      0|                return js_parse_error(s, "expecting target");
27009|      0|            if (!s->cur_func->new_target_allowed)
  ------------------
  |  Branch (27009:17): [True: 0, False: 0]
  ------------------
27010|      0|                return js_parse_error(s, "new.target only allowed within functions");
27011|      0|            if (next_token(s))
  ------------------
  |  Branch (27011:17): [True: 0, False: 0]
  ------------------
27012|      0|                return -1;
27013|      0|            emit_op(s, OP_scope_get_var);
27014|      0|            emit_atom(s, JS_ATOM_new_target);
27015|      0|            emit_u16(s, 0);
27016|      0|        } else {
27017|      0|            if (js_parse_postfix_expr(s, 0))
  ------------------
  |  Branch (27017:17): [True: 0, False: 0]
  ------------------
27018|      0|                return -1;
27019|      0|            accept_lparen = TRUE;
27020|      0|            if (s->token.val != '(') {
  ------------------
  |  Branch (27020:17): [True: 0, False: 0]
  ------------------
27021|       |                /* new operator on an object */
27022|      0|                emit_source_pos(s, s->token.ptr);
27023|      0|                emit_op(s, OP_dup);
27024|      0|                emit_op(s, OP_call_constructor);
27025|      0|                emit_u16(s, 0);
27026|      0|            } else {
27027|      0|                call_type = FUNC_CALL_NEW;
27028|      0|            }
27029|      0|        }
27030|      0|        break;
27031|      0|    case TOK_SUPER:
  ------------------
  |  Branch (27031:5): [True: 0, False: 123]
  ------------------
27032|      0|        if (next_token(s))
  ------------------
  |  Branch (27032:13): [True: 0, False: 0]
  ------------------
27033|      0|            return -1;
27034|      0|        if (s->token.val == '(') {
  ------------------
  |  Branch (27034:13): [True: 0, False: 0]
  ------------------
27035|      0|            if (!s->cur_func->super_call_allowed)
  ------------------
  |  Branch (27035:17): [True: 0, False: 0]
  ------------------
27036|      0|                return js_parse_error(s, "super() is only valid in a derived class constructor");
27037|      0|            call_type = FUNC_CALL_SUPER_CTOR;
27038|      0|        } else if (s->token.val == '.' || s->token.val == '[') {
  ------------------
  |  Branch (27038:20): [True: 0, False: 0]
  |  Branch (27038:43): [True: 0, False: 0]
  ------------------
27039|      0|            if (!s->cur_func->super_allowed)
  ------------------
  |  Branch (27039:17): [True: 0, False: 0]
  ------------------
27040|      0|                return js_parse_error(s, "'super' is only valid in a method");
27041|      0|            emit_op(s, OP_scope_get_var);
27042|      0|            emit_atom(s, JS_ATOM_this);
27043|      0|            emit_u16(s, 0);
27044|      0|            emit_op(s, OP_scope_get_var);
27045|      0|            emit_atom(s, JS_ATOM_home_object);
27046|      0|            emit_u16(s, 0);
27047|      0|            emit_op(s, OP_get_super);
27048|      0|        } else {
27049|      0|            return js_parse_error(s, "invalid use of 'super'");
27050|      0|        }
27051|      0|        break;
27052|      0|    case TOK_IMPORT:
  ------------------
  |  Branch (27052:5): [True: 0, False: 123]
  ------------------
27053|      0|        if (next_token(s))
  ------------------
  |  Branch (27053:13): [True: 0, False: 0]
  ------------------
27054|      0|            return -1;
27055|      0|        if (s->token.val == '.') {
  ------------------
  |  Branch (27055:13): [True: 0, False: 0]
  ------------------
27056|      0|            if (next_token(s))
  ------------------
  |  Branch (27056:17): [True: 0, False: 0]
  ------------------
27057|      0|                return -1;
27058|      0|            if (!token_is_pseudo_keyword(s, JS_ATOM_meta))
  ------------------
  |  Branch (27058:17): [True: 0, False: 0]
  ------------------
27059|      0|                return js_parse_error(s, "meta expected");
27060|      0|            if (!s->is_module)
  ------------------
  |  Branch (27060:17): [True: 0, False: 0]
  ------------------
27061|      0|                return js_parse_error(s, "import.meta only valid in module code");
27062|      0|            if (next_token(s))
  ------------------
  |  Branch (27062:17): [True: 0, False: 0]
  ------------------
27063|      0|                return -1;
27064|      0|            emit_op(s, OP_special_object);
27065|      0|            emit_u8(s, OP_SPECIAL_OBJECT_IMPORT_META);
27066|      0|        } else {
27067|      0|            if (js_parse_expect(s, '('))
  ------------------
  |  Branch (27067:17): [True: 0, False: 0]
  ------------------
27068|      0|                return -1;
27069|      0|            if (!accept_lparen)
  ------------------
  |  Branch (27069:17): [True: 0, False: 0]
  ------------------
27070|      0|                return js_parse_error(s, "invalid use of 'import()'");
27071|      0|            if (js_parse_assign_expr(s))
  ------------------
  |  Branch (27071:17): [True: 0, False: 0]
  ------------------
27072|      0|                return -1;
27073|      0|            if (s->token.val == ',') {
  ------------------
  |  Branch (27073:17): [True: 0, False: 0]
  ------------------
27074|      0|                if (next_token(s))
  ------------------
  |  Branch (27074:21): [True: 0, False: 0]
  ------------------
27075|      0|                    return -1;
27076|      0|                if (s->token.val != ')') {
  ------------------
  |  Branch (27076:21): [True: 0, False: 0]
  ------------------
27077|      0|                    if (js_parse_assign_expr(s))
  ------------------
  |  Branch (27077:25): [True: 0, False: 0]
  ------------------
27078|      0|                        return -1;
27079|       |                    /* accept a trailing comma */
27080|      0|                    if (s->token.val == ',') {
  ------------------
  |  Branch (27080:25): [True: 0, False: 0]
  ------------------
27081|      0|                        if (next_token(s))
  ------------------
  |  Branch (27081:29): [True: 0, False: 0]
  ------------------
27082|      0|                            return -1;
27083|      0|                    }
27084|      0|                } else {
27085|      0|                    emit_op(s, OP_undefined);
27086|      0|                }
27087|      0|            } else {
27088|      0|                emit_op(s, OP_undefined);
27089|      0|            }
27090|      0|            if (js_parse_expect(s, ')'))
  ------------------
  |  Branch (27090:17): [True: 0, False: 0]
  ------------------
27091|      0|                return -1;
27092|      0|            emit_op(s, OP_import);
27093|      0|        }
27094|      0|        break;
27095|      1|    default:
  ------------------
  |  Branch (27095:5): [True: 1, False: 122]
  ------------------
27096|      1|        return js_parse_error(s, "unexpected token in expression: '%.*s'",
27097|      1|                              (int)(s->buf_ptr - s->token.ptr), s->token.ptr);
27098|    123|    }
27099|       |
27100|    122|    optional_chaining_label = -1;
27101|    154|    for(;;) {
27102|    154|        JSFunctionDef *fd = s->cur_func;
27103|    154|        BOOL has_optional_chain = FALSE;
27104|       |
27105|    154|        if (s->token.val == TOK_QUESTION_MARK_DOT) {
  ------------------
  |  Branch (27105:13): [True: 0, False: 154]
  ------------------
27106|      0|            if ((parse_flags & PF_POSTFIX_CALL) == 0)
  ------------------
  |  |25087|      0|#define PF_POSTFIX_CALL (1 << 1)
  ------------------
  |  Branch (27106:17): [True: 0, False: 0]
  ------------------
27107|      0|                return js_parse_error(s, "new keyword cannot be used with an optional chain");
27108|      0|            op_token_ptr = s->token.ptr;
27109|       |            /* optional chaining */
27110|      0|            if (next_token(s))
  ------------------
  |  Branch (27110:17): [True: 0, False: 0]
  ------------------
27111|      0|                return -1;
27112|      0|            has_optional_chain = TRUE;
27113|      0|            if (s->token.val == '(' && accept_lparen) {
  ------------------
  |  Branch (27113:17): [True: 0, False: 0]
  |  Branch (27113:40): [True: 0, False: 0]
  ------------------
27114|      0|                goto parse_func_call;
27115|      0|            } else if (s->token.val == '[') {
  ------------------
  |  Branch (27115:24): [True: 0, False: 0]
  ------------------
27116|      0|                goto parse_array_access;
27117|      0|            } else {
27118|      0|                goto parse_property;
27119|      0|            }
27120|    154|        } else if (s->token.val == TOK_TEMPLATE &&
  ------------------
  |  Branch (27120:20): [True: 4, False: 150]
  ------------------
27121|      4|                   call_type == FUNC_CALL_NORMAL) {
  ------------------
  |  Branch (27121:20): [True: 4, False: 0]
  ------------------
27122|      4|            if (optional_chaining_label >= 0) {
  ------------------
  |  Branch (27122:17): [True: 0, False: 4]
  ------------------
27123|      0|                return js_parse_error(s, "template literal cannot appear in an optional chain");
27124|      0|            }
27125|      4|            call_type = FUNC_CALL_TEMPLATE;
27126|      4|            op_token_ptr = s->token.ptr; /* XXX: check if right position */
27127|      4|            goto parse_func_call2;
27128|    150|        } else if (s->token.val == '(' && accept_lparen) {
  ------------------
  |  Branch (27128:20): [True: 5, False: 145]
  |  Branch (27128:43): [True: 5, False: 0]
  ------------------
27129|      5|            int opcode, arg_count, drop_count;
27130|       |
27131|       |            /* function call */
27132|      5|        parse_func_call:
27133|      5|            op_token_ptr = s->token.ptr;
27134|      5|            if (next_token(s))
  ------------------
  |  Branch (27134:17): [True: 0, False: 5]
  ------------------
27135|      0|                return -1;
27136|       |
27137|      5|            if (call_type == FUNC_CALL_NORMAL) {
  ------------------
  |  Branch (27137:17): [True: 5, False: 0]
  ------------------
27138|      9|            parse_func_call2:
27139|      9|                switch(opcode = get_prev_opcode(fd)) {
27140|      1|                case OP_get_field:
  ------------------
  |  Branch (27140:17): [True: 1, False: 8]
  ------------------
27141|       |                    /* keep the object on the stack */
27142|      1|                    fd->byte_code.buf[fd->last_opcode_pos] = OP_get_field2;
27143|      1|                    drop_count = 2;
27144|      1|                    break;
27145|      0|                case OP_get_field_opt_chain:
  ------------------
  |  Branch (27145:17): [True: 0, False: 9]
  ------------------
27146|      0|                    {
27147|      0|                        int opt_chain_label, next_label;
27148|      0|                        opt_chain_label = get_u32(fd->byte_code.buf +
27149|      0|                                                  fd->last_opcode_pos + 1 + 4 + 1);
27150|       |                        /* keep the object on the stack */
27151|      0|                        fd->byte_code.buf[fd->last_opcode_pos] = OP_get_field2;
27152|      0|                        fd->byte_code.size = fd->last_opcode_pos + 1 + 4;
27153|      0|                        next_label = emit_goto(s, OP_goto, -1);
27154|      0|                        emit_label(s, opt_chain_label);
27155|       |                        /* need an additional undefined value for the
27156|       |                           case where the optional field does not
27157|       |                           exists */
27158|      0|                        emit_op(s, OP_undefined);
27159|      0|                        emit_label(s, next_label);
27160|      0|                        drop_count = 2;
27161|      0|                        opcode = OP_get_field;
27162|      0|                    }
27163|      0|                    break;
27164|      0|                case OP_scope_get_private_field:
  ------------------
  |  Branch (27164:17): [True: 0, False: 9]
  ------------------
27165|       |                    /* keep the object on the stack */
27166|      0|                    fd->byte_code.buf[fd->last_opcode_pos] = OP_scope_get_private_field2;
27167|      0|                    drop_count = 2;
27168|      0|                    break;
27169|      0|                case OP_get_array_el:
  ------------------
  |  Branch (27169:17): [True: 0, False: 9]
  ------------------
27170|       |                    /* keep the object on the stack */
27171|      0|                    fd->byte_code.buf[fd->last_opcode_pos] = OP_get_array_el2;
27172|      0|                    drop_count = 2;
27173|      0|                    break;
27174|      0|                case OP_get_array_el_opt_chain:
  ------------------
  |  Branch (27174:17): [True: 0, False: 9]
  ------------------
27175|      0|                    {
27176|      0|                        int opt_chain_label, next_label;
27177|      0|                        opt_chain_label = get_u32(fd->byte_code.buf +
27178|      0|                                                  fd->last_opcode_pos + 1 + 1);
27179|       |                        /* keep the object on the stack */
27180|      0|                        fd->byte_code.buf[fd->last_opcode_pos] = OP_get_array_el2;
27181|      0|                        fd->byte_code.size = fd->last_opcode_pos + 1;
27182|      0|                        next_label = emit_goto(s, OP_goto, -1);
27183|      0|                        emit_label(s, opt_chain_label);
27184|       |                        /* need an additional undefined value for the
27185|       |                           case where the optional field does not
27186|       |                           exists */
27187|      0|                        emit_op(s, OP_undefined);
27188|      0|                        emit_label(s, next_label);
27189|      0|                        drop_count = 2;
27190|      0|                        opcode = OP_get_array_el;
27191|      0|                    }
27192|      0|                    break;
27193|      8|                case OP_scope_get_var:
  ------------------
  |  Branch (27193:17): [True: 8, False: 1]
  ------------------
27194|      8|                    {
27195|      8|                        JSAtom name;
27196|      8|                        int scope;
27197|      8|                        name = get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
27198|      8|                        scope = get_u16(fd->byte_code.buf + fd->last_opcode_pos + 5);
27199|      8|                        if (name == JS_ATOM_eval && call_type == FUNC_CALL_NORMAL && !has_optional_chain) {
  ------------------
  |  Branch (27199:29): [True: 0, False: 8]
  |  Branch (27199:53): [True: 0, False: 0]
  |  Branch (27199:86): [True: 0, False: 0]
  ------------------
27200|       |                            /* direct 'eval' */
27201|      0|                            opcode = OP_eval;
27202|      8|                        } else {
27203|       |                            /* verify if function name resolves to a simple
27204|       |                               get_loc/get_arg: a function call inside a `with`
27205|       |                               statement can resolve to a method call of the
27206|       |                               `with` context object
27207|       |                             */
27208|       |                            /* XXX: always generate the OP_scope_get_ref
27209|       |                               and remove it in variable resolution
27210|       |                               pass ? */
27211|      8|                            if (has_with_scope(fd, scope)) {
  ------------------
  |  Branch (27211:33): [True: 0, False: 8]
  ------------------
27212|      0|                                opcode = OP_scope_get_ref;
27213|      0|                                fd->byte_code.buf[fd->last_opcode_pos] = opcode;
27214|      0|                            }
27215|      8|                        }
27216|      8|                        drop_count = 1;
27217|      8|                    }
27218|      8|                    break;
27219|      0|                case OP_get_super_value:
  ------------------
  |  Branch (27219:17): [True: 0, False: 9]
  ------------------
27220|      0|                    fd->byte_code.buf[fd->last_opcode_pos] = OP_get_array_el;
27221|       |                    /* on stack: this func_obj */
27222|      0|                    opcode = OP_get_array_el;
27223|      0|                    drop_count = 2;
27224|      0|                    break;
27225|      0|                default:
  ------------------
  |  Branch (27225:17): [True: 0, False: 9]
  ------------------
27226|      0|                    opcode = OP_invalid;
27227|      0|                    drop_count = 1;
27228|      0|                    break;
27229|      9|                }
27230|      9|                if (has_optional_chain) {
  ------------------
  |  Branch (27230:21): [True: 0, False: 9]
  ------------------
27231|      0|                    optional_chain_test(s, &optional_chaining_label,
27232|      0|                                        drop_count);
27233|      0|                }
27234|      9|            } else {
27235|      0|                opcode = OP_invalid;
27236|      0|            }
27237|       |
27238|      9|            if (call_type == FUNC_CALL_TEMPLATE) {
  ------------------
  |  Branch (27238:17): [True: 4, False: 5]
  ------------------
27239|      4|                if (js_parse_template(s, 1, &arg_count))
  ------------------
  |  Branch (27239:21): [True: 0, False: 4]
  ------------------
27240|      0|                    return -1;
27241|      4|                goto emit_func_call;
27242|      5|            } else if (call_type == FUNC_CALL_SUPER_CTOR) {
  ------------------
  |  Branch (27242:24): [True: 0, False: 5]
  ------------------
27243|      0|                emit_op(s, OP_scope_get_var);
27244|      0|                emit_atom(s, JS_ATOM_this_active_func);
27245|      0|                emit_u16(s, 0);
27246|       |
27247|      0|                emit_op(s, OP_get_super);
27248|       |
27249|      0|                emit_op(s, OP_scope_get_var);
27250|      0|                emit_atom(s, JS_ATOM_new_target);
27251|      0|                emit_u16(s, 0);
27252|      5|            } else if (call_type == FUNC_CALL_NEW) {
  ------------------
  |  Branch (27252:24): [True: 0, False: 5]
  ------------------
27253|      0|                emit_op(s, OP_dup); /* new.target = function */
27254|      0|            }
27255|       |
27256|       |            /* parse arguments */
27257|      5|            arg_count = 0;
27258|      5|            while (s->token.val != ')') {
  ------------------
  |  Branch (27258:20): [True: 4, False: 1]
  ------------------
27259|      4|                if (arg_count >= 65535) {
  ------------------
  |  Branch (27259:21): [True: 0, False: 4]
  ------------------
27260|      0|                    return js_parse_error(s, "Too many call arguments");
27261|      0|                }
27262|      4|                if (s->token.val == TOK_ELLIPSIS)
  ------------------
  |  Branch (27262:21): [True: 0, False: 4]
  ------------------
27263|      0|                    break;
27264|      4|                if (js_parse_assign_expr(s))
  ------------------
  |  Branch (27264:21): [True: 0, False: 4]
  ------------------
27265|      0|                    return -1;
27266|      4|                arg_count++;
27267|      4|                if (s->token.val == ')')
  ------------------
  |  Branch (27267:21): [True: 4, False: 0]
  ------------------
27268|      4|                    break;
27269|       |                /* accept a trailing comma before the ')' */
27270|      0|                if (js_parse_expect(s, ','))
  ------------------
  |  Branch (27270:21): [True: 0, False: 0]
  ------------------
27271|      0|                    return -1;
27272|      0|            }
27273|      5|            if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (27273:17): [True: 0, False: 5]
  ------------------
27274|      0|                emit_op(s, OP_array_from);
27275|      0|                emit_u16(s, arg_count);
27276|      0|                emit_op(s, OP_push_i32);
27277|      0|                emit_u32(s, arg_count);
27278|       |
27279|       |                /* on stack: array idx */
27280|      0|                while (s->token.val != ')') {
  ------------------
  |  Branch (27280:24): [True: 0, False: 0]
  ------------------
27281|      0|                    if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (27281:25): [True: 0, False: 0]
  ------------------
27282|      0|                        if (next_token(s))
  ------------------
  |  Branch (27282:29): [True: 0, False: 0]
  ------------------
27283|      0|                            return -1;
27284|      0|                        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (27284:29): [True: 0, False: 0]
  ------------------
27285|      0|                            return -1;
27286|      0|#if 1
27287|       |                        /* XXX: could pass is_last indicator? */
27288|      0|                        emit_op(s, OP_append);
27289|       |#else
27290|       |                        int label_next, label_done;
27291|       |                        label_next = new_label(s);
27292|       |                        label_done = new_label(s);
27293|       |                        /* push enumerate object below array/idx pair */
27294|       |                        emit_op(s, OP_for_of_start);
27295|       |                        emit_op(s, OP_rot5l);
27296|       |                        emit_op(s, OP_rot5l);
27297|       |                        emit_label(s, label_next);
27298|       |                        /* on stack: enum_rec array idx */
27299|       |                        emit_op(s, OP_for_of_next);
27300|       |                        emit_u8(s, 2);
27301|       |                        emit_goto(s, OP_if_true, label_done);
27302|       |                        /* append element */
27303|       |                        /* enum_rec array idx val -> enum_rec array new_idx */
27304|       |                        emit_op(s, OP_define_array_el);
27305|       |                        emit_op(s, OP_inc);
27306|       |                        emit_goto(s, OP_goto, label_next);
27307|       |                        emit_label(s, label_done);
27308|       |                        /* close enumeration, drop enum_rec and idx */
27309|       |                        emit_op(s, OP_drop); /* drop undef */
27310|       |                        emit_op(s, OP_nip1); /* drop enum_rec */
27311|       |                        emit_op(s, OP_nip1);
27312|       |                        emit_op(s, OP_nip1);
27313|       |#endif
27314|      0|                    } else {
27315|      0|                        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (27315:29): [True: 0, False: 0]
  ------------------
27316|      0|                            return -1;
27317|       |                        /* array idx val */
27318|      0|                        emit_op(s, OP_define_array_el);
27319|      0|                        emit_op(s, OP_inc);
27320|      0|                    }
27321|      0|                    if (s->token.val == ')')
  ------------------
  |  Branch (27321:25): [True: 0, False: 0]
  ------------------
27322|      0|                        break;
27323|       |                    /* accept a trailing comma before the ')' */
27324|      0|                    if (js_parse_expect(s, ','))
  ------------------
  |  Branch (27324:25): [True: 0, False: 0]
  ------------------
27325|      0|                        return -1;
27326|      0|                }
27327|      0|                if (next_token(s))
  ------------------
  |  Branch (27327:21): [True: 0, False: 0]
  ------------------
27328|      0|                    return -1;
27329|       |                /* drop the index */
27330|      0|                emit_op(s, OP_drop);
27331|       |
27332|      0|                emit_source_pos(s, op_token_ptr);
27333|       |                /* apply function call */
27334|      0|                switch(opcode) {
27335|      0|                case OP_get_field:
  ------------------
  |  Branch (27335:17): [True: 0, False: 0]
  ------------------
27336|      0|                case OP_scope_get_private_field:
  ------------------
  |  Branch (27336:17): [True: 0, False: 0]
  ------------------
27337|      0|                case OP_get_array_el:
  ------------------
  |  Branch (27337:17): [True: 0, False: 0]
  ------------------
27338|      0|                case OP_scope_get_ref:
  ------------------
  |  Branch (27338:17): [True: 0, False: 0]
  ------------------
27339|       |                    /* obj func array -> func obj array */
27340|      0|                    emit_op(s, OP_perm3);
27341|      0|                    emit_op(s, OP_apply);
27342|      0|                    emit_u16(s, call_type == FUNC_CALL_NEW);
27343|      0|                    break;
27344|      0|                case OP_eval:
  ------------------
  |  Branch (27344:17): [True: 0, False: 0]
  ------------------
27345|      0|                    emit_op(s, OP_apply_eval);
27346|      0|                    emit_u16(s, fd->scope_level);
27347|      0|                    fd->has_eval_call = TRUE;
27348|      0|                    break;
27349|      0|                default:
  ------------------
  |  Branch (27349:17): [True: 0, False: 0]
  ------------------
27350|      0|                    if (call_type == FUNC_CALL_SUPER_CTOR) {
  ------------------
  |  Branch (27350:25): [True: 0, False: 0]
  ------------------
27351|      0|                        emit_op(s, OP_apply);
27352|      0|                        emit_u16(s, 1);
27353|       |                        /* set the 'this' value */
27354|      0|                        emit_op(s, OP_dup);
27355|      0|                        emit_op(s, OP_scope_put_var_init);
27356|      0|                        emit_atom(s, JS_ATOM_this);
27357|      0|                        emit_u16(s, 0);
27358|       |
27359|      0|                        emit_class_field_init(s);
27360|      0|                    } else if (call_type == FUNC_CALL_NEW) {
  ------------------
  |  Branch (27360:32): [True: 0, False: 0]
  ------------------
27361|       |                        /* obj func array -> func obj array */
27362|      0|                        emit_op(s, OP_perm3);
27363|      0|                        emit_op(s, OP_apply);
27364|      0|                        emit_u16(s, 1);
27365|      0|                    } else {
27366|       |                        /* func array -> func undef array */
27367|      0|                        emit_op(s, OP_undefined);
27368|      0|                        emit_op(s, OP_swap);
27369|      0|                        emit_op(s, OP_apply);
27370|      0|                        emit_u16(s, 0);
27371|      0|                    }
27372|      0|                    break;
27373|      0|                }
27374|      5|            } else {
27375|      5|                if (next_token(s))
  ------------------
  |  Branch (27375:21): [True: 0, False: 5]
  ------------------
27376|      0|                    return -1;
27377|      9|            emit_func_call:
27378|      9|                emit_source_pos(s, op_token_ptr);
27379|      9|                switch(opcode) {
27380|      1|                case OP_get_field:
  ------------------
  |  Branch (27380:17): [True: 1, False: 8]
  ------------------
27381|      1|                case OP_scope_get_private_field:
  ------------------
  |  Branch (27381:17): [True: 0, False: 9]
  ------------------
27382|      1|                case OP_get_array_el:
  ------------------
  |  Branch (27382:17): [True: 0, False: 9]
  ------------------
27383|      1|                case OP_scope_get_ref:
  ------------------
  |  Branch (27383:17): [True: 0, False: 9]
  ------------------
27384|      1|                    emit_op(s, OP_call_method);
27385|      1|                    emit_u16(s, arg_count);
27386|      1|                    break;
27387|      0|                case OP_eval:
  ------------------
  |  Branch (27387:17): [True: 0, False: 9]
  ------------------
27388|      0|                    emit_op(s, OP_eval);
27389|      0|                    emit_u16(s, arg_count);
27390|      0|                    emit_u16(s, fd->scope_level);
27391|      0|                    fd->has_eval_call = TRUE;
27392|      0|                    break;
27393|      8|                default:
  ------------------
  |  Branch (27393:17): [True: 8, False: 1]
  ------------------
27394|      8|                    if (call_type == FUNC_CALL_SUPER_CTOR) {
  ------------------
  |  Branch (27394:25): [True: 0, False: 8]
  ------------------
27395|      0|                        emit_op(s, OP_call_constructor);
27396|      0|                        emit_u16(s, arg_count);
27397|       |
27398|       |                        /* set the 'this' value */
27399|      0|                        emit_op(s, OP_dup);
27400|      0|                        emit_op(s, OP_scope_put_var_init);
27401|      0|                        emit_atom(s, JS_ATOM_this);
27402|      0|                        emit_u16(s, 0);
27403|       |
27404|      0|                        emit_class_field_init(s);
27405|      8|                    } else if (call_type == FUNC_CALL_NEW) {
  ------------------
  |  Branch (27405:32): [True: 0, False: 8]
  ------------------
27406|      0|                        emit_op(s, OP_call_constructor);
27407|      0|                        emit_u16(s, arg_count);
27408|      8|                    } else {
27409|      8|                        emit_op(s, OP_call);
27410|      8|                        emit_u16(s, arg_count);
27411|      8|                    }
27412|      8|                    break;
27413|      9|                }
27414|      9|            }
27415|      9|            call_type = FUNC_CALL_NORMAL;
27416|    145|        } else if (s->token.val == '.') {
  ------------------
  |  Branch (27416:20): [True: 24, False: 121]
  ------------------
27417|     24|            op_token_ptr = s->token.ptr;
27418|     24|            if (next_token(s))
  ------------------
  |  Branch (27418:17): [True: 0, False: 24]
  ------------------
27419|      0|                return -1;
27420|     24|        parse_property:
27421|     24|            emit_source_pos(s, op_token_ptr);
27422|     24|            if (s->token.val == TOK_PRIVATE_NAME) {
  ------------------
  |  Branch (27422:17): [True: 0, False: 24]
  ------------------
27423|       |                /* private class field */
27424|      0|                if (get_prev_opcode(fd) == OP_get_super) {
  ------------------
  |  Branch (27424:21): [True: 0, False: 0]
  ------------------
27425|      0|                    return js_parse_error(s, "private class field forbidden after super");
27426|      0|                }
27427|      0|                if (has_optional_chain) {
  ------------------
  |  Branch (27427:21): [True: 0, False: 0]
  ------------------
27428|      0|                    optional_chain_test(s, &optional_chaining_label, 1);
27429|      0|                }
27430|      0|                emit_op(s, OP_scope_get_private_field);
27431|      0|                emit_atom(s, s->token.u.ident.atom);
27432|      0|                emit_u16(s, s->cur_func->scope_level);
27433|     24|            } else {
27434|     24|                if (!token_is_ident(s->token.val)) {
  ------------------
  |  Branch (27434:21): [True: 0, False: 24]
  ------------------
27435|      0|                    return js_parse_error(s, "expecting field name");
27436|      0|                }
27437|     24|                if (get_prev_opcode(fd) == OP_get_super) {
  ------------------
  |  Branch (27437:21): [True: 0, False: 24]
  ------------------
27438|      0|                    JSValue val;
27439|      0|                    int ret;
27440|      0|                    val = JS_AtomToValue(s->ctx, s->token.u.ident.atom);
27441|      0|                    ret = emit_push_const(s, val, 1);
27442|      0|                    JS_FreeValue(s->ctx, val);
27443|      0|                    if (ret)
  ------------------
  |  Branch (27443:25): [True: 0, False: 0]
  ------------------
27444|      0|                        return -1;
27445|      0|                    emit_op(s, OP_get_super_value);
27446|     24|                } else {
27447|     24|                    if (has_optional_chain) {
  ------------------
  |  Branch (27447:25): [True: 0, False: 24]
  ------------------
27448|      0|                        optional_chain_test(s, &optional_chaining_label, 1);
27449|      0|                    }
27450|     24|                    emit_op(s, OP_get_field);
27451|     24|                    emit_atom(s, s->token.u.ident.atom);
27452|     24|                }
27453|     24|            }
27454|     24|            if (next_token(s))
  ------------------
  |  Branch (27454:17): [True: 1, False: 23]
  ------------------
27455|      1|                return -1;
27456|    121|        } else if (s->token.val == '[') {
  ------------------
  |  Branch (27456:20): [True: 0, False: 121]
  ------------------
27457|      0|            int prev_op;
27458|      0|            op_token_ptr = s->token.ptr;
27459|      0|        parse_array_access:
27460|      0|            prev_op = get_prev_opcode(fd);
27461|      0|            if (has_optional_chain) {
  ------------------
  |  Branch (27461:17): [True: 0, False: 0]
  ------------------
27462|      0|                optional_chain_test(s, &optional_chaining_label, 1);
27463|      0|            }
27464|      0|            if (next_token(s))
  ------------------
  |  Branch (27464:17): [True: 0, False: 0]
  ------------------
27465|      0|                return -1;
27466|      0|            if (js_parse_expr(s))
  ------------------
  |  Branch (27466:17): [True: 0, False: 0]
  ------------------
27467|      0|                return -1;
27468|      0|            if (js_parse_expect(s, ']'))
  ------------------
  |  Branch (27468:17): [True: 0, False: 0]
  ------------------
27469|      0|                return -1;
27470|      0|            emit_source_pos(s, op_token_ptr);
27471|      0|            if (prev_op == OP_get_super) {
  ------------------
  |  Branch (27471:17): [True: 0, False: 0]
  ------------------
27472|      0|                emit_op(s, OP_get_super_value);
27473|      0|            } else {
27474|      0|                emit_op(s, OP_get_array_el);
27475|      0|            }
27476|    121|        } else {
27477|    121|            break;
27478|    121|        }
27479|    154|    }
27480|    121|    if (optional_chaining_label >= 0) {
  ------------------
  |  Branch (27480:9): [True: 0, False: 121]
  ------------------
27481|      0|        JSFunctionDef *fd = s->cur_func;
27482|      0|        int opcode;
27483|      0|        emit_label_raw(s, optional_chaining_label);
27484|       |        /* modify the last opcode so that it is an indicator of an
27485|       |           optional chain */
27486|      0|        opcode = get_prev_opcode(fd);
27487|      0|        if (opcode == OP_get_field || opcode == OP_get_array_el) {
  ------------------
  |  Branch (27487:13): [True: 0, False: 0]
  |  Branch (27487:39): [True: 0, False: 0]
  ------------------
27488|      0|            if (opcode == OP_get_field)
  ------------------
  |  Branch (27488:17): [True: 0, False: 0]
  ------------------
27489|      0|                opcode = OP_get_field_opt_chain;
27490|      0|            else
27491|      0|                opcode = OP_get_array_el_opt_chain;
27492|      0|            fd->byte_code.buf[fd->last_opcode_pos] = opcode;
27493|      0|        } else {
27494|      0|            fd->last_opcode_pos = -1;
27495|      0|        }
27496|      0|    }
27497|    121|    return 0;
27498|    122|}
quickjs.c:emit_push_const:
23976|     31|{
23977|     31|    int idx;
23978|       |
23979|     31|    if (JS_VALUE_GET_TAG(val) == JS_TAG_STRING && as_atom) {
  ------------------
  |  |  236|     31|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (23979:9): [True: 24, False: 7]
  |  Branch (23979:51): [True: 24, False: 0]
  ------------------
23980|     24|        JSAtom atom;
23981|       |        /* warning: JS_NewAtomStr frees the string value */
23982|     24|        JS_DupValue(s->ctx, val);
23983|     24|        atom = JS_NewAtomStr(s->ctx, JS_VALUE_GET_STRING(val));
  ------------------
  |  |  230|     24|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     24|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
23984|     24|        if (atom != JS_ATOM_NULL && !__JS_AtomIsTaggedInt(atom)) {
  ------------------
  |  |  451|     48|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (23984:13): [True: 24, False: 0]
  |  Branch (23984:37): [True: 24, False: 0]
  ------------------
23985|     24|            emit_op(s, OP_push_atom_value);
23986|     24|            emit_u32(s, atom);
23987|     24|            return 0;
23988|     24|        }
23989|     24|    }
23990|       |
23991|      7|    idx = cpool_add(s, JS_DupValue(s->ctx, val));
23992|      7|    if (idx < 0)
  ------------------
  |  Branch (23992:9): [True: 0, False: 7]
  ------------------
23993|      0|        return -1;
23994|      7|    emit_op(s, OP_push_const);
23995|      7|    emit_u32(s, idx);
23996|      7|    return 0;
23997|      7|}
quickjs.c:js_parse_template:
24492|     21|{
24493|     21|    JSContext *ctx = s->ctx;
24494|     21|    JSValue raw_array, template_object;
24495|     21|    JSToken cooked;
24496|     21|    int depth, ret;
24497|       |
24498|     21|    raw_array = JS_UNDEFINED; /* avoid warning */
  ------------------
  |  |  291|     21|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     21|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
24499|     21|    template_object = JS_UNDEFINED; /* avoid warning */
  ------------------
  |  |  291|     21|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     21|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
24500|     21|    if (call) {
  ------------------
  |  Branch (24500:9): [True: 4, False: 17]
  ------------------
24501|       |        /* Create a template object: an array of cooked strings */
24502|       |        /* Create an array of raw strings and store it to the raw property */
24503|      4|        template_object = JS_NewArray(ctx);
24504|      4|        if (JS_IsException(template_object))
  ------------------
  |  Branch (24504:13): [True: 0, False: 4]
  ------------------
24505|      0|            return -1;
24506|       |        //        pool_idx = s->cur_func->cpool_count;
24507|      4|        ret = emit_push_const(s, template_object, 0);
24508|      4|        JS_FreeValue(ctx, template_object);
24509|      4|        if (ret)
  ------------------
  |  Branch (24509:13): [True: 0, False: 4]
  ------------------
24510|      0|            return -1;
24511|      4|        raw_array = JS_NewArray(ctx);
24512|      4|        if (JS_IsException(raw_array))
  ------------------
  |  Branch (24512:13): [True: 0, False: 4]
  ------------------
24513|      0|            return -1;
24514|      4|        if (JS_DefinePropertyValue(ctx, template_object, JS_ATOM_raw,
  ------------------
  |  Branch (24514:13): [True: 0, False: 4]
  ------------------
24515|      4|                                   raw_array, JS_PROP_THROW) < 0) {
  ------------------
  |  |  320|      4|#define JS_PROP_THROW            (1 << 14)
  ------------------
24516|      0|            return -1;
24517|      0|        }
24518|      4|    }
24519|       |
24520|     21|    depth = 0;
24521|     21|    while (s->token.val == TOK_TEMPLATE) {
  ------------------
  |  Branch (24521:12): [True: 21, False: 0]
  ------------------
24522|     21|        const uint8_t *p = s->token.ptr + 1;
24523|     21|        cooked = s->token;
24524|     21|        if (call) {
  ------------------
  |  Branch (24524:13): [True: 4, False: 17]
  ------------------
24525|      4|            if (JS_DefinePropertyValueUint32(ctx, raw_array, depth,
  ------------------
  |  Branch (24525:17): [True: 0, False: 4]
  ------------------
24526|      4|                                             JS_DupValue(ctx, s->token.u.str.str),
24527|      4|                                             JS_PROP_ENUMERABLE | JS_PROP_THROW) < 0) {
  ------------------
  |  |  300|      4|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                                                           JS_PROP_ENUMERABLE | JS_PROP_THROW) < 0) {
  ------------------
  |  |  320|      4|#define JS_PROP_THROW            (1 << 14)
  ------------------
24528|      0|                return -1;
24529|      0|            }
24530|       |            /* re-parse the string with escape sequences but do not throw a
24531|       |               syntax error if it contains invalid sequences
24532|       |             */
24533|      4|            if (js_parse_string(s, '`', FALSE, p, &cooked, &p)) {
  ------------------
  |  Branch (24533:17): [True: 0, False: 4]
  ------------------
24534|      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 }
  |  |  ------------------
  ------------------
24535|      0|            }
24536|      4|            if (JS_DefinePropertyValueUint32(ctx, template_object, depth,
  ------------------
  |  Branch (24536:17): [True: 0, False: 4]
  ------------------
24537|      4|                                             cooked.u.str.str,
24538|      4|                                             JS_PROP_ENUMERABLE | JS_PROP_THROW) < 0) {
  ------------------
  |  |  300|      4|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                                                           JS_PROP_ENUMERABLE | JS_PROP_THROW) < 0) {
  ------------------
  |  |  320|      4|#define JS_PROP_THROW            (1 << 14)
  ------------------
24539|      0|                return -1;
24540|      0|            }
24541|     17|        } else {
24542|     17|            JSString *str;
24543|       |            /* re-parse the string with escape sequences and throw a
24544|       |               syntax error if it contains invalid sequences
24545|       |             */
24546|     17|            JS_FreeValue(ctx, s->token.u.str.str);
24547|     17|            s->token.u.str.str = 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 }
  |  |  ------------------
  ------------------
24548|     17|            if (js_parse_string(s, '`', TRUE, p, &cooked, &p))
  ------------------
  |  Branch (24548:17): [True: 0, False: 17]
  ------------------
24549|      0|                return -1;
24550|     17|            str = JS_VALUE_GET_STRING(cooked.u.str.str);
  ------------------
  |  |  230|     17|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     17|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
24551|     17|            if (str->len != 0 || depth == 0) {
  ------------------
  |  Branch (24551:17): [True: 15, False: 2]
  |  Branch (24551:34): [True: 2, False: 0]
  ------------------
24552|     17|                ret = emit_push_const(s, cooked.u.str.str, 1);
24553|     17|                JS_FreeValue(s->ctx, cooked.u.str.str);
24554|     17|                if (ret)
  ------------------
  |  Branch (24554:21): [True: 0, False: 17]
  ------------------
24555|      0|                    return -1;
24556|     17|                if (depth == 0) {
  ------------------
  |  Branch (24556:21): [True: 17, False: 0]
  ------------------
24557|     17|                    if (s->token.u.str.sep == '`')
  ------------------
  |  Branch (24557:25): [True: 17, False: 0]
  ------------------
24558|     17|                        goto done1;
24559|      0|                    emit_op(s, OP_get_field2);
24560|      0|                    emit_atom(s, JS_ATOM_concat);
24561|      0|                }
24562|      0|                depth++;
24563|      0|            } else {
24564|      0|                JS_FreeValue(s->ctx, cooked.u.str.str);
24565|      0|            }
24566|     17|        }
24567|      4|        if (s->token.u.str.sep == '`')
  ------------------
  |  Branch (24567:13): [True: 4, False: 0]
  ------------------
24568|      4|            goto done;
24569|      0|        if (next_token(s))
  ------------------
  |  Branch (24569:13): [True: 0, False: 0]
  ------------------
24570|      0|            return -1;
24571|      0|        if (js_parse_expr(s))
  ------------------
  |  Branch (24571:13): [True: 0, False: 0]
  ------------------
24572|      0|            return -1;
24573|      0|        depth++;
24574|      0|        if (s->token.val != '}') {
  ------------------
  |  Branch (24574:13): [True: 0, False: 0]
  ------------------
24575|      0|            return js_parse_error(s, "expected '}' after template expression");
24576|      0|        }
24577|       |        /* XXX: should convert to string at this stage? */
24578|      0|        free_token(s, &s->token);
24579|       |        /* Resume TOK_TEMPLATE parsing (s->token.line_num and
24580|       |         * s->token.ptr are OK) */
24581|      0|        s->got_lf = FALSE;
24582|      0|        if (js_parse_template_part(s, s->buf_ptr))
  ------------------
  |  Branch (24582:13): [True: 0, False: 0]
  ------------------
24583|      0|            return -1;
24584|      0|    }
24585|      0|    return js_parse_expect(s, TOK_TEMPLATE);
24586|       |
24587|      4| done:
24588|      4|    if (call) {
  ------------------
  |  Branch (24588:9): [True: 4, False: 0]
  ------------------
24589|       |        /* Seal the objects */
24590|      4|        seal_template_obj(ctx, raw_array);
24591|      4|        seal_template_obj(ctx, template_object);
24592|      4|        *argc = depth + 1;
24593|      4|    } else {
24594|      0|        emit_op(s, OP_call_method);
24595|      0|        emit_u16(s, depth - 1);
24596|      0|    }
24597|     21| done1:
24598|     21|    return next_token(s);
24599|      4|}
quickjs.c:seal_template_obj:
24476|      8|{
24477|      8|    JSObject *p;
24478|      8|    JSShapeProperty *prs;
24479|       |
24480|      8|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  229|      8|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      8|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
24481|      8|    prs = find_own_property1(p, JS_ATOM_length);
24482|      8|    if (prs) {
  ------------------
  |  Branch (24482:9): [True: 8, False: 0]
  ------------------
24483|      8|        if (js_update_property_flags(ctx, p, &prs,
  ------------------
  |  Branch (24483:13): [True: 0, False: 8]
  ------------------
24484|      8|                                     prs->flags & ~(JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE)))
  ------------------
  |  |  298|      8|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                                   prs->flags & ~(JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE)))
  ------------------
  |  |  299|      8|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
24485|      0|            return -1;
24486|      8|    }
24487|      8|    p->extensible = FALSE;
24488|      8|    return 0;
24489|      8|}
quickjs.c:pop_scope:
24152|     11|static void pop_scope(JSParseState *s) {
24153|     11|    if (s->cur_func) {
  ------------------
  |  Branch (24153:9): [True: 11, False: 0]
  ------------------
24154|       |        /* disable scoped variables */
24155|     11|        JSFunctionDef *fd = s->cur_func;
24156|     11|        int scope = fd->scope_level;
24157|     11|        emit_op(s, OP_leave_scope);
24158|     11|        emit_u16(s, scope);
24159|     11|        fd->scope_level = fd->scopes[scope].parent;
24160|     11|        fd->scope_first = get_first_lexical_var(fd, fd->scope_level);
24161|     11|    }
24162|     11|}
quickjs.c:get_first_lexical_var:
24142|     11|{
24143|     41|    while (scope >= 0) {
  ------------------
  |  Branch (24143:12): [True: 30, False: 11]
  ------------------
24144|     30|        int scope_idx = fd->scopes[scope].first;
24145|     30|        if (scope_idx >= 0)
  ------------------
  |  Branch (24145:13): [True: 0, False: 30]
  ------------------
24146|      0|            return scope_idx;
24147|     30|        scope = fd->scopes[scope].parent;
24148|     30|    }
24149|     11|    return -1;
24150|     11|}
quickjs.c:js_parse_expect_semi:
22379|     80|{
22380|     80|    if (s->token.val != ';') {
  ------------------
  |  Branch (22380:9): [True: 36, False: 44]
  ------------------
22381|       |        /* automatic insertion of ';' */
22382|     36|        if (s->token.val == TOK_EOF || s->token.val == '}' || s->got_lf) {
  ------------------
  |  Branch (22382:13): [True: 7, False: 29]
  |  Branch (22382:40): [True: 0, False: 29]
  |  Branch (22382:63): [True: 28, False: 1]
  ------------------
22383|     35|            return 0;
22384|     35|        }
22385|      1|        return js_parse_error(s, "expecting '%c'", ';');
22386|     36|    }
22387|     44|    return next_token(s);
22388|     80|}
quickjs.c:emit_source_pos:
23853|    200|{
23854|    200|    JSFunctionDef *fd = s->cur_func;
23855|    200|    DynBuf *bc = &fd->byte_code;
23856|       |
23857|    200|    if (unlikely(fd->last_opcode_source_ptr != source_ptr)) {
  ------------------
  |  |   33|    200|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 146, False: 54]
  |  |  ------------------
  ------------------
23858|    146|        dbuf_putc(bc, OP_line_num);
23859|    146|        dbuf_put_u32(bc, source_ptr - s->buf_start);
23860|    146|        fd->last_opcode_source_ptr = source_ptr;
23861|    146|    }
23862|    200|}
quickjs.c:get_prev_opcode:
23809|    130|static inline int get_prev_opcode(JSFunctionDef *fd) {
23810|    130|    if (fd->last_opcode_pos < 0 || dbuf_error(&fd->byte_code))
  ------------------
  |  Branch (23810:9): [True: 0, False: 130]
  |  Branch (23810:36): [True: 0, False: 130]
  ------------------
23811|      0|        return OP_invalid;
23812|    130|    else
23813|    130|        return fd->byte_code.buf[fd->last_opcode_pos];
23814|    130|}
quickjs.c:has_with_scope:
25914|     18|{
25915|     56|    while (s) {
  ------------------
  |  Branch (25915:12): [True: 38, False: 18]
  ------------------
25916|       |        /* no with in strict mode */
25917|     38|        if (!(s->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  403|     38|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (25917:13): [True: 38, False: 0]
  ------------------
25918|     38|            int scope_idx = s->scopes[scope_level].first;
25919|     48|            while (scope_idx >= 0) {
  ------------------
  |  Branch (25919:20): [True: 10, False: 38]
  ------------------
25920|     10|                JSVarDef *vd = &s->vars[scope_idx];
25921|     10|                if (vd->var_name == JS_ATOM__with_)
  ------------------
  |  Branch (25921:21): [True: 0, False: 10]
  ------------------
25922|      0|                    return TRUE;
25923|     10|                scope_idx = vd->scope_next;
25924|     10|            }
25925|     38|        }
25926|       |        /* check parent scopes */
25927|     38|        scope_level = s->parent_scope_level;
25928|     38|        s = s->parent;
25929|     38|    }
25930|     18|    return FALSE;
25931|     18|}
quickjs.c:token_is_ident:
24613|     48|{
24614|       |    /* Accept keywords and reserved words as property names */
24615|     48|    return (tok == TOK_IDENT ||
  ------------------
  |  Branch (24615:13): [True: 46, False: 2]
  ------------------
24616|      2|            (tok >= TOK_FIRST_KEYWORD &&
  ------------------
  |  |21882|      4|#define TOK_FIRST_KEYWORD   TOK_NULL
  ------------------
  |  Branch (24616:14): [True: 0, False: 2]
  ------------------
24617|      0|             tok <= TOK_LAST_KEYWORD));
  ------------------
  |  |21883|      0|#define TOK_LAST_KEYWORD    TOK_AWAIT
  ------------------
  |  Branch (24617:14): [True: 0, False: 0]
  ------------------
24618|     48|}
quickjs.c:js_parse_expr:
28314|     73|{
28315|     73|    return js_parse_expr2(s, PF_IN_ACCEPTED);
  ------------------
  |  |25085|     73|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
28316|     73|}
quickjs.c:js_parse_expr2:
28290|     73|{
28291|     73|    BOOL comma = FALSE;
28292|     76|    for(;;) {
28293|     76|        if (js_parse_assign_expr2(s, parse_flags))
  ------------------
  |  Branch (28293:13): [True: 2, False: 74]
  ------------------
28294|      2|            return -1;
28295|     74|        if (comma) {
  ------------------
  |  Branch (28295:13): [True: 3, False: 71]
  ------------------
28296|       |            /* prevent get_lvalue from using the last expression
28297|       |               as an lvalue. This also prevents the conversion of
28298|       |               of get_var to get_ref for method lookup in function
28299|       |               call inside `with` statement.
28300|       |             */
28301|      3|            s->cur_func->last_opcode_pos = -1;
28302|      3|        }
28303|     74|        if (s->token.val != ',')
  ------------------
  |  Branch (28303:13): [True: 71, False: 3]
  ------------------
28304|     71|            break;
28305|      3|        comma = TRUE;
28306|      3|        if (next_token(s))
  ------------------
  |  Branch (28306:13): [True: 0, False: 3]
  ------------------
28307|      0|            return -1;
28308|      3|        emit_op(s, OP_drop);
28309|      3|    }
28310|     71|    return 0;
28311|     73|}
quickjs.c:js_parse_assign_expr2:
28000|    116|{
28001|    116|    int opcode, op, scope, skip_bits;
28002|    116|    JSAtom name0 = JS_ATOM_NULL;
  ------------------
  |  |  451|    116|#define JS_ATOM_NULL 0
  ------------------
28003|    116|    JSAtom name;
28004|       |
28005|    116|    if (s->token.val == TOK_YIELD) {
  ------------------
  |  Branch (28005:9): [True: 0, False: 116]
  ------------------
28006|      0|        BOOL is_star = FALSE, is_async;
28007|       |
28008|      0|        if (!(s->cur_func->func_kind & JS_FUNC_GENERATOR))
  ------------------
  |  Branch (28008:13): [True: 0, False: 0]
  ------------------
28009|      0|            return js_parse_error(s, "unexpected 'yield' keyword");
28010|      0|        if (!s->cur_func->in_function_body)
  ------------------
  |  Branch (28010:13): [True: 0, False: 0]
  ------------------
28011|      0|            return js_parse_error(s, "yield in default expression");
28012|      0|        if (next_token(s))
  ------------------
  |  Branch (28012:13): [True: 0, False: 0]
  ------------------
28013|      0|            return -1;
28014|       |        /* XXX: is there a better method to detect 'yield' without
28015|       |           parameters ? */
28016|      0|        if (s->token.val != ';' && s->token.val != ')' &&
  ------------------
  |  Branch (28016:13): [True: 0, False: 0]
  |  Branch (28016:36): [True: 0, False: 0]
  ------------------
28017|      0|            s->token.val != ']' && s->token.val != '}' &&
  ------------------
  |  Branch (28017:13): [True: 0, False: 0]
  |  Branch (28017:36): [True: 0, False: 0]
  ------------------
28018|      0|            s->token.val != ',' && s->token.val != ':' && !s->got_lf) {
  ------------------
  |  Branch (28018:13): [True: 0, False: 0]
  |  Branch (28018:36): [True: 0, False: 0]
  |  Branch (28018:59): [True: 0, False: 0]
  ------------------
28019|      0|            if (s->token.val == '*') {
  ------------------
  |  Branch (28019:17): [True: 0, False: 0]
  ------------------
28020|      0|                is_star = TRUE;
28021|      0|                if (next_token(s))
  ------------------
  |  Branch (28021:21): [True: 0, False: 0]
  ------------------
28022|      0|                    return -1;
28023|      0|            }
28024|      0|            if (js_parse_assign_expr2(s, parse_flags))
  ------------------
  |  Branch (28024:17): [True: 0, False: 0]
  ------------------
28025|      0|                return -1;
28026|      0|        } else {
28027|      0|            emit_op(s, OP_undefined);
28028|      0|        }
28029|      0|        is_async = (s->cur_func->func_kind == JS_FUNC_ASYNC_GENERATOR);
28030|       |
28031|      0|        if (is_star) {
  ------------------
  |  Branch (28031:13): [True: 0, False: 0]
  ------------------
28032|      0|            int label_loop, label_return, label_next;
28033|      0|            int label_return1, label_yield, label_throw, label_throw1;
28034|      0|            int label_throw2;
28035|       |
28036|      0|            label_loop = new_label(s);
28037|      0|            label_yield = new_label(s);
28038|       |
28039|      0|            emit_op(s, is_async ? OP_for_await_of_start : OP_for_of_start);
  ------------------
  |  Branch (28039:24): [True: 0, False: 0]
  ------------------
28040|       |
28041|       |            /* remove the catch offset (XXX: could avoid pushing back
28042|       |               undefined) */
28043|      0|            emit_op(s, OP_drop);
28044|      0|            emit_op(s, OP_undefined);
28045|       |
28046|      0|            emit_op(s, OP_undefined); /* initial value */
28047|       |
28048|      0|            emit_label(s, label_loop);
28049|      0|            emit_op(s, OP_iterator_next);
28050|      0|            if (is_async)
  ------------------
  |  Branch (28050:17): [True: 0, False: 0]
  ------------------
28051|      0|                emit_op(s, OP_await);
28052|      0|            emit_op(s, OP_iterator_check_object);
28053|      0|            emit_op(s, OP_get_field2);
28054|      0|            emit_atom(s, JS_ATOM_done);
28055|      0|            label_next = emit_goto(s, OP_if_true, -1); /* end of loop */
28056|      0|            emit_label(s, label_yield);
28057|      0|            if (is_async) {
  ------------------
  |  Branch (28057:17): [True: 0, False: 0]
  ------------------
28058|       |                /* OP_async_yield_star takes the value as parameter */
28059|      0|                emit_op(s, OP_get_field);
28060|      0|                emit_atom(s, JS_ATOM_value);
28061|      0|                emit_op(s, OP_async_yield_star);
28062|      0|            } else {
28063|       |                /* OP_yield_star takes (value, done) as parameter */
28064|      0|                emit_op(s, OP_yield_star);
28065|      0|            }
28066|      0|            emit_op(s, OP_dup);
28067|      0|            label_return = emit_goto(s, OP_if_true, -1);
28068|      0|            emit_op(s, OP_drop);
28069|      0|            emit_goto(s, OP_goto, label_loop);
28070|       |
28071|      0|            emit_label(s, label_return);
28072|      0|            emit_op(s, OP_push_i32);
28073|      0|            emit_u32(s, 2);
28074|      0|            emit_op(s, OP_strict_eq);
28075|      0|            label_throw = emit_goto(s, OP_if_true, -1);
28076|       |
28077|       |            /* return handling */
28078|      0|            if (is_async)
  ------------------
  |  Branch (28078:17): [True: 0, False: 0]
  ------------------
28079|      0|                emit_op(s, OP_await);
28080|      0|            emit_op(s, OP_iterator_call);
28081|      0|            emit_u8(s, 0);
28082|      0|            label_return1 = emit_goto(s, OP_if_true, -1);
28083|      0|            if (is_async)
  ------------------
  |  Branch (28083:17): [True: 0, False: 0]
  ------------------
28084|      0|                emit_op(s, OP_await);
28085|      0|            emit_op(s, OP_iterator_check_object);
28086|      0|            emit_op(s, OP_get_field2);
28087|      0|            emit_atom(s, JS_ATOM_done);
28088|      0|            emit_goto(s, OP_if_false, label_yield);
28089|       |
28090|      0|            emit_op(s, OP_get_field);
28091|      0|            emit_atom(s, JS_ATOM_value);
28092|       |
28093|      0|            emit_label(s, label_return1);
28094|      0|            emit_op(s, OP_nip);
28095|      0|            emit_op(s, OP_nip);
28096|      0|            emit_op(s, OP_nip);
28097|      0|            emit_return(s, TRUE);
28098|       |
28099|       |            /* throw handling */
28100|      0|            emit_label(s, label_throw);
28101|      0|            emit_op(s, OP_iterator_call);
28102|      0|            emit_u8(s, 1);
28103|      0|            label_throw1 = emit_goto(s, OP_if_true, -1);
28104|      0|            if (is_async)
  ------------------
  |  Branch (28104:17): [True: 0, False: 0]
  ------------------
28105|      0|                emit_op(s, OP_await);
28106|      0|            emit_op(s, OP_iterator_check_object);
28107|      0|            emit_op(s, OP_get_field2);
28108|      0|            emit_atom(s, JS_ATOM_done);
28109|      0|            emit_goto(s, OP_if_false, label_yield);
28110|      0|            emit_goto(s, OP_goto, label_next);
28111|       |            /* close the iterator and throw a type error exception */
28112|      0|            emit_label(s, label_throw1);
28113|      0|            emit_op(s, OP_iterator_call);
28114|      0|            emit_u8(s, 2);
28115|      0|            label_throw2 = emit_goto(s, OP_if_true, -1);
28116|      0|            if (is_async)
  ------------------
  |  Branch (28116:17): [True: 0, False: 0]
  ------------------
28117|      0|                emit_op(s, OP_await);
28118|      0|            emit_label(s, label_throw2);
28119|       |
28120|      0|            emit_op(s, OP_throw_error);
28121|      0|            emit_atom(s, JS_ATOM_NULL);
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
28122|      0|            emit_u8(s, JS_THROW_ERROR_ITERATOR_THROW);
  ------------------
  |  |18337|      0|#define JS_THROW_ERROR_ITERATOR_THROW 4
  ------------------
28123|       |
28124|      0|            emit_label(s, label_next);
28125|      0|            emit_op(s, OP_get_field);
28126|      0|            emit_atom(s, JS_ATOM_value);
28127|      0|            emit_op(s, OP_nip); /* keep the value associated with
28128|       |                                   done = true */
28129|      0|            emit_op(s, OP_nip);
28130|      0|            emit_op(s, OP_nip);
28131|      0|        } else {
28132|      0|            int label_next;
28133|       |
28134|      0|            if (is_async)
  ------------------
  |  Branch (28134:17): [True: 0, False: 0]
  ------------------
28135|      0|                emit_op(s, OP_await);
28136|      0|            emit_op(s, OP_yield);
28137|      0|            label_next = emit_goto(s, OP_if_false, -1);
28138|      0|            emit_return(s, TRUE);
28139|      0|            emit_label(s, label_next);
28140|      0|        }
28141|      0|        return 0;
28142|    116|    } else if (s->token.val == '(' &&
  ------------------
  |  Branch (28142:16): [True: 2, False: 114]
  ------------------
28143|      2|               js_parse_skip_parens_token(s, NULL, TRUE) == TOK_ARROW) {
  ------------------
  |  Branch (28143:16): [True: 2, False: 0]
  ------------------
28144|      2|        return js_parse_function_decl(s, JS_PARSE_FUNC_ARROW,
28145|      2|                                      JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
28146|      2|                                      s->token.ptr);
28147|    114|    } else if (token_is_pseudo_keyword(s, JS_ATOM_async)) {
  ------------------
  |  Branch (28147:16): [True: 0, False: 114]
  ------------------
28148|      0|        const uint8_t *source_ptr;
28149|      0|        int tok;
28150|      0|        JSParsePos pos;
28151|       |
28152|       |        /* fast test */
28153|      0|        tok = peek_token(s, TRUE);
28154|      0|        if (tok == TOK_FUNCTION || tok == '\n')
  ------------------
  |  Branch (28154:13): [True: 0, False: 0]
  |  Branch (28154:36): [True: 0, False: 0]
  ------------------
28155|      0|            goto next;
28156|       |
28157|      0|        source_ptr = s->token.ptr;
28158|      0|        js_parse_get_pos(s, &pos);
28159|      0|        if (next_token(s))
  ------------------
  |  Branch (28159:13): [True: 0, False: 0]
  ------------------
28160|      0|            return -1;
28161|      0|        if ((s->token.val == '(' &&
  ------------------
  |  Branch (28161:14): [True: 0, False: 0]
  ------------------
28162|      0|             js_parse_skip_parens_token(s, NULL, TRUE) == TOK_ARROW) ||
  ------------------
  |  Branch (28162:14): [True: 0, False: 0]
  ------------------
28163|      0|            (s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved &&
  ------------------
  |  Branch (28163:14): [True: 0, False: 0]
  |  Branch (28163:43): [True: 0, False: 0]
  ------------------
28164|      0|             peek_token(s, TRUE) == TOK_ARROW)) {
  ------------------
  |  Branch (28164:14): [True: 0, False: 0]
  ------------------
28165|      0|            return js_parse_function_decl(s, JS_PARSE_FUNC_ARROW,
28166|      0|                                          JS_FUNC_ASYNC, JS_ATOM_NULL,
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
28167|      0|                                          source_ptr);
28168|      0|        } else {
28169|       |            /* undo the token parsing */
28170|      0|            if (js_parse_seek_token(s, &pos))
  ------------------
  |  Branch (28170:17): [True: 0, False: 0]
  ------------------
28171|      0|                return -1;
28172|      0|        }
28173|    114|    } else if (s->token.val == TOK_IDENT &&
  ------------------
  |  Branch (28173:16): [True: 86, False: 28]
  ------------------
28174|     86|               peek_token(s, TRUE) == TOK_ARROW) {
  ------------------
  |  Branch (28174:16): [True: 0, False: 86]
  ------------------
28175|      0|        return js_parse_function_decl(s, JS_PARSE_FUNC_ARROW,
28176|      0|                                      JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
28177|      0|                                      s->token.ptr);
28178|    114|    } else if ((s->token.val == '{' || s->token.val == '[') &&
  ------------------
  |  Branch (28178:17): [True: 0, False: 114]
  |  Branch (28178:40): [True: 0, False: 114]
  ------------------
28179|      0|               js_parse_skip_parens_token(s, &skip_bits, FALSE) == '=') {
  ------------------
  |  Branch (28179:16): [True: 0, False: 0]
  ------------------
28180|      0|        if (js_parse_destructuring_element(s, 0, 0, FALSE, skip_bits & SKIP_HAS_ELLIPSIS, TRUE, FALSE) < 0)
  ------------------
  |  |24783|      0|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
  |  Branch (28180:13): [True: 0, False: 0]
  ------------------
28181|      0|            return -1;
28182|      0|        return 0;
28183|      0|    }
28184|    114| next:
28185|    114|    if (s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (28185:9): [True: 86, False: 28]
  ------------------
28186|       |        /* name0 is used to check for OP_set_name pattern, not duplicated */
28187|     86|        name0 = s->token.u.ident.atom;
28188|     86|    }
28189|    114|    if (js_parse_cond_expr(s, parse_flags))
  ------------------
  |  Branch (28189:9): [True: 2, False: 112]
  ------------------
28190|      2|        return -1;
28191|       |
28192|    112|    op = s->token.val;
28193|    112|    if (op == '=' || (op >= TOK_MUL_ASSIGN && op <= TOK_POW_ASSIGN)) {
  ------------------
  |  Branch (28193:9): [True: 30, False: 82]
  |  Branch (28193:23): [True: 61, False: 21]
  |  Branch (28193:47): [True: 2, False: 59]
  ------------------
28194|     32|        int label;
28195|     32|        const uint8_t *op_token_ptr;
28196|     32|        op_token_ptr = s->token.ptr;
28197|     32|        if (next_token(s))
  ------------------
  |  Branch (28197:13): [True: 0, False: 32]
  ------------------
28198|      0|            return -1;
28199|     32|        if (get_lvalue(s, &opcode, &scope, &name, &label, NULL, (op != '='), op) < 0)
  ------------------
  |  Branch (28199:13): [True: 0, False: 32]
  ------------------
28200|      0|            return -1;
28201|       |
28202|     32|        if (js_parse_assign_expr2(s, parse_flags)) {
  ------------------
  |  Branch (28202:13): [True: 0, False: 32]
  ------------------
28203|      0|            JS_FreeAtom(s->ctx, name);
28204|      0|            return -1;
28205|      0|        }
28206|       |
28207|     32|        if (op == '=') {
  ------------------
  |  Branch (28207:13): [True: 30, False: 2]
  ------------------
28208|     30|            if ((opcode == OP_get_ref_value || opcode == OP_scope_get_var) && name == name0) {
  ------------------
  |  Branch (28208:18): [True: 0, False: 30]
  |  Branch (28208:48): [True: 8, False: 22]
  |  Branch (28208:79): [True: 8, False: 0]
  ------------------
28209|      8|                set_object_name(s, name);
28210|      8|            }
28211|     30|        } else {
28212|      2|            static const uint8_t assign_opcodes[] = {
28213|      2|                OP_mul, OP_div, OP_mod, OP_add, OP_sub,
28214|      2|                OP_shl, OP_sar, OP_shr, OP_and, OP_xor, OP_or,
28215|      2|                OP_pow,
28216|      2|            };
28217|      2|            op = assign_opcodes[op - TOK_MUL_ASSIGN];
28218|      2|            emit_source_pos(s, op_token_ptr);
28219|      2|            emit_op(s, op);
28220|      2|        }
28221|     32|        put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_KEEP_TOP, FALSE);
28222|     80|    } else if (op >= TOK_LAND_ASSIGN && op <= TOK_DOUBLE_QUESTION_MARK_ASSIGN) {
  ------------------
  |  Branch (28222:16): [True: 59, False: 21]
  |  Branch (28222:41): [True: 0, False: 59]
  ------------------
28223|      0|        int label, label1, depth_lvalue, label2;
28224|       |
28225|      0|        if (next_token(s))
  ------------------
  |  Branch (28225:13): [True: 0, False: 0]
  ------------------
28226|      0|            return -1;
28227|      0|        if (get_lvalue(s, &opcode, &scope, &name, &label,
  ------------------
  |  Branch (28227:13): [True: 0, False: 0]
  ------------------
28228|      0|                       &depth_lvalue, TRUE, op) < 0)
28229|      0|            return -1;
28230|       |
28231|      0|        emit_op(s, OP_dup);
28232|      0|        if (op == TOK_DOUBLE_QUESTION_MARK_ASSIGN)
  ------------------
  |  Branch (28232:13): [True: 0, False: 0]
  ------------------
28233|      0|            emit_op(s, OP_is_undefined_or_null);
28234|      0|        label1 = emit_goto(s, op == TOK_LOR_ASSIGN ? OP_if_true : OP_if_false,
  ------------------
  |  Branch (28234:31): [True: 0, False: 0]
  ------------------
28235|      0|                           -1);
28236|      0|        emit_op(s, OP_drop);
28237|       |
28238|      0|        if (js_parse_assign_expr2(s, parse_flags)) {
  ------------------
  |  Branch (28238:13): [True: 0, False: 0]
  ------------------
28239|      0|            JS_FreeAtom(s->ctx, name);
28240|      0|            return -1;
28241|      0|        }
28242|       |
28243|      0|        if ((opcode == OP_get_ref_value || opcode == OP_scope_get_var) && name == name0) {
  ------------------
  |  Branch (28243:14): [True: 0, False: 0]
  |  Branch (28243:44): [True: 0, False: 0]
  |  Branch (28243:75): [True: 0, False: 0]
  ------------------
28244|      0|            set_object_name(s, name);
28245|      0|        }
28246|       |
28247|      0|        switch(depth_lvalue) {
28248|      0|        case 0:
  ------------------
  |  Branch (28248:9): [True: 0, False: 0]
  ------------------
28249|      0|            emit_op(s, OP_dup);
28250|      0|            break;
28251|      0|        case 1:
  ------------------
  |  Branch (28251:9): [True: 0, False: 0]
  ------------------
28252|      0|            emit_op(s, OP_insert2);
28253|      0|            break;
28254|      0|        case 2:
  ------------------
  |  Branch (28254:9): [True: 0, False: 0]
  ------------------
28255|      0|            emit_op(s, OP_insert3);
28256|      0|            break;
28257|      0|        case 3:
  ------------------
  |  Branch (28257:9): [True: 0, False: 0]
  ------------------
28258|      0|            emit_op(s, OP_insert4);
28259|      0|            break;
28260|      0|        default:
  ------------------
  |  Branch (28260:9): [True: 0, False: 0]
  ------------------
28261|      0|            abort();
28262|      0|        }
28263|       |
28264|       |        /* XXX: we disable the OP_put_ref_value optimization by not
28265|       |           using put_lvalue() otherwise depth_lvalue is not correct */
28266|      0|        put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_NOKEEP_DEPTH,
28267|      0|                   FALSE);
28268|      0|        label2 = emit_goto(s, OP_goto, -1);
28269|       |
28270|      0|        emit_label(s, label1);
28271|       |
28272|       |        /* remove the lvalue stack entries */
28273|      0|        while (depth_lvalue != 0) {
  ------------------
  |  Branch (28273:16): [True: 0, False: 0]
  ------------------
28274|      0|            emit_op(s, OP_nip);
28275|      0|            depth_lvalue--;
28276|      0|        }
28277|       |
28278|      0|        emit_label(s, label2);
28279|      0|    }
28280|    112|    return 0;
28281|    112|}
quickjs.c:js_parse_cond_expr:
27971|    114|{
27972|    114|    int label1, label2;
27973|       |
27974|    114|    if (js_parse_coalesce_expr(s, parse_flags))
  ------------------
  |  Branch (27974:9): [True: 2, False: 112]
  ------------------
27975|      2|        return -1;
27976|    112|    if (s->token.val == '?') {
  ------------------
  |  Branch (27976:9): [True: 0, False: 112]
  ------------------
27977|      0|        if (next_token(s))
  ------------------
  |  Branch (27977:13): [True: 0, False: 0]
  ------------------
27978|      0|            return -1;
27979|      0|        label1 = emit_goto(s, OP_if_false, -1);
27980|       |
27981|      0|        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (27981:13): [True: 0, False: 0]
  ------------------
27982|      0|            return -1;
27983|      0|        if (js_parse_expect(s, ':'))
  ------------------
  |  Branch (27983:13): [True: 0, False: 0]
  ------------------
27984|      0|            return -1;
27985|       |
27986|      0|        label2 = emit_goto(s, OP_goto, -1);
27987|       |
27988|      0|        emit_label(s, label1);
27989|       |
27990|      0|        if (js_parse_assign_expr2(s, parse_flags & PF_IN_ACCEPTED))
  ------------------
  |  |25085|      0|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
  |  Branch (27990:13): [True: 0, False: 0]
  ------------------
27991|      0|            return -1;
27992|       |
27993|      0|        emit_label(s, label2);
27994|      0|    }
27995|    112|    return 0;
27996|    112|}
quickjs.c:js_parse_coalesce_expr:
27943|    114|{
27944|    114|    int label1;
27945|       |
27946|    114|    if (js_parse_logical_and_or(s, TOK_LOR, parse_flags))
  ------------------
  |  Branch (27946:9): [True: 2, False: 112]
  ------------------
27947|      2|        return -1;
27948|    112|    if (s->token.val == TOK_DOUBLE_QUESTION_MARK) {
  ------------------
  |  Branch (27948:9): [True: 0, False: 112]
  ------------------
27949|      0|        label1 = new_label(s);
27950|      0|        for(;;) {
27951|      0|            if (next_token(s))
  ------------------
  |  Branch (27951:17): [True: 0, False: 0]
  ------------------
27952|      0|                return -1;
27953|       |
27954|      0|            emit_op(s, OP_dup);
27955|      0|            emit_op(s, OP_is_undefined_or_null);
27956|      0|            emit_goto(s, OP_if_false, label1);
27957|      0|            emit_op(s, OP_drop);
27958|       |
27959|      0|            if (js_parse_expr_binary(s, 8, parse_flags))
  ------------------
  |  Branch (27959:17): [True: 0, False: 0]
  ------------------
27960|      0|                return -1;
27961|      0|            if (s->token.val != TOK_DOUBLE_QUESTION_MARK)
  ------------------
  |  Branch (27961:17): [True: 0, False: 0]
  ------------------
27962|      0|                break;
27963|      0|        }
27964|      0|        emit_label(s, label1);
27965|      0|    }
27966|    112|    return 0;
27967|    112|}
quickjs.c:js_parse_logical_and_or:
27902|    228|{
27903|    228|    int label1;
27904|       |
27905|    228|    if (op == TOK_LAND) {
  ------------------
  |  Branch (27905:9): [True: 114, False: 114]
  ------------------
27906|    114|        if (js_parse_expr_binary(s, 8, parse_flags))
  ------------------
  |  Branch (27906:13): [True: 2, False: 112]
  ------------------
27907|      2|            return -1;
27908|    114|    } else {
27909|    114|        if (js_parse_logical_and_or(s, TOK_LAND, parse_flags))
  ------------------
  |  Branch (27909:13): [True: 2, False: 112]
  ------------------
27910|      2|            return -1;
27911|    114|    }
27912|    224|    if (s->token.val == op) {
  ------------------
  |  Branch (27912:9): [True: 0, False: 224]
  ------------------
27913|      0|        label1 = new_label(s);
27914|       |
27915|      0|        for(;;) {
27916|      0|            if (next_token(s))
  ------------------
  |  Branch (27916:17): [True: 0, False: 0]
  ------------------
27917|      0|                return -1;
27918|      0|            emit_op(s, OP_dup);
27919|      0|            emit_goto(s, op == TOK_LAND ? OP_if_false : OP_if_true, label1);
  ------------------
  |  Branch (27919:26): [True: 0, False: 0]
  ------------------
27920|      0|            emit_op(s, OP_drop);
27921|       |
27922|      0|            if (op == TOK_LAND) {
  ------------------
  |  Branch (27922:17): [True: 0, False: 0]
  ------------------
27923|      0|                if (js_parse_expr_binary(s, 8, parse_flags))
  ------------------
  |  Branch (27923:21): [True: 0, False: 0]
  ------------------
27924|      0|                    return -1;
27925|      0|            } else {
27926|      0|                if (js_parse_logical_and_or(s, TOK_LAND,
  ------------------
  |  Branch (27926:21): [True: 0, False: 0]
  ------------------
27927|      0|                                            parse_flags))
27928|      0|                    return -1;
27929|      0|            }
27930|      0|            if (s->token.val != op) {
  ------------------
  |  Branch (27930:17): [True: 0, False: 0]
  ------------------
27931|      0|                if (s->token.val == TOK_DOUBLE_QUESTION_MARK)
  ------------------
  |  Branch (27931:21): [True: 0, False: 0]
  ------------------
27932|      0|                    return js_parse_error(s, "cannot mix ?? with && or ||");
27933|      0|                break;
27934|      0|            }
27935|      0|        }
27936|       |
27937|      0|        emit_label(s, label1);
27938|      0|    }
27939|    224|    return 0;
27940|    224|}
quickjs.c:js_parse_expr_binary:
27735|  1.03k|{
27736|  1.03k|    int op, opcode;
27737|  1.03k|    const uint8_t *op_token_ptr;
27738|       |    
27739|  1.03k|    if (level == 0) {
  ------------------
  |  Branch (27739:9): [True: 123, False: 914]
  ------------------
27740|    123|        return js_parse_unary(s, PF_POW_ALLOWED);
  ------------------
  |  |25089|    123|#define PF_POW_ALLOWED  (1 << 2)
  ------------------
27741|    914|    } else if (s->token.val == TOK_PRIVATE_NAME &&
  ------------------
  |  Branch (27741:16): [True: 0, False: 914]
  ------------------
27742|      0|               (parse_flags & PF_IN_ACCEPTED) && level == 4 &&
  ------------------
  |  |25085|      0|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
  |  Branch (27742:16): [True: 0, False: 0]
  |  Branch (27742:50): [True: 0, False: 0]
  ------------------
27743|      0|               peek_token(s, FALSE) == TOK_IN) {
  ------------------
  |  Branch (27743:16): [True: 0, False: 0]
  ------------------
27744|      0|        JSAtom atom;
27745|       |
27746|      0|        atom = JS_DupAtom(s->ctx, s->token.u.ident.atom);
27747|      0|        if (next_token(s))
  ------------------
  |  Branch (27747:13): [True: 0, False: 0]
  ------------------
27748|      0|            goto fail_private_in;
27749|      0|        if (s->token.val != TOK_IN)
  ------------------
  |  Branch (27749:13): [True: 0, False: 0]
  ------------------
27750|      0|            goto fail_private_in;
27751|      0|        if (next_token(s))
  ------------------
  |  Branch (27751:13): [True: 0, False: 0]
  ------------------
27752|      0|            goto fail_private_in;
27753|      0|        if (js_parse_expr_binary(s, level - 1, parse_flags)) {
  ------------------
  |  Branch (27753:13): [True: 0, False: 0]
  ------------------
27754|      0|        fail_private_in:
27755|      0|            JS_FreeAtom(s->ctx, atom);
27756|      0|            return -1;
27757|      0|        }
27758|      0|        emit_op(s, OP_scope_in_private_field);
27759|      0|        emit_atom(s, atom);
27760|      0|        emit_u16(s, s->cur_func->scope_level);
27761|      0|        JS_FreeAtom(s->ctx, atom);
27762|      0|        return 0;
27763|    914|    } else {
27764|    914|        if (js_parse_expr_binary(s, level - 1, parse_flags))
  ------------------
  |  Branch (27764:13): [True: 16, False: 898]
  ------------------
27765|     16|            return -1;
27766|    914|    }
27767|    907|    for(;;) {
27768|    907|        op = s->token.val;
27769|    907|        op_token_ptr = s->token.ptr;
27770|    907|        switch(level) {
27771|    121|        case 1:
  ------------------
  |  Branch (27771:9): [True: 121, False: 786]
  ------------------
27772|    121|            switch(op) {
27773|      5|            case '*':
  ------------------
  |  Branch (27773:13): [True: 5, False: 116]
  ------------------
27774|      5|                opcode = OP_mul;
27775|      5|                break;
27776|      0|            case '/':
  ------------------
  |  Branch (27776:13): [True: 0, False: 121]
  ------------------
27777|      0|                opcode = OP_div;
27778|      0|                break;
27779|      2|            case '%':
  ------------------
  |  Branch (27779:13): [True: 2, False: 119]
  ------------------
27780|      2|                opcode = OP_mod;
27781|      2|                break;
27782|    114|            default:
  ------------------
  |  Branch (27782:13): [True: 114, False: 7]
  ------------------
27783|    114|                return 0;
27784|    121|            }
27785|      7|            break;
27786|    114|        case 2:
  ------------------
  |  Branch (27786:9): [True: 114, False: 793]
  ------------------
27787|    114|            switch(op) {
27788|      2|            case '+':
  ------------------
  |  Branch (27788:13): [True: 2, False: 112]
  ------------------
27789|      2|                opcode = OP_add;
27790|      2|                break;
27791|      0|            case '-':
  ------------------
  |  Branch (27791:13): [True: 0, False: 114]
  ------------------
27792|      0|                opcode = OP_sub;
27793|      0|                break;
27794|    112|            default:
  ------------------
  |  Branch (27794:13): [True: 112, False: 2]
  ------------------
27795|    112|                return 0;
27796|    114|            }
27797|      2|            break;
27798|    112|        case 3:
  ------------------
  |  Branch (27798:9): [True: 112, False: 795]
  ------------------
27799|    112|            switch(op) {
27800|      0|            case TOK_SHL:
  ------------------
  |  Branch (27800:13): [True: 0, False: 112]
  ------------------
27801|      0|                opcode = OP_shl;
27802|      0|                break;
27803|      0|            case TOK_SAR:
  ------------------
  |  Branch (27803:13): [True: 0, False: 112]
  ------------------
27804|      0|                opcode = OP_sar;
27805|      0|                break;
27806|      0|            case TOK_SHR:
  ------------------
  |  Branch (27806:13): [True: 0, False: 112]
  ------------------
27807|      0|                opcode = OP_shr;
27808|      0|                break;
27809|    112|            default:
  ------------------
  |  Branch (27809:13): [True: 112, False: 0]
  ------------------
27810|    112|                return 0;
27811|    112|            }
27812|      0|            break;
27813|    112|        case 4:
  ------------------
  |  Branch (27813:9): [True: 112, False: 795]
  ------------------
27814|    112|            switch(op) {
27815|      0|            case '<':
  ------------------
  |  Branch (27815:13): [True: 0, False: 112]
  ------------------
27816|      0|                opcode = OP_lt;
27817|      0|                break;
27818|      0|            case '>':
  ------------------
  |  Branch (27818:13): [True: 0, False: 112]
  ------------------
27819|      0|                opcode = OP_gt;
27820|      0|                break;
27821|      0|            case TOK_LTE:
  ------------------
  |  Branch (27821:13): [True: 0, False: 112]
  ------------------
27822|      0|                opcode = OP_lte;
27823|      0|                break;
27824|      0|            case TOK_GTE:
  ------------------
  |  Branch (27824:13): [True: 0, False: 112]
  ------------------
27825|      0|                opcode = OP_gte;
27826|      0|                break;
27827|      0|            case TOK_INSTANCEOF:
  ------------------
  |  Branch (27827:13): [True: 0, False: 112]
  ------------------
27828|      0|                opcode = OP_instanceof;
27829|      0|                break;
27830|      0|            case TOK_IN:
  ------------------
  |  Branch (27830:13): [True: 0, False: 112]
  ------------------
27831|      0|                if (parse_flags & PF_IN_ACCEPTED) {
  ------------------
  |  |25085|      0|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
  |  Branch (27831:21): [True: 0, False: 0]
  ------------------
27832|      0|                    opcode = OP_in;
27833|      0|                } else {
27834|      0|                    return 0;
27835|      0|                }
27836|      0|                break;
27837|    112|            default:
  ------------------
  |  Branch (27837:13): [True: 112, False: 0]
  ------------------
27838|    112|                return 0;
27839|    112|            }
27840|      0|            break;
27841|    112|        case 5:
  ------------------
  |  Branch (27841:9): [True: 112, False: 795]
  ------------------
27842|    112|            switch(op) {
27843|      0|            case TOK_EQ:
  ------------------
  |  Branch (27843:13): [True: 0, False: 112]
  ------------------
27844|      0|                opcode = OP_eq;
27845|      0|                break;
27846|      0|            case TOK_NEQ:
  ------------------
  |  Branch (27846:13): [True: 0, False: 112]
  ------------------
27847|      0|                opcode = OP_neq;
27848|      0|                break;
27849|      0|            case TOK_STRICT_EQ:
  ------------------
  |  Branch (27849:13): [True: 0, False: 112]
  ------------------
27850|      0|                opcode = OP_strict_eq;
27851|      0|                break;
27852|      0|            case TOK_STRICT_NEQ:
  ------------------
  |  Branch (27852:13): [True: 0, False: 112]
  ------------------
27853|      0|                opcode = OP_strict_neq;
27854|      0|                break;
27855|    112|            default:
  ------------------
  |  Branch (27855:13): [True: 112, False: 0]
  ------------------
27856|    112|                return 0;
27857|    112|            }
27858|      0|            break;
27859|    112|        case 6:
  ------------------
  |  Branch (27859:9): [True: 112, False: 795]
  ------------------
27860|    112|            switch(op) {
27861|      0|            case '&':
  ------------------
  |  Branch (27861:13): [True: 0, False: 112]
  ------------------
27862|      0|                opcode = OP_and;
27863|      0|                break;
27864|    112|            default:
  ------------------
  |  Branch (27864:13): [True: 112, False: 0]
  ------------------
27865|    112|                return 0;
27866|    112|            }
27867|      0|            break;
27868|    112|        case 7:
  ------------------
  |  Branch (27868:9): [True: 112, False: 795]
  ------------------
27869|    112|            switch(op) {
27870|      0|            case '^':
  ------------------
  |  Branch (27870:13): [True: 0, False: 112]
  ------------------
27871|      0|                opcode = OP_xor;
27872|      0|                break;
27873|    112|            default:
  ------------------
  |  Branch (27873:13): [True: 112, False: 0]
  ------------------
27874|    112|                return 0;
27875|    112|            }
27876|      0|            break;
27877|    112|        case 8:
  ------------------
  |  Branch (27877:9): [True: 112, False: 795]
  ------------------
27878|    112|            switch(op) {
27879|      0|            case '|':
  ------------------
  |  Branch (27879:13): [True: 0, False: 112]
  ------------------
27880|      0|                opcode = OP_or;
27881|      0|                break;
27882|    112|            default:
  ------------------
  |  Branch (27882:13): [True: 112, False: 0]
  ------------------
27883|    112|                return 0;
27884|    112|            }
27885|      0|            break;
27886|      0|        default:
  ------------------
  |  Branch (27886:9): [True: 0, False: 907]
  ------------------
27887|      0|            abort();
27888|    907|        }
27889|      9|        if (next_token(s))
  ------------------
  |  Branch (27889:13): [True: 0, False: 9]
  ------------------
27890|      0|            return -1;
27891|      9|        if (js_parse_expr_binary(s, level - 1, parse_flags))
  ------------------
  |  Branch (27891:13): [True: 0, False: 9]
  ------------------
27892|      0|            return -1;
27893|      9|        emit_source_pos(s, op_token_ptr);
27894|      9|        emit_op(s, opcode);
27895|      9|    }
27896|      0|    return 0;
27897|    898|}
quickjs.c:js_parse_unary:
27594|    128|{
27595|    128|    int op;
27596|    128|    const uint8_t *op_token_ptr;
27597|       |
27598|    128|    switch(s->token.val) {
27599|      0|    case '+':
  ------------------
  |  Branch (27599:5): [True: 0, False: 128]
  ------------------
27600|      3|    case '-':
  ------------------
  |  Branch (27600:5): [True: 3, False: 125]
  ------------------
27601|      4|    case '!':
  ------------------
  |  Branch (27601:5): [True: 1, False: 127]
  ------------------
27602|      5|    case '~':
  ------------------
  |  Branch (27602:5): [True: 1, False: 127]
  ------------------
27603|      5|    case TOK_VOID:
  ------------------
  |  Branch (27603:5): [True: 0, False: 128]
  ------------------
27604|      5|        op_token_ptr = s->token.ptr;
27605|      5|        op = s->token.val;
27606|      5|        if (next_token(s))
  ------------------
  |  Branch (27606:13): [True: 0, False: 5]
  ------------------
27607|      0|            return -1;
27608|      5|        if (js_parse_unary(s, PF_POW_FORBIDDEN))
  ------------------
  |  |25091|      5|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27608:13): [True: 0, False: 5]
  ------------------
27609|      0|            return -1;
27610|      5|        switch(op) {
27611|      3|        case '-':
  ------------------
  |  Branch (27611:9): [True: 3, False: 2]
  ------------------
27612|      3|            emit_source_pos(s, op_token_ptr);
27613|      3|            emit_op(s, OP_neg);
27614|      3|            break;
27615|      0|        case '+':
  ------------------
  |  Branch (27615:9): [True: 0, False: 5]
  ------------------
27616|      0|            emit_source_pos(s, op_token_ptr);
27617|      0|            emit_op(s, OP_plus);
27618|      0|            break;
27619|      1|        case '!':
  ------------------
  |  Branch (27619:9): [True: 1, False: 4]
  ------------------
27620|      1|            emit_op(s, OP_lnot);
27621|      1|            break;
27622|      1|        case '~':
  ------------------
  |  Branch (27622:9): [True: 1, False: 4]
  ------------------
27623|      1|            emit_source_pos(s, op_token_ptr);
27624|      1|            emit_op(s, OP_not);
27625|      1|            break;
27626|      0|        case TOK_VOID:
  ------------------
  |  Branch (27626:9): [True: 0, False: 5]
  ------------------
27627|      0|            emit_op(s, OP_drop);
27628|      0|            emit_op(s, OP_undefined);
27629|      0|            break;
27630|      0|        default:
  ------------------
  |  Branch (27630:9): [True: 0, False: 5]
  ------------------
27631|      0|            abort();
27632|      5|        }
27633|      5|        parse_flags = 0;
27634|      5|        break;
27635|      0|    case TOK_DEC:
  ------------------
  |  Branch (27635:5): [True: 0, False: 128]
  ------------------
27636|      0|    case TOK_INC:
  ------------------
  |  Branch (27636:5): [True: 0, False: 128]
  ------------------
27637|      0|        {
27638|      0|            int opcode, op, scope, label;
27639|      0|            JSAtom name;
27640|      0|            op = s->token.val;
27641|      0|            op_token_ptr = s->token.ptr;
27642|      0|            if (next_token(s))
  ------------------
  |  Branch (27642:17): [True: 0, False: 0]
  ------------------
27643|      0|                return -1;
27644|      0|            if (js_parse_unary(s, 0))
  ------------------
  |  Branch (27644:17): [True: 0, False: 0]
  ------------------
27645|      0|                return -1;
27646|      0|            if (get_lvalue(s, &opcode, &scope, &name, &label, NULL, TRUE, op))
  ------------------
  |  Branch (27646:17): [True: 0, False: 0]
  ------------------
27647|      0|                return -1;
27648|      0|            emit_source_pos(s, op_token_ptr);
27649|      0|            emit_op(s, OP_dec + op - TOK_DEC);
27650|      0|            put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_KEEP_TOP,
27651|      0|                       FALSE);
27652|      0|        }
27653|      0|        break;
27654|      0|    case TOK_TYPEOF:
  ------------------
  |  Branch (27654:5): [True: 0, False: 128]
  ------------------
27655|      0|        {
27656|      0|            JSFunctionDef *fd;
27657|      0|            if (next_token(s))
  ------------------
  |  Branch (27657:17): [True: 0, False: 0]
  ------------------
27658|      0|                return -1;
27659|      0|            if (js_parse_unary(s, PF_POW_FORBIDDEN))
  ------------------
  |  |25091|      0|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27659:17): [True: 0, False: 0]
  ------------------
27660|      0|                return -1;
27661|       |            /* reference access should not return an exception, so we
27662|       |               patch the get_var */
27663|      0|            fd = s->cur_func;
27664|      0|            if (get_prev_opcode(fd) == OP_scope_get_var) {
  ------------------
  |  Branch (27664:17): [True: 0, False: 0]
  ------------------
27665|      0|                fd->byte_code.buf[fd->last_opcode_pos] = OP_scope_get_var_undef;
27666|      0|            }
27667|      0|            emit_op(s, OP_typeof);
27668|      0|            parse_flags = 0;
27669|      0|        }
27670|      0|        break;
27671|      0|    case TOK_DELETE:
  ------------------
  |  Branch (27671:5): [True: 0, False: 128]
  ------------------
27672|      0|        if (js_parse_delete(s))
  ------------------
  |  Branch (27672:13): [True: 0, False: 0]
  ------------------
27673|      0|            return -1;
27674|      0|        parse_flags = 0;
27675|      0|        break;
27676|      0|    case TOK_AWAIT:
  ------------------
  |  Branch (27676:5): [True: 0, False: 128]
  ------------------
27677|      0|        if (!(s->cur_func->func_kind & JS_FUNC_ASYNC))
  ------------------
  |  Branch (27677:13): [True: 0, False: 0]
  ------------------
27678|      0|            return js_parse_error(s, "unexpected 'await' keyword");
27679|      0|        if (!s->cur_func->in_function_body)
  ------------------
  |  Branch (27679:13): [True: 0, False: 0]
  ------------------
27680|      0|            return js_parse_error(s, "await in default expression");
27681|      0|        if (next_token(s))
  ------------------
  |  Branch (27681:13): [True: 0, False: 0]
  ------------------
27682|      0|            return -1;
27683|      0|        if (js_parse_unary(s, PF_POW_FORBIDDEN))
  ------------------
  |  |25091|      0|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27683:13): [True: 0, False: 0]
  ------------------
27684|      0|            return -1;
27685|      0|        s->cur_func->has_await = TRUE;
27686|      0|        emit_op(s, OP_await);
27687|      0|        parse_flags = 0;
27688|      0|        break;
27689|    123|    default:
  ------------------
  |  Branch (27689:5): [True: 123, False: 5]
  ------------------
27690|    123|        if (js_parse_postfix_expr(s, PF_POSTFIX_CALL))
  ------------------
  |  |25087|    123|#define PF_POSTFIX_CALL (1 << 1)
  ------------------
  |  Branch (27690:13): [True: 2, False: 121]
  ------------------
27691|      2|            return -1;
27692|    121|        if (!s->got_lf &&
  ------------------
  |  Branch (27692:13): [True: 92, False: 29]
  ------------------
27693|     92|            (s->token.val == TOK_DEC || s->token.val == TOK_INC)) {
  ------------------
  |  Branch (27693:14): [True: 0, False: 92]
  |  Branch (27693:41): [True: 0, False: 92]
  ------------------
27694|      0|            int opcode, op, scope, label;
27695|      0|            JSAtom name;
27696|      0|            op = s->token.val;
27697|      0|            op_token_ptr = s->token.ptr;
27698|      0|            if (get_lvalue(s, &opcode, &scope, &name, &label, NULL, TRUE, op))
  ------------------
  |  Branch (27698:17): [True: 0, False: 0]
  ------------------
27699|      0|                return -1;
27700|      0|            emit_source_pos(s, op_token_ptr);
27701|      0|            emit_op(s, OP_post_dec + op - TOK_DEC);
27702|      0|            put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_KEEP_SECOND,
27703|      0|                       FALSE);
27704|      0|            if (next_token(s))
  ------------------
  |  Branch (27704:17): [True: 0, False: 0]
  ------------------
27705|      0|                return -1;
27706|      0|        }
27707|    121|        break;
27708|    128|    }
27709|    126|    if (parse_flags & (PF_POW_ALLOWED | PF_POW_FORBIDDEN)) {
  ------------------
  |  |25089|    126|#define PF_POW_ALLOWED  (1 << 2)
  ------------------
                  if (parse_flags & (PF_POW_ALLOWED | PF_POW_FORBIDDEN)) {
  ------------------
  |  |25091|    126|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27709:9): [True: 121, False: 5]
  ------------------
27710|    121|        if (s->token.val == TOK_POW) {
  ------------------
  |  Branch (27710:13): [True: 0, False: 121]
  ------------------
27711|       |            /* Strict ES7 exponentiation syntax rules: To solve
27712|       |               conficting semantics between different implementations
27713|       |               regarding the precedence of prefix operators and the
27714|       |               postifx exponential, ES7 specifies that -2**2 is a
27715|       |               syntax error. */
27716|      0|            if (parse_flags & PF_POW_FORBIDDEN) {
  ------------------
  |  |25091|      0|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27716:17): [True: 0, False: 0]
  ------------------
27717|      0|                JS_ThrowSyntaxError(s->ctx, "unparenthesized unary expression can't appear on the left-hand side of '**'");
27718|      0|                return -1;
27719|      0|            }
27720|      0|            op_token_ptr = s->token.ptr;
27721|      0|            if (next_token(s))
  ------------------
  |  Branch (27721:17): [True: 0, False: 0]
  ------------------
27722|      0|                return -1;
27723|      0|            if (js_parse_unary(s, PF_POW_ALLOWED))
  ------------------
  |  |25089|      0|#define PF_POW_ALLOWED  (1 << 2)
  ------------------
  |  Branch (27723:17): [True: 0, False: 0]
  ------------------
27724|      0|                return -1;
27725|      0|            emit_source_pos(s, op_token_ptr);
27726|      0|            emit_op(s, OP_pow);
27727|      0|        }
27728|    121|    }
27729|    126|    return 0;
27730|    126|}
quickjs.c:get_lvalue:
25936|     32|{
25937|     32|    JSFunctionDef *fd;
25938|     32|    int opcode, scope, label, depth;
25939|     32|    JSAtom name;
25940|       |
25941|       |    /* we check the last opcode to get the lvalue type */
25942|     32|    fd = s->cur_func;
25943|     32|    scope = 0;
25944|     32|    name = JS_ATOM_NULL;
  ------------------
  |  |  451|     32|#define JS_ATOM_NULL 0
  ------------------
25945|     32|    label = -1;
25946|     32|    depth = 0;
25947|     32|    switch(opcode = get_prev_opcode(fd)) {
25948|     10|    case OP_scope_get_var:
  ------------------
  |  Branch (25948:5): [True: 10, False: 22]
  ------------------
25949|     10|        name = get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
25950|     10|        scope = get_u16(fd->byte_code.buf + fd->last_opcode_pos + 5);
25951|     10|        if ((name == JS_ATOM_arguments || name == JS_ATOM_eval) &&
  ------------------
  |  Branch (25951:14): [True: 0, False: 10]
  |  Branch (25951:43): [True: 0, False: 10]
  ------------------
25952|      0|            (fd->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (25952:13): [True: 0, False: 0]
  ------------------
25953|      0|            return js_parse_error(s, "invalid lvalue in strict mode");
25954|      0|        }
25955|     10|        if (name == JS_ATOM_this || name == JS_ATOM_new_target)
  ------------------
  |  Branch (25955:13): [True: 0, False: 10]
  |  Branch (25955:37): [True: 0, False: 10]
  ------------------
25956|      0|            goto invalid_lvalue;
25957|     10|        if (has_with_scope(fd, scope)) {
  ------------------
  |  Branch (25957:13): [True: 0, False: 10]
  ------------------
25958|      0|            depth = 2;  /* will generate OP_get_ref_value */
25959|     10|        } else {
25960|     10|            depth = 0;
25961|     10|        }
25962|     10|        break;
25963|     22|    case OP_get_field:
  ------------------
  |  Branch (25963:5): [True: 22, False: 10]
  ------------------
25964|     22|        name = get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
25965|     22|        depth = 1;
25966|     22|        break;
25967|      0|    case OP_scope_get_private_field:
  ------------------
  |  Branch (25967:5): [True: 0, False: 32]
  ------------------
25968|      0|        name = get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
25969|      0|        scope = get_u16(fd->byte_code.buf + fd->last_opcode_pos + 5);
25970|      0|        depth = 1;
25971|      0|        break;
25972|      0|    case OP_get_array_el:
  ------------------
  |  Branch (25972:5): [True: 0, False: 32]
  ------------------
25973|      0|        depth = 2;
25974|      0|        break;
25975|      0|    case OP_get_super_value:
  ------------------
  |  Branch (25975:5): [True: 0, False: 32]
  ------------------
25976|      0|        depth = 3;
25977|      0|        break;
25978|      0|    default:
  ------------------
  |  Branch (25978:5): [True: 0, False: 32]
  ------------------
25979|      0|    invalid_lvalue:
25980|      0|        if (tok == TOK_FOR) {
  ------------------
  |  Branch (25980:13): [True: 0, False: 0]
  ------------------
25981|      0|            return js_parse_error(s, "invalid for in/of left hand-side");
25982|      0|        } else if (tok == TOK_INC || tok == TOK_DEC) {
  ------------------
  |  Branch (25982:20): [True: 0, False: 0]
  |  Branch (25982:38): [True: 0, False: 0]
  ------------------
25983|      0|            return js_parse_error(s, "invalid increment/decrement operand");
25984|      0|        } else if (tok == '[' || tok == '{') {
  ------------------
  |  Branch (25984:20): [True: 0, False: 0]
  |  Branch (25984:34): [True: 0, False: 0]
  ------------------
25985|      0|            return js_parse_error(s, "invalid destructuring target");
25986|      0|        } else {
25987|      0|            return js_parse_error(s, "invalid assignment left-hand side");
25988|      0|        }
25989|     32|    }
25990|       |    /* remove the last opcode */
25991|     32|    fd->byte_code.size = fd->last_opcode_pos;
25992|     32|    fd->last_opcode_pos = -1;
25993|       |
25994|     32|    if (keep) {
  ------------------
  |  Branch (25994:9): [True: 2, False: 30]
  ------------------
25995|       |        /* get the value but keep the object/fields on the stack */
25996|      2|        switch(opcode) {
25997|      2|        case OP_scope_get_var:
  ------------------
  |  Branch (25997:9): [True: 2, False: 0]
  ------------------
25998|      2|            if (depth != 0) {
  ------------------
  |  Branch (25998:17): [True: 0, False: 2]
  ------------------
25999|      0|                label = new_label(s);
26000|      0|                if (label < 0)
  ------------------
  |  Branch (26000:21): [True: 0, False: 0]
  ------------------
26001|      0|                    return -1;
26002|      0|                emit_op(s, OP_scope_make_ref);
26003|      0|                emit_atom(s, name);
26004|      0|                emit_u32(s, label);
26005|      0|                emit_u16(s, scope);
26006|      0|                update_label(fd, label, 1);
26007|      0|                emit_op(s, OP_get_ref_value);
26008|      0|                opcode = OP_get_ref_value;
26009|      2|            } else {
26010|      2|                emit_op(s, OP_scope_get_var);
26011|      2|                emit_atom(s, name);
26012|      2|                emit_u16(s, scope);
26013|      2|            }
26014|      2|            break;
26015|      2|        case OP_get_field:
  ------------------
  |  Branch (26015:9): [True: 0, False: 2]
  ------------------
26016|      0|            emit_op(s, OP_get_field2);
26017|      0|            emit_atom(s, name);
26018|      0|            break;
26019|      0|        case OP_scope_get_private_field:
  ------------------
  |  Branch (26019:9): [True: 0, False: 2]
  ------------------
26020|      0|            emit_op(s, OP_scope_get_private_field2);
26021|      0|            emit_atom(s, name);
26022|      0|            emit_u16(s, scope);
26023|      0|            break;
26024|      0|        case OP_get_array_el:
  ------------------
  |  Branch (26024:9): [True: 0, False: 2]
  ------------------
26025|      0|            emit_op(s, OP_get_array_el3);
26026|      0|            break;
26027|      0|        case OP_get_super_value:
  ------------------
  |  Branch (26027:9): [True: 0, False: 2]
  ------------------
26028|      0|            emit_op(s, OP_to_propkey);
26029|      0|            emit_op(s, OP_dup3);
26030|      0|            emit_op(s, OP_get_super_value);
26031|      0|            break;
26032|      0|        default:
  ------------------
  |  Branch (26032:9): [True: 0, False: 2]
  ------------------
26033|      0|            abort();
26034|      2|        }
26035|     30|    } else {
26036|     30|        switch(opcode) {
26037|      8|        case OP_scope_get_var:
  ------------------
  |  Branch (26037:9): [True: 8, False: 22]
  ------------------
26038|      8|            if (depth != 0) {
  ------------------
  |  Branch (26038:17): [True: 0, False: 8]
  ------------------
26039|      0|                label = new_label(s);
26040|      0|                if (label < 0)
  ------------------
  |  Branch (26040:21): [True: 0, False: 0]
  ------------------
26041|      0|                    return -1;
26042|      0|                emit_op(s, OP_scope_make_ref);
26043|      0|                emit_atom(s, name);
26044|      0|                emit_u32(s, label);
26045|      0|                emit_u16(s, scope);
26046|      0|                update_label(fd, label, 1);
26047|      0|                opcode = OP_get_ref_value;
26048|      0|            }
26049|      8|            break;
26050|     22|        default:
  ------------------
  |  Branch (26050:9): [True: 22, False: 8]
  ------------------
26051|     22|            break;
26052|     30|        }
26053|     30|    }
26054|       |
26055|     32|    *popcode = opcode;
26056|     32|    *pscope = scope;
26057|       |    /* name has refcount for OP_get_field and OP_get_ref_value,
26058|       |       and JS_ATOM_NULL for other opcodes */
26059|     32|    *pname = name;
26060|     32|    *plabel = label;
26061|     32|    if (pdepth)
  ------------------
  |  Branch (26061:9): [True: 0, False: 32]
  ------------------
26062|      0|        *pdepth = depth;
26063|     32|    return 0;
26064|     32|}
quickjs.c:update_label:
23883|     78|{
23884|     78|    LabelSlot *ls;
23885|       |
23886|     78|    assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (23886:5): [True: 0, False: 78]
  |  Branch (23886:5): [True: 0, False: 0]
  |  Branch (23886:5): [True: 78, False: 0]
  |  Branch (23886:5): [True: 78, False: 0]
  ------------------
23887|     78|    ls = &s->label_slots[label];
23888|     78|    ls->ref_count += delta;
23889|     78|    assert(ls->ref_count >= 0);
  ------------------
  |  Branch (23889:5): [True: 0, False: 78]
  |  Branch (23889:5): [True: 78, False: 0]
  ------------------
23890|     78|    return ls->ref_count;
23891|     78|}
quickjs.c:js_parse_property_name:
24625|      2|{
24626|      2|    int is_private = 0;
24627|      2|    BOOL is_non_reserved_ident;
24628|      2|    JSAtom name;
24629|      2|    int prop_type;
24630|       |
24631|      2|    prop_type = PROP_TYPE_IDENT;
  ------------------
  |  |24602|      2|#define PROP_TYPE_IDENT 0
  ------------------
24632|      2|    if (allow_method) {
  ------------------
  |  Branch (24632:9): [True: 0, False: 2]
  ------------------
24633|       |        /* if allow_private is true (for class field parsing) and
24634|       |           get/set is following by ';' (or LF with ASI), then it
24635|       |           is a field name */
24636|      0|        if ((token_is_pseudo_keyword(s, JS_ATOM_get) ||
  ------------------
  |  Branch (24636:14): [True: 0, False: 0]
  ------------------
24637|      0|             token_is_pseudo_keyword(s, JS_ATOM_set)) &&
  ------------------
  |  Branch (24637:14): [True: 0, False: 0]
  ------------------
24638|      0|            (!allow_private || peek_token(s, TRUE) != '\n')) {
  ------------------
  |  Branch (24638:14): [True: 0, False: 0]
  |  Branch (24638:32): [True: 0, False: 0]
  ------------------
24639|       |            /* get x(), set x() */
24640|      0|            name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
24641|      0|            if (next_token(s))
  ------------------
  |  Branch (24641:17): [True: 0, False: 0]
  ------------------
24642|      0|                goto fail1;
24643|      0|            if (s->token.val == ':' || s->token.val == ',' ||
  ------------------
  |  Branch (24643:17): [True: 0, False: 0]
  |  Branch (24643:40): [True: 0, False: 0]
  ------------------
24644|      0|                s->token.val == '}' || s->token.val == '(' ||
  ------------------
  |  Branch (24644:17): [True: 0, False: 0]
  |  Branch (24644:40): [True: 0, False: 0]
  ------------------
24645|      0|                s->token.val == '=' ||
  ------------------
  |  Branch (24645:17): [True: 0, False: 0]
  ------------------
24646|      0|                (s->token.val == ';' && allow_private)) {
  ------------------
  |  Branch (24646:18): [True: 0, False: 0]
  |  Branch (24646:41): [True: 0, False: 0]
  ------------------
24647|      0|                is_non_reserved_ident = TRUE;
24648|      0|                goto ident_found;
24649|      0|            }
24650|      0|            prop_type = PROP_TYPE_GET + (name == JS_ATOM_set);
  ------------------
  |  |24604|      0|#define PROP_TYPE_GET   2
  ------------------
24651|      0|            JS_FreeAtom(s->ctx, name);
24652|      0|        } else if (s->token.val == '*') {
  ------------------
  |  Branch (24652:20): [True: 0, False: 0]
  ------------------
24653|      0|            if (next_token(s))
  ------------------
  |  Branch (24653:17): [True: 0, False: 0]
  ------------------
24654|      0|                goto fail;
24655|      0|            prop_type = PROP_TYPE_STAR;
  ------------------
  |  |24606|      0|#define PROP_TYPE_STAR  4
  ------------------
24656|      0|        } else if (token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (24656:20): [True: 0, False: 0]
  ------------------
24657|      0|                   peek_token(s, TRUE) != '\n') {
  ------------------
  |  Branch (24657:20): [True: 0, False: 0]
  ------------------
24658|      0|            name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
24659|      0|            if (next_token(s))
  ------------------
  |  Branch (24659:17): [True: 0, False: 0]
  ------------------
24660|      0|                goto fail1;
24661|      0|            if (s->token.val == ':' || s->token.val == ',' ||
  ------------------
  |  Branch (24661:17): [True: 0, False: 0]
  |  Branch (24661:40): [True: 0, False: 0]
  ------------------
24662|      0|                s->token.val == '}' || s->token.val == '(' ||
  ------------------
  |  Branch (24662:17): [True: 0, False: 0]
  |  Branch (24662:40): [True: 0, False: 0]
  ------------------
24663|      0|                s->token.val == '=') {
  ------------------
  |  Branch (24663:17): [True: 0, False: 0]
  ------------------
24664|      0|                is_non_reserved_ident = TRUE;
24665|      0|                goto ident_found;
24666|      0|            }
24667|      0|            JS_FreeAtom(s->ctx, name);
24668|      0|            if (s->token.val == '*') {
  ------------------
  |  Branch (24668:17): [True: 0, False: 0]
  ------------------
24669|      0|                if (next_token(s))
  ------------------
  |  Branch (24669:21): [True: 0, False: 0]
  ------------------
24670|      0|                    goto fail;
24671|      0|                prop_type = PROP_TYPE_ASYNC_STAR;
  ------------------
  |  |24608|      0|#define PROP_TYPE_ASYNC_STAR 6
  ------------------
24672|      0|            } else {
24673|      0|                prop_type = PROP_TYPE_ASYNC;
  ------------------
  |  |24607|      0|#define PROP_TYPE_ASYNC 5
  ------------------
24674|      0|            }
24675|      0|        }
24676|      0|    }
24677|       |
24678|      2|    if (token_is_ident(s->token.val)) {
  ------------------
  |  Branch (24678:9): [True: 0, False: 2]
  ------------------
24679|       |        /* variable can only be a non-reserved identifier */
24680|      0|        is_non_reserved_ident =
24681|      0|            (s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved);
  ------------------
  |  Branch (24681:14): [True: 0, False: 0]
  |  Branch (24681:43): [True: 0, False: 0]
  ------------------
24682|       |        /* keywords and reserved words have a valid atom */
24683|      0|        name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
24684|      0|        if (next_token(s))
  ------------------
  |  Branch (24684:13): [True: 0, False: 0]
  ------------------
24685|      0|            goto fail1;
24686|      0|    ident_found:
24687|      0|        if (is_non_reserved_ident &&
  ------------------
  |  Branch (24687:13): [True: 0, False: 0]
  ------------------
24688|      0|            prop_type == PROP_TYPE_IDENT && allow_var) {
  ------------------
  |  |24602|      0|#define PROP_TYPE_IDENT 0
  ------------------
  |  Branch (24688:13): [True: 0, False: 0]
  |  Branch (24688:45): [True: 0, False: 0]
  ------------------
24689|      0|            if (!(s->token.val == ':' ||
  ------------------
  |  Branch (24689:19): [True: 0, False: 0]
  ------------------
24690|      0|                  (s->token.val == '(' && allow_method))) {
  ------------------
  |  Branch (24690:20): [True: 0, False: 0]
  |  Branch (24690:43): [True: 0, False: 0]
  ------------------
24691|      0|                prop_type = PROP_TYPE_VAR;
  ------------------
  |  |24603|      0|#define PROP_TYPE_VAR   1
  ------------------
24692|      0|            }
24693|      0|        }
24694|      2|    } else if (s->token.val == TOK_STRING) {
  ------------------
  |  Branch (24694:16): [True: 0, False: 2]
  ------------------
24695|      0|        name = JS_ValueToAtom(s->ctx, s->token.u.str.str);
24696|      0|        if (name == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (24696:13): [True: 0, False: 0]
  ------------------
24697|      0|            goto fail;
24698|      0|        if (next_token(s))
  ------------------
  |  Branch (24698:13): [True: 0, False: 0]
  ------------------
24699|      0|            goto fail1;
24700|      2|    } else if (s->token.val == TOK_NUMBER) {
  ------------------
  |  Branch (24700:16): [True: 2, False: 0]
  ------------------
24701|      2|        JSValue val;
24702|      2|        val = s->token.u.num.val;
24703|      2|        name = JS_ValueToAtom(s->ctx, val);
24704|      2|        if (name == JS_ATOM_NULL)
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (24704:13): [True: 0, False: 2]
  ------------------
24705|      0|            goto fail;
24706|      2|        if (next_token(s))
  ------------------
  |  Branch (24706:13): [True: 0, False: 2]
  ------------------
24707|      0|            goto fail1;
24708|      2|    } else if (s->token.val == '[') {
  ------------------
  |  Branch (24708:16): [True: 0, False: 0]
  ------------------
24709|      0|        if (next_token(s))
  ------------------
  |  Branch (24709:13): [True: 0, False: 0]
  ------------------
24710|      0|            goto fail;
24711|      0|        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (24711:13): [True: 0, False: 0]
  ------------------
24712|      0|            goto fail;
24713|      0|        if (js_parse_expect(s, ']'))
  ------------------
  |  Branch (24713:13): [True: 0, False: 0]
  ------------------
24714|      0|            goto fail;
24715|      0|        name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
24716|      0|    } else if (s->token.val == TOK_PRIVATE_NAME && allow_private) {
  ------------------
  |  Branch (24716:16): [True: 0, False: 0]
  |  Branch (24716:52): [True: 0, False: 0]
  ------------------
24717|      0|        name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
24718|      0|        if (next_token(s))
  ------------------
  |  Branch (24718:13): [True: 0, False: 0]
  ------------------
24719|      0|            goto fail1;
24720|      0|        is_private = PROP_TYPE_PRIVATE;
  ------------------
  |  |24610|      0|#define PROP_TYPE_PRIVATE (1 << 4)
  ------------------
24721|      0|    } else {
24722|      0|        goto invalid_prop;
24723|      0|    }
24724|      2|    if (prop_type != PROP_TYPE_IDENT && prop_type != PROP_TYPE_VAR &&
  ------------------
  |  |24602|      4|#define PROP_TYPE_IDENT 0
  ------------------
                  if (prop_type != PROP_TYPE_IDENT && prop_type != PROP_TYPE_VAR &&
  ------------------
  |  |24603|      2|#define PROP_TYPE_VAR   1
  ------------------
  |  Branch (24724:9): [True: 0, False: 2]
  |  Branch (24724:41): [True: 0, False: 0]
  ------------------
24725|      0|        s->token.val != '(') {
  ------------------
  |  Branch (24725:9): [True: 0, False: 0]
  ------------------
24726|      0|        JS_FreeAtom(s->ctx, name);
24727|      0|    invalid_prop:
24728|      0|        js_parse_error(s, "invalid property name");
24729|      0|        goto fail;
24730|      0|    }
24731|      2|    *pname = name;
24732|      2|    return prop_type | is_private;
24733|      0| fail1:
24734|      0|    JS_FreeAtom(s->ctx, name);
24735|      0| fail:
24736|      0|    *pname = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
24737|      0|    return -1;
24738|      0|}
quickjs.c:js_define_var:
26214|     15|{
26215|     15|    JSFunctionDef *fd = s->cur_func;
26216|     15|    JSVarDefEnum var_def_type;
26217|       |
26218|     15|    if (name == JS_ATOM_yield && fd->func_kind == JS_FUNC_GENERATOR) {
  ------------------
  |  Branch (26218:9): [True: 0, False: 15]
  |  Branch (26218:34): [True: 0, False: 0]
  ------------------
26219|      0|        return js_parse_error(s, "yield is a reserved identifier");
26220|      0|    }
26221|     15|    if ((name == JS_ATOM_arguments || name == JS_ATOM_eval)
  ------------------
  |  Branch (26221:10): [True: 0, False: 15]
  |  Branch (26221:39): [True: 0, False: 15]
  ------------------
26222|      0|    &&  (fd->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (26222:9): [True: 0, False: 0]
  ------------------
26223|      0|        return js_parse_error(s, "invalid variable name in strict mode");
26224|      0|    }
26225|     15|    if (name == JS_ATOM_let
  ------------------
  |  Branch (26225:9): [True: 0, False: 15]
  ------------------
26226|      0|    &&  (tok == TOK_LET || tok == TOK_CONST)) {
  ------------------
  |  Branch (26226:10): [True: 0, False: 0]
  |  Branch (26226:28): [True: 0, False: 0]
  ------------------
26227|      0|        return js_parse_error(s, "invalid lexical variable name");
26228|      0|    }
26229|     15|    switch(tok) {
26230|     15|    case TOK_LET:
  ------------------
  |  Branch (26230:5): [True: 15, False: 0]
  ------------------
26231|     15|        var_def_type = JS_VAR_DEF_LET;
26232|     15|        break;
26233|      0|    case TOK_CONST:
  ------------------
  |  Branch (26233:5): [True: 0, False: 15]
  ------------------
26234|      0|        var_def_type = JS_VAR_DEF_CONST;
26235|      0|        break;
26236|      0|    case TOK_VAR:
  ------------------
  |  Branch (26236:5): [True: 0, False: 15]
  ------------------
26237|      0|        var_def_type = JS_VAR_DEF_VAR;
26238|      0|        break;
26239|      0|    case TOK_CATCH:
  ------------------
  |  Branch (26239:5): [True: 0, False: 15]
  ------------------
26240|      0|        var_def_type = JS_VAR_DEF_CATCH;
26241|      0|        break;
26242|      0|    default:
  ------------------
  |  Branch (26242:5): [True: 0, False: 15]
  ------------------
26243|      0|        abort();
26244|     15|    }
26245|     15|    if (define_var(s, fd, name, var_def_type) < 0)
  ------------------
  |  Branch (26245:9): [True: 0, False: 15]
  ------------------
26246|      0|        return -1;
26247|     15|    return 0;
26248|     15|}
quickjs.c:put_lvalue:
26080|     34|{
26081|     34|    switch(opcode) {
26082|     12|    case OP_scope_get_var:
  ------------------
  |  Branch (26082:5): [True: 12, False: 22]
  ------------------
26083|       |        /* depth = 0 */
26084|     12|        switch(special) {
26085|      0|        case PUT_LVALUE_NOKEEP:
  ------------------
  |  Branch (26085:9): [True: 0, False: 12]
  ------------------
26086|      2|        case PUT_LVALUE_NOKEEP_DEPTH:
  ------------------
  |  Branch (26086:9): [True: 2, False: 10]
  ------------------
26087|      2|        case PUT_LVALUE_KEEP_SECOND:
  ------------------
  |  Branch (26087:9): [True: 0, False: 12]
  ------------------
26088|      2|        case PUT_LVALUE_NOKEEP_BOTTOM:
  ------------------
  |  Branch (26088:9): [True: 0, False: 12]
  ------------------
26089|      2|            break;
26090|     10|        case PUT_LVALUE_KEEP_TOP:
  ------------------
  |  Branch (26090:9): [True: 10, False: 2]
  ------------------
26091|     10|            emit_op(s, OP_dup);
26092|     10|            break;
26093|      0|        default:
  ------------------
  |  Branch (26093:9): [True: 0, False: 12]
  ------------------
26094|      0|            abort();
26095|     12|        }
26096|     12|        break;
26097|     22|    case OP_get_field:
  ------------------
  |  Branch (26097:5): [True: 22, False: 12]
  ------------------
26098|     22|    case OP_scope_get_private_field:
  ------------------
  |  Branch (26098:5): [True: 0, False: 34]
  ------------------
26099|       |        /* depth = 1 */
26100|     22|        switch(special) {
26101|      0|        case PUT_LVALUE_NOKEEP:
  ------------------
  |  Branch (26101:9): [True: 0, False: 22]
  ------------------
26102|      0|        case PUT_LVALUE_NOKEEP_DEPTH:
  ------------------
  |  Branch (26102:9): [True: 0, False: 22]
  ------------------
26103|      0|            break;
26104|     22|        case PUT_LVALUE_KEEP_TOP:
  ------------------
  |  Branch (26104:9): [True: 22, False: 0]
  ------------------
26105|     22|            emit_op(s, OP_insert2); /* obj v -> v obj v */
26106|     22|            break;
26107|      0|        case PUT_LVALUE_KEEP_SECOND:
  ------------------
  |  Branch (26107:9): [True: 0, False: 22]
  ------------------
26108|      0|            emit_op(s, OP_perm3); /* obj v0 v -> v0 obj v */
26109|      0|            break;
26110|      0|        case PUT_LVALUE_NOKEEP_BOTTOM:
  ------------------
  |  Branch (26110:9): [True: 0, False: 22]
  ------------------
26111|      0|            emit_op(s, OP_swap);
26112|      0|            break;
26113|      0|        default:
  ------------------
  |  Branch (26113:9): [True: 0, False: 22]
  ------------------
26114|      0|            abort();
26115|     22|        }
26116|     22|        break;
26117|     22|    case OP_get_array_el:
  ------------------
  |  Branch (26117:5): [True: 0, False: 34]
  ------------------
26118|      0|    case OP_get_ref_value:
  ------------------
  |  Branch (26118:5): [True: 0, False: 34]
  ------------------
26119|       |        /* depth = 2 */
26120|      0|        if (opcode == OP_get_ref_value) {
  ------------------
  |  Branch (26120:13): [True: 0, False: 0]
  ------------------
26121|      0|            JS_FreeAtom(s->ctx, name);
26122|      0|            emit_label(s, label);
26123|      0|        }
26124|      0|        switch(special) {
26125|      0|        case PUT_LVALUE_NOKEEP:
  ------------------
  |  Branch (26125:9): [True: 0, False: 0]
  ------------------
26126|      0|            emit_op(s, OP_nop); /* will trigger optimization */
26127|      0|            break;
26128|      0|        case PUT_LVALUE_NOKEEP_DEPTH:
  ------------------
  |  Branch (26128:9): [True: 0, False: 0]
  ------------------
26129|      0|            break;
26130|      0|        case PUT_LVALUE_KEEP_TOP:
  ------------------
  |  Branch (26130:9): [True: 0, False: 0]
  ------------------
26131|      0|            emit_op(s, OP_insert3); /* obj prop v -> v obj prop v */
26132|      0|            break;
26133|      0|        case PUT_LVALUE_KEEP_SECOND:
  ------------------
  |  Branch (26133:9): [True: 0, False: 0]
  ------------------
26134|      0|            emit_op(s, OP_perm4); /* obj prop v0 v -> v0 obj prop v */
26135|      0|            break;
26136|      0|        case PUT_LVALUE_NOKEEP_BOTTOM:
  ------------------
  |  Branch (26136:9): [True: 0, False: 0]
  ------------------
26137|      0|            emit_op(s, OP_rot3l);
26138|      0|            break;
26139|      0|        default:
  ------------------
  |  Branch (26139:9): [True: 0, False: 0]
  ------------------
26140|      0|            abort();
26141|      0|        }
26142|      0|        break;
26143|      0|    case OP_get_super_value:
  ------------------
  |  Branch (26143:5): [True: 0, False: 34]
  ------------------
26144|       |        /* depth = 3 */
26145|      0|        switch(special) {
26146|      0|        case PUT_LVALUE_NOKEEP:
  ------------------
  |  Branch (26146:9): [True: 0, False: 0]
  ------------------
26147|      0|        case PUT_LVALUE_NOKEEP_DEPTH:
  ------------------
  |  Branch (26147:9): [True: 0, False: 0]
  ------------------
26148|      0|            break;
26149|      0|        case PUT_LVALUE_KEEP_TOP:
  ------------------
  |  Branch (26149:9): [True: 0, False: 0]
  ------------------
26150|      0|            emit_op(s, OP_insert4); /* this obj prop v -> v this obj prop v */
26151|      0|            break;
26152|      0|        case PUT_LVALUE_KEEP_SECOND:
  ------------------
  |  Branch (26152:9): [True: 0, False: 0]
  ------------------
26153|      0|            emit_op(s, OP_perm5); /* this obj prop v0 v -> v0 this obj prop v */
26154|      0|            break;
26155|      0|        case PUT_LVALUE_NOKEEP_BOTTOM:
  ------------------
  |  Branch (26155:9): [True: 0, False: 0]
  ------------------
26156|      0|            emit_op(s, OP_rot4l);
26157|      0|            break;
26158|      0|        default:
  ------------------
  |  Branch (26158:9): [True: 0, False: 0]
  ------------------
26159|      0|            abort();
26160|      0|        }
26161|      0|        break;
26162|      0|    default:
  ------------------
  |  Branch (26162:5): [True: 0, False: 34]
  ------------------
26163|      0|        break;
26164|     34|    }
26165|       |
26166|     34|    switch(opcode) {
26167|     12|    case OP_scope_get_var:  /* val -- */
  ------------------
  |  Branch (26167:5): [True: 12, False: 22]
  ------------------
26168|     12|        emit_op(s, is_let ? OP_scope_put_var_init : OP_scope_put_var);
  ------------------
  |  Branch (26168:20): [True: 2, False: 10]
  ------------------
26169|     12|        emit_u32(s, name);  /* has refcount */
26170|     12|        emit_u16(s, scope);
26171|     12|        break;
26172|     22|    case OP_get_field:
  ------------------
  |  Branch (26172:5): [True: 22, False: 12]
  ------------------
26173|     22|        emit_op(s, OP_put_field);
26174|     22|        emit_u32(s, name);  /* name has refcount */
26175|     22|        break;
26176|      0|    case OP_scope_get_private_field:
  ------------------
  |  Branch (26176:5): [True: 0, False: 34]
  ------------------
26177|      0|        emit_op(s, OP_scope_put_private_field);
26178|      0|        emit_u32(s, name);  /* name has refcount */
26179|      0|        emit_u16(s, scope);
26180|      0|        break;
26181|      0|    case OP_get_array_el:
  ------------------
  |  Branch (26181:5): [True: 0, False: 34]
  ------------------
26182|      0|        emit_op(s, OP_put_array_el);
26183|      0|        break;
26184|      0|    case OP_get_ref_value:
  ------------------
  |  Branch (26184:5): [True: 0, False: 34]
  ------------------
26185|      0|        emit_op(s, OP_put_ref_value);
26186|      0|        break;
26187|      0|    case OP_get_super_value:
  ------------------
  |  Branch (26187:5): [True: 0, False: 34]
  ------------------
26188|      0|        emit_op(s, OP_put_super_value);
26189|      0|        break;
26190|      0|    default:
  ------------------
  |  Branch (26190:5): [True: 0, False: 34]
  ------------------
26191|      0|        abort();
26192|     34|    }
26193|     34|}
quickjs.c:push_break_entry:
28322|     14|{
28323|     14|    be->prev = fd->top_break;
28324|     14|    fd->top_break = be;
28325|     14|    be->label_name = label_name;
28326|     14|    be->label_break = label_break;
28327|     14|    be->label_cont = label_cont;
28328|     14|    be->drop_count = drop_count;
28329|     14|    be->label_finally = -1;
28330|     14|    be->scope_level = fd->scope_level;
28331|     14|    be->has_iterator = FALSE;
28332|     14|    be->is_regular_stmt = FALSE;
28333|     14|}
quickjs.c:pop_break_entry:
28336|     12|{
28337|     12|    BlockEnv *be;
28338|     12|    be = fd->top_break;
28339|     12|    fd->top_break = be->prev;
28340|     12|}
quickjs.c:js_parse_check_duplicate_parameter:
26277|      4|{
26278|       |    /* Check for duplicate parameter names */
26279|      4|    JSFunctionDef *fd = s->cur_func;
26280|      4|    int i;
26281|      8|    for (i = 0; i < fd->arg_count; i++) {
  ------------------
  |  Branch (26281:17): [True: 4, False: 4]
  ------------------
26282|      4|        if (fd->args[i].var_name == name)
  ------------------
  |  Branch (26282:13): [True: 0, False: 4]
  ------------------
26283|      0|            goto duplicate;
26284|      4|    }
26285|      6|    for (i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (26285:17): [True: 2, False: 4]
  ------------------
26286|      2|        if (fd->vars[i].var_name == name)
  ------------------
  |  Branch (26286:13): [True: 0, False: 2]
  ------------------
26287|      0|            goto duplicate;
26288|      2|    }
26289|      4|    return 0;
26290|       |
26291|      0|duplicate:
26292|      0|    return js_parse_error(s, "duplicate parameter names not allowed in this context");
26293|      4|}
quickjs.c:new_label:
23913|     72|{
23914|     72|    int label;
23915|     72|    label = new_label_fd(s->cur_func);
23916|     72|    if (unlikely(label < 0)) {
  ------------------
  |  |   33|     72|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 72]
  |  |  ------------------
  ------------------
23917|      0|        dbuf_set_error(&s->cur_func->byte_code);
23918|      0|    }
23919|     72|    return label;
23920|     72|}
quickjs.c:new_label_fd:
23894|     83|{
23895|     83|    int label;
23896|     83|    LabelSlot *ls;
23897|       |
23898|     83|    if (js_resize_array(fd->ctx, (void *)&fd->label_slots,
  ------------------
  |  Branch (23898:9): [True: 0, False: 83]
  ------------------
23899|     83|                        sizeof(fd->label_slots[0]),
23900|     83|                        &fd->label_size, fd->label_count + 1))
23901|      0|        return -1;
23902|     83|    label = fd->label_count++;
23903|     83|    ls = &fd->label_slots[label];
23904|     83|    ls->ref_count = 0;
23905|     83|    ls->pos = -1;
23906|     83|    ls->pos2 = -1;
23907|     83|    ls->addr = -1;
23908|       |    ls->first_reloc = NULL;
23909|     83|    return label;
23910|     83|}
quickjs.c:emit_goto:
23945|     56|{
23946|     56|    if (js_is_live_code(s)) {
  ------------------
  |  Branch (23946:9): [True: 56, False: 0]
  ------------------
23947|     56|        if (label < 0) {
  ------------------
  |  Branch (23947:13): [True: 15, False: 41]
  ------------------
23948|     15|            label = new_label(s);
23949|     15|            if (label < 0)
  ------------------
  |  Branch (23949:17): [True: 0, False: 15]
  ------------------
23950|      0|                return -1;
23951|     15|        }
23952|     56|        emit_op(s, opcode);
23953|     56|        emit_u32(s, label);
23954|     56|        s->cur_func->label_slots[label].ref_count++;
23955|     56|        return label;
23956|     56|    }
23957|      0|    return -1;
23958|     56|}
quickjs.c:js_parse_assign_expr:
28284|      8|{
28285|      8|    return js_parse_assign_expr2(s, PF_IN_ACCEPTED);
  ------------------
  |  |25085|      8|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
28286|      8|}
quickjs.c:set_object_name:
24919|      8|{
24920|      8|    JSFunctionDef *fd = s->cur_func;
24921|      8|    int opcode;
24922|       |
24923|      8|    opcode = get_prev_opcode(fd);
24924|      8|    if (opcode == OP_set_name) {
  ------------------
  |  Branch (24924:9): [True: 2, False: 6]
  ------------------
24925|       |        /* XXX: should free atom after OP_set_name? */
24926|      2|        fd->byte_code.size = fd->last_opcode_pos;
24927|      2|        fd->last_opcode_pos = -1;
24928|      2|        emit_op(s, OP_set_name);
24929|      2|        emit_atom(s, name);
24930|      6|    } else if (opcode == OP_set_class_name) {
  ------------------
  |  Branch (24930:16): [True: 0, False: 6]
  ------------------
24931|      0|        int define_class_pos;
24932|      0|        JSAtom atom;
24933|      0|        define_class_pos = fd->last_opcode_pos + 1 -
24934|      0|            get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
24935|      0|        assert(fd->byte_code.buf[define_class_pos] == OP_define_class);
  ------------------
  |  Branch (24935:9): [True: 0, False: 0]
  |  Branch (24935:9): [True: 0, False: 0]
  ------------------
24936|       |        /* for consistency we free the previous atom which is
24937|       |           JS_ATOM_empty_string */
24938|      0|        atom = get_u32(fd->byte_code.buf + define_class_pos + 1);
24939|      0|        JS_FreeAtom(s->ctx, atom);
24940|      0|        put_u32(fd->byte_code.buf + define_class_pos + 1,
24941|      0|                JS_DupAtom(s->ctx, name));
24942|      0|        fd->last_opcode_pos = -1;
24943|      0|    }
24944|      8|}
quickjs.c:emit_label:
23932|     68|{
23933|     68|    if (label >= 0) {
  ------------------
  |  Branch (23933:9): [True: 68, False: 0]
  ------------------
23934|     68|        emit_op(s, OP_label);
23935|     68|        emit_u32(s, label);
23936|     68|        s->cur_func->label_slots[label].pos = s->cur_func->byte_code.size;
23937|     68|        return s->cur_func->byte_code.size - 4;
23938|     68|    } else {
23939|      0|        return -1;
23940|      0|    }
23941|     68|}
quickjs.c:js_parse_function_check_names:
36421|      5|{
36422|      5|    JSAtom name;
36423|      5|    int i, idx;
36424|       |
36425|      5|    if (fd->js_mode & JS_MODE_STRICT) {
  ------------------
  |  |  403|      5|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (36425:9): [True: 0, False: 5]
  ------------------
36426|      0|        if (!fd->has_simple_parameter_list && fd->has_use_strict) {
  ------------------
  |  Branch (36426:13): [True: 0, False: 0]
  |  Branch (36426:47): [True: 0, False: 0]
  ------------------
36427|      0|            return js_parse_error(s, "\"use strict\" not allowed in function with default or destructuring parameter");
36428|      0|        }
36429|      0|        if (func_name == JS_ATOM_eval || func_name == JS_ATOM_arguments ||
  ------------------
  |  Branch (36429:13): [True: 0, False: 0]
  |  Branch (36429:42): [True: 0, False: 0]
  ------------------
36430|      0|            is_strict_future_keyword(func_name)) {
  ------------------
  |  Branch (36430:13): [True: 0, False: 0]
  ------------------
36431|      0|            return js_parse_error(s, "invalid function name in strict code");
36432|      0|        }
36433|      0|        for (idx = 0; idx < fd->arg_count; idx++) {
  ------------------
  |  Branch (36433:23): [True: 0, False: 0]
  ------------------
36434|      0|            name = fd->args[idx].var_name;
36435|       |
36436|      0|            if (name == JS_ATOM_eval || name == JS_ATOM_arguments ||
  ------------------
  |  Branch (36436:17): [True: 0, False: 0]
  |  Branch (36436:41): [True: 0, False: 0]
  ------------------
36437|      0|                is_strict_future_keyword(name)) {
  ------------------
  |  Branch (36437:17): [True: 0, False: 0]
  ------------------
36438|      0|                return js_parse_error(s, "invalid argument name in strict code");
36439|      0|            }
36440|      0|        }
36441|      0|    }
36442|       |    /* check async_generator case */
36443|      5|    if ((fd->js_mode & JS_MODE_STRICT)
  ------------------
  |  |  403|      5|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (36443:9): [True: 0, False: 5]
  ------------------
36444|      5|    ||  !fd->has_simple_parameter_list
  ------------------
  |  Branch (36444:9): [True: 2, False: 3]
  ------------------
36445|      3|    ||  (fd->func_type == JS_PARSE_FUNC_METHOD && fd->func_kind == JS_FUNC_ASYNC)
  ------------------
  |  Branch (36445:10): [True: 0, False: 3]
  |  Branch (36445:51): [True: 0, False: 0]
  ------------------
36446|      3|    ||  fd->func_type == JS_PARSE_FUNC_ARROW
  ------------------
  |  Branch (36446:9): [True: 0, False: 3]
  ------------------
36447|      3|    ||  fd->func_type == JS_PARSE_FUNC_METHOD) {
  ------------------
  |  Branch (36447:9): [True: 0, False: 3]
  ------------------
36448|      6|        for (idx = 0; idx < fd->arg_count; idx++) {
  ------------------
  |  Branch (36448:23): [True: 4, False: 2]
  ------------------
36449|      4|            name = fd->args[idx].var_name;
36450|      4|            if (name != JS_ATOM_NULL) {
  ------------------
  |  |  451|      4|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (36450:17): [True: 2, False: 2]
  ------------------
36451|      4|                for (i = 0; i < idx; i++) {
  ------------------
  |  Branch (36451:29): [True: 2, False: 2]
  ------------------
36452|      2|                    if (fd->args[i].var_name == name)
  ------------------
  |  Branch (36452:25): [True: 0, False: 2]
  ------------------
36453|      0|                        goto duplicate;
36454|      2|                }
36455|       |                /* Check if argument name duplicates a destructuring parameter */
36456|       |                /* XXX: should have a flag for such variables */
36457|      8|                for (i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (36457:29): [True: 6, False: 2]
  ------------------
36458|      6|                    if (fd->vars[i].var_name == name &&
  ------------------
  |  Branch (36458:25): [True: 2, False: 4]
  ------------------
36459|      2|                        fd->vars[i].scope_level == 0)
  ------------------
  |  Branch (36459:25): [True: 0, False: 2]
  ------------------
36460|      0|                        goto duplicate;
36461|      6|                }
36462|      2|            }
36463|      4|        }
36464|      2|    }
36465|      5|    return 0;
36466|       |
36467|      0|duplicate:
36468|      0|    return js_parse_error(s, "duplicate argument names not allowed in this context");
36469|      5|}
quickjs.c:js_is_live_code:
23816|     57|static BOOL js_is_live_code(JSParseState *s) {
23817|     57|    switch (get_prev_opcode(s->cur_func)) {
23818|      0|    case OP_tail_call:
  ------------------
  |  Branch (23818:5): [True: 0, False: 57]
  ------------------
23819|      0|    case OP_tail_call_method:
  ------------------
  |  Branch (23819:5): [True: 0, False: 57]
  ------------------
23820|      0|    case OP_return:
  ------------------
  |  Branch (23820:5): [True: 0, False: 57]
  ------------------
23821|      0|    case OP_return_undef:
  ------------------
  |  Branch (23821:5): [True: 0, False: 57]
  ------------------
23822|      0|    case OP_return_async:
  ------------------
  |  Branch (23822:5): [True: 0, False: 57]
  ------------------
23823|      0|    case OP_throw:
  ------------------
  |  Branch (23823:5): [True: 0, False: 57]
  ------------------
23824|      0|    case OP_throw_error:
  ------------------
  |  Branch (23824:5): [True: 0, False: 57]
  ------------------
23825|      0|    case OP_goto:
  ------------------
  |  Branch (23825:5): [True: 0, False: 57]
  ------------------
23826|      0|#if SHORT_OPCODES
23827|      0|    case OP_goto8:
  ------------------
  |  Branch (23827:5): [True: 0, False: 57]
  ------------------
23828|      0|    case OP_goto16:
  ------------------
  |  Branch (23828:5): [True: 0, False: 57]
  ------------------
23829|      0|#endif
23830|      0|    case OP_ret:
  ------------------
  |  Branch (23830:5): [True: 0, False: 57]
  ------------------
23831|      0|        return FALSE;
23832|     57|    default:
  ------------------
  |  Branch (23832:5): [True: 57, False: 0]
  ------------------
23833|     57|        return TRUE;
23834|     57|    }
23835|     57|}
quickjs.c:reparse_ident_token:
22770|      3|{
22771|      3|    if (s->token.val == TOK_IDENT ||
  ------------------
  |  Branch (22771:9): [True: 1, False: 2]
  ------------------
22772|      2|        (s->token.val >= TOK_FIRST_KEYWORD &&
  ------------------
  |  |21882|      4|#define TOK_FIRST_KEYWORD   TOK_NULL
  ------------------
  |  Branch (22772:10): [True: 2, False: 0]
  ------------------
22773|      2|         s->token.val <= TOK_LAST_KEYWORD)) {
  ------------------
  |  |21883|      2|#define TOK_LAST_KEYWORD    TOK_AWAIT
  ------------------
  |  Branch (22773:10): [True: 0, False: 2]
  ------------------
22774|      1|        s->token.val = TOK_IDENT;
22775|      1|        s->token.u.ident.is_reserved = FALSE;
22776|      1|        update_token_ident(s);
22777|      1|    }
22778|      3|}
quickjs.c:cpool_add:
23962|     10|{
23963|     10|    JSFunctionDef *fd = s->cur_func;
23964|       |
23965|     10|    if (js_resize_array(s->ctx, (void *)&fd->cpool, sizeof(fd->cpool[0]),
  ------------------
  |  Branch (23965:9): [True: 0, False: 10]
  ------------------
23966|     10|                        &fd->cpool_size, fd->cpool_count + 1)) {
23967|      0|        JS_FreeValue(s->ctx, val);
23968|      0|        return -1;
23969|      0|    }
23970|     10|    fd->cpool[fd->cpool_count++] = val;
23971|     10|    return fd->cpool_count - 1;
23972|     10|}
quickjs.c:emit_u32:
23848|    290|{
23849|    290|    dbuf_put_u32(&s->cur_func->byte_code, val);
23850|    290|}
quickjs.c:add_global_var:
24276|      1|{
24277|      1|    JSGlobalVar *hf;
24278|       |
24279|      1|    if (js_resize_array(ctx, (void **)&s->global_vars,
  ------------------
  |  Branch (24279:9): [True: 0, False: 1]
  ------------------
24280|      1|                        sizeof(s->global_vars[0]),
24281|      1|                        &s->global_var_size, s->global_var_count + 1))
24282|      0|        return NULL;
24283|      1|    hf = &s->global_vars[s->global_var_count++];
24284|      1|    hf->cpool_idx = -1;
24285|      1|    hf->force_init = FALSE;
24286|      1|    hf->is_lexical = FALSE;
24287|      1|    hf->is_const = FALSE;
24288|      1|    hf->scope_level = s->scope_level;
24289|      1|    hf->var_name = JS_DupAtom(ctx, name);
24290|      1|    return hf;
24291|      1|}
quickjs.c:js_parse_from_clause:
31666|     22|{
31667|     22|    JSAtom module_name;
31668|     22|    int idx;
31669|       |
31670|     22|    if (!token_is_pseudo_keyword(s, JS_ATOM_from)) {
  ------------------
  |  Branch (31670:9): [True: 0, False: 22]
  ------------------
31671|      0|        js_parse_error(s, "from clause expected");
31672|      0|        return -1;
31673|      0|    }
31674|     22|    if (next_token(s))
  ------------------
  |  Branch (31674:9): [True: 0, False: 22]
  ------------------
31675|      0|        return -1;
31676|     22|    if (s->token.val != TOK_STRING) {
  ------------------
  |  Branch (31676:9): [True: 0, False: 22]
  ------------------
31677|      0|        js_parse_error(s, "string expected");
31678|      0|        return -1;
31679|      0|    }
31680|     22|    module_name = JS_ValueToAtom(s->ctx, s->token.u.str.str);
31681|     22|    if (module_name == JS_ATOM_NULL)
  ------------------
  |  |  451|     22|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (31681:9): [True: 0, False: 22]
  ------------------
31682|      0|        return -1;
31683|     22|    if (next_token(s)) {
  ------------------
  |  Branch (31683:9): [True: 0, False: 22]
  ------------------
31684|      0|        JS_FreeAtom(s->ctx, module_name);
31685|      0|        return -1;
31686|      0|    }
31687|       |
31688|     22|    idx = add_req_module_entry(s->ctx, m, module_name);
31689|     22|    JS_FreeAtom(s->ctx, module_name);
31690|     22|    if (idx < 0)
  ------------------
  |  Branch (31690:9): [True: 0, False: 22]
  ------------------
31691|      0|        return -1;
31692|     22|    if (s->token.val == TOK_WITH) {
  ------------------
  |  Branch (31692:9): [True: 0, False: 22]
  ------------------
31693|      0|        if (js_parse_with_clause(s, &m->req_module_entries[idx]))
  ------------------
  |  Branch (31693:13): [True: 0, False: 0]
  ------------------
31694|      0|            return -1;
31695|      0|    }
31696|     22|    return idx;
31697|     22|}
quickjs.c:add_req_module_entry:
29769|     22|{
29770|     22|    JSReqModuleEntry *rme;
29771|       |
29772|     22|    if (js_resize_array(ctx, (void **)&m->req_module_entries,
  ------------------
  |  Branch (29772:9): [True: 0, False: 22]
  ------------------
29773|     22|                        sizeof(JSReqModuleEntry),
29774|     22|                        &m->req_module_entries_size,
29775|     22|                        m->req_module_entries_count + 1))
29776|      0|        return -1;
29777|     22|    rme = &m->req_module_entries[m->req_module_entries_count++];
29778|     22|    rme->module_name = JS_DupAtom(ctx, module_name);
29779|     22|    rme->module = NULL;
29780|     22|    rme->attributes = JS_UNDEFINED;
  ------------------
  |  |  291|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
29781|     22|    return m->req_module_entries_count - 1;
29782|     22|}
quickjs.c:js_parse_import:
31900|     22|{
31901|     22|    JSContext *ctx = s->ctx;
31902|     22|    JSModuleDef *m = s->cur_func->module;
31903|     22|    JSAtom local_name, import_name, module_name;
31904|     22|    int first_import, i, idx;
31905|       |
31906|     22|    if (next_token(s))
  ------------------
  |  Branch (31906:9): [True: 0, False: 22]
  ------------------
31907|      0|        return -1;
31908|       |
31909|     22|    first_import = m->import_entries_count;
31910|     22|    if (s->token.val == TOK_STRING) {
  ------------------
  |  Branch (31910:9): [True: 0, False: 22]
  ------------------
31911|      0|        module_name = JS_ValueToAtom(ctx, s->token.u.str.str);
31912|      0|        if (module_name == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (31912:13): [True: 0, False: 0]
  ------------------
31913|      0|            return -1;
31914|      0|        if (next_token(s)) {
  ------------------
  |  Branch (31914:13): [True: 0, False: 0]
  ------------------
31915|      0|            JS_FreeAtom(ctx, module_name);
31916|      0|            return -1;
31917|      0|        }
31918|      0|        idx = add_req_module_entry(ctx, m, module_name);
31919|      0|        JS_FreeAtom(ctx, module_name);
31920|      0|        if (idx < 0)
  ------------------
  |  Branch (31920:13): [True: 0, False: 0]
  ------------------
31921|      0|            return -1;
31922|      0|        if (s->token.val == TOK_WITH) {
  ------------------
  |  Branch (31922:13): [True: 0, False: 0]
  ------------------
31923|      0|            if (js_parse_with_clause(s, &m->req_module_entries[idx]))
  ------------------
  |  Branch (31923:17): [True: 0, False: 0]
  ------------------
31924|      0|                return -1;
31925|      0|        }
31926|     22|    } else {
31927|     22|        if (s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (31927:13): [True: 0, False: 22]
  ------------------
31928|      0|            if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (31928:17): [True: 0, False: 0]
  ------------------
31929|      0|                return js_parse_error_reserved_identifier(s);
31930|      0|            }
31931|       |            /* "default" import */
31932|      0|            local_name = JS_DupAtom(ctx, s->token.u.ident.atom);
31933|      0|            import_name = JS_ATOM_default;
31934|      0|            if (next_token(s))
  ------------------
  |  Branch (31934:17): [True: 0, False: 0]
  ------------------
31935|      0|                goto fail;
31936|      0|            if (add_import(s, m, local_name, import_name, FALSE))
  ------------------
  |  Branch (31936:17): [True: 0, False: 0]
  ------------------
31937|      0|                goto fail;
31938|      0|            JS_FreeAtom(ctx, local_name);
31939|       |
31940|      0|            if (s->token.val != ',')
  ------------------
  |  Branch (31940:17): [True: 0, False: 0]
  ------------------
31941|      0|                goto end_import_clause;
31942|      0|            if (next_token(s))
  ------------------
  |  Branch (31942:17): [True: 0, False: 0]
  ------------------
31943|      0|                return -1;
31944|      0|        }
31945|       |
31946|     22|        if (s->token.val == '*') {
  ------------------
  |  Branch (31946:13): [True: 22, False: 0]
  ------------------
31947|       |            /* name space import */
31948|     22|            if (next_token(s))
  ------------------
  |  Branch (31948:17): [True: 0, False: 22]
  ------------------
31949|      0|                return -1;
31950|     22|            if (!token_is_pseudo_keyword(s, JS_ATOM_as))
  ------------------
  |  Branch (31950:17): [True: 0, False: 22]
  ------------------
31951|      0|                return js_parse_error(s, "expecting 'as'");
31952|     22|            if (next_token(s))
  ------------------
  |  Branch (31952:17): [True: 0, False: 22]
  ------------------
31953|      0|                return -1;
31954|     22|            if (!token_is_ident(s->token.val)) {
  ------------------
  |  Branch (31954:17): [True: 0, False: 22]
  ------------------
31955|      0|                js_parse_error(s, "identifier expected");
31956|      0|                return -1;
31957|      0|            }
31958|     22|            local_name = JS_DupAtom(ctx, s->token.u.ident.atom);
31959|     22|            import_name = JS_ATOM__star_;
31960|     22|            if (next_token(s))
  ------------------
  |  Branch (31960:17): [True: 0, False: 22]
  ------------------
31961|      0|                goto fail;
31962|     22|            if (add_import(s, m, local_name, import_name, TRUE))
  ------------------
  |  Branch (31962:17): [True: 0, False: 22]
  ------------------
31963|      0|                goto fail;
31964|     22|            JS_FreeAtom(ctx, local_name);
31965|     22|        } else if (s->token.val == '{') {
  ------------------
  |  Branch (31965:20): [True: 0, False: 0]
  ------------------
31966|      0|            if (next_token(s))
  ------------------
  |  Branch (31966:17): [True: 0, False: 0]
  ------------------
31967|      0|                return -1;
31968|       |
31969|      0|            while (s->token.val != '}') {
  ------------------
  |  Branch (31969:20): [True: 0, False: 0]
  ------------------
31970|      0|                BOOL is_string;
31971|      0|                if (s->token.val == TOK_STRING) {
  ------------------
  |  Branch (31971:21): [True: 0, False: 0]
  ------------------
31972|      0|                    is_string = TRUE;
31973|      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 (31973:25): [True: 0, False: 0]
  ------------------
31974|      0|                        js_parse_error(s, "contains unpaired surrogate");
31975|      0|                        return -1;
31976|      0|                    }
31977|      0|                    import_name = JS_ValueToAtom(s->ctx, s->token.u.str.str);
31978|      0|                    if (import_name == JS_ATOM_NULL)
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (31978:25): [True: 0, False: 0]
  ------------------
31979|      0|                        return -1;
31980|      0|                } else {
31981|      0|                    is_string = FALSE;
31982|      0|                    if (!token_is_ident(s->token.val)) {
  ------------------
  |  Branch (31982:25): [True: 0, False: 0]
  ------------------
31983|      0|                        js_parse_error(s, "identifier expected");
31984|      0|                        return -1;
31985|      0|                    }
31986|      0|                    import_name = JS_DupAtom(ctx, s->token.u.ident.atom);
31987|      0|                }
31988|      0|                local_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
31989|      0|                if (next_token(s))
  ------------------
  |  Branch (31989:21): [True: 0, False: 0]
  ------------------
31990|      0|                    goto fail;
31991|      0|                if (token_is_pseudo_keyword(s, JS_ATOM_as)) {
  ------------------
  |  Branch (31991:21): [True: 0, False: 0]
  ------------------
31992|      0|                    if (next_token(s))
  ------------------
  |  Branch (31992:25): [True: 0, False: 0]
  ------------------
31993|      0|                        goto fail;
31994|      0|                    if (!token_is_ident(s->token.val)) {
  ------------------
  |  Branch (31994:25): [True: 0, False: 0]
  ------------------
31995|      0|                        js_parse_error(s, "identifier expected");
31996|      0|                        goto fail;
31997|      0|                    }
31998|      0|                    local_name = JS_DupAtom(ctx, s->token.u.ident.atom);
31999|      0|                    if (next_token(s))
  ------------------
  |  Branch (31999:25): [True: 0, False: 0]
  ------------------
32000|      0|                        goto fail;
32001|      0|                } else {
32002|      0|                    if (is_string) {
  ------------------
  |  Branch (32002:25): [True: 0, False: 0]
  ------------------
32003|      0|                        js_parse_error(s, "expecting 'as'");
32004|      0|                    fail:
32005|      0|                        JS_FreeAtom(ctx, local_name);
32006|      0|                        JS_FreeAtom(ctx, import_name);
32007|      0|                        return -1;
32008|      0|                    }
32009|      0|                    local_name = JS_DupAtom(ctx, import_name);
32010|      0|                }
32011|      0|                if (add_import(s, m, local_name, import_name, FALSE))
  ------------------
  |  Branch (32011:21): [True: 0, False: 0]
  ------------------
32012|      0|                    goto fail;
32013|      0|                JS_FreeAtom(ctx, local_name);
32014|      0|                JS_FreeAtom(ctx, import_name);
32015|      0|                if (s->token.val != ',')
  ------------------
  |  Branch (32015:21): [True: 0, False: 0]
  ------------------
32016|      0|                    break;
32017|      0|                if (next_token(s))
  ------------------
  |  Branch (32017:21): [True: 0, False: 0]
  ------------------
32018|      0|                    return -1;
32019|      0|            }
32020|      0|            if (js_parse_expect(s, '}'))
  ------------------
  |  Branch (32020:17): [True: 0, False: 0]
  ------------------
32021|      0|                return -1;
32022|      0|        }
32023|     22|    end_import_clause:
32024|     22|        idx = js_parse_from_clause(s, m);
32025|     22|        if (idx < 0)
  ------------------
  |  Branch (32025:13): [True: 0, False: 22]
  ------------------
32026|      0|            return -1;
32027|     22|    }
32028|     44|    for(i = first_import; i < m->import_entries_count; i++)
  ------------------
  |  Branch (32028:27): [True: 22, False: 22]
  ------------------
32029|     22|        m->import_entries[i].req_module_idx = idx;
32030|       |
32031|     22|    return js_parse_expect_semi(s);
32032|     22|}
quickjs.c:add_import:
31866|     22|{
31867|     22|    JSContext *ctx = s->ctx;
31868|     22|    int i, var_idx;
31869|     22|    JSImportEntry *mi;
31870|       |
31871|     22|    if (local_name == JS_ATOM_arguments || local_name == JS_ATOM_eval)
  ------------------
  |  Branch (31871:9): [True: 0, False: 22]
  |  Branch (31871:44): [True: 0, False: 22]
  ------------------
31872|      0|        return js_parse_error(s, "invalid import binding");
31873|       |
31874|     22|    if (local_name != JS_ATOM_default) {
  ------------------
  |  Branch (31874:9): [True: 22, False: 0]
  ------------------
31875|     33|        for (i = 0; i < s->cur_func->closure_var_count; i++) {
  ------------------
  |  Branch (31875:21): [True: 11, False: 22]
  ------------------
31876|     11|            if (s->cur_func->closure_var[i].var_name == local_name)
  ------------------
  |  Branch (31876:17): [True: 0, False: 11]
  ------------------
31877|      0|                return js_parse_error(s, "duplicate import binding");
31878|     11|        }
31879|     22|    }
31880|       |
31881|     22|    var_idx = add_closure_var(ctx, s->cur_func,
31882|     22|                              is_star ? JS_CLOSURE_MODULE_DECL : JS_CLOSURE_MODULE_IMPORT,
  ------------------
  |  Branch (31882:31): [True: 22, False: 0]
  ------------------
31883|     22|                              m->import_entries_count,
31884|     22|                              local_name, TRUE, TRUE, JS_VAR_NORMAL);
31885|     22|    if (var_idx < 0)
  ------------------
  |  Branch (31885:9): [True: 0, False: 22]
  ------------------
31886|      0|        return -1;
31887|     22|    if (js_resize_array(ctx, (void **)&m->import_entries,
  ------------------
  |  Branch (31887:9): [True: 0, False: 22]
  ------------------
31888|     22|                        sizeof(JSImportEntry),
31889|     22|                        &m->import_entries_size,
31890|     22|                        m->import_entries_count + 1))
31891|      0|        return -1;
31892|     22|    mi = &m->import_entries[m->import_entries_count++];
31893|     22|    mi->import_name = JS_DupAtom(ctx, import_name);
31894|     22|    mi->var_idx = var_idx;
31895|     22|    mi->is_star = is_star;
31896|     22|    return 0;
31897|     22|}
quickjs.c:add_closure_var:
32699|     50|{
32700|     50|    JSClosureVar *cv;
32701|       |
32702|       |    /* the closure variable indexes are currently stored on 16 bits */
32703|     50|    if (s->closure_var_count >= JS_MAX_LOCAL_VARS) {
  ------------------
  |  |  210|     50|#define JS_MAX_LOCAL_VARS 65534
  ------------------
  |  Branch (32703:9): [True: 0, False: 50]
  ------------------
32704|      0|        JS_ThrowInternalError(ctx, "too many closure variables");
32705|      0|        return -1;
32706|      0|    }
32707|       |
32708|     50|    if (js_resize_array(ctx, (void **)&s->closure_var,
  ------------------
  |  Branch (32708:9): [True: 0, False: 50]
  ------------------
32709|     50|                        sizeof(s->closure_var[0]),
32710|     50|                        &s->closure_var_size, s->closure_var_count + 1))
32711|      0|        return -1;
32712|     50|    cv = &s->closure_var[s->closure_var_count++];
32713|     50|    cv->closure_type = closure_type;
32714|     50|    cv->is_const = is_const;
32715|     50|    cv->is_lexical = is_lexical;
32716|     50|    cv->var_kind = var_kind;
32717|     50|    cv->var_idx = var_idx;
32718|     50|    cv->var_name = JS_DupAtom(ctx, var_name);
32719|     50|    return s->closure_var_count - 1;
32720|     50|}
quickjs.c:js_parse_statement_or_decl:
28903|     82|{
28904|     82|    JSContext *ctx = s->ctx;
28905|     82|    JSAtom label_name;
28906|     82|    int tok;
28907|       |
28908|       |    /* specific label handling */
28909|       |    /* XXX: support multiple labels on loop statements */
28910|     82|    label_name = JS_ATOM_NULL;
  ------------------
  |  |  451|     82|#define JS_ATOM_NULL 0
  ------------------
28911|     82|    if (is_label(s)) {
  ------------------
  |  Branch (28911:9): [True: 14, False: 68]
  ------------------
28912|     14|        BlockEnv *be;
28913|       |
28914|     14|        label_name = JS_DupAtom(ctx, s->token.u.ident.atom);
28915|       |
28916|     14|        for (be = s->cur_func->top_break; be; be = be->prev) {
  ------------------
  |  Branch (28916:43): [True: 0, False: 14]
  ------------------
28917|      0|            if (be->label_name == label_name) {
  ------------------
  |  Branch (28917:17): [True: 0, False: 0]
  ------------------
28918|      0|                js_parse_error(s, "duplicate label name");
28919|      0|                goto fail;
28920|      0|            }
28921|      0|        }
28922|       |
28923|     14|        if (next_token(s))
  ------------------
  |  Branch (28923:13): [True: 0, False: 14]
  ------------------
28924|      0|            goto fail;
28925|     14|        if (js_parse_expect(s, ':'))
  ------------------
  |  Branch (28925:13): [True: 0, False: 14]
  ------------------
28926|      0|            goto fail;
28927|     14|        if (s->token.val != TOK_FOR
  ------------------
  |  Branch (28927:13): [True: 1, False: 13]
  ------------------
28928|      1|        &&  s->token.val != TOK_DO
  ------------------
  |  Branch (28928:13): [True: 1, False: 0]
  ------------------
28929|      1|        &&  s->token.val != TOK_WHILE) {
  ------------------
  |  Branch (28929:13): [True: 1, False: 0]
  ------------------
28930|       |            /* labelled regular statement */
28931|      1|            int label_break, mask;
28932|      1|            BlockEnv break_entry;
28933|       |
28934|      1|            label_break = new_label(s);
28935|      1|            push_break_entry(s->cur_func, &break_entry,
28936|      1|                             label_name, label_break, -1, 0);
28937|      1|            break_entry.is_regular_stmt = TRUE;
28938|      1|            if (!(s->cur_func->js_mode & JS_MODE_STRICT) &&
  ------------------
  |  |  403|      1|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (28938:17): [True: 1, False: 0]
  ------------------
28939|      1|                (decl_mask & DECL_MASK_FUNC_WITH_LABEL)) {
  ------------------
  |  |28483|      1|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  ------------------
  |  Branch (28939:17): [True: 1, False: 0]
  ------------------
28940|      1|                mask = DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL;
  ------------------
  |  |28481|      1|#define DECL_MASK_FUNC  (1 << 0) /* allow normal function declaration */
  ------------------
                              mask = DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL;
  ------------------
  |  |28483|      1|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  ------------------
28941|      1|            } else {
28942|      0|                mask = 0;
28943|      0|            }
28944|      1|            if (js_parse_statement_or_decl(s, mask))
  ------------------
  |  Branch (28944:17): [True: 0, False: 1]
  ------------------
28945|      0|                goto fail;
28946|      1|            emit_label(s, label_break);
28947|      1|            pop_break_entry(s->cur_func);
28948|      1|            goto done;
28949|      1|        }
28950|     14|    }
28951|       |
28952|     81|    switch(tok = s->token.val) {
28953|      6|    case '{':
  ------------------
  |  Branch (28953:5): [True: 6, False: 75]
  ------------------
28954|      6|        if (js_parse_block(s))
  ------------------
  |  Branch (28954:13): [True: 5, False: 1]
  ------------------
28955|      5|            goto fail;
28956|      1|        break;
28957|      1|    case TOK_RETURN:
  ------------------
  |  Branch (28957:5): [True: 0, False: 81]
  ------------------
28958|      0|        {
28959|      0|            const uint8_t *op_token_ptr;
28960|      0|            if (s->cur_func->is_eval) {
  ------------------
  |  Branch (28960:17): [True: 0, False: 0]
  ------------------
28961|      0|                js_parse_error(s, "return not in a function");
28962|      0|                goto fail;
28963|      0|            }
28964|      0|            if (s->cur_func->func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT) {
  ------------------
  |  Branch (28964:17): [True: 0, False: 0]
  ------------------
28965|      0|                js_parse_error(s, "return in a static initializer block");
28966|      0|                goto fail;
28967|      0|            }
28968|      0|            op_token_ptr = s->token.ptr;
28969|      0|            if (next_token(s))
  ------------------
  |  Branch (28969:17): [True: 0, False: 0]
  ------------------
28970|      0|                goto fail;
28971|      0|            if (s->token.val != ';' && s->token.val != '}' && !s->got_lf) {
  ------------------
  |  Branch (28971:17): [True: 0, False: 0]
  |  Branch (28971:40): [True: 0, False: 0]
  |  Branch (28971:63): [True: 0, False: 0]
  ------------------
28972|      0|                if (js_parse_expr(s))
  ------------------
  |  Branch (28972:21): [True: 0, False: 0]
  ------------------
28973|      0|                    goto fail;
28974|      0|                emit_source_pos(s, op_token_ptr);
28975|      0|                emit_return(s, TRUE);
28976|      0|            } else {
28977|      0|                emit_source_pos(s, op_token_ptr);
28978|      0|                emit_return(s, FALSE);
28979|      0|            }
28980|      0|            if (js_parse_expect_semi(s))
  ------------------
  |  Branch (28980:17): [True: 0, False: 0]
  ------------------
28981|      0|                goto fail;
28982|      0|        }
28983|      0|        break;
28984|      0|    case TOK_THROW:
  ------------------
  |  Branch (28984:5): [True: 0, False: 81]
  ------------------
28985|      0|        {
28986|      0|            const uint8_t *op_token_ptr;
28987|      0|            op_token_ptr = s->token.ptr;
28988|      0|            if (next_token(s))
  ------------------
  |  Branch (28988:17): [True: 0, False: 0]
  ------------------
28989|      0|                goto fail;
28990|      0|            if (s->got_lf) {
  ------------------
  |  Branch (28990:17): [True: 0, False: 0]
  ------------------
28991|      0|                js_parse_error(s, "line terminator not allowed after throw");
28992|      0|                goto fail;
28993|      0|            }
28994|      0|            if (js_parse_expr(s))
  ------------------
  |  Branch (28994:17): [True: 0, False: 0]
  ------------------
28995|      0|                goto fail;
28996|      0|            emit_source_pos(s, op_token_ptr);
28997|      0|            emit_op(s, OP_throw);
28998|      0|            if (js_parse_expect_semi(s))
  ------------------
  |  Branch (28998:17): [True: 0, False: 0]
  ------------------
28999|      0|                goto fail;
29000|      0|        }
29001|      0|        break;
29002|      0|    case TOK_LET:
  ------------------
  |  Branch (29002:5): [True: 0, False: 81]
  ------------------
29003|      0|    case TOK_CONST:
  ------------------
  |  Branch (29003:5): [True: 0, False: 81]
  ------------------
29004|      0|    haslet:
29005|      0|        if (!(decl_mask & DECL_MASK_OTHER)) {
  ------------------
  |  |28484|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (29005:13): [True: 0, False: 0]
  ------------------
29006|      0|            js_parse_error(s, "lexical declarations can't appear in single-statement context");
29007|      0|            goto fail;
29008|      0|        }
29009|       |        /* fall thru */
29010|      0|    case TOK_VAR:
  ------------------
  |  Branch (29010:5): [True: 0, False: 81]
  ------------------
29011|      0|        if (next_token(s))
  ------------------
  |  Branch (29011:13): [True: 0, False: 0]
  ------------------
29012|      0|            goto fail;
29013|      0|        if (js_parse_var(s, TRUE, tok, FALSE))
  ------------------
  |  Branch (29013:13): [True: 0, False: 0]
  ------------------
29014|      0|            goto fail;
29015|      0|        if (js_parse_expect_semi(s))
  ------------------
  |  Branch (29015:13): [True: 0, False: 0]
  ------------------
29016|      0|            goto fail;
29017|      0|        break;
29018|      0|    case TOK_IF:
  ------------------
  |  Branch (29018:5): [True: 0, False: 81]
  ------------------
29019|      0|        {
29020|      0|            int label1, label2, mask;
29021|      0|            if (next_token(s))
  ------------------
  |  Branch (29021:17): [True: 0, False: 0]
  ------------------
29022|      0|                goto fail;
29023|       |            /* create a new scope for `let f;if(1) function f(){}` */
29024|      0|            push_scope(s);
29025|      0|            set_eval_ret_undefined(s);
29026|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (29026:17): [True: 0, False: 0]
  ------------------
29027|      0|                goto fail;
29028|      0|            label1 = emit_goto(s, OP_if_false, -1);
29029|      0|            if (s->cur_func->js_mode & JS_MODE_STRICT)
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (29029:17): [True: 0, False: 0]
  ------------------
29030|      0|                mask = 0;
29031|      0|            else
29032|      0|                mask = DECL_MASK_FUNC; /* Annex B.3.4 */
  ------------------
  |  |28481|      0|#define DECL_MASK_FUNC  (1 << 0) /* allow normal function declaration */
  ------------------
29033|       |
29034|      0|            if (js_parse_statement_or_decl(s, mask))
  ------------------
  |  Branch (29034:17): [True: 0, False: 0]
  ------------------
29035|      0|                goto fail;
29036|       |
29037|      0|            if (s->token.val == TOK_ELSE) {
  ------------------
  |  Branch (29037:17): [True: 0, False: 0]
  ------------------
29038|      0|                label2 = emit_goto(s, OP_goto, -1);
29039|      0|                if (next_token(s))
  ------------------
  |  Branch (29039:21): [True: 0, False: 0]
  ------------------
29040|      0|                    goto fail;
29041|       |
29042|      0|                emit_label(s, label1);
29043|      0|                if (js_parse_statement_or_decl(s, mask))
  ------------------
  |  Branch (29043:21): [True: 0, False: 0]
  ------------------
29044|      0|                    goto fail;
29045|       |
29046|      0|                label1 = label2;
29047|      0|            }
29048|      0|            emit_label(s, label1);
29049|      0|            pop_scope(s);
29050|      0|        }
29051|      0|        break;
29052|      0|    case TOK_WHILE:
  ------------------
  |  Branch (29052:5): [True: 0, False: 81]
  ------------------
29053|      0|        {
29054|      0|            int label_cont, label_break;
29055|      0|            BlockEnv break_entry;
29056|       |
29057|      0|            label_cont = new_label(s);
29058|      0|            label_break = new_label(s);
29059|       |
29060|      0|            push_break_entry(s->cur_func, &break_entry,
29061|      0|                             label_name, label_break, label_cont, 0);
29062|       |
29063|      0|            if (next_token(s))
  ------------------
  |  Branch (29063:17): [True: 0, False: 0]
  ------------------
29064|      0|                goto fail;
29065|       |
29066|      0|            set_eval_ret_undefined(s);
29067|       |
29068|      0|            emit_label(s, label_cont);
29069|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (29069:17): [True: 0, False: 0]
  ------------------
29070|      0|                goto fail;
29071|      0|            emit_goto(s, OP_if_false, label_break);
29072|       |
29073|      0|            if (js_parse_statement(s))
  ------------------
  |  Branch (29073:17): [True: 0, False: 0]
  ------------------
29074|      0|                goto fail;
29075|      0|            emit_goto(s, OP_goto, label_cont);
29076|       |
29077|      0|            emit_label(s, label_break);
29078|       |
29079|      0|            pop_break_entry(s->cur_func);
29080|      0|        }
29081|      0|        break;
29082|      0|    case TOK_DO:
  ------------------
  |  Branch (29082:5): [True: 0, False: 81]
  ------------------
29083|      0|        {
29084|      0|            int label_cont, label_break, label1;
29085|      0|            BlockEnv break_entry;
29086|       |
29087|      0|            label_cont = new_label(s);
29088|      0|            label_break = new_label(s);
29089|      0|            label1 = new_label(s);
29090|       |
29091|      0|            push_break_entry(s->cur_func, &break_entry,
29092|      0|                             label_name, label_break, label_cont, 0);
29093|       |
29094|      0|            if (next_token(s))
  ------------------
  |  Branch (29094:17): [True: 0, False: 0]
  ------------------
29095|      0|                goto fail;
29096|       |
29097|      0|            emit_label(s, label1);
29098|       |
29099|      0|            set_eval_ret_undefined(s);
29100|       |
29101|      0|            if (js_parse_statement(s))
  ------------------
  |  Branch (29101:17): [True: 0, False: 0]
  ------------------
29102|      0|                goto fail;
29103|       |
29104|      0|            emit_label(s, label_cont);
29105|      0|            if (js_parse_expect(s, TOK_WHILE))
  ------------------
  |  Branch (29105:17): [True: 0, False: 0]
  ------------------
29106|      0|                goto fail;
29107|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (29107:17): [True: 0, False: 0]
  ------------------
29108|      0|                goto fail;
29109|       |            /* Insert semicolon if missing */
29110|      0|            if (s->token.val == ';') {
  ------------------
  |  Branch (29110:17): [True: 0, False: 0]
  ------------------
29111|      0|                if (next_token(s))
  ------------------
  |  Branch (29111:21): [True: 0, False: 0]
  ------------------
29112|      0|                    goto fail;
29113|      0|            }
29114|      0|            emit_goto(s, OP_if_true, label1);
29115|       |
29116|      0|            emit_label(s, label_break);
29117|       |
29118|      0|            pop_break_entry(s->cur_func);
29119|      0|        }
29120|      0|        break;
29121|     13|    case TOK_FOR:
  ------------------
  |  Branch (29121:5): [True: 13, False: 68]
  ------------------
29122|     13|        {
29123|     13|            int label_cont, label_break, label_body, label_test;
29124|     13|            int pos_cont, pos_body, block_scope_level;
29125|     13|            BlockEnv break_entry;
29126|     13|            int tok, bits;
29127|     13|            BOOL is_async;
29128|       |
29129|     13|            if (next_token(s))
  ------------------
  |  Branch (29129:17): [True: 0, False: 13]
  ------------------
29130|      0|                goto fail;
29131|       |
29132|     13|            set_eval_ret_undefined(s);
29133|     13|            bits = 0;
29134|     13|            is_async = FALSE;
29135|     13|            if (s->token.val == '(') {
  ------------------
  |  Branch (29135:17): [True: 13, False: 0]
  ------------------
29136|     13|                js_parse_skip_parens_token(s, &bits, FALSE);
29137|     13|            } else if (s->token.val == TOK_AWAIT) {
  ------------------
  |  Branch (29137:24): [True: 0, False: 0]
  ------------------
29138|      0|                if (!(s->cur_func->func_kind & JS_FUNC_ASYNC)) {
  ------------------
  |  Branch (29138:21): [True: 0, False: 0]
  ------------------
29139|      0|                    js_parse_error(s, "for await is only valid in asynchronous functions");
29140|      0|                    goto fail;
29141|      0|                }
29142|      0|                is_async = TRUE;
29143|      0|                if (next_token(s))
  ------------------
  |  Branch (29143:21): [True: 0, False: 0]
  ------------------
29144|      0|                    goto fail;
29145|      0|                s->cur_func->has_await = TRUE;
29146|      0|            }
29147|     13|            if (js_parse_expect(s, '('))
  ------------------
  |  Branch (29147:17): [True: 0, False: 13]
  ------------------
29148|      0|                goto fail;
29149|       |
29150|     13|            if (!(bits & SKIP_HAS_SEMI)) {
  ------------------
  |  |24782|     13|#define SKIP_HAS_SEMI       (1 << 0)
  ------------------
  |  Branch (29150:17): [True: 13, False: 0]
  ------------------
29151|       |                /* parse for/in or for/of */
29152|     13|                if (js_parse_for_in_of(s, label_name, is_async))
  ------------------
  |  Branch (29152:21): [True: 2, False: 11]
  ------------------
29153|      2|                    goto fail;
29154|     11|                break;
29155|     13|            }
29156|      0|            block_scope_level = s->cur_func->scope_level;
29157|       |
29158|       |            /* create scope for the lexical variables declared in the initial,
29159|       |               test and increment expressions */
29160|      0|            push_scope(s);
29161|       |            /* initial expression */
29162|      0|            tok = s->token.val;
29163|      0|            if (tok != ';') {
  ------------------
  |  Branch (29163:17): [True: 0, False: 0]
  ------------------
29164|      0|                switch (is_let(s, DECL_MASK_OTHER)) {
  ------------------
  |  |28484|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
29165|      0|                case TRUE:
  ------------------
  |  Branch (29165:17): [True: 0, False: 0]
  ------------------
29166|      0|                    tok = TOK_LET;
29167|      0|                    break;
29168|      0|                case FALSE:
  ------------------
  |  Branch (29168:17): [True: 0, False: 0]
  ------------------
29169|      0|                    break;
29170|      0|                default:
  ------------------
  |  Branch (29170:17): [True: 0, False: 0]
  ------------------
29171|      0|                    goto fail;
29172|      0|                }
29173|      0|                if (tok == TOK_VAR || tok == TOK_LET || tok == TOK_CONST) {
  ------------------
  |  Branch (29173:21): [True: 0, False: 0]
  |  Branch (29173:39): [True: 0, False: 0]
  |  Branch (29173:57): [True: 0, False: 0]
  ------------------
29174|      0|                    if (next_token(s))
  ------------------
  |  Branch (29174:25): [True: 0, False: 0]
  ------------------
29175|      0|                        goto fail;
29176|      0|                    if (js_parse_var(s, FALSE, tok, FALSE))
  ------------------
  |  Branch (29176:25): [True: 0, False: 0]
  ------------------
29177|      0|                        goto fail;
29178|      0|                } else {
29179|      0|                    if (js_parse_expr2(s, FALSE))
  ------------------
  |  Branch (29179:25): [True: 0, False: 0]
  ------------------
29180|      0|                        goto fail;
29181|      0|                    emit_op(s, OP_drop);
29182|      0|                }
29183|       |
29184|       |                /* close the closures before the first iteration */
29185|      0|                close_scopes(s, s->cur_func->scope_level, block_scope_level);
29186|      0|            }
29187|      0|            if (js_parse_expect(s, ';'))
  ------------------
  |  Branch (29187:17): [True: 0, False: 0]
  ------------------
29188|      0|                goto fail;
29189|       |
29190|      0|            label_test = new_label(s);
29191|      0|            label_cont = new_label(s);
29192|      0|            label_body = new_label(s);
29193|      0|            label_break = new_label(s);
29194|       |
29195|      0|            push_break_entry(s->cur_func, &break_entry,
29196|      0|                             label_name, label_break, label_cont, 0);
29197|       |
29198|       |            /* test expression */
29199|      0|            if (s->token.val == ';') {
  ------------------
  |  Branch (29199:17): [True: 0, False: 0]
  ------------------
29200|       |                /* no test expression */
29201|      0|                label_test = label_body;
29202|      0|            } else {
29203|      0|                emit_label(s, label_test);
29204|      0|                if (js_parse_expr(s))
  ------------------
  |  Branch (29204:21): [True: 0, False: 0]
  ------------------
29205|      0|                    goto fail;
29206|      0|                emit_goto(s, OP_if_false, label_break);
29207|      0|            }
29208|      0|            if (js_parse_expect(s, ';'))
  ------------------
  |  Branch (29208:17): [True: 0, False: 0]
  ------------------
29209|      0|                goto fail;
29210|       |
29211|      0|            if (s->token.val == ')') {
  ------------------
  |  Branch (29211:17): [True: 0, False: 0]
  ------------------
29212|       |                /* no end expression */
29213|      0|                break_entry.label_cont = label_cont = label_test;
29214|      0|                pos_cont = 0; /* avoid warning */
29215|      0|            } else {
29216|       |                /* skip the end expression */
29217|      0|                emit_goto(s, OP_goto, label_body);
29218|       |
29219|      0|                pos_cont = s->cur_func->byte_code.size;
29220|      0|                emit_label(s, label_cont);
29221|      0|                if (js_parse_expr(s))
  ------------------
  |  Branch (29221:21): [True: 0, False: 0]
  ------------------
29222|      0|                    goto fail;
29223|      0|                emit_op(s, OP_drop);
29224|      0|                if (label_test != label_body)
  ------------------
  |  Branch (29224:21): [True: 0, False: 0]
  ------------------
29225|      0|                    emit_goto(s, OP_goto, label_test);
29226|      0|            }
29227|      0|            if (js_parse_expect(s, ')'))
  ------------------
  |  Branch (29227:17): [True: 0, False: 0]
  ------------------
29228|      0|                goto fail;
29229|       |
29230|      0|            pos_body = s->cur_func->byte_code.size;
29231|      0|            emit_label(s, label_body);
29232|      0|            if (js_parse_statement(s))
  ------------------
  |  Branch (29232:17): [True: 0, False: 0]
  ------------------
29233|      0|                goto fail;
29234|       |
29235|       |            /* close the closures before the next iteration */
29236|       |            /* XXX: check continue case */
29237|      0|            close_scopes(s, s->cur_func->scope_level, block_scope_level);
29238|       |
29239|      0|            if (OPTIMIZE && label_test != label_body && label_cont != label_test) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
  |  Branch (29239:29): [True: 0, False: 0]
  |  Branch (29239:57): [True: 0, False: 0]
  ------------------
29240|       |                /* move the increment code here */
29241|      0|                DynBuf *bc = &s->cur_func->byte_code;
29242|      0|                int chunk_size = pos_body - pos_cont;
29243|      0|                int offset = bc->size - pos_cont;
29244|      0|                int i;
29245|      0|                if (dbuf_claim(bc, chunk_size))
  ------------------
  |  Branch (29245:21): [True: 0, False: 0]
  ------------------
29246|      0|                    goto fail;
29247|      0|                dbuf_put(bc, bc->buf + pos_cont, chunk_size);
29248|      0|                memset(bc->buf + pos_cont, OP_nop, chunk_size);
29249|       |                /* increment part ends with a goto */
29250|      0|                s->cur_func->last_opcode_pos = bc->size - 5;
29251|       |                /* relocate labels */
29252|      0|                for (i = label_cont; i < s->cur_func->label_count; i++) {
  ------------------
  |  Branch (29252:38): [True: 0, False: 0]
  ------------------
29253|      0|                    LabelSlot *ls = &s->cur_func->label_slots[i];
29254|      0|                    if (ls->pos >= pos_cont && ls->pos < pos_body)
  ------------------
  |  Branch (29254:25): [True: 0, False: 0]
  |  Branch (29254:48): [True: 0, False: 0]
  ------------------
29255|      0|                        ls->pos += offset;
29256|      0|                }
29257|      0|            } else {
29258|      0|                emit_goto(s, OP_goto, label_cont);
29259|      0|            }
29260|       |
29261|      0|            emit_label(s, label_break);
29262|       |
29263|      0|            pop_break_entry(s->cur_func);
29264|      0|            pop_scope(s);
29265|      0|        }
29266|      0|        break;
29267|      0|    case TOK_BREAK:
  ------------------
  |  Branch (29267:5): [True: 0, False: 81]
  ------------------
29268|      0|    case TOK_CONTINUE:
  ------------------
  |  Branch (29268:5): [True: 0, False: 81]
  ------------------
29269|      0|        {
29270|      0|            int is_cont = s->token.val - TOK_BREAK;
29271|      0|            int label;
29272|       |
29273|      0|            if (next_token(s))
  ------------------
  |  Branch (29273:17): [True: 0, False: 0]
  ------------------
29274|      0|                goto fail;
29275|      0|            if (!s->got_lf && s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved)
  ------------------
  |  Branch (29275:17): [True: 0, False: 0]
  |  Branch (29275:31): [True: 0, False: 0]
  |  Branch (29275:60): [True: 0, False: 0]
  ------------------
29276|      0|                label = s->token.u.ident.atom;
29277|      0|            else
29278|      0|                label = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
29279|      0|            if (emit_break(s, label, is_cont))
  ------------------
  |  Branch (29279:17): [True: 0, False: 0]
  ------------------
29280|      0|                goto fail;
29281|      0|            if (label != JS_ATOM_NULL) {
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (29281:17): [True: 0, False: 0]
  ------------------
29282|      0|                if (next_token(s))
  ------------------
  |  Branch (29282:21): [True: 0, False: 0]
  ------------------
29283|      0|                    goto fail;
29284|      0|            }
29285|      0|            if (js_parse_expect_semi(s))
  ------------------
  |  Branch (29285:17): [True: 0, False: 0]
  ------------------
29286|      0|                goto fail;
29287|      0|        }
29288|      0|        break;
29289|      0|    case TOK_SWITCH:
  ------------------
  |  Branch (29289:5): [True: 0, False: 81]
  ------------------
29290|      0|        {
29291|      0|            int label_case, label_break, label1;
29292|      0|            int default_label_pos;
29293|      0|            BlockEnv break_entry;
29294|       |
29295|      0|            if (next_token(s))
  ------------------
  |  Branch (29295:17): [True: 0, False: 0]
  ------------------
29296|      0|                goto fail;
29297|       |
29298|      0|            set_eval_ret_undefined(s);
29299|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (29299:17): [True: 0, False: 0]
  ------------------
29300|      0|                goto fail;
29301|       |
29302|      0|            push_scope(s);
29303|      0|            label_break = new_label(s);
29304|      0|            push_break_entry(s->cur_func, &break_entry,
29305|      0|                             label_name, label_break, -1, 1);
29306|       |
29307|      0|            if (js_parse_expect(s, '{'))
  ------------------
  |  Branch (29307:17): [True: 0, False: 0]
  ------------------
29308|      0|                goto fail;
29309|       |
29310|      0|            default_label_pos = -1;
29311|      0|            label_case = -1;
29312|      0|            while (s->token.val != '}') {
  ------------------
  |  Branch (29312:20): [True: 0, False: 0]
  ------------------
29313|      0|                if (s->token.val == TOK_CASE) {
  ------------------
  |  Branch (29313:21): [True: 0, False: 0]
  ------------------
29314|      0|                    label1 = -1;
29315|      0|                    if (label_case >= 0) {
  ------------------
  |  Branch (29315:25): [True: 0, False: 0]
  ------------------
29316|       |                        /* skip the case if needed */
29317|      0|                        label1 = emit_goto(s, OP_goto, -1);
29318|      0|                    }
29319|      0|                    emit_label(s, label_case);
29320|      0|                    label_case = -1;
29321|      0|                    for (;;) {
29322|       |                        /* parse a sequence of case clauses */
29323|      0|                        if (next_token(s))
  ------------------
  |  Branch (29323:29): [True: 0, False: 0]
  ------------------
29324|      0|                            goto fail;
29325|      0|                        emit_op(s, OP_dup);
29326|      0|                        if (js_parse_expr(s))
  ------------------
  |  Branch (29326:29): [True: 0, False: 0]
  ------------------
29327|      0|                            goto fail;
29328|      0|                        if (js_parse_expect(s, ':'))
  ------------------
  |  Branch (29328:29): [True: 0, False: 0]
  ------------------
29329|      0|                            goto fail;
29330|      0|                        emit_op(s, OP_strict_eq);
29331|      0|                        if (s->token.val == TOK_CASE) {
  ------------------
  |  Branch (29331:29): [True: 0, False: 0]
  ------------------
29332|      0|                            label1 = emit_goto(s, OP_if_true, label1);
29333|      0|                        } else {
29334|      0|                            label_case = emit_goto(s, OP_if_false, -1);
29335|      0|                            emit_label(s, label1);
29336|      0|                            break;
29337|      0|                        }
29338|      0|                    }
29339|      0|                } else if (s->token.val == TOK_DEFAULT) {
  ------------------
  |  Branch (29339:28): [True: 0, False: 0]
  ------------------
29340|      0|                    if (next_token(s))
  ------------------
  |  Branch (29340:25): [True: 0, False: 0]
  ------------------
29341|      0|                        goto fail;
29342|      0|                    if (js_parse_expect(s, ':'))
  ------------------
  |  Branch (29342:25): [True: 0, False: 0]
  ------------------
29343|      0|                        goto fail;
29344|      0|                    if (default_label_pos >= 0) {
  ------------------
  |  Branch (29344:25): [True: 0, False: 0]
  ------------------
29345|      0|                        js_parse_error(s, "duplicate default");
29346|      0|                        goto fail;
29347|      0|                    }
29348|      0|                    if (label_case < 0) {
  ------------------
  |  Branch (29348:25): [True: 0, False: 0]
  ------------------
29349|       |                        /* falling thru direct from switch expression */
29350|      0|                        label_case = emit_goto(s, OP_goto, -1);
29351|      0|                    }
29352|       |                    /* Emit a dummy label opcode. Label will be patched after
29353|       |                       the end of the switch body. Do not use emit_label(s, 0)
29354|       |                       because it would clobber label 0 address, preventing
29355|       |                       proper optimizer operation.
29356|       |                     */
29357|      0|                    emit_op(s, OP_label);
29358|      0|                    emit_u32(s, 0);
29359|      0|                    default_label_pos = s->cur_func->byte_code.size - 4;
29360|      0|                } else {
29361|      0|                    if (label_case < 0) {
  ------------------
  |  Branch (29361:25): [True: 0, False: 0]
  ------------------
29362|       |                        /* falling thru direct from switch expression */
29363|      0|                        js_parse_error(s, "invalid switch statement");
29364|      0|                        goto fail;
29365|      0|                    }
29366|      0|                    if (js_parse_statement_or_decl(s, DECL_MASK_ALL))
  ------------------
  |  |28485|      0|#define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28481|      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)
  |  |  ------------------
  |  |  |  |28483|      0|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  |  |  ------------------
  |  |               #define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28484|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  |  |  ------------------
  ------------------
  |  Branch (29366:25): [True: 0, False: 0]
  ------------------
29367|      0|                        goto fail;
29368|      0|                }
29369|      0|            }
29370|      0|            if (js_parse_expect(s, '}'))
  ------------------
  |  Branch (29370:17): [True: 0, False: 0]
  ------------------
29371|      0|                goto fail;
29372|      0|            if (default_label_pos >= 0) {
  ------------------
  |  Branch (29372:17): [True: 0, False: 0]
  ------------------
29373|       |                /* Ugly patch for the `default` label, shameful and risky */
29374|      0|                put_u32(s->cur_func->byte_code.buf + default_label_pos,
29375|      0|                        label_case);
29376|      0|                s->cur_func->label_slots[label_case].pos = default_label_pos + 4;
29377|      0|            } else {
29378|      0|                emit_label(s, label_case);
29379|      0|            }
29380|      0|            emit_label(s, label_break);
29381|      0|            emit_op(s, OP_drop); /* drop the switch expression */
29382|       |
29383|      0|            pop_break_entry(s->cur_func);
29384|      0|            pop_scope(s);
29385|      0|        }
29386|      0|        break;
29387|      0|    case TOK_TRY:
  ------------------
  |  Branch (29387:5): [True: 0, False: 81]
  ------------------
29388|      0|        {
29389|      0|            int label_catch, label_catch2, label_finally, label_end;
29390|      0|            JSAtom name;
29391|      0|            BlockEnv block_env;
29392|       |
29393|      0|            set_eval_ret_undefined(s);
29394|      0|            if (next_token(s))
  ------------------
  |  Branch (29394:17): [True: 0, False: 0]
  ------------------
29395|      0|                goto fail;
29396|      0|            label_catch = new_label(s);
29397|      0|            label_catch2 = new_label(s);
29398|      0|            label_finally = new_label(s);
29399|      0|            label_end = new_label(s);
29400|       |
29401|      0|            emit_goto(s, OP_catch, label_catch);
29402|       |
29403|      0|            push_break_entry(s->cur_func, &block_env,
29404|      0|                             JS_ATOM_NULL, -1, -1, 1);
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
29405|      0|            block_env.label_finally = label_finally;
29406|       |
29407|      0|            if (js_parse_block(s))
  ------------------
  |  Branch (29407:17): [True: 0, False: 0]
  ------------------
29408|      0|                goto fail;
29409|       |
29410|      0|            pop_break_entry(s->cur_func);
29411|       |
29412|      0|            if (js_is_live_code(s)) {
  ------------------
  |  Branch (29412:17): [True: 0, False: 0]
  ------------------
29413|       |                /* drop the catch offset */
29414|      0|                emit_op(s, OP_drop);
29415|       |                /* must push dummy value to keep same stack size */
29416|      0|                emit_op(s, OP_undefined);
29417|      0|                emit_goto(s, OP_gosub, label_finally);
29418|      0|                emit_op(s, OP_drop);
29419|       |
29420|      0|                emit_goto(s, OP_goto, label_end);
29421|      0|            }
29422|       |
29423|      0|            if (s->token.val == TOK_CATCH) {
  ------------------
  |  Branch (29423:17): [True: 0, False: 0]
  ------------------
29424|      0|                if (next_token(s))
  ------------------
  |  Branch (29424:21): [True: 0, False: 0]
  ------------------
29425|      0|                    goto fail;
29426|       |
29427|      0|                push_scope(s);  /* catch variable */
29428|      0|                emit_label(s, label_catch);
29429|       |
29430|      0|                if (s->token.val == '{') {
  ------------------
  |  Branch (29430:21): [True: 0, False: 0]
  ------------------
29431|       |                    /* support optional-catch-binding feature */
29432|      0|                    emit_op(s, OP_drop);    /* pop the exception object */
29433|      0|                } else {
29434|      0|                    if (js_parse_expect(s, '('))
  ------------------
  |  Branch (29434:25): [True: 0, False: 0]
  ------------------
29435|      0|                        goto fail;
29436|      0|                    if (!(s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved)) {
  ------------------
  |  Branch (29436:27): [True: 0, False: 0]
  |  Branch (29436:56): [True: 0, False: 0]
  ------------------
29437|      0|                        if (s->token.val == '[' || s->token.val == '{') {
  ------------------
  |  Branch (29437:29): [True: 0, False: 0]
  |  Branch (29437:52): [True: 0, False: 0]
  ------------------
29438|       |                            /* XXX: TOK_LET is not completely correct */
29439|      0|                            if (js_parse_destructuring_element(s, TOK_LET, 0, TRUE, -1, TRUE, FALSE) < 0)
  ------------------
  |  Branch (29439:33): [True: 0, False: 0]
  ------------------
29440|      0|                                goto fail;
29441|      0|                        } else {
29442|      0|                            js_parse_error(s, "identifier expected");
29443|      0|                            goto fail;
29444|      0|                        }
29445|      0|                    } else {
29446|      0|                        name = JS_DupAtom(ctx, s->token.u.ident.atom);
29447|      0|                        if (next_token(s)
  ------------------
  |  Branch (29447:29): [True: 0, False: 0]
  ------------------
29448|      0|                        ||  js_define_var(s, name, TOK_CATCH) < 0) {
  ------------------
  |  Branch (29448:29): [True: 0, False: 0]
  ------------------
29449|      0|                            JS_FreeAtom(ctx, name);
29450|      0|                            goto fail;
29451|      0|                        }
29452|       |                        /* store the exception value in the catch variable */
29453|      0|                        emit_op(s, OP_scope_put_var);
29454|      0|                        emit_u32(s, name);
29455|      0|                        emit_u16(s, s->cur_func->scope_level);
29456|      0|                    }
29457|      0|                    if (js_parse_expect(s, ')'))
  ------------------
  |  Branch (29457:25): [True: 0, False: 0]
  ------------------
29458|      0|                        goto fail;
29459|      0|                }
29460|       |                /* XXX: should keep the address to nop it out if there is no finally block */
29461|      0|                emit_goto(s, OP_catch, label_catch2);
29462|       |
29463|      0|                push_scope(s);  /* catch block */
29464|      0|                push_break_entry(s->cur_func, &block_env, JS_ATOM_NULL,
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
29465|      0|                                 -1, -1, 1);
29466|      0|                block_env.label_finally = label_finally;
29467|       |
29468|      0|                if (js_parse_block(s))
  ------------------
  |  Branch (29468:21): [True: 0, False: 0]
  ------------------
29469|      0|                    goto fail;
29470|       |
29471|      0|                pop_break_entry(s->cur_func);
29472|      0|                pop_scope(s);  /* catch block */
29473|      0|                pop_scope(s);  /* catch variable */
29474|       |
29475|      0|                if (js_is_live_code(s)) {
  ------------------
  |  Branch (29475:21): [True: 0, False: 0]
  ------------------
29476|       |                    /* drop the catch2 offset */
29477|      0|                    emit_op(s, OP_drop);
29478|       |                    /* XXX: should keep the address to nop it out if there is no finally block */
29479|       |                    /* must push dummy value to keep same stack size */
29480|      0|                    emit_op(s, OP_undefined);
29481|      0|                    emit_goto(s, OP_gosub, label_finally);
29482|      0|                    emit_op(s, OP_drop);
29483|      0|                    emit_goto(s, OP_goto, label_end);
29484|      0|                }
29485|       |                /* catch exceptions thrown in the catch block to execute the
29486|       |                 * finally clause and rethrow the exception */
29487|      0|                emit_label(s, label_catch2);
29488|       |                /* catch value is at TOS, no need to push undefined */
29489|      0|                emit_goto(s, OP_gosub, label_finally);
29490|      0|                emit_op(s, OP_throw);
29491|       |
29492|      0|            } else if (s->token.val == TOK_FINALLY) {
  ------------------
  |  Branch (29492:24): [True: 0, False: 0]
  ------------------
29493|       |                /* finally without catch : execute the finally clause
29494|       |                 * and rethrow the exception */
29495|      0|                emit_label(s, label_catch);
29496|       |                /* catch value is at TOS, no need to push undefined */
29497|      0|                emit_goto(s, OP_gosub, label_finally);
29498|      0|                emit_op(s, OP_throw);
29499|      0|            } else {
29500|      0|                js_parse_error(s, "expecting catch or finally");
29501|      0|                goto fail;
29502|      0|            }
29503|      0|            emit_label(s, label_finally);
29504|      0|            if (s->token.val == TOK_FINALLY) {
  ------------------
  |  Branch (29504:17): [True: 0, False: 0]
  ------------------
29505|      0|                int saved_eval_ret_idx = 0; /* avoid warning */
29506|       |
29507|      0|                if (next_token(s))
  ------------------
  |  Branch (29507:21): [True: 0, False: 0]
  ------------------
29508|      0|                    goto fail;
29509|       |                /* on the stack: ret_value gosub_ret_value */
29510|      0|                push_break_entry(s->cur_func, &block_env, JS_ATOM_NULL,
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
29511|      0|                                 -1, -1, 2);
29512|       |
29513|      0|                if (s->cur_func->eval_ret_idx >= 0) {
  ------------------
  |  Branch (29513:21): [True: 0, False: 0]
  ------------------
29514|       |                    /* 'finally' updates eval_ret only if not a normal
29515|       |                       termination */
29516|      0|                    saved_eval_ret_idx =
29517|      0|                        add_var(s->ctx, s->cur_func, JS_ATOM__ret_);
29518|      0|                    if (saved_eval_ret_idx < 0)
  ------------------
  |  Branch (29518:25): [True: 0, False: 0]
  ------------------
29519|      0|                        goto fail;
29520|      0|                    emit_op(s, OP_get_loc);
29521|      0|                    emit_u16(s, s->cur_func->eval_ret_idx);
29522|      0|                    emit_op(s, OP_put_loc);
29523|      0|                    emit_u16(s, saved_eval_ret_idx);
29524|      0|                    set_eval_ret_undefined(s);
29525|      0|                }
29526|       |
29527|      0|                if (js_parse_block(s))
  ------------------
  |  Branch (29527:21): [True: 0, False: 0]
  ------------------
29528|      0|                    goto fail;
29529|       |
29530|      0|                if (s->cur_func->eval_ret_idx >= 0) {
  ------------------
  |  Branch (29530:21): [True: 0, False: 0]
  ------------------
29531|      0|                    emit_op(s, OP_get_loc);
29532|      0|                    emit_u16(s, saved_eval_ret_idx);
29533|      0|                    emit_op(s, OP_put_loc);
29534|      0|                    emit_u16(s, s->cur_func->eval_ret_idx);
29535|      0|                }
29536|      0|                pop_break_entry(s->cur_func);
29537|      0|            }
29538|      0|            emit_op(s, OP_ret);
29539|      0|            emit_label(s, label_end);
29540|      0|        }
29541|      0|        break;
29542|      0|    case ';':
  ------------------
  |  Branch (29542:5): [True: 0, False: 81]
  ------------------
29543|       |        /* empty statement */
29544|      0|        if (next_token(s))
  ------------------
  |  Branch (29544:13): [True: 0, False: 0]
  ------------------
29545|      0|            goto fail;
29546|      0|        break;
29547|      0|    case TOK_WITH:
  ------------------
  |  Branch (29547:5): [True: 0, False: 81]
  ------------------
29548|      0|        if (s->cur_func->js_mode & JS_MODE_STRICT) {
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (29548:13): [True: 0, False: 0]
  ------------------
29549|      0|            js_parse_error(s, "invalid keyword: with");
29550|      0|            goto fail;
29551|      0|        } else {
29552|      0|            int with_idx;
29553|       |
29554|      0|            if (next_token(s))
  ------------------
  |  Branch (29554:17): [True: 0, False: 0]
  ------------------
29555|      0|                goto fail;
29556|       |
29557|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (29557:17): [True: 0, False: 0]
  ------------------
29558|      0|                goto fail;
29559|       |
29560|      0|            push_scope(s);
29561|      0|            with_idx = define_var(s, s->cur_func, JS_ATOM__with_,
29562|      0|                                  JS_VAR_DEF_WITH);
29563|      0|            if (with_idx < 0)
  ------------------
  |  Branch (29563:17): [True: 0, False: 0]
  ------------------
29564|      0|                goto fail;
29565|      0|            emit_op(s, OP_to_object);
29566|      0|            emit_op(s, OP_put_loc);
29567|      0|            emit_u16(s, with_idx);
29568|       |
29569|      0|            set_eval_ret_undefined(s);
29570|      0|            if (js_parse_statement(s))
  ------------------
  |  Branch (29570:17): [True: 0, False: 0]
  ------------------
29571|      0|                goto fail;
29572|       |
29573|       |            /* Popping scope drops lexical context for the with object variable */
29574|      0|            pop_scope(s);
29575|      0|        }
29576|      0|        break;
29577|      2|    case TOK_FUNCTION:
  ------------------
  |  Branch (29577:5): [True: 2, False: 79]
  ------------------
29578|       |        /* ES6 Annex B.3.2 and B.3.3 semantics */
29579|      2|        if (!(decl_mask & DECL_MASK_FUNC))
  ------------------
  |  |28481|      2|#define DECL_MASK_FUNC  (1 << 0) /* allow normal function declaration */
  ------------------
  |  Branch (29579:13): [True: 0, False: 2]
  ------------------
29580|      0|            goto func_decl_error;
29581|      2|        if (!(decl_mask & DECL_MASK_OTHER) && peek_token(s, FALSE) == '*')
  ------------------
  |  |28484|      2|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (29581:13): [True: 0, False: 2]
  |  Branch (29581:47): [True: 0, False: 0]
  ------------------
29582|      0|            goto func_decl_error;
29583|      2|        goto parse_func_var;
29584|     46|    case TOK_IDENT:
  ------------------
  |  Branch (29584:5): [True: 46, False: 35]
  ------------------
29585|     46|        if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (29585:13): [True: 0, False: 46]
  ------------------
29586|      0|            js_parse_error_reserved_identifier(s);
29587|      0|            goto fail;
29588|      0|        }
29589|       |        /* Determine if `let` introduces a Declaration or an ExpressionStatement */
29590|     46|        switch (is_let(s, decl_mask)) {
29591|      0|        case TRUE:
  ------------------
  |  Branch (29591:9): [True: 0, False: 46]
  ------------------
29592|      0|            tok = TOK_LET;
29593|      0|            goto haslet;
29594|     46|        case FALSE:
  ------------------
  |  Branch (29594:9): [True: 46, False: 0]
  ------------------
29595|     46|            break;
29596|      0|        default:
  ------------------
  |  Branch (29596:9): [True: 0, False: 46]
  ------------------
29597|      0|            goto fail;
29598|     46|        }
29599|     46|        if (token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (29599:13): [True: 0, False: 46]
  ------------------
29600|      0|            peek_token(s, TRUE) == TOK_FUNCTION) {
  ------------------
  |  Branch (29600:13): [True: 0, False: 0]
  ------------------
29601|      0|            if (!(decl_mask & DECL_MASK_OTHER)) {
  ------------------
  |  |28484|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (29601:17): [True: 0, False: 0]
  ------------------
29602|      0|            func_decl_error:
29603|      0|                js_parse_error(s, "function declarations can't appear in single-statement context");
29604|      0|                goto fail;
29605|      0|            }
29606|      2|        parse_func_var:
29607|      2|            if (js_parse_function_decl(s, JS_PARSE_FUNC_VAR,
  ------------------
  |  Branch (29607:17): [True: 2, False: 0]
  ------------------
29608|      2|                                       JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
29609|      2|                                       s->token.ptr))
29610|      2|                goto fail;
29611|      0|            break;
29612|      2|        }
29613|     46|        goto hasexpr;
29614|       |
29615|     46|    case TOK_CLASS:
  ------------------
  |  Branch (29615:5): [True: 0, False: 81]
  ------------------
29616|      0|        if (!(decl_mask & DECL_MASK_OTHER)) {
  ------------------
  |  |28484|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (29616:13): [True: 0, False: 0]
  ------------------
29617|      0|            js_parse_error(s, "class declarations can't appear in single-statement context");
29618|      0|            goto fail;
29619|      0|        }
29620|      0|        if (js_parse_class(s, FALSE, JS_PARSE_EXPORT_NONE))
  ------------------
  |  Branch (29620:13): [True: 0, False: 0]
  ------------------
29621|      0|            return -1;
29622|      0|        break;
29623|       |
29624|      0|    case TOK_DEBUGGER:
  ------------------
  |  Branch (29624:5): [True: 0, False: 81]
  ------------------
29625|       |        /* currently no debugger, so just skip the keyword */
29626|      0|        if (next_token(s))
  ------------------
  |  Branch (29626:13): [True: 0, False: 0]
  ------------------
29627|      0|            goto fail;
29628|      0|        if (js_parse_expect_semi(s))
  ------------------
  |  Branch (29628:13): [True: 0, False: 0]
  ------------------
29629|      0|            goto fail;
29630|      0|        break;
29631|       |
29632|      0|    case TOK_ENUM:
  ------------------
  |  Branch (29632:5): [True: 0, False: 81]
  ------------------
29633|      0|    case TOK_EXPORT:
  ------------------
  |  Branch (29633:5): [True: 0, False: 81]
  ------------------
29634|      0|    case TOK_EXTENDS:
  ------------------
  |  Branch (29634:5): [True: 0, False: 81]
  ------------------
29635|      0|        js_unsupported_keyword(s, s->token.u.ident.atom);
29636|      0|        goto fail;
29637|       |
29638|     14|    default:
  ------------------
  |  Branch (29638:5): [True: 14, False: 67]
  ------------------
29639|     60|    hasexpr:
29640|     60|        emit_source_pos(s, s->token.ptr);
29641|     60|        if (js_parse_expr(s))
  ------------------
  |  Branch (29641:13): [True: 2, False: 58]
  ------------------
29642|      2|            goto fail;
29643|     58|        if (s->cur_func->eval_ret_idx >= 0) {
  ------------------
  |  Branch (29643:13): [True: 22, False: 36]
  ------------------
29644|       |            /* store the expression value so that it can be returned
29645|       |               by eval() */
29646|     22|            emit_op(s, OP_put_loc);
29647|     22|            emit_u16(s, s->cur_func->eval_ret_idx);
29648|     36|        } else {
29649|     36|            emit_op(s, OP_drop); /* drop the result */
29650|     36|        }
29651|     58|        if (js_parse_expect_semi(s))
  ------------------
  |  Branch (29651:13): [True: 1, False: 57]
  ------------------
29652|      1|            goto fail;
29653|     57|        break;
29654|     81|    }
29655|     70|done:
29656|     70|    JS_FreeAtom(ctx, label_name);
29657|     70|    return 0;
29658|     12|fail:
29659|     12|    JS_FreeAtom(ctx, label_name);
29660|     12|    return -1;
29661|     81|}
quickjs.c:is_label:
28613|     82|{
28614|     82|    return (s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved &&
  ------------------
  |  Branch (28614:13): [True: 60, False: 22]
  |  Branch (28614:42): [True: 60, False: 0]
  ------------------
28615|     60|            peek_token(s, FALSE) == ':');
  ------------------
  |  Branch (28615:13): [True: 14, False: 46]
  ------------------
28616|     82|}
quickjs.c:js_parse_block:
28496|      6|{
28497|      6|    if (js_parse_expect(s, '{'))
  ------------------
  |  Branch (28497:9): [True: 0, False: 6]
  ------------------
28498|      0|        return -1;
28499|      6|    if (s->token.val != '}') {
  ------------------
  |  Branch (28499:9): [True: 5, False: 1]
  ------------------
28500|      5|        push_scope(s);
28501|     18|        for(;;) {
28502|     18|            if (js_parse_statement_or_decl(s, DECL_MASK_ALL))
  ------------------
  |  |28485|     18|#define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28481|     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)
  |  |  ------------------
  |  |  |  |28483|     18|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  |  |  ------------------
  |  |               #define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28484|     18|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  |  |  ------------------
  ------------------
  |  Branch (28502:17): [True: 5, False: 13]
  ------------------
28503|      5|                return -1;
28504|     13|            if (s->token.val == '}')
  ------------------
  |  Branch (28504:17): [True: 0, False: 13]
  ------------------
28505|      0|                break;
28506|     13|        }
28507|      0|        pop_scope(s);
28508|      0|    }
28509|      1|    if (next_token(s))
  ------------------
  |  Branch (28509:9): [True: 0, False: 1]
  ------------------
28510|      0|        return -1;
28511|      1|    return 0;
28512|      1|}
quickjs.c:set_eval_ret_undefined:
28893|     13|{
28894|     13|    if (s->cur_func->eval_ret_idx >= 0) {
  ------------------
  |  Branch (28894:9): [True: 8, False: 5]
  ------------------
28895|      8|        emit_op(s, OP_undefined);
28896|      8|        emit_op(s, OP_put_loc);
28897|      8|        emit_u16(s, s->cur_func->eval_ret_idx);
28898|      8|    }
28899|     13|}
quickjs.c:js_parse_statement:
28491|     13|{
28492|     13|    return js_parse_statement_or_decl(s, 0);
28493|     13|}
quickjs.c:js_parse_for_in_of:
28667|     13|{
28668|     13|    JSContext *ctx = s->ctx;
28669|     13|    JSFunctionDef *fd = s->cur_func;
28670|     13|    JSAtom var_name;
28671|     13|    BOOL has_initializer, is_for_of, has_destructuring;
28672|     13|    int tok, tok1, opcode, scope, block_scope_level;
28673|     13|    int label_next, label_expr, label_cont, label_body, label_break;
28674|     13|    int pos_next, pos_expr;
28675|     13|    BlockEnv break_entry;
28676|       |
28677|     13|    has_initializer = FALSE;
28678|     13|    has_destructuring = FALSE;
28679|     13|    is_for_of = FALSE;
28680|     13|    block_scope_level = fd->scope_level;
28681|     13|    label_cont = new_label(s);
28682|     13|    label_body = new_label(s);
28683|     13|    label_break = new_label(s);
28684|     13|    label_next = new_label(s);
28685|       |
28686|       |    /* create scope for the lexical variables declared in the enumeration
28687|       |       expressions. XXX: Not completely correct because of weird capturing
28688|       |       semantics in `for (i of o) a.push(function(){return i})` */
28689|     13|    push_scope(s);
28690|       |
28691|       |    /* local for_in scope starts here so individual elements
28692|       |       can be closed in statement. */
28693|     13|    push_break_entry(s->cur_func, &break_entry,
28694|     13|                     label_name, label_break, label_cont, 1);
28695|     13|    break_entry.scope_level = block_scope_level;
28696|       |
28697|     13|    label_expr = emit_goto(s, OP_goto, -1);
28698|       |
28699|     13|    pos_next = s->cur_func->byte_code.size;
28700|     13|    emit_label(s, label_next);
28701|       |
28702|     13|    tok = s->token.val;
28703|     13|    switch (is_let(s, DECL_MASK_OTHER)) {
  ------------------
  |  |28484|     13|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
28704|     13|    case TRUE:
  ------------------
  |  Branch (28704:5): [True: 13, False: 0]
  ------------------
28705|     13|        tok = TOK_LET;
28706|     13|        break;
28707|      0|    case FALSE:
  ------------------
  |  Branch (28707:5): [True: 0, False: 13]
  ------------------
28708|      0|        break;
28709|      0|    default:
  ------------------
  |  Branch (28709:5): [True: 0, False: 13]
  ------------------
28710|      0|        return -1;
28711|     13|    }
28712|     13|    if (tok == TOK_VAR || tok == TOK_LET || tok == TOK_CONST) {
  ------------------
  |  Branch (28712:9): [True: 0, False: 13]
  |  Branch (28712:27): [True: 13, False: 0]
  |  Branch (28712:45): [True: 0, False: 0]
  ------------------
28713|     13|        if (next_token(s))
  ------------------
  |  Branch (28713:13): [True: 0, False: 13]
  ------------------
28714|      0|            return -1;
28715|       |
28716|     13|        if (!(s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved)) {
  ------------------
  |  Branch (28716:15): [True: 13, False: 0]
  |  Branch (28716:44): [True: 13, False: 0]
  ------------------
28717|      0|            if (s->token.val == '[' || s->token.val == '{') {
  ------------------
  |  Branch (28717:17): [True: 0, False: 0]
  |  Branch (28717:40): [True: 0, False: 0]
  ------------------
28718|      0|                if (js_parse_destructuring_element(s, tok, 0, TRUE, -1, FALSE, FALSE) < 0)
  ------------------
  |  Branch (28718:21): [True: 0, False: 0]
  ------------------
28719|      0|                    return -1;
28720|      0|                has_destructuring = TRUE;
28721|      0|            } else {
28722|      0|                return js_parse_error(s, "variable name expected");
28723|      0|            }
28724|      0|            var_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
28725|     13|        } else {
28726|     13|            var_name = JS_DupAtom(ctx, s->token.u.ident.atom);
28727|     13|            if (next_token(s)) {
  ------------------
  |  Branch (28727:17): [True: 0, False: 13]
  ------------------
28728|      0|                JS_FreeAtom(s->ctx, var_name);
28729|      0|                return -1;
28730|      0|            }
28731|     13|            if (js_define_var(s, var_name, tok)) {
  ------------------
  |  Branch (28731:17): [True: 0, False: 13]
  ------------------
28732|      0|                JS_FreeAtom(s->ctx, var_name);
28733|      0|                return -1;
28734|      0|            }
28735|     13|            emit_op(s, (tok == TOK_CONST || tok == TOK_LET) ?
  ------------------
  |  Branch (28735:25): [True: 0, False: 13]
  |  Branch (28735:45): [True: 13, False: 0]
  ------------------
28736|     13|                    OP_scope_put_var_init : OP_scope_put_var);
28737|     13|            emit_atom(s, var_name);
28738|     13|            emit_u16(s, fd->scope_level);
28739|     13|        }
28740|     13|    } else if (!is_async && token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (28740:16): [True: 0, False: 0]
  |  Branch (28740:29): [True: 0, False: 0]
  ------------------
28741|      0|               peek_token(s, FALSE) == TOK_OF) {
  ------------------
  |  Branch (28741:16): [True: 0, False: 0]
  ------------------
28742|      0|        return js_parse_error(s, "'for of' expression cannot start with 'async'");
28743|      0|    } else {
28744|      0|        int skip_bits;
28745|      0|        if ((s->token.val == '[' || s->token.val == '{')
  ------------------
  |  Branch (28745:14): [True: 0, False: 0]
  |  Branch (28745:37): [True: 0, False: 0]
  ------------------
28746|      0|        &&  ((tok1 = js_parse_skip_parens_token(s, &skip_bits, FALSE)) == TOK_IN || tok1 == TOK_OF)) {
  ------------------
  |  Branch (28746:14): [True: 0, False: 0]
  |  Branch (28746:85): [True: 0, False: 0]
  ------------------
28747|      0|            if (js_parse_destructuring_element(s, 0, 0, TRUE, skip_bits & SKIP_HAS_ELLIPSIS, TRUE, FALSE) < 0)
  ------------------
  |  |24783|      0|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
  |  Branch (28747:17): [True: 0, False: 0]
  ------------------
28748|      0|                return -1;
28749|      0|        } else {
28750|      0|            int lvalue_label;
28751|      0|            if (js_parse_left_hand_side_expr(s))
  ------------------
  |  Branch (28751:17): [True: 0, False: 0]
  ------------------
28752|      0|                return -1;
28753|      0|            if (get_lvalue(s, &opcode, &scope, &var_name, &lvalue_label,
  ------------------
  |  Branch (28753:17): [True: 0, False: 0]
  ------------------
28754|      0|                           NULL, FALSE, TOK_FOR))
28755|      0|                return -1;
28756|      0|            put_lvalue(s, opcode, scope, var_name, lvalue_label,
28757|      0|                       PUT_LVALUE_NOKEEP_BOTTOM, FALSE);
28758|      0|        }
28759|      0|        var_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
28760|      0|    }
28761|     13|    emit_goto(s, OP_goto, label_body);
28762|       |
28763|     13|    pos_expr = s->cur_func->byte_code.size;
28764|     13|    emit_label(s, label_expr);
28765|     13|    if (s->token.val == '=') {
  ------------------
  |  Branch (28765:9): [True: 0, False: 13]
  ------------------
28766|       |        /* XXX: potential scoping issue if inside `with` statement */
28767|      0|        has_initializer = TRUE;
28768|       |        /* parse and evaluate initializer prior to evaluating the
28769|       |           object (only used with "for in" with a non lexical variable
28770|       |           in non strict mode */
28771|      0|        if (next_token(s) || js_parse_assign_expr2(s, 0)) {
  ------------------
  |  Branch (28771:13): [True: 0, False: 0]
  |  Branch (28771:30): [True: 0, False: 0]
  ------------------
28772|      0|            JS_FreeAtom(ctx, var_name);
28773|      0|            return -1;
28774|      0|        }
28775|      0|        if (var_name != JS_ATOM_NULL) {
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (28775:13): [True: 0, False: 0]
  ------------------
28776|      0|            emit_op(s, OP_scope_put_var);
28777|      0|            emit_atom(s, var_name);
28778|      0|            emit_u16(s, fd->scope_level);
28779|      0|        }
28780|      0|    }
28781|     13|    JS_FreeAtom(ctx, var_name);
28782|       |
28783|     13|    if (token_is_pseudo_keyword(s, JS_ATOM_of)) {
  ------------------
  |  Branch (28783:9): [True: 0, False: 13]
  ------------------
28784|      0|        is_for_of = TRUE;
28785|      0|        if (has_initializer)
  ------------------
  |  Branch (28785:13): [True: 0, False: 0]
  ------------------
28786|      0|            goto initializer_error;
28787|     13|    } else if (s->token.val == TOK_IN) {
  ------------------
  |  Branch (28787:16): [True: 13, False: 0]
  ------------------
28788|     13|        if (is_async)
  ------------------
  |  Branch (28788:13): [True: 0, False: 13]
  ------------------
28789|      0|            return js_parse_error(s, "'for await' loop should be used with 'of'");
28790|     13|        if (has_initializer &&
  ------------------
  |  Branch (28790:13): [True: 0, False: 13]
  ------------------
28791|      0|            (tok != TOK_VAR || (fd->js_mode & JS_MODE_STRICT) ||
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (28791:14): [True: 0, False: 0]
  |  Branch (28791:32): [True: 0, False: 0]
  ------------------
28792|      0|             has_destructuring)) {
  ------------------
  |  Branch (28792:14): [True: 0, False: 0]
  ------------------
28793|      0|        initializer_error:
28794|      0|            return js_parse_error(s, "a declaration in the head of a for-%s loop can't have an initializer",
28795|      0|                                  is_for_of ? "of" : "in");
  ------------------
  |  Branch (28795:35): [True: 0, False: 0]
  ------------------
28796|      0|        }
28797|     13|    } else {
28798|      0|        return js_parse_error(s, "expected 'of' or 'in' in for control expression");
28799|      0|    }
28800|     13|    if (next_token(s))
  ------------------
  |  Branch (28800:9): [True: 0, False: 13]
  ------------------
28801|      0|        return -1;
28802|     13|    if (is_for_of) {
  ------------------
  |  Branch (28802:9): [True: 0, False: 13]
  ------------------
28803|      0|        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (28803:13): [True: 0, False: 0]
  ------------------
28804|      0|            return -1;
28805|     13|    } else {
28806|     13|        if (js_parse_expr(s))
  ------------------
  |  Branch (28806:13): [True: 0, False: 13]
  ------------------
28807|      0|            return -1;
28808|     13|    }
28809|       |    /* close the scope after having evaluated the expression so that
28810|       |       the TDZ values are in the closures */
28811|     13|    close_scopes(s, s->cur_func->scope_level, block_scope_level);
28812|     13|    if (is_for_of) {
  ------------------
  |  Branch (28812:9): [True: 0, False: 13]
  ------------------
28813|       |        /* set has_iterator after the iterable expression is parsed so
28814|       |           that a yield in the expression does not try to close a
28815|       |           not-yet-created iterator */
28816|      0|        break_entry.has_iterator = TRUE;
28817|      0|        break_entry.drop_count += 2;
28818|      0|        if (is_async)
  ------------------
  |  Branch (28818:13): [True: 0, False: 0]
  ------------------
28819|      0|            emit_op(s, OP_for_await_of_start);
28820|      0|        else
28821|      0|            emit_op(s, OP_for_of_start);
28822|       |        /* on stack: enum_rec */
28823|     13|    } else {
28824|     13|        emit_op(s, OP_for_in_start);
28825|       |        /* on stack: enum_obj */
28826|     13|    }
28827|     13|    emit_goto(s, OP_goto, label_cont);
28828|       |
28829|     13|    if (js_parse_expect(s, ')'))
  ------------------
  |  Branch (28829:9): [True: 0, False: 13]
  ------------------
28830|      0|        return -1;
28831|       |
28832|     13|    if (OPTIMIZE) {
  ------------------
  |  |   50|     13|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 13, Folded]
  |  |  ------------------
  ------------------
28833|       |        /* move the `next` code here */
28834|     13|        DynBuf *bc = &s->cur_func->byte_code;
28835|     13|        int chunk_size = pos_expr - pos_next;
28836|     13|        int offset = bc->size - pos_next;
28837|     13|        int i;
28838|     13|        if (dbuf_claim(bc, chunk_size))
  ------------------
  |  Branch (28838:13): [True: 0, False: 13]
  ------------------
28839|      0|            return -1;
28840|     13|        dbuf_put(bc, bc->buf + pos_next, chunk_size);
28841|     13|        memset(bc->buf + pos_next, OP_nop, chunk_size);
28842|       |        /* `next` part ends with a goto */
28843|     13|        s->cur_func->last_opcode_pos = bc->size - 5;
28844|       |        /* relocate labels */
28845|     78|        for (i = label_cont; i < s->cur_func->label_count; i++) {
  ------------------
  |  Branch (28845:30): [True: 65, False: 13]
  ------------------
28846|     65|            LabelSlot *ls = &s->cur_func->label_slots[i];
28847|     65|            if (ls->pos >= pos_next && ls->pos < pos_expr)
  ------------------
  |  Branch (28847:17): [True: 26, False: 39]
  |  Branch (28847:40): [True: 13, False: 13]
  ------------------
28848|     13|                ls->pos += offset;
28849|     65|        }
28850|     13|    }
28851|       |
28852|     13|    emit_label(s, label_body);
28853|     13|    if (js_parse_statement(s))
  ------------------
  |  Branch (28853:9): [True: 2, False: 11]
  ------------------
28854|      2|        return -1;
28855|       |
28856|     11|    close_scopes(s, s->cur_func->scope_level, block_scope_level);
28857|       |
28858|     11|    emit_label(s, label_cont);
28859|     11|    if (is_for_of) {
  ------------------
  |  Branch (28859:9): [True: 0, False: 11]
  ------------------
28860|      0|        if (is_async) {
  ------------------
  |  Branch (28860:13): [True: 0, False: 0]
  ------------------
28861|       |            /* stack: iter_obj next catch_offset */
28862|       |            /* call the next method */
28863|      0|            emit_op(s, OP_for_await_of_next); 
28864|       |            /* get the result of the promise */
28865|      0|            emit_op(s, OP_await);
28866|       |            /* unwrap the value and done values */
28867|      0|            emit_op(s, OP_iterator_get_value_done);
28868|      0|        } else {
28869|      0|            emit_op(s, OP_for_of_next);
28870|      0|            emit_u8(s, 0);
28871|      0|        }
28872|     11|    } else {
28873|     11|        emit_op(s, OP_for_in_next);
28874|     11|    }
28875|       |    /* on stack: enum_rec / enum_obj value bool */
28876|     11|    emit_goto(s, OP_if_false, label_next);
28877|       |    /* drop the undefined value from for_xx_next */
28878|     11|    emit_op(s, OP_drop);
28879|       |
28880|     11|    emit_label(s, label_break);
28881|     11|    if (is_for_of) {
  ------------------
  |  Branch (28881:9): [True: 0, False: 11]
  ------------------
28882|       |        /* close and drop enum_rec */
28883|      0|        emit_op(s, OP_iterator_close);
28884|     11|    } else {
28885|     11|        emit_op(s, OP_drop);
28886|     11|    }
28887|     11|    pop_break_entry(s->cur_func);
28888|     11|    pop_scope(s);
28889|     11|    return 0;
28890|     13|}
quickjs.c:is_let:
28620|     59|{
28621|     59|    int res = FALSE;
28622|     59|    const uint8_t *last_token_ptr;
28623|       |    
28624|     59|    if (token_is_pseudo_keyword(s, JS_ATOM_let)) {
  ------------------
  |  Branch (28624:9): [True: 13, False: 46]
  ------------------
28625|     13|        JSParsePos pos;
28626|     13|        js_parse_get_pos(s, &pos);
28627|     13|        for (;;) {
28628|     13|            last_token_ptr = s->token.ptr;
28629|     13|            if (next_token(s)) {
  ------------------
  |  Branch (28629:17): [True: 0, False: 13]
  ------------------
28630|      0|                res = -1;
28631|      0|                break;
28632|      0|            }
28633|     13|            if (s->token.val == '[') {
  ------------------
  |  Branch (28633:17): [True: 0, False: 13]
  ------------------
28634|       |                /* let [ is a syntax restriction:
28635|       |                   it never introduces an ExpressionStatement */
28636|      0|                res = TRUE;
28637|      0|                break;
28638|      0|            }
28639|     13|            if (s->token.val == '{' ||
  ------------------
  |  Branch (28639:17): [True: 0, False: 13]
  ------------------
28640|     13|                (s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved) ||
  ------------------
  |  Branch (28640:18): [True: 13, False: 0]
  |  Branch (28640:47): [True: 13, False: 0]
  ------------------
28641|      0|                s->token.val == TOK_LET ||
  ------------------
  |  Branch (28641:17): [True: 0, False: 0]
  ------------------
28642|      0|                s->token.val == TOK_YIELD ||
  ------------------
  |  Branch (28642:17): [True: 0, False: 0]
  ------------------
28643|     13|                s->token.val == TOK_AWAIT) {
  ------------------
  |  Branch (28643:17): [True: 0, False: 0]
  ------------------
28644|       |                /* Check for possible ASI if not scanning for Declaration */
28645|       |                /* XXX: should also check that `{` introduces a BindingPattern,
28646|       |                   but Firefox does not and rejects eval("let=1;let\n{if(1)2;}") */
28647|     13|                if (!has_lf_in_range(last_token_ptr, s->token.ptr) ||
  ------------------
  |  Branch (28647:21): [True: 13, False: 0]
  ------------------
28648|     13|                    (decl_mask & DECL_MASK_OTHER)) {
  ------------------
  |  |28484|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (28648:21): [True: 0, False: 0]
  ------------------
28649|     13|                    res = TRUE;
28650|     13|                    break;
28651|     13|                }
28652|      0|                break;
28653|     13|            }
28654|      0|            break;
28655|     13|        }
28656|     13|        if (js_parse_seek_token(s, &pos)) {
  ------------------
  |  Branch (28656:13): [True: 0, False: 13]
  ------------------
28657|      0|            res = -1;
28658|      0|        }
28659|     13|    }
28660|     59|    return res;
28661|     59|}
quickjs.c:close_scopes:
24165|     24|{
24166|     48|    while (scope > scope_stop) {
  ------------------
  |  Branch (24166:12): [True: 24, False: 24]
  ------------------
24167|     24|        emit_op(s, OP_leave_scope);
24168|     24|        emit_u16(s, scope);
24169|     24|        scope = s->cur_func->scopes[scope].parent;
24170|     24|    }
24171|     24|}
quickjs.c:emit_atom:
23874|     47|{
23875|     47|    DynBuf *bc = &s->cur_func->byte_code;
23876|     47|    if (dbuf_claim(bc, 4))
  ------------------
  |  Branch (23876:9): [True: 0, False: 47]
  ------------------
23877|      0|        return; /* not enough memory : don't duplicate the atom */
23878|     47|    put_u32(bc->buf + bc->size, JS_DupAtom(s->ctx, name));
23879|     47|    bc->size += 4;
23880|     47|}
quickjs.c:emit_return:
28393|     19|{
28394|     19|    BlockEnv *top;
28395|       |
28396|     19|    if (s->cur_func->func_kind != JS_FUNC_NORMAL) {
  ------------------
  |  Branch (28396:9): [True: 11, False: 8]
  ------------------
28397|     11|        if (!hasval) {
  ------------------
  |  Branch (28397:13): [True: 11, False: 0]
  ------------------
28398|       |            /* no value: direct return in case of async generator */
28399|     11|            emit_op(s, OP_undefined);
28400|     11|            hasval = TRUE;
28401|     11|        } else if (s->cur_func->func_kind == JS_FUNC_ASYNC_GENERATOR) {
  ------------------
  |  Branch (28401:20): [True: 0, False: 0]
  ------------------
28402|       |            /* the await must be done before handling the "finally" in
28403|       |               case it raises an exception */
28404|      0|            emit_op(s, OP_await);
28405|      0|        }
28406|     11|    }
28407|       |
28408|     19|    top = s->cur_func->top_break;
28409|     19|    while (top != NULL) {
  ------------------
  |  Branch (28409:12): [True: 0, False: 19]
  ------------------
28410|      0|        if (top->has_iterator || top->label_finally != -1) {
  ------------------
  |  Branch (28410:13): [True: 0, False: 0]
  |  Branch (28410:34): [True: 0, False: 0]
  ------------------
28411|      0|            if (!hasval) {
  ------------------
  |  Branch (28411:17): [True: 0, False: 0]
  ------------------
28412|      0|                emit_op(s, OP_undefined);
28413|      0|                hasval = TRUE;
28414|      0|            }
28415|       |            /* Remove the stack elements up to and including the catch
28416|       |               offset. When 'yield' is used in an expression we have
28417|       |               no easy way to count them, so we use this specific
28418|       |               instruction instead. */
28419|      0|            emit_op(s, OP_nip_catch);
28420|       |            /* stack: iter_obj next ret_val */
28421|      0|            if (top->has_iterator) {
  ------------------
  |  Branch (28421:17): [True: 0, False: 0]
  ------------------
28422|      0|                if (s->cur_func->func_kind == JS_FUNC_ASYNC_GENERATOR) {
  ------------------
  |  Branch (28422:21): [True: 0, False: 0]
  ------------------
28423|      0|                    int label_next, label_next2;
28424|      0|                    emit_op(s, OP_nip); /* next */
28425|      0|                    emit_op(s, OP_swap);
28426|      0|                    emit_op(s, OP_get_field2);
28427|      0|                    emit_atom(s, JS_ATOM_return);
28428|       |                    /* stack: iter_obj return_func */
28429|      0|                    emit_op(s, OP_dup);
28430|      0|                    emit_op(s, OP_is_undefined_or_null);
28431|      0|                    label_next = emit_goto(s, OP_if_true, -1);
28432|      0|                    emit_op(s, OP_call_method);
28433|      0|                    emit_u16(s, 0);
28434|      0|                    emit_op(s, OP_iterator_check_object);
28435|      0|                    emit_op(s, OP_await);
28436|      0|                    label_next2 = emit_goto(s, OP_goto, -1);
28437|      0|                    emit_label(s, label_next);
28438|      0|                    emit_op(s, OP_drop);
28439|      0|                    emit_label(s, label_next2);
28440|      0|                    emit_op(s, OP_drop);
28441|      0|                } else {
28442|      0|                    emit_op(s, OP_rot3r);
28443|      0|                    emit_op(s, OP_undefined); /* dummy catch offset */
28444|      0|                    emit_op(s, OP_iterator_close);
28445|      0|                }
28446|      0|            } else {
28447|       |                /* execute the "finally" block */
28448|      0|                emit_goto(s, OP_gosub, top->label_finally);
28449|      0|            }
28450|      0|        }
28451|      0|        top = top->prev;
28452|      0|    }
28453|     19|    if (s->cur_func->is_derived_class_constructor) {
  ------------------
  |  Branch (28453:9): [True: 0, False: 19]
  ------------------
28454|      0|        int label_return;
28455|       |
28456|       |        /* 'this' can be uninitialized, so it may be accessed only if
28457|       |           the derived class constructor does not return an object */
28458|      0|        if (hasval) {
  ------------------
  |  Branch (28458:13): [True: 0, False: 0]
  ------------------
28459|      0|            emit_op(s, OP_check_ctor_return);
28460|      0|            label_return = emit_goto(s, OP_if_false, -1);
28461|      0|            emit_op(s, OP_drop);
28462|      0|        } else {
28463|      0|            label_return = -1;
28464|      0|        }
28465|       |
28466|       |        /* The error should be raised in the caller context, so we use
28467|       |           a specific opcode */
28468|      0|        emit_op(s, OP_scope_get_var_checkthis);
28469|      0|        emit_atom(s, JS_ATOM_this);
28470|      0|        emit_u16(s, 0);
28471|       |
28472|      0|        emit_label(s, label_return);
28473|      0|        emit_op(s, OP_return);
28474|     19|    } else if (s->cur_func->func_kind != JS_FUNC_NORMAL) {
  ------------------
  |  Branch (28474:16): [True: 11, False: 8]
  ------------------
28475|     11|        emit_op(s, OP_return_async);
28476|     11|    } else {
28477|      8|        emit_op(s, hasval ? OP_return : OP_return_undef);
  ------------------
  |  Branch (28477:20): [True: 7, False: 1]
  ------------------
28478|      8|    }
28479|     19|}
quickjs.c:js_free_function_def:
32163|      7|{
32164|      7|    int i;
32165|      7|    struct list_head *el, *el1;
32166|       |
32167|       |    /* free the child functions */
32168|      7|    list_for_each_safe(el, el1, &fd->child_list) {
  ------------------
  |  |   89|      8|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 1, False: 7]
  |  |  ------------------
  |  |   90|      7|        el = el1, el1 = el->next)
  ------------------
32169|      1|        JSFunctionDef *fd1;
32170|      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)))
  |  |  ------------------
  ------------------
32171|      1|        js_free_function_def(ctx, fd1);
32172|      1|    }
32173|       |
32174|      7|    free_bytecode_atoms(ctx->rt, fd->byte_code.buf, fd->byte_code.size,
32175|      7|                        fd->use_short_opcodes);
32176|      7|    dbuf_free(&fd->byte_code);
32177|      7|    js_free(ctx, fd->jump_slots);
32178|      7|    js_free(ctx, fd->label_slots);
32179|      7|    js_free(ctx, fd->line_number_slots);
32180|       |
32181|      8|    for(i = 0; i < fd->cpool_count; i++) {
  ------------------
  |  Branch (32181:16): [True: 1, False: 7]
  ------------------
32182|      1|        JS_FreeValue(ctx, fd->cpool[i]);
32183|      1|    }
32184|      7|    js_free(ctx, fd->cpool);
32185|       |
32186|      7|    JS_FreeAtom(ctx, fd->func_name);
32187|       |
32188|     24|    for(i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (32188:16): [True: 17, False: 7]
  ------------------
32189|     17|        JS_FreeAtom(ctx, fd->vars[i].var_name);
32190|     17|    }
32191|      7|    js_free(ctx, fd->vars);
32192|     11|    for(i = 0; i < fd->arg_count; i++) {
  ------------------
  |  Branch (32192:16): [True: 4, False: 7]
  ------------------
32193|      4|        JS_FreeAtom(ctx, fd->args[i].var_name);
32194|      4|    }
32195|      7|    js_free(ctx, fd->args);
32196|       |
32197|      8|    for(i = 0; i < fd->global_var_count; i++) {
  ------------------
  |  Branch (32197:16): [True: 1, False: 7]
  ------------------
32198|      1|        JS_FreeAtom(ctx, fd->global_vars[i].var_name);
32199|      1|    }
32200|      7|    js_free(ctx, fd->global_vars);
32201|       |
32202|      7|    for(i = 0; i < fd->closure_var_count; i++) {
  ------------------
  |  Branch (32202:16): [True: 0, False: 7]
  ------------------
32203|      0|        JSClosureVar *cv = &fd->closure_var[i];
32204|      0|        JS_FreeAtom(ctx, cv->var_name);
32205|      0|    }
32206|      7|    js_free(ctx, fd->closure_var);
32207|       |
32208|      7|    if (fd->scopes != fd->def_scope_array)
  ------------------
  |  Branch (32208:9): [True: 2, False: 5]
  ------------------
32209|      2|        js_free(ctx, fd->scopes);
32210|       |
32211|      7|    JS_FreeAtom(ctx, fd->filename);
32212|      7|    dbuf_free(&fd->pc2line);
32213|       |
32214|      7|    js_free(ctx, fd->source);
32215|       |
32216|      7|    if (fd->parent) {
  ------------------
  |  Branch (32216:9): [True: 3, False: 4]
  ------------------
32217|       |        /* remove in parent list */
32218|      3|        list_del(&fd->link);
32219|      3|    }
32220|      7|    js_free(ctx, fd);
32221|      7|}
quickjs.c:js_create_function:
36025|     20|{
36026|     20|    JSValue func_obj;
36027|     20|    JSFunctionBytecode *b;
36028|     20|    struct list_head *el, *el1;
36029|     20|    int stack_size, scope, idx;
36030|     20|    int function_size, byte_code_offset, cpool_offset;
36031|     20|    int closure_var_offset, vardefs_offset;
36032|     20|    BOOL strip_var_debug;
36033|       |    
36034|       |    /* recompute scope linkage */
36035|     63|    for (scope = 0; scope < fd->scope_count; scope++) {
  ------------------
  |  Branch (36035:21): [True: 43, False: 20]
  ------------------
36036|     43|        fd->scopes[scope].first = -1;
36037|     43|    }
36038|     20|    if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36038:9): [True: 2, False: 18]
  ------------------
36039|       |        /* special end of variable list marker for the argument scope */
36040|      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)
  ------------------
36041|      2|    }
36042|     34|    for (idx = 0; idx < fd->var_count; idx++) {
  ------------------
  |  Branch (36042:19): [True: 14, False: 20]
  ------------------
36043|     14|        JSVarDef *vd = &fd->vars[idx];
36044|     14|        vd->scope_next = fd->scopes[vd->scope_level].first;
36045|     14|        fd->scopes[vd->scope_level].first = idx;
36046|     14|    }
36047|     23|    for (scope = 2; scope < fd->scope_count; scope++) {
  ------------------
  |  Branch (36047:21): [True: 3, False: 20]
  ------------------
36048|      3|        JSVarScope *sd = &fd->scopes[scope];
36049|      3|        if (sd->first < 0)
  ------------------
  |  Branch (36049:13): [True: 2, False: 1]
  ------------------
36050|      2|            sd->first = fd->scopes[sd->parent].first;
36051|      3|    }
36052|     34|    for (idx = 0; idx < fd->var_count; idx++) {
  ------------------
  |  Branch (36052:19): [True: 14, False: 20]
  ------------------
36053|     14|        JSVarDef *vd = &fd->vars[idx];
36054|     14|        if (vd->scope_next < 0 && vd->scope_level > 1) {
  ------------------
  |  Branch (36054:13): [True: 12, False: 2]
  |  Branch (36054:35): [True: 1, False: 11]
  ------------------
36055|      1|            scope = fd->scopes[vd->scope_level].parent;
36056|      1|            vd->scope_next = fd->scopes[scope].first;
36057|      1|        }
36058|     14|    }
36059|       |
36060|       |    /* if the function contains an eval call, the closure variables
36061|       |       are used to compile the eval and they must be ordered by scope,
36062|       |       so it is necessary to create the closure variables before any
36063|       |       other variable lookup is done. */
36064|     20|    if (fd->has_eval_call)
  ------------------
  |  Branch (36064:9): [True: 0, False: 20]
  ------------------
36065|      0|        add_eval_variables(ctx, fd);
36066|       |
36067|       |    /* add the module global variables in the closure */
36068|     20|    if (fd->is_eval) {
  ------------------
  |  Branch (36068:9): [True: 18, False: 2]
  ------------------
36069|     18|        if (add_global_variables(ctx, fd))
  ------------------
  |  Branch (36069:13): [True: 0, False: 18]
  ------------------
36070|      0|            goto fail;
36071|     18|    } 
36072|       |
36073|       |    /* first create all the child functions */
36074|     20|    list_for_each_safe(el, el1, &fd->child_list) {
  ------------------
  |  |   89|     22|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 2, False: 20]
  |  |  ------------------
  |  |   90|     20|        el = el1, el1 = el->next)
  ------------------
36075|      2|        JSFunctionDef *fd1;
36076|      2|        int cpool_idx;
36077|       |
36078|      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)))
  |  |  ------------------
  ------------------
36079|      2|        cpool_idx = fd1->parent_cpool_idx;
36080|      2|        func_obj = js_create_function(ctx, fd1);
36081|      2|        if (JS_IsException(func_obj))
  ------------------
  |  Branch (36081:13): [True: 0, False: 2]
  ------------------
36082|      0|            goto fail;
36083|       |        /* save it in the constant pool */
36084|      2|        assert(cpool_idx >= 0);
  ------------------
  |  Branch (36084:9): [True: 0, False: 2]
  |  Branch (36084:9): [True: 2, False: 0]
  ------------------
36085|      2|        fd->cpool[cpool_idx] = func_obj;
36086|      2|    }
36087|       |
36088|       |#if defined(DUMP_BYTECODE) && (DUMP_BYTECODE & 4)
36089|       |    if (!fd->strip_debug) {
36090|       |        printf("pass 1\n");
36091|       |        dump_byte_code(ctx, 1, fd->byte_code.buf, fd->byte_code.size,
36092|       |                       NULL, fd->args, fd->arg_count, fd->vars, fd->var_count,
36093|       |                       fd->closure_var, fd->closure_var_count,
36094|       |                       fd->cpool, fd->cpool_count, fd->source,
36095|       |                       fd->label_slots, NULL);
36096|       |        printf("\n");
36097|       |    }
36098|       |#endif
36099|       |
36100|     20|    if (resolve_variables(ctx, fd))
  ------------------
  |  Branch (36100:9): [True: 0, False: 20]
  ------------------
36101|      0|        goto fail;
36102|       |
36103|       |#if defined(DUMP_BYTECODE) && (DUMP_BYTECODE & 2)
36104|       |    if (!fd->strip_debug) {
36105|       |        printf("pass 2\n");
36106|       |        dump_byte_code(ctx, 2, fd->byte_code.buf, fd->byte_code.size,
36107|       |                       NULL, fd->args, fd->arg_count, fd->vars, fd->var_count,
36108|       |                       fd->closure_var, fd->closure_var_count,
36109|       |                       fd->cpool, fd->cpool_count, fd->source,
36110|       |                       fd->label_slots, NULL);
36111|       |        printf("\n");
36112|       |    }
36113|       |#endif
36114|       |
36115|     20|    if (resolve_labels(ctx, fd))
  ------------------
  |  Branch (36115:9): [True: 0, False: 20]
  ------------------
36116|      0|        goto fail;
36117|       |
36118|     20|    if (compute_stack_size(ctx, fd, &stack_size) < 0)
  ------------------
  |  Branch (36118:9): [True: 0, False: 20]
  ------------------
36119|      0|        goto fail;
36120|       |
36121|     20|    if (fd->strip_debug) {
  ------------------
  |  Branch (36121:9): [True: 0, False: 20]
  ------------------
36122|      0|        function_size = offsetof(JSFunctionBytecode, debug);
36123|     20|    } else {
36124|     20|        function_size = sizeof(*b);
36125|     20|    }
36126|     20|    cpool_offset = function_size;
36127|     20|    function_size += fd->cpool_count * sizeof(*fd->cpool);
36128|     20|    vardefs_offset = function_size;
36129|     20|    function_size += (fd->arg_count + fd->var_count) * sizeof(*b->vardefs);
36130|     20|    closure_var_offset = function_size;
36131|     20|    function_size += fd->closure_var_count * sizeof(*fd->closure_var);
36132|     20|    byte_code_offset = function_size;
36133|     20|    function_size += fd->byte_code.size;
36134|       |
36135|     20|    b = js_mallocz(ctx, function_size);
36136|     20|    if (!b)
  ------------------
  |  Branch (36136:9): [True: 0, False: 20]
  ------------------
36137|      0|        goto fail;
36138|     20|    js_rc(b)->ref_count = 1;
36139|       |
36140|     20|    b->byte_code_buf = (void *)((uint8_t*)b + byte_code_offset);
36141|     20|    b->byte_code_len = fd->byte_code.size;
36142|     20|    memcpy(b->byte_code_buf, fd->byte_code.buf, fd->byte_code.size);
36143|     20|    js_free(ctx, fd->byte_code.buf);
36144|     20|    fd->byte_code.buf = NULL;
36145|       |
36146|     20|    strip_var_debug = fd->strip_debug && !fd->has_eval_call; /* XXX: check */
  ------------------
  |  Branch (36146:23): [True: 0, False: 20]
  |  Branch (36146:42): [True: 0, False: 0]
  ------------------
36147|     20|    b->func_name = fd->func_name;
36148|     20|    if (fd->arg_count + fd->var_count > 0) {
  ------------------
  |  Branch (36148:9): [True: 9, False: 11]
  ------------------
36149|      9|        int i;
36150|      9|        b->vardefs = (void *)((uint8_t*)b + vardefs_offset);
36151|     13|        for(i = 0; i < fd->arg_count; i++) {
  ------------------
  |  Branch (36151:20): [True: 4, False: 9]
  ------------------
36152|      4|            JSVarDef *vd = &fd->args[i];
36153|      4|            JSBytecodeVarDef *vd1 = &b->vardefs[i];
36154|      4|            if (strip_var_debug) {
  ------------------
  |  Branch (36154:17): [True: 0, False: 4]
  ------------------
36155|      0|                JS_FreeAtom(ctx, vd->var_name);
36156|      0|                vd1->var_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
36157|      4|            } else {
36158|      4|                vd1->var_name = vd->var_name;
36159|      4|            }
36160|      4|            vd1->has_scope = (vd->scope_level != 0);
36161|      4|            vd1->scope_next = vd->scope_next;
36162|      4|            vd1->is_const = vd->is_const;
36163|      4|            vd1->is_lexical = vd->is_lexical;
36164|      4|            vd1->is_captured = vd->is_captured;
36165|      4|            vd1->var_kind = vd->var_kind;
36166|      4|            vd1->var_ref_idx = vd->var_ref_idx;
36167|      4|        }
36168|       |        
36169|     23|        for(i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (36169:20): [True: 14, False: 9]
  ------------------
36170|     14|            JSVarDef *vd = &fd->vars[i];
36171|     14|            JSBytecodeVarDef *vd1 = &b->vardefs[i + fd->arg_count];
36172|     14|            if (strip_var_debug) {
  ------------------
  |  Branch (36172:17): [True: 0, False: 14]
  ------------------
36173|      0|                JS_FreeAtom(ctx, vd->var_name);
36174|      0|                vd1->var_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
36175|     14|            } else {
36176|     14|                vd1->var_name = vd->var_name;
36177|     14|            }
36178|     14|            vd1->has_scope = (vd->scope_level != 0);
36179|     14|            vd1->scope_next = vd->scope_next;
36180|     14|            vd1->is_const = vd->is_const;
36181|     14|            vd1->is_lexical = vd->is_lexical;
36182|     14|            vd1->is_captured = vd->is_captured;
36183|     14|            vd1->var_kind = vd->var_kind;
36184|     14|            vd1->var_ref_idx = vd->var_ref_idx;
36185|     14|        }
36186|      9|        b->var_count = fd->var_count;
36187|      9|        b->arg_count = fd->arg_count;
36188|      9|        b->defined_arg_count = fd->defined_arg_count;
36189|      9|        b->var_ref_count = fd->var_ref_count;
36190|      9|        js_free(ctx, fd->args);
36191|      9|        js_free(ctx, fd->vars);
36192|      9|    }
36193|     20|    b->cpool_count = fd->cpool_count;
36194|     20|    if (b->cpool_count) {
  ------------------
  |  Branch (36194:9): [True: 6, False: 14]
  ------------------
36195|      6|        b->cpool = (void *)((uint8_t*)b + cpool_offset);
36196|      6|        memcpy(b->cpool, fd->cpool, b->cpool_count * sizeof(*b->cpool));
36197|      6|    }
36198|     20|    js_free(ctx, fd->cpool);
36199|     20|    fd->cpool = NULL;
36200|       |
36201|     20|    b->stack_size = stack_size;
36202|       |
36203|     20|    if (fd->strip_debug) {
  ------------------
  |  Branch (36203:9): [True: 0, False: 20]
  ------------------
36204|      0|        JS_FreeAtom(ctx, fd->filename);
36205|      0|        dbuf_free(&fd->pc2line);    // probably useless
36206|     20|    } else {
36207|       |        /* XXX: source and pc2line info should be packed at the end of the
36208|       |           JSFunctionBytecode structure, avoiding allocation overhead
36209|       |         */
36210|     20|        b->has_debug = 1;
36211|     20|        b->debug.filename = fd->filename;
36212|       |
36213|       |        //DynBuf pc2line;
36214|       |        //compute_pc2line_info(fd, &pc2line);
36215|       |        //js_free(ctx, fd->line_number_slots)
36216|     20|        b->debug.pc2line_buf = js_realloc(ctx, fd->pc2line.buf, fd->pc2line.size);
36217|     20|        if (!b->debug.pc2line_buf)
  ------------------
  |  Branch (36217:13): [True: 0, False: 20]
  ------------------
36218|      0|            b->debug.pc2line_buf = fd->pc2line.buf;
36219|     20|        b->debug.pc2line_len = fd->pc2line.size;
36220|     20|        b->debug.source = fd->source;
36221|     20|        b->debug.source_len = fd->source_len;
36222|     20|    }
36223|     20|    if (fd->scopes != fd->def_scope_array)
  ------------------
  |  Branch (36223:9): [True: 0, False: 20]
  ------------------
36224|      0|        js_free(ctx, fd->scopes);
36225|       |
36226|     20|    b->closure_var_count = fd->closure_var_count;
36227|     20|    if (b->closure_var_count) {
  ------------------
  |  Branch (36227:9): [True: 19, False: 1]
  ------------------
36228|     19|        if (strip_var_debug) {
  ------------------
  |  Branch (36228:13): [True: 0, False: 19]
  ------------------
36229|      0|            int i;
36230|      0|            for(i = 0; i < fd->closure_var_count; i++) {
  ------------------
  |  Branch (36230:24): [True: 0, False: 0]
  ------------------
36231|      0|                JSClosureVar *cv = &fd->closure_var[i];
36232|      0|                if (cv->closure_type != JS_CLOSURE_GLOBAL_REF &&
  ------------------
  |  Branch (36232:21): [True: 0, False: 0]
  ------------------
36233|      0|                    cv->closure_type != JS_CLOSURE_GLOBAL_DECL &&
  ------------------
  |  Branch (36233:21): [True: 0, False: 0]
  ------------------
36234|      0|                    cv->closure_type != JS_CLOSURE_GLOBAL &&
  ------------------
  |  Branch (36234:21): [True: 0, False: 0]
  ------------------
36235|      0|                    cv->closure_type != JS_CLOSURE_MODULE_DECL &&
  ------------------
  |  Branch (36235:21): [True: 0, False: 0]
  ------------------
36236|      0|                    cv->closure_type != JS_CLOSURE_MODULE_IMPORT) {
  ------------------
  |  Branch (36236:21): [True: 0, False: 0]
  ------------------
36237|      0|                    JS_FreeAtom(ctx, cv->var_name);
36238|      0|                    cv->var_name = JS_ATOM_NULL;
  ------------------
  |  |  451|      0|#define JS_ATOM_NULL 0
  ------------------
36239|      0|                }
36240|      0|            }
36241|      0|        }
36242|     19|        b->closure_var = (void *)((uint8_t*)b + closure_var_offset);
36243|     19|        memcpy(b->closure_var, fd->closure_var, b->closure_var_count * sizeof(*b->closure_var));
36244|     19|    }
36245|     20|    js_free(ctx, fd->closure_var);
36246|     20|    fd->closure_var = NULL;
36247|       |
36248|     20|    b->has_prototype = fd->has_prototype;
36249|     20|    b->has_simple_parameter_list = fd->has_simple_parameter_list;
36250|     20|    b->js_mode = fd->js_mode;
36251|     20|    b->is_derived_class_constructor = fd->is_derived_class_constructor;
36252|     20|    b->func_kind = fd->func_kind;
36253|     20|    b->need_home_object = (fd->home_object_var_idx >= 0 ||
  ------------------
  |  Branch (36253:28): [True: 0, False: 20]
  ------------------
36254|     20|                           fd->need_home_object);
  ------------------
  |  Branch (36254:28): [True: 0, False: 20]
  ------------------
36255|     20|    b->new_target_allowed = fd->new_target_allowed;
36256|     20|    b->super_call_allowed = fd->super_call_allowed;
36257|     20|    b->super_allowed = fd->super_allowed;
36258|     20|    b->arguments_allowed = fd->arguments_allowed;
36259|     20|    b->is_direct_or_indirect_eval = (fd->eval_type == JS_EVAL_TYPE_DIRECT ||
  ------------------
  |  |  334|     40|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
  |  Branch (36259:38): [True: 0, False: 20]
  ------------------
36260|     20|                                     fd->eval_type == JS_EVAL_TYPE_INDIRECT);
  ------------------
  |  |  335|     20|#define JS_EVAL_TYPE_INDIRECT (3 << 0) /* indirect call (internal use) */
  ------------------
  |  Branch (36260:38): [True: 0, False: 20]
  ------------------
36261|     20|    b->realm = JS_DupContext(ctx);
36262|       |
36263|     20|    add_gc_object(ctx->rt, &b->header, JS_GC_OBJ_TYPE_FUNCTION_BYTECODE);
36264|       |
36265|       |#if defined(DUMP_BYTECODE) && (DUMP_BYTECODE & 1)
36266|       |    if (!fd->strip_debug) {
36267|       |        js_dump_function_bytecode(ctx, b);
36268|       |    }
36269|       |#endif
36270|       |
36271|     20|    if (fd->parent) {
  ------------------
  |  Branch (36271:9): [True: 2, False: 18]
  ------------------
36272|       |        /* remove from parent list */
36273|      2|        list_del(&fd->link);
36274|      2|    }
36275|       |
36276|     20|    js_free(ctx, fd);
36277|     20|    return JS_MKPTR(JS_TAG_FUNCTION_BYTECODE, b);
  ------------------
  |  |  248|     20|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
36278|      0| fail:
36279|      0|    js_free_function_def(ctx, fd);
36280|      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 }
  |  |  ------------------
  ------------------
36281|     20|}
quickjs.c:get_closure_var:
32741|      8|{
32742|      8|    int i;
32743|       |
32744|      8|    if (fd != s->parent) {
  ------------------
  |  Branch (32744:9): [True: 3, False: 5]
  ------------------
32745|      3|        var_idx = get_closure_var(ctx, s->parent, fd, closure_type,
32746|      3|                                  var_idx, var_name,
32747|      3|                                  is_const, is_lexical, var_kind);
32748|      3|        if (var_idx < 0)
  ------------------
  |  Branch (32748:13): [True: 0, False: 3]
  ------------------
32749|      0|            return -1;
32750|      3|        if (closure_type != JS_CLOSURE_GLOBAL_REF)
  ------------------
  |  Branch (32750:13): [True: 0, False: 3]
  ------------------
32751|      0|            closure_type = JS_CLOSURE_REF;
32752|      3|    }
32753|     17|    for(i = 0; i < s->closure_var_count; i++) {
  ------------------
  |  Branch (32753:16): [True: 10, False: 7]
  ------------------
32754|     10|        JSClosureVar *cv = &s->closure_var[i];
32755|     10|        if (cv->var_idx == var_idx && cv->closure_type == closure_type)
  ------------------
  |  Branch (32755:13): [True: 1, False: 9]
  |  Branch (32755:39): [True: 1, False: 0]
  ------------------
32756|      1|            return i;
32757|     10|    }
32758|      7|    return add_closure_var(ctx, s, closure_type, var_idx, var_name,
32759|      7|                           is_const, is_lexical, var_kind);
32760|      8|}
quickjs.c:add_global_variables:
35955|     18|{
35956|     18|    int i, idx;
35957|     18|    JSModuleDef *m = fd->module;
35958|     18|    JSExportEntry *me;
35959|     18|    JSGlobalVar *hf;
35960|     18|    BOOL need_global_closures;
35961|       |    
35962|       |    /* Script: add the defined global variables. In the non strict
35963|       |       direct eval not in global scope, the global variables are
35964|       |       created in the enclosing scope so they are not created as
35965|       |       variable references.
35966|       |
35967|       |       In modules, the imported global variables were added as closure
35968|       |       global variables in js_parse_import().
35969|       |    */
35970|     18|    need_global_closures = TRUE;
35971|     18|    if (fd->eval_type == JS_EVAL_TYPE_DIRECT && !(fd->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  334|     36|#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 (35971:9): [True: 0, False: 18]
  |  Branch (35971:49): [True: 0, False: 0]
  ------------------
35972|       |        /* XXX: add a flag ? */
35973|      0|        for(idx = 0; idx < fd->closure_var_count; idx++) {
  ------------------
  |  Branch (35973:22): [True: 0, False: 0]
  ------------------
35974|      0|            JSClosureVar *cv = &fd->closure_var[idx];
35975|      0|            if (cv->var_name == JS_ATOM__var_ ||
  ------------------
  |  Branch (35975:17): [True: 0, False: 0]
  ------------------
35976|      0|                cv->var_name == JS_ATOM__arg_var_) {
  ------------------
  |  Branch (35976:17): [True: 0, False: 0]
  ------------------
35977|      0|                need_global_closures = FALSE;
35978|      0|                break;
35979|      0|            }
35980|      0|        }
35981|      0|    }
35982|       |
35983|     18|    if (need_global_closures) {
  ------------------
  |  Branch (35983:9): [True: 18, False: 0]
  ------------------
35984|     18|        JSClosureTypeEnum closure_type;
35985|     18|        if (fd->module)
  ------------------
  |  Branch (35985:13): [True: 11, False: 7]
  ------------------
35986|     11|            closure_type = JS_CLOSURE_MODULE_DECL;
35987|      7|        else
35988|      7|            closure_type = JS_CLOSURE_GLOBAL_DECL;
35989|     18|        for(i = 0; i < fd->global_var_count; i++) {
  ------------------
  |  Branch (35989:20): [True: 0, False: 18]
  ------------------
35990|      0|            JSVarKindEnum var_kind;
35991|      0|            hf = &fd->global_vars[i];
35992|      0|            if (hf->cpool_idx >= 0 && !hf->is_lexical) {
  ------------------
  |  Branch (35992:17): [True: 0, False: 0]
  |  Branch (35992:39): [True: 0, False: 0]
  ------------------
35993|      0|                var_kind = JS_VAR_GLOBAL_FUNCTION_DECL;
35994|      0|            } else {
35995|      0|                var_kind = JS_VAR_NORMAL;
35996|      0|            }
35997|      0|            if (add_closure_var(ctx, fd, closure_type, i, hf->var_name, hf->is_const,
  ------------------
  |  Branch (35997:17): [True: 0, False: 0]
  ------------------
35998|      0|                                hf->is_lexical, var_kind) < 0)
35999|      0|                return -1;
36000|      0|        }
36001|     18|    }
36002|       |
36003|     18|    if (fd->module) {
  ------------------
  |  Branch (36003:9): [True: 11, False: 7]
  ------------------
36004|       |        /* resolve the variable names of the local exports */
36005|     11|        for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (36005:20): [True: 0, False: 11]
  ------------------
36006|      0|            me = &m->export_entries[i];
36007|      0|            if (me->export_type == JS_EXPORT_TYPE_LOCAL) {
  ------------------
  |  Branch (36007:17): [True: 0, False: 0]
  ------------------
36008|      0|                idx = find_closure_var(ctx, fd, me->local_name);
36009|      0|                if (idx < 0) {
  ------------------
  |  Branch (36009:21): [True: 0, False: 0]
  ------------------
36010|      0|                    JS_ThrowSyntaxErrorAtom(ctx, "exported variable '%s' does not exist",
  ------------------
  |  | 7732|      0|#define JS_ThrowSyntaxErrorAtom(ctx, fmt, atom) __JS_ThrowSyntaxErrorAtom(ctx, atom, fmt, "")
  ------------------
36011|      0|                                            me->local_name);
36012|      0|                    return -1;
36013|      0|                }
36014|      0|                me->u.local.var_idx = idx;
36015|      0|            }
36016|      0|        }
36017|     11|    }
36018|     18|    return 0;
36019|     18|}
quickjs.c:resolve_variables:
34188|     20|{
34189|     20|    int pos, pos_next, bc_len, op, len, line_num, i, idx;
34190|     20|    uint8_t *bc_buf;
34191|     20|    JSAtom var_name;
34192|     20|    DynBuf bc_out;
34193|     20|    CodeContext cc;
34194|     20|    int scope;
34195|       |
34196|     20|    cc.bc_buf = bc_buf = s->byte_code.buf;
34197|     20|    cc.bc_len = bc_len = s->byte_code.size;
34198|     20|    js_dbuf_bytecode_init(ctx, &bc_out);
34199|       |
34200|       |    /* first pass for runtime checks (must be done before the
34201|       |       variables are created) */
34202|       |    /* XXX: inefficient */
34203|     20|    for(i = 0; i < s->global_var_count; i++) {
  ------------------
  |  Branch (34203:16): [True: 0, False: 20]
  ------------------
34204|      0|        JSGlobalVar *hf = &s->global_vars[i];
34205|       |
34206|       |        /* check if global variable (XXX: simplify) */
34207|      0|        for(idx = 0; idx < s->closure_var_count; idx++) {
  ------------------
  |  Branch (34207:22): [True: 0, False: 0]
  ------------------
34208|      0|            JSClosureVar *cv = &s->closure_var[idx];
34209|      0|            if (cv->closure_type == JS_CLOSURE_GLOBAL_REF ||
  ------------------
  |  Branch (34209:17): [True: 0, False: 0]
  ------------------
34210|      0|                cv->closure_type == JS_CLOSURE_GLOBAL_DECL ||
  ------------------
  |  Branch (34210:17): [True: 0, False: 0]
  ------------------
34211|      0|                cv->closure_type == JS_CLOSURE_GLOBAL ||
  ------------------
  |  Branch (34211:17): [True: 0, False: 0]
  ------------------
34212|      0|                cv->closure_type == JS_CLOSURE_MODULE_DECL ||
  ------------------
  |  Branch (34212:17): [True: 0, False: 0]
  ------------------
34213|      0|                cv->closure_type == JS_CLOSURE_MODULE_IMPORT)
  ------------------
  |  Branch (34213:17): [True: 0, False: 0]
  ------------------
34214|      0|                goto next; /* don't look at global variables (they are at the end) */
34215|      0|            if (cv->var_name == hf->var_name) {
  ------------------
  |  Branch (34215:17): [True: 0, False: 0]
  ------------------
34216|      0|                if (s->eval_type == JS_EVAL_TYPE_DIRECT &&
  ------------------
  |  |  334|      0|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
  |  Branch (34216:21): [True: 0, False: 0]
  ------------------
34217|      0|                    cv->is_lexical) {
  ------------------
  |  Branch (34217:21): [True: 0, False: 0]
  ------------------
34218|       |                    /* Check if a lexical variable is
34219|       |                       redefined as 'var'. XXX: Could abort
34220|       |                       compilation here, but for consistency
34221|       |                       with the other checks, we delay the
34222|       |                       error generation. */
34223|      0|                    dbuf_putc(&bc_out, OP_throw_error);
34224|      0|                    dbuf_put_u32(&bc_out, JS_DupAtom(ctx, hf->var_name));
34225|      0|                    dbuf_putc(&bc_out, JS_THROW_VAR_REDECL);
  ------------------
  |  |18334|      0|#define JS_THROW_VAR_REDECL         1
  ------------------
34226|      0|                }
34227|      0|                goto next;
34228|      0|            }
34229|      0|            if (cv->var_name == JS_ATOM__var_ ||
  ------------------
  |  Branch (34229:17): [True: 0, False: 0]
  ------------------
34230|      0|                cv->var_name == JS_ATOM__arg_var_)
  ------------------
  |  Branch (34230:17): [True: 0, False: 0]
  ------------------
34231|      0|                goto next;
34232|      0|        }
34233|      0|    next: ;
34234|      0|    }
34235|       |
34236|     20|    line_num = 0; /* avoid warning */
34237|    441|    for (pos = 0; pos < bc_len; pos = pos_next) {
  ------------------
  |  Branch (34237:19): [True: 421, False: 20]
  ------------------
34238|    421|        op = bc_buf[pos];
34239|    421|        len = opcode_info[op].size;
34240|    421|        pos_next = pos + len;
34241|    421|        switch(op) {
34242|    104|        case OP_line_num:
  ------------------
  |  Branch (34242:9): [True: 104, False: 317]
  ------------------
34243|    104|            line_num = get_u32(bc_buf + pos + 1);
34244|    104|            s->line_number_size++;
34245|    104|            goto no_change;
34246|       |
34247|      0|        case OP_eval: /* convert scope index to adjusted variable index */
  ------------------
  |  Branch (34247:9): [True: 0, False: 421]
  ------------------
34248|      0|            {
34249|      0|                int call_argc = get_u16(bc_buf + pos + 1);
34250|      0|                scope = get_u16(bc_buf + pos + 1 + 2);
34251|      0|                mark_eval_captured_variables(ctx, s, scope);
34252|      0|                dbuf_putc(&bc_out, op);
34253|      0|                dbuf_put_u16(&bc_out, call_argc);
34254|      0|                dbuf_put_u16(&bc_out, s->scopes[scope].first - ARG_SCOPE_END);
  ------------------
  |  |  636|      0|#define ARG_SCOPE_END (-2)
  ------------------
34255|      0|            }
34256|      0|            break;
34257|      0|        case OP_apply_eval: /* convert scope index to adjusted variable index */
  ------------------
  |  Branch (34257:9): [True: 0, False: 421]
  ------------------
34258|      0|            scope = get_u16(bc_buf + pos + 1);
34259|      0|            mark_eval_captured_variables(ctx, s, scope);
34260|      0|            dbuf_putc(&bc_out, op);
34261|      0|            dbuf_put_u16(&bc_out, s->scopes[scope].first - ARG_SCOPE_END);
  ------------------
  |  |  636|      0|#define ARG_SCOPE_END (-2)
  ------------------
34262|      0|            break;
34263|      0|        case OP_scope_get_var_checkthis:
  ------------------
  |  Branch (34263:9): [True: 0, False: 421]
  ------------------
34264|      0|        case OP_scope_get_var_undef:
  ------------------
  |  Branch (34264:9): [True: 0, False: 421]
  ------------------
34265|     59|        case OP_scope_get_var:
  ------------------
  |  Branch (34265:9): [True: 59, False: 362]
  ------------------
34266|     71|        case OP_scope_put_var:
  ------------------
  |  Branch (34266:9): [True: 12, False: 409]
  ------------------
34267|     71|        case OP_scope_delete_var:
  ------------------
  |  Branch (34267:9): [True: 0, False: 421]
  ------------------
34268|     71|        case OP_scope_get_ref:
  ------------------
  |  Branch (34268:9): [True: 0, False: 421]
  ------------------
34269|     76|        case OP_scope_put_var_init:
  ------------------
  |  Branch (34269:9): [True: 5, False: 416]
  ------------------
34270|     76|            var_name = get_u32(bc_buf + pos + 1);
34271|     76|            scope = get_u16(bc_buf + pos + 5);
34272|     76|            pos_next = resolve_scope_var(ctx, s, var_name, scope, op, &bc_out,
34273|     76|                                         NULL, NULL, pos_next);
34274|     76|            JS_FreeAtom(ctx, var_name);
34275|     76|            break;
34276|      0|        case OP_scope_make_ref:
  ------------------
  |  Branch (34276:9): [True: 0, False: 421]
  ------------------
34277|      0|            {
34278|      0|                int label;
34279|      0|                LabelSlot *ls;
34280|      0|                var_name = get_u32(bc_buf + pos + 1);
34281|      0|                label = get_u32(bc_buf + pos + 5);
34282|      0|                scope = get_u16(bc_buf + pos + 9);
34283|      0|                ls = &s->label_slots[label];
34284|      0|                ls->ref_count--;  /* always remove label reference */
34285|      0|                pos_next = resolve_scope_var(ctx, s, var_name, scope, op, &bc_out,
34286|      0|                                             bc_buf, ls, pos_next);
34287|      0|                JS_FreeAtom(ctx, var_name);
34288|      0|            }
34289|      0|            break;
34290|      0|        case OP_scope_get_private_field:
  ------------------
  |  Branch (34290:9): [True: 0, False: 421]
  ------------------
34291|      0|        case OP_scope_get_private_field2:
  ------------------
  |  Branch (34291:9): [True: 0, False: 421]
  ------------------
34292|      0|        case OP_scope_put_private_field:
  ------------------
  |  Branch (34292:9): [True: 0, False: 421]
  ------------------
34293|      0|        case OP_scope_in_private_field:
  ------------------
  |  Branch (34293:9): [True: 0, False: 421]
  ------------------
34294|      0|            {
34295|      0|                int ret;
34296|      0|                var_name = get_u32(bc_buf + pos + 1);
34297|      0|                scope = get_u16(bc_buf + pos + 5);
34298|      0|                ret = resolve_scope_private_field(ctx, s, var_name, scope, op, &bc_out);
34299|      0|                if (ret < 0)
  ------------------
  |  Branch (34299:21): [True: 0, False: 0]
  ------------------
34300|      0|                    goto fail;
34301|      0|                JS_FreeAtom(ctx, var_name);
34302|      0|            }
34303|      0|            break;
34304|      0|        case OP_gosub:
  ------------------
  |  Branch (34304:9): [True: 0, False: 421]
  ------------------
34305|      0|            s->jump_size++;
34306|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
34307|       |                /* remove calls to empty finalizers  */
34308|      0|                int label;
34309|      0|                LabelSlot *ls;
34310|       |
34311|      0|                label = get_u32(bc_buf + pos + 1);
34312|      0|                assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34312:17): [True: 0, False: 0]
  |  Branch (34312:17): [True: 0, False: 0]
  |  Branch (34312:17): [True: 0, False: 0]
  |  Branch (34312:17): [True: 0, False: 0]
  ------------------
34313|      0|                ls = &s->label_slots[label];
34314|      0|                if (code_match(&cc, ls->pos, OP_ret, -1)) {
  ------------------
  |  Branch (34314:21): [True: 0, False: 0]
  ------------------
34315|      0|                    ls->ref_count--;
34316|      0|                    break;
34317|      0|                }
34318|      0|            }
34319|      0|            goto no_change;
34320|     31|        case OP_drop:
  ------------------
  |  Branch (34320:9): [True: 31, False: 390]
  ------------------
34321|     31|            if (0) {
  ------------------
  |  Branch (34321:17): [Folded, False: 31]
  ------------------
34322|       |                /* remove drops before return_undef */
34323|       |                /* do not perform this optimization in pass2 because
34324|       |                   it breaks patterns recognised in resolve_labels */
34325|      0|                int pos1 = pos_next;
34326|      0|                int line1 = line_num;
34327|      0|                while (code_match(&cc, pos1, OP_drop, -1)) {
  ------------------
  |  Branch (34327:24): [True: 0, False: 0]
  ------------------
34328|      0|                    if (cc.line_num >= 0) line1 = cc.line_num;
  ------------------
  |  Branch (34328:25): [True: 0, False: 0]
  ------------------
34329|      0|                    pos1 = cc.pos;
34330|      0|                }
34331|      0|                if (code_match(&cc, pos1, OP_return_undef, -1)) {
  ------------------
  |  Branch (34331:21): [True: 0, False: 0]
  ------------------
34332|      0|                    pos_next = pos1;
34333|      0|                    if (line1 != -1 && line1 != line_num) {
  ------------------
  |  Branch (34333:25): [True: 0, False: 0]
  |  Branch (34333:40): [True: 0, False: 0]
  ------------------
34334|      0|                        line_num = line1;
34335|      0|                        s->line_number_size++;
34336|      0|                        dbuf_putc(&bc_out, OP_line_num);
34337|      0|                        dbuf_put_u32(&bc_out, line_num);
34338|      0|                    }
34339|      0|                    break;
34340|      0|                }
34341|      0|            }
34342|     31|            goto no_change;
34343|     31|        case OP_insert3:
  ------------------
  |  Branch (34343:9): [True: 0, False: 421]
  ------------------
34344|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
34345|       |                /* Transformation: insert3 put_array_el|put_ref_value drop -> put_array_el|put_ref_value */
34346|      0|                if (code_match(&cc, pos_next, M2(OP_put_array_el, OP_put_ref_value), OP_drop, -1)) {
  ------------------
  |  |33877|      0|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (34346:21): [True: 0, False: 0]
  ------------------
34347|      0|                    dbuf_putc(&bc_out, cc.op);
34348|      0|                    pos_next = cc.pos;
34349|      0|                    if (cc.line_num != -1 && cc.line_num != line_num) {
  ------------------
  |  Branch (34349:25): [True: 0, False: 0]
  |  Branch (34349:46): [True: 0, False: 0]
  ------------------
34350|      0|                        line_num = cc.line_num;
34351|      0|                        s->line_number_size++;
34352|      0|                        dbuf_putc(&bc_out, OP_line_num);
34353|      0|                        dbuf_put_u32(&bc_out, line_num);
34354|      0|                    }
34355|      0|                    break;
34356|      0|                }
34357|      0|            }
34358|      0|            goto no_change;
34359|       |
34360|      7|        case OP_goto:
  ------------------
  |  Branch (34360:9): [True: 7, False: 414]
  ------------------
34361|      7|            s->jump_size++;
34362|       |            /* fall thru */
34363|      7|        case OP_tail_call:
  ------------------
  |  Branch (34363:9): [True: 0, False: 421]
  ------------------
34364|      7|        case OP_tail_call_method:
  ------------------
  |  Branch (34364:9): [True: 0, False: 421]
  ------------------
34365|     16|        case OP_return:
  ------------------
  |  Branch (34365:9): [True: 9, False: 412]
  ------------------
34366|     16|        case OP_return_undef:
  ------------------
  |  Branch (34366:9): [True: 0, False: 421]
  ------------------
34367|     16|        case OP_throw:
  ------------------
  |  Branch (34367:9): [True: 0, False: 421]
  ------------------
34368|     16|        case OP_throw_error:
  ------------------
  |  Branch (34368:9): [True: 0, False: 421]
  ------------------
34369|     16|        case OP_ret:
  ------------------
  |  Branch (34369:9): [True: 0, False: 421]
  ------------------
34370|     16|            if (OPTIMIZE) {
  ------------------
  |  |   50|     16|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 16, Folded]
  |  |  ------------------
  ------------------
34371|       |                /* remove dead code */
34372|     16|                int line = -1;
34373|     16|                dbuf_put(&bc_out, bc_buf + pos, len);
34374|     16|                pos = skip_dead_code(s, bc_buf, bc_len, pos + len, &line);
34375|     16|                pos_next = pos;
34376|     16|                if (pos < bc_len && line >= 0 && line_num != line) {
  ------------------
  |  Branch (34376:21): [True: 7, False: 9]
  |  Branch (34376:37): [True: 0, False: 7]
  |  Branch (34376:50): [True: 0, False: 0]
  ------------------
34377|      0|                    line_num = line;
34378|      0|                    s->line_number_size++;
34379|      0|                    dbuf_putc(&bc_out, OP_line_num);
34380|      0|                    dbuf_put_u32(&bc_out, line_num);
34381|      0|                }
34382|     16|                break;
34383|     16|            }
34384|      0|            goto no_change;
34385|       |
34386|     12|        case OP_label:
  ------------------
  |  Branch (34386:9): [True: 12, False: 409]
  ------------------
34387|     12|            {
34388|     12|                int label;
34389|     12|                LabelSlot *ls;
34390|       |
34391|     12|                label = get_u32(bc_buf + pos + 1);
34392|     12|                assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34392:17): [True: 0, False: 12]
  |  Branch (34392:17): [True: 0, False: 0]
  |  Branch (34392:17): [True: 12, False: 0]
  |  Branch (34392:17): [True: 12, False: 0]
  ------------------
34393|     12|                ls = &s->label_slots[label];
34394|     12|                ls->pos2 = bc_out.size + opcode_info[op].size;
34395|     12|            }
34396|     12|            goto no_change;
34397|       |
34398|     23|        case OP_enter_scope:
  ------------------
  |  Branch (34398:9): [True: 23, False: 398]
  ------------------
34399|     23|            {
34400|     23|                int scope_idx, scope = get_u16(bc_buf + pos + 1);
34401|       |
34402|     23|                if (scope == s->body_scope) {
  ------------------
  |  Branch (34402:21): [True: 20, False: 3]
  ------------------
34403|     20|                    instantiate_hoisted_definitions(ctx, s, &bc_out);
34404|     20|                }
34405|       |
34406|     28|                for(scope_idx = s->scopes[scope].first; scope_idx >= 0;) {
  ------------------
  |  Branch (34406:57): [True: 7, False: 21]
  ------------------
34407|      7|                    JSVarDef *vd = &s->vars[scope_idx];
34408|      7|                    if (vd->scope_level == scope) {
  ------------------
  |  Branch (34408:25): [True: 5, False: 2]
  ------------------
34409|      5|                        if (scope_idx != s->arguments_arg_idx) {
  ------------------
  |  Branch (34409:29): [True: 5, False: 0]
  ------------------
34410|      5|                            if (vd->var_kind == JS_VAR_FUNCTION_DECL ||
  ------------------
  |  Branch (34410:33): [True: 0, False: 5]
  ------------------
34411|      5|                                vd->var_kind == JS_VAR_NEW_FUNCTION_DECL) {
  ------------------
  |  Branch (34411:33): [True: 0, False: 5]
  ------------------
34412|       |                                /* Initialize lexical variable upon entering scope */
34413|      0|                                dbuf_putc(&bc_out, OP_fclosure);
34414|      0|                                dbuf_put_u32(&bc_out, vd->func_pool_idx);
34415|      0|                                dbuf_putc(&bc_out, OP_put_loc);
34416|      0|                                dbuf_put_u16(&bc_out, scope_idx);
34417|      5|                            } else {
34418|       |                                /* XXX: should check if variable can be used
34419|       |                                   before initialization */
34420|      5|                                dbuf_putc(&bc_out, OP_set_loc_uninitialized);
34421|      5|                                dbuf_put_u16(&bc_out, scope_idx);
34422|      5|                            }
34423|      5|                        }
34424|      5|                        scope_idx = vd->scope_next;
34425|      5|                    } else {
34426|      2|                        break;
34427|      2|                    }
34428|      7|                }
34429|     23|            }
34430|     23|            break;
34431|       |
34432|      5|        case OP_leave_scope:
  ------------------
  |  Branch (34432:9): [True: 5, False: 416]
  ------------------
34433|      5|            {
34434|      5|                int scope_idx, scope = get_u16(bc_buf + pos + 1);
34435|       |
34436|     12|                for(scope_idx = s->scopes[scope].first; scope_idx >= 0;) {
  ------------------
  |  Branch (34436:57): [True: 7, False: 5]
  ------------------
34437|      7|                    JSVarDef *vd = &s->vars[scope_idx];
34438|      7|                    if (vd->scope_level == scope) {
  ------------------
  |  Branch (34438:25): [True: 7, False: 0]
  ------------------
34439|      7|                        if (vd->is_captured) {
  ------------------
  |  Branch (34439:29): [True: 0, False: 7]
  ------------------
34440|      0|                            dbuf_putc(&bc_out, OP_close_loc);
34441|      0|                            dbuf_put_u16(&bc_out, scope_idx);
34442|      0|                        }
34443|      7|                        scope_idx = vd->scope_next;
34444|      7|                    } else {
34445|      0|                        break;
34446|      0|                    }
34447|      7|                }
34448|      5|            }
34449|      5|            break;
34450|       |
34451|      2|        case OP_set_name:
  ------------------
  |  Branch (34451:9): [True: 2, False: 419]
  ------------------
34452|      2|            {
34453|       |                /* remove dummy set_name opcodes */
34454|      2|                JSAtom name = get_u32(bc_buf + pos + 1);
34455|      2|                if (name == JS_ATOM_NULL)
  ------------------
  |  |  451|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (34455:21): [True: 0, False: 2]
  ------------------
34456|      0|                    break;
34457|      2|            }
34458|      2|            goto no_change;
34459|       |
34460|      2|        case OP_if_false:
  ------------------
  |  Branch (34460:9): [True: 1, False: 420]
  ------------------
34461|      3|        case OP_if_true:
  ------------------
  |  Branch (34461:9): [True: 2, False: 419]
  ------------------
34462|      3|        case OP_catch:
  ------------------
  |  Branch (34462:9): [True: 0, False: 421]
  ------------------
34463|      3|            s->jump_size++;
34464|      3|            goto no_change;
34465|       |
34466|     14|        case OP_dup:
  ------------------
  |  Branch (34466:9): [True: 14, False: 407]
  ------------------
34467|     14|            if (OPTIMIZE) {
  ------------------
  |  |   50|     14|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 14, Folded]
  |  |  ------------------
  ------------------
34468|       |                /* Transformation: dup if_false(l1) drop, l1: if_false(l2) -> if_false(l2) */
34469|       |                /* Transformation: dup if_true(l1) drop, l1: if_true(l2) -> if_true(l2) */
34470|     14|                if (code_match(&cc, pos_next, M2(OP_if_false, OP_if_true), OP_drop, -1)) {
  ------------------
  |  |33877|     14|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (34470:21): [True: 0, False: 14]
  ------------------
34471|      0|                    int lab0, lab1, op1, pos1, line1, pos2;
34472|      0|                    lab0 = lab1 = cc.label;
34473|      0|                    assert(lab1 >= 0 && lab1 < s->label_count);
  ------------------
  |  Branch (34473:21): [True: 0, False: 0]
  |  Branch (34473:21): [True: 0, False: 0]
  |  Branch (34473:21): [True: 0, False: 0]
  |  Branch (34473:21): [True: 0, False: 0]
  ------------------
34474|      0|                    op1 = cc.op;
34475|      0|                    pos1 = cc.pos;
34476|      0|                    line1 = cc.line_num;
34477|      0|                    while (code_match(&cc, (pos2 = get_label_pos(s, lab1)), OP_dup, op1, OP_drop, -1)) {
  ------------------
  |  Branch (34477:28): [True: 0, False: 0]
  ------------------
34478|      0|                        lab1 = cc.label;
34479|      0|                    }
34480|      0|                    if (code_match(&cc, pos2, op1, -1)) {
  ------------------
  |  Branch (34480:25): [True: 0, False: 0]
  ------------------
34481|      0|                        s->jump_size++;
34482|      0|                        update_label(s, lab0, -1);
34483|      0|                        update_label(s, cc.label, +1);
34484|      0|                        dbuf_putc(&bc_out, op1);
34485|      0|                        dbuf_put_u32(&bc_out, cc.label);
34486|      0|                        pos_next = pos1;
34487|      0|                        if (line1 != -1 && line1 != line_num) {
  ------------------
  |  Branch (34487:29): [True: 0, False: 0]
  |  Branch (34487:44): [True: 0, False: 0]
  ------------------
34488|      0|                            line_num = line1;
34489|      0|                            s->line_number_size++;
34490|      0|                            dbuf_putc(&bc_out, OP_line_num);
34491|      0|                            dbuf_put_u32(&bc_out, line_num);
34492|      0|                        }
34493|      0|                        break;
34494|      0|                    }
34495|      0|                }
34496|     14|            }
34497|     14|            goto no_change;
34498|       |
34499|     14|        case OP_nop:
  ------------------
  |  Branch (34499:9): [True: 0, False: 421]
  ------------------
34500|       |            /* remove erased code */
34501|      0|            break;
34502|      0|        case OP_set_class_name:
  ------------------
  |  Branch (34502:9): [True: 0, False: 421]
  ------------------
34503|       |            /* only used during parsing */
34504|      0|            break;
34505|       |
34506|      0|        case OP_get_field_opt_chain: /* equivalent to OP_get_field */
  ------------------
  |  Branch (34506:9): [True: 0, False: 421]
  ------------------
34507|      0|            {
34508|      0|                JSAtom name = get_u32(bc_buf + pos + 1);
34509|      0|                dbuf_putc(&bc_out, OP_get_field);
34510|      0|                dbuf_put_u32(&bc_out, name);
34511|      0|            }
34512|      0|            break;
34513|      0|        case OP_get_array_el_opt_chain: /* equivalent to OP_get_array_el */
  ------------------
  |  Branch (34513:9): [True: 0, False: 421]
  ------------------
34514|      0|            dbuf_putc(&bc_out, OP_get_array_el);
34515|      0|            break;
34516|       |
34517|    135|        default:
  ------------------
  |  Branch (34517:9): [True: 135, False: 286]
  ------------------
34518|    301|        no_change:
34519|    301|            dbuf_put(&bc_out, bc_buf + pos, len);
34520|    301|            break;
34521|    421|        }
34522|    421|    }
34523|       |
34524|       |    /* set the new byte code */
34525|     20|    dbuf_free(&s->byte_code);
34526|     20|    s->byte_code = bc_out;
34527|     20|    if (dbuf_error(&s->byte_code)) {
  ------------------
  |  Branch (34527:9): [True: 0, False: 20]
  ------------------
34528|      0|        JS_ThrowOutOfMemory(ctx);
34529|      0|        return -1;
34530|      0|    }
34531|     20|    return 0;
34532|      0| fail:
34533|       |    /* continue the copy to keep the atom refcounts consistent */
34534|       |    /* XXX: find a better solution ? */
34535|      0|    for (; pos < bc_len; pos = pos_next) {
  ------------------
  |  Branch (34535:12): [True: 0, False: 0]
  ------------------
34536|      0|        op = bc_buf[pos];
34537|      0|        len = opcode_info[op].size;
34538|      0|        pos_next = pos + len;
34539|      0|        dbuf_put(&bc_out, bc_buf + pos, len);
34540|      0|    }
34541|      0|    dbuf_free(&s->byte_code);
34542|      0|    s->byte_code = bc_out;
34543|      0|    return -1;
34544|     20|}
quickjs.c:resolve_scope_var:
32920|     76|{
32921|     76|    int idx, var_idx, is_put;
32922|     76|    int label_done;
32923|     76|    JSFunctionDef *fd;
32924|     76|    JSVarDef *vd;
32925|     76|    BOOL is_pseudo_var, is_arg_scope;
32926|       |
32927|     76|    label_done = -1;
32928|       |
32929|       |    /* XXX: could be simpler to use a specific function to
32930|       |       resolve the pseudo variables */
32931|     76|    is_pseudo_var = (var_name == JS_ATOM_home_object ||
  ------------------
  |  Branch (32931:22): [True: 0, False: 76]
  ------------------
32932|     76|                     var_name == JS_ATOM_this_active_func ||
  ------------------
  |  Branch (32932:22): [True: 0, False: 76]
  ------------------
32933|     76|                     var_name == JS_ATOM_new_target ||
  ------------------
  |  Branch (32933:22): [True: 0, False: 76]
  ------------------
32934|     76|                     var_name == JS_ATOM_this);
  ------------------
  |  Branch (32934:22): [True: 0, False: 76]
  ------------------
32935|       |
32936|       |    /* resolve local scoped variables */
32937|     76|    var_idx = -1;
32938|     93|    for (idx = s->scopes[scope_level].first; idx >= 0;) {
  ------------------
  |  Branch (32938:46): [True: 30, False: 63]
  ------------------
32939|     30|        vd = &s->vars[idx];
32940|     30|        if (vd->var_name == var_name) {
  ------------------
  |  Branch (32940:13): [True: 13, False: 17]
  ------------------
32941|     13|            if (op == OP_scope_put_var || op == OP_scope_make_ref) {
  ------------------
  |  Branch (32941:17): [True: 4, False: 9]
  |  Branch (32941:43): [True: 0, False: 9]
  ------------------
32942|      4|                if (vd->is_const) {
  ------------------
  |  Branch (32942:21): [True: 0, False: 4]
  ------------------
32943|      0|                    dbuf_putc(bc, OP_throw_error);
32944|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32945|      0|                    dbuf_putc(bc, JS_THROW_VAR_RO);
  ------------------
  |  |18333|      0|#define JS_THROW_VAR_RO             0
  ------------------
32946|      0|                    goto done;
32947|      0|                }
32948|      4|            }
32949|     13|            var_idx = idx;
32950|     13|            break;
32951|     13|        } else
32952|     17|        if (vd->var_name == JS_ATOM__with_ && !is_pseudo_var) {
  ------------------
  |  Branch (32952:13): [True: 0, False: 17]
  |  Branch (32952:47): [True: 0, False: 0]
  ------------------
32953|      0|            dbuf_putc(bc, OP_get_loc);
32954|      0|            dbuf_put_u16(bc, idx);
32955|      0|            var_object_test(ctx, s, var_name, op, bc, &label_done, 1);
32956|      0|        }
32957|     17|        idx = vd->scope_next;
32958|     17|    }
32959|     76|    is_arg_scope = (idx == ARG_SCOPE_END);
  ------------------
  |  |  636|     76|#define ARG_SCOPE_END (-2)
  ------------------
32960|     76|    if (var_idx < 0) {
  ------------------
  |  Branch (32960:9): [True: 63, False: 13]
  ------------------
32961|       |        /* argument scope: variables are not visible but pseudo
32962|       |           variables are visible */
32963|     63|        if (!is_arg_scope) {
  ------------------
  |  Branch (32963:13): [True: 61, False: 2]
  ------------------
32964|     61|            var_idx = find_var(ctx, s, var_name);
32965|     61|        }
32966|       |
32967|     63|        if (var_idx < 0 && is_pseudo_var)
  ------------------
  |  Branch (32967:13): [True: 58, False: 5]
  |  Branch (32967:28): [True: 0, False: 58]
  ------------------
32968|      0|            var_idx = resolve_pseudo_var(ctx, s, var_name);
32969|       |
32970|     63|        if (var_idx < 0 && var_name == JS_ATOM_arguments &&
  ------------------
  |  Branch (32970:13): [True: 58, False: 5]
  |  Branch (32970:28): [True: 0, False: 58]
  ------------------
32971|      0|            s->has_arguments_binding) {
  ------------------
  |  Branch (32971:13): [True: 0, False: 0]
  ------------------
32972|       |            /* 'arguments' pseudo variable */
32973|      0|            var_idx = add_arguments_var(ctx, s);
32974|      0|        }
32975|     63|        if (var_idx < 0 && s->is_func_expr && var_name == s->func_name) {
  ------------------
  |  Branch (32975:13): [True: 58, False: 5]
  |  Branch (32975:28): [True: 5, False: 53]
  |  Branch (32975:47): [True: 0, False: 5]
  ------------------
32976|       |            /* add a new variable with the function name */
32977|      0|            var_idx = add_func_var(ctx, s, var_name);
32978|      0|        }
32979|     63|    }
32980|     76|    if (var_idx >= 0) {
  ------------------
  |  Branch (32980:9): [True: 18, False: 58]
  ------------------
32981|     18|        if ((op == OP_scope_put_var || op == OP_scope_make_ref) &&
  ------------------
  |  Branch (32981:14): [True: 9, False: 9]
  |  Branch (32981:40): [True: 0, False: 9]
  ------------------
32982|      9|            !(var_idx & ARGUMENT_VAR_OFFSET) &&
  ------------------
  |  |16191|      9|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (32982:13): [True: 4, False: 5]
  ------------------
32983|      4|            s->vars[var_idx].is_const) {
  ------------------
  |  Branch (32983:13): [True: 0, False: 4]
  ------------------
32984|       |            /* only happens when assigning a function expression name
32985|       |               in strict mode */
32986|      0|            dbuf_putc(bc, OP_throw_error);
32987|      0|            dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32988|      0|            dbuf_putc(bc, JS_THROW_VAR_RO);
  ------------------
  |  |18333|      0|#define JS_THROW_VAR_RO             0
  ------------------
32989|      0|            goto done;
32990|      0|        }
32991|       |        /* OP_scope_put_var_init is only used to initialize a
32992|       |           lexical variable, so it is never used in a with or var object. It
32993|       |           can be used with a closure (module global variable case). */
32994|     18|        switch (op) {
  ------------------
  |  Branch (32994:17): [True: 18, False: 0]
  ------------------
32995|      0|        case OP_scope_make_ref:
  ------------------
  |  Branch (32995:9): [True: 0, False: 18]
  ------------------
32996|      0|            if (!(var_idx & ARGUMENT_VAR_OFFSET) &&
  ------------------
  |  |16191|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (32996:17): [True: 0, False: 0]
  ------------------
32997|      0|                s->vars[var_idx].var_kind == JS_VAR_FUNCTION_NAME) {
  ------------------
  |  Branch (32997:17): [True: 0, False: 0]
  ------------------
32998|       |                /* Create a dummy object reference for the func_var */
32999|      0|                dbuf_putc(bc, OP_object);
33000|      0|                dbuf_putc(bc, OP_get_loc);
33001|      0|                dbuf_put_u16(bc, var_idx);
33002|      0|                dbuf_putc(bc, OP_define_field);
33003|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33004|      0|                dbuf_putc(bc, OP_push_atom_value);
33005|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33006|      0|            } else
33007|      0|            if (label_done == -1 && can_opt_put_ref_value(bc_buf, ls->pos)) {
  ------------------
  |  Branch (33007:17): [True: 0, False: 0]
  |  Branch (33007:37): [True: 0, False: 0]
  ------------------
33008|      0|                int get_op;
33009|      0|                if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16191|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (33009:21): [True: 0, False: 0]
  ------------------
33010|      0|                    get_op = OP_get_arg;
33011|      0|                    var_idx -= ARGUMENT_VAR_OFFSET;
  ------------------
  |  |16191|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
33012|      0|                } else {
33013|      0|                    if (s->vars[var_idx].is_lexical)
  ------------------
  |  Branch (33013:25): [True: 0, False: 0]
  ------------------
33014|      0|                        get_op = OP_get_loc_check;
33015|      0|                    else
33016|      0|                        get_op = OP_get_loc;
33017|      0|                }
33018|      0|                pos_next = optimize_scope_make_ref(ctx, s, bc, bc_buf, ls,
33019|      0|                                                   pos_next, get_op, var_idx);
33020|      0|            } else {
33021|       |                /* Create a dummy object with a named slot that is
33022|       |                   a reference to the local variable */
33023|      0|                if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16191|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (33023:21): [True: 0, False: 0]
  ------------------
33024|      0|                    capture_var(s, &s->args[var_idx - ARGUMENT_VAR_OFFSET]);
  ------------------
  |  |16191|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
33025|      0|                    dbuf_putc(bc, OP_make_arg_ref);
33026|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33027|      0|                    dbuf_put_u16(bc, var_idx - ARGUMENT_VAR_OFFSET);
  ------------------
  |  |16191|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
33028|      0|                } else {
33029|      0|                    capture_var(s, &s->vars[var_idx]);
33030|      0|                    dbuf_putc(bc, OP_make_loc_ref);
33031|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33032|      0|                    dbuf_put_u16(bc, var_idx);
33033|      0|                }
33034|      0|            }
33035|      0|            break;
33036|      9|        case OP_scope_put_var:
  ------------------
  |  Branch (33036:9): [True: 9, False: 9]
  ------------------
33037|      9|            if (!(var_idx & ARGUMENT_VAR_OFFSET) &&
  ------------------
  |  |16191|      9|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (33037:17): [True: 4, False: 5]
  ------------------
33038|      4|                s->vars[var_idx].var_kind == JS_VAR_FUNCTION_NAME) {
  ------------------
  |  Branch (33038:17): [True: 0, False: 4]
  ------------------
33039|       |                /* in non strict mode, modifying the function name is ignored */
33040|      0|                dbuf_putc(bc, OP_drop);
33041|      0|                goto done;
33042|      0|            }
33043|      9|            goto local_scope_var;
33044|      9|        case OP_scope_get_ref:
  ------------------
  |  Branch (33044:9): [True: 0, False: 18]
  ------------------
33045|      0|            dbuf_putc(bc, OP_undefined);
33046|      0|            goto local_scope_var;
33047|      0|        case OP_scope_get_var_checkthis:
  ------------------
  |  Branch (33047:9): [True: 0, False: 18]
  ------------------
33048|      0|        case OP_scope_get_var_undef:
  ------------------
  |  Branch (33048:9): [True: 0, False: 18]
  ------------------
33049|      4|        case OP_scope_get_var:
  ------------------
  |  Branch (33049:9): [True: 4, False: 14]
  ------------------
33050|      9|        case OP_scope_put_var_init:
  ------------------
  |  Branch (33050:9): [True: 5, False: 13]
  ------------------
33051|     18|        local_scope_var:
33052|     18|            is_put = (op == OP_scope_put_var || op == OP_scope_put_var_init);
  ------------------
  |  Branch (33052:23): [True: 9, False: 9]
  |  Branch (33052:49): [True: 5, False: 4]
  ------------------
33053|     18|            if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16191|     18|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (33053:17): [True: 5, False: 13]
  ------------------
33054|      5|                dbuf_putc(bc, OP_get_arg + is_put);
33055|      5|                dbuf_put_u16(bc, var_idx - ARGUMENT_VAR_OFFSET);
  ------------------
  |  |16191|      5|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
33056|     13|            } else {
33057|     13|                if (is_put) {
  ------------------
  |  Branch (33057:21): [True: 9, False: 4]
  ------------------
33058|      9|                    if (s->vars[var_idx].is_lexical) {
  ------------------
  |  Branch (33058:25): [True: 5, False: 4]
  ------------------
33059|      5|                        if (op == OP_scope_put_var_init) {
  ------------------
  |  Branch (33059:29): [True: 5, False: 0]
  ------------------
33060|       |                            /* 'this' can only be initialized once */
33061|      5|                            if (var_name == JS_ATOM_this)
  ------------------
  |  Branch (33061:33): [True: 0, False: 5]
  ------------------
33062|      0|                                dbuf_putc(bc, OP_put_loc_check_init);
33063|      5|                            else
33064|      5|                                dbuf_putc(bc, OP_put_loc);
33065|      5|                        } else {
33066|      0|                            dbuf_putc(bc, OP_put_loc_check);
33067|      0|                        }
33068|      5|                    } else {
33069|      4|                        dbuf_putc(bc, OP_put_loc);
33070|      4|                    }
33071|      9|                } else {
33072|      4|                    if (s->vars[var_idx].is_lexical) {
  ------------------
  |  Branch (33072:25): [True: 2, False: 2]
  ------------------
33073|      2|                        if (op == OP_scope_get_var_checkthis) {
  ------------------
  |  Branch (33073:29): [True: 0, False: 2]
  ------------------
33074|       |                            /* only used for 'this' return in derived class constructors */
33075|      0|                            dbuf_putc(bc, OP_get_loc_checkthis);
33076|      2|                        } else {
33077|      2|                            dbuf_putc(bc, OP_get_loc_check);
33078|      2|                        }
33079|      2|                    } else {
33080|      2|                        dbuf_putc(bc, OP_get_loc);
33081|      2|                    }
33082|      4|                }
33083|     13|                dbuf_put_u16(bc, var_idx);
33084|     13|            }
33085|     18|            break;
33086|      0|        case OP_scope_delete_var:
  ------------------
  |  Branch (33086:9): [True: 0, False: 18]
  ------------------
33087|      0|            dbuf_putc(bc, OP_push_false);
33088|      0|            break;
33089|     18|        }
33090|     18|        goto done;
33091|     18|    }
33092|       |    /* check eval object */
33093|     58|    if (!is_arg_scope && s->var_object_idx >= 0 && !is_pseudo_var) {
  ------------------
  |  Branch (33093:9): [True: 56, False: 2]
  |  Branch (33093:26): [True: 0, False: 56]
  |  Branch (33093:52): [True: 0, False: 0]
  ------------------
33094|      0|        dbuf_putc(bc, OP_get_loc);
33095|      0|        dbuf_put_u16(bc, s->var_object_idx);
33096|      0|        var_object_test(ctx, s, var_name, op, bc, &label_done, 0);
33097|      0|    }
33098|       |    /* check eval object in argument scope */
33099|     58|    if (s->arg_var_object_idx >= 0 && !is_pseudo_var) {
  ------------------
  |  Branch (33099:9): [True: 0, False: 58]
  |  Branch (33099:39): [True: 0, False: 0]
  ------------------
33100|      0|        dbuf_putc(bc, OP_get_loc);
33101|      0|        dbuf_put_u16(bc, s->arg_var_object_idx);
33102|      0|        var_object_test(ctx, s, var_name, op, bc, &label_done, 0);
33103|      0|    }
33104|       |
33105|       |    /* check parent scopes */
33106|     61|    for (fd = s; fd->parent;) {
  ------------------
  |  Branch (33106:18): [True: 8, False: 53]
  ------------------
33107|      8|        scope_level = fd->parent_scope_level;
33108|      8|        fd = fd->parent;
33109|     11|        for (idx = fd->scopes[scope_level].first; idx >= 0;) {
  ------------------
  |  Branch (33109:51): [True: 3, False: 8]
  ------------------
33110|      3|            vd = &fd->vars[idx];
33111|      3|            if (vd->var_name == var_name) {
  ------------------
  |  Branch (33111:17): [True: 0, False: 3]
  ------------------
33112|      0|                if (op == OP_scope_put_var || op == OP_scope_make_ref) {
  ------------------
  |  Branch (33112:21): [True: 0, False: 0]
  |  Branch (33112:47): [True: 0, False: 0]
  ------------------
33113|      0|                    if (vd->is_const) {
  ------------------
  |  Branch (33113:25): [True: 0, False: 0]
  ------------------
33114|      0|                        dbuf_putc(bc, OP_throw_error);
33115|      0|                        dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33116|      0|                        dbuf_putc(bc, JS_THROW_VAR_RO);
  ------------------
  |  |18333|      0|#define JS_THROW_VAR_RO             0
  ------------------
33117|      0|                        goto done;
33118|      0|                    }
33119|      0|                }
33120|      0|                var_idx = idx;
33121|      0|                break;
33122|      3|            } else if (vd->var_name == JS_ATOM__with_ && !is_pseudo_var) {
  ------------------
  |  Branch (33122:24): [True: 0, False: 3]
  |  Branch (33122:58): [True: 0, False: 0]
  ------------------
33123|      0|                capture_var(fd, vd);
33124|      0|                idx = get_closure_var(ctx, s, fd, JS_CLOSURE_LOCAL, idx, vd->var_name, FALSE, FALSE, JS_VAR_NORMAL);
33125|      0|                if (idx >= 0) {
  ------------------
  |  Branch (33125:21): [True: 0, False: 0]
  ------------------
33126|      0|                    dbuf_putc(bc, OP_get_var_ref);
33127|      0|                    dbuf_put_u16(bc, idx);
33128|      0|                    var_object_test(ctx, s, var_name, op, bc, &label_done, 1);
33129|      0|                }
33130|      0|            }
33131|      3|            idx = vd->scope_next;
33132|      3|        }
33133|      8|        is_arg_scope = (idx == ARG_SCOPE_END);
  ------------------
  |  |  636|      8|#define ARG_SCOPE_END (-2)
  ------------------
33134|      8|        if (var_idx >= 0)
  ------------------
  |  Branch (33134:13): [True: 0, False: 8]
  ------------------
33135|      0|            break;
33136|       |
33137|      8|        if (!is_arg_scope) {
  ------------------
  |  Branch (33137:13): [True: 8, False: 0]
  ------------------
33138|      8|            var_idx = find_var(ctx, fd, var_name);
33139|      8|            if (var_idx >= 0)
  ------------------
  |  Branch (33139:17): [True: 0, False: 8]
  ------------------
33140|      0|                break;
33141|      8|        }
33142|      8|        if (is_pseudo_var) {
  ------------------
  |  Branch (33142:13): [True: 0, False: 8]
  ------------------
33143|      0|            var_idx = resolve_pseudo_var(ctx, fd, var_name);
33144|      0|            if (var_idx >= 0)
  ------------------
  |  Branch (33144:17): [True: 0, False: 0]
  ------------------
33145|      0|                break;
33146|      0|        }
33147|      8|        if (var_name == JS_ATOM_arguments && fd->has_arguments_binding) {
  ------------------
  |  Branch (33147:13): [True: 0, False: 8]
  |  Branch (33147:46): [True: 0, False: 0]
  ------------------
33148|      0|            var_idx = add_arguments_var(ctx, fd);
33149|      0|            break;
33150|      0|        }
33151|      8|        if (fd->is_func_expr && fd->func_name == var_name) {
  ------------------
  |  Branch (33151:13): [True: 3, False: 5]
  |  Branch (33151:33): [True: 0, False: 3]
  ------------------
33152|       |            /* add a new variable with the function name */
33153|      0|            var_idx = add_func_var(ctx, fd, var_name);
33154|      0|            break;
33155|      0|        }
33156|       |
33157|       |        /* check eval object */
33158|      8|        if (!is_arg_scope && fd->var_object_idx >= 0 && !is_pseudo_var) {
  ------------------
  |  Branch (33158:13): [True: 8, False: 0]
  |  Branch (33158:30): [True: 0, False: 8]
  |  Branch (33158:57): [True: 0, False: 0]
  ------------------
33159|      0|            vd = &fd->vars[fd->var_object_idx];
33160|      0|            capture_var(fd, vd);
33161|      0|            idx = get_closure_var(ctx, s, fd, JS_CLOSURE_LOCAL,
33162|      0|                                  fd->var_object_idx, vd->var_name,
33163|      0|                                  FALSE, FALSE, JS_VAR_NORMAL);
33164|      0|            dbuf_putc(bc, OP_get_var_ref);
33165|      0|            dbuf_put_u16(bc, idx);
33166|      0|            var_object_test(ctx, s, var_name, op, bc, &label_done, 0);
33167|      0|        }
33168|       |
33169|       |        /* check eval object in argument scope */
33170|      8|        if (fd->arg_var_object_idx >= 0 && !is_pseudo_var) {
  ------------------
  |  Branch (33170:13): [True: 0, False: 8]
  |  Branch (33170:44): [True: 0, False: 0]
  ------------------
33171|      0|            vd = &fd->vars[fd->arg_var_object_idx];
33172|      0|            capture_var(fd, vd);
33173|      0|            idx = get_closure_var(ctx, s, fd, JS_CLOSURE_LOCAL,
33174|      0|                                  fd->arg_var_object_idx, vd->var_name,
33175|      0|                                  FALSE, FALSE, JS_VAR_NORMAL);
33176|      0|            dbuf_putc(bc, OP_get_var_ref);
33177|      0|            dbuf_put_u16(bc, idx);
33178|      0|            var_object_test(ctx, s, var_name, op, bc, &label_done, 0);
33179|      0|        }
33180|       |
33181|      8|        if (fd->is_eval)
  ------------------
  |  Branch (33181:13): [True: 5, False: 3]
  ------------------
33182|      5|            break; /* it it necessarily the top level function */
33183|      8|    }
33184|       |
33185|       |    /* check direct eval scope (in the closure of the eval function
33186|       |       which is necessarily at the top level) */
33187|     58|    if (!fd)
  ------------------
  |  Branch (33187:9): [True: 0, False: 58]
  ------------------
33188|      0|        fd = s;
33189|     58|    if (var_idx < 0 && fd->is_eval) {
  ------------------
  |  Branch (33189:9): [True: 58, False: 0]
  |  Branch (33189:24): [True: 58, False: 0]
  ------------------
33190|     58|        int idx1;
33191|    129|        for (idx1 = 0; idx1 < fd->closure_var_count; idx1++) {
  ------------------
  |  Branch (33191:24): [True: 108, False: 21]
  ------------------
33192|    108|            JSClosureVar *cv = &fd->closure_var[idx1];
33193|    108|            if (var_name == cv->var_name) {
  ------------------
  |  Branch (33193:17): [True: 37, False: 71]
  ------------------
33194|     37|                if (fd != s) {
  ------------------
  |  Branch (33194:21): [True: 1, False: 36]
  ------------------
33195|      1|                    JSClosureTypeEnum closure_type;
33196|      1|                    if (cv->closure_type == JS_CLOSURE_GLOBAL ||
  ------------------
  |  Branch (33196:25): [True: 1, False: 0]
  ------------------
33197|      0|                        cv->closure_type == JS_CLOSURE_GLOBAL_DECL ||
  ------------------
  |  Branch (33197:25): [True: 0, False: 0]
  ------------------
33198|      0|                        cv->closure_type == JS_CLOSURE_GLOBAL_REF)
  ------------------
  |  Branch (33198:25): [True: 0, False: 0]
  ------------------
33199|      1|                        closure_type = JS_CLOSURE_GLOBAL_REF;
33200|      0|                    else
33201|      0|                        closure_type = JS_CLOSURE_REF;
33202|      1|                    idx = get_closure_var(ctx, s, fd,
33203|      1|                                          closure_type,
33204|      1|                                          idx1,
33205|      1|                                          cv->var_name, cv->is_const,
33206|      1|                                          cv->is_lexical, cv->var_kind);
33207|     36|                } else {
33208|     36|                    idx = idx1;
33209|     36|                }
33210|     37|                if (cv->closure_type == JS_CLOSURE_GLOBAL ||
  ------------------
  |  Branch (33210:21): [True: 15, False: 22]
  ------------------
33211|     22|                    cv->closure_type == JS_CLOSURE_GLOBAL_DECL ||
  ------------------
  |  Branch (33211:21): [True: 0, False: 22]
  ------------------
33212|     22|                    cv->closure_type == JS_CLOSURE_GLOBAL_REF)
  ------------------
  |  Branch (33212:21): [True: 0, False: 22]
  ------------------
33213|     15|                    goto has_global_idx;
33214|     22|                else
33215|     22|                    goto has_idx;
33216|     71|            } else if ((cv->var_name == JS_ATOM__var_ ||
  ------------------
  |  Branch (33216:25): [True: 0, False: 71]
  ------------------
33217|     71|                        cv->var_name == JS_ATOM__arg_var_ ||
  ------------------
  |  Branch (33217:25): [True: 0, False: 71]
  ------------------
33218|     71|                        cv->var_name == JS_ATOM__with_) && !is_pseudo_var) {
  ------------------
  |  Branch (33218:25): [True: 0, False: 71]
  |  Branch (33218:60): [True: 0, False: 0]
  ------------------
33219|      0|                int is_with = (cv->var_name == JS_ATOM__with_);
33220|      0|                if (fd != s) {
  ------------------
  |  Branch (33220:21): [True: 0, False: 0]
  ------------------
33221|      0|                    idx = get_closure_var(ctx, s, fd,
33222|      0|                                          JS_CLOSURE_REF,
33223|      0|                                          idx1,
33224|      0|                                          cv->var_name, FALSE, FALSE,
33225|      0|                                          JS_VAR_NORMAL);
33226|      0|                } else {
33227|      0|                    idx = idx1;
33228|      0|                }
33229|      0|                dbuf_putc(bc, OP_get_var_ref);
33230|      0|                dbuf_put_u16(bc, idx);
33231|      0|                var_object_test(ctx, s, var_name, op, bc, &label_done, is_with);
33232|      0|            }
33233|    108|        }
33234|       |
33235|       |        /* not found: add a closure for a global variable access */
33236|     21|        idx1 = add_closure_var(ctx, fd, JS_CLOSURE_GLOBAL, 0, var_name,
33237|     21|                              FALSE, FALSE, JS_VAR_NORMAL);
33238|     21|        if (idx1 < 0)
  ------------------
  |  Branch (33238:13): [True: 0, False: 21]
  ------------------
33239|      0|            return -1;
33240|     21|        if (fd != s) {
  ------------------
  |  Branch (33240:13): [True: 4, False: 17]
  ------------------
33241|      4|            idx = get_closure_var(ctx, s, fd,
33242|      4|                                  JS_CLOSURE_GLOBAL_REF,
33243|      4|                                  idx1,
33244|      4|                                  var_name, FALSE, FALSE, 
33245|      4|                                  JS_VAR_NORMAL);
33246|     17|        } else {
33247|     17|            idx = idx1;
33248|     17|        }
33249|     36|    has_global_idx:
33250|       |        /* global variable access */
33251|     36|        switch (op) {
  ------------------
  |  Branch (33251:17): [True: 36, False: 0]
  ------------------
33252|      0|        case OP_scope_make_ref:
  ------------------
  |  Branch (33252:9): [True: 0, False: 36]
  ------------------
33253|      0|            if (label_done == -1 && can_opt_put_global_ref_value(bc_buf, ls->pos)) {
  ------------------
  |  Branch (33253:17): [True: 0, False: 0]
  |  Branch (33253:37): [True: 0, False: 0]
  ------------------
33254|      0|                pos_next = optimize_scope_make_ref(ctx, s, bc, bc_buf, ls,
33255|      0|                                                   pos_next,
33256|      0|                                                   OP_get_var, idx);
33257|      0|            } else {
33258|      0|                dbuf_putc(bc, OP_make_var_ref);
33259|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33260|      0|            }
33261|      0|            break;
33262|      0|        case OP_scope_get_ref:
  ------------------
  |  Branch (33262:9): [True: 0, False: 36]
  ------------------
33263|       |            /* XXX: should create a dummy object with a named slot that is
33264|       |               a reference to the global variable */
33265|      0|            dbuf_putc(bc, OP_undefined);
33266|      0|            dbuf_putc(bc, OP_get_var);
33267|      0|            dbuf_put_u16(bc, idx);
33268|      0|            break;
33269|      0|        case OP_scope_get_var_undef:
  ------------------
  |  Branch (33269:9): [True: 0, False: 36]
  ------------------
33270|     33|        case OP_scope_get_var:
  ------------------
  |  Branch (33270:9): [True: 33, False: 3]
  ------------------
33271|     36|        case OP_scope_put_var:
  ------------------
  |  Branch (33271:9): [True: 3, False: 33]
  ------------------
33272|     36|            dbuf_putc(bc, OP_get_var_undef + (op - OP_scope_get_var_undef));
33273|     36|            dbuf_put_u16(bc, idx);
33274|     36|            break;
33275|      0|        case OP_scope_put_var_init:
  ------------------
  |  Branch (33275:9): [True: 0, False: 36]
  ------------------
33276|      0|            dbuf_putc(bc, OP_put_var_init);
33277|      0|            dbuf_put_u16(bc, idx);
33278|      0|            break;
33279|      0|        case OP_scope_delete_var:
  ------------------
  |  Branch (33279:9): [True: 0, False: 36]
  ------------------
33280|      0|            dbuf_putc(bc, OP_delete_var);
33281|      0|            dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33282|      0|            break;
33283|     36|        }
33284|     36|    } else {
33285|       |        /* find the corresponding closure variable */
33286|      0|        if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16191|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (33286:13): [True: 0, False: 0]
  ------------------
33287|      0|            capture_var(fd, &fd->args[var_idx - ARGUMENT_VAR_OFFSET]);
  ------------------
  |  |16191|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
33288|      0|            idx = get_closure_var(ctx, s, fd,
33289|      0|                                  JS_CLOSURE_ARG, var_idx - ARGUMENT_VAR_OFFSET,
  ------------------
  |  |16191|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
33290|      0|                                  var_name, FALSE, FALSE, JS_VAR_NORMAL);
33291|      0|        } else {
33292|      0|            capture_var(fd, &fd->vars[var_idx]);
33293|      0|            idx = get_closure_var(ctx, s, fd,
33294|      0|                                  JS_CLOSURE_LOCAL, var_idx,
33295|      0|                                  var_name,
33296|      0|                                  fd->vars[var_idx].is_const,
33297|      0|                                  fd->vars[var_idx].is_lexical,
33298|      0|                                  fd->vars[var_idx].var_kind);
33299|      0|        }
33300|      0|        if (idx >= 0) {
  ------------------
  |  Branch (33300:13): [True: 0, False: 0]
  ------------------
33301|     22|        has_idx:
33302|     22|            if ((op == OP_scope_put_var || op == OP_scope_make_ref) &&
  ------------------
  |  Branch (33302:18): [True: 0, False: 22]
  |  Branch (33302:44): [True: 0, False: 22]
  ------------------
33303|      0|                s->closure_var[idx].is_const) {
  ------------------
  |  Branch (33303:17): [True: 0, False: 0]
  ------------------
33304|      0|                dbuf_putc(bc, OP_throw_error);
33305|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33306|      0|                dbuf_putc(bc, JS_THROW_VAR_RO);
  ------------------
  |  |18333|      0|#define JS_THROW_VAR_RO             0
  ------------------
33307|      0|                goto done;
33308|      0|            }
33309|     22|            switch (op) {
  ------------------
  |  Branch (33309:21): [True: 22, False: 0]
  ------------------
33310|      0|            case OP_scope_make_ref:
  ------------------
  |  Branch (33310:13): [True: 0, False: 22]
  ------------------
33311|      0|                if (s->closure_var[idx].var_kind == JS_VAR_FUNCTION_NAME) {
  ------------------
  |  Branch (33311:21): [True: 0, False: 0]
  ------------------
33312|       |                    /* Create a dummy object reference for the func_var */
33313|      0|                    dbuf_putc(bc, OP_object);
33314|      0|                    dbuf_putc(bc, OP_get_var_ref);
33315|      0|                    dbuf_put_u16(bc, idx);
33316|      0|                    dbuf_putc(bc, OP_define_field);
33317|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33318|      0|                    dbuf_putc(bc, OP_push_atom_value);
33319|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33320|      0|                } else
33321|      0|                if (label_done == -1 &&
  ------------------
  |  Branch (33321:21): [True: 0, False: 0]
  ------------------
33322|      0|                    can_opt_put_ref_value(bc_buf, ls->pos)) {
  ------------------
  |  Branch (33322:21): [True: 0, False: 0]
  ------------------
33323|      0|                    int get_op;
33324|      0|                    if (s->closure_var[idx].is_lexical)
  ------------------
  |  Branch (33324:25): [True: 0, False: 0]
  ------------------
33325|      0|                        get_op = OP_get_var_ref_check;
33326|      0|                    else
33327|      0|                        get_op = OP_get_var_ref;
33328|      0|                    pos_next = optimize_scope_make_ref(ctx, s, bc, bc_buf, ls,
33329|      0|                                                       pos_next,
33330|      0|                                                       get_op, idx);
33331|      0|                } else {
33332|       |                    /* Create a dummy object with a named slot that is
33333|       |                       a reference to the closure variable */
33334|      0|                    dbuf_putc(bc, OP_make_var_ref_ref);
33335|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33336|      0|                    dbuf_put_u16(bc, idx);
33337|      0|                }
33338|      0|                break;
33339|      0|            case OP_scope_put_var:
  ------------------
  |  Branch (33339:13): [True: 0, False: 22]
  ------------------
33340|      0|                if (s->closure_var[idx].var_kind == JS_VAR_FUNCTION_NAME) {
  ------------------
  |  Branch (33340:21): [True: 0, False: 0]
  ------------------
33341|       |                    /* in non strict mode, modifying the function name is ignored */
33342|      0|                    dbuf_putc(bc, OP_drop);
33343|      0|                    goto done;
33344|      0|                }
33345|      0|                goto closure_scope_var;
33346|      0|            case OP_scope_get_ref:
  ------------------
  |  Branch (33346:13): [True: 0, False: 22]
  ------------------
33347|       |                /* XXX: should create a dummy object with a named slot that is
33348|       |                   a reference to the closure variable */
33349|      0|                dbuf_putc(bc, OP_undefined);
33350|      0|                goto closure_scope_var;
33351|      0|            case OP_scope_get_var_undef:
  ------------------
  |  Branch (33351:13): [True: 0, False: 22]
  ------------------
33352|     22|            case OP_scope_get_var:
  ------------------
  |  Branch (33352:13): [True: 22, False: 0]
  ------------------
33353|     22|            case OP_scope_put_var_init:
  ------------------
  |  Branch (33353:13): [True: 0, False: 22]
  ------------------
33354|     22|            closure_scope_var:
33355|     22|                is_put = (op == OP_scope_put_var ||
  ------------------
  |  Branch (33355:27): [True: 0, False: 22]
  ------------------
33356|     22|                          op == OP_scope_put_var_init);
  ------------------
  |  Branch (33356:27): [True: 0, False: 22]
  ------------------
33357|     22|                if (is_put) {
  ------------------
  |  Branch (33357:21): [True: 0, False: 22]
  ------------------
33358|      0|                    if (s->closure_var[idx].is_lexical) {
  ------------------
  |  Branch (33358:25): [True: 0, False: 0]
  ------------------
33359|      0|                        if (op == OP_scope_put_var_init) {
  ------------------
  |  Branch (33359:29): [True: 0, False: 0]
  ------------------
33360|       |                            /* 'this' can only be initialized once */
33361|      0|                            if (var_name == JS_ATOM_this)
  ------------------
  |  Branch (33361:33): [True: 0, False: 0]
  ------------------
33362|      0|                                dbuf_putc(bc, OP_put_var_ref_check_init);
33363|      0|                            else
33364|      0|                                dbuf_putc(bc, OP_put_var_ref);
33365|      0|                        } else {
33366|      0|                            dbuf_putc(bc, OP_put_var_ref_check);
33367|      0|                        }
33368|      0|                    } else {
33369|      0|                        dbuf_putc(bc, OP_put_var_ref);
33370|      0|                    }
33371|     22|                } else {
33372|     22|                    if (s->closure_var[idx].is_lexical) {
  ------------------
  |  Branch (33372:25): [True: 22, False: 0]
  ------------------
33373|     22|                        dbuf_putc(bc, OP_get_var_ref_check);
33374|     22|                    } else {
33375|      0|                        dbuf_putc(bc, OP_get_var_ref);
33376|      0|                    }
33377|     22|                }
33378|     22|                dbuf_put_u16(bc, idx);
33379|     22|                break;
33380|      0|            case OP_scope_delete_var:
  ------------------
  |  Branch (33380:13): [True: 0, False: 22]
  ------------------
33381|      0|                dbuf_putc(bc, OP_push_false);
33382|      0|                break;
33383|     22|            }
33384|     22|            goto done;
33385|     22|        }
33386|      0|    }
33387|       |
33388|     76|done:
33389|     76|    if (label_done >= 0) {
  ------------------
  |  Branch (33389:9): [True: 0, False: 76]
  ------------------
33390|      0|        dbuf_putc(bc, OP_label);
33391|      0|        dbuf_put_u32(bc, label_done);
33392|      0|        s->label_slots[label_done].pos2 = bc->size;
33393|      0|    }
33394|     76|    return pos_next;
33395|     58|}
quickjs.c:code_match:
33882|    188|{
33883|    188|    const uint8_t *tab = s->bc_buf;
33884|    188|    int op, len, op1, line_num, pos_next;
33885|    188|    va_list ap;
33886|    188|    BOOL ret = FALSE;
33887|       |
33888|    188|    line_num = -1;
33889|    188|    va_start(ap, pos);
33890|       |
33891|    250|    for(;;) {
33892|    250|        op1 = va_arg(ap, int);
33893|    250|        if (op1 == -1) {
  ------------------
  |  Branch (33893:13): [True: 40, False: 210]
  ------------------
33894|     40|            s->pos = pos;
33895|     40|            s->line_num = line_num;
33896|     40|            ret = TRUE;
33897|     40|            break;
33898|     40|        }
33899|    232|        for (;;) {
33900|    232|            if (pos >= s->bc_len)
  ------------------
  |  Branch (33900:17): [True: 0, False: 232]
  ------------------
33901|      0|                goto done;
33902|    232|            op = tab[pos];
33903|    232|            len = opcode_info[op].size;
33904|    232|            pos_next = pos + len;
33905|    232|            if (pos_next > s->bc_len)
  ------------------
  |  Branch (33905:17): [True: 0, False: 232]
  ------------------
33906|      0|                goto done;
33907|    232|            if (op == OP_line_num) {
  ------------------
  |  Branch (33907:17): [True: 22, False: 210]
  ------------------
33908|     22|                line_num = get_u32(tab + pos + 1);
33909|     22|                pos = pos_next;
33910|    210|            } else {
33911|    210|                break;
33912|    210|            }
33913|    232|        }
33914|    210|        if (op != op1) {
  ------------------
  |  Branch (33914:13): [True: 155, False: 55]
  ------------------
33915|    155|            if (op1 == (uint8_t)op1 || !op)
  ------------------
  |  Branch (33915:17): [True: 108, False: 47]
  |  Branch (33915:40): [True: 0, False: 47]
  ------------------
33916|    108|                break;
33917|     47|            if (op != (uint8_t)op1
  ------------------
  |  Branch (33917:17): [True: 45, False: 2]
  ------------------
33918|     45|            &&  op != (uint8_t)(op1 >> 8)
  ------------------
  |  Branch (33918:17): [True: 45, False: 0]
  ------------------
33919|     45|            &&  op != (uint8_t)(op1 >> 16)
  ------------------
  |  Branch (33919:17): [True: 40, False: 5]
  ------------------
33920|     40|            &&  op != (uint8_t)(op1 >> 24)) {
  ------------------
  |  Branch (33920:17): [True: 40, False: 0]
  ------------------
33921|     40|                break;
33922|     40|            }
33923|      7|            s->op = op;
33924|      7|        }
33925|       |
33926|     62|        pos++;
33927|     62|        switch(opcode_info[op].fmt) {
33928|      0|        case OP_FMT_loc8:
  ------------------
  |  Branch (33928:9): [True: 0, False: 62]
  ------------------
33929|      0|        case OP_FMT_u8:
  ------------------
  |  Branch (33929:9): [True: 0, False: 62]
  ------------------
33930|      0|            {
33931|      0|                int idx = tab[pos];
33932|      0|                int arg = va_arg(ap, int);
33933|      0|                if (arg == -1) {
  ------------------
  |  Branch (33933:21): [True: 0, False: 0]
  ------------------
33934|      0|                    s->idx = idx;
33935|      0|                } else {
33936|      0|                    if (arg != idx)
  ------------------
  |  Branch (33936:25): [True: 0, False: 0]
  ------------------
33937|      0|                        goto done;
33938|      0|                }
33939|      0|                break;
33940|      0|            }
33941|      0|        case OP_FMT_u16:
  ------------------
  |  Branch (33941:9): [True: 0, False: 62]
  ------------------
33942|      0|        case OP_FMT_npop:
  ------------------
  |  Branch (33942:9): [True: 0, False: 62]
  ------------------
33943|     10|        case OP_FMT_loc:
  ------------------
  |  Branch (33943:9): [True: 10, False: 52]
  ------------------
33944|     15|        case OP_FMT_arg:
  ------------------
  |  Branch (33944:9): [True: 5, False: 57]
  ------------------
33945|     15|        case OP_FMT_var_ref:
  ------------------
  |  Branch (33945:9): [True: 0, False: 62]
  ------------------
33946|     15|            {
33947|     15|                int idx = get_u16(tab + pos);
33948|     15|                int arg = va_arg(ap, int);
33949|     15|                if (arg == -1) {
  ------------------
  |  Branch (33949:21): [True: 7, False: 8]
  ------------------
33950|      7|                    s->idx = idx;
33951|      8|                } else {
33952|      8|                    if (arg != idx)
  ------------------
  |  Branch (33952:25): [True: 0, False: 8]
  ------------------
33953|      0|                        goto done;
33954|      8|                }
33955|     15|                break;
33956|     15|            }
33957|     15|        case OP_FMT_i32:
  ------------------
  |  Branch (33957:9): [True: 0, False: 62]
  ------------------
33958|      0|        case OP_FMT_u32:
  ------------------
  |  Branch (33958:9): [True: 0, False: 62]
  ------------------
33959|      0|        case OP_FMT_label:
  ------------------
  |  Branch (33959:9): [True: 0, False: 62]
  ------------------
33960|      0|        case OP_FMT_const:
  ------------------
  |  Branch (33960:9): [True: 0, False: 62]
  ------------------
33961|      0|            {
33962|      0|                s->label = get_u32(tab + pos);
33963|      0|                break;
33964|      0|            }
33965|      0|        case OP_FMT_label_u16:
  ------------------
  |  Branch (33965:9): [True: 0, False: 62]
  ------------------
33966|      0|            {
33967|      0|                s->label = get_u32(tab + pos);
33968|      0|                s->val = get_u16(tab + pos + 4);
33969|      0|                break;
33970|      0|            }
33971|     22|        case OP_FMT_atom:
  ------------------
  |  Branch (33971:9): [True: 22, False: 40]
  ------------------
33972|     22|            {
33973|     22|                s->atom = get_u32(tab + pos);
33974|     22|                break;
33975|      0|            }
33976|      0|        case OP_FMT_atom_u8:
  ------------------
  |  Branch (33976:9): [True: 0, False: 62]
  ------------------
33977|      0|            {
33978|      0|                s->atom = get_u32(tab + pos);
33979|      0|                s->val = get_u8(tab + pos + 4);
33980|      0|                break;
33981|      0|            }
33982|      0|        case OP_FMT_atom_u16:
  ------------------
  |  Branch (33982:9): [True: 0, False: 62]
  ------------------
33983|      0|            {
33984|      0|                s->atom = get_u32(tab + pos);
33985|      0|                s->val = get_u16(tab + pos + 4);
33986|      0|                break;
33987|      0|            }
33988|      0|        case OP_FMT_atom_label_u8:
  ------------------
  |  Branch (33988:9): [True: 0, False: 62]
  ------------------
33989|      0|            {
33990|      0|                s->atom = get_u32(tab + pos);
33991|      0|                s->label = get_u32(tab + pos + 4);
33992|      0|                s->val = get_u8(tab + pos + 8);
33993|      0|                break;
33994|      0|            }
33995|     25|        default:
  ------------------
  |  Branch (33995:9): [True: 25, False: 37]
  ------------------
33996|     25|            break;
33997|     62|        }
33998|     62|        pos = pos_next;
33999|     62|    }
34000|    188| done:
34001|       |    va_end(ap);
34002|    188|    return ret;
34003|    188|}
quickjs.c:skip_dead_code:
34114|     52|{
34115|     52|    int op, len, label;
34116|       |
34117|     69|    for (; pos < bc_len; pos += len) {
  ------------------
  |  Branch (34117:12): [True: 40, False: 29]
  ------------------
34118|     40|        op = bc_buf[pos];
34119|     40|        len = opcode_info[op].size;
34120|     40|        if (op == OP_line_num) {
  ------------------
  |  Branch (34120:13): [True: 0, False: 40]
  ------------------
34121|      0|            *linep = get_u32(bc_buf + pos + 1);
34122|      0|        } else
34123|     40|        if (op == OP_label) {
  ------------------
  |  Branch (34123:13): [True: 23, False: 17]
  ------------------
34124|     23|            label = get_u32(bc_buf + pos + 1);
34125|     23|            if (update_label(s, label, 0) > 0)
  ------------------
  |  Branch (34125:17): [True: 23, False: 0]
  ------------------
34126|     23|                break;
34127|       |#if 0
34128|       |            if (s->label_slots[label].first_reloc) {
34129|       |                printf("line %d: unreferenced label %d:%d has relocations\n",
34130|       |                       *linep, label, s->label_slots[label].pos2);
34131|       |            }
34132|       |#endif
34133|     23|            assert(s->label_slots[label].first_reloc == NULL);
  ------------------
  |  Branch (34133:13): [True: 0, False: 0]
  |  Branch (34133:13): [True: 0, False: 0]
  ------------------
34134|     17|        } else {
34135|       |            /* XXX: output a warning for unreachable code? */
34136|     17|            JSAtom atom;
34137|     17|            switch(opcode_info[op].fmt) {
34138|      0|            case OP_FMT_label:
  ------------------
  |  Branch (34138:13): [True: 0, False: 17]
  ------------------
34139|      0|            case OP_FMT_label_u16:
  ------------------
  |  Branch (34139:13): [True: 0, False: 17]
  ------------------
34140|      0|                label = get_u32(bc_buf + pos + 1);
34141|      0|                update_label(s, label, -1);
34142|      0|                break;
34143|      0|            case OP_FMT_atom_label_u8:
  ------------------
  |  Branch (34143:13): [True: 0, False: 17]
  ------------------
34144|      0|            case OP_FMT_atom_label_u16:
  ------------------
  |  Branch (34144:13): [True: 0, False: 17]
  ------------------
34145|      0|                label = get_u32(bc_buf + pos + 5);
34146|      0|                update_label(s, label, -1);
34147|       |                /* fall thru */
34148|      0|            case OP_FMT_atom:
  ------------------
  |  Branch (34148:13): [True: 0, False: 17]
  ------------------
34149|      0|            case OP_FMT_atom_u8:
  ------------------
  |  Branch (34149:13): [True: 0, False: 17]
  ------------------
34150|      0|            case OP_FMT_atom_u16:
  ------------------
  |  Branch (34150:13): [True: 0, False: 17]
  ------------------
34151|      0|                atom = get_u32(bc_buf + pos + 1);
34152|      0|                JS_FreeAtom(s->ctx, atom);
34153|      0|                break;
34154|     17|            default:
  ------------------
  |  Branch (34154:13): [True: 17, False: 0]
  ------------------
34155|     17|                break;
34156|     17|            }
34157|     17|        }
34158|     40|    }
34159|     52|    return pos;
34160|     52|}
quickjs.c:instantiate_hoisted_definitions:
34006|     20|{
34007|     20|    int i, idx, label_next = -1;
34008|       |
34009|       |    /* add the hoisted functions in arguments and local variables */
34010|     24|    for(i = 0; i < s->arg_count; i++) {
  ------------------
  |  Branch (34010:16): [True: 4, False: 20]
  ------------------
34011|      4|        JSVarDef *vd = &s->args[i];
34012|      4|        if (vd->func_pool_idx >= 0) {
  ------------------
  |  Branch (34012:13): [True: 0, False: 4]
  ------------------
34013|      0|            dbuf_putc(bc, OP_fclosure);
34014|      0|            dbuf_put_u32(bc, vd->func_pool_idx);
34015|      0|            dbuf_putc(bc, OP_put_arg);
34016|      0|            dbuf_put_u16(bc, i);
34017|      0|        }
34018|      4|    }
34019|     34|    for(i = 0; i < s->var_count; i++) {
  ------------------
  |  Branch (34019:16): [True: 14, False: 20]
  ------------------
34020|     14|        JSVarDef *vd = &s->vars[i];
34021|     14|        if (vd->scope_level == 0 && vd->func_pool_idx >= 0) {
  ------------------
  |  Branch (34021:13): [True: 9, False: 5]
  |  Branch (34021:37): [True: 0, False: 9]
  ------------------
34022|      0|            dbuf_putc(bc, OP_fclosure);
34023|      0|            dbuf_put_u32(bc, vd->func_pool_idx);
34024|      0|            dbuf_putc(bc, OP_put_loc);
34025|      0|            dbuf_put_u16(bc, i);
34026|      0|        }
34027|     14|    }
34028|       |
34029|       |    /* the module global variables must be initialized before
34030|       |       evaluating the module so that the exported functions are
34031|       |       visible if there are cyclic module references */
34032|     20|    if (s->module) {
  ------------------
  |  Branch (34032:9): [True: 11, False: 9]
  ------------------
34033|     11|        label_next = new_label_fd(s);
34034|     11|        if (label_next < 0) {
  ------------------
  |  Branch (34034:13): [True: 0, False: 11]
  ------------------
34035|      0|            dbuf_set_error(bc);
34036|      0|            return;
34037|      0|        }
34038|       |        /* if 'this' is true, initialize the global variables and return */
34039|     11|        dbuf_putc(bc, OP_push_this);
34040|     11|        dbuf_putc(bc, OP_if_false);
34041|     11|        dbuf_put_u32(bc, label_next);
34042|     11|        update_label(s, label_next, 1);
34043|     11|        s->jump_size++;
34044|     11|    }
34045|       |
34046|       |    /* add the global variables (only happens if s->is_global_var is
34047|       |       true) */
34048|       |    /* XXX: inefficient, add a closure index in JSGlobalVar */
34049|     20|    for(i = 0; i < s->global_var_count; i++) {
  ------------------
  |  Branch (34049:16): [True: 0, False: 20]
  ------------------
34050|      0|        JSGlobalVar *hf = &s->global_vars[i];
34051|      0|        BOOL has_var_obj = FALSE;
34052|      0|        BOOL force_init = hf->force_init;
34053|       |        /* we are in an eval, so the closure contains all the
34054|       |           enclosing variables */
34055|       |        /* If the outer function has a variable environment,
34056|       |           create a property for the variable there */
34057|      0|        for(idx = 0; idx < s->closure_var_count; idx++) {
  ------------------
  |  Branch (34057:22): [True: 0, False: 0]
  ------------------
34058|      0|            JSClosureVar *cv = &s->closure_var[idx];
34059|      0|            if (cv->var_name == hf->var_name) {
  ------------------
  |  Branch (34059:17): [True: 0, False: 0]
  ------------------
34060|      0|                force_init = FALSE;
34061|      0|                goto closure_found;
34062|      0|            }
34063|      0|            if (cv->var_name == JS_ATOM__var_ ||
  ------------------
  |  Branch (34063:17): [True: 0, False: 0]
  ------------------
34064|      0|                cv->var_name == JS_ATOM__arg_var_) {
  ------------------
  |  Branch (34064:17): [True: 0, False: 0]
  ------------------
34065|      0|                dbuf_putc(bc, OP_get_var_ref);
34066|      0|                dbuf_put_u16(bc, idx);
34067|      0|                has_var_obj = TRUE;
34068|      0|                force_init = TRUE;
34069|      0|                goto closure_found;
34070|      0|            }
34071|      0|        }
34072|      0|        abort();
34073|      0|    closure_found:
34074|      0|        if (hf->cpool_idx >= 0 || force_init) {
  ------------------
  |  Branch (34074:13): [True: 0, False: 0]
  |  Branch (34074:35): [True: 0, False: 0]
  ------------------
34075|      0|            if (hf->cpool_idx >= 0) {
  ------------------
  |  Branch (34075:17): [True: 0, False: 0]
  ------------------
34076|      0|                dbuf_putc(bc, OP_fclosure);
34077|      0|                dbuf_put_u32(bc, hf->cpool_idx);
34078|      0|                if (hf->var_name == JS_ATOM__default_) {
  ------------------
  |  Branch (34078:21): [True: 0, False: 0]
  ------------------
34079|       |                    /* set default export function name */
34080|      0|                    dbuf_putc(bc, OP_set_name);
34081|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, JS_ATOM_default));
34082|      0|                }
34083|      0|            } else {
34084|      0|                dbuf_putc(bc, OP_undefined);
34085|      0|            }
34086|      0|            if (!has_var_obj) {
  ------------------
  |  Branch (34086:17): [True: 0, False: 0]
  ------------------
34087|      0|                dbuf_putc(bc, OP_put_var_ref);
34088|      0|                dbuf_put_u16(bc, idx);
34089|      0|            } else {
34090|      0|                dbuf_putc(bc, OP_define_field);
34091|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, hf->var_name));
34092|      0|                dbuf_putc(bc, OP_drop);
34093|      0|            }
34094|      0|        }
34095|      0|        JS_FreeAtom(ctx, hf->var_name);
34096|      0|    }
34097|       |
34098|     20|    if (s->module) {
  ------------------
  |  Branch (34098:9): [True: 11, False: 9]
  ------------------
34099|     11|        dbuf_putc(bc, OP_return_undef);
34100|       |
34101|     11|        dbuf_putc(bc, OP_label);
34102|     11|        dbuf_put_u32(bc, label_next);
34103|     11|        s->label_slots[label_next].pos2 = bc->size;
34104|     11|    }
34105|       |
34106|     20|    js_free(ctx, s->global_vars);
34107|       |    s->global_vars = NULL;
34108|     20|    s->global_var_count = 0;
34109|     20|    s->global_var_size = 0;
34110|     20|}
quickjs.c:resolve_labels:
34797|     20|{
34798|     20|    int pos, pos_next, bc_len, op, op1, len, i, line_num;
34799|     20|    const uint8_t *bc_buf;
34800|     20|    DynBuf bc_out;
34801|     20|    LabelSlot *label_slots, *ls;
34802|     20|    RelocEntry *re, *re_next;
34803|     20|    CodeContext cc;
34804|     20|    int label;
34805|     20|#if SHORT_OPCODES
34806|     20|    JumpSlot *jp;
34807|     20|#endif
34808|       |
34809|     20|    label_slots = s->label_slots;
34810|       |
34811|     20|    line_num = s->source_pos;
34812|       |
34813|     20|    cc.bc_buf = bc_buf = s->byte_code.buf;
34814|     20|    cc.bc_len = bc_len = s->byte_code.size;
34815|     20|    js_dbuf_bytecode_init(ctx, &bc_out);
34816|       |
34817|     20|#if SHORT_OPCODES
34818|     20|    if (s->jump_size) {
  ------------------
  |  Branch (34818:9): [True: 14, False: 6]
  ------------------
34819|     14|        s->jump_slots = js_mallocz(s->ctx, sizeof(*s->jump_slots) * s->jump_size);
34820|     14|        if (s->jump_slots == NULL)
  ------------------
  |  Branch (34820:13): [True: 0, False: 14]
  ------------------
34821|      0|            return -1;
34822|     14|    }
34823|     20|#endif
34824|       |    /* XXX: Should skip this phase if not generating SHORT_OPCODES */
34825|     20|    if (s->line_number_size && !s->strip_debug) {
  ------------------
  |  Branch (34825:9): [True: 18, False: 2]
  |  Branch (34825:32): [True: 18, False: 0]
  ------------------
34826|     18|        s->line_number_slots = js_mallocz(s->ctx, sizeof(*s->line_number_slots) * s->line_number_size);
34827|     18|        if (s->line_number_slots == NULL)
  ------------------
  |  Branch (34827:13): [True: 0, False: 18]
  ------------------
34828|      0|            return -1;
34829|     18|        s->line_number_last = s->source_pos;
34830|     18|        s->line_number_last_pc = 0;
34831|     18|    }
34832|       |
34833|       |    /* initialize the 'home_object' variable if needed */
34834|     20|    if (s->home_object_var_idx >= 0) {
  ------------------
  |  Branch (34834:9): [True: 0, False: 20]
  ------------------
34835|      0|        dbuf_putc(&bc_out, OP_special_object);
34836|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_HOME_OBJECT);
34837|      0|        put_short_code(&bc_out, OP_put_loc, s->home_object_var_idx);
34838|      0|    }
34839|       |    /* initialize the 'this.active_func' variable if needed */
34840|     20|    if (s->this_active_func_var_idx >= 0) {
  ------------------
  |  Branch (34840:9): [True: 0, False: 20]
  ------------------
34841|      0|        dbuf_putc(&bc_out, OP_special_object);
34842|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_THIS_FUNC);
34843|      0|        put_short_code(&bc_out, OP_put_loc, s->this_active_func_var_idx);
34844|      0|    }
34845|       |    /* initialize the 'new.target' variable if needed */
34846|     20|    if (s->new_target_var_idx >= 0) {
  ------------------
  |  Branch (34846:9): [True: 0, False: 20]
  ------------------
34847|      0|        dbuf_putc(&bc_out, OP_special_object);
34848|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_NEW_TARGET);
34849|      0|        put_short_code(&bc_out, OP_put_loc, s->new_target_var_idx);
34850|      0|    }
34851|       |    /* initialize the 'this' variable if needed. In a derived class
34852|       |       constructor, this is initially uninitialized. */
34853|     20|    if (s->this_var_idx >= 0) {
  ------------------
  |  Branch (34853:9): [True: 0, False: 20]
  ------------------
34854|      0|        if (s->is_derived_class_constructor) {
  ------------------
  |  Branch (34854:13): [True: 0, False: 0]
  ------------------
34855|      0|            dbuf_putc(&bc_out, OP_set_loc_uninitialized);
34856|      0|            dbuf_put_u16(&bc_out, s->this_var_idx);
34857|      0|        } else {
34858|      0|            dbuf_putc(&bc_out, OP_push_this);
34859|      0|            put_short_code(&bc_out, OP_put_loc, s->this_var_idx);
34860|      0|        }
34861|      0|    }
34862|       |    /* initialize the 'arguments' variable if needed */
34863|     20|    if (s->arguments_var_idx >= 0) {
  ------------------
  |  Branch (34863:9): [True: 0, False: 20]
  ------------------
34864|      0|        if ((s->js_mode & JS_MODE_STRICT) || !s->has_simple_parameter_list) {
  ------------------
  |  |  403|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (34864:13): [True: 0, False: 0]
  |  Branch (34864:46): [True: 0, False: 0]
  ------------------
34865|      0|            dbuf_putc(&bc_out, OP_special_object);
34866|      0|            dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_ARGUMENTS);
34867|      0|        } else {
34868|      0|            dbuf_putc(&bc_out, OP_special_object);
34869|      0|            dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_MAPPED_ARGUMENTS);
34870|       |            /* the arguments are implicitly captured because
34871|       |               references to them are created with the 'argument'
34872|       |               object */
34873|      0|            for(i = 0; i < s->arg_count; i++)
  ------------------
  |  Branch (34873:24): [True: 0, False: 0]
  ------------------
34874|      0|                capture_var(s, &s->args[i]);
34875|      0|        }
34876|      0|        if (s->arguments_arg_idx >= 0)
  ------------------
  |  Branch (34876:13): [True: 0, False: 0]
  ------------------
34877|      0|            put_short_code(&bc_out, OP_set_loc, s->arguments_arg_idx);
34878|      0|        put_short_code(&bc_out, OP_put_loc, s->arguments_var_idx);
34879|      0|    }
34880|       |    /* initialize a reference to the current function if needed */
34881|     20|    if (s->func_var_idx >= 0) {
  ------------------
  |  Branch (34881:9): [True: 0, False: 20]
  ------------------
34882|      0|        dbuf_putc(&bc_out, OP_special_object);
34883|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_THIS_FUNC);
34884|      0|        put_short_code(&bc_out, OP_put_loc, s->func_var_idx);
34885|      0|    }
34886|       |    /* initialize the variable environment object if needed */
34887|     20|    if (s->var_object_idx >= 0) {
  ------------------
  |  Branch (34887:9): [True: 0, False: 20]
  ------------------
34888|      0|        dbuf_putc(&bc_out, OP_special_object);
34889|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_VAR_OBJECT);
34890|      0|        put_short_code(&bc_out, OP_put_loc, s->var_object_idx);
34891|      0|    }
34892|     20|    if (s->arg_var_object_idx >= 0) {
  ------------------
  |  Branch (34892:9): [True: 0, False: 20]
  ------------------
34893|      0|        dbuf_putc(&bc_out, OP_special_object);
34894|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_VAR_OBJECT);
34895|      0|        put_short_code(&bc_out, OP_put_loc, s->arg_var_object_idx);
34896|      0|    }
34897|       |
34898|    394|    for (pos = 0; pos < bc_len; pos = pos_next) {
  ------------------
  |  Branch (34898:19): [True: 374, False: 20]
  ------------------
34899|    374|        int val;
34900|    374|        op = bc_buf[pos];
34901|    374|        len = opcode_info[op].size;
34902|    374|        pos_next = pos + len;
34903|    374|        switch(op) {
34904|     98|        case OP_line_num:
  ------------------
  |  Branch (34904:9): [True: 98, False: 276]
  ------------------
34905|       |            /* line number info (for debug). We put it in a separate
34906|       |               compressed table to reduce memory usage and get better
34907|       |               performance */
34908|     98|            line_num = get_u32(bc_buf + pos + 1);
34909|     98|            break;
34910|       |
34911|     23|        case OP_label:
  ------------------
  |  Branch (34911:9): [True: 23, False: 351]
  ------------------
34912|     23|            {
34913|     23|                label = get_u32(bc_buf + pos + 1);
34914|     23|                assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34914:17): [True: 0, False: 23]
  |  Branch (34914:17): [True: 0, False: 0]
  |  Branch (34914:17): [True: 23, False: 0]
  |  Branch (34914:17): [True: 23, False: 0]
  ------------------
34915|     23|                ls = &label_slots[label];
34916|     23|                assert(ls->addr == -1);
  ------------------
  |  Branch (34916:17): [True: 0, False: 23]
  |  Branch (34916:17): [True: 23, False: 0]
  ------------------
34917|     23|                ls->addr = bc_out.size;
34918|       |                /* resolve the relocation entries */
34919|     39|                for(re = ls->first_reloc; re != NULL; re = re_next) {
  ------------------
  |  Branch (34919:43): [True: 16, False: 23]
  ------------------
34920|     16|                    int diff = ls->addr - re->addr;
34921|     16|                    re_next = re->next;
34922|     16|                    switch (re->size) {
  ------------------
  |  Branch (34922:29): [True: 16, False: 0]
  ------------------
34923|      0|                    case 4:
  ------------------
  |  Branch (34923:21): [True: 0, False: 16]
  ------------------
34924|      0|                        put_u32(bc_out.buf + re->addr, diff);
34925|      0|                        break;
34926|      0|                    case 2:
  ------------------
  |  Branch (34926:21): [True: 0, False: 16]
  ------------------
34927|      0|                        assert(diff == (int16_t)diff);
  ------------------
  |  Branch (34927:25): [True: 0, False: 0]
  |  Branch (34927:25): [True: 0, False: 0]
  ------------------
34928|      0|                        put_u16(bc_out.buf + re->addr, diff);
34929|      0|                        break;
34930|     16|                    case 1:
  ------------------
  |  Branch (34930:21): [True: 16, False: 0]
  ------------------
34931|     16|                        assert(diff == (int8_t)diff);
  ------------------
  |  Branch (34931:25): [True: 0, False: 16]
  |  Branch (34931:25): [True: 16, False: 0]
  ------------------
34932|     16|                        put_u8(bc_out.buf + re->addr, diff);
34933|     16|                        break;
34934|     16|                    }
34935|     16|                    js_free(ctx, re);
34936|     16|                }
34937|     23|                ls->first_reloc = NULL;
34938|     23|            }
34939|      0|            break;
34940|       |
34941|      4|        case OP_call:
  ------------------
  |  Branch (34941:9): [True: 4, False: 370]
  ------------------
34942|      5|        case OP_call_method:
  ------------------
  |  Branch (34942:9): [True: 1, False: 373]
  ------------------
34943|      5|            {
34944|       |                /* detect and transform tail calls */
34945|      5|                int argc;
34946|      5|                argc = get_u16(bc_buf + pos + 1);
34947|      5|                if (code_match(&cc, pos_next, OP_return, -1)) {
  ------------------
  |  Branch (34947:21): [True: 0, False: 5]
  ------------------
34948|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (34948:25): [True: 0, False: 0]
  ------------------
34949|      0|                    add_pc2line_info(s, bc_out.size, line_num);
34950|      0|                    put_short_code(&bc_out, op + 1, argc);
34951|      0|                    pos_next = skip_dead_code(s, bc_buf, bc_len, cc.pos, &line_num);
34952|      0|                    break;
34953|      0|                }
34954|      5|                add_pc2line_info(s, bc_out.size, line_num);
34955|      5|                put_short_code(&bc_out, op, argc);
34956|      5|                break;
34957|      5|            }
34958|      0|            goto no_change;
34959|       |
34960|      9|        case OP_return:
  ------------------
  |  Branch (34960:9): [True: 9, False: 365]
  ------------------
34961|     20|        case OP_return_undef:
  ------------------
  |  Branch (34961:9): [True: 11, False: 363]
  ------------------
34962|     31|        case OP_return_async:
  ------------------
  |  Branch (34962:9): [True: 11, False: 363]
  ------------------
34963|     31|        case OP_throw:
  ------------------
  |  Branch (34963:9): [True: 0, False: 374]
  ------------------
34964|     31|        case OP_throw_error:
  ------------------
  |  Branch (34964:9): [True: 0, False: 374]
  ------------------
34965|     31|            pos_next = skip_dead_code(s, bc_buf, bc_len, pos_next, &line_num);
34966|     31|            goto no_change;
34967|       |
34968|      7|        case OP_goto:
  ------------------
  |  Branch (34968:9): [True: 7, False: 367]
  ------------------
34969|      7|            label = get_u32(bc_buf + pos + 1);
34970|      7|        has_goto:
34971|      7|            if (OPTIMIZE) {
  ------------------
  |  |   50|      7|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 7, Folded]
  |  |  ------------------
  ------------------
34972|      7|                int line1 = -1;
34973|       |                /* Use custom matcher because multiple labels can follow */
34974|      7|                label = find_jump_target(s, label, &op1, &line1);
34975|      7|                if (code_has_label(&cc, pos_next, label)) {
  ------------------
  |  Branch (34975:21): [True: 2, False: 5]
  ------------------
34976|       |                    /* jump to next instruction: remove jump */
34977|      2|                    update_label(s, label, -1);
34978|      2|                    break;
34979|      2|                }
34980|      5|                if (op1 == OP_return || op1 == OP_return_undef || op1 == OP_throw) {
  ------------------
  |  Branch (34980:21): [True: 0, False: 5]
  |  Branch (34980:41): [True: 0, False: 5]
  |  Branch (34980:67): [True: 0, False: 5]
  ------------------
34981|       |                    /* jump to return/throw: remove jump, append return/throw */
34982|       |                    /* updating the line number obfuscates assembly listing */
34983|       |                    //if (line1 != -1) line_num = line1;
34984|      0|                    update_label(s, label, -1);
34985|      0|                    add_pc2line_info(s, bc_out.size, line_num);
34986|      0|                    dbuf_putc(&bc_out, op1);
34987|      0|                    pos_next = skip_dead_code(s, bc_buf, bc_len, pos_next, &line_num);
34988|      0|                    break;
34989|      0|                }
34990|       |                /* XXX: should duplicate single instructions followed by goto or return */
34991|       |                /* For example, can match one of these followed by return:
34992|       |                   push_i32 / push_const / push_atom_value / get_var /
34993|       |                   undefined / null / push_false / push_true / get_ref_value /
34994|       |                   get_loc / get_arg / get_var_ref
34995|       |                 */
34996|      5|            }
34997|      5|            goto has_label;
34998|       |
34999|      5|        case OP_gosub:
  ------------------
  |  Branch (34999:9): [True: 0, False: 374]
  ------------------
35000|      0|            label = get_u32(bc_buf + pos + 1);
35001|      0|            if (0 && OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
  |  Branch (35001:17): [Folded, False: 0]
  ------------------
35002|      0|                label = find_jump_target(s, label, &op1, NULL);
35003|      0|                if (op1 == OP_ret) {
  ------------------
  |  Branch (35003:21): [True: 0, False: 0]
  ------------------
35004|      0|                    update_label(s, label, -1);
35005|       |                    /* empty finally clause: remove gosub */
35006|      0|                    break;
35007|      0|                }
35008|      0|            }
35009|      0|            goto has_label;
35010|       |
35011|      0|        case OP_catch:
  ------------------
  |  Branch (35011:9): [True: 0, False: 374]
  ------------------
35012|      0|            label = get_u32(bc_buf + pos + 1);
35013|      0|            goto has_label;
35014|       |
35015|      2|        case OP_if_true:
  ------------------
  |  Branch (35015:9): [True: 2, False: 372]
  ------------------
35016|     14|        case OP_if_false:
  ------------------
  |  Branch (35016:9): [True: 12, False: 362]
  ------------------
35017|     14|            label = get_u32(bc_buf + pos + 1);
35018|     14|            if (OPTIMIZE) {
  ------------------
  |  |   50|     14|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 14, Folded]
  |  |  ------------------
  ------------------
35019|     14|                label = find_jump_target(s, label, &op1, NULL);
35020|       |                /* transform if_false/if_true(l1) label(l1) -> drop label(l1) */
35021|     14|                if (code_has_label(&cc, pos_next, label)) {
  ------------------
  |  Branch (35021:21): [True: 0, False: 14]
  ------------------
35022|      0|                    update_label(s, label, -1);
35023|      0|                    dbuf_putc(&bc_out, OP_drop);
35024|      0|                    break;
35025|      0|                }
35026|       |                /* transform if_false(l1) goto(l2) label(l1) -> if_false(l2) label(l1) */
35027|     14|                if (code_match(&cc, pos_next, OP_goto, -1)) {
  ------------------
  |  Branch (35027:21): [True: 0, False: 14]
  ------------------
35028|      0|                    int pos1 = cc.pos;
35029|      0|                    int line1 = cc.line_num;
35030|      0|                    if (code_has_label(&cc, pos1, label)) {
  ------------------
  |  Branch (35030:25): [True: 0, False: 0]
  ------------------
35031|      0|                        if (line1 != -1) line_num = line1;
  ------------------
  |  Branch (35031:29): [True: 0, False: 0]
  ------------------
35032|      0|                        pos_next = pos1;
35033|      0|                        update_label(s, label, -1);
35034|      0|                        label = cc.label;
35035|      0|                        op ^= OP_if_true ^ OP_if_false;
35036|      0|                    }
35037|      0|                }
35038|     14|            }
35039|     19|        has_label:
35040|     19|            add_pc2line_info(s, bc_out.size, line_num);
35041|     19|            if (op == OP_goto) {
  ------------------
  |  Branch (35041:17): [True: 5, False: 14]
  ------------------
35042|      5|                pos_next = skip_dead_code(s, bc_buf, bc_len, pos_next, &line_num);
35043|      5|            }
35044|     19|            assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (35044:13): [True: 0, False: 19]
  |  Branch (35044:13): [True: 0, False: 0]
  |  Branch (35044:13): [True: 19, False: 0]
  |  Branch (35044:13): [True: 19, False: 0]
  ------------------
35045|     19|            ls = &label_slots[label];
35046|     19|#if SHORT_OPCODES
35047|     19|            jp = &s->jump_slots[s->jump_count++];
35048|     19|            jp->op = op;
35049|     19|            jp->size = 4;
35050|     19|            jp->pos = bc_out.size + 1;
35051|     19|            jp->label = label;
35052|       |
35053|     19|            if (ls->addr == -1) {
  ------------------
  |  Branch (35053:17): [True: 16, False: 3]
  ------------------
35054|     16|                int diff = ls->pos2 - pos - 1;
35055|     16|                if (diff < 128 && (op == OP_if_false || op == OP_if_true || op == OP_goto)) {
  ------------------
  |  Branch (35055:21): [True: 16, False: 0]
  |  Branch (35055:36): [True: 11, False: 5]
  |  Branch (35055:57): [True: 2, False: 3]
  |  Branch (35055:77): [True: 3, False: 0]
  ------------------
35056|     16|                    jp->size = 1;
35057|     16|                    jp->op = OP_if_false8 + (op - OP_if_false);
35058|     16|                    dbuf_putc(&bc_out, OP_if_false8 + (op - OP_if_false));
35059|     16|                    dbuf_putc(&bc_out, 0);
35060|     16|                    if (!add_reloc(ctx, ls, bc_out.size - 1, 1))
  ------------------
  |  Branch (35060:25): [True: 0, False: 16]
  ------------------
35061|      0|                        goto fail;
35062|     16|                    break;
35063|     16|                }
35064|      0|                if (diff < 32768 && op == OP_goto) {
  ------------------
  |  Branch (35064:21): [True: 0, False: 0]
  |  Branch (35064:37): [True: 0, False: 0]
  ------------------
35065|      0|                    jp->size = 2;
35066|      0|                    jp->op = OP_goto16;
35067|      0|                    dbuf_putc(&bc_out, OP_goto16);
35068|      0|                    dbuf_put_u16(&bc_out, 0);
35069|      0|                    if (!add_reloc(ctx, ls, bc_out.size - 2, 2))
  ------------------
  |  Branch (35069:25): [True: 0, False: 0]
  ------------------
35070|      0|                        goto fail;
35071|      0|                    break;
35072|      0|                }
35073|      3|            } else {
35074|      3|                int diff = ls->addr - bc_out.size - 1;
35075|      3|                if (diff == (int8_t)diff && (op == OP_if_false || op == OP_if_true || op == OP_goto)) {
  ------------------
  |  Branch (35075:21): [True: 3, False: 0]
  |  Branch (35075:46): [True: 1, False: 2]
  |  Branch (35075:67): [True: 0, False: 2]
  |  Branch (35075:87): [True: 2, False: 0]
  ------------------
35076|      3|                    jp->size = 1;
35077|      3|                    jp->op = OP_if_false8 + (op - OP_if_false);
35078|      3|                    dbuf_putc(&bc_out, OP_if_false8 + (op - OP_if_false));
35079|      3|                    dbuf_putc(&bc_out, diff);
35080|      3|                    break;
35081|      3|                }
35082|      0|                if (diff == (int16_t)diff && op == OP_goto) {
  ------------------
  |  Branch (35082:21): [True: 0, False: 0]
  |  Branch (35082:46): [True: 0, False: 0]
  ------------------
35083|      0|                    jp->size = 2;
35084|      0|                    jp->op = OP_goto16;
35085|      0|                    dbuf_putc(&bc_out, OP_goto16);
35086|      0|                    dbuf_put_u16(&bc_out, diff);
35087|      0|                    break;
35088|      0|                }
35089|      0|            }
35090|      0|#endif
35091|      0|            dbuf_putc(&bc_out, op);
35092|      0|            dbuf_put_u32(&bc_out, ls->addr - bc_out.size);
35093|      0|            if (ls->addr == -1) {
  ------------------
  |  Branch (35093:17): [True: 0, False: 0]
  ------------------
35094|       |                /* unresolved yet: create a new relocation entry */
35095|      0|                if (!add_reloc(ctx, ls, bc_out.size - 4, 4))
  ------------------
  |  Branch (35095:21): [True: 0, False: 0]
  ------------------
35096|      0|                    goto fail;
35097|      0|            }
35098|      0|            break;
35099|      0|        case OP_with_get_var:
  ------------------
  |  Branch (35099:9): [True: 0, False: 374]
  ------------------
35100|      0|        case OP_with_put_var:
  ------------------
  |  Branch (35100:9): [True: 0, False: 374]
  ------------------
35101|      0|        case OP_with_delete_var:
  ------------------
  |  Branch (35101:9): [True: 0, False: 374]
  ------------------
35102|      0|        case OP_with_make_ref:
  ------------------
  |  Branch (35102:9): [True: 0, False: 374]
  ------------------
35103|      0|        case OP_with_get_ref:
  ------------------
  |  Branch (35103:9): [True: 0, False: 374]
  ------------------
35104|      0|            {
35105|      0|                JSAtom atom;
35106|      0|                int is_with;
35107|       |
35108|      0|                atom = get_u32(bc_buf + pos + 1);
35109|      0|                label = get_u32(bc_buf + pos + 5);
35110|      0|                is_with = bc_buf[pos + 9];
35111|      0|                if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35112|      0|                    label = find_jump_target(s, label, &op1, NULL);
35113|      0|                }
35114|      0|                assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (35114:17): [True: 0, False: 0]
  |  Branch (35114:17): [True: 0, False: 0]
  |  Branch (35114:17): [True: 0, False: 0]
  |  Branch (35114:17): [True: 0, False: 0]
  ------------------
35115|      0|                ls = &label_slots[label];
35116|      0|                add_pc2line_info(s, bc_out.size, line_num);
35117|      0|#if SHORT_OPCODES
35118|      0|                jp = &s->jump_slots[s->jump_count++];
35119|      0|                jp->op = op;
35120|      0|                jp->size = 4;
35121|      0|                jp->pos = bc_out.size + 5;
35122|      0|                jp->label = label;
35123|      0|#endif
35124|      0|                dbuf_putc(&bc_out, op);
35125|      0|                dbuf_put_u32(&bc_out, atom);
35126|      0|                dbuf_put_u32(&bc_out, ls->addr - bc_out.size);
35127|      0|                if (ls->addr == -1) {
  ------------------
  |  Branch (35127:21): [True: 0, False: 0]
  ------------------
35128|       |                    /* unresolved yet: create a new relocation entry */
35129|      0|                    if (!add_reloc(ctx, ls, bc_out.size - 4, 4))
  ------------------
  |  Branch (35129:25): [True: 0, False: 0]
  ------------------
35130|      0|                        goto fail;
35131|      0|                }
35132|      0|                dbuf_putc(&bc_out, is_with);
35133|      0|            }
35134|      0|            break;
35135|       |
35136|      8|        case OP_drop:
  ------------------
  |  Branch (35136:9): [True: 8, False: 366]
  ------------------
35137|      8|            if (OPTIMIZE) {
  ------------------
  |  |   50|      8|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 8, Folded]
  |  |  ------------------
  ------------------
35138|       |                /* remove useless drops before return */
35139|      8|                if (code_match(&cc, pos_next, OP_return_undef, -1)) {
  ------------------
  |  Branch (35139:21): [True: 0, False: 8]
  ------------------
35140|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35140:25): [True: 0, False: 0]
  ------------------
35141|      0|                    break;
35142|      0|                }
35143|      8|            }
35144|      8|            goto no_change;
35145|       |
35146|      8|        case OP_null:
  ------------------
  |  Branch (35146:9): [True: 0, False: 374]
  ------------------
35147|      0|#if SHORT_OPCODES
35148|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35149|       |                /* transform null strict_eq into is_null */
35150|      0|                if (code_match(&cc, pos_next, OP_strict_eq, -1)) {
  ------------------
  |  Branch (35150:21): [True: 0, False: 0]
  ------------------
35151|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35151:25): [True: 0, False: 0]
  ------------------
35152|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35153|      0|                    dbuf_putc(&bc_out, OP_is_null);
35154|      0|                    pos_next = cc.pos;
35155|      0|                    break;
35156|      0|                }
35157|       |                /* transform null strict_neq if_false/if_true -> is_null if_true/if_false */
35158|      0|                if (code_match(&cc, pos_next, OP_strict_neq, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33877|      0|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35158:21): [True: 0, False: 0]
  ------------------
35159|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35159:25): [True: 0, False: 0]
  ------------------
35160|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35161|      0|                    dbuf_putc(&bc_out, OP_is_null);
35162|      0|                    pos_next = cc.pos;
35163|      0|                    label = cc.label;
35164|      0|                    op = cc.op ^ OP_if_false ^ OP_if_true;
35165|      0|                    goto has_label;
35166|      0|                }
35167|      0|            }
35168|      0|#endif
35169|       |            /* fall thru */
35170|      0|        case OP_push_false:
  ------------------
  |  Branch (35170:9): [True: 0, False: 374]
  ------------------
35171|      0|        case OP_push_true:
  ------------------
  |  Branch (35171:9): [True: 0, False: 374]
  ------------------
35172|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35173|      0|                val = (op == OP_push_true);
35174|      0|                if (code_match(&cc, pos_next, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33877|      0|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35174:21): [True: 0, False: 0]
  ------------------
35175|      0|                has_constant_test:
35176|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35176:25): [True: 0, False: 0]
  ------------------
35177|      0|                    if (val == cc.op - OP_if_false) {
  ------------------
  |  Branch (35177:25): [True: 0, False: 0]
  ------------------
35178|       |                        /* transform null if_false(l1) -> goto l1 */
35179|       |                        /* transform false if_false(l1) -> goto l1 */
35180|       |                        /* transform true if_true(l1) -> goto l1 */
35181|      0|                        pos_next = cc.pos;
35182|      0|                        op = OP_goto;
35183|      0|                        label = cc.label;
35184|      0|                        goto has_goto;
35185|      0|                    } else {
35186|       |                        /* transform null if_true(l1) -> nop */
35187|       |                        /* transform false if_true(l1) -> nop */
35188|       |                        /* transform true if_false(l1) -> nop */
35189|      0|                        pos_next = cc.pos;
35190|      0|                        update_label(s, cc.label, -1);
35191|      0|                        break;
35192|      0|                    }
35193|      0|                }
35194|      0|            }
35195|      0|            goto no_change;
35196|       |
35197|      3|        case OP_push_i32:
  ------------------
  |  Branch (35197:9): [True: 3, False: 371]
  ------------------
35198|      3|            if (OPTIMIZE) {
  ------------------
  |  |   50|      3|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 3, Folded]
  |  |  ------------------
  ------------------
35199|       |                /* transform i32(val) neg -> i32(-val) */
35200|      3|                val = get_i32(bc_buf + pos + 1);
35201|      3|                if ((val != INT32_MIN && val != 0)
  ------------------
  |  Branch (35201:22): [True: 3, False: 0]
  |  Branch (35201:42): [True: 2, False: 1]
  ------------------
35202|      2|                &&  code_match(&cc, pos_next, OP_neg, -1)) {
  ------------------
  |  Branch (35202:21): [True: 0, False: 2]
  ------------------
35203|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35203:25): [True: 0, False: 0]
  ------------------
35204|      0|                    if (code_match(&cc, cc.pos, OP_drop, -1)) {
  ------------------
  |  Branch (35204:25): [True: 0, False: 0]
  ------------------
35205|      0|                        if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35205:29): [True: 0, False: 0]
  ------------------
35206|      0|                    } else {
35207|      0|                        add_pc2line_info(s, bc_out.size, line_num);
35208|      0|                        push_short_int(&bc_out, -val);
35209|      0|                    }
35210|      0|                    pos_next = cc.pos;
35211|      0|                    break;
35212|      0|                }
35213|       |                /* remove push/drop pairs generated by the parser */
35214|      3|                if (code_match(&cc, pos_next, OP_drop, -1)) {
  ------------------
  |  Branch (35214:21): [True: 1, False: 2]
  ------------------
35215|      1|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35215:25): [True: 0, False: 1]
  ------------------
35216|      1|                    pos_next = cc.pos;
35217|      1|                    break;
35218|      1|                }
35219|       |                /* Optimize constant tests: `if (0)`, `if (1)`, `if (!0)`... */
35220|      2|                if (code_match(&cc, pos_next, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33877|      2|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35220:21): [True: 0, False: 2]
  ------------------
35221|      0|                    val = (val != 0);
35222|      0|                    goto has_constant_test;
35223|      0|                }
35224|      2|                add_pc2line_info(s, bc_out.size, line_num);
35225|      2|                push_short_int(&bc_out, val);
35226|      2|                break;
35227|      2|            }
35228|      0|            goto no_change;
35229|       |
35230|      0|        case OP_push_bigint_i32:
  ------------------
  |  Branch (35230:9): [True: 0, False: 374]
  ------------------
35231|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35232|       |                /* transform i32(val) neg -> i32(-val) */
35233|      0|                val = get_i32(bc_buf + pos + 1);
35234|      0|                if (val != INT32_MIN
  ------------------
  |  Branch (35234:21): [True: 0, False: 0]
  ------------------
35235|      0|                &&  code_match(&cc, pos_next, OP_neg, -1)) {
  ------------------
  |  Branch (35235:21): [True: 0, False: 0]
  ------------------
35236|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35236:25): [True: 0, False: 0]
  ------------------
35237|      0|                    if (code_match(&cc, cc.pos, OP_drop, -1)) {
  ------------------
  |  Branch (35237:25): [True: 0, False: 0]
  ------------------
35238|      0|                        if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35238:29): [True: 0, False: 0]
  ------------------
35239|      0|                    } else {
35240|      0|                        add_pc2line_info(s, bc_out.size, line_num);
35241|      0|                        dbuf_putc(&bc_out, OP_push_bigint_i32);
35242|      0|                        dbuf_put_u32(&bc_out, -val);
35243|      0|                    }
35244|      0|                    pos_next = cc.pos;
35245|      0|                    break;
35246|      0|                }
35247|      0|            }
35248|      0|            goto no_change;
35249|       |
35250|      0|#if SHORT_OPCODES
35251|      7|        case OP_push_const:
  ------------------
  |  Branch (35251:9): [True: 7, False: 367]
  ------------------
35252|      9|        case OP_fclosure:
  ------------------
  |  Branch (35252:9): [True: 2, False: 372]
  ------------------
35253|      9|            if (OPTIMIZE) {
  ------------------
  |  |   50|      9|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 9, Folded]
  |  |  ------------------
  ------------------
35254|      9|                int idx = get_u32(bc_buf + pos + 1);
35255|      9|                if (idx < 256) {
  ------------------
  |  Branch (35255:21): [True: 9, False: 0]
  ------------------
35256|      9|                    add_pc2line_info(s, bc_out.size, line_num);
35257|      9|                    dbuf_putc(&bc_out, OP_push_const8 + op - OP_push_const);
35258|      9|                    dbuf_putc(&bc_out, idx);
35259|      9|                    break;
35260|      9|                }
35261|      9|            }
35262|      0|            goto no_change;
35263|       |
35264|      2|        case OP_get_field:
  ------------------
  |  Branch (35264:9): [True: 2, False: 372]
  ------------------
35265|      2|            if (OPTIMIZE) {
  ------------------
  |  |   50|      2|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 2, Folded]
  |  |  ------------------
  ------------------
35266|      2|                JSAtom atom = get_u32(bc_buf + pos + 1);
35267|      2|                if (atom == JS_ATOM_length) {
  ------------------
  |  Branch (35267:21): [True: 0, False: 2]
  ------------------
35268|      0|                    JS_FreeAtom(ctx, atom);
35269|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35270|      0|                    dbuf_putc(&bc_out, OP_get_length);
35271|      0|                    break;
35272|      0|                }
35273|      2|            }
35274|      2|            goto no_change;
35275|      2|#endif
35276|      5|        case OP_push_atom_value:
  ------------------
  |  Branch (35276:9): [True: 5, False: 369]
  ------------------
35277|      5|            if (OPTIMIZE) {
  ------------------
  |  |   50|      5|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 5, Folded]
  |  |  ------------------
  ------------------
35278|      5|                JSAtom atom = get_u32(bc_buf + pos + 1);
35279|       |                /* remove push/drop pairs generated by the parser */
35280|      5|                if (code_match(&cc, pos_next, OP_drop, -1)) {
  ------------------
  |  Branch (35280:21): [True: 0, False: 5]
  ------------------
35281|      0|                    JS_FreeAtom(ctx, atom);
35282|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35282:25): [True: 0, False: 0]
  ------------------
35283|      0|                    pos_next = cc.pos;
35284|      0|                    break;
35285|      0|                }
35286|      5|#if SHORT_OPCODES
35287|      5|                if (atom == JS_ATOM_empty_string) {
  ------------------
  |  Branch (35287:21): [True: 2, False: 3]
  ------------------
35288|      2|                    JS_FreeAtom(ctx, atom);
35289|      2|                    add_pc2line_info(s, bc_out.size, line_num);
35290|      2|                    dbuf_putc(&bc_out, OP_push_empty_string);
35291|      2|                    break;
35292|      2|                }
35293|      5|#endif
35294|      5|            }
35295|      3|            goto no_change;
35296|       |
35297|      3|        case OP_to_propkey:
  ------------------
  |  Branch (35297:9): [True: 0, False: 374]
  ------------------
35298|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35299|       |                /* remove redundant to_propkey opcodes when storing simple data */
35300|      0|                if (code_match(&cc, pos_next, M3(OP_get_loc, OP_get_arg, OP_get_var_ref), -1, OP_put_array_el, -1)
  ------------------
  |  |33878|      0|#define M3(op1, op2, op3)       ((op1) | ((op2) << 8) | ((op3) << 16))
  ------------------
  |  Branch (35300:21): [True: 0, False: 0]
  ------------------
35301|      0|                ||  code_match(&cc, pos_next, M3(OP_push_i32, OP_push_const, OP_push_atom_value), OP_put_array_el, -1)
  ------------------
  |  |33878|      0|#define M3(op1, op2, op3)       ((op1) | ((op2) << 8) | ((op3) << 16))
  ------------------
  |  Branch (35301:21): [True: 0, False: 0]
  ------------------
35302|      0|                ||  code_match(&cc, pos_next, M4(OP_undefined, OP_null, OP_push_true, OP_push_false), OP_put_array_el, -1)) {
  ------------------
  |  |33879|      0|#define M4(op1, op2, op3, op4)  ((op1) | ((op2) << 8) | ((op3) << 16) | ((op4) << 24))
  ------------------
  |  Branch (35302:21): [True: 0, False: 0]
  ------------------
35303|      0|                    break;
35304|      0|                }
35305|      0|            }
35306|      0|            goto no_change;
35307|       |
35308|     14|        case OP_undefined:
  ------------------
  |  Branch (35308:9): [True: 14, False: 360]
  ------------------
35309|     14|            if (OPTIMIZE) {
  ------------------
  |  |   50|     14|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 14, Folded]
  |  |  ------------------
  ------------------
35310|       |                /* remove push/drop pairs generated by the parser */
35311|     14|                if (code_match(&cc, pos_next, OP_drop, -1)) {
  ------------------
  |  Branch (35311:21): [True: 0, False: 14]
  ------------------
35312|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35312:25): [True: 0, False: 0]
  ------------------
35313|      0|                    pos_next = cc.pos;
35314|      0|                    break;
35315|      0|                }
35316|       |                /* transform undefined return -> return_undefined */
35317|     14|                if (code_match(&cc, pos_next, OP_return, -1)) {
  ------------------
  |  Branch (35317:21): [True: 0, False: 14]
  ------------------
35318|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35318:25): [True: 0, False: 0]
  ------------------
35319|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35320|      0|                    dbuf_putc(&bc_out, OP_return_undef);
35321|      0|                    pos_next = cc.pos;
35322|      0|                    break;
35323|      0|                }
35324|       |                /* transform undefined if_true(l1)/if_false(l1) -> nop/goto(l1) */
35325|     14|                if (code_match(&cc, pos_next, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33877|     14|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35325:21): [True: 0, False: 14]
  ------------------
35326|      0|                    val = 0;
35327|      0|                    goto has_constant_test;
35328|      0|                }
35329|     14|#if SHORT_OPCODES
35330|       |                /* transform undefined strict_eq -> is_undefined */
35331|     14|                if (code_match(&cc, pos_next, OP_strict_eq, -1)) {
  ------------------
  |  Branch (35331:21): [True: 2, False: 12]
  ------------------
35332|      2|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35332:25): [True: 0, False: 2]
  ------------------
35333|      2|                    add_pc2line_info(s, bc_out.size, line_num);
35334|      2|                    dbuf_putc(&bc_out, OP_is_undefined);
35335|      2|                    pos_next = cc.pos;
35336|      2|                    break;
35337|      2|                }
35338|       |                /* transform undefined strict_neq if_false/if_true -> is_undefined if_true/if_false */
35339|     12|                if (code_match(&cc, pos_next, OP_strict_neq, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33877|     12|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35339:21): [True: 0, False: 12]
  ------------------
35340|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35340:25): [True: 0, False: 0]
  ------------------
35341|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35342|      0|                    dbuf_putc(&bc_out, OP_is_undefined);
35343|      0|                    pos_next = cc.pos;
35344|      0|                    label = cc.label;
35345|      0|                    op = cc.op ^ OP_if_false ^ OP_if_true;
35346|      0|                    goto has_label;
35347|      0|                }
35348|     12|#endif
35349|     12|            }
35350|     12|            goto no_change;
35351|       |
35352|     22|        case OP_insert2:
  ------------------
  |  Branch (35352:9): [True: 22, False: 352]
  ------------------
35353|     22|            if (OPTIMIZE) {
  ------------------
  |  |   50|     22|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 22, Folded]
  |  |  ------------------
  ------------------
35354|       |                /* Transformation:
35355|       |                   insert2 put_field(a) drop -> put_field(a)
35356|       |                */
35357|     22|                if (code_match(&cc, pos_next, OP_put_field, OP_drop, -1)) {
  ------------------
  |  Branch (35357:21): [True: 22, False: 0]
  ------------------
35358|     22|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35358:25): [True: 0, False: 22]
  ------------------
35359|     22|                    add_pc2line_info(s, bc_out.size, line_num);
35360|     22|                    dbuf_putc(&bc_out, OP_put_field);
35361|     22|                    dbuf_put_u32(&bc_out, cc.atom);
35362|     22|                    pos_next = cc.pos;
35363|     22|                    break;
35364|     22|                }
35365|     22|            }
35366|      0|            goto no_change;
35367|       |
35368|     14|        case OP_dup:
  ------------------
  |  Branch (35368:9): [True: 14, False: 360]
  ------------------
35369|     14|            if (OPTIMIZE) {
  ------------------
  |  |   50|     14|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 14, Folded]
  |  |  ------------------
  ------------------
35370|       |                /* Transformation: dup put_x(n) drop -> put_x(n) */
35371|     14|                int op1, line2 = -1;
35372|       |                /* Transformation: dup put_x(n) -> set_x(n) */
35373|     14|                if (code_match(&cc, pos_next, M4(OP_put_loc, OP_put_loc_check, OP_put_arg, OP_put_var_ref), -1, -1)) {
  ------------------
  |  |33879|     14|#define M4(op1, op2, op3, op4)  ((op1) | ((op2) << 8) | ((op3) << 16) | ((op4) << 24))
  ------------------
  |  Branch (35373:21): [True: 7, False: 7]
  ------------------
35374|      7|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35374:25): [True: 0, False: 7]
  ------------------
35375|      7|                    op1 = cc.op + 1;  /* put_x -> set_x */
35376|      7|                    pos_next = cc.pos;
35377|      7|                    if (code_match(&cc, cc.pos, OP_drop, -1)) {
  ------------------
  |  Branch (35377:25): [True: 0, False: 7]
  ------------------
35378|      0|                        if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35378:29): [True: 0, False: 0]
  ------------------
35379|      0|                        op1 -= 1; /* set_x drop -> put_x */
35380|      0|                        pos_next = cc.pos;
35381|      0|                        if (code_match(&cc, cc.pos, op1 - 1, cc.idx, -1)) {
  ------------------
  |  Branch (35381:29): [True: 0, False: 0]
  ------------------
35382|      0|                            line2 = cc.line_num; /* delay line number update */
35383|      0|                            op1 += 1;   /* put_x(n) get_x(n) -> set_x(n) */
35384|      0|                            pos_next = cc.pos;
35385|      0|                        }
35386|      0|                    }
35387|      7|                    add_pc2line_info(s, bc_out.size, line_num);
35388|      7|                    put_short_code(&bc_out, op1, cc.idx);
35389|      7|                    if (line2 >= 0) line_num = line2;
  ------------------
  |  Branch (35389:25): [True: 0, False: 7]
  ------------------
35390|      7|                    break;
35391|      7|                }
35392|     14|            }
35393|      7|            goto no_change;
35394|       |
35395|      7|        case OP_get_loc:
  ------------------
  |  Branch (35395:9): [True: 1, False: 373]
  ------------------
35396|      1|            if (OPTIMIZE) {
  ------------------
  |  |   50|      1|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 1, Folded]
  |  |  ------------------
  ------------------
35397|       |                /* transformation:
35398|       |                   get_loc(n) post_dec put_loc(n) drop -> dec_loc(n)
35399|       |                   get_loc(n) post_inc put_loc(n) drop -> inc_loc(n)
35400|       |                   get_loc(n) dec dup put_loc(n) drop -> dec_loc(n)
35401|       |                   get_loc(n) inc dup put_loc(n) drop -> inc_loc(n)
35402|       |                 */
35403|      1|                int idx;
35404|      1|                idx = get_u16(bc_buf + pos + 1);
35405|      1|                if (idx >= 256)
  ------------------
  |  Branch (35405:21): [True: 0, False: 1]
  ------------------
35406|      0|                    goto no_change;
35407|      1|                if (code_match(&cc, pos_next, M2(OP_post_dec, OP_post_inc), OP_put_loc, idx, OP_drop, -1) ||
  ------------------
  |  |33877|      1|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35407:21): [True: 0, False: 1]
  ------------------
35408|      1|                    code_match(&cc, pos_next, M2(OP_dec, OP_inc), OP_dup, OP_put_loc, idx, OP_drop, -1)) {
  ------------------
  |  |33877|      1|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35408:21): [True: 0, False: 1]
  ------------------
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, (cc.op == OP_inc || cc.op == OP_post_inc) ? OP_inc_loc : OP_dec_loc);
  ------------------
  |  Branch (35411:41): [True: 0, False: 0]
  |  Branch (35411:60): [True: 0, False: 0]
  ------------------
35412|      0|                    dbuf_putc(&bc_out, idx);
35413|      0|                    pos_next = cc.pos;
35414|      0|                    break;
35415|      0|                }
35416|       |                /* transformation:
35417|       |                   get_loc(n) push_atom_value(x) add dup put_loc(n) drop -> push_atom_value(x) add_loc(n)
35418|       |                 */
35419|      1|                if (code_match(&cc, pos_next, OP_push_atom_value, OP_add, OP_dup, OP_put_loc, idx, OP_drop, -1)) {
  ------------------
  |  Branch (35419:21): [True: 0, False: 1]
  ------------------
35420|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35420:25): [True: 0, False: 0]
  ------------------
35421|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35422|      0|#if SHORT_OPCODES
35423|      0|                    if (cc.atom == JS_ATOM_empty_string) {
  ------------------
  |  Branch (35423:25): [True: 0, False: 0]
  ------------------
35424|      0|                        JS_FreeAtom(ctx, cc.atom);
35425|      0|                        dbuf_putc(&bc_out, OP_push_empty_string);
35426|      0|                    } else
35427|      0|#endif
35428|      0|                    {
35429|      0|                        dbuf_putc(&bc_out, OP_push_atom_value);
35430|      0|                        dbuf_put_u32(&bc_out, cc.atom);
35431|      0|                    }
35432|      0|                    dbuf_putc(&bc_out, OP_add_loc);
35433|      0|                    dbuf_putc(&bc_out, idx);
35434|      0|                    pos_next = cc.pos;
35435|      0|                    break;
35436|      0|                }
35437|       |                /* transformation:
35438|       |                   get_loc(n) push_i32(x) add dup put_loc(n) drop -> push_i32(x) add_loc(n)
35439|       |                 */
35440|      1|                if (code_match(&cc, pos_next, OP_push_i32, OP_add, OP_dup, OP_put_loc, idx, OP_drop, -1)) {
  ------------------
  |  Branch (35440:21): [True: 0, False: 1]
  ------------------
35441|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35441:25): [True: 0, False: 0]
  ------------------
35442|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35443|      0|                    push_short_int(&bc_out, cc.label);
35444|      0|                    dbuf_putc(&bc_out, OP_add_loc);
35445|      0|                    dbuf_putc(&bc_out, idx);
35446|      0|                    pos_next = cc.pos;
35447|      0|                    break;
35448|      0|                }
35449|       |                /* transformation: XXX: also do these:
35450|       |                   get_loc(n) get_loc(x) add dup put_loc(n) drop -> get_loc(x) add_loc(n)
35451|       |                   get_loc(n) get_arg(x) add dup put_loc(n) drop -> get_arg(x) add_loc(n)
35452|       |                   get_loc(n) get_var_ref(x) add dup put_loc(n) drop -> get_var_ref(x) add_loc(n)
35453|       |                 */
35454|      1|                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)) {
  ------------------
  |  |33878|      1|#define M3(op1, op2, op3)       ((op1) | ((op2) << 8) | ((op3) << 16))
  ------------------
  |  Branch (35454:21): [True: 0, False: 1]
  ------------------
35455|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35455:25): [True: 0, False: 0]
  ------------------
35456|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35457|      0|                    put_short_code(&bc_out, cc.op, cc.idx);
35458|      0|                    dbuf_putc(&bc_out, OP_add_loc);
35459|      0|                    dbuf_putc(&bc_out, idx);
35460|      0|                    pos_next = cc.pos;
35461|      0|                    break;
35462|      0|                }
35463|      1|                add_pc2line_info(s, bc_out.size, line_num);
35464|      1|                put_short_code(&bc_out, op, idx);
35465|      1|                break;
35466|      1|            }
35467|      0|            goto no_change;
35468|      0|#if SHORT_OPCODES
35469|      4|        case OP_get_arg:
  ------------------
  |  Branch (35469:9): [True: 4, False: 370]
  ------------------
35470|      4|        case OP_get_var_ref:
  ------------------
  |  Branch (35470:9): [True: 0, False: 374]
  ------------------
35471|      4|            if (OPTIMIZE) {
  ------------------
  |  |   50|      4|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 4, Folded]
  |  |  ------------------
  ------------------
35472|      4|                int idx;
35473|      4|                idx = get_u16(bc_buf + pos + 1);
35474|      4|                add_pc2line_info(s, bc_out.size, line_num);
35475|      4|                put_short_code(&bc_out, op, idx);
35476|      4|                break;
35477|      4|            }
35478|      0|            goto no_change;
35479|      0|#endif
35480|     19|        case OP_put_loc:
  ------------------
  |  Branch (35480:9): [True: 19, False: 355]
  ------------------
35481|     19|        case OP_put_loc_check:
  ------------------
  |  Branch (35481:9): [True: 0, False: 374]
  ------------------
35482|     19|        case OP_put_arg:
  ------------------
  |  Branch (35482:9): [True: 0, False: 374]
  ------------------
35483|     19|        case OP_put_var_ref:
  ------------------
  |  Branch (35483:9): [True: 0, False: 374]
  ------------------
35484|     19|            if (OPTIMIZE) {
  ------------------
  |  |   50|     19|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 19, Folded]
  |  |  ------------------
  ------------------
35485|       |                /* transformation: put_x(n) get_x(n) -> set_x(n) */
35486|     19|                int idx;
35487|     19|                idx = get_u16(bc_buf + pos + 1);
35488|     19|                if (code_match(&cc, pos_next, op - 1, idx, -1)) {
  ------------------
  |  Branch (35488:21): [True: 8, False: 11]
  ------------------
35489|      8|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35489:25): [True: 2, False: 6]
  ------------------
35490|      8|                    add_pc2line_info(s, bc_out.size, line_num);
35491|      8|                    put_short_code(&bc_out, op + 1, idx);
35492|      8|                    pos_next = cc.pos;
35493|      8|                    break;
35494|      8|                }
35495|     11|                add_pc2line_info(s, bc_out.size, line_num);
35496|     11|                put_short_code(&bc_out, op, idx);
35497|     11|                break;
35498|     19|            }
35499|      0|            goto no_change;
35500|       |
35501|      0|        case OP_post_inc:
  ------------------
  |  Branch (35501:9): [True: 0, False: 374]
  ------------------
35502|      0|        case OP_post_dec:
  ------------------
  |  Branch (35502:9): [True: 0, False: 374]
  ------------------
35503|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35504|       |                /* transformation:
35505|       |                   post_inc put_x drop -> inc put_x
35506|       |                   post_inc perm3 put_field drop -> inc put_field
35507|       |                   post_inc perm4 put_array_el drop -> inc put_array_el
35508|       |                 */
35509|      0|                int op1, idx;
35510|      0|                if (code_match(&cc, pos_next, M3(OP_put_loc, OP_put_arg, OP_put_var_ref), -1, OP_drop, -1)) {
  ------------------
  |  |33878|      0|#define M3(op1, op2, op3)       ((op1) | ((op2) << 8) | ((op3) << 16))
  ------------------
  |  Branch (35510:21): [True: 0, False: 0]
  ------------------
35511|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35511:25): [True: 0, False: 0]
  ------------------
35512|      0|                    op1 = cc.op;
35513|      0|                    idx = cc.idx;
35514|      0|                    pos_next = cc.pos;
35515|      0|                    if (code_match(&cc, cc.pos, op1 - 1, idx, -1)) {
  ------------------
  |  Branch (35515:25): [True: 0, False: 0]
  ------------------
35516|      0|                        if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35516:29): [True: 0, False: 0]
  ------------------
35517|      0|                        op1 += 1;   /* put_x(n) get_x(n) -> set_x(n) */
35518|      0|                        pos_next = cc.pos;
35519|      0|                    }
35520|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35521|      0|                    dbuf_putc(&bc_out, OP_dec + (op - OP_post_dec));
35522|      0|                    put_short_code(&bc_out, op1, idx);
35523|      0|                    break;
35524|      0|                }
35525|      0|                if (code_match(&cc, pos_next, OP_perm3, OP_put_field, OP_drop, -1)) {
  ------------------
  |  Branch (35525:21): [True: 0, False: 0]
  ------------------
35526|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35526:25): [True: 0, False: 0]
  ------------------
35527|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35528|      0|                    dbuf_putc(&bc_out, OP_dec + (op - OP_post_dec));
35529|      0|                    dbuf_putc(&bc_out, OP_put_field);
35530|      0|                    dbuf_put_u32(&bc_out, cc.atom);
35531|      0|                    pos_next = cc.pos;
35532|      0|                    break;
35533|      0|                }
35534|      0|                if (code_match(&cc, pos_next, OP_perm4, OP_put_array_el, OP_drop, -1)) {
  ------------------
  |  Branch (35534:21): [True: 0, False: 0]
  ------------------
35535|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35535:25): [True: 0, False: 0]
  ------------------
35536|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35537|      0|                    dbuf_putc(&bc_out, OP_dec + (op - OP_post_dec));
35538|      0|                    dbuf_putc(&bc_out, OP_put_array_el);
35539|      0|                    pos_next = cc.pos;
35540|      0|                    break;
35541|      0|                }
35542|      0|            }
35543|      0|            goto no_change;
35544|       |
35545|      0|#if SHORT_OPCODES
35546|      0|        case OP_typeof:
  ------------------
  |  Branch (35546:9): [True: 0, False: 374]
  ------------------
35547|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35548|       |                /* simplify typeof tests */
35549|      0|                if (code_match(&cc, pos_next, OP_push_atom_value, M4(OP_strict_eq, OP_strict_neq, OP_eq, OP_neq), -1)) {
  ------------------
  |  |33879|      0|#define M4(op1, op2, op3, op4)  ((op1) | ((op2) << 8) | ((op3) << 16) | ((op4) << 24))
  ------------------
  |  Branch (35549:21): [True: 0, False: 0]
  ------------------
35550|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35550:25): [True: 0, False: 0]
  ------------------
35551|      0|                    int op1 = (cc.op == OP_strict_eq || cc.op == OP_eq) ? OP_strict_eq : OP_strict_neq;
  ------------------
  |  Branch (35551:32): [True: 0, False: 0]
  |  Branch (35551:57): [True: 0, False: 0]
  ------------------
35552|      0|                    int op2 = -1;
35553|      0|                    switch (cc.atom) {
  ------------------
  |  Branch (35553:29): [True: 0, False: 0]
  ------------------
35554|      0|                    case JS_ATOM_undefined:
  ------------------
  |  Branch (35554:21): [True: 0, False: 0]
  ------------------
35555|      0|                        op2 = OP_typeof_is_undefined;
35556|      0|                        break;
35557|      0|                    case JS_ATOM_function:
  ------------------
  |  Branch (35557:21): [True: 0, False: 0]
  ------------------
35558|      0|                        op2 = OP_typeof_is_function;
35559|      0|                        break;
35560|      0|                    }
35561|      0|                    if (op2 >= 0) {
  ------------------
  |  Branch (35561:25): [True: 0, False: 0]
  ------------------
35562|       |                        /* transform typeof(s) == "<type>" into is_<type> */
35563|      0|                        if (op1 == OP_strict_eq) {
  ------------------
  |  Branch (35563:29): [True: 0, False: 0]
  ------------------
35564|      0|                            add_pc2line_info(s, bc_out.size, line_num);
35565|      0|                            dbuf_putc(&bc_out, op2);
35566|      0|                            JS_FreeAtom(ctx, cc.atom);
35567|      0|                            pos_next = cc.pos;
35568|      0|                            break;
35569|      0|                        }
35570|      0|                        if (op1 == OP_strict_neq && code_match(&cc, cc.pos, OP_if_false, -1)) {
  ------------------
  |  Branch (35570:29): [True: 0, False: 0]
  |  Branch (35570:53): [True: 0, False: 0]
  ------------------
35571|       |                            /* transform typeof(s) != "<type>" if_false into is_<type> if_true */
35572|      0|                            if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35572:33): [True: 0, False: 0]
  ------------------
35573|      0|                            add_pc2line_info(s, bc_out.size, line_num);
35574|      0|                            dbuf_putc(&bc_out, op2);
35575|      0|                            JS_FreeAtom(ctx, cc.atom);
35576|      0|                            pos_next = cc.pos;
35577|      0|                            label = cc.label;
35578|      0|                            op = OP_if_true;
35579|      0|                            goto has_label;
35580|      0|                        }
35581|      0|                    }
35582|      0|                }
35583|      0|            }
35584|      0|            goto no_change;
35585|      0|#endif
35586|       |
35587|     95|        default:
  ------------------
  |  Branch (35587:9): [True: 95, False: 279]
  ------------------
35588|    158|        no_change:
35589|    158|            add_pc2line_info(s, bc_out.size, line_num);
35590|    158|            dbuf_put(&bc_out, bc_buf + pos, len);
35591|    158|            break;
35592|    374|        }
35593|    374|    }
35594|       |
35595|       |    /* check that there were no missing labels */
35596|     43|    for(i = 0; i < s->label_count; i++) {
  ------------------
  |  Branch (35596:16): [True: 23, False: 20]
  ------------------
35597|     23|        assert(label_slots[i].first_reloc == NULL);
  ------------------
  |  Branch (35597:9): [True: 0, False: 23]
  |  Branch (35597:9): [True: 23, False: 0]
  ------------------
35598|     23|    }
35599|     20|#if SHORT_OPCODES
35600|     20|    if (OPTIMIZE) {
  ------------------
  |  |   50|     20|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 20, Folded]
  |  |  ------------------
  ------------------
35601|       |        /* more jump optimizations */
35602|     20|        int patch_offsets = 0;
35603|     39|        for (i = 0, jp = s->jump_slots; i < s->jump_count; i++, jp++) {
  ------------------
  |  Branch (35603:41): [True: 19, False: 20]
  ------------------
35604|     19|            LabelSlot *ls;
35605|     19|            JumpSlot *jp1;
35606|     19|            int j, pos, diff, delta;
35607|       |
35608|     19|            delta = 3;
35609|     19|            switch (op = jp->op) {
  ------------------
  |  Branch (35609:21): [True: 0, False: 19]
  ------------------
35610|      0|            case OP_goto16:
  ------------------
  |  Branch (35610:13): [True: 0, False: 19]
  ------------------
35611|      0|                delta = 1;
35612|       |                /* fall thru */
35613|      0|            case OP_if_false:
  ------------------
  |  Branch (35613:13): [True: 0, False: 19]
  ------------------
35614|      0|            case OP_if_true:
  ------------------
  |  Branch (35614:13): [True: 0, False: 19]
  ------------------
35615|      0|            case OP_goto:
  ------------------
  |  Branch (35615:13): [True: 0, False: 19]
  ------------------
35616|      0|                pos = jp->pos;
35617|      0|                diff = s->label_slots[jp->label].addr - pos;
35618|      0|                if (diff >= -128 && diff <= 127 + delta) {
  ------------------
  |  Branch (35618:21): [True: 0, False: 0]
  |  Branch (35618:37): [True: 0, False: 0]
  ------------------
35619|       |                    //put_u8(bc_out.buf + pos, diff);
35620|      0|                    jp->size = 1;
35621|      0|                    if (op == OP_goto16) {
  ------------------
  |  Branch (35621:25): [True: 0, False: 0]
  ------------------
35622|      0|                        bc_out.buf[pos - 1] = jp->op = OP_goto8;
35623|      0|                    } else {
35624|      0|                        bc_out.buf[pos - 1] = jp->op = OP_if_false8 + (op - OP_if_false);
35625|      0|                    }
35626|      0|                    goto shrink;
35627|      0|                } else
35628|      0|                if (diff == (int16_t)diff && op == OP_goto) {
  ------------------
  |  Branch (35628:21): [True: 0, False: 0]
  |  Branch (35628:46): [True: 0, False: 0]
  ------------------
35629|       |                    //put_u16(bc_out.buf + pos, diff);
35630|      0|                    jp->size = 2;
35631|      0|                    delta = 2;
35632|      0|                    bc_out.buf[pos - 1] = jp->op = OP_goto16;
35633|      0|                shrink:
35634|       |                    /* XXX: should reduce complexity, using 2 finger copy scheme */
35635|      0|                    memmove(bc_out.buf + pos + jp->size, bc_out.buf + pos + jp->size + delta,
35636|      0|                            bc_out.size - pos - jp->size - delta);
35637|      0|                    bc_out.size -= delta;
35638|      0|                    patch_offsets++;
35639|      0|                    for (j = 0, ls = s->label_slots; j < s->label_count; j++, ls++) {
  ------------------
  |  Branch (35639:54): [True: 0, False: 0]
  ------------------
35640|      0|                        if (ls->addr > pos)
  ------------------
  |  Branch (35640:29): [True: 0, False: 0]
  ------------------
35641|      0|                            ls->addr -= delta;
35642|      0|                    }
35643|      0|                    for (j = i + 1, jp1 = jp + 1; j < s->jump_count; j++, jp1++) {
  ------------------
  |  Branch (35643:51): [True: 0, False: 0]
  ------------------
35644|      0|                        if (jp1->pos > pos)
  ------------------
  |  Branch (35644:29): [True: 0, False: 0]
  ------------------
35645|      0|                            jp1->pos -= delta;
35646|      0|                    }
35647|      0|                    for (j = 0; j < s->line_number_count; j++) {
  ------------------
  |  Branch (35647:33): [True: 0, False: 0]
  ------------------
35648|      0|                        if (s->line_number_slots[j].pc > pos)
  ------------------
  |  Branch (35648:29): [True: 0, False: 0]
  ------------------
35649|      0|                            s->line_number_slots[j].pc -= delta;
35650|      0|                    }
35651|      0|                    continue;
35652|      0|                }
35653|      0|                break;
35654|     19|            }
35655|     19|        }
35656|     20|        if (patch_offsets) {
  ------------------
  |  Branch (35656:13): [True: 0, False: 20]
  ------------------
35657|      0|            JumpSlot *jp1;
35658|      0|            int j;
35659|      0|            for (j = 0, jp1 = s->jump_slots; j < s->jump_count; j++, jp1++) {
  ------------------
  |  Branch (35659:46): [True: 0, False: 0]
  ------------------
35660|      0|                int diff1 = s->label_slots[jp1->label].addr - jp1->pos;
35661|      0|                switch (jp1->size) {
  ------------------
  |  Branch (35661:25): [True: 0, False: 0]
  ------------------
35662|      0|                case 1:
  ------------------
  |  Branch (35662:17): [True: 0, False: 0]
  ------------------
35663|      0|                    put_u8(bc_out.buf + jp1->pos, diff1);
35664|      0|                    break;
35665|      0|                case 2:
  ------------------
  |  Branch (35665:17): [True: 0, False: 0]
  ------------------
35666|      0|                    put_u16(bc_out.buf + jp1->pos, diff1);
35667|      0|                    break;
35668|      0|                case 4:
  ------------------
  |  Branch (35668:17): [True: 0, False: 0]
  ------------------
35669|      0|                    put_u32(bc_out.buf + jp1->pos, diff1);
35670|      0|                    break;
35671|      0|                }
35672|      0|            }
35673|      0|        }
35674|     20|    }
35675|     20|    js_free(ctx, s->jump_slots);
35676|     20|    s->jump_slots = NULL;
35677|     20|#endif
35678|     20|    js_free(ctx, s->label_slots);
35679|     20|    s->label_slots = NULL;
35680|       |    /* XXX: should delay until copying to runtime bytecode function */
35681|     20|    compute_pc2line_info(s);
35682|     20|    js_free(ctx, s->line_number_slots);
35683|     20|    s->line_number_slots = NULL;
35684|       |    /* set the new byte code */
35685|     20|    dbuf_free(&s->byte_code);
35686|     20|    s->byte_code = bc_out;
35687|     20|    s->use_short_opcodes = TRUE;
35688|     20|    if (dbuf_error(&s->byte_code)) {
  ------------------
  |  Branch (35688:9): [True: 0, False: 20]
  ------------------
35689|      0|        JS_ThrowOutOfMemory(ctx);
35690|      0|        return -1;
35691|      0|    }
35692|     20|    return 0;
35693|      0| fail:
35694|       |    /* XXX: not safe */
35695|      0|    dbuf_free(&bc_out);
35696|      0|    return -1;
35697|     20|}
quickjs.c:put_short_code:
34738|     36|{
34739|     36|#if SHORT_OPCODES
34740|     36|    if (idx < 4) {
  ------------------
  |  Branch (34740:9): [True: 36, False: 0]
  ------------------
34741|     36|        switch (op) {
  ------------------
  |  Branch (34741:17): [True: 35, False: 1]
  ------------------
34742|      1|        case OP_get_loc:
  ------------------
  |  Branch (34742:9): [True: 1, False: 35]
  ------------------
34743|      1|            dbuf_putc(bc_out, OP_get_loc0 + idx);
34744|      1|            return;
34745|     11|        case OP_put_loc:
  ------------------
  |  Branch (34745:9): [True: 11, False: 25]
  ------------------
34746|     11|            dbuf_putc(bc_out, OP_put_loc0 + idx);
34747|     11|            return;
34748|     10|        case OP_set_loc:
  ------------------
  |  Branch (34748:9): [True: 10, False: 26]
  ------------------
34749|     10|            dbuf_putc(bc_out, OP_set_loc0 + idx);
34750|     10|            return;
34751|      4|        case OP_get_arg:
  ------------------
  |  Branch (34751:9): [True: 4, False: 32]
  ------------------
34752|      4|            dbuf_putc(bc_out, OP_get_arg0 + idx);
34753|      4|            return;
34754|      0|        case OP_put_arg:
  ------------------
  |  Branch (34754:9): [True: 0, False: 36]
  ------------------
34755|      0|            dbuf_putc(bc_out, OP_put_arg0 + idx);
34756|      0|            return;
34757|      5|        case OP_set_arg:
  ------------------
  |  Branch (34757:9): [True: 5, False: 31]
  ------------------
34758|      5|            dbuf_putc(bc_out, OP_set_arg0 + idx);
34759|      5|            return;
34760|      0|        case OP_get_var_ref:
  ------------------
  |  Branch (34760:9): [True: 0, False: 36]
  ------------------
34761|      0|            dbuf_putc(bc_out, OP_get_var_ref0 + idx);
34762|      0|            return;
34763|      0|        case OP_put_var_ref:
  ------------------
  |  Branch (34763:9): [True: 0, False: 36]
  ------------------
34764|      0|            dbuf_putc(bc_out, OP_put_var_ref0 + idx);
34765|      0|            return;
34766|      0|        case OP_set_var_ref:
  ------------------
  |  Branch (34766:9): [True: 0, False: 36]
  ------------------
34767|      0|            dbuf_putc(bc_out, OP_set_var_ref0 + idx);
34768|      0|            return;
34769|      4|        case OP_call:
  ------------------
  |  Branch (34769:9): [True: 4, False: 32]
  ------------------
34770|      4|            dbuf_putc(bc_out, OP_call0 + idx);
34771|      4|            return;
34772|     36|        }
34773|     36|    }
34774|      1|    if (idx < 256) {
  ------------------
  |  Branch (34774:9): [True: 1, False: 0]
  ------------------
34775|      1|        switch (op) {
  ------------------
  |  Branch (34775:17): [True: 0, False: 1]
  ------------------
34776|      0|        case OP_get_loc:
  ------------------
  |  Branch (34776:9): [True: 0, False: 1]
  ------------------
34777|      0|            dbuf_putc(bc_out, OP_get_loc8);
34778|      0|            dbuf_putc(bc_out, idx);
34779|      0|            return;
34780|      0|        case OP_put_loc:
  ------------------
  |  Branch (34780:9): [True: 0, False: 1]
  ------------------
34781|      0|            dbuf_putc(bc_out, OP_put_loc8);
34782|      0|            dbuf_putc(bc_out, idx);
34783|      0|            return;
34784|      0|        case OP_set_loc:
  ------------------
  |  Branch (34784:9): [True: 0, False: 1]
  ------------------
34785|      0|            dbuf_putc(bc_out, OP_set_loc8);
34786|      0|            dbuf_putc(bc_out, idx);
34787|      0|            return;
34788|      1|        }
34789|      1|    }
34790|      1|#endif
34791|      1|    dbuf_putc(bc_out, op);
34792|      1|    dbuf_put_u16(bc_out, idx);
34793|      1|}
quickjs.c:add_pc2line_info:
34548|    250|{
34549|    250|    if (s->line_number_slots != NULL
  ------------------
  |  Branch (34549:9): [True: 244, False: 6]
  ------------------
34550|    244|    &&  s->line_number_count < s->line_number_size
  ------------------
  |  Branch (34550:9): [True: 234, False: 10]
  ------------------
34551|    234|    &&  pc >= s->line_number_last_pc
  ------------------
  |  Branch (34551:9): [True: 234, False: 0]
  ------------------
34552|    234|    &&  source_pos != s->line_number_last) {
  ------------------
  |  Branch (34552:9): [True: 75, False: 159]
  ------------------
34553|     75|        s->line_number_slots[s->line_number_count].pc = pc;
34554|     75|        s->line_number_slots[s->line_number_count].source_pos = source_pos;
34555|     75|        s->line_number_count++;
34556|     75|        s->line_number_last_pc = pc;
34557|     75|        s->line_number_last = source_pos;
34558|     75|    }
34559|    250|}
quickjs.c:find_jump_target:
34662|     21|{
34663|     21|    int i, pos, op, label;
34664|       |
34665|     21|    label = label0;
34666|     21|    update_label(s, label, -1);
34667|     21|    for (i = 0; i < 10; i++) {
  ------------------
  |  Branch (34667:17): [True: 21, False: 0]
  ------------------
34668|     21|        assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34668:9): [True: 0, False: 21]
  |  Branch (34668:9): [True: 0, False: 0]
  |  Branch (34668:9): [True: 21, False: 0]
  |  Branch (34668:9): [True: 21, False: 0]
  ------------------
34669|     21|        pos = s->label_slots[label].pos2;
34670|     34|        for (;;) {
34671|     34|            switch(op = s->byte_code.buf[pos]) {
34672|     13|            case OP_line_num:
  ------------------
  |  Branch (34672:13): [True: 13, False: 21]
  ------------------
34673|     13|                if (pline)
  ------------------
  |  Branch (34673:21): [True: 2, False: 11]
  ------------------
34674|      2|                    *pline = get_u32(s->byte_code.buf + pos + 1);
34675|       |                /* fall thru */
34676|     13|            case OP_label:
  ------------------
  |  Branch (34676:13): [True: 0, False: 34]
  ------------------
34677|     13|                pos += opcode_info[op].size;
34678|     13|                continue;
34679|      0|            case OP_goto:
  ------------------
  |  Branch (34679:13): [True: 0, False: 34]
  ------------------
34680|      0|                label = get_u32(s->byte_code.buf + pos + 1);
34681|      0|                break;
34682|      2|            case OP_drop:
  ------------------
  |  Branch (34682:13): [True: 2, False: 32]
  ------------------
34683|       |                /* ignore drop opcodes if followed by OP_return_undef */
34684|      2|                while (s->byte_code.buf[++pos] == OP_drop)
  ------------------
  |  Branch (34684:24): [True: 0, False: 2]
  ------------------
34685|      0|                    continue;
34686|      2|                if (s->byte_code.buf[pos] == OP_return_undef)
  ------------------
  |  Branch (34686:21): [True: 0, False: 2]
  ------------------
34687|      0|                    op = OP_return_undef;
34688|       |                /* fall thru */
34689|     21|            default:
  ------------------
  |  Branch (34689:13): [True: 19, False: 15]
  ------------------
34690|     21|                goto done;
34691|     34|            }
34692|      0|            break;
34693|     34|        }
34694|     21|    }
34695|       |    /* cycle detected, could issue a warning */
34696|       |    /* XXX: the combination of find_jump_target() and skip_dead_code()
34697|       |       seems incorrect with cyclic labels. See for exemple:
34698|       |
34699|       |       for (;;) {
34700|       |       l:break l;
34701|       |       l:break l;
34702|       |       l:break l;
34703|       |       l:break l;
34704|       |       }
34705|       |
34706|       |       Avoiding changing the target is just a workaround and might not
34707|       |       suffice to completely fix the problem. */
34708|      0|    label = label0;
34709|     21| done:
34710|     21|    *pop = op;
34711|     21|    update_label(s, label, +1);
34712|     21|    return label;
34713|      0|}
quickjs.c:code_has_label:
34634|     21|{
34635|     28|    while (pos < s->bc_len) {
  ------------------
  |  Branch (34635:12): [True: 28, False: 0]
  ------------------
34636|     28|        int op = s->bc_buf[pos];
34637|     28|        if (op == OP_line_num) {
  ------------------
  |  Branch (34637:13): [True: 0, False: 28]
  ------------------
34638|      0|            pos += 5;
34639|      0|            continue;
34640|      0|        }
34641|     28|        if (op == OP_label) {
  ------------------
  |  Branch (34641:13): [True: 9, False: 19]
  ------------------
34642|      9|            int lab = get_u32(s->bc_buf + pos + 1);
34643|      9|            if (lab == label)
  ------------------
  |  Branch (34643:17): [True: 2, False: 7]
  ------------------
34644|      2|                return TRUE;
34645|      7|            pos += 5;
34646|      7|            continue;
34647|      9|        }
34648|     19|        if (op == OP_goto) {
  ------------------
  |  Branch (34648:13): [True: 0, False: 19]
  ------------------
34649|      0|            int lab = get_u32(s->bc_buf + pos + 1);
34650|      0|            if (lab == label)
  ------------------
  |  Branch (34650:17): [True: 0, False: 0]
  ------------------
34651|      0|                return TRUE;
34652|      0|        }
34653|     19|        break;
34654|     19|    }
34655|     19|    return FALSE;
34656|     21|}
quickjs.c:add_reloc:
34621|     16|{
34622|     16|    RelocEntry *re;
34623|     16|    re = js_malloc(ctx, sizeof(*re));
34624|     16|    if (!re)
  ------------------
  |  Branch (34624:9): [True: 0, False: 16]
  ------------------
34625|      0|        return NULL;
34626|     16|    re->addr = addr;
34627|     16|    re->size = size;
34628|     16|    re->next = ls->first_reloc;
34629|     16|    ls->first_reloc = re;
34630|     16|    return re;
34631|     16|}
quickjs.c:push_short_int:
34716|      2|{
34717|      2|#if SHORT_OPCODES
34718|      2|    if (val >= -1 && val <= 7) {
  ------------------
  |  Branch (34718:9): [True: 2, False: 0]
  |  Branch (34718:22): [True: 2, False: 0]
  ------------------
34719|      2|        dbuf_putc(bc_out, OP_push_0 + val);
34720|      2|        return;
34721|      2|    }
34722|      0|    if (val == (int8_t)val) {
  ------------------
  |  Branch (34722:9): [True: 0, False: 0]
  ------------------
34723|      0|        dbuf_putc(bc_out, OP_push_i8);
34724|      0|        dbuf_putc(bc_out, val);
34725|      0|        return;
34726|      0|    }
34727|      0|    if (val == (int16_t)val) {
  ------------------
  |  Branch (34727:9): [True: 0, False: 0]
  ------------------
34728|      0|        dbuf_putc(bc_out, OP_push_i16);
34729|      0|        dbuf_put_u16(bc_out, val);
34730|      0|        return;
34731|      0|    }
34732|      0|#endif
34733|      0|    dbuf_putc(bc_out, OP_push_i32);
34734|      0|    dbuf_put_u32(bc_out, val);
34735|      0|}
quickjs.c:compute_pc2line_info:
34568|     20|{
34569|     20|    if (!s->strip_debug) {
  ------------------
  |  Branch (34569:9): [True: 20, False: 0]
  ------------------
34570|     20|        int last_line_num, last_col_num;
34571|     20|        uint32_t last_pc = 0;
34572|     20|        int i, line_num, col_num;
34573|     20|        const uint8_t *buf_start = s->get_line_col_cache->buf_start;
34574|     20|        js_dbuf_init(s->ctx, &s->pc2line);
34575|       |
34576|     20|        last_line_num = get_line_col_cached(s->get_line_col_cache,
34577|     20|                                            &last_col_num,
34578|     20|                                            buf_start + s->source_pos);
34579|     20|        dbuf_put_leb128(&s->pc2line, last_line_num); /* line number minus 1 */
34580|     20|        dbuf_put_leb128(&s->pc2line, last_col_num); /* column number minus 1 */
34581|       |
34582|     95|        for (i = 0; i < s->line_number_count; i++) {
  ------------------
  |  Branch (34582:21): [True: 75, False: 20]
  ------------------
34583|     75|            uint32_t pc = s->line_number_slots[i].pc;
34584|     75|            uint32_t source_pos = s->line_number_slots[i].source_pos;
34585|     75|            int diff_pc, diff_line, diff_col;
34586|       |
34587|     75|            if (source_pos == -1)
  ------------------
  |  Branch (34587:17): [True: 0, False: 75]
  ------------------
34588|      0|                continue;
34589|     75|            diff_pc = pc - last_pc;
34590|     75|            if (diff_pc < 0)
  ------------------
  |  Branch (34590:17): [True: 0, False: 75]
  ------------------
34591|      0|                continue;
34592|       |
34593|     75|            line_num = get_line_col_cached(s->get_line_col_cache, &col_num,
34594|     75|                                           buf_start + source_pos);
34595|     75|            diff_line = line_num - last_line_num;
34596|     75|            diff_col = col_num - last_col_num;
34597|     75|            if (diff_line == 0 && diff_col == 0)
  ------------------
  |  Branch (34597:17): [True: 39, False: 36]
  |  Branch (34597:35): [True: 0, False: 39]
  ------------------
34598|      0|                continue;
34599|       |
34600|     75|            if (diff_line >= PC2LINE_BASE &&
  ------------------
  |  |  673|    150|#define PC2LINE_BASE     (-1)
  ------------------
  |  Branch (34600:17): [True: 73, False: 2]
  ------------------
34601|     73|                diff_line < PC2LINE_BASE + PC2LINE_RANGE &&
  ------------------
  |  |  673|     73|#define PC2LINE_BASE     (-1)
  ------------------
                              diff_line < PC2LINE_BASE + PC2LINE_RANGE &&
  ------------------
  |  |  674|    148|#define PC2LINE_RANGE    5
  ------------------
  |  Branch (34601:17): [True: 68, False: 5]
  ------------------
34602|     68|                diff_pc <= PC2LINE_DIFF_PC_MAX) {
  ------------------
  |  |  676|     68|#define PC2LINE_DIFF_PC_MAX ((255 - PC2LINE_OP_FIRST) / PC2LINE_RANGE)
  |  |  ------------------
  |  |  |  |  675|     68|#define PC2LINE_OP_FIRST 1
  |  |  ------------------
  |  |               #define PC2LINE_DIFF_PC_MAX ((255 - PC2LINE_OP_FIRST) / PC2LINE_RANGE)
  |  |  ------------------
  |  |  |  |  674|     68|#define PC2LINE_RANGE    5
  |  |  ------------------
  ------------------
  |  Branch (34602:17): [True: 68, False: 0]
  ------------------
34603|     68|                dbuf_putc(&s->pc2line, (diff_line - PC2LINE_BASE) +
  ------------------
  |  |  673|     68|#define PC2LINE_BASE     (-1)
  ------------------
34604|     68|                          diff_pc * PC2LINE_RANGE + PC2LINE_OP_FIRST);
  ------------------
  |  |  674|     68|#define PC2LINE_RANGE    5
  ------------------
                                        diff_pc * PC2LINE_RANGE + PC2LINE_OP_FIRST);
  ------------------
  |  |  675|     68|#define PC2LINE_OP_FIRST 1
  ------------------
34605|     68|            } else {
34606|       |                /* longer encoding */
34607|      7|                dbuf_putc(&s->pc2line, 0);
34608|      7|                dbuf_put_leb128(&s->pc2line, diff_pc);
34609|      7|                dbuf_put_sleb128(&s->pc2line, diff_line);
34610|      7|            }
34611|     75|            dbuf_put_sleb128(&s->pc2line, diff_col);
34612|       |                
34613|     75|            last_pc = pc;
34614|     75|            last_line_num = line_num;
34615|     75|            last_col_num = col_num;
34616|     75|        }
34617|     20|    }
34618|     20|}
quickjs.c:get_line_col_cached:
22301|     95|{
22302|     95|    int line_num, col_num;
22303|     95|    if (ptr >= s->ptr) {
  ------------------
  |  Branch (22303:9): [True: 87, False: 8]
  ------------------
22304|     87|        line_num = get_line_col(&col_num, s->ptr, ptr - s->ptr);
22305|     87|        if (line_num == 0) {
  ------------------
  |  Branch (22305:13): [True: 53, False: 34]
  ------------------
22306|     53|            s->col_num += col_num;
22307|     53|        } else {
22308|     34|            s->line_num += line_num;
22309|     34|            s->col_num = col_num;
22310|     34|        }
22311|     87|    } else {
22312|      8|        line_num = get_line_col(&col_num, ptr, s->ptr - ptr);
22313|      8|        if (line_num == 0) {
  ------------------
  |  Branch (22313:13): [True: 3, False: 5]
  ------------------
22314|      3|            s->col_num -= col_num;
22315|      5|        } else {
22316|      5|            const uint8_t *p;
22317|      5|            s->line_num -= line_num;
22318|       |            /* find the absolute column position */
22319|      5|            col_num = 0;
22320|    106|            for(p = ptr - 1; p >= s->buf_start; p--) {
  ------------------
  |  Branch (22320:30): [True: 103, False: 3]
  ------------------
22321|    103|                if (*p == '\n') {
  ------------------
  |  Branch (22321:21): [True: 2, False: 101]
  ------------------
22322|      2|                    break;
22323|    101|                } else if (*p < 0x80 || *p >= 0xc0) {
  ------------------
  |  Branch (22323:28): [True: 94, False: 7]
  |  Branch (22323:41): [True: 0, False: 7]
  ------------------
22324|     94|                    col_num++;
22325|     94|                }
22326|    103|            }
22327|      5|            s->col_num = col_num;
22328|      5|        }
22329|      8|    }
22330|     95|    s->ptr = ptr;
22331|     95|    *pcol_num = s->col_num;
22332|     95|    return s->line_num;
22333|     95|}
quickjs.c:compute_stack_size:
35756|     20|{
35757|     20|    StackSizeState s_s, *s = &s_s;
35758|     20|    int i, diff, n_pop, pos_next, stack_len, pos, op, catch_pos, catch_level;
35759|     20|    const JSOpCode *oi;
35760|     20|    const uint8_t *bc_buf;
35761|       |
35762|     20|    bc_buf = fd->byte_code.buf;
35763|     20|    s->bc_len = fd->byte_code.size;
35764|       |    /* bc_len > 0 */
35765|     20|    s->stack_level_tab = js_malloc(ctx, sizeof(s->stack_level_tab[0]) *
35766|     20|                                   s->bc_len);
35767|     20|    if (!s->stack_level_tab)
  ------------------
  |  Branch (35767:9): [True: 0, False: 20]
  ------------------
35768|      0|        return -1;
35769|    550|    for(i = 0; i < s->bc_len; i++)
  ------------------
  |  Branch (35769:16): [True: 530, False: 20]
  ------------------
35770|    530|        s->stack_level_tab[i] = 0xffff;
35771|     20|    s->pc_stack = NULL;
35772|     20|    s->catch_pos_tab = js_malloc(ctx, sizeof(s->catch_pos_tab[0]) *
35773|     20|                                   s->bc_len);
35774|     20|    if (!s->catch_pos_tab)
  ------------------
  |  Branch (35774:9): [True: 0, False: 20]
  ------------------
35775|      0|        goto fail;
35776|       |
35777|     20|    s->stack_len_max = 0;
35778|     20|    s->pc_stack_len = 0;
35779|     20|    s->pc_stack_size = 0;
35780|       |
35781|       |    /* breadth-first graph exploration */
35782|     20|    if (ss_check(ctx, s, 0, OP_invalid, 0, -1))
  ------------------
  |  Branch (35782:9): [True: 0, False: 20]
  ------------------
35783|      0|        goto fail;
35784|       |
35785|    270|    while (s->pc_stack_len > 0) {
  ------------------
  |  Branch (35785:12): [True: 250, False: 20]
  ------------------
35786|    250|        pos = s->pc_stack[--s->pc_stack_len];
35787|    250|        stack_len = s->stack_level_tab[pos];
35788|    250|        catch_pos = s->catch_pos_tab[pos];
35789|    250|        op = bc_buf[pos];
35790|    250|        if (op == 0 || op >= OP_COUNT) {
  ------------------
  |  Branch (35790:13): [True: 0, False: 250]
  |  Branch (35790:24): [True: 0, False: 250]
  ------------------
35791|      0|            JS_ThrowInternalError(ctx, "invalid opcode (op=%d, pc=%d)", op, pos);
35792|      0|            goto fail;
35793|      0|        }
35794|    250|        oi = &short_opcode_info(op);
  ------------------
  |  |22182|    250|    opcode_info[(op) >= OP_TEMP_START ? \
  |  |  ------------------
  |  |  |  Branch (22182:17): [True: 69, False: 181]
  |  |  ------------------
  |  |22183|    250|                (op) + (OP_TEMP_END - OP_TEMP_START) : (op)]
  ------------------
35795|       |#if defined(DUMP_BYTECODE) && (DUMP_BYTECODE & 64)
35796|       |        printf("%5d: %10s %5d %5d\n", pos, oi->name, stack_len, catch_pos);
35797|       |#endif
35798|    250|        pos_next = pos + oi->size;
35799|    250|        if (pos_next > s->bc_len) {
  ------------------
  |  Branch (35799:13): [True: 0, False: 250]
  ------------------
35800|      0|            JS_ThrowInternalError(ctx, "bytecode buffer overflow (op=%d, pc=%d)", op, pos);
35801|      0|            goto fail;
35802|      0|        }
35803|    250|        n_pop = oi->n_pop;
35804|       |        /* call pops a variable number of arguments */
35805|    250|        if (oi->fmt == OP_FMT_npop || oi->fmt == OP_FMT_npop_u16) {
  ------------------
  |  Branch (35805:13): [True: 1, False: 249]
  |  Branch (35805:39): [True: 0, False: 249]
  ------------------
35806|      1|            n_pop += get_u16(bc_buf + pos + 1);
35807|    249|        } else {
35808|    249|#if SHORT_OPCODES
35809|    249|            if (oi->fmt == OP_FMT_npopx) {
  ------------------
  |  Branch (35809:17): [True: 4, False: 245]
  ------------------
35810|      4|                n_pop += op - OP_call0;
35811|      4|            }
35812|    249|#endif
35813|    249|        }
35814|       |
35815|    250|        if (stack_len < n_pop) {
  ------------------
  |  Branch (35815:13): [True: 0, False: 250]
  ------------------
35816|      0|            JS_ThrowInternalError(ctx, "stack underflow (op=%d, pc=%d)", op, pos);
35817|      0|            goto fail;
35818|      0|        }
35819|    250|        stack_len += oi->n_push - n_pop;
35820|    250|        if (stack_len > s->stack_len_max) {
  ------------------
  |  Branch (35820:13): [True: 41, False: 209]
  ------------------
35821|     41|            s->stack_len_max = stack_len;
35822|     41|            if (s->stack_len_max > JS_STACK_SIZE_MAX) {
  ------------------
  |  |  211|     41|#define JS_STACK_SIZE_MAX 65534
  ------------------
  |  Branch (35822:17): [True: 0, False: 41]
  ------------------
35823|      0|                JS_ThrowInternalError(ctx, "stack overflow (op=%d, pc=%d)", op, pos);
35824|      0|                goto fail;
35825|      0|            }
35826|     41|        }
35827|    250|        switch(op) {
35828|      0|        case OP_tail_call:
  ------------------
  |  Branch (35828:9): [True: 0, False: 250]
  ------------------
35829|      0|        case OP_tail_call_method:
  ------------------
  |  Branch (35829:9): [True: 0, False: 250]
  ------------------
35830|      9|        case OP_return:
  ------------------
  |  Branch (35830:9): [True: 9, False: 241]
  ------------------
35831|     20|        case OP_return_undef:
  ------------------
  |  Branch (35831:9): [True: 11, False: 239]
  ------------------
35832|     31|        case OP_return_async:
  ------------------
  |  Branch (35832:9): [True: 11, False: 239]
  ------------------
35833|     31|        case OP_throw:
  ------------------
  |  Branch (35833:9): [True: 0, False: 250]
  ------------------
35834|     31|        case OP_throw_error:
  ------------------
  |  Branch (35834:9): [True: 0, False: 250]
  ------------------
35835|     31|        case OP_ret:
  ------------------
  |  Branch (35835:9): [True: 0, False: 250]
  ------------------
35836|     31|            goto done_insn;
35837|      0|        case OP_goto:
  ------------------
  |  Branch (35837:9): [True: 0, False: 250]
  ------------------
35838|      0|            diff = get_u32(bc_buf + pos + 1);
35839|      0|            pos_next = pos + 1 + diff;
35840|      0|            break;
35841|      0|#if SHORT_OPCODES
35842|      0|        case OP_goto16:
  ------------------
  |  Branch (35842:9): [True: 0, False: 250]
  ------------------
35843|      0|            diff = (int16_t)get_u16(bc_buf + pos + 1);
35844|      0|            pos_next = pos + 1 + diff;
35845|      0|            break;
35846|      5|        case OP_goto8:
  ------------------
  |  Branch (35846:9): [True: 5, False: 245]
  ------------------
35847|      5|            diff = (int8_t)bc_buf[pos + 1];
35848|      5|            pos_next = pos + 1 + diff;
35849|      5|            break;
35850|      2|        case OP_if_true8:
  ------------------
  |  Branch (35850:9): [True: 2, False: 248]
  ------------------
35851|     14|        case OP_if_false8:
  ------------------
  |  Branch (35851:9): [True: 12, False: 238]
  ------------------
35852|     14|            diff = (int8_t)bc_buf[pos + 1];
35853|     14|            if (ss_check(ctx, s, pos + 1 + diff, op, stack_len, catch_pos))
  ------------------
  |  Branch (35853:17): [True: 0, False: 14]
  ------------------
35854|      0|                goto fail;
35855|     14|            break;
35856|     14|#endif
35857|     14|        case OP_if_true:
  ------------------
  |  Branch (35857:9): [True: 0, False: 250]
  ------------------
35858|      0|        case OP_if_false:
  ------------------
  |  Branch (35858:9): [True: 0, False: 250]
  ------------------
35859|      0|            diff = get_u32(bc_buf + pos + 1);
35860|      0|            if (ss_check(ctx, s, pos + 1 + diff, op, stack_len, catch_pos))
  ------------------
  |  Branch (35860:17): [True: 0, False: 0]
  ------------------
35861|      0|                goto fail;
35862|      0|            break;
35863|      0|        case OP_gosub:
  ------------------
  |  Branch (35863:9): [True: 0, False: 250]
  ------------------
35864|      0|            diff = get_u32(bc_buf + pos + 1);
35865|      0|            if (ss_check(ctx, s, pos + 1 + diff, op, stack_len + 1, catch_pos))
  ------------------
  |  Branch (35865:17): [True: 0, False: 0]
  ------------------
35866|      0|                goto fail;
35867|      0|            break;
35868|      0|        case OP_with_get_var:
  ------------------
  |  Branch (35868:9): [True: 0, False: 250]
  ------------------
35869|      0|        case OP_with_delete_var:
  ------------------
  |  Branch (35869:9): [True: 0, False: 250]
  ------------------
35870|      0|            diff = get_u32(bc_buf + pos + 5);
35871|      0|            if (ss_check(ctx, s, pos + 5 + diff, op, stack_len + 1, catch_pos))
  ------------------
  |  Branch (35871:17): [True: 0, False: 0]
  ------------------
35872|      0|                goto fail;
35873|      0|            break;
35874|      0|        case OP_with_make_ref:
  ------------------
  |  Branch (35874:9): [True: 0, False: 250]
  ------------------
35875|      0|        case OP_with_get_ref:
  ------------------
  |  Branch (35875:9): [True: 0, False: 250]
  ------------------
35876|      0|            diff = get_u32(bc_buf + pos + 5);
35877|      0|            if (ss_check(ctx, s, pos + 5 + diff, op, stack_len + 2, catch_pos))
  ------------------
  |  Branch (35877:17): [True: 0, False: 0]
  ------------------
35878|      0|                goto fail;
35879|      0|            break;
35880|      0|        case OP_with_put_var:
  ------------------
  |  Branch (35880:9): [True: 0, False: 250]
  ------------------
35881|      0|            diff = get_u32(bc_buf + pos + 5);
35882|      0|            if (ss_check(ctx, s, pos + 5 + diff, op, stack_len - 1, catch_pos))
  ------------------
  |  Branch (35882:17): [True: 0, False: 0]
  ------------------
35883|      0|                goto fail;
35884|      0|            break;
35885|      0|        case OP_catch:
  ------------------
  |  Branch (35885:9): [True: 0, False: 250]
  ------------------
35886|      0|            diff = get_u32(bc_buf + pos + 1);
35887|      0|            if (ss_check(ctx, s, pos + 1 + diff, op, stack_len, catch_pos))
  ------------------
  |  Branch (35887:17): [True: 0, False: 0]
  ------------------
35888|      0|                goto fail;
35889|      0|            catch_pos = pos;
35890|      0|            break;
35891|      0|        case OP_for_of_start:
  ------------------
  |  Branch (35891:9): [True: 0, False: 250]
  ------------------
35892|      0|        case OP_for_await_of_start:
  ------------------
  |  Branch (35892:9): [True: 0, False: 250]
  ------------------
35893|      0|            catch_pos = pos;
35894|      0|            break;
35895|       |            /* we assume the catch offset entry is only removed with
35896|       |               some op codes */
35897|      8|        case OP_drop:
  ------------------
  |  Branch (35897:9): [True: 8, False: 242]
  ------------------
35898|      8|            catch_level = stack_len;
35899|      8|            goto check_catch;
35900|      0|        case OP_nip:
  ------------------
  |  Branch (35900:9): [True: 0, False: 250]
  ------------------
35901|      0|            catch_level = stack_len - 1;
35902|      0|            goto check_catch;
35903|      0|        case OP_nip1:
  ------------------
  |  Branch (35903:9): [True: 0, False: 250]
  ------------------
35904|      0|            catch_level = stack_len - 1;
35905|      0|            goto check_catch;
35906|      0|        case OP_iterator_close:
  ------------------
  |  Branch (35906:9): [True: 0, False: 250]
  ------------------
35907|      0|            catch_level = stack_len + 2;
35908|      8|        check_catch:
35909|       |            /* Note: for for_of_start/for_await_of_start we consider
35910|       |               the catch offset is on the first stack entry instead of
35911|       |               the thirst */
35912|      8|            if (catch_pos >= 0) {
  ------------------
  |  Branch (35912:17): [True: 0, False: 8]
  ------------------
35913|      0|                int level;
35914|      0|                level = s->stack_level_tab[catch_pos];
35915|      0|                if (bc_buf[catch_pos] != OP_catch)
  ------------------
  |  Branch (35915:21): [True: 0, False: 0]
  ------------------
35916|      0|                    level++; /* for_of_start, for_wait_of_start */
35917|       |                /* catch_level = stack_level before op_catch is executed ? */
35918|      0|                if (catch_level == level) {
  ------------------
  |  Branch (35918:21): [True: 0, False: 0]
  ------------------
35919|      0|                    catch_pos = s->catch_pos_tab[catch_pos];
35920|      0|                }
35921|      0|            }
35922|      8|            break;
35923|      0|        case OP_nip_catch:
  ------------------
  |  Branch (35923:9): [True: 0, False: 250]
  ------------------
35924|      0|            if (catch_pos < 0) {
  ------------------
  |  Branch (35924:17): [True: 0, False: 0]
  ------------------
35925|      0|                JS_ThrowInternalError(ctx, "nip_catch: no catch op (pc=%d)", pos);
35926|      0|                goto fail;
35927|      0|            }
35928|      0|            stack_len = s->stack_level_tab[catch_pos];
35929|      0|            if (bc_buf[catch_pos] != OP_catch)
  ------------------
  |  Branch (35929:17): [True: 0, False: 0]
  ------------------
35930|      0|                stack_len++; /* for_of_start, for_wait_of_start */
35931|      0|            stack_len++; /* no stack overflow is possible by construction */
35932|      0|            catch_pos = s->catch_pos_tab[catch_pos];
35933|      0|            break;
35934|    192|        default:
  ------------------
  |  Branch (35934:9): [True: 192, False: 58]
  ------------------
35935|    192|            break;
35936|    250|        }
35937|    219|        if (ss_check(ctx, s, pos_next, op, stack_len, catch_pos))
  ------------------
  |  Branch (35937:13): [True: 0, False: 219]
  ------------------
35938|      0|            goto fail;
35939|    250|    done_insn: ;
35940|    250|    }
35941|     20|    js_free(ctx, s->pc_stack);
35942|     20|    js_free(ctx, s->catch_pos_tab);
35943|     20|    js_free(ctx, s->stack_level_tab);
35944|     20|    *pstack_size = s->stack_len_max;
35945|     20|    return 0;
35946|      0| fail:
35947|      0|    js_free(ctx, s->pc_stack);
35948|      0|    js_free(ctx, s->catch_pos_tab);
35949|      0|    js_free(ctx, s->stack_level_tab);
35950|      0|    *pstack_size = 0;
35951|      0|    return -1;
35952|     20|}
quickjs.c:ss_check:
35714|    253|{
35715|    253|    if ((unsigned)pos >= s->bc_len) {
  ------------------
  |  Branch (35715:9): [True: 0, False: 253]
  ------------------
35716|      0|        JS_ThrowInternalError(ctx, "bytecode buffer overflow (op=%d, pc=%d)", op, pos);
35717|      0|        return -1;
35718|      0|    }
35719|    253|    if (stack_len > s->stack_len_max) {
  ------------------
  |  Branch (35719:9): [True: 0, False: 253]
  ------------------
35720|      0|        s->stack_len_max = stack_len;
35721|      0|        if (s->stack_len_max > JS_STACK_SIZE_MAX) {
  ------------------
  |  |  211|      0|#define JS_STACK_SIZE_MAX 65534
  ------------------
  |  Branch (35721:13): [True: 0, False: 0]
  ------------------
35722|      0|            JS_ThrowInternalError(ctx, "stack overflow (op=%d, pc=%d)", op, pos);
35723|      0|            return -1;
35724|      0|        }
35725|      0|    }
35726|    253|    if (s->stack_level_tab[pos] != 0xffff) {
  ------------------
  |  Branch (35726:9): [True: 3, False: 250]
  ------------------
35727|       |        /* already explored: check that the stack size is consistent */
35728|      3|        if (s->stack_level_tab[pos] != stack_len) {
  ------------------
  |  Branch (35728:13): [True: 0, False: 3]
  ------------------
35729|      0|            JS_ThrowInternalError(ctx, "inconsistent stack size: %d %d (pc=%d)",
35730|      0|                                  s->stack_level_tab[pos], stack_len, pos);
35731|      0|            return -1;
35732|      3|        } else if (s->catch_pos_tab[pos] != catch_pos) {
  ------------------
  |  Branch (35732:20): [True: 0, False: 3]
  ------------------
35733|      0|            JS_ThrowInternalError(ctx, "inconsistent catch position: %d %d (pc=%d)",
35734|      0|                                  s->catch_pos_tab[pos], catch_pos, pos);
35735|      0|            return -1;
35736|      3|        } else {
35737|      3|            return 0;
35738|      3|        }
35739|      3|    }
35740|       |
35741|       |    /* mark as explored and store the stack size */
35742|    250|    s->stack_level_tab[pos] = stack_len;
35743|    250|    s->catch_pos_tab[pos] = catch_pos;
35744|       |
35745|       |    /* queue the new PC to explore */
35746|    250|    if (js_resize_array(ctx, (void **)&s->pc_stack, sizeof(s->pc_stack[0]),
  ------------------
  |  Branch (35746:9): [True: 0, False: 250]
  ------------------
35747|    250|                        &s->pc_stack_size, s->pc_stack_len + 1))
35748|      0|        return -1;
35749|    250|    s->pc_stack[s->pc_stack_len++] = pos;
35750|    250|    return 0;
35751|    250|}
quickjs.c:JS_AddIntrinsicBasicObjects:
56380|     11|{
56381|     11|    JSValue obj;
56382|     11|    JSCFunctionType ft;
56383|     11|    int i;
56384|       |
56385|       |    /* warning: ordering is tricky */
56386|     11|    ctx->class_proto[JS_CLASS_OBJECT] =
56387|     11|        JS_NewObjectProtoClassAlloc(ctx, JS_NULL, JS_CLASS_OBJECT,
  ------------------
  |  |  290|     11|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|     11|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56388|     11|                                    countof(js_object_proto_funcs) + 1);
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56389|     11|    if (JS_IsException(ctx->class_proto[JS_CLASS_OBJECT]))
  ------------------
  |  Branch (56389:9): [True: 0, False: 11]
  ------------------
56390|      0|        return -1;
56391|     11|    JS_SetImmutablePrototype(ctx, ctx->class_proto[JS_CLASS_OBJECT]);
56392|       |
56393|       |    /* 2 more properties: caller and arguments */
56394|     11|    ctx->function_proto = JS_NewCFunction3(ctx, js_function_proto, "", 0,
56395|     11|                                           JS_CFUNC_generic, 0,
56396|     11|                                           ctx->class_proto[JS_CLASS_OBJECT],
56397|     11|                                           countof(js_function_proto_funcs) + 3 + 2);
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56398|     11|    if (JS_IsException(ctx->function_proto))
  ------------------
  |  Branch (56398:9): [True: 0, False: 11]
  ------------------
56399|      0|        return -1;
56400|     11|    ctx->class_proto[JS_CLASS_BYTECODE_FUNCTION] = JS_DupValue(ctx, ctx->function_proto);
56401|       |
56402|     11|    ctx->global_obj = JS_NewObjectProtoClassAlloc(ctx, ctx->class_proto[JS_CLASS_OBJECT],
56403|     11|                                                  JS_CLASS_GLOBAL_OBJECT, 64);
56404|     11|    if (JS_IsException(ctx->global_obj))
  ------------------
  |  Branch (56404:9): [True: 0, False: 11]
  ------------------
56405|      0|        return -1;
56406|     11|    {
56407|     11|        JSObject *p;
56408|     11|        obj = JS_NewObjectProtoClassAlloc(ctx, JS_NULL, JS_CLASS_OBJECT, 4);
  ------------------
  |  |  290|     11|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|     11|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56409|     11|        p = JS_VALUE_GET_OBJ(ctx->global_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)
  |  |  ------------------
  ------------------
56410|     11|        p->u.global_object.uninitialized_vars = obj;
56411|     11|    }
56412|     11|    ctx->global_var_obj = JS_NewObjectProtoClassAlloc(ctx, JS_NULL,
  ------------------
  |  |  290|     11|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  247|     11|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
56413|     11|                                                      JS_CLASS_OBJECT, 16);
56414|     11|    if (JS_IsException(ctx->global_var_obj))
  ------------------
  |  Branch (56414:9): [True: 0, False: 11]
  ------------------
56415|      0|        return -1;
56416|       |
56417|       |    /* Error */
56418|     11|    ft.generic_magic = js_error_constructor;
56419|     11|    obj = JS_NewCConstructor(ctx, JS_CLASS_ERROR, "Error",
56420|     11|                                    ft.generic, 1, JS_CFUNC_constructor_or_func_magic, -1,
56421|     11|                                    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 }
  |  |  ------------------
  ------------------
56422|     11|                                    js_error_funcs, countof(js_error_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56423|     11|                                    js_error_proto_funcs, countof(js_error_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56424|     11|                                    0);
56425|     11|    if (JS_IsException(obj))
  ------------------
  |  Branch (56425:9): [True: 0, False: 11]
  ------------------
56426|      0|        return -1;
56427|       |
56428|     99|    for(i = 0; i < JS_NATIVE_ERROR_COUNT; i++) {
  ------------------
  |  Branch (56428:16): [True: 88, False: 11]
  ------------------
56429|     88|        JSValue func_obj;
56430|     88|        const JSCFunctionListEntry *funcs;
56431|     88|        int n_args;
56432|     88|        char buf[ATOM_GET_STR_BUF_SIZE];
56433|     88|        const char *name = JS_AtomGetStr(ctx, buf, sizeof(buf),
56434|     88|                                         JS_ATOM_EvalError + i);
56435|     88|        n_args = 1 + (i == JS_AGGREGATE_ERROR);
56436|     88|        funcs = js_native_error_proto_funcs + 2 * i;
56437|     88|        func_obj = JS_NewCConstructor(ctx, -1, name,
56438|     88|                                      ft.generic, n_args, JS_CFUNC_constructor_or_func_magic, i,
56439|     88|                                      obj,
56440|     88|                                      NULL, 0,
56441|     88|                                      funcs, 2,
56442|     88|                                      0);
56443|     88|        if (JS_IsException(func_obj)) {
  ------------------
  |  Branch (56443:13): [True: 0, False: 88]
  ------------------
56444|      0|            JS_FreeValue(ctx, obj);
56445|      0|            return -1;
56446|      0|        }
56447|     88|        ctx->native_error_proto[i] = JS_GetProperty(ctx, func_obj, JS_ATOM_prototype);
56448|     88|        JS_FreeValue(ctx, func_obj);
56449|     88|        if (JS_IsException(ctx->native_error_proto[i])) {
  ------------------
  |  Branch (56449:13): [True: 0, False: 88]
  ------------------
56450|      0|            JS_FreeValue(ctx, obj);
56451|      0|            return -1;
56452|      0|        }
56453|     88|    }
56454|     11|    JS_FreeValue(ctx, obj);
56455|       |
56456|       |    /* Array */
56457|     11|    obj = JS_NewCConstructor(ctx, JS_CLASS_ARRAY, "Array",
56458|     11|                                    js_array_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56459|     11|                                    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 }
  |  |  ------------------
  ------------------
56460|     11|                                    js_array_funcs, countof(js_array_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56461|     11|                                    js_array_proto_funcs, countof(js_array_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56462|     11|                                    JS_NEW_CTOR_PROTO_CLASS);
  ------------------
  |  |39803|     11|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
56463|     11|    if (JS_IsException(obj))
  ------------------
  |  Branch (56463:9): [True: 0, False: 11]
  ------------------
56464|      0|        return -1;
56465|     11|    ctx->array_ctor = obj;
56466|       |
56467|     11|    {
56468|     11|        JSObject *p = JS_VALUE_GET_OBJ(ctx->class_proto[JS_CLASS_ARRAY]);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
56469|     11|        p->is_std_array_prototype = TRUE;
56470|     11|    }
56471|       |    
56472|     11|    ctx->array_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_ARRAY]),
56473|     11|                                     JS_PROP_INITIAL_HASH_SIZE, 1);
  ------------------
  |  |  966|     11|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
56474|     11|    if (!ctx->array_shape)
  ------------------
  |  Branch (56474:9): [True: 0, False: 11]
  ------------------
56475|      0|        return -1;
56476|     11|    if (add_shape_property(ctx, &ctx->array_shape, NULL,
  ------------------
  |  Branch (56476:9): [True: 0, False: 11]
  ------------------
56477|     11|                           JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_LENGTH))
  ------------------
  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_LENGTH))
  ------------------
  |  |  302|     11|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
56478|      0|        return -1;
56479|       |
56480|     11|    ctx->arguments_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_OBJECT]),
56481|     11|                                         JS_PROP_INITIAL_HASH_SIZE, 3);
  ------------------
  |  |  966|     11|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
56482|     11|    if (!ctx->arguments_shape)
  ------------------
  |  Branch (56482:9): [True: 0, False: 11]
  ------------------
56483|      0|        return -1;
56484|     11|    if (add_shape_property(ctx, &ctx->arguments_shape, NULL,
  ------------------
  |  Branch (56484:9): [True: 0, False: 11]
  ------------------
56485|     11|                           JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56486|      0|        return -1;
56487|     11|    if (add_shape_property(ctx, &ctx->arguments_shape, NULL,
  ------------------
  |  Branch (56487:9): [True: 0, False: 11]
  ------------------
56488|     11|                           JS_ATOM_Symbol_iterator, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_Symbol_iterator, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56489|      0|        return -1;
56490|     11|    if (add_shape_property(ctx, &ctx->arguments_shape, NULL,
  ------------------
  |  Branch (56490:9): [True: 0, False: 11]
  ------------------
56491|     11|                           JS_ATOM_callee, JS_PROP_GETSET))
  ------------------
  |  |  305|     11|#define JS_PROP_GETSET         (1 << 4)
  ------------------
56492|      0|        return -1;
56493|       |
56494|     11|    ctx->mapped_arguments_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_OBJECT]),
56495|     11|                                         JS_PROP_INITIAL_HASH_SIZE, 3);
  ------------------
  |  |  966|     11|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
56496|     11|    if (!ctx->mapped_arguments_shape)
  ------------------
  |  Branch (56496:9): [True: 0, False: 11]
  ------------------
56497|      0|        return -1;
56498|     11|    if (add_shape_property(ctx, &ctx->mapped_arguments_shape, NULL,
  ------------------
  |  Branch (56498:9): [True: 0, False: 11]
  ------------------
56499|     11|                           JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56500|      0|        return -1;
56501|     11|    if (add_shape_property(ctx, &ctx->mapped_arguments_shape, NULL,
  ------------------
  |  Branch (56501:9): [True: 0, False: 11]
  ------------------
56502|     11|                           JS_ATOM_Symbol_iterator, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_Symbol_iterator, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56503|      0|        return -1;
56504|     11|    if (add_shape_property(ctx, &ctx->mapped_arguments_shape, NULL,
  ------------------
  |  Branch (56504:9): [True: 0, False: 11]
  ------------------
56505|     11|                           JS_ATOM_callee, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  299|     11|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_callee, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  298|     11|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56506|      0|        return -1;
56507|       |    
56508|     11|    return 0;
56509|     11|}
quickjs.c:JS_SetImmutablePrototype:
 7887|     11|{
 7888|     11|    JSObject *p;
 7889|     11|    if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|     11|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (7889:9): [True: 0, False: 11]
  ------------------
 7890|      0|        return;
 7891|     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)
  |  |  ------------------
  ------------------
 7892|     11|    p->has_immutable_prototype = TRUE;
 7893|     11|}
quickjs.c:js_array_join:
42653|      3|{
42654|      3|    JSValue obj, sep = JS_UNDEFINED, el;
  ------------------
  |  |  291|      3|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      3|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
42655|      3|    StringBuffer b_s, *b = &b_s;
42656|      3|    JSString *p = NULL;
42657|      3|    int64_t i, n;
42658|      3|    int c;
42659|       |
42660|      3|    obj = JS_ToObject(ctx, this_val);
42661|      3|    if (js_get_length64(ctx, &n, obj))
  ------------------
  |  Branch (42661:9): [True: 0, False: 3]
  ------------------
42662|      0|        goto exception;
42663|       |
42664|      3|    c = ',';    /* default separator */
42665|      3|    if (!toLocaleString && argc > 0 && !JS_IsUndefined(argv[0])) {
  ------------------
  |  Branch (42665:9): [True: 3, False: 0]
  |  Branch (42665:28): [True: 0, False: 3]
  |  Branch (42665:40): [True: 0, False: 0]
  ------------------
42666|      0|        sep = JS_ToString(ctx, argv[0]);
42667|      0|        if (JS_IsException(sep))
  ------------------
  |  Branch (42667:13): [True: 0, False: 0]
  ------------------
42668|      0|            goto exception;
42669|      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)
  |  |  ------------------
  ------------------
42670|      0|        if (p->len == 1 && !p->is_wide_char)
  ------------------
  |  Branch (42670:13): [True: 0, False: 0]
  |  Branch (42670:28): [True: 0, False: 0]
  ------------------
42671|      0|            c = p->u.str8[0];
42672|      0|        else
42673|      0|            c = -1;
42674|      0|    }
42675|      3|    string_buffer_init(ctx, b, 0);
42676|       |
42677|   171k|    for(i = 0; i < n; i++) {
  ------------------
  |  Branch (42677:16): [True: 171k, False: 3]
  ------------------
42678|   171k|        if (i > 0) {
  ------------------
  |  Branch (42678:13): [True: 171k, False: 3]
  ------------------
42679|   171k|            if (c >= 0) {
  ------------------
  |  Branch (42679:17): [True: 171k, False: 0]
  ------------------
42680|   171k|                string_buffer_putc8(b, c);
42681|   171k|            } else {
42682|      0|                string_buffer_concat(b, p, 0, p->len);
42683|      0|            }
42684|   171k|        }
42685|   171k|        el = JS_GetPropertyUint32(ctx, obj, i);
42686|   171k|        if (JS_IsException(el))
  ------------------
  |  Branch (42686:13): [True: 0, False: 171k]
  ------------------
42687|      0|            goto fail;
42688|   171k|        if (!JS_IsNull(el) && !JS_IsUndefined(el)) {
  ------------------
  |  Branch (42688:13): [True: 171k, False: 0]
  |  Branch (42688:31): [True: 171k, False: 0]
  ------------------
42689|   171k|            if (toLocaleString) {
  ------------------
  |  Branch (42689:17): [True: 0, False: 171k]
  ------------------
42690|      0|                el = JS_ToLocaleStringFree(ctx, el);
42691|      0|            }
42692|   171k|            if (string_buffer_concat_value_free(b, el))
  ------------------
  |  Branch (42692:17): [True: 0, False: 171k]
  ------------------
42693|      0|                goto fail;
42694|   171k|        }
42695|   171k|    }
42696|      3|    JS_FreeValue(ctx, sep);
42697|      3|    JS_FreeValue(ctx, obj);
42698|      3|    return string_buffer_end(b);
42699|       |
42700|      0|fail:
42701|      0|    string_buffer_free(b);
42702|      0|    JS_FreeValue(ctx, sep);
42703|      0|exception:
42704|      0|    JS_FreeValue(ctx, obj);
42705|      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 }
  |  |  ------------------
  ------------------
42706|      0|}
quickjs.c:js_array_toString:
42630|      3|{
42631|      3|    JSValue obj, method, ret;
42632|       |
42633|      3|    obj = JS_ToObject(ctx, this_val);
42634|      3|    if (JS_IsException(obj))
  ------------------
  |  Branch (42634:9): [True: 0, False: 3]
  ------------------
42635|      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 }
  |  |  ------------------
  ------------------
42636|      3|    method = JS_GetProperty(ctx, obj, JS_ATOM_join);
42637|      3|    if (JS_IsException(method)) {
  ------------------
  |  Branch (42637:9): [True: 0, False: 3]
  ------------------
42638|      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 }
  |  |  ------------------
  ------------------
42639|      0|    } else
42640|      3|    if (!JS_IsFunction(ctx, method)) {
  ------------------
  |  Branch (42640:9): [True: 0, False: 3]
  ------------------
42641|       |        /* Use intrinsic Object.prototype.toString */
42642|      0|        JS_FreeValue(ctx, method);
42643|      0|        ret = js_object_toString(ctx, obj, 0, NULL);
42644|      3|    } else {
42645|       |        ret = JS_CallFree(ctx, method, obj, 0, NULL);
42646|      3|    }
42647|      3|    JS_FreeValue(ctx, obj);
42648|      3|    return ret;
42649|      3|}
quickjs.c:js_object_seal:
40668|     11|{
40669|     11|    JSValueConst obj = argv[0];
  ------------------
  |  |  234|     11|#define JSValueConst JSValue
  ------------------
40670|     11|    JSObject *p;
40671|     11|    JSPropertyEnum *props;
40672|     11|    uint32_t len, i;
40673|     11|    int flags, desc_flags, res;
40674|       |
40675|     11|    if (!JS_IsObject(obj))
  ------------------
  |  Branch (40675:9): [True: 0, False: 11]
  ------------------
40676|      0|        return JS_DupValue(ctx, obj);
40677|       |
40678|     11|    res = JS_PreventExtensions(ctx, obj);
40679|     11|    if (res < 0)
  ------------------
  |  Branch (40679:9): [True: 0, False: 11]
  ------------------
40680|      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 }
  |  |  ------------------
  ------------------
40681|     11|    if (!res) {
  ------------------
  |  Branch (40681:9): [True: 0, False: 11]
  ------------------
40682|      0|        return JS_ThrowTypeError(ctx, "proxy preventExtensions handler returned false");
40683|      0|    }
40684|       |
40685|     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)
  |  |  ------------------
  ------------------
40686|     11|    flags = JS_GPN_STRING_MASK | JS_GPN_SYMBOL_MASK;
  ------------------
  |  |  810|     11|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
                  flags = JS_GPN_STRING_MASK | JS_GPN_SYMBOL_MASK;
  ------------------
  |  |  811|     11|#define JS_GPN_SYMBOL_MASK  (1 << 1)
  ------------------
40687|     11|    if (JS_GetOwnPropertyNamesInternal(ctx, &props, &len, p, flags))
  ------------------
  |  Branch (40687:9): [True: 0, False: 11]
  ------------------
40688|      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 }
  |  |  ------------------
  ------------------
40689|       |
40690|     33|    for(i = 0; i < len; i++) {
  ------------------
  |  Branch (40690:16): [True: 22, False: 11]
  ------------------
40691|     22|        JSPropertyDescriptor desc;
40692|     22|        JSAtom prop = props[i].atom;
40693|       |
40694|     22|        desc_flags = JS_PROP_THROW | JS_PROP_HAS_CONFIGURABLE;
  ------------------
  |  |  320|     22|#define JS_PROP_THROW            (1 << 14)
  ------------------
                      desc_flags = JS_PROP_THROW | JS_PROP_HAS_CONFIGURABLE;
  ------------------
  |  |  311|     22|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
40695|     22|        if (freeze_flag) {
  ------------------
  |  Branch (40695:13): [True: 22, False: 0]
  ------------------
40696|     22|            res = JS_GetOwnPropertyInternal(ctx, &desc, p, prop);
40697|     22|            if (res < 0)
  ------------------
  |  Branch (40697:17): [True: 0, False: 22]
  ------------------
40698|      0|                goto exception;
40699|     22|            if (res) {
  ------------------
  |  Branch (40699:17): [True: 22, False: 0]
  ------------------
40700|     22|                if (desc.flags & JS_PROP_WRITABLE)
  ------------------
  |  |  299|     22|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (40700:21): [True: 0, False: 22]
  ------------------
40701|      0|                    desc_flags |= JS_PROP_HAS_WRITABLE;
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
40702|     22|                js_free_desc(ctx, &desc);
40703|     22|            }
40704|     22|        }
40705|     22|        if (JS_DefineProperty(ctx, obj, prop, JS_UNDEFINED,
  ------------------
  |  |  291|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
  |  Branch (40705:13): [True: 0, False: 22]
  ------------------
40706|     22|                              JS_UNDEFINED, JS_UNDEFINED, desc_flags) < 0)
  ------------------
  |  |  291|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
                                            JS_UNDEFINED, JS_UNDEFINED, desc_flags) < 0)
  ------------------
  |  |  291|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
40707|      0|            goto exception;
40708|     22|    }
40709|     11|    JS_FreePropertyEnum(ctx, props, len);
40710|     11|    return JS_DupValue(ctx, obj);
40711|       |
40712|      0| exception:
40713|      0|    JS_FreePropertyEnum(ctx, props, len);
40714|      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 }
  |  |  ------------------
  ------------------
40715|     11|}
quickjs.c:js_object_valueOf:
40573|      2|{
40574|      2|    return JS_ToObject(ctx, this_val);
40575|      2|}
quickjs.c:js_function_toString:
41337|      1|{
41338|      1|    JSObject *p;
41339|      1|    JSFunctionKindEnum func_kind = JS_FUNC_NORMAL;
41340|       |
41341|      1|    if (check_function(ctx, this_val))
  ------------------
  |  Branch (41341:9): [True: 0, False: 1]
  ------------------
41342|      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 }
  |  |  ------------------
  ------------------
41343|       |
41344|      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)
  |  |  ------------------
  ------------------
41345|      1|    if (js_class_has_bytecode(p->class_id)) {
  ------------------
  |  Branch (41345:9): [True: 1, False: 0]
  ------------------
41346|      1|        JSFunctionBytecode *b = p->u.func.function_bytecode;
41347|      1|        if (b->has_debug && b->debug.source) {
  ------------------
  |  Branch (41347:13): [True: 1, False: 0]
  |  Branch (41347:29): [True: 1, False: 0]
  ------------------
41348|      1|            return JS_NewStringLen(ctx, b->debug.source, b->debug.source_len);
41349|      1|        }
41350|      0|        func_kind = b->func_kind;
41351|      0|    }
41352|      0|    {
41353|      0|        JSValue name;
41354|      0|        const char *pref, *suff;
41355|       |
41356|      0|        switch(func_kind) {
41357|      0|        default:
  ------------------
  |  Branch (41357:9): [True: 0, False: 0]
  ------------------
41358|      0|        case JS_FUNC_NORMAL:
  ------------------
  |  Branch (41358:9): [True: 0, False: 0]
  ------------------
41359|      0|            pref = "function ";
41360|      0|            break;
41361|      0|        case JS_FUNC_GENERATOR:
  ------------------
  |  Branch (41361:9): [True: 0, False: 0]
  ------------------
41362|      0|            pref = "function *";
41363|      0|            break;
41364|      0|        case JS_FUNC_ASYNC:
  ------------------
  |  Branch (41364:9): [True: 0, False: 0]
  ------------------
41365|      0|            pref = "async function ";
41366|      0|            break;
41367|      0|        case JS_FUNC_ASYNC_GENERATOR:
  ------------------
  |  Branch (41367:9): [True: 0, False: 0]
  ------------------
41368|      0|            pref = "async function *";
41369|      0|            break;
41370|      0|        }
41371|      0|        suff = "() {\n    [native code]\n}";
41372|      0|        name = JS_GetProperty(ctx, this_val, JS_ATOM_name);
41373|      0|        if (JS_IsUndefined(name))
  ------------------
  |  Branch (41373:13): [True: 0, False: 0]
  ------------------
41374|      0|            name = JS_AtomToString(ctx, JS_ATOM_empty_string);
41375|      0|        return JS_ConcatString3(ctx, pref, name, suff);
41376|      0|    }
41377|      0|}
quickjs.c:string_get_hex:
54720|  17.3k|static int string_get_hex(JSString *p, int k, int n) {
54721|  17.3k|    int c = 0, h;
54722|  50.1k|    while (n-- > 0) {
  ------------------
  |  Branch (54722:12): [True: 36.6k, False: 13.4k]
  ------------------
54723|  36.6k|        if ((h = from_hex(string_get(p, k++))) < 0)
  ------------------
  |  Branch (54723:13): [True: 3.88k, False: 32.7k]
  ------------------
54724|  3.88k|            return -1;
54725|  32.7k|        c = (c << 4) | h;
54726|  32.7k|    }
54727|  13.4k|    return c;
54728|  17.3k|}
quickjs.c:js_global_unescape:
54959|      1|{
54960|      1|    JSValue str;
54961|      1|    StringBuffer b_s, *b = &b_s;
54962|      1|    JSString *p;
54963|      1|    int i, len, c, n;
54964|       |
54965|      1|    str = JS_ToString(ctx, argv[0]);
54966|      1|    if (JS_IsException(str))
  ------------------
  |  Branch (54966:9): [True: 0, False: 1]
  ------------------
54967|      0|        return str;
54968|       |
54969|      1|    string_buffer_init(ctx, b, 0);
54970|      1|    p = JS_VALUE_GET_STRING(str);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
54971|   808k|    for (i = 0, len = p->len; i < len; i++) {
  ------------------
  |  Branch (54971:31): [True: 808k, False: 1]
  ------------------
54972|   808k|        c = string_get(p, i);
54973|   808k|        if (c == '%') {
  ------------------
  |  Branch (54973:13): [True: 15.4k, False: 793k]
  ------------------
54974|  15.4k|            if (i + 6 <= len
  ------------------
  |  Branch (54974:17): [True: 15.4k, False: 0]
  ------------------
54975|  15.4k|            &&  string_get(p, i + 1) == 'u'
  ------------------
  |  Branch (54975:17): [True: 3.87k, False: 11.5k]
  ------------------
54976|  3.87k|            &&  (n = string_get_hex(p, i + 2, 4)) >= 0) {
  ------------------
  |  Branch (54976:17): [True: 1.93k, False: 1.93k]
  ------------------
54977|  1.93k|                c = n;
54978|  1.93k|                i += 6 - 1;
54979|  1.93k|            } else
54980|  13.4k|            if (i + 3 <= len
  ------------------
  |  Branch (54980:17): [True: 13.4k, False: 0]
  ------------------
54981|  13.4k|            &&  (n = string_get_hex(p, i + 1, 2)) >= 0) {
  ------------------
  |  Branch (54981:17): [True: 11.5k, False: 1.95k]
  ------------------
54982|  11.5k|                c = n;
54983|  11.5k|                i += 3 - 1;
54984|  11.5k|            }
54985|  15.4k|        }
54986|   808k|        string_buffer_putc16(b, c);
54987|   808k|    }
54988|      1|    JS_FreeValue(ctx, str);
54989|      1|    return string_buffer_end(b);
54990|      1|}
quickjs.c:string_cmp:
45544|   210k|{
45545|   210k|    int i, c1, c2;
45546|   382k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (45546:17): [True: 210k, False: 171k]
  ------------------
45547|   210k|        if ((c1 = string_get(p1, x1 + i)) != (c2 = string_get(p2, x2 + i)))
  ------------------
  |  Branch (45547:13): [True: 39.2k, False: 171k]
  ------------------
45548|  39.2k|            return c1 - c2;
45549|   210k|    }
45550|   171k|    return 0;
45551|   210k|}
quickjs.c:js_string_split:
46123|      1|{
46124|       |    // split(sep, limit)
46125|      1|    JSValueConst O = this_val, separator = argv[0], limit = argv[1];
  ------------------
  |  |  234|      1|#define JSValueConst JSValue
  ------------------
46126|      1|    JSValueConst args[2];
  ------------------
  |  |  234|      1|#define JSValueConst JSValue
  ------------------
46127|      1|    JSValue S, A, R, T;
46128|      1|    uint32_t lim, lengthA;
46129|      1|    int64_t p, q, s, r, e;
46130|      1|    JSString *sp, *rp;
46131|       |
46132|      1|    if (JS_IsUndefined(O) || JS_IsNull(O))
  ------------------
  |  Branch (46132:9): [True: 0, False: 1]
  |  Branch (46132:30): [True: 0, False: 1]
  ------------------
46133|      0|        return JS_ThrowTypeError(ctx, "cannot convert to object");
46134|       |
46135|      1|    S = JS_UNDEFINED;
  ------------------
  |  |  291|      1|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
46136|      1|    A = JS_UNDEFINED;
  ------------------
  |  |  291|      1|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
46137|      1|    R = JS_UNDEFINED;
  ------------------
  |  |  291|      1|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  247|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  |  |  ------------------
  ------------------
46138|       |
46139|      1|    if (JS_IsObject(separator)) {
  ------------------
  |  Branch (46139:9): [True: 1, False: 0]
  ------------------
46140|      1|        JSValue splitter;
46141|      1|        splitter = JS_GetProperty(ctx, separator, JS_ATOM_Symbol_split);
46142|      1|        if (JS_IsException(splitter))
  ------------------
  |  Branch (46142:13): [True: 0, False: 1]
  ------------------
46143|      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 }
  |  |  ------------------
  ------------------
46144|      1|        if (!JS_IsUndefined(splitter) && !JS_IsNull(splitter)) {
  ------------------
  |  Branch (46144:13): [True: 0, False: 1]
  |  Branch (46144:42): [True: 0, False: 0]
  ------------------
46145|      0|            args[0] = O;
46146|      0|            args[1] = limit;
46147|      0|            return JS_CallFree(ctx, splitter, separator, 2, args);
46148|      0|        }
46149|      1|    }
46150|      1|    S = JS_ToString(ctx, O);
46151|      1|    if (JS_IsException(S))
  ------------------
  |  Branch (46151:9): [True: 0, False: 1]
  ------------------
46152|      0|        goto exception;
46153|      1|    A = JS_NewArray(ctx);
46154|      1|    if (JS_IsException(A))
  ------------------
  |  Branch (46154:9): [True: 0, False: 1]
  ------------------
46155|      0|        goto exception;
46156|      1|    lengthA = 0;
46157|      1|    if (JS_IsUndefined(limit)) {
  ------------------
  |  Branch (46157:9): [True: 1, False: 0]
  ------------------
46158|      1|        lim = 0xffffffff;
46159|      1|    } else {
46160|      0|        if (JS_ToUint32(ctx, &lim, limit) < 0)
  ------------------
  |  Branch (46160:13): [True: 0, False: 0]
  ------------------
46161|      0|            goto exception;
46162|      0|    }
46163|      1|    sp = JS_VALUE_GET_STRING(S);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
46164|      1|    s = sp->len;
46165|      1|    R = JS_ToString(ctx, separator);
46166|      1|    if (JS_IsException(R))
  ------------------
  |  Branch (46166:9): [True: 0, False: 1]
  ------------------
46167|      0|        goto exception;
46168|      1|    rp = JS_VALUE_GET_STRING(R);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
46169|      1|    r = rp->len;
46170|      1|    p = 0;
46171|      1|    if (lim == 0)
  ------------------
  |  Branch (46171:9): [True: 0, False: 1]
  ------------------
46172|      0|        goto done;
46173|      1|    if (JS_IsUndefined(separator))
  ------------------
  |  Branch (46173:9): [True: 0, False: 1]
  ------------------
46174|      0|        goto add_tail;
46175|      1|    if (s == 0) {
  ------------------
  |  Branch (46175:9): [True: 0, False: 1]
  ------------------
46176|      0|        if (r != 0)
  ------------------
  |  Branch (46176:13): [True: 0, False: 0]
  ------------------
46177|      0|            goto add_tail;
46178|      0|        goto done;
46179|      0|    }
46180|   171k|    for (q = p; (q += !r) <= s - r - !r; q = p = e + r) {
  ------------------
  |  Branch (46180:17): [True: 171k, False: 0]
  ------------------
46181|   171k|        e = string_indexof(sp, rp, q);
46182|   171k|        if (e < 0)
  ------------------
  |  Branch (46182:13): [True: 1, False: 171k]
  ------------------
46183|      1|            break;
46184|   171k|        T = js_sub_string(ctx, sp, p, e);
46185|   171k|        if (JS_IsException(T))
  ------------------
  |  Branch (46185:13): [True: 0, False: 171k]
  ------------------
46186|      0|            goto exception;
46187|   171k|        if (JS_CreateDataPropertyUint32(ctx, A, lengthA++, T, 0) < 0)
  ------------------
  |  Branch (46187:13): [True: 0, False: 171k]
  ------------------
46188|      0|            goto exception;
46189|   171k|        if (lengthA == lim)
  ------------------
  |  Branch (46189:13): [True: 0, False: 171k]
  ------------------
46190|      0|            goto done;
46191|   171k|    }
46192|      1|add_tail:
46193|      1|    T = js_sub_string(ctx, sp, p, s);
46194|      1|    if (JS_IsException(T))
  ------------------
  |  Branch (46194:9): [True: 0, False: 1]
  ------------------
46195|      0|        goto exception;
46196|      1|    if (JS_CreateDataPropertyUint32(ctx, A, lengthA++, T,0 ) < 0)
  ------------------
  |  Branch (46196:9): [True: 0, False: 1]
  ------------------
46197|      0|        goto exception;
46198|      1|done:
46199|      1|    JS_FreeValue(ctx, S);
46200|      1|    JS_FreeValue(ctx, R);
46201|      1|    return A;
46202|       |
46203|      0|exception:
46204|      0|    JS_FreeValue(ctx, A);
46205|      0|    JS_FreeValue(ctx, S);
46206|      0|    JS_FreeValue(ctx, R);
46207|      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 }
  |  |  ------------------
  ------------------
46208|      1|}
quickjs.c:string_indexof:
45574|   171k|{
45575|       |    /* assuming 0 <= from <= p1->len */
45576|   171k|    int c, i, j, len1 = p1->len, len2 = p2->len;
45577|   171k|    if (len2 == 0)
  ------------------
  |  Branch (45577:9): [True: 0, False: 171k]
  ------------------
45578|      0|        return from;
45579|   210k|    for (i = from, c = string_get(p2, 0); i + len2 <= len1; i = j + 1) {
  ------------------
  |  Branch (45579:43): [True: 210k, False: 0]
  ------------------
45580|   210k|        j = string_indexof_char(p1, c, i);
45581|   210k|        if (j < 0 || j + len2 > len1)
  ------------------
  |  Branch (45581:13): [True: 1, False: 210k]
  |  Branch (45581:22): [True: 0, False: 210k]
  ------------------
45582|      1|            break;
45583|   210k|        if (!string_cmp(p1, p2, j + 1, 1, len2 - 1))
  ------------------
  |  Branch (45583:13): [True: 171k, False: 39.2k]
  ------------------
45584|   171k|            return j;
45585|   210k|    }
45586|      1|    return -1;
45587|   171k|}
quickjs.c:js_random_init:
47374|     11|{
47375|     11|    struct timeval tv;
47376|     11|    gettimeofday(&tv, NULL);
47377|     11|    ctx->random_state = ((int64_t)tv.tv_sec * 1000000) + tv.tv_usec;
47378|       |    /* the state must be non zero */
47379|     11|    if (ctx->random_state == 0)
  ------------------
  |  Branch (47379:9): [True: 0, False: 11]
  ------------------
47380|      0|        ctx->random_state = 1;
47381|     11|}
quickjs.c:JS_AddIntrinsicBigInt:
56362|     11|{
56363|     11|    JSValue obj1;
56364|       |
56365|     11|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_BIG_INT, "BigInt",
56366|     11|                                     js_bigint_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56367|     11|                                     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 }
  |  |  ------------------
  ------------------
56368|     11|                                     js_bigint_funcs, countof(js_bigint_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56369|     11|                                     js_bigint_proto_funcs, countof(js_bigint_proto_funcs),
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56370|     11|                                     0);
56371|     11|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56371:9): [True: 0, False: 11]
  ------------------
56372|      0|        return -1;
56373|     11|    JS_FreeValue(ctx, obj1);
56374|     11|    return 0;
56375|     11|}
quickjs.c:JS_AddIntrinsicAtomics:
61024|     11|{
61025|       |    /* add Atomics as autoinit object */
61026|     11|    return JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_atomics_obj, countof(js_atomics_obj));
  ------------------
  |  |   47|     11|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61027|     11|}

fuzz_eval.c:JS_IsException:
  642|     11|{
  643|     11|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_EXCEPTION);
  ------------------
  |  |   38|     11|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  644|     11|}
fuzz_eval.c:JS_FreeValue:
  688|      1|{
  689|      1|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  287|      1|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (287:35): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  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|      1|}
fuzz_common.c:JS_IsException:
  642|     11|{
  643|     11|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_EXCEPTION);
  ------------------
  |  |   38|     11|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  644|     11|}
fuzz_common.c:JS_FreeValue:
  688|     11|{
  689|     11|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  287|     11|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|     11|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (287:35): [True: 0, False: 11]
  |  |  ------------------
  ------------------
  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|     11|}
quickjs.c:JS_FreeValue:
  688|   537k|{
  689|   537k|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  287|   537k|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|   537k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (287:35): [True: 361k, False: 176k]
  |  |  ------------------
  ------------------
  690|   361k|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|   361k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  691|   361k|        if (--p->ref_count <= 0) {
  ------------------
  |  Branch (691:13): [True: 844, False: 360k]
  ------------------
  692|    844|            __JS_FreeValue(ctx, v);
  693|    844|        }
  694|   361k|    }
  695|   537k|}
quickjs.c:__js_rc:
  683|  1.04M|{
  684|  1.04M|    return (JSRefCountHeader *)((uint32_t *)ptr - 1);
  685|  1.04M|}
quickjs.c:JS_IsException:
  642|   363k|{
  643|   363k|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_EXCEPTION);
  ------------------
  |  |   38|   363k|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  644|   363k|}
quickjs.c:JS_FreeValueRT:
  698|   183k|{
  699|   183k|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  287|   183k|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|   183k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (287:35): [True: 179k, False: 3.14k]
  |  |  ------------------
  ------------------
  700|   179k|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|   179k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  701|   179k|        if (--p->ref_count <= 0) {
  ------------------
  |  Branch (701:13): [True: 38.7k, False: 141k]
  ------------------
  702|  38.7k|            __JS_FreeValueRT(rt, v);
  703|  38.7k|        }
  704|   179k|    }
  705|   183k|}
quickjs.c:JS_DupValue:
  708|   504k|{
  709|   504k|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  287|   504k|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|   504k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (287:35): [True: 502k, False: 2.55k]
  |  |  ------------------
  ------------------
  710|   502k|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|   502k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  711|   502k|        p->ref_count++;
  712|   502k|    }
  713|   504k|    return (JSValue)v;
  714|   504k|}
quickjs.c:JS_ToCStringLen:
  753|     64|{
  754|     64|    return JS_ToCStringLen2(ctx, plen, val1, 0);
  755|     64|}
quickjs.c:JS_IsObject:
  663|     57|{
  664|     57|    return JS_VALUE_GET_TAG(v) == JS_TAG_OBJECT;
  ------------------
  |  |  236|     57|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  665|     57|}
quickjs.c:JS_IsUninitialized:
  647|     90|{
  648|     90|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_UNINITIALIZED);
  ------------------
  |  |   38|     90|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  649|     90|}
quickjs.c:JS_ToCString:
  757|      7|{
  758|       |    return JS_ToCStringLen2(ctx, NULL, val1, 0);
  759|      7|}
quickjs.c:JS_AtomToCString:
  463|     51|{
  464|       |    return JS_AtomToCStringLen(ctx, NULL, atom);
  465|     51|}
quickjs.c:JS_GetProperty:
  781|    514|{
  782|    514|    return JS_GetPropertyInternal(ctx, this_obj, prop, this_obj, 0);
  783|    514|}
quickjs.c:JS_IsNull:
  632|   171k|{
  633|   171k|    return JS_VALUE_GET_TAG(v) == JS_TAG_NULL;
  ------------------
  |  |  236|   171k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  634|   171k|}
quickjs.c:JS_IsUndefined:
  637|   172k|{
  638|   172k|    return JS_VALUE_GET_TAG(v) == JS_TAG_UNDEFINED;
  ------------------
  |  |  236|   172k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  639|   172k|}
quickjs.c:JS_NewInt32:
  561|   517k|{
  562|   517k|    return JS_MKVAL(JS_TAG_INT, val);
  ------------------
  |  |  247|   517k|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  ------------------
  563|   517k|}
quickjs.c:JS_NewUint32:
  582|   171k|{
  583|   171k|    JSValue v;
  584|   171k|    if (val <= 0x7fffffff) {
  ------------------
  |  Branch (584:9): [True: 171k, False: 0]
  ------------------
  585|   171k|        v = JS_NewInt32(ctx, val);
  586|   171k|    } else {
  587|      0|        v = __JS_NewFloat64(ctx, val);
  588|      0|    }
  589|   171k|    return v;
  590|   171k|}
quickjs.c:JS_NewInt64:
  571|   171k|{
  572|   171k|    JSValue v;
  573|   171k|    if (val == (int32_t)val) {
  ------------------
  |  Branch (573:9): [True: 171k, False: 0]
  ------------------
  574|   171k|        v = JS_NewInt32(ctx, val);
  575|   171k|    } else {
  576|      0|        v = __JS_NewFloat64(ctx, val);
  577|      0|    }
  578|   171k|    return v;
  579|   171k|}
quickjs.c:JS_NewFloat64:
  596|     16|{
  597|     16|    int32_t val;
  598|     16|    union {
  599|     16|        double d;
  600|     16|        uint64_t u;
  601|     16|    } u, t;
  602|     16|    if (d >= INT32_MIN && d <= INT32_MAX) {
  ------------------
  |  Branch (602:9): [True: 16, False: 0]
  |  Branch (602:27): [True: 14, False: 2]
  ------------------
  603|     14|        u.d = d;
  604|     14|        val = (int32_t)d;
  605|     14|        t.d = val;
  606|       |        /* -0 cannot be represented as integer, so we compare the bit
  607|       |           representation */
  608|     14|        if (u.u == t.u)
  ------------------
  |  Branch (608:13): [True: 13, False: 1]
  ------------------
  609|     13|            return JS_MKVAL(JS_TAG_INT, val);
  ------------------
  |  |  247|     13|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  ------------------
  610|     14|    }
  611|      3|    return __JS_NewFloat64(ctx, d);
  612|     16|}
quickjs.c:JS_VALUE_IS_NAN:
  263|     15|{
  264|     15|    union {
  265|     15|        double d;
  266|     15|        uint64_t u64;
  267|     15|    } u;
  268|     15|    if (v.tag != JS_TAG_FLOAT64)
  ------------------
  |  Branch (268:9): [True: 12, False: 3]
  ------------------
  269|     12|        return 0;
  270|      3|    u.d = v.u.float64;
  271|      3|    return (u.u64 & 0x7fffffffffffffff) > 0x7ff0000000000000;
  272|     15|}
quickjs.c:JS_NewString:
  745|     57|{
  746|     57|    return JS_NewStringLen(ctx, str, strlen(str));
  747|     57|}
quickjs.c:__JS_NewFloat64:
  255|    116|{
  256|    116|    JSValue v;
  257|    116|    v.tag = JS_TAG_FLOAT64;
  258|    116|    v.u.float64 = d;
  259|    116|    return v;
  260|    116|}
quickjs.c:JS_ToUint32:
  732|      8|{
  733|      8|    return JS_ToInt32(ctx, (int32_t*)pres, val);
  734|      8|}
quickjs.c:JS_NewCFunction:
 1052|     11|{
 1053|     11|    return JS_NewCFunction2(ctx, func, name, length, JS_CFUNC_generic, 0);
 1054|     11|}
quickjs.c:JS_NewBool:
  556|     12|{
  557|     12|    return JS_MKVAL(JS_TAG_BOOL, (val != 0));
  ------------------
  |  |  247|     12|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
  ------------------
  558|     12|}
quickjs-libc.c:JS_AtomToCString:
  463|     11|{
  464|       |    return JS_AtomToCStringLen(ctx, NULL, atom);
  465|     11|}
quickjs-libc.c:JS_IsException:
  642|     33|{
  643|     33|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_EXCEPTION);
  ------------------
  |  |   38|     33|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  644|     33|}
quickjs-libc.c:JS_FreeValue:
  688|     22|{
  689|     22|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  287|     22|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|     22|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (287:35): [True: 22, False: 0]
  |  |  ------------------
  ------------------
  690|     22|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|     22|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  691|     22|        if (--p->ref_count <= 0) {
  ------------------
  |  Branch (691:13): [True: 0, False: 22]
  ------------------
  692|      0|            __JS_FreeValue(ctx, v);
  693|      0|        }
  694|     22|    }
  695|     22|}
quickjs-libc.c:__js_rc:
  683|     22|{
  684|     22|    return (JSRefCountHeader *)((uint32_t *)ptr - 1);
  685|     22|}
quickjs-libc.c:JS_NewCFunction:
 1052|     44|{
 1053|     44|    return JS_NewCFunction2(ctx, func, name, length, JS_CFUNC_generic, 0);
 1054|     44|}

