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

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

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

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

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

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

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

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

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

js_module_set_import_meta:
  543|     14|{
  544|     14|    JSModuleDef *m;
  545|     14|    char buf[PATH_MAX + 16];
  546|     14|    JSValue meta_obj;
  547|     14|    JSAtom module_name_atom;
  548|     14|    const char *module_name;
  549|       |
  550|     14|    assert(JS_VALUE_GET_TAG(func_val) == JS_TAG_MODULE);
  ------------------
  |  Branch (550:5): [True: 0, False: 14]
  |  Branch (550:5): [True: 14, False: 0]
  ------------------
  551|     14|    m = JS_VALUE_GET_PTR(func_val);
  ------------------
  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  552|       |
  553|     14|    module_name_atom = JS_GetModuleName(ctx, m);
  554|     14|    module_name = JS_AtomToCString(ctx, module_name_atom);
  555|     14|    JS_FreeAtom(ctx, module_name_atom);
  556|     14|    if (!module_name)
  ------------------
  |  Branch (556:9): [True: 0, False: 14]
  ------------------
  557|      0|        return -1;
  558|     14|    if (!strchr(module_name, ':')) {
  ------------------
  |  Branch (558:9): [True: 14, False: 0]
  ------------------
  559|     14|        strcpy(buf, "file://");
  560|     14|#if !defined(_WIN32)
  561|       |        /* realpath() cannot be used with modules compiled with qjsc
  562|       |           because the corresponding module source code is not
  563|       |           necessarily present */
  564|     14|        if (use_realpath) {
  ------------------
  |  Branch (564:13): [True: 14, False: 0]
  ------------------
  565|     14|            char *res = realpath(module_name, buf + strlen(buf));
  566|     14|            if (!res) {
  ------------------
  |  Branch (566:17): [True: 14, False: 0]
  ------------------
  567|     14|                JS_ThrowTypeError(ctx, "realpath failure");
  568|     14|                JS_FreeCString(ctx, module_name);
  569|     14|                return -1;
  570|     14|            }
  571|     14|        } else
  572|      0|#endif
  573|      0|        {
  574|      0|            pstrcat(buf, sizeof(buf), module_name);
  575|      0|        }
  576|     14|    } else {
  577|      0|        pstrcpy(buf, sizeof(buf), module_name);
  578|      0|    }
  579|      0|    JS_FreeCString(ctx, module_name);
  580|       |
  581|      0|    meta_obj = JS_GetImportMeta(ctx, m);
  582|      0|    if (JS_IsException(meta_obj))
  ------------------
  |  Branch (582:9): [True: 0, False: 0]
  ------------------
  583|      0|        return -1;
  584|      0|    JS_DefinePropertyValueStr(ctx, meta_obj, "url",
  585|      0|                              JS_NewString(ctx, buf),
  586|      0|                              JS_PROP_C_W_E);
  ------------------
  |  |  299|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
  587|      0|    JS_DefinePropertyValueStr(ctx, meta_obj, "main",
  588|      0|                              JS_NewBool(ctx, is_main),
  589|      0|                              JS_PROP_C_W_E);
  ------------------
  |  |  299|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
  590|      0|    JS_FreeValue(ctx, meta_obj);
  591|      0|    return 0;
  592|      0|}
js_init_module_std:
 1713|     14|{
 1714|     14|    JSModuleDef *m;
 1715|     14|    m = JS_NewCModule(ctx, module_name, js_std_init);
 1716|     14|    if (!m)
  ------------------
  |  Branch (1716:9): [True: 0, False: 14]
  ------------------
 1717|      0|        return NULL;
 1718|     14|    JS_AddModuleExportList(ctx, m, js_std_funcs, countof(js_std_funcs));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 1719|     14|    JS_AddModuleExport(ctx, m, "in");
 1720|     14|    JS_AddModuleExport(ctx, m, "out");
 1721|     14|    JS_AddModuleExport(ctx, m, "err");
 1722|     14|    return m;
 1723|     14|}
js_init_module_os:
 4012|     14|{
 4013|     14|    JSModuleDef *m;
 4014|     14|    m = JS_NewCModule(ctx, module_name, js_os_init);
 4015|     14|    if (!m)
  ------------------
  |  Branch (4015:9): [True: 0, False: 14]
  ------------------
 4016|      0|        return NULL;
 4017|     14|    JS_AddModuleExportList(ctx, m, js_os_funcs, countof(js_os_funcs));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 4018|       |#ifdef USE_WORKER
 4019|       |    JS_AddModuleExport(ctx, m, "Worker");
 4020|       |#endif
 4021|     14|    return m;
 4022|     14|}
js_std_add_helpers:
 4062|     14|{
 4063|     14|    JSValue global_obj, console, args, performance;
 4064|     14|    int i;
 4065|       |
 4066|       |    /* XXX: should these global definitions be enumerable? */
 4067|     14|    global_obj = JS_GetGlobalObject(ctx);
 4068|       |
 4069|     14|    console = JS_NewObject(ctx);
 4070|     14|    JS_SetPropertyStr(ctx, console, "log",
 4071|     14|                      JS_NewCFunction(ctx, js_console_log, "log", 1));
 4072|     14|    JS_SetPropertyStr(ctx, global_obj, "console", console);
 4073|       |
 4074|     14|    performance = JS_NewObject(ctx);
 4075|     14|    JS_SetPropertyStr(ctx, performance, "now",
 4076|     14|                      JS_NewCFunction(ctx, js_os_now, "now", 0));
 4077|     14|    JS_SetPropertyStr(ctx, global_obj, "performance", performance);
 4078|       |
 4079|       |    /* same methods as the mozilla JS shell */
 4080|     14|    if (argc >= 0) {
  ------------------
  |  Branch (4080:9): [True: 14, False: 0]
  ------------------
 4081|     14|        args = JS_NewArray(ctx);
 4082|     14|        for(i = 0; i < argc; i++) {
  ------------------
  |  Branch (4082:20): [True: 0, False: 14]
  ------------------
 4083|      0|            JS_SetPropertyUint32(ctx, args, i, JS_NewString(ctx, argv[i]));
 4084|      0|        }
 4085|     14|        JS_SetPropertyStr(ctx, global_obj, "scriptArgs", args);
 4086|     14|    }
 4087|       |
 4088|     14|    JS_SetPropertyStr(ctx, global_obj, "print",
 4089|     14|                      JS_NewCFunction(ctx, js_print, "print", 1));
 4090|     14|    JS_SetPropertyStr(ctx, global_obj, "__loadScript",
 4091|     14|                      JS_NewCFunction(ctx, js_loadScript, "__loadScript", 1));
 4092|       |
 4093|     14|    JS_FreeValue(ctx, global_obj);
 4094|     14|}
js_std_init_handlers:
 4097|     14|{
 4098|     14|    JSThreadState *ts;
 4099|       |
 4100|     14|    ts = malloc(sizeof(*ts));
 4101|     14|    if (!ts) {
  ------------------
  |  Branch (4101:9): [True: 0, False: 14]
  ------------------
 4102|      0|        fprintf(stderr, "Could not allocate memory for the worker");
 4103|      0|        exit(1);
 4104|      0|    }
 4105|     14|    memset(ts, 0, sizeof(*ts));
 4106|     14|    init_list_head(&ts->os_rw_handlers);
 4107|     14|    init_list_head(&ts->os_signal_handlers);
 4108|     14|    init_list_head(&ts->os_timers);
 4109|     14|    init_list_head(&ts->port_list);
 4110|     14|    init_list_head(&ts->rejected_promise_list);
 4111|     14|    ts->next_timer_id = 1;
 4112|       |
 4113|     14|    JS_SetRuntimeOpaque(rt, ts);
 4114|       |
 4115|       |#ifdef USE_WORKER
 4116|       |    /* set the SharedArrayBuffer memory handlers */
 4117|       |    {
 4118|       |        JSSharedArrayBufferFunctions sf;
 4119|       |        memset(&sf, 0, sizeof(sf));
 4120|       |        sf.sab_alloc = js_sab_alloc;
 4121|       |        sf.sab_free = js_sab_free;
 4122|       |        sf.sab_dup = js_sab_dup;
 4123|       |        JS_SetSharedArrayBufferFunctions(rt, &sf);
 4124|       |    }
 4125|       |#endif
 4126|     14|}
js_std_free_handlers:
 4129|     14|{
 4130|     14|    JSThreadState *ts = JS_GetRuntimeOpaque(rt);
 4131|     14|    struct list_head *el, *el1;
 4132|       |
 4133|     14|    list_for_each_safe(el, el1, &ts->os_rw_handlers) {
  ------------------
  |  |   89|     14|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 14]
  |  |  ------------------
  |  |   90|     14|        el = el1, el1 = el->next)
  ------------------
 4134|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4135|      0|        free_rw_handler(rt, rh);
 4136|      0|    }
 4137|       |
 4138|     14|    list_for_each_safe(el, el1, &ts->os_signal_handlers) {
  ------------------
  |  |   89|     14|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 14]
  |  |  ------------------
  |  |   90|     14|        el = el1, el1 = el->next)
  ------------------
 4139|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4140|      0|        free_sh(rt, sh);
 4141|      0|    }
 4142|       |
 4143|     14|    list_for_each_safe(el, el1, &ts->os_timers) {
  ------------------
  |  |   89|     14|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 14]
  |  |  ------------------
  |  |   90|     14|        el = el1, el1 = el->next)
  ------------------
 4144|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4145|      0|        free_timer(rt, th);
 4146|      0|    }
 4147|       |
 4148|     14|    list_for_each_safe(el, el1, &ts->rejected_promise_list) {
  ------------------
  |  |   89|     14|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 14]
  |  |  ------------------
  |  |   90|     14|        el = el1, el1 = el->next)
  ------------------
 4149|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4150|      0|        JS_FreeValueRT(rt, rp->promise);
 4151|      0|        JS_FreeValueRT(rt, rp->reason);
 4152|      0|        free(rp);
 4153|      0|    }
 4154|       |
 4155|       |#ifdef USE_WORKER
 4156|       |    js_free_message_pipe(ts->recv_pipe);
 4157|       |    js_free_message_pipe(ts->send_pipe);
 4158|       |
 4159|       |    list_for_each_safe(el, el1, &ts->port_list) {
 4160|       |        JSWorkerMessageHandler *port = list_entry(el, JSWorkerMessageHandler, link);
 4161|       |        /* unlink the message ports. They are freed by the Worker object */
 4162|       |        port->link.prev = NULL;
 4163|       |        port->link.next = NULL;
 4164|       |    }
 4165|       |#endif
 4166|       |
 4167|     14|    free(ts);
 4168|       |    JS_SetRuntimeOpaque(rt, NULL); /* fail safe */
 4169|     14|}
js_std_loop:
 4252|      2|{
 4253|      2|    int err;
 4254|       |
 4255|      2|    for(;;) {
 4256|       |        /* execute the pending jobs */
 4257|      2|        for(;;) {
 4258|      2|            err = JS_ExecutePendingJob(JS_GetRuntime(ctx), NULL);
 4259|      2|            if (err <= 0) {
  ------------------
  |  Branch (4259:17): [True: 2, False: 0]
  ------------------
 4260|      2|                if (err < 0)
  ------------------
  |  Branch (4260:21): [True: 0, False: 2]
  ------------------
 4261|      0|                    js_std_dump_error(ctx);
 4262|      2|                break;
 4263|      2|            }
 4264|      2|        }
 4265|       |
 4266|      2|        js_std_promise_rejection_check(ctx);
 4267|       |        
 4268|      2|        if (!os_poll_func || os_poll_func(ctx))
  ------------------
  |  Branch (4268:13): [True: 0, False: 2]
  |  Branch (4268:30): [True: 2, False: 0]
  ------------------
 4269|      2|            break;
 4270|      2|    }
 4271|      2|}
js_std_await:
 4277|     14|{
 4278|     14|    JSValue ret;
 4279|     14|    int state;
 4280|       |
 4281|     14|    for(;;) {
 4282|     14|        state = JS_PromiseState(ctx, obj);
 4283|     14|        if (state == JS_PROMISE_FULFILLED) {
  ------------------
  |  Branch (4283:13): [True: 13, False: 1]
  ------------------
 4284|     13|            ret = JS_PromiseResult(ctx, obj);
 4285|     13|            JS_FreeValue(ctx, obj);
 4286|     13|            break;
 4287|     13|        } else if (state == JS_PROMISE_REJECTED) {
  ------------------
  |  Branch (4287:20): [True: 0, False: 1]
  ------------------
 4288|      0|            ret = JS_Throw(ctx, JS_PromiseResult(ctx, obj));
 4289|      0|            JS_FreeValue(ctx, obj);
 4290|      0|            break;
 4291|      1|        } else if (state == JS_PROMISE_PENDING) {
  ------------------
  |  Branch (4291:20): [True: 0, False: 1]
  ------------------
 4292|      0|            int err;
 4293|      0|            err = JS_ExecutePendingJob(JS_GetRuntime(ctx), NULL);
 4294|      0|            if (err < 0) {
  ------------------
  |  Branch (4294:17): [True: 0, False: 0]
  ------------------
 4295|      0|                js_std_dump_error(ctx);
 4296|      0|            }
 4297|      0|            if (err == 0) {
  ------------------
  |  Branch (4297:17): [True: 0, False: 0]
  ------------------
 4298|      0|                js_std_promise_rejection_check(ctx);
 4299|       |
 4300|      0|                if (os_poll_func)
  ------------------
  |  Branch (4300:21): [True: 0, False: 0]
  ------------------
 4301|      0|                    os_poll_func(ctx);
 4302|      0|            }
 4303|      1|        } else {
 4304|       |            /* not a promise */
 4305|      1|            ret = obj;
 4306|      1|            break;
 4307|      1|        }
 4308|     14|    }
 4309|     14|    return ret;
 4310|     14|}
quickjs-libc.c:js_std_init:
 1691|     13|{
 1692|     13|    JSValue proto;
 1693|       |
 1694|       |    /* FILE class */
 1695|       |    /* the class ID is created once */
 1696|     13|    JS_NewClassID(&js_std_file_class_id);
 1697|       |    /* the class is created once per runtime */
 1698|     13|    JS_NewClass(JS_GetRuntime(ctx), js_std_file_class_id, &js_std_file_class);
 1699|     13|    proto = JS_NewObject(ctx);
 1700|     13|    JS_SetPropertyFunctionList(ctx, proto, js_std_file_proto_funcs,
 1701|     13|                               countof(js_std_file_proto_funcs));
  ------------------
  |  |   47|     13|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 1702|     13|    JS_SetClassProto(ctx, js_std_file_class_id, proto);
 1703|       |
 1704|     13|    JS_SetModuleExportList(ctx, m, js_std_funcs,
 1705|     13|                           countof(js_std_funcs));
  ------------------
  |  |   47|     13|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 1706|     13|    JS_SetModuleExport(ctx, m, "in", js_new_std_file(ctx, stdin, FALSE, FALSE));
 1707|     13|    JS_SetModuleExport(ctx, m, "out", js_new_std_file(ctx, stdout, FALSE, FALSE));
 1708|       |    JS_SetModuleExport(ctx, m, "err", js_new_std_file(ctx, stderr, FALSE, FALSE));
 1709|     13|    return 0;
 1710|     13|}
quickjs-libc.c:js_std_file_finalizer:
  931|     39|{
  932|     39|    JSSTDFile *s = JS_GetOpaque(val, js_std_file_class_id);
  933|     39|    if (s) {
  ------------------
  |  Branch (933:9): [True: 39, False: 0]
  ------------------
  934|     39|        if (s->f && s->close_in_finalizer) {
  ------------------
  |  Branch (934:13): [True: 39, False: 0]
  |  Branch (934:21): [True: 0, False: 39]
  ------------------
  935|      0|            if (s->is_popen)
  ------------------
  |  Branch (935:17): [True: 0, False: 0]
  ------------------
  936|      0|                pclose(s->f);
  937|      0|            else
  938|      0|                fclose(s->f);
  939|      0|        }
  940|     39|        js_free_rt(rt, s);
  941|     39|    }
  942|     39|}
quickjs-libc.c:js_new_std_file:
  978|     39|{
  979|     39|    JSSTDFile *s;
  980|     39|    JSValue obj;
  981|     39|    obj = JS_NewObjectClass(ctx, js_std_file_class_id);
  982|     39|    if (JS_IsException(obj))
  ------------------
  |  Branch (982:9): [True: 0, False: 39]
  ------------------
  983|      0|        return obj;
  984|     39|    s = js_mallocz(ctx, sizeof(*s));
  985|     39|    if (!s) {
  ------------------
  |  Branch (985:9): [True: 0, False: 39]
  ------------------
  986|      0|        JS_FreeValue(ctx, obj);
  987|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
  988|      0|    }
  989|     39|    s->close_in_finalizer = close_in_finalizer;
  990|     39|    s->is_popen = is_popen;
  991|     39|    s->f = f;
  992|     39|    JS_SetOpaque(obj, s);
  993|     39|    return obj;
  994|     39|}
quickjs-libc.c:js_os_init:
 3976|     13|{
 3977|     13|    os_poll_func = js_os_poll;
 3978|       |
 3979|       |#ifdef USE_WORKER
 3980|       |    {
 3981|       |        JSRuntime *rt = JS_GetRuntime(ctx);
 3982|       |        JSThreadState *ts = JS_GetRuntimeOpaque(rt);
 3983|       |        JSValue proto, obj;
 3984|       |        /* Worker class */
 3985|       |        JS_NewClassID(&js_worker_class_id);
 3986|       |        JS_NewClass(JS_GetRuntime(ctx), js_worker_class_id, &js_worker_class);
 3987|       |        proto = JS_NewObject(ctx);
 3988|       |        JS_SetPropertyFunctionList(ctx, proto, js_worker_proto_funcs, countof(js_worker_proto_funcs));
 3989|       |
 3990|       |        obj = JS_NewCFunction2(ctx, js_worker_ctor, "Worker", 1,
 3991|       |                               JS_CFUNC_constructor, 0);
 3992|       |        JS_SetConstructor(ctx, obj, proto);
 3993|       |
 3994|       |        JS_SetClassProto(ctx, js_worker_class_id, proto);
 3995|       |
 3996|       |        /* set 'Worker.parent' if necessary */
 3997|       |        if (ts->recv_pipe && ts->send_pipe) {
 3998|       |            JS_DefinePropertyValueStr(ctx, obj, "parent",
 3999|       |                                      js_worker_ctor_internal(ctx, JS_UNDEFINED, ts->recv_pipe, ts->send_pipe),
 4000|       |                                      JS_PROP_C_W_E);
 4001|       |        }
 4002|       |
 4003|       |        JS_SetModuleExport(ctx, m, "Worker", obj);
 4004|       |    }
 4005|       |#endif /* USE_WORKER */
 4006|       |
 4007|     13|    return JS_SetModuleExportList(ctx, m, js_os_funcs,
 4008|     13|                                  countof(js_os_funcs));
  ------------------
  |  |   47|     13|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 4009|     13|}
quickjs-libc.c:js_os_poll:
 2511|      2|{
 2512|      2|    JSRuntime *rt = JS_GetRuntime(ctx);
 2513|      2|    JSThreadState *ts = JS_GetRuntimeOpaque(rt);
 2514|      2|    int ret, fd_max, min_delay;
 2515|      2|    int64_t cur_time, delay;
 2516|      2|    fd_set rfds, wfds;
 2517|      2|    JSOSRWHandler *rh;
 2518|      2|    struct list_head *el;
 2519|      2|    struct timeval tv, *tvp;
 2520|       |
 2521|       |    /* only check signals in the main thread */
 2522|      2|    if (!ts->recv_pipe &&
  ------------------
  |  Branch (2522:9): [True: 2, False: 0]
  ------------------
 2523|      2|        unlikely(os_pending_signals != 0)) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 2524|      0|        JSOSSignalHandler *sh;
 2525|      0|        uint64_t mask;
 2526|       |
 2527|      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]
  |  |  ------------------
  ------------------
 2528|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2529|      0|            mask = (uint64_t)1 << sh->sig_num;
 2530|      0|            if (os_pending_signals & mask) {
  ------------------
  |  Branch (2530:17): [True: 0, False: 0]
  ------------------
 2531|      0|                os_pending_signals &= ~mask;
 2532|      0|                call_handler(ctx, sh->func);
 2533|      0|                return 0;
 2534|      0|            }
 2535|      0|        }
 2536|      0|    }
 2537|       |
 2538|      2|    if (list_empty(&ts->os_rw_handlers) && list_empty(&ts->os_timers) &&
  ------------------
  |  Branch (2538:9): [True: 2, False: 0]
  |  Branch (2538:44): [True: 2, False: 0]
  ------------------
 2539|      2|        list_empty(&ts->port_list))
  ------------------
  |  Branch (2539:9): [True: 2, False: 0]
  ------------------
 2540|      2|        return -1; /* no more events */
 2541|       |
 2542|      0|    if (!list_empty(&ts->os_timers)) {
  ------------------
  |  Branch (2542:9): [True: 0, False: 0]
  ------------------
 2543|      0|        cur_time = get_time_ms();
 2544|      0|        min_delay = 10000;
 2545|      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]
  |  |  ------------------
  ------------------
 2546|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2547|      0|            delay = th->timeout - cur_time;
 2548|      0|            if (delay <= 0) {
  ------------------
  |  Branch (2548:17): [True: 0, False: 0]
  ------------------
 2549|      0|                JSValue func;
 2550|       |                /* the timer expired */
 2551|      0|                func = th->func;
 2552|      0|                th->func = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 2553|      0|                free_timer(rt, th);
 2554|      0|                call_handler(ctx, func);
 2555|      0|                JS_FreeValue(ctx, func);
 2556|      0|                return 0;
 2557|      0|            } else if (delay < min_delay) {
  ------------------
  |  Branch (2557:24): [True: 0, False: 0]
  ------------------
 2558|      0|                min_delay = delay;
 2559|      0|            }
 2560|      0|        }
 2561|      0|        tv.tv_sec = min_delay / 1000;
 2562|      0|        tv.tv_usec = (min_delay % 1000) * 1000;
 2563|      0|        tvp = &tv;
 2564|      0|    } else {
 2565|      0|        tvp = NULL;
 2566|      0|    }
 2567|       |
 2568|      0|    FD_ZERO(&rfds);
  ------------------
  |  Branch (2568:5): [Folded, False: 0]
  ------------------
 2569|      0|    FD_ZERO(&wfds);
  ------------------
  |  Branch (2569:5): [Folded, False: 0]
  ------------------
 2570|      0|    fd_max = -1;
 2571|      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]
  |  |  ------------------
  ------------------
 2572|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2573|      0|        fd_max = max_int(fd_max, rh->fd);
 2574|      0|        if (!JS_IsNull(rh->rw_func[0]))
  ------------------
  |  Branch (2574:13): [True: 0, False: 0]
  ------------------
 2575|      0|            FD_SET(rh->fd, &rfds);
 2576|      0|        if (!JS_IsNull(rh->rw_func[1]))
  ------------------
  |  Branch (2576:13): [True: 0, False: 0]
  ------------------
 2577|      0|            FD_SET(rh->fd, &wfds);
 2578|      0|    }
 2579|       |
 2580|      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]
  |  |  ------------------
  ------------------
 2581|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2582|      0|        if (!JS_IsNull(port->on_message_func)) {
  ------------------
  |  Branch (2582:13): [True: 0, False: 0]
  ------------------
 2583|      0|            JSWorkerMessagePipe *ps = port->recv_pipe;
 2584|      0|            fd_max = max_int(fd_max, ps->waker.read_fd);
 2585|      0|            FD_SET(ps->waker.read_fd, &rfds);
 2586|      0|        }
 2587|      0|    }
 2588|       |
 2589|      0|    ret = select(fd_max + 1, &rfds, &wfds, NULL, tvp);
 2590|      0|    if (ret > 0) {
  ------------------
  |  Branch (2590:9): [True: 0, False: 0]
  ------------------
 2591|      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]
  |  |  ------------------
  ------------------
 2592|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2593|      0|            if (!JS_IsNull(rh->rw_func[0]) &&
  ------------------
  |  Branch (2593:17): [True: 0, False: 0]
  ------------------
 2594|      0|                FD_ISSET(rh->fd, &rfds)) {
  ------------------
  |  Branch (2594:17): [True: 0, False: 0]
  ------------------
 2595|      0|                call_handler(ctx, rh->rw_func[0]);
 2596|       |                /* must stop because the list may have been modified */
 2597|      0|                goto done;
 2598|      0|            }
 2599|      0|            if (!JS_IsNull(rh->rw_func[1]) &&
  ------------------
  |  Branch (2599:17): [True: 0, False: 0]
  ------------------
 2600|      0|                FD_ISSET(rh->fd, &wfds)) {
  ------------------
  |  Branch (2600:17): [True: 0, False: 0]
  ------------------
 2601|      0|                call_handler(ctx, rh->rw_func[1]);
 2602|       |                /* must stop because the list may have been modified */
 2603|      0|                goto done;
 2604|      0|            }
 2605|      0|        }
 2606|       |
 2607|      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]
  |  |  ------------------
  ------------------
 2608|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2609|      0|            if (!JS_IsNull(port->on_message_func)) {
  ------------------
  |  Branch (2609:17): [True: 0, False: 0]
  ------------------
 2610|      0|                JSWorkerMessagePipe *ps = port->recv_pipe;
 2611|      0|                if (FD_ISSET(ps->waker.read_fd, &rfds)) {
  ------------------
  |  Branch (2611:21): [True: 0, False: 0]
  ------------------
 2612|      0|                    if (handle_posted_message(rt, ctx, port))
  ------------------
  |  Branch (2612:25): [True: 0, False: 0]
  ------------------
 2613|      0|                        goto done;
 2614|      0|                }
 2615|      0|            }
 2616|      0|        }
 2617|      0|    }
 2618|      0| done:
 2619|      0|    return 0;
 2620|      0|}
quickjs-libc.c:js_std_promise_rejection_check:
 4235|      2|{
 4236|      2|    JSRuntime *rt = JS_GetRuntime(ctx);
 4237|      2|    JSThreadState *ts = JS_GetRuntimeOpaque(rt);
 4238|      2|    struct list_head *el;
 4239|       |
 4240|      2|    if (unlikely(!list_empty(&ts->rejected_promise_list))) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 4241|      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]
  |  |  ------------------
  ------------------
 4242|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4243|       |            fprintf(stderr, "Possibly unhandled promise rejection: ");
 4244|      0|            js_std_dump_error1(ctx, rp->reason);
 4245|      0|        }
 4246|      0|        exit(1);
 4247|      0|    }
 4248|      2|}

js_malloc_rt:
 1792|  1.10M|{
 1793|  1.10M|    return __js_malloc(&rt->malloc_ctx, size);
 1794|  1.10M|}
js_free_rt:
 1797|  1.10M|{
 1798|  1.10M|    __js_free(&rt->malloc_ctx, ptr);
 1799|  1.10M|}
js_realloc_rt:
 1802|  3.25k|{
 1803|  3.25k|    return __js_realloc(&rt->malloc_ctx, ptr, size);
 1804|  3.25k|}
js_malloc_usable_size_rt:
 1807|  1.40k|{
 1808|  1.40k|    return __js_malloc_usable_size(&rt->malloc_ctx, ptr);
 1809|  1.40k|}
js_mallocz_rt:
 1812|    310|{
 1813|    310|    void *ptr;
 1814|    310|    ptr = js_malloc_rt(rt, size);
 1815|    310|    if (unlikely(!ptr))
  ------------------
  |  |   33|    310|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 310]
  |  |  ------------------
  ------------------
 1816|      0|        return NULL;
 1817|    310|    return memset(ptr, 0, size);
 1818|    310|}
js_malloc:
 1822|  1.02M|{
 1823|  1.02M|    void *ptr;
 1824|  1.02M|    ptr = js_malloc_rt(ctx->rt, size);
 1825|  1.02M|    if (unlikely(!ptr)) {
  ------------------
  |  |   33|  1.02M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.02M]
  |  |  ------------------
  ------------------
 1826|      0|        JS_ThrowOutOfMemory(ctx);
 1827|      0|        return NULL;
 1828|      0|    }
 1829|  1.02M|    return ptr;
 1830|  1.02M|}
js_mallocz:
 1834|    237|{
 1835|    237|    void *ptr;
 1836|    237|    ptr = js_mallocz_rt(ctx->rt, size);
 1837|    237|    if (unlikely(!ptr)) {
  ------------------
  |  |   33|    237|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 237]
  |  |  ------------------
  ------------------
 1838|      0|        JS_ThrowOutOfMemory(ctx);
 1839|      0|        return NULL;
 1840|      0|    }
 1841|    237|    return ptr;
 1842|    237|}
js_free:
 1845|  1.01M|{
 1846|  1.01M|    js_free_rt(ctx->rt, ptr);
 1847|  1.01M|}
js_realloc:
 1851|    526|{
 1852|    526|    void *ret;
 1853|    526|    ret = js_realloc_rt(ctx->rt, ptr, size);
 1854|    526|    if (unlikely(!ret && size != 0)) {
  ------------------
  |  |   33|    526|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 526]
  |  |  |  Branch (33:45): [True: 0, False: 526]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1855|      0|        JS_ThrowOutOfMemory(ctx);
 1856|      0|        return NULL;
 1857|      0|    }
 1858|    526|    return ret;
 1859|    526|}
js_realloc2:
 1863|  1.40k|{
 1864|  1.40k|    void *ret;
 1865|  1.40k|    ret = js_realloc_rt(ctx->rt, ptr, size);
 1866|  1.40k|    if (unlikely(!ret && size != 0)) {
  ------------------
  |  |   33|  1.40k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.40k]
  |  |  |  Branch (33:45): [True: 0, False: 1.40k]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1867|      0|        JS_ThrowOutOfMemory(ctx);
 1868|      0|        return NULL;
 1869|      0|    }
 1870|  1.40k|    if (pslack) {
  ------------------
  |  Branch (1870:9): [True: 1.40k, False: 0]
  ------------------
 1871|  1.40k|        size_t new_size = js_malloc_usable_size_rt(ctx->rt, ret);
 1872|  1.40k|        *pslack = (new_size > size) ? new_size - size : 0;
  ------------------
  |  Branch (1872:19): [True: 745, False: 659]
  ------------------
 1873|  1.40k|    }
 1874|  1.40k|    return ret;
 1875|  1.40k|}
js_strndup:
 1884|     31|{
 1885|     31|    char *ptr;
 1886|     31|    ptr = js_malloc(ctx, n + 1);
 1887|     31|    if (ptr) {
  ------------------
  |  Branch (1887:9): [True: 31, False: 0]
  ------------------
 1888|     31|        memcpy(ptr, s, n);
 1889|     31|        ptr[n] = '\0';
 1890|     31|    }
 1891|     31|    return ptr;
 1892|     31|}
js_strdup:
 1895|     28|{
 1896|     28|    return js_strndup(ctx, str, strlen(str));
 1897|     28|}
JS_NewRuntime2:
 2059|     14|{
 2060|     14|    JSRuntime *rt;
 2061|     14|    JSMallocState ms;
 2062|       |
 2063|     14|    memset(&ms, 0, sizeof(ms));
 2064|     14|    ms.opaque = opaque;
 2065|     14|    ms.malloc_limit = -1;
 2066|       |
 2067|     14|    rt = mf->js_malloc(&ms, sizeof(JSRuntime));
 2068|     14|    if (!rt)
  ------------------
  |  Branch (2068:9): [True: 0, False: 14]
  ------------------
 2069|      0|        return NULL;
 2070|     14|    memset(rt, 0, sizeof(*rt));
 2071|     14|    js_malloc_init(&rt->malloc_ctx);
 2072|     14|    rt->malloc_ctx.mf = *mf;
 2073|     14|    rt->malloc_ctx.malloc_state = ms;
 2074|     14|    rt->malloc_gc_threshold = 256 * 1024;
 2075|       |
 2076|     14|    init_list_head(&rt->context_list);
 2077|     14|    init_list_head(&rt->gc_obj_list);
 2078|     14|    init_list_head(&rt->gc_zero_ref_count_list);
 2079|     14|    rt->gc_phase = JS_GC_PHASE_NONE;
 2080|     14|    init_list_head(&rt->weakref_list);
 2081|       |
 2082|       |#ifdef DUMP_LEAKS
 2083|       |    init_list_head(&rt->string_list);
 2084|       |#endif
 2085|     14|    init_list_head(&rt->job_list);
 2086|       |
 2087|     14|    if (JS_InitAtoms(rt))
  ------------------
  |  Branch (2087:9): [True: 0, False: 14]
  ------------------
 2088|      0|        goto fail;
 2089|       |
 2090|       |    /* create the object, array and function classes */
 2091|     14|    if (init_class_range(rt, js_std_class_def, JS_CLASS_OBJECT,
  ------------------
  |  Branch (2091:9): [True: 0, False: 14]
  ------------------
 2092|     14|                         countof(js_std_class_def)) < 0)
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 2093|      0|        goto fail;
 2094|     14|    rt->class_array[JS_CLASS_ARGUMENTS].exotic = &js_arguments_exotic_methods;
 2095|     14|    rt->class_array[JS_CLASS_MAPPED_ARGUMENTS].exotic = &js_arguments_exotic_methods;
 2096|     14|    rt->class_array[JS_CLASS_STRING].exotic = &js_string_exotic_methods;
 2097|     14|    rt->class_array[JS_CLASS_MODULE_NS].exotic = &js_module_ns_exotic_methods;
 2098|       |
 2099|     14|    rt->class_array[JS_CLASS_C_FUNCTION].call = js_call_c_function;
 2100|     14|    rt->class_array[JS_CLASS_C_FUNCTION_DATA].call = js_c_function_data_call;
 2101|     14|    rt->class_array[JS_CLASS_BOUND_FUNCTION].call = js_call_bound_function;
 2102|     14|    rt->class_array[JS_CLASS_GENERATOR_FUNCTION].call = js_generator_function_call;
 2103|     14|    if (init_shape_hash(rt))
  ------------------
  |  Branch (2103:9): [True: 0, False: 14]
  ------------------
 2104|      0|        goto fail;
 2105|       |
 2106|     14|    rt->stack_size = JS_DEFAULT_STACK_SIZE;
  ------------------
  |  |  326|     14|#define JS_DEFAULT_STACK_SIZE (1024 * 1024)
  ------------------
 2107|     14|    JS_UpdateStackTop(rt);
 2108|       |
 2109|     14|    rt->current_exception = JS_UNINITIALIZED;
  ------------------
  |  |  293|     14|#define JS_UNINITIALIZED JS_MKVAL(JS_TAG_UNINITIALIZED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 2110|       |
 2111|     14|    return rt;
 2112|      0| fail:
 2113|      0|    JS_FreeRuntime(rt);
 2114|       |    return NULL;
 2115|     14|}
JS_GetRuntimeOpaque:
 2118|     18|{
 2119|     18|    return rt->user_opaque;
 2120|     18|}
JS_SetRuntimeOpaque:
 2123|     28|{
 2124|     28|    rt->user_opaque = opaque;
 2125|     28|}
JS_NewRuntime:
 2208|     14|{
 2209|       |    return JS_NewRuntime2(&def_malloc_funcs, NULL);
 2210|     14|}
JS_SetMemoryLimit:
 2213|     14|{
 2214|     14|    rt->malloc_ctx.malloc_state.malloc_limit = limit;
 2215|     14|}
JS_SetInterruptHandler:
 2228|     14|{
 2229|     14|    rt->interrupt_handler = cb;
 2230|     14|    rt->interrupt_opaque = opaque;
 2231|     14|}
JS_ExecutePendingJob:
 2295|      2|{
 2296|      2|    JSContext *ctx;
 2297|      2|    JSJobEntry *e;
 2298|      2|    JSValue res;
 2299|      2|    int i, ret;
 2300|       |
 2301|      2|    if (list_empty(&rt->job_list)) {
  ------------------
  |  Branch (2301:9): [True: 2, False: 0]
  ------------------
 2302|      2|        if (pctx)
  ------------------
  |  Branch (2302:13): [True: 0, False: 2]
  ------------------
 2303|      0|            *pctx = NULL;
 2304|      2|        return 0;
 2305|      2|    }
 2306|       |
 2307|       |    /* get the first pending job and execute it */
 2308|      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)))
  |  |  ------------------
  ------------------
 2309|      0|    list_del(&e->link);
 2310|      0|    ctx = e->realm;
 2311|      0|    res = e->job_func(ctx, e->argc, (JSValueConst *)e->argv);
 2312|      0|    for(i = 0; i < e->argc; i++)
  ------------------
  |  Branch (2312:16): [True: 0, False: 0]
  ------------------
 2313|      0|        JS_FreeValue(ctx, e->argv[i]);
 2314|      0|    if (JS_IsException(res))
  ------------------
  |  Branch (2314:9): [True: 0, False: 0]
  ------------------
 2315|      0|        ret = -1;
 2316|      0|    else
 2317|      0|        ret = 1;
 2318|      0|    JS_FreeValue(ctx, res);
 2319|      0|    js_free(ctx, e);
 2320|      0|    if (pctx) {
  ------------------
  |  Branch (2320:9): [True: 0, False: 0]
  ------------------
 2321|      0|        if (js_rc(ctx)->ref_count > 1)
  ------------------
  |  Branch (2321:13): [True: 0, False: 0]
  ------------------
 2322|      0|            *pctx = ctx;
 2323|      0|        else
 2324|      0|            *pctx = NULL;
 2325|      0|    }
 2326|      0|    JS_FreeContext(ctx);
 2327|      0|    return ret;
 2328|      2|}
JS_FreeRuntime:
 2397|     14|{
 2398|     14|    struct list_head *el, *el1;
 2399|     14|    int i;
 2400|       |
 2401|     14|    JS_FreeValueRT(rt, rt->current_exception);
 2402|       |
 2403|     14|    list_for_each_safe(el, el1, &rt->job_list) {
  ------------------
  |  |   89|     14|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 14]
  |  |  ------------------
  |  |   90|     14|        el = el1, el1 = el->next)
  ------------------
 2404|      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)))
  |  |  ------------------
  ------------------
 2405|      0|        for(i = 0; i < e->argc; i++)
  ------------------
  |  Branch (2405:20): [True: 0, False: 0]
  ------------------
 2406|      0|            JS_FreeValueRT(rt, e->argv[i]);
 2407|      0|        JS_FreeContext(e->realm);
 2408|      0|        js_free_rt(rt, e);
 2409|      0|    }
 2410|     14|    init_list_head(&rt->job_list);
 2411|       |
 2412|       |    /* don't remove the weak objects to avoid create new jobs with
 2413|       |       FinalizationRegistry */
 2414|     14|    JS_RunGCInternal(rt, FALSE);
 2415|       |
 2416|       |#ifdef DUMP_LEAKS
 2417|       |    /* leaking objects */
 2418|       |    {
 2419|       |        BOOL header_done;
 2420|       |        JSGCObjectHeader *p;
 2421|       |        int count;
 2422|       |
 2423|       |        /* remove the internal refcounts to display only the object
 2424|       |           referenced externally */
 2425|       |        list_for_each(el, &rt->gc_obj_list) {
 2426|       |            p = list_entry(el, JSGCObjectHeader, link);
 2427|       |            js_rc(p)->mark = 0;
 2428|       |        }
 2429|       |        gc_decref(rt);
 2430|       |
 2431|       |        header_done = FALSE;
 2432|       |        list_for_each(el, &rt->gc_obj_list) {
 2433|       |            p = list_entry(el, JSGCObjectHeader, link);
 2434|       |            if (js_rc(p)->ref_count != 0) {
 2435|       |                if (!header_done) {
 2436|       |                    printf("Object leaks:\n");
 2437|       |                    JS_DumpObjectHeader(rt);
 2438|       |                    header_done = TRUE;
 2439|       |                }
 2440|       |                JS_DumpGCObject(rt, p);
 2441|       |            }
 2442|       |        }
 2443|       |
 2444|       |        count = 0;
 2445|       |        list_for_each(el, &rt->gc_obj_list) {
 2446|       |            p = list_entry(el, JSGCObjectHeader, link);
 2447|       |            if (js_rc(p)->ref_count == 0) {
 2448|       |                count++;
 2449|       |            }
 2450|       |        }
 2451|       |        if (count != 0)
 2452|       |            printf("Secondary object leaks: %d\n", count);
 2453|       |    }
 2454|       |#endif
 2455|     14|    assert(list_empty(&rt->gc_obj_list));
  ------------------
  |  Branch (2455:5): [True: 0, False: 14]
  |  Branch (2455:5): [True: 14, False: 0]
  ------------------
 2456|     14|    assert(list_empty(&rt->weakref_list));
  ------------------
  |  Branch (2456:5): [True: 0, False: 14]
  |  Branch (2456:5): [True: 14, False: 0]
  ------------------
 2457|       |
 2458|       |    /* free the classes */
 2459|  1.29k|    for(i = 0; i < rt->class_count; i++) {
  ------------------
  |  Branch (2459:16): [True: 1.28k, False: 14]
  ------------------
 2460|  1.28k|        JSClass *cl = &rt->class_array[i];
 2461|  1.28k|        if (cl->class_id != 0) {
  ------------------
  |  Branch (2461:13): [True: 881, False: 404]
  ------------------
 2462|    881|            JS_FreeAtomRT(rt, cl->class_name);
 2463|    881|        }
 2464|  1.28k|    }
 2465|     14|    js_free_rt(rt, rt->class_array);
 2466|       |
 2467|       |#ifdef DUMP_LEAKS
 2468|       |    /* only the atoms defined in JS_InitAtoms() should be left */
 2469|       |    {
 2470|       |        BOOL header_done = FALSE;
 2471|       |
 2472|       |        for(i = 0; i < rt->atom_size; i++) {
 2473|       |            JSAtomStruct *p = rt->atom_array[i];
 2474|       |            if (!atom_is_free(p) /* && p->str*/) {
 2475|       |                if (i >= JS_ATOM_END || js_rc(p)->ref_count != 1) {
 2476|       |                    if (!header_done) {
 2477|       |                        header_done = TRUE;
 2478|       |                        if (rt->rt_info) {
 2479|       |                            printf("%s:1: atom leakage:", rt->rt_info);
 2480|       |                        } else {
 2481|       |                            printf("Atom leaks:\n"
 2482|       |                                   "    %6s %6s %s\n",
 2483|       |                                   "ID", "REFCNT", "NAME");
 2484|       |                        }
 2485|       |                    }
 2486|       |                    if (rt->rt_info) {
 2487|       |                        printf(" ");
 2488|       |                    } else {
 2489|       |                        printf("    %6u %6u ", i, js_rc(p)->ref_count);
 2490|       |                    }
 2491|       |                    switch (p->atom_type) {
 2492|       |                    case JS_ATOM_TYPE_STRING:
 2493|       |                        JS_DumpString(rt, p);
 2494|       |                        break;
 2495|       |                    case JS_ATOM_TYPE_GLOBAL_SYMBOL:
 2496|       |                        printf("Symbol.for(");
 2497|       |                        JS_DumpString(rt, p);
 2498|       |                        printf(")");
 2499|       |                        break;
 2500|       |                    case JS_ATOM_TYPE_SYMBOL:
 2501|       |                        if (p->hash != JS_ATOM_HASH_PRIVATE) {
 2502|       |                            printf("Symbol(");
 2503|       |                            JS_DumpString(rt, p);
 2504|       |                            printf(")");
 2505|       |                        } else {
 2506|       |                            printf("Private(");
 2507|       |                            JS_DumpString(rt, p);
 2508|       |                            printf(")");
 2509|       |                        }
 2510|       |                        break;
 2511|       |                    }
 2512|       |                    if (rt->rt_info) {
 2513|       |                        printf(":%u", js_rc(p)->ref_count);
 2514|       |                    } else {
 2515|       |                        printf("\n");
 2516|       |                    }
 2517|       |                }
 2518|       |            }
 2519|       |        }
 2520|       |        if (rt->rt_info && header_done)
 2521|       |            printf("\n");
 2522|       |    }
 2523|       |#endif
 2524|       |
 2525|       |    /* free the atoms */
 2526|  9.96k|    for(i = 0; i < rt->atom_size; i++) {
  ------------------
  |  Branch (2526:16): [True: 9.95k, False: 14]
  ------------------
 2527|  9.95k|        JSAtomStruct *p = rt->atom_array[i];
 2528|  9.95k|        if (!atom_is_free(p)) {
  ------------------
  |  Branch (2528:13): [True: 3.40k, False: 6.55k]
  ------------------
 2529|       |#ifdef DUMP_LEAKS
 2530|       |            list_del(&p->link);
 2531|       |#endif
 2532|  3.40k|            js_free_rt(rt, p);
 2533|  3.40k|        }
 2534|  9.95k|    }
 2535|     14|    js_free_rt(rt, rt->atom_array);
 2536|     14|    js_free_rt(rt, rt->atom_hash);
 2537|     14|    js_free_rt(rt, rt->shape_hash);
 2538|       |#ifdef DUMP_LEAKS
 2539|       |    if (!list_empty(&rt->string_list)) {
 2540|       |        if (rt->rt_info) {
 2541|       |            printf("%s:1: string leakage:", rt->rt_info);
 2542|       |        } else {
 2543|       |            printf("String leaks:\n"
 2544|       |                   "    %6s %s\n",
 2545|       |                   "REFCNT", "VALUE");
 2546|       |        }
 2547|       |        list_for_each_safe(el, el1, &rt->string_list) {
 2548|       |            JSString *str = list_entry(el, JSString, link);
 2549|       |            if (rt->rt_info) {
 2550|       |                printf(" ");
 2551|       |            } else {
 2552|       |                printf("    %6u ", js_rc(str)->ref_count);
 2553|       |            }
 2554|       |            JS_DumpString(rt, str);
 2555|       |            if (rt->rt_info) {
 2556|       |                printf(":%u", js_rc(str)->ref_count);
 2557|       |            } else {
 2558|       |                printf("\n");
 2559|       |            }
 2560|       |            list_del(&str->link);
 2561|       |            js_free_rt(rt, str);
 2562|       |        }
 2563|       |        if (rt->rt_info)
 2564|       |            printf("\n");
 2565|       |    }
 2566|       |    {
 2567|       |        JSMallocState *s = &rt->malloc_ctx.malloc_state;
 2568|       |        if (s->malloc_count > 1) {
 2569|       |            if (rt->rt_info)
 2570|       |                printf("%s:1: ", rt->rt_info);
 2571|       |            printf("Memory leak: %"PRIu64" bytes lost in %"PRIu64" block%s\n",
 2572|       |                   (uint64_t)(s->malloc_size - sizeof(JSRuntime)),
 2573|       |                   (uint64_t)(s->malloc_count - 1), &"s"[s->malloc_count == 2]);
 2574|       |        }
 2575|       |    }
 2576|       |#endif
 2577|       |
 2578|     14|    {
 2579|     14|        JSMallocState ms = rt->malloc_ctx.malloc_state;
 2580|     14|        rt->malloc_ctx.mf.js_free(&ms, rt);
 2581|     14|    }
 2582|     14|}
JS_NewContextRaw:
 2585|     14|{
 2586|     14|    JSContext *ctx;
 2587|     14|    int i;
 2588|       |
 2589|     14|    ctx = js_mallocz_rt(rt, sizeof(JSContext));
 2590|     14|    if (!ctx)
  ------------------
  |  Branch (2590:9): [True: 0, False: 14]
  ------------------
 2591|      0|        return NULL;
 2592|     14|    js_rc(ctx)->ref_count = 1;
 2593|     14|    add_gc_object(rt, &ctx->header, JS_GC_OBJ_TYPE_JS_CONTEXT);
 2594|       |
 2595|     14|    ctx->class_proto = js_malloc_rt(rt, sizeof(ctx->class_proto[0]) *
 2596|     14|                                    rt->class_count);
 2597|     14|    if (!ctx->class_proto) {
  ------------------
  |  Branch (2597:9): [True: 0, False: 14]
  ------------------
 2598|      0|        js_free_rt(rt, ctx);
 2599|      0|        return NULL;
 2600|      0|    }
 2601|     14|    ctx->rt = rt;
 2602|     14|    list_add_tail(&ctx->link, &rt->context_list);
 2603|    896|    for(i = 0; i < rt->class_count; i++)
  ------------------
  |  Branch (2603:16): [True: 882, False: 14]
  ------------------
 2604|    882|        ctx->class_proto[i] = JS_NULL;
  ------------------
  |  |  288|    882|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|    896|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 2605|     14|    ctx->array_ctor = JS_NULL;
  ------------------
  |  |  288|     14|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 2606|     14|    ctx->iterator_ctor = JS_NULL;
  ------------------
  |  |  288|     14|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 2607|     14|    ctx->regexp_ctor = JS_NULL;
  ------------------
  |  |  288|     14|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 2608|     14|    ctx->promise_ctor = JS_NULL;
  ------------------
  |  |  288|     14|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 2609|     14|    init_list_head(&ctx->loaded_modules);
 2610|       |
 2611|     14|    if (JS_AddIntrinsicBasicObjects(ctx)) {
  ------------------
  |  Branch (2611:9): [True: 0, False: 14]
  ------------------
 2612|      0|        JS_FreeContext(ctx);
 2613|      0|        return NULL;
 2614|      0|    }
 2615|     14|    return ctx;
 2616|     14|}
JS_NewContext:
 2619|     14|{
 2620|     14|    JSContext *ctx;
 2621|       |
 2622|     14|    ctx = JS_NewContextRaw(rt);
 2623|     14|    if (!ctx)
  ------------------
  |  Branch (2623:9): [True: 0, False: 14]
  ------------------
 2624|      0|        return NULL;
 2625|       |
 2626|     14|    if (JS_AddIntrinsicBaseObjects(ctx) ||
  ------------------
  |  Branch (2626:9): [True: 0, False: 14]
  ------------------
 2627|     14|        JS_AddIntrinsicDate(ctx) ||
  ------------------
  |  Branch (2627:9): [True: 0, False: 14]
  ------------------
 2628|     14|        JS_AddIntrinsicEval(ctx) ||
  ------------------
  |  Branch (2628:9): [True: 0, False: 14]
  ------------------
 2629|     14|        JS_AddIntrinsicStringNormalize(ctx) ||
  ------------------
  |  Branch (2629:9): [True: 0, False: 14]
  ------------------
 2630|     14|        JS_AddIntrinsicRegExp(ctx) ||
  ------------------
  |  Branch (2630:9): [True: 0, False: 14]
  ------------------
 2631|     14|        JS_AddIntrinsicJSON(ctx) ||
  ------------------
  |  Branch (2631:9): [True: 0, False: 14]
  ------------------
 2632|     14|        JS_AddIntrinsicProxy(ctx) ||
  ------------------
  |  Branch (2632:9): [True: 0, False: 14]
  ------------------
 2633|     14|        JS_AddIntrinsicMapSet(ctx) ||
  ------------------
  |  Branch (2633:9): [True: 0, False: 14]
  ------------------
 2634|     14|        JS_AddIntrinsicTypedArrays(ctx) ||
  ------------------
  |  Branch (2634:9): [True: 0, False: 14]
  ------------------
 2635|     14|        JS_AddIntrinsicPromise(ctx) ||
  ------------------
  |  Branch (2635:9): [True: 0, False: 14]
  ------------------
 2636|     14|        JS_AddIntrinsicWeakRef(ctx)) {
  ------------------
  |  Branch (2636:9): [True: 0, False: 14]
  ------------------
 2637|      0|        JS_FreeContext(ctx);
 2638|      0|        return NULL;
 2639|      0|    }
 2640|     14|    return ctx;
 2641|     14|}
JS_SetClassProto:
 2664|     13|{
 2665|     13|    JSRuntime *rt = ctx->rt;
 2666|     13|    assert(class_id < rt->class_count);
  ------------------
  |  Branch (2666:5): [True: 0, False: 13]
  |  Branch (2666:5): [True: 13, False: 0]
  ------------------
 2667|     13|    set_value(ctx, &ctx->class_proto[class_id], obj);
 2668|     13|}
JS_DupContext:
 2702|  8.32k|{
 2703|  8.32k|    js_rc(ctx)->ref_count++;
 2704|  8.32k|    return ctx;
 2705|  8.32k|}
JS_FreeContext:
 2757|  8.33k|{
 2758|  8.33k|    JSRuntime *rt = ctx->rt;
 2759|  8.33k|    int i;
 2760|       |
 2761|  8.33k|    if (--js_rc(ctx)->ref_count > 0)
  ------------------
  |  Branch (2761:9): [True: 8.32k, False: 14]
  ------------------
 2762|  8.32k|        return;
 2763|  8.33k|    assert(js_rc(ctx)->ref_count == 0);
  ------------------
  |  Branch (2763:5): [True: 0, False: 14]
  |  Branch (2763:5): [True: 14, False: 0]
  ------------------
 2764|       |
 2765|       |#ifdef DUMP_ATOMS
 2766|       |    JS_DumpAtoms(ctx->rt);
 2767|       |#endif
 2768|       |#ifdef DUMP_SHAPES
 2769|       |    JS_DumpShapes(ctx->rt);
 2770|       |#endif
 2771|       |#ifdef DUMP_OBJECTS
 2772|       |    {
 2773|       |        struct list_head *el;
 2774|       |        JSGCObjectHeader *p;
 2775|       |        printf("JSObjects: {\n");
 2776|       |        JS_DumpObjectHeader(ctx->rt);
 2777|       |        list_for_each(el, &rt->gc_obj_list) {
 2778|       |            p = list_entry(el, JSGCObjectHeader, link);
 2779|       |            JS_DumpGCObject(rt, p);
 2780|       |        }
 2781|       |        printf("}\n");
 2782|       |    }
 2783|       |#endif
 2784|       |#ifdef DUMP_MEM
 2785|       |    {
 2786|       |        JSMemoryUsage stats;
 2787|       |        JS_ComputeMemoryUsage(rt, &stats);
 2788|       |        JS_DumpMemoryUsage(stdout, &stats, rt);
 2789|       |    }
 2790|       |#endif
 2791|       |
 2792|     14|    js_free_modules(ctx, JS_FREE_MODULE_ALL);
 2793|       |
 2794|     14|    JS_FreeValue(ctx, ctx->global_obj);
 2795|     14|    JS_FreeValue(ctx, ctx->global_var_obj);
 2796|       |
 2797|     14|    JS_FreeValue(ctx, ctx->throw_type_error);
 2798|     14|    JS_FreeValue(ctx, ctx->eval_obj);
 2799|       |
 2800|     14|    JS_FreeValue(ctx, ctx->array_proto_values);
 2801|    126|    for(i = 0; i < JS_NATIVE_ERROR_COUNT; i++) {
  ------------------
  |  Branch (2801:16): [True: 112, False: 14]
  ------------------
 2802|    112|        JS_FreeValue(ctx, ctx->native_error_proto[i]);
 2803|    112|    }
 2804|  1.29k|    for(i = 0; i < rt->class_count; i++) {
  ------------------
  |  Branch (2804:16): [True: 1.28k, False: 14]
  ------------------
 2805|  1.28k|        JS_FreeValue(ctx, ctx->class_proto[i]);
 2806|  1.28k|    }
 2807|     14|    js_free_rt(rt, ctx->class_proto);
 2808|     14|    JS_FreeValue(ctx, ctx->iterator_ctor);
 2809|     14|    JS_FreeValue(ctx, ctx->async_iterator_proto);
 2810|     14|    JS_FreeValue(ctx, ctx->promise_ctor);
 2811|     14|    JS_FreeValue(ctx, ctx->array_ctor);
 2812|     14|    JS_FreeValue(ctx, ctx->regexp_ctor);
 2813|     14|    JS_FreeValue(ctx, ctx->function_ctor);
 2814|     14|    JS_FreeValue(ctx, ctx->function_proto);
 2815|       |
 2816|     14|    js_free_shape_null(ctx->rt, ctx->array_shape);
 2817|     14|    js_free_shape_null(ctx->rt, ctx->arguments_shape);
 2818|     14|    js_free_shape_null(ctx->rt, ctx->mapped_arguments_shape);
 2819|     14|    js_free_shape_null(ctx->rt, ctx->regexp_shape);
 2820|     14|    js_free_shape_null(ctx->rt, ctx->regexp_result_shape);
 2821|       |
 2822|     14|    list_del(&ctx->link);
 2823|     14|    remove_gc_object(&ctx->header);
 2824|     14|    js_free_rt(ctx->rt, ctx);
 2825|     14|}
JS_GetRuntime:
 2828|     33|{
 2829|     33|    return ctx->rt;
 2830|     33|}
JS_SetMaxStackSize:
 2842|     14|{
 2843|     14|    rt->stack_size = stack_size;
 2844|     14|    update_stack_limit(rt);
 2845|     14|}
JS_UpdateStackTop:
 2848|     14|{
 2849|     14|    rt->stack_top = js_get_stack_pointer();
 2850|     14|    update_stack_limit(rt);
 2851|     14|}
JS_DupAtom:
 3110|  18.5k|{
 3111|  18.5k|    JSRuntime *rt;
 3112|  18.5k|    JSAtomStruct *p;
 3113|       |
 3114|  18.5k|    if (!__JS_AtomIsConst(v)) {
  ------------------
  |  Branch (3114:9): [True: 8.07k, False: 10.4k]
  ------------------
 3115|  8.07k|        rt = ctx->rt;
 3116|  8.07k|        p = rt->atom_array[v];
 3117|  8.07k|        js_rc(p)->ref_count++;
 3118|  8.07k|    }
 3119|  18.5k|    return v;
 3120|  18.5k|}
JS_NewAtomLen:
 3452|  13.2k|{
 3453|  13.2k|    JSValue val;
 3454|       |
 3455|  13.2k|    if (len == 0 ||
  ------------------
  |  Branch (3455:9): [True: 28, False: 13.2k]
  ------------------
 3456|  13.2k|        (!is_digit(*str) &&
  ------------------
  |  Branch (3456:10): [True: 13.2k, False: 0]
  ------------------
 3457|  13.2k|         count_ascii((const uint8_t *)str, len) == len)) {
  ------------------
  |  Branch (3457:10): [True: 13.2k, False: 18]
  ------------------
 3458|  13.2k|        JSAtom atom = __JS_FindAtom(ctx->rt, str, len, JS_ATOM_TYPE_STRING);
 3459|  13.2k|        if (atom)
  ------------------
  |  Branch (3459:13): [True: 7.66k, False: 5.58k]
  ------------------
 3460|  7.66k|            return atom;
 3461|  13.2k|    }
 3462|  5.60k|    val = JS_NewStringLen(ctx, str, len);
 3463|  5.60k|    if (JS_IsException(val))
  ------------------
  |  Branch (3463:9): [True: 0, False: 5.60k]
  ------------------
 3464|      0|        return JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
 3465|  5.60k|    return JS_NewAtomStr(ctx, JS_VALUE_GET_STRING(val));
  ------------------
  |  |  228|  5.60k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  5.60k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 3466|  5.60k|}
JS_NewAtom:
 3469|  12.8k|{
 3470|  12.8k|    return JS_NewAtomLen(ctx, str, strlen(str));
 3471|  12.8k|}
JS_AtomToValue:
 3614|    301|{
 3615|    301|    return __JS_AtomToValue(ctx, atom, FALSE);
 3616|    301|}
JS_AtomToString:
 3619|   286k|{
 3620|   286k|    return __JS_AtomToValue(ctx, atom, TRUE);
 3621|   286k|}
JS_FreeAtom:
 3716|  1.36M|{
 3717|  1.36M|    if (!__JS_AtomIsConst(v))
  ------------------
  |  Branch (3717:9): [True: 9.62k, False: 1.35M]
  ------------------
 3718|  9.62k|        __JS_FreeAtom(ctx->rt, v);
 3719|  1.36M|}
JS_FreeAtomRT:
 3722|  18.5k|{
 3723|  18.5k|    if (!__JS_AtomIsConst(v))
  ------------------
  |  Branch (3723:9): [True: 8.03k, False: 10.5k]
  ------------------
 3724|  8.03k|        __JS_FreeAtom(rt, v);
 3725|  18.5k|}
JS_AtomToCStringLen:
 3745|     81|{
 3746|     81|    JSValue str;
 3747|     81|    const char *cstr;
 3748|       |
 3749|     81|    str = JS_AtomToString(ctx, atom);
 3750|     81|    if (JS_IsException(str)) {
  ------------------
  |  Branch (3750:9): [True: 0, False: 81]
  ------------------
 3751|      0|        if (plen)
  ------------------
  |  Branch (3751:13): [True: 0, False: 0]
  ------------------
 3752|      0|            *plen = 0;
 3753|      0|        return NULL;
 3754|      0|    }
 3755|     81|    cstr = JS_ToCStringLen(ctx, plen, str);
 3756|     81|    JS_FreeValue(ctx, str);
 3757|     81|    return cstr;
 3758|     81|}
JS_NewClassID:
 3815|     13|{
 3816|     13|    JSClassID class_id;
 3817|     13|#ifdef CONFIG_ATOMICS
 3818|     13|    pthread_mutex_lock(&js_class_id_mutex);
 3819|     13|#endif
 3820|     13|    class_id = *pclass_id;
 3821|     13|    if (class_id == 0) {
  ------------------
  |  Branch (3821:9): [True: 1, False: 12]
  ------------------
 3822|      1|        class_id = js_class_id_alloc++;
 3823|      1|        *pclass_id = class_id;
 3824|      1|    }
 3825|     13|#ifdef CONFIG_ATOMICS
 3826|     13|    pthread_mutex_unlock(&js_class_id_mutex);
 3827|     13|#endif
 3828|     13|    return class_id;
 3829|     13|}
JS_IsRegisteredClass:
 3841|     56|{
 3842|     56|    return (class_id < rt->class_count &&
  ------------------
  |  Branch (3842:13): [True: 56, False: 0]
  ------------------
 3843|     56|            rt->class_array[class_id].class_id != 0);
  ------------------
  |  Branch (3843:13): [True: 0, False: 56]
  ------------------
 3844|     56|}
JS_NewClass:
 3898|     13|{
 3899|     13|    int ret, len;
 3900|     13|    JSAtom name;
 3901|       |
 3902|     13|    len = strlen(class_def->class_name);
 3903|     13|    name = __JS_FindAtom(rt, class_def->class_name, len, JS_ATOM_TYPE_STRING);
 3904|     13|    if (name == JS_ATOM_NULL) {
  ------------------
  |  |  449|     13|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (3904:9): [True: 13, False: 0]
  ------------------
 3905|     13|        name = __JS_NewAtomInit(rt, class_def->class_name, len, JS_ATOM_TYPE_STRING);
 3906|     13|        if (name == JS_ATOM_NULL)
  ------------------
  |  |  449|     13|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (3906:13): [True: 0, False: 13]
  ------------------
 3907|      0|            return -1;
 3908|     13|    }
 3909|     13|    ret = JS_NewClass1(rt, class_id, class_def, name);
 3910|     13|    JS_FreeAtomRT(rt, name);
 3911|     13|    return ret;
 3912|     13|}
JS_NewStringLen:
 4349|  5.67k|{
 4350|  5.67k|    const uint8_t *p, *p_end, *p_start, *p_next;
 4351|  5.67k|    uint32_t c;
 4352|  5.67k|    StringBuffer b_s, *b = &b_s;
 4353|  5.67k|    size_t len1;
 4354|       |
 4355|  5.67k|    p_start = (const uint8_t *)buf;
 4356|  5.67k|    p_end = p_start + buf_len;
 4357|  5.67k|    len1 = count_ascii(p_start, buf_len);
 4358|  5.67k|    p = p_start + len1;
 4359|  5.67k|    if (len1 > JS_STRING_LEN_MAX)
  ------------------
  |  |  210|  5.67k|#define JS_STRING_LEN_MAX ((1 << 30) - 1)
  ------------------
  |  Branch (4359:9): [True: 0, False: 5.67k]
  ------------------
 4360|      0|        return JS_ThrowInternalError(ctx, "string too long");
 4361|  5.67k|    if (p == p_end) {
  ------------------
  |  Branch (4361:9): [True: 5.65k, False: 19]
  ------------------
 4362|       |        /* ASCII string */
 4363|  5.65k|        return js_new_string8_len(ctx, buf, buf_len);
 4364|  5.65k|    } else {
 4365|     19|        if (string_buffer_init(ctx, b, buf_len))
  ------------------
  |  Branch (4365:13): [True: 0, False: 19]
  ------------------
 4366|      0|            goto fail;
 4367|     19|        string_buffer_write8(b, p_start, len1);
 4368|  2.09M|        while (p < p_end) {
  ------------------
  |  Branch (4368:16): [True: 2.09M, False: 19]
  ------------------
 4369|  2.09M|            if (*p < 128) {
  ------------------
  |  Branch (4369:17): [True: 2.09M, False: 20]
  ------------------
 4370|  2.09M|                string_buffer_putc8(b, *p++);
 4371|  2.09M|            } else {
 4372|       |                /* parse utf-8 sequence, return 0xFFFFFFFF for error */
 4373|     20|                c = unicode_from_utf8(p, p_end - p, &p_next);
 4374|     20|                if (c < 0x10000) {
  ------------------
  |  Branch (4374:21): [True: 18, False: 2]
  ------------------
 4375|     18|                    p = p_next;
 4376|     18|                } else if (c <= 0x10FFFF) {
  ------------------
  |  Branch (4376:28): [True: 0, False: 2]
  ------------------
 4377|      0|                    p = p_next;
 4378|       |                    /* surrogate pair */
 4379|      0|                    string_buffer_putc16(b, get_hi_surrogate(c));
 4380|      0|                    c = get_lo_surrogate(c);
 4381|      2|                } else {
 4382|       |                    /* invalid char */
 4383|      2|                    c = 0xfffd;
 4384|       |                    /* skip the invalid chars */
 4385|       |                    /* XXX: seems incorrect. Why not just use c = *p++; ? */
 4386|      2|                    while (p < p_end && (*p >= 0x80 && *p < 0xc0))
  ------------------
  |  Branch (4386:28): [True: 2, False: 0]
  |  Branch (4386:42): [True: 2, False: 0]
  |  Branch (4386:56): [True: 0, False: 2]
  ------------------
 4387|      0|                        p++;
 4388|      2|                    if (p < p_end) {
  ------------------
  |  Branch (4388:25): [True: 2, False: 0]
  ------------------
 4389|      2|                        p++;
 4390|      2|                        while (p < p_end && (*p >= 0x80 && *p < 0xc0))
  ------------------
  |  Branch (4390:32): [True: 2, False: 0]
  |  Branch (4390:46): [True: 1, False: 1]
  |  Branch (4390:60): [True: 0, False: 1]
  ------------------
 4391|      0|                            p++;
 4392|      2|                    }
 4393|      2|                }
 4394|     20|                string_buffer_putc16(b, c);
 4395|     20|            }
 4396|  2.09M|        }
 4397|     19|    }
 4398|     19|    return string_buffer_end(b);
 4399|       |
 4400|      0| fail:
 4401|      0|    string_buffer_free(b);
 4402|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 4403|  5.67k|}
JS_ToCStringLen2:
 4450|    105|{
 4451|    105|    JSValue val;
 4452|    105|    JSString *str, *str_new;
 4453|    105|    int pos, len, c, c1;
 4454|    105|    uint8_t *q;
 4455|       |
 4456|    105|    if (JS_VALUE_GET_TAG(val1) != JS_TAG_STRING) {
  ------------------
  |  |  236|    105|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (4456:9): [True: 1, False: 104]
  ------------------
 4457|      1|        val = JS_ToString(ctx, val1);
 4458|      1|        if (JS_IsException(val))
  ------------------
  |  Branch (4458:13): [True: 0, False: 1]
  ------------------
 4459|      0|            goto fail;
 4460|    104|    } else {
 4461|    104|        val = JS_DupValue(ctx, val1);
 4462|    104|    }
 4463|       |
 4464|    105|    str = JS_VALUE_GET_STRING(val);
  ------------------
  |  |  228|    105|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    105|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4465|    105|    len = str->len;
 4466|    105|    if (!str->is_wide_char) {
  ------------------
  |  Branch (4466:9): [True: 101, False: 4]
  ------------------
 4467|    101|        const uint8_t *src = str->u.str8;
 4468|    101|        int count;
 4469|       |
 4470|       |        /* count the number of non-ASCII characters */
 4471|       |        /* Scanning the whole string is required for ASCII strings,
 4472|       |           and computing the number of non-ASCII bytes is less expensive
 4473|       |           than testing each byte, hence this method is faster for ASCII
 4474|       |           strings, which is the most common case.
 4475|       |         */
 4476|    101|        count = 0;
 4477|    648|        for (pos = 0; pos < len; pos++) {
  ------------------
  |  Branch (4477:23): [True: 547, False: 101]
  ------------------
 4478|    547|            count += src[pos] >> 7;
 4479|    547|        }
 4480|    101|        if (count == 0) {
  ------------------
  |  Branch (4480:13): [True: 101, False: 0]
  ------------------
 4481|    101|            if (plen)
  ------------------
  |  Branch (4481:17): [True: 7, False: 94]
  ------------------
 4482|      7|                *plen = len;
 4483|    101|            return (const char *)src;
 4484|    101|        }
 4485|      0|        str_new = js_alloc_string(ctx, len + count, 0);
 4486|      0|        if (!str_new)
  ------------------
  |  Branch (4486:13): [True: 0, False: 0]
  ------------------
 4487|      0|            goto fail;
 4488|      0|        q = str_new->u.str8;
 4489|      0|        for (pos = 0; pos < len; pos++) {
  ------------------
  |  Branch (4489:23): [True: 0, False: 0]
  ------------------
 4490|      0|            c = src[pos];
 4491|      0|            if (c < 0x80) {
  ------------------
  |  Branch (4491:17): [True: 0, False: 0]
  ------------------
 4492|      0|                *q++ = c;
 4493|      0|            } else {
 4494|      0|                *q++ = (c >> 6) | 0xc0;
 4495|      0|                *q++ = (c & 0x3f) | 0x80;
 4496|      0|            }
 4497|      0|        }
 4498|      4|    } else {
 4499|      4|        const uint16_t *src = str->u.str16;
 4500|       |        /* Allocate 3 bytes per 16 bit code point. Surrogate pairs may
 4501|       |           produce 4 bytes but use 2 code points.
 4502|       |         */
 4503|      4|        str_new = js_alloc_string(ctx, len * 3, 0);
 4504|      4|        if (!str_new)
  ------------------
  |  Branch (4504:13): [True: 0, False: 4]
  ------------------
 4505|      0|            goto fail;
 4506|      4|        q = str_new->u.str8;
 4507|      4|        pos = 0;
 4508|  2.46M|        while (pos < len) {
  ------------------
  |  Branch (4508:16): [True: 2.46M, False: 4]
  ------------------
 4509|  2.46M|            c = src[pos++];
 4510|  2.46M|            if (c < 0x80) {
  ------------------
  |  Branch (4510:17): [True: 2.46M, False: 1.24k]
  ------------------
 4511|  2.46M|                *q++ = c;
 4512|  2.46M|            } else {
 4513|  1.24k|                if (is_hi_surrogate(c)) {
  ------------------
  |  Branch (4513:21): [True: 1, False: 1.24k]
  ------------------
 4514|      1|                    if (pos < len && !cesu8) {
  ------------------
  |  Branch (4514:25): [True: 1, False: 0]
  |  Branch (4514:38): [True: 1, False: 0]
  ------------------
 4515|      1|                        c1 = src[pos];
 4516|      1|                        if (is_lo_surrogate(c1)) {
  ------------------
  |  Branch (4516:29): [True: 0, False: 1]
  ------------------
 4517|      0|                            pos++;
 4518|      0|                            c = from_surrogate(c, c1);
 4519|      1|                        } else {
 4520|       |                            /* Keep unmatched surrogate code points */
 4521|       |                            /* c = 0xfffd; */ /* error */
 4522|      1|                        }
 4523|      1|                    } else {
 4524|       |                        /* Keep unmatched surrogate code points */
 4525|       |                        /* c = 0xfffd; */ /* error */
 4526|      0|                    }
 4527|      1|                }
 4528|  1.24k|                q += unicode_to_utf8(q, c);
 4529|  1.24k|            }
 4530|  2.46M|        }
 4531|      4|    }
 4532|       |
 4533|      4|    *q = '\0';
 4534|      4|    str_new->len = q - str_new->u.str8;
 4535|      4|    JS_FreeValue(ctx, val);
 4536|      4|    if (plen)
  ------------------
  |  Branch (4536:9): [True: 4, False: 0]
  ------------------
 4537|      4|        *plen = str_new->len;
 4538|      4|    return (const char *)str_new->u.str8;
 4539|      0| fail:
 4540|      0|    if (plen)
  ------------------
  |  Branch (4540:9): [True: 0, False: 0]
  ------------------
 4541|      0|        *plen = 0;
 4542|       |    return NULL;
 4543|    105|}
JS_FreeCString:
 4546|    105|{
 4547|    105|    JSString *p;
 4548|    105|    if (!ptr)
  ------------------
  |  Branch (4548:9): [True: 0, False: 105]
  ------------------
 4549|      0|        return;
 4550|       |    /* purposely removing constness */
 4551|    105|    p = container_of(ptr, JSString, u);
  ------------------
  |  |   51|    105|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 4552|    105|    JS_FreeValue(ctx, JS_MKPTR(JS_TAG_STRING, p));
  ------------------
  |  |  246|    105|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 4553|    105|}
JS_NewObjectProtoClass:
 5736|  1.84k|{
 5737|  1.84k|    JSShape *sh;
 5738|  1.84k|    JSObject *proto;
 5739|       |
 5740|  1.84k|    proto = get_proto_obj(proto_val);
 5741|  1.84k|    sh = find_hashed_shape_proto(ctx->rt, proto);
 5742|  1.84k|    if (likely(sh)) {
  ------------------
  |  |   32|  1.84k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 866, False: 983]
  |  |  ------------------
  ------------------
 5743|    866|        sh = js_dup_shape(sh);
 5744|    983|    } else {
 5745|    983|        sh = js_new_shape(ctx, proto);
 5746|    983|        if (!sh)
  ------------------
  |  Branch (5746:13): [True: 0, False: 983]
  ------------------
 5747|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 5748|    983|    }
 5749|  1.84k|    return JS_NewObjectFromShape(ctx, sh, class_id, NULL);
 5750|  1.84k|}
JS_NewObjectClass:
 5823|     84|{
 5824|     84|    return JS_NewObjectProtoClass(ctx, ctx->class_proto[class_id], class_id);
 5825|     84|}
JS_NewArray:
 5833|     30|{
 5834|     30|    return JS_NewObjectFromShape(ctx, js_dup_shape(ctx->array_shape),
 5835|       |                                 JS_CLASS_ARRAY, NULL);
 5836|     30|}
JS_NewObject:
 5839|     41|{
 5840|       |    /* inline JS_NewObjectClass(ctx, JS_CLASS_OBJECT); */
 5841|     41|    return JS_NewObjectProtoClass(ctx, ctx->class_proto[JS_CLASS_OBJECT], JS_CLASS_OBJECT);
 5842|     41|}
JS_NewCFunction2:
 5977|  1.56k|{
 5978|  1.56k|    return JS_NewCFunction3(ctx, func, name, length, cproto, magic,
 5979|  1.56k|                            ctx->function_proto, 0);
 5980|  1.56k|}
JS_NewCFunctionData:
 6041|     40|{
 6042|     40|    JSCFunctionDataRecord *s;
 6043|     40|    JSValue func_obj;
 6044|     40|    int i;
 6045|       |
 6046|     40|    func_obj = JS_NewObjectProtoClass(ctx, ctx->function_proto,
 6047|     40|                                      JS_CLASS_C_FUNCTION_DATA);
 6048|     40|    if (JS_IsException(func_obj))
  ------------------
  |  Branch (6048:9): [True: 0, False: 40]
  ------------------
 6049|      0|        return func_obj;
 6050|     40|    s = js_malloc(ctx, sizeof(*s) + data_len * sizeof(JSValue));
 6051|     40|    if (!s) {
  ------------------
  |  Branch (6051:9): [True: 0, False: 40]
  ------------------
 6052|      0|        JS_FreeValue(ctx, func_obj);
 6053|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 6054|      0|    }
 6055|     40|    s->func = func;
 6056|     40|    s->length = length;
 6057|     40|    s->data_len = data_len;
 6058|     40|    s->magic = magic;
 6059|    106|    for(i = 0; i < data_len; i++)
  ------------------
  |  Branch (6059:16): [True: 66, False: 40]
  ------------------
 6060|     66|        s->data[i] = JS_DupValue(ctx, data[i]);
 6061|     40|    JS_SetOpaque(func_obj, s);
 6062|     40|    js_function_set_properties(ctx, func_obj,
 6063|     40|                               JS_ATOM_empty_string, length);
 6064|     40|    return func_obj;
 6065|     40|}
__JS_FreeValueRT:
 6424|  76.7k|{
 6425|  76.7k|    uint32_t tag = JS_VALUE_GET_TAG(v);
  ------------------
  |  |  236|  76.7k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
 6426|       |
 6427|       |#ifdef DUMP_FREE
 6428|       |    {
 6429|       |        printf("Freeing ");
 6430|       |        if (tag == JS_TAG_OBJECT) {
 6431|       |            JS_DumpObject(rt, JS_VALUE_GET_OBJ(v));
 6432|       |        } else {
 6433|       |            JS_DumpValueShort(rt, v);
 6434|       |            printf("\n");
 6435|       |        }
 6436|       |    }
 6437|       |#endif
 6438|       |
 6439|  76.7k|    switch(tag) {
 6440|  73.3k|    case JS_TAG_STRING:
  ------------------
  |  Branch (6440:5): [True: 73.3k, False: 3.43k]
  ------------------
 6441|  73.3k|        {
 6442|  73.3k|            JSString *p = JS_VALUE_GET_STRING(v);
  ------------------
  |  |  228|  73.3k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  73.3k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6443|  73.3k|            if (p->atom_type) {
  ------------------
  |  Branch (6443:17): [True: 472, False: 72.8k]
  ------------------
 6444|    472|                JS_FreeAtomStruct(rt, p);
 6445|  72.8k|            } else {
 6446|       |#ifdef DUMP_LEAKS
 6447|       |                list_del(&p->link);
 6448|       |#endif
 6449|  72.8k|                js_free_rt(rt, p);
 6450|  72.8k|            }
 6451|  73.3k|        }
 6452|  73.3k|        break;
 6453|      1|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (6453:5): [True: 1, False: 76.7k]
  ------------------
 6454|       |        /* Note: recursion is acceptable because the rope depth is bounded */
 6455|      1|        {
 6456|      1|            JSStringRope *p = JS_VALUE_GET_STRING_ROPE(v);
  ------------------
  |  |  229|      1|#define JS_VALUE_GET_STRING_ROPE(v) ((JSStringRope *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6457|      1|            JS_FreeValueRT(rt, p->left);
 6458|      1|            JS_FreeValueRT(rt, p->right);
 6459|      1|            js_free_rt(rt, p);
 6460|      1|        }
 6461|      1|        break;
 6462|  3.41k|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (6462:5): [True: 3.41k, False: 73.3k]
  ------------------
 6463|  3.43k|    case JS_TAG_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6463:5): [True: 28, False: 76.7k]
  ------------------
 6464|  3.43k|    case JS_TAG_MODULE:
  ------------------
  |  Branch (6464:5): [True: 0, False: 76.7k]
  ------------------
 6465|  3.43k|        {
 6466|  3.43k|            JSGCObjectHeader *p = JS_VALUE_GET_PTR(v);
  ------------------
  |  |  243|  3.43k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
 6467|  3.43k|            if (rt->gc_phase != JS_GC_PHASE_REMOVE_CYCLES) {
  ------------------
  |  Branch (6467:17): [True: 147, False: 3.29k]
  ------------------
 6468|    147|                list_del(&p->link);
 6469|    147|                list_add(&p->link, &rt->gc_zero_ref_count_list);
 6470|    147|                js_rc(p)->mark = 1; /* indicate that the object is about to be freed */
 6471|    147|                if (rt->gc_phase == JS_GC_PHASE_NONE) {
  ------------------
  |  Branch (6471:21): [True: 94, False: 53]
  ------------------
 6472|     94|                    free_zero_refcount(rt);
 6473|     94|                }
 6474|    147|            }
 6475|  3.43k|        }
 6476|  3.43k|        break;
 6477|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (6477:5): [True: 0, False: 76.7k]
  ------------------
 6478|      0|        {
 6479|      0|            JSBigInt *p = JS_VALUE_GET_PTR(v);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
 6480|      0|            js_free_rt(rt, p);
 6481|      0|        }
 6482|      0|        break;
 6483|      0|    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (6483:5): [True: 0, False: 76.7k]
  ------------------
 6484|      0|        {
 6485|      0|            JSAtomStruct *p = JS_VALUE_GET_PTR(v);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
 6486|      0|            JS_FreeAtomStruct(rt, p);
 6487|      0|        }
 6488|      0|        break;
 6489|      0|    default:
  ------------------
  |  Branch (6489:5): [True: 0, False: 76.7k]
  ------------------
 6490|      0|        abort();
 6491|  76.7k|    }
 6492|  76.7k|}
__JS_FreeValue:
 6495|  1.09k|{
 6496|  1.09k|    __JS_FreeValueRT(ctx->rt, v);
 6497|  1.09k|}
JS_MarkValue:
 6545|   730k|{
 6546|   730k|    if (JS_VALUE_HAS_REF_COUNT(val)) {
  ------------------
  |  |  285|   730k|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|   730k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (285:35): [True: 713k, False: 17.1k]
  |  |  ------------------
  ------------------
 6547|   713k|        switch(JS_VALUE_GET_TAG(val)) {
  ------------------
  |  |  236|   713k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
 6548|  16.4k|        case JS_TAG_OBJECT:
  ------------------
  |  Branch (6548:9): [True: 16.4k, False: 696k]
  ------------------
 6549|  16.4k|        case JS_TAG_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6549:9): [True: 62, False: 713k]
  ------------------
 6550|  16.6k|        case JS_TAG_MODULE:
  ------------------
  |  Branch (6550:9): [True: 162, False: 713k]
  ------------------
 6551|  16.6k|            mark_func(rt, JS_VALUE_GET_PTR(val));
  ------------------
  |  |  243|  16.6k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
 6552|  16.6k|            break;
 6553|   696k|        default:
  ------------------
  |  Branch (6553:9): [True: 696k, False: 16.6k]
  ------------------
 6554|   696k|            break;
 6555|   713k|        }
 6556|   713k|    }
 6557|   730k|}
JS_RunGC:
 6827|     13|{
 6828|     13|    JS_RunGCInternal(rt, TRUE);
 6829|     13|}
JS_GetGlobalObject:
 7341|     14|{
 7342|     14|    return JS_DupValue(ctx, ctx->global_obj);
 7343|     14|}
JS_Throw:
 7347|     27|{
 7348|     27|    JSRuntime *rt = ctx->rt;
 7349|     27|    JS_FreeValue(ctx, rt->current_exception);
 7350|     27|    rt->current_exception = obj;
 7351|     27|    rt->current_exception_is_uncatchable = FALSE;
 7352|     27|    return JS_EXCEPTION;
  ------------------
  |  |  292|     27|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|     27|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 7353|     27|}
JS_ThrowTypeError:
 7679|     14|{
 7680|     14|    JSValue val;
 7681|     14|    va_list ap;
 7682|       |
 7683|     14|    va_start(ap, fmt);
 7684|     14|    val = JS_ThrowError(ctx, JS_TYPE_ERROR, fmt, ap);
 7685|       |    va_end(ap);
 7686|     14|    return val;
 7687|     14|}
JS_ThrowReferenceError:
 7737|      9|{
 7738|      9|    JSValue val;
 7739|      9|    va_list ap;
 7740|       |
 7741|      9|    va_start(ap, fmt);
 7742|      9|    val = JS_ThrowError(ctx, JS_REFERENCE_ERROR, fmt, ap);
 7743|       |    va_end(ap);
 7744|      9|    return val;
 7745|      9|}
JS_ThrowInternalError:
 7759|      2|{
 7760|      2|    JSValue val;
 7761|      2|    va_list ap;
 7762|       |
 7763|      2|    va_start(ap, fmt);
 7764|      2|    val = JS_ThrowError(ctx, JS_INTERNAL_ERROR, fmt, ap);
 7765|       |    va_end(ap);
 7766|      2|    return val;
 7767|      2|}
JS_GetPrototype:
 8019|      6|{
 8020|      6|    JSValue val;
 8021|      6|    if (JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT) {
  ------------------
  |  |  236|      6|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (8021:9): [True: 6, False: 0]
  ------------------
 8022|      6|        JSObject *p;
 8023|      6|        p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|      6|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      6|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8024|      6|        if (unlikely(p->is_exotic)) {
  ------------------
  |  |   33|      6|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 6]
  |  |  ------------------
  ------------------
 8025|      0|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8026|      0|            if (em && em->get_prototype) {
  ------------------
  |  Branch (8026:17): [True: 0, False: 0]
  |  Branch (8026:23): [True: 0, False: 0]
  ------------------
 8027|      0|                return em->get_prototype(ctx, obj);
 8028|      0|            }
 8029|      0|        }
 8030|      6|        p = p->shape->proto;
 8031|      6|        if (!p)
  ------------------
  |  Branch (8031:13): [True: 2, False: 4]
  ------------------
 8032|      2|            val = JS_NULL;
  ------------------
  |  |  288|      2|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8033|      4|        else
 8034|      4|            val = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  246|      4|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8035|      6|    } else {
 8036|      0|        val = JS_DupValue(ctx, JS_GetPrototypePrimitive(ctx, obj));
 8037|      0|    }
 8038|      6|    return val;
 8039|      6|}
JS_GetPropertyInternal:
 8204|  1.01M|{
 8205|  1.01M|    JSObject *p;
 8206|  1.01M|    JSProperty *pr;
 8207|  1.01M|    JSShapeProperty *prs;
 8208|  1.01M|    uint32_t tag;
 8209|       |
 8210|  1.01M|    tag = JS_VALUE_GET_TAG(obj);
  ------------------
  |  |  236|  1.01M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
 8211|  1.01M|    if (unlikely(tag != JS_TAG_OBJECT)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 5, False: 1.01M]
  |  |  ------------------
  ------------------
 8212|      5|        switch(tag) {
 8213|      0|        case JS_TAG_NULL:
  ------------------
  |  Branch (8213:9): [True: 0, False: 5]
  ------------------
 8214|      0|            return JS_ThrowTypeErrorAtom(ctx, "cannot read property '%s' of null", prop);
  ------------------
  |  | 7722|      0|#define JS_ThrowTypeErrorAtom(ctx, fmt, atom) __JS_ThrowTypeErrorAtom(ctx, atom, fmt, "")
  ------------------
 8215|      0|        case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (8215:9): [True: 0, False: 5]
  ------------------
 8216|      0|            return JS_ThrowTypeErrorAtom(ctx, "cannot read property '%s' of undefined", prop);
  ------------------
  |  | 7722|      0|#define JS_ThrowTypeErrorAtom(ctx, fmt, atom) __JS_ThrowTypeErrorAtom(ctx, atom, fmt, "")
  ------------------
 8217|      0|        case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (8217:9): [True: 0, False: 5]
  ------------------
 8218|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8219|      5|        case JS_TAG_STRING:
  ------------------
  |  Branch (8219:9): [True: 5, False: 0]
  ------------------
 8220|      5|            {
 8221|      5|                JSString *p1 = JS_VALUE_GET_STRING(obj);
  ------------------
  |  |  228|      5|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      5|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8222|      5|                if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (8222:21): [True: 0, False: 5]
  ------------------
 8223|      0|                    uint32_t idx;
 8224|      0|                    idx = __JS_AtomToUInt32(prop);
 8225|      0|                    if (idx < p1->len) {
  ------------------
  |  Branch (8225:25): [True: 0, False: 0]
  ------------------
 8226|      0|                        return js_new_string_char(ctx, string_get(p1, idx));
 8227|      0|                    }
 8228|      5|                } else if (prop == JS_ATOM_length) {
  ------------------
  |  Branch (8228:28): [True: 0, False: 5]
  ------------------
 8229|      0|                    return JS_NewInt32(ctx, p1->len);
 8230|      0|                }
 8231|      5|            }
 8232|      5|            break;
 8233|      5|        case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (8233:9): [True: 0, False: 5]
  ------------------
 8234|      0|            {
 8235|      0|                JSStringRope *p1 = JS_VALUE_GET_STRING_ROPE(obj);
  ------------------
  |  |  229|      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)
  |  |  ------------------
  ------------------
 8236|      0|                if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (8236:21): [True: 0, False: 0]
  ------------------
 8237|      0|                    uint32_t idx;
 8238|      0|                    idx = __JS_AtomToUInt32(prop);
 8239|      0|                    if (idx < p1->len) {
  ------------------
  |  Branch (8239:25): [True: 0, False: 0]
  ------------------
 8240|      0|                        return js_new_string_char(ctx, string_rope_get(obj, idx));
 8241|      0|                    }
 8242|      0|                } else if (prop == JS_ATOM_length) {
  ------------------
  |  Branch (8242:28): [True: 0, False: 0]
  ------------------
 8243|      0|                    return JS_NewInt32(ctx, p1->len);
 8244|      0|                }
 8245|      0|            }
 8246|      0|            break;
 8247|      0|        default:
  ------------------
  |  Branch (8247:9): [True: 0, False: 5]
  ------------------
 8248|      0|            break;
 8249|      5|        }
 8250|       |        /* cannot raise an exception */
 8251|      5|        p = JS_VALUE_GET_OBJ(JS_GetPrototypePrimitive(ctx, obj));
  ------------------
  |  |  227|      5|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      5|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8252|      5|        if (!p)
  ------------------
  |  Branch (8252:13): [True: 0, False: 5]
  ------------------
 8253|      0|            return JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8254|  1.01M|    } else {
 8255|  1.01M|        p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|  1.01M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.01M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8256|  1.01M|    }
 8257|       |
 8258|  2.02M|    for(;;) {
 8259|  2.02M|        prs = find_own_property(&pr, p, prop);
 8260|  2.02M|        if (prs) {
  ------------------
  |  Branch (8260:13): [True: 1.01M, False: 1.01M]
  ------------------
 8261|       |            /* found */
 8262|  1.01M|            if (unlikely(prs->flags & JS_PROP_TMASK)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 234, False: 1.01M]
  |  |  ------------------
  ------------------
 8263|    234|                if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  301|    234|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|    234|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (8263:21): [True: 20, False: 214]
  ------------------
 8264|     20|                    if (unlikely(!pr->u.getset.getter)) {
  ------------------
  |  |   33|     20|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 20]
  |  |  ------------------
  ------------------
 8265|      0|                        return JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8266|     20|                    } else {
 8267|     20|                        JSValue func = JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.getter);
  ------------------
  |  |  246|     20|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8268|       |                        /* Note: the field could be removed in the getter */
 8269|     20|                        func = JS_DupValue(ctx, func);
 8270|     20|                        return JS_CallFree(ctx, func, this_obj, 0, NULL);
 8271|     20|                    }
 8272|    214|                } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  301|    214|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  304|    214|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (8272:28): [True: 42, False: 172]
  ------------------
 8273|     42|                    JSValue val = *pr->u.var_ref->pvalue;
 8274|     42|                    if (unlikely(JS_IsUninitialized(val)))
  ------------------
  |  |   33|     42|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 42]
  |  |  ------------------
  ------------------
 8275|      0|                        return JS_ThrowReferenceErrorUninitialized(ctx, prs->atom);
 8276|     42|                    return JS_DupValue(ctx, val);
 8277|    172|                } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  301|    172|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  305|    172|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (8277:28): [True: 172, False: 0]
  ------------------
 8278|       |                    /* Instantiate property and retry */
 8279|    172|                    if (JS_AutoInitProperty(ctx, p, prop, pr, prs))
  ------------------
  |  Branch (8279:25): [True: 0, False: 172]
  ------------------
 8280|      0|                        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8281|    172|                    continue;
 8282|    172|                }
 8283|  1.01M|            } else {
 8284|  1.01M|                return JS_DupValue(ctx, pr->u.value);
 8285|  1.01M|            }
 8286|  1.01M|        }
 8287|  1.01M|        if (unlikely(p->is_exotic)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 42, False: 1.01M]
  |  |  ------------------
  ------------------
 8288|       |            /* exotic behaviors */
 8289|     42|            if (p->fast_array) {
  ------------------
  |  Branch (8289:17): [True: 26, False: 16]
  ------------------
 8290|     26|                if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (8290:21): [True: 2, False: 24]
  ------------------
 8291|      2|                    uint32_t idx = __JS_AtomToUInt32(prop);
 8292|      2|                    if (idx < p->u.array.count) {
  ------------------
  |  Branch (8292:25): [True: 0, False: 2]
  ------------------
 8293|       |                        /* we avoid duplicating the code */
 8294|      0|                        return JS_GetPropertyUint32(ctx, JS_MKPTR(JS_TAG_OBJECT, p), idx);
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8295|      2|                    } else if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (8295:32): [True: 0, False: 2]
  ------------------
 8296|      0|                               p->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (8296:32): [True: 0, False: 0]
  ------------------
 8297|      0|                        return JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8298|      0|                    }
 8299|     24|                } else if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (8299:28): [True: 0, False: 24]
  ------------------
 8300|      0|                           p->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (8300:28): [True: 0, False: 0]
  ------------------
 8301|      0|                    int ret;
 8302|      0|                    ret = JS_AtomIsNumericIndex(ctx, prop);
 8303|      0|                    if (ret != 0) {
  ------------------
  |  Branch (8303:25): [True: 0, False: 0]
  ------------------
 8304|      0|                        if (ret < 0)
  ------------------
  |  Branch (8304:29): [True: 0, False: 0]
  ------------------
 8305|      0|                            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8306|      0|                        return JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8307|      0|                    }
 8308|      0|                }
 8309|     26|            } else {
 8310|     16|                const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8311|     16|                if (em) {
  ------------------
  |  Branch (8311:21): [True: 0, False: 16]
  ------------------
 8312|      0|                    if (em->get_property) {
  ------------------
  |  Branch (8312:25): [True: 0, False: 0]
  ------------------
 8313|      0|                        JSValue obj1, retval;
 8314|       |                        /* XXX: should pass throw_ref_error */
 8315|       |                        /* Note: if 'p' is a prototype, it can be
 8316|       |                           freed in the called function */
 8317|      0|                        obj1 = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8318|      0|                        retval = em->get_property(ctx, obj1, prop, this_obj);
 8319|      0|                        JS_FreeValue(ctx, obj1);
 8320|      0|                        return retval;
 8321|      0|                    }
 8322|      0|                    if (em->get_own_property) {
  ------------------
  |  Branch (8322:25): [True: 0, False: 0]
  ------------------
 8323|      0|                        JSPropertyDescriptor desc;
 8324|      0|                        int ret;
 8325|      0|                        JSValue obj1;
 8326|       |
 8327|       |                        /* Note: if 'p' is a prototype, it can be
 8328|       |                           freed in the called function */
 8329|      0|                        obj1 = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8330|      0|                        ret = em->get_own_property(ctx, &desc, obj1, prop);
 8331|      0|                        JS_FreeValue(ctx, obj1);
 8332|      0|                        if (ret < 0)
  ------------------
  |  Branch (8332:29): [True: 0, False: 0]
  ------------------
 8333|      0|                            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8334|      0|                        if (ret) {
  ------------------
  |  Branch (8334:29): [True: 0, False: 0]
  ------------------
 8335|      0|                            if (desc.flags & JS_PROP_GETSET) {
  ------------------
  |  |  303|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (8335:33): [True: 0, False: 0]
  ------------------
 8336|      0|                                JS_FreeValue(ctx, desc.setter);
 8337|      0|                                return JS_CallFree(ctx, desc.getter, this_obj, 0, NULL);
 8338|      0|                            } else {
 8339|      0|                                return desc.value;
 8340|      0|                            }
 8341|      0|                        }
 8342|      0|                    }
 8343|      0|                }
 8344|     16|            }
 8345|     42|        }
 8346|  1.01M|        p = p->shape->proto;
 8347|  1.01M|        if (!p)
  ------------------
  |  Branch (8347:13): [True: 21, False: 1.01M]
  ------------------
 8348|     21|            break;
 8349|  1.01M|    }
 8350|     21|    if (unlikely(throw_ref_error)) {
  ------------------
  |  |   33|     21|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 9, False: 12]
  |  |  ------------------
  ------------------
 8351|      9|        return JS_ThrowReferenceErrorNotDefined(ctx, prop);
 8352|     12|    } else {
 8353|     12|        return JS_UNDEFINED;
  ------------------
  |  |  289|     12|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     12|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8354|     12|    }
 8355|     21|}
JS_FreePropertyEnum:
 8578|     18|{
 8579|     18|    uint32_t i;
 8580|     18|    if (tab) {
  ------------------
  |  Branch (8580:9): [True: 18, False: 0]
  ------------------
 8581|     46|        for(i = 0; i < len; i++)
  ------------------
  |  Branch (8581:20): [True: 28, False: 18]
  ------------------
 8582|     28|            JS_FreeAtom(ctx, tab[i].atom);
 8583|     18|        js_free(ctx, tab);
 8584|     18|    }
 8585|     18|}
JS_IsExtensible:
 8898|     28|{
 8899|     28|    JSObject *p;
 8900|       |
 8901|     28|    if (unlikely(JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT))
  ------------------
  |  |   33|     28|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 28]
  |  |  ------------------
  ------------------
 8902|      0|        return FALSE;
 8903|     28|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|     28|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     28|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8904|     28|    if (unlikely(p->is_exotic)) {
  ------------------
  |  |   33|     28|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 28, False: 0]
  |  |  ------------------
  ------------------
 8905|     28|        const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8906|     28|        if (em && em->is_extensible) {
  ------------------
  |  Branch (8906:13): [True: 28, False: 0]
  |  Branch (8906:19): [True: 0, False: 28]
  ------------------
 8907|      0|            return em->is_extensible(ctx, obj);
 8908|      0|        }
 8909|     28|    }
 8910|     28|    return p->extensible;
 8911|     28|}
JS_PreventExtensions:
 8915|     14|{
 8916|     14|    JSObject *p;
 8917|       |
 8918|     14|    if (unlikely(JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT))
  ------------------
  |  |   33|     14|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 14]
  |  |  ------------------
  ------------------
 8919|      0|        return FALSE;
 8920|     14|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|     14|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8921|     14|    if (unlikely(p->is_exotic)) {
  ------------------
  |  |   33|     14|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 14]
  |  |  ------------------
  ------------------
 8922|      0|        if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (8922:13): [True: 0, False: 0]
  ------------------
 8923|      0|            p->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (8923:13): [True: 0, False: 0]
  ------------------
 8924|      0|            JSTypedArray *ta;
 8925|      0|            JSArrayBuffer *abuf;
 8926|       |            /* resizable type arrays return FALSE */
 8927|      0|            ta = p->u.typed_array;
 8928|      0|            abuf = ta->buffer->u.array_buffer;
 8929|      0|            if (ta->track_rab ||
  ------------------
  |  Branch (8929:17): [True: 0, False: 0]
  ------------------
 8930|      0|                (array_buffer_is_resizable(abuf) && !abuf->shared))
  ------------------
  |  Branch (8930:18): [True: 0, False: 0]
  |  Branch (8930:53): [True: 0, False: 0]
  ------------------
 8931|      0|                return FALSE;
 8932|      0|        } else {
 8933|      0|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8934|      0|            if (em && em->prevent_extensions) {
  ------------------
  |  Branch (8934:17): [True: 0, False: 0]
  |  Branch (8934:23): [True: 0, False: 0]
  ------------------
 8935|      0|                return em->prevent_extensions(ctx, obj);
 8936|      0|            }
 8937|      0|        }
 8938|      0|    }
 8939|     14|    p->extensible = FALSE;
 8940|     14|    return TRUE;
 8941|     14|}
JS_HasProperty:
 8945|      2|{
 8946|      2|    JSObject *p;
 8947|      2|    int ret;
 8948|      2|    JSValue obj1;
 8949|       |
 8950|      2|    if (unlikely(JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 8951|      0|        return FALSE;
 8952|      2|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 8953|      4|    for(;;) {
 8954|      4|        if (p->is_exotic) {
  ------------------
  |  Branch (8954:13): [True: 0, False: 4]
  ------------------
 8955|      0|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8956|      0|            if (em && em->has_property) {
  ------------------
  |  Branch (8956:17): [True: 0, False: 0]
  |  Branch (8956:23): [True: 0, False: 0]
  ------------------
 8957|       |                /* has_property can free the prototype */
 8958|      0|                obj1 = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8959|      0|                ret = em->has_property(ctx, obj1, prop);
 8960|      0|                JS_FreeValue(ctx, obj1);
 8961|      0|                return ret;
 8962|      0|            }
 8963|      0|        }
 8964|       |        /* JS_GetOwnPropertyInternal can free the prototype */
 8965|      4|        JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  246|      4|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8966|      4|        ret = JS_GetOwnPropertyInternal(ctx, NULL, p, prop);
 8967|      4|        JS_FreeValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  246|      4|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8968|      4|        if (ret != 0)
  ------------------
  |  Branch (8968:13): [True: 0, False: 4]
  ------------------
 8969|      0|            return ret;
 8970|      4|        if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (8970:13): [True: 2, False: 2]
  ------------------
 8971|      2|            p->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (8971:13): [True: 0, False: 2]
  ------------------
 8972|      0|            ret = JS_AtomIsNumericIndex(ctx, prop);
 8973|      0|            if (ret != 0) {
  ------------------
  |  Branch (8973:17): [True: 0, False: 0]
  ------------------
 8974|      0|                if (ret < 0)
  ------------------
  |  Branch (8974:21): [True: 0, False: 0]
  ------------------
 8975|      0|                    return -1;
 8976|      0|                return FALSE;
 8977|      0|            }
 8978|      0|        }
 8979|      4|        p = p->shape->proto;
 8980|      4|        if (!p)
  ------------------
  |  Branch (8980:13): [True: 2, False: 2]
  ------------------
 8981|      2|            break;
 8982|      4|    }
 8983|      2|    return FALSE;
 8984|      2|}
JS_ValueToAtom:
 8995|   343k|{
 8996|   343k|    JSAtom atom;
 8997|   343k|    uint32_t tag;
 8998|   343k|    tag = JS_VALUE_GET_TAG(val);
  ------------------
  |  |  236|   343k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
 8999|   343k|    if (tag == JS_TAG_INT &&
  ------------------
  |  Branch (8999:9): [True: 343k, False: 28]
  ------------------
 9000|   343k|        (uint32_t)JS_VALUE_GET_INT(val) <= JS_ATOM_MAX_INT) {
  ------------------
  |  |  239|   343k|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
                      (uint32_t)JS_VALUE_GET_INT(val) <= JS_ATOM_MAX_INT) {
  ------------------
  |  | 2862|   343k|#define JS_ATOM_MAX_INT (JS_ATOM_TAG_INT - 1)
  |  |  ------------------
  |  |  |  | 2861|   343k|#define JS_ATOM_TAG_INT (1U << 31)
  |  |  ------------------
  ------------------
  |  Branch (9000:9): [True: 343k, False: 0]
  ------------------
 9001|       |        /* fast path for integer values */
 9002|   343k|        atom = __JS_AtomFromUInt32(JS_VALUE_GET_INT(val));
  ------------------
  |  |  239|   343k|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
 9003|   343k|    } else if (tag == JS_TAG_SYMBOL) {
  ------------------
  |  Branch (9003:16): [True: 0, False: 28]
  ------------------
 9004|      0|        JSAtomStruct *p = JS_VALUE_GET_PTR(val);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
 9005|      0|        atom = JS_DupAtom(ctx, js_get_atom_index(ctx->rt, p));
 9006|     28|    } else {
 9007|     28|        JSValue str;
 9008|     28|        str = JS_ToPropertyKey(ctx, val);
 9009|     28|        if (JS_IsException(str))
  ------------------
  |  Branch (9009:13): [True: 0, False: 28]
  ------------------
 9010|      0|            return JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
 9011|     28|        if (JS_VALUE_GET_TAG(str) == JS_TAG_SYMBOL) {
  ------------------
  |  |  236|     28|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (9011:13): [True: 0, False: 28]
  ------------------
 9012|      0|            atom = js_symbol_to_atom(ctx, str);
 9013|     28|        } else {
 9014|     28|            atom = JS_NewAtomStr(ctx, JS_VALUE_GET_STRING(str));
  ------------------
  |  |  228|     28|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     28|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9015|     28|        }
 9016|     28|    }
 9017|   343k|    return atom;
 9018|   343k|}
JS_GetPropertyUint32:
 9097|   343k|{
 9098|   343k|    return JS_GetPropertyValue(ctx, this_obj, JS_NewUint32(ctx, idx));
 9099|   343k|}
JS_SetPropertyInternal:
 9656|  1.01M|{
 9657|  1.01M|    JSObject *p, *p1;
 9658|  1.01M|    JSShapeProperty *prs;
 9659|  1.01M|    JSProperty *pr;
 9660|  1.01M|    uint32_t tag;
 9661|  1.01M|    JSPropertyDescriptor desc;
 9662|  1.01M|    int ret;
 9663|       |#if 0
 9664|       |    printf("JS_SetPropertyInternal: "); print_atom(ctx, prop); printf("\n");
 9665|       |#endif
 9666|  1.01M|    tag = JS_VALUE_GET_TAG(this_obj);
  ------------------
  |  |  236|  1.01M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
 9667|  1.01M|    if (unlikely(tag != JS_TAG_OBJECT)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.01M]
  |  |  ------------------
  ------------------
 9668|      0|        if (JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (9668:13): [True: 0, False: 0]
  ------------------
 9669|      0|            p = NULL;
 9670|      0|            p1 = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9671|      0|            goto prototype_lookup;
 9672|      0|        } else {
 9673|      0|            switch(tag) {
 9674|      0|            case JS_TAG_NULL:
  ------------------
  |  Branch (9674:13): [True: 0, False: 0]
  ------------------
 9675|      0|                JS_FreeValue(ctx, val);
 9676|      0|                JS_ThrowTypeErrorAtom(ctx, "cannot set property '%s' of null", prop);
  ------------------
  |  | 7722|      0|#define JS_ThrowTypeErrorAtom(ctx, fmt, atom) __JS_ThrowTypeErrorAtom(ctx, atom, fmt, "")
  ------------------
 9677|      0|                return -1;
 9678|      0|            case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (9678:13): [True: 0, False: 0]
  ------------------
 9679|      0|                JS_FreeValue(ctx, val);
 9680|      0|                JS_ThrowTypeErrorAtom(ctx, "cannot set property '%s' of undefined", prop);
  ------------------
  |  | 7722|      0|#define JS_ThrowTypeErrorAtom(ctx, fmt, atom) __JS_ThrowTypeErrorAtom(ctx, atom, fmt, "")
  ------------------
 9681|      0|                return -1;
 9682|      0|            default:
  ------------------
  |  Branch (9682:13): [True: 0, False: 0]
  ------------------
 9683|       |                /* even on a primitive type we can have setters on the prototype */
 9684|      0|                p = NULL;
 9685|      0|                p1 = JS_VALUE_GET_OBJ(JS_GetPrototypePrimitive(ctx, obj));
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9686|      0|                goto prototype_lookup;
 9687|      0|            }
 9688|      0|        }
 9689|  1.01M|    } else {
 9690|  1.01M|        p = JS_VALUE_GET_OBJ(this_obj);
  ------------------
  |  |  227|  1.01M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.01M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9691|  1.01M|        p1 = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|  1.01M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.01M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9692|  1.01M|        if (unlikely(p != p1))
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.01M]
  |  |  ------------------
  ------------------
 9693|      0|            goto retry2;
 9694|  1.01M|    }
 9695|       |
 9696|       |    /* fast path if obj == this_obj */
 9697|  1.01M| retry:
 9698|  1.01M|    prs = find_own_property(&pr, p1, prop);
 9699|  1.01M|    if (prs) {
  ------------------
  |  Branch (9699:9): [True: 1.00M, False: 126]
  ------------------
 9700|  1.00M|        if (likely((prs->flags & (JS_PROP_TMASK | JS_PROP_WRITABLE |
  ------------------
  |  |   32|  1.00M|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 1.00M, False: 0]
  |  |  ------------------
  ------------------
 9701|  1.00M|                                  JS_PROP_LENGTH)) == JS_PROP_WRITABLE)) {
 9702|       |            /* fast case */
 9703|  1.00M|            set_value(ctx, &pr->u.value, val);
 9704|  1.00M|            return TRUE;
 9705|  1.00M|        } else if (prs->flags & JS_PROP_LENGTH) {
  ------------------
  |  |  300|      0|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
  |  Branch (9705:20): [True: 0, False: 0]
  ------------------
 9706|      0|            assert(p->class_id == JS_CLASS_ARRAY);
  ------------------
  |  Branch (9706:13): [True: 0, False: 0]
  |  Branch (9706:13): [True: 0, False: 0]
  ------------------
 9707|      0|            assert(prop == JS_ATOM_length);
  ------------------
  |  Branch (9707:13): [True: 0, False: 0]
  |  Branch (9707:13): [True: 0, False: 0]
  ------------------
 9708|      0|            return set_array_length(ctx, p, val, flags);
 9709|      0|        } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  301|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (9709:20): [True: 0, False: 0]
  ------------------
 9710|      0|            return call_setter(ctx, pr->u.getset.setter, this_obj, val, flags);
 9711|      0|        } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  301|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  304|      0|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (9711:20): [True: 0, False: 0]
  ------------------
 9712|       |            /* XXX: already use var_ref->is_const. Cannot simplify use the
 9713|       |               writable flag for JS_CLASS_MODULE_NS. */
 9714|      0|            if (p->class_id == JS_CLASS_MODULE_NS || pr->u.var_ref->is_const)
  ------------------
  |  Branch (9714:17): [True: 0, False: 0]
  |  Branch (9714:54): [True: 0, False: 0]
  ------------------
 9715|      0|                goto read_only_prop;
 9716|      0|            set_value(ctx, pr->u.var_ref->pvalue, val);
 9717|      0|            return TRUE;
 9718|      0|        } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  301|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  305|      0|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (9718:20): [True: 0, False: 0]
  ------------------
 9719|       |            /* Instantiate property and retry (potentially useless) */
 9720|      0|            if (JS_AutoInitProperty(ctx, p, prop, pr, prs)) {
  ------------------
  |  Branch (9720:17): [True: 0, False: 0]
  ------------------
 9721|      0|                JS_FreeValue(ctx, val);
 9722|      0|                return -1;
 9723|      0|            }
 9724|      0|            goto retry;
 9725|      0|        } else {
 9726|      0|            goto read_only_prop;
 9727|      0|        }
 9728|  1.00M|    }
 9729|       |
 9730|    252|    for(;;) {
 9731|    252|        if (p1->is_exotic) {
  ------------------
  |  Branch (9731:13): [True: 0, False: 252]
  ------------------
 9732|      0|            if (p1->fast_array) {
  ------------------
  |  Branch (9732:17): [True: 0, False: 0]
  ------------------
 9733|      0|                if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (9733:21): [True: 0, False: 0]
  ------------------
 9734|      0|                    uint32_t idx = __JS_AtomToUInt32(prop);
 9735|      0|                    if (idx < p1->u.array.count) {
  ------------------
  |  Branch (9735:25): [True: 0, False: 0]
  ------------------
 9736|      0|                        if (unlikely(p == p1))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9737|      0|                            return JS_SetPropertyValue(ctx, this_obj, JS_NewInt32(ctx, idx), val, flags);
 9738|      0|                        else
 9739|      0|                            break;
 9740|      0|                    } else if (p1->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (9740:32): [True: 0, False: 0]
  ------------------
 9741|      0|                               p1->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (9741:32): [True: 0, False: 0]
  ------------------
 9742|      0|                        goto typed_array_oob;
 9743|      0|                    }
 9744|      0|                } else if (p1->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (9744:28): [True: 0, False: 0]
  ------------------
 9745|      0|                           p1->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (9745:28): [True: 0, False: 0]
  ------------------
 9746|      0|                    ret = JS_AtomIsNumericIndex(ctx, prop);
 9747|      0|                    if (ret != 0) {
  ------------------
  |  Branch (9747:25): [True: 0, False: 0]
  ------------------
 9748|      0|                        if (ret < 0) {
  ------------------
  |  Branch (9748:29): [True: 0, False: 0]
  ------------------
 9749|      0|                            JS_FreeValue(ctx, val);
 9750|      0|                            return -1;
 9751|      0|                        }
 9752|      0|                    typed_array_oob:
 9753|      0|                        if (p == p1) {
  ------------------
  |  Branch (9753:29): [True: 0, False: 0]
  ------------------
 9754|       |                            /* must convert the argument even if out of bound access */
 9755|      0|                            if (p1->class_id == JS_CLASS_BIG_INT64_ARRAY ||
  ------------------
  |  Branch (9755:33): [True: 0, False: 0]
  ------------------
 9756|      0|                                p1->class_id == JS_CLASS_BIG_UINT64_ARRAY) {
  ------------------
  |  Branch (9756:33): [True: 0, False: 0]
  ------------------
 9757|      0|                                int64_t v;
 9758|      0|                                if (JS_ToBigInt64Free(ctx, &v, val))
  ------------------
  |  Branch (9758:37): [True: 0, False: 0]
  ------------------
 9759|      0|                                    return -1;
 9760|      0|                            } else {
 9761|      0|                                val = JS_ToNumberFree(ctx, val);
 9762|      0|                                JS_FreeValue(ctx, val);
 9763|      0|                                if (JS_IsException(val))
  ------------------
  |  Branch (9763:37): [True: 0, False: 0]
  ------------------
 9764|      0|                                    return -1;
 9765|      0|                            }
 9766|      0|                        } else {
 9767|      0|                            JS_FreeValue(ctx, val);
 9768|      0|                        }
 9769|      0|                        return TRUE;
 9770|      0|                    }
 9771|      0|                }
 9772|      0|            } else {
 9773|      0|                const JSClassExoticMethods *em = ctx->rt->class_array[p1->class_id].exotic;
 9774|      0|                if (em) {
  ------------------
  |  Branch (9774:21): [True: 0, False: 0]
  ------------------
 9775|      0|                    JSValue obj1;
 9776|      0|                    if (em->set_property) {
  ------------------
  |  Branch (9776:25): [True: 0, False: 0]
  ------------------
 9777|       |                        /* set_property can free the prototype */
 9778|      0|                        obj1 = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p1));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 9779|      0|                        ret = em->set_property(ctx, obj1, prop,
 9780|      0|                                               val, this_obj, flags);
 9781|      0|                        JS_FreeValue(ctx, obj1);
 9782|      0|                        JS_FreeValue(ctx, val);
 9783|      0|                        return ret;
 9784|      0|                    }
 9785|      0|                    if (em->get_own_property) {
  ------------------
  |  Branch (9785:25): [True: 0, False: 0]
  ------------------
 9786|       |                        /* get_own_property can free the prototype */
 9787|      0|                        obj1 = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p1));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 9788|      0|                        ret = em->get_own_property(ctx, &desc,
 9789|      0|                                                   obj1, prop);
 9790|      0|                        JS_FreeValue(ctx, obj1);
 9791|      0|                        if (ret < 0) {
  ------------------
  |  Branch (9791:29): [True: 0, False: 0]
  ------------------
 9792|      0|                            JS_FreeValue(ctx, val);
 9793|      0|                            return ret;
 9794|      0|                        }
 9795|      0|                        if (ret) {
  ------------------
  |  Branch (9795:29): [True: 0, False: 0]
  ------------------
 9796|      0|                            if (desc.flags & JS_PROP_GETSET) {
  ------------------
  |  |  303|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (9796:33): [True: 0, False: 0]
  ------------------
 9797|      0|                                JSObject *setter;
 9798|      0|                                if (JS_IsUndefined(desc.setter))
  ------------------
  |  Branch (9798:37): [True: 0, False: 0]
  ------------------
 9799|      0|                                    setter = NULL;
 9800|      0|                                else
 9801|      0|                                    setter = JS_VALUE_GET_OBJ(desc.setter);
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9802|      0|                                ret = call_setter(ctx, setter, this_obj, val, flags);
 9803|      0|                                JS_FreeValue(ctx, desc.getter);
 9804|      0|                                JS_FreeValue(ctx, desc.setter);
 9805|      0|                                return ret;
 9806|      0|                            } else {
 9807|      0|                                JS_FreeValue(ctx, desc.value);
 9808|      0|                                if (!(desc.flags & JS_PROP_WRITABLE))
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (9808:37): [True: 0, False: 0]
  ------------------
 9809|      0|                                    goto read_only_prop;
 9810|      0|                                if (likely(p == p1)) {
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9811|      0|                                    ret = JS_DefineProperty(ctx, this_obj, prop, val,
 9812|      0|                                                            JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
                                                                          JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 9813|      0|                                                            JS_PROP_HAS_VALUE);
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
 9814|      0|                                    JS_FreeValue(ctx, val);
 9815|      0|                                    return ret;
 9816|      0|                                } else {
 9817|      0|                                    break;
 9818|      0|                                }
 9819|      0|                            }
 9820|      0|                        }
 9821|      0|                    }
 9822|      0|                }
 9823|      0|            }
 9824|      0|        }
 9825|    252|        p1 = p1->shape->proto;
 9826|    252|    prototype_lookup:
 9827|    252|        if (!p1)
  ------------------
  |  Branch (9827:13): [True: 126, False: 126]
  ------------------
 9828|    126|            break;
 9829|       |
 9830|    126|    retry2:
 9831|    126|        prs = find_own_property(&pr, p1, prop);
 9832|    126|        if (prs) {
  ------------------
  |  Branch (9832:13): [True: 0, False: 126]
  ------------------
 9833|      0|            if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  301|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                          if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (9833:17): [True: 0, False: 0]
  ------------------
 9834|      0|                return call_setter(ctx, pr->u.getset.setter, this_obj, val, flags);
 9835|      0|            } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  301|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                          } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  305|      0|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (9835:24): [True: 0, False: 0]
  ------------------
 9836|       |                /* Instantiate property and retry (potentially useless) */
 9837|      0|                if (JS_AutoInitProperty(ctx, p1, prop, pr, prs))
  ------------------
  |  Branch (9837:21): [True: 0, False: 0]
  ------------------
 9838|      0|                    return -1;
 9839|      0|                goto retry2;
 9840|      0|            } else if (!(prs->flags & JS_PROP_WRITABLE)) {
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (9840:24): [True: 0, False: 0]
  ------------------
 9841|      0|                goto read_only_prop;
 9842|      0|            } else {
 9843|      0|                break;
 9844|      0|            }
 9845|      0|        }
 9846|    126|    }
 9847|       |
 9848|    126|    if (unlikely(!p)) {
  ------------------
  |  |   33|    126|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 126]
  |  |  ------------------
  ------------------
 9849|      0|        JS_FreeValue(ctx, val);
 9850|      0|        return JS_ThrowTypeErrorOrFalse(ctx, flags, "not an object");
 9851|      0|    }
 9852|       |
 9853|    126|    if (unlikely(!p->extensible)) {
  ------------------
  |  |   33|    126|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 126]
  |  |  ------------------
  ------------------
 9854|      0|        JS_FreeValue(ctx, val);
 9855|      0|        return JS_ThrowTypeErrorOrFalse(ctx, flags, "object is not extensible");
 9856|      0|    }
 9857|       |
 9858|    126|    if (likely(p == JS_VALUE_GET_OBJ(obj))) {
  ------------------
  |  |   32|    126|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 126, False: 0]
  |  |  ------------------
  ------------------
 9859|    126|        if (p->is_exotic) {
  ------------------
  |  Branch (9859:13): [True: 0, False: 126]
  ------------------
 9860|      0|            if (p->class_id == JS_CLASS_ARRAY && p->fast_array &&
  ------------------
  |  Branch (9860:17): [True: 0, False: 0]
  |  Branch (9860:50): [True: 0, False: 0]
  ------------------
 9861|      0|                __JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (9861:17): [True: 0, False: 0]
  ------------------
 9862|      0|                uint32_t idx = __JS_AtomToUInt32(prop);
 9863|      0|                if (idx == p->u.array.count) {
  ------------------
  |  Branch (9863:21): [True: 0, False: 0]
  ------------------
 9864|       |                    /* fast case */
 9865|      0|                    return add_fast_array_element(ctx, p, val, flags);
 9866|      0|                } else {
 9867|      0|                    goto generic_create_prop;
 9868|      0|                }
 9869|      0|            } else {
 9870|      0|                goto generic_create_prop;
 9871|      0|            }
 9872|    126|        } else {
 9873|    126|            if (unlikely(p->class_id == JS_CLASS_GLOBAL_OBJECT))
  ------------------
  |  |   33|    126|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 98, False: 28]
  |  |  ------------------
  ------------------
 9874|     98|                goto generic_create_prop;
 9875|     28|            pr = add_property(ctx, p, prop, JS_PROP_C_W_E);
  ------------------
  |  |  299|     28|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|     28|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|     28|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     28|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
 9876|     28|            if (unlikely(!pr)) {
  ------------------
  |  |   33|     28|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 28]
  |  |  ------------------
  ------------------
 9877|      0|                JS_FreeValue(ctx, val);
 9878|      0|                return -1;
 9879|      0|            }
 9880|     28|            pr->u.value = val;
 9881|     28|            return TRUE;
 9882|     28|        }
 9883|    126|    } else {
 9884|       |        /* generic case: modify the property in this_obj if it already exists */
 9885|      0|        ret = JS_GetOwnPropertyInternal(ctx, &desc, p, prop);
 9886|      0|        if (ret < 0) {
  ------------------
  |  Branch (9886:13): [True: 0, False: 0]
  ------------------
 9887|      0|            JS_FreeValue(ctx, val);
 9888|      0|            return ret;
 9889|      0|        }
 9890|      0|        if (ret) {
  ------------------
  |  Branch (9890:13): [True: 0, False: 0]
  ------------------
 9891|      0|            if (desc.flags & JS_PROP_GETSET) {
  ------------------
  |  |  303|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (9891:17): [True: 0, False: 0]
  ------------------
 9892|      0|                JS_FreeValue(ctx, desc.getter);
 9893|      0|                JS_FreeValue(ctx, desc.setter);
 9894|      0|                JS_FreeValue(ctx, val);
 9895|      0|                return JS_ThrowTypeErrorOrFalse(ctx, flags, "setter is forbidden");
 9896|      0|            } else {
 9897|      0|                JS_FreeValue(ctx, desc.value);
 9898|      0|                if (!(desc.flags & JS_PROP_WRITABLE) ||
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (9898:21): [True: 0, False: 0]
  ------------------
 9899|      0|                    p->class_id == JS_CLASS_MODULE_NS) {
  ------------------
  |  Branch (9899:21): [True: 0, False: 0]
  ------------------
 9900|      0|                read_only_prop:
 9901|      0|                    JS_FreeValue(ctx, val);
 9902|      0|                    return JS_ThrowTypeErrorReadOnly(ctx, flags, prop);
 9903|      0|                }
 9904|      0|            }
 9905|      0|            ret = JS_DefineProperty(ctx, this_obj, prop, val,
 9906|      0|                                    JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
                                                  JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 9907|      0|                                    JS_PROP_HAS_VALUE);
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
 9908|      0|            JS_FreeValue(ctx, val);
 9909|      0|            return ret;
 9910|      0|        } else {
 9911|     98|        generic_create_prop:
 9912|     98|            ret = JS_CreateProperty(ctx, p, prop, val, JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  289|     98|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     98|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
                          ret = JS_CreateProperty(ctx, p, prop, val, JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  289|     98|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     98|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 9913|     98|                                    flags |
 9914|     98|                                    JS_PROP_HAS_VALUE |
  ------------------
  |  |  314|     98|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
 9915|     98|                                    JS_PROP_HAS_ENUMERABLE |
  ------------------
  |  |  311|     98|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
 9916|     98|                                    JS_PROP_HAS_WRITABLE |
  ------------------
  |  |  310|     98|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
 9917|     98|                                    JS_PROP_HAS_CONFIGURABLE |
  ------------------
  |  |  309|     98|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
 9918|     98|                                    JS_PROP_C_W_E);
  ------------------
  |  |  299|     98|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|     98|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|     98|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     98|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
 9919|     98|            JS_FreeValue(ctx, val);
 9920|     98|            return ret;
 9921|      0|        }
 9922|      0|    }
 9923|    126|}
JS_SetPropertyStr:
10093|     98|{
10094|     98|    JSAtom atom;
10095|     98|    int ret;
10096|     98|    atom = JS_NewAtom(ctx, prop);
10097|     98|    if (atom == JS_ATOM_NULL) {
  ------------------
  |  |  449|     98|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (10097:9): [True: 0, False: 98]
  ------------------
10098|      0|        JS_FreeValue(ctx, val);
10099|      0|        return -1;
10100|      0|    }
10101|     98|    ret = JS_SetPropertyInternal(ctx, this_obj, atom, val, this_obj, JS_PROP_THROW);
  ------------------
  |  |  318|     98|#define JS_PROP_THROW            (1 << 14)
  ------------------
10102|     98|    JS_FreeAtom(ctx, atom);
10103|     98|    return ret;
10104|     98|}
JS_DefineProperty:
10344|   351k|{
10345|   351k|    JSObject *p;
10346|   351k|    JSShapeProperty *prs;
10347|   351k|    JSProperty *pr;
10348|   351k|    int mask, res;
10349|       |
10350|   351k|    if (JS_VALUE_GET_TAG(this_obj) != JS_TAG_OBJECT) {
  ------------------
  |  |  236|   351k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10350:9): [True: 0, False: 351k]
  ------------------
10351|      0|        JS_ThrowTypeErrorNotAnObject(ctx);
10352|      0|        return -1;
10353|      0|    }
10354|   351k|    p = JS_VALUE_GET_OBJ(this_obj);
  ------------------
  |  |  227|   351k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|   351k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10355|       |
10356|   351k| redo_prop_update:
10357|   351k|    prs = find_own_property(&pr, p, prop);
10358|   351k|    if (prs) {
  ------------------
  |  Branch (10358:9): [True: 44, False: 351k]
  ------------------
10359|       |        /* the range of the Array length property is always tested before */
10360|     44|        if ((prs->flags & JS_PROP_LENGTH) && (flags & JS_PROP_HAS_VALUE)) {
  ------------------
  |  |  300|     44|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
                      if ((prs->flags & JS_PROP_LENGTH) && (flags & JS_PROP_HAS_VALUE)) {
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10360:13): [True: 0, False: 44]
  |  Branch (10360:46): [True: 0, False: 0]
  ------------------
10361|      0|            uint32_t array_length;
10362|      0|            if (JS_ToArrayLengthFree(ctx, &array_length,
  ------------------
  |  Branch (10362:17): [True: 0, False: 0]
  ------------------
10363|      0|                                     JS_DupValue(ctx, val), FALSE)) {
10364|      0|                return -1;
10365|      0|            }
10366|       |            /* this code relies on the fact that Uint32 are never allocated */
10367|      0|            val = (JSValueConst)JS_NewUint32(ctx, array_length);
10368|       |            /* prs may have been modified */
10369|      0|            prs = find_own_property(&pr, p, prop);
10370|      0|            assert(prs != NULL);
  ------------------
  |  Branch (10370:13): [True: 0, False: 0]
  |  Branch (10370:13): [True: 0, False: 0]
  ------------------
10371|      0|        }
10372|       |        /* property already exists */
10373|     44|        if (!check_define_prop_flags(prs->flags, flags)) {
  ------------------
  |  Branch (10373:13): [True: 0, False: 44]
  ------------------
10374|      0|        not_configurable:
10375|      0|            return JS_ThrowTypeErrorOrFalse(ctx, flags, "property is not configurable");
10376|      0|        }
10377|       |
10378|     44|        if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  301|     44|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  305|     44|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (10378:13): [True: 0, False: 44]
  ------------------
10379|       |            /* Instantiate property and retry */
10380|      0|            if (JS_AutoInitProperty(ctx, p, prop, pr, prs))
  ------------------
  |  Branch (10380:17): [True: 0, False: 0]
  ------------------
10381|      0|                return -1;
10382|      0|            goto redo_prop_update;
10383|      0|        }
10384|       |
10385|     44|        if (flags & (JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE |
  ------------------
  |  |  314|     44|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
                      if (flags & (JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE |
  ------------------
  |  |  310|     44|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
  |  Branch (10385:13): [True: 16, False: 28]
  ------------------
10386|     44|                     JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  312|     44|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                   JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  313|     44|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
10387|     16|            if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  312|     16|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                          if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  313|     16|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10387:17): [True: 14, False: 2]
  ------------------
10388|     14|                JSObject *new_getter, *new_setter;
10389|       |
10390|     14|                if (JS_IsFunction(ctx, getter)) {
  ------------------
  |  Branch (10390:21): [True: 14, False: 0]
  ------------------
10391|     14|                    new_getter = JS_VALUE_GET_OBJ(getter);
  ------------------
  |  |  227|     14|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10392|     14|                } else {
10393|      0|                    new_getter = NULL;
10394|      0|                }
10395|     14|                if (JS_IsFunction(ctx, setter)) {
  ------------------
  |  Branch (10395:21): [True: 14, False: 0]
  ------------------
10396|     14|                    new_setter = JS_VALUE_GET_OBJ(setter);
  ------------------
  |  |  227|     14|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10397|     14|                } else {
10398|      0|                    new_setter = NULL;
10399|      0|                }
10400|       |
10401|     14|                if ((prs->flags & JS_PROP_TMASK) != JS_PROP_GETSET) {
  ------------------
  |  |  301|     14|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              if ((prs->flags & JS_PROP_TMASK) != JS_PROP_GETSET) {
  ------------------
  |  |  303|     14|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (10401:21): [True: 14, False: 0]
  ------------------
10402|     14|                    if (js_shape_prepare_update(ctx, p, &prs))
  ------------------
  |  Branch (10402:25): [True: 0, False: 14]
  ------------------
10403|      0|                        return -1;
10404|       |                    /* convert to getset */
10405|     14|                    if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  301|     14|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                  if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  304|     14|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (10405:25): [True: 0, False: 14]
  ------------------
10406|      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]
  |  |  ------------------
  ------------------
10407|      0|                            if (remove_global_object_property(ctx, p, prs, pr))
  ------------------
  |  Branch (10407:33): [True: 0, False: 0]
  ------------------
10408|      0|                                return -1;
10409|      0|                        }
10410|      0|                        free_var_ref(ctx->rt, pr->u.var_ref);
10411|     14|                    } else {
10412|     14|                        JS_FreeValue(ctx, pr->u.value);
10413|     14|                    }
10414|     14|                    prs->flags = (prs->flags &
10415|     14|                                  (JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE)) |
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                                (JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE)) |
  ------------------
  |  |  298|     14|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
10416|     14|                        JS_PROP_GETSET;
  ------------------
  |  |  303|     14|#define JS_PROP_GETSET         (1 << 4)
  ------------------
10417|     14|                    pr->u.getset.getter = NULL;
10418|     14|                    pr->u.getset.setter = NULL;
10419|     14|                } else {
10420|      0|                    if (!(prs->flags & JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
  |  Branch (10420:25): [True: 0, False: 0]
  ------------------
10421|      0|                        if ((flags & JS_PROP_HAS_GET) &&
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
  |  Branch (10421:29): [True: 0, False: 0]
  ------------------
10422|      0|                            new_getter != pr->u.getset.getter) {
  ------------------
  |  Branch (10422:29): [True: 0, False: 0]
  ------------------
10423|      0|                            goto not_configurable;
10424|      0|                        }
10425|      0|                        if ((flags & JS_PROP_HAS_SET) &&
  ------------------
  |  |  313|      0|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10425:29): [True: 0, False: 0]
  ------------------
10426|      0|                            new_setter != pr->u.getset.setter) {
  ------------------
  |  Branch (10426:29): [True: 0, False: 0]
  ------------------
10427|      0|                            goto not_configurable;
10428|      0|                        }
10429|      0|                    }
10430|      0|                }
10431|     14|                if (flags & JS_PROP_HAS_GET) {
  ------------------
  |  |  312|     14|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
  |  Branch (10431:21): [True: 14, False: 0]
  ------------------
10432|     14|                    if (pr->u.getset.getter)
  ------------------
  |  Branch (10432:25): [True: 0, False: 14]
  ------------------
10433|      0|                        JS_FreeValue(ctx, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.getter));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
10434|     14|                    if (new_getter)
  ------------------
  |  Branch (10434:25): [True: 14, False: 0]
  ------------------
10435|     14|                        JS_DupValue(ctx, getter);
10436|     14|                    pr->u.getset.getter = new_getter;
10437|     14|                }
10438|     14|                if (flags & JS_PROP_HAS_SET) {
  ------------------
  |  |  313|     14|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10438:21): [True: 14, False: 0]
  ------------------
10439|     14|                    if (pr->u.getset.setter)
  ------------------
  |  Branch (10439:25): [True: 0, False: 14]
  ------------------
10440|      0|                        JS_FreeValue(ctx, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.setter));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
10441|     14|                    if (new_setter)
  ------------------
  |  Branch (10441:25): [True: 14, False: 0]
  ------------------
10442|     14|                        JS_DupValue(ctx, setter);
10443|     14|                    pr->u.getset.setter = new_setter;
10444|     14|                }
10445|     14|            } else {
10446|      2|                if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  301|      2|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|      2|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (10446:21): [True: 0, False: 2]
  ------------------
10447|       |                    /* convert to data descriptor */
10448|      0|                    JSVarRef *var_ref;
10449|      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]
  |  |  ------------------
  ------------------
10450|      0|                        var_ref = js_global_object_find_uninitialized_var(ctx, p, prop, FALSE);
10451|      0|                        if (!var_ref)
  ------------------
  |  Branch (10451:29): [True: 0, False: 0]
  ------------------
10452|      0|                            return -1;
10453|      0|                    } else {
10454|      0|                        var_ref = NULL;
10455|      0|                    }
10456|      0|                    if (js_shape_prepare_update(ctx, p, &prs)) {
  ------------------
  |  Branch (10456:25): [True: 0, False: 0]
  ------------------
10457|      0|                        if (var_ref)
  ------------------
  |  Branch (10457:29): [True: 0, False: 0]
  ------------------
10458|      0|                            free_var_ref(ctx->rt, var_ref);
10459|      0|                        return -1;
10460|      0|                    }
10461|      0|                    if (pr->u.getset.getter)
  ------------------
  |  Branch (10461:25): [True: 0, False: 0]
  ------------------
10462|      0|                        JS_FreeValue(ctx, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.getter));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
10463|      0|                    if (pr->u.getset.setter)
  ------------------
  |  Branch (10463:25): [True: 0, False: 0]
  ------------------
10464|      0|                        JS_FreeValue(ctx, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.setter));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
10465|      0|                    if (var_ref) {
  ------------------
  |  Branch (10465:25): [True: 0, False: 0]
  ------------------
10466|      0|                        prs->flags = (prs->flags & ~JS_PROP_TMASK) |
  ------------------
  |  |  301|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
10467|      0|                            JS_PROP_VARREF | JS_PROP_WRITABLE;
  ------------------
  |  |  304|      0|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
                                          JS_PROP_VARREF | JS_PROP_WRITABLE;
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10468|      0|                        pr->u.var_ref = var_ref;
10469|      0|                    } else {
10470|      0|                        prs->flags &= ~(JS_PROP_TMASK | JS_PROP_WRITABLE);
  ------------------
  |  |  301|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                      prs->flags &= ~(JS_PROP_TMASK | JS_PROP_WRITABLE);
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10471|      0|                        pr->u.value = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
10472|      0|                    }
10473|      2|                } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  301|      2|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  304|      2|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (10473:28): [True: 0, False: 2]
  ------------------
10474|       |                    /* Note: JS_PROP_VARREF is always writable */
10475|      2|                } else {
10476|      2|                    if ((prs->flags & (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE)) == 0 &&
  ------------------
  |  |  296|      2|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                  if ((prs->flags & (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE)) == 0 &&
  ------------------
  |  |  297|      2|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (10476:25): [True: 0, False: 2]
  ------------------
10477|      0|                        (flags & JS_PROP_HAS_VALUE)) {
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10477:25): [True: 0, False: 0]
  ------------------
10478|      0|                        if (!js_same_value(ctx, val, pr->u.value)) {
  ------------------
  |  Branch (10478:29): [True: 0, False: 0]
  ------------------
10479|      0|                            goto not_configurable;
10480|      0|                        } else {
10481|      0|                            return TRUE;
10482|      0|                        }
10483|      0|                    }
10484|      2|                }
10485|      2|                if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  301|      2|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  304|      2|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (10485:21): [True: 0, False: 2]
  ------------------
10486|      0|                    if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10486:25): [True: 0, False: 0]
  ------------------
10487|      0|                        if (p->class_id == JS_CLASS_MODULE_NS) {
  ------------------
  |  Branch (10487:29): [True: 0, False: 0]
  ------------------
10488|       |                            /* JS_PROP_WRITABLE is always true for variable
10489|       |                               references, but they are write protected in module name
10490|       |                               spaces. */
10491|      0|                            if (!js_same_value(ctx, val, *pr->u.var_ref->pvalue))
  ------------------
  |  Branch (10491:33): [True: 0, False: 0]
  ------------------
10492|      0|                                goto not_configurable;
10493|      0|                        } else {
10494|       |                            /* update the reference */
10495|      0|                            set_value(ctx, pr->u.var_ref->pvalue,
10496|      0|                                      JS_DupValue(ctx, val));
10497|      0|                        }
10498|      0|                    }
10499|      0|                    if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) == JS_PROP_HAS_WRITABLE) {
  ------------------
  |  |  310|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
                                  if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) == JS_PROP_HAS_WRITABLE) {
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                  if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) == JS_PROP_HAS_WRITABLE) {
  ------------------
  |  |  310|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
  |  Branch (10499:25): [True: 0, False: 0]
  ------------------
10500|      0|                        JSValue val1;
10501|      0|                        if (p->class_id == JS_CLASS_MODULE_NS) {
  ------------------
  |  Branch (10501:29): [True: 0, False: 0]
  ------------------
10502|      0|                            return JS_ThrowTypeErrorOrFalse(ctx, flags, "module namespace properties have writable = false");
10503|      0|                        }
10504|      0|                        if (js_shape_prepare_update(ctx, p, &prs))
  ------------------
  |  Branch (10504:29): [True: 0, False: 0]
  ------------------
10505|      0|                            return -1;
10506|      0|                        if (p->class_id == JS_CLASS_GLOBAL_OBJECT) {
  ------------------
  |  Branch (10506:29): [True: 0, False: 0]
  ------------------
10507|      0|                            pr->u.var_ref->is_const = TRUE; /* mark as read-only */
10508|      0|                            prs->flags &= ~JS_PROP_WRITABLE;
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10509|      0|                        } else {
10510|       |                            /* if writable is set to false, no longer a
10511|       |                               reference (for mapped arguments) */
10512|      0|                            val1 = JS_DupValue(ctx, *pr->u.var_ref->pvalue);
10513|      0|                            free_var_ref(ctx->rt, pr->u.var_ref);
10514|      0|                            pr->u.value = val1;
10515|      0|                            prs->flags &= ~(JS_PROP_TMASK | JS_PROP_WRITABLE);
  ------------------
  |  |  301|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                          prs->flags &= ~(JS_PROP_TMASK | JS_PROP_WRITABLE);
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10516|      0|                        }
10517|      0|                    }
10518|      2|                } else if (prs->flags & JS_PROP_LENGTH) {
  ------------------
  |  |  300|      2|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
  |  Branch (10518:28): [True: 0, False: 2]
  ------------------
10519|      0|                    if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10519:25): [True: 0, False: 0]
  ------------------
10520|       |                        /* Note: no JS code is executable because
10521|       |                           'val' is guaranted to be a Uint32 */
10522|      0|                        res = set_array_length(ctx, p, JS_DupValue(ctx, val),
10523|      0|                                               flags);
10524|      0|                    } else {
10525|      0|                        res = TRUE;
10526|      0|                    }
10527|       |                    /* still need to reset the writable flag if
10528|       |                       needed.  The JS_PROP_LENGTH is kept because the
10529|       |                       Uint32 test is still done if the length
10530|       |                       property is read-only. */
10531|      0|                    if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) ==
  ------------------
  |  |  310|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
                                  if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) ==
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (10531:25): [True: 0, False: 0]
  ------------------
10532|      0|                        JS_PROP_HAS_WRITABLE) {
  ------------------
  |  |  310|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
10533|      0|                        prs = get_shape_prop(p->shape);
10534|      0|                        if (js_update_property_flags(ctx, p, &prs,
  ------------------
  |  Branch (10534:29): [True: 0, False: 0]
  ------------------
10535|      0|                                                     prs->flags & ~JS_PROP_WRITABLE))
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10536|      0|                            return -1;
10537|      0|                    }
10538|      0|                    return res;
10539|      2|                } else {
10540|      2|                    if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  314|      2|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10540:25): [True: 2, False: 0]
  ------------------
10541|      2|                        JS_FreeValue(ctx, pr->u.value);
10542|      2|                        pr->u.value = JS_DupValue(ctx, val);
10543|      2|                    }
10544|      2|                    if (flags & JS_PROP_HAS_WRITABLE) {
  ------------------
  |  |  310|      2|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
  |  Branch (10544:25): [True: 2, False: 0]
  ------------------
10545|      2|                        if (js_update_property_flags(ctx, p, &prs,
  ------------------
  |  Branch (10545:29): [True: 0, False: 2]
  ------------------
10546|      2|                                                     (prs->flags & ~JS_PROP_WRITABLE) |
  ------------------
  |  |  297|      2|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10547|      2|                                                     (flags & JS_PROP_WRITABLE)))
  ------------------
  |  |  297|      2|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10548|      0|                            return -1;
10549|      2|                    }
10550|      2|                }
10551|      2|            }
10552|     16|        }
10553|     44|        mask = 0;
10554|     44|        if (flags & JS_PROP_HAS_CONFIGURABLE)
  ------------------
  |  |  309|     44|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
  |  Branch (10554:13): [True: 30, False: 14]
  ------------------
10555|     30|            mask |= JS_PROP_CONFIGURABLE;
  ------------------
  |  |  296|     30|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
10556|     44|        if (flags & JS_PROP_HAS_ENUMERABLE)
  ------------------
  |  |  311|     44|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
  |  Branch (10556:13): [True: 2, False: 42]
  ------------------
10557|      2|            mask |= JS_PROP_ENUMERABLE;
  ------------------
  |  |  298|      2|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
10558|     44|        if (js_update_property_flags(ctx, p, &prs,
  ------------------
  |  Branch (10558:13): [True: 0, False: 44]
  ------------------
10559|     44|                                     (prs->flags & ~mask) | (flags & mask)))
10560|      0|            return -1;
10561|     44|        return TRUE;
10562|     44|    }
10563|       |
10564|       |    /* handle modification of fast array elements */
10565|   351k|    if (p->fast_array) {
  ------------------
  |  Branch (10565:9): [True: 343k, False: 8.45k]
  ------------------
10566|   343k|        uint32_t idx;
10567|   343k|        uint32_t prop_flags;
10568|   343k|        if (p->class_id == JS_CLASS_ARRAY) {
  ------------------
  |  Branch (10568:13): [True: 343k, False: 0]
  ------------------
10569|   343k|            if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (10569:17): [True: 343k, False: 34]
  ------------------
10570|   343k|                idx = __JS_AtomToUInt32(prop);
10571|   343k|                if (idx < p->u.array.count) {
  ------------------
  |  Branch (10571:21): [True: 0, False: 343k]
  ------------------
10572|      0|                    prop_flags = get_prop_flags(flags, JS_PROP_C_W_E);
  ------------------
  |  |  299|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
10573|      0|                    if (prop_flags != JS_PROP_C_W_E)
  ------------------
  |  |  299|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
  |  Branch (10573:25): [True: 0, False: 0]
  ------------------
10574|      0|                        goto convert_to_slow_array;
10575|      0|                    if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                  if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  313|      0|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10575:25): [True: 0, False: 0]
  ------------------
10576|      0|                    convert_to_slow_array:
10577|      0|                        if (convert_fast_array_to_array(ctx, p))
  ------------------
  |  Branch (10577:29): [True: 0, False: 0]
  ------------------
10578|      0|                            return -1;
10579|      0|                        else
10580|      0|                            goto redo_prop_update;
10581|      0|                    }
10582|      0|                    if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10582:25): [True: 0, False: 0]
  ------------------
10583|      0|                        set_value(ctx, &p->u.array.u.values[idx], JS_DupValue(ctx, val));
10584|      0|                    }
10585|      0|                    return TRUE;
10586|      0|                }
10587|   343k|            }
10588|   343k|        } else if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (10588:20): [True: 0, False: 0]
  ------------------
10589|      0|                   p->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (10589:20): [True: 0, False: 0]
  ------------------
10590|      0|            JSValue num;
10591|      0|            int ret;
10592|       |
10593|      0|            if (!__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (10593:17): [True: 0, False: 0]
  ------------------
10594|       |                /* slow path with to handle all numeric indexes */
10595|      0|                num = JS_AtomIsNumericIndex1(ctx, prop);
10596|      0|                if (JS_IsUndefined(num))
  ------------------
  |  Branch (10596:21): [True: 0, False: 0]
  ------------------
10597|      0|                    goto typed_array_done;
10598|      0|                if (JS_IsException(num))
  ------------------
  |  Branch (10598:21): [True: 0, False: 0]
  ------------------
10599|      0|                    return -1;
10600|      0|                ret = JS_NumberIsInteger(ctx, num);
10601|      0|                if (ret < 0) {
  ------------------
  |  Branch (10601:21): [True: 0, False: 0]
  ------------------
10602|      0|                    JS_FreeValue(ctx, num);
10603|      0|                    return -1;
10604|      0|                }
10605|      0|                if (!ret) {
  ------------------
  |  Branch (10605:21): [True: 0, False: 0]
  ------------------
10606|      0|                    JS_FreeValue(ctx, num);
10607|      0|                    return JS_ThrowTypeErrorOrFalse(ctx, flags, "non integer index in typed array");
10608|      0|                }
10609|      0|                ret = JS_NumberIsNegativeOrMinusZero(ctx, num);
10610|      0|                JS_FreeValue(ctx, num);
10611|      0|                if (ret) {
  ------------------
  |  Branch (10611:21): [True: 0, False: 0]
  ------------------
10612|      0|                    return JS_ThrowTypeErrorOrFalse(ctx, flags, "negative index in typed array");
10613|      0|                }
10614|      0|                if (!__JS_AtomIsTaggedInt(prop))
  ------------------
  |  Branch (10614:21): [True: 0, False: 0]
  ------------------
10615|      0|                    goto typed_array_oob;
10616|      0|            }
10617|      0|            idx = __JS_AtomToUInt32(prop);
10618|       |            /* if the typed array is detached, p->u.array.count = 0 */
10619|      0|            if (idx >= p->u.array.count) {
  ------------------
  |  Branch (10619:17): [True: 0, False: 0]
  ------------------
10620|      0|            typed_array_oob:
10621|      0|                return JS_ThrowTypeErrorOrFalse(ctx, flags, "out-of-bound index in typed array");
10622|      0|            }
10623|      0|            prop_flags = get_prop_flags(flags, JS_PROP_ENUMERABLE | JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                          prop_flags = get_prop_flags(flags, JS_PROP_ENUMERABLE | JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                          prop_flags = get_prop_flags(flags, JS_PROP_ENUMERABLE | JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
10624|      0|            if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET) ||
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                          if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET) ||
  ------------------
  |  |  313|      0|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10624:17): [True: 0, False: 0]
  ------------------
10625|      0|                prop_flags != (JS_PROP_ENUMERABLE | JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                              prop_flags != (JS_PROP_ENUMERABLE | JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                              prop_flags != (JS_PROP_ENUMERABLE | JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
  |  Branch (10625:17): [True: 0, False: 0]
  ------------------
10626|      0|                return JS_ThrowTypeErrorOrFalse(ctx, flags, "invalid descriptor flags");
10627|      0|            }
10628|      0|            if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10628:17): [True: 0, False: 0]
  ------------------
10629|      0|                return JS_SetPropertyValue(ctx, this_obj, JS_NewInt32(ctx, idx), JS_DupValue(ctx, val), flags);
10630|      0|            }
10631|      0|            return TRUE;
10632|      0|        typed_array_done: ;
10633|      0|        }
10634|   343k|    }
10635|       |
10636|   351k|    return JS_CreateProperty(ctx, p, prop, val, getter, setter, flags);
10637|   351k|}
JS_DefinePropertyValue:
10672|   351k|{
10673|   351k|    int ret;
10674|   351k|    ret = JS_DefineProperty(ctx, this_obj, prop, val, JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  289|   351k|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|   351k|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
                  ret = JS_DefineProperty(ctx, this_obj, prop, val, JS_UNDEFINED, JS_UNDEFINED,
  ------------------
  |  |  289|   351k|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|   351k|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
10675|   351k|                            flags | JS_PROP_HAS_VALUE | JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_WRITABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  314|   351k|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
                                          flags | JS_PROP_HAS_VALUE | JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_WRITABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  309|   351k|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                                          flags | JS_PROP_HAS_VALUE | JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_WRITABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  310|   351k|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
                                          flags | JS_PROP_HAS_VALUE | JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_WRITABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  311|   351k|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
10676|   351k|    JS_FreeValue(ctx, val);
10677|   351k|    return ret;
10678|   351k|}
JS_DefinePropertyValueValue:
10682|   343k|{
10683|   343k|    JSAtom atom;
10684|   343k|    int ret;
10685|   343k|    atom = JS_ValueToAtom(ctx, prop);
10686|   343k|    JS_FreeValue(ctx, prop);
10687|   343k|    if (unlikely(atom == JS_ATOM_NULL)) {
  ------------------
  |  |   33|   343k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 343k]
  |  |  ------------------
  ------------------
10688|      0|        JS_FreeValue(ctx, val);
10689|      0|        return -1;
10690|      0|    }
10691|   343k|    ret = JS_DefinePropertyValue(ctx, this_obj, atom, val, flags);
10692|   343k|    JS_FreeAtom(ctx, atom);
10693|   343k|    return ret;
10694|   343k|}
JS_DefinePropertyValueUint32:
10698|     12|{
10699|     12|    return JS_DefinePropertyValueValue(ctx, this_obj, JS_NewUint32(ctx, idx),
10700|     12|                                       val, flags);
10701|     12|}
JS_DefinePropertyValueInt64:
10705|      5|{
10706|      5|    return JS_DefinePropertyValueValue(ctx, this_obj, JS_NewInt64(ctx, idx),
10707|      5|                                       val, flags);
10708|      5|}
JS_DefinePropertyValueStr:
10712|    602|{
10713|    602|    JSAtom atom;
10714|    602|    int ret;
10715|    602|    atom = JS_NewAtom(ctx, prop);
10716|    602|    if (atom == JS_ATOM_NULL) {
  ------------------
  |  |  449|    602|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (10716:9): [True: 0, False: 602]
  ------------------
10717|      0|        JS_FreeValue(ctx, val);
10718|      0|        return -1;
10719|      0|    }
10720|    602|    ret = JS_DefinePropertyValue(ctx, this_obj, atom, val, flags);
10721|    602|    JS_FreeAtom(ctx, atom);
10722|    602|    return ret;
10723|    602|}
JS_DefinePropertyGetSet:
10729|    574|{
10730|    574|    int ret;
10731|    574|    ret = JS_DefineProperty(ctx, this_obj, prop, JS_UNDEFINED, getter, setter,
  ------------------
  |  |  289|    574|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|    574|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
10732|    574|                            flags | JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  312|    574|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                          flags | JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  313|    574|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
10733|    574|                            JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  309|    574|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                                          JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_ENUMERABLE);
  ------------------
  |  |  311|    574|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
10734|    574|    JS_FreeValue(ctx, getter);
10735|    574|    JS_FreeValue(ctx, setter);
10736|    574|    return ret;
10737|    574|}
JS_IsFunction:
10951|  1.01M|{
10952|  1.01M|    JSObject *p;
10953|  1.01M|    if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|  1.01M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10953:9): [True: 546, False: 1.01M]
  ------------------
10954|    546|        return FALSE;
10955|  1.01M|    p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|  1.01M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.01M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10956|  1.01M|    switch(p->class_id) {
10957|      1|    case JS_CLASS_BYTECODE_FUNCTION:
  ------------------
  |  Branch (10957:5): [True: 1, False: 1.01M]
  ------------------
10958|      1|        return TRUE;
10959|      0|    case JS_CLASS_PROXY:
  ------------------
  |  Branch (10959:5): [True: 0, False: 1.01M]
  ------------------
10960|      0|        return p->u.proxy_data->is_func;
10961|  1.01M|    default:
  ------------------
  |  Branch (10961:5): [True: 1.01M, False: 1]
  ------------------
10962|       |        return (ctx->rt->class_array[p->class_id].call != NULL);
10963|  1.01M|    }
10964|  1.01M|}
JS_IsConstructor:
10979|      2|{
10980|      2|    JSObject *p;
10981|      2|    if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10981:9): [True: 0, False: 2]
  ------------------
10982|      0|        return FALSE;
10983|      2|    p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10984|      2|    return p->is_constructor;
10985|      2|}
JS_SetConstructorBit:
10988|     14|{
10989|     14|    JSObject *p;
10990|     14|    if (JS_VALUE_GET_TAG(func_obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|     14|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10990:9): [True: 0, False: 14]
  ------------------
10991|      0|        return FALSE;
10992|     14|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  227|     14|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10993|     14|    p->is_constructor = val;
10994|     14|    return TRUE;
10995|     14|}
JS_SetUncatchableException:
11008|      2|{
11009|      2|    ctx->rt->current_exception_is_uncatchable = flag;
11010|      2|}
JS_SetOpaque:
11013|    158|{
11014|    158|   JSObject *p;
11015|    158|    if (JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT) {
  ------------------
  |  |  236|    158|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (11015:9): [True: 158, False: 0]
  ------------------
11016|    158|        p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|    158|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    158|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
11017|    158|        p->u.opaque = opaque;
11018|    158|    }
11019|    158|}
JS_GetOpaque:
11023|    327|{
11024|    327|    JSObject *p;
11025|    327|    if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|    327|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (11025:9): [True: 1, False: 326]
  ------------------
11026|      1|        return NULL;
11027|    326|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|    326|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    326|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
11028|    326|    if (p->class_id != class_id)
  ------------------
  |  Branch (11028:9): [True: 0, False: 326]
  ------------------
11029|      0|        return NULL;
11030|    326|    return p->u.opaque;
11031|    326|}
JS_GetOpaque2:
11034|      2|{
11035|      2|    void *p = JS_GetOpaque(obj, class_id);
11036|      2|    if (unlikely(!p)) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
11037|      0|        JS_ThrowTypeErrorInvalidClass(ctx, class_id);
11038|      0|    }
11039|      2|    return p;
11040|      2|}
JS_ToInt64Clamp:
13230|     15|{
13231|     15|    int res = JS_ToInt64SatFree(ctx, pres, JS_DupValue(ctx, val));
13232|     15|    if (res == 0) {
  ------------------
  |  Branch (13232:9): [True: 15, False: 0]
  ------------------
13233|     15|        if (*pres < 0)
  ------------------
  |  Branch (13233:13): [True: 0, False: 15]
  ------------------
13234|      0|            *pres += neg_offset;
13235|     15|        if (*pres < min)
  ------------------
  |  Branch (13235:13): [True: 0, False: 15]
  ------------------
13236|      0|            *pres = min;
13237|     15|        else if (*pres > max)
  ------------------
  |  Branch (13237:18): [True: 0, False: 15]
  ------------------
13238|      0|            *pres = max;
13239|     15|    }
13240|     15|    return res;
13241|     15|}
JS_ToInt32:
13363|     12|{
13364|     12|    return JS_ToInt32Free(ctx, pres, JS_DupValue(ctx, val));
13365|     12|}
JS_ToString:
13637|  1.00M|{
13638|  1.00M|    return JS_ToStringInternal(ctx, val, FALSE);
13639|  1.00M|}
JS_ToPropertyKey:
13657|     28|{
13658|     28|    return JS_ToStringInternal(ctx, val, TRUE);
13659|     28|}
JS_Call:
20533|     67|{
20534|     67|    return JS_CallInternal(ctx, func_obj, this_obj, JS_UNDEFINED,
  ------------------
  |  |  289|     67|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     67|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20535|     67|                           argc, (JSValue *)argv, JS_CALL_FLAG_COPY_ARGV);
  ------------------
  |  |17576|     67|#define JS_CALL_FLAG_COPY_ARGV   (1 << 1)
  ------------------
20536|     67|}
JS_CallConstructor:
20682|      2|{
20683|      2|    return JS_CallConstructorInternal(ctx, func_obj, func_obj,
20684|      2|                                      argc, (JSValue *)argv,
20685|      2|                                      JS_CALL_FLAG_COPY_ARGV);
  ------------------
  |  |17576|      2|#define JS_CALL_FLAG_COPY_ARGV   (1 << 1)
  ------------------
20686|      2|}
JS_NewCModule:
29663|     28|{
29664|     28|    JSModuleDef *m;
29665|     28|    JSAtom name;
29666|     28|    name = JS_NewAtom(ctx, name_str);
29667|     28|    if (name == JS_ATOM_NULL)
  ------------------
  |  |  449|     28|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (29667:9): [True: 0, False: 28]
  ------------------
29668|      0|        return NULL;
29669|     28|    m = js_new_module_def(ctx, name);
29670|     28|    if (!m)
  ------------------
  |  Branch (29670:9): [True: 0, False: 28]
  ------------------
29671|      0|        return NULL;
29672|     28|    m->init_func = func;
29673|     28|    return m;
29674|     28|}
JS_AddModuleExport:
29677|  1.37k|{
29678|  1.37k|    JSExportEntry *me;
29679|  1.37k|    JSAtom name;
29680|  1.37k|    name = JS_NewAtom(ctx, export_name);
29681|  1.37k|    if (name == JS_ATOM_NULL)
  ------------------
  |  |  449|  1.37k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (29681:9): [True: 0, False: 1.37k]
  ------------------
29682|      0|        return -1;
29683|  1.37k|    me = add_export_entry2(ctx, NULL, m, JS_ATOM_NULL, name,
  ------------------
  |  |  449|  1.37k|#define JS_ATOM_NULL 0
  ------------------
29684|  1.37k|                           JS_EXPORT_TYPE_LOCAL);
29685|  1.37k|    JS_FreeAtom(ctx, name);
29686|  1.37k|    if (!me)
  ------------------
  |  Branch (29686:9): [True: 0, False: 1.37k]
  ------------------
29687|      0|        return -1;
29688|  1.37k|    else
29689|  1.37k|        return 0;
29690|  1.37k|}
JS_SetModuleExport:
29694|  1.27k|{
29695|  1.27k|    JSExportEntry *me;
29696|  1.27k|    JSAtom name;
29697|  1.27k|    name = JS_NewAtom(ctx, export_name);
29698|  1.27k|    if (name == JS_ATOM_NULL)
  ------------------
  |  |  449|  1.27k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (29698:9): [True: 0, False: 1.27k]
  ------------------
29699|      0|        goto fail;
29700|  1.27k|    me = find_export_entry(ctx, m, name);
29701|  1.27k|    JS_FreeAtom(ctx, name);
29702|  1.27k|    if (!me)
  ------------------
  |  Branch (29702:9): [True: 0, False: 1.27k]
  ------------------
29703|      0|        goto fail;
29704|  1.27k|    set_value(ctx, me->u.local.var_ref->pvalue, val);
29705|  1.27k|    return 0;
29706|      0| fail:
29707|      0|    JS_FreeValue(ctx, val);
29708|      0|    return -1;
29709|  1.27k|}
JS_SetModuleLoaderFunc:
29725|     14|{
29726|     14|    rt->module_normalize_func = module_normalize;
29727|     14|    rt->module_loader_has_attr = FALSE;
29728|     14|    rt->u.module_loader_func = module_loader;
29729|       |    rt->module_check_attrs = NULL;
29730|     14|    rt->module_loader_opaque = opaque;
29731|     14|}
JS_GetModuleNamespace:
30322|     28|{
30323|     28|    if (JS_IsUndefined(m->module_ns)) {
  ------------------
  |  Branch (30323:9): [True: 28, False: 0]
  ------------------
30324|     28|        JSValue val;
30325|     28|        val = js_build_module_ns(ctx, m);
30326|     28|        if (JS_IsException(val))
  ------------------
  |  Branch (30326:13): [True: 0, False: 28]
  ------------------
30327|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
30328|     28|        m->module_ns = val;
30329|     28|    }
30330|     28|    return JS_DupValue(ctx, m->module_ns);
30331|     28|}
JS_GetModuleName:
30699|     14|{
30700|     14|    return JS_DupAtom(ctx, m->module_name);
30701|     14|}
JS_EvalFunction:
36987|     14|{
36988|     14|    return JS_EvalFunctionInternal(ctx, fun_obj, ctx->global_obj, NULL, NULL);
36989|     14|}
JS_EvalThis:
37150|     28|{
37151|     28|    int eval_type = eval_flags & JS_EVAL_TYPE_MASK;
  ------------------
  |  |  334|     28|#define JS_EVAL_TYPE_MASK     (3 << 0)
  ------------------
37152|     28|    JSValue ret;
37153|       |
37154|     28|    assert(eval_type == JS_EVAL_TYPE_GLOBAL ||
  ------------------
  |  Branch (37154:5): [True: 28, False: 0]
  |  Branch (37154:5): [True: 0, False: 0]
  |  Branch (37154:5): [True: 14, False: 14]
  |  Branch (37154:5): [True: 14, False: 0]
  ------------------
37155|     28|           eval_type == JS_EVAL_TYPE_MODULE);
37156|     28|    ret = JS_EvalInternal(ctx, this_obj, input, input_len, filename,
37157|     28|                          eval_flags, -1);
37158|     28|    return ret;
37159|     28|}
JS_Eval:
37163|     28|{
37164|     28|    return JS_EvalThis(ctx, ctx->global_obj, input, input_len, filename,
37165|     28|                       eval_flags);
37166|     28|}
JS_SetPropertyFunctionList:
39512|  1.58k|{
39513|  1.58k|    int i, ret;
39514|       |
39515|  9.29k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (39515:17): [True: 7.71k, False: 1.58k]
  ------------------
39516|  7.71k|        const JSCFunctionListEntry *e = &tab[i];
39517|  7.71k|        JSAtom atom = find_atom(ctx, e->name);
39518|  7.71k|        if (atom == JS_ATOM_NULL)
  ------------------
  |  |  449|  7.71k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (39518:13): [True: 0, False: 7.71k]
  ------------------
39519|      0|            return -1;
39520|  7.71k|        ret = JS_InstantiateFunctionListItem(ctx, obj, atom, e);
39521|  7.71k|        JS_FreeAtom(ctx, atom);
39522|  7.71k|        if (ret)
  ------------------
  |  Branch (39522:13): [True: 0, False: 7.71k]
  ------------------
39523|      0|            return -1;
39524|  7.71k|    }
39525|  1.58k|    return 0;
39526|  1.58k|}
JS_AddModuleExportList:
39530|     28|{
39531|     28|    int i;
39532|  1.35k|    for(i = 0; i < len; i++) {
  ------------------
  |  Branch (39532:16): [True: 1.33k, False: 28]
  ------------------
39533|  1.33k|        if (JS_AddModuleExport(ctx, m, tab[i].name))
  ------------------
  |  Branch (39533:13): [True: 0, False: 1.33k]
  ------------------
39534|      0|            return -1;
39535|  1.33k|    }
39536|     28|    return 0;
39537|     28|}
JS_SetModuleExportList:
39541|     26|{
39542|     26|    int i;
39543|     26|    JSValue val;
39544|       |
39545|  1.26k|    for(i = 0; i < len; i++) {
  ------------------
  |  Branch (39545:16): [True: 1.23k, False: 26]
  ------------------
39546|  1.23k|        const JSCFunctionListEntry *e = &tab[i];
39547|  1.23k|        switch(e->def_type) {
39548|    715|        case JS_DEF_CFUNC:
  ------------------
  |  | 1097|    715|#define JS_DEF_CFUNC          0
  ------------------
  |  Branch (39548:9): [True: 715, False: 520]
  ------------------
39549|    715|            val = JS_NewCFunction2(ctx, e->u.func.cfunc.generic,
39550|    715|                                   e->name, e->u.func.length, e->u.func.cproto, e->magic);
39551|    715|            break;
39552|     13|        case JS_DEF_PROP_STRING:
  ------------------
  |  | 1100|     13|#define JS_DEF_PROP_STRING    3
  ------------------
  |  Branch (39552:9): [True: 13, False: 1.22k]
  ------------------
39553|     13|            val = JS_NewString(ctx, e->u.str);
39554|     13|            break;
39555|    494|        case JS_DEF_PROP_INT32:
  ------------------
  |  | 1101|    494|#define JS_DEF_PROP_INT32     4
  ------------------
  |  Branch (39555:9): [True: 494, False: 741]
  ------------------
39556|    494|            val = JS_NewInt32(ctx, e->u.i32);
39557|    494|            break;
39558|      0|        case JS_DEF_PROP_INT64:
  ------------------
  |  | 1102|      0|#define JS_DEF_PROP_INT64     5
  ------------------
  |  Branch (39558:9): [True: 0, False: 1.23k]
  ------------------
39559|      0|            val = JS_NewInt64(ctx, e->u.i64);
39560|      0|            break;
39561|      0|        case JS_DEF_PROP_DOUBLE:
  ------------------
  |  | 1103|      0|#define JS_DEF_PROP_DOUBLE    6
  ------------------
  |  Branch (39561:9): [True: 0, False: 1.23k]
  ------------------
39562|      0|            val = __JS_NewFloat64(ctx, e->u.f64);
39563|      0|            break;
39564|     13|        case JS_DEF_OBJECT:
  ------------------
  |  | 1105|     13|#define JS_DEF_OBJECT         8
  ------------------
  |  Branch (39564:9): [True: 13, False: 1.22k]
  ------------------
39565|     13|            val = JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_OBJECT],
39566|     13|                                        e->u.prop_list.tab, e->u.prop_list.len);
39567|     13|            break;
39568|      0|        default:
  ------------------
  |  Branch (39568:9): [True: 0, False: 1.23k]
  ------------------
39569|      0|            abort();
39570|  1.23k|        }
39571|  1.23k|        if (JS_SetModuleExport(ctx, m, e->name, val))
  ------------------
  |  Branch (39571:13): [True: 0, False: 1.23k]
  ------------------
39572|      0|            return -1;
39573|  1.23k|    }
39574|     26|    return 0;
39575|     26|}
JS_AddIntrinsicStringNormalize:
46608|     14|{
46609|     14|    return JS_SetPropertyFunctionList(ctx, ctx->class_proto[JS_CLASS_STRING], js_string_proto_normalize,
46610|     14|                                      countof(js_string_proto_normalize));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
46611|     14|}
lre_check_stack_overflow:
47692|      3|{
47693|      3|    JSContext *ctx = opaque;
47694|      3|    return js_check_stack_overflow(ctx->rt, alloca_size);
47695|      3|}
lre_realloc:
47706|     20|{
47707|     20|    JSContext *ctx = opaque;
47708|       |    /* No JS exception is raised here */
47709|     20|    return js_realloc_rt(ctx->rt, ptr, size);
47710|     20|}
JS_AddIntrinsicRegExpCompiler:
48953|     14|{
48954|     14|    ctx->compile_regexp = js_compile_regexp;
48955|     14|}
JS_AddIntrinsicRegExp:
48958|     14|{
48959|     14|    JSValue obj;
48960|       |
48961|     14|    JS_AddIntrinsicRegExpCompiler(ctx);
48962|       |
48963|     14|    obj = JS_NewCConstructor(ctx, JS_CLASS_REGEXP, "RegExp",
48964|     14|                                    js_regexp_constructor, 2, JS_CFUNC_constructor_or_func, 0,
48965|     14|                                    JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
48966|     14|                                    js_regexp_funcs, countof(js_regexp_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
48967|     14|                                    js_regexp_proto_funcs, countof(js_regexp_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
48968|     14|                                    0);
48969|     14|    if (JS_IsException(obj))
  ------------------
  |  Branch (48969:9): [True: 0, False: 14]
  ------------------
48970|      0|        return -1;
48971|     14|    ctx->regexp_ctor = obj;
48972|       |    
48973|     14|    ctx->class_proto[JS_CLASS_REGEXP_STRING_ITERATOR] =
48974|     14|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR],
48975|     14|                              js_regexp_string_iterator_proto_funcs,
48976|     14|                              countof(js_regexp_string_iterator_proto_funcs));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
48977|     14|    if (JS_IsException(ctx->class_proto[JS_CLASS_REGEXP_STRING_ITERATOR]))
  ------------------
  |  Branch (48977:9): [True: 0, False: 14]
  ------------------
48978|      0|        return -1;
48979|       |
48980|     14|    ctx->regexp_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_REGEXP]),
48981|     14|                                     JS_PROP_INITIAL_HASH_SIZE, 1);
  ------------------
  |  |  958|     14|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
48982|     14|    if (!ctx->regexp_shape)
  ------------------
  |  Branch (48982:9): [True: 0, False: 14]
  ------------------
48983|      0|        return -1;
48984|     14|    if (add_shape_property(ctx, &ctx->regexp_shape, NULL,
  ------------------
  |  Branch (48984:9): [True: 0, False: 14]
  ------------------
48985|     14|                           JS_ATOM_lastIndex, JS_PROP_WRITABLE))
  ------------------
  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
48986|      0|        return -1;
48987|       |
48988|     14|    ctx->regexp_result_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_ARRAY]),
48989|     14|                                     JS_PROP_INITIAL_HASH_SIZE, 4);
  ------------------
  |  |  958|     14|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
48990|     14|    if (!ctx->regexp_result_shape)
  ------------------
  |  Branch (48990:9): [True: 0, False: 14]
  ------------------
48991|      0|        return -1;
48992|     14|    if (add_shape_property(ctx, &ctx->regexp_result_shape, NULL,
  ------------------
  |  Branch (48992:9): [True: 0, False: 14]
  ------------------
48993|     14|                           JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_LENGTH))
  ------------------
  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_LENGTH))
  ------------------
  |  |  300|     14|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
48994|      0|        return -1;
48995|     14|    if (add_shape_property(ctx, &ctx->regexp_result_shape, NULL,
  ------------------
  |  Branch (48995:9): [True: 0, False: 14]
  ------------------
48996|     14|                           JS_ATOM_index, JS_PROP_C_W_E))
  ------------------
  |  |  299|     14|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     14|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
48997|      0|        return -1;
48998|     14|    if (add_shape_property(ctx, &ctx->regexp_result_shape, NULL,
  ------------------
  |  Branch (48998:9): [True: 0, False: 14]
  ------------------
48999|     14|                           JS_ATOM_input, JS_PROP_C_W_E))
  ------------------
  |  |  299|     14|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     14|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
49000|      0|        return -1;
49001|     14|    if (add_shape_property(ctx, &ctx->regexp_result_shape, NULL,
  ------------------
  |  Branch (49001:9): [True: 0, False: 14]
  ------------------
49002|     14|                           JS_ATOM_groups, JS_PROP_C_W_E))
  ------------------
  |  |  299|     14|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     14|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
49003|      0|        return -1;
49004|       |
49005|     14|    return 0;
49006|     14|}
JS_AddIntrinsicJSON:
50096|     14|{
50097|       |    /* add JSON as autoinit object */
50098|     14|    return JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_json_obj, countof(js_json_obj));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
50099|     14|}
JS_AddIntrinsicProxy:
51226|     14|{
51227|     14|    JSRuntime *rt = ctx->rt;
51228|     14|    JSValue obj1;
51229|       |
51230|     14|    if (!JS_IsRegisteredClass(rt, JS_CLASS_PROXY)) {
  ------------------
  |  Branch (51230:9): [True: 14, False: 0]
  ------------------
51231|     14|        if (init_class_range(rt, js_proxy_class_def, JS_CLASS_PROXY,
  ------------------
  |  Branch (51231:13): [True: 0, False: 14]
  ------------------
51232|     14|                             countof(js_proxy_class_def)))
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
51233|      0|            return -1;
51234|     14|        rt->class_array[JS_CLASS_PROXY].exotic = &js_proxy_exotic_methods;
51235|     14|        rt->class_array[JS_CLASS_PROXY].call = js_proxy_call;
51236|     14|    }
51237|       |
51238|       |    /* additional fields: name, length */
51239|     14|    obj1 = JS_NewCFunction3(ctx, js_proxy_constructor, "Proxy", 2,
51240|     14|                            JS_CFUNC_constructor, 0,
51241|     14|                            ctx->function_proto, countof(js_proxy_funcs) + 2);
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
51242|     14|    if (JS_IsException(obj1))
  ------------------
  |  Branch (51242:9): [True: 0, False: 14]
  ------------------
51243|      0|        return -1;
51244|     14|    JS_SetConstructorBit(ctx, obj1, TRUE);
51245|     14|    if (JS_SetPropertyFunctionList(ctx, obj1, js_proxy_funcs,
  ------------------
  |  Branch (51245:9): [True: 0, False: 14]
  ------------------
51246|     14|                                   countof(js_proxy_funcs)))
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
51247|      0|        goto fail;
51248|     14|    if (JS_DefinePropertyValueStr(ctx, ctx->global_obj, "Proxy",
  ------------------
  |  Branch (51248:9): [True: 0, False: 14]
  ------------------
51249|     14|                                  obj1, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                obj1, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
51250|      0|        goto fail;
51251|     14|    return 0;
51252|      0| fail:
51253|      0|    JS_FreeValue(ctx, obj1);
51254|      0|    return -1;
51255|     14|}
JS_AddIntrinsicMapSet:
52979|     14|{
52980|     14|    int i;
52981|     14|    JSValue obj1;
52982|     14|    char buf[ATOM_GET_STR_BUF_SIZE];
52983|       |
52984|     70|    for(i = 0; i < 4; i++) {
  ------------------
  |  Branch (52984:16): [True: 56, False: 14]
  ------------------
52985|     56|        JSCFunctionType ft;
52986|     56|        const char *name = JS_AtomGetStr(ctx, buf, sizeof(buf),
52987|     56|                                         JS_ATOM_Map + i);
52988|     56|        ft.constructor_magic = js_map_constructor;
52989|     56|        obj1 = JS_NewCConstructor(ctx, JS_CLASS_MAP + i, name,
52990|     56|                                  ft.generic, 0, JS_CFUNC_constructor_magic, i,
52991|     56|                                  JS_UNDEFINED,
  ------------------
  |  |  289|     56|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     56|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
52992|     56|                                  js_map_funcs, i < 2 ? countof(js_map_funcs) : 0,
  ------------------
  |  |   47|     28|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (52992:49): [True: 28, False: 28]
  ------------------
52993|     56|                                  js_map_proto_funcs_ptr[i], js_map_proto_funcs_count[i],
52994|     56|                                  0);
52995|     56|        if (JS_IsException(obj1))
  ------------------
  |  Branch (52995:13): [True: 0, False: 56]
  ------------------
52996|      0|            return -1;
52997|     56|        JS_FreeValue(ctx, obj1);
52998|     56|    }
52999|       |
53000|     42|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53000:16): [True: 28, False: 14]
  ------------------
53001|     28|        ctx->class_proto[JS_CLASS_MAP_ITERATOR + i] =
53002|     28|            JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
53003|     28|                                  js_map_proto_funcs_ptr[i + 4],
53004|     28|                                  js_map_proto_funcs_count[i + 4]);
53005|     28|        if (JS_IsException(ctx->class_proto[JS_CLASS_MAP_ITERATOR + i]))
  ------------------
  |  Branch (53005:13): [True: 0, False: 28]
  ------------------
53006|      0|            return -1;
53007|     28|    }
53008|     14|    return 0;
53009|     14|}
JS_PromiseState:
53050|     27|{
53051|     27|    JSPromiseData *s = JS_GetOpaque(promise, JS_CLASS_PROMISE);
53052|     27|    if (!s)
  ------------------
  |  Branch (53052:9): [True: 1, False: 26]
  ------------------
53053|      1|        return -1;
53054|     26|    return s->promise_state;
53055|     27|}
JS_PromiseResult:
53058|     13|{
53059|     13|    JSPromiseData *s = JS_GetOpaque(promise, JS_CLASS_PROMISE);
53060|     13|    if (!s)
  ------------------
  |  Branch (53060:9): [True: 0, False: 13]
  ------------------
53061|      0|        return JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53062|     13|    return JS_DupValue(ctx, s->promise_result);
53063|     13|}
JS_NewPromiseCapability:
53473|     26|{
53474|     26|    return js_new_promise_capability(ctx, resolving_funcs, JS_UNDEFINED);
  ------------------
  |  |  289|     26|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     26|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53475|     26|}
JS_AddIntrinsicPromise:
54328|     14|{
54329|     14|    JSRuntime *rt = ctx->rt;
54330|     14|    JSValue obj1;
54331|     14|    JSCFunctionType ft;
54332|       |
54333|     14|    if (!JS_IsRegisteredClass(rt, JS_CLASS_PROMISE)) {
  ------------------
  |  Branch (54333:9): [True: 14, False: 0]
  ------------------
54334|     14|        if (init_class_range(rt, js_async_class_def, JS_CLASS_PROMISE,
  ------------------
  |  Branch (54334:13): [True: 0, False: 14]
  ------------------
54335|     14|                             countof(js_async_class_def)))
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54336|      0|            return -1;
54337|     14|        rt->class_array[JS_CLASS_PROMISE_RESOLVE_FUNCTION].call = js_promise_resolve_function_call;
54338|     14|        rt->class_array[JS_CLASS_PROMISE_REJECT_FUNCTION].call = js_promise_resolve_function_call;
54339|     14|        rt->class_array[JS_CLASS_ASYNC_FUNCTION].call = js_async_function_call;
54340|     14|        rt->class_array[JS_CLASS_ASYNC_FUNCTION_RESOLVE].call = js_async_function_resolve_call;
54341|     14|        rt->class_array[JS_CLASS_ASYNC_FUNCTION_REJECT].call = js_async_function_resolve_call;
54342|     14|        rt->class_array[JS_CLASS_ASYNC_GENERATOR_FUNCTION].call = js_async_generator_function_call;
54343|     14|    }
54344|       |
54345|       |    /* Promise */
54346|     14|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_PROMISE, "Promise",
54347|     14|                                     js_promise_constructor, 1, JS_CFUNC_constructor, 0,
54348|     14|                                     JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
54349|     14|                                     js_promise_funcs, countof(js_promise_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54350|     14|                                     js_promise_proto_funcs, countof(js_promise_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54351|     14|                                     0);
54352|     14|    if (JS_IsException(obj1))
  ------------------
  |  Branch (54352:9): [True: 0, False: 14]
  ------------------
54353|      0|        return -1;
54354|     14|    ctx->promise_ctor = obj1;
54355|       |    
54356|       |    /* AsyncFunction */
54357|     14|    ft.generic_magic = js_function_constructor;
54358|     14|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_ASYNC_FUNCTION, "AsyncFunction",
54359|     14|                                     ft.generic, 1, JS_CFUNC_constructor_or_func_magic, JS_FUNC_ASYNC,
54360|     14|                                     ctx->function_ctor,
54361|     14|                                     NULL, 0,
54362|     14|                                     js_async_function_proto_funcs, countof(js_async_function_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54363|     14|                                     JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39603|     14|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
                                                   JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39606|     14|#define JS_NEW_CTOR_READONLY    (1 << 3) /* read-only constructor field */
  ------------------
54364|     14|    if (JS_IsException(obj1))
  ------------------
  |  Branch (54364:9): [True: 0, False: 14]
  ------------------
54365|      0|        return -1;
54366|     14|    JS_FreeValue(ctx, obj1);
54367|       |    
54368|       |    /* AsyncIteratorPrototype */
54369|     14|    ctx->async_iterator_proto =
54370|     14|        JS_NewObjectProtoList(ctx,  ctx->class_proto[JS_CLASS_OBJECT],
54371|     14|                              js_async_iterator_proto_funcs,
54372|     14|                              countof(js_async_iterator_proto_funcs));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54373|     14|    if (JS_IsException(ctx->async_iterator_proto))
  ------------------
  |  Branch (54373:9): [True: 0, False: 14]
  ------------------
54374|      0|        return -1;
54375|       |
54376|       |    /* AsyncFromSyncIteratorPrototype */
54377|     14|    ctx->class_proto[JS_CLASS_ASYNC_FROM_SYNC_ITERATOR] =
54378|     14|        JS_NewObjectProtoList(ctx, ctx->async_iterator_proto,
54379|     14|                              js_async_from_sync_iterator_proto_funcs,
54380|     14|                              countof(js_async_from_sync_iterator_proto_funcs));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54381|     14|    if (JS_IsException(ctx->class_proto[JS_CLASS_ASYNC_FROM_SYNC_ITERATOR]))
  ------------------
  |  Branch (54381:9): [True: 0, False: 14]
  ------------------
54382|      0|        return -1;
54383|       |    
54384|       |    /* AsyncGeneratorPrototype */
54385|     14|    ctx->class_proto[JS_CLASS_ASYNC_GENERATOR] =
54386|     14|        JS_NewObjectProtoList(ctx, ctx->async_iterator_proto, 
54387|     14|                              js_async_generator_proto_funcs,
54388|     14|                              countof(js_async_generator_proto_funcs));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54389|     14|    if (JS_IsException(ctx->class_proto[JS_CLASS_ASYNC_GENERATOR]))
  ------------------
  |  Branch (54389:9): [True: 0, False: 14]
  ------------------
54390|      0|        return -1;
54391|       |
54392|       |    /* AsyncGeneratorFunction */
54393|     14|    ft.generic_magic = js_function_constructor;
54394|     14|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_ASYNC_GENERATOR_FUNCTION, "AsyncGeneratorFunction",
54395|     14|                                     ft.generic, 1, JS_CFUNC_constructor_or_func_magic, JS_FUNC_ASYNC_GENERATOR,
54396|     14|                                     ctx->function_ctor,
54397|     14|                                     NULL, 0,
54398|     14|                                     js_async_generator_function_proto_funcs, countof(js_async_generator_function_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
54399|     14|                                     JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39603|     14|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
                                                   JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39606|     14|#define JS_NEW_CTOR_READONLY    (1 << 3) /* read-only constructor field */
  ------------------
54400|     14|    if (JS_IsException(obj1))
  ------------------
  |  Branch (54400:9): [True: 0, False: 14]
  ------------------
54401|      0|        return -1;
54402|     14|    JS_FreeValue(ctx, obj1);
54403|       |
54404|     14|    return JS_SetConstructor2(ctx, ctx->class_proto[JS_CLASS_ASYNC_GENERATOR_FUNCTION],
54405|     14|                              ctx->class_proto[JS_CLASS_ASYNC_GENERATOR],
54406|     14|                              JS_PROP_CONFIGURABLE, JS_PROP_CONFIGURABLE);
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                            JS_PROP_CONFIGURABLE, JS_PROP_CONFIGURABLE);
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
54407|     14|}
JS_AddIntrinsicDate:
55847|     14|{
55848|     14|    JSValue obj;
55849|       |
55850|       |    /* Date */
55851|     14|    obj = JS_NewCConstructor(ctx, JS_CLASS_DATE, "Date",
55852|     14|                                    js_date_constructor, 7, JS_CFUNC_constructor_or_func, 0,
55853|     14|                                    JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
55854|     14|                                    js_date_funcs, countof(js_date_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
55855|     14|                                    js_date_proto_funcs, countof(js_date_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
55856|     14|                                    0);
55857|     14|    if (JS_IsException(obj))
  ------------------
  |  Branch (55857:9): [True: 0, False: 14]
  ------------------
55858|      0|        return -1;
55859|     14|    JS_FreeValue(ctx, obj);
55860|     14|    return 0;
55861|     14|}
JS_AddIntrinsicEval:
55866|     14|{
55867|     14|    ctx->eval_internal = __JS_EvalInternal;
55868|     14|    return 0;
55869|     14|}
JS_AddIntrinsicBaseObjects:
56203|     14|{
56204|     14|    JSValue obj1, obj2;
56205|     14|    JSCFunctionType ft;
56206|       |
56207|     14|    ctx->throw_type_error = JS_NewCFunction(ctx, js_throw_type_error, NULL, 0);
56208|     14|    if (JS_IsException(ctx->throw_type_error))
  ------------------
  |  Branch (56208:9): [True: 0, False: 14]
  ------------------
56209|      0|        return -1;
56210|       |    /* add caller and arguments properties to throw a TypeError */
56211|     14|    if (JS_DefineProperty(ctx, ctx->function_proto, JS_ATOM_caller, JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
  |  Branch (56211:9): [True: 0, False: 14]
  ------------------
56212|     14|                          ctx->throw_type_error, ctx->throw_type_error,
56213|     14|                          JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  312|     14|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                        JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  313|     14|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
56214|     14|                          JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  309|     14|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                                        JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56215|      0|        return -1;
56216|     14|    if (JS_DefineProperty(ctx, ctx->function_proto, JS_ATOM_arguments, JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
  |  Branch (56216:9): [True: 0, False: 14]
  ------------------
56217|     14|                          ctx->throw_type_error, ctx->throw_type_error,
56218|     14|                          JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  312|     14|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                        JS_PROP_HAS_GET | JS_PROP_HAS_SET |
  ------------------
  |  |  313|     14|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
56219|     14|                          JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  309|     14|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                                        JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56220|      0|        return -1;
56221|     14|    JS_FreeValue(ctx, js_object_seal(ctx, JS_UNDEFINED, 1, (JSValueConst *)&ctx->throw_type_error, 1));
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56222|       |
56223|       |    /* Object */
56224|     14|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_OBJECT, "Object",
56225|     14|                              js_object_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56226|     14|                              JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56227|     14|                              js_object_funcs, countof(js_object_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56228|     14|                              js_object_proto_funcs, countof(js_object_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56229|     14|                              JS_NEW_CTOR_PROTO_EXIST);
  ------------------
  |  |39605|     14|#define JS_NEW_CTOR_PROTO_EXIST (1 << 2) /* the prototype is already defined */
  ------------------
56230|     14|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56230:9): [True: 0, False: 14]
  ------------------
56231|      0|        return -1;
56232|     14|    JS_FreeValue(ctx, obj1);
56233|       |    
56234|       |    /* Function */
56235|     14|    ft.generic_magic = js_function_constructor;
56236|     14|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_BYTECODE_FUNCTION, "Function",
56237|     14|                              ft.generic, 1, JS_CFUNC_constructor_or_func_magic, JS_FUNC_NORMAL,
56238|     14|                              JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56239|     14|                              NULL, 0,
56240|     14|                              js_function_proto_funcs, countof(js_function_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56241|     14|                              JS_NEW_CTOR_PROTO_EXIST);
  ------------------
  |  |39605|     14|#define JS_NEW_CTOR_PROTO_EXIST (1 << 2) /* the prototype is already defined */
  ------------------
56242|     14|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56242:9): [True: 0, False: 14]
  ------------------
56243|      0|        return -1;
56244|     14|    ctx->function_ctor = obj1;
56245|       |
56246|       |    /* Iterator */
56247|     14|    obj2 = JS_NewCConstructor(ctx, JS_CLASS_ITERATOR, "Iterator",
56248|     14|                                     js_iterator_constructor, 0, JS_CFUNC_constructor_or_func, 0,
56249|     14|                                     JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56250|     14|                                     js_iterator_funcs, countof(js_iterator_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56251|     14|                                     js_iterator_proto_funcs, countof(js_iterator_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56252|     14|                                     0);
56253|     14|    if (JS_IsException(obj2))
  ------------------
  |  Branch (56253:9): [True: 0, False: 14]
  ------------------
56254|      0|        return -1;
56255|       |    // quirk: Iterator.prototype.constructor is an accessor property
56256|       |    // TODO(bnoordhuis) mildly inefficient because JS_NewGlobalCConstructor
56257|       |    // first creates a .constructor value property that we then replace with
56258|       |    // an accessor
56259|     14|    obj1 = JS_NewCFunctionData(ctx, js_iterator_constructor_getset,
56260|     14|                               0, 0, 1, (JSValueConst *)&obj2);
56261|     14|    if (JS_IsException(obj1)) {
  ------------------
  |  Branch (56261:9): [True: 0, False: 14]
  ------------------
56262|      0|        JS_FreeValue(ctx, obj2);
56263|      0|        return -1;
56264|      0|    }
56265|     14|    if (JS_DefineProperty(ctx, ctx->class_proto[JS_CLASS_ITERATOR],
  ------------------
  |  Branch (56265:9): [True: 0, False: 14]
  ------------------
56266|     14|                          JS_ATOM_constructor, JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56267|     14|                          obj1, obj1,
56268|     14|                          JS_PROP_HAS_GET | JS_PROP_HAS_SET | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  312|     14|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                        JS_PROP_HAS_GET | JS_PROP_HAS_SET | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  313|     14|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
                                        JS_PROP_HAS_GET | JS_PROP_HAS_SET | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56269|      0|        JS_FreeValue(ctx, obj2);
56270|      0|        JS_FreeValue(ctx, obj1);
56271|      0|        return -1;
56272|      0|    }
56273|     14|    JS_FreeValue(ctx, obj1);
56274|     14|    ctx->iterator_ctor = obj2;
56275|       |    
56276|     14|    ctx->class_proto[JS_CLASS_ITERATOR_CONCAT] =
56277|     14|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56278|     14|                              js_iterator_concat_proto_funcs,
56279|     14|                              countof(js_iterator_concat_proto_funcs));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56280|     14|    if (JS_IsException(ctx->class_proto[JS_CLASS_ITERATOR_CONCAT]))
  ------------------
  |  Branch (56280:9): [True: 0, False: 14]
  ------------------
56281|      0|        return -1;
56282|     14|    ctx->class_proto[JS_CLASS_ITERATOR_HELPER] =
56283|     14|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56284|     14|                              js_iterator_helper_proto_funcs,
56285|     14|                              countof(js_iterator_helper_proto_funcs));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56286|     14|    if (JS_IsException(ctx->class_proto[JS_CLASS_ITERATOR_HELPER]))
  ------------------
  |  Branch (56286:9): [True: 0, False: 14]
  ------------------
56287|      0|        return -1;
56288|       |                       
56289|     14|    ctx->class_proto[JS_CLASS_ITERATOR_WRAP] =
56290|     14|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56291|     14|                              js_iterator_wrap_proto_funcs,
56292|     14|                              countof(js_iterator_wrap_proto_funcs));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56293|     14|    if (JS_IsException(ctx->class_proto[JS_CLASS_ITERATOR_WRAP]))
  ------------------
  |  Branch (56293:9): [True: 0, False: 14]
  ------------------
56294|      0|        return -1;
56295|       |
56296|       |    /* needed to initialize arguments[Symbol.iterator] */
56297|     14|    ctx->array_proto_values =
56298|     14|        JS_GetProperty(ctx, ctx->class_proto[JS_CLASS_ARRAY], JS_ATOM_values);
56299|     14|    if (JS_IsException(ctx->array_proto_values))
  ------------------
  |  Branch (56299:9): [True: 0, False: 14]
  ------------------
56300|      0|        return -1;
56301|       |
56302|     14|    ctx->class_proto[JS_CLASS_ARRAY_ITERATOR] =
56303|     14|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56304|     14|                              js_array_iterator_proto_funcs,
56305|     14|                              countof(js_array_iterator_proto_funcs));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56306|     14|    if (JS_IsException(ctx->class_proto[JS_CLASS_ARRAY_ITERATOR]))
  ------------------
  |  Branch (56306:9): [True: 0, False: 14]
  ------------------
56307|      0|        return -1;
56308|       |
56309|       |    /* parseFloat and parseInteger must be defined before Number
56310|       |       because of the Number.parseFloat and Number.parseInteger
56311|       |       aliases */
56312|     14|    if (JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_global_funcs,
  ------------------
  |  Branch (56312:9): [True: 0, False: 14]
  ------------------
56313|     14|                                   countof(js_global_funcs)))
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56314|      0|        return -1;
56315|       |
56316|       |    /* Number */
56317|     14|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_NUMBER, "Number",
56318|     14|                                     js_number_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56319|     14|                                     JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56320|     14|                                     js_number_funcs, countof(js_number_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56321|     14|                                     js_number_proto_funcs, countof(js_number_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56322|     14|                                     JS_NEW_CTOR_PROTO_CLASS);
  ------------------
  |  |39604|     14|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
56323|     14|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56323:9): [True: 0, False: 14]
  ------------------
56324|      0|        return -1;
56325|     14|    JS_FreeValue(ctx, obj1);
56326|     14|    if (JS_SetObjectData(ctx, ctx->class_proto[JS_CLASS_NUMBER], JS_NewInt32(ctx, 0)))
  ------------------
  |  Branch (56326:9): [True: 0, False: 14]
  ------------------
56327|      0|        return -1;
56328|       |    
56329|       |    /* Boolean */
56330|     14|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_BOOLEAN, "Boolean",
56331|     14|                                     js_boolean_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56332|     14|                                     JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56333|     14|                                     NULL, 0,
56334|     14|                                     js_boolean_proto_funcs, countof(js_boolean_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56335|     14|                                     JS_NEW_CTOR_PROTO_CLASS);
  ------------------
  |  |39604|     14|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
56336|     14|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56336:9): [True: 0, False: 14]
  ------------------
56337|      0|        return -1;
56338|     14|    JS_FreeValue(ctx, obj1);
56339|     14|    if (JS_SetObjectData(ctx, ctx->class_proto[JS_CLASS_BOOLEAN], JS_NewBool(ctx, FALSE)))
  ------------------
  |  Branch (56339:9): [True: 0, False: 14]
  ------------------
56340|      0|        return -1;
56341|       |
56342|       |    /* String */
56343|     14|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_STRING, "String",
56344|     14|                                     js_string_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56345|     14|                                     JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56346|     14|                                     js_string_funcs, countof(js_string_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56347|     14|                                     js_string_proto_funcs, countof(js_string_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56348|     14|                                     JS_NEW_CTOR_PROTO_CLASS);
  ------------------
  |  |39604|     14|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
56349|     14|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56349:9): [True: 0, False: 14]
  ------------------
56350|      0|        return -1;
56351|     14|    JS_FreeValue(ctx, obj1);
56352|     14|    if (JS_SetObjectData(ctx, ctx->class_proto[JS_CLASS_STRING], JS_AtomToString(ctx, JS_ATOM_empty_string)))
  ------------------
  |  Branch (56352:9): [True: 0, False: 14]
  ------------------
56353|      0|        return -1;
56354|       |
56355|     14|    ctx->class_proto[JS_CLASS_STRING_ITERATOR] =
56356|     14|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR], 
56357|     14|                              js_string_iterator_proto_funcs,
56358|     14|                              countof(js_string_iterator_proto_funcs));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56359|     14|    if (JS_IsException(ctx->class_proto[JS_CLASS_STRING_ITERATOR]))
  ------------------
  |  Branch (56359:9): [True: 0, False: 14]
  ------------------
56360|      0|        return -1;
56361|       |
56362|       |    /* Math: create as autoinit object */
56363|     14|    js_random_init(ctx);
56364|     14|    if (JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_math_obj, countof(js_math_obj)))
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (56364:9): [True: 0, False: 14]
  ------------------
56365|      0|        return -1;
56366|       |
56367|       |    /* ES6 Reflect: create as autoinit object */
56368|     14|    if (JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_reflect_obj, countof(js_reflect_obj)))
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (56368:9): [True: 0, False: 14]
  ------------------
56369|      0|        return -1;
56370|       |
56371|       |    /* ES6 Symbol */
56372|     14|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_SYMBOL, "Symbol",
56373|     14|                                     js_symbol_constructor, 0, JS_CFUNC_constructor_or_func, 0,
56374|     14|                                     JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56375|     14|                                     js_symbol_funcs, countof(js_symbol_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56376|     14|                                     js_symbol_proto_funcs, countof(js_symbol_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56377|     14|                                     0);
56378|     14|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56378:9): [True: 0, False: 14]
  ------------------
56379|      0|        return -1;
56380|     14|    JS_FreeValue(ctx, obj1);
56381|       |    
56382|       |    /* ES6 Generator */
56383|     14|    ctx->class_proto[JS_CLASS_GENERATOR] =
56384|     14|        JS_NewObjectProtoList(ctx, ctx->class_proto[JS_CLASS_ITERATOR],
56385|     14|                              js_generator_proto_funcs,
56386|     14|                              countof(js_generator_proto_funcs));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56387|     14|    if (JS_IsException(ctx->class_proto[JS_CLASS_GENERATOR]))
  ------------------
  |  Branch (56387:9): [True: 0, False: 14]
  ------------------
56388|      0|        return -1;
56389|       |
56390|     14|    ft.generic_magic = js_function_constructor;
56391|     14|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_GENERATOR_FUNCTION, "GeneratorFunction",
56392|     14|                                     ft.generic, 1, JS_CFUNC_constructor_or_func_magic, JS_FUNC_GENERATOR,
56393|     14|                                     ctx->function_ctor,
56394|     14|                                     NULL, 0,
56395|     14|                                     js_generator_function_proto_funcs,
56396|     14|                                     countof(js_generator_function_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56397|     14|                                     JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39603|     14|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
                                                   JS_NEW_CTOR_NO_GLOBAL | JS_NEW_CTOR_READONLY);
  ------------------
  |  |39606|     14|#define JS_NEW_CTOR_READONLY    (1 << 3) /* read-only constructor field */
  ------------------
56398|     14|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56398:9): [True: 0, False: 14]
  ------------------
56399|      0|        return -1;
56400|     14|    JS_FreeValue(ctx, obj1);
56401|     14|    if (JS_SetConstructor2(ctx, ctx->class_proto[JS_CLASS_GENERATOR_FUNCTION],
  ------------------
  |  Branch (56401:9): [True: 0, False: 14]
  ------------------
56402|     14|                           ctx->class_proto[JS_CLASS_GENERATOR],
56403|     14|                           JS_PROP_CONFIGURABLE, JS_PROP_CONFIGURABLE))
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                         JS_PROP_CONFIGURABLE, JS_PROP_CONFIGURABLE))
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56404|      0|        return -1;
56405|       |    
56406|       |    /* global properties */
56407|     14|    ctx->eval_obj = JS_GetProperty(ctx, ctx->global_obj, JS_ATOM_eval);
56408|     14|    if (JS_IsException(ctx->eval_obj))
  ------------------
  |  Branch (56408:9): [True: 0, False: 14]
  ------------------
56409|      0|        return -1;
56410|       |    
56411|     14|    if (JS_DefinePropertyValue(ctx, ctx->global_obj, JS_ATOM_globalThis,
  ------------------
  |  Branch (56411:9): [True: 0, False: 14]
  ------------------
56412|     14|                               JS_DupValue(ctx, ctx->global_obj),
56413|     14|                               JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE) < 0)
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                             JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE) < 0)
  ------------------
  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
56414|      0|        return -1;
56415|       |
56416|       |    /* BigInt */
56417|     14|    if (JS_AddIntrinsicBigInt(ctx))
  ------------------
  |  Branch (56417:9): [True: 0, False: 14]
  ------------------
56418|      0|        return -1;
56419|     14|    return 0;
56420|     14|}
JS_AddIntrinsicTypedArrays:
60705|     14|{
60706|     14|    JSValue typed_array_base_func, typed_array_base_proto, obj;
60707|     14|    int i, ret;
60708|       |
60709|     14|    obj = JS_NewCConstructor(ctx, JS_CLASS_ARRAY_BUFFER, "ArrayBuffer",
60710|     14|                                    js_array_buffer_constructor, 1, JS_CFUNC_constructor, 0,
60711|     14|                                    JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
60712|     14|                                    js_array_buffer_funcs, countof(js_array_buffer_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60713|     14|                                    js_array_buffer_proto_funcs, countof(js_array_buffer_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60714|     14|                                    0);
60715|     14|    if (JS_IsException(obj))
  ------------------
  |  Branch (60715:9): [True: 0, False: 14]
  ------------------
60716|      0|        return -1;
60717|     14|    JS_FreeValue(ctx, obj);
60718|       |
60719|     14|    obj = JS_NewCConstructor(ctx, JS_CLASS_SHARED_ARRAY_BUFFER, "SharedArrayBuffer",
60720|     14|                                    js_shared_array_buffer_constructor, 1, JS_CFUNC_constructor, 0,
60721|     14|                                    JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
60722|     14|                                    js_shared_array_buffer_funcs, countof(js_shared_array_buffer_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60723|     14|                                    js_shared_array_buffer_proto_funcs, countof(js_shared_array_buffer_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60724|     14|                                    0);
60725|     14|    if (JS_IsException(obj))
  ------------------
  |  Branch (60725:9): [True: 0, False: 14]
  ------------------
60726|      0|        return -1;
60727|     14|    JS_FreeValue(ctx, obj);
60728|       |
60729|       |
60730|     14|    typed_array_base_func =
60731|     14|        JS_NewCConstructor(ctx, -1, "TypedArray",
60732|     14|                                  js_typed_array_base_constructor, 0, JS_CFUNC_constructor_or_func, 0,
60733|     14|                                  JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
60734|     14|                                  js_typed_array_base_funcs, countof(js_typed_array_base_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60735|     14|                                  js_typed_array_base_proto_funcs, countof(js_typed_array_base_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60736|     14|                                  JS_NEW_CTOR_NO_GLOBAL);
  ------------------
  |  |39603|     14|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
60737|     14|    if (JS_IsException(typed_array_base_func))
  ------------------
  |  Branch (60737:9): [True: 0, False: 14]
  ------------------
60738|      0|        return -1;
60739|       |
60740|       |    /* TypedArray.prototype.toString must be the same object as Array.prototype.toString */
60741|     14|    obj = JS_GetProperty(ctx, ctx->class_proto[JS_CLASS_ARRAY], JS_ATOM_toString);
60742|     14|    if (JS_IsException(obj))
  ------------------
  |  Branch (60742:9): [True: 0, False: 14]
  ------------------
60743|      0|        goto fail;
60744|       |    /* XXX: should use alias method in JSCFunctionListEntry */ //@@@
60745|     14|    typed_array_base_proto = JS_GetProperty(ctx, typed_array_base_func, JS_ATOM_prototype);
60746|     14|    if (JS_IsException(typed_array_base_proto))
  ------------------
  |  Branch (60746:9): [True: 0, False: 14]
  ------------------
60747|      0|        goto fail;
60748|     14|    ret = JS_DefinePropertyValue(ctx, typed_array_base_proto, JS_ATOM_toString, obj,
60749|     14|                                 JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                               JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
60750|     14|    JS_FreeValue(ctx, typed_array_base_proto);
60751|     14|    if (ret < 0)
  ------------------
  |  Branch (60751:9): [True: 0, False: 14]
  ------------------
60752|      0|        goto fail;
60753|       |    
60754|       |    /* Used to squelch a -Wcast-function-type warning. */
60755|     14|    JSCFunctionType ft = { .generic_magic = js_typed_array_constructor };
60756|    182|    for(i = JS_CLASS_UINT8C_ARRAY; i < JS_CLASS_UINT8C_ARRAY + JS_TYPED_ARRAY_COUNT; i++) {
  ------------------
  |  |  189|    182|#define JS_TYPED_ARRAY_COUNT  (JS_CLASS_FLOAT64_ARRAY - JS_CLASS_UINT8C_ARRAY + 1)
  ------------------
  |  Branch (60756:36): [True: 168, False: 14]
  ------------------
60757|    168|        char buf[ATOM_GET_STR_BUF_SIZE];
60758|    168|        const char *name;
60759|       |            
60760|    168|        name = JS_AtomGetStr(ctx, buf, sizeof(buf),
60761|    168|                             JS_ATOM_Uint8ClampedArray + i - JS_CLASS_UINT8C_ARRAY);
60762|    168|        if (i == JS_CLASS_UINT8_ARRAY) {
  ------------------
  |  Branch (60762:13): [True: 14, False: 154]
  ------------------
60763|     14|            obj = JS_NewCConstructor(ctx, i, name,
60764|     14|                                     ft.generic, 3, JS_CFUNC_constructor_magic, i,
60765|     14|                                     typed_array_base_func,
60766|     14|                                     js_uint8array_funcs, countof(js_uint8array_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60767|     14|                                     js_uint8array_proto_funcs, countof(js_uint8array_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60768|     14|                                     0);
60769|    154|        } else {
60770|    154|            const JSCFunctionListEntry *bpe = js_typed_array_funcs + typed_array_size_log2(i);
  ------------------
  |  |  191|    154|#define typed_array_size_log2(classid)  (typed_array_size_log2[(classid)- JS_CLASS_UINT8C_ARRAY])
  ------------------
60771|    154|            obj = JS_NewCConstructor(ctx, i, name,
60772|    154|                                     ft.generic, 3, JS_CFUNC_constructor_magic, i,
60773|    154|                                     typed_array_base_func,
60774|    154|                                     bpe, 1,
60775|    154|                                     bpe, 1,
60776|    154|                                     0);
60777|    154|        }
60778|    168|        if (JS_IsException(obj)) {
  ------------------
  |  Branch (60778:13): [True: 0, False: 168]
  ------------------
60779|      0|        fail:
60780|      0|            JS_FreeValue(ctx, typed_array_base_func);
60781|      0|            return -1;
60782|      0|        }
60783|    168|        JS_FreeValue(ctx, obj);
60784|    168|    }
60785|     14|    JS_FreeValue(ctx, typed_array_base_func);
60786|       |
60787|       |    /* DataView */
60788|     14|    obj = JS_NewCConstructor(ctx, JS_CLASS_DATAVIEW, "DataView",
60789|     14|                                    js_dataview_constructor, 1, JS_CFUNC_constructor, 0,
60790|     14|                                    JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
60791|     14|                                    NULL, 0,
60792|     14|                                    js_dataview_proto_funcs, countof(js_dataview_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60793|     14|                                    0);
60794|     14|    if (JS_IsException(obj))
  ------------------
  |  Branch (60794:9): [True: 0, False: 14]
  ------------------
60795|      0|        return -1;
60796|     14|    JS_FreeValue(ctx, obj);
60797|       |
60798|       |    /* Atomics */
60799|     14|#ifdef CONFIG_ATOMICS
60800|     14|    if (JS_AddIntrinsicAtomics(ctx))
  ------------------
  |  Branch (60800:9): [True: 0, False: 14]
  ------------------
60801|      0|        return -1;
60802|     14|#endif
60803|     14|    return 0;
60804|     14|}
JS_AddIntrinsicWeakRef:
61060|     14|{
61061|     14|    JSRuntime *rt = ctx->rt;
61062|     14|    JSValue obj;
61063|       |    
61064|       |    /* WeakRef */
61065|     14|    if (!JS_IsRegisteredClass(rt, JS_CLASS_WEAK_REF)) {
  ------------------
  |  Branch (61065:9): [True: 14, False: 0]
  ------------------
61066|     14|        if (init_class_range(rt, js_weakref_class_def, JS_CLASS_WEAK_REF,
  ------------------
  |  Branch (61066:13): [True: 0, False: 14]
  ------------------
61067|     14|                             countof(js_weakref_class_def)))
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61068|      0|            return -1;
61069|     14|    }
61070|     14|    obj = JS_NewCConstructor(ctx, JS_CLASS_WEAK_REF, "WeakRef",
61071|     14|                             js_weakref_constructor, 1, JS_CFUNC_constructor_or_func, 0,
61072|     14|                             JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
61073|     14|                             NULL, 0,
61074|     14|                             js_weakref_proto_funcs, countof(js_weakref_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61075|     14|                             0);
61076|     14|    if (JS_IsException(obj))
  ------------------
  |  Branch (61076:9): [True: 0, False: 14]
  ------------------
61077|      0|        return -1;
61078|     14|    JS_FreeValue(ctx, obj);
61079|       |
61080|       |    /* FinalizationRegistry */
61081|     14|    if (!JS_IsRegisteredClass(rt, JS_CLASS_FINALIZATION_REGISTRY)) {
  ------------------
  |  Branch (61081:9): [True: 14, False: 0]
  ------------------
61082|     14|        if (init_class_range(rt, js_finrec_class_def, JS_CLASS_FINALIZATION_REGISTRY,
  ------------------
  |  Branch (61082:13): [True: 0, False: 14]
  ------------------
61083|     14|                             countof(js_finrec_class_def)))
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61084|      0|            return -1;
61085|     14|    }
61086|       |
61087|     14|    obj = JS_NewCConstructor(ctx, JS_CLASS_FINALIZATION_REGISTRY, "FinalizationRegistry",
61088|     14|                             js_finrec_constructor, 1, JS_CFUNC_constructor_or_func, 0,
61089|     14|                             JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
61090|     14|                             NULL, 0,
61091|     14|                             js_finrec_proto_funcs, countof(js_finrec_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
61092|     14|                             0);
61093|     14|    if (JS_IsException(obj))
  ------------------
  |  Branch (61093:9): [True: 0, False: 14]
  ------------------
61094|      0|        return -1;
61095|     14|    JS_FreeValue(ctx, obj);
61096|     14|    return 0;
61097|     14|}
quickjs.c:__js_malloc:
 1542|  1.10M|{
 1543|  1.10M|    size_t total_size;
 1544|  1.10M|    if (unlikely(size == 0)) {
  ------------------
  |  |   33|  1.10M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.10M]
  |  |  ------------------
  ------------------
 1545|      0|        JSMallocBlockHeader *b = get_zero_size_block(s);
 1546|      0|        return b->user_data;
 1547|  1.10M|    } else {
 1548|  1.10M|        total_size = ((size + JS_MALLOC_ALIGN - 1) & ~(JS_MALLOC_ALIGN - 1)) +
  ------------------
  |  |  241|  1.10M|#define JS_MALLOC_ALIGN 8
  ------------------
                      total_size = ((size + JS_MALLOC_ALIGN - 1) & ~(JS_MALLOC_ALIGN - 1)) +
  ------------------
  |  |  241|  1.10M|#define JS_MALLOC_ALIGN 8
  ------------------
 1549|  1.10M|            sizeof(JSMallocBlockHeader);
 1550|  1.10M|        if (total_size <= JS_MALLOC_MAX_SMALL_SIZE) { /* TEST */
  ------------------
  |  |  245|  1.10M|#define JS_MALLOC_MAX_SMALL_SIZE 512
  ------------------
  |  Branch (1550:13): [True: 1.10M, False: 426]
  ------------------
 1551|  1.10M|            int block_size_idx;
 1552|  1.10M|            unsigned int block_idx, block_size;
 1553|  1.10M|            JSMallocBlockHeader *b;
 1554|  1.10M|            JSMallocArena *ar;
 1555|  1.10M|            struct list_head *el, *head;
 1556|       |            
 1557|  1.10M|            block_size_idx = get_block_size_index(total_size);
 1558|  1.10M|            block_size = js_malloc_block_sizes[block_size_idx];
 1559|  1.10M|            head = &s->free_arena_list[block_size_idx];
 1560|  1.10M|            el = head->next;
 1561|  1.10M|            if (unlikely(el == head)) {
  ------------------
  |  |   33|  1.10M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1.47k, False: 1.10M]
  |  |  ------------------
  ------------------
 1562|  1.47k|                ar = js_malloc_new_arena(s, block_size_idx);
 1563|  1.47k|                if (!ar)
  ------------------
  |  Branch (1563:21): [True: 0, False: 1.47k]
  ------------------
 1564|      0|                    return NULL;
 1565|  1.10M|            } else {
 1566|  1.10M|                ar = list_entry(el, JSMallocArena, free_link);
  ------------------
  |  |   39|  1.10M|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  1.10M|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 1567|  1.10M|            }
 1568|  1.10M|            block_idx = ar->first_free_block;
 1569|  1.10M|            b = get_arena_block(ar, ar->first_free_block, block_size);
 1570|  1.10M|            ar->first_free_block = b->u.free_next;
 1571|  1.10M|            b->u.block_idx = block_idx;
 1572|  1.10M|            ar->n_used_blocks++;
 1573|  1.10M|            if (unlikely(ar->n_used_blocks == ar->n_blocks)) {
  ------------------
  |  |   33|  1.10M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 948, False: 1.10M]
  |  |  ------------------
  ------------------
 1574|    948|                list_del(&ar->free_link);
 1575|    948|            }
 1576|       |#ifdef JS_MALLOC_USE_ITER
 1577|       |            ar->bitmap[block_idx / 32] |= 1 << (block_idx % 32);
 1578|       |#endif
 1579|  1.10M|            return b->user_data;
 1580|  1.10M|        } else {
 1581|    426|            return js_malloc_large(s, size);
 1582|    426|        }
 1583|  1.10M|    }
 1584|  1.10M|}
quickjs.c:get_zero_size_block:
 1461|  1.63k|{
 1462|  1.63k|    return (JSMallocBlockHeader *)s->zero_size_block;
 1463|  1.63k|}
quickjs.c:get_block_size_index:
 1446|  1.10M|{
 1447|  1.10M|    if (size <= 16) {
  ------------------
  |  Branch (1447:9): [True: 289, False: 1.10M]
  ------------------
 1448|    289|        return 0;
 1449|  1.10M|    } else if (size <= 128) {
  ------------------
  |  Branch (1449:16): [True: 1.10M, False: 3.83k]
  ------------------
 1450|  1.10M|        return (size + 7) / 8 - 2;
 1451|  1.10M|    } else if (size <= 256) {
  ------------------
  |  Branch (1451:16): [True: 3.02k, False: 809]
  ------------------
 1452|  3.02k|        return (size + 15) / 16 + 6;
 1453|  3.02k|    } else if (size <= 512) {
  ------------------
  |  Branch (1453:16): [True: 809, False: 0]
  ------------------
 1454|    809|        return (size + 31) / 32 + 14;
 1455|    809|    } else {
 1456|      0|        return JS_MALLOC_BLOCK_SIZE_COUNT;
  ------------------
  |  |  243|      0|#define JS_MALLOC_BLOCK_SIZE_COUNT 31
  ------------------
 1457|      0|    }
 1458|  1.10M|}
quickjs.c:js_malloc_new_arena:
 1490|  1.47k|{
 1491|  1.47k|    JSMallocBlockHeader *b;
 1492|  1.47k|    JSMallocArena *ar;
 1493|  1.47k|    int n_blocks, block_size, i;
 1494|       |
 1495|  1.47k|    block_size = js_malloc_block_sizes[block_size_idx];
 1496|  1.47k|    n_blocks = (JS_MALLOC_ARENA_SIZE - sizeof(JSMallocArena)) / block_size;
  ------------------
  |  |  242|  1.47k|#define JS_MALLOC_ARENA_SIZE 4096
  ------------------
 1497|  1.47k|    ar = s->mf.js_malloc(&s->malloc_state, sizeof(JSMallocArena) + n_blocks * block_size);
 1498|  1.47k|    if (!ar)
  ------------------
  |  Branch (1498:9): [True: 0, False: 1.47k]
  ------------------
 1499|      0|        return NULL;
 1500|       |
 1501|  1.47k|    ar->block_size_idx = block_size_idx;
 1502|  1.47k|    ar->n_blocks = n_blocks;
 1503|  1.47k|    ar->n_used_blocks = 0;
 1504|  1.47k|    ar->first_free_block = 0;
 1505|       |#ifdef JS_MALLOC_USE_ITER
 1506|       |    {
 1507|       |        int n_bitmap_words = (n_blocks + 31) / 32;
 1508|       |        for(i = 0; i < n_bitmap_words; i++)
 1509|       |            ar->bitmap[i] = 0;
 1510|       |    }
 1511|       |#endif
 1512|   143k|    for(i = 0; i < n_blocks - 1; i++) {
  ------------------
  |  Branch (1512:16): [True: 141k, False: 1.47k]
  ------------------
 1513|   141k|        b = get_arena_block(ar, i, block_size);
 1514|   141k|        b->u.free_next = i + 1;
 1515|   141k|        b->block_size_idx = block_size_idx;
 1516|   141k|    }
 1517|  1.47k|    b = get_arena_block(ar, n_blocks - 1, block_size);
 1518|  1.47k|    b->u.free_next = FREE_NIL;
  ------------------
  |  |  251|  1.47k|#define FREE_NIL 0xffff
  ------------------
 1519|  1.47k|    b->block_size_idx = block_size_idx;
 1520|       |    
 1521|       |    /* add to the head */
 1522|  1.47k|    list_add(&ar->link, &s->arena_list[block_size_idx]);
 1523|  1.47k|    list_add(&ar->free_link, &s->free_arena_list[block_size_idx]);
 1524|  1.47k|    return ar;
 1525|  1.47k|}
quickjs.c:get_arena_block:
 1480|  1.25M|{
 1481|  1.25M|    return ar->blocks + idx * block_size;
 1482|  1.25M|}
quickjs.c:js_malloc_large:
 1528|    426|{
 1529|    426|    JSMallocLargeBlockHeader *b;
 1530|    426|    b = s->mf.js_malloc(&s->malloc_state, sizeof(JSMallocLargeBlockHeader) + size);
 1531|    426|    if (!b)
  ------------------
  |  Branch (1531:9): [True: 0, False: 426]
  ------------------
 1532|      0|        return NULL;
 1533|    426|    b->header.u.block_idx = FREE_NIL;
  ------------------
  |  |  251|    426|#define FREE_NIL 0xffff
  ------------------
 1534|    426|    b->header.block_size_idx = 0xff; /* fail safe */
 1535|       |#ifdef JS_MALLOC_USE_ITER
 1536|       |    list_add_tail(&b->link, &s->large_block_list);
 1537|       |#endif
 1538|    426|    return b->header.user_data;
 1539|    426|}
quickjs.c:__js_free:
 1587|  1.10M|{
 1588|  1.10M|    JSMallocBlockHeader *b;
 1589|       |
 1590|  1.10M|    if (!ptr)
  ------------------
  |  Branch (1590:9): [True: 361, False: 1.10M]
  ------------------
 1591|    361|        return;
 1592|  1.10M|    b = container_of(ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|  1.10M|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1593|  1.10M|    if (unlikely(b->u.block_idx == FREE_NIL)) {
  ------------------
  |  |   33|  1.10M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 426, False: 1.10M]
  |  |  ------------------
  ------------------
 1594|       |        /* large or zero size block */
 1595|    426|        if (b == get_zero_size_block(s)) {
  ------------------
  |  Branch (1595:13): [True: 0, False: 426]
  ------------------
 1596|       |            /* nothing to do */
 1597|    426|        } else {
 1598|    426|            JSMallocLargeBlockHeader *lb = container_of(ptr, JSMallocLargeBlockHeader, header.user_data);
  ------------------
  |  |   51|    426|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1599|       |#ifdef JS_MALLOC_USE_ITER
 1600|       |            list_del(&lb->link);
 1601|       |#endif
 1602|    426|            s->mf.js_free(&s->malloc_state, lb);
 1603|    426|        }
 1604|  1.10M|    } else {
 1605|  1.10M|        unsigned int block_idx = b->u.block_idx;
 1606|  1.10M|        unsigned int block_size_idx = b->block_size_idx;
 1607|  1.10M|        unsigned int block_size = js_malloc_block_sizes[block_size_idx];
 1608|  1.10M|        JSMallocArena *ar = (JSMallocArena *)((uint8_t *)b - block_size * block_idx - sizeof(JSMallocArena));
 1609|  1.10M|        b->u.free_next = ar->first_free_block;
 1610|  1.10M|        ar->first_free_block = block_idx;
 1611|       |#ifdef JS_MALLOC_USE_ITER
 1612|       |        ar->bitmap[block_idx / 32] &= ~(1 << (block_idx % 32));
 1613|       |#endif
 1614|       |        /* add back to the free list if needed */
 1615|  1.10M|        if (unlikely(ar->n_used_blocks == ar->n_blocks)) {
  ------------------
  |  |   33|  1.10M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 948, False: 1.10M]
  |  |  ------------------
  ------------------
 1616|    948|            list_add(&ar->free_link, &s->free_arena_list[block_size_idx]);
 1617|    948|        }
 1618|  1.10M|        ar->n_used_blocks--;
 1619|  1.10M|        if (unlikely(ar->n_used_blocks == 0)) {
  ------------------
  |  |   33|  1.10M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1.47k, False: 1.10M]
  |  |  ------------------
  ------------------
 1620|  1.47k|            list_del(&ar->link);
 1621|  1.47k|            list_del(&ar->free_link);
 1622|  1.47k|            s->mf.js_free(&s->malloc_state, ar);
 1623|  1.47k|        }
 1624|  1.10M|    }
 1625|  1.10M|}
quickjs.c:__js_realloc:
 1628|  3.25k|{
 1629|  3.25k|    JSMallocBlockHeader *b;
 1630|  3.25k|    if (ptr == NULL) {
  ------------------
  |  Branch (1630:9): [True: 408, False: 2.84k]
  ------------------
 1631|    408|        return __js_malloc(s, size);
 1632|  2.84k|    } else if (size == 0) {
  ------------------
  |  Branch (1632:16): [True: 88, False: 2.75k]
  ------------------
 1633|     88|        __js_free(s, ptr);
 1634|     88|        return NULL;
 1635|     88|    }
 1636|  2.75k|    b = container_of(ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|  2.75k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1637|  2.75k|    if (b->u.block_idx == FREE_NIL) {
  ------------------
  |  |  251|  2.75k|#define FREE_NIL 0xffff
  ------------------
  |  Branch (1637:9): [True: 649, False: 2.10k]
  ------------------
 1638|    649|        if (b == get_zero_size_block(s)) {
  ------------------
  |  Branch (1638:13): [True: 0, False: 649]
  ------------------
 1639|      0|            return __js_malloc(s, size);
 1640|    649|        } else {
 1641|    649|            JSMallocLargeBlockHeader *lb, *new_lb;
 1642|    649|            lb = container_of(ptr, JSMallocLargeBlockHeader, header.user_data);
  ------------------
  |  |   51|    649|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1643|       |#ifdef JS_MALLOC_USE_ITER
 1644|       |            list_del(&lb->link);
 1645|       |#endif
 1646|    649|            new_lb = s->mf.js_realloc(&s->malloc_state, lb, sizeof(JSMallocLargeBlockHeader) + size);
 1647|    649|            if (!new_lb) {
  ------------------
  |  Branch (1647:17): [True: 0, False: 649]
  ------------------
 1648|       |#ifdef JS_MALLOC_USE_ITER
 1649|       |                /* add again in the list */
 1650|       |                list_add_tail(&lb->link, &s->large_block_list);
 1651|       |#endif
 1652|      0|                return NULL;
 1653|      0|            }
 1654|    649|            new_lb->header.u.block_idx = FREE_NIL;
  ------------------
  |  |  251|    649|#define FREE_NIL 0xffff
  ------------------
 1655|    649|            new_lb->header.block_size_idx = 0xff; /* fail safe */
 1656|       |#ifdef JS_MALLOC_USE_ITER
 1657|       |            list_add_tail(&new_lb->link, &s->large_block_list);
 1658|       |#endif
 1659|    649|            return new_lb->header.user_data;
 1660|    649|        }
 1661|  2.10k|    } else {
 1662|  2.10k|        unsigned int block_size_idx = b->block_size_idx;
 1663|  2.10k|        size_t block_size = js_malloc_block_sizes[block_size_idx];
 1664|  2.10k|        size_t total_size, old_size;
 1665|  2.10k|        void *new_ptr;
 1666|  2.10k|        JSMallocBlockHeader *new_b;
 1667|       |
 1668|  2.10k|        total_size = ((size + JS_MALLOC_ALIGN - 1) & ~(JS_MALLOC_ALIGN - 1)) +
  ------------------
  |  |  241|  2.10k|#define JS_MALLOC_ALIGN 8
  ------------------
                      total_size = ((size + JS_MALLOC_ALIGN - 1) & ~(JS_MALLOC_ALIGN - 1)) +
  ------------------
  |  |  241|  2.10k|#define JS_MALLOC_ALIGN 8
  ------------------
 1669|  2.10k|            sizeof(JSMallocBlockHeader);
 1670|  2.10k|        if (total_size <= block_size)
  ------------------
  |  Branch (1670:13): [True: 556, False: 1.54k]
  ------------------
 1671|    556|            return ptr;
 1672|  1.54k|        new_ptr = __js_malloc(s, size);
 1673|  1.54k|        if (!new_ptr)
  ------------------
  |  Branch (1673:13): [True: 0, False: 1.54k]
  ------------------
 1674|      0|            return NULL;
 1675|  1.54k|        new_b = container_of(new_ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|  1.54k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1676|       |        /* copy the GC data */
 1677|  1.54k|        new_b->gc_obj_type = b->gc_obj_type;
 1678|  1.54k|        new_b->mark = b->mark;
 1679|  1.54k|        new_b->ref_count = b->ref_count;
 1680|       |        /* copy the data */
 1681|  1.54k|        old_size = block_size - sizeof(JSMallocBlockHeader);
 1682|  1.54k|        if (size > old_size)
  ------------------
  |  Branch (1682:13): [True: 1.54k, False: 0]
  ------------------
 1683|  1.54k|            size = old_size;
 1684|  1.54k|        memcpy(new_ptr, ptr, size);
 1685|  1.54k|        __js_free(s, ptr);
 1686|  1.54k|        return new_ptr;
 1687|  1.54k|    }
 1688|  2.75k|}
quickjs.c:__js_malloc_usable_size:
 1691|  1.40k|{
 1692|  1.40k|    JSMallocBlockHeader *b;
 1693|  1.40k|    if (!ptr)
  ------------------
  |  Branch (1693:9): [True: 0, False: 1.40k]
  ------------------
 1694|      0|        return 0;
 1695|  1.40k|    b = container_of(ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|  1.40k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1696|  1.40k|    if (b->u.block_idx == FREE_NIL) {
  ------------------
  |  |  251|  1.40k|#define FREE_NIL 0xffff
  ------------------
  |  Branch (1696:9): [True: 545, False: 859]
  ------------------
 1697|    545|        if (b == get_zero_size_block(s)) {
  ------------------
  |  Branch (1697:13): [True: 0, False: 545]
  ------------------
 1698|      0|            return 0;
 1699|    545|        } else {
 1700|    545|            JSMallocLargeBlockHeader *lb;
 1701|    545|            size_t size;
 1702|    545|            lb = container_of(ptr, JSMallocLargeBlockHeader, header.user_data);
  ------------------
  |  |   51|    545|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1703|    545|            if (s->mf.js_malloc_usable_size) {
  ------------------
  |  Branch (1703:17): [True: 545, False: 0]
  ------------------
 1704|    545|                size = s->mf.js_malloc_usable_size(lb);
 1705|    545|                if (size != 0)
  ------------------
  |  Branch (1705:21): [True: 545, False: 0]
  ------------------
 1706|    545|                    size -= sizeof(JSMallocLargeBlockHeader);
 1707|    545|                return size;
 1708|    545|            } else {
 1709|      0|                return 0;
 1710|      0|            }
 1711|    545|        }
 1712|    859|    } else {
 1713|    859|        size_t block_size = js_malloc_block_sizes[b->block_size_idx];
 1714|    859|        return block_size - sizeof(*b);
 1715|    859|    }
 1716|  1.40k|}
quickjs.c:js_malloc_init:
 1466|     14|{
 1467|     14|    int i;
 1468|     14|    memset(s, 0, sizeof(*s));
 1469|     14|    get_zero_size_block(s)->u.block_idx = FREE_NIL;
  ------------------
  |  |  251|     14|#define FREE_NIL 0xffff
  ------------------
 1470|    448|    for(i = 0; i < JS_MALLOC_BLOCK_SIZE_COUNT; i++) {
  ------------------
  |  |  243|    448|#define JS_MALLOC_BLOCK_SIZE_COUNT 31
  ------------------
  |  Branch (1470:16): [True: 434, False: 14]
  ------------------
 1471|    434|        init_list_head(&s->arena_list[i]);
 1472|    434|        init_list_head(&s->free_arena_list[i]);
 1473|    434|    }
 1474|       |#ifdef JS_MALLOC_USE_ITER
 1475|       |    init_list_head(&s->large_block_list);
 1476|       |#endif
 1477|     14|}
quickjs.c:init_class_range:
 2017|     70|{
 2018|     70|    JSClassDef cm_s, *cm = &cm_s;
 2019|     70|    int i, class_id;
 2020|       |
 2021|    938|    for(i = 0; i < count; i++) {
  ------------------
  |  Branch (2021:16): [True: 868, False: 70]
  ------------------
 2022|    868|        class_id = i + start;
 2023|    868|        memset(cm, 0, sizeof(*cm));
 2024|    868|        cm->finalizer = tab[i].finalizer;
 2025|    868|        cm->gc_mark = tab[i].gc_mark;
 2026|    868|        if (JS_NewClass1(rt, class_id, cm, tab[i].class_name) < 0)
  ------------------
  |  Branch (2026:13): [True: 0, False: 868]
  ------------------
 2027|      0|            return -1;
 2028|    868|    }
 2029|     70|    return 0;
 2030|     70|}
quickjs.c:js_array_finalizer:
 6178|     48|{
 6179|     48|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|     48|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     48|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6180|     48|    int i;
 6181|       |
 6182|   343k|    for(i = 0; i < p->u.array.count; i++) {
  ------------------
  |  Branch (6182:16): [True: 343k, False: 48]
  ------------------
 6183|   343k|        JS_FreeValueRT(rt, p->u.array.u.values[i]);
 6184|   343k|    }
 6185|     48|    js_free_rt(rt, p->u.array.u.values);
 6186|     48|}
quickjs.c:js_array_mark:
 6190|    130|{
 6191|    130|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|    130|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    130|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6192|    130|    int i;
 6193|       |
 6194|   686k|    for(i = 0; i < p->u.array.count; i++) {
  ------------------
  |  Branch (6194:16): [True: 686k, False: 130]
  ------------------
 6195|   686k|        JS_MarkValue(rt, p->u.array.u.values[i], mark_func);
 6196|   686k|    }
 6197|    130|}
quickjs.c:js_object_data_finalizer:
 6200|     44|{
 6201|     44|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|     44|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     44|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6202|     44|    JS_FreeValueRT(rt, p->u.object_data);
 6203|     44|    p->u.object_data = JS_UNDEFINED;
  ------------------
  |  |  289|     44|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     44|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 6204|     44|}
quickjs.c:js_object_data_mark:
 6208|    162|{
 6209|    162|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|    162|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    162|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6210|    162|    JS_MarkValue(rt, p->u.object_data, mark_func);
 6211|    162|}
quickjs.c:js_c_function_finalizer:
 6214|  2.23k|{
 6215|  2.23k|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|  2.23k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  2.23k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6216|       |
 6217|  2.23k|    if (p->u.cfunc.realm)
  ------------------
  |  Branch (6217:9): [True: 2.23k, False: 0]
  ------------------
 6218|  2.23k|        JS_FreeContext(p->u.cfunc.realm);
 6219|  2.23k|}
quickjs.c:js_c_function_mark:
 6223|  8.47k|{
 6224|  8.47k|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|  8.47k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  8.47k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6225|       |
 6226|  8.47k|    if (p->u.cfunc.realm)
  ------------------
  |  Branch (6226:9): [True: 8.47k, False: 0]
  ------------------
 6227|  8.47k|        mark_func(rt, &p->u.cfunc.realm->header);
 6228|  8.47k|}
quickjs.c:js_bytecode_function_finalizer:
 6231|     28|{
 6232|     28|    JSObject *p1, *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|     28|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     28|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6233|     28|    JSFunctionBytecode *b;
 6234|     28|    JSVarRef **var_refs;
 6235|     28|    int i;
 6236|       |
 6237|     28|    p1 = p->u.func.home_object;
 6238|     28|    if (p1) {
  ------------------
  |  Branch (6238:9): [True: 0, False: 28]
  ------------------
 6239|      0|        JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_OBJECT, p1));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6240|      0|    }
 6241|     28|    b = p->u.func.function_bytecode;
 6242|     28|    if (b) {
  ------------------
  |  Branch (6242:9): [True: 28, False: 0]
  ------------------
 6243|     28|        var_refs = p->u.func.var_refs;
 6244|     28|        if (var_refs) {
  ------------------
  |  Branch (6244:13): [True: 26, False: 2]
  ------------------
 6245|     90|            for(i = 0; i < b->closure_var_count; i++)
  ------------------
  |  Branch (6245:24): [True: 64, False: 26]
  ------------------
 6246|     64|                free_var_ref(rt, var_refs[i]);
 6247|     26|            js_free_rt(rt, var_refs);
 6248|     26|        }
 6249|     28|        JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_FUNCTION_BYTECODE, b));
  ------------------
  |  |  246|     28|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6250|     28|    }
 6251|     28|}
quickjs.c:js_bytecode_function_mark:
 6255|     62|{
 6256|     62|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|     62|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     62|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6257|     62|    JSVarRef **var_refs = p->u.func.var_refs;
 6258|     62|    JSFunctionBytecode *b = p->u.func.function_bytecode;
 6259|     62|    int i;
 6260|       |
 6261|     62|    if (p->u.func.home_object) {
  ------------------
  |  Branch (6261:9): [True: 0, False: 62]
  ------------------
 6262|      0|        JS_MarkValue(rt, JS_MKPTR(JS_TAG_OBJECT, p->u.func.home_object),
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6263|      0|                     mark_func);
 6264|      0|    }
 6265|     62|    if (b) {
  ------------------
  |  Branch (6265:9): [True: 62, False: 0]
  ------------------
 6266|     62|        if (var_refs) {
  ------------------
  |  Branch (6266:13): [True: 62, False: 0]
  ------------------
 6267|    236|            for(i = 0; i < b->closure_var_count; i++) {
  ------------------
  |  Branch (6267:24): [True: 174, False: 62]
  ------------------
 6268|    174|                JSVarRef *var_ref = var_refs[i];
 6269|    174|                if (var_ref) {
  ------------------
  |  Branch (6269:21): [True: 174, False: 0]
  ------------------
 6270|    174|                    mark_func(rt, &var_ref->header);
 6271|    174|                }
 6272|    174|            }
 6273|     62|        }
 6274|       |        /* must mark the function bytecode because template objects may be
 6275|       |           part of a cycle */
 6276|     62|        JS_MarkValue(rt, JS_MKPTR(JS_TAG_FUNCTION_BYTECODE, b), mark_func);
  ------------------
  |  |  246|     62|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6277|     62|    }
 6278|     62|}
quickjs.c:js_c_function_data_finalizer:
 5991|     40|{
 5992|     40|    JSCFunctionDataRecord *s = JS_GetOpaque(val, JS_CLASS_C_FUNCTION_DATA);
 5993|     40|    int i;
 5994|       |
 5995|     40|    if (s) {
  ------------------
  |  Branch (5995:9): [True: 40, False: 0]
  ------------------
 5996|    106|        for(i = 0; i < s->data_len; i++) {
  ------------------
  |  Branch (5996:20): [True: 66, False: 40]
  ------------------
 5997|     66|            JS_FreeValueRT(rt, s->data[i]);
 5998|     66|        }
 5999|     40|        js_free_rt(rt, s);
 6000|     40|    }
 6001|     40|}
quickjs.c:js_c_function_data_mark:
 6005|     54|{
 6006|     54|    JSCFunctionDataRecord *s = JS_GetOpaque(val, JS_CLASS_C_FUNCTION_DATA);
 6007|     54|    int i;
 6008|       |
 6009|     54|    if (s) {
  ------------------
  |  Branch (6009:9): [True: 54, False: 0]
  ------------------
 6010|    108|        for(i = 0; i < s->data_len; i++) {
  ------------------
  |  Branch (6010:20): [True: 54, False: 54]
  ------------------
 6011|     54|            JS_MarkValue(rt, s->data[i], mark_func);
 6012|     54|        }
 6013|     54|    }
 6014|     54|}
quickjs.c:js_for_in_iterator_finalizer:
 6308|      2|{
 6309|      2|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 6310|      2|    JSForInIterator *it = p->u.for_in_iterator;
 6311|      2|    int i;
 6312|       |
 6313|      2|    JS_FreeValueRT(rt, it->obj);
 6314|      2|    if (!it->is_array) {
  ------------------
  |  Branch (6314:9): [True: 2, False: 0]
  ------------------
 6315|      2|        for(i = 0; i < it->atom_count; i++) {
  ------------------
  |  Branch (6315:20): [True: 0, False: 2]
  ------------------
 6316|      0|            JS_FreeAtomRT(rt, it->tab_atom[i].atom);
 6317|      0|        }
 6318|      2|        js_free_rt(rt, it->tab_atom);
 6319|      2|    }
 6320|      2|    js_free_rt(rt, it);
 6321|      2|}
quickjs.c:js_regexp_finalizer:
47246|      4|{
47247|      4|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|      4|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      4|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47248|      4|    JSRegExp *re = &p->u.regexp;
47249|      4|    if (re->bytecode != NULL)
  ------------------
  |  Branch (47249:9): [True: 4, False: 0]
  ------------------
47250|      4|        JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_STRING, re->bytecode));
  ------------------
  |  |  246|      4|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
47251|      4|    if (re->pattern != NULL)
  ------------------
  |  Branch (47251:9): [True: 4, False: 0]
  ------------------
47252|      4|        JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_STRING, re->pattern));
  ------------------
  |  |  246|      4|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
47253|      4|}
quickjs.c:js_array_iterator_finalizer:
43263|      1|{
43264|      1|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|      1|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
43265|      1|    JSArrayIteratorData *it = p->u.array_iterator_data;
43266|      1|    if (it) {
  ------------------
  |  Branch (43266:9): [True: 1, False: 0]
  ------------------
43267|      1|        JS_FreeValueRT(rt, it->obj);
43268|      1|        js_free_rt(rt, it);
43269|      1|    }
43270|      1|}
quickjs.c:js_array_iterator_mark:
43274|      2|{
43275|      2|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
43276|      2|    JSArrayIteratorData *it = p->u.array_iterator_data;
43277|      2|    if (it) {
  ------------------
  |  Branch (43277:9): [True: 2, False: 0]
  ------------------
43278|      2|        JS_MarkValue(rt, it->obj, mark_func);
43279|      2|    }
43280|      2|}
quickjs.c:async_func_free:
20822|     13|{
20823|     13|    if (--js_rc(s)->ref_count == 0) {
  ------------------
  |  Branch (20823:9): [True: 13, False: 0]
  ------------------
20824|     13|        if (rt->gc_phase != JS_GC_PHASE_REMOVE_CYCLES) {
  ------------------
  |  Branch (20824:13): [True: 13, False: 0]
  ------------------
20825|     13|            list_del(&s->header.link);
20826|     13|            list_add(&s->header.link, &rt->gc_zero_ref_count_list);
20827|     13|            if (rt->gc_phase == JS_GC_PHASE_NONE) {
  ------------------
  |  Branch (20827:17): [True: 13, False: 0]
  ------------------
20828|     13|                free_zero_refcount(rt);
20829|     13|            }
20830|     13|        }
20831|     13|    }
20832|     13|}
quickjs.c:js_global_object_finalizer:
17074|     14|{
17075|     14|    JSObject *p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|     14|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17076|     14|    JS_FreeValueRT(rt, p->u.global_object.uninitialized_vars);
17077|     14|}
quickjs.c:js_global_object_mark:
17081|     54|{
17082|     54|    JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|     54|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     54|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17083|     54|    JS_MarkValue(rt, p->u.global_object.uninitialized_vars, mark_func);
17084|     54|}
quickjs.c:js_def_malloc:
 2145|  1.91k|{
 2146|  1.91k|    void *ptr;
 2147|       |
 2148|       |    /* Do not allocate zero bytes: behavior is platform dependent */
 2149|  1.91k|    assert(size != 0);
  ------------------
  |  Branch (2149:5): [True: 0, False: 1.91k]
  |  Branch (2149:5): [True: 1.91k, False: 0]
  ------------------
 2150|       |
 2151|  1.91k|    if (unlikely(s->malloc_size + size > s->malloc_limit))
  ------------------
  |  |   33|  1.91k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.91k]
  |  |  ------------------
  ------------------
 2152|      0|        return NULL;
 2153|       |
 2154|  1.91k|    ptr = malloc(size);
 2155|  1.91k|    if (!ptr)
  ------------------
  |  Branch (2155:9): [True: 0, False: 1.91k]
  ------------------
 2156|      0|        return NULL;
 2157|       |
 2158|  1.91k|    s->malloc_count++;
 2159|  1.91k|    s->malloc_size += js_def_malloc_usable_size(ptr) + MALLOC_OVERHEAD;
  ------------------
  |  |   61|  1.91k|#define MALLOC_OVERHEAD  8
  ------------------
 2160|  1.91k|    return ptr;
 2161|  1.91k|}
quickjs.c:js_def_free:
 2164|  1.91k|{
 2165|  1.91k|    if (!ptr)
  ------------------
  |  Branch (2165:9): [True: 0, False: 1.91k]
  ------------------
 2166|      0|        return;
 2167|       |
 2168|  1.91k|    s->malloc_count--;
 2169|  1.91k|    s->malloc_size -= js_def_malloc_usable_size(ptr) + MALLOC_OVERHEAD;
  ------------------
  |  |   61|  1.91k|#define MALLOC_OVERHEAD  8
  ------------------
 2170|  1.91k|    free(ptr);
 2171|  1.91k|}
quickjs.c:js_def_realloc:
 2174|    649|{
 2175|    649|    size_t old_size;
 2176|       |
 2177|    649|    if (!ptr) {
  ------------------
  |  Branch (2177:9): [True: 0, False: 649]
  ------------------
 2178|      0|        if (size == 0)
  ------------------
  |  Branch (2178:13): [True: 0, False: 0]
  ------------------
 2179|      0|            return NULL;
 2180|      0|        return js_def_malloc(s, size);
 2181|      0|    }
 2182|    649|    old_size = js_def_malloc_usable_size(ptr);
 2183|    649|    if (size == 0) {
  ------------------
  |  Branch (2183:9): [True: 0, False: 649]
  ------------------
 2184|      0|        s->malloc_count--;
 2185|      0|        s->malloc_size -= old_size + MALLOC_OVERHEAD;
  ------------------
  |  |   61|      0|#define MALLOC_OVERHEAD  8
  ------------------
 2186|      0|        free(ptr);
 2187|      0|        return NULL;
 2188|      0|    }
 2189|    649|    if (s->malloc_size + size - old_size > s->malloc_limit)
  ------------------
  |  Branch (2189:9): [True: 0, False: 649]
  ------------------
 2190|      0|        return NULL;
 2191|       |
 2192|    649|    ptr = realloc(ptr, size);
 2193|    649|    if (!ptr)
  ------------------
  |  Branch (2193:9): [True: 0, False: 649]
  ------------------
 2194|      0|        return NULL;
 2195|       |
 2196|    649|    s->malloc_size += js_def_malloc_usable_size(ptr) - old_size;
 2197|    649|    return ptr;
 2198|    649|}
quickjs.c:js_def_malloc_usable_size:
 2129|  5.66k|{
 2130|       |#if defined(__APPLE__)
 2131|       |    return malloc_size(ptr);
 2132|       |#elif defined(_WIN32)
 2133|       |    return _msize((void *)ptr);
 2134|       |#elif defined(__EMSCRIPTEN__)
 2135|       |    return 0;
 2136|       |#elif defined(__linux__) || defined(__GLIBC__)
 2137|       |    return malloc_usable_size((void *)ptr);
 2138|       |#else
 2139|       |    /* change this to `return 0;` if compilation fails */
 2140|       |    return malloc_usable_size((void *)ptr);
 2141|       |#endif
 2142|  5.66k|}
quickjs.c:js_rc:
 1485|   505k|{
 1486|       |    return container_of(ptr, JSMallocBlockHeader, user_data);
  ------------------
  |  |   51|   505k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 1487|   505k|}
quickjs.c:atom_is_free:
 2336|  10.2k|{
 2337|  10.2k|    return (uintptr_t)p & 1;
 2338|  10.2k|}
quickjs.c:set_value:
 2656|  2.02M|{
 2657|  2.02M|    JSValue old_val;
 2658|  2.02M|    old_val = *pval;
 2659|  2.02M|    *pval = new_val;
 2660|  2.02M|    JS_FreeValue(ctx, old_val);
 2661|  2.02M|}
quickjs.c:js_free_modules:
 2684|     14|{
 2685|     14|    struct list_head *el, *el1;
 2686|     14|    list_for_each_safe(el, el1, &ctx->loaded_modules) {
  ------------------
  |  |   89|     14|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 14]
  |  |  ------------------
  |  |   90|     14|        el = el1, el1 = el->next)
  ------------------
 2687|      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)))
  |  |  ------------------
  ------------------
 2688|      0|        if (flag == JS_FREE_MODULE_ALL ||
  ------------------
  |  Branch (2688:13): [True: 0, False: 0]
  ------------------
 2689|      0|            (flag == JS_FREE_MODULE_NOT_RESOLVED && !m->resolved)) {
  ------------------
  |  Branch (2689:14): [True: 0, False: 0]
  |  Branch (2689:53): [True: 0, False: 0]
  ------------------
 2690|       |            /* warning: the module may be referenced elsewhere. It
 2691|       |               could be simpler to use an array instead of a list for
 2692|       |               'ctx->loaded_modules' */
 2693|      0|            list_del(&m->link);
 2694|      0|            m->link.prev = NULL;
 2695|      0|            m->link.next = NULL;
 2696|      0|            JS_FreeValue(ctx, JS_MKPTR(JS_TAG_MODULE, m));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 2697|      0|        }
 2698|      0|    }
 2699|     14|}
quickjs.c:update_stack_limit:
 2833|     28|{
 2834|     28|    if (rt->stack_size == 0) {
  ------------------
  |  Branch (2834:9): [True: 0, False: 28]
  ------------------
 2835|      0|        rt->stack_limit = 0; /* no limit */
 2836|     28|    } else {
 2837|     28|        rt->stack_limit = rt->stack_top - rt->stack_size;
 2838|     28|    }
 2839|     28|}
quickjs.c:js_get_stack_pointer:
 2046|  1.01M|{
 2047|  1.01M|    return (uintptr_t)__builtin_frame_address(0);
 2048|  1.01M|}
quickjs.c:JS_InitAtoms:
 3070|     14|{
 3071|     14|    int i, len, atom_type;
 3072|     14|    const char *p;
 3073|       |
 3074|     14|    rt->atom_hash_size = 0;
 3075|     14|    rt->atom_hash = NULL;
 3076|     14|    rt->atom_count = 0;
 3077|     14|    rt->atom_size = 0;
 3078|     14|    rt->atom_free_index = 0;
 3079|     14|    if (JS_ResizeAtomHash(rt, 512))     /* there are at least 504 predefined atoms */
  ------------------
  |  Branch (3079:9): [True: 0, False: 14]
  ------------------
 3080|      0|        return -1;
 3081|       |
 3082|     14|    p = js_atom_init;
 3083|  3.40k|    for(i = 1; i < JS_ATOM_END; i++) {
  ------------------
  |  Branch (3083:16): [True: 3.38k, False: 14]
  ------------------
 3084|  3.38k|        if (i == JS_ATOM_Private_brand)
  ------------------
  |  Branch (3084:13): [True: 14, False: 3.37k]
  ------------------
 3085|     14|            atom_type = JS_ATOM_TYPE_PRIVATE;
 3086|  3.37k|        else if (i >= JS_ATOM_Symbol_toPrimitive)
  ------------------
  |  Branch (3086:18): [True: 182, False: 3.19k]
  ------------------
 3087|    182|            atom_type = JS_ATOM_TYPE_SYMBOL;
 3088|  3.19k|        else
 3089|  3.19k|            atom_type = JS_ATOM_TYPE_STRING;
 3090|  3.38k|        len = strlen(p);
 3091|  3.38k|        if (__JS_NewAtomInit(rt, p, len, atom_type) == JS_ATOM_NULL)
  ------------------
  |  |  449|  3.38k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (3091:13): [True: 0, False: 3.38k]
  ------------------
 3092|      0|            return -1;
 3093|  3.38k|        p = p + len + 1;
 3094|  3.38k|    }
 3095|     14|    return 0;
 3096|     14|}
quickjs.c:JS_ResizeAtomHash:
 3040|     14|{
 3041|     14|    JSAtomStruct *p;
 3042|     14|    uint32_t new_hash_mask, h, i, hash_next1, j, *new_hash;
 3043|       |
 3044|     14|    assert((new_hash_size & (new_hash_size - 1)) == 0); /* power of two */
  ------------------
  |  Branch (3044:5): [True: 0, False: 14]
  |  Branch (3044:5): [True: 14, False: 0]
  ------------------
 3045|     14|    new_hash_mask = new_hash_size - 1;
 3046|     14|    new_hash = js_mallocz_rt(rt, sizeof(rt->atom_hash[0]) * new_hash_size);
 3047|     14|    if (!new_hash)
  ------------------
  |  Branch (3047:9): [True: 0, False: 14]
  ------------------
 3048|      0|        return -1;
 3049|     14|    for(i = 0; i < rt->atom_hash_size; i++) {
  ------------------
  |  Branch (3049:16): [True: 0, False: 14]
  ------------------
 3050|      0|        h = rt->atom_hash[i];
 3051|      0|        while (h != 0) {
  ------------------
  |  Branch (3051:16): [True: 0, False: 0]
  ------------------
 3052|      0|            p = rt->atom_array[h];
 3053|      0|            hash_next1 = p->hash_next;
 3054|       |            /* add in new hash table */
 3055|      0|            j = p->hash & new_hash_mask;
 3056|      0|            p->hash_next = new_hash[j];
 3057|      0|            new_hash[j] = h;
 3058|      0|            h = hash_next1;
 3059|      0|        }
 3060|      0|    }
 3061|     14|    js_free_rt(rt, rt->atom_hash);
 3062|     14|    rt->atom_hash = new_hash;
 3063|     14|    rt->atom_hash_size = new_hash_size;
 3064|     14|    rt->atom_count_resize = JS_ATOM_COUNT_RESIZE(new_hash_size);
  ------------------
  |  | 2866|     14|#define JS_ATOM_COUNT_RESIZE(n) ((n) * 2)
  ------------------
 3065|       |    //    JS_DumpAtoms(rt);
 3066|     14|    return 0;
 3067|     14|}
quickjs.c:__JS_AtomIsConst:
 2869|  1.41M|{
 2870|       |#if defined(DUMP_LEAKS) && DUMP_LEAKS > 1
 2871|       |        return (int32_t)v <= 0;
 2872|       |#else
 2873|  1.41M|        return (int32_t)v < JS_ATOM_END;
 2874|  1.41M|#endif
 2875|  1.41M|}
quickjs.c:is_digit:
 1948|  13.2k|static inline int is_digit(int c) {
 1949|  13.2k|    return c >= '0' && c <= '9';
  ------------------
  |  Branch (1949:12): [True: 13.2k, False: 4]
  |  Branch (1949:24): [True: 1, False: 13.2k]
  ------------------
 1950|  13.2k|}
quickjs.c:count_ascii:
 3441|  18.9k|{
 3442|  18.9k|    const uint8_t *p, *p_end;
 3443|  18.9k|    p = buf;
 3444|  18.9k|    p_end = buf + len;
 3445|   179k|    while (p < p_end && *p < 128)
  ------------------
  |  Branch (3445:12): [True: 160k, False: 18.8k]
  |  Branch (3445:25): [True: 160k, False: 37]
  ------------------
 3446|   160k|        p++;
 3447|  18.9k|    return p - buf;
 3448|  18.9k|}
quickjs.c:__JS_FindAtom:
 3341|  13.2k|{
 3342|  13.2k|    uint32_t h, h1, i;
 3343|  13.2k|    JSAtomStruct *p;
 3344|       |
 3345|  13.2k|    h = hash_string8((const uint8_t *)str, len, JS_ATOM_TYPE_STRING);
 3346|  13.2k|    h &= JS_ATOM_HASH_MASK;
  ------------------
  |  |  572|  13.2k|#define JS_ATOM_HASH_MASK  ((1 << 30) - 1)
  ------------------
 3347|  13.2k|    h1 = h & (rt->atom_hash_size - 1);
 3348|  13.2k|    i = rt->atom_hash[h1];
 3349|  21.1k|    while (i != 0) {
  ------------------
  |  Branch (3349:12): [True: 15.5k, False: 5.59k]
  ------------------
 3350|  15.5k|        p = rt->atom_array[i];
 3351|  15.5k|        if (p->hash == h &&
  ------------------
  |  Branch (3351:13): [True: 7.66k, False: 7.89k]
  ------------------
 3352|  7.66k|            p->atom_type == JS_ATOM_TYPE_STRING &&
  ------------------
  |  Branch (3352:13): [True: 7.66k, False: 0]
  ------------------
 3353|  7.66k|            p->len == len &&
  ------------------
  |  Branch (3353:13): [True: 7.66k, False: 0]
  ------------------
 3354|  7.66k|            p->is_wide_char == 0 &&
  ------------------
  |  Branch (3354:13): [True: 7.66k, False: 0]
  ------------------
 3355|  7.66k|            memcmp(p->u.str8, str, len) == 0) {
  ------------------
  |  Branch (3355:13): [True: 7.66k, False: 0]
  ------------------
 3356|  7.66k|            if (!__JS_AtomIsConst(i))
  ------------------
  |  Branch (3356:17): [True: 3.90k, False: 3.76k]
  ------------------
 3357|  3.90k|                js_rc(p)->ref_count++;
 3358|  7.66k|            return i;
 3359|  7.66k|        }
 3360|  7.89k|        i = p->hash_next;
 3361|  7.89k|    }
 3362|  5.59k|    return JS_ATOM_NULL;
  ------------------
  |  |  449|  5.59k|#define JS_ATOM_NULL 0
  ------------------
 3363|  13.2k|}
quickjs.c:hash_string8:
 2934|  22.1k|{
 2935|  22.1k|    size_t i;
 2936|       |
 2937|   204k|    for(i = 0; i < len; i++)
  ------------------
  |  Branch (2937:16): [True: 182k, False: 22.1k]
  ------------------
 2938|   182k|        h = h * 263 + str[i];
 2939|  22.1k|    return h;
 2940|  22.1k|}
quickjs.c:JS_NewAtomStr:
 3426|  5.66k|{
 3427|  5.66k|    JSRuntime *rt = ctx->rt;
 3428|  5.66k|    uint32_t n;
 3429|  5.66k|    if (is_num_string(&n, p)) {
  ------------------
  |  Branch (3429:9): [True: 0, False: 5.66k]
  ------------------
 3430|      0|        if (n <= JS_ATOM_MAX_INT) {
  ------------------
  |  | 2862|      0|#define JS_ATOM_MAX_INT (JS_ATOM_TAG_INT - 1)
  |  |  ------------------
  |  |  |  | 2861|      0|#define JS_ATOM_TAG_INT (1U << 31)
  |  |  ------------------
  ------------------
  |  Branch (3430:13): [True: 0, False: 0]
  ------------------
 3431|      0|            js_free_string(rt, p);
 3432|      0|            return __JS_AtomFromUInt32(n);
 3433|      0|        }
 3434|      0|    }
 3435|       |    /* XXX: should generate an exception */
 3436|  5.66k|    return __JS_NewAtom(rt, p, JS_ATOM_TYPE_STRING);
 3437|  5.66k|}
quickjs.c:is_num_string:
 2899|  5.73k|{
 2900|  5.73k|    uint32_t n;
 2901|  5.73k|    uint64_t n64;
 2902|  5.73k|    int c, i, len;
 2903|       |
 2904|  5.73k|    len = p->len;
 2905|  5.73k|    if (len == 0 || len > 10)
  ------------------
  |  Branch (2905:9): [True: 2, False: 5.73k]
  |  Branch (2905:21): [True: 1.51k, False: 4.22k]
  ------------------
 2906|  1.51k|        return FALSE;
 2907|  4.22k|    c = string_get(p, 0);
 2908|  4.22k|    if (is_num(c)) {
  ------------------
  |  Branch (2908:9): [True: 0, False: 4.22k]
  ------------------
 2909|      0|        if (c == '0') {
  ------------------
  |  Branch (2909:13): [True: 0, False: 0]
  ------------------
 2910|      0|            if (len != 1)
  ------------------
  |  Branch (2910:17): [True: 0, False: 0]
  ------------------
 2911|      0|                return FALSE;
 2912|      0|            n = 0;
 2913|      0|        } else {
 2914|      0|            n = c - '0';
 2915|      0|            for(i = 1; i < len; i++) {
  ------------------
  |  Branch (2915:24): [True: 0, False: 0]
  ------------------
 2916|      0|                c = string_get(p, i);
 2917|      0|                if (!is_num(c))
  ------------------
  |  Branch (2917:21): [True: 0, False: 0]
  ------------------
 2918|      0|                    return FALSE;
 2919|      0|                n64 = (uint64_t)n * 10 + (c - '0');
 2920|      0|                if ((n64 >> 32) != 0)
  ------------------
  |  Branch (2920:21): [True: 0, False: 0]
  ------------------
 2921|      0|                    return FALSE;
 2922|      0|                n = n64;
 2923|      0|            }
 2924|      0|        }
 2925|      0|        *pval = n;
 2926|      0|        return TRUE;
 2927|  4.22k|    } else {
 2928|  4.22k|        return FALSE;
 2929|  4.22k|    }
 2930|  4.22k|}
quickjs.c:is_num:
 2893|  4.22k|{
 2894|  4.22k|    return c >= '0' && c <= '9';
  ------------------
  |  Branch (2894:12): [True: 4.21k, False: 12]
  |  Branch (2894:24): [True: 0, False: 4.21k]
  ------------------
 2895|  4.22k|}
quickjs.c:js_free_string:
 2377|     55|{
 2378|     55|    if (--js_rc(str)->ref_count <= 0) {
  ------------------
  |  Branch (2378:9): [True: 11, False: 44]
  ------------------
 2379|     11|        if (str->atom_type) {
  ------------------
  |  Branch (2379:13): [True: 0, False: 11]
  ------------------
 2380|      0|            JS_FreeAtomStruct(rt, str);
 2381|     11|        } else {
 2382|       |#ifdef DUMP_LEAKS
 2383|       |            list_del(&str->link);
 2384|       |#endif
 2385|     11|            js_free_rt(rt, str);
 2386|     11|        }
 2387|     11|    }
 2388|     55|}
quickjs.c:__JS_AtomFromUInt32:
 2883|   343k|{
 2884|   343k|    return v | JS_ATOM_TAG_INT;
  ------------------
  |  | 2861|   343k|#define JS_ATOM_TAG_INT (1U << 31)
  ------------------
 2885|   343k|}
quickjs.c:__JS_NewAtom:
 3171|  9.06k|{
 3172|  9.06k|    uint32_t h, h1, i;
 3173|  9.06k|    JSAtomStruct *p;
 3174|  9.06k|    int len;
 3175|       |
 3176|       |#if 0
 3177|       |    printf("__JS_NewAtom: ");  JS_DumpString(rt, str); printf("\n");
 3178|       |#endif
 3179|  9.06k|    if (atom_type < JS_ATOM_TYPE_SYMBOL) {
  ------------------
  |  Branch (3179:9): [True: 8.86k, False: 196]
  ------------------
 3180|       |        /* str is not NULL */
 3181|  8.86k|        if (str->atom_type == atom_type) {
  ------------------
  |  Branch (3181:13): [True: 2, False: 8.86k]
  ------------------
 3182|       |            /* str is the atom, return its index */
 3183|      2|            i = js_get_atom_index(rt, str);
 3184|       |            /* reduce string refcount and increase atom's unless constant */
 3185|      2|            if (__JS_AtomIsConst(i))
  ------------------
  |  Branch (3185:17): [True: 2, False: 0]
  ------------------
 3186|      2|                js_rc(str)->ref_count--;
 3187|      2|            return i;
 3188|      2|        }
 3189|       |        /* try and locate an already registered atom */
 3190|  8.86k|        len = str->len;
 3191|  8.86k|        h = hash_string(str, atom_type);
 3192|  8.86k|        h &= JS_ATOM_HASH_MASK;
  ------------------
  |  |  572|  8.86k|#define JS_ATOM_HASH_MASK  ((1 << 30) - 1)
  ------------------
 3193|  8.86k|        h1 = h & (rt->atom_hash_size - 1);
 3194|  8.86k|        i = rt->atom_hash[h1];
 3195|  14.7k|        while (i != 0) {
  ------------------
  |  Branch (3195:16): [True: 5.91k, False: 8.80k]
  ------------------
 3196|  5.91k|            p = rt->atom_array[i];
 3197|  5.91k|            if (p->hash == h &&
  ------------------
  |  Branch (3197:17): [True: 55, False: 5.85k]
  ------------------
 3198|     55|                p->atom_type == atom_type &&
  ------------------
  |  Branch (3198:17): [True: 55, False: 0]
  ------------------
 3199|     55|                p->len == len &&
  ------------------
  |  Branch (3199:17): [True: 55, False: 0]
  ------------------
 3200|     55|                js_string_memcmp(p, 0, str, 0, len) == 0) {
  ------------------
  |  Branch (3200:17): [True: 55, False: 0]
  ------------------
 3201|     55|                if (!__JS_AtomIsConst(i))
  ------------------
  |  Branch (3201:21): [True: 55, False: 0]
  ------------------
 3202|     55|                    js_rc(p)->ref_count++;
 3203|     55|                goto done;
 3204|     55|            }
 3205|  5.85k|            i = p->hash_next;
 3206|  5.85k|        }
 3207|  8.86k|    } else {
 3208|    196|        h1 = 0; /* avoid warning */
 3209|    196|        if (atom_type == JS_ATOM_TYPE_SYMBOL) {
  ------------------
  |  Branch (3209:13): [True: 182, False: 14]
  ------------------
 3210|    182|            h = 0;
 3211|    182|        } else {
 3212|     14|            h = JS_ATOM_HASH_PRIVATE;
  ------------------
  |  |  573|     14|#define JS_ATOM_HASH_PRIVATE JS_ATOM_HASH_MASK
  |  |  ------------------
  |  |  |  |  572|     14|#define JS_ATOM_HASH_MASK  ((1 << 30) - 1)
  |  |  ------------------
  ------------------
 3213|     14|            atom_type = JS_ATOM_TYPE_SYMBOL;
 3214|     14|        }
 3215|    196|    }
 3216|       |
 3217|  9.00k|    if (rt->atom_free_index == 0) {
  ------------------
  |  Branch (3217:9): [True: 14, False: 8.99k]
  ------------------
 3218|       |        /* allow new atom entries */
 3219|     14|        uint32_t new_size, start;
 3220|     14|        JSAtomStruct **new_array;
 3221|       |
 3222|       |        /* alloc new with size progression 3/2:
 3223|       |           4 6 9 13 19 28 42 63 94 141 211 316 474 711 1066 1599 2398 3597 5395 8092
 3224|       |           preallocating space for predefined atoms (at least 504).
 3225|       |         */
 3226|     14|        new_size = max_int(711, rt->atom_size * 3 / 2);
 3227|     14|        if (new_size > JS_ATOM_MAX)
  ------------------
  |  | 2863|     14|#define JS_ATOM_MAX     ((1U << 30) - 1)
  ------------------
  |  Branch (3227:13): [True: 0, False: 14]
  ------------------
 3228|      0|            goto fail;
 3229|       |        /* XXX: should use realloc2 to use slack space */
 3230|     14|        new_array = js_realloc_rt(rt, rt->atom_array, sizeof(*new_array) * new_size);
 3231|     14|        if (!new_array)
  ------------------
  |  Branch (3231:13): [True: 0, False: 14]
  ------------------
 3232|      0|            goto fail;
 3233|       |        /* Note: the atom 0 is not used */
 3234|     14|        start = rt->atom_size;
 3235|     14|        if (start == 0) {
  ------------------
  |  Branch (3235:13): [True: 14, False: 0]
  ------------------
 3236|       |            /* JS_ATOM_NULL entry */
 3237|     14|            p = js_mallocz_rt(rt, sizeof(JSAtomStruct));
 3238|     14|            if (!p) {
  ------------------
  |  Branch (3238:17): [True: 0, False: 14]
  ------------------
 3239|      0|                js_free_rt(rt, new_array);
 3240|      0|                goto fail;
 3241|      0|            }
 3242|     14|            js_rc(p)->ref_count = 1;  /* not refcounted */
 3243|     14|            p->atom_type = JS_ATOM_TYPE_SYMBOL;
 3244|       |#ifdef DUMP_LEAKS
 3245|       |            list_add_tail(&p->link, &rt->string_list);
 3246|       |#endif
 3247|     14|            new_array[0] = p;
 3248|     14|            rt->atom_count++;
 3249|     14|            start = 1;
 3250|     14|        }
 3251|     14|        rt->atom_size = new_size;
 3252|     14|        rt->atom_array = new_array;
 3253|     14|        rt->atom_free_index = start;
 3254|  9.95k|        for(i = start; i < new_size; i++) {
  ------------------
  |  Branch (3254:24): [True: 9.94k, False: 14]
  ------------------
 3255|  9.94k|            uint32_t next;
 3256|  9.94k|            if (i == (new_size - 1))
  ------------------
  |  Branch (3256:17): [True: 14, False: 9.92k]
  ------------------
 3257|     14|                next = 0;
 3258|  9.92k|            else
 3259|  9.92k|                next = i + 1;
 3260|  9.94k|            rt->atom_array[i] = atom_set_free(next);
 3261|  9.94k|        }
 3262|     14|    }
 3263|       |
 3264|  9.00k|    if (str) {
  ------------------
  |  Branch (3264:9): [True: 9.00k, False: 0]
  ------------------
 3265|  9.00k|        if (str->atom_type == 0) {
  ------------------
  |  Branch (3265:13): [True: 9.00k, False: 0]
  ------------------
 3266|  9.00k|            p = str;
 3267|  9.00k|            p->atom_type = atom_type;
 3268|  9.00k|        } else {
 3269|      0|            p = js_malloc_rt(rt, sizeof(JSString) +
 3270|      0|                             (str->len << str->is_wide_char) +
 3271|      0|                             1 - str->is_wide_char);
 3272|      0|            if (unlikely(!p))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3273|      0|                goto fail;
 3274|      0|            js_rc(p)->ref_count = 1;
 3275|      0|            p->is_wide_char = str->is_wide_char;
 3276|      0|            p->len = str->len;
 3277|       |#ifdef DUMP_LEAKS
 3278|       |            list_add_tail(&p->link, &rt->string_list);
 3279|       |#endif
 3280|      0|            memcpy(p->u.str8, str->u.str8, (str->len << str->is_wide_char) +
 3281|      0|                   1 - str->is_wide_char);
 3282|      0|            js_free_string(rt, str);
 3283|      0|        }
 3284|  9.00k|    } else {
 3285|      0|        p = js_malloc_rt(rt, sizeof(JSAtomStruct)); /* empty wide string */
 3286|      0|        if (!p)
  ------------------
  |  Branch (3286:13): [True: 0, False: 0]
  ------------------
 3287|      0|            return JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
 3288|      0|        js_rc(p)->ref_count = 1;
 3289|      0|        p->is_wide_char = 1;    /* Hack to represent NULL as a JSString */
 3290|      0|        p->len = 0;
 3291|       |#ifdef DUMP_LEAKS
 3292|       |        list_add_tail(&p->link, &rt->string_list);
 3293|       |#endif
 3294|      0|    }
 3295|       |
 3296|       |    /* use an already free entry */
 3297|  9.00k|    i = rt->atom_free_index;
 3298|  9.00k|    rt->atom_free_index = atom_get_free(rt->atom_array[i]);
 3299|  9.00k|    rt->atom_array[i] = p;
 3300|       |
 3301|  9.00k|    p->hash = h;
 3302|  9.00k|    p->hash_next = i;   /* atom_index */
 3303|  9.00k|    p->atom_type = atom_type;
 3304|       |
 3305|  9.00k|    rt->atom_count++;
 3306|       |
 3307|  9.00k|    if (atom_type != JS_ATOM_TYPE_SYMBOL) {
  ------------------
  |  Branch (3307:9): [True: 8.80k, False: 196]
  ------------------
 3308|  8.80k|        p->hash_next = rt->atom_hash[h1];
 3309|  8.80k|        rt->atom_hash[h1] = i;
 3310|  8.80k|        if (unlikely(rt->atom_count >= rt->atom_count_resize))
  ------------------
  |  |   33|  8.80k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 8.80k]
  |  |  ------------------
  ------------------
 3311|      0|            JS_ResizeAtomHash(rt, rt->atom_hash_size * 2);
 3312|  8.80k|    }
 3313|       |
 3314|       |    //    JS_DumpAtoms(rt);
 3315|  9.00k|    return i;
 3316|       |
 3317|      0| fail:
 3318|      0|    i = JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
 3319|     55| done:
 3320|     55|    if (str)
  ------------------
  |  Branch (3320:9): [True: 55, False: 0]
  ------------------
 3321|     55|        js_free_string(rt, str);
 3322|     55|    return i;
 3323|      0|}
quickjs.c:hash_string:
 2953|  8.86k|{
 2954|  8.86k|    if (str->is_wide_char)
  ------------------
  |  Branch (2954:9): [True: 7, False: 8.85k]
  ------------------
 2955|      7|        h = hash_string16(str->u.str16, str->len, h);
 2956|  8.85k|    else
 2957|  8.85k|        h = hash_string8(str->u.str8, str->len, h);
 2958|  8.86k|    return h;
 2959|  8.86k|}
quickjs.c:hash_string16:
 2944|      7|{
 2945|      7|    size_t i;
 2946|       |
 2947|  4.90M|    for(i = 0; i < len; i++)
  ------------------
  |  Branch (2947:16): [True: 4.90M, False: 7]
  ------------------
 2948|  4.90M|        h = h * 263 + str[i];
 2949|      7|    return h;
 2950|      7|}
quickjs.c:js_string_memcmp:
 4579|  6.85k|{
 4580|  6.85k|    int res;
 4581|       |
 4582|  6.85k|    if (likely(!p1->is_wide_char)) {
  ------------------
  |  |   32|  6.85k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 6.85k, False: 0]
  |  |  ------------------
  ------------------
 4583|  6.85k|        if (likely(!p2->is_wide_char))
  ------------------
  |  |   32|  6.85k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 6.85k, False: 0]
  |  |  ------------------
  ------------------
 4584|  6.85k|            res = memcmp(p1->u.str8 + pos1, p2->u.str8 + pos2, len);
 4585|      0|        else
 4586|      0|            res = -memcmp16_8(p2->u.str16 + pos2, p1->u.str8 + pos1, len);
 4587|  6.85k|    } else {
 4588|      0|        if (!p2->is_wide_char)
  ------------------
  |  Branch (4588:13): [True: 0, False: 0]
  ------------------
 4589|      0|            res = memcmp16_8(p1->u.str16 + pos1, p2->u.str8 + pos2, len);
 4590|      0|        else
 4591|      0|            res = memcmp16(p1->u.str16 + pos1, p2->u.str16 + pos2, len);
 4592|      0|    }
 4593|  6.85k|    return res;
 4594|  6.85k|}
quickjs.c:atom_set_free:
 2341|  15.5k|{
 2342|  15.5k|    return (JSAtomStruct *)(((uintptr_t)v << 1) | 1);
 2343|  15.5k|}
quickjs.c:atom_get_free:
 2331|  9.00k|{
 2332|  9.00k|    return (uintptr_t)p >> 1;
 2333|  9.00k|}
quickjs.c:__JS_AtomToValue:
 3587|   287k|{
 3588|   287k|    char buf[ATOM_GET_STR_BUF_SIZE];
 3589|       |
 3590|   287k|    if (__JS_AtomIsTaggedInt(atom)) {
  ------------------
  |  Branch (3590:9): [True: 0, False: 287k]
  ------------------
 3591|      0|        size_t len = u32toa(buf, __JS_AtomToUInt32(atom));
 3592|      0|        return js_new_string8_len(ctx, buf, len);
 3593|   287k|    } else {
 3594|   287k|        JSRuntime *rt = ctx->rt;
 3595|   287k|        JSAtomStruct *p;
 3596|   287k|        assert(atom < rt->atom_size);
  ------------------
  |  Branch (3596:9): [True: 0, False: 287k]
  |  Branch (3596:9): [True: 287k, False: 0]
  ------------------
 3597|   287k|        p = rt->atom_array[atom];
 3598|   287k|        if (p->atom_type == JS_ATOM_TYPE_STRING) {
  ------------------
  |  Branch (3598:13): [True: 286k, False: 182]
  ------------------
 3599|   286k|            goto ret_string;
 3600|   286k|        } else if (force_string) {
  ------------------
  |  Branch (3600:20): [True: 0, False: 182]
  ------------------
 3601|      0|            if (p->len == 0 && p->is_wide_char != 0) {
  ------------------
  |  Branch (3601:17): [True: 0, False: 0]
  |  Branch (3601:32): [True: 0, False: 0]
  ------------------
 3602|       |                /* no description string */
 3603|      0|                p = rt->atom_array[JS_ATOM_empty_string];
 3604|      0|            }
 3605|   286k|        ret_string:
 3606|   286k|            return JS_DupValue(ctx, JS_MKPTR(JS_TAG_STRING, p));
  ------------------
  |  |  246|   286k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3607|    182|        } else {
 3608|    182|            return JS_DupValue(ctx, JS_MKPTR(JS_TAG_SYMBOL, p));
  ------------------
  |  |  246|    182|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3609|    182|        }
 3610|   287k|    }
 3611|   287k|}
quickjs.c:__JS_FreeAtom:
 3415|  17.6k|{
 3416|  17.6k|    JSAtomStruct *p;
 3417|       |
 3418|  17.6k|    p = rt->atom_array[i];
 3419|  17.6k|    if (--js_rc(p)->ref_count > 0)
  ------------------
  |  Branch (3419:9): [True: 12.5k, False: 5.14k]
  ------------------
 3420|  12.5k|        return;
 3421|  5.14k|    JS_FreeAtomStruct(rt, p);
 3422|  5.14k|}
quickjs.c:__JS_NewAtomInit:
 3328|  3.40k|{
 3329|  3.40k|    JSString *p;
 3330|  3.40k|    p = js_alloc_string_rt(rt, len, 0);
 3331|  3.40k|    if (!p)
  ------------------
  |  Branch (3331:9): [True: 0, False: 3.40k]
  ------------------
 3332|      0|        return JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
 3333|  3.40k|    memcpy(p->u.str8, str, len);
 3334|  3.40k|    p->u.str8[len] = '\0';
 3335|  3.40k|    return __JS_NewAtom(rt, p, atom_type);
 3336|  3.40k|}
quickjs.c:js_alloc_string_rt:
 2347|  81.8k|{
 2348|  81.8k|    JSString *str;
 2349|  81.8k|    str = js_malloc_rt(rt, sizeof(JSString) + (max_len << is_wide_char) + 1 - is_wide_char);
 2350|  81.8k|    if (unlikely(!str))
  ------------------
  |  |   33|  81.8k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 81.8k]
  |  |  ------------------
  ------------------
 2351|      0|        return NULL;
 2352|  81.8k|    js_rc(str)->ref_count = 1;
 2353|  81.8k|    str->is_wide_char = is_wide_char;
 2354|  81.8k|    str->len = max_len;
 2355|  81.8k|    str->atom_type = 0;
 2356|  81.8k|    str->hash = 0;          /* optional but costless */
 2357|  81.8k|    str->hash_next = 0;     /* optional */
 2358|       |#ifdef DUMP_LEAKS
 2359|       |    list_add_tail(&str->link, &rt->string_list);
 2360|       |#endif
 2361|  81.8k|    return str;
 2362|  81.8k|}
quickjs.c:JS_NewClass1:
 3850|    881|{
 3851|    881|    int new_size, i;
 3852|    881|    JSClass *cl, *new_class_array;
 3853|    881|    struct list_head *el;
 3854|       |
 3855|    881|    if (class_id >= (1 << 16))
  ------------------
  |  Branch (3855:9): [True: 0, False: 881]
  ------------------
 3856|      0|        return -1;
 3857|    881|    if (class_id < rt->class_count &&
  ------------------
  |  Branch (3857:9): [True: 854, False: 27]
  ------------------
 3858|    854|        rt->class_array[class_id].class_id != 0)
  ------------------
  |  Branch (3858:9): [True: 0, False: 854]
  ------------------
 3859|      0|        return -1;
 3860|       |
 3861|    881|    if (class_id >= rt->class_count) {
  ------------------
  |  Branch (3861:9): [True: 27, False: 854]
  ------------------
 3862|     27|        new_size = max_int(JS_CLASS_INIT_COUNT,
 3863|     27|                           max_int(class_id + 1, rt->class_count * 3 / 2));
 3864|       |
 3865|       |        /* reallocate the context class prototype array, if any */
 3866|     27|        list_for_each(el, &rt->context_list) {
  ------------------
  |  |   86|     40|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 13, False: 27]
  |  |  ------------------
  ------------------
 3867|     13|            JSContext *ctx = list_entry(el, JSContext, link);
  ------------------
  |  |   39|     13|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|     13|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 3868|     13|            JSValue *new_tab;
 3869|     13|            new_tab = js_realloc_rt(rt, ctx->class_proto,
 3870|     13|                                    sizeof(ctx->class_proto[0]) * new_size);
 3871|     13|            if (!new_tab)
  ------------------
  |  Branch (3871:17): [True: 0, False: 13]
  ------------------
 3872|      0|                return -1;
 3873|    416|            for(i = rt->class_count; i < new_size; i++)
  ------------------
  |  Branch (3873:38): [True: 403, False: 13]
  ------------------
 3874|    403|                new_tab[i] = JS_NULL;
  ------------------
  |  |  288|    403|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|    416|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 3875|     13|            ctx->class_proto = new_tab;
 3876|     13|        }
 3877|       |        /* reallocate the class array */
 3878|     27|        new_class_array = js_realloc_rt(rt, rt->class_array,
 3879|     27|                                        sizeof(JSClass) * new_size);
 3880|     27|        if (!new_class_array)
  ------------------
  |  Branch (3880:13): [True: 0, False: 27]
  ------------------
 3881|      0|            return -1;
 3882|     27|        memset(new_class_array + rt->class_count, 0,
 3883|     27|               (new_size - rt->class_count) * sizeof(JSClass));
 3884|     27|        rt->class_array = new_class_array;
 3885|     27|        rt->class_count = new_size;
 3886|     27|    }
 3887|    881|    cl = &rt->class_array[class_id];
 3888|    881|    cl->class_id = class_id;
 3889|    881|    cl->class_name = JS_DupAtomRT(rt, name);
 3890|    881|    cl->finalizer = class_def->finalizer;
 3891|    881|    cl->gc_mark = class_def->gc_mark;
 3892|    881|    cl->call = class_def->call;
 3893|    881|    cl->exotic = class_def->exotic;
 3894|    881|    return 0;
 3895|    881|}
quickjs.c:JS_DupAtomRT:
 3099|    881|{
 3100|    881|    JSAtomStruct *p;
 3101|       |
 3102|    881|    if (!__JS_AtomIsConst(v)) {
  ------------------
  |  Branch (3102:9): [True: 13, False: 868]
  ------------------
 3103|     13|        p = rt->atom_array[v];
 3104|     13|        js_rc(p)->ref_count++;
 3105|     13|    }
 3106|    881|    return v;
 3107|    881|}
quickjs.c:js_new_string8_len:
 3915|   276k|{
 3916|   276k|    JSString *str;
 3917|       |
 3918|   276k|    if (len <= 0) {
  ------------------
  |  Branch (3918:9): [True: 270k, False: 5.64k]
  ------------------
 3919|   270k|        return JS_AtomToString(ctx, JS_ATOM_empty_string);
 3920|   270k|    }
 3921|  5.64k|    str = js_alloc_string(ctx, len, 0);
 3922|  5.64k|    if (!str)
  ------------------
  |  Branch (3922:9): [True: 0, False: 5.64k]
  ------------------
 3923|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 3924|  5.64k|    memcpy(str->u.str8, buf, len);
 3925|  5.64k|    str->u.str8[len] = '\0';
 3926|  5.64k|    return JS_MKPTR(JS_TAG_STRING, str);
  ------------------
  |  |  246|  5.64k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3927|  5.64k|}
quickjs.c:string_buffer_init:
 4018|    139|{
 4019|    139|    return string_buffer_init2(ctx, s, size, 0);
 4020|    139|}
quickjs.c:string_buffer_write8:
 4187|  71.4k|{
 4188|  71.4k|    int i;
 4189|       |
 4190|  71.4k|    if (s->len + len > s->size) {
  ------------------
  |  Branch (4190:9): [True: 45, False: 71.3k]
  ------------------
 4191|     45|        if (string_buffer_realloc(s, s->len + len, 0))
  ------------------
  |  Branch (4191:13): [True: 0, False: 45]
  ------------------
 4192|      0|            return -1;
 4193|     45|    }
 4194|  71.4k|    if (s->is_wide_char) {
  ------------------
  |  Branch (4194:9): [True: 71.4k, False: 34]
  ------------------
 4195|  1.31M|        for (i = 0; i < len; i++) {
  ------------------
  |  Branch (4195:21): [True: 1.24M, False: 71.4k]
  ------------------
 4196|  1.24M|            s->str->u.str16[s->len + i] = p[i];
 4197|  1.24M|        }
 4198|  71.4k|        s->len += len;
 4199|  71.4k|    } else {
 4200|     34|        memcpy(&s->str->u.str8[s->len], p, len);
 4201|     34|        s->len += len;
 4202|     34|    }
 4203|  71.4k|    return 0;
 4204|  71.4k|}
quickjs.c:string_buffer_realloc:
 4060|    434|{
 4061|    434|    JSString *new_str;
 4062|    434|    int new_size;
 4063|    434|    size_t new_size_bytes, slack;
 4064|       |
 4065|    434|    if (s->error_status)
  ------------------
  |  Branch (4065:9): [True: 0, False: 434]
  ------------------
 4066|      0|        return -1;
 4067|       |
 4068|    434|    if (new_len > JS_STRING_LEN_MAX) {
  ------------------
  |  |  210|    434|#define JS_STRING_LEN_MAX ((1 << 30) - 1)
  ------------------
  |  Branch (4068:9): [True: 0, False: 434]
  ------------------
 4069|      0|        JS_ThrowInternalError(s->ctx, "string too long");
 4070|      0|        return string_buffer_set_error(s);
 4071|      0|    }
 4072|    434|    new_size = min_int(max_int(new_len, s->size * 3 / 2), JS_STRING_LEN_MAX);
  ------------------
  |  |  210|    434|#define JS_STRING_LEN_MAX ((1 << 30) - 1)
  ------------------
 4073|    434|    if (!s->is_wide_char && c >= 0x100) {
  ------------------
  |  Branch (4073:9): [True: 252, False: 182]
  |  Branch (4073:29): [True: 4, False: 248]
  ------------------
 4074|      4|        return string_buffer_widen(s, new_size);
 4075|      4|    }
 4076|    430|    new_size_bytes = sizeof(JSString) + (new_size << s->is_wide_char) + 1 - s->is_wide_char;
 4077|    430|    new_str = js_realloc2(s->ctx, s->str, new_size_bytes, &slack);
 4078|    430|    if (!new_str)
  ------------------
  |  Branch (4078:9): [True: 0, False: 430]
  ------------------
 4079|      0|        return string_buffer_set_error(s);
 4080|    430|    new_size = min_int(new_size + (slack >> s->is_wide_char), JS_STRING_LEN_MAX);
  ------------------
  |  |  210|    430|#define JS_STRING_LEN_MAX ((1 << 30) - 1)
  ------------------
 4081|    430|    s->size = new_size;
 4082|    430|    s->str = new_str;
 4083|    430|    return 0;
 4084|    430|}
quickjs.c:string_buffer_widen:
 4038|     20|{
 4039|     20|    JSString *str;
 4040|     20|    size_t slack;
 4041|     20|    int i;
 4042|       |
 4043|     20|    if (s->error_status)
  ------------------
  |  Branch (4043:9): [True: 0, False: 20]
  ------------------
 4044|      0|        return -1;
 4045|       |
 4046|     20|    str = js_realloc2(s->ctx, s->str, sizeof(JSString) + (size << 1), &slack);
 4047|     20|    if (!str)
  ------------------
  |  Branch (4047:9): [True: 0, False: 20]
  ------------------
 4048|      0|        return string_buffer_set_error(s);
 4049|     20|    size += slack >> 1;
 4050|  1.26M|    for(i = s->len; i-- > 0;) {
  ------------------
  |  Branch (4050:21): [True: 1.26M, False: 20]
  ------------------
 4051|  1.26M|        str->u.str16[i] = str->u.str8[i];
 4052|  1.26M|    }
 4053|     20|    s->is_wide_char = 1;
 4054|     20|    s->size = size;
 4055|     20|    s->str = str;
 4056|     20|    return 0;
 4057|     20|}
quickjs.c:string_buffer_putc8:
 4106|  2.49M|{
 4107|  2.49M|    if (unlikely(s->len >= s->size)) {
  ------------------
  |  |   33|  2.49M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 2.49M]
  |  |  ------------------
  ------------------
 4108|      2|        if (string_buffer_realloc(s, s->len + 1, c))
  ------------------
  |  Branch (4108:13): [True: 0, False: 2]
  ------------------
 4109|      0|            return -1;
 4110|      2|    }
 4111|  2.49M|    if (s->is_wide_char) {
  ------------------
  |  Branch (4111:9): [True: 2.49M, False: 27]
  ------------------
 4112|  2.49M|        s->str->u.str16[s->len++] = c;
 4113|  2.49M|    } else {
 4114|     27|        s->str->u.str8[s->len++] = c;
 4115|     27|    }
 4116|  2.49M|    return 0;
 4117|  2.49M|}
quickjs.c:string_buffer_putc16:
 4121|  1.62M|{
 4122|  1.62M|    if (likely(s->len < s->size)) {
  ------------------
  |  |   32|  1.62M|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 1.62M, False: 383]
  |  |  ------------------
  ------------------
 4123|  1.62M|        if (s->is_wide_char) {
  ------------------
  |  Branch (4123:13): [True: 1.62M, False: 914]
  ------------------
 4124|  1.62M|            s->str->u.str16[s->len++] = c;
 4125|  1.62M|            return 0;
 4126|  1.62M|        } else if (c < 0x100) {
  ------------------
  |  Branch (4126:20): [True: 898, False: 16]
  ------------------
 4127|    898|            s->str->u.str8[s->len++] = c;
 4128|    898|            return 0;
 4129|    898|        }
 4130|  1.62M|    }
 4131|    399|    return string_buffer_putc16_slow(s, c);
 4132|  1.62M|}
quickjs.c:string_buffer_putc16_slow:
 4087|    399|{
 4088|    399|    if (unlikely(s->len >= s->size)) {
  ------------------
  |  |   33|    399|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 383, False: 16]
  |  |  ------------------
  ------------------
 4089|    383|        if (string_buffer_realloc(s, s->len + 1, c))
  ------------------
  |  Branch (4089:13): [True: 0, False: 383]
  ------------------
 4090|      0|            return -1;
 4091|    383|    }
 4092|    399|    if (s->is_wide_char) {
  ------------------
  |  Branch (4092:9): [True: 144, False: 255]
  ------------------
 4093|    144|        s->str->u.str16[s->len++] = c;
 4094|    255|    } else if (c < 0x100) {
  ------------------
  |  Branch (4094:16): [True: 239, False: 16]
  ------------------
 4095|    239|        s->str->u.str8[s->len++] = c;
 4096|    239|    } else {
 4097|     16|        if (string_buffer_widen(s, s->size))
  ------------------
  |  Branch (4097:13): [True: 0, False: 16]
  ------------------
 4098|      0|            return -1;
 4099|     16|        s->str->u.str16[s->len++] = c;
 4100|     16|    }
 4101|    399|    return 0;
 4102|    399|}
quickjs.c:string_buffer_end:
 4316|    141|{
 4317|    141|    JSString *str;
 4318|    141|    str = s->str;
 4319|    141|    if (s->error_status)
  ------------------
  |  Branch (4319:9): [True: 0, False: 141]
  ------------------
 4320|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 4321|    141|    if (s->len == 0) {
  ------------------
  |  Branch (4321:9): [True: 8, False: 133]
  ------------------
 4322|      8|        js_free(s->ctx, str);
 4323|      8|        s->str = NULL;
 4324|      8|        return JS_AtomToString(s->ctx, JS_ATOM_empty_string);
 4325|      8|    }
 4326|    133|    if (s->len < s->size) {
  ------------------
  |  Branch (4326:9): [True: 128, False: 5]
  ------------------
 4327|       |        /* smaller size so js_realloc should not fail, but OK if it does */
 4328|       |        /* XXX: should add some slack to avoid unnecessary calls */
 4329|       |        /* XXX: might need to use malloc+free to ensure smaller size */
 4330|    128|        str = js_realloc_rt(s->ctx->rt, str, sizeof(JSString) +
 4331|    128|                            (s->len << s->is_wide_char) + 1 - s->is_wide_char);
 4332|    128|        if (str == NULL)
  ------------------
  |  Branch (4332:13): [True: 0, False: 128]
  ------------------
 4333|      0|            str = s->str;
 4334|    128|        s->str = str;
 4335|    128|    }
 4336|    133|    if (!s->is_wide_char)
  ------------------
  |  Branch (4336:9): [True: 112, False: 21]
  ------------------
 4337|    112|        str->u.str8[s->len] = 0;
 4338|       |#ifdef DUMP_LEAKS
 4339|       |    list_add_tail(&str->link, &s->ctx->rt->string_list);
 4340|       |#endif
 4341|    133|    str->is_wide_char = s->is_wide_char;
 4342|    133|    str->len = s->len;
 4343|    133|    s->str = NULL;
 4344|    133|    return JS_MKPTR(JS_TAG_STRING, str);
  ------------------
  |  |  246|    133|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 4345|    141|}
quickjs.c:string_buffer_free:
 4023|      1|{
 4024|      1|    js_free(s->ctx, s->str);
 4025|       |    s->str = NULL;
 4026|      1|}
quickjs.c:js_alloc_string:
 2365|  78.4k|{
 2366|  78.4k|    JSString *p;
 2367|  78.4k|    p = js_alloc_string_rt(ctx->rt, max_len, is_wide_char);
 2368|  78.4k|    if (unlikely(!p)) {
  ------------------
  |  |   33|  78.4k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 78.4k]
  |  |  ------------------
  ------------------
 2369|      0|        JS_ThrowOutOfMemory(ctx);
 2370|      0|        return NULL;
 2371|      0|    }
 2372|  78.4k|    return p;
 2373|  78.4k|}
quickjs.c:init_shape_hash:
 5124|     14|{
 5125|     14|    rt->shape_hash_bits = 4;   /* 16 shapes */
 5126|     14|    rt->shape_hash_size = 1 << rt->shape_hash_bits;
 5127|     14|    rt->shape_hash_count = 0;
 5128|     14|    rt->shape_hash = js_mallocz_rt(rt, sizeof(rt->shape_hash[0]) *
 5129|     14|                                   rt->shape_hash_size);
 5130|     14|    if (!rt->shape_hash)
  ------------------
  |  Branch (5130:9): [True: 0, False: 14]
  ------------------
 5131|      0|        return -1;
 5132|     14|    return 0;
 5133|     14|}
quickjs.c:js_free_shape_null:
 5319|     70|{
 5320|     70|    if (sh)
  ------------------
  |  Branch (5320:9): [True: 70, False: 0]
  ------------------
 5321|     70|        js_free_shape(rt, sh);
 5322|     70|}
quickjs.c:js_free_shape:
 5312|  5.98k|{
 5313|  5.98k|    if (unlikely(--js_rc(sh)->ref_count <= 0)) {
  ------------------
  |  |   33|  5.98k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 3.43k, False: 2.55k]
  |  |  ------------------
  ------------------
 5314|  3.43k|        js_free_shape0(rt, sh);
 5315|  3.43k|    }
 5316|  5.98k|}
quickjs.c:js_free_shape0:
 5292|  3.43k|{
 5293|  3.43k|    uint32_t i;
 5294|  3.43k|    JSShapeProperty *pr;
 5295|       |
 5296|  3.43k|    assert(js_rc(sh)->ref_count == 0);
  ------------------
  |  Branch (5296:5): [True: 0, False: 3.43k]
  |  Branch (5296:5): [True: 3.43k, False: 0]
  ------------------
 5297|  3.43k|    if (sh->is_hashed)
  ------------------
  |  Branch (5297:9): [True: 1.88k, False: 1.55k]
  ------------------
 5298|  1.88k|        js_shape_hash_unlink(rt, sh);
 5299|  3.43k|    if (sh->proto != NULL) {
  ------------------
  |  Branch (5299:9): [True: 3.35k, False: 72]
  ------------------
 5300|  3.35k|        JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_OBJECT, sh->proto));
  ------------------
  |  |  246|  3.35k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 5301|  3.35k|    }
 5302|  3.43k|    pr = get_shape_prop(sh);
 5303|  18.0k|    for(i = 0; i < sh->prop_count; i++) {
  ------------------
  |  Branch (5303:16): [True: 14.5k, False: 3.43k]
  ------------------
 5304|  14.5k|        JS_FreeAtomRT(rt, pr->atom);
 5305|  14.5k|        pr++;
 5306|  14.5k|    }
 5307|  3.43k|    remove_gc_object(&sh->header);
 5308|  3.43k|    js_free_rt(rt, sh);
 5309|  3.43k|}
quickjs.c:js_shape_hash_unlink:
 5192|  5.45k|{
 5193|  5.45k|    uint32_t h;
 5194|  5.45k|    JSShape **psh;
 5195|       |
 5196|  5.45k|    h = get_shape_hash(sh->hash, rt->shape_hash_bits);
 5197|  5.45k|    psh = &rt->shape_hash[h];
 5198|  5.46k|    while (*psh != sh)
  ------------------
  |  Branch (5198:12): [True: 15, False: 5.45k]
  ------------------
 5199|     15|        psh = &(*psh)->shape_hash_next;
 5200|  5.45k|    *psh = sh->shape_hash_next;
 5201|  5.45k|    rt->shape_hash_count--;
 5202|  5.45k|}
quickjs.c:get_shape_hash:
 5143|  17.9k|{
 5144|  17.9k|    return h >> (32 - hash_bits);
 5145|  17.9k|}
quickjs.c:get_proto_obj:
 5726|  3.44k|{
 5727|  3.44k|    if (JS_VALUE_GET_TAG(proto_val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|  3.44k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5727:9): [True: 72, False: 3.37k]
  ------------------
 5728|     72|        return NULL;
 5729|  3.37k|    else
 5730|  3.37k|        return JS_VALUE_GET_OBJ(proto_val);
  ------------------
  |  |  227|  3.37k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  3.37k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5731|  3.44k|}
quickjs.c:find_hashed_shape_proto:
 5506|  1.84k|{
 5507|  1.84k|    JSShape *sh1;
 5508|  1.84k|    uint32_t h, h1;
 5509|       |
 5510|  1.84k|    h = shape_initial_hash(proto);
 5511|  1.84k|    h1 = get_shape_hash(h, rt->shape_hash_bits);
 5512|  2.21k|    for(sh1 = rt->shape_hash[h1]; sh1 != NULL; sh1 = sh1->shape_hash_next) {
  ------------------
  |  Branch (5512:35): [True: 1.23k, False: 983]
  ------------------
 5513|  1.23k|        if (sh1->hash == h &&
  ------------------
  |  Branch (5513:13): [True: 866, False: 368]
  ------------------
 5514|    866|            sh1->proto == proto &&
  ------------------
  |  Branch (5514:13): [True: 866, False: 0]
  ------------------
 5515|    866|            sh1->prop_count == 0) {
  ------------------
  |  Branch (5515:13): [True: 866, False: 0]
  ------------------
 5516|    866|            return sh1;
 5517|    866|        }
 5518|  1.23k|    }
 5519|    983|    return NULL;
 5520|  1.84k|}
quickjs.c:shape_initial_hash:
 5148|  2.90k|{
 5149|  2.90k|    uint32_t h;
 5150|  2.90k|    h = shape_hash(1, (uintptr_t)proto);
 5151|  2.90k|    if (sizeof(proto) > 4)
  ------------------
  |  Branch (5151:9): [True: 2.90k, Folded]
  ------------------
 5152|  2.90k|        h = shape_hash(h, (uint64_t)(uintptr_t)proto >> 32);
 5153|  2.90k|    return h;
 5154|  2.90k|}
quickjs.c:shape_hash:
 5137|  23.0k|{
 5138|  23.0k|    return (h + val) * 0x9e370001;
 5139|  23.0k|}
quickjs.c:js_dup_shape:
 5286|  2.55k|{
 5287|  2.55k|    js_rc(sh)->ref_count++;
 5288|  2.55k|    return sh;
 5289|  2.55k|}
quickjs.c:js_new_shape:
 5252|    983|{
 5253|    983|    return js_new_shape2(ctx, proto, JS_PROP_INITIAL_HASH_SIZE,
  ------------------
  |  |  958|    983|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
 5254|    983|                         JS_PROP_INITIAL_SIZE);
  ------------------
  |  |  957|    983|#define JS_PROP_INITIAL_SIZE 2
  ------------------
 5255|    983|}
quickjs.c:JS_NewObjectFromShape:
 5606|  3.41k|{
 5607|  3.41k|    JSObject *p;
 5608|  3.41k|    int i;
 5609|       |    
 5610|  3.41k|    js_trigger_gc(ctx->rt, sizeof(JSObject));
 5611|  3.41k|    p = js_malloc(ctx, sizeof(JSObject));
 5612|  3.41k|    if (unlikely(!p))
  ------------------
  |  |   33|  3.41k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 3.41k]
  |  |  ------------------
  ------------------
 5613|      0|        goto fail;
 5614|  3.41k|    p->class_id = class_id;
 5615|  3.41k|    p->is_std_array_prototype = 0;
 5616|  3.41k|    p->extensible = TRUE;
 5617|  3.41k|    p->free_mark = 0;
 5618|  3.41k|    p->is_exotic = 0;
 5619|  3.41k|    p->fast_array = 0;
 5620|  3.41k|    p->is_constructor = 0;
 5621|  3.41k|    p->has_immutable_prototype = 0;
 5622|  3.41k|    p->tmp_mark = 0;
 5623|  3.41k|    p->is_HTMLDDA = 0;
 5624|  3.41k|    p->weakref_count = 0;
 5625|  3.41k|    p->u.opaque = NULL;
 5626|  3.41k|    p->shape = sh;
 5627|  3.41k|    p->prop = js_malloc(ctx, sizeof(JSProperty) * sh->prop_size);
 5628|  3.41k|    if (unlikely(!p->prop)) {
  ------------------
  |  |   33|  3.41k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 3.41k]
  |  |  ------------------
  ------------------
 5629|      0|        js_free(ctx, p);
 5630|      0|    fail:
 5631|      0|        if (props) {
  ------------------
  |  Branch (5631:13): [True: 0, False: 0]
  ------------------
 5632|      0|            JSShapeProperty *prs = get_shape_prop(sh);
 5633|      0|            for(i = 0; i < sh->prop_count; i++) {
  ------------------
  |  Branch (5633:24): [True: 0, False: 0]
  ------------------
 5634|      0|                free_property(ctx->rt, &props[i], prs->flags);
 5635|      0|                prs++;
 5636|      0|            }
 5637|      0|        }
 5638|      0|        js_free_shape(ctx->rt, sh);
 5639|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 5640|      0|    }
 5641|       |
 5642|  3.41k|    switch(class_id) {
 5643|    824|    case JS_CLASS_OBJECT:
  ------------------
  |  Branch (5643:5): [True: 824, False: 2.58k]
  ------------------
 5644|    824|        break;
 5645|     48|    case JS_CLASS_ARRAY:
  ------------------
  |  Branch (5645:5): [True: 48, False: 3.36k]
  ------------------
 5646|     48|        {
 5647|     48|            JSProperty *pr;
 5648|     48|            p->is_exotic = 1;
 5649|     48|            p->fast_array = 1;
 5650|     48|            p->u.array.u.values = NULL;
 5651|     48|            p->u.array.count = 0;
 5652|     48|            p->u.array.u1.size = 0;
 5653|     48|            if (!props) {
  ------------------
  |  Branch (5653:17): [True: 44, False: 4]
  ------------------
 5654|       |                /* XXX: remove */
 5655|       |                /* the length property is always the first one */
 5656|     44|                if (likely(sh == ctx->array_shape)) {
  ------------------
  |  |   32|     44|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 30, False: 14]
  |  |  ------------------
  ------------------
 5657|     30|                    pr = &p->prop[0];
 5658|     30|                } else {
 5659|       |                    /* only used for the first array */
 5660|       |                    /* cannot fail */
 5661|     14|                    pr = add_property(ctx, p, JS_ATOM_length,
 5662|     14|                                      JS_PROP_WRITABLE | JS_PROP_LENGTH);
  ------------------
  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                    JS_PROP_WRITABLE | JS_PROP_LENGTH);
  ------------------
  |  |  300|     14|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
 5663|     14|                }
 5664|     44|                pr->u.value = JS_NewInt32(ctx, 0);
 5665|     44|            }
 5666|     48|        }
 5667|     48|        break;
 5668|  2.23k|    case JS_CLASS_C_FUNCTION:
  ------------------
  |  Branch (5668:5): [True: 2.23k, False: 1.17k]
  ------------------
 5669|  2.23k|        p->prop[0].u.value = JS_UNDEFINED;
  ------------------
  |  |  289|  2.23k|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|  2.23k|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 5670|  2.23k|        break;
 5671|      0|    case JS_CLASS_ARGUMENTS:
  ------------------
  |  Branch (5671:5): [True: 0, False: 3.41k]
  ------------------
 5672|      0|    case JS_CLASS_MAPPED_ARGUMENTS:
  ------------------
  |  Branch (5672:5): [True: 0, False: 3.41k]
  ------------------
 5673|      0|    case JS_CLASS_UINT8C_ARRAY:
  ------------------
  |  Branch (5673:5): [True: 0, False: 3.41k]
  ------------------
 5674|      0|    case JS_CLASS_INT8_ARRAY:
  ------------------
  |  Branch (5674:5): [True: 0, False: 3.41k]
  ------------------
 5675|      0|    case JS_CLASS_UINT8_ARRAY:
  ------------------
  |  Branch (5675:5): [True: 0, False: 3.41k]
  ------------------
 5676|      0|    case JS_CLASS_INT16_ARRAY:
  ------------------
  |  Branch (5676:5): [True: 0, False: 3.41k]
  ------------------
 5677|      0|    case JS_CLASS_UINT16_ARRAY:
  ------------------
  |  Branch (5677:5): [True: 0, False: 3.41k]
  ------------------
 5678|      0|    case JS_CLASS_INT32_ARRAY:
  ------------------
  |  Branch (5678:5): [True: 0, False: 3.41k]
  ------------------
 5679|      0|    case JS_CLASS_UINT32_ARRAY:
  ------------------
  |  Branch (5679:5): [True: 0, False: 3.41k]
  ------------------
 5680|      0|    case JS_CLASS_BIG_INT64_ARRAY:
  ------------------
  |  Branch (5680:5): [True: 0, False: 3.41k]
  ------------------
 5681|      0|    case JS_CLASS_BIG_UINT64_ARRAY:
  ------------------
  |  Branch (5681:5): [True: 0, False: 3.41k]
  ------------------
 5682|      0|    case JS_CLASS_FLOAT16_ARRAY:
  ------------------
  |  Branch (5682:5): [True: 0, False: 3.41k]
  ------------------
 5683|      0|    case JS_CLASS_FLOAT32_ARRAY:
  ------------------
  |  Branch (5683:5): [True: 0, False: 3.41k]
  ------------------
 5684|      0|    case JS_CLASS_FLOAT64_ARRAY:
  ------------------
  |  Branch (5684:5): [True: 0, False: 3.41k]
  ------------------
 5685|      0|        p->is_exotic = 1;
 5686|      0|        p->fast_array = 1;
 5687|      0|        p->u.array.u.ptr = NULL;
 5688|      0|        p->u.array.count = 0;
 5689|      0|        break;
 5690|      0|    case JS_CLASS_DATAVIEW:
  ------------------
  |  Branch (5690:5): [True: 0, False: 3.41k]
  ------------------
 5691|      0|        p->u.array.u.ptr = NULL;
 5692|      0|        p->u.array.count = 0;
 5693|      0|        break;
 5694|     14|    case JS_CLASS_NUMBER:
  ------------------
  |  Branch (5694:5): [True: 14, False: 3.39k]
  ------------------
 5695|     28|    case JS_CLASS_STRING:
  ------------------
  |  Branch (5695:5): [True: 14, False: 3.39k]
  ------------------
 5696|     44|    case JS_CLASS_BOOLEAN:
  ------------------
  |  Branch (5696:5): [True: 16, False: 3.39k]
  ------------------
 5697|     44|    case JS_CLASS_SYMBOL:
  ------------------
  |  Branch (5697:5): [True: 0, False: 3.41k]
  ------------------
 5698|     44|    case JS_CLASS_DATE:
  ------------------
  |  Branch (5698:5): [True: 0, False: 3.41k]
  ------------------
 5699|     44|    case JS_CLASS_BIG_INT:
  ------------------
  |  Branch (5699:5): [True: 0, False: 3.41k]
  ------------------
 5700|     44|        p->u.object_data = JS_UNDEFINED;
  ------------------
  |  |  289|     44|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     44|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 5701|     44|        goto set_exotic;
 5702|      4|    case JS_CLASS_REGEXP:
  ------------------
  |  Branch (5702:5): [True: 4, False: 3.40k]
  ------------------
 5703|      4|        p->u.regexp.pattern = NULL;
 5704|      4|        p->u.regexp.bytecode = NULL;
 5705|      4|        break;
 5706|     14|    case JS_CLASS_GLOBAL_OBJECT:
  ------------------
  |  Branch (5706:5): [True: 14, False: 3.39k]
  ------------------
 5707|     14|        p->u.global_object.uninitialized_vars = JS_UNDEFINED;
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 5708|     14|        break;
 5709|    243|    default:
  ------------------
  |  Branch (5709:5): [True: 243, False: 3.16k]
  ------------------
 5710|    287|    set_exotic:
 5711|    287|        if (ctx->rt->class_array[class_id].exotic) {
  ------------------
  |  Branch (5711:13): [True: 42, False: 245]
  ------------------
 5712|     42|            p->is_exotic = 1;
 5713|     42|        }
 5714|    287|        break;
 5715|  3.41k|    }
 5716|  3.41k|    js_rc(p)->ref_count = 1;
 5717|  3.41k|    add_gc_object(ctx->rt, &p->header, JS_GC_OBJ_TYPE_JS_OBJECT);
 5718|  3.41k|    if (props) {
  ------------------
  |  Branch (5718:9): [True: 6, False: 3.40k]
  ------------------
 5719|     24|        for(i = 0; i < sh->prop_count; i++)
  ------------------
  |  Branch (5719:20): [True: 18, False: 6]
  ------------------
 5720|     18|            p->prop[i] = props[i];
 5721|      6|    }
 5722|  3.41k|    return JS_MKPTR(JS_TAG_OBJECT, p);
  ------------------
  |  |  246|  3.41k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 5723|  3.41k|}
quickjs.c:js_trigger_gc:
 1772|  3.41k|{
 1773|  3.41k|    BOOL force_gc;
 1774|       |#ifdef FORCE_GC_AT_MALLOC
 1775|       |    force_gc = TRUE;
 1776|       |#else
 1777|  3.41k|    force_gc = ((rt->malloc_ctx.malloc_state.malloc_size + size) >
 1778|  3.41k|                rt->malloc_gc_threshold);
 1779|  3.41k|#endif
 1780|  3.41k|    if (force_gc) {
  ------------------
  |  Branch (1780:9): [True: 13, False: 3.39k]
  ------------------
 1781|       |#ifdef DUMP_GC
 1782|       |        printf("GC: size=%" PRIu64 "\n",
 1783|       |               (uint64_t)rt->malloc_ctx.malloc_state.malloc_size);
 1784|       |#endif
 1785|     13|        JS_RunGC(rt);
 1786|     13|        rt->malloc_gc_threshold = rt->malloc_ctx.malloc_state.malloc_size +
 1787|     13|            (rt->malloc_ctx.malloc_state.malloc_size >> 1);
 1788|     13|    }
 1789|  3.41k|}
quickjs.c:free_property:
 6089|  16.0k|{
 6090|  16.0k|    if (unlikely(prop_flags & JS_PROP_TMASK)) {
  ------------------
  |  |   33|  16.0k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 8.68k, False: 7.39k]
  |  |  ------------------
  ------------------
 6091|  8.68k|        if ((prop_flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  301|  8.68k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      if ((prop_flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|  8.68k|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (6091:13): [True: 616, False: 8.07k]
  ------------------
 6092|    616|            if (pr->u.getset.getter)
  ------------------
  |  Branch (6092:17): [True: 616, False: 0]
  ------------------
 6093|    616|                JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.getter));
  ------------------
  |  |  246|    616|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6094|    616|            if (pr->u.getset.setter)
  ------------------
  |  Branch (6094:17): [True: 70, False: 546]
  ------------------
 6095|     70|                JS_FreeValueRT(rt, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.setter));
  ------------------
  |  |  246|     70|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6096|  8.07k|        } else if ((prop_flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  301|  8.07k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      } else if ((prop_flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  304|  8.07k|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (6096:20): [True: 2.18k, False: 5.88k]
  ------------------
 6097|  2.18k|            free_var_ref(rt, pr->u.var_ref);
 6098|  5.88k|        } else if ((prop_flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  301|  5.88k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      } else if ((prop_flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  305|  5.88k|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (6098:20): [True: 5.88k, False: 0]
  ------------------
 6099|  5.88k|            js_autoinit_free(rt, pr);
 6100|  5.88k|        }
 6101|  8.68k|    } else {
 6102|  7.39k|        JS_FreeValueRT(rt, pr->u.value);
 6103|  7.39k|    }
 6104|  16.0k|}
quickjs.c:js_autoinit_free:
 6078|  6.05k|{
 6079|  6.05k|    JS_FreeContext(js_autoinit_get_realm(pr));
 6080|  6.05k|}
quickjs.c:js_autoinit_get_realm:
 6068|  28.9k|{
 6069|  28.9k|    return (JSContext *)(pr->u.init.realm_and_id & ~3);
 6070|  28.9k|}
quickjs.c:JS_NewCFunction3:
 5939|  2.23k|{
 5940|  2.23k|    JSValue func_obj;
 5941|  2.23k|    JSObject *p;
 5942|  2.23k|    JSAtom name_atom;
 5943|       |
 5944|  2.23k|    if (n_fields > 0) {
  ------------------
  |  Branch (5944:9): [True: 672, False: 1.56k]
  ------------------
 5945|    672|        func_obj = JS_NewObjectProtoClassAlloc(ctx, proto_val, JS_CLASS_C_FUNCTION, n_fields);
 5946|  1.56k|    } else {
 5947|  1.56k|        func_obj = JS_NewObjectProtoClass(ctx, proto_val, JS_CLASS_C_FUNCTION);
 5948|  1.56k|    }
 5949|  2.23k|    if (JS_IsException(func_obj))
  ------------------
  |  Branch (5949:9): [True: 0, False: 2.23k]
  ------------------
 5950|      0|        return func_obj;
 5951|  2.23k|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  227|  2.23k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  2.23k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5952|  2.23k|    p->u.cfunc.realm = JS_DupContext(ctx);
 5953|  2.23k|    p->u.cfunc.c_function.generic = func;
 5954|  2.23k|    p->u.cfunc.length = length;
 5955|  2.23k|    p->u.cfunc.cproto = cproto;
 5956|  2.23k|    p->u.cfunc.magic = magic;
 5957|  2.23k|    p->is_constructor = (cproto == JS_CFUNC_constructor ||
  ------------------
  |  Branch (5957:26): [True: 70, False: 2.16k]
  ------------------
 5958|  2.16k|                         cproto == JS_CFUNC_constructor_magic ||
  ------------------
  |  Branch (5958:26): [True: 224, False: 1.93k]
  ------------------
 5959|  1.93k|                         cproto == JS_CFUNC_constructor_or_func ||
  ------------------
  |  Branch (5959:26): [True: 182, False: 1.75k]
  ------------------
 5960|  1.75k|                         cproto == JS_CFUNC_constructor_or_func_magic);
  ------------------
  |  Branch (5960:26): [True: 182, False: 1.57k]
  ------------------
 5961|  2.23k|    if (!name)
  ------------------
  |  Branch (5961:9): [True: 14, False: 2.21k]
  ------------------
 5962|     14|        name = "";
 5963|  2.23k|    name_atom = JS_NewAtom(ctx, name);
 5964|  2.23k|    if (name_atom == JS_ATOM_NULL) {
  ------------------
  |  |  449|  2.23k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (5964:9): [True: 0, False: 2.23k]
  ------------------
 5965|      0|        JS_FreeValue(ctx, func_obj);
 5966|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 5967|      0|    }
 5968|  2.23k|    js_function_set_properties(ctx, func_obj, name_atom, length);
 5969|  2.23k|    JS_FreeAtom(ctx, name_atom);
 5970|  2.23k|    return func_obj;
 5971|  2.23k|}
quickjs.c:JS_NewObjectProtoClassAlloc:
 5756|  1.52k|{
 5757|  1.52k|    JSShape *sh;
 5758|  1.52k|    JSObject *proto;
 5759|  1.52k|    int hash_size, hash_bits;
 5760|       |    
 5761|  1.52k|    if (n_alloc_props <= JS_PROP_INITIAL_SIZE) {
  ------------------
  |  |  957|  1.52k|#define JS_PROP_INITIAL_SIZE 2
  ------------------
  |  Branch (5761:9): [True: 294, False: 1.23k]
  ------------------
 5762|    294|        n_alloc_props = JS_PROP_INITIAL_SIZE;
  ------------------
  |  |  957|    294|#define JS_PROP_INITIAL_SIZE 2
  ------------------
 5763|    294|        hash_size = JS_PROP_INITIAL_HASH_SIZE;
  ------------------
  |  |  958|    294|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
 5764|  1.23k|    } else {
 5765|  1.23k|        hash_bits = 32 - clz32(n_alloc_props - 1); /* ceil(log2(radix)) */
 5766|  1.23k|        hash_size = 1 << hash_bits;
 5767|  1.23k|    }
 5768|  1.52k|    proto = get_proto_obj(proto_val);
 5769|  1.52k|    sh = js_new_shape_nohash(ctx, proto, hash_size, n_alloc_props);
 5770|  1.52k|    if (!sh)
  ------------------
  |  Branch (5770:9): [True: 0, False: 1.52k]
  ------------------
 5771|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 5772|  1.52k|    return JS_NewObjectFromShape(ctx, sh, class_id, NULL);
 5773|  1.52k|}
quickjs.c:js_new_shape_nohash:
 5207|  2.57k|{
 5208|  2.57k|    JSRuntime *rt = ctx->rt;
 5209|  2.57k|    JSShape *sh;
 5210|       |
 5211|  2.57k|    sh = js_malloc(ctx, get_shape_size(hash_size, prop_size));
 5212|  2.57k|    if (!sh)
  ------------------
  |  Branch (5212:9): [True: 0, False: 2.57k]
  ------------------
 5213|      0|        return NULL;
 5214|  2.57k|    js_rc(sh)->ref_count = 1;
 5215|  2.57k|    add_gc_object(rt, &sh->header, JS_GC_OBJ_TYPE_SHAPE);
 5216|  2.57k|    if (proto)
  ------------------
  |  Branch (5216:9): [True: 2.50k, False: 72]
  ------------------
 5217|  2.50k|        JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, proto));
  ------------------
  |  |  246|  2.50k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 5218|  2.57k|    sh->proto = proto;
 5219|  2.57k|    memset(sh->hash_table, 0, sizeof(sh->hash_table[0]) * hash_size);
 5220|  2.57k|    sh->prop_hash_mask = hash_size - 1;
 5221|  2.57k|    sh->prop_size = prop_size;
 5222|  2.57k|    sh->prop_count = 0;
 5223|  2.57k|    sh->deleted_prop_count = 0;
 5224|  2.57k|    sh->is_hashed = FALSE;
 5225|  2.57k|    return sh;
 5226|  2.57k|}
quickjs.c:js_c_function_data_call:
 6019|     26|{
 6020|     26|    JSCFunctionDataRecord *s = JS_GetOpaque(func_obj, JS_CLASS_C_FUNCTION_DATA);
 6021|     26|    JSValueConst *arg_buf;
  ------------------
  |  |  234|     26|#define JSValueConst JSValue
  ------------------
 6022|     26|    int i;
 6023|       |
 6024|       |    /* XXX: could add the function on the stack for debug */
 6025|     26|    if (unlikely(argc < s->length)) {
  ------------------
  |  |   33|     26|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 26]
  |  |  ------------------
  ------------------
 6026|      0|        arg_buf = alloca(sizeof(arg_buf[0]) * s->length);
 6027|      0|        for(i = 0; i < argc; i++)
  ------------------
  |  Branch (6027:20): [True: 0, False: 0]
  ------------------
 6028|      0|            arg_buf[i] = argv[i];
 6029|      0|        for(i = argc; i < s->length; i++)
  ------------------
  |  Branch (6029:23): [True: 0, False: 0]
  ------------------
 6030|      0|            arg_buf[i] = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 6031|     26|    } else {
 6032|     26|        arg_buf = argv;
 6033|     26|    }
 6034|       |
 6035|     26|    return s->func(ctx, this_val, argc, arg_buf, s->magic, s->data);
 6036|     26|}
quickjs.c:js_function_set_properties:
 5846|  2.33k|{
 5847|       |    /* ES6 feature non compatible with ES5.1: length is configurable */
 5848|  2.33k|    JS_DefinePropertyValue(ctx, func_obj, JS_ATOM_length, JS_NewInt32(ctx, len),
 5849|  2.33k|                           JS_PROP_CONFIGURABLE);
  ------------------
  |  |  296|  2.33k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 5850|  2.33k|    JS_DefinePropertyValue(ctx, func_obj, JS_ATOM_name,
 5851|  2.33k|                           JS_AtomToString(ctx, name), JS_PROP_CONFIGURABLE);
  ------------------
  |  |  296|  2.33k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 5852|  2.33k|}
quickjs.c:JS_FreeAtomStruct:
 3366|  5.61k|{
 3367|       |#if 0   /* JS_ATOM_NULL is not refcounted: __JS_AtomIsConst() includes 0 */
 3368|       |    if (unlikely(i == JS_ATOM_NULL)) {
 3369|       |        js_rc(p)->ref_count = INT32_MAX / 2;
 3370|       |        return;
 3371|       |    }
 3372|       |#endif
 3373|  5.61k|    uint32_t i = p->hash_next;  /* atom_index */
 3374|  5.61k|    if (p->atom_type != JS_ATOM_TYPE_SYMBOL) {
  ------------------
  |  Branch (3374:9): [True: 5.61k, False: 0]
  ------------------
 3375|  5.61k|        JSAtomStruct *p0, *p1;
 3376|  5.61k|        uint32_t h0;
 3377|       |
 3378|  5.61k|        h0 = p->hash & (rt->atom_hash_size - 1);
 3379|  5.61k|        i = rt->atom_hash[h0];
 3380|  5.61k|        p1 = rt->atom_array[i];
 3381|  5.61k|        if (p1 == p) {
  ------------------
  |  Branch (3381:13): [True: 4.12k, False: 1.48k]
  ------------------
 3382|  4.12k|            rt->atom_hash[h0] = p1->hash_next;
 3383|  4.12k|        } else {
 3384|  2.05k|            for(;;) {
 3385|  2.05k|                assert(i != 0);
  ------------------
  |  Branch (3385:17): [True: 0, False: 2.05k]
  |  Branch (3385:17): [True: 2.05k, False: 0]
  ------------------
 3386|  2.05k|                p0 = p1;
 3387|  2.05k|                i = p1->hash_next;
 3388|  2.05k|                p1 = rt->atom_array[i];
 3389|  2.05k|                if (p1 == p) {
  ------------------
  |  Branch (3389:21): [True: 1.48k, False: 570]
  ------------------
 3390|  1.48k|                    p0->hash_next = p1->hash_next;
 3391|  1.48k|                    break;
 3392|  1.48k|                }
 3393|  2.05k|            }
 3394|  1.48k|        }
 3395|  5.61k|    }
 3396|       |    /* insert in free atom list */
 3397|  5.61k|    rt->atom_array[i] = atom_set_free(rt->atom_free_index);
 3398|  5.61k|    rt->atom_free_index = i;
 3399|       |    /* free the string structure */
 3400|       |#ifdef DUMP_LEAKS
 3401|       |    list_del(&p->link);
 3402|       |#endif
 3403|  5.61k|    if (p->atom_type == JS_ATOM_TYPE_SYMBOL &&
  ------------------
  |  Branch (3403:9): [True: 0, False: 5.61k]
  ------------------
 3404|      0|        p->hash != JS_ATOM_HASH_PRIVATE && p->hash != 0) {
  ------------------
  |  |  573|      0|#define JS_ATOM_HASH_PRIVATE JS_ATOM_HASH_MASK
  |  |  ------------------
  |  |  |  |  572|  5.61k|#define JS_ATOM_HASH_MASK  ((1 << 30) - 1)
  |  |  ------------------
  ------------------
  |  Branch (3404:9): [True: 0, False: 0]
  |  Branch (3404:44): [True: 0, False: 0]
  ------------------
 3405|       |        /* live weak references are still present on this object: keep
 3406|       |           it */
 3407|  5.61k|    } else {
 3408|  5.61k|        js_free_rt(rt, p);
 3409|  5.61k|    }
 3410|  5.61k|    rt->atom_count--;
 3411|       |    assert(rt->atom_count >= 0);
  ------------------
  |  Branch (3411:5): [True: 0, False: 5.61k]
  |  Branch (3411:5): [True: 5.61k, False: 0]
  ------------------
 3412|  5.61k|}
quickjs.c:free_zero_refcount:
 6406|    120|{
 6407|    120|    struct list_head *el;
 6408|    120|    JSGCObjectHeader *p;
 6409|       |
 6410|    120|    rt->gc_phase = JS_GC_PHASE_DECREF;
 6411|    280|    for(;;) {
 6412|    280|        el = rt->gc_zero_ref_count_list.next;
 6413|    280|        if (el == &rt->gc_zero_ref_count_list)
  ------------------
  |  Branch (6413:13): [True: 120, False: 160]
  ------------------
 6414|    120|            break;
 6415|    160|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|    160|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|    160|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6416|    160|        assert(js_rc(p)->ref_count == 0);
  ------------------
  |  Branch (6416:9): [True: 0, False: 160]
  |  Branch (6416:9): [True: 160, False: 0]
  ------------------
 6417|    160|        free_gc_object(rt, p);
 6418|    160|    }
 6419|    120|    rt->gc_phase = JS_GC_PHASE_NONE;
 6420|    120|}
quickjs.c:free_gc_object:
 6386|  3.49k|{
 6387|  3.49k|    switch(js_rc(gp)->gc_obj_type) {
 6388|  3.41k|    case JS_GC_OBJ_TYPE_JS_OBJECT:
  ------------------
  |  Branch (6388:5): [True: 3.41k, False: 83]
  ------------------
 6389|  3.41k|        free_object(rt, (JSObject *)gp);
 6390|  3.41k|        break;
 6391|     28|    case JS_GC_OBJ_TYPE_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6391:5): [True: 28, False: 3.46k]
  ------------------
 6392|     28|        free_function_bytecode(rt, (JSFunctionBytecode *)gp);
 6393|     28|        break;
 6394|     13|    case JS_GC_OBJ_TYPE_ASYNC_FUNCTION:
  ------------------
  |  Branch (6394:5): [True: 13, False: 3.48k]
  ------------------
 6395|     13|        __async_func_free(rt, (JSAsyncFunctionState *)gp);
 6396|     13|        break;
 6397|     42|    case JS_GC_OBJ_TYPE_MODULE:
  ------------------
  |  Branch (6397:5): [True: 42, False: 3.45k]
  ------------------
 6398|     42|        js_free_module_def(rt, (JSModuleDef *)gp);
 6399|     42|        break;
 6400|      0|    default:
  ------------------
  |  Branch (6400:5): [True: 0, False: 3.49k]
  ------------------
 6401|      0|        abort();
 6402|  3.49k|    }
 6403|  3.49k|}
quickjs.c:free_object:
 6332|  3.41k|{
 6333|  3.41k|    int i;
 6334|  3.41k|    JSClassFinalizer *finalizer;
 6335|  3.41k|    JSShape *sh;
 6336|  3.41k|    JSShapeProperty *pr;
 6337|       |
 6338|  3.41k|    p->free_mark = 1; /* used to tell the object is invalid when
 6339|       |                         freeing cycles */
 6340|       |    /* free all the fields */
 6341|  3.41k|    sh = p->shape;
 6342|  3.41k|    pr = get_shape_prop(sh);
 6343|  19.4k|    for(i = 0; i < sh->prop_count; i++) {
  ------------------
  |  Branch (6343:16): [True: 16.0k, False: 3.41k]
  ------------------
 6344|  16.0k|        free_property(rt, &p->prop[i], pr->flags);
 6345|  16.0k|        pr++;
 6346|  16.0k|    }
 6347|  3.41k|    js_free_rt(rt, p->prop);
 6348|       |    /* as an optimization we destroy the shape immediately without
 6349|       |       putting it in gc_zero_ref_count_list */
 6350|  3.41k|    js_free_shape(rt, sh);
 6351|       |
 6352|       |    /* fail safe */
 6353|  3.41k|    p->shape = NULL;
 6354|  3.41k|    p->prop = NULL;
 6355|       |
 6356|  3.41k|    finalizer = rt->class_array[p->class_id].finalizer;
 6357|  3.41k|    if (finalizer)
  ------------------
  |  Branch (6357:9): [True: 2.53k, False: 879]
  ------------------
 6358|  2.53k|        (*finalizer)(rt, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  246|  2.53k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6359|       |
 6360|       |    /* fail safe */
 6361|  3.41k|    p->class_id = 0;
 6362|  3.41k|    p->u.opaque = NULL;
 6363|  3.41k|    p->u.func.var_refs = NULL;
 6364|  3.41k|    p->u.func.home_object = NULL;
 6365|       |
 6366|  3.41k|    remove_gc_object(&p->header);
 6367|  3.41k|    if (rt->gc_phase == JS_GC_PHASE_REMOVE_CYCLES) {
  ------------------
  |  Branch (6367:9): [True: 3.27k, False: 134]
  ------------------
 6368|  3.27k|        if (js_rc(p)->ref_count == 0 && p->weakref_count == 0) {
  ------------------
  |  Branch (6368:13): [True: 828, False: 2.44k]
  |  Branch (6368:41): [True: 828, False: 0]
  ------------------
 6369|    828|            js_free_rt(rt, p);
 6370|  2.44k|        } else {
 6371|       |            /* keep the object structure because there are may be
 6372|       |               references to it */
 6373|  2.44k|            list_add_tail(&p->header.link, &rt->gc_zero_ref_count_list);
 6374|  2.44k|        }
 6375|  3.27k|    } else {
 6376|       |        /* keep the object structure in case there are weak references to it */
 6377|    134|        if (p->weakref_count == 0) {
  ------------------
  |  Branch (6377:13): [True: 134, False: 0]
  ------------------
 6378|    134|            js_free_rt(rt, p);
 6379|    134|        } else {
 6380|      0|            js_rc(p)->mark = 0; /* reset the mark so that the weakref can be freed */
 6381|      0|        }
 6382|    134|    }
 6383|  3.41k|}
quickjs.c:free_function_bytecode:
36088|     28|{
36089|     28|    int i;
36090|       |
36091|       |#if 0
36092|       |    {
36093|       |        char buf[ATOM_GET_STR_BUF_SIZE];
36094|       |        printf("freeing %s\n",
36095|       |               JS_AtomGetStrRT(rt, buf, sizeof(buf), b->func_name));
36096|       |    }
36097|       |#endif
36098|     28|    if (b->byte_code_buf)
  ------------------
  |  Branch (36098:9): [True: 28, False: 0]
  ------------------
36099|     28|        free_bytecode_atoms(rt, b->byte_code_buf, b->byte_code_len, TRUE);
36100|       |
36101|     28|    if (b->vardefs) {
  ------------------
  |  Branch (36101:9): [True: 14, False: 14]
  ------------------
36102|     38|        for(i = 0; i < b->arg_count + b->var_count; i++) {
  ------------------
  |  Branch (36102:20): [True: 24, False: 14]
  ------------------
36103|     24|            JS_FreeAtomRT(rt, b->vardefs[i].var_name);
36104|     24|        }
36105|     14|    }
36106|     43|    for(i = 0; i < b->cpool_count; i++)
  ------------------
  |  Branch (36106:16): [True: 15, False: 28]
  ------------------
36107|     15|        JS_FreeValueRT(rt, b->cpool[i]);
36108|       |
36109|     92|    for(i = 0; i < b->closure_var_count; i++) {
  ------------------
  |  Branch (36109:16): [True: 64, False: 28]
  ------------------
36110|     64|        JSClosureVar *cv = &b->closure_var[i];
36111|     64|        JS_FreeAtomRT(rt, cv->var_name);
36112|     64|    }
36113|     28|    if (b->realm)
  ------------------
  |  Branch (36113:9): [True: 28, False: 0]
  ------------------
36114|     28|        JS_FreeContext(b->realm);
36115|       |
36116|     28|    JS_FreeAtomRT(rt, b->func_name);
36117|     28|    if (b->has_debug) {
  ------------------
  |  Branch (36117:9): [True: 28, False: 0]
  ------------------
36118|     28|        JS_FreeAtomRT(rt, b->debug.filename);
36119|     28|        js_free_rt(rt, b->debug.pc2line_buf);
36120|     28|        js_free_rt(rt, b->debug.source);
36121|     28|    }
36122|       |
36123|     28|    remove_gc_object(&b->header);
36124|     28|    if (rt->gc_phase == JS_GC_PHASE_REMOVE_CYCLES && js_rc(b)->ref_count != 0) {
  ------------------
  |  Branch (36124:9): [True: 15, False: 13]
  |  Branch (36124:54): [True: 7, False: 8]
  ------------------
36125|      7|        list_add_tail(&b->header.link, &rt->gc_zero_ref_count_list);
36126|     21|    } else {
36127|     21|        js_free_rt(rt, b);
36128|     21|    }
36129|     28|}
quickjs.c:free_bytecode_atoms:
31939|     33|{
31940|     33|    int pos, len, op;
31941|     33|    JSAtom atom;
31942|     33|    const JSOpCode *oi;
31943|       |
31944|     33|    pos = 0;
31945|    934|    while (pos < bc_len) {
  ------------------
  |  Branch (31945:12): [True: 901, False: 33]
  ------------------
31946|    901|        op = bc_buf[pos];
31947|    901|        if (use_short_opcodes)
  ------------------
  |  Branch (31947:13): [True: 351, False: 550]
  ------------------
31948|    351|            oi = &short_opcode_info(op);
  ------------------
  |  |21996|    351|    opcode_info[(op) >= OP_TEMP_START ? \
  |  |  ------------------
  |  |  |  Branch (21996:17): [True: 99, False: 252]
  |  |  ------------------
  |  |21997|    351|                (op) + (OP_TEMP_END - OP_TEMP_START) : (op)]
  ------------------
31949|    550|        else
31950|    550|            oi = &opcode_info[op];
31951|       |
31952|    901|        len = oi->size;
31953|    901|        switch(oi->fmt) {
31954|     63|        case OP_FMT_atom:
  ------------------
  |  Branch (31954:9): [True: 63, False: 838]
  ------------------
31955|     63|        case OP_FMT_atom_u8:
  ------------------
  |  Branch (31955:9): [True: 0, False: 901]
  ------------------
31956|    101|        case OP_FMT_atom_u16:
  ------------------
  |  Branch (31956:9): [True: 38, False: 863]
  ------------------
31957|    101|        case OP_FMT_atom_label_u8:
  ------------------
  |  Branch (31957:9): [True: 0, False: 901]
  ------------------
31958|    101|        case OP_FMT_atom_label_u16:
  ------------------
  |  Branch (31958:9): [True: 0, False: 901]
  ------------------
31959|    101|            if ((pos + 1 + 4) > bc_len)
  ------------------
  |  Branch (31959:17): [True: 0, False: 101]
  ------------------
31960|      0|                break; /* may happen if there is not enough memory when emiting bytecode */
31961|    101|            atom = get_u32(bc_buf + pos + 1);
31962|    101|            JS_FreeAtomRT(rt, atom);
31963|    101|            break;
31964|    800|        default:
  ------------------
  |  Branch (31964:9): [True: 800, False: 101]
  ------------------
31965|    800|            break;
31966|    901|        }
31967|    901|        pos += len;
31968|    901|    }
31969|     33|}
quickjs.c:__async_func_free:
20803|     13|{
20804|       |    /* cannot close the closure variables here because it would
20805|       |       potentially modify the object graph */
20806|     13|    if (!s->is_completed) {
  ------------------
  |  Branch (20806:9): [True: 0, False: 13]
  ------------------
20807|      0|        async_func_free_frame(rt, s);
20808|      0|    }
20809|       |
20810|     13|    JS_FreeValueRT(rt, s->resolving_funcs[0]);
20811|     13|    JS_FreeValueRT(rt, s->resolving_funcs[1]);
20812|       |
20813|     13|    remove_gc_object(&s->header);
20814|     13|    if (rt->gc_phase == JS_GC_PHASE_REMOVE_CYCLES && js_rc(s)->ref_count != 0) {
  ------------------
  |  Branch (20814:9): [True: 0, False: 13]
  |  Branch (20814:54): [True: 0, False: 0]
  ------------------
20815|      0|        list_add_tail(&s->header.link, &rt->gc_zero_ref_count_list);
20816|     13|    } else {
20817|     13|        js_free_rt(rt, s);
20818|     13|    }
20819|     13|}
quickjs.c:async_func_free_frame:
20752|     13|{
20753|     13|    JSStackFrame *sf = &s->frame;
20754|     13|    JSValue *sp;
20755|       |
20756|       |    /* cannot free the function if it is running */
20757|     13|    assert(sf->cur_sp != NULL);
  ------------------
  |  Branch (20757:5): [True: 0, False: 13]
  |  Branch (20757:5): [True: 13, False: 0]
  ------------------
20758|     26|    for(sp = sf->arg_buf; sp < sf->cur_sp; sp++) {
  ------------------
  |  Branch (20758:27): [True: 13, False: 13]
  ------------------
20759|     13|        JS_FreeValueRT(rt, *sp);
20760|     13|    }
20761|     13|    JS_FreeValueRT(rt, sf->cur_func);
20762|     13|    JS_FreeValueRT(rt, s->this_val);
20763|     13|}
quickjs.c:js_free_module_def:
29525|     42|{
29526|     42|    int i;
29527|       |
29528|     42|    JS_FreeAtomRT(rt, m->module_name);
29529|       |
29530|     70|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (29530:16): [True: 28, False: 42]
  ------------------
29531|     28|        JSReqModuleEntry *rme = &m->req_module_entries[i];
29532|     28|        JS_FreeAtomRT(rt, rme->module_name);
29533|     28|        JS_FreeValueRT(rt, rme->attributes);
29534|     28|    }
29535|     42|    js_free_rt(rt, m->req_module_entries);
29536|       |
29537|  1.41k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (29537:16): [True: 1.37k, False: 42]
  ------------------
29538|  1.37k|        JSExportEntry *me = &m->export_entries[i];
29539|  1.37k|        if (me->export_type == JS_EXPORT_TYPE_LOCAL)
  ------------------
  |  Branch (29539:13): [True: 1.37k, False: 0]
  ------------------
29540|  1.37k|            free_var_ref(rt, me->u.local.var_ref);
29541|  1.37k|        JS_FreeAtomRT(rt, me->export_name);
29542|  1.37k|        JS_FreeAtomRT(rt, me->local_name);
29543|  1.37k|    }
29544|     42|    js_free_rt(rt, m->export_entries);
29545|       |
29546|     42|    js_free_rt(rt, m->star_export_entries);
29547|       |
29548|     70|    for(i = 0; i < m->import_entries_count; i++) {
  ------------------
  |  Branch (29548:16): [True: 28, False: 42]
  ------------------
29549|     28|        JSImportEntry *mi = &m->import_entries[i];
29550|     28|        JS_FreeAtomRT(rt, mi->import_name);
29551|     28|    }
29552|     42|    js_free_rt(rt, m->import_entries);
29553|     42|    js_free_rt(rt, m->async_parent_modules);
29554|       |
29555|     42|    JS_FreeValueRT(rt, m->module_ns);
29556|     42|    JS_FreeValueRT(rt, m->func_obj);
29557|     42|    JS_FreeValueRT(rt, m->eval_exception);
29558|     42|    JS_FreeValueRT(rt, m->meta_obj);
29559|     42|    JS_FreeValueRT(rt, m->promise);
29560|     42|    JS_FreeValueRT(rt, m->resolving_funcs[0]);
29561|     42|    JS_FreeValueRT(rt, m->resolving_funcs[1]);
29562|     42|    JS_FreeValueRT(rt, m->private_value);
29563|       |    /* during the GC the finalizers are called in an arbitrary
29564|       |       order so the module may no longer be referenced by the JSContext list */
29565|     42|    if (m->link.next) {
  ------------------
  |  Branch (29565:9): [True: 42, False: 0]
  ------------------
29566|     42|        list_del(&m->link);
29567|     42|    }
29568|     42|    remove_gc_object(&m->header);
29569|     42|    if (rt->gc_phase == JS_GC_PHASE_REMOVE_CYCLES && js_rc(m)->ref_count != 0) {
  ------------------
  |  Branch (29569:9): [True: 42, False: 0]
  |  Branch (29569:54): [True: 42, False: 0]
  ------------------
29570|     42|        list_add_tail(&m->header.link, &rt->gc_zero_ref_count_list);
29571|     42|    } else {
29572|      0|        js_free_rt(rt, m);
29573|      0|    }
29574|     42|}
quickjs.c:add_gc_object:
 6533|  9.60k|{
 6534|  9.60k|    js_rc(h)->mark = 0;
 6535|  9.60k|    js_rc(h)->gc_obj_type = type;
 6536|  9.60k|    list_add_tail(&h->link, &rt->gc_obj_list);
 6537|  9.60k|}
quickjs.c:remove_gc_object:
 6540|  9.60k|{
 6541|  9.60k|    list_del(&h->link);
 6542|  9.60k|}
quickjs.c:JS_RunGCInternal:
 6807|     27|{
 6808|     27|    if (remove_weak_objects) {
  ------------------
  |  Branch (6808:9): [True: 13, False: 14]
  ------------------
 6809|       |        /* free the weakly referenced object or symbol structures, delete
 6810|       |           the associated Map/Set entries and queue the finalization
 6811|       |           registry callbacks. */
 6812|     13|        gc_remove_weak_objects(rt);
 6813|     13|    }
 6814|       |    
 6815|       |    /* decrement the reference of the children of each object. mark =
 6816|       |       1 after this pass. */
 6817|     27|    gc_decref(rt);
 6818|       |
 6819|       |    /* keep the GC objects with a non zero refcount and their childs */
 6820|     27|    gc_scan(rt);
 6821|       |
 6822|       |    /* free the GC objects in a cycle */
 6823|     27|    gc_free_cycles(rt);
 6824|     27|}
quickjs.c:gc_remove_weak_objects:
 6502|     13|{
 6503|     13|    struct list_head *el;
 6504|       |
 6505|       |    /* add the freed objects to rt->gc_zero_ref_count_list so that
 6506|       |       rt->weakref_list is not modified while we traverse it */
 6507|     13|    rt->gc_phase = JS_GC_PHASE_DECREF; 
 6508|       |        
 6509|     13|    list_for_each(el, &rt->weakref_list) {
  ------------------
  |  |   86|     13|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 0, False: 13]
  |  |  ------------------
  ------------------
 6510|      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)))
  |  |  ------------------
  ------------------
 6511|      0|        switch(wh->weakref_type) {
 6512|      0|        case JS_WEAKREF_TYPE_MAP:
  ------------------
  |  Branch (6512:9): [True: 0, False: 0]
  ------------------
 6513|      0|            map_delete_weakrefs(rt, wh);
 6514|      0|            break;
 6515|      0|        case JS_WEAKREF_TYPE_WEAKREF:
  ------------------
  |  Branch (6515:9): [True: 0, False: 0]
  ------------------
 6516|      0|            weakref_delete_weakref(rt, wh);
 6517|      0|            break;
 6518|      0|        case JS_WEAKREF_TYPE_FINREC:
  ------------------
  |  Branch (6518:9): [True: 0, False: 0]
  ------------------
 6519|      0|            finrec_delete_weakref(rt, wh);
 6520|      0|            break;
 6521|      0|        default:
  ------------------
  |  Branch (6521:9): [True: 0, False: 0]
  ------------------
 6522|      0|            abort();
 6523|      0|        }
 6524|      0|    }
 6525|       |
 6526|     13|    rt->gc_phase = JS_GC_PHASE_NONE;
 6527|       |    /* free the freed objects here. */
 6528|     13|    free_zero_refcount(rt);
 6529|     13|}
quickjs.c:gc_decref:
 6689|     27|{
 6690|     27|    struct list_head *el, *el1;
 6691|     27|    JSGCObjectHeader *p;
 6692|       |
 6693|     27|    init_list_head(&rt->tmp_obj_list);
 6694|       |
 6695|       |    /* decrement the refcount of all the children of all the GC
 6696|       |       objects and move the GC objects with zero refcount to
 6697|       |       tmp_obj_list */
 6698|  14.0k|    list_for_each_safe(el, el1, &rt->gc_obj_list) {
  ------------------
  |  |   89|  14.0k|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 14.0k, False: 27]
  |  |  ------------------
  |  |   90|  14.0k|        el = el1, el1 = el->next)
  ------------------
 6699|  14.0k|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  14.0k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  14.0k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6700|  14.0k|        assert(js_rc(p)->mark == 0);
  ------------------
  |  Branch (6700:9): [True: 0, False: 14.0k]
  |  Branch (6700:9): [True: 14.0k, False: 0]
  ------------------
 6701|  14.0k|        mark_children(rt, p, gc_decref_child);
 6702|  14.0k|        js_rc(p)->mark = 1;
 6703|  14.0k|        if (js_rc(p)->ref_count == 0) {
  ------------------
  |  Branch (6703:13): [True: 7.44k, False: 6.58k]
  ------------------
 6704|  7.44k|            list_del(&p->link);
 6705|  7.44k|            list_add_tail(&p->link, &rt->tmp_obj_list);
 6706|  7.44k|        }
 6707|  14.0k|    }
 6708|     27|}
quickjs.c:mark_children:
 6561|  28.0k|{
 6562|  28.0k|    switch(js_rc(gp)->gc_obj_type) {
 6563|  12.5k|    case JS_GC_OBJ_TYPE_JS_OBJECT:
  ------------------
  |  Branch (6563:5): [True: 12.5k, False: 15.5k]
  ------------------
 6564|  12.5k|        {
 6565|  12.5k|            JSObject *p = (JSObject *)gp;
 6566|  12.5k|            JSShapeProperty *prs;
 6567|  12.5k|            JSShape *sh;
 6568|  12.5k|            int i;
 6569|  12.5k|            sh = p->shape;
 6570|  12.5k|            mark_func(rt, &sh->header);
 6571|       |            /* mark all the fields */
 6572|  12.5k|            prs = get_shape_prop(sh);
 6573|  73.3k|            for(i = 0; i < sh->prop_count; i++) {
  ------------------
  |  Branch (6573:24): [True: 60.8k, False: 12.5k]
  ------------------
 6574|  60.8k|                JSProperty *pr = &p->prop[i];
 6575|  60.8k|                if (prs->atom != JS_ATOM_NULL) {
  ------------------
  |  |  449|  60.8k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (6575:21): [True: 60.8k, False: 6]
  ------------------
 6576|  60.8k|                    if (prs->flags & JS_PROP_TMASK) {
  ------------------
  |  |  301|  60.8k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
  |  Branch (6576:25): [True: 33.4k, False: 27.3k]
  ------------------
 6577|  33.4k|                        if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  301|  33.4k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                      if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|  33.4k|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (6577:29): [True: 2.37k, False: 31.0k]
  ------------------
 6578|  2.37k|                            if (pr->u.getset.getter)
  ------------------
  |  Branch (6578:33): [True: 2.37k, False: 0]
  ------------------
 6579|  2.37k|                                mark_func(rt, &pr->u.getset.getter->header);
 6580|  2.37k|                            if (pr->u.getset.setter)
  ------------------
  |  Branch (6580:33): [True: 270, False: 2.10k]
  ------------------
 6581|    270|                                mark_func(rt, &pr->u.getset.setter->header);
 6582|  31.0k|                        } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  301|  31.0k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                      } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  304|  31.0k|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (6582:36): [True: 8.39k, False: 22.6k]
  ------------------
 6583|       |                            /* Note: the tag does not matter
 6584|       |                               provided it is a GC object */
 6585|  8.39k|                            mark_func(rt, &pr->u.var_ref->header);
 6586|  22.6k|                        } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  301|  22.6k|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                                      } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  305|  22.6k|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (6586:36): [True: 22.6k, False: 0]
  ------------------
 6587|  22.6k|                            js_autoinit_mark(rt, pr, mark_func);
 6588|  22.6k|                        }
 6589|  33.4k|                    } else {
 6590|  27.3k|                        JS_MarkValue(rt, pr->u.value, mark_func);
 6591|  27.3k|                    }
 6592|  60.8k|                }
 6593|  60.8k|                prs++;
 6594|  60.8k|            }
 6595|       |
 6596|  12.5k|            if (p->class_id != JS_CLASS_OBJECT) {
  ------------------
  |  Branch (6596:17): [True: 9.36k, False: 3.17k]
  ------------------
 6597|  9.36k|                JSClassGCMark *gc_mark;
 6598|  9.36k|                gc_mark = rt->class_array[p->class_id].gc_mark;
 6599|  9.36k|                if (gc_mark)
  ------------------
  |  Branch (6599:21): [True: 9.08k, False: 278]
  ------------------
 6600|  9.08k|                    gc_mark(rt, JS_MKPTR(JS_TAG_OBJECT, p), mark_func);
  ------------------
  |  |  246|  9.08k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 6601|  9.36k|            }
 6602|  12.5k|        }
 6603|  12.5k|        break;
 6604|     72|    case JS_GC_OBJ_TYPE_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6604:5): [True: 72, False: 27.9k]
  ------------------
 6605|       |        /* the template objects can be part of a cycle */
 6606|     72|        {
 6607|     72|            JSFunctionBytecode *b = (JSFunctionBytecode *)gp;
 6608|     72|            int i;
 6609|     92|            for(i = 0; i < b->cpool_count; i++) {
  ------------------
  |  Branch (6609:24): [True: 20, False: 72]
  ------------------
 6610|     20|                JS_MarkValue(rt, b->cpool[i], mark_func);
 6611|     20|            }
 6612|     72|            if (b->realm)
  ------------------
  |  Branch (6612:17): [True: 72, False: 0]
  ------------------
 6613|     72|                mark_func(rt, &b->realm->header);
 6614|     72|        }
 6615|     72|        break;
 6616|  8.50k|    case JS_GC_OBJ_TYPE_VAR_REF:
  ------------------
  |  Branch (6616:5): [True: 8.50k, False: 19.5k]
  ------------------
 6617|  8.50k|        {
 6618|  8.50k|            JSVarRef *var_ref = (JSVarRef *)gp;
 6619|  8.50k|            if (var_ref->is_detached) {
  ------------------
  |  Branch (6619:17): [True: 8.50k, False: 0]
  ------------------
 6620|  8.50k|                JS_MarkValue(rt, *var_ref->pvalue, mark_func);
 6621|  8.50k|            } else {
 6622|      0|                JSStackFrame *sf = var_ref->stack_frame;
 6623|      0|                if (sf->js_mode & JS_MODE_ASYNC) {
  ------------------
  |  |  396|      0|#define JS_MODE_ASYNC  (1 << 2) /* async function */
  ------------------
  |  Branch (6623:21): [True: 0, False: 0]
  ------------------
 6624|      0|                    JSAsyncFunctionState *async_func = container_of(sf, JSAsyncFunctionState, frame);
  ------------------
  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 6625|      0|                    mark_func(rt, &async_func->header);
 6626|      0|                }
 6627|      0|            }
 6628|  8.50k|        }
 6629|  8.50k|        break;
 6630|      0|    case JS_GC_OBJ_TYPE_ASYNC_FUNCTION:
  ------------------
  |  Branch (6630:5): [True: 0, False: 28.0k]
  ------------------
 6631|      0|        {
 6632|      0|            JSAsyncFunctionState *s = (JSAsyncFunctionState *)gp;
 6633|      0|            JSStackFrame *sf = &s->frame;
 6634|      0|            JSValue *sp;
 6635|       |
 6636|      0|            if (!s->is_completed) {
  ------------------
  |  Branch (6636:17): [True: 0, False: 0]
  ------------------
 6637|      0|                JS_MarkValue(rt, sf->cur_func, mark_func);
 6638|      0|                JS_MarkValue(rt, s->this_val, mark_func);
 6639|       |                /* sf->cur_sp = NULL if the function is running */
 6640|      0|                if (sf->cur_sp) {
  ------------------
  |  Branch (6640:21): [True: 0, False: 0]
  ------------------
 6641|       |                    /* if the function is running, cur_sp is not known so we
 6642|       |                       cannot mark the stack. Marking the variables is not needed
 6643|       |                       because a running function cannot be part of a removable
 6644|       |                       cycle */
 6645|      0|                    for(sp = sf->arg_buf; sp < sf->cur_sp; sp++)
  ------------------
  |  Branch (6645:43): [True: 0, False: 0]
  ------------------
 6646|      0|                        JS_MarkValue(rt, *sp, mark_func);
 6647|      0|                }
 6648|      0|            }
 6649|      0|            JS_MarkValue(rt, s->resolving_funcs[0], mark_func);
 6650|      0|            JS_MarkValue(rt, s->resolving_funcs[1], mark_func);
 6651|      0|        }
 6652|      0|        break;
 6653|  6.71k|    case JS_GC_OBJ_TYPE_SHAPE:
  ------------------
  |  Branch (6653:5): [True: 6.71k, False: 21.3k]
  ------------------
 6654|  6.71k|        {
 6655|  6.71k|            JSShape *sh = (JSShape *)gp;
 6656|  6.71k|            if (sh->proto != NULL) {
  ------------------
  |  Branch (6656:17): [True: 6.44k, False: 270]
  ------------------
 6657|  6.44k|                mark_func(rt, &sh->proto->header);
 6658|  6.44k|            }
 6659|  6.71k|        }
 6660|  6.71k|        break;
 6661|     54|    case JS_GC_OBJ_TYPE_JS_CONTEXT:
  ------------------
  |  Branch (6661:5): [True: 54, False: 27.9k]
  ------------------
 6662|     54|        {
 6663|     54|            JSContext *ctx = (JSContext *)gp;
 6664|     54|            JS_MarkContext(rt, ctx, mark_func);
 6665|     54|        }
 6666|     54|        break;
 6667|    162|    case JS_GC_OBJ_TYPE_MODULE:
  ------------------
  |  Branch (6667:5): [True: 162, False: 27.8k]
  ------------------
 6668|    162|        {
 6669|    162|            JSModuleDef *m = (JSModuleDef *)gp;
 6670|    162|            js_mark_module_def(rt, m, mark_func);
 6671|    162|        }
 6672|    162|        break;
 6673|      0|    default:
  ------------------
  |  Branch (6673:5): [True: 0, False: 28.0k]
  ------------------
 6674|      0|        abort();
 6675|  28.0k|    }
 6676|  28.0k|}
quickjs.c:js_autoinit_mark:
 6084|  22.6k|{
 6085|  22.6k|    mark_func(rt, &js_autoinit_get_realm(pr)->header);
 6086|  22.6k|}
quickjs.c:JS_MarkContext:
 2710|     54|{
 2711|     54|    int i;
 2712|     54|    struct list_head *el;
 2713|       |
 2714|    162|    list_for_each(el, &ctx->loaded_modules) {
  ------------------
  |  |   86|    216|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 162, False: 54]
  |  |  ------------------
  ------------------
 2715|    162|        JSModuleDef *m = list_entry(el, JSModuleDef, link);
  ------------------
  |  |   39|    162|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|    162|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 2716|    162|        JS_MarkValue(rt, JS_MKPTR(JS_TAG_MODULE, m), mark_func);
  ------------------
  |  |  246|    162|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 2717|    162|    }
 2718|       |
 2719|     54|    JS_MarkValue(rt, ctx->global_obj, mark_func);
 2720|     54|    JS_MarkValue(rt, ctx->global_var_obj, mark_func);
 2721|       |
 2722|     54|    JS_MarkValue(rt, ctx->throw_type_error, mark_func);
 2723|     54|    JS_MarkValue(rt, ctx->eval_obj, mark_func);
 2724|       |
 2725|     54|    JS_MarkValue(rt, ctx->array_proto_values, mark_func);
 2726|    486|    for(i = 0; i < JS_NATIVE_ERROR_COUNT; i++) {
  ------------------
  |  Branch (2726:16): [True: 432, False: 54]
  ------------------
 2727|    432|        JS_MarkValue(rt, ctx->native_error_proto[i], mark_func);
 2728|    432|    }
 2729|  4.94k|    for(i = 0; i < rt->class_count; i++) {
  ------------------
  |  Branch (2729:16): [True: 4.89k, False: 54]
  ------------------
 2730|  4.89k|        JS_MarkValue(rt, ctx->class_proto[i], mark_func);
 2731|  4.89k|    }
 2732|     54|    JS_MarkValue(rt, ctx->iterator_ctor, mark_func);
 2733|     54|    JS_MarkValue(rt, ctx->async_iterator_proto, mark_func);
 2734|     54|    JS_MarkValue(rt, ctx->promise_ctor, mark_func);
 2735|     54|    JS_MarkValue(rt, ctx->array_ctor, mark_func);
 2736|     54|    JS_MarkValue(rt, ctx->regexp_ctor, mark_func);
 2737|     54|    JS_MarkValue(rt, ctx->function_ctor, mark_func);
 2738|     54|    JS_MarkValue(rt, ctx->function_proto, mark_func);
 2739|       |
 2740|     54|    if (ctx->array_shape)
  ------------------
  |  Branch (2740:9): [True: 54, False: 0]
  ------------------
 2741|     54|        mark_func(rt, &ctx->array_shape->header);
 2742|       |
 2743|     54|    if (ctx->arguments_shape)
  ------------------
  |  Branch (2743:9): [True: 54, False: 0]
  ------------------
 2744|     54|        mark_func(rt, &ctx->arguments_shape->header);
 2745|       |
 2746|     54|    if (ctx->mapped_arguments_shape)
  ------------------
  |  Branch (2746:9): [True: 54, False: 0]
  ------------------
 2747|     54|        mark_func(rt, &ctx->mapped_arguments_shape->header);
 2748|       |
 2749|     54|    if (ctx->regexp_shape)
  ------------------
  |  Branch (2749:9): [True: 54, False: 0]
  ------------------
 2750|     54|        mark_func(rt, &ctx->regexp_shape->header);
 2751|       |
 2752|     54|    if (ctx->regexp_result_shape)
  ------------------
  |  Branch (2752:9): [True: 54, False: 0]
  ------------------
 2753|     54|        mark_func(rt, &ctx->regexp_result_shape->header);
 2754|     54|}
quickjs.c:js_mark_module_def:
29498|    162|{
29499|    162|    int i;
29500|       |
29501|    270|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (29501:16): [True: 108, False: 162]
  ------------------
29502|    108|        JSReqModuleEntry *rme = &m->req_module_entries[i];
29503|    108|        JS_MarkValue(rt, rme->attributes, mark_func);
29504|    108|    }
29505|       |    
29506|  5.45k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (29506:16): [True: 5.29k, False: 162]
  ------------------
29507|  5.29k|        JSExportEntry *me = &m->export_entries[i];
29508|  5.29k|        if (me->export_type == JS_EXPORT_TYPE_LOCAL &&
  ------------------
  |  Branch (29508:13): [True: 5.29k, False: 0]
  ------------------
29509|  5.29k|            me->u.local.var_ref) {
  ------------------
  |  Branch (29509:13): [True: 5.29k, False: 0]
  ------------------
29510|  5.29k|            mark_func(rt, &me->u.local.var_ref->header);
29511|  5.29k|        }
29512|  5.29k|    }
29513|       |
29514|    162|    JS_MarkValue(rt, m->module_ns, mark_func);
29515|    162|    JS_MarkValue(rt, m->func_obj, mark_func);
29516|    162|    JS_MarkValue(rt, m->eval_exception, mark_func);
29517|    162|    JS_MarkValue(rt, m->meta_obj, mark_func);
29518|    162|    JS_MarkValue(rt, m->promise, mark_func);
29519|    162|    JS_MarkValue(rt, m->resolving_funcs[0], mark_func);
29520|    162|    JS_MarkValue(rt, m->resolving_funcs[1], mark_func);
29521|    162|    JS_MarkValue(rt, m->private_value, mark_func);
29522|    162|}
quickjs.c:gc_decref_child:
 6679|  41.8k|{
 6680|  41.8k|    assert(js_rc(p)->ref_count > 0);
  ------------------
  |  Branch (6680:5): [True: 0, False: 41.8k]
  |  Branch (6680:5): [True: 41.8k, False: 0]
  ------------------
 6681|  41.8k|    js_rc(p)->ref_count--;
 6682|  41.8k|    if (js_rc(p)->ref_count == 0 && js_rc(p)->mark == 1) {
  ------------------
  |  Branch (6682:9): [True: 13.9k, False: 27.8k]
  |  Branch (6682:37): [True: 6.53k, False: 7.44k]
  ------------------
 6683|  6.53k|        list_del(&p->link);
 6684|  6.53k|        list_add_tail(&p->link, &rt->tmp_obj_list);
 6685|  6.53k|    }
 6686|  41.8k|}
quickjs.c:gc_scan:
 6728|     27|{
 6729|     27|    struct list_head *el;
 6730|     27|    JSGCObjectHeader *p;
 6731|       |
 6732|       |    /* keep the objects with a refcount > 0 and their children. */
 6733|  6.73k|    list_for_each(el, &rt->gc_obj_list) {
  ------------------
  |  |   86|  6.76k|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 6.73k, False: 27]
  |  |  ------------------
  ------------------
 6734|  6.73k|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  6.73k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  6.73k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6735|  6.73k|        assert(js_rc(p)->ref_count > 0);
  ------------------
  |  Branch (6735:9): [True: 0, False: 6.73k]
  |  Branch (6735:9): [True: 6.73k, False: 0]
  ------------------
 6736|  6.73k|        js_rc(p)->mark = 0; /* reset the mark for the next GC call */
 6737|  6.73k|        mark_children(rt, p, gc_scan_incref_child);
 6738|  6.73k|    }
 6739|       |
 6740|       |    /* restore the refcount of the objects to be deleted. */
 6741|  7.29k|    list_for_each(el, &rt->tmp_obj_list) {
  ------------------
  |  |   86|  7.31k|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 7.29k, False: 27]
  |  |  ------------------
  ------------------
 6742|       |        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  7.29k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  7.29k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6743|  7.29k|        mark_children(rt, p, gc_scan_incref_child2);
 6744|  7.29k|    }
 6745|     27|}
quickjs.c:gc_scan_incref_child:
 6711|  20.0k|{
 6712|  20.0k|    js_rc(p)->ref_count++;
 6713|  20.0k|    if (js_rc(p)->ref_count == 1) {
  ------------------
  |  Branch (6713:9): [True: 6.68k, False: 13.3k]
  ------------------
 6714|       |        /* ref_count was 0: remove from tmp_obj_list and add at the
 6715|       |           end of gc_obj_list */
 6716|  6.68k|        list_del(&p->link);
 6717|  6.68k|        list_add_tail(&p->link, &rt->gc_obj_list);
 6718|  6.68k|        js_rc(p)->mark = 0; /* reset the mark for the next GC call */
 6719|  6.68k|    }
 6720|  20.0k|}
quickjs.c:gc_scan_incref_child2:
 6723|  21.7k|{
 6724|  21.7k|    js_rc(p)->ref_count++;
 6725|  21.7k|}
quickjs.c:gc_free_cycles:
 6748|     27|{
 6749|     27|    struct list_head *el, *el1;
 6750|     27|    JSGCObjectHeader *p;
 6751|       |#ifdef DUMP_GC_FREE
 6752|       |    BOOL header_done = FALSE;
 6753|       |#endif
 6754|       |
 6755|     27|    rt->gc_phase = JS_GC_PHASE_REMOVE_CYCLES;
 6756|       |
 6757|  6.22k|    for(;;) {
 6758|  6.22k|        el = rt->tmp_obj_list.next;
 6759|  6.22k|        if (el == &rt->tmp_obj_list)
  ------------------
  |  Branch (6759:13): [True: 27, False: 6.20k]
  ------------------
 6760|     27|            break;
 6761|  6.20k|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  6.20k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  6.20k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6762|       |        /* Only need to free the GC object associated with JS values
 6763|       |           or async functions. The rest will be automatically removed
 6764|       |           because they must be referenced by them. */
 6765|  6.20k|        switch(js_rc(p)->gc_obj_type) {
 6766|  3.27k|        case JS_GC_OBJ_TYPE_JS_OBJECT:
  ------------------
  |  Branch (6766:9): [True: 3.27k, False: 2.92k]
  ------------------
 6767|  3.29k|        case JS_GC_OBJ_TYPE_FUNCTION_BYTECODE:
  ------------------
  |  Branch (6767:9): [True: 15, False: 6.18k]
  ------------------
 6768|  3.29k|        case JS_GC_OBJ_TYPE_ASYNC_FUNCTION:
  ------------------
  |  Branch (6768:9): [True: 0, False: 6.20k]
  ------------------
 6769|  3.33k|        case JS_GC_OBJ_TYPE_MODULE:
  ------------------
  |  Branch (6769:9): [True: 42, False: 6.15k]
  ------------------
 6770|       |#ifdef DUMP_GC_FREE
 6771|       |            if (!header_done) {
 6772|       |                printf("Freeing cycles:\n");
 6773|       |                JS_DumpObjectHeader(rt);
 6774|       |                header_done = TRUE;
 6775|       |            }
 6776|       |            JS_DumpGCObject(rt, p);
 6777|       |#endif
 6778|  3.33k|            free_gc_object(rt, p);
 6779|  3.33k|            break;
 6780|  2.86k|        default:
  ------------------
  |  Branch (6780:9): [True: 2.86k, False: 3.33k]
  ------------------
 6781|  2.86k|            list_del(&p->link);
 6782|  2.86k|            list_add_tail(&p->link, &rt->gc_zero_ref_count_list);
 6783|  2.86k|            break;
 6784|  6.20k|        }
 6785|  6.20k|    }
 6786|     27|    rt->gc_phase = JS_GC_PHASE_NONE;
 6787|       |
 6788|  2.49k|    list_for_each_safe(el, el1, &rt->gc_zero_ref_count_list) {
  ------------------
  |  |   89|  2.52k|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 2.49k, False: 27]
  |  |  ------------------
  |  |   90|  2.49k|        el = el1, el1 = el->next)
  ------------------
 6789|  2.49k|        p = list_entry(el, JSGCObjectHeader, link);
  ------------------
  |  |   39|  2.49k|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|  2.49k|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
 6790|  2.49k|        assert(js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_JS_OBJECT ||
  ------------------
  |  Branch (6790:9): [True: 2.49k, False: 0]
  |  Branch (6790:9): [True: 0, False: 0]
  |  Branch (6790:9): [True: 0, False: 0]
  |  Branch (6790:9): [True: 0, False: 0]
  |  Branch (6790:9): [True: 2.44k, False: 49]
  |  Branch (6790:9): [True: 7, False: 42]
  |  Branch (6790:9): [True: 0, False: 42]
  |  Branch (6790:9): [True: 42, False: 0]
  ------------------
 6791|  2.49k|               js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_FUNCTION_BYTECODE ||
 6792|  2.49k|               js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_ASYNC_FUNCTION ||
 6793|  2.49k|               js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_MODULE);
 6794|  2.49k|        if (js_rc(p)->gc_obj_type == JS_GC_OBJ_TYPE_JS_OBJECT &&
  ------------------
  |  Branch (6794:13): [True: 2.44k, False: 49]
  ------------------
 6795|  2.44k|            ((JSObject *)p)->weakref_count != 0) {
  ------------------
  |  Branch (6795:13): [True: 0, False: 2.44k]
  ------------------
 6796|       |            /* keep the object because there are weak references to it */
 6797|      0|            js_rc(p)->mark = 0;
 6798|  2.49k|        } else {
 6799|  2.49k|            js_free_rt(rt, p);
 6800|  2.49k|        }
 6801|  2.49k|    }
 6802|       |
 6803|     27|    init_list_head(&rt->gc_zero_ref_count_list);
 6804|     27|}
quickjs.c:get_shape_size:
 5113|  3.88k|{
 5114|  3.88k|    return sizeof(JSShape) + hash_size * sizeof(uint32_t) +
 5115|  3.88k|        prop_size * sizeof(JSShapeProperty);
 5116|  3.88k|}
quickjs.c:get_shape_prop:
 5119|  4.78M|{
 5120|  4.78M|    return (JSShapeProperty *)((uint32_t *)(sh + 1) + sh->prop_hash_mask + 1);
 5121|  4.78M|}
quickjs.c:JS_AtomGetStrRT:
 3537|    345|{
 3538|    345|    if (__JS_AtomIsTaggedInt(atom)) {
  ------------------
  |  Branch (3538:9): [True: 0, False: 345]
  ------------------
 3539|      0|        snprintf(buf, buf_size, "%u", __JS_AtomToUInt32(atom));
 3540|    345|    } else {
 3541|    345|        JSAtomStruct *p;
 3542|    345|        assert(atom < rt->atom_size);
  ------------------
  |  Branch (3542:9): [True: 0, False: 345]
  |  Branch (3542:9): [True: 345, False: 0]
  ------------------
 3543|    345|        if (atom == JS_ATOM_NULL) {
  ------------------
  |  |  449|    345|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (3543:13): [True: 0, False: 345]
  ------------------
 3544|      0|            snprintf(buf, buf_size, "<null>");
 3545|    345|        } else {
 3546|    345|            int i, c;
 3547|    345|            char *q;
 3548|    345|            JSString *str;
 3549|       |
 3550|    345|            q = buf;
 3551|    345|            p = rt->atom_array[atom];
 3552|    345|            assert(!atom_is_free(p));
  ------------------
  |  Branch (3552:13): [True: 0, False: 345]
  |  Branch (3552:13): [True: 345, False: 0]
  ------------------
 3553|    345|            str = p;
 3554|    345|            if (str) {
  ------------------
  |  Branch (3554:17): [True: 345, False: 0]
  ------------------
 3555|    345|                if (!str->is_wide_char) {
  ------------------
  |  Branch (3555:21): [True: 343, False: 2]
  ------------------
 3556|       |                    /* special case ASCII strings */
 3557|    343|                    c = 0;
 3558|  3.84k|                    for(i = 0; i < str->len; i++) {
  ------------------
  |  Branch (3558:32): [True: 3.50k, False: 343]
  ------------------
 3559|  3.50k|                        c |= str->u.str8[i];
 3560|  3.50k|                    }
 3561|    343|                    if (c < 0x80)
  ------------------
  |  Branch (3561:25): [True: 343, False: 0]
  ------------------
 3562|    343|                        return (const char *)str->u.str8;
 3563|    343|                }
 3564|    118|                for(i = 0; i < str->len; i++) {
  ------------------
  |  Branch (3564:28): [True: 118, False: 0]
  ------------------
 3565|    118|                    c = string_get(str, i);
 3566|    118|                    if ((q - buf) >= buf_size - UTF8_CHAR_LEN_MAX)
  ------------------
  |  |  330|    118|#define UTF8_CHAR_LEN_MAX 6
  ------------------
  |  Branch (3566:25): [True: 2, False: 116]
  ------------------
 3567|      2|                        break;
 3568|    116|                    if (c < 128) {
  ------------------
  |  Branch (3568:25): [True: 116, False: 0]
  ------------------
 3569|    116|                        *q++ = c;
 3570|    116|                    } else {
 3571|      0|                        q += unicode_to_utf8((uint8_t *)q, c);
 3572|      0|                    }
 3573|    116|                }
 3574|      2|            }
 3575|      2|            *q = '\0';
 3576|      2|        }
 3577|    345|    }
 3578|      2|    return buf;
 3579|    345|}
quickjs.c:JS_ThrowError:
 7655|     25|{
 7656|     25|    JSRuntime *rt = ctx->rt;
 7657|     25|    JSStackFrame *sf;
 7658|     25|    BOOL add_backtrace;
 7659|       |
 7660|       |    /* the backtrace is added later if called from a bytecode function */
 7661|     25|    sf = rt->current_stack_frame;
 7662|     25|    add_backtrace = !rt->in_out_of_memory &&
  ------------------
  |  Branch (7662:21): [True: 25, False: 0]
  ------------------
 7663|     25|        (!sf || (JS_GetFunctionBytecode(sf->cur_func) == NULL));
  ------------------
  |  Branch (7663:10): [True: 15, False: 10]
  |  Branch (7663:17): [True: 1, False: 9]
  ------------------
 7664|     25|    return JS_ThrowError2(ctx, error_num, fmt, ap, add_backtrace);
 7665|     25|}
quickjs.c:JS_GetFunctionBytecode:
 5864|     10|{
 5865|     10|    JSObject *p;
 5866|     10|    if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|     10|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5866:9): [True: 0, False: 10]
  ------------------
 5867|      0|        return NULL;
 5868|     10|    p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|     10|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     10|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5869|     10|    if (!js_class_has_bytecode(p->class_id))
  ------------------
  |  Branch (5869:9): [True: 1, False: 9]
  ------------------
 5870|      1|        return NULL;
 5871|      9|    return p->u.func.function_bytecode;
 5872|     10|}
quickjs.c:JS_ThrowError2:
 7631|     27|{
 7632|     27|    char buf[256];
 7633|     27|    JSValue obj, ret;
 7634|       |
 7635|     27|    vsnprintf(buf, sizeof(buf), fmt, ap);
 7636|     27|    obj = JS_NewObjectProtoClass(ctx, ctx->native_error_proto[error_num],
 7637|     27|                                 JS_CLASS_ERROR);
 7638|     27|    if (unlikely(JS_IsException(obj))) {
  ------------------
  |  |   33|     27|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 27]
  |  |  ------------------
  ------------------
 7639|       |        /* out of memory: throw JS_NULL to avoid recursing */
 7640|      0|        obj = JS_NULL;
  ------------------
  |  |  288|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 7641|     27|    } else {
 7642|     27|        JS_DefinePropertyValue(ctx, obj, JS_ATOM_message,
 7643|     27|                               JS_NewString(ctx, buf),
 7644|     27|                               JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  297|     27|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                             JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  296|     27|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7645|     27|        if (add_backtrace) {
  ------------------
  |  Branch (7645:13): [True: 16, False: 11]
  ------------------
 7646|       |            build_backtrace(ctx, obj, NULL, 0, 0, 0);
 7647|     16|        }
 7648|     27|    }
 7649|     27|    ret = JS_Throw(ctx, obj);
 7650|     27|    return ret;
 7651|     27|}
quickjs.c:build_backtrace:
 7532|     27|{
 7533|     27|    JSStackFrame *sf;
 7534|     27|    JSValue str;
 7535|     27|    DynBuf dbuf;
 7536|     27|    const char *func_name_str;
 7537|     27|    const char *str1;
 7538|     27|    JSObject *p;
 7539|       |
 7540|     27|    if (!JS_IsObject(error_obj))
  ------------------
  |  Branch (7540:9): [True: 0, False: 27]
  ------------------
 7541|      0|        return; /* protection in the out of memory case */
 7542|       |    
 7543|     27|    js_dbuf_init(ctx, &dbuf);
 7544|     27|    if (filename) {
  ------------------
  |  Branch (7544:9): [True: 2, False: 25]
  ------------------
 7545|      2|        dbuf_printf(&dbuf, "    at %s", filename);
 7546|      2|        if (line_num != -1)
  ------------------
  |  Branch (7546:13): [True: 2, False: 0]
  ------------------
 7547|      2|            dbuf_printf(&dbuf, ":%d:%d", line_num, col_num);
 7548|      2|        dbuf_putc(&dbuf, '\n');
 7549|      2|        str = JS_NewString(ctx, filename);
 7550|      2|        if (JS_IsException(str))
  ------------------
  |  Branch (7550:13): [True: 0, False: 2]
  ------------------
 7551|      0|            return;
 7552|       |        /* Note: SpiderMonkey does that, could update once there is a standard */
 7553|      2|        if (JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_fileName, str,
  ------------------
  |  Branch (7553:13): [True: 0, False: 2]
  ------------------
 7554|      2|                                   JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0 ||
  ------------------
  |  |  297|      2|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                 JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0 ||
  ------------------
  |  |  296|      2|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7555|      2|            JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_lineNumber, JS_NewInt32(ctx, line_num),
  ------------------
  |  Branch (7555:13): [True: 0, False: 2]
  ------------------
 7556|      2|                                   JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0 ||
  ------------------
  |  |  297|      2|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                 JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0 ||
  ------------------
  |  |  296|      2|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7557|      2|            JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_columnNumber, JS_NewInt32(ctx, col_num),
  ------------------
  |  Branch (7557:13): [True: 0, False: 2]
  ------------------
 7558|      2|                                   JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  297|      2|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                 JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0) {
  ------------------
  |  |  296|      2|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7559|      0|            return;
 7560|      0|        }
 7561|      2|    }
 7562|     40|    for(sf = ctx->rt->current_stack_frame; sf != NULL; sf = sf->prev_frame) {
  ------------------
  |  Branch (7562:44): [True: 13, False: 27]
  ------------------
 7563|     13|        if (sf->js_mode & JS_MODE_BACKTRACE_BARRIER)
  ------------------
  |  |  397|     13|#define JS_MODE_BACKTRACE_BARRIER (1 << 3) /* stop backtrace before this frame */
  ------------------
  |  Branch (7563:13): [True: 0, False: 13]
  ------------------
 7564|      0|            break;
 7565|     13|        if (backtrace_flags & JS_BACKTRACE_FLAG_SKIP_FIRST_LEVEL) {
  ------------------
  |  | 7525|     13|#define JS_BACKTRACE_FLAG_SKIP_FIRST_LEVEL (1 << 0)
  ------------------
  |  Branch (7565:13): [True: 0, False: 13]
  ------------------
 7566|      0|            backtrace_flags &= ~JS_BACKTRACE_FLAG_SKIP_FIRST_LEVEL;
  ------------------
  |  | 7525|      0|#define JS_BACKTRACE_FLAG_SKIP_FIRST_LEVEL (1 << 0)
  ------------------
 7567|      0|            continue;
 7568|      0|        }
 7569|     13|        func_name_str = get_prop_string(ctx, sf->cur_func, JS_ATOM_name);
 7570|     13|        if (!func_name_str || func_name_str[0] == '\0')
  ------------------
  |  Branch (7570:13): [True: 0, False: 13]
  |  Branch (7570:31): [True: 0, False: 13]
  ------------------
 7571|      0|            str1 = "<anonymous>";
 7572|     13|        else
 7573|     13|            str1 = func_name_str;
 7574|     13|        dbuf_printf(&dbuf, "    at %s", str1);
 7575|     13|        JS_FreeCString(ctx, func_name_str);
 7576|       |
 7577|     13|        p = JS_VALUE_GET_OBJ(sf->cur_func);
  ------------------
  |  |  227|     13|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     13|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 7578|     13|        if (js_class_has_bytecode(p->class_id)) {
  ------------------
  |  Branch (7578:13): [True: 11, False: 2]
  ------------------
 7579|     11|            JSFunctionBytecode *b;
 7580|     11|            const char *atom_str;
 7581|     11|            int line_num1, col_num1;
 7582|       |
 7583|     11|            b = p->u.func.function_bytecode;
 7584|     11|            if (b->has_debug) {
  ------------------
  |  Branch (7584:17): [True: 11, False: 0]
  ------------------
 7585|     11|                line_num1 = find_line_num(ctx, b,
 7586|     11|                                          sf->cur_pc - b->byte_code_buf - 1, &col_num1);
 7587|     11|                atom_str = JS_AtomToCString(ctx, b->debug.filename);
 7588|     11|                dbuf_printf(&dbuf, " (%s",
 7589|     11|                            atom_str ? atom_str : "<null>");
  ------------------
  |  Branch (7589:29): [True: 11, False: 0]
  ------------------
 7590|     11|                JS_FreeCString(ctx, atom_str);
 7591|     11|                if (line_num1 != 0)
  ------------------
  |  Branch (7591:21): [True: 11, False: 0]
  ------------------
 7592|     11|                    dbuf_printf(&dbuf, ":%d:%d", line_num1, col_num1);
 7593|     11|                dbuf_putc(&dbuf, ')');
 7594|     11|            }
 7595|     11|        } else {
 7596|      2|            dbuf_printf(&dbuf, " (native)");
 7597|      2|        }
 7598|     13|        dbuf_putc(&dbuf, '\n');
 7599|     13|    }
 7600|     27|    dbuf_putc(&dbuf, '\0');
 7601|     27|    if (dbuf_error(&dbuf))
  ------------------
  |  Branch (7601:9): [True: 0, False: 27]
  ------------------
 7602|      0|        str = JS_NULL;
  ------------------
  |  |  288|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 7603|     27|    else
 7604|     27|        str = JS_NewString(ctx, (char *)dbuf.buf);
 7605|     27|    dbuf_free(&dbuf);
 7606|     27|    JS_DefinePropertyValue(ctx, error_obj, JS_ATOM_stack, str,
 7607|     27|                           JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  297|     27|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
  ------------------
  |  |  296|     27|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 7608|     27|}
quickjs.c:get_prop_string:
 7496|     13|{
 7497|     13|    JSObject *p;
 7498|     13|    JSProperty *pr;
 7499|     13|    JSShapeProperty *prs;
 7500|     13|    JSValueConst val;
  ------------------
  |  |  234|     13|#define JSValueConst JSValue
  ------------------
 7501|       |
 7502|     13|    if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|     13|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (7502:9): [True: 0, False: 13]
  ------------------
 7503|      0|        return NULL;
 7504|     13|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|     13|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     13|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 7505|     13|    prs = find_own_property(&pr, p, prop);
 7506|     13|    if (!prs) {
  ------------------
  |  Branch (7506:9): [True: 0, False: 13]
  ------------------
 7507|       |        /* we look at one level in the prototype to handle the 'name'
 7508|       |           field of the Error objects */
 7509|      0|        p = p->shape->proto;
 7510|      0|        if (!p)
  ------------------
  |  Branch (7510:13): [True: 0, False: 0]
  ------------------
 7511|      0|            return NULL;
 7512|      0|        prs = find_own_property(&pr, p, prop);
 7513|      0|        if (!prs)
  ------------------
  |  Branch (7513:13): [True: 0, False: 0]
  ------------------
 7514|      0|            return NULL;
 7515|      0|    }
 7516|       |    
 7517|     13|    if ((prs->flags & JS_PROP_TMASK) != JS_PROP_NORMAL)
  ------------------
  |  |  301|     13|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                  if ((prs->flags & JS_PROP_TMASK) != JS_PROP_NORMAL)
  ------------------
  |  |  302|     13|#define JS_PROP_NORMAL         (0 << 4)
  ------------------
  |  Branch (7517:9): [True: 0, False: 13]
  ------------------
 7518|      0|        return NULL;
 7519|     13|    val = pr->u.value;
 7520|     13|    if (JS_VALUE_GET_TAG(val) != JS_TAG_STRING)
  ------------------
  |  |  236|     13|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (7520:9): [True: 0, False: 13]
  ------------------
 7521|      0|        return NULL;
 7522|     13|    return JS_ToCString(ctx, val);
 7523|     13|}
quickjs.c:find_line_num:
 7428|     11|{
 7429|     11|    const uint8_t *p_end, *p;
 7430|     11|    int new_line_num, line_num, pc, v, ret, new_col_num, col_num;
 7431|     11|    uint32_t val;
 7432|     11|    unsigned int op;
 7433|       |
 7434|     11|    if (!b->has_debug || !b->debug.pc2line_buf)
  ------------------
  |  Branch (7434:9): [True: 0, False: 11]
  |  Branch (7434:26): [True: 0, False: 11]
  ------------------
 7435|      0|        goto fail; /* function was stripped */
 7436|       |
 7437|     11|    p = b->debug.pc2line_buf;
 7438|     11|    p_end = p + b->debug.pc2line_len;
 7439|       |
 7440|       |    /* get the function line and column numbers */
 7441|     11|    ret = get_leb128(&val, p, p_end);
 7442|     11|    if (ret < 0)
  ------------------
  |  Branch (7442:9): [True: 0, False: 11]
  ------------------
 7443|      0|        goto fail;
 7444|     11|    p += ret;
 7445|     11|    line_num = val + 1;
 7446|       |
 7447|     11|    ret = get_leb128(&val, p, p_end);
 7448|     11|    if (ret < 0)
  ------------------
  |  Branch (7448:9): [True: 0, False: 11]
  ------------------
 7449|      0|        goto fail;
 7450|     11|    p += ret;
 7451|     11|    col_num = val + 1;
 7452|       |
 7453|     11|    if (pc_value != -1) {
  ------------------
  |  Branch (7453:9): [True: 11, False: 0]
  ------------------
 7454|     11|        pc = 0;
 7455|     48|        while (p < p_end) {
  ------------------
  |  Branch (7455:16): [True: 43, False: 5]
  ------------------
 7456|     43|            op = *p++;
 7457|     43|            if (op == 0) {
  ------------------
  |  Branch (7457:17): [True: 12, False: 31]
  ------------------
 7458|     12|                ret = get_leb128(&val, p, p_end);
 7459|     12|                if (ret < 0)
  ------------------
  |  Branch (7459:21): [True: 0, False: 12]
  ------------------
 7460|      0|                    goto fail;
 7461|     12|                pc += val;
 7462|     12|                p += ret;
 7463|     12|                ret = get_sleb128(&v, p, p_end);
 7464|     12|                if (ret < 0)
  ------------------
  |  Branch (7464:21): [True: 0, False: 12]
  ------------------
 7465|      0|                    goto fail;
 7466|     12|                p += ret;
 7467|     12|                new_line_num = line_num + v;
 7468|     31|            } else {
 7469|     31|                op -= PC2LINE_OP_FIRST;
  ------------------
  |  |  667|     31|#define PC2LINE_OP_FIRST 1
  ------------------
 7470|     31|                pc += (op / PC2LINE_RANGE);
  ------------------
  |  |  666|     31|#define PC2LINE_RANGE    5
  ------------------
 7471|     31|                new_line_num = line_num + (op % PC2LINE_RANGE) + PC2LINE_BASE;
  ------------------
  |  |  666|     31|#define PC2LINE_RANGE    5
  ------------------
                              new_line_num = line_num + (op % PC2LINE_RANGE) + PC2LINE_BASE;
  ------------------
  |  |  665|     31|#define PC2LINE_BASE     (-1)
  ------------------
 7472|     31|            }
 7473|     43|            ret = get_sleb128(&v, p, p_end);
 7474|     43|            if (ret < 0)
  ------------------
  |  Branch (7474:17): [True: 0, False: 43]
  ------------------
 7475|      0|                goto fail;
 7476|     43|            p += ret;
 7477|     43|            new_col_num = col_num + v;
 7478|       |            
 7479|     43|            if (pc_value < pc)
  ------------------
  |  Branch (7479:17): [True: 6, False: 37]
  ------------------
 7480|      6|                goto done;
 7481|     37|            line_num = new_line_num;
 7482|     37|            col_num = new_col_num;
 7483|     37|        }
 7484|     11|    }
 7485|     11| done:
 7486|     11|    *pcol_num = col_num;
 7487|     11|    return line_num;
 7488|      0| fail:
 7489|      0|    *pcol_num = 0;
 7490|      0|    return 0;
 7491|     11|}
quickjs.c:get_leb128:
 7393|     89|{
 7394|     89|    const uint8_t *ptr = buf;
 7395|     89|    uint32_t v, a, i;
 7396|     89|    v = 0;
 7397|    111|    for(i = 0; i < 5; i++) {
  ------------------
  |  Branch (7397:16): [True: 111, False: 0]
  ------------------
 7398|    111|        if (unlikely(ptr >= buf_end))
  ------------------
  |  |   33|    111|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 111]
  |  |  ------------------
  ------------------
 7399|      0|            break;
 7400|    111|        a = *ptr++;
 7401|    111|        v |= (a & 0x7f) << (i * 7);
 7402|    111|        if (!(a & 0x80)) {
  ------------------
  |  Branch (7402:13): [True: 89, False: 22]
  ------------------
 7403|     89|            *pval = v;
 7404|     89|            return ptr - buf;
 7405|     89|        }
 7406|    111|    }
 7407|      0|    *pval = 0;
 7408|      0|    return -1;
 7409|     89|}
quickjs.c:get_sleb128:
 7413|     55|{
 7414|     55|    int ret;
 7415|     55|    uint32_t val;
 7416|     55|    ret = get_leb128(&val, buf, buf_end);
 7417|     55|    if (ret < 0) {
  ------------------
  |  Branch (7417:9): [True: 0, False: 55]
  ------------------
 7418|      0|        *pval = 0;
 7419|      0|        return -1;
 7420|      0|    }
 7421|     55|    *pval = (val >> 1) ^ -(val & 1);
 7422|     55|    return ret;
 7423|     55|}
quickjs.c:JS_GetPrototypePrimitive:
 7987|      5|{
 7988|      5|    switch(JS_VALUE_GET_NORM_TAG(val)) {
  ------------------
  |  |  238|      5|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      5|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
 7989|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (7989:5): [True: 0, False: 5]
  ------------------
 7990|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (7990:5): [True: 0, False: 5]
  ------------------
 7991|      0|        val = ctx->class_proto[JS_CLASS_BIG_INT];
 7992|      0|        break;
 7993|      0|    case JS_TAG_INT:
  ------------------
  |  Branch (7993:5): [True: 0, False: 5]
  ------------------
 7994|      0|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (7994:5): [True: 0, False: 5]
  ------------------
 7995|      0|        val = ctx->class_proto[JS_CLASS_NUMBER];
 7996|      0|        break;
 7997|      0|    case JS_TAG_BOOL:
  ------------------
  |  Branch (7997:5): [True: 0, False: 5]
  ------------------
 7998|      0|        val = ctx->class_proto[JS_CLASS_BOOLEAN];
 7999|      0|        break;
 8000|      5|    case JS_TAG_STRING:
  ------------------
  |  Branch (8000:5): [True: 5, False: 0]
  ------------------
 8001|      5|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (8001:5): [True: 0, False: 5]
  ------------------
 8002|      5|        val = ctx->class_proto[JS_CLASS_STRING];
 8003|      5|        break;
 8004|      0|    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (8004:5): [True: 0, False: 5]
  ------------------
 8005|      0|        val = ctx->class_proto[JS_CLASS_SYMBOL];
 8006|      0|        break;
 8007|      0|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (8007:5): [True: 0, False: 5]
  ------------------
 8008|      0|    case JS_TAG_NULL:
  ------------------
  |  Branch (8008:5): [True: 0, False: 5]
  ------------------
 8009|      0|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (8009:5): [True: 0, False: 5]
  ------------------
 8010|      0|    default:
  ------------------
  |  Branch (8010:5): [True: 0, False: 5]
  ------------------
 8011|      0|        val = JS_NULL;
  ------------------
  |  |  288|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8012|      0|        break;
 8013|      5|    }
 8014|      5|    return val;
 8015|      5|}
quickjs.c:JS_GetPrototypeFree:
 8042|      6|{
 8043|      6|    JSValue obj1;
 8044|      6|    obj1 = JS_GetPrototype(ctx, obj);
 8045|      6|    JS_FreeValue(ctx, obj);
 8046|      6|    return obj1;
 8047|      6|}
quickjs.c:js_poll_interrupts:
 7869|  1.01M|{
 7870|  1.01M|    if (unlikely(--ctx->interrupt_counter <= 0)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 115, False: 1.01M]
  |  |  ------------------
  ------------------
 7871|    115|        return __js_poll_interrupts(ctx);
 7872|  1.01M|    } else {
 7873|  1.01M|        return 0;
 7874|  1.01M|    }
 7875|  1.01M|}
quickjs.c:__js_poll_interrupts:
 7856|    115|{
 7857|    115|    JSRuntime *rt = ctx->rt;
 7858|    115|    ctx->interrupt_counter = JS_INTERRUPT_COUNTER_INIT;
  ------------------
  |  |  504|    115|#define JS_INTERRUPT_COUNTER_INIT 10000
  ------------------
 7859|    115|    if (rt->interrupt_handler) {
  ------------------
  |  Branch (7859:9): [True: 115, False: 0]
  ------------------
 7860|    115|        if (rt->interrupt_handler(rt, rt->interrupt_opaque)) {
  ------------------
  |  Branch (7860:13): [True: 2, False: 113]
  ------------------
 7861|      2|            JS_ThrowInterrupted(ctx);
 7862|      2|            return -1;
 7863|      2|        }
 7864|    115|    }
 7865|    113|    return 0;
 7866|    115|}
quickjs.c:JS_ThrowInterrupted:
 7850|      2|{
 7851|      2|    JS_ThrowInternalError(ctx, "interrupted");
 7852|      2|    JS_SetUncatchableException(ctx, TRUE);
 7853|      2|}
quickjs.c:__JS_AtomIsTaggedInt:
 2878|   990k|{
 2879|   990k|    return (v & JS_ATOM_TAG_INT) != 0;
  ------------------
  |  | 2861|   990k|#define JS_ATOM_TAG_INT (1U << 31)
  ------------------
 2880|   990k|}
quickjs.c:__JS_AtomToUInt32:
 2888|   686k|{
 2889|   686k|    return atom & ~JS_ATOM_TAG_INT;
  ------------------
  |  | 2861|   686k|#define JS_ATOM_TAG_INT (1U << 31)
  ------------------
 2890|   686k|}
quickjs.c:js_new_string_char:
 3945|      2|{
 3946|      2|    if (c < 0x100) {
  ------------------
  |  Branch (3946:9): [True: 2, False: 0]
  ------------------
 3947|      2|        uint8_t ch8 = c;
 3948|      2|        return js_new_string8_len(ctx, (const char *)&ch8, 1);
 3949|      2|    } else {
 3950|      0|        uint16_t ch16 = c;
 3951|      0|        return js_new_string16_len(ctx, &ch16, 1);
 3952|      0|    }
 3953|      2|}
quickjs.c:js_new_string16_len:
 3935|  1.24k|{
 3936|  1.24k|    JSString *str;
 3937|  1.24k|    str = js_alloc_string(ctx, len, 1);
 3938|  1.24k|    if (!str)
  ------------------
  |  Branch (3938:9): [True: 0, False: 1.24k]
  ------------------
 3939|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 3940|  1.24k|    memcpy(str->u.str16, buf, len * 2);
 3941|  1.24k|    return JS_MKPTR(JS_TAG_STRING, str);
  ------------------
  |  |  246|  1.24k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3942|  1.24k|}
quickjs.c:string_get:
 1952|  2.91M|static inline int string_get(const JSString *p, int idx) {
 1953|  2.91M|    return p->is_wide_char ? p->u.str16[idx] : p->u.str8[idx];
  ------------------
  |  Branch (1953:12): [True: 1.28M, False: 1.63M]
  ------------------
 1954|  2.91M|}
quickjs.c:find_own_property:
 6129|  3.38M|{
 6130|  3.38M|    JSShape *sh;
 6131|  3.38M|    JSShapeProperty *pr, *prop;
 6132|  3.38M|    intptr_t h;
 6133|  3.38M|    sh = p->shape;
 6134|  3.38M|    h = (uintptr_t)atom & sh->prop_hash_mask;
 6135|  3.38M|    h = sh->hash_table[h];
 6136|  3.38M|    prop = get_shape_prop(sh);
 6137|  4.49M|    while (h) {
  ------------------
  |  Branch (6137:12): [True: 3.12M, False: 1.36M]
  ------------------
 6138|  3.12M|        pr = &prop[h - 1];
 6139|  3.12M|        if (likely(pr->atom == atom)) {
  ------------------
  |  |   32|  3.12M|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 2.02M, False: 1.10M]
  |  |  ------------------
  ------------------
 6140|  2.02M|            *ppr = &p->prop[h - 1];
 6141|       |            /* the compiler should be able to assume that pr != NULL here */
 6142|  2.02M|            return pr;
 6143|  2.02M|        }
 6144|  1.10M|        h = pr->hash_next;
 6145|  1.10M|    }
 6146|  1.36M|    *ppr = NULL;
 6147|       |    return NULL;
 6148|  3.38M|}
quickjs.c:JS_AutoInitProperty:
 8160|    174|{
 8161|    174|    JSValue val;
 8162|    174|    JSContext *realm;
 8163|    174|    JSAutoInitFunc *func;
 8164|    174|    JSAutoInitIDEnum id;
 8165|       |    
 8166|    174|    if (js_shape_prepare_update(ctx, p, &prs))
  ------------------
  |  Branch (8166:9): [True: 0, False: 174]
  ------------------
 8167|      0|        return -1;
 8168|       |
 8169|    174|    realm = js_autoinit_get_realm(pr);
 8170|    174|    id = js_autoinit_get_id(pr);
 8171|    174|    func = js_autoinit_func_table[id];
 8172|       |    /* 'func' shall not modify the object properties 'pr' */
 8173|    174|    val = func(realm, p, prop, pr->u.init.opaque);
 8174|    174|    js_autoinit_free(ctx->rt, pr);
 8175|    174|    prs->flags &= ~JS_PROP_TMASK;
  ------------------
  |  |  301|    174|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
 8176|    174|    pr->u.value = JS_UNDEFINED;
  ------------------
  |  |  289|    174|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|    174|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8177|    174|    if (JS_IsException(val))
  ------------------
  |  Branch (8177:9): [True: 0, False: 174]
  ------------------
 8178|      0|        return -1;
 8179|    174|    if (id == JS_AUTOINIT_ID_MODULE_NS &&
  ------------------
  |  Branch (8179:9): [True: 0, False: 174]
  ------------------
 8180|      0|        JS_VALUE_GET_TAG(val) == JS_TAG_STRING) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (8180:9): [True: 0, False: 0]
  ------------------
 8181|       |        /* WARNING: a varref is returned as a string  ! */
 8182|      0|        prs->flags |= JS_PROP_VARREF;
  ------------------
  |  |  304|      0|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
 8183|      0|        pr->u.var_ref = JS_VALUE_GET_PTR(val);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
 8184|      0|        js_rc(pr->u.var_ref)->ref_count++;
 8185|    174|    } else if (p->class_id == JS_CLASS_GLOBAL_OBJECT) {
  ------------------
  |  Branch (8185:16): [True: 44, False: 130]
  ------------------
 8186|     44|        JSVarRef *var_ref;
 8187|       |        /* in the global object we use references */
 8188|     44|        var_ref = js_create_var_ref(ctx, FALSE);
 8189|     44|        if (!var_ref)
  ------------------
  |  Branch (8189:13): [True: 0, False: 44]
  ------------------
 8190|      0|            return -1;
 8191|     44|        prs->flags |= JS_PROP_VARREF;
  ------------------
  |  |  304|     44|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
 8192|     44|        pr->u.var_ref = var_ref;
 8193|     44|        var_ref->value = val; 
 8194|     44|        var_ref->is_const = !(prs->flags & JS_PROP_WRITABLE);
  ------------------
  |  |  297|     44|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
 8195|    130|    } else {
 8196|    130|        pr->u.value = val;
 8197|    130|    }
 8198|    174|    return 0;
 8199|    174|}
quickjs.c:js_autoinit_get_id:
 6073|    174|{
 6074|    174|    return pr->u.init.realm_and_id & 3;
 6075|    174|}
quickjs.c:set_cycle_flag:
 6152|  1.34k|{
 6153|  1.34k|}
quickjs.c:js_resize_array:
 1919|  3.40k|{
 1920|  3.40k|    if (unlikely(req_size > *psize))
  ------------------
  |  |   33|  3.40k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 878, False: 2.52k]
  |  |  ------------------
  ------------------
 1921|    878|        return js_realloc_array(ctx, parray, elem_size, psize, req_size);
 1922|  2.52k|    else
 1923|  2.52k|        return 0;
 1924|  3.40k|}
quickjs.c:js_realloc_array:
 1901|    878|{
 1902|    878|    int new_size;
 1903|    878|    size_t slack;
 1904|    878|    void *new_array;
 1905|       |    /* XXX: potential arithmetic overflow */
 1906|    878|    new_size = max_int(req_size, *psize * 3 / 2);
 1907|    878|    new_array = js_realloc2(ctx, *parray, new_size * elem_size, &slack);
 1908|    878|    if (!new_array)
  ------------------
  |  Branch (1908:9): [True: 0, False: 878]
  ------------------
 1909|      0|        return -1;
 1910|    878|    new_size += slack / elem_size;
 1911|    878|    *psize = new_size;
 1912|    878|    *parray = new_array;
 1913|    878|    return 0;
 1914|    878|}
quickjs.c:JS_InstantiateFunctionListItem2:
39372|    174|{
39373|    174|    const JSCFunctionListEntry *e = opaque;
39374|    174|    JSValue val, proto;
39375|       |
39376|    174|    switch(e->def_type) {
39377|    174|    case JS_DEF_CFUNC:
  ------------------
  |  | 1097|    174|#define JS_DEF_CFUNC          0
  ------------------
  |  Branch (39377:5): [True: 174, False: 0]
  ------------------
39378|    174|        val = JS_NewCFunction2(ctx, e->u.func.cfunc.generic,
39379|    174|                               e->name, e->u.func.length, e->u.func.cproto, e->magic);
39380|    174|        break;
39381|      0|    case JS_DEF_PROP_STRING:
  ------------------
  |  | 1100|      0|#define JS_DEF_PROP_STRING    3
  ------------------
  |  Branch (39381:5): [True: 0, False: 174]
  ------------------
39382|      0|        val = JS_NewAtomString(ctx, e->u.str);
39383|      0|        break;
39384|      0|    case JS_DEF_OBJECT:
  ------------------
  |  | 1105|      0|#define JS_DEF_OBJECT         8
  ------------------
  |  Branch (39384:5): [True: 0, False: 174]
  ------------------
39385|       |        /* XXX: could add a flag */
39386|      0|        if (atom == JS_ATOM_Symbol_unscopables)
  ------------------
  |  Branch (39386:13): [True: 0, False: 0]
  ------------------
39387|      0|            proto = JS_NULL;
  ------------------
  |  |  288|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
39388|      0|        else
39389|      0|            proto = ctx->class_proto[JS_CLASS_OBJECT];
39390|      0|        val = JS_NewObjectProtoList(ctx, proto,
39391|      0|                                    e->u.prop_list.tab, e->u.prop_list.len);
39392|      0|        break;
39393|      0|    default:
  ------------------
  |  Branch (39393:5): [True: 0, False: 174]
  ------------------
39394|      0|        abort();
39395|    174|    }
39396|    174|    return val;
39397|    174|}
quickjs.c:js_create_var_ref:
16996|  2.21k|{
16997|  2.21k|    JSVarRef *var_ref;
16998|  2.21k|    var_ref = js_malloc(ctx, sizeof(JSVarRef));
16999|  2.21k|    if (!var_ref)
  ------------------
  |  Branch (16999:9): [True: 0, False: 2.21k]
  ------------------
17000|      0|        return NULL;
17001|  2.21k|    js_rc(var_ref)->ref_count = 1;
17002|  2.21k|    if (is_lexical)
  ------------------
  |  Branch (17002:9): [True: 41, False: 2.17k]
  ------------------
17003|     41|        var_ref->value = JS_UNINITIALIZED;
  ------------------
  |  |  293|     41|#define JS_UNINITIALIZED JS_MKVAL(JS_TAG_UNINITIALIZED, 0)
  |  |  ------------------
  |  |  |  |  245|     41|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17004|  2.17k|    else
17005|  2.17k|        var_ref->value = JS_UNDEFINED;
  ------------------
  |  |  289|  2.17k|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|  2.17k|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17006|  2.21k|    var_ref->pvalue = &var_ref->value;
17007|  2.21k|    var_ref->is_detached = TRUE;
17008|  2.21k|    var_ref->is_lexical = FALSE;
17009|  2.21k|    var_ref->is_const = FALSE;
17010|  2.21k|    add_gc_object(ctx->rt, &var_ref->header, JS_GC_OBJ_TYPE_VAR_REF);
17011|  2.21k|    return var_ref;
17012|  2.21k|}
quickjs.c:JS_ThrowReferenceErrorNotDefined:
 7812|      9|{
 7813|      9|    char buf[ATOM_GET_STR_BUF_SIZE];
 7814|      9|    return JS_ThrowReferenceError(ctx, "'%s' is not defined",
 7815|      9|                                  JS_AtomGetStr(ctx, buf, sizeof(buf), name));
 7816|      9|}
quickjs.c:JS_GetOwnPropertyNamesInternal:
 8593|     20|{
 8594|     20|    int i, j;
 8595|     20|    JSShape *sh;
 8596|     20|    JSShapeProperty *prs;
 8597|     20|    JSPropertyEnum *tab_atom, *tab_exotic;
 8598|     20|    JSAtom atom;
 8599|     20|    uint32_t num_keys_count, str_keys_count, sym_keys_count, atom_count;
 8600|     20|    uint32_t num_index, str_index, sym_index, exotic_count, exotic_keys_count;
 8601|     20|    BOOL is_enumerable, num_sorted;
 8602|     20|    uint32_t num_key;
 8603|     20|    JSAtomKindEnum kind;
 8604|       |
 8605|       |    /* clear pointer for consistency in case of failure */
 8606|     20|    *ptab = NULL;
 8607|     20|    *plen = 0;
 8608|       |
 8609|       |    /* compute the number of returned properties */
 8610|     20|    num_keys_count = 0;
 8611|     20|    str_keys_count = 0;
 8612|     20|    sym_keys_count = 0;
 8613|     20|    exotic_keys_count = 0;
 8614|     20|    exotic_count = 0;
 8615|     20|    tab_exotic = NULL;
 8616|     20|    sh = p->shape;
 8617|     78|    for(i = 0, prs = get_shape_prop(sh); i < sh->prop_count; i++, prs++) {
  ------------------
  |  Branch (8617:42): [True: 58, False: 20]
  ------------------
 8618|     58|        atom = prs->atom;
 8619|     58|        if (atom != JS_ATOM_NULL) {
  ------------------
  |  |  449|     58|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (8619:13): [True: 58, False: 0]
  ------------------
 8620|     58|            is_enumerable = ((prs->flags & JS_PROP_ENUMERABLE) != 0);
  ------------------
  |  |  298|     58|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
 8621|     58|            kind = JS_AtomGetKind(ctx, atom);
 8622|     58|            if ((!(flags & JS_GPN_ENUM_ONLY) || is_enumerable) &&
  ------------------
  |  |  812|     58|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
  |  Branch (8622:18): [True: 28, False: 30]
  |  Branch (8622:49): [True: 0, False: 30]
  ------------------
 8623|     28|                ((flags >> kind) & 1) != 0) {
  ------------------
  |  Branch (8623:17): [True: 28, False: 0]
  ------------------
 8624|       |                /* need to raise an exception in case of the module
 8625|       |                   name space (implicit GetOwnProperty) */
 8626|     28|                if (unlikely((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) &&
  ------------------
  |  |   33|     56|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 28]
  |  |  ------------------
  ------------------
 8627|      0|                    (flags & (JS_GPN_SET_ENUM | JS_GPN_ENUM_ONLY))) {
  ------------------
  |  |  814|      0|#define JS_GPN_SET_ENUM     (1 << 5)
  ------------------
                                  (flags & (JS_GPN_SET_ENUM | JS_GPN_ENUM_ONLY))) {
  ------------------
  |  |  812|      0|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
  |  Branch (8627:21): [True: 0, False: 0]
  ------------------
 8628|      0|                    JSVarRef *var_ref = p->prop[i].u.var_ref;
 8629|      0|                    if (unlikely(JS_IsUninitialized(*var_ref->pvalue))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8630|      0|                        JS_ThrowReferenceErrorUninitialized(ctx, prs->atom);
 8631|      0|                        return -1;
 8632|      0|                    }
 8633|      0|                }
 8634|     28|                if (JS_AtomIsArrayIndex(ctx, &num_key, atom)) {
  ------------------
  |  Branch (8634:21): [True: 0, False: 28]
  ------------------
 8635|      0|                    num_keys_count++;
 8636|     28|                } else if (kind == JS_ATOM_KIND_STRING) {
  ------------------
  |  Branch (8636:28): [True: 28, False: 0]
  ------------------
 8637|     28|                    str_keys_count++;
 8638|     28|                } else {
 8639|      0|                    sym_keys_count++;
 8640|      0|                }
 8641|     28|            }
 8642|     58|        }
 8643|     58|    }
 8644|       |
 8645|     20|    if (p->is_exotic) {
  ------------------
  |  Branch (8645:9): [True: 0, False: 20]
  ------------------
 8646|      0|        if (p->fast_array) {
  ------------------
  |  Branch (8646:13): [True: 0, False: 0]
  ------------------
 8647|      0|            if (flags & JS_GPN_STRING_MASK) {
  ------------------
  |  |  808|      0|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
  |  Branch (8647:17): [True: 0, False: 0]
  ------------------
 8648|      0|                num_keys_count += p->u.array.count;
 8649|      0|            }
 8650|      0|        } else if (p->class_id == JS_CLASS_STRING) {
  ------------------
  |  Branch (8650:20): [True: 0, False: 0]
  ------------------
 8651|      0|            if (flags & JS_GPN_STRING_MASK) {
  ------------------
  |  |  808|      0|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
  |  Branch (8651:17): [True: 0, False: 0]
  ------------------
 8652|      0|                num_keys_count += js_string_obj_get_length(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8653|      0|            }
 8654|      0|        } else {
 8655|      0|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8656|      0|            if (em && em->get_own_property_names) {
  ------------------
  |  Branch (8656:17): [True: 0, False: 0]
  |  Branch (8656:23): [True: 0, False: 0]
  ------------------
 8657|      0|                if (em->get_own_property_names(ctx, &tab_exotic, &exotic_count,
  ------------------
  |  Branch (8657:21): [True: 0, False: 0]
  ------------------
 8658|      0|                                               JS_MKPTR(JS_TAG_OBJECT, p)))
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8659|      0|                    return -1;
 8660|      0|                for(i = 0; i < exotic_count; i++) {
  ------------------
  |  Branch (8660:28): [True: 0, False: 0]
  ------------------
 8661|      0|                    atom = tab_exotic[i].atom;
 8662|      0|                    kind = JS_AtomGetKind(ctx, atom);
 8663|      0|                    if (((flags >> kind) & 1) != 0) {
  ------------------
  |  Branch (8663:25): [True: 0, False: 0]
  ------------------
 8664|      0|                        is_enumerable = FALSE;
 8665|      0|                        if (flags & (JS_GPN_SET_ENUM | JS_GPN_ENUM_ONLY)) {
  ------------------
  |  |  814|      0|#define JS_GPN_SET_ENUM     (1 << 5)
  ------------------
                                      if (flags & (JS_GPN_SET_ENUM | JS_GPN_ENUM_ONLY)) {
  ------------------
  |  |  812|      0|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
  |  Branch (8665:29): [True: 0, False: 0]
  ------------------
 8666|      0|                            JSPropertyDescriptor desc;
 8667|      0|                            int res;
 8668|       |                            /* set the "is_enumerable" field if necessary */
 8669|      0|                            res = JS_GetOwnPropertyInternal(ctx, &desc, p, atom);
 8670|      0|                            if (res < 0) {
  ------------------
  |  Branch (8670:33): [True: 0, False: 0]
  ------------------
 8671|      0|                                JS_FreePropertyEnum(ctx, tab_exotic, exotic_count);
 8672|      0|                                return -1;
 8673|      0|                            }
 8674|      0|                            if (res) {
  ------------------
  |  Branch (8674:33): [True: 0, False: 0]
  ------------------
 8675|      0|                                is_enumerable =
 8676|      0|                                    ((desc.flags & JS_PROP_ENUMERABLE) != 0);
  ------------------
  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
 8677|      0|                                js_free_desc(ctx, &desc);
 8678|      0|                            }
 8679|      0|                            tab_exotic[i].is_enumerable = is_enumerable;
 8680|      0|                        }
 8681|      0|                        if (!(flags & JS_GPN_ENUM_ONLY) || is_enumerable) {
  ------------------
  |  |  812|      0|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
  |  Branch (8681:29): [True: 0, False: 0]
  |  Branch (8681:60): [True: 0, False: 0]
  ------------------
 8682|      0|                            exotic_keys_count++;
 8683|      0|                        }
 8684|      0|                    }
 8685|      0|                }
 8686|      0|            }
 8687|      0|        }
 8688|      0|    }
 8689|       |
 8690|       |    /* fill them */
 8691|       |
 8692|     20|    atom_count = num_keys_count + str_keys_count;
 8693|     20|    if (atom_count < str_keys_count)
  ------------------
  |  Branch (8693:9): [True: 0, False: 20]
  ------------------
 8694|      0|        goto add_overflow;
 8695|     20|    atom_count += sym_keys_count;
 8696|     20|    if (atom_count < sym_keys_count)
  ------------------
  |  Branch (8696:9): [True: 0, False: 20]
  ------------------
 8697|      0|        goto add_overflow;
 8698|     20|    atom_count += exotic_keys_count;
 8699|     20|    if (atom_count < exotic_keys_count || atom_count > INT32_MAX) {
  ------------------
  |  Branch (8699:9): [True: 0, False: 20]
  |  Branch (8699:43): [True: 0, False: 20]
  ------------------
 8700|      0|    add_overflow:
 8701|      0|        JS_ThrowOutOfMemory(ctx);
 8702|      0|        JS_FreePropertyEnum(ctx, tab_exotic, exotic_count);
 8703|      0|        return -1;
 8704|      0|    }
 8705|       |    /* XXX: need generic way to test for js_malloc(ctx, a * b) overflow */
 8706|       |    
 8707|       |    /* avoid allocating 0 bytes */
 8708|     20|    tab_atom = js_malloc(ctx, sizeof(tab_atom[0]) * max_int(atom_count, 1));
 8709|     20|    if (!tab_atom) {
  ------------------
  |  Branch (8709:9): [True: 0, False: 20]
  ------------------
 8710|      0|        JS_FreePropertyEnum(ctx, tab_exotic, exotic_count);
 8711|      0|        return -1;
 8712|      0|    }
 8713|       |
 8714|     20|    num_index = 0;
 8715|     20|    str_index = num_keys_count;
 8716|     20|    sym_index = str_index + str_keys_count;
 8717|       |
 8718|     20|    num_sorted = TRUE;
 8719|     20|    sh = p->shape;
 8720|     78|    for(i = 0, prs = get_shape_prop(sh); i < sh->prop_count; i++, prs++) {
  ------------------
  |  Branch (8720:42): [True: 58, False: 20]
  ------------------
 8721|     58|        atom = prs->atom;
 8722|     58|        if (atom != JS_ATOM_NULL) {
  ------------------
  |  |  449|     58|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (8722:13): [True: 58, False: 0]
  ------------------
 8723|     58|            is_enumerable = ((prs->flags & JS_PROP_ENUMERABLE) != 0);
  ------------------
  |  |  298|     58|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
 8724|     58|            kind = JS_AtomGetKind(ctx, atom);
 8725|     58|            if ((!(flags & JS_GPN_ENUM_ONLY) || is_enumerable) &&
  ------------------
  |  |  812|     58|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
  |  Branch (8725:18): [True: 28, False: 30]
  |  Branch (8725:49): [True: 0, False: 30]
  ------------------
 8726|     28|                ((flags >> kind) & 1) != 0) {
  ------------------
  |  Branch (8726:17): [True: 28, False: 0]
  ------------------
 8727|     28|                if (JS_AtomIsArrayIndex(ctx, &num_key, atom)) {
  ------------------
  |  Branch (8727:21): [True: 0, False: 28]
  ------------------
 8728|      0|                    j = num_index++;
 8729|      0|                    num_sorted = FALSE;
 8730|     28|                } else if (kind == JS_ATOM_KIND_STRING) {
  ------------------
  |  Branch (8730:28): [True: 28, False: 0]
  ------------------
 8731|     28|                    j = str_index++;
 8732|     28|                } else {
 8733|      0|                    j = sym_index++;
 8734|      0|                }
 8735|     28|                tab_atom[j].atom = JS_DupAtom(ctx, atom);
 8736|     28|                tab_atom[j].is_enumerable = is_enumerable;
 8737|     28|            }
 8738|     58|        }
 8739|     58|    }
 8740|       |
 8741|     20|    if (p->is_exotic) {
  ------------------
  |  Branch (8741:9): [True: 0, False: 20]
  ------------------
 8742|      0|        int len;
 8743|      0|        if (p->fast_array) {
  ------------------
  |  Branch (8743:13): [True: 0, False: 0]
  ------------------
 8744|      0|            if (flags & JS_GPN_STRING_MASK) {
  ------------------
  |  |  808|      0|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
  |  Branch (8744:17): [True: 0, False: 0]
  ------------------
 8745|      0|                len = p->u.array.count;
 8746|      0|                goto add_array_keys;
 8747|      0|            }
 8748|      0|        } else if (p->class_id == JS_CLASS_STRING) {
  ------------------
  |  Branch (8748:20): [True: 0, False: 0]
  ------------------
 8749|      0|            if (flags & JS_GPN_STRING_MASK) {
  ------------------
  |  |  808|      0|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
  |  Branch (8749:17): [True: 0, False: 0]
  ------------------
 8750|      0|                len = js_string_obj_get_length(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8751|      0|            add_array_keys:
 8752|      0|                for(i = 0; i < len; i++) {
  ------------------
  |  Branch (8752:28): [True: 0, False: 0]
  ------------------
 8753|      0|                    tab_atom[num_index].atom = __JS_AtomFromUInt32(i);
 8754|      0|                    if (tab_atom[num_index].atom == JS_ATOM_NULL) {
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (8754:25): [True: 0, False: 0]
  ------------------
 8755|      0|                        JS_FreePropertyEnum(ctx, tab_atom, num_index);
 8756|      0|                        return -1;
 8757|      0|                    }
 8758|      0|                    tab_atom[num_index].is_enumerable = TRUE;
 8759|      0|                    num_index++;
 8760|      0|                }
 8761|      0|            }
 8762|      0|        } else {
 8763|       |            /* Note: exotic keys are not reordered and comes after the object own properties. */
 8764|      0|            for(i = 0; i < exotic_count; i++) {
  ------------------
  |  Branch (8764:24): [True: 0, False: 0]
  ------------------
 8765|      0|                atom = tab_exotic[i].atom;
 8766|      0|                is_enumerable = tab_exotic[i].is_enumerable;
 8767|      0|                kind = JS_AtomGetKind(ctx, atom);
 8768|      0|                if ((!(flags & JS_GPN_ENUM_ONLY) || is_enumerable) &&
  ------------------
  |  |  812|      0|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
  |  Branch (8768:22): [True: 0, False: 0]
  |  Branch (8768:53): [True: 0, False: 0]
  ------------------
 8769|      0|                    ((flags >> kind) & 1) != 0) {
  ------------------
  |  Branch (8769:21): [True: 0, False: 0]
  ------------------
 8770|      0|                    tab_atom[sym_index].atom = atom;
 8771|      0|                    tab_atom[sym_index].is_enumerable = is_enumerable;
 8772|      0|                    sym_index++;
 8773|      0|                } else {
 8774|      0|                    JS_FreeAtom(ctx, atom);
 8775|      0|                }
 8776|      0|            }
 8777|      0|            js_free(ctx, tab_exotic);
 8778|      0|        }
 8779|      0|    }
 8780|       |
 8781|     20|    assert(num_index == num_keys_count);
  ------------------
  |  Branch (8781:5): [True: 0, False: 20]
  |  Branch (8781:5): [True: 20, False: 0]
  ------------------
 8782|     20|    assert(str_index == num_keys_count + str_keys_count);
  ------------------
  |  Branch (8782:5): [True: 0, False: 20]
  |  Branch (8782:5): [True: 20, False: 0]
  ------------------
 8783|     20|    assert(sym_index == atom_count);
  ------------------
  |  Branch (8783:5): [True: 0, False: 20]
  |  Branch (8783:5): [True: 20, False: 0]
  ------------------
 8784|       |
 8785|     20|    if (num_keys_count != 0 && !num_sorted) {
  ------------------
  |  Branch (8785:9): [True: 0, False: 20]
  |  Branch (8785:32): [True: 0, False: 0]
  ------------------
 8786|      0|        rqsort(tab_atom, num_keys_count, sizeof(tab_atom[0]), num_keys_cmp,
 8787|      0|               ctx);
 8788|      0|    }
 8789|     20|    *ptab = tab_atom;
 8790|     20|    *plen = atom_count;
 8791|     20|    return 0;
 8792|     20|}
quickjs.c:JS_AtomGetKind:
 3123|    116|{
 3124|    116|    JSRuntime *rt;
 3125|    116|    JSAtomStruct *p;
 3126|       |
 3127|    116|    rt = ctx->rt;
 3128|    116|    if (__JS_AtomIsTaggedInt(v))
  ------------------
  |  Branch (3128:9): [True: 0, False: 116]
  ------------------
 3129|      0|        return JS_ATOM_KIND_STRING;
 3130|    116|    p = rt->atom_array[v];
 3131|    116|    switch(p->atom_type) {
 3132|    116|    case JS_ATOM_TYPE_STRING:
  ------------------
  |  Branch (3132:5): [True: 116, False: 0]
  ------------------
 3133|    116|        return JS_ATOM_KIND_STRING;
 3134|      0|    case JS_ATOM_TYPE_GLOBAL_SYMBOL:
  ------------------
  |  Branch (3134:5): [True: 0, False: 116]
  ------------------
 3135|      0|        return JS_ATOM_KIND_SYMBOL;
 3136|      0|    case JS_ATOM_TYPE_SYMBOL:
  ------------------
  |  Branch (3136:5): [True: 0, False: 116]
  ------------------
 3137|      0|        if (p->hash == JS_ATOM_HASH_PRIVATE)
  ------------------
  |  |  573|      0|#define JS_ATOM_HASH_PRIVATE JS_ATOM_HASH_MASK
  |  |  ------------------
  |  |  |  |  572|      0|#define JS_ATOM_HASH_MASK  ((1 << 30) - 1)
  |  |  ------------------
  ------------------
  |  Branch (3137:13): [True: 0, False: 0]
  ------------------
 3138|      0|            return JS_ATOM_KIND_PRIVATE;
 3139|      0|        else
 3140|      0|            return JS_ATOM_KIND_SYMBOL;
 3141|      0|    default:
  ------------------
  |  Branch (3141:5): [True: 0, False: 116]
  ------------------
 3142|      0|        abort();
 3143|    116|    }
 3144|    116|}
quickjs.c:JS_AtomIsArrayIndex:
 3626|     90|{
 3627|     90|    if (__JS_AtomIsTaggedInt(atom)) {
  ------------------
  |  Branch (3627:9): [True: 0, False: 90]
  ------------------
 3628|      0|        *pval = __JS_AtomToUInt32(atom);
 3629|      0|        return TRUE;
 3630|     90|    } else {
 3631|     90|        JSRuntime *rt = ctx->rt;
 3632|     90|        JSAtomStruct *p;
 3633|     90|        uint32_t val;
 3634|       |
 3635|     90|        assert(atom < rt->atom_size);
  ------------------
  |  Branch (3635:9): [True: 0, False: 90]
  |  Branch (3635:9): [True: 90, False: 0]
  ------------------
 3636|     90|        p = rt->atom_array[atom];
 3637|     90|        if (p->atom_type == JS_ATOM_TYPE_STRING &&
  ------------------
  |  Branch (3637:13): [True: 76, False: 14]
  ------------------
 3638|     76|            is_num_string(&val, p) && val != -1) {
  ------------------
  |  Branch (3638:13): [True: 0, False: 76]
  |  Branch (3638:39): [True: 0, False: 0]
  ------------------
 3639|      0|            *pval = val;
 3640|      0|            return TRUE;
 3641|     90|        } else {
 3642|     90|            *pval = 0;
 3643|     90|            return FALSE;
 3644|     90|        }
 3645|     90|    }
 3646|     90|}
quickjs.c:js_free_desc:
 9644|     28|{
 9645|     28|    JS_FreeValue(ctx, desc->getter);
 9646|     28|    JS_FreeValue(ctx, desc->setter);
 9647|     28|    JS_FreeValue(ctx, desc->value);
 9648|     28|}
quickjs.c:JS_GetOwnPropertyInternal:
 8810|     32|{
 8811|     32|    JSShapeProperty *prs;
 8812|     32|    JSProperty *pr;
 8813|       |
 8814|     32|retry:
 8815|     32|    prs = find_own_property(&pr, p, prop);
 8816|     32|    if (prs) {
  ------------------
  |  Branch (8816:9): [True: 28, False: 4]
  ------------------
 8817|     28|        if (desc) {
  ------------------
  |  Branch (8817:13): [True: 28, False: 0]
  ------------------
 8818|     28|            desc->flags = prs->flags & JS_PROP_C_W_E;
  ------------------
  |  |  299|     28|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|     28|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|     28|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     28|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
 8819|     28|            desc->getter = JS_UNDEFINED;
  ------------------
  |  |  289|     28|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     28|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8820|     28|            desc->setter = JS_UNDEFINED;
  ------------------
  |  |  289|     28|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     28|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8821|     28|            desc->value = JS_UNDEFINED;
  ------------------
  |  |  289|     28|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     28|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8822|     28|            if (unlikely(prs->flags & JS_PROP_TMASK)) {
  ------------------
  |  |   33|     28|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 28]
  |  |  ------------------
  ------------------
 8823|      0|                if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  301|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
  ------------------
  |  |  303|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
  |  Branch (8823:21): [True: 0, False: 0]
  ------------------
 8824|      0|                    desc->flags |= JS_PROP_GETSET;
  ------------------
  |  |  303|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
 8825|      0|                    if (pr->u.getset.getter)
  ------------------
  |  Branch (8825:25): [True: 0, False: 0]
  ------------------
 8826|      0|                        desc->getter = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.getter));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8827|      0|                    if (pr->u.getset.setter)
  ------------------
  |  Branch (8827:25): [True: 0, False: 0]
  ------------------
 8828|      0|                        desc->setter = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.setter));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8829|      0|                } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  301|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  304|      0|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (8829:28): [True: 0, False: 0]
  ------------------
 8830|      0|                    JSValue val = *pr->u.var_ref->pvalue;
 8831|      0|                    if (unlikely(JS_IsUninitialized(val))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8832|      0|                        JS_ThrowReferenceErrorUninitialized(ctx, prs->atom);
 8833|      0|                        return -1;
 8834|      0|                    }
 8835|      0|                    desc->value = JS_DupValue(ctx, val);
 8836|      0|                } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  301|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  305|      0|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (8836:28): [True: 0, False: 0]
  ------------------
 8837|       |                    /* Instantiate property and retry */
 8838|      0|                    if (JS_AutoInitProperty(ctx, p, prop, pr, prs))
  ------------------
  |  Branch (8838:25): [True: 0, False: 0]
  ------------------
 8839|      0|                        return -1;
 8840|      0|                    goto retry;
 8841|      0|                }
 8842|     28|            } else {
 8843|     28|                desc->value = JS_DupValue(ctx, pr->u.value);
 8844|     28|            }
 8845|     28|        } else {
 8846|       |            /* for consistency, send the exception even if desc is NULL */
 8847|      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]
  |  |  ------------------
  ------------------
 8848|      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]
  |  |  ------------------
  ------------------
 8849|      0|                    JS_ThrowReferenceErrorUninitialized(ctx, prs->atom);
 8850|      0|                    return -1;
 8851|      0|                }
 8852|      0|            } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  301|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                          } else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
  ------------------
  |  |  305|      0|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
  |  Branch (8852:24): [True: 0, False: 0]
  ------------------
 8853|       |                /* nothing to do: delay instantiation until actual value and/or attributes are read */
 8854|      0|            }
 8855|      0|        }
 8856|     28|        return TRUE;
 8857|     28|    }
 8858|      4|    if (p->is_exotic) {
  ------------------
  |  Branch (8858:9): [True: 0, False: 4]
  ------------------
 8859|      0|        if (p->fast_array) {
  ------------------
  |  Branch (8859:13): [True: 0, False: 0]
  ------------------
 8860|       |            /* specific case for fast arrays */
 8861|      0|            if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (8861:17): [True: 0, False: 0]
  ------------------
 8862|      0|                uint32_t idx;
 8863|      0|                idx = __JS_AtomToUInt32(prop);
 8864|      0|                if (idx < p->u.array.count) {
  ------------------
  |  Branch (8864:21): [True: 0, False: 0]
  ------------------
 8865|      0|                    if (desc) {
  ------------------
  |  Branch (8865:25): [True: 0, False: 0]
  ------------------
 8866|      0|                        desc->flags = JS_PROP_WRITABLE | JS_PROP_ENUMERABLE |
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                      desc->flags = JS_PROP_WRITABLE | JS_PROP_ENUMERABLE |
  ------------------
  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
 8867|      0|                            JS_PROP_CONFIGURABLE;
  ------------------
  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
 8868|      0|                        desc->getter = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8869|      0|                        desc->setter = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 8870|      0|                        desc->value = JS_GetPropertyUint32(ctx, JS_MKPTR(JS_TAG_OBJECT, p), idx);
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8871|      0|                    }
 8872|      0|                    return TRUE;
 8873|      0|                }
 8874|      0|            }
 8875|      0|        } else {
 8876|      0|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 8877|      0|            if (em && em->get_own_property) {
  ------------------
  |  Branch (8877:17): [True: 0, False: 0]
  |  Branch (8877:23): [True: 0, False: 0]
  ------------------
 8878|      0|                return em->get_own_property(ctx, desc,
 8879|      0|                                            JS_MKPTR(JS_TAG_OBJECT, p), prop);
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 8880|      0|            }
 8881|      0|        }
 8882|      0|    }
 8883|      4|    return FALSE;
 8884|      4|}
quickjs.c:js_get_atom_index:
 3152|      2|{
 3153|      2|    uint32_t i = p->hash_next;  /* atom_index */
 3154|      2|    if (p->atom_type != JS_ATOM_TYPE_SYMBOL) {
  ------------------
  |  Branch (3154:9): [True: 2, False: 0]
  ------------------
 3155|      2|        JSAtomStruct *p1;
 3156|       |
 3157|      2|        i = rt->atom_hash[p->hash & (rt->atom_hash_size - 1)];
 3158|      2|        p1 = rt->atom_array[i];
 3159|      8|        while (p1 != p) {
  ------------------
  |  Branch (3159:16): [True: 6, False: 2]
  ------------------
 3160|      6|            assert(i != 0);
  ------------------
  |  Branch (3160:13): [True: 0, False: 6]
  |  Branch (3160:13): [True: 6, False: 0]
  ------------------
 3161|      6|            i = p1->hash_next;
 3162|      6|            p1 = rt->atom_array[i];
 3163|      6|        }
 3164|      2|    }
 3165|      2|    return i;
 3166|      2|}
quickjs.c:JS_GetPropertyValue:
 9022|   343k|{
 9023|   343k|    JSAtom atom;
 9024|   343k|    JSValue ret;
 9025|       |
 9026|   343k|    if (likely(JS_VALUE_GET_TAG(this_obj) == JS_TAG_OBJECT &&
  ------------------
  |  |   32|   686k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 343k, False: 0]
  |  |  |  Branch (32:45): [True: 343k, False: 0]
  |  |  |  Branch (32:45): [True: 343k, False: 0]
  |  |  ------------------
  ------------------
 9027|   343k|               JS_VALUE_GET_TAG(prop) == JS_TAG_INT)) {
 9028|   343k|        JSObject *p;
 9029|   343k|        uint32_t idx;
 9030|       |        /* fast path for array access */
 9031|   343k|        p = JS_VALUE_GET_OBJ(this_obj);
  ------------------
  |  |  227|   343k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|   343k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9032|   343k|        idx = JS_VALUE_GET_INT(prop);
  ------------------
  |  |  239|   343k|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
 9033|   343k|        switch(p->class_id) {
 9034|   343k|        case JS_CLASS_ARRAY:
  ------------------
  |  Branch (9034:9): [True: 343k, False: 0]
  ------------------
 9035|   343k|        case JS_CLASS_ARGUMENTS:
  ------------------
  |  Branch (9035:9): [True: 0, False: 343k]
  ------------------
 9036|   343k|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|   343k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 4, False: 343k]
  |  |  ------------------
  ------------------
 9037|   343k|            return JS_DupValue(ctx, p->u.array.u.values[idx]);
 9038|      0|        case JS_CLASS_MAPPED_ARGUMENTS:
  ------------------
  |  Branch (9038:9): [True: 0, False: 343k]
  ------------------
 9039|      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]
  |  |  ------------------
  ------------------
 9040|      0|            return JS_DupValue(ctx, *p->u.array.u.var_refs[idx]->pvalue);
 9041|      0|        case JS_CLASS_INT8_ARRAY:
  ------------------
  |  Branch (9041:9): [True: 0, False: 343k]
  ------------------
 9042|      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]
  |  |  ------------------
  ------------------
 9043|      0|            return JS_NewInt32(ctx, p->u.array.u.int8_ptr[idx]);
 9044|      0|        case JS_CLASS_UINT8C_ARRAY:
  ------------------
  |  Branch (9044:9): [True: 0, False: 343k]
  ------------------
 9045|      0|        case JS_CLASS_UINT8_ARRAY:
  ------------------
  |  Branch (9045:9): [True: 0, False: 343k]
  ------------------
 9046|      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]
  |  |  ------------------
  ------------------
 9047|      0|            return JS_NewInt32(ctx, p->u.array.u.uint8_ptr[idx]);
 9048|      0|        case JS_CLASS_INT16_ARRAY:
  ------------------
  |  Branch (9048:9): [True: 0, False: 343k]
  ------------------
 9049|      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]
  |  |  ------------------
  ------------------
 9050|      0|            return JS_NewInt32(ctx, p->u.array.u.int16_ptr[idx]);
 9051|      0|        case JS_CLASS_UINT16_ARRAY:
  ------------------
  |  Branch (9051:9): [True: 0, False: 343k]
  ------------------
 9052|      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]
  |  |  ------------------
  ------------------
 9053|      0|            return JS_NewInt32(ctx, p->u.array.u.uint16_ptr[idx]);
 9054|      0|        case JS_CLASS_INT32_ARRAY:
  ------------------
  |  Branch (9054:9): [True: 0, False: 343k]
  ------------------
 9055|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9056|      0|            return JS_NewInt32(ctx, p->u.array.u.int32_ptr[idx]);
 9057|      0|        case JS_CLASS_UINT32_ARRAY:
  ------------------
  |  Branch (9057:9): [True: 0, False: 343k]
  ------------------
 9058|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9059|      0|            return JS_NewUint32(ctx, p->u.array.u.uint32_ptr[idx]);
 9060|      0|        case JS_CLASS_BIG_INT64_ARRAY:
  ------------------
  |  Branch (9060:9): [True: 0, False: 343k]
  ------------------
 9061|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9062|      0|            return JS_NewBigInt64(ctx, p->u.array.u.int64_ptr[idx]);
 9063|      0|        case JS_CLASS_BIG_UINT64_ARRAY:
  ------------------
  |  Branch (9063:9): [True: 0, False: 343k]
  ------------------
 9064|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9065|      0|            return JS_NewBigUint64(ctx, p->u.array.u.uint64_ptr[idx]);
 9066|      0|        case JS_CLASS_FLOAT16_ARRAY:
  ------------------
  |  Branch (9066:9): [True: 0, False: 343k]
  ------------------
 9067|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9068|      0|            return __JS_NewFloat64(ctx, fromfp16(p->u.array.u.fp16_ptr[idx]));
 9069|      0|        case JS_CLASS_FLOAT32_ARRAY:
  ------------------
  |  Branch (9069:9): [True: 0, False: 343k]
  ------------------
 9070|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9071|      0|            return __JS_NewFloat64(ctx, p->u.array.u.float_ptr[idx]);
 9072|      0|        case JS_CLASS_FLOAT64_ARRAY:
  ------------------
  |  Branch (9072:9): [True: 0, False: 343k]
  ------------------
 9073|      0|            if (unlikely(idx >= p->u.array.count)) goto slow_path;
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 9074|      0|            return __JS_NewFloat64(ctx, p->u.array.u.double_ptr[idx]);
 9075|      0|        default:
  ------------------
  |  Branch (9075:9): [True: 0, False: 343k]
  ------------------
 9076|      0|            goto slow_path;
 9077|   343k|        }
 9078|   343k|    } else {
 9079|      4|    slow_path:
 9080|       |        /* ToObject() must be done before ToPropertyKey() */
 9081|      4|        if (JS_IsNull(this_obj) || JS_IsUndefined(this_obj)) {
  ------------------
  |  Branch (9081:13): [True: 0, False: 4]
  |  Branch (9081:36): [True: 0, False: 4]
  ------------------
 9082|      0|            JS_FreeValue(ctx, prop);
 9083|      0|            return JS_ThrowTypeError(ctx, "cannot read property of %s", JS_IsNull(this_obj) ? "null" : "undefined");
  ------------------
  |  Branch (9083:73): [True: 0, False: 0]
  ------------------
 9084|      0|        }
 9085|      4|        atom = JS_ValueToAtom(ctx, prop);
 9086|      4|        JS_FreeValue(ctx, prop);
 9087|      4|        if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      4|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 4]
  |  |  ------------------
  ------------------
 9088|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 9089|      4|        ret = JS_GetProperty(ctx, this_obj, atom);
 9090|      4|        JS_FreeAtom(ctx, atom);
 9091|      4|        return ret;
 9092|      4|    }
 9093|   343k|}
quickjs.c:add_fast_array_element:
 9535|   343k|{
 9536|   343k|    uint32_t new_len, array_len;
 9537|       |    /* extend the array by one */
 9538|       |    /* XXX: convert to slow array if new_len > 2^31-1 elements */
 9539|   343k|    new_len = p->u.array.count + 1;
 9540|       |    /* update the length if necessary. We assume that if the length is
 9541|       |       not an integer, then if it >= 2^31.  */
 9542|   343k|    if (likely(JS_VALUE_GET_TAG(p->prop[0].u.value) == JS_TAG_INT)) {
  ------------------
  |  |   32|   343k|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 343k, False: 0]
  |  |  ------------------
  ------------------
 9543|   343k|        array_len = JS_VALUE_GET_INT(p->prop[0].u.value);
  ------------------
  |  |  239|   343k|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
 9544|   343k|        if (new_len > array_len) {
  ------------------
  |  Branch (9544:13): [True: 343k, False: 0]
  ------------------
 9545|   343k|            if (unlikely(!(get_shape_prop(p->shape)->flags & JS_PROP_WRITABLE))) {
  ------------------
  |  |   33|   343k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 343k]
  |  |  ------------------
  ------------------
 9546|      0|                JS_FreeValue(ctx, val);
 9547|      0|                return JS_ThrowTypeErrorReadOnly(ctx, flags, JS_ATOM_length);
 9548|      0|            }
 9549|   343k|            p->prop[0].u.value = JS_NewInt32(ctx, new_len);
 9550|   343k|        }
 9551|   343k|    }
 9552|   343k|    if (unlikely(new_len > p->u.array.u1.size)) {
  ------------------
  |  |   33|   343k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 67, False: 343k]
  |  |  ------------------
  ------------------
 9553|     67|        if (expand_fast_array(ctx, p, new_len)) {
  ------------------
  |  Branch (9553:13): [True: 0, False: 67]
  ------------------
 9554|      0|            JS_FreeValue(ctx, val);
 9555|      0|            return -1;
 9556|      0|        }
 9557|     67|    }
 9558|   343k|    p->u.array.u.values[new_len - 1] = val;
 9559|   343k|    p->u.array.count = new_len;
 9560|   343k|    return TRUE;
 9561|   343k|}
quickjs.c:expand_fast_array:
 9516|     71|{
 9517|     71|    uint32_t new_size;
 9518|     71|    size_t slack;
 9519|     71|    JSValue *new_array_prop;
 9520|       |    /* XXX: potential arithmetic overflow */
 9521|     71|    new_size = max_int(new_len, p->u.array.u1.size * 3 / 2);
 9522|     71|    new_array_prop = js_realloc2(ctx, p->u.array.u.values, sizeof(JSValue) * new_size, &slack);
 9523|     71|    if (!new_array_prop)
  ------------------
  |  Branch (9523:9): [True: 0, False: 71]
  ------------------
 9524|      0|        return -1;
 9525|     71|    new_size += slack / sizeof(*new_array_prop);
 9526|     71|    p->u.array.u.values = new_array_prop;
 9527|     71|    p->u.array.u1.size = new_size;
 9528|     71|    return 0;
 9529|     71|}
quickjs.c:add_property:
 9172|  16.0k|{
 9173|  16.0k|    JSShape *sh, *new_sh;
 9174|       |
 9175|  16.0k|    if (unlikely(__JS_AtomIsTaggedInt(prop))) {
  ------------------
  |  |   33|  16.0k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 12, False: 16.0k]
  |  |  ------------------
  ------------------
 9176|       |        /* update is_std_array_prototype */
 9177|     12|        if (unlikely(p->is_std_array_prototype)) {
  ------------------
  |  |   33|     12|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 12]
  |  |  ------------------
  ------------------
 9178|      0|            p->is_std_array_prototype = FALSE;
 9179|     12|        } else if (unlikely(p->has_immutable_prototype)) {
  ------------------
  |  |   33|     12|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 12]
  |  |  ------------------
  ------------------
 9180|      0|            struct list_head *el;
 9181|       |            
 9182|       |            /* modifying Object.prototype : reset the corresponding is_std_array_prototype */
 9183|      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]
  |  |  ------------------
  ------------------
 9184|      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)))
  |  |  ------------------
  ------------------
 9185|      0|                if (JS_IsObject(ctx1->class_proto[JS_CLASS_OBJECT]) && 
  ------------------
  |  Branch (9185:21): [True: 0, False: 0]
  ------------------
 9186|      0|                    JS_VALUE_GET_OBJ(ctx1->class_proto[JS_CLASS_OBJECT]) == p) {
  ------------------
  |  |  227|      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 (9186:21): [True: 0, False: 0]
  ------------------
 9187|      0|                    if (JS_IsObject(ctx1->class_proto[JS_CLASS_ARRAY])) {
  ------------------
  |  Branch (9187:25): [True: 0, False: 0]
  ------------------
 9188|      0|                        JSObject *p1 = JS_VALUE_GET_OBJ(ctx1->class_proto[JS_CLASS_ARRAY]);
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 9189|      0|                        p1->is_std_array_prototype = FALSE;
 9190|      0|                    }
 9191|      0|                    break;
 9192|      0|                }
 9193|      0|            }
 9194|      0|        }
 9195|     12|    }
 9196|  16.0k|    sh = p->shape;
 9197|  16.0k|    if (sh->is_hashed) {
  ------------------
  |  Branch (9197:9): [True: 5.05k, False: 10.9k]
  ------------------
 9198|       |        /* try to find an existing shape */
 9199|  5.05k|        new_sh = find_hashed_shape_prop(ctx->rt, sh, prop, prop_flags);
 9200|  5.05k|        if (new_sh) {
  ------------------
  |  Branch (9200:13): [True: 1.65k, False: 3.39k]
  ------------------
 9201|       |            /* matching shape found: use it */
 9202|       |            /*  the property array may need to be resized */
 9203|  1.65k|            if (new_sh->prop_size != sh->prop_size) {
  ------------------
  |  Branch (9203:17): [True: 2, False: 1.65k]
  ------------------
 9204|      2|                JSProperty *new_prop;
 9205|      2|                new_prop = js_realloc(ctx, p->prop, sizeof(p->prop[0]) *
 9206|      2|                                      new_sh->prop_size);
 9207|      2|                if (!new_prop)
  ------------------
  |  Branch (9207:21): [True: 0, False: 2]
  ------------------
 9208|      0|                    return NULL;
 9209|      2|                p->prop = new_prop;
 9210|      2|            }
 9211|  1.65k|            p->shape = js_dup_shape(new_sh);
 9212|  1.65k|            js_free_shape(ctx->rt, sh);
 9213|  1.65k|            return &p->prop[new_sh->prop_count - 1];
 9214|  3.39k|        } else if (js_rc(sh)->ref_count != 1) {
  ------------------
  |  Branch (9214:20): [True: 833, False: 2.56k]
  ------------------
 9215|       |            /* if the shape is shared, clone it */
 9216|    833|            new_sh = js_clone_shape(ctx, sh);
 9217|    833|            if (!new_sh)
  ------------------
  |  Branch (9217:17): [True: 0, False: 833]
  ------------------
 9218|      0|                return NULL;
 9219|       |            /* hash the cloned shape */
 9220|    833|            new_sh->is_hashed = TRUE;
 9221|    833|            js_shape_hash_link(ctx->rt, new_sh);
 9222|    833|            js_free_shape(ctx->rt, p->shape);
 9223|    833|            p->shape = new_sh;
 9224|    833|        }
 9225|  5.05k|    }
 9226|  16.0k|    assert(js_rc(p->shape)->ref_count == 1);
  ------------------
  |  Branch (9226:5): [True: 0, False: 14.3k]
  |  Branch (9226:5): [True: 14.3k, False: 0]
  ------------------
 9227|  14.3k|    if (add_shape_property(ctx, &p->shape, p, prop, prop_flags))
  ------------------
  |  Branch (9227:9): [True: 0, False: 14.3k]
  ------------------
 9228|      0|        return NULL;
 9229|  14.3k|    return &p->prop[p->shape->prop_count - 1];
 9230|  14.3k|}
quickjs.c:find_hashed_shape_prop:
 5526|  5.05k|{
 5527|  5.05k|    JSShape *sh1;
 5528|  5.05k|    uint32_t h, h1, i, n;
 5529|       |
 5530|  5.05k|    h = sh->hash;
 5531|  5.05k|    h = shape_hash(h, atom);
 5532|  5.05k|    h = shape_hash(h, prop_flags);
 5533|  5.05k|    h1 = get_shape_hash(h, rt->shape_hash_bits);
 5534|  6.36k|    for(sh1 = rt->shape_hash[h1]; sh1 != NULL; sh1 = sh1->shape_hash_next) {
  ------------------
  |  Branch (5534:35): [True: 2.97k, False: 3.39k]
  ------------------
 5535|       |        /* we test the hash first so that the rest is done only if the
 5536|       |           shapes really match */
 5537|  2.97k|        if (sh1->hash == h &&
  ------------------
  |  Branch (5537:13): [True: 1.65k, False: 1.31k]
  ------------------
 5538|  1.65k|            sh1->proto == sh->proto &&
  ------------------
  |  Branch (5538:13): [True: 1.65k, False: 0]
  ------------------
 5539|  1.65k|            sh1->prop_count == ((n = sh->prop_count) + 1)) {
  ------------------
  |  Branch (5539:13): [True: 1.65k, False: 0]
  ------------------
 5540|  1.65k|            JSShapeProperty *prop = get_shape_prop(sh);
 5541|  1.65k|            JSShapeProperty *prop1 = get_shape_prop(sh1);
 5542|  3.30k|            for(i = 0; i < n; i++) {
  ------------------
  |  Branch (5542:24): [True: 1.65k, False: 1.65k]
  ------------------
 5543|  1.65k|                if (unlikely(prop1[i].atom != prop[i].atom) ||
  ------------------
  |  |   33|  3.30k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.65k]
  |  |  ------------------
  ------------------
 5544|  1.65k|                    unlikely(prop1[i].flags != prop[i].flags))
  ------------------
  |  |   33|  1.65k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.65k]
  |  |  ------------------
  ------------------
 5545|      0|                    goto next;
 5546|  1.65k|            }
 5547|  1.65k|            if (unlikely(prop1[n].atom != atom) ||
  ------------------
  |  |   33|  3.31k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.65k]
  |  |  ------------------
  ------------------
 5548|  1.65k|                unlikely(prop1[n].flags != prop_flags))
  ------------------
  |  |   33|  1.65k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1.65k]
  |  |  ------------------
  ------------------
 5549|      0|                goto next;
 5550|  1.65k|            return sh1;
 5551|  1.65k|        }
 5552|  1.31k|    next: ;
 5553|  1.31k|    }
 5554|  3.39k|    return NULL;
 5555|  5.05k|}
quickjs.c:js_clone_shape:
 5260|    853|{
 5261|    853|    JSShape *sh;
 5262|    853|    size_t size;
 5263|    853|    JSShapeProperty *pr;
 5264|    853|    uint32_t i, hash_size;
 5265|       |
 5266|    853|    hash_size = sh1->prop_hash_mask + 1;
 5267|    853|    size = get_shape_size(hash_size, sh1->prop_size);
 5268|    853|    sh = js_malloc(ctx, size);
 5269|    853|    if (!sh)
  ------------------
  |  Branch (5269:9): [True: 0, False: 853]
  ------------------
 5270|      0|        return NULL;
 5271|    853|    memcpy(&sh->header + 1, &sh1->header + 1,
 5272|    853|           size - sizeof(JSGCObjectHeader));
 5273|    853|    js_rc(sh)->ref_count = 1;
 5274|    853|    add_gc_object(ctx->rt, &sh->header, JS_GC_OBJ_TYPE_SHAPE);
 5275|    853|    sh->is_hashed = FALSE;
 5276|    853|    if (sh->proto) {
  ------------------
  |  Branch (5276:9): [True: 853, False: 0]
  ------------------
 5277|    853|        JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, sh->proto));
  ------------------
  |  |  246|    853|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 5278|    853|    }
 5279|    893|    for(i = 0, pr = get_shape_prop(sh); i < sh->prop_count; i++, pr++) {
  ------------------
  |  Branch (5279:41): [True: 40, False: 853]
  ------------------
 5280|     40|        JS_DupAtom(ctx, pr->atom);
 5281|     40|    }
 5282|    853|    return sh;
 5283|    853|}
quickjs.c:js_shape_hash_link:
 5183|  5.45k|{
 5184|  5.45k|    uint32_t h;
 5185|  5.45k|    h = get_shape_hash(sh->hash, rt->shape_hash_bits);
 5186|  5.45k|    sh->shape_hash_next = rt->shape_hash[h];
 5187|  5.45k|    rt->shape_hash[h] = sh;
 5188|  5.45k|    rt->shape_hash_count++;
 5189|  5.45k|}
quickjs.c:JS_CreateProperty:
10121|   351k|{
10122|   351k|    JSProperty *pr;
10123|   351k|    int ret, prop_flags;
10124|   351k|    JSVarRef *var_ref;
10125|   351k|    JSObject *delete_obj;
10126|       |    
10127|       |    /* add a new property or modify an existing exotic one */
10128|   351k|    if (p->is_exotic) {
  ------------------
  |  Branch (10128:9): [True: 343k, False: 8.41k]
  ------------------
10129|   343k|        if (p->class_id == JS_CLASS_ARRAY) {
  ------------------
  |  Branch (10129:13): [True: 343k, False: 140]
  ------------------
10130|   343k|            uint32_t idx, len;
10131|       |
10132|   343k|            if (p->fast_array) {
  ------------------
  |  Branch (10132:17): [True: 343k, False: 0]
  ------------------
10133|   343k|                if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (10133:21): [True: 343k, False: 34]
  ------------------
10134|   343k|                    idx = __JS_AtomToUInt32(prop);
10135|   343k|                    if (idx == p->u.array.count) {
  ------------------
  |  Branch (10135:25): [True: 343k, False: 0]
  ------------------
10136|   343k|                        if (!p->extensible)
  ------------------
  |  Branch (10136:29): [True: 0, False: 343k]
  ------------------
10137|      0|                            goto not_extensible;
10138|   343k|                        if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET))
  ------------------
  |  |  312|   343k|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                      if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET))
  ------------------
  |  |  313|   343k|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10138:29): [True: 0, False: 343k]
  ------------------
10139|      0|                            goto convert_to_array;
10140|   343k|                        prop_flags = get_prop_flags(flags, 0);
10141|   343k|                        if (prop_flags != JS_PROP_C_W_E)
  ------------------
  |  |  299|   343k|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|   343k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|   343k|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|   343k|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
  |  Branch (10141:29): [True: 12, False: 343k]
  ------------------
10142|     12|                            goto convert_to_array;
10143|   343k|                        return add_fast_array_element(ctx, p,
10144|   343k|                                                      JS_DupValue(ctx, val), flags);
10145|   343k|                    } else {
10146|      0|                        goto convert_to_array;
10147|      0|                    }
10148|   343k|                } else if (JS_AtomIsArrayIndex(ctx, &idx, prop)) {
  ------------------
  |  Branch (10148:28): [True: 0, False: 34]
  ------------------
10149|       |                    /* convert the fast array to normal array */
10150|     12|                convert_to_array:
10151|     12|                    if (convert_fast_array_to_array(ctx, p))
  ------------------
  |  Branch (10151:25): [True: 0, False: 12]
  ------------------
10152|      0|                        return -1;
10153|     12|                    goto generic_array;
10154|     12|                }
10155|   343k|            } else if (JS_AtomIsArrayIndex(ctx, &idx, prop)) {
  ------------------
  |  Branch (10155:24): [True: 0, False: 0]
  ------------------
10156|      0|                JSProperty *plen;
10157|      0|                JSShapeProperty *pslen;
10158|     12|            generic_array:
10159|       |                /* update the length field */
10160|     12|                plen = &p->prop[0];
10161|     12|                JS_ToUint32(ctx, &len, plen->u.value);
10162|     12|                if ((idx + 1) > len) {
  ------------------
  |  Branch (10162:21): [True: 12, False: 0]
  ------------------
10163|     12|                    pslen = get_shape_prop(p->shape);
10164|     12|                    if (unlikely(!(pslen->flags & JS_PROP_WRITABLE)))
  ------------------
  |  |   33|     12|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 12]
  |  |  ------------------
  ------------------
10165|      0|                        return JS_ThrowTypeErrorReadOnly(ctx, flags, JS_ATOM_length);
10166|       |                    /* XXX: should update the length after defining
10167|       |                       the property */
10168|     12|                    len = idx + 1;
10169|     12|                    set_value(ctx, &plen->u.value, JS_NewUint32(ctx, len));
10170|     12|                }
10171|     12|            }
10172|   343k|        } else if (p->class_id >= JS_CLASS_UINT8C_ARRAY &&
  ------------------
  |  Branch (10172:20): [True: 0, False: 140]
  ------------------
10173|      0|                   p->class_id <= JS_CLASS_FLOAT64_ARRAY) {
  ------------------
  |  Branch (10173:20): [True: 0, False: 0]
  ------------------
10174|      0|            ret = JS_AtomIsNumericIndex(ctx, prop);
10175|      0|            if (ret != 0) {
  ------------------
  |  Branch (10175:17): [True: 0, False: 0]
  ------------------
10176|      0|                if (ret < 0)
  ------------------
  |  Branch (10176:21): [True: 0, False: 0]
  ------------------
10177|      0|                    return -1;
10178|      0|                return JS_ThrowTypeErrorOrFalse(ctx, flags, "cannot create numeric index in typed array");
10179|      0|            }
10180|    140|        } else if (!(flags & JS_PROP_NO_EXOTIC)) {
  ------------------
  |  |  323|    140|#define JS_PROP_NO_EXOTIC        (1 << 16) /* internal use */
  ------------------
  |  Branch (10180:20): [True: 84, False: 56]
  ------------------
10181|     84|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
10182|     84|            if (em) {
  ------------------
  |  Branch (10182:17): [True: 84, False: 0]
  ------------------
10183|     84|                if (em->define_own_property) {
  ------------------
  |  Branch (10183:21): [True: 56, False: 28]
  ------------------
10184|     56|                    return em->define_own_property(ctx, JS_MKPTR(JS_TAG_OBJECT, p),
  ------------------
  |  |  246|     56|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
10185|     56|                                                   prop, val, getter, setter, flags);
10186|     56|                }
10187|     28|                ret = JS_IsExtensible(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
  ------------------
  |  |  246|     28|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
10188|     28|                if (ret < 0)
  ------------------
  |  Branch (10188:21): [True: 0, False: 28]
  ------------------
10189|      0|                    return -1;
10190|     28|                if (!ret)
  ------------------
  |  Branch (10190:21): [True: 0, False: 28]
  ------------------
10191|      0|                    goto not_extensible;
10192|     28|            }
10193|     84|        }
10194|   343k|    }
10195|       |
10196|  8.54k|    if (!p->extensible) {
  ------------------
  |  Branch (10196:9): [True: 0, False: 8.54k]
  ------------------
10197|      0|    not_extensible:
10198|      0|        return JS_ThrowTypeErrorOrFalse(ctx, flags, "object is not extensible");
10199|      0|    }
10200|       |
10201|  8.54k|    var_ref = NULL;
10202|  8.54k|    delete_obj = NULL;
10203|  8.54k|    if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  312|  8.54k|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                  if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  313|  8.54k|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10203:9): [True: 602, False: 7.93k]
  ------------------
10204|    602|        prop_flags = (flags & (JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE)) |
  ------------------
  |  |  296|    602|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                      prop_flags = (flags & (JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE)) |
  ------------------
  |  |  298|    602|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
10205|    602|            JS_PROP_GETSET;
  ------------------
  |  |  303|    602|#define JS_PROP_GETSET         (1 << 4)
  ------------------
10206|  7.93k|    } else {
10207|  7.93k|        prop_flags = flags & JS_PROP_C_W_E;
  ------------------
  |  |  299|  7.93k|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|  7.93k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|  7.93k|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|  7.93k|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
10208|  7.93k|        if (p->class_id == JS_CLASS_GLOBAL_OBJECT) {
  ------------------
  |  Branch (10208:13): [True: 756, False: 7.18k]
  ------------------
10209|    756|            JSObject *p1 = JS_VALUE_GET_OBJ(p->u.global_object.uninitialized_vars);
  ------------------
  |  |  227|    756|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    756|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10210|    756|            JSShapeProperty *prs1;
10211|    756|            JSProperty *pr1;
10212|    756|            prs1 = find_own_property(&pr1, p1, prop);
10213|    756|            if (prs1) {
  ------------------
  |  Branch (10213:17): [True: 2, False: 754]
  ------------------
10214|      2|                delete_obj = p1;
10215|      2|                var_ref = pr1->u.var_ref;
10216|      2|                js_rc(var_ref)->ref_count++;
10217|    754|            } else {
10218|    754|                var_ref = js_create_var_ref(ctx, FALSE);
10219|    754|                if (!var_ref)
  ------------------
  |  Branch (10219:21): [True: 0, False: 754]
  ------------------
10220|      0|                    return -1;
10221|    754|            }
10222|    756|            var_ref->is_const = !(prop_flags & JS_PROP_WRITABLE);
  ------------------
  |  |  297|    756|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10223|    756|            prop_flags |= JS_PROP_VARREF;
  ------------------
  |  |  304|    756|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
10224|    756|        }
10225|  7.93k|    }
10226|  8.54k|    pr = add_property(ctx, p, prop, prop_flags);
10227|  8.54k|    if (unlikely(!pr)) {
  ------------------
  |  |   33|  8.54k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 8.54k]
  |  |  ------------------
  ------------------
10228|      0|        if (var_ref)
  ------------------
  |  Branch (10228:13): [True: 0, False: 0]
  ------------------
10229|      0|            free_var_ref(ctx->rt, var_ref);
10230|      0|        return -1;
10231|      0|    }
10232|  8.54k|    if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  312|  8.54k|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                  if (flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  313|  8.54k|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10232:9): [True: 602, False: 7.93k]
  ------------------
10233|    602|        pr->u.getset.getter = NULL;
10234|    602|        if ((flags & JS_PROP_HAS_GET) && JS_IsFunction(ctx, getter)) {
  ------------------
  |  |  312|    602|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
  |  Branch (10234:13): [True: 602, False: 0]
  |  Branch (10234:42): [True: 602, False: 0]
  ------------------
10235|    602|            pr->u.getset.getter =
10236|    602|                JS_VALUE_GET_OBJ(JS_DupValue(ctx, getter));
  ------------------
  |  |  227|    602|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|    602|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10237|    602|        }
10238|    602|        pr->u.getset.setter = NULL;
10239|    602|        if ((flags & JS_PROP_HAS_SET) && JS_IsFunction(ctx, setter)) {
  ------------------
  |  |  313|    602|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
  |  Branch (10239:13): [True: 602, False: 0]
  |  Branch (10239:42): [True: 56, False: 546]
  ------------------
10240|     56|            pr->u.getset.setter =
10241|     56|                JS_VALUE_GET_OBJ(JS_DupValue(ctx, setter));
  ------------------
  |  |  227|     56|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     56|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10242|     56|        }
10243|  7.93k|    } else if (p->class_id == JS_CLASS_GLOBAL_OBJECT) {
  ------------------
  |  Branch (10243:16): [True: 756, False: 7.18k]
  ------------------
10244|    756|        if (delete_obj)
  ------------------
  |  Branch (10244:13): [True: 2, False: 754]
  ------------------
10245|      2|            delete_property(ctx, delete_obj, prop);
10246|    756|        pr->u.var_ref = var_ref;
10247|    756|        if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  314|    756|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10247:13): [True: 756, False: 0]
  ------------------
10248|    756|            *var_ref->pvalue = JS_DupValue(ctx, val);
10249|    756|        } else {
10250|      0|            *var_ref->pvalue = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
10251|      0|        }
10252|  7.18k|    } else {
10253|  7.18k|        if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  314|  7.18k|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (10253:13): [True: 7.18k, False: 0]
  ------------------
10254|  7.18k|            pr->u.value = JS_DupValue(ctx, val);
10255|  7.18k|        } else {
10256|      0|            pr->u.value = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
10257|      0|        }
10258|  7.18k|    }
10259|  8.54k|    return TRUE;
10260|  8.54k|}
quickjs.c:check_define_prop_flags:
10264|     44|{
10265|     44|    BOOL has_accessor, is_getset;
10266|       |
10267|     44|    if (!(prop_flags & JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  296|     44|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
  |  Branch (10267:9): [True: 0, False: 44]
  ------------------
10268|      0|        if ((flags & (JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE)) ==
  ------------------
  |  |  309|      0|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                      if ((flags & (JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE)) ==
  ------------------
  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
  |  Branch (10268:13): [True: 0, False: 0]
  ------------------
10269|      0|            (JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  309|      0|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                          (JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE)) {
  ------------------
  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
10270|      0|            return FALSE;
10271|      0|        }
10272|      0|        if ((flags & JS_PROP_HAS_ENUMERABLE) &&
  ------------------
  |  |  311|      0|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
  |  Branch (10272:13): [True: 0, False: 0]
  ------------------
10273|      0|            (flags & JS_PROP_ENUMERABLE) != (prop_flags & JS_PROP_ENUMERABLE))
  ------------------
  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                          (flags & JS_PROP_ENUMERABLE) != (prop_flags & JS_PROP_ENUMERABLE))
  ------------------
  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
  |  Branch (10273:13): [True: 0, False: 0]
  ------------------
10274|      0|            return FALSE;
10275|      0|        if (flags & (JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE |
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
                      if (flags & (JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE |
  ------------------
  |  |  310|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
  |  Branch (10275:13): [True: 0, False: 0]
  ------------------
10276|      0|                     JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                                   JS_PROP_HAS_GET | JS_PROP_HAS_SET)) {
  ------------------
  |  |  313|      0|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
10277|      0|            has_accessor = ((flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) != 0);
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
                          has_accessor = ((flags & (JS_PROP_HAS_GET | JS_PROP_HAS_SET)) != 0);
  ------------------
  |  |  313|      0|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
10278|      0|            is_getset = ((prop_flags & JS_PROP_TMASK) == JS_PROP_GETSET);
  ------------------
  |  |  301|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                          is_getset = ((prop_flags & JS_PROP_TMASK) == JS_PROP_GETSET);
  ------------------
  |  |  303|      0|#define JS_PROP_GETSET         (1 << 4)
  ------------------
10279|      0|            if (has_accessor != is_getset)
  ------------------
  |  Branch (10279:17): [True: 0, False: 0]
  ------------------
10280|      0|                return FALSE;
10281|      0|            if (!is_getset && !(prop_flags & JS_PROP_WRITABLE)) {
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (10281:17): [True: 0, False: 0]
  |  Branch (10281:31): [True: 0, False: 0]
  ------------------
10282|       |                /* not writable: cannot set the writable bit */
10283|      0|                if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) ==
  ------------------
  |  |  310|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
                              if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) ==
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (10283:21): [True: 0, False: 0]
  ------------------
10284|      0|                    (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE))
  ------------------
  |  |  310|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
                                  (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE))
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10285|      0|                    return FALSE;
10286|      0|            }
10287|      0|        }
10288|      0|    }
10289|     44|    return TRUE;
10290|     44|}
quickjs.c:js_shape_prepare_update:
10295|    242|{
10296|    242|    JSShape *sh;
10297|    242|    uint32_t idx = 0;    /* prevent warning */
10298|       |
10299|    242|    sh = p->shape;
10300|    242|    if (sh->is_hashed) {
  ------------------
  |  Branch (10300:9): [True: 26, False: 216]
  ------------------
10301|     26|        if (js_rc(sh)->ref_count != 1) {
  ------------------
  |  Branch (10301:13): [True: 20, False: 6]
  ------------------
10302|     20|            if (pprs)
  ------------------
  |  Branch (10302:17): [True: 14, False: 6]
  ------------------
10303|     14|                idx = *pprs - get_shape_prop(sh);
10304|       |            /* clone the shape (the resulting one is no longer hashed) */
10305|     20|            sh = js_clone_shape(ctx, sh);
10306|     20|            if (!sh)
  ------------------
  |  Branch (10306:17): [True: 0, False: 20]
  ------------------
10307|      0|                return -1;
10308|     20|            js_free_shape(ctx->rt, p->shape);
10309|     20|            p->shape = sh;
10310|     20|            if (pprs)
  ------------------
  |  Branch (10310:17): [True: 14, False: 6]
  ------------------
10311|     14|                *pprs = get_shape_prop(sh) + idx;
10312|     20|        } else {
10313|      6|            js_shape_hash_unlink(ctx->rt, sh);
10314|      6|            sh->is_hashed = FALSE;
10315|      6|        }
10316|     26|    }
10317|    242|    return 0;
10318|    242|}
quickjs.c:free_var_ref:
 6156|  3.62k|{
 6157|  3.62k|    if (var_ref) {
  ------------------
  |  Branch (6157:9): [True: 3.62k, False: 0]
  ------------------
 6158|  3.62k|        assert(js_rc(var_ref)->ref_count > 0);
  ------------------
  |  Branch (6158:9): [True: 0, False: 3.62k]
  |  Branch (6158:9): [True: 3.62k, False: 0]
  ------------------
 6159|  3.62k|        if (--js_rc(var_ref)->ref_count == 0) {
  ------------------
  |  Branch (6159:13): [True: 2.21k, False: 1.41k]
  ------------------
 6160|  2.21k|            if (var_ref->is_detached) {
  ------------------
  |  Branch (6160:17): [True: 2.21k, False: 0]
  ------------------
 6161|  2.21k|                JS_FreeValueRT(rt, var_ref->value);
 6162|  2.21k|            } else {
 6163|      0|                JSStackFrame *sf = var_ref->stack_frame;
 6164|      0|                assert(sf->var_refs[var_ref->var_ref_idx] == var_ref);
  ------------------
  |  Branch (6164:17): [True: 0, False: 0]
  |  Branch (6164:17): [True: 0, False: 0]
  ------------------
 6165|      0|                sf->var_refs[var_ref->var_ref_idx] = NULL;
 6166|      0|                if (sf->js_mode & JS_MODE_ASYNC) {
  ------------------
  |  |  396|      0|#define JS_MODE_ASYNC  (1 << 2) /* async function */
  ------------------
  |  Branch (6166:21): [True: 0, False: 0]
  ------------------
 6167|      0|                    JSAsyncFunctionState *async_func = container_of(sf, JSAsyncFunctionState, frame);
  ------------------
  |  |   51|      0|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  ------------------
 6168|      0|                    async_func_free(rt, async_func);
 6169|      0|                }
 6170|      0|            }
 6171|  2.21k|            remove_gc_object(&var_ref->header);
 6172|  2.21k|            js_free_rt(rt, var_ref);
 6173|  2.21k|        }
 6174|  3.62k|    }
 6175|  3.62k|}
quickjs.c:js_update_property_flags:
10322|     58|{
10323|     58|    if (flags != (*pprs)->flags) {
  ------------------
  |  Branch (10323:9): [True: 40, False: 18]
  ------------------
10324|     40|        if (js_shape_prepare_update(ctx, p, pprs))
  ------------------
  |  Branch (10324:13): [True: 0, False: 40]
  ------------------
10325|      0|            return -1;
10326|     40|        (*pprs)->flags = flags;
10327|     40|    }
10328|     58|    return 0;
10329|     58|}
quickjs.c:get_prop_flags:
10111|   343k|{
10112|   343k|    int mask;
10113|   343k|    mask = (flags >> JS_PROP_HAS_SHIFT) & JS_PROP_C_W_E;
  ------------------
  |  |  308|   343k|#define JS_PROP_HAS_SHIFT        8
  ------------------
                  mask = (flags >> JS_PROP_HAS_SHIFT) & JS_PROP_C_W_E;
  ------------------
  |  |  299|   343k|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|   343k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|   343k|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|   343k|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
10114|   343k|    return (flags & mask) | (def_flags & ~mask);
10115|   343k|}
quickjs.c:convert_fast_array_to_array:
 9237|     12|{
 9238|     12|    JSProperty *pr;
 9239|     12|    JSShape *sh;
 9240|     12|    uint32_t i, len, new_count;
 9241|       |
 9242|     12|    if (js_shape_prepare_update(ctx, p, NULL))
  ------------------
  |  Branch (9242:9): [True: 0, False: 12]
  ------------------
 9243|      0|        return -1;
 9244|     12|    len = p->u.array.count;
 9245|       |    /* resize the properties once to simplify the error handling */
 9246|     12|    sh = p->shape;
 9247|     12|    new_count = sh->prop_count + len;
 9248|     12|    if (new_count > sh->prop_size) {
  ------------------
  |  Branch (9248:9): [True: 0, False: 12]
  ------------------
 9249|      0|        if (resize_properties(ctx, &p->shape, p, new_count))
  ------------------
  |  Branch (9249:13): [True: 0, False: 0]
  ------------------
 9250|      0|            return -1;
 9251|      0|    }
 9252|       |
 9253|     12|    if (p->class_id == JS_CLASS_MAPPED_ARGUMENTS) {
  ------------------
  |  Branch (9253:9): [True: 0, False: 12]
  ------------------
 9254|      0|        JSVarRef **tab = p->u.array.u.var_refs;
 9255|      0|        for(i = 0; i < len; i++) {
  ------------------
  |  Branch (9255:20): [True: 0, False: 0]
  ------------------
 9256|       |            /* add_property cannot fail here but
 9257|       |               __JS_AtomFromUInt32(i) fails for i > INT32_MAX */
 9258|      0|            pr = add_property(ctx, p, __JS_AtomFromUInt32(i), JS_PROP_C_W_E | JS_PROP_VARREF);
  ------------------
  |  |  299|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                          pr = add_property(ctx, p, __JS_AtomFromUInt32(i), JS_PROP_C_W_E | JS_PROP_VARREF);
  ------------------
  |  |  304|      0|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
 9259|      0|            pr->u.var_ref = *tab++;
 9260|      0|        }
 9261|     12|    } else {
 9262|     12|        JSValue *tab = p->u.array.u.values;
 9263|     12|        for(i = 0; i < len; i++) {
  ------------------
  |  Branch (9263:20): [True: 0, False: 12]
  ------------------
 9264|       |            /* add_property cannot fail here but
 9265|       |               __JS_AtomFromUInt32(i) fails for i > INT32_MAX */
 9266|      0|            pr = add_property(ctx, p, __JS_AtomFromUInt32(i), JS_PROP_C_W_E);
  ------------------
  |  |  299|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
 9267|      0|            pr->u.value = *tab++;
 9268|      0|        }
 9269|     12|    }
 9270|     12|    js_free(ctx, p->u.array.u.values);
 9271|     12|    p->u.array.count = 0;
 9272|       |    p->u.array.u.values = NULL; /* fail safe */
 9273|     12|    p->u.array.u1.size = 0;
 9274|     12|    p->fast_array = 0;
 9275|     12|    p->is_std_array_prototype = FALSE;
 9276|     12|    return 0;
 9277|     12|}
quickjs.c:resize_properties:
 5327|    452|{
 5328|    452|    JSShape *sh;
 5329|    452|    uint32_t new_size, new_hash_size, new_hash_mask, i;
 5330|    452|    JSShapeProperty *pr;
 5331|    452|    intptr_t h;
 5332|    452|    JSShape *old_sh;
 5333|       |
 5334|    452|    sh = *psh;
 5335|    452|    new_size = max_int(count, sh->prop_size * 3 / 2);
 5336|       |    /* Reallocate prop array first to avoid crash or size inconsistency
 5337|       |       in case of memory allocation failure */
 5338|    452|    if (p) {
  ------------------
  |  Branch (5338:9): [True: 452, False: 0]
  ------------------
 5339|    452|        JSProperty *new_prop;
 5340|    452|        new_prop = js_realloc(ctx, p->prop, sizeof(new_prop[0]) * new_size);
 5341|    452|        if (unlikely(!new_prop))
  ------------------
  |  |   33|    452|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 452]
  |  |  ------------------
  ------------------
 5342|      0|            return -1;
 5343|    452|        p->prop = new_prop;
 5344|    452|    }
 5345|    452|    new_hash_size = sh->prop_hash_mask + 1;
 5346|    661|    while (new_hash_size < new_size)
  ------------------
  |  Branch (5346:12): [True: 209, False: 452]
  ------------------
 5347|    209|        new_hash_size = 2 * new_hash_size;
 5348|       |    /* resize the property shapes. Using js_realloc() is not possible in
 5349|       |       case the GC runs during the allocation */
 5350|    452|    old_sh = sh;
 5351|    452|    sh = js_malloc(ctx, get_shape_size(new_hash_size, new_size));
 5352|    452|    if (!sh)
  ------------------
  |  Branch (5352:9): [True: 0, False: 452]
  ------------------
 5353|      0|        return -1;
 5354|    452|    remove_gc_object(&old_sh->header);
 5355|       |
 5356|    452|    js_rc(sh)->ref_count = 1;
 5357|    452|    add_gc_object(ctx->rt, &sh->header, JS_GC_OBJ_TYPE_SHAPE);
 5358|       |
 5359|    452|    memcpy(&sh->header + 1, &old_sh->header + 1,
 5360|    452|           sizeof(JSShape) - sizeof(JSGCObjectHeader));
 5361|       |    
 5362|    452|    if (new_hash_size != (sh->prop_hash_mask + 1)) {
  ------------------
  |  Branch (5362:9): [True: 209, False: 243]
  ------------------
 5363|       |        /* resize the hash table and the properties */
 5364|    209|        new_hash_mask = new_hash_size - 1;
 5365|    209|        sh->prop_hash_mask = new_hash_mask;
 5366|    209|        memset(sh->hash_table, 0,
 5367|    209|               sizeof(sh->hash_table[0]) * new_hash_size);
 5368|    209|        memcpy(get_shape_prop(sh), get_shape_prop(old_sh),
 5369|    209|               sizeof(JSShapeProperty) * old_sh->prop_count);
 5370|  4.15k|        for(i = 0, pr = get_shape_prop(sh); i < sh->prop_count; i++, pr++) {
  ------------------
  |  Branch (5370:45): [True: 3.94k, False: 209]
  ------------------
 5371|  3.94k|            if (pr->atom != JS_ATOM_NULL) {
  ------------------
  |  |  449|  3.94k|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (5371:17): [True: 3.94k, False: 0]
  ------------------
 5372|  3.94k|                h = ((uintptr_t)pr->atom & new_hash_mask);
 5373|  3.94k|                pr->hash_next = sh->hash_table[h];
 5374|  3.94k|                sh->hash_table[h] = i + 1;
 5375|  3.94k|            }
 5376|  3.94k|        }
 5377|    243|    } else {
 5378|       |        /* just copy the previous hash table and the properties */
 5379|    243|        memcpy(sh->hash_table, old_sh->hash_table,
 5380|    243|               sizeof(sh->hash_table[0]) * new_hash_size);
 5381|       |
 5382|    243|        memcpy(get_shape_prop(sh), get_shape_prop(old_sh),
 5383|    243|               sizeof(JSShapeProperty) * old_sh->prop_count);
 5384|    243|    }
 5385|    452|    js_free(ctx, old_sh);
 5386|    452|    *psh = sh;
 5387|    452|    sh->prop_size = new_size;
 5388|    452|    return 0;
 5389|    452|}
quickjs.c:delete_property:
 9303|      2|{
 9304|      2|    JSShape *sh;
 9305|      2|    JSShapeProperty *pr, *lpr, *prop;
 9306|      2|    JSProperty *pr1;
 9307|      2|    uint32_t lpr_idx;
 9308|      2|    intptr_t h, h1;
 9309|       |
 9310|      2| redo:
 9311|      2|    sh = p->shape;
 9312|      2|    h1 = atom & sh->prop_hash_mask;
 9313|      2|    h = sh->hash_table[h1];
 9314|      2|    prop = get_shape_prop(sh);
 9315|      2|    lpr = NULL;
 9316|      2|    lpr_idx = 0;   /* prevent warning */
 9317|      2|    while (h != 0) {
  ------------------
  |  Branch (9317:12): [True: 2, False: 0]
  ------------------
 9318|      2|        pr = &prop[h - 1];
 9319|      2|        if (likely(pr->atom == atom)) {
  ------------------
  |  |   32|      2|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 2, False: 0]
  |  |  ------------------
  ------------------
 9320|       |            /* found ! */
 9321|      2|            if (!(pr->flags & JS_PROP_CONFIGURABLE))
  ------------------
  |  |  296|      2|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
  |  Branch (9321:17): [True: 0, False: 2]
  ------------------
 9322|      0|                return FALSE;
 9323|       |            /* realloc the shape if needed */
 9324|      2|            if (lpr)
  ------------------
  |  Branch (9324:17): [True: 0, False: 2]
  ------------------
 9325|      0|                lpr_idx = lpr - get_shape_prop(sh);
 9326|      2|            if (js_shape_prepare_update(ctx, p, &pr))
  ------------------
  |  Branch (9326:17): [True: 0, False: 2]
  ------------------
 9327|      0|                return -1;
 9328|      2|            sh = p->shape;
 9329|       |            /* remove property */
 9330|      2|            if (lpr) {
  ------------------
  |  Branch (9330:17): [True: 0, False: 2]
  ------------------
 9331|      0|                lpr = get_shape_prop(sh) + lpr_idx;
 9332|      0|                lpr->hash_next = pr->hash_next;
 9333|      2|            } else {
 9334|      2|                sh->hash_table[h1] = pr->hash_next;
 9335|      2|            }
 9336|      2|            sh->deleted_prop_count++;
 9337|       |            /* free the entry */
 9338|      2|            pr1 = &p->prop[h - 1];
 9339|      2|            if (unlikely(p->class_id == JS_CLASS_GLOBAL_OBJECT)) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 9340|      0|                if ((pr->flags & JS_PROP_TMASK) == JS_PROP_VARREF)
  ------------------
  |  |  301|      0|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                              if ((pr->flags & JS_PROP_TMASK) == JS_PROP_VARREF)
  ------------------
  |  |  304|      0|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (9340:21): [True: 0, False: 0]
  ------------------
 9341|      0|                    if (remove_global_object_property(ctx, p, pr, pr1))
  ------------------
  |  Branch (9341:25): [True: 0, False: 0]
  ------------------
 9342|      0|                        return -1;
 9343|      0|            }
 9344|      2|            free_property(ctx->rt, pr1, pr->flags);
 9345|      2|            JS_FreeAtom(ctx, pr->atom);
 9346|       |            /* put default values */
 9347|      2|            pr->flags = 0;
 9348|      2|            pr->atom = JS_ATOM_NULL;
  ------------------
  |  |  449|      2|#define JS_ATOM_NULL 0
  ------------------
 9349|      2|            pr1->u.value = JS_UNDEFINED;
  ------------------
  |  |  289|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 9350|       |
 9351|       |            /* compact the properties if too many deleted properties */
 9352|      2|            if (sh->deleted_prop_count >= 8 &&
  ------------------
  |  Branch (9352:17): [True: 0, False: 2]
  ------------------
 9353|      0|                sh->deleted_prop_count >= ((unsigned)sh->prop_count / 2)) {
  ------------------
  |  Branch (9353:17): [True: 0, False: 0]
  ------------------
 9354|      0|                compact_properties(ctx, p);
 9355|      0|            }
 9356|      2|            return TRUE;
 9357|      2|        }
 9358|      0|        lpr = pr;
 9359|      0|        h = pr->hash_next;
 9360|      0|    }
 9361|       |
 9362|      0|    if (p->is_exotic) {
  ------------------
  |  Branch (9362:9): [True: 0, False: 0]
  ------------------
 9363|      0|        if (p->fast_array) {
  ------------------
  |  Branch (9363:13): [True: 0, False: 0]
  ------------------
 9364|      0|            uint32_t idx;
 9365|      0|            if (JS_AtomIsArrayIndex(ctx, &idx, atom) &&
  ------------------
  |  Branch (9365:17): [True: 0, False: 0]
  ------------------
 9366|      0|                idx < p->u.array.count) {
  ------------------
  |  Branch (9366:17): [True: 0, False: 0]
  ------------------
 9367|      0|                if (p->class_id == JS_CLASS_ARRAY ||
  ------------------
  |  Branch (9367:21): [True: 0, False: 0]
  ------------------
 9368|      0|                    p->class_id == JS_CLASS_ARGUMENTS ||
  ------------------
  |  Branch (9368:21): [True: 0, False: 0]
  ------------------
 9369|      0|                    p->class_id == JS_CLASS_MAPPED_ARGUMENTS) {
  ------------------
  |  Branch (9369:21): [True: 0, False: 0]
  ------------------
 9370|       |                    /* Special case deleting the last element of a fast Array */
 9371|      0|                    if (idx == p->u.array.count - 1) {
  ------------------
  |  Branch (9371:25): [True: 0, False: 0]
  ------------------
 9372|      0|                        if (p->class_id == JS_CLASS_MAPPED_ARGUMENTS) {
  ------------------
  |  Branch (9372:29): [True: 0, False: 0]
  ------------------
 9373|      0|                            free_var_ref(ctx->rt, p->u.array.u.var_refs[idx]);
 9374|      0|                        } else {
 9375|      0|                            JS_FreeValue(ctx, p->u.array.u.values[idx]);
 9376|      0|                        }
 9377|      0|                        p->u.array.count = idx;
 9378|      0|                        return TRUE;
 9379|      0|                    }
 9380|      0|                    if (convert_fast_array_to_array(ctx, p))
  ------------------
  |  Branch (9380:25): [True: 0, False: 0]
  ------------------
 9381|      0|                        return -1;
 9382|      0|                    goto redo;
 9383|      0|                } else {
 9384|      0|                    return FALSE;
 9385|      0|                }
 9386|      0|            }
 9387|      0|        } else {
 9388|      0|            const JSClassExoticMethods *em = ctx->rt->class_array[p->class_id].exotic;
 9389|      0|            if (em && em->delete_property) {
  ------------------
  |  Branch (9389:17): [True: 0, False: 0]
  |  Branch (9389:23): [True: 0, False: 0]
  ------------------
 9390|      0|                return em->delete_property(ctx, JS_MKPTR(JS_TAG_OBJECT, p), atom);
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 9391|      0|            }
 9392|      0|        }
 9393|      0|    }
 9394|       |    /* not found */
 9395|      0|    return TRUE;
 9396|      0|}
quickjs.c:is_strict_mode:
 2854|      2|{
 2855|      2|    JSStackFrame *sf = ctx->rt->current_stack_frame;
 2856|      2|    return (sf && (sf->js_mode & JS_MODE_STRICT));
  ------------------
  |  |  395|      2|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (2856:13): [True: 2, False: 0]
  |  Branch (2856:19): [True: 0, False: 2]
  ------------------
 2857|      2|}
quickjs.c:JS_ToBoolFree:
11152|     20|{
11153|     20|    uint32_t tag = JS_VALUE_GET_TAG(val);
  ------------------
  |  |  236|     20|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
11154|     20|    switch(tag) {
11155|      0|    case JS_TAG_INT:
  ------------------
  |  Branch (11155:5): [True: 0, False: 20]
  ------------------
11156|      0|        return JS_VALUE_GET_INT(val) != 0;
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
11157|     16|    case JS_TAG_BOOL:
  ------------------
  |  Branch (11157:5): [True: 16, False: 4]
  ------------------
11158|     16|    case JS_TAG_NULL:
  ------------------
  |  Branch (11158:5): [True: 0, False: 20]
  ------------------
11159|     16|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (11159:5): [True: 0, False: 20]
  ------------------
11160|     16|        return JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|     16|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
11161|      0|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (11161:5): [True: 0, False: 20]
  ------------------
11162|      0|        return -1;
11163|      2|    case JS_TAG_STRING:
  ------------------
  |  Branch (11163:5): [True: 2, False: 18]
  ------------------
11164|      2|        {
11165|      2|            BOOL ret = JS_VALUE_GET_STRING(val)->len != 0;
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
11166|      2|            JS_FreeValue(ctx, val);
11167|      2|            return ret;
11168|     16|        }
11169|      0|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (11169:5): [True: 0, False: 20]
  ------------------
11170|      0|        {
11171|      0|            BOOL ret = JS_VALUE_GET_STRING_ROPE(val)->len != 0;
  ------------------
  |  |  229|      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)
  |  |  ------------------
  ------------------
11172|      0|            JS_FreeValue(ctx, val);
11173|      0|            return ret;
11174|     16|        }
11175|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (11175:5): [True: 0, False: 20]
  ------------------
11176|      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)
  ------------------
11177|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (11177:5): [True: 0, False: 20]
  ------------------
11178|      0|        {
11179|      0|            JSBigInt *p = JS_VALUE_GET_PTR(val);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
11180|      0|            BOOL ret;
11181|      0|            int i;
11182|       |            
11183|       |            /* fail safe: we assume it is not necessarily
11184|       |               normalized. Beginning from the MSB ensures that the
11185|       |               test is fast. */
11186|      0|            ret = FALSE;
11187|      0|            for(i = p->len - 1; i >= 0; i--) {
  ------------------
  |  Branch (11187:33): [True: 0, False: 0]
  ------------------
11188|      0|                if (p->tab[i] != 0) {
  ------------------
  |  Branch (11188:21): [True: 0, False: 0]
  ------------------
11189|      0|                    ret = TRUE;
11190|      0|                    break;
11191|      0|                }
11192|      0|            }
11193|      0|            JS_FreeValue(ctx, val);
11194|      0|            return ret;
11195|     16|        }
11196|      2|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (11196:5): [True: 2, False: 18]
  ------------------
11197|      2|        {
11198|      2|            JSObject *p = JS_VALUE_GET_OBJ(val);
  ------------------
  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
11199|      2|            BOOL ret;
11200|      2|            ret = !p->is_HTMLDDA;
11201|      2|            JS_FreeValue(ctx, val);
11202|      2|            return ret;
11203|     16|        }
11204|      0|        break;
11205|      0|    default:
  ------------------
  |  Branch (11205:5): [True: 0, False: 20]
  ------------------
11206|      0|        if (JS_TAG_IS_FLOAT64(tag)) {
  ------------------
  |  |  248|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (248:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
11207|      0|            double d = JS_VALUE_GET_FLOAT64(val);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
11208|      0|            return !isnan(d) && d != 0;
  ------------------
  |  Branch (11208:20): [True: 0, False: 0]
  |  Branch (11208:33): [True: 0, False: 0]
  ------------------
11209|      0|        } else {
11210|      0|            JS_FreeValue(ctx, val);
11211|      0|            return TRUE;
11212|      0|        }
11213|     20|    }
11214|     20|}
quickjs.c:JS_ToNumberHintFree:
12939|     10|{
12940|     10|    uint32_t tag;
12941|     10|    JSValue ret;
12942|       |
12943|     13| redo:
12944|     13|    tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  238|     13|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|     13|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
12945|     13|    switch(tag) {
12946|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (12946:5): [True: 0, False: 13]
  ------------------
12947|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (12947:5): [True: 0, False: 13]
  ------------------
12948|      0|        if (flag != TON_FLAG_NUMERIC) {
  ------------------
  |  Branch (12948:13): [True: 0, False: 0]
  ------------------
12949|      0|            JS_FreeValue(ctx, val);
12950|      0|            return JS_ThrowTypeError(ctx, "cannot convert bigint to number");
12951|      0|        }
12952|      0|        ret = val;
12953|      0|        break;
12954|      2|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (12954:5): [True: 2, False: 11]
  ------------------
12955|      4|    case JS_TAG_INT:
  ------------------
  |  Branch (12955:5): [True: 2, False: 11]
  ------------------
12956|      4|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (12956:5): [True: 0, False: 13]
  ------------------
12957|      4|        ret = val;
12958|      4|        break;
12959|      0|    case JS_TAG_BOOL:
  ------------------
  |  Branch (12959:5): [True: 0, False: 13]
  ------------------
12960|      0|    case JS_TAG_NULL:
  ------------------
  |  Branch (12960:5): [True: 0, False: 13]
  ------------------
12961|      0|        ret = JS_NewInt32(ctx, JS_VALUE_GET_INT(val));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
12962|      0|        break;
12963|      1|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (12963:5): [True: 1, False: 12]
  ------------------
12964|      1|        ret = JS_NAN;
  ------------------
  |  |  250|      1|#define JS_NAN (JSValue){ .u.float64 = JS_FLOAT64_NAN, JS_TAG_FLOAT64 }
  |  |  ------------------
  |  |  |  |  103|      1|#define JS_FLOAT64_NAN NAN
  |  |  ------------------
  ------------------
12965|      1|        break;
12966|      3|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (12966:5): [True: 3, False: 10]
  ------------------
12967|      3|        val = JS_ToPrimitiveFree(ctx, val, HINT_NUMBER);
  ------------------
  |  | 1237|      3|#define HINT_NUMBER  1
  ------------------
12968|      3|        if (JS_IsException(val))
  ------------------
  |  Branch (12968:13): [True: 0, False: 3]
  ------------------
12969|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
12970|      3|        goto redo;
12971|      4|    case JS_TAG_STRING:
  ------------------
  |  Branch (12971:5): [True: 4, False: 9]
  ------------------
12972|      5|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (12972:5): [True: 1, False: 12]
  ------------------
12973|      5|        {
12974|      5|            const char *str;
12975|      5|            const char *p;
12976|      5|            size_t len;
12977|       |
12978|      5|            str = JS_ToCStringLen(ctx, &len, val);
12979|      5|            JS_FreeValue(ctx, val);
12980|      5|            if (!str)
  ------------------
  |  Branch (12980:17): [True: 0, False: 5]
  ------------------
12981|      0|                return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
12982|      5|            p = str;
12983|      5|            p += skip_spaces(p);
12984|      5|            if ((p - str) == len) {
  ------------------
  |  Branch (12984:17): [True: 0, False: 5]
  ------------------
12985|      0|                ret = JS_NewInt32(ctx, 0);
12986|      5|            } else {
12987|      5|                int flags = ATOD_ACCEPT_BIN_OCT;
  ------------------
  |  |12737|      5|#define ATOD_ACCEPT_BIN_OCT  (1 << 2)
  ------------------
12988|      5|                ret = js_atof(ctx, p, &p, 0, flags);
12989|      5|                if (!JS_IsException(ret)) {
  ------------------
  |  Branch (12989:21): [True: 5, False: 0]
  ------------------
12990|      5|                    p += skip_spaces(p);
12991|      5|                    if ((p - str) != len) {
  ------------------
  |  Branch (12991:25): [True: 5, False: 0]
  ------------------
12992|      5|                        JS_FreeValue(ctx, ret);
12993|      5|                        ret = JS_NAN;
  ------------------
  |  |  250|      5|#define JS_NAN (JSValue){ .u.float64 = JS_FLOAT64_NAN, JS_TAG_FLOAT64 }
  |  |  ------------------
  |  |  |  |  103|      5|#define JS_FLOAT64_NAN NAN
  |  |  ------------------
  ------------------
12994|      5|                    }
12995|      5|                }
12996|      5|            }
12997|      5|            JS_FreeCString(ctx, str);
12998|      5|        }
12999|      0|        break;
13000|      0|    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (13000:5): [True: 0, False: 13]
  ------------------
13001|      0|        JS_FreeValue(ctx, val);
13002|      0|        return JS_ThrowTypeError(ctx, "cannot convert symbol to number");
13003|      0|    default:
  ------------------
  |  Branch (13003:5): [True: 0, False: 13]
  ------------------
13004|      0|        JS_FreeValue(ctx, val);
13005|      0|        ret = JS_NAN;
  ------------------
  |  |  250|      0|#define JS_NAN (JSValue){ .u.float64 = JS_FLOAT64_NAN, JS_TAG_FLOAT64 }
  |  |  ------------------
  |  |  |  |  103|      0|#define JS_FLOAT64_NAN NAN
  |  |  ------------------
  ------------------
13006|      0|        break;
13007|     13|    }
13008|     10|    return ret;
13009|     13|}
quickjs.c:JS_ToPrimitiveFree:
11055|      9|{
11056|      9|    int i;
11057|      9|    BOOL force_ordinary;
11058|       |
11059|      9|    JSAtom method_name;
11060|      9|    JSValue method, ret;
11061|      9|    if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      9|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (11061:9): [True: 1, False: 8]
  ------------------
11062|      1|        return val;
11063|      8|    force_ordinary = hint & HINT_FORCE_ORDINARY;
  ------------------
  |  | 1239|      8|#define HINT_FORCE_ORDINARY (1 << 4) // don't try Symbol.toPrimitive
  ------------------
11064|      8|    hint &= ~HINT_FORCE_ORDINARY;
  ------------------
  |  | 1239|      8|#define HINT_FORCE_ORDINARY (1 << 4) // don't try Symbol.toPrimitive
  ------------------
11065|      8|    if (!force_ordinary) {
  ------------------
  |  Branch (11065:9): [True: 8, False: 0]
  ------------------
11066|      8|        method = JS_GetProperty(ctx, val, JS_ATOM_Symbol_toPrimitive);
11067|      8|        if (JS_IsException(method))
  ------------------
  |  Branch (11067:13): [True: 0, False: 8]
  ------------------
11068|      0|            goto exception;
11069|       |        /* ECMA says *If exoticToPrim is not undefined* but tests in
11070|       |           test262 use null as a non callable converter */
11071|      8|        if (!JS_IsUndefined(method) && !JS_IsNull(method)) {
  ------------------
  |  Branch (11071:13): [True: 0, False: 8]
  |  Branch (11071:40): [True: 0, False: 0]
  ------------------
11072|      0|            JSAtom atom;
11073|      0|            JSValue arg;
11074|      0|            switch(hint) {
11075|      0|            case HINT_STRING:
  ------------------
  |  | 1236|      0|#define HINT_STRING  0
  ------------------
  |  Branch (11075:13): [True: 0, False: 0]
  ------------------
11076|      0|                atom = JS_ATOM_string;
11077|      0|                break;
11078|      0|            case HINT_NUMBER:
  ------------------
  |  | 1237|      0|#define HINT_NUMBER  1
  ------------------
  |  Branch (11078:13): [True: 0, False: 0]
  ------------------
11079|      0|                atom = JS_ATOM_number;
11080|      0|                break;
11081|      0|            default:
  ------------------
  |  Branch (11081:13): [True: 0, False: 0]
  ------------------
11082|      0|            case HINT_NONE:
  ------------------
  |  | 1238|      0|#define HINT_NONE    2
  ------------------
  |  Branch (11082:13): [True: 0, False: 0]
  ------------------
11083|      0|                atom = JS_ATOM_default;
11084|      0|                break;
11085|      0|            }
11086|      0|            arg = JS_AtomToString(ctx, atom);
11087|      0|            ret = JS_CallFree(ctx, method, val, 1, (JSValueConst *)&arg);
11088|      0|            JS_FreeValue(ctx, arg);
11089|      0|            if (JS_IsException(ret))
  ------------------
  |  Branch (11089:17): [True: 0, False: 0]
  ------------------
11090|      0|                goto exception;
11091|      0|            JS_FreeValue(ctx, val);
11092|      0|            if (JS_VALUE_GET_TAG(ret) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (11092:17): [True: 0, False: 0]
  ------------------
11093|      0|                return ret;
11094|      0|            JS_FreeValue(ctx, ret);
11095|      0|            return JS_ThrowTypeError(ctx, "toPrimitive");
11096|      0|        }
11097|      8|    }
11098|      8|    if (hint != HINT_STRING)
  ------------------
  |  | 1236|      8|#define HINT_STRING  0
  ------------------
  |  Branch (11098:9): [True: 4, False: 4]
  ------------------
11099|      4|        hint = HINT_NUMBER;
  ------------------
  |  | 1237|      4|#define HINT_NUMBER  1
  ------------------
11100|     12|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (11100:16): [True: 12, False: 0]
  ------------------
11101|     12|        if ((i ^ hint) == 0) {
  ------------------
  |  Branch (11101:13): [True: 8, False: 4]
  ------------------
11102|      8|            method_name = JS_ATOM_toString;
11103|      8|        } else {
11104|      4|            method_name = JS_ATOM_valueOf;
11105|      4|        }
11106|     12|        method = JS_GetProperty(ctx, val, method_name);
11107|     12|        if (JS_IsException(method))
  ------------------
  |  Branch (11107:13): [True: 0, False: 12]
  ------------------
11108|      0|            goto exception;
11109|     12|        if (JS_IsFunction(ctx, method)) {
  ------------------
  |  Branch (11109:13): [True: 12, False: 0]
  ------------------
11110|     12|            ret = JS_CallFree(ctx, method, val, 0, NULL);
11111|     12|            if (JS_IsException(ret))
  ------------------
  |  Branch (11111:17): [True: 0, False: 12]
  ------------------
11112|      0|                goto exception;
11113|     12|            if (JS_VALUE_GET_TAG(ret) != JS_TAG_OBJECT) {
  ------------------
  |  |  236|     12|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (11113:17): [True: 8, False: 4]
  ------------------
11114|      8|                JS_FreeValue(ctx, val);
11115|      8|                return ret;
11116|      8|            }
11117|      4|            JS_FreeValue(ctx, ret);
11118|      4|        } else {
11119|      0|            JS_FreeValue(ctx, method);
11120|      0|        }
11121|     12|    }
11122|      0|    JS_ThrowTypeError(ctx, "toPrimitive");
11123|      0|exception:
11124|      0|    JS_FreeValue(ctx, val);
11125|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
11126|      0|}
quickjs.c:skip_spaces:
11222|     10|{
11223|     10|    const uint8_t *p, *p_next, *p_start;
11224|     10|    uint32_t c;
11225|       |
11226|     10|    p = p_start = (const uint8_t *)pc;
11227|     11|    for (;;) {
11228|     11|        c = *p;
11229|     11|        if (c < 128) {
  ------------------
  |  Branch (11229:13): [True: 11, False: 0]
  ------------------
11230|     11|            if (!((c >= 0x09 && c <= 0x0d) || (c == 0x20)))
  ------------------
  |  Branch (11230:20): [True: 11, False: 0]
  |  Branch (11230:33): [True: 1, False: 10]
  |  Branch (11230:47): [True: 0, False: 10]
  ------------------
11231|     10|                break;
11232|      1|            p++;
11233|      1|        } else {
11234|      0|            c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
11235|      0|            if (!lre_is_space(c))
  ------------------
  |  Branch (11235:17): [True: 0, False: 0]
  ------------------
11236|      0|                break;
11237|      0|            p = p_next;
11238|      0|        }
11239|     11|    }
11240|     10|    return p - p_start;
11241|     10|}
quickjs.c:js_atof:
12756|     27|{
12757|     27|    const char *p, *p_start;
12758|     27|    int sep, is_neg;
12759|     27|    BOOL is_float, has_legacy_octal;
12760|     27|    int atod_type = flags & ATOD_TYPE_MASK;
  ------------------
  |  |12745|     27|#define ATOD_TYPE_MASK        (3 << 7)
  ------------------
12761|     27|    char buf1[64], *buf;
12762|     27|    int i, j, len;
12763|     27|    BOOL buf_allocated = FALSE;
12764|     27|    JSValue val;
12765|     27|    JSATODTempMem atod_mem;
12766|       |    
12767|       |    /* optional separator between digits */
12768|     27|    sep = (flags & ATOD_ACCEPT_UNDERSCORES) ? '_' : 256;
  ------------------
  |  |12741|     27|#define ATOD_ACCEPT_UNDERSCORES  (1 << 5)
  ------------------
  |  Branch (12768:11): [True: 22, False: 5]
  ------------------
12769|     27|    has_legacy_octal = FALSE;
12770|       |
12771|     27|    p = str;
12772|     27|    p_start = p;
12773|     27|    is_neg = 0;
12774|     27|    if (p[0] == '+') {
  ------------------
  |  Branch (12774:9): [True: 0, False: 27]
  ------------------
12775|      0|        p++;
12776|      0|        p_start++;
12777|      0|        if (!(flags & ATOD_ACCEPT_PREFIX_AFTER_SIGN))
  ------------------
  |  |12749|      0|#define ATOD_ACCEPT_PREFIX_AFTER_SIGN (1 << 10)
  ------------------
  |  Branch (12777:13): [True: 0, False: 0]
  ------------------
12778|      0|            goto no_radix_prefix;
12779|     27|    } else if (p[0] == '-') {
  ------------------
  |  Branch (12779:16): [True: 0, False: 27]
  ------------------
12780|      0|        p++;
12781|      0|        p_start++;
12782|      0|        is_neg = 1;
12783|      0|        if (!(flags & ATOD_ACCEPT_PREFIX_AFTER_SIGN))
  ------------------
  |  |12749|      0|#define ATOD_ACCEPT_PREFIX_AFTER_SIGN (1 << 10)
  ------------------
  |  Branch (12783:13): [True: 0, False: 0]
  ------------------
12784|      0|            goto no_radix_prefix;
12785|      0|    }
12786|     27|    if (p[0] == '0') {
  ------------------
  |  Branch (12786:9): [True: 6, False: 21]
  ------------------
12787|      6|        if ((p[1] == 'x' || p[1] == 'X') &&
  ------------------
  |  Branch (12787:14): [True: 0, False: 6]
  |  Branch (12787:29): [True: 1, False: 5]
  ------------------
12788|      1|            (radix == 0 || radix == 16)) {
  ------------------
  |  Branch (12788:14): [True: 1, False: 0]
  |  Branch (12788:28): [True: 0, False: 0]
  ------------------
12789|      1|            p += 2;
12790|      1|            radix = 16;
12791|      5|        } else if ((p[1] == 'o' || p[1] == 'O') &&
  ------------------
  |  Branch (12791:21): [True: 0, False: 5]
  |  Branch (12791:36): [True: 0, False: 5]
  ------------------
12792|      0|                   radix == 0 && (flags & ATOD_ACCEPT_BIN_OCT)) {
  ------------------
  |  |12737|      0|#define ATOD_ACCEPT_BIN_OCT  (1 << 2)
  ------------------
  |  Branch (12792:20): [True: 0, False: 0]
  |  Branch (12792:34): [True: 0, False: 0]
  ------------------
12793|      0|            p += 2;
12794|      0|            radix = 8;
12795|      5|        } else if ((p[1] == 'b' || p[1] == 'B') &&
  ------------------
  |  Branch (12795:21): [True: 0, False: 5]
  |  Branch (12795:36): [True: 0, False: 5]
  ------------------
12796|      0|                   radix == 0 && (flags & ATOD_ACCEPT_BIN_OCT)) {
  ------------------
  |  |12737|      0|#define ATOD_ACCEPT_BIN_OCT  (1 << 2)
  ------------------
  |  Branch (12796:20): [True: 0, False: 0]
  |  Branch (12796:34): [True: 0, False: 0]
  ------------------
12797|      0|            p += 2;
12798|      0|            radix = 2;
12799|      5|        } else if ((p[1] >= '0' && p[1] <= '9') &&
  ------------------
  |  Branch (12799:21): [True: 1, False: 4]
  |  Branch (12799:36): [True: 1, False: 0]
  ------------------
12800|      1|                   radix == 0 && (flags & ATOD_ACCEPT_LEGACY_OCTAL)) {
  ------------------
  |  |12739|      1|#define ATOD_ACCEPT_LEGACY_OCTAL  (1 << 4)
  ------------------
  |  Branch (12800:20): [True: 1, False: 0]
  |  Branch (12800:34): [True: 1, False: 0]
  ------------------
12801|      1|            int i;
12802|      1|            has_legacy_octal = TRUE;
12803|      1|            sep = 256;
12804|  1.04M|            for (i = 1; (p[i] >= '0' && p[i] <= '7'); i++)
  ------------------
  |  Branch (12804:26): [True: 1.04M, False: 1]
  |  Branch (12804:41): [True: 1.04M, False: 0]
  ------------------
12805|  1.04M|                continue;
12806|      1|            if (p[i] == '8' || p[i] == '9')
  ------------------
  |  Branch (12806:17): [True: 0, False: 1]
  |  Branch (12806:32): [True: 0, False: 1]
  ------------------
12807|      0|                goto no_prefix;
12808|      1|            p += 1;
12809|      1|            radix = 8;
12810|      4|        } else {
12811|      4|            goto no_prefix;
12812|      4|        }
12813|       |        /* there must be a digit after the prefix */
12814|      2|        if (to_digit((uint8_t)*p) >= radix)
  ------------------
  |  Branch (12814:13): [True: 0, False: 2]
  ------------------
12815|      0|            goto fail;
12816|      6|    no_prefix: ;
12817|     21|    } else {
12818|     21| no_radix_prefix:
12819|     21|        if (!(flags & ATOD_INT_ONLY) &&
  ------------------
  |  |12735|     21|#define ATOD_INT_ONLY        (1 << 0)
  ------------------
  |  Branch (12819:13): [True: 21, False: 0]
  ------------------
12820|     21|            (atod_type == ATOD_TYPE_FLOAT64) &&
  ------------------
  |  |12746|     21|#define ATOD_TYPE_FLOAT64     (0 << 7)
  ------------------
  |  Branch (12820:13): [True: 21, False: 0]
  ------------------
12821|     21|            strstart(p, "Infinity", &p)) {
  ------------------
  |  Branch (12821:13): [True: 0, False: 21]
  ------------------
12822|      0|            double d = 1.0 / 0.0;
12823|      0|            if (is_neg)
  ------------------
  |  Branch (12823:17): [True: 0, False: 0]
  ------------------
12824|      0|                d = -d;
12825|      0|            val = JS_NewFloat64(ctx, d);
12826|      0|            goto done;
12827|      0|        }
12828|     21|    }
12829|     27|    if (radix == 0)
  ------------------
  |  Branch (12829:9): [True: 25, False: 2]
  ------------------
12830|     25|        radix = 10;
12831|     27|    is_float = FALSE;
12832|     27|    p_start = p;
12833|  3.14M|    while (to_digit((uint8_t)*p) < radix
  ------------------
  |  Branch (12833:12): [True: 3.14M, False: 27]
  ------------------
12834|     27|           ||  (*p == sep && (radix != 10 ||
  ------------------
  |  Branch (12834:17): [True: 0, False: 27]
  |  Branch (12834:31): [True: 0, False: 0]
  ------------------
12835|      0|                              p != p_start + 1 || p[-1] != '0') &&
  ------------------
  |  Branch (12835:31): [True: 0, False: 0]
  |  Branch (12835:51): [True: 0, False: 0]
  ------------------
12836|  3.14M|                to_digit((uint8_t)p[1]) < radix)) {
  ------------------
  |  Branch (12836:17): [True: 0, False: 0]
  ------------------
12837|  3.14M|        p++;
12838|  3.14M|    }
12839|     27|    if (!(flags & ATOD_INT_ONLY) && radix == 10) {
  ------------------
  |  |12735|     27|#define ATOD_INT_ONLY        (1 << 0)
  ------------------
  |  Branch (12839:9): [True: 27, False: 0]
  |  Branch (12839:37): [True: 25, False: 2]
  ------------------
12840|     25|        if (*p == '.' && (p > p_start || to_digit((uint8_t)p[1]) < radix)) {
  ------------------
  |  Branch (12840:13): [True: 12, False: 13]
  |  Branch (12840:27): [True: 12, False: 0]
  |  Branch (12840:42): [True: 0, False: 0]
  ------------------
12841|     12|            is_float = TRUE;
12842|     12|            p++;
12843|     12|            if (*p == sep)
  ------------------
  |  Branch (12843:17): [True: 0, False: 12]
  ------------------
12844|      0|                goto fail;
12845|     14|            while (to_digit((uint8_t)*p) < radix ||
  ------------------
  |  Branch (12845:20): [True: 2, False: 12]
  ------------------
12846|     12|                   (*p == sep && to_digit((uint8_t)p[1]) < radix))
  ------------------
  |  Branch (12846:21): [True: 0, False: 12]
  |  Branch (12846:34): [True: 0, False: 0]
  ------------------
12847|      2|                p++;
12848|     12|        }
12849|     25|        if (p > p_start && (*p == 'e' || *p == 'E')) {
  ------------------
  |  Branch (12849:13): [True: 22, False: 3]
  |  Branch (12849:29): [True: 0, False: 22]
  |  Branch (12849:42): [True: 0, False: 22]
  ------------------
12850|      0|            const char *p1 = p + 1;
12851|      0|            is_float = TRUE;
12852|      0|            if (*p1 == '+') {
  ------------------
  |  Branch (12852:17): [True: 0, False: 0]
  ------------------
12853|      0|                p1++;
12854|      0|            } else if (*p1 == '-') {
  ------------------
  |  Branch (12854:24): [True: 0, False: 0]
  ------------------
12855|      0|                p1++;
12856|      0|            }
12857|      0|            if (is_digit((uint8_t)*p1)) {
  ------------------
  |  Branch (12857:17): [True: 0, False: 0]
  ------------------
12858|      0|                p = p1 + 1;
12859|      0|                while (is_digit((uint8_t)*p) || (*p == sep && is_digit((uint8_t)p[1])))
  ------------------
  |  Branch (12859:24): [True: 0, False: 0]
  |  Branch (12859:50): [True: 0, False: 0]
  |  Branch (12859:63): [True: 0, False: 0]
  ------------------
12860|      0|                    p++;
12861|      0|            }
12862|      0|        }
12863|     25|    }
12864|     27|    if (p == p_start)
  ------------------
  |  Branch (12864:9): [True: 3, False: 24]
  ------------------
12865|      3|        goto fail;
12866|       |
12867|     24|    buf = buf1;
12868|     24|    buf_allocated = FALSE;
12869|     24|    len = p - p_start;
12870|     24|    if (unlikely((len + 2) > sizeof(buf1))) {
  ------------------
  |  |   33|     24|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 3, False: 21]
  |  |  ------------------
  ------------------
12871|      3|        buf = js_malloc_rt(ctx->rt, len + 2); /* no exception raised */
12872|      3|        if (!buf)
  ------------------
  |  Branch (12872:13): [True: 0, False: 3]
  ------------------
12873|      0|            goto mem_error;
12874|      3|        buf_allocated = TRUE;
12875|      3|    }
12876|       |    /* remove the separators and the radix prefixes */
12877|     24|    j = 0;
12878|     24|    if (is_neg)
  ------------------
  |  Branch (12878:9): [True: 0, False: 24]
  ------------------
12879|      0|        buf[j++] = '-';
12880|  3.14M|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (12880:17): [True: 3.14M, False: 24]
  ------------------
12881|  3.14M|        if (p_start[i] != '_')
  ------------------
  |  Branch (12881:13): [True: 3.14M, False: 0]
  ------------------
12882|  3.14M|            buf[j++] = p_start[i];
12883|  3.14M|    }
12884|     24|    buf[j] = '\0';
12885|       |
12886|     24|    if ((flags & ATOD_ACCEPT_SUFFIX) && *p == 'n') {
  ------------------
  |  |12743|     24|#define ATOD_ACCEPT_SUFFIX    (1 << 6)
  ------------------
  |  Branch (12886:9): [True: 22, False: 2]
  |  Branch (12886:41): [True: 0, False: 22]
  ------------------
12887|      0|        p++;
12888|      0|        atod_type = ATOD_TYPE_BIG_INT;
  ------------------
  |  |12747|      0|#define ATOD_TYPE_BIG_INT     (1 << 7)
  ------------------
12889|      0|    }
12890|       |
12891|     24|    switch(atod_type) {
12892|     24|    case ATOD_TYPE_FLOAT64:
  ------------------
  |  |12746|     24|#define ATOD_TYPE_FLOAT64     (0 << 7)
  ------------------
  |  Branch (12892:5): [True: 24, False: 0]
  ------------------
12893|     24|        {
12894|     24|            double d;
12895|     24|            d = js_atod(buf, NULL, radix, is_float ? 0 : JS_ATOD_INT_ONLY,
  ------------------
  |  |   49|     12|#define JS_ATOD_INT_ONLY       (1 << 0)
  ------------------
  |  Branch (12895:43): [True: 12, False: 12]
  ------------------
12896|     24|                        &atod_mem);
12897|       |            /* return int or float64 */
12898|     24|            val = JS_NewFloat64(ctx, d);
12899|     24|        }
12900|     24|        break;
12901|      0|    case ATOD_TYPE_BIG_INT:
  ------------------
  |  |12747|      0|#define ATOD_TYPE_BIG_INT     (1 << 7)
  ------------------
  |  Branch (12901:5): [True: 0, False: 24]
  ------------------
12902|      0|        {
12903|      0|            JSBigInt *r;
12904|      0|            if (has_legacy_octal || is_float)
  ------------------
  |  Branch (12904:17): [True: 0, False: 0]
  |  Branch (12904:37): [True: 0, False: 0]
  ------------------
12905|      0|                goto fail;
12906|      0|            r = js_bigint_from_string(ctx, buf, radix);
12907|      0|            if (!r) {
  ------------------
  |  Branch (12907:17): [True: 0, False: 0]
  ------------------
12908|      0|                val = JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
12909|      0|                goto done;
12910|      0|            }
12911|      0|            val = JS_CompactBigInt(ctx, r);
12912|      0|        }
12913|      0|        break;
12914|      0|    default:
  ------------------
  |  Branch (12914:5): [True: 0, False: 24]
  ------------------
12915|      0|        abort();
12916|     24|    }
12917|       |
12918|     27|done:
12919|     27|    if (buf_allocated)
  ------------------
  |  Branch (12919:9): [True: 3, False: 24]
  ------------------
12920|      3|        js_free_rt(ctx->rt, buf);
12921|     27|    if (pp)
  ------------------
  |  Branch (12921:9): [True: 27, False: 0]
  ------------------
12922|     27|        *pp = p;
12923|     27|    return val;
12924|      3| fail:
12925|      3|    val = JS_NAN;
  ------------------
  |  |  250|      3|#define JS_NAN (JSValue){ .u.float64 = JS_FLOAT64_NAN, JS_TAG_FLOAT64 }
  |  |  ------------------
  |  |  |  |  103|      3|#define JS_FLOAT64_NAN NAN
  |  |  ------------------
  ------------------
12926|      3|    goto done;
12927|      0| mem_error:
12928|      0|    val = JS_ThrowOutOfMemory(ctx);
12929|      0|    goto done;
12930|     24|}
quickjs.c:to_digit:
11244|  3.14M|{
11245|  3.14M|    if (c >= '0' && c <= '9')
  ------------------
  |  Branch (11245:9): [True: 3.14M, False: 38]
  |  Branch (11245:21): [True: 2.09M, False: 1.04M]
  ------------------
11246|  2.09M|        return c - '0';
11247|  1.04M|    else if (c >= 'A' && c <= 'Z')
  ------------------
  |  Branch (11247:14): [True: 1.04M, False: 38]
  |  Branch (11247:26): [True: 0, False: 1.04M]
  ------------------
11248|      0|        return c - 'A' + 10;
11249|  1.04M|    else if (c >= 'a' && c <= 'z')
  ------------------
  |  Branch (11249:14): [True: 1.04M, False: 38]
  |  Branch (11249:26): [True: 1.04M, False: 0]
  ------------------
11250|  1.04M|        return c - 'a' + 10;
11251|     38|    else
11252|     38|        return 36;
11253|  3.14M|}
quickjs.c:JS_ToFloat64Free:
13054|      6|{
13055|      6|    uint32_t tag;
13056|       |
13057|      6|    tag = JS_VALUE_GET_TAG(val);
  ------------------
  |  |  236|      6|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
13058|      6|    if (tag <= JS_TAG_NULL) {
  ------------------
  |  Branch (13058:9): [True: 2, False: 4]
  ------------------
13059|      2|        *pres = JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|      2|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
13060|      2|        return 0;
13061|      4|    } else if (JS_TAG_IS_FLOAT64(tag)) {
  ------------------
  |  |  248|      4|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (248:32): [True: 4, False: 0]
  |  |  ------------------
  ------------------
13062|      4|        *pres = JS_VALUE_GET_FLOAT64(val);
  ------------------
  |  |  241|      4|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
13063|      4|        return 0;
13064|      4|    } else {
13065|      0|        return __JS_ToFloat64Free(ctx, pres, val);
13066|      0|    }
13067|      6|}
quickjs.c:JS_ToInt64SatFree:
13183|     15|{
13184|     15|    uint32_t tag;
13185|       |
13186|     15| redo:
13187|     15|    tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  238|     15|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|     15|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
13188|     15|    switch(tag) {
13189|     15|    case JS_TAG_INT:
  ------------------
  |  Branch (13189:5): [True: 15, False: 0]
  ------------------
13190|     15|    case JS_TAG_BOOL:
  ------------------
  |  Branch (13190:5): [True: 0, False: 15]
  ------------------
13191|     15|    case JS_TAG_NULL:
  ------------------
  |  Branch (13191:5): [True: 0, False: 15]
  ------------------
13192|     15|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (13192:5): [True: 0, False: 15]
  ------------------
13193|     15|        *pres = JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|     15|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
13194|     15|        return 0;
13195|      0|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (13195:5): [True: 0, False: 15]
  ------------------
13196|      0|        *pres = 0;
13197|      0|        return -1;
13198|      0|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (13198:5): [True: 0, False: 15]
  ------------------
13199|      0|        {
13200|      0|            double d = JS_VALUE_GET_FLOAT64(val);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
13201|      0|            if (isnan(d)) {
  ------------------
  |  Branch (13201:17): [True: 0, False: 0]
  ------------------
13202|      0|                *pres = 0;
13203|      0|            } else {
13204|      0|                if (d < INT64_MIN)
  ------------------
  |  Branch (13204:21): [True: 0, False: 0]
  ------------------
13205|      0|                    *pres = INT64_MIN;
13206|      0|                else if (d >= 0x1p63) /* must use INT64_MAX + 1 because INT64_MAX cannot be exactly represented as a double */
  ------------------
  |  Branch (13206:26): [True: 0, False: 0]
  ------------------
13207|      0|                    *pres = INT64_MAX;
13208|      0|                else
13209|      0|                    *pres = (int64_t)d;
13210|      0|            }
13211|      0|        }
13212|      0|        return 0;
13213|      0|    default:
  ------------------
  |  Branch (13213:5): [True: 0, False: 15]
  ------------------
13214|      0|        val = JS_ToNumberFree(ctx, val);
13215|      0|        if (JS_IsException(val)) {
  ------------------
  |  Branch (13215:13): [True: 0, False: 0]
  ------------------
13216|      0|            *pres = 0;
13217|      0|            return -1;
13218|      0|        }
13219|      0|        goto redo;
13220|     15|    }
13221|     15|}
quickjs.c:JS_ToInt32Free:
13311|     14|{
13312|     14|    uint32_t tag;
13313|     14|    int32_t ret;
13314|       |
13315|     14| redo:
13316|     14|    tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  238|     14|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|     14|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
13317|     14|    switch(tag) {
13318|     12|    case JS_TAG_INT:
  ------------------
  |  Branch (13318:5): [True: 12, False: 2]
  ------------------
13319|     12|    case JS_TAG_BOOL:
  ------------------
  |  Branch (13319:5): [True: 0, False: 14]
  ------------------
13320|     12|    case JS_TAG_NULL:
  ------------------
  |  Branch (13320:5): [True: 0, False: 14]
  ------------------
13321|     12|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (13321:5): [True: 0, False: 14]
  ------------------
13322|     12|        ret = JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|     12|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
13323|     12|        break;
13324|      2|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (13324:5): [True: 2, False: 12]
  ------------------
13325|      2|        {
13326|      2|            JSFloat64Union u;
13327|      2|            double d;
13328|      2|            int e;
13329|      2|            d = JS_VALUE_GET_FLOAT64(val);
  ------------------
  |  |  241|      2|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
13330|      2|            u.d = d;
13331|       |            /* we avoid doing fmod(x, 2^32) */
13332|      2|            e = (u.u64 >> 52) & 0x7ff;
13333|      2|            if (likely(e <= (1023 + 30))) {
  ------------------
  |  |   32|      2|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
13334|       |                /* fast case */
13335|      0|                ret = (int32_t)d;
13336|      2|            } else if (e <= (1023 + 30 + 53)) {
  ------------------
  |  Branch (13336:24): [True: 0, False: 2]
  ------------------
13337|      0|                uint64_t v;
13338|       |                /* remainder modulo 2^32 */
13339|      0|                v = (u.u64 & (((uint64_t)1 << 52) - 1)) | ((uint64_t)1 << 52);
13340|      0|                v = v << ((e - 1023) - 52 + 32);
13341|      0|                ret = v >> 32;
13342|       |                /* take the sign into account */
13343|      0|                if (u.u64 >> 63)
  ------------------
  |  Branch (13343:21): [True: 0, False: 0]
  ------------------
13344|      0|                    ret = -ret;
13345|      2|            } else {
13346|      2|                ret = 0; /* also handles NaN and +inf */
13347|      2|            }
13348|      2|        }
13349|      2|        break;
13350|      0|    default:
  ------------------
  |  Branch (13350:5): [True: 0, False: 14]
  ------------------
13351|      0|        val = JS_ToNumberFree(ctx, val);
13352|      0|        if (JS_IsException(val)) {
  ------------------
  |  Branch (13352:13): [True: 0, False: 0]
  ------------------
13353|      0|            *pres = 0;
13354|      0|            return -1;
13355|      0|        }
13356|      0|        goto redo;
13357|     14|    }
13358|     14|    *pres = ret;
13359|     14|    return 0;
13360|     14|}
quickjs.c:JS_ToStringInternal:
13580|  1.01M|{
13581|  1.01M|    uint32_t tag;
13582|  1.01M|    char buf[32];
13583|       |
13584|  1.01M|    tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  238|  1.01M|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|  1.01M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
13585|  1.01M|    switch(tag) {
13586|  1.00M|    case JS_TAG_STRING:
  ------------------
  |  Branch (13586:5): [True: 1.00M, False: 6]
  ------------------
13587|  1.00M|        return JS_DupValue(ctx, val);
13588|      1|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (13588:5): [True: 1, False: 1.01M]
  ------------------
13589|      1|        return js_linearize_string_rope(ctx, JS_DupValue(ctx, val));
13590|      0|    case JS_TAG_INT:
  ------------------
  |  Branch (13590:5): [True: 0, False: 1.01M]
  ------------------
13591|      0|        {
13592|      0|            size_t len;
13593|      0|            len = i32toa(buf, JS_VALUE_GET_INT(val));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
13594|      0|            return js_new_string8_len(ctx, buf, len);
13595|      0|        }
13596|      0|        break;
13597|      0|    case JS_TAG_BOOL:
  ------------------
  |  Branch (13597:5): [True: 0, False: 1.01M]
  ------------------
13598|      0|        return JS_AtomToString(ctx, JS_VALUE_GET_BOOL(val) ?
  ------------------
  |  |  240|      0|#define JS_VALUE_GET_BOOL(v) ((v).u.int32)
  |  |  ------------------
  |  |  |  Branch (240:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
13599|      0|                          JS_ATOM_true : JS_ATOM_false);
13600|      0|    case JS_TAG_NULL:
  ------------------
  |  Branch (13600:5): [True: 0, False: 1.01M]
  ------------------
13601|      0|        return JS_AtomToString(ctx, JS_ATOM_null);
13602|      0|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (13602:5): [True: 0, False: 1.01M]
  ------------------
13603|      0|        return JS_AtomToString(ctx, JS_ATOM_undefined);
13604|      0|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (13604:5): [True: 0, False: 1.01M]
  ------------------
13605|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
13606|      4|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (13606:5): [True: 4, False: 1.00M]
  ------------------
13607|      4|        {
13608|      4|            JSValue val1, ret;
13609|      4|            val1 = JS_ToPrimitive(ctx, val, HINT_STRING);
  ------------------
  |  | 1236|      4|#define HINT_STRING  0
  ------------------
13610|      4|            if (JS_IsException(val1))
  ------------------
  |  Branch (13610:17): [True: 0, False: 4]
  ------------------
13611|      0|                return val1;
13612|      4|            ret = JS_ToStringInternal(ctx, val1, is_ToPropertyKey);
13613|      4|            JS_FreeValue(ctx, val1);
13614|      4|            return ret;
13615|      4|        }
13616|      0|        break;
13617|      0|    case JS_TAG_FUNCTION_BYTECODE:
  ------------------
  |  Branch (13617:5): [True: 0, False: 1.01M]
  ------------------
13618|      0|        return js_new_string8(ctx, "[function bytecode]");
13619|      0|    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (13619:5): [True: 0, False: 1.01M]
  ------------------
13620|      0|        if (is_ToPropertyKey) {
  ------------------
  |  Branch (13620:13): [True: 0, False: 0]
  ------------------
13621|      0|            return JS_DupValue(ctx, val);
13622|      0|        } else {
13623|      0|            return JS_ThrowTypeError(ctx, "cannot convert symbol to string");
13624|      0|        }
13625|      1|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (13625:5): [True: 1, False: 1.01M]
  ------------------
13626|      1|        return js_dtoa2(ctx, JS_VALUE_GET_FLOAT64(val), 10, 0,
  ------------------
  |  |  241|      1|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
13627|      1|                        JS_DTOA_FORMAT_FREE);
  ------------------
  |  |   32|      1|#define JS_DTOA_FORMAT_FREE  (0 << 0)
  ------------------
13628|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (13628:5): [True: 0, False: 1.01M]
  ------------------
13629|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (13629:5): [True: 0, False: 1.01M]
  ------------------
13630|      0|        return js_bigint_to_string(ctx, val);
13631|      0|    default:
  ------------------
  |  Branch (13631:5): [True: 0, False: 1.01M]
  ------------------
13632|      0|        return js_new_string8(ctx, "[unsupported type]");
13633|  1.01M|    }
13634|  1.01M|}
quickjs.c:js_linearize_string_rope:
 4823|      1|{
 4824|      1|    StringBuffer b_s, *b = &b_s;
 4825|      1|    JSStringRope *r;
 4826|      1|    JSValue ret;
 4827|       |    
 4828|      1|    r = JS_VALUE_GET_STRING_ROPE(rope);
  ------------------
  |  |  229|      1|#define JS_VALUE_GET_STRING_ROPE(v) ((JSStringRope *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4829|       |
 4830|       |    /* check whether it is already linearized */
 4831|      1|    if (JS_VALUE_GET_TAG(r->right) == JS_TAG_STRING &&
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (4831:9): [True: 1, False: 0]
  ------------------
 4832|      1|        JS_VALUE_GET_STRING(r->right)->len == 0) {
  ------------------
  |  |  228|      1|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
  |  Branch (4832:9): [True: 0, False: 1]
  ------------------
 4833|      0|        ret = JS_DupValue(ctx, r->left);
 4834|      0|        JS_FreeValue(ctx, rope);
 4835|      0|        return ret;
 4836|      0|    }
 4837|      1|    if (string_buffer_init2(ctx, b, r->len, r->is_wide_char))
  ------------------
  |  Branch (4837:9): [True: 0, False: 1]
  ------------------
 4838|      0|        goto fail;
 4839|      1|    if (string_buffer_concat_value(b, rope))
  ------------------
  |  Branch (4839:9): [True: 0, False: 1]
  ------------------
 4840|      0|        goto fail;
 4841|      1|    ret = string_buffer_end(b);
 4842|      1|    if (js_rc(r)->ref_count > 1) {
  ------------------
  |  Branch (4842:9): [True: 1, False: 0]
  ------------------
 4843|       |        /* update the rope so that it won't need to be linearized again */
 4844|      1|        JS_FreeValue(ctx, r->left);
 4845|      1|        JS_FreeValue(ctx, r->right);
 4846|      1|        r->left = JS_DupValue(ctx, ret);
 4847|      1|        r->right = JS_AtomToString(ctx, JS_ATOM_empty_string);
 4848|      1|    }
 4849|      1|    JS_FreeValue(ctx, rope);
 4850|      1|    return ret;
 4851|      0| fail:
 4852|      0|    JS_FreeValue(ctx, rope);
 4853|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 4854|      1|}
quickjs.c:string_buffer_concat_value:
 4250|      3|{
 4251|      3|    JSString *p;
 4252|      3|    JSValue v1;
 4253|      3|    int res;
 4254|       |
 4255|      3|    if (s->error_status) {
  ------------------
  |  Branch (4255:9): [True: 0, False: 3]
  ------------------
 4256|       |        /* prevent exception overload */
 4257|      0|        return -1;
 4258|      0|    }
 4259|      3|    if (unlikely(JS_VALUE_GET_TAG(v) != JS_TAG_STRING)) {
  ------------------
  |  |   33|      3|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1, False: 2]
  |  |  ------------------
  ------------------
 4260|      1|        if (JS_VALUE_GET_TAG(v) == JS_TAG_STRING_ROPE) {
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (4260:13): [True: 1, False: 0]
  ------------------
 4261|      1|            JSStringRope *r = JS_VALUE_GET_STRING_ROPE(v);
  ------------------
  |  |  229|      1|#define JS_VALUE_GET_STRING_ROPE(v) ((JSStringRope *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4262|       |            /* recursion is acceptable because the rope depth is bounded */
 4263|      1|            if (string_buffer_concat_value(s, r->left))
  ------------------
  |  Branch (4263:17): [True: 0, False: 1]
  ------------------
 4264|      0|                return -1;
 4265|      1|            return string_buffer_concat_value(s, r->right);
 4266|      1|        } else {
 4267|      0|            v1 = JS_ToString(s->ctx, v);
 4268|      0|            if (JS_IsException(v1))
  ------------------
  |  Branch (4268:17): [True: 0, False: 0]
  ------------------
 4269|      0|                return string_buffer_set_error(s);
 4270|      0|            p = JS_VALUE_GET_STRING(v1);
  ------------------
  |  |  228|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4271|      0|            res = string_buffer_concat(s, p, 0, p->len);
 4272|      0|            JS_FreeValue(s->ctx, v1);
 4273|      0|            return res;
 4274|      0|        }
 4275|      1|    }
 4276|      2|    p = JS_VALUE_GET_STRING(v);
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4277|      2|    return string_buffer_concat(s, p, 0, p->len);
 4278|      3|}
quickjs.c:string_buffer_concat:
 4240|   343k|{
 4241|   343k|    if (to <= from)
  ------------------
  |  Branch (4241:9): [True: 270k, False: 72.6k]
  ------------------
 4242|   270k|        return 0;
 4243|  72.6k|    if (p->is_wide_char)
  ------------------
  |  Branch (4243:9): [True: 1.24k, False: 71.4k]
  ------------------
 4244|  1.24k|        return string_buffer_write16(s, p->u.str16 + from, to - from);
 4245|  71.4k|    else
 4246|  71.4k|        return string_buffer_write8(s, p->u.str8 + from, to - from);
 4247|  72.6k|}
quickjs.c:string_buffer_write16:
 4207|  1.24k|{
 4208|  1.24k|    int c = 0, i;
 4209|       |
 4210|  2.54M|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (4210:17): [True: 2.53M, False: 1.24k]
  ------------------
 4211|  2.53M|        c |= p[i];
 4212|  2.53M|    }
 4213|  1.24k|    if (s->len + len > s->size) {
  ------------------
  |  Branch (4213:9): [True: 4, False: 1.24k]
  ------------------
 4214|      4|        if (string_buffer_realloc(s, s->len + len, c))
  ------------------
  |  Branch (4214:13): [True: 0, False: 4]
  ------------------
 4215|      0|            return -1;
 4216|  1.24k|    } else if (!s->is_wide_char && c >= 0x100) {
  ------------------
  |  Branch (4216:16): [True: 0, False: 1.24k]
  |  Branch (4216:36): [True: 0, False: 0]
  ------------------
 4217|      0|        if (string_buffer_widen(s, s->size))
  ------------------
  |  Branch (4217:13): [True: 0, False: 0]
  ------------------
 4218|      0|            return -1;
 4219|      0|    }
 4220|  1.24k|    if (s->is_wide_char) {
  ------------------
  |  Branch (4220:9): [True: 1.24k, False: 0]
  ------------------
 4221|  1.24k|        memcpy(&s->str->u.str16[s->len], p, len << 1);
 4222|  1.24k|        s->len += len;
 4223|  1.24k|    } else {
 4224|      0|        for (i = 0; i < len; i++) {
  ------------------
  |  Branch (4224:21): [True: 0, False: 0]
  ------------------
 4225|      0|            s->str->u.str8[s->len + i] = p[i];
 4226|      0|        }
 4227|      0|        s->len += len;
 4228|      0|    }
 4229|  1.24k|    return 0;
 4230|  1.24k|}
quickjs.c:JS_ToPrimitive:
11129|      4|{
11130|      4|    return JS_ToPrimitiveFree(ctx, JS_DupValue(ctx, val), hint);
11131|      4|}
quickjs.c:js_dtoa2:
13556|      1|{
13557|      1|    char static_buf[128], *buf, *tmp_buf;
13558|      1|    int len, len_max;
13559|      1|    JSValue res;
13560|      1|    JSDTOATempMem dtoa_mem;
13561|      1|    len_max = js_dtoa_max_len(d, radix, n_digits, flags);
13562|       |    
13563|       |    /* longer buffer may be used if radix != 10 */
13564|      1|    if (len_max > sizeof(static_buf) - 1) {
  ------------------
  |  Branch (13564:9): [True: 0, False: 1]
  ------------------
13565|      0|        tmp_buf = js_malloc(ctx, len_max + 1);
13566|      0|        if (!tmp_buf)
  ------------------
  |  Branch (13566:13): [True: 0, False: 0]
  ------------------
13567|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
13568|      0|        buf = tmp_buf;
13569|      1|    } else {
13570|      1|        tmp_buf = NULL;
13571|      1|        buf = static_buf;
13572|      1|    }
13573|      1|    len = js_dtoa(buf, d, radix, n_digits, flags, &dtoa_mem);
13574|      1|    res = js_new_string8_len(ctx, buf, len);
13575|      1|    js_free(ctx, tmp_buf);
13576|      1|    return res;
13577|      1|}
quickjs.c:tag_is_string:
15085|      3|{
15086|      3|    return tag == JS_TAG_STRING || tag == JS_TAG_STRING_ROPE;
  ------------------
  |  Branch (15086:12): [True: 2, False: 1]
  |  Branch (15086:36): [True: 0, False: 1]
  ------------------
15087|      3|}
quickjs.c:js_call_c_function:
17582|  1.01M|{
17583|  1.01M|    JSRuntime *rt = ctx->rt;
17584|  1.01M|    JSCFunctionType func;
17585|  1.01M|    JSObject *p;
17586|  1.01M|    JSStackFrame sf_s, *sf = &sf_s, *prev_sf;
17587|  1.01M|    JSValue ret_val;
17588|  1.01M|    JSValueConst *arg_buf;
  ------------------
  |  |  234|  1.01M|#define JSValueConst JSValue
  ------------------
17589|  1.01M|    int arg_count, i;
17590|  1.01M|    JSCFunctionEnum cproto;
17591|       |
17592|  1.01M|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  227|  1.01M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.01M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17593|  1.01M|    cproto = p->u.cfunc.cproto;
17594|  1.01M|    arg_count = p->u.cfunc.length;
17595|       |
17596|       |    /* better to always check stack overflow */
17597|  1.01M|    if (js_check_stack_overflow(rt, sizeof(arg_buf[0]) * arg_count))
  ------------------
  |  Branch (17597:9): [True: 0, False: 1.01M]
  ------------------
17598|      0|        return JS_ThrowStackOverflow(ctx);
17599|       |
17600|  1.01M|    prev_sf = rt->current_stack_frame;
17601|  1.01M|    sf->prev_frame = prev_sf;
17602|  1.01M|    rt->current_stack_frame = sf;
17603|  1.01M|    ctx = p->u.cfunc.realm; /* change the current realm */
17604|  1.01M|    sf->js_mode = 0;
17605|  1.01M|    sf->cur_func = (JSValue)func_obj;
17606|  1.01M|    sf->arg_count = argc;
17607|  1.01M|    arg_buf = argv;
17608|       |
17609|  1.01M|    if (unlikely(argc < arg_count)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 11, False: 1.00M]
  |  |  ------------------
  ------------------
17610|       |        /* ensure that at least argc_count arguments are readable */
17611|     11|        arg_buf = alloca(sizeof(arg_buf[0]) * arg_count);
17612|     15|        for(i = 0; i < argc; i++)
  ------------------
  |  Branch (17612:20): [True: 4, False: 11]
  ------------------
17613|      4|            arg_buf[i] = argv[i];
17614|     22|        for(i = argc; i < arg_count; i++)
  ------------------
  |  Branch (17614:23): [True: 11, False: 11]
  ------------------
17615|     11|            arg_buf[i] = JS_UNDEFINED;
  ------------------
  |  |  289|     11|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     11|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17616|     11|        sf->arg_count = arg_count;
17617|     11|    }
17618|  1.01M|    sf->arg_buf = (JSValue*)arg_buf;
17619|       |
17620|  1.01M|    func = p->u.cfunc.c_function;
17621|  1.01M|    switch(cproto) {
17622|      0|    case JS_CFUNC_constructor:
  ------------------
  |  Branch (17622:5): [True: 0, False: 1.01M]
  ------------------
17623|      2|    case JS_CFUNC_constructor_or_func:
  ------------------
  |  Branch (17623:5): [True: 2, False: 1.01M]
  ------------------
17624|      2|        if (!(flags & JS_CALL_FLAG_CONSTRUCTOR)) {
  ------------------
  |  |  524|      2|#define JS_CALL_FLAG_CONSTRUCTOR (1 << 0)
  ------------------
  |  Branch (17624:13): [True: 0, False: 2]
  ------------------
17625|      0|            if (cproto == JS_CFUNC_constructor) {
  ------------------
  |  Branch (17625:17): [True: 0, False: 0]
  ------------------
17626|      0|            not_a_constructor:
17627|      0|                ret_val = JS_ThrowTypeError(ctx, "must be called with new");
17628|      0|                break;
17629|      0|            } else {
17630|      0|                this_obj = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17631|      0|            }
17632|      0|        }
17633|       |        /* here this_obj is new_target */
17634|       |        /* fall thru */
17635|  1.00M|    case JS_CFUNC_generic:
  ------------------
  |  Branch (17635:5): [True: 1.00M, False: 30]
  ------------------
17636|  1.00M|        ret_val = func.generic(ctx, this_obj, argc, arg_buf);
17637|  1.00M|        break;
17638|      0|    case JS_CFUNC_constructor_magic:
  ------------------
  |  Branch (17638:5): [True: 0, False: 1.01M]
  ------------------
17639|      0|    case JS_CFUNC_constructor_or_func_magic:
  ------------------
  |  Branch (17639:5): [True: 0, False: 1.01M]
  ------------------
17640|      0|        if (!(flags & JS_CALL_FLAG_CONSTRUCTOR)) {
  ------------------
  |  |  524|      0|#define JS_CALL_FLAG_CONSTRUCTOR (1 << 0)
  ------------------
  |  Branch (17640:13): [True: 0, False: 0]
  ------------------
17641|      0|            if (cproto == JS_CFUNC_constructor_magic) {
  ------------------
  |  Branch (17641:17): [True: 0, False: 0]
  ------------------
17642|      0|                goto not_a_constructor;
17643|      0|            } else {
17644|      0|                this_obj = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17645|      0|            }
17646|      0|        }
17647|       |        /* fall thru */
17648|      8|    case JS_CFUNC_generic_magic:
  ------------------
  |  Branch (17648:5): [True: 8, False: 1.01M]
  ------------------
17649|      8|        ret_val = func.generic_magic(ctx, this_obj, argc, arg_buf,
17650|      8|                                     p->u.cfunc.magic);
17651|      8|        break;
17652|      4|    case JS_CFUNC_getter:
  ------------------
  |  Branch (17652:5): [True: 4, False: 1.01M]
  ------------------
17653|      4|        ret_val = func.getter(ctx, this_obj);
17654|      4|        break;
17655|      0|    case JS_CFUNC_setter:
  ------------------
  |  Branch (17655:5): [True: 0, False: 1.01M]
  ------------------
17656|      0|        ret_val = func.setter(ctx, this_obj, arg_buf[0]);
17657|      0|        break;
17658|     16|    case JS_CFUNC_getter_magic:
  ------------------
  |  Branch (17658:5): [True: 16, False: 1.00M]
  ------------------
17659|     16|        ret_val = func.getter_magic(ctx, this_obj, p->u.cfunc.magic);
17660|     16|        break;
17661|      0|    case JS_CFUNC_setter_magic:
  ------------------
  |  Branch (17661:5): [True: 0, False: 1.01M]
  ------------------
17662|      0|        ret_val = func.setter_magic(ctx, this_obj, arg_buf[0], p->u.cfunc.magic);
17663|      0|        break;
17664|      0|    case JS_CFUNC_f_f:
  ------------------
  |  Branch (17664:5): [True: 0, False: 1.01M]
  ------------------
17665|      0|        {
17666|      0|            double d1;
17667|       |
17668|      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]
  |  |  ------------------
  ------------------
17669|      0|                ret_val = JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17670|      0|                break;
17671|      0|            }
17672|      0|            ret_val = JS_NewFloat64(ctx, func.f_f(d1));
17673|      0|        }
17674|      0|        break;
17675|      0|    case JS_CFUNC_f_f_f:
  ------------------
  |  Branch (17675:5): [True: 0, False: 1.01M]
  ------------------
17676|      0|        {
17677|      0|            double d1, d2;
17678|       |
17679|      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]
  |  |  ------------------
  ------------------
17680|      0|                ret_val = JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17681|      0|                break;
17682|      0|            }
17683|      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]
  |  |  ------------------
  ------------------
17684|      0|                ret_val = JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17685|      0|                break;
17686|      0|            }
17687|      0|            ret_val = JS_NewFloat64(ctx, func.f_f_f(d1, d2));
17688|      0|        }
17689|      0|        break;
17690|      0|    case JS_CFUNC_iterator_next:
  ------------------
  |  Branch (17690:5): [True: 0, False: 1.01M]
  ------------------
17691|      0|        {
17692|      0|            int done;
17693|      0|            ret_val = func.iterator_next(ctx, this_obj, argc, arg_buf,
17694|      0|                                         &done, p->u.cfunc.magic);
17695|      0|            if (!JS_IsException(ret_val) && done != 2) {
  ------------------
  |  Branch (17695:17): [True: 0, False: 0]
  |  Branch (17695:45): [True: 0, False: 0]
  ------------------
17696|      0|                ret_val = js_create_iterator_result(ctx, ret_val, done);
17697|      0|            }
17698|      0|        }
17699|      0|        break;
17700|      0|    default:
  ------------------
  |  Branch (17700:5): [True: 0, False: 1.01M]
  ------------------
17701|      0|        abort();
17702|  1.01M|    }
17703|       |
17704|  1.01M|    rt->current_stack_frame = sf->prev_frame;
17705|  1.01M|    return ret_val;
17706|  1.01M|}
quickjs.c:JS_CallInternal:
17761|  1.01M|{
17762|  1.01M|    JSRuntime *rt = caller_ctx->rt;
17763|  1.01M|    JSContext *ctx;
17764|  1.01M|    JSObject *p;
17765|  1.01M|    JSFunctionBytecode *b;
17766|  1.01M|    JSStackFrame sf_s, *sf = &sf_s;
17767|  1.01M|    const uint8_t *pc;
17768|  1.01M|    int opcode, arg_allocated_size, i;
17769|  1.01M|    JSValue *local_buf, *stack_buf, *var_buf, *arg_buf, *sp, ret_val, *pval;
17770|  1.01M|    JSVarRef **var_refs;
17771|  1.01M|    size_t alloca_size;
17772|       |
17773|       |#if !DIRECT_DISPATCH
17774|       |#define SWITCH(pc)      switch (opcode = *pc++)
17775|       |#define CASE(op)        case op
17776|       |#define DEFAULT         default
17777|       |#define BREAK           break
17778|       |#else
17779|  1.01M|    static const void * const dispatch_table[256] = {
17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
17781|  1.01M|#if SHORT_OPCODES
17782|  1.01M|#define def(id, size, n_pop, n_push, f)
17783|       |#else
17784|       |#define def(id, size, n_pop, n_push, f) && case_default,
17785|       |#endif
17786|  1.01M|#include "quickjs-opcode.h"
  ------------------
  |  |    1|       |/*
  |  |    2|       | * QuickJS opcode definitions
  |  |    3|       | *
  |  |    4|       | * Copyright (c) 2017-2018 Fabrice Bellard
  |  |    5|       | * Copyright (c) 2017-2018 Charlie Gordon
  |  |    6|       | *
  |  |    7|       | * Permission is hereby granted, free of charge, to any person obtaining a copy
  |  |    8|       | * of this software and associated documentation files (the "Software"), to deal
  |  |    9|       | * in the Software without restriction, including without limitation the rights
  |  |   10|       | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  |  |   11|       | * copies of the Software, and to permit persons to whom the Software is
  |  |   12|       | * furnished to do so, subject to the following conditions:
  |  |   13|       | *
  |  |   14|       | * The above copyright notice and this permission notice shall be included in
  |  |   15|       | * all copies or substantial portions of the Software.
  |  |   16|       | *
  |  |   17|       | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  |  |   18|       | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  |  |   19|       | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  |  |   20|       | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  |  |   21|       | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  |  |   22|       | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  |  |   23|       | * THE SOFTWARE.
  |  |   24|       | */
  |  |   25|       |
  |  |   26|       |#ifdef FMT
  |  |   27|       |FMT(none)
  |  |   28|       |FMT(none_int)
  |  |   29|       |FMT(none_loc)
  |  |   30|       |FMT(none_arg)
  |  |   31|       |FMT(none_var_ref)
  |  |   32|       |FMT(u8)
  |  |   33|       |FMT(i8)
  |  |   34|       |FMT(loc8)
  |  |   35|       |FMT(const8)
  |  |   36|       |FMT(label8)
  |  |   37|       |FMT(u16)
  |  |   38|       |FMT(i16)
  |  |   39|       |FMT(label16)
  |  |   40|       |FMT(npop)
  |  |   41|       |FMT(npopx)
  |  |   42|       |FMT(npop_u16)
  |  |   43|       |FMT(loc)
  |  |   44|       |FMT(arg)
  |  |   45|       |FMT(var_ref)
  |  |   46|       |FMT(u32)
  |  |   47|       |FMT(i32)
  |  |   48|       |FMT(const)
  |  |   49|       |FMT(label)
  |  |   50|       |FMT(atom)
  |  |   51|       |FMT(atom_u8)
  |  |   52|       |FMT(atom_u16)
  |  |   53|       |FMT(atom_label_u8)
  |  |   54|       |FMT(atom_label_u16)
  |  |   55|       |FMT(label_u16)
  |  |   56|       |#undef FMT
  |  |   57|       |#endif /* FMT */
  |  |   58|       |
  |  |   59|  1.01M|#ifdef DEF
  |  |   60|       |
  |  |   61|       |#ifndef def
  |  |   62|       |#define def(id, size, n_pop, n_push, f) DEF(id, size, n_pop, n_push, f)
  |  |   63|       |#endif
  |  |   64|       |
  |  |   65|  1.01M|DEF(invalid, 1, 0, 0, none) /* never emitted */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   66|       |
  |  |   67|       |/* push values */
  |  |   68|  1.01M|DEF(       push_i32, 5, 0, 1, i32)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   69|  1.01M|DEF(     push_const, 5, 0, 1, const)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   70|  1.01M|DEF(       fclosure, 5, 0, 1, const) /* must follow push_const */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   71|  1.01M|DEF(push_atom_value, 5, 0, 1, atom)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   72|  1.01M|DEF( private_symbol, 5, 0, 1, atom)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   73|  1.01M|DEF(      undefined, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   74|  1.01M|DEF(           null, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   75|  1.01M|DEF(      push_this, 1, 0, 1, none) /* only used at the start of a function */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   76|  1.01M|DEF(     push_false, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   77|  1.01M|DEF(      push_true, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   78|  1.01M|DEF(         object, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   79|  1.01M|DEF( special_object, 2, 0, 1, u8) /* only used at the start of a function */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   80|  1.01M|DEF(           rest, 3, 0, 1, u16) /* only used at the start of a function */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   81|       |
  |  |   82|  1.01M|DEF(           drop, 1, 1, 0, none) /* a -> */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   83|  1.01M|DEF(            nip, 1, 2, 1, none) /* a b -> b */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   84|  1.01M|DEF(           nip1, 1, 3, 2, none) /* a b c -> b c */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   85|  1.01M|DEF(            dup, 1, 1, 2, none) /* a -> a a */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   86|  1.01M|DEF(           dup1, 1, 2, 3, none) /* a b -> a a b */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   87|  1.01M|DEF(           dup2, 1, 2, 4, none) /* a b -> a b a b */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   88|  1.01M|DEF(           dup3, 1, 3, 6, none) /* a b c -> a b c a b c */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   89|  1.01M|DEF(        insert2, 1, 2, 3, none) /* obj a -> a obj a (dup_x1) */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   90|  1.01M|DEF(        insert3, 1, 3, 4, none) /* obj prop a -> a obj prop a (dup_x2) */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   91|  1.01M|DEF(        insert4, 1, 4, 5, none) /* this obj prop a -> a this obj prop a */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   92|  1.01M|DEF(          perm3, 1, 3, 3, none) /* obj a b -> a obj b */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   93|  1.01M|DEF(          perm4, 1, 4, 4, none) /* obj prop a b -> a obj prop b */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   94|  1.01M|DEF(          perm5, 1, 5, 5, none) /* this obj prop a b -> a this obj prop b */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   95|  1.01M|DEF(           swap, 1, 2, 2, none) /* a b -> b a */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   96|  1.01M|DEF(          swap2, 1, 4, 4, none) /* a b c d -> c d a b */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   97|  1.01M|DEF(          rot3l, 1, 3, 3, none) /* x a b -> a b x */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   98|  1.01M|DEF(          rot3r, 1, 3, 3, none) /* a b x -> x a b */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |   99|  1.01M|DEF(          rot4l, 1, 4, 4, none) /* x a b c -> a b c x */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  100|  1.01M|DEF(          rot5l, 1, 5, 5, none) /* x a b c d -> a b c d x */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  101|       |
  |  |  102|  1.01M|DEF(call_constructor, 3, 2, 1, npop) /* func new.target args -> ret. arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  103|  1.01M|DEF(           call, 3, 1, 1, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  104|  1.01M|DEF(      tail_call, 3, 1, 0, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  105|  1.01M|DEF(    call_method, 3, 2, 1, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  106|  1.01M|DEF(tail_call_method, 3, 2, 0, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  107|  1.01M|DEF(     array_from, 3, 0, 1, npop) /* arguments are not counted in n_pop */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  108|  1.01M|DEF(          apply, 3, 3, 1, u16)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  109|  1.01M|DEF(         return, 1, 1, 0, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  110|  1.01M|DEF(   return_undef, 1, 0, 0, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  111|  1.01M|DEF(check_ctor_return, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  112|  1.01M|DEF(     check_ctor, 1, 0, 0, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  113|  1.01M|DEF(      init_ctor, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  114|  1.01M|DEF(    check_brand, 1, 2, 2, none) /* this_obj func -> this_obj func */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  115|  1.01M|DEF(      add_brand, 1, 2, 0, none) /* this_obj home_obj -> */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  116|  1.01M|DEF(   return_async, 1, 1, 0, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  117|  1.01M|DEF(          throw, 1, 1, 0, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  118|  1.01M|DEF(    throw_error, 6, 0, 0, atom_u8)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  119|  1.01M|DEF(           eval, 5, 1, 1, npop_u16) /* func args... -> ret_val */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  120|  1.01M|DEF(     apply_eval, 3, 2, 1, u16) /* func array -> ret_eval */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  121|  1.01M|DEF(         regexp, 1, 2, 1, none) /* create a RegExp object from the pattern and a
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  122|       |                                       bytecode string */
  |  |  123|  1.01M|DEF(      get_super, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  124|  1.01M|DEF(         import, 1, 2, 1, none) /* dynamic module import */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  125|       |
  |  |  126|  1.01M|DEF(  get_var_undef, 3, 0, 1, var_ref) /* push undefined if the variable does not exist */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  127|  1.01M|DEF(        get_var, 3, 0, 1, var_ref) /* throw an exception if the variable does not exist */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  128|  1.01M|DEF(        put_var, 3, 1, 0, var_ref) /* must come after get_var */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  129|  1.01M|DEF(   put_var_init, 3, 1, 0, var_ref) /* must come after put_var. Used to initialize a global lexical variable */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  130|       |
  |  |  131|  1.01M|DEF(  get_ref_value, 1, 2, 3, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  132|  1.01M|DEF(  put_ref_value, 1, 3, 0, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  133|       |
  |  |  134|  1.01M|DEF(      get_field, 5, 1, 1, atom)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  135|  1.01M|DEF(     get_field2, 5, 1, 2, atom)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  136|  1.01M|DEF(      put_field, 5, 2, 0, atom)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  137|  1.01M|DEF( get_private_field, 1, 2, 1, none) /* obj prop -> value */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  138|  1.01M|DEF( put_private_field, 1, 3, 0, none) /* obj value prop -> */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  139|  1.01M|DEF(define_private_field, 1, 3, 1, none) /* obj prop value -> obj */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  140|  1.01M|DEF(   get_array_el, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  141|  1.01M|DEF(  get_array_el2, 1, 2, 2, none) /* obj prop -> obj value */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  142|  1.01M|DEF(  get_array_el3, 1, 2, 3, none) /* obj prop -> obj prop1 value */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  143|  1.01M|DEF(   put_array_el, 1, 3, 0, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  144|  1.01M|DEF(get_super_value, 1, 3, 1, none) /* this obj prop -> value */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  145|  1.01M|DEF(put_super_value, 1, 4, 0, none) /* this obj prop value -> */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  146|  1.01M|DEF(   define_field, 5, 2, 1, atom)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  147|  1.01M|DEF(       set_name, 5, 1, 1, atom)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  148|  1.01M|DEF(set_name_computed, 1, 2, 2, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  149|  1.01M|DEF(      set_proto, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  150|  1.01M|DEF(set_home_object, 1, 2, 2, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  151|  1.01M|DEF(define_array_el, 1, 3, 2, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  152|  1.01M|DEF(         append, 1, 3, 2, none) /* append enumerated object, update length */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  153|  1.01M|DEF(copy_data_properties, 2, 3, 3, u8)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  154|  1.01M|DEF(  define_method, 6, 2, 1, atom_u8)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  155|  1.01M|DEF(define_method_computed, 2, 3, 1, u8) /* must come after define_method */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  156|  1.01M|DEF(   define_class, 6, 2, 2, atom_u8) /* parent ctor -> ctor proto */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  157|  1.01M|DEF(   define_class_computed, 6, 3, 3, atom_u8) /* field_name parent ctor -> field_name ctor proto (class with computed name) */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  158|       |
  |  |  159|  1.01M|DEF(        get_loc, 3, 0, 1, loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  160|  1.01M|DEF(        put_loc, 3, 1, 0, loc) /* must come after get_loc */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  161|  1.01M|DEF(        set_loc, 3, 1, 1, loc) /* must come after put_loc */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  162|  1.01M|DEF(        get_arg, 3, 0, 1, arg)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  163|  1.01M|DEF(        put_arg, 3, 1, 0, arg) /* must come after get_arg */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  164|  1.01M|DEF(        set_arg, 3, 1, 1, arg) /* must come after put_arg */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  165|  1.01M|DEF(    get_var_ref, 3, 0, 1, var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  166|  1.01M|DEF(    put_var_ref, 3, 1, 0, var_ref) /* must come after get_var_ref */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  167|  1.01M|DEF(    set_var_ref, 3, 1, 1, var_ref) /* must come after put_var_ref */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  168|  1.01M|DEF(set_loc_uninitialized, 3, 0, 0, loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  169|  1.01M|DEF(  get_loc_check, 3, 0, 1, loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  170|  1.01M|DEF(  put_loc_check, 3, 1, 0, loc) /* must come after get_loc_check */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  171|  1.01M|DEF(  set_loc_check, 3, 1, 1, loc) /* must come after put_loc_check */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  172|  1.01M|DEF(  put_loc_check_init, 3, 1, 0, loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  173|  1.01M|DEF(get_loc_checkthis, 3, 0, 1, loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  174|  1.01M|DEF(get_var_ref_check, 3, 0, 1, var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  175|  1.01M|DEF(put_var_ref_check, 3, 1, 0, var_ref) /* must come after get_var_ref_check */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  176|  1.01M|DEF(put_var_ref_check_init, 3, 1, 0, var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  177|  1.01M|DEF(      close_loc, 3, 0, 0, loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  178|  1.01M|DEF(       if_false, 5, 1, 0, label)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  179|  1.01M|DEF(        if_true, 5, 1, 0, label) /* must come after if_false */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  180|  1.01M|DEF(           goto, 5, 0, 0, label) /* must come after if_true */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  181|  1.01M|DEF(          catch, 5, 0, 1, label)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  182|  1.01M|DEF(          gosub, 5, 0, 0, label) /* used to execute the finally block */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  183|  1.01M|DEF(            ret, 1, 1, 0, none) /* used to return from the finally block */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  184|  1.01M|DEF(      nip_catch, 1, 2, 1, none) /* catch ... a -> a */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  185|       |
  |  |  186|  1.01M|DEF(      to_object, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  187|       |//DEF(      to_string, 1, 1, 1, none)
  |  |  188|  1.01M|DEF(     to_propkey, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  189|       |
  |  |  190|  1.01M|DEF(   with_get_var, 10, 1, 0, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  191|  1.01M|DEF(   with_put_var, 10, 2, 1, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  192|  1.01M|DEF(with_delete_var, 10, 1, 0, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  193|  1.01M|DEF(  with_make_ref, 10, 1, 0, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  194|  1.01M|DEF(   with_get_ref, 10, 1, 0, atom_label_u8)     /* must be in the same order as scope_xxx */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  195|       |
  |  |  196|  1.01M|DEF(   make_loc_ref, 7, 0, 2, atom_u16)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  197|  1.01M|DEF(   make_arg_ref, 7, 0, 2, atom_u16)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  198|  1.01M|DEF(make_var_ref_ref, 7, 0, 2, atom_u16)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  199|  1.01M|DEF(   make_var_ref, 5, 0, 2, atom)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  200|       |
  |  |  201|  1.01M|DEF(   for_in_start, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  202|  1.01M|DEF(   for_of_start, 1, 1, 3, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  203|  1.01M|DEF(for_await_of_start, 1, 1, 3, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  204|  1.01M|DEF(    for_in_next, 1, 1, 3, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  205|  1.01M|DEF(    for_of_next, 2, 3, 5, u8)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  206|  1.01M|DEF(for_await_of_next, 1, 3, 4, none) /* iter next catch_offset -> iter next catch_offset obj */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  207|  1.01M|DEF(iterator_check_object, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  208|  1.01M|DEF(iterator_get_value_done, 1, 2, 3, none) /* catch_offset obj -> catch_offset value done */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  209|  1.01M|DEF( iterator_close, 1, 3, 0, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  210|  1.01M|DEF(  iterator_next, 1, 4, 4, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  211|  1.01M|DEF(  iterator_call, 2, 4, 5, u8)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  212|  1.01M|DEF(  initial_yield, 1, 0, 0, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  213|  1.01M|DEF(          yield, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  214|  1.01M|DEF(     yield_star, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  215|  1.01M|DEF(async_yield_star, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  216|  1.01M|DEF(          await, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  217|       |
  |  |  218|       |/* arithmetic/logic operations */
  |  |  219|  1.01M|DEF(            neg, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  220|  1.01M|DEF(           plus, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  221|  1.01M|DEF(            dec, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  222|  1.01M|DEF(            inc, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  223|  1.01M|DEF(       post_dec, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  224|  1.01M|DEF(       post_inc, 1, 1, 2, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  225|  1.01M|DEF(        dec_loc, 2, 0, 0, loc8)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  226|  1.01M|DEF(        inc_loc, 2, 0, 0, loc8)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  227|  1.01M|DEF(        add_loc, 2, 1, 0, loc8)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  228|  1.01M|DEF(            not, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  229|  1.01M|DEF(           lnot, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  230|  1.01M|DEF(         typeof, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  231|  1.01M|DEF(         delete, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  232|  1.01M|DEF(     delete_var, 5, 0, 1, atom)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  233|       |
  |  |  234|  1.01M|DEF(            mul, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  235|  1.01M|DEF(            div, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  236|  1.01M|DEF(            mod, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  237|  1.01M|DEF(            add, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  238|  1.01M|DEF(            sub, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  239|  1.01M|DEF(            pow, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  240|  1.01M|DEF(            shl, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  241|  1.01M|DEF(            sar, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  242|  1.01M|DEF(            shr, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  243|  1.01M|DEF(             lt, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  244|  1.01M|DEF(            lte, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  245|  1.01M|DEF(             gt, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  246|  1.01M|DEF(            gte, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  247|  1.01M|DEF(     instanceof, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  248|  1.01M|DEF(             in, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  249|  1.01M|DEF(             eq, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  250|  1.01M|DEF(            neq, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  251|  1.01M|DEF(      strict_eq, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  252|  1.01M|DEF(     strict_neq, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  253|  1.01M|DEF(            and, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  254|  1.01M|DEF(            xor, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  255|  1.01M|DEF(             or, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  256|  1.01M|DEF(is_undefined_or_null, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  257|  1.01M|DEF(     private_in, 1, 2, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  258|  1.01M|DEF(push_bigint_i32, 5, 0, 1, i32)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  259|       |/* must be the last non short and non temporary opcode */
  |  |  260|  1.01M|DEF(            nop, 1, 0, 0, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  261|       |
  |  |  262|       |/* temporary opcodes: never emitted in the final bytecode */
  |  |  263|       |
  |  |  264|  1.01M|def(    enter_scope, 3, 0, 0, u16)  /* emitted in phase 1, removed in phase 2 */
  |  |  265|  1.01M|def(    leave_scope, 3, 0, 0, u16)  /* emitted in phase 1, removed in phase 2 */
  |  |  266|       |
  |  |  267|  1.01M|def(          label, 5, 0, 0, label) /* emitted in phase 1, removed in phase 3 */
  |  |  268|       |
  |  |  269|       |/* the following opcodes must be in the same order as the 'with_x' and
  |  |  270|       |   get_var_undef, get_var and put_var opcodes */
  |  |  271|  1.01M|def(scope_get_var_undef, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  272|  1.01M|def(  scope_get_var, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  273|  1.01M|def(  scope_put_var, 7, 1, 0, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  274|  1.01M|def(scope_delete_var, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  275|  1.01M|def( scope_make_ref, 11, 0, 2, atom_label_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  276|  1.01M|def(  scope_get_ref, 7, 0, 2, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  277|  1.01M|def(scope_put_var_init, 7, 0, 2, atom_u16) /* emitted in phase 1, removed in phase 2 */
  |  |  278|  1.01M|def(scope_get_var_checkthis, 7, 0, 1, atom_u16) /* emitted in phase 1, removed in phase 2, only used to return 'this' in derived class constructors */
  |  |  279|  1.01M|def(scope_get_private_field, 7, 1, 1, atom_u16) /* obj -> value, emitted in phase 1, removed in phase 2 */
  |  |  280|  1.01M|def(scope_get_private_field2, 7, 1, 2, atom_u16) /* obj -> obj value, emitted in phase 1, removed in phase 2 */
  |  |  281|  1.01M|def(scope_put_private_field, 7, 2, 0, atom_u16) /* obj value ->, emitted in phase 1, removed in phase 2 */
  |  |  282|  1.01M|def(scope_in_private_field, 7, 1, 1, atom_u16) /* obj -> res emitted in phase 1, removed in phase 2 */
  |  |  283|  1.01M|def(get_field_opt_chain, 5, 1, 1, atom) /* emitted in phase 1, removed in phase 2 */
  |  |  284|  1.01M|def(get_array_el_opt_chain, 1, 2, 1, none) /* emitted in phase 1, removed in phase 2 */
  |  |  285|  1.01M|def( set_class_name, 5, 1, 1, u32) /* emitted in phase 1, removed in phase 2 */
  |  |  286|       |
  |  |  287|  1.01M|def(       line_num, 5, 0, 0, u32) /* emitted in phase 1, removed in phase 3 */
  |  |  288|       |
  |  |  289|  1.01M|#if SHORT_OPCODES
  |  |  290|  1.01M|DEF(    push_minus1, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  291|  1.01M|DEF(         push_0, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  292|  1.01M|DEF(         push_1, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  293|  1.01M|DEF(         push_2, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  294|  1.01M|DEF(         push_3, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  295|  1.01M|DEF(         push_4, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  296|  1.01M|DEF(         push_5, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  297|  1.01M|DEF(         push_6, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  298|  1.01M|DEF(         push_7, 1, 0, 1, none_int)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  299|  1.01M|DEF(        push_i8, 2, 0, 1, i8)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  300|  1.01M|DEF(       push_i16, 3, 0, 1, i16)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  301|  1.01M|DEF(    push_const8, 2, 0, 1, const8)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  302|  1.01M|DEF(      fclosure8, 2, 0, 1, const8) /* must follow push_const8 */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  303|  1.01M|DEF(push_empty_string, 1, 0, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  304|       |
  |  |  305|  1.01M|DEF(       get_loc8, 2, 0, 1, loc8)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  306|  1.01M|DEF(       put_loc8, 2, 1, 0, loc8)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  307|  1.01M|DEF(       set_loc8, 2, 1, 1, loc8)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  308|       |
  |  |  309|  1.01M|DEF(       get_loc0, 1, 0, 1, none_loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  310|  1.01M|DEF(       get_loc1, 1, 0, 1, none_loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  311|  1.01M|DEF(       get_loc2, 1, 0, 1, none_loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  312|  1.01M|DEF(       get_loc3, 1, 0, 1, none_loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  313|  1.01M|DEF(       put_loc0, 1, 1, 0, none_loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  314|  1.01M|DEF(       put_loc1, 1, 1, 0, none_loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  315|  1.01M|DEF(       put_loc2, 1, 1, 0, none_loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  316|  1.01M|DEF(       put_loc3, 1, 1, 0, none_loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  317|  1.01M|DEF(       set_loc0, 1, 1, 1, none_loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  318|  1.01M|DEF(       set_loc1, 1, 1, 1, none_loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  319|  1.01M|DEF(       set_loc2, 1, 1, 1, none_loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  320|  1.01M|DEF(       set_loc3, 1, 1, 1, none_loc)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  321|  1.01M|DEF(       get_arg0, 1, 0, 1, none_arg)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  322|  1.01M|DEF(       get_arg1, 1, 0, 1, none_arg)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  323|  1.01M|DEF(       get_arg2, 1, 0, 1, none_arg)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  324|  1.01M|DEF(       get_arg3, 1, 0, 1, none_arg)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  325|  1.01M|DEF(       put_arg0, 1, 1, 0, none_arg)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  326|  1.01M|DEF(       put_arg1, 1, 1, 0, none_arg)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  327|  1.01M|DEF(       put_arg2, 1, 1, 0, none_arg)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  328|  1.01M|DEF(       put_arg3, 1, 1, 0, none_arg)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  329|  1.01M|DEF(       set_arg0, 1, 1, 1, none_arg)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  330|  1.01M|DEF(       set_arg1, 1, 1, 1, none_arg)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  331|  1.01M|DEF(       set_arg2, 1, 1, 1, none_arg)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  332|  1.01M|DEF(       set_arg3, 1, 1, 1, none_arg)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  333|  1.01M|DEF(   get_var_ref0, 1, 0, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  334|  1.01M|DEF(   get_var_ref1, 1, 0, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  335|  1.01M|DEF(   get_var_ref2, 1, 0, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  336|  1.01M|DEF(   get_var_ref3, 1, 0, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  337|  1.01M|DEF(   put_var_ref0, 1, 1, 0, none_var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  338|  1.01M|DEF(   put_var_ref1, 1, 1, 0, none_var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  339|  1.01M|DEF(   put_var_ref2, 1, 1, 0, none_var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  340|  1.01M|DEF(   put_var_ref3, 1, 1, 0, none_var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  341|  1.01M|DEF(   set_var_ref0, 1, 1, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  342|  1.01M|DEF(   set_var_ref1, 1, 1, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  343|  1.01M|DEF(   set_var_ref2, 1, 1, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  344|  1.01M|DEF(   set_var_ref3, 1, 1, 1, none_var_ref)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  345|       |
  |  |  346|  1.01M|DEF(     get_length, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  347|       |
  |  |  348|  1.01M|DEF(      if_false8, 2, 1, 0, label8)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  349|  1.01M|DEF(       if_true8, 2, 1, 0, label8) /* must come after if_false8 */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  350|  1.01M|DEF(          goto8, 2, 0, 0, label8) /* must come after if_true8 */
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  351|  1.01M|DEF(         goto16, 3, 0, 0, label16)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  352|       |
  |  |  353|  1.01M|DEF(          call0, 1, 1, 1, npopx)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  354|  1.01M|DEF(          call1, 1, 1, 1, npopx)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  355|  1.01M|DEF(          call2, 1, 1, 1, npopx)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  356|  1.01M|DEF(          call3, 1, 1, 1, npopx)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  357|       |
  |  |  358|  1.01M|DEF(   is_undefined, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  359|  1.01M|DEF(        is_null, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  360|  1.01M|DEF(typeof_is_undefined, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  361|  1.01M|DEF( typeof_is_function, 1, 1, 1, none)
  |  |  ------------------
  |  |  |  |17780|  1.01M|#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
  |  |  ------------------
  |  |  362|  1.01M|#endif
  |  |  363|       |
  |  |  364|  1.01M|#undef DEF
  |  |  365|  1.01M|#undef def
  |  |  366|  1.01M|#endif  /* DEF */
  ------------------
17787|  1.01M|        [ OP_COUNT ... 255 ] = &&case_default
17788|  1.01M|    };
17789|  1.01M|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
17790|  1.01M|#define CASE(op)        case_ ## op
17791|  1.01M|#define DEFAULT         case_default
17792|  1.01M|#define BREAK           SWITCH(pc)
17793|  1.01M|#endif
17794|       |
17795|  1.01M|    if (js_poll_interrupts(caller_ctx))
  ------------------
  |  Branch (17795:9): [True: 2, False: 1.01M]
  ------------------
17796|      2|        return JS_EXCEPTION;
  ------------------
  |  |  292|      2|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17797|  1.01M|    if (unlikely(JS_VALUE_GET_TAG(func_obj) != JS_TAG_OBJECT)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 13, False: 1.01M]
  |  |  ------------------
  ------------------
17798|     13|        if (flags & JS_CALL_FLAG_GENERATOR) {
  ------------------
  |  |17577|     13|#define JS_CALL_FLAG_GENERATOR   (1 << 2)
  ------------------
  |  Branch (17798:13): [True: 13, False: 0]
  ------------------
17799|     13|            JSAsyncFunctionState *s = JS_VALUE_GET_PTR(func_obj);
  ------------------
  |  |  243|     13|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
17800|       |            /* func_obj get contains a pointer to JSFuncAsyncState */
17801|       |            /* the stack frame is already allocated */
17802|     13|            sf = &s->frame;
17803|     13|            p = JS_VALUE_GET_OBJ(sf->cur_func);
  ------------------
  |  |  227|     13|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     13|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17804|     13|            b = p->u.func.function_bytecode;
17805|     13|            ctx = b->realm;
17806|     13|            var_refs = p->u.func.var_refs;
17807|     13|            local_buf = arg_buf = sf->arg_buf;
17808|     13|            var_buf = sf->var_buf;
17809|     13|            stack_buf = sf->var_buf + b->var_count;
17810|     13|            sp = sf->cur_sp;
17811|     13|            sf->cur_sp = NULL; /* cur_sp is NULL if the function is running */
17812|     13|            pc = sf->cur_pc;
17813|     13|            sf->prev_frame = rt->current_stack_frame;
17814|     13|            rt->current_stack_frame = sf;
17815|     13|            if (s->throw_flag)
  ------------------
  |  Branch (17815:17): [True: 0, False: 13]
  ------------------
17816|      0|                goto exception;
17817|     13|            else
17818|     13|                goto restart;
17819|     13|        } else {
17820|      0|            goto not_a_function;
17821|      0|        }
17822|     13|    }
17823|  1.01M|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  227|  1.01M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.01M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17824|  1.01M|    if (unlikely(p->class_id != JS_CLASS_BYTECODE_FUNCTION)) {
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1.01M, False: 27]
  |  |  ------------------
  ------------------
17825|  1.01M|        JSClassCall *call_func;
17826|  1.01M|        call_func = rt->class_array[p->class_id].call;
17827|  1.01M|        if (!call_func) {
  ------------------
  |  Branch (17827:13): [True: 0, False: 1.01M]
  ------------------
17828|      0|        not_a_function:
17829|      0|            return JS_ThrowTypeError(caller_ctx, "not a function");
17830|      0|        }
17831|  1.01M|        return call_func(caller_ctx, func_obj, this_obj, argc,
17832|  1.01M|                         (JSValueConst *)argv, flags);
17833|  1.01M|    }
17834|     27|    b = p->u.func.function_bytecode;
17835|       |
17836|     27|    if (unlikely(argc < b->arg_count || (flags & JS_CALL_FLAG_COPY_ARGV))) {
  ------------------
  |  |   33|     52|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 27, False: 0]
  |  |  |  Branch (33:45): [True: 2, False: 25]
  |  |  |  Branch (33:45): [True: 25, False: 0]
  |  |  ------------------
  ------------------
17837|     27|        arg_allocated_size = b->arg_count;
17838|     27|    } else {
17839|      0|        arg_allocated_size = 0;
17840|      0|    }
17841|       |
17842|     27|    alloca_size = sizeof(JSValue) * (arg_allocated_size + b->var_count +
17843|     27|                                     b->stack_size) +
17844|     27|        sizeof(JSVarRef *) * b->var_ref_count;
17845|     27|    if (js_check_stack_overflow(rt, alloca_size))
  ------------------
  |  Branch (17845:9): [True: 0, False: 27]
  ------------------
17846|      0|        return JS_ThrowStackOverflow(caller_ctx);
17847|       |
17848|     27|    sf->js_mode = b->js_mode;
17849|     27|    arg_buf = argv;
17850|     27|    sf->arg_count = argc;
17851|     27|    sf->cur_func = (JSValue)func_obj;
17852|     27|    var_refs = p->u.func.var_refs;
17853|       |
17854|     27|    local_buf = alloca(alloca_size);
17855|     27|    if (unlikely(arg_allocated_size)) {
  ------------------
  |  |   33|     27|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 25]
  |  |  ------------------
  ------------------
17856|      2|        int n = min_int(argc, b->arg_count);
17857|      2|        arg_buf = local_buf;
17858|      4|        for(i = 0; i < n; i++)
  ------------------
  |  Branch (17858:20): [True: 2, False: 2]
  ------------------
17859|      2|            arg_buf[i] = JS_DupValue(caller_ctx, argv[i]);
17860|      4|        for(; i < b->arg_count; i++)
  ------------------
  |  Branch (17860:15): [True: 2, False: 2]
  ------------------
17861|      2|            arg_buf[i] = JS_UNDEFINED;
  ------------------
  |  |  289|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17862|      2|        sf->arg_count = b->arg_count;
17863|      2|    }
17864|     27|    var_buf = local_buf + arg_allocated_size;
17865|     27|    sf->var_buf = var_buf;
17866|     27|    sf->arg_buf = arg_buf;
17867|       |
17868|     47|    for(i = 0; i < b->var_count; i++)
  ------------------
  |  Branch (17868:16): [True: 20, False: 27]
  ------------------
17869|     27|        var_buf[i] = JS_UNDEFINED;
  ------------------
  |  |  289|     20|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     47|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17870|       |
17871|     27|    stack_buf = var_buf + b->var_count;
17872|     27|    sf->var_refs = (JSVarRef **)(stack_buf + b->stack_size);
17873|     27|    for(i = 0; i < b->var_ref_count; i++)
  ------------------
  |  Branch (17873:16): [True: 0, False: 27]
  ------------------
17874|      0|        sf->var_refs[i] = NULL;
17875|     27|    sp = stack_buf;
17876|     27|    pc = b->byte_code_buf;
17877|     27|    sf->prev_frame = rt->current_stack_frame;
17878|     27|    rt->current_stack_frame = sf;
17879|     27|    ctx = b->realm; /* set the current realm */
17880|       |
17881|     40| restart:
17882|     40|    for(;;) {
17883|     40|        int call_argc;
17884|     40|        JSValue *call_argv;
17885|       |
17886|     40|        SWITCH(pc) {
  ------------------
  |  |17789|     40|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  ------------------
17887|     40|        CASE(OP_push_i32):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
17888|      0|            *sp++ = JS_NewInt32(ctx, get_u32(pc));
17889|      0|            pc += 4;
17890|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17891|      0|        CASE(OP_push_bigint_i32):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
17892|      0|            *sp++ = __JS_NewShortBigInt(ctx, (int)get_u32(pc));
17893|      0|            pc += 4;
17894|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17895|      0|        CASE(OP_push_const):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
17896|      0|            *sp++ = JS_DupValue(ctx, b->cpool[get_u32(pc)]);
17897|      0|            pc += 4;
17898|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17899|      0|#if SHORT_OPCODES
17900|      0|        CASE(OP_push_minus1):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
17901|      0|        CASE(OP_push_0):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
17902|      2|        CASE(OP_push_1):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
17903|      2|        CASE(OP_push_2):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
17904|      2|        CASE(OP_push_3):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
17905|      2|        CASE(OP_push_4):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
17906|      2|        CASE(OP_push_5):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
17907|      2|        CASE(OP_push_6):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
17908|      2|        CASE(OP_push_7):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
17909|      2|            *sp++ = JS_NewInt32(ctx, opcode - OP_push_0);
17910|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17911|      2|        CASE(OP_push_i8):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
17912|      0|            *sp++ = JS_NewInt32(ctx, get_i8(pc));
17913|      0|            pc += 1;
17914|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17915|      0|        CASE(OP_push_i16):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
17916|      0|            *sp++ = JS_NewInt32(ctx, get_i16(pc));
17917|      0|            pc += 2;
17918|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17919|     12|        CASE(OP_push_const8):
  ------------------
  |  |17790|     12|#define CASE(op)        case_ ## op
  ------------------
17920|     12|            *sp++ = JS_DupValue(ctx, b->cpool[*pc++]);
17921|     12|            BREAK;
  ------------------
  |  |17792|     12|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|     12|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17922|     12|        CASE(OP_fclosure8):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
17923|      2|            *sp++ = js_closure(ctx, JS_DupValue(ctx, b->cpool[*pc++]), var_refs, sf, FALSE);
17924|      2|            if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
17925|      0|                goto exception;
17926|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17927|      2|        CASE(OP_push_empty_string):
  ------------------
  |  |17790|      1|#define CASE(op)        case_ ## op
  ------------------
17928|      1|            *sp++ = JS_AtomToString(ctx, JS_ATOM_empty_string);
17929|      1|            BREAK;
  ------------------
  |  |17792|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17930|      1|#endif
17931|      7|        CASE(OP_push_atom_value):
  ------------------
  |  |17790|      7|#define CASE(op)        case_ ## op
  ------------------
17932|      7|            *sp++ = JS_AtomToValue(ctx, get_u32(pc));
17933|      7|            pc += 4;
17934|      7|            BREAK;
  ------------------
  |  |17792|      7|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      7|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17935|     16|        CASE(OP_undefined):
  ------------------
  |  |17790|     16|#define CASE(op)        case_ ## op
  ------------------
17936|     16|            *sp++ = JS_UNDEFINED;
  ------------------
  |  |  289|     16|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     16|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17937|     16|            BREAK;
  ------------------
  |  |17792|     16|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|     16|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17938|     16|        CASE(OP_null):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
17939|      0|            *sp++ = JS_NULL;
  ------------------
  |  |  288|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17940|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17941|     26|        CASE(OP_push_this):
  ------------------
  |  |17790|     26|#define CASE(op)        case_ ## op
  ------------------
17942|       |            /* OP_push_this is only called at the start of a function */
17943|     26|            {
17944|     26|                JSValue val;
17945|     26|                if (!(b->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  395|     26|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (17945:21): [True: 0, False: 26]
  ------------------
17946|      0|                    uint32_t tag = JS_VALUE_GET_TAG(this_obj);
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
17947|      0|                    if (likely(tag == JS_TAG_OBJECT))
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17948|      0|                        goto normal_this;
17949|      0|                    if (tag == JS_TAG_NULL || tag == JS_TAG_UNDEFINED) {
  ------------------
  |  Branch (17949:25): [True: 0, False: 0]
  |  Branch (17949:47): [True: 0, False: 0]
  ------------------
17950|      0|                        val = JS_DupValue(ctx, ctx->global_obj);
17951|      0|                    } else {
17952|      0|                        val = JS_ToObject(ctx, this_obj);
17953|      0|                        if (JS_IsException(val))
  ------------------
  |  Branch (17953:29): [True: 0, False: 0]
  ------------------
17954|      0|                            goto exception;
17955|      0|                    }
17956|     26|                } else {
17957|     26|                normal_this:
17958|     26|                    val = JS_DupValue(ctx, this_obj);
17959|     26|                }
17960|     26|                *sp++ = val;
17961|     26|            }
17962|     26|            BREAK;
  ------------------
  |  |17792|     26|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|     26|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17963|     26|        CASE(OP_push_false):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
17964|      0|            *sp++ = JS_FALSE;
  ------------------
  |  |  290|      0|#define JS_FALSE     JS_MKVAL(JS_TAG_BOOL, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17965|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17966|      0|        CASE(OP_push_true):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
17967|      0|            *sp++ = JS_TRUE;
  ------------------
  |  |  291|      0|#define JS_TRUE      JS_MKVAL(JS_TAG_BOOL, 1)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17968|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17969|      0|        CASE(OP_object):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
17970|      0|            *sp++ = JS_NewObject(ctx);
17971|      0|            if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17972|      0|                goto exception;
17973|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
17974|      0|        CASE(OP_special_object):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
17975|      0|            {
17976|      0|                int arg = *pc++;
17977|      0|                switch(arg) {
17978|      0|                case OP_SPECIAL_OBJECT_ARGUMENTS:
  ------------------
  |  Branch (17978:17): [True: 0, False: 0]
  ------------------
17979|      0|                    *sp++ = js_build_arguments(ctx, argc, (JSValueConst *)argv);
17980|      0|                    if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17981|      0|                        goto exception;
17982|      0|                    break;
17983|      0|                case OP_SPECIAL_OBJECT_MAPPED_ARGUMENTS:
  ------------------
  |  Branch (17983:17): [True: 0, False: 0]
  ------------------
17984|      0|                    *sp++ = js_build_mapped_arguments(ctx, argc, (JSValueConst *)argv,
17985|      0|                                                      sf, min_int(argc, b->arg_count));
17986|      0|                    if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
17987|      0|                        goto exception;
17988|      0|                    break;
17989|      0|                case OP_SPECIAL_OBJECT_THIS_FUNC:
  ------------------
  |  Branch (17989:17): [True: 0, False: 0]
  ------------------
17990|      0|                    *sp++ = JS_DupValue(ctx, sf->cur_func);
17991|      0|                    break;
17992|      0|                case OP_SPECIAL_OBJECT_NEW_TARGET:
  ------------------
  |  Branch (17992:17): [True: 0, False: 0]
  ------------------
17993|      0|                    *sp++ = JS_DupValue(ctx, new_target);
17994|      0|                    break;
17995|      0|                case OP_SPECIAL_OBJECT_HOME_OBJECT:
  ------------------
  |  Branch (17995:17): [True: 0, False: 0]
  ------------------
17996|      0|                    {
17997|      0|                        JSObject *p1;
17998|      0|                        p1 = p->u.func.home_object;
17999|      0|                        if (unlikely(!p1))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18000|      0|                            *sp++ = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18001|      0|                        else
18002|      0|                            *sp++ = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p1));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
18003|      0|                    }
18004|      0|                    break;
18005|      0|                case OP_SPECIAL_OBJECT_VAR_OBJECT:
  ------------------
  |  Branch (18005:17): [True: 0, False: 0]
  ------------------
18006|      0|                    *sp++ = JS_NewObjectProto(ctx, JS_NULL);
  ------------------
  |  |  288|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18007|      0|                    if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18008|      0|                        goto exception;
18009|      0|                    break;
18010|      0|                case OP_SPECIAL_OBJECT_IMPORT_META:
  ------------------
  |  Branch (18010:17): [True: 0, False: 0]
  ------------------
18011|      0|                    *sp++ = js_import_meta(ctx);
18012|      0|                    if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18013|      0|                        goto exception;
18014|      0|                    break;
18015|      0|                default:
  ------------------
  |  Branch (18015:17): [True: 0, False: 0]
  ------------------
18016|      0|                    abort();
18017|      0|                }
18018|      0|            }
18019|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18020|      0|        CASE(OP_rest):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18021|      0|            {
18022|      0|                int first = get_u16(pc);
18023|      0|                pc += 2;
18024|      0|                first = min_int(first, argc);
18025|      0|                *sp++ = js_create_array(ctx, argc - first, (JSValueConst *)(argv + first));
18026|      0|                if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18027|      0|                    goto exception;
18028|      0|            }
18029|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18030|       |
18031|      8|        CASE(OP_drop):
  ------------------
  |  |17790|      8|#define CASE(op)        case_ ## op
  ------------------
18032|      8|            JS_FreeValue(ctx, sp[-1]);
18033|      8|            sp--;
18034|      8|            BREAK;
  ------------------
  |  |17792|      8|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      8|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18035|      8|        CASE(OP_nip):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18036|      0|            JS_FreeValue(ctx, sp[-2]);
18037|      0|            sp[-2] = sp[-1];
18038|      0|            sp--;
18039|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18040|      0|        CASE(OP_nip1): /* a b c -> b c */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18041|      0|            JS_FreeValue(ctx, sp[-3]);
18042|      0|            sp[-3] = sp[-2];
18043|      0|            sp[-2] = sp[-1];
18044|      0|            sp--;
18045|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18046|      6|        CASE(OP_dup):
  ------------------
  |  |17790|      6|#define CASE(op)        case_ ## op
  ------------------
18047|      6|            sp[0] = JS_DupValue(ctx, sp[-1]);
18048|      6|            sp++;
18049|      6|            BREAK;
  ------------------
  |  |17792|      6|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      6|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18050|      6|        CASE(OP_dup2): /* a b -> a b a b */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18051|      0|            sp[0] = JS_DupValue(ctx, sp[-2]);
18052|      0|            sp[1] = JS_DupValue(ctx, sp[-1]);
18053|      0|            sp += 2;
18054|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18055|      0|        CASE(OP_dup3): /* a b c -> a b c a b c */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18056|      0|            sp[0] = JS_DupValue(ctx, sp[-3]);
18057|      0|            sp[1] = JS_DupValue(ctx, sp[-2]);
18058|      0|            sp[2] = JS_DupValue(ctx, sp[-1]);
18059|      0|            sp += 3;
18060|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18061|      0|        CASE(OP_dup1): /* a b -> a a b */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18062|      0|            sp[0] = sp[-1];
18063|      0|            sp[-1] = JS_DupValue(ctx, sp[-2]);
18064|      0|            sp++;
18065|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18066|      0|        CASE(OP_insert2): /* obj a -> a obj a (dup_x1) */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18067|      0|            sp[0] = sp[-1];
18068|      0|            sp[-1] = sp[-2];
18069|      0|            sp[-2] = JS_DupValue(ctx, sp[0]);
18070|      0|            sp++;
18071|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18072|      0|        CASE(OP_insert3): /* obj prop a -> a obj prop a (dup_x2) */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18073|      0|            sp[0] = sp[-1];
18074|      0|            sp[-1] = sp[-2];
18075|      0|            sp[-2] = sp[-3];
18076|      0|            sp[-3] = JS_DupValue(ctx, sp[0]);
18077|      0|            sp++;
18078|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18079|      0|        CASE(OP_insert4): /* this obj prop a -> a this obj prop a */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18080|      0|            sp[0] = sp[-1];
18081|      0|            sp[-1] = sp[-2];
18082|      0|            sp[-2] = sp[-3];
18083|      0|            sp[-3] = sp[-4];
18084|      0|            sp[-4] = JS_DupValue(ctx, sp[0]);
18085|      0|            sp++;
18086|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18087|      0|        CASE(OP_perm3): /* obj a b -> a obj b (213) */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18088|      0|            {
18089|      0|                JSValue tmp;
18090|      0|                tmp = sp[-2];
18091|      0|                sp[-2] = sp[-3];
18092|      0|                sp[-3] = tmp;
18093|      0|            }
18094|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18095|      0|        CASE(OP_rot3l): /* x a b -> a b x (231) */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18096|      0|            {
18097|      0|                JSValue tmp;
18098|      0|                tmp = sp[-3];
18099|      0|                sp[-3] = sp[-2];
18100|      0|                sp[-2] = sp[-1];
18101|      0|                sp[-1] = tmp;
18102|      0|            }
18103|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18104|      0|        CASE(OP_rot4l): /* x a b c -> a b c x */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18105|      0|            {
18106|      0|                JSValue tmp;
18107|      0|                tmp = sp[-4];
18108|      0|                sp[-4] = sp[-3];
18109|      0|                sp[-3] = sp[-2];
18110|      0|                sp[-2] = sp[-1];
18111|      0|                sp[-1] = tmp;
18112|      0|            }
18113|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18114|      0|        CASE(OP_rot5l): /* x a b c d -> a b c d x */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18115|      0|            {
18116|      0|                JSValue tmp;
18117|      0|                tmp = sp[-5];
18118|      0|                sp[-5] = sp[-4];
18119|      0|                sp[-4] = sp[-3];
18120|      0|                sp[-3] = sp[-2];
18121|      0|                sp[-2] = sp[-1];
18122|      0|                sp[-1] = tmp;
18123|      0|            }
18124|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18125|      0|        CASE(OP_rot3r): /* a b x -> x a b (312) */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18126|      0|            {
18127|      0|                JSValue tmp;
18128|      0|                tmp = sp[-1];
18129|      0|                sp[-1] = sp[-2];
18130|      0|                sp[-2] = sp[-3];
18131|      0|                sp[-3] = tmp;
18132|      0|            }
18133|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18134|      0|        CASE(OP_perm4): /* obj prop a b -> a obj prop b */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18135|      0|            {
18136|      0|                JSValue tmp;
18137|      0|                tmp = sp[-2];
18138|      0|                sp[-2] = sp[-3];
18139|      0|                sp[-3] = sp[-4];
18140|      0|                sp[-4] = tmp;
18141|      0|            }
18142|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18143|      0|        CASE(OP_perm5): /* this obj prop a b -> a this obj prop b */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18144|      0|            {
18145|      0|                JSValue tmp;
18146|      0|                tmp = sp[-2];
18147|      0|                sp[-2] = sp[-3];
18148|      0|                sp[-3] = sp[-4];
18149|      0|                sp[-4] = sp[-5];
18150|      0|                sp[-5] = tmp;
18151|      0|            }
18152|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18153|      0|        CASE(OP_swap): /* a b -> b a */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18154|      0|            {
18155|      0|                JSValue tmp;
18156|      0|                tmp = sp[-2];
18157|      0|                sp[-2] = sp[-1];
18158|      0|                sp[-1] = tmp;
18159|      0|            }
18160|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18161|      0|        CASE(OP_swap2): /* a b c d -> c d a b */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18162|      0|            {
18163|      0|                JSValue tmp1, tmp2;
18164|      0|                tmp1 = sp[-4];
18165|      0|                tmp2 = sp[-3];
18166|      0|                sp[-4] = sp[-2];
18167|      0|                sp[-3] = sp[-1];
18168|      0|                sp[-2] = tmp1;
18169|      0|                sp[-1] = tmp2;
18170|      0|            }
18171|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18172|       |
18173|      0|        CASE(OP_fclosure):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18174|      0|            {
18175|      0|                JSValue bfunc = JS_DupValue(ctx, b->cpool[get_u32(pc)]);
18176|      0|                pc += 4;
18177|      0|                *sp++ = js_closure(ctx, bfunc, var_refs, sf, FALSE);
18178|      0|                if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18179|      0|                    goto exception;
18180|      0|            }
18181|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18182|      0|#if SHORT_OPCODES
18183|      0|        CASE(OP_call0):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18184|      4|        CASE(OP_call1):
  ------------------
  |  |17790|      4|#define CASE(op)        case_ ## op
  ------------------
18185|      4|        CASE(OP_call2):
  ------------------
  |  |17790|      4|#define CASE(op)        case_ ## op
  ------------------
18186|      4|        CASE(OP_call3):
  ------------------
  |  |17790|      4|#define CASE(op)        case_ ## op
  ------------------
18187|      4|            call_argc = opcode - OP_call0;
18188|      4|            goto has_call_argc;
18189|      0|#endif
18190|      0|        CASE(OP_call):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18191|      0|        CASE(OP_tail_call):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18192|      0|            {
18193|      0|                call_argc = get_u16(pc);
18194|      0|                pc += 2;
18195|      0|                goto has_call_argc;
18196|      4|            has_call_argc:
18197|      4|                call_argv = sp - call_argc;
18198|      4|                sf->cur_pc = pc;
18199|      4|                ret_val = JS_CallInternal(ctx, call_argv[-1], JS_UNDEFINED,
  ------------------
  |  |  289|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18200|      4|                                          JS_UNDEFINED, call_argc, call_argv, 0);
  ------------------
  |  |  289|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18201|      4|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      4|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1, False: 3]
  |  |  ------------------
  ------------------
18202|      1|                    goto exception;
18203|      3|                if (opcode == OP_tail_call)
  ------------------
  |  Branch (18203:21): [True: 0, False: 3]
  ------------------
18204|      0|                    goto done;
18205|      9|                for(i = -1; i < call_argc; i++)
  ------------------
  |  Branch (18205:29): [True: 6, False: 3]
  ------------------
18206|      6|                    JS_FreeValue(ctx, call_argv[i]);
18207|      3|                sp -= call_argc + 1;
18208|      3|                *sp++ = ret_val;
18209|      3|            }
18210|      3|            BREAK;
  ------------------
  |  |17792|      3|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      3|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18211|      3|        CASE(OP_call_constructor):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18212|      0|            {
18213|      0|                call_argc = get_u16(pc);
18214|      0|                pc += 2;
18215|      0|                call_argv = sp - call_argc;
18216|      0|                sf->cur_pc = pc;
18217|      0|                ret_val = JS_CallConstructorInternal(ctx, call_argv[-2],
18218|      0|                                                     call_argv[-1],
18219|      0|                                                     call_argc, call_argv, 0);
18220|      0|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18221|      0|                    goto exception;
18222|      0|                for(i = -2; i < call_argc; i++)
  ------------------
  |  Branch (18222:29): [True: 0, False: 0]
  ------------------
18223|      0|                    JS_FreeValue(ctx, call_argv[i]);
18224|      0|                sp -= call_argc + 2;
18225|      0|                *sp++ = ret_val;
18226|      0|            }
18227|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18228|      4|        CASE(OP_call_method):
  ------------------
  |  |17790|      4|#define CASE(op)        case_ ## op
  ------------------
18229|      4|        CASE(OP_tail_call_method):
  ------------------
  |  |17790|      4|#define CASE(op)        case_ ## op
  ------------------
18230|      4|            {
18231|      4|                call_argc = get_u16(pc);
18232|      4|                pc += 2;
18233|      4|                call_argv = sp - call_argc;
18234|      4|                sf->cur_pc = pc;
18235|      4|                ret_val = JS_CallInternal(ctx, call_argv[-1], call_argv[-2],
18236|      4|                                          JS_UNDEFINED, call_argc, call_argv, 0);
  ------------------
  |  |  289|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18237|      4|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      4|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1, False: 3]
  |  |  ------------------
  ------------------
18238|      1|                    goto exception;
18239|      3|                if (opcode == OP_tail_call_method)
  ------------------
  |  Branch (18239:21): [True: 0, False: 3]
  ------------------
18240|      0|                    goto done;
18241|     12|                for(i = -2; i < call_argc; i++)
  ------------------
  |  Branch (18241:29): [True: 9, False: 3]
  ------------------
18242|      9|                    JS_FreeValue(ctx, call_argv[i]);
18243|      3|                sp -= call_argc + 2;
18244|      3|                *sp++ = ret_val;
18245|      3|            }
18246|      3|            BREAK;
  ------------------
  |  |17792|      3|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      3|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18247|      3|        CASE(OP_array_from):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18248|      0|            call_argc = get_u16(pc);
18249|      0|            pc += 2;
18250|      0|            ret_val = js_create_array_free(ctx, call_argc, sp - call_argc);
18251|      0|            sp -= call_argc;
18252|      0|            if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18253|      0|                goto exception;
18254|      0|            *sp++ = ret_val;
18255|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18256|       |
18257|      0|        CASE(OP_apply):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18258|      0|            {
18259|      0|                int magic;
18260|      0|                magic = get_u16(pc);
18261|      0|                pc += 2;
18262|      0|                sf->cur_pc = pc;
18263|       |
18264|      0|                ret_val = js_function_apply(ctx, sp[-3], 2, (JSValueConst *)&sp[-2], magic);
18265|      0|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18266|      0|                    goto exception;
18267|      0|                JS_FreeValue(ctx, sp[-3]);
18268|      0|                JS_FreeValue(ctx, sp[-2]);
18269|      0|                JS_FreeValue(ctx, sp[-1]);
18270|      0|                sp -= 3;
18271|      0|                *sp++ = ret_val;
18272|      0|            }
18273|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18274|      3|        CASE(OP_return):
  ------------------
  |  |17790|      3|#define CASE(op)        case_ ## op
  ------------------
18275|      3|            ret_val = *--sp;
18276|      3|            goto done;
18277|     13|        CASE(OP_return_undef):
  ------------------
  |  |17790|     13|#define CASE(op)        case_ ## op
  ------------------
18278|     13|            ret_val = JS_UNDEFINED;
  ------------------
  |  |  289|     13|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     13|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18279|     13|            goto done;
18280|       |
18281|      0|        CASE(OP_check_ctor_return):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18282|       |            /* return TRUE if 'this' should be returned */
18283|      0|            if (!JS_IsObject(sp[-1])) {
  ------------------
  |  Branch (18283:17): [True: 0, False: 0]
  ------------------
18284|      0|                if (!JS_IsUndefined(sp[-1])) {
  ------------------
  |  Branch (18284:21): [True: 0, False: 0]
  ------------------
18285|      0|                    JS_ThrowTypeError(caller_ctx, "derived class constructor must return an object or undefined");
18286|      0|                    goto exception;
18287|      0|                }
18288|      0|                sp[0] = JS_TRUE;
  ------------------
  |  |  291|      0|#define JS_TRUE      JS_MKVAL(JS_TAG_BOOL, 1)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18289|      0|            } else {
18290|      0|                sp[0] = JS_FALSE;
  ------------------
  |  |  290|      0|#define JS_FALSE     JS_MKVAL(JS_TAG_BOOL, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18291|      0|            }
18292|      0|            sp++;
18293|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18294|      0|        CASE(OP_check_ctor):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18295|      0|            if (JS_IsUndefined(new_target)) {
  ------------------
  |  Branch (18295:17): [True: 0, False: 0]
  ------------------
18296|      0|            non_ctor_call:
18297|      0|                JS_ThrowTypeError(ctx, "class constructors must be invoked with 'new'");
18298|      0|                goto exception;
18299|      0|            }
18300|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18301|      0|        CASE(OP_init_ctor):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18302|      0|            {
18303|      0|                JSValue super, ret;
18304|      0|                sf->cur_pc = pc;
18305|      0|                if (JS_IsUndefined(new_target))
  ------------------
  |  Branch (18305:21): [True: 0, False: 0]
  ------------------
18306|      0|                    goto non_ctor_call;
18307|      0|                super = JS_GetPrototype(ctx, func_obj);
18308|      0|                if (JS_IsException(super))
  ------------------
  |  Branch (18308:21): [True: 0, False: 0]
  ------------------
18309|      0|                    goto exception;
18310|      0|                ret = JS_CallConstructor2(ctx, super, new_target, argc, (JSValueConst *)argv);
18311|      0|                JS_FreeValue(ctx, super);
18312|      0|                if (JS_IsException(ret))
  ------------------
  |  Branch (18312:21): [True: 0, False: 0]
  ------------------
18313|      0|                    goto exception;
18314|      0|                *sp++ = ret;
18315|      0|            }
18316|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18317|      0|        CASE(OP_check_brand):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18318|      0|            {
18319|      0|                int ret = JS_CheckBrand(ctx, sp[-2], sp[-1]);
18320|      0|                if (ret < 0)
  ------------------
  |  Branch (18320:21): [True: 0, False: 0]
  ------------------
18321|      0|                    goto exception;
18322|      0|                if (!ret) {
  ------------------
  |  Branch (18322:21): [True: 0, False: 0]
  ------------------
18323|      0|                    JS_ThrowTypeError(ctx, "invalid brand on object");
18324|      0|                    goto exception;
18325|      0|                }
18326|      0|            }
18327|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18328|      0|        CASE(OP_add_brand):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18329|      0|            if (JS_AddBrand(ctx, sp[-2], sp[-1]) < 0)
  ------------------
  |  Branch (18329:17): [True: 0, False: 0]
  ------------------
18330|      0|                goto exception;
18331|      0|            JS_FreeValue(ctx, sp[-2]);
18332|      0|            JS_FreeValue(ctx, sp[-1]);
18333|      0|            sp -= 2;
18334|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18335|       |
18336|      0|        CASE(OP_throw):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18337|      0|            JS_Throw(ctx, *--sp);
18338|      0|            goto exception;
18339|       |
18340|      0|        CASE(OP_throw_error):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18341|      0|#define JS_THROW_VAR_RO             0
18342|      0|#define JS_THROW_VAR_REDECL         1
18343|      0|#define JS_THROW_VAR_UNINITIALIZED  2
18344|      0|#define JS_THROW_ERROR_DELETE_SUPER   3
18345|      0|#define JS_THROW_ERROR_ITERATOR_THROW 4
18346|      0|            {
18347|      0|                JSAtom atom;
18348|      0|                int type;
18349|      0|                atom = get_u32(pc);
18350|      0|                type = pc[4];
18351|      0|                pc += 5;
18352|      0|                if (type == JS_THROW_VAR_RO)
  ------------------
  |  |18341|      0|#define JS_THROW_VAR_RO             0
  ------------------
  |  Branch (18352:21): [True: 0, False: 0]
  ------------------
18353|      0|                    JS_ThrowTypeErrorReadOnly(ctx, JS_PROP_THROW, atom);
  ------------------
  |  |  318|      0|#define JS_PROP_THROW            (1 << 14)
  ------------------
18354|      0|                else
18355|      0|                if (type == JS_THROW_VAR_REDECL)
  ------------------
  |  |18342|      0|#define JS_THROW_VAR_REDECL         1
  ------------------
  |  Branch (18355:21): [True: 0, False: 0]
  ------------------
18356|      0|                    JS_ThrowSyntaxErrorVarRedeclaration(ctx, atom);
18357|      0|                else
18358|      0|                if (type == JS_THROW_VAR_UNINITIALIZED)
  ------------------
  |  |18343|      0|#define JS_THROW_VAR_UNINITIALIZED  2
  ------------------
  |  Branch (18358:21): [True: 0, False: 0]
  ------------------
18359|      0|                    JS_ThrowReferenceErrorUninitialized(ctx, atom);
18360|      0|                else
18361|      0|                if (type == JS_THROW_ERROR_DELETE_SUPER)
  ------------------
  |  |18344|      0|#define JS_THROW_ERROR_DELETE_SUPER   3
  ------------------
  |  Branch (18361:21): [True: 0, False: 0]
  ------------------
18362|      0|                    JS_ThrowReferenceError(ctx, "unsupported reference to 'super'");
18363|      0|                else
18364|      0|                if (type == JS_THROW_ERROR_ITERATOR_THROW)
  ------------------
  |  |18345|      0|#define JS_THROW_ERROR_ITERATOR_THROW 4
  ------------------
  |  Branch (18364:21): [True: 0, False: 0]
  ------------------
18365|      0|                    JS_ThrowTypeError(ctx, "iterator does not have a throw method");
18366|      0|                else
18367|      0|                    JS_ThrowInternalError(ctx, "invalid throw var type %d", type);
18368|      0|            }
18369|      0|            goto exception;
18370|       |
18371|      0|        CASE(OP_eval):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18372|      0|            {
18373|      0|                JSValueConst obj;
  ------------------
  |  |  234|      0|#define JSValueConst JSValue
  ------------------
18374|      0|                int scope_idx;
18375|      0|                call_argc = get_u16(pc);
18376|      0|                scope_idx = get_u16(pc + 2) + ARG_SCOPE_END;
  ------------------
  |  |  628|      0|#define ARG_SCOPE_END (-2)
  ------------------
18377|      0|                pc += 4;
18378|      0|                call_argv = sp - call_argc;
18379|      0|                sf->cur_pc = pc;
18380|      0|                if (js_same_value(ctx, call_argv[-1], ctx->eval_obj)) {
  ------------------
  |  Branch (18380:21): [True: 0, False: 0]
  ------------------
18381|      0|                    if (call_argc >= 1)
  ------------------
  |  Branch (18381:25): [True: 0, False: 0]
  ------------------
18382|      0|                        obj = call_argv[0];
18383|      0|                    else
18384|      0|                        obj = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18385|      0|                    ret_val = JS_EvalObject(ctx, JS_UNDEFINED, obj,
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18386|      0|                                            JS_EVAL_TYPE_DIRECT, scope_idx);
  ------------------
  |  |  332|      0|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
18387|      0|                } else {
18388|      0|                    ret_val = JS_CallInternal(ctx, call_argv[-1], JS_UNDEFINED,
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18389|      0|                                              JS_UNDEFINED, call_argc, call_argv, 0);
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18390|      0|                }
18391|      0|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18392|      0|                    goto exception;
18393|      0|                for(i = -1; i < call_argc; i++)
  ------------------
  |  Branch (18393:29): [True: 0, False: 0]
  ------------------
18394|      0|                    JS_FreeValue(ctx, call_argv[i]);
18395|      0|                sp -= call_argc + 1;
18396|      0|                *sp++ = ret_val;
18397|      0|            }
18398|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18399|       |            /* could merge with OP_apply */
18400|      0|        CASE(OP_apply_eval):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18401|      0|            {
18402|      0|                int scope_idx;
18403|      0|                uint32_t len;
18404|      0|                JSValue *tab;
18405|      0|                JSValueConst obj;
  ------------------
  |  |  234|      0|#define JSValueConst JSValue
  ------------------
18406|       |
18407|      0|                scope_idx = get_u16(pc) + ARG_SCOPE_END;
  ------------------
  |  |  628|      0|#define ARG_SCOPE_END (-2)
  ------------------
18408|      0|                pc += 2;
18409|      0|                sf->cur_pc = pc;
18410|      0|                tab = build_arg_list(ctx, &len, sp[-1]);
18411|      0|                if (!tab)
  ------------------
  |  Branch (18411:21): [True: 0, False: 0]
  ------------------
18412|      0|                    goto exception;
18413|      0|                if (js_same_value(ctx, sp[-2], ctx->eval_obj)) {
  ------------------
  |  Branch (18413:21): [True: 0, False: 0]
  ------------------
18414|      0|                    if (len >= 1)
  ------------------
  |  Branch (18414:25): [True: 0, False: 0]
  ------------------
18415|      0|                        obj = tab[0];
18416|      0|                    else
18417|      0|                        obj = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18418|      0|                    ret_val = JS_EvalObject(ctx, JS_UNDEFINED, obj,
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18419|      0|                                            JS_EVAL_TYPE_DIRECT, scope_idx);
  ------------------
  |  |  332|      0|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
18420|      0|                } else {
18421|      0|                    ret_val = JS_Call(ctx, sp[-2], JS_UNDEFINED, len,
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18422|      0|                                      (JSValueConst *)tab);
18423|      0|                }
18424|      0|                free_arg_list(ctx, tab, len);
18425|      0|                if (unlikely(JS_IsException(ret_val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18426|      0|                    goto exception;
18427|      0|                JS_FreeValue(ctx, sp[-2]);
18428|      0|                JS_FreeValue(ctx, sp[-1]);
18429|      0|                sp -= 2;
18430|      0|                *sp++ = ret_val;
18431|      0|            }
18432|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18433|       |
18434|      2|        CASE(OP_regexp):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
18435|      2|            {
18436|      2|                sp[-2] = JS_NewRegexp(ctx, sp[-2], sp[-1]);
18437|      2|                sp--;
18438|      2|                if (JS_IsException(sp[-1]))
  ------------------
  |  Branch (18438:21): [True: 0, False: 2]
  ------------------
18439|      0|                    goto exception;
18440|      2|            }
18441|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18442|       |
18443|      2|        CASE(OP_get_super):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18444|      0|            {
18445|      0|                JSValue proto;
18446|      0|                sf->cur_pc = pc;
18447|      0|                proto = JS_GetPrototype(ctx, sp[-1]);
18448|      0|                if (JS_IsException(proto))
  ------------------
  |  Branch (18448:21): [True: 0, False: 0]
  ------------------
18449|      0|                    goto exception;
18450|      0|                JS_FreeValue(ctx, sp[-1]);
18451|      0|                sp[-1] = proto;
18452|      0|            }
18453|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18454|       |
18455|      0|        CASE(OP_import):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18456|      0|            {
18457|      0|                JSValue val;
18458|      0|                sf->cur_pc = pc;
18459|      0|                val = js_dynamic_import(ctx, sp[-2], sp[-1]);
18460|      0|                if (JS_IsException(val))
  ------------------
  |  Branch (18460:21): [True: 0, False: 0]
  ------------------
18461|      0|                    goto exception;
18462|      0|                JS_FreeValue(ctx, sp[-2]);
18463|      0|                JS_FreeValue(ctx, sp[-1]);
18464|      0|                sp--;
18465|      0|                sp[-1] = val;
18466|      0|            }
18467|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18468|       |
18469|      0|        CASE(OP_get_var_undef):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18470|     41|        CASE(OP_get_var):
  ------------------
  |  |17790|     41|#define CASE(op)        case_ ## op
  ------------------
18471|     41|            {
18472|     41|                int idx;
18473|     41|                JSValue val;
18474|     41|                idx = get_u16(pc);
18475|     41|                pc += 2;
18476|     41|                val = *var_refs[idx]->pvalue;
18477|     41|                if (unlikely(JS_IsUninitialized(val))) {
  ------------------
  |  |   33|     41|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 9, False: 32]
  |  |  ------------------
  ------------------
18478|      9|                    JSClosureVar *cv = &b->closure_var[idx];
18479|      9|                    if (cv->is_lexical) {
  ------------------
  |  Branch (18479:25): [True: 0, False: 9]
  ------------------
18480|      0|                        JS_ThrowReferenceErrorUninitialized(ctx, cv->var_name);
18481|      0|                        goto exception;
18482|      9|                    } else {
18483|      9|                        sf->cur_pc = pc;
18484|      9|                        sp[0] = JS_GetPropertyInternal(ctx, ctx->global_obj,
18485|      9|                                                       cv->var_name,
18486|      9|                                                       ctx->global_obj,
18487|      9|                                                       opcode - OP_get_var_undef);
18488|      9|                        if (JS_IsException(sp[0]))
  ------------------
  |  Branch (18488:29): [True: 9, False: 0]
  ------------------
18489|      9|                            goto exception;
18490|      9|                    }
18491|     32|                } else {
18492|     32|                    sp[0] = JS_DupValue(ctx, val);
18493|     32|                }
18494|     32|                sp++;
18495|     32|            }
18496|     32|            BREAK;
  ------------------
  |  |17792|     32|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|     32|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18497|       |
18498|     32|        CASE(OP_put_var):
  ------------------
  |  |17790|      4|#define CASE(op)        case_ ## op
  ------------------
18499|      4|        CASE(OP_put_var_init):
  ------------------
  |  |17790|      4|#define CASE(op)        case_ ## op
  ------------------
18500|      4|            {
18501|      4|                int idx, ret;
18502|      4|                JSVarRef *var_ref;
18503|      4|                idx = get_u16(pc);
18504|      4|                pc += 2;
18505|      4|                var_ref = var_refs[idx];
18506|      4|                if (unlikely(JS_IsUninitialized(*var_ref->pvalue) ||
  ------------------
  |  |   33|      6|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 2]
  |  |  |  Branch (33:45): [True: 2, False: 2]
  |  |  |  Branch (33:45): [True: 0, False: 2]
  |  |  ------------------
  ------------------
18507|      4|                             var_ref->is_const)) {
18508|      2|                    JSClosureVar *cv = &b->closure_var[idx];
18509|      2|                    if (var_ref->is_lexical) {
  ------------------
  |  Branch (18509:25): [True: 0, False: 2]
  ------------------
18510|      0|                        if (opcode == OP_put_var_init)
  ------------------
  |  Branch (18510:29): [True: 0, False: 0]
  ------------------
18511|      0|                            goto put_var_ok;
18512|      0|                        if (JS_IsUninitialized(*var_ref->pvalue))
  ------------------
  |  Branch (18512:29): [True: 0, False: 0]
  ------------------
18513|      0|                            JS_ThrowReferenceErrorUninitialized(ctx, cv->var_name);
18514|      0|                        else
18515|      0|                            JS_ThrowTypeErrorReadOnly(ctx, JS_PROP_THROW, cv->var_name);
  ------------------
  |  |  318|      0|#define JS_PROP_THROW            (1 << 14)
  ------------------
18516|      0|                        goto exception;
18517|      2|                    } else {
18518|      2|                        sf->cur_pc = pc;
18519|      2|                        ret = JS_HasProperty(ctx, ctx->global_obj, cv->var_name);
18520|      2|                        if (ret < 0)
  ------------------
  |  Branch (18520:29): [True: 0, False: 2]
  ------------------
18521|      0|                            goto exception;
18522|      2|                        if (ret == 0 && is_strict_mode(ctx)) {
  ------------------
  |  Branch (18522:29): [True: 2, False: 0]
  |  Branch (18522:41): [True: 0, False: 2]
  ------------------
18523|      0|                            JS_ThrowReferenceErrorNotDefined(ctx, cv->var_name);
18524|      0|                            goto exception;
18525|      0|                        }
18526|      2|                        ret = JS_SetPropertyInternal(ctx, ctx->global_obj, cv->var_name, sp[-1],
18527|      2|                                                     ctx->global_obj, JS_PROP_THROW_STRICT);
  ------------------
  |  |  321|      2|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
18528|      2|                        sp--;
18529|      2|                        if (ret < 0)
  ------------------
  |  Branch (18529:29): [True: 0, False: 2]
  ------------------
18530|      0|                            goto exception;
18531|      2|                    }
18532|      2|                } else {
18533|      2|                put_var_ok:
18534|      2|                   set_value(ctx, var_ref->pvalue, sp[-1]);
18535|      2|                   sp--;
18536|      2|                }
18537|      4|            }
18538|      4|            BREAK;
  ------------------
  |  |17792|      4|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      4|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18539|      4|        CASE(OP_get_loc):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18540|      0|            {
18541|      0|                int idx;
18542|      0|                idx = get_u16(pc);
18543|      0|                pc += 2;
18544|      0|                sp[0] = JS_DupValue(ctx, var_buf[idx]);
18545|      0|                sp++;
18546|      0|            }
18547|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18548|      0|        CASE(OP_put_loc):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18549|      0|            {
18550|      0|                int idx;
18551|      0|                idx = get_u16(pc);
18552|      0|                pc += 2;
18553|      0|                set_value(ctx, &var_buf[idx], sp[-1]);
18554|      0|                sp--;
18555|      0|            }
18556|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18557|      0|        CASE(OP_set_loc):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18558|      0|            {
18559|      0|                int idx;
18560|      0|                idx = get_u16(pc);
18561|      0|                pc += 2;
18562|      0|                set_value(ctx, &var_buf[idx], JS_DupValue(ctx, sp[-1]));
18563|      0|            }
18564|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18565|      0|        CASE(OP_get_arg):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18566|      0|            {
18567|      0|                int idx;
18568|      0|                idx = get_u16(pc);
18569|      0|                pc += 2;
18570|      0|                sp[0] = JS_DupValue(ctx, arg_buf[idx]);
18571|      0|                sp++;
18572|      0|            }
18573|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18574|      0|        CASE(OP_put_arg):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18575|      0|            {
18576|      0|                int idx;
18577|      0|                idx = get_u16(pc);
18578|      0|                pc += 2;
18579|      0|                set_value(ctx, &arg_buf[idx], sp[-1]);
18580|      0|                sp--;
18581|      0|            }
18582|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18583|      0|        CASE(OP_set_arg):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18584|      0|            {
18585|      0|                int idx;
18586|      0|                idx = get_u16(pc);
18587|      0|                pc += 2;
18588|      0|                set_value(ctx, &arg_buf[idx], JS_DupValue(ctx, sp[-1]));
18589|      0|            }
18590|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18591|       |
18592|      0|#if SHORT_OPCODES
18593|      0|        CASE(OP_get_loc8): *sp++ = JS_DupValue(ctx, var_buf[*pc++]); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc8): *sp++ = JS_DupValue(ctx, var_buf[*pc++]); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18594|      0|        CASE(OP_put_loc8): set_value(ctx, &var_buf[*pc++], *--sp); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc8): set_value(ctx, &var_buf[*pc++], *--sp); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18595|      0|        CASE(OP_set_loc8): set_value(ctx, &var_buf[*pc++], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc8): set_value(ctx, &var_buf[*pc++], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18596|       |
18597|      0|        CASE(OP_get_loc0): *sp++ = JS_DupValue(ctx, var_buf[0]); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc0): *sp++ = JS_DupValue(ctx, var_buf[0]); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18598|      0|        CASE(OP_get_loc1): *sp++ = JS_DupValue(ctx, var_buf[1]); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc1): *sp++ = JS_DupValue(ctx, var_buf[1]); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18599|      0|        CASE(OP_get_loc2): *sp++ = JS_DupValue(ctx, var_buf[2]); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc2): *sp++ = JS_DupValue(ctx, var_buf[2]); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18600|      0|        CASE(OP_get_loc3): *sp++ = JS_DupValue(ctx, var_buf[3]); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_loc3): *sp++ = JS_DupValue(ctx, var_buf[3]); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18601|      9|        CASE(OP_put_loc0): set_value(ctx, &var_buf[0], *--sp); BREAK;
  ------------------
  |  |17790|      9|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc0): set_value(ctx, &var_buf[0], *--sp); BREAK;
  ------------------
  |  |17792|      9|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      9|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18602|      9|        CASE(OP_put_loc1): set_value(ctx, &var_buf[1], *--sp); BREAK;
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc1): set_value(ctx, &var_buf[1], *--sp); BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18603|      2|        CASE(OP_put_loc2): set_value(ctx, &var_buf[2], *--sp); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc2): set_value(ctx, &var_buf[2], *--sp); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18604|      0|        CASE(OP_put_loc3): set_value(ctx, &var_buf[3], *--sp); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_loc3): set_value(ctx, &var_buf[3], *--sp); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18605|      2|        CASE(OP_set_loc0): set_value(ctx, &var_buf[0], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc0): set_value(ctx, &var_buf[0], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18606|      2|        CASE(OP_set_loc1): set_value(ctx, &var_buf[1], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc1): set_value(ctx, &var_buf[1], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18607|      3|        CASE(OP_set_loc2): set_value(ctx, &var_buf[2], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17790|      3|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc2): set_value(ctx, &var_buf[2], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17792|      3|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      3|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18608|      3|        CASE(OP_set_loc3): set_value(ctx, &var_buf[3], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_loc3): set_value(ctx, &var_buf[3], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18609|      2|        CASE(OP_get_arg0): *sp++ = JS_DupValue(ctx, arg_buf[0]); BREAK;
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_arg0): *sp++ = JS_DupValue(ctx, arg_buf[0]); BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18610|      2|        CASE(OP_get_arg1): *sp++ = JS_DupValue(ctx, arg_buf[1]); BREAK;
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_arg1): *sp++ = JS_DupValue(ctx, arg_buf[1]); BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18611|      2|        CASE(OP_get_arg2): *sp++ = JS_DupValue(ctx, arg_buf[2]); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_arg2): *sp++ = JS_DupValue(ctx, arg_buf[2]); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18612|      0|        CASE(OP_get_arg3): *sp++ = JS_DupValue(ctx, arg_buf[3]); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_arg3): *sp++ = JS_DupValue(ctx, arg_buf[3]); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18613|      0|        CASE(OP_put_arg0): set_value(ctx, &arg_buf[0], *--sp); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_arg0): set_value(ctx, &arg_buf[0], *--sp); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18614|      0|        CASE(OP_put_arg1): set_value(ctx, &arg_buf[1], *--sp); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_arg1): set_value(ctx, &arg_buf[1], *--sp); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18615|      0|        CASE(OP_put_arg2): set_value(ctx, &arg_buf[2], *--sp); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_arg2): set_value(ctx, &arg_buf[2], *--sp); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18616|      0|        CASE(OP_put_arg3): set_value(ctx, &arg_buf[3], *--sp); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_arg3): set_value(ctx, &arg_buf[3], *--sp); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18617|      0|        CASE(OP_set_arg0): set_value(ctx, &arg_buf[0], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_arg0): set_value(ctx, &arg_buf[0], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18618|      3|        CASE(OP_set_arg1): set_value(ctx, &arg_buf[1], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17790|      3|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_arg1): set_value(ctx, &arg_buf[1], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17792|      3|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      3|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18619|      3|        CASE(OP_set_arg2): set_value(ctx, &arg_buf[2], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_arg2): set_value(ctx, &arg_buf[2], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18620|      0|        CASE(OP_set_arg3): set_value(ctx, &arg_buf[3], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_arg3): set_value(ctx, &arg_buf[3], JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18621|      0|        CASE(OP_get_var_ref0): *sp++ = JS_DupValue(ctx, *var_refs[0]->pvalue); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_var_ref0): *sp++ = JS_DupValue(ctx, *var_refs[0]->pvalue); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18622|      0|        CASE(OP_get_var_ref1): *sp++ = JS_DupValue(ctx, *var_refs[1]->pvalue); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_var_ref1): *sp++ = JS_DupValue(ctx, *var_refs[1]->pvalue); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18623|      0|        CASE(OP_get_var_ref2): *sp++ = JS_DupValue(ctx, *var_refs[2]->pvalue); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_var_ref2): *sp++ = JS_DupValue(ctx, *var_refs[2]->pvalue); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18624|      0|        CASE(OP_get_var_ref3): *sp++ = JS_DupValue(ctx, *var_refs[3]->pvalue); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_get_var_ref3): *sp++ = JS_DupValue(ctx, *var_refs[3]->pvalue); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18625|      0|        CASE(OP_put_var_ref0): set_value(ctx, var_refs[0]->pvalue, *--sp); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_var_ref0): set_value(ctx, var_refs[0]->pvalue, *--sp); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18626|      0|        CASE(OP_put_var_ref1): set_value(ctx, var_refs[1]->pvalue, *--sp); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_var_ref1): set_value(ctx, var_refs[1]->pvalue, *--sp); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18627|      0|        CASE(OP_put_var_ref2): set_value(ctx, var_refs[2]->pvalue, *--sp); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_var_ref2): set_value(ctx, var_refs[2]->pvalue, *--sp); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18628|      0|        CASE(OP_put_var_ref3): set_value(ctx, var_refs[3]->pvalue, *--sp); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_put_var_ref3): set_value(ctx, var_refs[3]->pvalue, *--sp); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18629|      0|        CASE(OP_set_var_ref0): set_value(ctx, var_refs[0]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_var_ref0): set_value(ctx, var_refs[0]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18630|      0|        CASE(OP_set_var_ref1): set_value(ctx, var_refs[1]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_var_ref1): set_value(ctx, var_refs[1]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18631|      0|        CASE(OP_set_var_ref2): set_value(ctx, var_refs[2]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_var_ref2): set_value(ctx, var_refs[2]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18632|      0|        CASE(OP_set_var_ref3): set_value(ctx, var_refs[3]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
                      CASE(OP_set_var_ref3): set_value(ctx, var_refs[3]->pvalue, JS_DupValue(ctx, sp[-1])); BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18633|      0|#endif
18634|       |
18635|      0|        CASE(OP_get_var_ref):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18636|      0|            {
18637|      0|                int idx;
18638|      0|                JSValue val;
18639|      0|                idx = get_u16(pc);
18640|      0|                pc += 2;
18641|      0|                val = *var_refs[idx]->pvalue;
18642|      0|                sp[0] = JS_DupValue(ctx, val);
18643|      0|                sp++;
18644|      0|            }
18645|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18646|      0|        CASE(OP_put_var_ref):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18647|      0|            {
18648|      0|                int idx;
18649|      0|                idx = get_u16(pc);
18650|      0|                pc += 2;
18651|      0|                set_value(ctx, var_refs[idx]->pvalue, sp[-1]);
18652|      0|                sp--;
18653|      0|            }
18654|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18655|      0|        CASE(OP_set_var_ref):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18656|      0|            {
18657|      0|                int idx;
18658|      0|                idx = get_u16(pc);
18659|      0|                pc += 2;
18660|      0|                set_value(ctx, var_refs[idx]->pvalue, JS_DupValue(ctx, sp[-1]));
18661|      0|            }
18662|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18663|     26|        CASE(OP_get_var_ref_check):
  ------------------
  |  |17790|     26|#define CASE(op)        case_ ## op
  ------------------
18664|     26|            {
18665|     26|                int idx;
18666|     26|                JSValue val;
18667|     26|                idx = get_u16(pc);
18668|     26|                pc += 2;
18669|     26|                val = *var_refs[idx]->pvalue;
18670|     26|                if (unlikely(JS_IsUninitialized(val))) {
  ------------------
  |  |   33|     26|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 26]
  |  |  ------------------
  ------------------
18671|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, TRUE);
18672|      0|                    goto exception;
18673|      0|                }
18674|     26|                sp[0] = JS_DupValue(ctx, val);
18675|     26|                sp++;
18676|     26|            }
18677|     26|            BREAK;
  ------------------
  |  |17792|     26|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|     26|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18678|     26|        CASE(OP_put_var_ref_check):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18679|      0|            {
18680|      0|                int idx;
18681|      0|                idx = get_u16(pc);
18682|      0|                pc += 2;
18683|      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]
  |  |  ------------------
  ------------------
18684|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, TRUE);
18685|      0|                    goto exception;
18686|      0|                }
18687|      0|                set_value(ctx, var_refs[idx]->pvalue, sp[-1]);
18688|      0|                sp--;
18689|      0|            }
18690|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18691|      0|        CASE(OP_put_var_ref_check_init):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18692|      0|            {
18693|      0|                int idx;
18694|      0|                idx = get_u16(pc);
18695|      0|                pc += 2;
18696|      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]
  |  |  ------------------
  ------------------
18697|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, TRUE);
18698|      0|                    goto exception;
18699|      0|                }
18700|      0|                set_value(ctx, var_refs[idx]->pvalue, sp[-1]);
18701|      0|                sp--;
18702|      0|            }
18703|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18704|      6|        CASE(OP_set_loc_uninitialized):
  ------------------
  |  |17790|      6|#define CASE(op)        case_ ## op
  ------------------
18705|      6|            {
18706|      6|                int idx;
18707|      6|                idx = get_u16(pc);
18708|      6|                pc += 2;
18709|      6|                set_value(ctx, &var_buf[idx], JS_UNINITIALIZED);
  ------------------
  |  |  293|      6|#define JS_UNINITIALIZED JS_MKVAL(JS_TAG_UNINITIALIZED, 0)
  |  |  ------------------
  |  |  |  |  245|      6|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18710|      6|            }
18711|      6|            BREAK;
  ------------------
  |  |17792|      6|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      6|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18712|      6|        CASE(OP_get_loc_check):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
18713|      2|            {
18714|      2|                int idx;
18715|      2|                idx = get_u16(pc);
18716|      2|                pc += 2;
18717|      2|                if (unlikely(JS_IsUninitialized(var_buf[idx]))) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
18718|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, FALSE);
18719|      0|                    goto exception;
18720|      0|                }
18721|      2|                sp[0] = JS_DupValue(ctx, var_buf[idx]);
18722|      2|                sp++;
18723|      2|            }
18724|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18725|      2|        CASE(OP_get_loc_checkthis):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18726|      0|            {
18727|      0|                int idx;
18728|      0|                idx = get_u16(pc);
18729|      0|                pc += 2;
18730|      0|                if (unlikely(JS_IsUninitialized(var_buf[idx]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18731|      0|                    JS_ThrowReferenceErrorUninitialized2(caller_ctx, b, idx, FALSE);
18732|      0|                    goto exception;
18733|      0|                }
18734|      0|                sp[0] = JS_DupValue(ctx, var_buf[idx]);
18735|      0|                sp++;
18736|      0|            }
18737|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18738|      0|        CASE(OP_put_loc_check):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18739|      0|            {
18740|      0|                int idx;
18741|      0|                idx = get_u16(pc);
18742|      0|                pc += 2;
18743|      0|                if (unlikely(JS_IsUninitialized(var_buf[idx]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18744|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, FALSE);
18745|      0|                    goto exception;
18746|      0|                }
18747|      0|                set_value(ctx, &var_buf[idx], sp[-1]);
18748|      0|                sp--;
18749|      0|            }
18750|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18751|      0|        CASE(OP_set_loc_check):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18752|      0|            {
18753|      0|                int idx;
18754|      0|                idx = get_u16(pc);
18755|      0|                pc += 2;
18756|      0|                if (unlikely(JS_IsUninitialized(var_buf[idx]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18757|      0|                    JS_ThrowReferenceErrorUninitialized2(ctx, b, idx, FALSE);
18758|      0|                    goto exception;
18759|      0|                }
18760|      0|                set_value(ctx, &var_buf[idx], JS_DupValue(ctx, sp[-1]));
18761|      0|            }
18762|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18763|      0|        CASE(OP_put_loc_check_init):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18764|      0|            {
18765|      0|                int idx;
18766|      0|                idx = get_u16(pc);
18767|      0|                pc += 2;
18768|      0|                if (unlikely(!JS_IsUninitialized(var_buf[idx]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18769|      0|                    JS_ThrowReferenceError(ctx, "'this' can be initialized only once");
18770|      0|                    goto exception;
18771|      0|                }
18772|      0|                set_value(ctx, &var_buf[idx], sp[-1]);
18773|      0|                sp--;
18774|      0|            }
18775|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18776|      0|        CASE(OP_close_loc):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18777|      0|            {
18778|      0|                int idx;
18779|      0|                idx = get_u16(pc);
18780|      0|                pc += 2;
18781|      0|                close_lexical_var(ctx, b, sf, idx);
18782|      0|            }
18783|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18784|       |
18785|      0|        CASE(OP_make_loc_ref):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18786|      0|        CASE(OP_make_arg_ref):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18787|      0|        CASE(OP_make_var_ref_ref):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18788|      0|            {
18789|      0|                JSVarRef *var_ref;
18790|      0|                JSProperty *pr;
18791|      0|                JSAtom atom;
18792|      0|                int idx;
18793|      0|                atom = get_u32(pc);
18794|      0|                idx = get_u16(pc + 4);
18795|      0|                pc += 6;
18796|      0|                *sp++ = JS_NewObjectProto(ctx, JS_NULL);
  ------------------
  |  |  288|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
18797|      0|                if (unlikely(JS_IsException(sp[-1])))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18798|      0|                    goto exception;
18799|      0|                if (opcode == OP_make_var_ref_ref) {
  ------------------
  |  Branch (18799:21): [True: 0, False: 0]
  ------------------
18800|      0|                    var_ref = var_refs[idx];
18801|      0|                    js_rc(var_ref)->ref_count++;
18802|      0|                } else {
18803|      0|                    var_ref = get_var_ref(ctx, sf, idx, opcode == OP_make_arg_ref);
18804|      0|                    if (!var_ref)
  ------------------
  |  Branch (18804:25): [True: 0, False: 0]
  ------------------
18805|      0|                        goto exception;
18806|      0|                }
18807|      0|                pr = add_property(ctx, JS_VALUE_GET_OBJ(sp[-1]), atom,
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
18808|      0|                                  JS_PROP_WRITABLE | JS_PROP_VARREF);
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                JS_PROP_WRITABLE | JS_PROP_VARREF);
  ------------------
  |  |  304|      0|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
18809|      0|                if (!pr) {
  ------------------
  |  Branch (18809:21): [True: 0, False: 0]
  ------------------
18810|      0|                    free_var_ref(rt, var_ref);
18811|      0|                    goto exception;
18812|      0|                }
18813|      0|                pr->u.var_ref = var_ref;
18814|      0|                *sp++ = JS_AtomToValue(ctx, atom);
18815|      0|            }
18816|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18817|      0|        CASE(OP_make_var_ref):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18818|      0|            {
18819|      0|                JSAtom atom;
18820|      0|                atom = get_u32(pc);
18821|      0|                pc += 4;
18822|      0|                sf->cur_pc = pc;
18823|       |
18824|      0|                if (JS_GetGlobalVarRef(ctx, atom, sp))
  ------------------
  |  Branch (18824:21): [True: 0, False: 0]
  ------------------
18825|      0|                    goto exception;
18826|      0|                sp += 2;
18827|      0|            }
18828|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18829|       |
18830|      0|        CASE(OP_goto):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18831|      0|            pc += (int32_t)get_u32(pc);
18832|      0|            if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18833|      0|                goto exception;
18834|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18835|      0|#if SHORT_OPCODES
18836|      0|        CASE(OP_goto16):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18837|      0|            pc += (int16_t)get_u16(pc);
18838|      0|            if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18839|      0|                goto exception;
18840|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18841|      5|        CASE(OP_goto8):
  ------------------
  |  |17790|      5|#define CASE(op)        case_ ## op
  ------------------
18842|      5|            pc += (int8_t)pc[0];
18843|      5|            if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      5|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 5]
  |  |  ------------------
  ------------------
18844|      0|                goto exception;
18845|      5|            BREAK;
  ------------------
  |  |17792|      5|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      5|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18846|      5|#endif
18847|      5|        CASE(OP_if_true):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18848|      0|            {
18849|      0|                int res;
18850|      0|                JSValue op1;
18851|       |
18852|      0|                op1 = sp[-1];
18853|      0|                pc += 4;
18854|      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 (18854:21): [True: 0, False: 0]
  ------------------
18855|      0|                    res = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
18856|      0|                } else {
18857|      0|                    res = JS_ToBoolFree(ctx, op1);
18858|      0|                }
18859|      0|                sp--;
18860|      0|                if (res) {
  ------------------
  |  Branch (18860:21): [True: 0, False: 0]
  ------------------
18861|      0|                    pc += (int32_t)get_u32(pc - 4) - 4;
18862|      0|                }
18863|      0|                if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18864|      0|                    goto exception;
18865|      0|            }
18866|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18867|      0|        CASE(OP_if_false):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18868|      0|            {
18869|      0|                int res;
18870|      0|                JSValue op1;
18871|       |
18872|      0|                op1 = sp[-1];
18873|      0|                pc += 4;
18874|       |                /* quick and dirty test for JS_TAG_INT, JS_TAG_BOOL, JS_TAG_NULL and JS_TAG_UNDEFINED */
18875|      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 (18875:21): [True: 0, False: 0]
  ------------------
18876|      0|                    res = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
18877|      0|                } else {
18878|      0|                    res = JS_ToBoolFree(ctx, op1);
18879|      0|                }
18880|      0|                sp--;
18881|      0|                if (!res) {
  ------------------
  |  Branch (18881:21): [True: 0, False: 0]
  ------------------
18882|      0|                    pc += (int32_t)get_u32(pc - 4) - 4;
18883|      0|                }
18884|      0|                if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18885|      0|                    goto exception;
18886|      0|            }
18887|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18888|      0|#if SHORT_OPCODES
18889|      2|        CASE(OP_if_true8):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
18890|      2|            {
18891|      2|                int res;
18892|      2|                JSValue op1;
18893|       |
18894|      2|                op1 = sp[-1];
18895|      2|                pc += 1;
18896|      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 (18896:21): [True: 2, False: 0]
  ------------------
18897|      2|                    res = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      2|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
18898|      2|                } else {
18899|      0|                    res = JS_ToBoolFree(ctx, op1);
18900|      0|                }
18901|      2|                sp--;
18902|      2|                if (res) {
  ------------------
  |  Branch (18902:21): [True: 0, False: 2]
  ------------------
18903|      0|                    pc += (int8_t)pc[-1] - 1;
18904|      0|                }
18905|      2|                if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
18906|      0|                    goto exception;
18907|      2|            }
18908|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18909|     30|        CASE(OP_if_false8):
  ------------------
  |  |17790|     30|#define CASE(op)        case_ ## op
  ------------------
18910|     30|            {
18911|     30|                int res;
18912|     30|                JSValue op1;
18913|       |
18914|     30|                op1 = sp[-1];
18915|     30|                pc += 1;
18916|     30|                if ((uint32_t)JS_VALUE_GET_TAG(op1) <= JS_TAG_UNDEFINED) {
  ------------------
  |  |  236|     30|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (18916:21): [True: 30, False: 0]
  ------------------
18917|     30|                    res = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|     30|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
18918|     30|                } else {
18919|      0|                    res = JS_ToBoolFree(ctx, op1);
18920|      0|                }
18921|     30|                sp--;
18922|     30|                if (!res) {
  ------------------
  |  Branch (18922:21): [True: 15, False: 15]
  ------------------
18923|     15|                    pc += (int8_t)pc[-1] - 1;
18924|     15|                }
18925|     30|                if (unlikely(js_poll_interrupts(ctx)))
  ------------------
  |  |   33|     30|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 30]
  |  |  ------------------
  ------------------
18926|      0|                    goto exception;
18927|     30|            }
18928|     30|            BREAK;
  ------------------
  |  |17792|     30|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|     30|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18929|     30|#endif
18930|     30|        CASE(OP_catch):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18931|      0|            {
18932|      0|                int32_t diff;
18933|      0|                diff = get_u32(pc);
18934|      0|                sp[0] = JS_NewCatchOffset(ctx, pc + diff - b->byte_code_buf);
18935|      0|                sp++;
18936|      0|                pc += 4;
18937|      0|            }
18938|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18939|      0|        CASE(OP_gosub):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18940|      0|            {
18941|      0|                int32_t diff;
18942|      0|                diff = get_u32(pc);
18943|       |                /* XXX: should have a different tag to avoid security flaw */
18944|      0|                sp[0] = JS_NewInt32(ctx, pc + 4 - b->byte_code_buf);
18945|      0|                sp++;
18946|      0|                pc += diff;
18947|      0|            }
18948|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18949|      0|        CASE(OP_ret):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18950|      0|            {
18951|      0|                JSValue op1;
18952|      0|                uint32_t pos;
18953|      0|                op1 = sp[-1];
18954|      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]
  |  |  ------------------
  ------------------
18955|      0|                    goto ret_fail;
18956|      0|                pos = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
18957|      0|                if (unlikely(pos >= b->byte_code_len)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18958|      0|                ret_fail:
18959|      0|                    JS_ThrowInternalError(ctx, "invalid ret value");
18960|      0|                    goto exception;
18961|      0|                }
18962|      0|                sp--;
18963|      0|                pc = b->byte_code_buf + pos;
18964|      0|            }
18965|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18966|       |
18967|      2|        CASE(OP_for_in_start):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
18968|      2|            sf->cur_pc = pc;
18969|      2|            if (js_for_in_start(ctx, sp))
  ------------------
  |  Branch (18969:17): [True: 0, False: 2]
  ------------------
18970|      0|                goto exception;
18971|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18972|      2|        CASE(OP_for_in_next):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
18973|      2|            sf->cur_pc = pc;
18974|      2|            if (js_for_in_next(ctx, sp))
  ------------------
  |  Branch (18974:17): [True: 0, False: 2]
  ------------------
18975|      0|                goto exception;
18976|      2|            sp += 2;
18977|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18978|      2|        CASE(OP_for_of_start):
  ------------------
  |  |17790|      1|#define CASE(op)        case_ ## op
  ------------------
18979|      1|            sf->cur_pc = pc;
18980|      1|            if (js_for_of_start(ctx, sp, FALSE))
  ------------------
  |  Branch (18980:17): [True: 0, False: 1]
  ------------------
18981|      0|                goto exception;
18982|      1|            sp += 1;
18983|      1|            *sp++ = JS_NewCatchOffset(ctx, 0);
18984|      1|            BREAK;
  ------------------
  |  |17792|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18985|      2|        CASE(OP_for_of_next):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
18986|      2|            {
18987|      2|                int offset = -3 - pc[0];
18988|      2|                pc += 1;
18989|      2|                sf->cur_pc = pc;
18990|      2|                if (js_for_of_next(ctx, sp, offset))
  ------------------
  |  Branch (18990:21): [True: 0, False: 2]
  ------------------
18991|      0|                    goto exception;
18992|      2|                sp += 2;
18993|      2|            }
18994|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
18995|      2|        CASE(OP_for_await_of_next):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
18996|      0|            sf->cur_pc = pc;
18997|      0|            if (js_for_await_of_next(ctx, sp))
  ------------------
  |  Branch (18997:17): [True: 0, False: 0]
  ------------------
18998|      0|                goto exception;
18999|      0|            sp++;
19000|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19001|      0|        CASE(OP_for_await_of_start):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19002|      0|            sf->cur_pc = pc;
19003|      0|            if (js_for_of_start(ctx, sp, TRUE))
  ------------------
  |  Branch (19003:17): [True: 0, False: 0]
  ------------------
19004|      0|                goto exception;
19005|      0|            sp += 1;
19006|      0|            *sp++ = JS_NewCatchOffset(ctx, 0);
19007|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19008|      0|        CASE(OP_iterator_get_value_done):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19009|      0|            sf->cur_pc = pc;
19010|      0|            if (js_iterator_get_value_done(ctx, sp))
  ------------------
  |  Branch (19010:17): [True: 0, False: 0]
  ------------------
19011|      0|                goto exception;
19012|      0|            sp += 1;
19013|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19014|      0|        CASE(OP_iterator_check_object):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19015|      0|            if (unlikely(!JS_IsObject(sp[-1]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19016|      0|                JS_ThrowTypeError(ctx, "iterator must return an object");
19017|      0|                goto exception;
19018|      0|            }
19019|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19020|       |
19021|      0|        CASE(OP_iterator_close):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19022|       |            /* iter_obj next catch_offset -> */
19023|      0|            sp--; /* drop the catch offset to avoid getting caught by exception */
19024|      0|            JS_FreeValue(ctx, sp[-1]); /* drop the next method */
19025|      0|            sp--;
19026|      0|            if (!JS_IsUndefined(sp[-1])) {
  ------------------
  |  Branch (19026:17): [True: 0, False: 0]
  ------------------
19027|      0|                sf->cur_pc = pc;
19028|      0|                if (JS_IteratorClose(ctx, sp[-1], FALSE))
  ------------------
  |  Branch (19028:21): [True: 0, False: 0]
  ------------------
19029|      0|                    goto exception;
19030|      0|                JS_FreeValue(ctx, sp[-1]);
19031|      0|            }
19032|      0|            sp--;
19033|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19034|      0|        CASE(OP_nip_catch):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19035|      0|            {
19036|      0|                JSValue ret_val;
19037|       |                /* catch_offset ... ret_val -> ret_eval */
19038|      0|                ret_val = *--sp;
19039|      0|                while (sp > stack_buf &&
  ------------------
  |  Branch (19039:24): [True: 0, False: 0]
  ------------------
19040|      0|                       JS_VALUE_GET_TAG(sp[-1]) != JS_TAG_CATCH_OFFSET) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19040:24): [True: 0, False: 0]
  ------------------
19041|      0|                    JS_FreeValue(ctx, *--sp);
19042|      0|                }
19043|      0|                if (unlikely(sp == stack_buf)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19044|      0|                    JS_ThrowInternalError(ctx, "nip_catch");
19045|      0|                    JS_FreeValue(ctx, ret_val);
19046|      0|                    goto exception;
19047|      0|                }
19048|      0|                sp[-1] = ret_val;
19049|      0|            }
19050|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19051|       |
19052|      0|        CASE(OP_iterator_next):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19053|       |            /* stack: iter_obj next catch_offset val */
19054|      0|            {
19055|      0|                JSValue ret;
19056|      0|                sf->cur_pc = pc;
19057|      0|                ret = JS_Call(ctx, sp[-3], sp[-4],
19058|      0|                              1, (JSValueConst *)(sp - 1));
19059|      0|                if (JS_IsException(ret))
  ------------------
  |  Branch (19059:21): [True: 0, False: 0]
  ------------------
19060|      0|                    goto exception;
19061|      0|                JS_FreeValue(ctx, sp[-1]);
19062|      0|                sp[-1] = ret;
19063|      0|            }
19064|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19065|       |
19066|      0|        CASE(OP_iterator_call):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19067|       |            /* stack: iter_obj next catch_offset val */
19068|      0|            {
19069|      0|                JSValue method, ret;
19070|      0|                BOOL ret_flag;
19071|      0|                int flags;
19072|      0|                flags = *pc++;
19073|      0|                sf->cur_pc = pc;
19074|      0|                method = JS_GetProperty(ctx, sp[-4], (flags & 1) ?
  ------------------
  |  Branch (19074:54): [True: 0, False: 0]
  ------------------
19075|      0|                                        JS_ATOM_throw : JS_ATOM_return);
19076|      0|                if (JS_IsException(method))
  ------------------
  |  Branch (19076:21): [True: 0, False: 0]
  ------------------
19077|      0|                    goto exception;
19078|      0|                if (JS_IsUndefined(method) || JS_IsNull(method)) {
  ------------------
  |  Branch (19078:21): [True: 0, False: 0]
  |  Branch (19078:47): [True: 0, False: 0]
  ------------------
19079|      0|                    ret_flag = TRUE;
19080|      0|                } else {
19081|      0|                    if (flags & 2) {
  ------------------
  |  Branch (19081:25): [True: 0, False: 0]
  ------------------
19082|       |                        /* no argument */
19083|      0|                        ret = JS_CallFree(ctx, method, sp[-4],
19084|      0|                                          0, NULL);
19085|      0|                    } else {
19086|      0|                        ret = JS_CallFree(ctx, method, sp[-4],
19087|      0|                                          1, (JSValueConst *)(sp - 1));
19088|      0|                    }
19089|      0|                    if (JS_IsException(ret))
  ------------------
  |  Branch (19089:25): [True: 0, False: 0]
  ------------------
19090|      0|                        goto exception;
19091|      0|                    JS_FreeValue(ctx, sp[-1]);
19092|      0|                    sp[-1] = ret;
19093|      0|                    ret_flag = FALSE;
19094|      0|                }
19095|      0|                sp[0] = JS_NewBool(ctx, ret_flag);
19096|      0|                sp += 1;
19097|      0|            }
19098|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19099|       |
19100|      2|        CASE(OP_lnot):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
19101|      2|            {
19102|      2|                int res;
19103|      2|                JSValue op1;
19104|       |
19105|      2|                op1 = sp[-1];
19106|      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 (19106:21): [True: 0, False: 2]
  ------------------
19107|      0|                    res = JS_VALUE_GET_INT(op1) != 0;
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19108|      2|                } else {
19109|      2|                    res = JS_ToBoolFree(ctx, op1);
19110|      2|                }
19111|      2|                sp[-1] = JS_NewBool(ctx, !res);
19112|      2|            }
19113|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19114|       |
19115|      2|#define GET_FIELD_INLINE(name, keep, is_length)                         \
19116|      2|            {                                                           \
19117|      2|                JSValue val, obj;                                       \
19118|      2|                JSAtom atom;                                            \
19119|      2|                JSObject *p;                                            \
19120|      2|                JSProperty *pr;                                         \
19121|      2|                JSShapeProperty *prs;                                   \
19122|      2|                                                                        \
19123|      2|                if (is_length) {                                        \
19124|      2|                    atom = JS_ATOM_length;                              \
19125|      2|                } else {                                                \
19126|      2|                    atom = get_u32(pc);                                 \
19127|      2|                    pc += 4;                                            \
19128|      2|                }                                                       \
19129|      2|                                                                        \
19130|      2|                obj = sp[-1];                                           \
19131|      2|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT)) {   \
19132|      2|                    p = JS_VALUE_GET_OBJ(obj);                          \
19133|      2|                    for(;;) {                                           \
19134|      2|                        prs = find_own_property(&pr, p, atom);          \
19135|      2|                        if (prs) {                                      \
19136|       |                            /* found */                                 \
19137|      2|                            if (unlikely(prs->flags & JS_PROP_TMASK))   \
19138|      2|                                    goto name ## _slow_path;            \
19139|      2|                            val = JS_DupValue(ctx, pr->u.value);        \
19140|      2|                            break;                                      \
19141|      2|                        }                                               \
19142|      2|                        if (unlikely(p->is_exotic)) {                   \
19143|       |                            /* XXX: should avoid the slow path for arrays \
19144|       |                               and typed arrays by ensuring that 'prop' is \
19145|       |                               not numeric */                           \
19146|      2|                            obj = JS_MKPTR(JS_TAG_OBJECT, p);           \
19147|      2|                            goto name ## _slow_path;                    \
19148|      2|                        }                                               \
19149|      2|                        p = p->shape->proto;                            \
19150|      2|                        if (!p) {                                       \
19151|      2|                            val = JS_UNDEFINED;                         \
19152|      2|                            break;                                      \
19153|      2|                        }                                               \
19154|      2|                    }                                                   \
19155|      2|                } else {                                                \
19156|      2|                name ## _slow_path:                                     \
19157|      2|                    sf->cur_pc = pc;                                    \
19158|      2|                    val = JS_GetPropertyInternal(ctx, obj, atom, sp[-1], 0); \
19159|      2|                    if (unlikely(JS_IsException(val)))                  \
19160|      2|                        goto exception;                                 \
19161|      2|                }                                                       \
19162|      2|                if (keep) {                                             \
19163|      2|                    *sp++ = val;                                        \
19164|      2|                } else {                                                \
19165|      2|                    JS_FreeValue(ctx, sp[-1]);                          \
19166|      2|                    sp[-1] = val;                                       \
19167|      2|                }                                                       \
19168|      2|            }
19169|       |
19170|       |            
19171|      2|        CASE(OP_get_field):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
19172|      2|            GET_FIELD_INLINE(get_field, 0, 0);
  ------------------
  |  |19116|      2|            {                                                           \
  |  |19117|      2|                JSValue val, obj;                                       \
  |  |19118|      2|                JSAtom atom;                                            \
  |  |19119|      2|                JSObject *p;                                            \
  |  |19120|      2|                JSProperty *pr;                                         \
  |  |19121|      2|                JSShapeProperty *prs;                                   \
  |  |19122|      2|                                                                        \
  |  |19123|      2|                if (is_length) {                                        \
  |  |  ------------------
  |  |  |  Branch (19123:21): [Folded, False: 2]
  |  |  ------------------
  |  |19124|      0|                    atom = JS_ATOM_length;                              \
  |  |19125|      2|                } else {                                                \
  |  |19126|      2|                    atom = get_u32(pc);                                 \
  |  |19127|      2|                    pc += 4;                                            \
  |  |19128|      2|                }                                                       \
  |  |19129|      2|                                                                        \
  |  |19130|      2|                obj = sp[-1];                                           \
  |  |19131|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19132|      2|                    p = JS_VALUE_GET_OBJ(obj);                          \
  |  |  ------------------
  |  |  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  |  |  ------------------
  |  |  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19133|      2|                    for(;;) {                                           \
  |  |19134|      2|                        prs = find_own_property(&pr, p, atom);          \
  |  |19135|      2|                        if (prs) {                                      \
  |  |  ------------------
  |  |  |  Branch (19135:29): [True: 0, False: 2]
  |  |  ------------------
  |  |19136|      0|                            /* found */                                 \
  |  |19137|      0|                            if (unlikely(prs->flags & JS_PROP_TMASK))   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19138|      0|                                    goto name ## _slow_path;            \
  |  |19139|      0|                            val = JS_DupValue(ctx, pr->u.value);        \
  |  |19140|      0|                            break;                                      \
  |  |19141|      0|                        }                                               \
  |  |19142|      2|                        if (unlikely(p->is_exotic)) {                   \
  |  |  ------------------
  |  |  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19143|      2|                            /* XXX: should avoid the slow path for arrays \
  |  |19144|      2|                               and typed arrays by ensuring that 'prop' is \
  |  |19145|      2|                               not numeric */                           \
  |  |19146|      2|                            obj = JS_MKPTR(JS_TAG_OBJECT, p);           \
  |  |  ------------------
  |  |  |  |  246|      2|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  |  |  ------------------
  |  |19147|      2|                            goto name ## _slow_path;                    \
  |  |19148|      2|                        }                                               \
  |  |19149|      2|                        p = p->shape->proto;                            \
  |  |19150|      0|                        if (!p) {                                       \
  |  |  ------------------
  |  |  |  Branch (19150:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19151|      0|                            val = JS_UNDEFINED;                         \
  |  |  ------------------
  |  |  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19152|      0|                            break;                                      \
  |  |19153|      0|                        }                                               \
  |  |19154|      0|                    }                                                   \
  |  |19155|      2|                } else {                                                \
  |  |19156|      2|                name ## _slow_path:                                     \
  |  |19157|      2|                    sf->cur_pc = pc;                                    \
  |  |19158|      2|                    val = JS_GetPropertyInternal(ctx, obj, atom, sp[-1], 0); \
  |  |19159|      2|                    if (unlikely(JS_IsException(val)))                  \
  |  |  ------------------
  |  |  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19160|      2|                        goto exception;                                 \
  |  |19161|      2|                }                                                       \
  |  |19162|      2|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19162:21): [Folded, False: 2]
  |  |  ------------------
  |  |19163|      0|                    *sp++ = val;                                        \
  |  |19164|      2|                } else {                                                \
  |  |19165|      2|                    JS_FreeValue(ctx, sp[-1]);                          \
  |  |19166|      2|                    sp[-1] = val;                                       \
  |  |19167|      2|                }                                                       \
  |  |19168|      2|            }
  ------------------
19173|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19174|       |
19175|      4|        CASE(OP_get_field2):
  ------------------
  |  |17790|      4|#define CASE(op)        case_ ## op
  ------------------
19176|      4|            GET_FIELD_INLINE(get_field2, 1, 0);
  ------------------
  |  |19116|      4|            {                                                           \
  |  |19117|      4|                JSValue val, obj;                                       \
  |  |19118|      4|                JSAtom atom;                                            \
  |  |19119|      4|                JSObject *p;                                            \
  |  |19120|      4|                JSProperty *pr;                                         \
  |  |19121|      4|                JSShapeProperty *prs;                                   \
  |  |19122|      4|                                                                        \
  |  |19123|      4|                if (is_length) {                                        \
  |  |  ------------------
  |  |  |  Branch (19123:21): [Folded, False: 4]
  |  |  ------------------
  |  |19124|      0|                    atom = JS_ATOM_length;                              \
  |  |19125|      4|                } else {                                                \
  |  |19126|      4|                    atom = get_u32(pc);                                 \
  |  |19127|      4|                    pc += 4;                                            \
  |  |19128|      4|                }                                                       \
  |  |19129|      4|                                                                        \
  |  |19130|      4|                obj = sp[-1];                                           \
  |  |19131|      4|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT)) {   \
  |  |  ------------------
  |  |  |  |   32|      4|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:25): [True: 0, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19132|      0|                    p = JS_VALUE_GET_OBJ(obj);                          \
  |  |  ------------------
  |  |  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  |  |  ------------------
  |  |  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19133|      0|                    for(;;) {                                           \
  |  |19134|      0|                        prs = find_own_property(&pr, p, atom);          \
  |  |19135|      0|                        if (prs) {                                      \
  |  |  ------------------
  |  |  |  Branch (19135:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19136|      0|                            /* found */                                 \
  |  |19137|      0|                            if (unlikely(prs->flags & JS_PROP_TMASK))   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19138|      0|                                    goto name ## _slow_path;            \
  |  |19139|      0|                            val = JS_DupValue(ctx, pr->u.value);        \
  |  |19140|      0|                            break;                                      \
  |  |19141|      0|                        }                                               \
  |  |19142|      0|                        if (unlikely(p->is_exotic)) {                   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19143|      0|                            /* XXX: should avoid the slow path for arrays \
  |  |19144|      0|                               and typed arrays by ensuring that 'prop' is \
  |  |19145|      0|                               not numeric */                           \
  |  |19146|      0|                            obj = JS_MKPTR(JS_TAG_OBJECT, p);           \
  |  |  ------------------
  |  |  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  |  |  ------------------
  |  |19147|      0|                            goto name ## _slow_path;                    \
  |  |19148|      0|                        }                                               \
  |  |19149|      0|                        p = p->shape->proto;                            \
  |  |19150|      0|                        if (!p) {                                       \
  |  |  ------------------
  |  |  |  Branch (19150:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19151|      0|                            val = JS_UNDEFINED;                         \
  |  |  ------------------
  |  |  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19152|      0|                            break;                                      \
  |  |19153|      0|                        }                                               \
  |  |19154|      0|                    }                                                   \
  |  |19155|      4|                } else {                                                \
  |  |19156|      4|                name ## _slow_path:                                     \
  |  |19157|      4|                    sf->cur_pc = pc;                                    \
  |  |19158|      4|                    val = JS_GetPropertyInternal(ctx, obj, atom, sp[-1], 0); \
  |  |19159|      4|                    if (unlikely(JS_IsException(val)))                  \
  |  |  ------------------
  |  |  |  |   33|      4|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19160|      4|                        goto exception;                                 \
  |  |19161|      4|                }                                                       \
  |  |19162|      4|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19162:21): [True: 4, Folded]
  |  |  ------------------
  |  |19163|      4|                    *sp++ = val;                                        \
  |  |19164|      4|                } else {                                                \
  |  |19165|      0|                    JS_FreeValue(ctx, sp[-1]);                          \
  |  |19166|      0|                    sp[-1] = val;                                       \
  |  |19167|      0|                }                                                       \
  |  |19168|      4|            }
  ------------------
19177|      4|            BREAK;
  ------------------
  |  |17792|      4|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      4|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19178|       |
19179|      4|#if SHORT_OPCODES
19180|      4|        CASE(OP_get_length):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19181|      0|            GET_FIELD_INLINE(get_length, 0, 1);
  ------------------
  |  |19116|      0|            {                                                           \
  |  |19117|      0|                JSValue val, obj;                                       \
  |  |19118|      0|                JSAtom atom;                                            \
  |  |19119|      0|                JSObject *p;                                            \
  |  |19120|      0|                JSProperty *pr;                                         \
  |  |19121|      0|                JSShapeProperty *prs;                                   \
  |  |19122|      0|                                                                        \
  |  |19123|      0|                if (is_length) {                                        \
  |  |  ------------------
  |  |  |  Branch (19123:21): [True: 0, Folded]
  |  |  ------------------
  |  |19124|      0|                    atom = JS_ATOM_length;                              \
  |  |19125|      0|                } else {                                                \
  |  |19126|      0|                    atom = get_u32(pc);                                 \
  |  |19127|      0|                    pc += 4;                                            \
  |  |19128|      0|                }                                                       \
  |  |19129|      0|                                                                        \
  |  |19130|      0|                obj = sp[-1];                                           \
  |  |19131|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19132|      0|                    p = JS_VALUE_GET_OBJ(obj);                          \
  |  |  ------------------
  |  |  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  |  |  ------------------
  |  |  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19133|      0|                    for(;;) {                                           \
  |  |19134|      0|                        prs = find_own_property(&pr, p, atom);          \
  |  |19135|      0|                        if (prs) {                                      \
  |  |  ------------------
  |  |  |  Branch (19135:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19136|      0|                            /* found */                                 \
  |  |19137|      0|                            if (unlikely(prs->flags & JS_PROP_TMASK))   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19138|      0|                                    goto name ## _slow_path;            \
  |  |19139|      0|                            val = JS_DupValue(ctx, pr->u.value);        \
  |  |19140|      0|                            break;                                      \
  |  |19141|      0|                        }                                               \
  |  |19142|      0|                        if (unlikely(p->is_exotic)) {                   \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19143|      0|                            /* XXX: should avoid the slow path for arrays \
  |  |19144|      0|                               and typed arrays by ensuring that 'prop' is \
  |  |19145|      0|                               not numeric */                           \
  |  |19146|      0|                            obj = JS_MKPTR(JS_TAG_OBJECT, p);           \
  |  |  ------------------
  |  |  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  |  |  ------------------
  |  |19147|      0|                            goto name ## _slow_path;                    \
  |  |19148|      0|                        }                                               \
  |  |19149|      0|                        p = p->shape->proto;                            \
  |  |19150|      0|                        if (!p) {                                       \
  |  |  ------------------
  |  |  |  Branch (19150:29): [True: 0, False: 0]
  |  |  ------------------
  |  |19151|      0|                            val = JS_UNDEFINED;                         \
  |  |  ------------------
  |  |  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19152|      0|                            break;                                      \
  |  |19153|      0|                        }                                               \
  |  |19154|      0|                    }                                                   \
  |  |19155|      0|                } else {                                                \
  |  |19156|      0|                name ## _slow_path:                                     \
  |  |19157|      0|                    sf->cur_pc = pc;                                    \
  |  |19158|      0|                    val = JS_GetPropertyInternal(ctx, obj, atom, sp[-1], 0); \
  |  |19159|      0|                    if (unlikely(JS_IsException(val)))                  \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19160|      0|                        goto exception;                                 \
  |  |19161|      0|                }                                                       \
  |  |19162|      0|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19162:21): [Folded, False: 0]
  |  |  ------------------
  |  |19163|      0|                    *sp++ = val;                                        \
  |  |19164|      0|                } else {                                                \
  |  |19165|      0|                    JS_FreeValue(ctx, sp[-1]);                          \
  |  |19166|      0|                    sp[-1] = val;                                       \
  |  |19167|      0|                }                                                       \
  |  |19168|      0|            }
  ------------------
19182|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19183|      0|#endif
19184|       |            
19185|     26|        CASE(OP_put_field):
  ------------------
  |  |17790|     26|#define CASE(op)        case_ ## op
  ------------------
19186|     26|            {
19187|     26|                int ret;
19188|     26|                JSValue obj;
19189|     26|                JSAtom atom;
19190|     26|                JSObject *p;
19191|     26|                JSProperty *pr;
19192|     26|                JSShapeProperty *prs;
19193|       |
19194|     26|                atom = get_u32(pc);
19195|     26|                pc += 4;
19196|       |
19197|     26|                obj = sp[-2];
19198|     26|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT)) {
  ------------------
  |  |   32|     26|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 26, False: 0]
  |  |  ------------------
  ------------------
19199|     26|                    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|     26|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     26|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
19200|     26|                    prs = find_own_property(&pr, p, atom);
19201|     26|                    if (!prs)
  ------------------
  |  Branch (19201:25): [True: 26, False: 0]
  ------------------
19202|     26|                        goto put_field_slow_path;
19203|      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]
  |  |  ------------------
  ------------------
19204|      0|                                              JS_PROP_LENGTH)) == JS_PROP_WRITABLE)) {
19205|       |                        /* fast path */
19206|      0|                        set_value(ctx, &pr->u.value, sp[-1]);
19207|      0|                    } else {
19208|      0|                        goto put_field_slow_path;
19209|      0|                    }
19210|      0|                    JS_FreeValue(ctx, obj);
19211|      0|                    sp -= 2;
19212|      0|                } else {
19213|     26|                put_field_slow_path:
19214|     26|                    sf->cur_pc = pc;
19215|     26|                    ret = JS_SetPropertyInternal(ctx, obj, atom, sp[-1], obj,
19216|     26|                                                 JS_PROP_THROW_STRICT);
  ------------------
  |  |  321|     26|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
19217|     26|                    JS_FreeValue(ctx, obj);
19218|     26|                    sp -= 2;
19219|     26|                    if (unlikely(ret < 0))
  ------------------
  |  |   33|     26|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 26]
  |  |  ------------------
  ------------------
19220|      0|                        goto exception;
19221|     26|                }
19222|       |                
19223|     26|            }
19224|     26|            BREAK;
  ------------------
  |  |17792|     26|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|     26|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19225|       |
19226|     26|        CASE(OP_private_symbol):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19227|      0|            {
19228|      0|                JSAtom atom;
19229|      0|                JSValue val;
19230|       |
19231|      0|                atom = get_u32(pc);
19232|      0|                pc += 4;
19233|      0|                val = JS_NewSymbolFromAtom(ctx, atom, JS_ATOM_TYPE_PRIVATE);
19234|      0|                if (JS_IsException(val))
  ------------------
  |  Branch (19234:21): [True: 0, False: 0]
  ------------------
19235|      0|                    goto exception;
19236|      0|                *sp++ = val;
19237|      0|            }
19238|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19239|       |
19240|      0|        CASE(OP_get_private_field):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19241|      0|            {
19242|      0|                JSValue val;
19243|       |
19244|      0|                val = JS_GetPrivateField(ctx, sp[-2], sp[-1]);
19245|      0|                JS_FreeValue(ctx, sp[-1]);
19246|      0|                JS_FreeValue(ctx, sp[-2]);
19247|      0|                sp[-2] = val;
19248|      0|                sp--;
19249|      0|                if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19250|      0|                    goto exception;
19251|      0|            }
19252|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19253|       |
19254|      0|        CASE(OP_put_private_field):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19255|      0|            {
19256|      0|                int ret;
19257|      0|                ret = JS_SetPrivateField(ctx, sp[-3], sp[-1], sp[-2]);
19258|      0|                JS_FreeValue(ctx, sp[-3]);
19259|      0|                JS_FreeValue(ctx, sp[-1]);
19260|      0|                sp -= 3;
19261|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19262|      0|                    goto exception;
19263|      0|            }
19264|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19265|       |
19266|      0|        CASE(OP_define_private_field):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19267|      0|            {
19268|      0|                int ret;
19269|      0|                ret = JS_DefinePrivateField(ctx, sp[-3], sp[-2], sp[-1]);
19270|      0|                JS_FreeValue(ctx, sp[-2]);
19271|      0|                sp -= 2;
19272|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19273|      0|                    goto exception;
19274|      0|            }
19275|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19276|       |
19277|      0|        CASE(OP_define_field):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19278|      0|            {
19279|      0|                int ret;
19280|      0|                JSAtom atom;
19281|      0|                atom = get_u32(pc);
19282|      0|                pc += 4;
19283|       |
19284|      0|                ret = JS_DefinePropertyValue(ctx, sp[-2], atom, sp[-1],
19285|      0|                                             JS_PROP_C_W_E | JS_PROP_THROW);
  ------------------
  |  |  299|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                                                           JS_PROP_C_W_E | JS_PROP_THROW);
  ------------------
  |  |  318|      0|#define JS_PROP_THROW            (1 << 14)
  ------------------
19286|      0|                sp--;
19287|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19288|      0|                    goto exception;
19289|      0|            }
19290|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19291|       |
19292|      2|        CASE(OP_set_name):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
19293|      2|            {
19294|      2|                int ret;
19295|      2|                JSAtom atom;
19296|      2|                atom = get_u32(pc);
19297|      2|                pc += 4;
19298|       |
19299|      2|                ret = JS_DefineObjectName(ctx, sp[-1], atom, JS_PROP_CONFIGURABLE);
  ------------------
  |  |  296|      2|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
19300|      2|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
19301|      0|                    goto exception;
19302|      2|            }
19303|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19304|      2|        CASE(OP_set_name_computed):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19305|      0|            {
19306|      0|                int ret;
19307|      0|                ret = JS_DefineObjectNameComputed(ctx, sp[-1], sp[-2], JS_PROP_CONFIGURABLE);
  ------------------
  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
19308|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19309|      0|                    goto exception;
19310|      0|            }
19311|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19312|      0|        CASE(OP_set_proto):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19313|      0|            {
19314|      0|                JSValue proto;
19315|      0|                sf->cur_pc = pc;
19316|      0|                proto = sp[-1];
19317|      0|                if (JS_IsObject(proto) || JS_IsNull(proto)) {
  ------------------
  |  Branch (19317:21): [True: 0, False: 0]
  |  Branch (19317:43): [True: 0, False: 0]
  ------------------
19318|      0|                    if (JS_SetPrototypeInternal(ctx, sp[-2], proto, TRUE) < 0)
  ------------------
  |  Branch (19318:25): [True: 0, False: 0]
  ------------------
19319|      0|                        goto exception;
19320|      0|                }
19321|      0|                JS_FreeValue(ctx, proto);
19322|      0|                sp--;
19323|      0|            }
19324|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19325|      0|        CASE(OP_set_home_object):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19326|      0|            js_method_set_home_object(ctx, sp[-1], sp[-2]);
19327|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19328|      0|        CASE(OP_define_method):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19329|      0|        CASE(OP_define_method_computed):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19330|      0|            {
19331|      0|                JSValue getter, setter, value;
19332|      0|                JSValueConst obj;
  ------------------
  |  |  234|      0|#define JSValueConst JSValue
  ------------------
19333|      0|                JSAtom atom;
19334|      0|                int flags, ret, op_flags;
19335|      0|                BOOL is_computed;
19336|      0|#define OP_DEFINE_METHOD_METHOD 0
19337|      0|#define OP_DEFINE_METHOD_GETTER 1
19338|      0|#define OP_DEFINE_METHOD_SETTER 2
19339|      0|#define OP_DEFINE_METHOD_ENUMERABLE 4
19340|       |
19341|      0|                is_computed = (opcode == OP_define_method_computed);
19342|      0|                if (is_computed) {
  ------------------
  |  Branch (19342:21): [True: 0, False: 0]
  ------------------
19343|      0|                    atom = JS_ValueToAtom(ctx, sp[-2]);
19344|      0|                    if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19345|      0|                        goto exception;
19346|      0|                    opcode += OP_define_method - OP_define_method_computed;
19347|      0|                } else {
19348|      0|                    atom = get_u32(pc);
19349|      0|                    pc += 4;
19350|      0|                }
19351|      0|                op_flags = *pc++;
19352|       |
19353|      0|                obj = sp[-2 - is_computed];
19354|      0|                flags = JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE |
  ------------------
  |  |  309|      0|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
                              flags = JS_PROP_HAS_CONFIGURABLE | JS_PROP_CONFIGURABLE |
  ------------------
  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
19355|      0|                    JS_PROP_HAS_ENUMERABLE | JS_PROP_THROW;
  ------------------
  |  |  311|      0|#define JS_PROP_HAS_ENUMERABLE   (1 << 10)
  ------------------
                                  JS_PROP_HAS_ENUMERABLE | JS_PROP_THROW;
  ------------------
  |  |  318|      0|#define JS_PROP_THROW            (1 << 14)
  ------------------
19356|      0|                if (op_flags & OP_DEFINE_METHOD_ENUMERABLE)
  ------------------
  |  |19339|      0|#define OP_DEFINE_METHOD_ENUMERABLE 4
  ------------------
  |  Branch (19356:21): [True: 0, False: 0]
  ------------------
19357|      0|                    flags |= JS_PROP_ENUMERABLE;
  ------------------
  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
19358|      0|                op_flags &= 3;
19359|      0|                value = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
19360|      0|                getter = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
19361|      0|                setter = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
19362|      0|                if (op_flags == OP_DEFINE_METHOD_METHOD) {
  ------------------
  |  |19336|      0|#define OP_DEFINE_METHOD_METHOD 0
  ------------------
  |  Branch (19362:21): [True: 0, False: 0]
  ------------------
19363|      0|                    value = sp[-1];
19364|      0|                    flags |= JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE;
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
                                  flags |= JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE;
  ------------------
  |  |  310|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
                                  flags |= JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE;
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
19365|      0|                } else if (op_flags == OP_DEFINE_METHOD_GETTER) {
  ------------------
  |  |19337|      0|#define OP_DEFINE_METHOD_GETTER 1
  ------------------
  |  Branch (19365:28): [True: 0, False: 0]
  ------------------
19366|      0|                    getter = sp[-1];
19367|      0|                    flags |= JS_PROP_HAS_GET;
  ------------------
  |  |  312|      0|#define JS_PROP_HAS_GET          (1 << 11)
  ------------------
19368|      0|                } else {
19369|      0|                    setter = sp[-1];
19370|      0|                    flags |= JS_PROP_HAS_SET;
  ------------------
  |  |  313|      0|#define JS_PROP_HAS_SET          (1 << 12)
  ------------------
19371|      0|                }
19372|      0|                ret = js_method_set_properties(ctx, sp[-1], atom, flags, obj);
19373|      0|                if (ret >= 0) {
  ------------------
  |  Branch (19373:21): [True: 0, False: 0]
  ------------------
19374|      0|                    ret = JS_DefineProperty(ctx, obj, atom, value,
19375|      0|                                            getter, setter, flags);
19376|      0|                }
19377|      0|                JS_FreeValue(ctx, sp[-1]);
19378|      0|                if (is_computed) {
  ------------------
  |  Branch (19378:21): [True: 0, False: 0]
  ------------------
19379|      0|                    JS_FreeAtom(ctx, atom);
19380|      0|                    JS_FreeValue(ctx, sp[-2]);
19381|      0|                }
19382|      0|                sp -= 1 + is_computed;
19383|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19384|      0|                    goto exception;
19385|      0|            }
19386|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19387|       |
19388|      0|        CASE(OP_define_class):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19389|      0|        CASE(OP_define_class_computed):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19390|      0|            {
19391|      0|                int class_flags;
19392|      0|                JSAtom atom;
19393|       |
19394|      0|                atom = get_u32(pc);
19395|      0|                class_flags = pc[4];
19396|      0|                pc += 5;
19397|      0|                if (js_op_define_class(ctx, sp, atom, class_flags,
  ------------------
  |  Branch (19397:21): [True: 0, False: 0]
  ------------------
19398|      0|                                       var_refs, sf,
19399|      0|                                       (opcode == OP_define_class_computed)) < 0)
19400|      0|                    goto exception;
19401|      0|            }
19402|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19403|       |
19404|      0|#define GET_ARRAY_EL_INLINE(name, keep)                                 \
19405|      0|            {                                                           \
19406|      0|                JSValue val, obj, prop;                                 \
19407|      0|                JSObject *p;                                            \
19408|      0|                uint32_t idx;                                           \
19409|      0|                                                                        \
19410|      0|                obj = sp[-2];                                           \
19411|      0|                prop = sp[-1];                                          \
19412|      0|                if (likely(JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT &&    \
19413|      0|                           JS_VALUE_GET_TAG(prop) == JS_TAG_INT)) {     \
19414|      0|                    p = JS_VALUE_GET_OBJ(obj);                          \
19415|      0|                    idx = JS_VALUE_GET_INT(prop);                       \
19416|      0|                    if (unlikely(p->class_id != JS_CLASS_ARRAY))        \
19417|      0|                        goto name ## _slow_path;                        \
19418|      0|                    if (unlikely(idx >= p->u.array.count))              \
19419|      0|                        goto name ## _slow_path;                        \
19420|      0|                    val = JS_DupValue(ctx, p->u.array.u.values[idx]);   \
19421|      0|                } else {                                                \
19422|      0|                    name ## _slow_path:                                 \
19423|      0|                    sf->cur_pc = pc;                                    \
19424|      0|                    val = JS_GetPropertyValue(ctx, obj, prop);          \
19425|      0|                    if (unlikely(JS_IsException(val))) {                \
19426|      0|                        if (keep)                                       \
19427|      0|                            sp[-1] = JS_UNDEFINED;                      \
19428|      0|                        else                                            \
19429|      0|                            sp--;                                       \
19430|      0|                        goto exception;                                 \
19431|      0|                    }                                                   \
19432|      0|                }                                                       \
19433|      0|                if (keep) {                                             \
19434|      0|                    sp[-1] = val;                                       \
19435|      0|                } else {                                                \
19436|      0|                    JS_FreeValue(ctx, obj);                             \
19437|      0|                    sp[-2] = val;                                       \
19438|      0|                    sp--;                                               \
19439|      0|                }                                                       \
19440|      0|            }
19441|       |            
19442|      0|        CASE(OP_get_array_el):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19443|      0|            GET_ARRAY_EL_INLINE(get_array_el, 0);
  ------------------
  |  |19405|      0|            {                                                           \
  |  |19406|      0|                JSValue val, obj, prop;                                 \
  |  |19407|      0|                JSObject *p;                                            \
  |  |19408|      0|                uint32_t idx;                                           \
  |  |19409|      0|                                                                        \
  |  |19410|      0|                obj = sp[-2];                                           \
  |  |19411|      0|                prop = sp[-1];                                          \
  |  |19412|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19413|      0|                           JS_VALUE_GET_TAG(prop) == JS_TAG_INT)) {     \
  |  |19414|      0|                    p = JS_VALUE_GET_OBJ(obj);                          \
  |  |  ------------------
  |  |  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  |  |  ------------------
  |  |  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19415|      0|                    idx = JS_VALUE_GET_INT(prop);                       \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  |  |  ------------------
  |  |19416|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19417|      0|                        goto name ## _slow_path;                        \
  |  |19418|      0|                    if (unlikely(idx >= p->u.array.count))              \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19419|      0|                        goto name ## _slow_path;                        \
  |  |19420|      0|                    val = JS_DupValue(ctx, p->u.array.u.values[idx]);   \
  |  |19421|      0|                } else {                                                \
  |  |19422|      0|                    name ## _slow_path:                                 \
  |  |19423|      0|                    sf->cur_pc = pc;                                    \
  |  |19424|      0|                    val = JS_GetPropertyValue(ctx, obj, prop);          \
  |  |19425|      0|                    if (unlikely(JS_IsException(val))) {                \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19426|      0|                        if (keep)                                       \
  |  |  ------------------
  |  |  |  Branch (19426:29): [Folded, False: 0]
  |  |  ------------------
  |  |19427|      0|                            sp[-1] = JS_UNDEFINED;                      \
  |  |  ------------------
  |  |  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19428|      0|                        else                                            \
  |  |19429|      0|                            sp--;                                       \
  |  |19430|      0|                        goto exception;                                 \
  |  |19431|      0|                    }                                                   \
  |  |19432|      0|                }                                                       \
  |  |19433|      0|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19433:21): [Folded, False: 0]
  |  |  ------------------
  |  |19434|      0|                    sp[-1] = val;                                       \
  |  |19435|      0|                } else {                                                \
  |  |19436|      0|                    JS_FreeValue(ctx, obj);                             \
  |  |19437|      0|                    sp[-2] = val;                                       \
  |  |19438|      0|                    sp--;                                               \
  |  |19439|      0|                }                                                       \
  |  |19440|      0|            }
  ------------------
19444|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19445|       |
19446|      0|        CASE(OP_get_array_el2):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19447|      0|            GET_ARRAY_EL_INLINE(get_array_el2, 1);
  ------------------
  |  |19405|      0|            {                                                           \
  |  |19406|      0|                JSValue val, obj, prop;                                 \
  |  |19407|      0|                JSObject *p;                                            \
  |  |19408|      0|                uint32_t idx;                                           \
  |  |19409|      0|                                                                        \
  |  |19410|      0|                obj = sp[-2];                                           \
  |  |19411|      0|                prop = sp[-1];                                          \
  |  |19412|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19413|      0|                           JS_VALUE_GET_TAG(prop) == JS_TAG_INT)) {     \
  |  |19414|      0|                    p = JS_VALUE_GET_OBJ(obj);                          \
  |  |  ------------------
  |  |  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  |  |  ------------------
  |  |  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19415|      0|                    idx = JS_VALUE_GET_INT(prop);                       \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  |  |  ------------------
  |  |19416|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19417|      0|                        goto name ## _slow_path;                        \
  |  |19418|      0|                    if (unlikely(idx >= p->u.array.count))              \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19419|      0|                        goto name ## _slow_path;                        \
  |  |19420|      0|                    val = JS_DupValue(ctx, p->u.array.u.values[idx]);   \
  |  |19421|      0|                } else {                                                \
  |  |19422|      0|                    name ## _slow_path:                                 \
  |  |19423|      0|                    sf->cur_pc = pc;                                    \
  |  |19424|      0|                    val = JS_GetPropertyValue(ctx, obj, prop);          \
  |  |19425|      0|                    if (unlikely(JS_IsException(val))) {                \
  |  |  ------------------
  |  |  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19426|      0|                        if (keep)                                       \
  |  |  ------------------
  |  |  |  Branch (19426:29): [True: 0, Folded]
  |  |  ------------------
  |  |19427|      0|                            sp[-1] = JS_UNDEFINED;                      \
  |  |  ------------------
  |  |  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |19428|      0|                        else                                            \
  |  |19429|      0|                            sp--;                                       \
  |  |19430|      0|                        goto exception;                                 \
  |  |19431|      0|                    }                                                   \
  |  |19432|      0|                }                                                       \
  |  |19433|      0|                if (keep) {                                             \
  |  |  ------------------
  |  |  |  Branch (19433:21): [True: 0, Folded]
  |  |  ------------------
  |  |19434|      0|                    sp[-1] = val;                                       \
  |  |19435|      0|                } else {                                                \
  |  |19436|      0|                    JS_FreeValue(ctx, obj);                             \
  |  |19437|      0|                    sp[-2] = val;                                       \
  |  |19438|      0|                    sp--;                                               \
  |  |19439|      0|                }                                                       \
  |  |19440|      0|            }
  ------------------
19448|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19449|       |
19450|      0|        CASE(OP_get_array_el3):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19451|      0|            {
19452|      0|                JSValue val;
19453|      0|                JSObject *p;
19454|      0|                uint32_t idx;
19455|       |
19456|      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]
  |  |  ------------------
  ------------------
19457|      0|                           JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_INT)) {
19458|      0|                    p = JS_VALUE_GET_OBJ(sp[-2]);
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
19459|      0|                    idx = JS_VALUE_GET_INT(sp[-1]);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19460|      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]
  |  |  ------------------
  ------------------
19461|      0|                        goto get_array_el3_slow_path;
19462|      0|                    if (unlikely(idx >= p->u.array.count))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19463|      0|                        goto get_array_el3_slow_path;
19464|      0|                    val = JS_DupValue(ctx, p->u.array.u.values[idx]);
19465|      0|                } else {
19466|      0|                get_array_el3_slow_path:
19467|      0|                    switch (JS_VALUE_GET_TAG(sp[-1])) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
19468|      0|                    case JS_TAG_INT:
  ------------------
  |  Branch (19468:21): [True: 0, False: 0]
  ------------------
19469|      0|                    case JS_TAG_STRING:
  ------------------
  |  Branch (19469:21): [True: 0, False: 0]
  ------------------
19470|      0|                    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (19470:21): [True: 0, False: 0]
  ------------------
19471|       |                        /* undefined and null are tested in JS_GetPropertyValue() */
19472|      0|                        break;
19473|      0|                    default:
  ------------------
  |  Branch (19473:21): [True: 0, False: 0]
  ------------------
19474|       |                        /* must be tested before JS_ToPropertyKey */
19475|      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]
  |  |  ------------------
  ------------------
19476|      0|                            JS_ThrowTypeError(ctx, "value has no property");
19477|      0|                            goto exception;
19478|      0|                        }
19479|      0|                        sf->cur_pc = pc;
19480|      0|                        ret_val = JS_ToPropertyKey(ctx, sp[-1]);
19481|      0|                        if (JS_IsException(ret_val))
  ------------------
  |  Branch (19481:29): [True: 0, False: 0]
  ------------------
19482|      0|                            goto exception;
19483|      0|                        JS_FreeValue(ctx, sp[-1]);
19484|      0|                        sp[-1] = ret_val;
19485|      0|                        break;
19486|      0|                    }
19487|      0|                    sf->cur_pc = pc;
19488|      0|                    val = JS_GetPropertyValue(ctx, sp[-2], JS_DupValue(ctx, sp[-1]));
19489|      0|                    if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19490|      0|                        goto exception;
19491|      0|                }
19492|      0|                *sp++ = val;
19493|      0|            }
19494|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19495|       |            
19496|      0|        CASE(OP_get_ref_value):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19497|      0|            {
19498|      0|                JSValue val;
19499|      0|                JSAtom atom;
19500|      0|                int ret;
19501|       |                
19502|      0|                sf->cur_pc = pc;
19503|      0|                atom = JS_ValueToAtom(ctx, sp[-1]);
19504|      0|                if (atom == JS_ATOM_NULL)
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (19504:21): [True: 0, False: 0]
  ------------------
19505|      0|                    goto exception;
19506|      0|                if (unlikely(JS_IsUndefined(sp[-2]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19507|      0|                    JS_ThrowReferenceErrorNotDefined(ctx, atom);
19508|      0|                    JS_FreeAtom(ctx, atom);
19509|      0|                    goto exception;
19510|      0|                }
19511|      0|                ret = JS_HasProperty(ctx, sp[-2], atom);
19512|      0|                if (unlikely(ret <= 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19513|      0|                    if (ret < 0) {
  ------------------
  |  Branch (19513:25): [True: 0, False: 0]
  ------------------
19514|      0|                        JS_FreeAtom(ctx, atom);
19515|      0|                        goto exception;
19516|      0|                    }
19517|      0|                    if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (19517:25): [True: 0, False: 0]
  ------------------
19518|      0|                        JS_ThrowReferenceErrorNotDefined(ctx, atom);
19519|      0|                        JS_FreeAtom(ctx, atom);
19520|      0|                        goto exception;
19521|      0|                    } 
19522|      0|                    val = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
19523|      0|                } else {
19524|      0|                    val = JS_GetProperty(ctx, sp[-2], atom);
19525|      0|                }
19526|      0|                JS_FreeAtom(ctx, atom);
19527|      0|                if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19528|      0|                    goto exception;
19529|      0|                sp[0] = val;
19530|      0|                sp++;
19531|      0|            }
19532|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19533|       |
19534|      0|        CASE(OP_get_super_value):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19535|      0|            {
19536|      0|                JSValue val;
19537|      0|                JSAtom atom;
19538|      0|                sf->cur_pc = pc;
19539|      0|                atom = JS_ValueToAtom(ctx, sp[-1]);
19540|      0|                if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19541|      0|                    goto exception;
19542|      0|                val = JS_GetPropertyInternal(ctx, sp[-2], atom, sp[-3], FALSE);
19543|      0|                JS_FreeAtom(ctx, atom);
19544|      0|                if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19545|      0|                    goto exception;
19546|      0|                JS_FreeValue(ctx, sp[-1]);
19547|      0|                JS_FreeValue(ctx, sp[-2]);
19548|      0|                JS_FreeValue(ctx, sp[-3]);
19549|      0|                sp[-3] = val;
19550|      0|                sp -= 2;
19551|      0|            }
19552|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19553|       |
19554|      0|        CASE(OP_put_array_el):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19555|      0|            {
19556|      0|                int ret;
19557|      0|                JSObject *p;
19558|      0|                uint32_t idx;
19559|       |
19560|      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]
  |  |  ------------------
  ------------------
19561|      0|                           JS_VALUE_GET_TAG(sp[-2]) == JS_TAG_INT)) {
19562|      0|                    p = JS_VALUE_GET_OBJ(sp[-3]);
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
19563|      0|                    idx = JS_VALUE_GET_INT(sp[-2]);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19564|      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]
  |  |  ------------------
  ------------------
19565|      0|                        goto put_array_el_slow_path;
19566|      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]
  |  |  ------------------
  ------------------
19567|      0|                        uint32_t new_len, array_len;
19568|      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]
  |  |  ------------------
  ------------------
19569|      0|                                     !p->fast_array ||
19570|      0|                                     !can_extend_fast_array(p))) {
19571|      0|                            goto put_array_el_slow_path;
19572|      0|                        }
19573|      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]
  |  |  ------------------
  ------------------
19574|      0|                            goto put_array_el_slow_path;
19575|       |                        /* cannot overflow otherwise the length would not be an integer */
19576|      0|                        new_len = idx + 1;
19577|      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]
  |  |  ------------------
  ------------------
19578|      0|                            goto put_array_el_slow_path;
19579|      0|                        array_len = JS_VALUE_GET_INT(p->prop[0].u.value);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19580|      0|                        if (new_len > array_len) {
  ------------------
  |  Branch (19580:29): [True: 0, False: 0]
  ------------------
19581|      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]
  |  |  ------------------
  ------------------
19582|      0|                                goto put_array_el_slow_path;
19583|      0|                            p->prop[0].u.value = JS_NewInt32(ctx, new_len);
19584|      0|                        }
19585|      0|                        p->u.array.count = new_len;
19586|      0|                        p->u.array.u.values[idx] = sp[-1];
19587|      0|                    } else {
19588|      0|                        set_value(ctx, &p->u.array.u.values[idx], sp[-1]);
19589|      0|                    }
19590|      0|                    JS_FreeValue(ctx, sp[-3]);
19591|      0|                    sp -= 3;
19592|      0|                } else {
19593|      0|                put_array_el_slow_path:
19594|      0|                    sf->cur_pc = pc;
19595|      0|                    ret = JS_SetPropertyValue(ctx, sp[-3], sp[-2], sp[-1], JS_PROP_THROW_STRICT);
  ------------------
  |  |  321|      0|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
19596|      0|                    JS_FreeValue(ctx, sp[-3]);
19597|      0|                    sp -= 3;
19598|      0|                    if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19599|      0|                        goto exception;
19600|      0|                }
19601|      0|            }
19602|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19603|       |
19604|      0|        CASE(OP_put_ref_value):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19605|      0|            {
19606|      0|                int ret;
19607|      0|                JSAtom atom;
19608|      0|                sf->cur_pc = pc;
19609|      0|                atom = JS_ValueToAtom(ctx, sp[-2]);
19610|      0|                if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19611|      0|                    goto exception;
19612|      0|                if (unlikely(JS_IsUndefined(sp[-3]))) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19613|      0|                    if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (19613:25): [True: 0, False: 0]
  ------------------
19614|      0|                        JS_ThrowReferenceErrorNotDefined(ctx, atom);
19615|      0|                        JS_FreeAtom(ctx, atom);
19616|      0|                        goto exception;
19617|      0|                    } else {
19618|      0|                        sp[-3] = JS_DupValue(ctx, ctx->global_obj);
19619|      0|                    }
19620|      0|                }
19621|      0|                ret = JS_HasProperty(ctx, sp[-3], atom);
19622|      0|                if (unlikely(ret <= 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19623|      0|                    if (unlikely(ret < 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19624|      0|                        JS_FreeAtom(ctx, atom);
19625|      0|                        goto exception;
19626|      0|                    }
19627|      0|                    if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (19627:25): [True: 0, False: 0]
  ------------------
19628|      0|                        JS_ThrowReferenceErrorNotDefined(ctx, atom);
19629|      0|                        JS_FreeAtom(ctx, atom);
19630|      0|                        goto exception;
19631|      0|                    }
19632|      0|                }
19633|      0|                ret = JS_SetPropertyInternal(ctx, sp[-3], atom, sp[-1], sp[-3], JS_PROP_THROW_STRICT);
  ------------------
  |  |  321|      0|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
19634|      0|                JS_FreeAtom(ctx, atom);
19635|      0|                JS_FreeValue(ctx, sp[-2]);
19636|      0|                JS_FreeValue(ctx, sp[-3]);
19637|      0|                sp -= 3;
19638|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19639|      0|                    goto exception;
19640|      0|            }
19641|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19642|       |
19643|      0|        CASE(OP_put_super_value):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19644|      0|            {
19645|      0|                int ret;
19646|      0|                JSAtom atom;
19647|      0|                sf->cur_pc = pc;
19648|      0|                if (JS_VALUE_GET_TAG(sp[-3]) != JS_TAG_OBJECT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19648:21): [True: 0, False: 0]
  ------------------
19649|      0|                    JS_ThrowTypeErrorNotAnObject(ctx);
19650|      0|                    goto exception;
19651|      0|                }
19652|      0|                atom = JS_ValueToAtom(ctx, sp[-2]);
19653|      0|                if (unlikely(atom == JS_ATOM_NULL))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19654|      0|                    goto exception;
19655|      0|                ret = JS_SetPropertyInternal(ctx, sp[-3], atom, sp[-1], sp[-4],
19656|      0|                                             JS_PROP_THROW_STRICT);
  ------------------
  |  |  321|      0|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
19657|      0|                JS_FreeAtom(ctx, atom);
19658|      0|                JS_FreeValue(ctx, sp[-4]);
19659|      0|                JS_FreeValue(ctx, sp[-3]);
19660|      0|                JS_FreeValue(ctx, sp[-2]);
19661|      0|                sp -= 4;
19662|      0|                if (ret < 0)
  ------------------
  |  Branch (19662:21): [True: 0, False: 0]
  ------------------
19663|      0|                    goto exception;
19664|      0|            }
19665|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19666|       |
19667|      0|        CASE(OP_define_array_el):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19668|      0|            {
19669|      0|                int ret;
19670|      0|                ret = JS_DefinePropertyValueValue(ctx, sp[-3], JS_DupValue(ctx, sp[-2]), sp[-1],
19671|      0|                                                  JS_PROP_C_W_E | JS_PROP_THROW);
  ------------------
  |  |  299|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                                                                JS_PROP_C_W_E | JS_PROP_THROW);
  ------------------
  |  |  318|      0|#define JS_PROP_THROW            (1 << 14)
  ------------------
19672|      0|                sp -= 1;
19673|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19674|      0|                    goto exception;
19675|      0|            }
19676|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19677|       |
19678|      0|        CASE(OP_append):    /* array pos enumobj -- array pos */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19679|      0|            {
19680|      0|                sf->cur_pc = pc;
19681|      0|                if (js_append_enumerate(ctx, sp))
  ------------------
  |  Branch (19681:21): [True: 0, False: 0]
  ------------------
19682|      0|                    goto exception;
19683|      0|                JS_FreeValue(ctx, *--sp);
19684|      0|            }
19685|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19686|       |
19687|      0|        CASE(OP_copy_data_properties):    /* target source excludeList */
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19688|      0|            {
19689|       |                /* stack offsets (-1 based):
19690|       |                   2 bits for target,
19691|       |                   3 bits for source,
19692|       |                   2 bits for exclusionList */
19693|      0|                int mask;
19694|       |
19695|      0|                mask = *pc++;
19696|      0|                sf->cur_pc = pc;
19697|      0|                if (JS_CopyDataProperties(ctx, sp[-1 - (mask & 3)],
  ------------------
  |  Branch (19697:21): [True: 0, False: 0]
  ------------------
19698|      0|                                          sp[-1 - ((mask >> 2) & 7)],
19699|      0|                                          sp[-1 - ((mask >> 5) & 7)], 0))
19700|      0|                    goto exception;
19701|      0|            }
19702|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19703|       |
19704|      2|        CASE(OP_add):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
19705|      2|            {
19706|      2|                JSValue op1, op2;
19707|      2|                op1 = sp[-2];
19708|      2|                op2 = sp[-1];
19709|      2|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {
  ------------------
  |  |   32|      2|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
19710|      0|                    int64_t r;
19711|      0|                    r = (int64_t)JS_VALUE_GET_INT(op1) + JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
                                  r = (int64_t)JS_VALUE_GET_INT(op1) + JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19712|      0|                    if (unlikely((int)r != r)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19713|      0|                        sp[-2] = __JS_NewFloat64(ctx, (double)r);
19714|      0|                    } else {
19715|      0|                        sp[-2] = JS_NewInt32(ctx, r);
19716|      0|                    }
19717|      0|                    sp--;
19718|      2|                } else if (JS_VALUE_IS_BOTH_FLOAT(op1, op2)) {
  ------------------
  |  |  283|      2|#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)))
  |  |  ------------------
  |  |  |  |  248|      4|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (248:32): [True: 1, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #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)))
  |  |  ------------------
  |  |  |  |  248|      1|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (248:32): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
19719|      0|                    sp[-2] = __JS_NewFloat64(ctx, JS_VALUE_GET_FLOAT64(op1) +
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19720|      0|                                             JS_VALUE_GET_FLOAT64(op2));
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19721|      0|                    sp--;
19722|      2|                } else if (JS_IsString(op1) && JS_IsString(op2)) {
  ------------------
  |  Branch (19722:28): [True: 1, False: 1]
  |  Branch (19722:48): [True: 0, False: 1]
  ------------------
19723|      0|                    sp[-2] = JS_ConcatString(ctx, op1, op2);
19724|      0|                    sp--;
19725|      0|                    if (JS_IsException(sp[-1]))
  ------------------
  |  Branch (19725:25): [True: 0, False: 0]
  ------------------
19726|      0|                        goto exception;
19727|      2|                } else {
19728|      2|                    sf->cur_pc = pc;
19729|      2|                    if (js_add_slow(ctx, sp))
  ------------------
  |  Branch (19729:25): [True: 0, False: 2]
  ------------------
19730|      0|                        goto exception;
19731|      2|                    sp--;
19732|      2|                }
19733|      2|            }
19734|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19735|      2|        CASE(OP_add_loc):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19736|      0|            {
19737|      0|                JSValue op2;
19738|      0|                JSValue *pv;
19739|      0|                int idx;
19740|      0|                idx = *pc;
19741|      0|                pc += 1;
19742|       |
19743|      0|                op2 = sp[-1];
19744|      0|                pv = &var_buf[idx];
19745|      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]
  |  |  ------------------
  ------------------
19746|      0|                    int64_t r;
19747|      0|                    r = (int64_t)JS_VALUE_GET_INT(*pv) + JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
                                  r = (int64_t)JS_VALUE_GET_INT(*pv) + JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19748|      0|                    if (unlikely((int)r != r)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19749|      0|                        *pv = __JS_NewFloat64(ctx, (double)r);
19750|      0|                    } else {
19751|      0|                        *pv = JS_NewInt32(ctx, r);
19752|      0|                    }
19753|      0|                    sp--;
19754|      0|                } else if (JS_VALUE_IS_BOTH_FLOAT(*pv, op2)) {
  ------------------
  |  |  283|      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)))
  |  |  ------------------
  |  |  |  |  248|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (248: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)))
  |  |  ------------------
  |  |  |  |  248|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (248:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
19755|      0|                    *pv = __JS_NewFloat64(ctx, JS_VALUE_GET_FLOAT64(*pv) +
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19756|      0|                                               JS_VALUE_GET_FLOAT64(op2));
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19757|      0|                    sp--;
19758|      0|                } else if (JS_VALUE_GET_TAG(*pv) == JS_TAG_STRING &&
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19758:28): [True: 0, False: 0]
  ------------------
19759|      0|                           JS_VALUE_GET_TAG(op2) == JS_TAG_STRING) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19759:28): [True: 0, False: 0]
  ------------------
19760|      0|                    sp--;
19761|      0|                    sf->cur_pc = pc;
19762|      0|                    if (JS_ConcatStringInPlace(ctx, JS_VALUE_GET_STRING(*pv), op2)) {
  ------------------
  |  |  228|      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 (19762:25): [True: 0, False: 0]
  ------------------
19763|      0|                        JS_FreeValue(ctx, op2);
19764|      0|                    } else {
19765|      0|                        op2 = JS_ConcatString(ctx, JS_DupValue(ctx, *pv), op2);
19766|      0|                        if (JS_IsException(op2))
  ------------------
  |  Branch (19766:29): [True: 0, False: 0]
  ------------------
19767|      0|                            goto exception;
19768|      0|                        set_value(ctx, pv, op2);
19769|      0|                    }
19770|      0|                } else {
19771|      0|                    JSValue ops[2];
19772|       |                    /* In case of exception, js_add_slow frees ops[0]
19773|       |                       and ops[1], so we must duplicate *pv */
19774|      0|                    sf->cur_pc = pc;
19775|      0|                    ops[0] = JS_DupValue(ctx, *pv);
19776|      0|                    ops[1] = op2;
19777|      0|                    sp--;
19778|      0|                    if (js_add_slow(ctx, ops + 2))
  ------------------
  |  Branch (19778:25): [True: 0, False: 0]
  ------------------
19779|      0|                        goto exception;
19780|      0|                    set_value(ctx, pv, ops[0]);
19781|      0|                }
19782|      0|            }
19783|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19784|      0|        CASE(OP_sub):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19785|      0|            {
19786|      0|                JSValue op1, op2;
19787|      0|                op1 = sp[-2];
19788|      0|                op2 = sp[-1];
19789|      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]
  |  |  ------------------
  ------------------
19790|      0|                    int64_t r;
19791|      0|                    r = (int64_t)JS_VALUE_GET_INT(op1) - JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
                                  r = (int64_t)JS_VALUE_GET_INT(op1) - JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19792|      0|                    if (unlikely((int)r != r)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19793|      0|                        sp[-2] = __JS_NewFloat64(ctx, (double)r);
19794|      0|                    } else {
19795|      0|                        sp[-2] = JS_NewInt32(ctx, r);
19796|      0|                    }
19797|      0|                    sp--;
19798|      0|                } else if (JS_VALUE_IS_BOTH_FLOAT(op1, op2)) {
  ------------------
  |  |  283|      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)))
  |  |  ------------------
  |  |  |  |  248|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (248: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)))
  |  |  ------------------
  |  |  |  |  248|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (248:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
19799|      0|                    sp[-2] = __JS_NewFloat64(ctx, JS_VALUE_GET_FLOAT64(op1) -
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19800|      0|                                             JS_VALUE_GET_FLOAT64(op2));
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19801|      0|                    sp--;
19802|      0|                } else {
19803|      0|                    goto binary_arith_slow;
19804|      0|                }
19805|      0|            }
19806|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19807|      1|        CASE(OP_mul):
  ------------------
  |  |17790|      1|#define CASE(op)        case_ ## op
  ------------------
19808|      1|            {
19809|      1|                JSValue op1, op2;
19810|      1|                double d;
19811|      1|                op1 = sp[-2];
19812|      1|                op2 = sp[-1];
19813|      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]
  |  |  ------------------
  ------------------
19814|      0|                    int32_t v1, v2;
19815|      0|                    int64_t r;
19816|      0|                    v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19817|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19818|      0|                    r = (int64_t)v1 * v2;
19819|      0|                    if (unlikely((int)r != r)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19820|      0|                        d = (double)r;
19821|      0|                        goto mul_fp_res;
19822|      0|                    }
19823|       |                    /* need to test zero case for -0 result */
19824|      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]
  |  |  ------------------
  ------------------
19825|      0|                        d = -0.0;
19826|      0|                        goto mul_fp_res;
19827|      0|                    }
19828|      0|                    sp[-2] = JS_NewInt32(ctx, r);
19829|      0|                    sp--;
19830|      1|                } else if (JS_VALUE_IS_BOTH_FLOAT(op1, op2)) {
  ------------------
  |  |  283|      1|#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)))
  |  |  ------------------
  |  |  |  |  248|      2|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (248:32): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #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)))
  |  |  ------------------
  |  |  |  |  248|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (248:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
19831|      0|                    d = JS_VALUE_GET_FLOAT64(op1) * JS_VALUE_GET_FLOAT64(op2);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
                                  d = JS_VALUE_GET_FLOAT64(op1) * JS_VALUE_GET_FLOAT64(op2);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19832|      0|                mul_fp_res:
19833|      0|                    sp[-2] = __JS_NewFloat64(ctx, d);
19834|      0|                    sp--;
19835|      1|                } else {
19836|      1|                    goto binary_arith_slow;
19837|      1|                }
19838|      1|            }
19839|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19840|      0|        CASE(OP_div):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19841|      0|            {
19842|      0|                JSValue op1, op2;
19843|      0|                op1 = sp[-2];
19844|      0|                op2 = sp[-1];
19845|      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]
  |  |  ------------------
  ------------------
19846|      0|                    int v1, v2;
19847|      0|                    v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19848|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19849|      0|                    sp[-2] = JS_NewFloat64(ctx, (double)v1 / (double)v2);
19850|      0|                    sp--;
19851|      0|                } else {
19852|      0|                    goto binary_arith_slow;
19853|      0|                }
19854|      0|            }
19855|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19856|      2|        CASE(OP_mod):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
19857|      2|            {
19858|      2|                JSValue op1, op2;
19859|      2|                op1 = sp[-2];
19860|      2|                op2 = sp[-1];
19861|      2|                if (likely(JS_VALUE_IS_BOTH_INT(op1, op2))) {
  ------------------
  |  |   32|      2|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
19862|      0|                    int v1, v2, r;
19863|      0|                    v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19864|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19865|       |                    /* We must avoid v2 = 0, v1 = INT32_MIN and v2 =
19866|       |                       -1 and the cases where the result is -0. */
19867|      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]
  |  |  ------------------
  ------------------
19868|      0|                        goto binary_arith_slow;
19869|      0|                    r = v1 % v2;
19870|      0|                    sp[-2] = JS_NewInt32(ctx, r);
19871|      0|                    sp--;
19872|      2|                } else {
19873|      2|                    goto binary_arith_slow;
19874|      2|                }
19875|      2|            }
19876|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19877|      0|        CASE(OP_pow):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19878|      3|        binary_arith_slow:
19879|      3|            sf->cur_pc = pc;
19880|      3|            if (js_binary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (19880:17): [True: 0, False: 3]
  ------------------
19881|      0|                goto exception;
19882|      3|            sp--;
19883|      3|            BREAK;
  ------------------
  |  |17792|      3|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      3|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19884|       |
19885|      3|        CASE(OP_plus):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19886|      0|            {
19887|      0|                JSValue op1;
19888|      0|                uint32_t tag;
19889|      0|                op1 = sp[-1];
19890|      0|                tag = JS_VALUE_GET_TAG(op1);
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
19891|      0|                if (tag == JS_TAG_INT || JS_TAG_IS_FLOAT64(tag)) {
  ------------------
  |  |  248|      0|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (248:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (19891:21): [True: 0, False: 0]
  ------------------
19892|      0|                } else if (tag == JS_TAG_NULL || tag == JS_TAG_BOOL) {
  ------------------
  |  Branch (19892:28): [True: 0, False: 0]
  |  Branch (19892:50): [True: 0, False: 0]
  ------------------
19893|      0|                    sp[-1] = JS_NewInt32(ctx, JS_VALUE_GET_INT(op1));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19894|      0|                } else {
19895|      0|                    sf->cur_pc = pc;
19896|      0|                    if (js_unary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (19896:25): [True: 0, False: 0]
  ------------------
19897|      0|                        goto exception;
19898|      0|                }
19899|      0|            }
19900|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19901|      2|        CASE(OP_neg):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
19902|      2|            {
19903|      2|                JSValue op1;
19904|      2|                uint32_t tag;
19905|      2|                int val;
19906|      2|                double d;
19907|      2|                op1 = sp[-1];
19908|      2|                tag = JS_VALUE_GET_TAG(op1);
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
19909|      2|                if (tag == JS_TAG_INT ||
  ------------------
  |  Branch (19909:21): [True: 0, False: 2]
  ------------------
19910|      2|                    tag == JS_TAG_BOOL ||
  ------------------
  |  Branch (19910:21): [True: 0, False: 2]
  ------------------
19911|      2|                    tag == JS_TAG_NULL) {
  ------------------
  |  Branch (19911:21): [True: 0, False: 2]
  ------------------
19912|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19913|       |                    /* Note: -0 cannot be expressed as integer */
19914|      0|                    if (unlikely(val == 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19915|      0|                        d = -0.0;
19916|      0|                        goto neg_fp_res;
19917|      0|                    }
19918|      0|                    if (unlikely(val == INT32_MIN)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19919|      0|                        d = -(double)val;
19920|      0|                        goto neg_fp_res;
19921|      0|                    }
19922|      0|                    sp[-1] = JS_NewInt32(ctx, -val);
19923|      2|                } else if (JS_TAG_IS_FLOAT64(tag)) {
  ------------------
  |  |  248|      2|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (248:32): [True: 0, False: 2]
  |  |  ------------------
  ------------------
19924|      0|                    d = -JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
19925|      0|                neg_fp_res:
19926|      0|                    sp[-1] = __JS_NewFloat64(ctx, d);
19927|      2|                } else {
19928|      2|                    sf->cur_pc = pc;
19929|      2|                    if (js_unary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (19929:25): [True: 0, False: 2]
  ------------------
19930|      0|                        goto exception;
19931|      2|                }
19932|      2|            }
19933|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19934|      2|        CASE(OP_inc):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19935|      0|            {
19936|      0|                JSValue op1;
19937|      0|                int val;
19938|      0|                op1 = sp[-1];
19939|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19939:21): [True: 0, False: 0]
  ------------------
19940|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19941|      0|                    if (unlikely(val == INT32_MAX))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19942|      0|                        goto inc_slow;
19943|      0|                    sp[-1] = JS_NewInt32(ctx, val + 1);
19944|      0|                } else {
19945|      0|                inc_slow:
19946|      0|                    sf->cur_pc = pc;
19947|      0|                    if (js_unary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (19947:25): [True: 0, False: 0]
  ------------------
19948|      0|                        goto exception;
19949|      0|                }
19950|      0|            }
19951|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19952|      0|        CASE(OP_dec):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19953|      0|            {
19954|      0|                JSValue op1;
19955|      0|                int val;
19956|      0|                op1 = sp[-1];
19957|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19957:21): [True: 0, False: 0]
  ------------------
19958|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19959|      0|                    if (unlikely(val == INT32_MIN))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19960|      0|                        goto dec_slow;
19961|      0|                    sp[-1] = JS_NewInt32(ctx, val - 1);
19962|      0|                } else {
19963|      0|                dec_slow:
19964|      0|                    sf->cur_pc = pc;
19965|      0|                    if (js_unary_arith_slow(ctx, sp, opcode))
  ------------------
  |  Branch (19965:25): [True: 0, False: 0]
  ------------------
19966|      0|                        goto exception;
19967|      0|                }
19968|      0|            }
19969|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19970|      0|        CASE(OP_post_inc):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19971|      0|            {
19972|      0|                JSValue op1;
19973|      0|                int val;
19974|      0|                op1 = sp[-1];
19975|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19975:21): [True: 0, False: 0]
  ------------------
19976|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19977|      0|                    if (unlikely(val == INT32_MAX))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19978|      0|                        goto post_inc_slow;
19979|      0|                    sp[0] = JS_NewInt32(ctx, val + 1);
19980|      0|                } else {
19981|      0|                post_inc_slow:
19982|      0|                    sf->cur_pc = pc;
19983|      0|                    if (js_post_inc_slow(ctx, sp, opcode))
  ------------------
  |  Branch (19983:25): [True: 0, False: 0]
  ------------------
19984|      0|                        goto exception;
19985|      0|                }
19986|      0|                sp++;
19987|      0|            }
19988|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
19989|      0|        CASE(OP_post_dec):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
19990|      0|            {
19991|      0|                JSValue op1;
19992|      0|                int val;
19993|      0|                op1 = sp[-1];
19994|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (19994:21): [True: 0, False: 0]
  ------------------
19995|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
19996|      0|                    if (unlikely(val == INT32_MIN))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19997|      0|                        goto post_dec_slow;
19998|      0|                    sp[0] = JS_NewInt32(ctx, val - 1);
19999|      0|                } else {
20000|      0|                post_dec_slow:
20001|      0|                    sf->cur_pc = pc;
20002|      0|                    if (js_post_inc_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20002:25): [True: 0, False: 0]
  ------------------
20003|      0|                        goto exception;
20004|      0|                }
20005|      0|                sp++;
20006|      0|            }
20007|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20008|      0|        CASE(OP_inc_loc):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20009|      0|            {
20010|      0|                JSValue op1;
20011|      0|                int val;
20012|      0|                int idx;
20013|      0|                idx = *pc;
20014|      0|                pc += 1;
20015|       |
20016|      0|                op1 = var_buf[idx];
20017|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20017:21): [True: 0, False: 0]
  ------------------
20018|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20019|      0|                    if (unlikely(val == INT32_MAX))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20020|      0|                        goto inc_loc_slow;
20021|      0|                    var_buf[idx] = JS_NewInt32(ctx, val + 1);
20022|      0|                } else {
20023|      0|                inc_loc_slow:
20024|      0|                    sf->cur_pc = pc;
20025|       |                    /* must duplicate otherwise the variable value may
20026|       |                       be destroyed before JS code accesses it */
20027|      0|                    op1 = JS_DupValue(ctx, op1);
20028|      0|                    if (js_unary_arith_slow(ctx, &op1 + 1, OP_inc))
  ------------------
  |  Branch (20028:25): [True: 0, False: 0]
  ------------------
20029|      0|                        goto exception;
20030|      0|                    set_value(ctx, &var_buf[idx], op1);
20031|      0|                }
20032|      0|            }
20033|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20034|      0|        CASE(OP_dec_loc):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20035|      0|            {
20036|      0|                JSValue op1;
20037|      0|                int val;
20038|      0|                int idx;
20039|      0|                idx = *pc;
20040|      0|                pc += 1;
20041|       |
20042|      0|                op1 = var_buf[idx];
20043|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20043:21): [True: 0, False: 0]
  ------------------
20044|      0|                    val = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20045|      0|                    if (unlikely(val == INT32_MIN))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20046|      0|                        goto dec_loc_slow;
20047|      0|                    var_buf[idx] = JS_NewInt32(ctx, val - 1);
20048|      0|                } else {
20049|      0|                dec_loc_slow:
20050|      0|                    sf->cur_pc = pc;
20051|       |                    /* must duplicate otherwise the variable value may
20052|       |                       be destroyed before JS code accesses it */
20053|      0|                    op1 = JS_DupValue(ctx, op1);
20054|      0|                    if (js_unary_arith_slow(ctx, &op1 + 1, OP_dec))
  ------------------
  |  Branch (20054:25): [True: 0, False: 0]
  ------------------
20055|      0|                        goto exception;
20056|      0|                    set_value(ctx, &var_buf[idx], op1);
20057|      0|                }
20058|      0|            }
20059|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20060|      0|        CASE(OP_not):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20061|      0|            {
20062|      0|                JSValue op1;
20063|      0|                op1 = sp[-1];
20064|      0|                if (JS_VALUE_GET_TAG(op1) == JS_TAG_INT) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20064:21): [True: 0, False: 0]
  ------------------
20065|      0|                    sp[-1] = JS_NewInt32(ctx, ~JS_VALUE_GET_INT(op1));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20066|      0|                } else {
20067|      0|                    sf->cur_pc = pc;
20068|      0|                    if (js_not_slow(ctx, sp))
  ------------------
  |  Branch (20068:25): [True: 0, False: 0]
  ------------------
20069|      0|                        goto exception;
20070|      0|                }
20071|      0|            }
20072|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20073|       |
20074|      0|        CASE(OP_shl):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20075|      0|            {
20076|      0|                JSValue op1, op2;
20077|      0|                op1 = sp[-2];
20078|      0|                op2 = sp[-1];
20079|      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]
  |  |  ------------------
  ------------------
20080|      0|                    uint32_t v1, v2;
20081|      0|                    v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20082|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20083|      0|                    v2 &= 0x1f;
20084|      0|                    sp[-2] = JS_NewInt32(ctx, v1 << v2);
20085|      0|                    sp--;
20086|      0|                } else {
20087|      0|                    sf->cur_pc = pc;
20088|      0|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20088:25): [True: 0, False: 0]
  ------------------
20089|      0|                        goto exception;
20090|      0|                    sp--;
20091|      0|                }
20092|      0|            }
20093|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20094|      0|        CASE(OP_shr):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20095|      0|            {
20096|      0|                JSValue op1, op2;
20097|      0|                op1 = sp[-2];
20098|      0|                op2 = sp[-1];
20099|      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]
  |  |  ------------------
  ------------------
20100|      0|                    uint32_t v2;
20101|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20102|      0|                    v2 &= 0x1f;
20103|      0|                    sp[-2] = JS_NewUint32(ctx,
20104|      0|                                          (uint32_t)JS_VALUE_GET_INT(op1) >>
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20105|      0|                                          v2);
20106|      0|                    sp--;
20107|      0|                } else {
20108|      0|                    sf->cur_pc = pc;
20109|      0|                    if (js_shr_slow(ctx, sp))
  ------------------
  |  Branch (20109:25): [True: 0, False: 0]
  ------------------
20110|      0|                        goto exception;
20111|      0|                    sp--;
20112|      0|                }
20113|      0|            }
20114|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20115|      0|        CASE(OP_sar):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20116|      0|            {
20117|      0|                JSValue op1, op2;
20118|      0|                op1 = sp[-2];
20119|      0|                op2 = sp[-1];
20120|      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]
  |  |  ------------------
  ------------------
20121|      0|                    uint32_t v2;
20122|      0|                    v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20123|      0|                    v2 &= 0x1f;
20124|      0|                    sp[-2] = JS_NewInt32(ctx,
20125|      0|                                          (int)JS_VALUE_GET_INT(op1) >> v2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20126|      0|                    sp--;
20127|      0|                } else {
20128|      0|                    sf->cur_pc = pc;
20129|      0|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20129:25): [True: 0, False: 0]
  ------------------
20130|      0|                        goto exception;
20131|      0|                    sp--;
20132|      0|                }
20133|      0|            }
20134|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20135|      1|        CASE(OP_and):
  ------------------
  |  |17790|      1|#define CASE(op)        case_ ## op
  ------------------
20136|      1|            {
20137|      1|                JSValue op1, op2;
20138|      1|                op1 = sp[-2];
20139|      1|                op2 = sp[-1];
20140|      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]
  |  |  ------------------
  ------------------
20141|      0|                    sp[-2] = JS_NewInt32(ctx,
20142|      0|                                         JS_VALUE_GET_INT(op1) &
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20143|      0|                                         JS_VALUE_GET_INT(op2));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20144|      0|                    sp--;
20145|      1|                } else {
20146|      1|                    sf->cur_pc = pc;
20147|      1|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20147:25): [True: 0, False: 1]
  ------------------
20148|      0|                        goto exception;
20149|      1|                    sp--;
20150|      1|                }
20151|      1|            }
20152|      1|            BREAK;
  ------------------
  |  |17792|      1|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      1|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20153|      1|        CASE(OP_or):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20154|      0|            {
20155|      0|                JSValue op1, op2;
20156|      0|                op1 = sp[-2];
20157|      0|                op2 = sp[-1];
20158|      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]
  |  |  ------------------
  ------------------
20159|      0|                    sp[-2] = JS_NewInt32(ctx,
20160|      0|                                         JS_VALUE_GET_INT(op1) |
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20161|      0|                                         JS_VALUE_GET_INT(op2));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20162|      0|                    sp--;
20163|      0|                } else {
20164|      0|                    sf->cur_pc = pc;
20165|      0|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20165:25): [True: 0, False: 0]
  ------------------
20166|      0|                        goto exception;
20167|      0|                    sp--;
20168|      0|                }
20169|      0|            }
20170|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20171|      0|        CASE(OP_xor):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20172|      0|            {
20173|      0|                JSValue op1, op2;
20174|      0|                op1 = sp[-2];
20175|      0|                op2 = sp[-1];
20176|      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]
  |  |  ------------------
  ------------------
20177|      0|                    sp[-2] = JS_NewInt32(ctx,
20178|      0|                                         JS_VALUE_GET_INT(op1) ^
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20179|      0|                                         JS_VALUE_GET_INT(op2));
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20180|      0|                    sp--;
20181|      0|                } else {
20182|      0|                    sf->cur_pc = pc;
20183|      0|                    if (js_binary_logic_slow(ctx, sp, opcode))
  ------------------
  |  Branch (20183:25): [True: 0, False: 0]
  ------------------
20184|      0|                        goto exception;
20185|      0|                    sp--;
20186|      0|                }
20187|      0|            }
20188|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20189|       |
20190|       |
20191|      0|#define OP_CMP(opcode, binary_op, slow_call)              \
20192|      0|            CASE(opcode):                                 \
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))) {           \
20198|      0|                    sp[-2] = JS_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
20199|      0|                    sp--;                                               \
20200|      0|                } else {                                                \
20201|      0|                    sf->cur_pc = pc;                                    \
20202|      0|                    if (slow_call)                                      \
20203|      0|                        goto exception;                                 \
20204|      0|                    sp--;                                               \
20205|      0|                }                                                       \
20206|      0|                }                                                       \
20207|      0|            BREAK
20208|       |
20209|      0|            OP_CMP(OP_lt, <, js_relational_slow(ctx, sp, opcode));
  ------------------
  |  |20192|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17790|      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_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  |  |  ------------------
  |  |                                   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) ((v).u.int32)
  |  |  ------------------
  |  |20199|      0|                    sp--;                                               \
  |  |20200|      0|                } else {                                                \
  |  |20201|      0|                    sf->cur_pc = pc;                                    \
  |  |20202|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20202:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20203|      0|                        goto exception;                                 \
  |  |20204|      0|                    sp--;                                               \
  |  |20205|      0|                }                                                       \
  |  |20206|      0|                }                                                       \
  |  |20207|      0|            BREAK
  |  |  ------------------
  |  |  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20210|      0|            OP_CMP(OP_lte, <=, js_relational_slow(ctx, sp, opcode));
  ------------------
  |  |20192|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17790|      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_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  |  |  ------------------
  |  |                                   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) ((v).u.int32)
  |  |  ------------------
  |  |20199|      0|                    sp--;                                               \
  |  |20200|      0|                } else {                                                \
  |  |20201|      0|                    sf->cur_pc = pc;                                    \
  |  |20202|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20202:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20203|      0|                        goto exception;                                 \
  |  |20204|      0|                    sp--;                                               \
  |  |20205|      0|                }                                                       \
  |  |20206|      0|                }                                                       \
  |  |20207|      0|            BREAK
  |  |  ------------------
  |  |  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20211|      0|            OP_CMP(OP_gt, >, js_relational_slow(ctx, sp, opcode));
  ------------------
  |  |20192|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17790|      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_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  |  |  ------------------
  |  |                                   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) ((v).u.int32)
  |  |  ------------------
  |  |20199|      0|                    sp--;                                               \
  |  |20200|      0|                } else {                                                \
  |  |20201|      0|                    sf->cur_pc = pc;                                    \
  |  |20202|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20202:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20203|      0|                        goto exception;                                 \
  |  |20204|      0|                    sp--;                                               \
  |  |20205|      0|                }                                                       \
  |  |20206|      0|                }                                                       \
  |  |20207|      0|            BREAK
  |  |  ------------------
  |  |  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20212|      0|            OP_CMP(OP_gte, >=, js_relational_slow(ctx, sp, opcode));
  ------------------
  |  |20192|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17790|      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_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  |  |  ------------------
  |  |                                   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) ((v).u.int32)
  |  |  ------------------
  |  |20199|      0|                    sp--;                                               \
  |  |20200|      0|                } else {                                                \
  |  |20201|      0|                    sf->cur_pc = pc;                                    \
  |  |20202|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20202:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20203|      0|                        goto exception;                                 \
  |  |20204|      0|                    sp--;                                               \
  |  |20205|      0|                }                                                       \
  |  |20206|      0|                }                                                       \
  |  |20207|      0|            BREAK
  |  |  ------------------
  |  |  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20213|      0|            OP_CMP(OP_eq, ==, js_eq_slow(ctx, sp, 0));
  ------------------
  |  |20192|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17790|      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_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  |  |  ------------------
  |  |                                   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) ((v).u.int32)
  |  |  ------------------
  |  |20199|      0|                    sp--;                                               \
  |  |20200|      0|                } else {                                                \
  |  |20201|      0|                    sf->cur_pc = pc;                                    \
  |  |20202|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20202:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20203|      0|                        goto exception;                                 \
  |  |20204|      0|                    sp--;                                               \
  |  |20205|      0|                }                                                       \
  |  |20206|      0|                }                                                       \
  |  |20207|      0|            BREAK
  |  |  ------------------
  |  |  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20214|      0|            OP_CMP(OP_neq, !=, js_eq_slow(ctx, sp, 1));
  ------------------
  |  |20192|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17790|      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_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  |  |  ------------------
  |  |                                   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) ((v).u.int32)
  |  |  ------------------
  |  |20199|      0|                    sp--;                                               \
  |  |20200|      0|                } else {                                                \
  |  |20201|      0|                    sf->cur_pc = pc;                                    \
  |  |20202|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20202:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20203|      0|                        goto exception;                                 \
  |  |20204|      0|                    sp--;                                               \
  |  |20205|      0|                }                                                       \
  |  |20206|      0|                }                                                       \
  |  |20207|      0|            BREAK
  |  |  ------------------
  |  |  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20215|      0|            OP_CMP(OP_strict_eq, ==, js_strict_eq_slow(ctx, sp, 0));
  ------------------
  |  |20192|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17790|      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_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  |  |  ------------------
  |  |                                   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) ((v).u.int32)
  |  |  ------------------
  |  |20199|      0|                    sp--;                                               \
  |  |20200|      0|                } else {                                                \
  |  |20201|      0|                    sf->cur_pc = pc;                                    \
  |  |20202|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20202:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20203|      0|                        goto exception;                                 \
  |  |20204|      0|                    sp--;                                               \
  |  |20205|      0|                }                                                       \
  |  |20206|      0|                }                                                       \
  |  |20207|      0|            BREAK
  |  |  ------------------
  |  |  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20216|      0|            OP_CMP(OP_strict_neq, !=, js_strict_eq_slow(ctx, sp, 1));
  ------------------
  |  |20192|      0|            CASE(opcode):                                 \
  |  |  ------------------
  |  |  |  |17790|      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_NewBool(ctx, JS_VALUE_GET_INT(op1) binary_op JS_VALUE_GET_INT(op2)); \
  |  |  ------------------
  |  |  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  |  |  ------------------
  |  |                                   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) ((v).u.int32)
  |  |  ------------------
  |  |20199|      0|                    sp--;                                               \
  |  |20200|      0|                } else {                                                \
  |  |20201|      0|                    sf->cur_pc = pc;                                    \
  |  |20202|      0|                    if (slow_call)                                      \
  |  |  ------------------
  |  |  |  Branch (20202:25): [True: 0, False: 0]
  |  |  ------------------
  |  |20203|      0|                        goto exception;                                 \
  |  |20204|      0|                    sp--;                                               \
  |  |20205|      0|                }                                                       \
  |  |20206|      0|                }                                                       \
  |  |20207|      0|            BREAK
  |  |  ------------------
  |  |  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  |  |  ------------------
  |  |  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
20217|       |
20218|      0|        CASE(OP_in):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20219|      0|            sf->cur_pc = pc;
20220|      0|            if (js_operator_in(ctx, sp))
  ------------------
  |  Branch (20220:17): [True: 0, False: 0]
  ------------------
20221|      0|                goto exception;
20222|      0|            sp--;
20223|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20224|      0|        CASE(OP_private_in):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20225|      0|            sf->cur_pc = pc;
20226|      0|            if (js_operator_private_in(ctx, sp))
  ------------------
  |  Branch (20226:17): [True: 0, False: 0]
  ------------------
20227|      0|                goto exception;
20228|      0|            sp--;
20229|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20230|      0|        CASE(OP_instanceof):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20231|      0|            sf->cur_pc = pc;
20232|      0|            if (js_operator_instanceof(ctx, sp))
  ------------------
  |  Branch (20232:17): [True: 0, False: 0]
  ------------------
20233|      0|                goto exception;
20234|      0|            sp--;
20235|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20236|      0|        CASE(OP_typeof):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20237|      0|            {
20238|      0|                JSValue op1;
20239|      0|                JSAtom atom;
20240|       |
20241|      0|                op1 = sp[-1];
20242|      0|                atom = js_operator_typeof(ctx, op1);
20243|      0|                JS_FreeValue(ctx, op1);
20244|      0|                sp[-1] = JS_AtomToString(ctx, atom);
20245|      0|            }
20246|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20247|      0|        CASE(OP_delete):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20248|      0|            sf->cur_pc = pc;
20249|      0|            if (js_operator_delete(ctx, sp))
  ------------------
  |  Branch (20249:17): [True: 0, False: 0]
  ------------------
20250|      0|                goto exception;
20251|      0|            sp--;
20252|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20253|      0|        CASE(OP_delete_var):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20254|      0|            {
20255|      0|                JSAtom atom;
20256|      0|                int ret;
20257|       |
20258|      0|                atom = get_u32(pc);
20259|      0|                pc += 4;
20260|      0|                sf->cur_pc = pc;
20261|       |
20262|      0|                ret = JS_DeleteGlobalVar(ctx, atom);
20263|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20264|      0|                    goto exception;
20265|      0|                *sp++ = JS_NewBool(ctx, ret);
20266|      0|            }
20267|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20268|       |
20269|      2|        CASE(OP_to_object):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
20270|      2|            if (JS_VALUE_GET_TAG(sp[-1]) != JS_TAG_OBJECT) {
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20270:17): [True: 0, False: 2]
  ------------------
20271|      0|                sf->cur_pc = pc;
20272|      0|                ret_val = JS_ToObject(ctx, sp[-1]);
20273|      0|                if (JS_IsException(ret_val))
  ------------------
  |  Branch (20273:21): [True: 0, False: 0]
  ------------------
20274|      0|                    goto exception;
20275|      0|                JS_FreeValue(ctx, sp[-1]);
20276|      0|                sp[-1] = ret_val;
20277|      0|            }
20278|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20279|       |
20280|      2|        CASE(OP_to_propkey):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20281|      0|            switch (JS_VALUE_GET_TAG(sp[-1])) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
20282|      0|            case JS_TAG_INT:
  ------------------
  |  Branch (20282:13): [True: 0, False: 0]
  ------------------
20283|      0|            case JS_TAG_STRING:
  ------------------
  |  Branch (20283:13): [True: 0, False: 0]
  ------------------
20284|      0|            case JS_TAG_SYMBOL:
  ------------------
  |  Branch (20284:13): [True: 0, False: 0]
  ------------------
20285|      0|                break;
20286|      0|            default:
  ------------------
  |  Branch (20286:13): [True: 0, False: 0]
  ------------------
20287|      0|                sf->cur_pc = pc;
20288|      0|                ret_val = JS_ToPropertyKey(ctx, sp[-1]);
20289|      0|                if (JS_IsException(ret_val))
  ------------------
  |  Branch (20289:21): [True: 0, False: 0]
  ------------------
20290|      0|                    goto exception;
20291|      0|                JS_FreeValue(ctx, sp[-1]);
20292|      0|                sp[-1] = ret_val;
20293|      0|                break;
20294|      0|            }
20295|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20296|       |
20297|       |#if 0
20298|       |        CASE(OP_to_string):
20299|       |            if (JS_VALUE_GET_TAG(sp[-1]) != JS_TAG_STRING) {
20300|       |                ret_val = JS_ToString(ctx, sp[-1]);
20301|       |                if (JS_IsException(ret_val))
20302|       |                    goto exception;
20303|       |                JS_FreeValue(ctx, sp[-1]);
20304|       |                sp[-1] = ret_val;
20305|       |            }
20306|       |            BREAK;
20307|       |#endif
20308|      0|        CASE(OP_with_get_var):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20309|      0|        CASE(OP_with_put_var):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20310|      0|        CASE(OP_with_delete_var):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20311|      0|        CASE(OP_with_make_ref):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20312|      0|        CASE(OP_with_get_ref):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20313|      0|            {
20314|      0|                JSAtom atom;
20315|      0|                int32_t diff;
20316|      0|                JSValue obj, val;
20317|      0|                int ret, is_with;
20318|      0|                atom = get_u32(pc);
20319|      0|                diff = get_u32(pc + 4);
20320|      0|                is_with = pc[8];
20321|      0|                pc += 9;
20322|      0|                sf->cur_pc = pc;
20323|       |
20324|      0|                obj = sp[-1];
20325|      0|                ret = JS_HasProperty(ctx, obj, atom);
20326|      0|                if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20327|      0|                    goto exception;
20328|      0|                if (ret) {
  ------------------
  |  Branch (20328:21): [True: 0, False: 0]
  ------------------
20329|      0|                    if (is_with) {
  ------------------
  |  Branch (20329:25): [True: 0, False: 0]
  ------------------
20330|      0|                        ret = js_has_unscopable(ctx, obj, atom);
20331|      0|                        if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20332|      0|                            goto exception;
20333|      0|                        if (ret)
  ------------------
  |  Branch (20333:29): [True: 0, False: 0]
  ------------------
20334|      0|                            goto no_with;
20335|      0|                    }
20336|      0|                    switch (opcode) {
  ------------------
  |  Branch (20336:29): [True: 0, False: 0]
  ------------------
20337|      0|                    case OP_with_get_var:
  ------------------
  |  Branch (20337:21): [True: 0, False: 0]
  ------------------
20338|       |                        /* in Object Environment Records, GetBindingValue() calls HasProperty() */
20339|      0|                        ret = JS_HasProperty(ctx, obj, atom);
20340|      0|                        if (unlikely(ret <= 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20341|      0|                            if (ret < 0)
  ------------------
  |  Branch (20341:33): [True: 0, False: 0]
  ------------------
20342|      0|                                goto exception;
20343|      0|                            if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (20343:33): [True: 0, False: 0]
  ------------------
20344|      0|                                JS_ThrowReferenceErrorNotDefined(ctx, atom);
20345|      0|                                goto exception;
20346|      0|                            } 
20347|      0|                            val = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20348|      0|                        } else {
20349|      0|                            val = JS_GetProperty(ctx, obj, atom);
20350|      0|                            if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20351|      0|                                goto exception;
20352|      0|                        }
20353|      0|                        set_value(ctx, &sp[-1], val);
20354|      0|                        break;
20355|      0|                    case OP_with_put_var: /* used e.g. in for in/of */
  ------------------
  |  Branch (20355:21): [True: 0, False: 0]
  ------------------
20356|       |                        /* in Object Environment Records, SetMutableBinding() calls HasProperty() */
20357|      0|                        ret = JS_HasProperty(ctx, obj, atom);
20358|      0|                        if (unlikely(ret <= 0)) {
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20359|      0|                            if (ret < 0)
  ------------------
  |  Branch (20359:33): [True: 0, False: 0]
  ------------------
20360|      0|                                goto exception;
20361|      0|                            if (is_strict_mode(ctx)) {
  ------------------
  |  Branch (20361:33): [True: 0, False: 0]
  ------------------
20362|      0|                                JS_ThrowReferenceErrorNotDefined(ctx, atom);
20363|      0|                                goto exception;
20364|      0|                            } 
20365|      0|                        }
20366|      0|                        ret = JS_SetPropertyInternal(ctx, obj, atom, sp[-2], obj,
20367|      0|                                                     JS_PROP_THROW_STRICT);
  ------------------
  |  |  321|      0|#define JS_PROP_THROW_STRICT     (1 << 15)
  ------------------
20368|      0|                        JS_FreeValue(ctx, sp[-1]);
20369|      0|                        sp -= 2;
20370|      0|                        if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20371|      0|                            goto exception;
20372|      0|                        break;
20373|      0|                    case OP_with_delete_var:
  ------------------
  |  Branch (20373:21): [True: 0, False: 0]
  ------------------
20374|      0|                        ret = JS_DeleteProperty(ctx, obj, atom, 0);
20375|      0|                        if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20376|      0|                            goto exception;
20377|      0|                        JS_FreeValue(ctx, sp[-1]);
20378|      0|                        sp[-1] = JS_NewBool(ctx, ret);
20379|      0|                        break;
20380|      0|                    case OP_with_make_ref:
  ------------------
  |  Branch (20380:21): [True: 0, False: 0]
  ------------------
20381|       |                        /* produce a pair object/propname on the stack */
20382|      0|                        *sp++ = JS_AtomToValue(ctx, atom);
20383|      0|                        break;
20384|      0|                    case OP_with_get_ref:
  ------------------
  |  Branch (20384:21): [True: 0, False: 0]
  ------------------
20385|       |                        /* produce a pair object/method on the stack */
20386|       |                        /* in Object Environment Records, GetBindingValue() calls HasProperty() */
20387|      0|                        ret = JS_HasProperty(ctx, obj, atom);
20388|      0|                        if (unlikely(ret < 0))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20389|      0|                            goto exception;
20390|      0|                        if (!ret) {
  ------------------
  |  Branch (20390:29): [True: 0, False: 0]
  ------------------
20391|      0|                            val = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20392|      0|                        } else {
20393|      0|                            val = JS_GetProperty(ctx, obj, atom);
20394|      0|                            if (unlikely(JS_IsException(val)))
  ------------------
  |  |   33|      0|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
20395|      0|                                goto exception;
20396|      0|                        }
20397|      0|                        *sp++ = val;
20398|      0|                        break;
20399|      0|                    }
20400|      0|                    pc += diff - 5;
20401|      0|                } else {
20402|      0|                no_with:
20403|       |                    /* if not jumping, drop the object argument */
20404|      0|                    JS_FreeValue(ctx, sp[-1]);
20405|      0|                    sp--;
20406|      0|                }
20407|      0|            }
20408|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20409|       |
20410|      0|        CASE(OP_await):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20411|      0|            ret_val = JS_NewInt32(ctx, FUNC_RET_AWAIT);
  ------------------
  |  |17752|      0|#define FUNC_RET_AWAIT         0
  ------------------
20412|      0|            goto done_generator;
20413|      0|        CASE(OP_yield):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20414|      0|            ret_val = JS_NewInt32(ctx, FUNC_RET_YIELD);
  ------------------
  |  |17753|      0|#define FUNC_RET_YIELD         1
  ------------------
20415|      0|            goto done_generator;
20416|      0|        CASE(OP_yield_star):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20417|      0|        CASE(OP_async_yield_star):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20418|      0|            ret_val = JS_NewInt32(ctx, FUNC_RET_YIELD_STAR);
  ------------------
  |  |17754|      0|#define FUNC_RET_YIELD_STAR    2
  ------------------
20419|      0|            goto done_generator;
20420|     13|        CASE(OP_return_async):
  ------------------
  |  |17790|     13|#define CASE(op)        case_ ## op
  ------------------
20421|     13|            ret_val = JS_UNDEFINED;
  ------------------
  |  |  289|     13|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     13|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20422|     13|            goto done_generator;
20423|      0|        CASE(OP_initial_yield):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20424|      0|            ret_val = JS_NewInt32(ctx, FUNC_RET_INITIAL_YIELD);
  ------------------
  |  |17755|      0|#define FUNC_RET_INITIAL_YIELD 3
  ------------------
20425|      0|            goto done_generator;
20426|       |
20427|      0|        CASE(OP_nop):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20428|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20429|      0|        CASE(OP_is_undefined_or_null):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20430|      0|            if (JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_UNDEFINED ||
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20430:17): [True: 0, False: 0]
  ------------------
20431|      0|                JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_NULL) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20431:17): [True: 0, False: 0]
  ------------------
20432|      0|                goto set_true;
20433|      0|            } else {
20434|      0|                goto free_and_set_false;
20435|      0|            }
20436|      0|#if SHORT_OPCODES
20437|      2|        CASE(OP_is_undefined):
  ------------------
  |  |17790|      2|#define CASE(op)        case_ ## op
  ------------------
20438|      2|            if (JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_UNDEFINED) {
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20438:17): [True: 0, False: 2]
  ------------------
20439|      0|                goto set_true;
20440|      2|            } else {
20441|      2|                goto free_and_set_false;
20442|      2|            }
20443|      0|        CASE(OP_is_null):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20444|      0|            if (JS_VALUE_GET_TAG(sp[-1]) == JS_TAG_NULL) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20444:17): [True: 0, False: 0]
  ------------------
20445|      0|                goto set_true;
20446|      0|            } else {
20447|      0|                goto free_and_set_false;
20448|      0|            }
20449|       |            /* XXX: could merge to a single opcode */
20450|      0|        CASE(OP_typeof_is_undefined):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20451|       |            /* different from OP_is_undefined because of isHTMLDDA */
20452|      0|            if (js_operator_typeof(ctx, sp[-1]) == JS_ATOM_undefined) {
  ------------------
  |  Branch (20452:17): [True: 0, False: 0]
  ------------------
20453|      0|                goto free_and_set_true;
20454|      0|            } else {
20455|      0|                goto free_and_set_false;
20456|      0|            }
20457|      0|        CASE(OP_typeof_is_function):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20458|      0|            if (js_operator_typeof(ctx, sp[-1]) == JS_ATOM_function) {
  ------------------
  |  Branch (20458:17): [True: 0, False: 0]
  ------------------
20459|      0|                goto free_and_set_true;
20460|      0|            } else {
20461|      0|                goto free_and_set_false;
20462|      0|            }
20463|      0|        free_and_set_true:
20464|      0|            JS_FreeValue(ctx, sp[-1]);
20465|      0|#endif
20466|      0|        set_true:
20467|      0|            sp[-1] = JS_TRUE;
  ------------------
  |  |  291|      0|#define JS_TRUE      JS_MKVAL(JS_TAG_BOOL, 1)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20468|      0|            BREAK;
  ------------------
  |  |17792|      0|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      0|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20469|      2|        free_and_set_false:
20470|      2|            JS_FreeValue(ctx, sp[-1]);
20471|      2|            sp[-1] = JS_FALSE;
  ------------------
  |  |  290|      2|#define JS_FALSE     JS_MKVAL(JS_TAG_BOOL, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20472|      2|            BREAK;
  ------------------
  |  |17792|      2|#define BREAK           SWITCH(pc)
  |  |  ------------------
  |  |  |  |17789|      2|#define SWITCH(pc)      goto *dispatch_table[opcode = *pc++];
  |  |  ------------------
  ------------------
20473|      2|        CASE(OP_invalid):
  ------------------
  |  |17790|      0|#define CASE(op)        case_ ## op
  ------------------
20474|      0|        DEFAULT:
  ------------------
  |  |17791|      0|#define DEFAULT         case_default
  ------------------
20475|      0|            JS_ThrowInternalError(ctx, "invalid opcode: pc=%u opcode=0x%02x",
20476|      0|                                  (int)(pc - b->byte_code_buf - 1), opcode);
20477|      0|            goto exception;
20478|      0|        }
20479|      0|    }
20480|     11| exception:
20481|     11|    if (is_backtrace_needed(ctx, rt->current_exception)) {
  ------------------
  |  Branch (20481:9): [True: 9, False: 2]
  ------------------
20482|       |        /* add the backtrace information now (it is not done
20483|       |           before if the exception happens in a bytecode
20484|       |           operation */
20485|      9|        sf->cur_pc = pc;
20486|      9|        build_backtrace(ctx, rt->current_exception, NULL, 0, 0, 0);
20487|      9|    }
20488|     11|    if (!rt->current_exception_is_uncatchable) {
  ------------------
  |  Branch (20488:9): [True: 10, False: 1]
  ------------------
20489|     13|        while (sp > stack_buf) {
  ------------------
  |  Branch (20489:16): [True: 3, False: 10]
  ------------------
20490|      3|            JSValue val = *--sp;
20491|      3|            JS_FreeValue(ctx, val);
20492|      3|            if (JS_VALUE_GET_TAG(val) == JS_TAG_CATCH_OFFSET) {
  ------------------
  |  |  236|      3|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20492:17): [True: 0, False: 3]
  ------------------
20493|      0|                int pos = JS_VALUE_GET_INT(val);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
20494|      0|                if (pos == 0) {
  ------------------
  |  Branch (20494:21): [True: 0, False: 0]
  ------------------
20495|       |                    /* enumerator: close it with a throw */
20496|      0|                    JS_FreeValue(ctx, sp[-1]); /* drop the next method */
20497|      0|                    sp--;
20498|      0|                    JS_IteratorClose(ctx, sp[-1], TRUE);
20499|      0|                } else {
20500|      0|                    *sp++ = rt->current_exception;
20501|      0|                    rt->current_exception = JS_UNINITIALIZED;
  ------------------
  |  |  293|      0|#define JS_UNINITIALIZED JS_MKVAL(JS_TAG_UNINITIALIZED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20502|      0|                    pc = b->byte_code_buf + pos;
20503|      0|                    goto restart;
20504|      0|                }
20505|      0|            }
20506|      3|        }
20507|     10|    }
20508|     11|    ret_val = JS_EXCEPTION;
  ------------------
  |  |  292|     11|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|     11|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20509|       |    /* the local variables are freed by the caller in the generator
20510|       |       case. Hence the label 'done' should never be reached in a
20511|       |       generator function. */
20512|     11|    if (b->func_kind != JS_FUNC_NORMAL) {
  ------------------
  |  Branch (20512:9): [True: 0, False: 11]
  ------------------
20513|     13|    done_generator:
20514|     13|        sf->cur_pc = pc;
20515|     13|        sf->cur_sp = sp;
20516|     13|    } else {
20517|     27|    done:
20518|     27|        if (unlikely(b->var_ref_count != 0)) {
  ------------------
  |  |   33|     27|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 27]
  |  |  ------------------
  ------------------
20519|       |            /* variable references reference the stack: must close them */
20520|      0|            close_var_refs(rt, b, sf);
20521|      0|        }
20522|       |        /* free the local variables and stack */
20523|     58|        for(pval = local_buf; pval < sp; pval++) {
  ------------------
  |  Branch (20523:31): [True: 31, False: 27]
  ------------------
20524|     31|            JS_FreeValue(ctx, *pval);
20525|     31|        }
20526|     27|    }
20527|     40|    rt->current_stack_frame = sf->prev_frame;
20528|     40|    return ret_val;
20529|     11|}
quickjs.c:js_closure:
17389|     14|{
17390|     14|    JSFunctionBytecode *b;
17391|     14|    JSValue func_obj;
17392|     14|    JSAtom name_atom;
17393|       |
17394|     14|    b = JS_VALUE_GET_PTR(bfunc);
  ------------------
  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
17395|     14|    func_obj = JS_NewObjectClass(ctx, func_kind_to_class_id[b->func_kind]);
17396|     14|    if (JS_IsException(func_obj)) {
  ------------------
  |  Branch (17396:9): [True: 0, False: 14]
  ------------------
17397|      0|        JS_FreeValue(ctx, bfunc);
17398|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17399|      0|    }
17400|     14|    func_obj = js_closure2(ctx, func_obj, b, cur_var_refs, sf, is_eval, NULL);
17401|     14|    if (JS_IsException(func_obj)) {
  ------------------
  |  Branch (17401:9): [True: 0, False: 14]
  ------------------
17402|       |        /* bfunc has been freed */
17403|      0|        goto fail;
17404|      0|    }
17405|     14|    name_atom = b->func_name;
17406|     14|    if (name_atom == JS_ATOM_NULL)
  ------------------
  |  |  449|     14|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (17406:9): [True: 2, False: 12]
  ------------------
17407|      2|        name_atom = JS_ATOM_empty_string;
17408|     14|    js_function_set_properties(ctx, func_obj, name_atom,
17409|     14|                               b->defined_arg_count);
17410|       |
17411|     14|    if (b->func_kind & JS_FUNC_GENERATOR) {
  ------------------
  |  Branch (17411:9): [True: 0, False: 14]
  ------------------
17412|      0|        JSValue proto;
17413|      0|        int proto_class_id;
17414|       |        /* generators have a prototype field which is used as
17415|       |           prototype for the generator object */
17416|      0|        if (b->func_kind == JS_FUNC_ASYNC_GENERATOR)
  ------------------
  |  Branch (17416:13): [True: 0, False: 0]
  ------------------
17417|      0|            proto_class_id = JS_CLASS_ASYNC_GENERATOR;
17418|      0|        else
17419|      0|            proto_class_id = JS_CLASS_GENERATOR;
17420|      0|        proto = JS_NewObjectProto(ctx, ctx->class_proto[proto_class_id]);
17421|      0|        if (JS_IsException(proto))
  ------------------
  |  Branch (17421:13): [True: 0, False: 0]
  ------------------
17422|      0|            goto fail;
17423|      0|        JS_DefinePropertyValue(ctx, func_obj, JS_ATOM_prototype, proto,
17424|      0|                               JS_PROP_WRITABLE);
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
17425|     14|    } else if (b->has_prototype) {
  ------------------
  |  Branch (17425:16): [True: 0, False: 14]
  ------------------
17426|       |        /* add the 'prototype' property: delay instantiation to avoid
17427|       |           creating cycles for every javascript function. The prototype
17428|       |           object is created on the fly when first accessed */
17429|      0|        JS_SetConstructorBit(ctx, func_obj, TRUE);
17430|      0|        JS_DefineAutoInitProperty(ctx, func_obj, JS_ATOM_prototype,
17431|      0|                                  JS_AUTOINIT_ID_PROTOTYPE, NULL,
17432|      0|                                  JS_PROP_WRITABLE);
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
17433|      0|    }
17434|     14|    return func_obj;
17435|      0| fail:
17436|       |    /* bfunc is freed when func_obj is freed */
17437|      0|    JS_FreeValue(ctx, func_obj);
17438|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17439|     14|}
quickjs.c:js_closure2:
17284|     28|{
17285|     28|    JSObject *p;
17286|     28|    JSVarRef **var_refs;
17287|     28|    int i;
17288|       |
17289|     28|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  227|     28|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     28|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17290|     28|    p->u.func.function_bytecode = b;
17291|     28|    p->u.func.home_object = NULL;
17292|     28|    p->u.func.var_refs = NULL;
17293|     28|    if (b->closure_var_count) {
  ------------------
  |  Branch (17293:9): [True: 26, False: 2]
  ------------------
17294|     26|        var_refs = js_mallocz(ctx, sizeof(var_refs[0]) * b->closure_var_count);
17295|     26|        if (!var_refs)
  ------------------
  |  Branch (17295:13): [True: 0, False: 26]
  ------------------
17296|      0|            goto fail;
17297|     26|        p->u.func.var_refs = var_refs;
17298|     26|        if (is_eval) {
  ------------------
  |  Branch (17298:13): [True: 24, False: 2]
  ------------------
17299|       |            /* first pass to check the global variable definitions */
17300|     81|            for(i = 0; i < b->closure_var_count; i++) {
  ------------------
  |  Branch (17300:24): [True: 57, False: 24]
  ------------------
17301|     57|                JSClosureVar *cv = &b->closure_var[i];
17302|     57|                if (cv->closure_type == JS_CLOSURE_GLOBAL_DECL) {
  ------------------
  |  Branch (17302:21): [True: 0, False: 57]
  ------------------
17303|      0|                    int flags;
17304|      0|                    flags = 0;
17305|      0|                    if (cv->is_lexical)
  ------------------
  |  Branch (17305:25): [True: 0, False: 0]
  ------------------
17306|      0|                        flags |= DEFINE_GLOBAL_LEX_VAR;
  ------------------
  |  |10800|      0|#define DEFINE_GLOBAL_LEX_VAR (1 << 7)
  ------------------
17307|      0|                    if (cv->var_kind == JS_VAR_GLOBAL_FUNCTION_DECL)
  ------------------
  |  Branch (17307:25): [True: 0, False: 0]
  ------------------
17308|      0|                        flags |= DEFINE_GLOBAL_FUNC_VAR;
  ------------------
  |  |10801|      0|#define DEFINE_GLOBAL_FUNC_VAR (1 << 6)
  ------------------
17309|      0|                    if (JS_CheckDefineGlobalVar(ctx, cv->var_name, flags))
  ------------------
  |  Branch (17309:25): [True: 0, False: 0]
  ------------------
17310|      0|                        goto fail;
17311|      0|                }
17312|     57|            }
17313|     24|        }
17314|     90|        for(i = 0; i < b->closure_var_count; i++) {
  ------------------
  |  Branch (17314:20): [True: 64, False: 26]
  ------------------
17315|     64|            JSClosureVar *cv = &b->closure_var[i];
17316|     64|            JSVarRef *var_ref;
17317|     64|            switch(cv->closure_type) {
17318|      0|            case JS_CLOSURE_MODULE_IMPORT:
  ------------------
  |  Branch (17318:13): [True: 0, False: 64]
  ------------------
17319|       |                /* imported from other modules */
17320|      0|                continue;
17321|     28|            case JS_CLOSURE_MODULE_DECL:
  ------------------
  |  Branch (17321:13): [True: 28, False: 36]
  ------------------
17322|     28|                var_ref = js_create_var_ref(ctx, cv->is_lexical);
17323|     28|                break;
17324|      0|            case JS_CLOSURE_GLOBAL_DECL:
  ------------------
  |  Branch (17324:13): [True: 0, False: 64]
  ------------------
17325|      0|                var_ref = js_closure_define_global_var(ctx, cv, b->is_direct_or_indirect_eval);
17326|      0|                break;
17327|     29|            case JS_CLOSURE_GLOBAL:
  ------------------
  |  Branch (17327:13): [True: 29, False: 35]
  ------------------
17328|     29|                var_ref = js_closure_global_var(ctx, cv);
17329|     29|                break;
17330|      0|            case JS_CLOSURE_LOCAL:
  ------------------
  |  Branch (17330:13): [True: 0, False: 64]
  ------------------
17331|       |                /* reuse the existing variable reference if it already exists */
17332|      0|                var_ref = get_var_ref(ctx, sf, cv->var_idx, FALSE);
17333|      0|                break;
17334|      0|            case JS_CLOSURE_ARG:
  ------------------
  |  Branch (17334:13): [True: 0, False: 64]
  ------------------
17335|       |                /* reuse the existing variable reference if it already exists */
17336|      0|                var_ref = get_var_ref(ctx, sf, cv->var_idx, TRUE);
17337|      0|                break;
17338|      0|            case JS_CLOSURE_REF:
  ------------------
  |  Branch (17338:13): [True: 0, False: 64]
  ------------------
17339|      7|            case JS_CLOSURE_GLOBAL_REF:
  ------------------
  |  Branch (17339:13): [True: 7, False: 57]
  ------------------
17340|      7|                var_ref = cur_var_refs[cv->var_idx];
17341|      7|                js_rc(var_ref)->ref_count++;
17342|      7|                break;
17343|      0|            default:
  ------------------
  |  Branch (17343:13): [True: 0, False: 64]
  ------------------
17344|      0|                abort();
17345|     64|            }
17346|     64|            if (!var_ref)
  ------------------
  |  Branch (17346:17): [True: 0, False: 64]
  ------------------
17347|      0|                goto fail;
17348|     64|            var_refs[i] = var_ref;
17349|     64|        }
17350|     26|    }
17351|     28|    return func_obj;
17352|      0| fail:
17353|       |    /* bfunc is freed when func_obj is freed */
17354|      0|    JS_FreeValue(ctx, func_obj);
17355|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
17356|     28|}
quickjs.c:find_own_property1:
 6108|     23|{
 6109|     23|    JSShape *sh;
 6110|     23|    JSShapeProperty *pr, *prop;
 6111|     23|    intptr_t h;
 6112|     23|    sh = p->shape;
 6113|     23|    h = (uintptr_t)atom & sh->prop_hash_mask;
 6114|     23|    h = sh->hash_table[h];
 6115|     23|    prop = get_shape_prop(sh);
 6116|     23|    while (h) {
  ------------------
  |  Branch (6116:12): [True: 14, False: 9]
  ------------------
 6117|     14|        pr = &prop[h - 1];
 6118|     14|        if (likely(pr->atom == atom)) {
  ------------------
  |  |   32|     14|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 14, False: 0]
  |  |  ------------------
  ------------------
 6119|     14|            return pr;
 6120|     14|        }
 6121|      0|        h = pr->hash_next;
 6122|      0|    }
 6123|      9|    return NULL;
 6124|     23|}
quickjs.c:js_global_object_get_uninitialized_var:
17088|     13|{
17089|     13|    JSObject *p = JS_VALUE_GET_OBJ(p1->u.global_object.uninitialized_vars);
  ------------------
  |  |  227|     13|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     13|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17090|     13|    JSShapeProperty *prs;
17091|     13|    JSProperty *pr;
17092|     13|    JSVarRef *var_ref;
17093|       |    
17094|     13|    prs = find_own_property(&pr, p, atom);
17095|     13|    if (prs) {
  ------------------
  |  Branch (17095:9): [True: 0, False: 13]
  ------------------
17096|      0|        assert((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF);
  ------------------
  |  Branch (17096:9): [True: 0, False: 0]
  |  Branch (17096:9): [True: 0, False: 0]
  ------------------
17097|      0|        var_ref = pr->u.var_ref;
17098|      0|        js_rc(var_ref)->ref_count++;
17099|      0|        return var_ref;
17100|      0|    }
17101|       |
17102|     13|    var_ref = js_create_var_ref(ctx, TRUE);
17103|     13|    if (!var_ref)
  ------------------
  |  Branch (17103:9): [True: 0, False: 13]
  ------------------
17104|      0|        return NULL;
17105|     13|    pr = add_property(ctx, p, atom, JS_PROP_C_W_E | JS_PROP_VARREF);
  ------------------
  |  |  299|     13|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|     13|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|     13|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|     13|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                  pr = add_property(ctx, p, atom, JS_PROP_C_W_E | JS_PROP_VARREF);
  ------------------
  |  |  304|     13|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
17106|     13|    if (unlikely(!pr)) {
  ------------------
  |  |   33|     13|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 13]
  |  |  ------------------
  ------------------
17107|      0|        free_var_ref(ctx->rt, var_ref);
17108|      0|        return NULL;
17109|      0|    }
17110|     13|    pr->u.var_ref = var_ref;
17111|     13|    js_rc(var_ref)->ref_count++;
17112|     13|    return var_ref;
17113|     13|}
quickjs.c:js_closure_global_var:
17246|     29|{
17247|     29|    JSObject *p;
17248|     29|    JSShapeProperty *prs;
17249|     29|    JSProperty *pr;
17250|     29|    JSVarRef *var_ref;
17251|       |    
17252|     29|    p = JS_VALUE_GET_OBJ(ctx->global_var_obj);
  ------------------
  |  |  227|     29|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     29|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17253|     29|    prs = find_own_property(&pr, p, cv->var_name);
17254|     29|    if (prs) {
  ------------------
  |  Branch (17254:9): [True: 0, False: 29]
  ------------------
17255|      0|        assert((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF);
  ------------------
  |  Branch (17255:9): [True: 0, False: 0]
  |  Branch (17255:9): [True: 0, False: 0]
  ------------------
17256|      0|        var_ref = pr->u.var_ref;
17257|      0|        js_rc(var_ref)->ref_count++;
17258|      0|        return var_ref;
17259|      0|    }
17260|     29|    p = JS_VALUE_GET_OBJ(ctx->global_obj);
  ------------------
  |  |  227|     29|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     29|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
17261|     31| redo:
17262|     31|    prs = find_own_property(&pr, p, cv->var_name);
17263|     31|    if (prs) {
  ------------------
  |  Branch (17263:9): [True: 18, False: 13]
  ------------------
17264|     18|        if (unlikely((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT)) {
  ------------------
  |  |   33|     18|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 16]
  |  |  ------------------
  ------------------
17265|       |            /* Instantiate property and retry */
17266|      2|            if (JS_AutoInitProperty(ctx, p, cv->var_name, pr, prs))
  ------------------
  |  Branch (17266:17): [True: 0, False: 2]
  ------------------
17267|      0|                return NULL;
17268|      2|            goto redo;
17269|      2|        }
17270|     16|        if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  301|     16|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                      if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
  ------------------
  |  |  304|     16|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
  |  Branch (17270:13): [True: 16, False: 0]
  ------------------
17271|     16|            var_ref = pr->u.var_ref;
17272|     16|            js_rc(var_ref)->ref_count++;
17273|     16|            return var_ref;
17274|     16|        }
17275|     16|    }
17276|     13|    return js_global_object_get_uninitialized_var(ctx, p, cv->var_name);
17277|     31|}
quickjs.c:JS_DefineAutoInitProperty:
10642|  6.05k|{
10643|  6.05k|    JSObject *p;
10644|  6.05k|    JSProperty *pr;
10645|       |
10646|  6.05k|    if (JS_VALUE_GET_TAG(this_obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|  6.05k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10646:9): [True: 0, False: 6.05k]
  ------------------
10647|      0|        return FALSE;
10648|       |
10649|  6.05k|    p = JS_VALUE_GET_OBJ(this_obj);
  ------------------
  |  |  227|  6.05k|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  6.05k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10650|       |
10651|  6.05k|    if (find_own_property(&pr, p, prop)) {
  ------------------
  |  Branch (10651:9): [True: 0, False: 6.05k]
  ------------------
10652|       |        /* property already exists */
10653|      0|        abort();
10654|      0|        return FALSE;
10655|      0|    }
10656|       |
10657|       |    /* Specialized CreateProperty */
10658|  6.05k|    pr = add_property(ctx, p, prop, (flags & JS_PROP_C_W_E) | JS_PROP_AUTOINIT);
  ------------------
  |  |  299|  6.05k|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|  6.05k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|  6.05k|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|  6.05k|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                  pr = add_property(ctx, p, prop, (flags & JS_PROP_C_W_E) | JS_PROP_AUTOINIT);
  ------------------
  |  |  305|  6.05k|#define JS_PROP_AUTOINIT       (3 << 4) /* used internally */
  ------------------
10659|  6.05k|    if (unlikely(!pr))
  ------------------
  |  |   33|  6.05k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 6.05k]
  |  |  ------------------
  ------------------
10660|      0|        return -1;
10661|  6.05k|    pr->u.init.realm_and_id = (uintptr_t)JS_DupContext(ctx);
10662|  6.05k|    assert((pr->u.init.realm_and_id & 3) == 0);
  ------------------
  |  Branch (10662:5): [True: 0, False: 6.05k]
  |  Branch (10662:5): [True: 6.05k, False: 0]
  ------------------
10663|  6.05k|    assert(id <= 3);
  ------------------
  |  Branch (10663:5): [True: 0, False: 6.05k]
  |  Branch (10663:5): [True: 6.05k, False: 0]
  ------------------
10664|  6.05k|    pr->u.init.realm_and_id |= id;
10665|  6.05k|    pr->u.init.opaque = opaque;
10666|  6.05k|    return TRUE;
10667|  6.05k|}
quickjs.c:js_find_loaded_module:
29807|     28|{
29808|     28|    struct list_head *el;
29809|     28|    JSModuleDef *m;
29810|       |
29811|       |    /* first look at the loaded modules */
29812|     42|    list_for_each(el, &ctx->loaded_modules) {
  ------------------
  |  |   86|     42|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 42, False: 0]
  |  |  ------------------
  ------------------
29813|     42|        m = list_entry(el, JSModuleDef, link);
  ------------------
  |  |   39|     42|#define list_entry(el, type, member) container_of(el, type, member)
  |  |  ------------------
  |  |  |  |   51|     42|#define container_of(ptr, type, member) ((type *)((uint8_t *)(ptr) - offsetof(type, member)))
  |  |  ------------------
  ------------------
29814|     42|        if (m->module_name == name)
  ------------------
  |  Branch (29814:13): [True: 28, False: 14]
  ------------------
29815|     28|            return m;
29816|     42|    }
29817|      0|    return NULL;
29818|     28|}
quickjs.c:check_function:
39320|     79|{
39321|     79|    if (likely(JS_IsFunction(ctx, obj)))
  ------------------
  |  |   32|     79|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 79, False: 0]
  |  |  ------------------
  ------------------
39322|     79|        return 0;
39323|      0|    JS_ThrowTypeError(ctx, "not a function");
39324|      0|    return -1;
39325|     79|}
quickjs.c:JS_NewRegexp:
47336|      2|{
47337|      2|    JSValue obj;
47338|      2|    JSProperty props[1];
47339|      2|    JSObject *p;
47340|      2|    JSRegExp *re;
47341|       |
47342|       |    /* sanity check */
47343|      2|    if (unlikely(JS_VALUE_GET_TAG(bc) != JS_TAG_STRING ||
  ------------------
  |  |   33|      4|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  |  Branch (33:45): [True: 0, False: 2]
  |  |  |  Branch (33:45): [True: 0, False: 2]
  |  |  ------------------
  ------------------
47344|      2|                 JS_VALUE_GET_TAG(pattern) != JS_TAG_STRING)) {
47345|      0|        JS_ThrowTypeError(ctx, "string expected");
47346|      0|        goto fail;
47347|      0|    }
47348|      2|    props[0].u.value = JS_NewInt32(ctx, 0); /* lastIndex */
47349|      2|    obj = JS_NewObjectFromShape(ctx, js_dup_shape(ctx->regexp_shape), JS_CLASS_REGEXP, props);
47350|      2|    if (JS_IsException(obj))
  ------------------
  |  Branch (47350:9): [True: 0, False: 2]
  ------------------
47351|      0|        goto fail;
47352|      2|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47353|      2|    re = &p->u.regexp;
47354|      2|    re->pattern = JS_VALUE_GET_STRING(pattern);
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47355|      2|    re->bytecode = JS_VALUE_GET_STRING(bc);
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47356|      2|    return obj;
47357|      0| fail:
47358|      0|    JS_FreeValue(ctx, bc);
47359|      0|    JS_FreeValue(ctx, pattern);
47360|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47361|      2|}
quickjs.c:js_for_in_start:
16338|      2|{
16339|      2|    sp[-1] = build_for_in_iterator(ctx, sp[-1]);
16340|      2|    if (JS_IsException(sp[-1]))
  ------------------
  |  Branch (16340:9): [True: 0, False: 2]
  ------------------
16341|      0|        return -1;
16342|      2|    return 0;
16343|      2|}
quickjs.c:build_for_in_iterator:
16274|      2|{
16275|      2|    JSObject *p, *p1;
16276|      2|    JSPropertyEnum *tab_atom;
16277|      2|    int i;
16278|      2|    JSValue enum_obj;
16279|      2|    JSForInIterator *it;
16280|      2|    uint32_t tag, tab_atom_count;
16281|       |
16282|      2|    tag = JS_VALUE_GET_TAG(obj);
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
16283|      2|    if (tag != JS_TAG_OBJECT && tag != JS_TAG_NULL && tag != JS_TAG_UNDEFINED) {
  ------------------
  |  Branch (16283:9): [True: 2, False: 0]
  |  Branch (16283:33): [True: 2, False: 0]
  |  Branch (16283:55): [True: 2, False: 0]
  ------------------
16284|      2|        obj = JS_ToObjectFree(ctx, obj);
16285|      2|    }
16286|       |
16287|      2|    it = js_malloc(ctx, sizeof(*it));
16288|      2|    if (!it) {
  ------------------
  |  Branch (16288:9): [True: 0, False: 2]
  ------------------
16289|      0|        JS_FreeValue(ctx, obj);
16290|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16291|      0|    }
16292|      2|    enum_obj = JS_NewObjectProtoClass(ctx, JS_NULL, JS_CLASS_FOR_IN_ITERATOR);
  ------------------
  |  |  288|      2|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16293|      2|    if (JS_IsException(enum_obj)) {
  ------------------
  |  Branch (16293:9): [True: 0, False: 2]
  ------------------
16294|      0|        js_free(ctx, it);
16295|      0|        JS_FreeValue(ctx, obj);
16296|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16297|      0|    }
16298|      2|    it->is_array = FALSE;
16299|      2|    it->obj = obj;
16300|      2|    it->idx = 0;
16301|      2|    it->tab_atom = NULL;
16302|      2|    it->atom_count = 0;
16303|      2|    it->in_prototype_chain = FALSE;
16304|      2|    p1 = JS_VALUE_GET_OBJ(enum_obj);
  ------------------
  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16305|      2|    p1->u.for_in_iterator = it;
16306|       |
16307|      2|    if (tag == JS_TAG_NULL || tag == JS_TAG_UNDEFINED)
  ------------------
  |  Branch (16307:9): [True: 0, False: 2]
  |  Branch (16307:31): [True: 0, False: 2]
  ------------------
16308|      0|        return enum_obj;
16309|       |
16310|      2|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16311|      2|    if (p->fast_array) {
  ------------------
  |  Branch (16311:9): [True: 0, False: 2]
  ------------------
16312|      0|        JSShape *sh;
16313|      0|        JSShapeProperty *prs;
16314|       |        /* check that there are no enumerable normal fields */
16315|      0|        sh = p->shape;
16316|      0|        for(i = 0, prs = get_shape_prop(sh); i < sh->prop_count; i++, prs++) {
  ------------------
  |  Branch (16316:46): [True: 0, False: 0]
  ------------------
16317|      0|            if (prs->flags & JS_PROP_ENUMERABLE)
  ------------------
  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
  |  Branch (16317:17): [True: 0, False: 0]
  ------------------
16318|      0|                goto normal_case;
16319|      0|        }
16320|       |        /* for fast arrays, we only store the number of elements */
16321|      0|        it->is_array = TRUE;
16322|      0|        it->atom_count = p->u.array.count;
16323|      2|    } else {
16324|      2|    normal_case:
16325|      2|        if (JS_GetOwnPropertyNamesInternal(ctx, &tab_atom, &tab_atom_count, p,
  ------------------
  |  Branch (16325:13): [True: 0, False: 2]
  ------------------
16326|      2|                                           JS_GPN_STRING_MASK | JS_GPN_SET_ENUM)) {
  ------------------
  |  |  808|      2|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
                                                         JS_GPN_STRING_MASK | JS_GPN_SET_ENUM)) {
  ------------------
  |  |  814|      2|#define JS_GPN_SET_ENUM     (1 << 5)
  ------------------
16327|      0|            JS_FreeValue(ctx, enum_obj);
16328|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16329|      0|        }
16330|      2|        it->tab_atom = tab_atom;
16331|      2|        it->atom_count = tab_atom_count;
16332|      2|    }
16333|      2|    return enum_obj;
16334|      2|}
quickjs.c:JS_ToObjectFree:
39759|      2|{
39760|      2|    JSValue obj = JS_ToObject(ctx, val);
39761|      2|    JS_FreeValue(ctx, val);
39762|      2|    return obj;
39763|      2|}
quickjs.c:js_for_in_next:
16410|      2|{
16411|      2|    JSValueConst enum_obj;
  ------------------
  |  |  234|      2|#define JSValueConst JSValue
  ------------------
16412|      2|    JSObject *p;
16413|      2|    JSAtom prop;
16414|      2|    JSForInIterator *it;
16415|      2|    JSPropertyEnum *tab_atom;
16416|      2|    uint32_t tab_atom_count;
16417|      2|    int ret;
16418|       |
16419|      2|    enum_obj = sp[-1];
16420|       |    /* fail safe */
16421|      2|    if (JS_VALUE_GET_TAG(enum_obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (16421:9): [True: 0, False: 2]
  ------------------
16422|      0|        goto done;
16423|      2|    p = JS_VALUE_GET_OBJ(enum_obj);
  ------------------
  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16424|      2|    if (p->class_id != JS_CLASS_FOR_IN_ITERATOR)
  ------------------
  |  Branch (16424:9): [True: 0, False: 2]
  ------------------
16425|      0|        goto done;
16426|      2|    it = p->u.for_in_iterator;
16427|       |
16428|      2|    for(;;) {
16429|      2|        if (it->idx >= it->atom_count) {
  ------------------
  |  Branch (16429:13): [True: 2, False: 0]
  ------------------
16430|      2|            if (JS_IsNull(it->obj) || JS_IsUndefined(it->obj))
  ------------------
  |  Branch (16430:17): [True: 0, False: 2]
  |  Branch (16430:39): [True: 0, False: 2]
  ------------------
16431|      0|                goto done; /* not an object */
16432|       |            /* no more property in the current object: look in the prototype */
16433|      2|            if (!it->in_prototype_chain) {
  ------------------
  |  Branch (16433:17): [True: 2, False: 0]
  ------------------
16434|      2|                ret = js_for_in_prepare_prototype_chain_enum(ctx, enum_obj);
16435|      2|                if (ret < 0)
  ------------------
  |  Branch (16435:21): [True: 0, False: 2]
  ------------------
16436|      0|                    return -1;
16437|      2|                if (ret)
  ------------------
  |  Branch (16437:21): [True: 2, False: 0]
  ------------------
16438|      2|                    goto done;
16439|      0|                it->in_prototype_chain = TRUE;
16440|      0|            }
16441|      0|            it->obj = JS_GetPrototypeFree(ctx, it->obj);
16442|      0|            if (JS_IsException(it->obj))
  ------------------
  |  Branch (16442:17): [True: 0, False: 0]
  ------------------
16443|      0|                return -1;
16444|      0|            if (JS_IsNull(it->obj))
  ------------------
  |  Branch (16444:17): [True: 0, False: 0]
  ------------------
16445|      0|                goto done; /* no more prototype */
16446|       |
16447|       |            /* must check for timeout to avoid infinite loop */
16448|      0|            if (js_poll_interrupts(ctx))
  ------------------
  |  Branch (16448:17): [True: 0, False: 0]
  ------------------
16449|      0|                return -1;
16450|       |
16451|      0|            if (JS_GetOwnPropertyNamesInternal(ctx, &tab_atom, &tab_atom_count,
  ------------------
  |  Branch (16451:17): [True: 0, False: 0]
  ------------------
16452|      0|                                               JS_VALUE_GET_OBJ(it->obj),
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16453|      0|                                               JS_GPN_STRING_MASK | JS_GPN_SET_ENUM)) {
  ------------------
  |  |  808|      0|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
                                                             JS_GPN_STRING_MASK | JS_GPN_SET_ENUM)) {
  ------------------
  |  |  814|      0|#define JS_GPN_SET_ENUM     (1 << 5)
  ------------------
16454|      0|                return -1;
16455|      0|            }
16456|      0|            JS_FreePropertyEnum(ctx, it->tab_atom, it->atom_count);
16457|      0|            it->tab_atom = tab_atom;
16458|      0|            it->atom_count = tab_atom_count;
16459|      0|            it->idx = 0;
16460|      0|        } else {
16461|      0|            if (it->is_array) {
  ------------------
  |  Branch (16461:17): [True: 0, False: 0]
  ------------------
16462|      0|                prop = __JS_AtomFromUInt32(it->idx);
16463|      0|                it->idx++;
16464|      0|            } else {
16465|      0|                BOOL is_enumerable;
16466|      0|                prop = it->tab_atom[it->idx].atom;
16467|      0|                is_enumerable = it->tab_atom[it->idx].is_enumerable;
16468|      0|                it->idx++;
16469|      0|                if (it->in_prototype_chain) {
  ------------------
  |  Branch (16469:21): [True: 0, False: 0]
  ------------------
16470|       |                    /* slow case: we are in the prototype chain */
16471|      0|                    ret = JS_GetOwnPropertyInternal(ctx, NULL, JS_VALUE_GET_OBJ(enum_obj), prop);
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16472|      0|                    if (ret < 0)
  ------------------
  |  Branch (16472:25): [True: 0, False: 0]
  ------------------
16473|      0|                        return ret;
16474|      0|                    if (ret)
  ------------------
  |  Branch (16474:25): [True: 0, False: 0]
  ------------------
16475|      0|                        continue; /* already visited */
16476|       |                    /* add to the visited property list */
16477|      0|                    if (JS_DefinePropertyValue(ctx, enum_obj, prop, JS_NULL,
  ------------------
  |  |  288|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
  |  Branch (16477:25): [True: 0, False: 0]
  ------------------
16478|      0|                                               JS_PROP_ENUMERABLE) < 0)
  ------------------
  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
16479|      0|                        return -1;
16480|      0|                }
16481|      0|                if (!is_enumerable)
  ------------------
  |  Branch (16481:21): [True: 0, False: 0]
  ------------------
16482|      0|                    continue;
16483|      0|            }
16484|       |            /* check if the property was deleted */
16485|      0|            ret = JS_GetOwnPropertyInternal(ctx, NULL, JS_VALUE_GET_OBJ(it->obj), prop);
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16486|      0|            if (ret < 0)
  ------------------
  |  Branch (16486:17): [True: 0, False: 0]
  ------------------
16487|      0|                return ret;
16488|      0|            if (ret)
  ------------------
  |  Branch (16488:17): [True: 0, False: 0]
  ------------------
16489|      0|                break;
16490|      0|        }
16491|      2|    }
16492|       |    /* return the property */
16493|      0|    sp[0] = JS_AtomToValue(ctx, prop);
16494|      0|    sp[1] = JS_FALSE;
  ------------------
  |  |  290|      0|#define JS_FALSE     JS_MKVAL(JS_TAG_BOOL, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16495|      0|    return 0;
16496|      2| done:
16497|       |    /* return the end */
16498|      2|    sp[0] = JS_UNDEFINED;
  ------------------
  |  |  289|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16499|      2|    sp[1] = JS_TRUE;
  ------------------
  |  |  291|      2|#define JS_TRUE      JS_MKVAL(JS_TAG_BOOL, 1)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16500|      2|    return 0;
16501|      2|}
quickjs.c:js_for_in_prepare_prototype_chain_enum:
16348|      2|{
16349|      2|    JSObject *p;
16350|      2|    JSForInIterator *it;
16351|      2|    JSPropertyEnum *tab_atom;
16352|      2|    uint32_t tab_atom_count, i;
16353|      2|    JSValue obj1;
16354|       |
16355|      2|    p = JS_VALUE_GET_OBJ(enum_obj);
  ------------------
  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16356|      2|    it = p->u.for_in_iterator;
16357|       |
16358|       |    /* check if there are enumerable properties in the prototype chain (fast path) */
16359|      2|    obj1 = JS_DupValue(ctx, it->obj);
16360|      6|    for(;;) {
16361|      6|        obj1 = JS_GetPrototypeFree(ctx, obj1);
16362|      6|        if (JS_IsNull(obj1))
  ------------------
  |  Branch (16362:13): [True: 2, False: 4]
  ------------------
16363|      2|            break;
16364|      4|        if (JS_IsException(obj1))
  ------------------
  |  Branch (16364:13): [True: 0, False: 4]
  ------------------
16365|      0|            goto fail;
16366|      4|        if (JS_GetOwnPropertyNamesInternal(ctx, &tab_atom, &tab_atom_count,
  ------------------
  |  Branch (16366:13): [True: 0, False: 4]
  ------------------
16367|      4|                                           JS_VALUE_GET_OBJ(obj1),
  ------------------
  |  |  227|      4|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      4|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16368|      4|                                           JS_GPN_STRING_MASK | JS_GPN_ENUM_ONLY)) {
  ------------------
  |  |  808|      4|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
                                                         JS_GPN_STRING_MASK | JS_GPN_ENUM_ONLY)) {
  ------------------
  |  |  812|      4|#define JS_GPN_ENUM_ONLY    (1 << 4)
  ------------------
16369|      0|            JS_FreeValue(ctx, obj1);
16370|      0|            goto fail;
16371|      0|        }
16372|      4|        JS_FreePropertyEnum(ctx, tab_atom, tab_atom_count);
16373|      4|        if (tab_atom_count != 0) {
  ------------------
  |  Branch (16373:13): [True: 0, False: 4]
  ------------------
16374|      0|            JS_FreeValue(ctx, obj1);
16375|      0|            goto slow_path;
16376|      0|        }
16377|       |        /* must check for timeout to avoid infinite loop */
16378|      4|        if (js_poll_interrupts(ctx)) {
  ------------------
  |  Branch (16378:13): [True: 0, False: 4]
  ------------------
16379|      0|            JS_FreeValue(ctx, obj1);
16380|      0|            goto fail;
16381|      0|        }
16382|      4|    }
16383|      2|    JS_FreeValue(ctx, obj1);
16384|      2|    return 1;
16385|       |
16386|      0| slow_path:
16387|       |    /* add the visited properties, even if they are not enumerable */
16388|      0|    if (it->is_array) {
  ------------------
  |  Branch (16388:9): [True: 0, False: 0]
  ------------------
16389|      0|        if (JS_GetOwnPropertyNamesInternal(ctx, &tab_atom, &tab_atom_count,
  ------------------
  |  Branch (16389:13): [True: 0, False: 0]
  ------------------
16390|      0|                                           JS_VALUE_GET_OBJ(it->obj),
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16391|      0|                                           JS_GPN_STRING_MASK | JS_GPN_SET_ENUM)) {
  ------------------
  |  |  808|      0|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
                                                         JS_GPN_STRING_MASK | JS_GPN_SET_ENUM)) {
  ------------------
  |  |  814|      0|#define JS_GPN_SET_ENUM     (1 << 5)
  ------------------
16392|      0|            goto fail;
16393|      0|        }
16394|      0|        it->is_array = FALSE;
16395|      0|        it->tab_atom = tab_atom;
16396|      0|        it->atom_count = tab_atom_count;
16397|      0|    }
16398|       |
16399|      0|    for(i = 0; i < it->atom_count; i++) {
  ------------------
  |  Branch (16399:16): [True: 0, False: 0]
  ------------------
16400|      0|        if (JS_DefinePropertyValue(ctx, enum_obj, it->tab_atom[i].atom, JS_NULL, JS_PROP_ENUMERABLE) < 0)
  ------------------
  |  |  288|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
                      if (JS_DefinePropertyValue(ctx, enum_obj, it->tab_atom[i].atom, JS_NULL, JS_PROP_ENUMERABLE) < 0)
  ------------------
  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
  |  Branch (16400:13): [True: 0, False: 0]
  ------------------
16401|      0|            goto fail;
16402|      0|    }
16403|      0|    return 0;
16404|      0| fail:
16405|      0|    return -1;
16406|      0|}
quickjs.c:js_for_of_start:
16672|      1|{
16673|      1|    JSValue op1, obj, method;
16674|      1|    op1 = sp[-1];
16675|      1|    obj = JS_GetIterator(ctx, op1, is_async);
16676|      1|    if (JS_IsException(obj))
  ------------------
  |  Branch (16676:9): [True: 0, False: 1]
  ------------------
16677|      0|        return -1;
16678|      1|    JS_FreeValue(ctx, op1);
16679|      1|    sp[-1] = obj;
16680|      1|    method = JS_GetProperty(ctx, obj, JS_ATOM_next);
16681|      1|    if (JS_IsException(method))
  ------------------
  |  Branch (16681:9): [True: 0, False: 1]
  ------------------
16682|      0|        return -1;
16683|      1|    sp[0] = method;
16684|      1|    return 0;
16685|      1|}
quickjs.c:JS_GetIterator:
16519|      1|{
16520|      1|    JSValue method, ret, sync_iter;
16521|       |
16522|      1|    if (is_async) {
  ------------------
  |  Branch (16522:9): [True: 0, False: 1]
  ------------------
16523|      0|        method = JS_GetProperty(ctx, obj, JS_ATOM_Symbol_asyncIterator);
16524|      0|        if (JS_IsException(method))
  ------------------
  |  Branch (16524:13): [True: 0, False: 0]
  ------------------
16525|      0|            return method;
16526|      0|        if (JS_IsUndefined(method) || JS_IsNull(method)) {
  ------------------
  |  Branch (16526:13): [True: 0, False: 0]
  |  Branch (16526:39): [True: 0, False: 0]
  ------------------
16527|      0|            method = JS_GetProperty(ctx, obj, JS_ATOM_Symbol_iterator);
16528|      0|            if (JS_IsException(method))
  ------------------
  |  Branch (16528:17): [True: 0, False: 0]
  ------------------
16529|      0|                return method;
16530|      0|            sync_iter = JS_GetIterator2(ctx, obj, method);
16531|      0|            JS_FreeValue(ctx, method);
16532|      0|            if (JS_IsException(sync_iter))
  ------------------
  |  Branch (16532:17): [True: 0, False: 0]
  ------------------
16533|      0|                return sync_iter;
16534|      0|            ret = JS_CreateAsyncFromSyncIterator(ctx, sync_iter);
16535|      0|            JS_FreeValue(ctx, sync_iter);
16536|      0|            return ret;
16537|      0|        }
16538|      1|    } else {
16539|      1|        method = JS_GetProperty(ctx, obj, JS_ATOM_Symbol_iterator);
16540|      1|        if (JS_IsException(method))
  ------------------
  |  Branch (16540:13): [True: 0, False: 1]
  ------------------
16541|      0|            return method;
16542|      1|    }
16543|      1|    if (!JS_IsFunction(ctx, method)) {
  ------------------
  |  Branch (16543:9): [True: 0, False: 1]
  ------------------
16544|      0|        JS_FreeValue(ctx, method);
16545|      0|        return JS_ThrowTypeError(ctx, "value is not iterable");
16546|      0|    }
16547|      1|    ret = JS_GetIterator2(ctx, obj, method);
16548|      1|    JS_FreeValue(ctx, method);
16549|      1|    return ret;
16550|      1|}
quickjs.c:JS_GetIterator2:
16505|      1|{
16506|      1|    JSValue enum_obj;
16507|       |
16508|      1|    enum_obj = JS_Call(ctx, method, obj, 0, NULL);
16509|      1|    if (JS_IsException(enum_obj))
  ------------------
  |  Branch (16509:9): [True: 0, False: 1]
  ------------------
16510|      0|        return enum_obj;
16511|      1|    if (!JS_IsObject(enum_obj)) {
  ------------------
  |  Branch (16511:9): [True: 0, False: 1]
  ------------------
16512|      0|        JS_FreeValue(ctx, enum_obj);
16513|      0|        return JS_ThrowTypeErrorNotAnObject(ctx);
16514|      0|    }
16515|      1|    return enum_obj;
16516|      1|}
quickjs.c:js_for_of_next:
16692|      2|{
16693|      2|    JSValue value = JS_UNDEFINED;
  ------------------
  |  |  289|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16694|      2|    int done = 1;
16695|       |
16696|      2|    if (likely(!JS_IsUndefined(sp[offset]))) {
  ------------------
  |  |   32|      2|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 2, False: 0]
  |  |  ------------------
  ------------------
16697|      2|        value = JS_IteratorNext(ctx, sp[offset], sp[offset + 1], 0, NULL, &done);
16698|      2|        if (JS_IsException(value))
  ------------------
  |  Branch (16698:13): [True: 0, False: 2]
  ------------------
16699|      0|            done = -1;
16700|      2|        if (done) {
  ------------------
  |  Branch (16700:13): [True: 0, False: 2]
  ------------------
16701|       |            /* value is JS_UNDEFINED or JS_EXCEPTION */
16702|       |            /* replace the iteration object with undefined */
16703|      0|            JS_FreeValue(ctx, sp[offset]);
16704|      0|            sp[offset] = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16705|      0|            if (done < 0) {
  ------------------
  |  Branch (16705:17): [True: 0, False: 0]
  ------------------
16706|      0|                return -1;
16707|      0|            } else {
16708|      0|                JS_FreeValue(ctx, value);
16709|      0|                value = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16710|      0|            }
16711|      0|        }
16712|      2|    }
16713|      2|    sp[0] = value;
16714|      2|    sp[1] = JS_NewBool(ctx, done);
16715|      2|    return 0;
16716|      2|}
quickjs.c:JS_IteratorNext:
16597|      2|{
16598|      2|    JSValue obj, value, done_val;
16599|      2|    int done;
16600|       |
16601|      2|    obj = JS_IteratorNext2(ctx, enum_obj, method, argc, argv, &done);
16602|      2|    if (JS_IsException(obj))
  ------------------
  |  Branch (16602:9): [True: 0, False: 2]
  ------------------
16603|      0|        goto fail;
16604|      2|    if (likely(done == 0)) {
  ------------------
  |  |   32|      2|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 2, False: 0]
  |  |  ------------------
  ------------------
16605|      2|        *pdone = FALSE;
16606|      2|        return obj;
16607|      2|    } else if (done != 2) {
  ------------------
  |  Branch (16607:16): [True: 0, False: 0]
  ------------------
16608|      0|        JS_FreeValue(ctx, obj);
16609|      0|        *pdone = TRUE;
16610|      0|        return JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16611|      0|    } else {
16612|      0|        done_val = JS_GetProperty(ctx, obj, JS_ATOM_done);
16613|      0|        if (JS_IsException(done_val))
  ------------------
  |  Branch (16613:13): [True: 0, False: 0]
  ------------------
16614|      0|            goto fail;
16615|      0|        *pdone = JS_ToBoolFree(ctx, done_val);
16616|      0|        value = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16617|      0|        if (!*pdone) {
  ------------------
  |  Branch (16617:13): [True: 0, False: 0]
  ------------------
16618|      0|            value = JS_GetProperty(ctx, obj, JS_ATOM_value);
16619|      0|        }
16620|      0|        JS_FreeValue(ctx, obj);
16621|      0|        return value;
16622|      0|    }
16623|      0| fail:
16624|      0|    JS_FreeValue(ctx, obj);
16625|      0|    *pdone = FALSE;
16626|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16627|      2|}
quickjs.c:JS_IteratorNext2:
16556|      2|{
16557|      2|    JSValue obj;
16558|       |
16559|       |    /* fast path for the built-in iterators (avoid creating the
16560|       |       intermediate result object) */
16561|      2|    if (JS_IsObject(method)) {
  ------------------
  |  Branch (16561:9): [True: 2, False: 0]
  ------------------
16562|      2|        JSObject *p = JS_VALUE_GET_OBJ(method);
  ------------------
  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
16563|      2|        if (p->class_id == JS_CLASS_C_FUNCTION &&
  ------------------
  |  Branch (16563:13): [True: 2, False: 0]
  ------------------
16564|      2|            p->u.cfunc.cproto == JS_CFUNC_iterator_next) {
  ------------------
  |  Branch (16564:13): [True: 2, False: 0]
  ------------------
16565|      2|            JSCFunctionType func;
16566|      2|            JSValueConst args[1];
  ------------------
  |  |  234|      2|#define JSValueConst JSValue
  ------------------
16567|       |
16568|       |            /* in case the function expects one argument */
16569|      2|            if (argc == 0) {
  ------------------
  |  Branch (16569:17): [True: 2, False: 0]
  ------------------
16570|      2|                args[0] = JS_UNDEFINED;
  ------------------
  |  |  289|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16571|      2|                argv = args;
16572|      2|            }
16573|      2|            func = p->u.cfunc.c_function;
16574|      2|            return func.iterator_next(ctx, enum_obj, argc, argv,
16575|      2|                                      pdone, p->u.cfunc.magic);
16576|      2|        }
16577|      2|    }
16578|      0|    obj = JS_Call(ctx, method, enum_obj, argc, argv);
16579|      0|    if (JS_IsException(obj))
  ------------------
  |  Branch (16579:9): [True: 0, False: 0]
  ------------------
16580|      0|        goto fail;
16581|      0|    if (!JS_IsObject(obj)) {
  ------------------
  |  Branch (16581:9): [True: 0, False: 0]
  ------------------
16582|      0|        JS_FreeValue(ctx, obj);
16583|      0|        JS_ThrowTypeError(ctx, "iterator must return an object");
16584|      0|        goto fail;
16585|      0|    }
16586|      0|    *pdone = 2;
16587|      0|    return obj;
16588|      0| fail:
16589|      0|    *pdone = FALSE;
16590|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
16591|      0|}
quickjs.c:JS_DefineObjectName:
10770|      2|{
10771|      2|    if (name != JS_ATOM_NULL
  ------------------
  |  |  449|      4|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (10771:9): [True: 2, False: 0]
  ------------------
10772|      2|    &&  JS_IsObject(obj)
  ------------------
  |  Branch (10772:9): [True: 2, False: 0]
  ------------------
10773|      2|    &&  !js_object_has_name(ctx, obj)
  ------------------
  |  Branch (10773:9): [True: 2, False: 0]
  ------------------
10774|      2|    &&  JS_DefinePropertyValue(ctx, obj, JS_ATOM_name, JS_AtomToString(ctx, name), flags) < 0) {
  ------------------
  |  Branch (10774:9): [True: 0, False: 2]
  ------------------
10775|      0|        return -1;
10776|      0|    }
10777|      2|    return 0;
10778|      2|}
quickjs.c:js_object_has_name:
10750|      2|{
10751|      2|    JSProperty *pr;
10752|      2|    JSShapeProperty *prs;
10753|      2|    JSValueConst val;
  ------------------
  |  |  234|      2|#define JSValueConst JSValue
  ------------------
10754|      2|    JSString *p;
10755|       |
10756|      2|    prs = find_own_property(&pr, JS_VALUE_GET_OBJ(obj), JS_ATOM_name);
  ------------------
  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10757|      2|    if (!prs)
  ------------------
  |  Branch (10757:9): [True: 0, False: 2]
  ------------------
10758|      0|        return FALSE;
10759|      2|    if ((prs->flags & JS_PROP_TMASK) != JS_PROP_NORMAL)
  ------------------
  |  |  301|      2|#define JS_PROP_TMASK         (3 << 4) /* mask for NORMAL, GETSET, VARREF, AUTOINIT */
  ------------------
                  if ((prs->flags & JS_PROP_TMASK) != JS_PROP_NORMAL)
  ------------------
  |  |  302|      2|#define JS_PROP_NORMAL         (0 << 4)
  ------------------
  |  Branch (10759:9): [True: 0, False: 2]
  ------------------
10760|      0|        return TRUE;
10761|      2|    val = pr->u.value;
10762|      2|    if (JS_VALUE_GET_TAG(val) != JS_TAG_STRING)
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (10762:9): [True: 0, False: 2]
  ------------------
10763|      0|        return TRUE;
10764|      2|    p = JS_VALUE_GET_STRING(val);
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
10765|      2|    return (p->len != 0);
10766|      2|}
quickjs.c:JS_ConcatString3:
 4407|      2|{
 4408|      2|    StringBuffer b_s, *b = &b_s;
 4409|      2|    int len1, len3;
 4410|      2|    JSString *p;
 4411|       |
 4412|      2|    if (unlikely(JS_VALUE_GET_TAG(str2) != JS_TAG_STRING)) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 4413|      0|        str2 = JS_ToStringFree(ctx, str2);
 4414|      0|        if (JS_IsException(str2))
  ------------------
  |  Branch (4414:13): [True: 0, False: 0]
  ------------------
 4415|      0|            goto fail;
 4416|      0|    }
 4417|      2|    p = JS_VALUE_GET_STRING(str2);
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4418|      2|    len1 = strlen(str1);
 4419|      2|    len3 = strlen(str3);
 4420|       |
 4421|      2|    if (string_buffer_init2(ctx, b, len1 + p->len + len3, p->is_wide_char))
  ------------------
  |  Branch (4421:9): [True: 0, False: 2]
  ------------------
 4422|      0|        goto fail;
 4423|       |
 4424|      2|    string_buffer_write8(b, (const uint8_t *)str1, len1);
 4425|      2|    string_buffer_concat(b, p, 0, p->len);
 4426|      2|    string_buffer_write8(b, (const uint8_t *)str3, len3);
 4427|       |
 4428|      2|    JS_FreeValue(ctx, str2);
 4429|      2|    return string_buffer_end(b);
 4430|       |
 4431|      0| fail:
 4432|      0|    JS_FreeValue(ctx, str2);
 4433|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 4434|      2|}
quickjs.c:js_create_array_iterator:
43284|      1|{
43285|      1|    JSValue enum_obj, arr;
43286|      1|    JSArrayIteratorData *it;
43287|      1|    JSIteratorKindEnum kind;
43288|      1|    int class_id;
43289|       |
43290|      1|    kind = magic & 3;
43291|      1|    if (magic & 4) {
  ------------------
  |  Branch (43291:9): [True: 1, False: 0]
  ------------------
43292|       |        /* string iterator case */
43293|      1|        arr = JS_ToStringCheckObject(ctx, this_val);
43294|      1|        class_id = JS_CLASS_STRING_ITERATOR;
43295|      1|    } else {
43296|      0|        arr = JS_ToObject(ctx, this_val);
43297|      0|        class_id = JS_CLASS_ARRAY_ITERATOR;
43298|      0|    }
43299|      1|    if (JS_IsException(arr))
  ------------------
  |  Branch (43299:9): [True: 0, False: 1]
  ------------------
43300|      0|        goto fail;
43301|      1|    enum_obj = JS_NewObjectClass(ctx, class_id);
43302|      1|    if (JS_IsException(enum_obj))
  ------------------
  |  Branch (43302:9): [True: 0, False: 1]
  ------------------
43303|      0|        goto fail;
43304|      1|    it = js_malloc(ctx, sizeof(*it));
43305|      1|    if (!it)
  ------------------
  |  Branch (43305:9): [True: 0, False: 1]
  ------------------
43306|      0|        goto fail1;
43307|      1|    it->obj = arr;
43308|      1|    it->kind = kind;
43309|      1|    it->idx = 0;
43310|      1|    JS_SetOpaque(enum_obj, it);
43311|      1|    return enum_obj;
43312|      0| fail1:
43313|      0|    JS_FreeValue(ctx, enum_obj);
43314|      0| fail:
43315|      0|    JS_FreeValue(ctx, arr);
43316|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
43317|      0|}
quickjs.c:JS_ToStringCheckObject:
13662|      1|{
13663|      1|    uint32_t tag = JS_VALUE_GET_TAG(val);
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
13664|      1|    if (tag == JS_TAG_NULL || tag == JS_TAG_UNDEFINED)
  ------------------
  |  Branch (13664:9): [True: 0, False: 1]
  |  Branch (13664:31): [True: 0, False: 1]
  ------------------
13665|      0|        return JS_ThrowTypeError(ctx, "null or undefined are forbidden");
13666|      1|    return JS_ToString(ctx, val);
13667|      1|}
quickjs.c:JS_ConcatString:
 5034|      2|{
 5035|      2|    JSString *p1, *p2;
 5036|       |
 5037|      2|    if (unlikely(JS_VALUE_GET_TAG(op1) != JS_TAG_STRING &&
  ------------------
  |  |   33|      3|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 1, False: 1]
  |  |  |  Branch (33:45): [True: 1, False: 1]
  |  |  |  Branch (33:45): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 5038|      2|                 JS_VALUE_GET_TAG(op1) != JS_TAG_STRING_ROPE)) {
 5039|      1|        op1 = JS_ToStringFree(ctx, op1);
 5040|      1|        if (JS_IsException(op1)) {
  ------------------
  |  Branch (5040:13): [True: 0, False: 1]
  ------------------
 5041|      0|            JS_FreeValue(ctx, op2);
 5042|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 5043|      0|        }
 5044|      1|    }
 5045|      2|    if (unlikely(JS_VALUE_GET_TAG(op2) != JS_TAG_STRING &&
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  |  Branch (33:45): [True: 0, False: 2]
  |  |  |  Branch (33:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5046|      2|                 JS_VALUE_GET_TAG(op2) != JS_TAG_STRING_ROPE)) {
 5047|      0|        op2 = JS_ToStringFree(ctx, op2);
 5048|      0|        if (JS_IsException(op2)) {
  ------------------
  |  Branch (5048:13): [True: 0, False: 0]
  ------------------
 5049|      0|            JS_FreeValue(ctx, op1);
 5050|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 5051|      0|        }
 5052|      0|    }
 5053|       |
 5054|       |    /* normal concatenation for short strings */
 5055|      2|    if (JS_VALUE_GET_TAG(op2) == JS_TAG_STRING) {
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5055:9): [True: 2, False: 0]
  ------------------
 5056|      2|        p2 = JS_VALUE_GET_STRING(op2);
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5057|      2|        if (p2->len == 0) {
  ------------------
  |  Branch (5057:13): [True: 1, False: 1]
  ------------------
 5058|      1|            JS_FreeValue(ctx, op2);
 5059|      1|            return op1;
 5060|      1|        }
 5061|      1|        if (p2->len <= JS_STRING_ROPE_SHORT_LEN) {
  ------------------
  |  |  214|      1|#define JS_STRING_ROPE_SHORT_LEN  512
  ------------------
  |  Branch (5061:13): [True: 0, False: 1]
  ------------------
 5062|      0|            if (JS_VALUE_GET_TAG(op1) == JS_TAG_STRING) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5062:17): [True: 0, False: 0]
  ------------------
 5063|      0|                p1 = JS_VALUE_GET_STRING(op1);
  ------------------
  |  |  228|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5064|      0|                if (p1->len <= JS_STRING_ROPE_SHORT2_LEN) {
  ------------------
  |  |  216|      0|#define JS_STRING_ROPE_SHORT2_LEN 8192
  ------------------
  |  Branch (5064:21): [True: 0, False: 0]
  ------------------
 5065|      0|                    return JS_ConcatString2(ctx, op1, op2);
 5066|      0|                } else {
 5067|      0|                    return js_new_string_rope(ctx, op1, op2);
 5068|      0|                }
 5069|      0|            } else {
 5070|      0|                JSStringRope *r1;
 5071|      0|                r1 = JS_VALUE_GET_STRING_ROPE(op1);
  ------------------
  |  |  229|      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)
  |  |  ------------------
  ------------------
 5072|      0|                if (JS_VALUE_GET_TAG(r1->right) == JS_TAG_STRING &&
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5072:21): [True: 0, False: 0]
  ------------------
 5073|      0|                    JS_VALUE_GET_STRING(r1->right)->len <= JS_STRING_ROPE_SHORT_LEN) {
  ------------------
  |  |  228|      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) {
  ------------------
  |  |  214|      0|#define JS_STRING_ROPE_SHORT_LEN  512
  ------------------
  |  Branch (5073:21): [True: 0, False: 0]
  ------------------
 5074|      0|                    JSValue val, ret;
 5075|      0|                    val = JS_ConcatString2(ctx, JS_DupValue(ctx, r1->right), op2);
 5076|      0|                    if (JS_IsException(val)) {
  ------------------
  |  Branch (5076:25): [True: 0, False: 0]
  ------------------
 5077|      0|                        JS_FreeValue(ctx, op1);
 5078|      0|                        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 5079|      0|                    }
 5080|      0|                    ret = js_new_string_rope(ctx, JS_DupValue(ctx, r1->left), val);
 5081|      0|                    JS_FreeValue(ctx, op1);
 5082|      0|                    return ret;
 5083|      0|                }
 5084|      0|            }
 5085|      0|        }
 5086|      1|    } else if (JS_VALUE_GET_TAG(op1) == JS_TAG_STRING) {
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5086:16): [True: 0, False: 0]
  ------------------
 5087|      0|        JSStringRope *r2;
 5088|      0|        p1 = JS_VALUE_GET_STRING(op1);
  ------------------
  |  |  228|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5089|      0|        if (p1->len == 0) {
  ------------------
  |  Branch (5089:13): [True: 0, False: 0]
  ------------------
 5090|      0|            JS_FreeValue(ctx, op1);
 5091|      0|            return op2;
 5092|      0|        }
 5093|      0|        r2 = JS_VALUE_GET_STRING_ROPE(op2);
  ------------------
  |  |  229|      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)
  |  |  ------------------
  ------------------
 5094|      0|        if (JS_VALUE_GET_TAG(r2->left) == JS_TAG_STRING &&
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5094:13): [True: 0, False: 0]
  ------------------
 5095|      0|            JS_VALUE_GET_STRING(r2->left)->len <= JS_STRING_ROPE_SHORT_LEN) {
  ------------------
  |  |  228|      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) {
  ------------------
  |  |  214|      0|#define JS_STRING_ROPE_SHORT_LEN  512
  ------------------
  |  Branch (5095:13): [True: 0, False: 0]
  ------------------
 5096|      0|            JSValue val, ret;
 5097|      0|            val = JS_ConcatString2(ctx, op1, JS_DupValue(ctx, r2->left));
 5098|      0|            if (JS_IsException(val)) {
  ------------------
  |  Branch (5098:17): [True: 0, False: 0]
  ------------------
 5099|      0|                JS_FreeValue(ctx, op2);
 5100|      0|                return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 5101|      0|            }
 5102|      0|            ret = js_new_string_rope(ctx, val, JS_DupValue(ctx, r2->right));
 5103|      0|            JS_FreeValue(ctx, op2);
 5104|      0|            return ret;
 5105|      0|        }
 5106|      0|    }
 5107|      1|    return js_new_string_rope(ctx, op1, op2);
 5108|      2|}
quickjs.c:js_new_string_rope:
 4860|      1|{
 4861|      1|    uint32_t len;
 4862|      1|    int is_wide_char, depth;
 4863|      1|    JSStringRope *r;
 4864|      1|    JSValue res;
 4865|       |    
 4866|      1|    if (JS_VALUE_GET_TAG(op1) == JS_TAG_STRING) {
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (4866:9): [True: 1, False: 0]
  ------------------
 4867|      1|        JSString *p1 = JS_VALUE_GET_STRING(op1);
  ------------------
  |  |  228|      1|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4868|      1|        len = p1->len;
 4869|      1|        is_wide_char = p1->is_wide_char;
 4870|      1|        depth = 0;
 4871|      1|    } else {
 4872|      0|        JSStringRope *r1 = JS_VALUE_GET_STRING_ROPE(op1);
  ------------------
  |  |  229|      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)
  |  |  ------------------
  ------------------
 4873|      0|        len = r1->len;
 4874|      0|        is_wide_char = r1->is_wide_char;
 4875|      0|        depth = r1->depth;
 4876|      0|    }
 4877|       |
 4878|      1|    if (JS_VALUE_GET_TAG(op2) == JS_TAG_STRING) {
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (4878:9): [True: 1, False: 0]
  ------------------
 4879|      1|        JSString *p2 = JS_VALUE_GET_STRING(op2);
  ------------------
  |  |  228|      1|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4880|      1|        len += p2->len;
 4881|      1|        is_wide_char |= p2->is_wide_char;
 4882|      1|    } else {
 4883|      0|        JSStringRope *r2 = JS_VALUE_GET_STRING_ROPE(op2);
  ------------------
  |  |  229|      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)
  |  |  ------------------
  ------------------
 4884|      0|        len += r2->len;
 4885|      0|        is_wide_char |= r2->is_wide_char;
 4886|      0|        depth = max_int(depth, r2->depth);
 4887|      0|    }
 4888|      1|    if (len > JS_STRING_LEN_MAX) {
  ------------------
  |  |  210|      1|#define JS_STRING_LEN_MAX ((1 << 30) - 1)
  ------------------
  |  Branch (4888:9): [True: 0, False: 1]
  ------------------
 4889|      0|        JS_ThrowInternalError(ctx, "string too long");
 4890|      0|        goto fail;
 4891|      0|    }
 4892|      1|    r = js_malloc(ctx, sizeof(*r));
 4893|      1|    if (!r)
  ------------------
  |  Branch (4893:9): [True: 0, False: 1]
  ------------------
 4894|      0|        goto fail;
 4895|      1|    js_rc(r)->ref_count = 1;
 4896|      1|    r->len = len;
 4897|      1|    r->is_wide_char = is_wide_char;
 4898|      1|    r->depth = depth + 1;
 4899|      1|    r->left = op1;
 4900|      1|    r->right = op2;
 4901|      1|    res = JS_MKPTR(JS_TAG_STRING_ROPE, r);
  ------------------
  |  |  246|      1|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 4902|      1|    if (r->depth > JS_STRING_ROPE_MAX_DEPTH) {
  ------------------
  |  |  218|      1|#define JS_STRING_ROPE_MAX_DEPTH 60
  ------------------
  |  Branch (4902:9): [True: 0, False: 1]
  ------------------
 4903|      0|        JSValue res2;
 4904|       |#ifdef DUMP_ROPE_REBALANCE
 4905|       |        printf("rebalance: initial depth=%d\n", r->depth);
 4906|       |#endif
 4907|      0|        res2 = js_rebalancee_string_rope(ctx, res);
 4908|       |#ifdef DUMP_ROPE_REBALANCE
 4909|       |        if (JS_VALUE_GET_TAG(res2) == JS_TAG_STRING_ROPE) 
 4910|       |            printf("rebalance: final depth=%d\n", JS_VALUE_GET_STRING_ROPE(res2)->depth);
 4911|       |#endif
 4912|      0|        JS_FreeValue(ctx, res);
 4913|      0|        return res2;
 4914|      1|    } else {
 4915|      1|        return res;
 4916|      1|    }
 4917|      0| fail:
 4918|      0|    JS_FreeValue(ctx, op1);
 4919|      0|    JS_FreeValue(ctx, op2);
 4920|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 4921|      1|}
quickjs.c:js_add_slow:
15090|      2|{
15091|      2|    JSValue op1, op2;
15092|      2|    uint32_t tag1, tag2;
15093|       |
15094|      2|    op1 = sp[-2];
15095|      2|    op2 = sp[-1];
15096|       |
15097|      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)
  |  |  ------------------
  ------------------
15098|      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)
  |  |  ------------------
  ------------------
15099|       |    /* fast path for float64 */
15100|      2|    if (tag1 == JS_TAG_FLOAT64 && tag2 == JS_TAG_FLOAT64) {
  ------------------
  |  Branch (15100:9): [True: 1, False: 1]
  |  Branch (15100:35): [True: 0, False: 1]
  ------------------
15101|      0|        double d1, d2;
15102|      0|        d1 = JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
15103|      0|        d2 = JS_VALUE_GET_FLOAT64(op2);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
15104|      0|        sp[-2] = __JS_NewFloat64(ctx, d1 + d2);
15105|      0|        return 0;
15106|      0|    }
15107|       |    /* fast path for short bigint */
15108|      2|    if (tag1 == JS_TAG_SHORT_BIG_INT && tag2 == JS_TAG_SHORT_BIG_INT) {
  ------------------
  |  Branch (15108:9): [True: 0, False: 2]
  |  Branch (15108:41): [True: 0, False: 0]
  ------------------
15109|      0|        js_slimb_t v1, v2;
15110|      0|        js_sdlimb_t v;
15111|      0|        v1 = JS_VALUE_GET_SHORT_BIG_INT(op1);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
15112|      0|        v2 = JS_VALUE_GET_SHORT_BIG_INT(op2);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
15113|      0|        v = (js_sdlimb_t)v1 + (js_sdlimb_t)v2;
15114|      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]
  |  |  ------------------
  ------------------
15115|      0|            sp[-2] = __JS_NewShortBigInt(ctx, v);
15116|      0|        } else {
15117|      0|            JSBigInt *r = js_bigint_new_di(ctx, v);
15118|      0|            if (!r)
  ------------------
  |  Branch (15118:17): [True: 0, False: 0]
  ------------------
15119|      0|                goto exception;
15120|      0|            sp[-2] = JS_MKPTR(JS_TAG_BIG_INT, r);
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
15121|      0|        }
15122|      0|        return 0;
15123|      0|    }
15124|       |    
15125|      2|    if (tag1 == JS_TAG_OBJECT || tag2 == JS_TAG_OBJECT) {
  ------------------
  |  Branch (15125:9): [True: 0, False: 2]
  |  Branch (15125:34): [True: 1, False: 1]
  ------------------
15126|      1|        op1 = JS_ToPrimitiveFree(ctx, op1, HINT_NONE);
  ------------------
  |  | 1238|      1|#define HINT_NONE    2
  ------------------
15127|      1|        if (JS_IsException(op1)) {
  ------------------
  |  Branch (15127:13): [True: 0, False: 1]
  ------------------
15128|      0|            JS_FreeValue(ctx, op2);
15129|      0|            goto exception;
15130|      0|        }
15131|       |
15132|      1|        op2 = JS_ToPrimitiveFree(ctx, op2, HINT_NONE);
  ------------------
  |  | 1238|      1|#define HINT_NONE    2
  ------------------
15133|      1|        if (JS_IsException(op2)) {
  ------------------
  |  Branch (15133:13): [True: 0, False: 1]
  ------------------
15134|      0|            JS_FreeValue(ctx, op1);
15135|      0|            goto exception;
15136|      0|        }
15137|      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)
  |  |  ------------------
  ------------------
15138|      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)
  |  |  ------------------
  ------------------
15139|      1|    }
15140|       |
15141|      2|    if (tag_is_string(tag1) || tag_is_string(tag2)) {
  ------------------
  |  Branch (15141:9): [True: 1, False: 1]
  |  Branch (15141:32): [True: 1, False: 0]
  ------------------
15142|      2|        sp[-2] = JS_ConcatString(ctx, op1, op2);
15143|      2|        if (JS_IsException(sp[-2]))
  ------------------
  |  Branch (15143:13): [True: 0, False: 2]
  ------------------
15144|      0|            goto exception;
15145|      2|        return 0;
15146|      2|    }
15147|       |
15148|      0|    op1 = JS_ToNumericFree(ctx, op1);
15149|      0|    if (JS_IsException(op1)) {
  ------------------
  |  Branch (15149:9): [True: 0, False: 0]
  ------------------
15150|      0|        JS_FreeValue(ctx, op2);
15151|      0|        goto exception;
15152|      0|    }
15153|      0|    op2 = JS_ToNumericFree(ctx, op2);
15154|      0|    if (JS_IsException(op2)) {
  ------------------
  |  Branch (15154:9): [True: 0, False: 0]
  ------------------
15155|      0|        JS_FreeValue(ctx, op1);
15156|      0|        goto exception;
15157|      0|    }
15158|      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)
  |  |  ------------------
  ------------------
15159|      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)
  |  |  ------------------
  ------------------
15160|       |
15161|      0|    if (tag1 == JS_TAG_INT && tag2 == JS_TAG_INT) {
  ------------------
  |  Branch (15161:9): [True: 0, False: 0]
  |  Branch (15161:31): [True: 0, False: 0]
  ------------------
15162|      0|        int32_t v1, v2;
15163|      0|        int64_t v;
15164|      0|        v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
15165|      0|        v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
15166|      0|        v = (int64_t)v1 + (int64_t)v2;
15167|      0|        sp[-2] = JS_NewInt64(ctx, v);
15168|      0|    } else if ((tag1 == JS_TAG_BIG_INT || tag1 == JS_TAG_SHORT_BIG_INT) &&
  ------------------
  |  Branch (15168:17): [True: 0, False: 0]
  |  Branch (15168:43): [True: 0, False: 0]
  ------------------
15169|      0|               (tag2 == JS_TAG_BIG_INT || tag2 == JS_TAG_SHORT_BIG_INT)) {
  ------------------
  |  Branch (15169:17): [True: 0, False: 0]
  |  Branch (15169:43): [True: 0, False: 0]
  ------------------
15170|      0|        JSBigInt *p1, *p2, *r;
15171|      0|        JSBigIntBuf buf1, buf2;
15172|       |        /* bigint result */
15173|      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 (15173:13): [True: 0, False: 0]
  ------------------
15174|      0|            p1 = js_bigint_set_short(&buf1, op1);
15175|      0|        else
15176|      0|            p1 = JS_VALUE_GET_PTR(op1);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
15177|      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 (15177:13): [True: 0, False: 0]
  ------------------
15178|      0|            p2 = js_bigint_set_short(&buf2, op2);
15179|      0|        else
15180|      0|            p2 = JS_VALUE_GET_PTR(op2);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
15181|      0|        r = js_bigint_add(ctx, p1, p2, 0);
15182|      0|        JS_FreeValue(ctx, op1);
15183|      0|        JS_FreeValue(ctx, op2);
15184|      0|        if (!r)
  ------------------
  |  Branch (15184:13): [True: 0, False: 0]
  ------------------
15185|      0|            goto exception;
15186|      0|        sp[-2] = JS_CompactBigInt(ctx, r);
15187|      0|    } else {
15188|      0|        double d1, d2;
15189|       |        /* float64 result */
15190|      0|        if (JS_ToFloat64Free(ctx, &d1, op1)) {
  ------------------
  |  Branch (15190:13): [True: 0, False: 0]
  ------------------
15191|      0|            JS_FreeValue(ctx, op2);
15192|      0|            goto exception;
15193|      0|        }
15194|      0|        if (JS_ToFloat64Free(ctx, &d2, op2))
  ------------------
  |  Branch (15194:13): [True: 0, False: 0]
  ------------------
15195|      0|            goto exception;
15196|      0|        sp[-2] = __JS_NewFloat64(ctx, d1 + d2);
15197|      0|    }
15198|      0|    return 0;
15199|      0| exception:
15200|      0|    sp[-2] = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
15201|      0|    sp[-1] = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
15202|      0|    return -1;
15203|      0|}
quickjs.c:JS_ToNumericFree:
13017|     10|{
13018|     10|    return JS_ToNumberHintFree(ctx, val, TON_FLAG_NUMERIC);
13019|     10|}
quickjs.c:js_binary_arith_slow:
14899|      3|{
14900|      3|    JSValue op1, op2;
14901|      3|    uint32_t tag1, tag2;
14902|      3|    double d1, d2;
14903|       |
14904|      3|    op1 = sp[-2];
14905|      3|    op2 = sp[-1];
14906|      3|    tag1 = JS_VALUE_GET_NORM_TAG(op1);
  ------------------
  |  |  238|      3|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      3|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
14907|      3|    tag2 = JS_VALUE_GET_NORM_TAG(op2);
  ------------------
  |  |  238|      3|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      3|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
14908|       |    /* fast path for float operations */
14909|      3|    if (tag1 == JS_TAG_FLOAT64 && tag2 == JS_TAG_FLOAT64) {
  ------------------
  |  Branch (14909:9): [True: 0, False: 3]
  |  Branch (14909:35): [True: 0, False: 0]
  ------------------
14910|      0|        d1 = JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
14911|      0|        d2 = JS_VALUE_GET_FLOAT64(op2);
  ------------------
  |  |  241|      0|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
14912|      0|        goto handle_float64;
14913|      0|    }
14914|       |    /* fast path for short big int operations */
14915|      3|    if (tag1 == JS_TAG_SHORT_BIG_INT && tag2 == JS_TAG_SHORT_BIG_INT) {
  ------------------
  |  Branch (14915:9): [True: 0, False: 3]
  |  Branch (14915:41): [True: 0, False: 0]
  ------------------
14916|      0|        js_slimb_t v1, v2;
14917|      0|        js_sdlimb_t v;
14918|      0|        v1 = JS_VALUE_GET_SHORT_BIG_INT(op1);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
14919|      0|        v2 = JS_VALUE_GET_SHORT_BIG_INT(op2);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
14920|      0|        switch(op) {
14921|      0|        case OP_sub:
  ------------------
  |  Branch (14921:9): [True: 0, False: 0]
  ------------------
14922|      0|            v = (js_sdlimb_t)v1 - (js_sdlimb_t)v2;
14923|      0|            break;
14924|      0|        case OP_mul:
  ------------------
  |  Branch (14924:9): [True: 0, False: 0]
  ------------------
14925|      0|            v = (js_sdlimb_t)v1 * (js_sdlimb_t)v2;
14926|      0|            break;
14927|      0|        case OP_div:
  ------------------
  |  Branch (14927:9): [True: 0, False: 0]
  ------------------
14928|      0|            if (v2 == 0 ||
  ------------------
  |  Branch (14928:17): [True: 0, False: 0]
  ------------------
14929|      0|                ((js_limb_t)v1 == (js_limb_t)1 << (JS_LIMB_BITS - 1) &&
  ------------------
  |  |   68|      0|#define JS_LIMB_BITS 64
  ------------------
  |  Branch (14929:18): [True: 0, False: 0]
  ------------------
14930|      0|                 v2 == -1)) {
  ------------------
  |  Branch (14930:18): [True: 0, False: 0]
  ------------------
14931|      0|                goto slow_big_int;
14932|      0|            }
14933|      0|            sp[-2] = __JS_NewShortBigInt(ctx, v1 / v2);
14934|      0|            return 0;
14935|      0|        case OP_mod:
  ------------------
  |  Branch (14935:9): [True: 0, False: 0]
  ------------------
14936|      0|            if (v2 == 0 ||
  ------------------
  |  Branch (14936:17): [True: 0, False: 0]
  ------------------
14937|      0|                ((js_limb_t)v1 == (js_limb_t)1 << (JS_LIMB_BITS - 1) &&
  ------------------
  |  |   68|      0|#define JS_LIMB_BITS 64
  ------------------
  |  Branch (14937:18): [True: 0, False: 0]
  ------------------
14938|      0|                 v2 == -1)) {
  ------------------
  |  Branch (14938:18): [True: 0, False: 0]
  ------------------
14939|      0|                goto slow_big_int;
14940|      0|            }
14941|      0|            sp[-2] = __JS_NewShortBigInt(ctx, v1 % v2);
14942|      0|            return 0;
14943|      0|        case OP_pow:
  ------------------
  |  Branch (14943:9): [True: 0, False: 0]
  ------------------
14944|      0|            goto slow_big_int;
14945|      0|        default:
  ------------------
  |  Branch (14945:9): [True: 0, False: 0]
  ------------------
14946|      0|            abort();
14947|      0|        }
14948|      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]
  |  |  ------------------
  ------------------
14949|      0|            sp[-2] = __JS_NewShortBigInt(ctx, v);
14950|      0|        } else {
14951|      0|            JSBigInt *r = js_bigint_new_di(ctx, v);
14952|      0|            if (!r)
  ------------------
  |  Branch (14952:17): [True: 0, False: 0]
  ------------------
14953|      0|                goto exception;
14954|      0|            sp[-2] = JS_MKPTR(JS_TAG_BIG_INT, r);
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
14955|      0|        }
14956|      0|        return 0;
14957|      0|    }
14958|      3|    op1 = JS_ToNumericFree(ctx, op1);
14959|      3|    if (JS_IsException(op1)) {
  ------------------
  |  Branch (14959:9): [True: 0, False: 3]
  ------------------
14960|      0|        JS_FreeValue(ctx, op2);
14961|      0|        goto exception;
14962|      0|    }
14963|      3|    op2 = JS_ToNumericFree(ctx, op2);
14964|      3|    if (JS_IsException(op2)) {
  ------------------
  |  Branch (14964:9): [True: 0, False: 3]
  ------------------
14965|      0|        JS_FreeValue(ctx, op1);
14966|      0|        goto exception;
14967|      0|    }
14968|      3|    tag1 = JS_VALUE_GET_NORM_TAG(op1);
  ------------------
  |  |  238|      3|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      3|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
14969|      3|    tag2 = JS_VALUE_GET_NORM_TAG(op2);
  ------------------
  |  |  238|      3|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|      3|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
14970|       |
14971|      3|    if (tag1 == JS_TAG_INT && tag2 == JS_TAG_INT) {
  ------------------
  |  Branch (14971:9): [True: 2, False: 1]
  |  Branch (14971:31): [True: 0, False: 2]
  ------------------
14972|      0|        int32_t v1, v2;
14973|      0|        int64_t v;
14974|      0|        v1 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
14975|      0|        v2 = JS_VALUE_GET_INT(op2);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
14976|      0|        switch(op) {
14977|      0|        case OP_sub:
  ------------------
  |  Branch (14977:9): [True: 0, False: 0]
  ------------------
14978|      0|            v = (int64_t)v1 - (int64_t)v2;
14979|      0|            break;
14980|      0|        case OP_mul:
  ------------------
  |  Branch (14980:9): [True: 0, False: 0]
  ------------------
14981|      0|            v = (int64_t)v1 * (int64_t)v2;
14982|      0|            if (v == 0 && (v1 | v2) < 0) {
  ------------------
  |  Branch (14982:17): [True: 0, False: 0]
  |  Branch (14982:27): [True: 0, False: 0]
  ------------------
14983|      0|                sp[-2] = __JS_NewFloat64(ctx, -0.0);
14984|      0|                return 0;
14985|      0|            }
14986|      0|            break;
14987|      0|        case OP_div:
  ------------------
  |  Branch (14987:9): [True: 0, False: 0]
  ------------------
14988|      0|            sp[-2] = JS_NewFloat64(ctx, (double)v1 / (double)v2);
14989|      0|            return 0;
14990|      0|        case OP_mod:
  ------------------
  |  Branch (14990:9): [True: 0, False: 0]
  ------------------
14991|      0|            if (v1 < 0 || v2 <= 0) {
  ------------------
  |  Branch (14991:17): [True: 0, False: 0]
  |  Branch (14991:27): [True: 0, False: 0]
  ------------------
14992|      0|                sp[-2] = JS_NewFloat64(ctx, fmod(v1, v2));
14993|      0|                return 0;
14994|      0|            } else {
14995|      0|                v = (int64_t)v1 % (int64_t)v2;
14996|      0|            }
14997|      0|            break;
14998|      0|        case OP_pow:
  ------------------
  |  Branch (14998:9): [True: 0, False: 0]
  ------------------
14999|      0|            sp[-2] = JS_NewFloat64(ctx, js_pow(v1, v2));
15000|      0|            return 0;
15001|      0|        default:
  ------------------
  |  Branch (15001:9): [True: 0, False: 0]
  ------------------
15002|      0|            abort();
15003|      0|        }
15004|      0|        sp[-2] = JS_NewInt64(ctx, v);
15005|      3|    } else if ((tag1 == JS_TAG_SHORT_BIG_INT || tag1 == JS_TAG_BIG_INT) &&
  ------------------
  |  Branch (15005:17): [True: 0, False: 3]
  |  Branch (15005:49): [True: 0, False: 3]
  ------------------
15006|      0|               (tag2 == JS_TAG_SHORT_BIG_INT || tag2 == JS_TAG_BIG_INT)) {
  ------------------
  |  Branch (15006:17): [True: 0, False: 0]
  |  Branch (15006:49): [True: 0, False: 0]
  ------------------
15007|      0|        JSBigInt *p1, *p2, *r;
15008|      0|        JSBigIntBuf buf1, buf2;
15009|      0|    slow_big_int:
15010|       |        /* bigint result */
15011|      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 (15011:13): [True: 0, False: 0]
  ------------------
15012|      0|            p1 = js_bigint_set_short(&buf1, op1);
15013|      0|        else
15014|      0|            p1 = JS_VALUE_GET_PTR(op1);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
15015|      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 (15015:13): [True: 0, False: 0]
  ------------------
15016|      0|            p2 = js_bigint_set_short(&buf2, op2);
15017|      0|        else
15018|      0|            p2 = JS_VALUE_GET_PTR(op2);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
15019|      0|        switch(op) {
15020|      0|        case OP_add:
  ------------------
  |  Branch (15020:9): [True: 0, False: 0]
  ------------------
15021|      0|            r = js_bigint_add(ctx, p1, p2, 0);
15022|      0|            break;
15023|      0|        case OP_sub:
  ------------------
  |  Branch (15023:9): [True: 0, False: 0]
  ------------------
15024|      0|            r = js_bigint_add(ctx, p1, p2, 1);
15025|      0|            break;
15026|      0|        case OP_mul:
  ------------------
  |  Branch (15026:9): [True: 0, False: 0]
  ------------------
15027|      0|            r = js_bigint_mul(ctx, p1, p2);
15028|      0|            break;
15029|      0|        case OP_div:
  ------------------
  |  Branch (15029:9): [True: 0, False: 0]
  ------------------
15030|      0|            r = js_bigint_divrem(ctx, p1, p2, FALSE);
15031|      0|            break;
15032|      0|        case OP_mod:
  ------------------
  |  Branch (15032:9): [True: 0, False: 0]
  ------------------
15033|      0|            r = js_bigint_divrem(ctx, p1, p2, TRUE);
15034|      0|            break;
15035|      0|        case OP_pow:
  ------------------
  |  Branch (15035:9): [True: 0, False: 0]
  ------------------
15036|      0|            r = js_bigint_pow(ctx, p1, p2);
15037|      0|            break;
15038|      0|        default:
  ------------------
  |  Branch (15038:9): [True: 0, False: 0]
  ------------------
15039|      0|            abort();
15040|      0|        }
15041|      0|        JS_FreeValue(ctx, op1);
15042|      0|        JS_FreeValue(ctx, op2);
15043|      0|        if (!r)
  ------------------
  |  Branch (15043:13): [True: 0, False: 0]
  ------------------
15044|      0|            goto exception;
15045|      0|        sp[-2] = JS_CompactBigInt(ctx, r);
15046|      3|    } else {
15047|      3|        double dr;
15048|       |        /* float64 result */
15049|      3|        if (JS_ToFloat64Free(ctx, &d1, op1)) {
  ------------------
  |  Branch (15049:13): [True: 0, False: 3]
  ------------------
15050|      0|            JS_FreeValue(ctx, op2);
15051|      0|            goto exception;
15052|      0|        }
15053|      3|        if (JS_ToFloat64Free(ctx, &d2, op2))
  ------------------
  |  Branch (15053:13): [True: 0, False: 3]
  ------------------
15054|      0|            goto exception;
15055|      3|    handle_float64:
15056|      3|        switch(op) {
15057|      0|        case OP_sub:
  ------------------
  |  Branch (15057:9): [True: 0, False: 3]
  ------------------
15058|      0|            dr = d1 - d2;
15059|      0|            break;
15060|      1|        case OP_mul:
  ------------------
  |  Branch (15060:9): [True: 1, False: 2]
  ------------------
15061|      1|            dr = d1 * d2;
15062|      1|            break;
15063|      0|        case OP_div:
  ------------------
  |  Branch (15063:9): [True: 0, False: 3]
  ------------------
15064|      0|            dr = d1 / d2;
15065|      0|            break;
15066|      2|        case OP_mod:
  ------------------
  |  Branch (15066:9): [True: 2, False: 1]
  ------------------
15067|      2|            dr = fmod(d1, d2);
15068|      2|            break;
15069|      0|        case OP_pow:
  ------------------
  |  Branch (15069:9): [True: 0, False: 3]
  ------------------
15070|      0|            dr = js_pow(d1, d2);
15071|      0|            break;
15072|      0|        default:
  ------------------
  |  Branch (15072:9): [True: 0, False: 3]
  ------------------
15073|      0|            abort();
15074|      3|        }
15075|      3|        sp[-2] = __JS_NewFloat64(ctx, dr);
15076|      3|    }
15077|      3|    return 0;
15078|      0| exception:
15079|      0|    sp[-2] = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
15080|      0|    sp[-1] = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
15081|      0|    return -1;
15082|      3|}
quickjs.c:js_unary_arith_slow:
14714|      2|{
14715|      2|    JSValue op1;
14716|      2|    int v;
14717|      2|    uint32_t tag;
14718|      2|    JSBigIntBuf buf1;
14719|      2|    JSBigInt *p1;
14720|       |
14721|      2|    op1 = sp[-1];
14722|       |    /* fast path for float64 */
14723|      2|    if (JS_TAG_IS_FLOAT64(JS_VALUE_GET_TAG(op1)))
  ------------------
  |  |  248|      2|#define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64)
  |  |  ------------------
  |  |  |  Branch (248:32): [True: 0, False: 2]
  |  |  ------------------
  ------------------
14724|      0|        goto handle_float64;
14725|      2|    op1 = JS_ToNumericFree(ctx, op1);
14726|      2|    if (JS_IsException(op1))
  ------------------
  |  Branch (14726:9): [True: 0, False: 2]
  ------------------
14727|      0|        goto exception;
14728|      2|    tag = JS_VALUE_GET_TAG(op1);
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
14729|      2|    switch(tag) {
14730|      0|    case JS_TAG_INT:
  ------------------
  |  Branch (14730:5): [True: 0, False: 2]
  ------------------
14731|      0|        {
14732|      0|            int64_t v64;
14733|      0|            v64 = JS_VALUE_GET_INT(op1);
  ------------------
  |  |  239|      0|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
14734|      0|            switch(op) {
14735|      0|            case OP_inc:
  ------------------
  |  Branch (14735:13): [True: 0, False: 0]
  ------------------
14736|      0|            case OP_dec:
  ------------------
  |  Branch (14736:13): [True: 0, False: 0]
  ------------------
14737|      0|                v = 2 * (op - OP_dec) - 1;
14738|      0|                v64 += v;
14739|      0|                break;
14740|      0|            case OP_plus:
  ------------------
  |  Branch (14740:13): [True: 0, False: 0]
  ------------------
14741|      0|                break;
14742|      0|            case OP_neg:
  ------------------
  |  Branch (14742:13): [True: 0, False: 0]
  ------------------
14743|      0|                if (v64 == 0) {
  ------------------
  |  Branch (14743:21): [True: 0, False: 0]
  ------------------
14744|      0|                    sp[-1] = __JS_NewFloat64(ctx, -0.0);
14745|      0|                    return 0;
14746|      0|                } else {
14747|      0|                    v64 = -v64;
14748|      0|                }
14749|      0|                break;
14750|      0|            default:
  ------------------
  |  Branch (14750:13): [True: 0, False: 0]
  ------------------
14751|      0|                abort();
14752|      0|            }
14753|      0|            sp[-1] = JS_NewInt64(ctx, v64);
14754|      0|        }
14755|      0|        break;
14756|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (14756:5): [True: 0, False: 2]
  ------------------
14757|      0|        {
14758|      0|            int64_t v;
14759|      0|            v = JS_VALUE_GET_SHORT_BIG_INT(op1);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
14760|      0|            switch(op) {
14761|      0|            case OP_plus:
  ------------------
  |  Branch (14761:13): [True: 0, False: 0]
  ------------------
14762|      0|                JS_ThrowTypeError(ctx, "bigint argument with unary +");
14763|      0|                goto exception;
14764|      0|            case OP_inc:
  ------------------
  |  Branch (14764:13): [True: 0, False: 0]
  ------------------
14765|      0|                if (v == JS_SHORT_BIG_INT_MAX)
  ------------------
  |  |11265|      0|#define JS_SHORT_BIG_INT_MAX INT64_MAX
  ------------------
  |  Branch (14765:21): [True: 0, False: 0]
  ------------------
14766|      0|                    goto bigint_slow_case;
14767|      0|                sp[-1] = __JS_NewShortBigInt(ctx, v + 1);
14768|      0|                break;
14769|      0|            case OP_dec:
  ------------------
  |  Branch (14769:13): [True: 0, False: 0]
  ------------------
14770|      0|                if (v == JS_SHORT_BIG_INT_MIN)
  ------------------
  |  |11264|      0|#define JS_SHORT_BIG_INT_MIN INT64_MIN
  ------------------
  |  Branch (14770:21): [True: 0, False: 0]
  ------------------
14771|      0|                    goto bigint_slow_case;
14772|      0|                sp[-1] = __JS_NewShortBigInt(ctx, v - 1);
14773|      0|                break;
14774|      0|            case OP_neg:
  ------------------
  |  Branch (14774:13): [True: 0, False: 0]
  ------------------
14775|      0|                v = JS_VALUE_GET_SHORT_BIG_INT(op1);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
14776|      0|                if (v == JS_SHORT_BIG_INT_MIN) {
  ------------------
  |  |11264|      0|#define JS_SHORT_BIG_INT_MIN INT64_MIN
  ------------------
  |  Branch (14776:21): [True: 0, False: 0]
  ------------------
14777|      0|                bigint_slow_case:
14778|      0|                    p1 = js_bigint_set_short(&buf1, op1);
14779|      0|                    goto bigint_slow_case1;
14780|      0|                }
14781|      0|                sp[-1] = __JS_NewShortBigInt(ctx, -v);
14782|      0|                break;
14783|      0|            default:
  ------------------
  |  Branch (14783:13): [True: 0, False: 0]
  ------------------
14784|      0|                abort();
14785|      0|            }
14786|      0|        }
14787|      0|        break;
14788|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (14788:5): [True: 0, False: 2]
  ------------------
14789|      0|        {
14790|      0|            JSBigInt *r;
14791|      0|            p1 = JS_VALUE_GET_PTR(op1);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
14792|      0|        bigint_slow_case1:
14793|      0|            switch(op) {
14794|      0|            case OP_plus:
  ------------------
  |  Branch (14794:13): [True: 0, False: 0]
  ------------------
14795|      0|                JS_ThrowTypeError(ctx, "bigint argument with unary +");
14796|      0|                JS_FreeValue(ctx, op1);
14797|      0|                goto exception;
14798|      0|            case OP_inc:
  ------------------
  |  Branch (14798:13): [True: 0, False: 0]
  ------------------
14799|      0|            case OP_dec:
  ------------------
  |  Branch (14799:13): [True: 0, False: 0]
  ------------------
14800|      0|                {
14801|      0|                    JSBigIntBuf buf2;
14802|      0|                    JSBigInt *p2;
14803|      0|                    p2 = js_bigint_set_si(&buf2, 2 * (op - OP_dec) - 1);
14804|      0|                    r = js_bigint_add(ctx, p1, p2, 0);
14805|      0|                }
14806|      0|                break;
14807|      0|            case OP_neg:
  ------------------
  |  Branch (14807:13): [True: 0, False: 0]
  ------------------
14808|      0|                r = js_bigint_neg(ctx, p1);
14809|      0|                break;
14810|      0|            case OP_not:
  ------------------
  |  Branch (14810:13): [True: 0, False: 0]
  ------------------
14811|      0|                r = js_bigint_not(ctx, p1);
14812|      0|                break;
14813|      0|            default:
  ------------------
  |  Branch (14813:13): [True: 0, False: 0]
  ------------------
14814|      0|                abort();
14815|      0|            }
14816|      0|            JS_FreeValue(ctx, op1);
14817|      0|            if (!r)
  ------------------
  |  Branch (14817:17): [True: 0, False: 0]
  ------------------
14818|      0|                goto exception;
14819|      0|            sp[-1] = JS_CompactBigInt(ctx, r);
14820|      0|        }
14821|      0|        break;
14822|      2|    default:
  ------------------
  |  Branch (14822:5): [True: 2, False: 0]
  ------------------
14823|      2|    handle_float64:
14824|      2|        {
14825|      2|            double d;
14826|      2|            d = JS_VALUE_GET_FLOAT64(op1);
  ------------------
  |  |  241|      2|#define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
  ------------------
14827|      2|            switch(op) {
14828|      0|            case OP_inc:
  ------------------
  |  Branch (14828:13): [True: 0, False: 2]
  ------------------
14829|      0|            case OP_dec:
  ------------------
  |  Branch (14829:13): [True: 0, False: 2]
  ------------------
14830|      0|                v = 2 * (op - OP_dec) - 1;
14831|      0|                d += v;
14832|      0|                break;
14833|      0|            case OP_plus:
  ------------------
  |  Branch (14833:13): [True: 0, False: 2]
  ------------------
14834|      0|                break;
14835|      2|            case OP_neg:
  ------------------
  |  Branch (14835:13): [True: 2, False: 0]
  ------------------
14836|      2|                d = -d;
14837|      2|                break;
14838|      0|            default:
  ------------------
  |  Branch (14838:13): [True: 0, False: 2]
  ------------------
14839|      0|                abort();
14840|      2|            }
14841|      2|            sp[-1] = __JS_NewFloat64(ctx, d);
14842|      2|        }
14843|      0|        break;
14844|      2|    }
14845|      2|    return 0;
14846|      0| exception:
14847|      0|    sp[-1] = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
14848|      0|    return -1;
14849|      2|}
quickjs.c:js_binary_logic_slow:
15208|      1|{
15209|      1|    JSValue op1, op2;
15210|      1|    uint32_t tag1, tag2;
15211|      1|    uint32_t v1, v2, r;
15212|       |
15213|      1|    op1 = sp[-2];
15214|      1|    op2 = sp[-1];
15215|      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)
  |  |  ------------------
  ------------------
15216|      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)
  |  |  ------------------
  ------------------
15217|       |
15218|      1|    if (tag1 == JS_TAG_SHORT_BIG_INT && tag2 == JS_TAG_SHORT_BIG_INT) {
  ------------------
  |  Branch (15218:9): [True: 0, False: 1]
  |  Branch (15218:41): [True: 0, False: 0]
  ------------------
15219|      0|        js_slimb_t v1, v2, v;
15220|      0|        js_sdlimb_t vd;
15221|      0|        v1 = JS_VALUE_GET_SHORT_BIG_INT(op1);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
15222|      0|        v2 = JS_VALUE_GET_SHORT_BIG_INT(op2);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
15223|       |        /* bigint fast path */
15224|      0|        switch(op) {
15225|      0|        case OP_and:
  ------------------
  |  Branch (15225:9): [True: 0, False: 0]
  ------------------
15226|      0|            v = v1 & v2;
15227|      0|            break;
15228|      0|        case OP_or:
  ------------------
  |  Branch (15228:9): [True: 0, False: 0]
  ------------------
15229|      0|            v = v1 | v2;
15230|      0|            break;
15231|      0|        case OP_xor:
  ------------------
  |  Branch (15231:9): [True: 0, False: 0]
  ------------------
15232|      0|            v = v1 ^ v2;
15233|      0|            break;
15234|      0|        case OP_sar:
  ------------------
  |  Branch (15234:9): [True: 0, False: 0]
  ------------------
15235|      0|            if (v2 > (JS_LIMB_BITS - 1)) {
  ------------------
  |  |   68|      0|#define JS_LIMB_BITS 64
  ------------------
  |  Branch (15235:17): [True: 0, False: 0]
  ------------------
15236|      0|                goto slow_big_int;
15237|      0|            } else if (v2 < 0) {
  ------------------
  |  Branch (15237:24): [True: 0, False: 0]
  ------------------
15238|      0|                if (v2 < -(JS_LIMB_BITS - 1))
  ------------------
  |  |   68|      0|#define JS_LIMB_BITS 64
  ------------------
  |  Branch (15238:21): [True: 0, False: 0]
  ------------------
15239|      0|                    goto slow_big_int;
15240|      0|                v2 = -v2;
15241|      0|                goto bigint_shl;
15242|      0|            }
15243|      0|        bigint_sar:
15244|      0|            v = v1 >> v2;
15245|      0|            break;
15246|      0|        case OP_shl:
  ------------------
  |  Branch (15246:9): [True: 0, False: 0]
  ------------------
15247|      0|            if (v2 > (JS_LIMB_BITS - 1)) {
  ------------------
  |  |   68|      0|#define JS_LIMB_BITS 64
  ------------------
  |  Branch (15247:17): [True: 0, False: 0]
  ------------------
15248|      0|                goto slow_big_int;
15249|      0|            } else if (v2 < 0) {
  ------------------
  |  Branch (15249:24): [True: 0, False: 0]
  ------------------
15250|      0|                if (v2 < -(JS_LIMB_BITS - 1))
  ------------------
  |  |   68|      0|#define JS_LIMB_BITS 64
  ------------------
  |  Branch (15250:21): [True: 0, False: 0]
  ------------------
15251|      0|                    goto slow_big_int;
15252|      0|                v2 = -v2;
15253|      0|                goto bigint_sar;
15254|      0|            }
15255|      0|        bigint_shl:
15256|      0|            vd = (js_dlimb_t)v1 << v2;
15257|      0|            if (likely(vd >= JS_SHORT_BIG_INT_MIN &&
  ------------------
  |  |   32|      0|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 0, False: 0]
  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  |  Branch (32:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
15258|      0|                       vd <= JS_SHORT_BIG_INT_MAX)) {
15259|      0|                v = vd;
15260|      0|            } else {
15261|      0|                JSBigInt *r = js_bigint_new_di(ctx, vd);
15262|      0|                if (!r)
  ------------------
  |  Branch (15262:21): [True: 0, False: 0]
  ------------------
15263|      0|                    goto exception;
15264|      0|                sp[-2] = JS_MKPTR(JS_TAG_BIG_INT, r);
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
15265|      0|                return 0;
15266|      0|            }
15267|      0|            break;
15268|      0|        default:
  ------------------
  |  Branch (15268:9): [True: 0, False: 0]
  ------------------
15269|      0|            abort();
15270|      0|        }
15271|      0|        sp[-2] = __JS_NewShortBigInt(ctx, v);
15272|      0|        return 0;
15273|      0|    }
15274|      1|    op1 = JS_ToNumericFree(ctx, op1);
15275|      1|    if (JS_IsException(op1)) {
  ------------------
  |  Branch (15275:9): [True: 0, False: 1]
  ------------------
15276|      0|        JS_FreeValue(ctx, op2);
15277|      0|        goto exception;
15278|      0|    }
15279|      1|    op2 = JS_ToNumericFree(ctx, op2);
15280|      1|    if (JS_IsException(op2)) {
  ------------------
  |  Branch (15280:9): [True: 0, False: 1]
  ------------------
15281|      0|        JS_FreeValue(ctx, op1);
15282|      0|        goto exception;
15283|      0|    }
15284|       |
15285|      1|    tag1 = JS_VALUE_GET_TAG(op1);
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
15286|      1|    tag2 = JS_VALUE_GET_TAG(op2);
  ------------------
  |  |  236|      1|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
15287|      1|    if ((tag1 == JS_TAG_BIG_INT || tag1 == JS_TAG_SHORT_BIG_INT) &&
  ------------------
  |  Branch (15287:10): [True: 0, False: 1]
  |  Branch (15287:36): [True: 0, False: 1]
  ------------------
15288|      0|        (tag2 == JS_TAG_BIG_INT || tag2 == JS_TAG_SHORT_BIG_INT)) {
  ------------------
  |  Branch (15288:10): [True: 0, False: 0]
  |  Branch (15288:36): [True: 0, False: 0]
  ------------------
15289|      0|        JSBigInt *p1, *p2, *r;
15290|      0|        JSBigIntBuf buf1, buf2;
15291|      0|    slow_big_int:
15292|      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 (15292:13): [True: 0, False: 0]
  ------------------
15293|      0|            p1 = js_bigint_set_short(&buf1, op1);
15294|      0|        else
15295|      0|            p1 = JS_VALUE_GET_PTR(op1);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
15296|      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 (15296:13): [True: 0, False: 0]
  ------------------
15297|      0|            p2 = js_bigint_set_short(&buf2, op2);
15298|      0|        else
15299|      0|            p2 = JS_VALUE_GET_PTR(op2);
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
15300|      0|        switch(op) {
15301|      0|        case OP_and:
  ------------------
  |  Branch (15301:9): [True: 0, False: 0]
  ------------------
15302|      0|        case OP_or:
  ------------------
  |  Branch (15302:9): [True: 0, False: 0]
  ------------------
15303|      0|        case OP_xor:
  ------------------
  |  Branch (15303:9): [True: 0, False: 0]
  ------------------
15304|      0|            r = js_bigint_logic(ctx, p1, p2, op);
15305|      0|            break;
15306|      0|        case OP_shl:
  ------------------
  |  Branch (15306:9): [True: 0, False: 0]
  ------------------
15307|      0|        case OP_sar:
  ------------------
  |  Branch (15307:9): [True: 0, False: 0]
  ------------------
15308|      0|            {
15309|      0|                js_slimb_t shift;
15310|      0|                shift = js_bigint_get_si_sat(p2);
15311|      0|                if (shift > INT32_MAX)
  ------------------
  |  Branch (15311:21): [True: 0, False: 0]
  ------------------
15312|      0|                    shift = INT32_MAX;
15313|      0|                else if (shift < -INT32_MAX)
  ------------------
  |  Branch (15313:26): [True: 0, False: 0]
  ------------------
15314|      0|                    shift = -INT32_MAX;
15315|      0|                if (op == OP_sar)
  ------------------
  |  Branch (15315:21): [True: 0, False: 0]
  ------------------
15316|      0|                    shift = -shift;
15317|      0|                if (shift >= 0)
  ------------------
  |  Branch (15317:21): [True: 0, False: 0]
  ------------------
15318|      0|                    r = js_bigint_shl(ctx, p1, shift);
15319|      0|                else
15320|      0|                    r = js_bigint_shr(ctx, p1, -shift);
15321|      0|            }
15322|      0|            break;
15323|      0|        default:
  ------------------
  |  Branch (15323:9): [True: 0, False: 0]
  ------------------
15324|      0|            abort();
15325|      0|        }
15326|      0|        JS_FreeValue(ctx, op1);
15327|      0|        JS_FreeValue(ctx, op2);
15328|      0|        if (!r)
  ------------------
  |  Branch (15328:13): [True: 0, False: 0]
  ------------------
15329|      0|            goto exception;
15330|      0|        sp[-2] = JS_CompactBigInt(ctx, r);
15331|      1|    } else {
15332|      1|        if (unlikely(JS_ToInt32Free(ctx, (int32_t *)&v1, op1))) {
  ------------------
  |  |   33|      1|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1]
  |  |  ------------------
  ------------------
15333|      0|            JS_FreeValue(ctx, op2);
15334|      0|            goto exception;
15335|      0|        }
15336|      1|        if (unlikely(JS_ToInt32Free(ctx, (int32_t *)&v2, op2)))
  ------------------
  |  |   33|      1|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 1]
  |  |  ------------------
  ------------------
15337|      0|            goto exception;
15338|      1|        switch(op) {
15339|      0|        case OP_shl:
  ------------------
  |  Branch (15339:9): [True: 0, False: 1]
  ------------------
15340|      0|            r = v1 << (v2 & 0x1f);
15341|      0|            break;
15342|      0|        case OP_sar:
  ------------------
  |  Branch (15342:9): [True: 0, False: 1]
  ------------------
15343|      0|            r = (int)v1 >> (v2 & 0x1f);
15344|      0|            break;
15345|      1|        case OP_and:
  ------------------
  |  Branch (15345:9): [True: 1, False: 0]
  ------------------
15346|      1|            r = v1 & v2;
15347|      1|            break;
15348|      0|        case OP_or:
  ------------------
  |  Branch (15348:9): [True: 0, False: 1]
  ------------------
15349|      0|            r = v1 | v2;
15350|      0|            break;
15351|      0|        case OP_xor:
  ------------------
  |  Branch (15351:9): [True: 0, False: 1]
  ------------------
15352|      0|            r = v1 ^ v2;
15353|      0|            break;
15354|      0|        default:
  ------------------
  |  Branch (15354:9): [True: 0, False: 1]
  ------------------
15355|      0|            abort();
15356|      1|        }
15357|      1|        sp[-2] = JS_NewInt32(ctx, r);
15358|      1|    }
15359|      1|    return 0;
15360|      0| exception:
15361|      0|    sp[-2] = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
15362|      0|    sp[-1] = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
15363|      0|    return -1;
15364|      1|}
quickjs.c:js_string_compare:
 4609|  6.80k|{
 4610|  6.80k|    int res, len;
 4611|  6.80k|    len = min_int(p1->len, p2->len);
 4612|  6.80k|    res = js_string_memcmp(p1, 0, p2, 0, len);
 4613|  6.80k|    if (res == 0) {
  ------------------
  |  Branch (4613:9): [True: 84, False: 6.72k]
  ------------------
 4614|     84|        if (p1->len == p2->len)
  ------------------
  |  Branch (4614:13): [True: 0, False: 84]
  ------------------
 4615|      0|            res = 0;
 4616|     84|        else if (p1->len < p2->len)
  ------------------
  |  Branch (4616:18): [True: 42, False: 42]
  ------------------
 4617|     42|            res = -1;
 4618|     42|        else
 4619|     42|            res = 1;
 4620|     84|    }
 4621|  6.80k|    return res;
 4622|  6.80k|}
quickjs.c:is_backtrace_needed:
 7612|     11|{
 7613|     11|    JSObject *p;
 7614|     11|    if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|     11|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (7614:9): [True: 0, False: 11]
  ------------------
 7615|      0|        return FALSE;
 7616|     11|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|     11|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     11|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 7617|     11|    if (p->class_id != JS_CLASS_ERROR)
  ------------------
  |  Branch (7617:9): [True: 0, False: 11]
  ------------------
 7618|      0|        return FALSE;
 7619|     11|    if (find_own_property1(p, JS_ATOM_stack))
  ------------------
  |  Branch (7619:9): [True: 2, False: 9]
  ------------------
 7620|      2|        return FALSE;
 7621|      9|    return TRUE;
 7622|     11|}
quickjs.c:close_var_refs:
17551|     13|{
17552|     13|    JSVarRef *var_ref;
17553|     13|    int i;
17554|       |
17555|     13|    for(i = 0; i < b->var_ref_count; i++) {
  ------------------
  |  Branch (17555:16): [True: 0, False: 13]
  ------------------
17556|      0|        var_ref = sf->var_refs[i];
17557|      0|        if (var_ref)
  ------------------
  |  Branch (17557:13): [True: 0, False: 0]
  ------------------
17558|      0|            close_var_ref(rt, sf, var_ref);
17559|      0|    }
17560|     13|}
quickjs.c:JS_CallFree:
20540|  1.01M|{
20541|  1.01M|    JSValue res = JS_CallInternal(ctx, func_obj, this_obj, JS_UNDEFINED,
  ------------------
  |  |  289|  1.01M|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|  1.01M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20542|  1.01M|                                  argc, (JSValue *)argv, JS_CALL_FLAG_COPY_ARGV);
  ------------------
  |  |17576|  1.01M|#define JS_CALL_FLAG_COPY_ARGV   (1 << 1)
  ------------------
20543|  1.01M|    JS_FreeValue(ctx, func_obj);
20544|  1.01M|    return res;
20545|  1.01M|}
quickjs.c:JS_CallConstructorInternal:
20627|      2|{
20628|      2|    JSObject *p;
20629|      2|    JSFunctionBytecode *b;
20630|       |
20631|      2|    if (js_poll_interrupts(ctx))
  ------------------
  |  Branch (20631:9): [True: 0, False: 2]
  ------------------
20632|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20633|      2|    flags |= JS_CALL_FLAG_CONSTRUCTOR;
  ------------------
  |  |  524|      2|#define JS_CALL_FLAG_CONSTRUCTOR (1 << 0)
  ------------------
20634|      2|    if (unlikely(JS_VALUE_GET_TAG(func_obj) != JS_TAG_OBJECT))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
20635|      0|        goto not_a_function;
20636|      2|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
20637|      2|    if (unlikely(!p->is_constructor))
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  ------------------
  ------------------
20638|      0|        return JS_ThrowTypeErrorNotAConstructor(ctx, func_obj);
20639|      2|    if (unlikely(p->class_id != JS_CLASS_BYTECODE_FUNCTION)) {
  ------------------
  |  |   33|      2|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 0]
  |  |  ------------------
  ------------------
20640|      2|        JSClassCall *call_func;
20641|      2|        call_func = ctx->rt->class_array[p->class_id].call;
20642|      2|        if (!call_func) {
  ------------------
  |  Branch (20642:13): [True: 0, False: 2]
  ------------------
20643|      0|        not_a_function:
20644|      0|            return JS_ThrowTypeError(ctx, "not a function");
20645|      0|        }
20646|      2|        return call_func(ctx, func_obj, new_target, argc,
20647|      2|                         (JSValueConst *)argv, flags);
20648|      2|    }
20649|       |
20650|      0|    b = p->u.func.function_bytecode;
20651|      0|    if (b->is_derived_class_constructor) {
  ------------------
  |  Branch (20651:9): [True: 0, False: 0]
  ------------------
20652|      0|        return JS_CallInternal(ctx, func_obj, JS_UNDEFINED, new_target, argc, argv, flags);
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20653|      0|    } else {
20654|      0|        JSValue obj, ret;
20655|       |        /* legacy constructor behavior */
20656|      0|        obj = js_create_from_ctor(ctx, new_target, JS_CLASS_OBJECT);
20657|      0|        if (JS_IsException(obj))
  ------------------
  |  Branch (20657:13): [True: 0, False: 0]
  ------------------
20658|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20659|      0|        ret = JS_CallInternal(ctx, func_obj, obj, new_target, argc, argv, flags);
20660|      0|        if (JS_VALUE_GET_TAG(ret) == JS_TAG_OBJECT ||
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (20660:13): [True: 0, False: 0]
  ------------------
20661|      0|            JS_IsException(ret)) {
  ------------------
  |  Branch (20661:13): [True: 0, False: 0]
  ------------------
20662|      0|            JS_FreeValue(ctx, obj);
20663|      0|            return ret;
20664|      0|        } else {
20665|      0|            JS_FreeValue(ctx, ret);
20666|      0|            return obj;
20667|      0|        }
20668|      0|    }
20669|      0|}
quickjs.c:async_func_init:
20710|     13|{
20711|     13|    JSAsyncFunctionState *s;
20712|     13|    JSObject *p;
20713|     13|    JSFunctionBytecode *b;
20714|     13|    JSStackFrame *sf;
20715|     13|    int i, arg_buf_len, n;
20716|       |
20717|     13|    p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  227|     13|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     13|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
20718|     13|    b = p->u.func.function_bytecode;
20719|     13|    arg_buf_len = max_int(b->arg_count, argc);
20720|     13|    s = js_malloc(ctx, sizeof(*s) + sizeof(JSValue) * (arg_buf_len + b->var_count + b->stack_size) + sizeof(JSVarRef *) * b->var_ref_count);
20721|     13|    if (!s)
  ------------------
  |  Branch (20721:9): [True: 0, False: 13]
  ------------------
20722|      0|        return NULL;
20723|     13|    memset(s, 0, sizeof(*s));
20724|     13|    js_rc(s)->ref_count = 1;
20725|     13|    add_gc_object(ctx->rt, &s->header, JS_GC_OBJ_TYPE_ASYNC_FUNCTION);
20726|       |
20727|     13|    sf = &s->frame;
20728|     13|    sf->js_mode = b->js_mode | JS_MODE_ASYNC;
  ------------------
  |  |  396|     13|#define JS_MODE_ASYNC  (1 << 2) /* async function */
  ------------------
20729|     13|    sf->cur_pc = b->byte_code_buf;
20730|     13|    sf->arg_buf = (JSValue *)(s + 1);
20731|     13|    sf->cur_func = JS_DupValue(ctx, func_obj);
20732|     13|    s->this_val = JS_DupValue(ctx, this_obj);
20733|     13|    s->argc = argc;
20734|     13|    sf->arg_count = arg_buf_len;
20735|     13|    sf->var_buf = sf->arg_buf + arg_buf_len;
20736|     13|    sf->cur_sp = sf->var_buf + b->var_count;
20737|     13|    sf->var_refs = (JSVarRef **)(sf->cur_sp + b->stack_size);
20738|     13|    for(i = 0; i < b->var_ref_count; i++)
  ------------------
  |  Branch (20738:16): [True: 0, False: 13]
  ------------------
20739|      0|        sf->var_refs[i] = NULL;
20740|     13|    for(i = 0; i < argc; i++)
  ------------------
  |  Branch (20740:16): [True: 0, False: 13]
  ------------------
20741|      0|        sf->arg_buf[i] = JS_DupValue(ctx, argv[i]);
20742|     13|    n = arg_buf_len + b->var_count;
20743|     13|    for(i = argc; i < n; i++)
  ------------------
  |  Branch (20743:19): [True: 0, False: 13]
  ------------------
20744|     13|        sf->arg_buf[i] = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     13|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20745|     13|    s->resolving_funcs[0] = JS_UNDEFINED;
  ------------------
  |  |  289|     13|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     13|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20746|     13|    s->resolving_funcs[1] = JS_UNDEFINED;
  ------------------
  |  |  289|     13|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     13|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20747|     13|    s->is_completed = FALSE;
20748|     13|    return s;
20749|     13|}
quickjs.c:async_func_resume:
20766|     13|{
20767|     13|    JSRuntime *rt = ctx->rt;
20768|     13|    JSStackFrame *sf = &s->frame;
20769|     13|    JSValue func_obj, ret;
20770|       |
20771|     13|    assert(!s->is_completed);
  ------------------
  |  Branch (20771:5): [True: 0, False: 13]
  |  Branch (20771:5): [True: 13, False: 0]
  ------------------
20772|     13|    if (js_check_stack_overflow(ctx->rt, 0)) {
  ------------------
  |  Branch (20772:9): [True: 0, False: 13]
  ------------------
20773|      0|        ret = JS_ThrowStackOverflow(ctx);
20774|     13|    } else {
20775|       |        /* the tag does not matter provided it is not an object */
20776|     13|        func_obj = JS_MKPTR(JS_TAG_INT, s);
  ------------------
  |  |  246|     13|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
20777|     13|        ret = JS_CallInternal(ctx, func_obj, s->this_val, JS_UNDEFINED,
  ------------------
  |  |  289|     13|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     13|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20778|     13|                              s->argc, sf->arg_buf, JS_CALL_FLAG_GENERATOR);
  ------------------
  |  |17577|     13|#define JS_CALL_FLAG_GENERATOR   (1 << 2)
  ------------------
20779|     13|    }
20780|     13|    if (JS_IsException(ret) || JS_IsUndefined(ret)) {
  ------------------
  |  Branch (20780:9): [True: 0, False: 13]
  |  Branch (20780:32): [True: 13, False: 0]
  ------------------
20781|     13|        JSObject *p;
20782|     13|        JSFunctionBytecode *b;
20783|       |        
20784|     13|        p = JS_VALUE_GET_OBJ(sf->cur_func);
  ------------------
  |  |  227|     13|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     13|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
20785|     13|        b = p->u.func.function_bytecode;
20786|       |        
20787|     13|        if (JS_IsUndefined(ret)) {
  ------------------
  |  Branch (20787:13): [True: 13, False: 0]
  ------------------
20788|     13|            ret = sf->cur_sp[-1];
20789|     13|            sf->cur_sp[-1] = JS_UNDEFINED;
  ------------------
  |  |  289|     13|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     13|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20790|     13|        }
20791|       |        /* end of execution */
20792|     13|        s->is_completed = TRUE;
20793|       |
20794|       |        /* close the closure variables. */
20795|     13|        close_var_refs(rt, b, sf);
20796|       |        
20797|     13|        async_func_free_frame(rt, s);
20798|     13|    }
20799|     13|    return ret;
20800|     13|}
quickjs.c:skip_shebang:
23576|     28|{
23577|     28|    const uint8_t *p = *pp;
23578|     28|    int c;
23579|       |
23580|     28|    if (p[0] == '#' && p[1] == '!') {
  ------------------
  |  Branch (23580:9): [True: 0, False: 28]
  |  Branch (23580:24): [True: 0, False: 0]
  ------------------
23581|      0|        p += 2;
23582|      0|        while (p < buf_end) {
  ------------------
  |  Branch (23582:16): [True: 0, False: 0]
  ------------------
23583|      0|            if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (23583:17): [True: 0, False: 0]
  |  Branch (23583:31): [True: 0, False: 0]
  ------------------
23584|      0|                break;
23585|      0|            } else if (*p >= 0x80) {
  ------------------
  |  Branch (23585:24): [True: 0, False: 0]
  ------------------
23586|      0|                c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
23587|      0|                if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21703|      0|#define CP_LS   0x2028
  ------------------
                              if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21704|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (23587:21): [True: 0, False: 0]
  |  Branch (23587:35): [True: 0, False: 0]
  ------------------
23588|      0|                    break;
23589|      0|                } else if (c == -1) {
  ------------------
  |  Branch (23589:28): [True: 0, False: 0]
  ------------------
23590|      0|                    p++; /* skip invalid UTF-8 */
23591|      0|                }
23592|      0|            } else {
23593|      0|                p++;
23594|      0|            }
23595|      0|        }
23596|      0|        *pp = p;
23597|      0|    }
23598|     28|}
quickjs.c:simple_next_token:
23485|    198|{
23486|    198|    const uint8_t *p;
23487|    198|    uint32_t c;
23488|       |
23489|       |    /* skip spaces and comments */
23490|    198|    p = *pp;
23491|  1.04M|    for (;;) {
23492|  1.04M|        switch(c = *p++) {
23493|      0|        case '\r':
  ------------------
  |  Branch (23493:9): [True: 0, False: 1.04M]
  ------------------
23494|  1.04M|        case '\n':
  ------------------
  |  Branch (23494:9): [True: 1.04M, False: 217]
  ------------------
23495|  1.04M|            if (no_line_terminator)
  ------------------
  |  Branch (23495:17): [True: 15, False: 1.04M]
  ------------------
23496|     15|                return '\n';
23497|  1.04M|            continue;
23498|  1.04M|        case ' ':
  ------------------
  |  Branch (23498:9): [True: 28, False: 1.04M]
  ------------------
23499|     31|        case '\t':
  ------------------
  |  Branch (23499:9): [True: 3, False: 1.04M]
  ------------------
23500|     31|        case '\v':
  ------------------
  |  Branch (23500:9): [True: 0, False: 1.04M]
  ------------------
23501|     31|        case '\f':
  ------------------
  |  Branch (23501:9): [True: 0, False: 1.04M]
  ------------------
23502|     31|            continue;
23503|      6|        case '/':
  ------------------
  |  Branch (23503:9): [True: 6, False: 1.04M]
  ------------------
23504|      6|            if (*p == '/') {
  ------------------
  |  Branch (23504:17): [True: 6, False: 0]
  ------------------
23505|      6|                if (no_line_terminator)
  ------------------
  |  Branch (23505:21): [True: 3, False: 3]
  ------------------
23506|      3|                    return '\n';
23507|     16|                while (*p && *p != '\r' && *p != '\n')
  ------------------
  |  Branch (23507:24): [True: 14, False: 2]
  |  Branch (23507:30): [True: 14, False: 0]
  |  Branch (23507:44): [True: 13, False: 1]
  ------------------
23508|     13|                    p++;
23509|      3|                continue;
23510|      6|            }
23511|      0|            if (*p == '*') {
  ------------------
  |  Branch (23511:17): [True: 0, False: 0]
  ------------------
23512|      0|                while (*++p) {
  ------------------
  |  Branch (23512:24): [True: 0, False: 0]
  ------------------
23513|      0|                    if ((*p == '\r' || *p == '\n') && no_line_terminator)
  ------------------
  |  Branch (23513:26): [True: 0, False: 0]
  |  Branch (23513:40): [True: 0, False: 0]
  |  Branch (23513:55): [True: 0, False: 0]
  ------------------
23514|      0|                        return '\n';
23515|      0|                    if (*p == '*' && p[1] == '/') {
  ------------------
  |  Branch (23515:25): [True: 0, False: 0]
  |  Branch (23515:38): [True: 0, False: 0]
  ------------------
23516|      0|                        p += 2;
23517|      0|                        break;
23518|      0|                    }
23519|      0|                }
23520|      0|                continue;
23521|      0|            }
23522|      0|            break;
23523|      9|        case '=':
  ------------------
  |  Branch (23523:9): [True: 9, False: 1.04M]
  ------------------
23524|      9|            if (*p == '>')
  ------------------
  |  Branch (23524:17): [True: 0, False: 9]
  ------------------
23525|      0|                return TOK_ARROW;
23526|      9|            break;
23527|     12|        case 'i':
  ------------------
  |  Branch (23527:9): [True: 12, False: 1.04M]
  ------------------
23528|     12|            if (match_identifier(p, "n"))
  ------------------
  |  Branch (23528:17): [True: 0, False: 12]
  ------------------
23529|      0|                return TOK_IN;
23530|     12|            if (match_identifier(p, "mport")) {
  ------------------
  |  Branch (23530:17): [True: 0, False: 12]
  ------------------
23531|      0|                *pp = p + 5;
23532|      0|                return TOK_IMPORT;
23533|      0|            }
23534|     12|            return TOK_IDENT;
23535|      0|        case 'o':
  ------------------
  |  Branch (23535:9): [True: 0, False: 1.04M]
  ------------------
23536|      0|            if (match_identifier(p, "f"))
  ------------------
  |  Branch (23536:17): [True: 0, False: 0]
  ------------------
23537|      0|                return TOK_OF;
23538|      0|            return TOK_IDENT;
23539|      1|        case 'e':
  ------------------
  |  Branch (23539:9): [True: 1, False: 1.04M]
  ------------------
23540|      1|            if (match_identifier(p, "xport"))
  ------------------
  |  Branch (23540:17): [True: 0, False: 1]
  ------------------
23541|      0|                return TOK_EXPORT;
23542|      1|            return TOK_IDENT;
23543|      2|        case 'f':
  ------------------
  |  Branch (23543:9): [True: 2, False: 1.04M]
  ------------------
23544|      2|            if (match_identifier(p, "unction"))
  ------------------
  |  Branch (23544:17): [True: 1, False: 1]
  ------------------
23545|      1|                return TOK_FUNCTION;
23546|      1|            return TOK_IDENT;
23547|      0|        case '\\':
  ------------------
  |  Branch (23547:9): [True: 0, False: 1.04M]
  ------------------
23548|      0|            if (*p == 'u') {
  ------------------
  |  Branch (23548:17): [True: 0, False: 0]
  ------------------
23549|      0|                if (lre_js_is_ident_first(lre_parse_escape(&p, TRUE)))
  ------------------
  |  Branch (23549:21): [True: 0, False: 0]
  ------------------
23550|      0|                    return TOK_IDENT;
23551|      0|            }
23552|      0|            break;
23553|    156|        default:
  ------------------
  |  Branch (23553:9): [True: 156, False: 1.04M]
  ------------------
23554|    156|            if (c >= 128) {
  ------------------
  |  Branch (23554:17): [True: 0, False: 156]
  ------------------
23555|      0|                c = unicode_from_utf8(p - 1, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
23556|      0|                if (no_line_terminator && (c == CP_PS || c == CP_LS))
  ------------------
  |  |21704|      0|#define CP_PS   0x2029
  ------------------
                              if (no_line_terminator && (c == CP_PS || c == CP_LS))
  ------------------
  |  |21703|      0|#define CP_LS   0x2028
  ------------------
  |  Branch (23556:21): [True: 0, False: 0]
  |  Branch (23556:44): [True: 0, False: 0]
  |  Branch (23556:58): [True: 0, False: 0]
  ------------------
23557|      0|                    return '\n';
23558|      0|            }
23559|    156|            if (lre_is_space(c))
  ------------------
  |  Branch (23559:17): [True: 0, False: 156]
  ------------------
23560|      0|                continue;
23561|    156|            if (lre_js_is_ident_first(c))
  ------------------
  |  Branch (23561:17): [True: 1, False: 155]
  ------------------
23562|      1|                return TOK_IDENT;
23563|    155|            break;
23564|  1.04M|        }
23565|    164|        return c;
23566|  1.04M|    }
23567|    198|}
quickjs.c:match_identifier:
23461|     27|static int match_identifier(const uint8_t *p, const char *s) {
23462|     27|    uint32_t c;
23463|    100|    while (*s) {
  ------------------
  |  Branch (23463:12): [True: 87, False: 13]
  ------------------
23464|     87|        if ((uint8_t)*s++ != *p++)
  ------------------
  |  Branch (23464:13): [True: 14, False: 73]
  ------------------
23465|     14|            return 0;
23466|     87|    }
23467|     13|    c = *p;
23468|     13|    if (c >= 128)
  ------------------
  |  Branch (23468:9): [True: 12, False: 1]
  ------------------
23469|     12|        c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|     12|#define UTF8_CHAR_LEN_MAX 6
  ------------------
23470|     13|    return !lre_js_is_ident_next(c);
23471|     27|}
quickjs.c:js_new_module_def:
29474|     42|{
29475|     42|    JSModuleDef *m;
29476|     42|    m = js_mallocz(ctx, sizeof(*m));
29477|     42|    if (!m) {
  ------------------
  |  Branch (29477:9): [True: 0, False: 42]
  ------------------
29478|      0|        JS_FreeAtom(ctx, name);
29479|      0|        return NULL;
29480|      0|    }
29481|     42|    js_rc(m)->ref_count = 1;
29482|     42|    add_gc_object(ctx->rt, &m->header, JS_GC_OBJ_TYPE_MODULE);
29483|     42|    m->module_name = name;
29484|     42|    m->module_ns = JS_UNDEFINED;
  ------------------
  |  |  289|     42|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     42|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
29485|     42|    m->func_obj = JS_UNDEFINED;
  ------------------
  |  |  289|     42|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     42|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
29486|     42|    m->eval_exception = JS_UNDEFINED;
  ------------------
  |  |  289|     42|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     42|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
29487|     42|    m->meta_obj = JS_UNDEFINED;
  ------------------
  |  |  289|     42|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     42|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
29488|     42|    m->promise = JS_UNDEFINED;
  ------------------
  |  |  289|     42|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     42|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
29489|     42|    m->resolving_funcs[0] = JS_UNDEFINED;
  ------------------
  |  |  289|     42|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     42|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
29490|     42|    m->resolving_funcs[1] = JS_UNDEFINED;
  ------------------
  |  |  289|     42|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     42|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
29491|     42|    m->private_value = JS_UNDEFINED;
  ------------------
  |  |  289|     42|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     42|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
29492|     42|    list_add_tail(&m->link, &ctx->loaded_modules);
29493|     42|    return m;
29494|     42|}
quickjs.c:add_export_entry2:
29610|  1.37k|{
29611|  1.37k|    JSExportEntry *me;
29612|       |
29613|  1.37k|    if (find_export_entry(ctx, m, export_name)) {
  ------------------
  |  Branch (29613:9): [True: 0, False: 1.37k]
  ------------------
29614|      0|        char buf1[ATOM_GET_STR_BUF_SIZE];
29615|      0|        if (s) {
  ------------------
  |  Branch (29615:13): [True: 0, False: 0]
  ------------------
29616|      0|            js_parse_error(s, "duplicate exported name '%s'",
29617|      0|                           JS_AtomGetStr(ctx, buf1, sizeof(buf1), export_name));
29618|      0|        } else {
29619|      0|            JS_ThrowSyntaxErrorAtom(ctx, "duplicate exported name '%s'", export_name);
  ------------------
  |  | 7723|      0|#define JS_ThrowSyntaxErrorAtom(ctx, fmt, atom) __JS_ThrowSyntaxErrorAtom(ctx, atom, fmt, "")
  ------------------
29620|      0|        }
29621|      0|        return NULL;
29622|      0|    }
29623|       |
29624|  1.37k|    if (js_resize_array(ctx, (void **)&m->export_entries,
  ------------------
  |  Branch (29624:9): [True: 0, False: 1.37k]
  ------------------
29625|  1.37k|                        sizeof(JSExportEntry),
29626|  1.37k|                        &m->export_entries_size,
29627|  1.37k|                        m->export_entries_count + 1))
29628|      0|        return NULL;
29629|  1.37k|    me = &m->export_entries[m->export_entries_count++];
29630|  1.37k|    memset(me, 0, sizeof(*me));
29631|  1.37k|    me->local_name = JS_DupAtom(ctx, local_name);
29632|  1.37k|    me->export_name = JS_DupAtom(ctx, export_name);
29633|  1.37k|    me->export_type = export_type;
29634|  1.37k|    return me;
29635|  1.37k|}
quickjs.c:find_export_entry:
29595|  2.64k|{
29596|  2.64k|    JSExportEntry *me;
29597|  2.64k|    int i;
29598|  79.2k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (29598:16): [True: 77.8k, False: 1.37k]
  ------------------
29599|  77.8k|        me = &m->export_entries[i];
29600|  77.8k|        if (me->export_name == export_name)
  ------------------
  |  Branch (29600:13): [True: 1.27k, False: 76.5k]
  ------------------
29601|  1.27k|            return me;
29602|  77.8k|    }
29603|  1.37k|    return NULL;
29604|  2.64k|}
quickjs.c:js_build_module_ns:
30217|     28|{
30218|     28|    JSValue obj;
30219|     28|    JSObject *p;
30220|     28|    GetExportNamesState s_s, *s = &s_s;
30221|     28|    int i, ret;
30222|     28|    JSProperty *pr;
30223|       |
30224|     28|    obj = JS_NewObjectClass(ctx, JS_CLASS_MODULE_NS);
30225|     28|    if (JS_IsException(obj))
  ------------------
  |  Branch (30225:9): [True: 0, False: 28]
  ------------------
30226|      0|        return obj;
30227|     28|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|     28|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     28|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30228|       |
30229|     28|    memset(s, 0, sizeof(*s));
30230|     28|    ret = get_exported_names(ctx, s, m, FALSE);
30231|     28|    js_free(ctx, s->modules);
30232|     28|    if (ret)
  ------------------
  |  Branch (30232:9): [True: 0, False: 28]
  ------------------
30233|      0|        goto fail;
30234|       |
30235|       |    /* Resolve the exported names. The ambiguous exports are removed */
30236|  1.40k|    for(i = 0; i < s->exported_names_count; i++) {
  ------------------
  |  Branch (30236:16): [True: 1.37k, False: 28]
  ------------------
30237|  1.37k|        ExportedNameEntry *en = &s->exported_names[i];
30238|  1.37k|        JSResolveResultEnum res;
30239|  1.37k|        JSExportEntry *res_me;
30240|  1.37k|        JSModuleDef *res_m;
30241|       |
30242|  1.37k|        if (en->u.me) {
  ------------------
  |  Branch (30242:13): [True: 1.37k, False: 0]
  ------------------
30243|  1.37k|            res_me = en->u.me; /* fast case: no resolution needed */
30244|  1.37k|            res_m = m;
30245|  1.37k|            res = JS_RESOLVE_RES_FOUND;
30246|  1.37k|        } else {
30247|      0|            res = js_resolve_export(ctx, &res_m, &res_me, m,
30248|      0|                                    en->export_name);
30249|      0|        }
30250|  1.37k|        if (res != JS_RESOLVE_RES_FOUND) {
  ------------------
  |  Branch (30250:13): [True: 0, False: 1.37k]
  ------------------
30251|      0|            if (res != JS_RESOLVE_RES_AMBIGUOUS) {
  ------------------
  |  Branch (30251:17): [True: 0, False: 0]
  ------------------
30252|      0|                js_resolve_export_throw_error(ctx, res, m, en->export_name);
30253|      0|                goto fail;
30254|      0|            }
30255|      0|            en->export_type = EXPORTED_NAME_AMBIGUOUS;
30256|  1.37k|        } else {
30257|  1.37k|            if (res_me->local_name == JS_ATOM__star_) {
  ------------------
  |  Branch (30257:17): [True: 0, False: 1.37k]
  ------------------
30258|      0|                en->export_type = EXPORTED_NAME_DELAYED;
30259|  1.37k|            } else {
30260|  1.37k|                if (res_me->u.local.var_ref) {
  ------------------
  |  Branch (30260:21): [True: 1.37k, False: 0]
  ------------------
30261|  1.37k|                    en->u.var_ref = res_me->u.local.var_ref;
30262|  1.37k|                } else {
30263|      0|                    JSObject *p1 = JS_VALUE_GET_OBJ(res_m->func_obj);
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30264|      0|                    en->u.var_ref = p1->u.func.var_refs[res_me->u.local.var_idx];
30265|      0|                }
30266|  1.37k|                if (en->u.var_ref == NULL)
  ------------------
  |  Branch (30266:21): [True: 0, False: 1.37k]
  ------------------
30267|      0|                    en->export_type = EXPORTED_NAME_DELAYED;
30268|  1.37k|                else
30269|  1.37k|                    en->export_type = EXPORTED_NAME_NORMAL;
30270|  1.37k|            }
30271|  1.37k|        }
30272|  1.37k|    }
30273|       |
30274|       |    /* sort the exported names */
30275|     28|    rqsort(s->exported_names, s->exported_names_count,
30276|     28|           sizeof(s->exported_names[0]), exported_names_cmp, ctx);
30277|       |
30278|  1.40k|    for(i = 0; i < s->exported_names_count; i++) {
  ------------------
  |  Branch (30278:16): [True: 1.37k, False: 28]
  ------------------
30279|  1.37k|        ExportedNameEntry *en = &s->exported_names[i];
30280|  1.37k|        switch(en->export_type) {
30281|  1.37k|        case EXPORTED_NAME_NORMAL:
  ------------------
  |  Branch (30281:9): [True: 1.37k, False: 0]
  ------------------
30282|  1.37k|            {
30283|  1.37k|                JSVarRef *var_ref = en->u.var_ref;
30284|  1.37k|                pr = add_property(ctx, p, en->export_name,
30285|  1.37k|                                  JS_PROP_ENUMERABLE | JS_PROP_WRITABLE |
  ------------------
  |  |  298|  1.37k|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                                                JS_PROP_ENUMERABLE | JS_PROP_WRITABLE |
  ------------------
  |  |  297|  1.37k|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
30286|  1.37k|                                  JS_PROP_VARREF);
  ------------------
  |  |  304|  1.37k|#define JS_PROP_VARREF         (2 << 4) /* used internally */
  ------------------
30287|  1.37k|                if (!pr)
  ------------------
  |  Branch (30287:21): [True: 0, False: 1.37k]
  ------------------
30288|      0|                    goto fail;
30289|  1.37k|                js_rc(var_ref)->ref_count++;
30290|  1.37k|                pr->u.var_ref = var_ref;
30291|  1.37k|            }
30292|      0|            break;
30293|      0|        case EXPORTED_NAME_DELAYED:
  ------------------
  |  Branch (30293:9): [True: 0, False: 1.37k]
  ------------------
30294|       |            /* the exported namespace or reference may depend on
30295|       |               circular references, so we resolve it lazily */
30296|      0|            if (JS_DefineAutoInitProperty(ctx, obj,
  ------------------
  |  Branch (30296:17): [True: 0, False: 0]
  ------------------
30297|      0|                                          en->export_name,
30298|      0|                                          JS_AUTOINIT_ID_MODULE_NS,
30299|      0|                                          m, JS_PROP_ENUMERABLE | JS_PROP_WRITABLE) < 0)
  ------------------
  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                                                        m, JS_PROP_ENUMERABLE | JS_PROP_WRITABLE) < 0)
  ------------------
  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
30300|      0|                goto fail;
30301|      0|            break;
30302|      0|        default:
  ------------------
  |  Branch (30302:9): [True: 0, False: 1.37k]
  ------------------
30303|      0|            break;
30304|  1.37k|        }
30305|  1.37k|    }
30306|       |
30307|     28|    js_free(ctx, s->exported_names);
30308|       |
30309|     28|    JS_DefinePropertyValue(ctx, obj, JS_ATOM_Symbol_toStringTag,
30310|     28|                           JS_AtomToString(ctx, JS_ATOM_Module),
30311|     28|                           0);
30312|       |
30313|     28|    p->extensible = FALSE;
30314|     28|    return obj;
30315|      0| fail:
30316|      0|    js_free(ctx, s->exported_names);
30317|      0|    JS_FreeValue(ctx, obj);
30318|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
30319|     28|}
quickjs.c:get_exported_names:
30108|     28|{
30109|     28|    ExportedNameEntry *en;
30110|     28|    int i, j;
30111|       |
30112|       |    /* check circular reference */
30113|     28|    for(i = 0; i < s->modules_count; i++) {
  ------------------
  |  Branch (30113:16): [True: 0, False: 28]
  ------------------
30114|      0|        if (s->modules[i] == m)
  ------------------
  |  Branch (30114:13): [True: 0, False: 0]
  ------------------
30115|      0|            return 0;
30116|      0|    }
30117|     28|    if (js_resize_array(ctx, (void **)&s->modules, sizeof(s->modules[0]),
  ------------------
  |  Branch (30117:9): [True: 0, False: 28]
  ------------------
30118|     28|                        &s->modules_size, s->modules_count + 1))
30119|      0|        return -1;
30120|     28|    s->modules[s->modules_count++] = m;
30121|       |
30122|  1.40k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (30122:16): [True: 1.37k, False: 28]
  ------------------
30123|  1.37k|        JSExportEntry *me = &m->export_entries[i];
30124|  1.37k|        if (from_star && me->export_name == JS_ATOM_default)
  ------------------
  |  Branch (30124:13): [True: 0, False: 1.37k]
  |  Branch (30124:26): [True: 0, False: 0]
  ------------------
30125|      0|            continue;
30126|  1.37k|        j = find_exported_name(s, me->export_name);
30127|  1.37k|        if (j < 0) {
  ------------------
  |  Branch (30127:13): [True: 1.37k, False: 0]
  ------------------
30128|  1.37k|            if (js_resize_array(ctx, (void **)&s->exported_names, sizeof(s->exported_names[0]),
  ------------------
  |  Branch (30128:17): [True: 0, False: 1.37k]
  ------------------
30129|  1.37k|                                &s->exported_names_size,
30130|  1.37k|                                s->exported_names_count + 1))
30131|      0|                return -1;
30132|  1.37k|            en = &s->exported_names[s->exported_names_count++];
30133|  1.37k|            en->export_name = me->export_name;
30134|       |            /* avoid a second lookup for simple module exports */
30135|  1.37k|            if (from_star || me->export_type != JS_EXPORT_TYPE_LOCAL)
  ------------------
  |  Branch (30135:17): [True: 0, False: 1.37k]
  |  Branch (30135:30): [True: 0, False: 1.37k]
  ------------------
30136|      0|                en->u.me = NULL;
30137|  1.37k|            else
30138|  1.37k|                en->u.me = me;
30139|  1.37k|        } else {
30140|      0|            en = &s->exported_names[j];
30141|      0|            en->u.me = NULL;
30142|      0|        }
30143|  1.37k|    }
30144|     28|    for(i = 0; i < m->star_export_entries_count; i++) {
  ------------------
  |  Branch (30144:16): [True: 0, False: 28]
  ------------------
30145|      0|        JSStarExportEntry *se = &m->star_export_entries[i];
30146|      0|        JSModuleDef *m1;
30147|      0|        m1 = m->req_module_entries[se->req_module_idx].module;
30148|      0|        if (get_exported_names(ctx, s, m1, TRUE))
  ------------------
  |  Branch (30148:13): [True: 0, False: 0]
  ------------------
30149|      0|            return -1;
30150|      0|    }
30151|     28|    return 0;
30152|     28|}
quickjs.c:find_exported_name:
30096|  1.37k|{
30097|  1.37k|    int i;
30098|  41.0k|    for(i = 0; i < s->exported_names_count; i++) {
  ------------------
  |  Branch (30098:16): [True: 39.7k, False: 1.37k]
  ------------------
30099|  39.7k|        if (s->exported_names[i].export_name == name)
  ------------------
  |  Branch (30099:13): [True: 0, False: 39.7k]
  ------------------
30100|      0|            return i;
30101|  39.7k|    }
30102|  1.37k|    return -1;
30103|  1.37k|}
quickjs.c:exported_names_cmp:
30165|  6.80k|{
30166|  6.80k|    JSContext *ctx = opaque;
30167|  6.80k|    const ExportedNameEntry *me1 = p1;
30168|  6.80k|    const ExportedNameEntry *me2 = p2;
30169|  6.80k|    JSValue str1, str2;
30170|  6.80k|    int ret;
30171|       |
30172|       |    /* XXX: should avoid allocation memory in atom comparison */
30173|  6.80k|    str1 = JS_AtomToString(ctx, me1->export_name);
30174|  6.80k|    str2 = JS_AtomToString(ctx, me2->export_name);
30175|  6.80k|    if (JS_IsException(str1) || JS_IsException(str2)) {
  ------------------
  |  Branch (30175:9): [True: 0, False: 6.80k]
  |  Branch (30175:33): [True: 0, False: 6.80k]
  ------------------
30176|       |        /* XXX: raise an error ? */
30177|      0|        ret = 0;
30178|  6.80k|    } else {
30179|  6.80k|        ret = js_string_compare(ctx, JS_VALUE_GET_STRING(str1),
  ------------------
  |  |  228|  6.80k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  6.80k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30180|  6.80k|                                JS_VALUE_GET_STRING(str2));
  ------------------
  |  |  228|  6.80k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  6.80k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30181|  6.80k|    }
30182|  6.80k|    JS_FreeValue(ctx, str1);
30183|  6.80k|    JS_FreeValue(ctx, str2);
30184|  6.80k|    return ret;
30185|  6.80k|}
quickjs.c:js_class_has_bytecode:
 5855|     24|{
 5856|     24|    return (class_id == JS_CLASS_BYTECODE_FUNCTION ||
  ------------------
  |  Branch (5856:13): [True: 21, False: 3]
  ------------------
 5857|      3|            class_id == JS_CLASS_GENERATOR_FUNCTION ||
  ------------------
  |  Branch (5857:13): [True: 0, False: 3]
  ------------------
 5858|      3|            class_id == JS_CLASS_ASYNC_FUNCTION ||
  ------------------
  |  Branch (5858:13): [True: 0, False: 3]
  ------------------
 5859|      3|            class_id == JS_CLASS_ASYNC_GENERATOR_FUNCTION);
  ------------------
  |  Branch (5859:13): [True: 0, False: 3]
  ------------------
 5860|     24|}
quickjs.c:js_host_resolve_imported_module:
29825|     28|{
29826|     28|    JSRuntime *rt = ctx->rt;
29827|     28|    JSModuleDef *m;
29828|     28|    char *cname;
29829|     28|    JSAtom module_name;
29830|       |
29831|     28|    if (!rt->module_normalize_func) {
  ------------------
  |  Branch (29831:9): [True: 28, False: 0]
  ------------------
29832|     28|        cname = js_default_module_normalize_name(ctx, base_cname, cname1);
29833|     28|    } else {
29834|      0|        cname = rt->module_normalize_func(ctx, base_cname, cname1,
29835|      0|                                          rt->module_loader_opaque);
29836|      0|    }
29837|     28|    if (!cname)
  ------------------
  |  Branch (29837:9): [True: 0, False: 28]
  ------------------
29838|      0|        return NULL;
29839|       |
29840|     28|    module_name = JS_NewAtom(ctx, cname);
29841|     28|    if (module_name == JS_ATOM_NULL) {
  ------------------
  |  |  449|     28|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (29841:9): [True: 0, False: 28]
  ------------------
29842|      0|        js_free(ctx, cname);
29843|      0|        return NULL;
29844|      0|    }
29845|       |
29846|       |    /* first look at the loaded modules */
29847|     28|    m = js_find_loaded_module(ctx, module_name);
29848|     28|    if (m) {
  ------------------
  |  Branch (29848:9): [True: 28, False: 0]
  ------------------
29849|     28|        js_free(ctx, cname);
29850|     28|        JS_FreeAtom(ctx, module_name);
29851|     28|        return m;
29852|     28|    }
29853|       |
29854|      0|    JS_FreeAtom(ctx, module_name);
29855|       |
29856|       |    /* load the module */
29857|      0|    if (!rt->u.module_loader_func) {
  ------------------
  |  Branch (29857:9): [True: 0, False: 0]
  ------------------
29858|       |        /* XXX: use a syntax error ? */
29859|      0|        JS_ThrowReferenceError(ctx, "could not load module '%s'",
29860|      0|                               cname);
29861|      0|        js_free(ctx, cname);
29862|      0|        return NULL;
29863|      0|    }
29864|      0|    if (rt->module_loader_has_attr) {
  ------------------
  |  Branch (29864:9): [True: 0, False: 0]
  ------------------
29865|      0|        m = rt->u.module_loader_func2(ctx, cname, rt->module_loader_opaque, attributes);
29866|      0|    } else {
29867|      0|        m = rt->u.module_loader_func(ctx, cname, rt->module_loader_opaque);
29868|      0|    }
29869|      0|    js_free(ctx, cname);
29870|      0|    return m;
29871|      0|}
quickjs.c:js_default_module_normalize_name:
29750|     28|{
29751|     28|    char *filename, *p;
29752|     28|    const char *r;
29753|     28|    int cap;
29754|     28|    int len;
29755|       |
29756|     28|    if (name[0] != '.') {
  ------------------
  |  Branch (29756:9): [True: 28, False: 0]
  ------------------
29757|       |        /* if no initial dot, the module name is not modified */
29758|     28|        return js_strdup(ctx, name);
29759|     28|    }
29760|       |
29761|      0|    p = strrchr(base_name, '/');
29762|      0|    if (p)
  ------------------
  |  Branch (29762:9): [True: 0, False: 0]
  ------------------
29763|      0|        len = p - base_name;
29764|      0|    else
29765|      0|        len = 0;
29766|       |
29767|      0|    cap = len + strlen(name) + 1 + 1;
29768|      0|    filename = js_malloc(ctx, cap);
29769|      0|    if (!filename)
  ------------------
  |  Branch (29769:9): [True: 0, False: 0]
  ------------------
29770|      0|        return NULL;
29771|      0|    memcpy(filename, base_name, len);
29772|      0|    filename[len] = '\0';
29773|       |
29774|       |    /* we only normalize the leading '..' or '.' */
29775|      0|    r = name;
29776|      0|    for(;;) {
29777|      0|        if (r[0] == '.' && r[1] == '/') {
  ------------------
  |  Branch (29777:13): [True: 0, False: 0]
  |  Branch (29777:28): [True: 0, False: 0]
  ------------------
29778|      0|            r += 2;
29779|      0|        } else if (r[0] == '.' && r[1] == '.' && r[2] == '/') {
  ------------------
  |  Branch (29779:20): [True: 0, False: 0]
  |  Branch (29779:35): [True: 0, False: 0]
  |  Branch (29779:50): [True: 0, False: 0]
  ------------------
29780|       |            /* remove the last path element of filename, except if "."
29781|       |               or ".." */
29782|      0|            if (filename[0] == '\0')
  ------------------
  |  Branch (29782:17): [True: 0, False: 0]
  ------------------
29783|      0|                break;
29784|      0|            p = strrchr(filename, '/');
29785|      0|            if (!p)
  ------------------
  |  Branch (29785:17): [True: 0, False: 0]
  ------------------
29786|      0|                p = filename;
29787|      0|            else
29788|      0|                p++;
29789|      0|            if (!strcmp(p, ".") || !strcmp(p, ".."))
  ------------------
  |  Branch (29789:17): [True: 0, False: 0]
  |  Branch (29789:36): [True: 0, False: 0]
  ------------------
29790|      0|                break;
29791|      0|            if (p > filename)
  ------------------
  |  Branch (29791:17): [True: 0, False: 0]
  ------------------
29792|      0|                p--;
29793|      0|            *p = '\0';
29794|      0|            r += 3;
29795|      0|        } else {
29796|      0|            break;
29797|      0|        }
29798|      0|    }
29799|      0|    if (filename[0] != '\0')
  ------------------
  |  Branch (29799:9): [True: 0, False: 0]
  ------------------
29800|      0|        pstrcat(filename, cap, "/");
29801|      0|    pstrcat(filename, cap, r);
29802|       |    //    printf("normalize: %s %s -> %s\n", base_name, name, filename);
29803|      0|    return filename;
29804|      0|}
quickjs.c:JS_NewModuleValue:
30739|     14|{
30740|     14|    return JS_DupValue(ctx, JS_MKPTR(JS_TAG_MODULE, m));
  ------------------
  |  |  246|     14|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
30741|     14|}
quickjs.c:JS_SpeciesConstructor:
40638|      2|{
40639|      2|    JSValue ctor, species;
40640|       |
40641|      2|    if (!JS_IsObject(obj))
  ------------------
  |  Branch (40641:9): [True: 0, False: 2]
  ------------------
40642|      0|        return JS_ThrowTypeErrorNotAnObject(ctx);
40643|      2|    ctor = JS_GetProperty(ctx, obj, JS_ATOM_constructor);
40644|      2|    if (JS_IsException(ctor))
  ------------------
  |  Branch (40644:9): [True: 0, False: 2]
  ------------------
40645|      0|        return ctor;
40646|      2|    if (JS_IsUndefined(ctor))
  ------------------
  |  Branch (40646:9): [True: 0, False: 2]
  ------------------
40647|      0|        return JS_DupValue(ctx, defaultConstructor);
40648|      2|    if (!JS_IsObject(ctor)) {
  ------------------
  |  Branch (40648:9): [True: 0, False: 2]
  ------------------
40649|      0|        JS_FreeValue(ctx, ctor);
40650|      0|        return JS_ThrowTypeErrorNotAnObject(ctx);
40651|      0|    }
40652|      2|    species = JS_GetProperty(ctx, ctor, JS_ATOM_Symbol_species);
40653|      2|    JS_FreeValue(ctx, ctor);
40654|      2|    if (JS_IsException(species))
  ------------------
  |  Branch (40654:9): [True: 0, False: 2]
  ------------------
40655|      0|        return species;
40656|      2|    if (JS_IsUndefined(species) || JS_IsNull(species))
  ------------------
  |  Branch (40656:9): [True: 0, False: 2]
  |  Branch (40656:36): [True: 0, False: 2]
  ------------------
40657|      0|        return JS_DupValue(ctx, defaultConstructor);
40658|      2|    if (!JS_IsConstructor(ctx, species)) {
  ------------------
  |  Branch (40658:9): [True: 0, False: 2]
  ------------------
40659|      0|        JS_ThrowTypeErrorNotAConstructor(ctx, species);
40660|      0|        JS_FreeValue(ctx, species);
40661|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
40662|      0|    }
40663|      2|    return species;
40664|      2|}
quickjs.c:JS_EvalFunctionInternal:
36955|     26|{
36956|     26|    JSValue ret_val;
36957|     26|    uint32_t tag;
36958|       |
36959|     26|    tag = JS_VALUE_GET_TAG(fun_obj);
  ------------------
  |  |  236|     26|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
36960|     26|    if (tag == JS_TAG_FUNCTION_BYTECODE) {
  ------------------
  |  Branch (36960:9): [True: 12, False: 14]
  ------------------
36961|     12|        fun_obj = js_closure(ctx, fun_obj, var_refs, sf, TRUE);
36962|     12|        if (JS_IsException(fun_obj))
  ------------------
  |  Branch (36962:13): [True: 0, False: 12]
  ------------------
36963|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
36964|     12|        ret_val = JS_CallFree(ctx, fun_obj, this_obj, 0, NULL);
36965|     14|    } else if (tag == JS_TAG_MODULE) {
  ------------------
  |  Branch (36965:16): [True: 14, False: 0]
  ------------------
36966|     14|        JSModuleDef *m;
36967|     14|        m = JS_VALUE_GET_PTR(fun_obj);
  ------------------
  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
36968|       |        /* the module refcount should be >= 2 */
36969|     14|        JS_FreeValue(ctx, fun_obj);
36970|     14|        if (js_create_module_function(ctx, m) < 0)
  ------------------
  |  Branch (36970:13): [True: 0, False: 14]
  ------------------
36971|      0|            goto fail;
36972|     14|        if (js_link_module(ctx, m) < 0)
  ------------------
  |  Branch (36972:13): [True: 1, False: 13]
  ------------------
36973|      1|            goto fail;
36974|     13|        ret_val = js_evaluate_module(ctx, m);
36975|     13|        if (JS_IsException(ret_val)) {
  ------------------
  |  Branch (36975:13): [True: 0, False: 13]
  ------------------
36976|      1|        fail:
36977|      1|            return JS_EXCEPTION;
  ------------------
  |  |  292|      1|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
36978|      0|        }
36979|     13|    } else {
36980|      0|        JS_FreeValue(ctx, fun_obj);
36981|      0|        ret_val = JS_ThrowTypeError(ctx, "bytecode function expected");
36982|      0|    }
36983|     25|    return ret_val;
36984|     26|}
quickjs.c:js_create_module_function:
30390|     42|{
30391|     42|    BOOL is_c_module;
30392|     42|    int i;
30393|     42|    JSVarRef *var_ref;
30394|       |
30395|     42|    if (m->func_created)
  ------------------
  |  Branch (30395:9): [True: 0, False: 42]
  ------------------
30396|      0|        return 0;
30397|       |
30398|     42|    is_c_module = (m->init_func != NULL);
30399|       |
30400|     42|    if (is_c_module) {
  ------------------
  |  Branch (30400:9): [True: 28, False: 14]
  ------------------
30401|       |        /* initialize the exported variables */
30402|  1.40k|        for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (30402:20): [True: 1.37k, False: 28]
  ------------------
30403|  1.37k|            JSExportEntry *me = &m->export_entries[i];
30404|  1.37k|            if (me->export_type == JS_EXPORT_TYPE_LOCAL) {
  ------------------
  |  Branch (30404:17): [True: 1.37k, False: 0]
  ------------------
30405|  1.37k|                var_ref = js_create_var_ref(ctx, FALSE);
30406|  1.37k|                if (!var_ref)
  ------------------
  |  Branch (30406:21): [True: 0, False: 1.37k]
  ------------------
30407|      0|                    return -1;
30408|  1.37k|                me->u.local.var_ref = var_ref;
30409|  1.37k|            }
30410|  1.37k|        }
30411|     28|    } else {
30412|     14|        if (js_create_module_bytecode_function(ctx, m))
  ------------------
  |  Branch (30412:13): [True: 0, False: 14]
  ------------------
30413|      0|            return -1;
30414|     14|    }
30415|     42|    m->func_created = TRUE;
30416|       |
30417|       |    /* do it on the dependencies */
30418|       |
30419|     70|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (30419:16): [True: 28, False: 42]
  ------------------
30420|     28|        JSReqModuleEntry *rme = &m->req_module_entries[i];
30421|     28|        if (js_create_module_function(ctx, rme->module) < 0)
  ------------------
  |  Branch (30421:13): [True: 0, False: 28]
  ------------------
30422|      0|            return -1;
30423|     28|    }
30424|       |
30425|     42|    return 0;
30426|     42|}
quickjs.c:js_create_module_bytecode_function:
30367|     14|{
30368|     14|    JSFunctionBytecode *b;
30369|     14|    JSValue func_obj, bfunc;
30370|       |
30371|     14|    bfunc = m->func_obj;
30372|     14|    func_obj = JS_NewObjectProtoClass(ctx, ctx->function_proto,
30373|     14|                                      JS_CLASS_BYTECODE_FUNCTION);
30374|       |
30375|     14|    if (JS_IsException(func_obj))
  ------------------
  |  Branch (30375:9): [True: 0, False: 14]
  ------------------
30376|      0|        return -1;
30377|     14|    m->func_obj = func_obj;
30378|     14|    b = JS_VALUE_GET_PTR(bfunc);
  ------------------
  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
30379|     14|    func_obj = js_closure2(ctx, func_obj, b, NULL, NULL, TRUE, m);
30380|     14|    if (JS_IsException(func_obj)) {
  ------------------
  |  Branch (30380:9): [True: 0, False: 14]
  ------------------
30381|      0|        m->func_obj = JS_UNDEFINED; /* XXX: keep it ? */
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
30382|      0|        JS_FreeValue(ctx, func_obj);
30383|      0|        return -1;
30384|      0|    }
30385|     14|    return 0;
30386|     14|}
quickjs.c:js_link_module:
30631|     14|{
30632|     14|    JSModuleDef *stack_top, *m1;
30633|       |
30634|       |#ifdef DUMP_MODULE_RESOLVE
30635|       |    {
30636|       |        char buf1[ATOM_GET_STR_BUF_SIZE];
30637|       |        printf("js_link_module '%s':\n", JS_AtomGetStr(ctx, buf1, sizeof(buf1), m->module_name));
30638|       |    }
30639|       |#endif
30640|     14|    assert(m->status == JS_MODULE_STATUS_UNLINKED ||
  ------------------
  |  Branch (30640:5): [True: 14, False: 0]
  |  Branch (30640:5): [True: 0, False: 0]
  |  Branch (30640:5): [True: 0, False: 0]
  |  Branch (30640:5): [True: 0, False: 0]
  |  Branch (30640:5): [True: 14, False: 0]
  |  Branch (30640:5): [True: 0, False: 0]
  |  Branch (30640:5): [True: 0, False: 0]
  |  Branch (30640:5): [True: 0, False: 0]
  ------------------
30641|     14|           m->status == JS_MODULE_STATUS_LINKED ||
30642|     14|           m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
30643|     14|           m->status == JS_MODULE_STATUS_EVALUATED);
30644|     14|    stack_top = NULL;
30645|     14|    if (js_inner_module_linking(ctx, m, &stack_top, 0) < 0) {
  ------------------
  |  Branch (30645:9): [True: 1, False: 13]
  ------------------
30646|      2|        while (stack_top != NULL) {
  ------------------
  |  Branch (30646:16): [True: 1, False: 1]
  ------------------
30647|      1|            m1 = stack_top;
30648|      1|            assert(m1->status == JS_MODULE_STATUS_LINKING);
  ------------------
  |  Branch (30648:13): [True: 0, False: 1]
  |  Branch (30648:13): [True: 1, False: 0]
  ------------------
30649|      1|            m1->status = JS_MODULE_STATUS_UNLINKED;
30650|      1|            stack_top = m1->stack_prev;
30651|      1|        }
30652|      1|        return -1;
30653|      1|    }
30654|     14|    assert(stack_top == NULL);
  ------------------
  |  Branch (30654:5): [True: 0, False: 13]
  |  Branch (30654:5): [True: 13, False: 0]
  ------------------
30655|     13|    assert(m->status == JS_MODULE_STATUS_LINKED ||
  ------------------
  |  Branch (30655:5): [True: 13, False: 0]
  |  Branch (30655:5): [True: 0, False: 0]
  |  Branch (30655:5): [True: 0, False: 0]
  |  Branch (30655:5): [True: 13, False: 0]
  |  Branch (30655:5): [True: 0, False: 0]
  |  Branch (30655:5): [True: 0, False: 0]
  ------------------
30656|     13|           m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
30657|     13|           m->status == JS_MODULE_STATUS_EVALUATED);
30658|     13|    return 0;
30659|     13|}
quickjs.c:js_inner_module_linking:
30433|     42|{
30434|     42|    int i;
30435|     42|    JSImportEntry *mi;
30436|     42|    JSModuleDef *m1;
30437|     42|    JSVarRef **var_refs, *var_ref;
30438|     42|    JSObject *p;
30439|     42|    BOOL is_c_module;
30440|     42|    JSValue ret_val;
30441|       |
30442|     42|    if (js_check_stack_overflow(ctx->rt, 0)) {
  ------------------
  |  Branch (30442:9): [True: 0, False: 42]
  ------------------
30443|      0|        JS_ThrowStackOverflow(ctx);
30444|      0|        return -1;
30445|      0|    }
30446|       |
30447|       |#ifdef DUMP_MODULE_RESOLVE
30448|       |    {
30449|       |        char buf1[ATOM_GET_STR_BUF_SIZE];
30450|       |        printf("js_inner_module_linking '%s':\n", JS_AtomGetStr(ctx, buf1, sizeof(buf1), m->module_name));
30451|       |    }
30452|       |#endif
30453|       |
30454|     42|    if (m->status == JS_MODULE_STATUS_LINKING ||
  ------------------
  |  Branch (30454:9): [True: 0, False: 42]
  ------------------
30455|     42|        m->status == JS_MODULE_STATUS_LINKED ||
  ------------------
  |  Branch (30455:9): [True: 0, False: 42]
  ------------------
30456|     42|        m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (30456:9): [True: 0, False: 42]
  ------------------
30457|     42|        m->status == JS_MODULE_STATUS_EVALUATED)
  ------------------
  |  Branch (30457:9): [True: 0, False: 42]
  ------------------
30458|      0|        return index;
30459|       |
30460|     42|    assert(m->status == JS_MODULE_STATUS_UNLINKED);
  ------------------
  |  Branch (30460:5): [True: 0, False: 42]
  |  Branch (30460:5): [True: 42, False: 0]
  ------------------
30461|     42|    m->status = JS_MODULE_STATUS_LINKING;
30462|     42|    m->dfs_index = index;
30463|     42|    m->dfs_ancestor_index = index;
30464|     42|    index++;
30465|       |    /* push 'm' on stack */
30466|     42|    m->stack_prev = *pstack_top;
30467|     42|    *pstack_top = m;
30468|       |
30469|     70|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (30469:16): [True: 28, False: 42]
  ------------------
30470|     28|        JSReqModuleEntry *rme = &m->req_module_entries[i];
30471|     28|        m1 = rme->module;
30472|     28|        index = js_inner_module_linking(ctx, m1, pstack_top, index);
30473|     28|        if (index < 0)
  ------------------
  |  Branch (30473:13): [True: 0, False: 28]
  ------------------
30474|      0|            goto fail;
30475|     28|        assert(m1->status == JS_MODULE_STATUS_LINKING ||
  ------------------
  |  Branch (30475:9): [True: 28, False: 0]
  |  Branch (30475:9): [True: 0, False: 0]
  |  Branch (30475:9): [True: 0, False: 0]
  |  Branch (30475:9): [True: 0, False: 0]
  |  Branch (30475:9): [True: 0, False: 28]
  |  Branch (30475:9): [True: 28, False: 0]
  |  Branch (30475:9): [True: 0, False: 0]
  |  Branch (30475:9): [True: 0, False: 0]
  ------------------
30476|     28|               m1->status == JS_MODULE_STATUS_LINKED ||
30477|     28|               m1->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
30478|     28|               m1->status == JS_MODULE_STATUS_EVALUATED);
30479|     28|        if (m1->status == JS_MODULE_STATUS_LINKING) {
  ------------------
  |  Branch (30479:13): [True: 0, False: 28]
  ------------------
30480|      0|            m->dfs_ancestor_index = min_int(m->dfs_ancestor_index,
30481|      0|                                            m1->dfs_ancestor_index);
30482|      0|        }
30483|     28|    }
30484|       |
30485|       |#ifdef DUMP_MODULE_RESOLVE
30486|       |    {
30487|       |        char buf1[ATOM_GET_STR_BUF_SIZE];
30488|       |        printf("instantiating module '%s':\n", JS_AtomGetStr(ctx, buf1, sizeof(buf1), m->module_name));
30489|       |    }
30490|       |#endif
30491|       |    /* check the indirect exports */
30492|  1.41k|    for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (30492:16): [True: 1.37k, False: 42]
  ------------------
30493|  1.37k|        JSExportEntry *me = &m->export_entries[i];
30494|  1.37k|        if (me->export_type == JS_EXPORT_TYPE_INDIRECT &&
  ------------------
  |  Branch (30494:13): [True: 0, False: 1.37k]
  ------------------
30495|      0|            me->local_name != JS_ATOM__star_) {
  ------------------
  |  Branch (30495:13): [True: 0, False: 0]
  ------------------
30496|      0|            JSResolveResultEnum ret;
30497|      0|            JSExportEntry *res_me;
30498|      0|            JSModuleDef *res_m, *m1;
30499|      0|            m1 = m->req_module_entries[me->u.req_module_idx].module;
30500|      0|            ret = js_resolve_export(ctx, &res_m, &res_me, m1, me->local_name);
30501|      0|            if (ret != JS_RESOLVE_RES_FOUND) {
  ------------------
  |  Branch (30501:17): [True: 0, False: 0]
  ------------------
30502|      0|                js_resolve_export_throw_error(ctx, ret, m, me->export_name);
30503|      0|                goto fail;
30504|      0|            }
30505|      0|        }
30506|  1.37k|    }
30507|       |
30508|       |#ifdef DUMP_MODULE_RESOLVE
30509|       |    {
30510|       |        printf("exported bindings:\n");
30511|       |        for(i = 0; i < m->export_entries_count; i++) {
30512|       |            JSExportEntry *me = &m->export_entries[i];
30513|       |            printf(" name="); print_atom(ctx, me->export_name);
30514|       |            printf(" local="); print_atom(ctx, me->local_name);
30515|       |            printf(" type=%d idx=%d\n", me->export_type, me->u.local.var_idx);
30516|       |        }
30517|       |    }
30518|       |#endif
30519|       |
30520|     42|    is_c_module = (m->init_func != NULL);
30521|       |
30522|     42|    if (!is_c_module) {
  ------------------
  |  Branch (30522:9): [True: 14, False: 28]
  ------------------
30523|     14|        p = JS_VALUE_GET_OBJ(m->func_obj);
  ------------------
  |  |  227|     14|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30524|     14|        var_refs = p->u.func.var_refs;
30525|       |
30526|     42|        for(i = 0; i < m->import_entries_count; i++) {
  ------------------
  |  Branch (30526:20): [True: 28, False: 14]
  ------------------
30527|     28|            mi = &m->import_entries[i];
30528|       |#ifdef DUMP_MODULE_RESOLVE
30529|       |            printf("import var_idx=%d name=", mi->var_idx);
30530|       |            print_atom(ctx, mi->import_name);
30531|       |            printf(": ");
30532|       |#endif
30533|     28|            m1 = m->req_module_entries[mi->req_module_idx].module;
30534|     28|            if (mi->is_star) {
  ------------------
  |  Branch (30534:17): [True: 28, False: 0]
  ------------------
30535|     28|                JSValue val;
30536|       |                /* name space import */
30537|     28|                val = JS_GetModuleNamespace(ctx, m1);
30538|     28|                if (JS_IsException(val))
  ------------------
  |  Branch (30538:21): [True: 0, False: 28]
  ------------------
30539|      0|                    goto fail;
30540|     28|                set_value(ctx, &var_refs[mi->var_idx]->value, val);
30541|       |#ifdef DUMP_MODULE_RESOLVE
30542|       |                printf("namespace\n");
30543|       |#endif
30544|     28|            } else {
30545|      0|                JSResolveResultEnum ret;
30546|      0|                JSExportEntry *res_me;
30547|      0|                JSModuleDef *res_m;
30548|      0|                JSObject *p1;
30549|       |
30550|      0|                ret = js_resolve_export(ctx, &res_m,
30551|      0|                                        &res_me, m1, mi->import_name);
30552|      0|                if (ret != JS_RESOLVE_RES_FOUND) {
  ------------------
  |  Branch (30552:21): [True: 0, False: 0]
  ------------------
30553|      0|                    js_resolve_export_throw_error(ctx, ret, m1, mi->import_name);
30554|      0|                    goto fail;
30555|      0|                }
30556|      0|                if (res_me->local_name == JS_ATOM__star_) {
  ------------------
  |  Branch (30556:21): [True: 0, False: 0]
  ------------------
30557|      0|                    JSValue val;
30558|      0|                    JSModuleDef *m2;
30559|       |                    /* name space import from */
30560|      0|                    m2 = res_m->req_module_entries[res_me->u.req_module_idx].module;
30561|      0|                    val = JS_GetModuleNamespace(ctx, m2);
30562|      0|                    if (JS_IsException(val))
  ------------------
  |  Branch (30562:25): [True: 0, False: 0]
  ------------------
30563|      0|                        goto fail;
30564|      0|                    var_ref = js_create_var_ref(ctx, TRUE);
30565|      0|                    if (!var_ref) {
  ------------------
  |  Branch (30565:25): [True: 0, False: 0]
  ------------------
30566|      0|                        JS_FreeValue(ctx, val);
30567|      0|                        goto fail;
30568|      0|                    }
30569|      0|                    set_value(ctx, &var_ref->value, val);
30570|      0|                    var_refs[mi->var_idx] = var_ref;
30571|       |#ifdef DUMP_MODULE_RESOLVE
30572|       |                    printf("namespace from\n");
30573|       |#endif
30574|      0|                } else {
30575|      0|                    var_ref = res_me->u.local.var_ref;
30576|      0|                    if (!var_ref) {
  ------------------
  |  Branch (30576:25): [True: 0, False: 0]
  ------------------
30577|      0|                        p1 = JS_VALUE_GET_OBJ(res_m->func_obj);
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
30578|      0|                        var_ref = p1->u.func.var_refs[res_me->u.local.var_idx];
30579|      0|                    }
30580|      0|                    js_rc(var_ref)->ref_count++;
30581|      0|                    var_refs[mi->var_idx] = var_ref;
30582|       |#ifdef DUMP_MODULE_RESOLVE
30583|       |                    printf("local export (var_ref=%p)\n", var_ref);
30584|       |#endif
30585|      0|                }
30586|      0|            }
30587|     28|        }
30588|       |
30589|       |        /* keep the exported variables in the module export entries (they
30590|       |           are used when the eval function is deleted and cannot be
30591|       |           initialized before in case imports are exported) */
30592|     14|        for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (30592:20): [True: 0, False: 14]
  ------------------
30593|      0|            JSExportEntry *me = &m->export_entries[i];
30594|      0|            if (me->export_type == JS_EXPORT_TYPE_LOCAL) {
  ------------------
  |  Branch (30594:17): [True: 0, False: 0]
  ------------------
30595|      0|                var_ref = var_refs[me->u.local.var_idx];
30596|      0|                js_rc(var_ref)->ref_count++;
30597|      0|                me->u.local.var_ref = var_ref;
30598|      0|            }
30599|      0|        }
30600|       |
30601|       |        /* initialize the global variables */
30602|     14|        ret_val = JS_Call(ctx, m->func_obj, JS_TRUE, 0, NULL);
  ------------------
  |  |  291|     14|#define JS_TRUE      JS_MKVAL(JS_TAG_BOOL, 1)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
30603|     14|        if (JS_IsException(ret_val))
  ------------------
  |  Branch (30603:13): [True: 1, False: 13]
  ------------------
30604|      1|            goto fail;
30605|     13|        JS_FreeValue(ctx, ret_val);
30606|     13|    }
30607|       |
30608|     42|    assert(m->dfs_ancestor_index <= m->dfs_index);
  ------------------
  |  Branch (30608:5): [True: 0, False: 41]
  |  Branch (30608:5): [True: 41, False: 0]
  ------------------
30609|     41|    if (m->dfs_index == m->dfs_ancestor_index) {
  ------------------
  |  Branch (30609:9): [True: 41, False: 0]
  ------------------
30610|     41|        for(;;) {
30611|       |            /* pop m1 from stack */
30612|     41|            m1 = *pstack_top;
30613|     41|            *pstack_top = m1->stack_prev;
30614|     41|            m1->status = JS_MODULE_STATUS_LINKED;
30615|     41|            if (m1 == m)
  ------------------
  |  Branch (30615:17): [True: 41, False: 0]
  ------------------
30616|     41|                break;
30617|     41|        }
30618|     41|    }
30619|       |
30620|       |#ifdef DUMP_MODULE_RESOLVE
30621|       |    printf("js_inner_module_linking done\n");
30622|       |#endif
30623|     41|    return index;
30624|      1| fail:
30625|      1|    return -1;
30626|     41|}
quickjs.c:js_evaluate_module:
31345|     13|{
31346|     13|    JSModuleDef *m1, *stack_top;
31347|     13|    JSValue ret_val, result;
31348|       |
31349|       |#ifdef DUMP_MODULE_EXEC
31350|       |    js_dump_module(ctx, __func__, m);
31351|       |#endif
31352|     13|    assert(m->status == JS_MODULE_STATUS_LINKED ||
  ------------------
  |  Branch (31352:5): [True: 13, False: 0]
  |  Branch (31352:5): [True: 0, False: 0]
  |  Branch (31352:5): [True: 0, False: 0]
  |  Branch (31352:5): [True: 13, False: 0]
  |  Branch (31352:5): [True: 0, False: 0]
  |  Branch (31352:5): [True: 0, False: 0]
  ------------------
31353|     13|           m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
31354|     13|           m->status == JS_MODULE_STATUS_EVALUATED);
31355|     13|    if (m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (31355:9): [True: 0, False: 13]
  ------------------
31356|     13|        m->status == JS_MODULE_STATUS_EVALUATED) {
  ------------------
  |  Branch (31356:9): [True: 0, False: 13]
  ------------------
31357|      0|        m = m->cycle_root;
31358|      0|    }
31359|       |    /* a promise may be created only on the cycle_root of a cycle */
31360|     13|    if (!JS_IsUndefined(m->promise))
  ------------------
  |  Branch (31360:9): [True: 0, False: 13]
  ------------------
31361|      0|        return JS_DupValue(ctx, m->promise);
31362|     13|    m->promise = JS_NewPromiseCapability(ctx, m->resolving_funcs);
31363|     13|    if (JS_IsException(m->promise))
  ------------------
  |  Branch (31363:9): [True: 0, False: 13]
  ------------------
31364|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
31365|       |
31366|     13|    stack_top = NULL;
31367|     13|    if (js_inner_module_evaluation(ctx, m, 0, &stack_top, &result) < 0) {
  ------------------
  |  Branch (31367:9): [True: 0, False: 13]
  ------------------
31368|      0|        while (stack_top != NULL) {
  ------------------
  |  Branch (31368:16): [True: 0, False: 0]
  ------------------
31369|      0|            m1 = stack_top;
31370|      0|            assert(m1->status == JS_MODULE_STATUS_EVALUATING);
  ------------------
  |  Branch (31370:13): [True: 0, False: 0]
  |  Branch (31370:13): [True: 0, False: 0]
  ------------------
31371|      0|            m1->status = JS_MODULE_STATUS_EVALUATED;
31372|      0|            m1->eval_has_exception = TRUE;
31373|      0|            m1->eval_exception = JS_DupValue(ctx, result);
31374|      0|            m1->cycle_root = m; /* spec bug: should be present */
31375|      0|            stack_top = m1->stack_prev;
31376|      0|        }
31377|      0|        JS_FreeValue(ctx, result);
31378|      0|        assert(m->status == JS_MODULE_STATUS_EVALUATED);
  ------------------
  |  Branch (31378:9): [True: 0, False: 0]
  |  Branch (31378:9): [True: 0, False: 0]
  ------------------
31379|      0|        assert(m->eval_has_exception);
  ------------------
  |  Branch (31379:9): [True: 0, False: 0]
  |  Branch (31379:9): [True: 0, False: 0]
  ------------------
31380|      0|        ret_val = JS_Call(ctx, m->resolving_funcs[1], JS_UNDEFINED,
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
31381|      0|                          1, (JSValueConst *)&m->eval_exception);
31382|      0|        JS_FreeValue(ctx, ret_val);
31383|     13|    } else {
31384|       |#ifdef DUMP_MODULE_EXEC
31385|       |        js_dump_module(ctx, "  done", m);
31386|       |#endif
31387|     13|        assert(m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (31387:9): [True: 13, False: 0]
  |  Branch (31387:9): [True: 0, False: 0]
  |  Branch (31387:9): [True: 0, False: 13]
  |  Branch (31387:9): [True: 13, False: 0]
  ------------------
31388|     13|               m->status == JS_MODULE_STATUS_EVALUATED);
31389|     13|        assert(!m->eval_has_exception);
  ------------------
  |  Branch (31389:9): [True: 0, False: 13]
  |  Branch (31389:9): [True: 13, False: 0]
  ------------------
31390|     13|        if (!m->async_evaluation) {
  ------------------
  |  Branch (31390:13): [True: 13, False: 0]
  ------------------
31391|     13|            JSValue value;
31392|     13|            assert(m->status == JS_MODULE_STATUS_EVALUATED);
  ------------------
  |  Branch (31392:13): [True: 0, False: 13]
  |  Branch (31392:13): [True: 13, False: 0]
  ------------------
31393|     13|            value = JS_UNDEFINED;
  ------------------
  |  |  289|     13|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     13|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
31394|     13|            ret_val = JS_Call(ctx, m->resolving_funcs[0], JS_UNDEFINED,
  ------------------
  |  |  289|     13|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     13|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
31395|     13|                              1, (JSValueConst *)&value);
31396|     13|            JS_FreeValue(ctx, ret_val);
31397|     13|        }
31398|     13|        assert(stack_top == NULL);
  ------------------
  |  Branch (31398:9): [True: 0, False: 13]
  |  Branch (31398:9): [True: 13, False: 0]
  ------------------
31399|     13|    }
31400|     13|    return JS_DupValue(ctx, m->promise);
31401|     13|}
quickjs.c:js_inner_module_evaluation:
31235|     39|{
31236|     39|    JSModuleDef *m1;
31237|     39|    int i;
31238|       |
31239|       |#ifdef DUMP_MODULE_EXEC
31240|       |    js_dump_module(ctx, __func__, m);
31241|       |#endif
31242|       |
31243|     39|    if (js_check_stack_overflow(ctx->rt, 0)) {
  ------------------
  |  Branch (31243:9): [True: 0, False: 39]
  ------------------
31244|      0|        JS_ThrowStackOverflow(ctx);
31245|      0|        *pvalue = JS_GetException(ctx);
31246|      0|        return -1;
31247|      0|    }
31248|       |
31249|     39|    if (m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (31249:9): [True: 0, False: 39]
  ------------------
31250|     39|        m->status == JS_MODULE_STATUS_EVALUATED) {
  ------------------
  |  Branch (31250:9): [True: 0, False: 39]
  ------------------
31251|      0|        if (m->eval_has_exception) {
  ------------------
  |  Branch (31251:13): [True: 0, False: 0]
  ------------------
31252|      0|            *pvalue = JS_DupValue(ctx, m->eval_exception);
31253|      0|            return -1;
31254|      0|        } else {
31255|      0|            *pvalue = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
31256|      0|            return index;
31257|      0|        }
31258|      0|    }
31259|     39|    if (m->status == JS_MODULE_STATUS_EVALUATING) {
  ------------------
  |  Branch (31259:9): [True: 0, False: 39]
  ------------------
31260|      0|        *pvalue = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
31261|      0|        return index;
31262|      0|    }
31263|     39|    assert(m->status == JS_MODULE_STATUS_LINKED);
  ------------------
  |  Branch (31263:5): [True: 0, False: 39]
  |  Branch (31263:5): [True: 39, False: 0]
  ------------------
31264|       |
31265|     39|    m->status = JS_MODULE_STATUS_EVALUATING;
31266|     39|    m->dfs_index = index;
31267|     39|    m->dfs_ancestor_index = index;
31268|     39|    m->pending_async_dependencies = 0;
31269|     39|    index++;
31270|       |    /* push 'm' on stack */
31271|     39|    m->stack_prev = *pstack_top;
31272|     39|    *pstack_top = m;
31273|       |
31274|     65|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (31274:16): [True: 26, False: 39]
  ------------------
31275|     26|        JSReqModuleEntry *rme = &m->req_module_entries[i];
31276|     26|        m1 = rme->module;
31277|     26|        index = js_inner_module_evaluation(ctx, m1, index, pstack_top, pvalue);
31278|     26|        if (index < 0)
  ------------------
  |  Branch (31278:13): [True: 0, False: 26]
  ------------------
31279|      0|            return -1;
31280|     26|        assert(m1->status == JS_MODULE_STATUS_EVALUATING ||
  ------------------
  |  Branch (31280:9): [True: 26, False: 0]
  |  Branch (31280:9): [True: 0, False: 0]
  |  Branch (31280:9): [True: 0, False: 0]
  |  Branch (31280:9): [True: 0, False: 26]
  |  Branch (31280:9): [True: 0, False: 26]
  |  Branch (31280:9): [True: 26, False: 0]
  ------------------
31281|     26|               m1->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
31282|     26|               m1->status == JS_MODULE_STATUS_EVALUATED);
31283|     26|        if (m1->status == JS_MODULE_STATUS_EVALUATING) {
  ------------------
  |  Branch (31283:13): [True: 0, False: 26]
  ------------------
31284|      0|            m->dfs_ancestor_index = min_int(m->dfs_ancestor_index,
31285|      0|                                            m1->dfs_ancestor_index);
31286|     26|        } else {
31287|     26|            m1 = m1->cycle_root;
31288|     26|            assert(m1->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
  ------------------
  |  Branch (31288:13): [True: 26, False: 0]
  |  Branch (31288:13): [True: 0, False: 0]
  |  Branch (31288:13): [True: 0, False: 26]
  |  Branch (31288:13): [True: 26, False: 0]
  ------------------
31289|     26|                   m1->status == JS_MODULE_STATUS_EVALUATED);
31290|     26|            if (m1->eval_has_exception) {
  ------------------
  |  Branch (31290:17): [True: 0, False: 26]
  ------------------
31291|      0|                *pvalue = JS_DupValue(ctx, m1->eval_exception);
31292|      0|                return -1;
31293|      0|            }
31294|     26|        }
31295|     26|        if (m1->async_evaluation) {
  ------------------
  |  Branch (31295:13): [True: 0, False: 26]
  ------------------
31296|      0|            m->pending_async_dependencies++;
31297|      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 (31297:17): [True: 0, False: 0]
  ------------------
31298|      0|                *pvalue = JS_GetException(ctx);
31299|      0|                return -1;
31300|      0|            }
31301|      0|            m1->async_parent_modules[m1->async_parent_modules_count++] = m;
31302|      0|        }
31303|     26|    }
31304|       |
31305|     39|    if (m->pending_async_dependencies > 0) {
  ------------------
  |  Branch (31305:9): [True: 0, False: 39]
  ------------------
31306|      0|        assert(!m->async_evaluation);
  ------------------
  |  Branch (31306:9): [True: 0, False: 0]
  |  Branch (31306:9): [True: 0, False: 0]
  ------------------
31307|      0|        m->async_evaluation = TRUE;
31308|      0|        m->async_evaluation_timestamp =
31309|      0|            ctx->rt->module_async_evaluation_next_timestamp++;
31310|     39|    } else if (m->has_tla) {
  ------------------
  |  Branch (31310:16): [True: 0, False: 39]
  ------------------
31311|      0|        assert(!m->async_evaluation);
  ------------------
  |  Branch (31311:9): [True: 0, False: 0]
  |  Branch (31311:9): [True: 0, False: 0]
  ------------------
31312|      0|        m->async_evaluation = TRUE;
31313|      0|        m->async_evaluation_timestamp =
31314|      0|            ctx->rt->module_async_evaluation_next_timestamp++;
31315|      0|        js_execute_async_module(ctx, m);
31316|     39|    } else {
31317|     39|        if (js_execute_sync_module(ctx, m, pvalue) < 0)
  ------------------
  |  Branch (31317:13): [True: 0, False: 39]
  ------------------
31318|      0|            return -1;
31319|     39|    }
31320|       |
31321|     39|    assert(m->dfs_ancestor_index <= m->dfs_index);
  ------------------
  |  Branch (31321:5): [True: 0, False: 39]
  |  Branch (31321:5): [True: 39, False: 0]
  ------------------
31322|     39|    if (m->dfs_index == m->dfs_ancestor_index) {
  ------------------
  |  Branch (31322:9): [True: 39, False: 0]
  ------------------
31323|     39|        for(;;) {
31324|       |            /* pop m1 from stack */
31325|     39|            m1 = *pstack_top;
31326|     39|            *pstack_top = m1->stack_prev;
31327|     39|            if (!m1->async_evaluation) {
  ------------------
  |  Branch (31327:17): [True: 39, False: 0]
  ------------------
31328|     39|                m1->status = JS_MODULE_STATUS_EVALUATED;
31329|     39|            } else {
31330|      0|                m1->status = JS_MODULE_STATUS_EVALUATING_ASYNC;
31331|      0|            }
31332|       |            /* spec bug: cycle_root must be assigned before the test */
31333|     39|            m1->cycle_root = m;
31334|     39|            if (m1 == m)
  ------------------
  |  Branch (31334:17): [True: 39, False: 0]
  ------------------
31335|     39|                break;
31336|     39|        }
31337|     39|    }
31338|     39|    *pvalue = JS_UNDEFINED;
  ------------------
  |  |  289|     39|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     39|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
31339|     39|    return index;
31340|     39|}
quickjs.c:js_execute_sync_module:
31196|     39|{
31197|       |#ifdef DUMP_MODULE_EXEC
31198|       |    js_dump_module(ctx, __func__, m);
31199|       |#endif
31200|     39|    if (m->init_func) {
  ------------------
  |  Branch (31200:9): [True: 26, False: 13]
  ------------------
31201|       |        /* C module init : no asynchronous execution */
31202|     26|        if (m->init_func(ctx, m) < 0)
  ------------------
  |  Branch (31202:13): [True: 0, False: 26]
  ------------------
31203|      0|            goto fail;
31204|     26|    } else {
31205|     13|        JSValue promise;
31206|     13|        JSPromiseStateEnum state;
31207|       |
31208|     13|        promise = js_async_function_call(ctx, m->func_obj, JS_UNDEFINED, 0, NULL, 0);
  ------------------
  |  |  289|     13|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     13|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
31209|     13|        if (JS_IsException(promise))
  ------------------
  |  Branch (31209:13): [True: 0, False: 13]
  ------------------
31210|      0|            goto fail;
31211|     13|        state = JS_PromiseState(ctx, promise);
31212|     13|        if (state == JS_PROMISE_FULFILLED) {
  ------------------
  |  Branch (31212:13): [True: 13, False: 0]
  ------------------
31213|     13|            JS_FreeValue(ctx, promise);
31214|     13|        } else if (state == JS_PROMISE_REJECTED) {
  ------------------
  |  Branch (31214:20): [True: 0, False: 0]
  ------------------
31215|      0|            *pvalue = JS_PromiseResult(ctx, promise);
31216|      0|            JS_FreeValue(ctx, promise);
31217|      0|            return -1;
31218|      0|        } else {
31219|      0|            JS_FreeValue(ctx, promise);
31220|      0|            JS_ThrowTypeError(ctx, "promise is pending");
31221|      0|        fail:
31222|      0|            *pvalue = JS_GetException(ctx);
31223|      0|            return -1;
31224|      0|        }
31225|     13|    }
31226|     39|    *pvalue = JS_UNDEFINED;
  ------------------
  |  |  289|     39|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     39|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
31227|     39|    return 0;
31228|     39|}
quickjs.c:JS_EvalInternal:
37111|     28|{
37112|     28|    BOOL backtrace_barrier = ((flags & JS_EVAL_FLAG_BACKTRACE_BARRIER) != 0);
  ------------------
  |  |  342|     28|#define JS_EVAL_FLAG_BACKTRACE_BARRIER (1 << 6)
  ------------------
37113|     28|    int saved_js_mode = 0;
37114|     28|    JSValue ret;
37115|       |    
37116|     28|    if (unlikely(!ctx->eval_internal)) {
  ------------------
  |  |   33|     28|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 28]
  |  |  ------------------
  ------------------
37117|      0|        return JS_ThrowTypeError(ctx, "eval is not supported");
37118|      0|    }
37119|     28|    if (backtrace_barrier && ctx->rt->current_stack_frame) {
  ------------------
  |  Branch (37119:9): [True: 0, False: 28]
  |  Branch (37119:30): [True: 0, False: 0]
  ------------------
37120|      0|        saved_js_mode = ctx->rt->current_stack_frame->js_mode;
37121|      0|        ctx->rt->current_stack_frame->js_mode |= JS_MODE_BACKTRACE_BARRIER;
  ------------------
  |  |  397|      0|#define JS_MODE_BACKTRACE_BARRIER (1 << 3) /* stop backtrace before this frame */
  ------------------
37122|      0|    }
37123|     28|    ret = ctx->eval_internal(ctx, this_obj, input, input_len, filename,
37124|     28|                             flags, scope_idx);
37125|     28|    if (backtrace_barrier && ctx->rt->current_stack_frame)
  ------------------
  |  Branch (37125:9): [True: 0, False: 28]
  |  Branch (37125:30): [True: 0, False: 0]
  ------------------
37126|      0|        ctx->rt->current_stack_frame->js_mode = saved_js_mode;
37127|     28|    return ret;
37128|     28|}
quickjs.c:js_resolve_module:
30335|     42|{
30336|     42|    int i;
30337|     42|    JSModuleDef *m1;
30338|       |
30339|     42|    if (m->resolved)
  ------------------
  |  Branch (30339:9): [True: 0, False: 42]
  ------------------
30340|      0|        return 0;
30341|       |#ifdef DUMP_MODULE_RESOLVE
30342|       |    {
30343|       |        char buf1[ATOM_GET_STR_BUF_SIZE];
30344|       |        printf("resolving module '%s':\n", JS_AtomGetStr(ctx, buf1, sizeof(buf1), m->module_name));
30345|       |    }
30346|       |#endif
30347|     42|    m->resolved = TRUE;
30348|       |    /* resolve each requested module */
30349|     70|    for(i = 0; i < m->req_module_entries_count; i++) {
  ------------------
  |  Branch (30349:16): [True: 28, False: 42]
  ------------------
30350|     28|        JSReqModuleEntry *rme = &m->req_module_entries[i];
30351|     28|        m1 = js_host_resolve_imported_module_atom(ctx, m->module_name,
30352|     28|                                                  rme->module_name,
30353|     28|                                                  rme->attributes);
30354|     28|        if (!m1)
  ------------------
  |  Branch (30354:13): [True: 0, False: 28]
  ------------------
30355|      0|            return -1;
30356|     28|        rme->module = m1;
30357|       |        /* already done in js_host_resolve_imported_module() except if
30358|       |           the module was loaded with JS_EvalBinary() */
30359|     28|        if (js_resolve_module(ctx, m1) < 0)
  ------------------
  |  Branch (30359:13): [True: 0, False: 28]
  ------------------
30360|      0|            return -1;
30361|     28|    }
30362|     42|    return 0;
30363|     42|}
quickjs.c:js_host_resolve_imported_module_atom:
29877|     28|{
29878|     28|    const char *base_cname, *cname;
29879|     28|    JSModuleDef *m;
29880|       |
29881|     28|    base_cname = JS_AtomToCString(ctx, base_module_name);
29882|     28|    if (!base_cname)
  ------------------
  |  Branch (29882:9): [True: 0, False: 28]
  ------------------
29883|      0|        return NULL;
29884|     28|    cname = JS_AtomToCString(ctx, module_name1);
29885|     28|    if (!cname) {
  ------------------
  |  Branch (29885:9): [True: 0, False: 28]
  ------------------
29886|      0|        JS_FreeCString(ctx, base_cname);
29887|      0|        return NULL;
29888|      0|    }
29889|     28|    m = js_host_resolve_imported_module(ctx, base_cname, cname, attributes);
29890|     28|    JS_FreeCString(ctx, base_cname);
29891|     28|    JS_FreeCString(ctx, cname);
29892|     28|    return m;
29893|     28|}
quickjs.c:js_dbuf_init:
 1927|     88|{
 1928|     88|    dbuf_init2(s, ctx->rt, (DynBufReallocFunc *)js_realloc_rt);
 1929|     88|}
quickjs.c:dbuf_put_sleb128:
 7386|    120|{
 7387|    120|    uint32_t v = v1;
 7388|    120|    dbuf_put_leb128(s, (2 * v) ^ -(v >> 31));
 7389|    120|}
quickjs.c:dbuf_put_leb128:
 7371|    190|{
 7372|    190|    uint32_t a;
 7373|    214|    for(;;) {
 7374|    214|        a = v & 0x7f;
 7375|    214|        v >>= 7;
 7376|    214|        if (v != 0) {
  ------------------
  |  Branch (7376:13): [True: 24, False: 190]
  ------------------
 7377|     24|            dbuf_putc(s, a | 0x80);
 7378|    190|        } else {
 7379|    190|            dbuf_putc(s, a);
 7380|    190|            break;
 7381|    190|        }
 7382|    214|    }
 7383|    190|}
quickjs.c:find_atom:
39334|  7.85k|{
39335|  7.85k|    JSAtom atom;
39336|  7.85k|    int len;
39337|       |
39338|  7.85k|    if (*name == '[') {
  ------------------
  |  Branch (39338:9): [True: 714, False: 7.14k]
  ------------------
39339|    714|        name++;
39340|    714|        len = strlen(name) - 1;
39341|       |        /* We assume 8 bit non null strings, which is the case for these
39342|       |           symbols */
39343|  5.29k|        for(atom = JS_ATOM_Symbol_toPrimitive; atom < JS_ATOM_END; atom++) {
  ------------------
  |  Branch (39343:48): [True: 5.29k, False: 0]
  ------------------
39344|  5.29k|            JSAtomStruct *p = ctx->rt->atom_array[atom];
39345|  5.29k|            JSString *str = p;
39346|  5.29k|            if (str->len == len && !memcmp(str->u.str8, name, len))
  ------------------
  |  Branch (39346:17): [True: 1.30k, False: 3.99k]
  |  Branch (39346:36): [True: 714, False: 588]
  ------------------
39347|    714|                return JS_DupAtom(ctx, atom);
39348|  5.29k|        }
39349|      0|        abort();
39350|  7.14k|    } else {
39351|  7.14k|        atom = JS_NewAtom(ctx, name);
39352|  7.14k|    }
39353|  7.14k|    return atom;
39354|  7.85k|}
quickjs.c:JS_InstantiateFunctionListItem:
39402|  7.71k|{
39403|  7.71k|    JSValue val;
39404|  7.71k|    int prop_flags = e->prop_flags;
39405|       |
39406|  7.71k|    switch(e->def_type) {
39407|    140|    case JS_DEF_ALIAS: /* using autoinit for aliases is not safe */
  ------------------
  |  | 1106|    140|#define JS_DEF_ALIAS          9
  ------------------
  |  Branch (39407:5): [True: 140, False: 7.57k]
  ------------------
39408|    140|        {
39409|    140|            JSAtom atom1 = find_atom(ctx, e->u.alias.name);
39410|    140|            switch (e->u.alias.base) {
39411|    112|            case -1:
  ------------------
  |  Branch (39411:13): [True: 112, False: 28]
  ------------------
39412|    112|                val = JS_GetProperty(ctx, obj, atom1);
39413|    112|                break;
39414|     28|            case 0:
  ------------------
  |  Branch (39414:13): [True: 28, False: 112]
  ------------------
39415|     28|                val = JS_GetProperty(ctx, ctx->global_obj, atom1);
39416|     28|                break;
39417|      0|            case 1:
  ------------------
  |  Branch (39417:13): [True: 0, False: 140]
  ------------------
39418|      0|                val = JS_GetProperty(ctx, ctx->class_proto[JS_CLASS_ARRAY], atom1);
39419|      0|                break;
39420|      0|            default:
  ------------------
  |  Branch (39420:13): [True: 0, False: 140]
  ------------------
39421|      0|                abort();
39422|    140|            }
39423|    140|            JS_FreeAtom(ctx, atom1);
39424|    140|            if (JS_IsException(val))
  ------------------
  |  Branch (39424:17): [True: 0, False: 140]
  ------------------
39425|      0|                return -1;
39426|    140|            if (atom == JS_ATOM_Symbol_toPrimitive) {
  ------------------
  |  Branch (39426:17): [True: 0, False: 140]
  ------------------
39427|       |                /* Symbol.toPrimitive functions are not writable */
39428|      0|                prop_flags = JS_PROP_CONFIGURABLE;
  ------------------
  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39429|    140|            } else if (atom == JS_ATOM_Symbol_hasInstance) {
  ------------------
  |  Branch (39429:24): [True: 0, False: 140]
  ------------------
39430|       |                /* Function.prototype[Symbol.hasInstance] is not writable nor configurable */
39431|      0|                prop_flags = 0;
39432|      0|            }
39433|    140|        }
39434|      0|        break;
39435|  5.49k|    case JS_DEF_CFUNC:
  ------------------
  |  | 1097|  5.49k|#define JS_DEF_CFUNC          0
  ------------------
  |  Branch (39435:5): [True: 5.49k, False: 2.21k]
  ------------------
39436|  5.49k|        if (atom == JS_ATOM_Symbol_toPrimitive) {
  ------------------
  |  Branch (39436:13): [True: 28, False: 5.47k]
  ------------------
39437|       |            /* Symbol.toPrimitive functions are not writable */
39438|     28|            prop_flags = JS_PROP_CONFIGURABLE;
  ------------------
  |  |  296|     28|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39439|  5.47k|        } else if (atom == JS_ATOM_Symbol_hasInstance) {
  ------------------
  |  Branch (39439:20): [True: 14, False: 5.45k]
  ------------------
39440|       |            /* Function.prototype[Symbol.hasInstance] is not writable nor configurable */
39441|     14|            prop_flags = 0;
39442|     14|        }
39443|  5.49k|        if (JS_DefineAutoInitProperty(ctx, obj, atom, JS_AUTOINIT_ID_PROP,
  ------------------
  |  Branch (39443:13): [True: 0, False: 5.49k]
  ------------------
39444|  5.49k|                                      (void *)e, prop_flags) < 0)
39445|      0|            return -1;
39446|  5.49k|        return 0;
39447|    322|    case JS_DEF_CGETSET: /* XXX: use autoinit again ? */
  ------------------
  |  | 1098|    322|#define JS_DEF_CGETSET        1
  ------------------
  |  Branch (39447:5): [True: 322, False: 7.39k]
  ------------------
39448|    574|    case JS_DEF_CGETSET_MAGIC:
  ------------------
  |  | 1099|    574|#define JS_DEF_CGETSET_MAGIC  2
  ------------------
  |  Branch (39448:5): [True: 252, False: 7.46k]
  ------------------
39449|    574|        {
39450|    574|            JSValue getter, setter;
39451|    574|            char buf[64];
39452|       |
39453|    574|            getter = JS_UNDEFINED;
  ------------------
  |  |  289|    574|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|    574|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
39454|    574|            if (e->u.getset.get.generic) {
  ------------------
  |  Branch (39454:17): [True: 574, False: 0]
  ------------------
39455|    574|                snprintf(buf, sizeof(buf), "get %s", e->name);
39456|    574|                getter = JS_NewCFunction2(ctx, e->u.getset.get.generic,
39457|    574|                                          buf, 0, e->def_type == JS_DEF_CGETSET_MAGIC ? JS_CFUNC_getter_magic : JS_CFUNC_getter,
  ------------------
  |  | 1099|    574|#define JS_DEF_CGETSET_MAGIC  2
  ------------------
  |  Branch (39457:51): [True: 252, False: 322]
  ------------------
39458|    574|                                          e->magic);
39459|    574|                if (JS_IsException(getter))
  ------------------
  |  Branch (39459:21): [True: 0, False: 574]
  ------------------
39460|      0|                    return -1;
39461|    574|            }
39462|    574|            setter = JS_UNDEFINED;
  ------------------
  |  |  289|    574|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|    574|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
39463|    574|            if (e->u.getset.set.generic) {
  ------------------
  |  Branch (39463:17): [True: 28, False: 546]
  ------------------
39464|     28|                snprintf(buf, sizeof(buf), "set %s", e->name);
39465|     28|                setter = JS_NewCFunction2(ctx, e->u.getset.set.generic,
39466|     28|                                          buf, 1, e->def_type == JS_DEF_CGETSET_MAGIC ? JS_CFUNC_setter_magic : JS_CFUNC_setter,
  ------------------
  |  | 1099|     28|#define JS_DEF_CGETSET_MAGIC  2
  ------------------
  |  Branch (39466:51): [True: 0, False: 28]
  ------------------
39467|     28|                                          e->magic);
39468|     28|                if (JS_IsException(setter)) {
  ------------------
  |  Branch (39468:21): [True: 0, False: 28]
  ------------------
39469|      0|                    JS_FreeValue(ctx, getter);
39470|      0|                    return -1;
39471|      0|                }
39472|     28|            }
39473|    574|            if (JS_DefinePropertyGetSet(ctx, obj, atom, getter, setter, prop_flags) < 0)
  ------------------
  |  Branch (39473:17): [True: 0, False: 574]
  ------------------
39474|      0|                return -1;
39475|    574|            return 0;
39476|    574|        }
39477|      0|        break;
39478|    493|    case JS_DEF_PROP_INT32:
  ------------------
  |  | 1101|    493|#define JS_DEF_PROP_INT32     4
  ------------------
  |  Branch (39478:5): [True: 493, False: 7.22k]
  ------------------
39479|    493|        val = JS_NewInt32(ctx, e->u.i32);
39480|    493|        break;
39481|      0|    case JS_DEF_PROP_INT64:
  ------------------
  |  | 1102|      0|#define JS_DEF_PROP_INT64     5
  ------------------
  |  Branch (39481:5): [True: 0, False: 7.71k]
  ------------------
39482|      0|        val = JS_NewInt64(ctx, e->u.i64);
39483|      0|        break;
39484|    140|    case JS_DEF_PROP_DOUBLE:
  ------------------
  |  | 1103|    140|#define JS_DEF_PROP_DOUBLE    6
  ------------------
  |  Branch (39484:5): [True: 140, False: 7.57k]
  ------------------
39485|    140|        val = __JS_NewFloat64(ctx, e->u.f64);
39486|    140|        break;
39487|     14|    case JS_DEF_PROP_UNDEFINED:
  ------------------
  |  | 1104|     14|#define JS_DEF_PROP_UNDEFINED 7
  ------------------
  |  Branch (39487:5): [True: 14, False: 7.70k]
  ------------------
39488|     14|        val = JS_UNDEFINED;
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
39489|     14|        break;
39490|    294|    case JS_DEF_PROP_ATOM:
  ------------------
  |  | 1107|    294|#define JS_DEF_PROP_ATOM     10
  ------------------
  |  Branch (39490:5): [True: 294, False: 7.42k]
  ------------------
39491|    294|        val = JS_AtomToValue(ctx, e->u.i32);
39492|    294|        break;
39493|      0|    case JS_DEF_PROP_BOOL:
  ------------------
  |  | 1108|      0|#define JS_DEF_PROP_BOOL     11
  ------------------
  |  Branch (39493:5): [True: 0, False: 7.71k]
  ------------------
39494|      0|        val = JS_NewBool(ctx, e->u.i32);
39495|      0|        break;
39496|    490|    case JS_DEF_PROP_STRING:
  ------------------
  |  | 1100|    490|#define JS_DEF_PROP_STRING    3
  ------------------
  |  Branch (39496:5): [True: 490, False: 7.22k]
  ------------------
39497|    560|    case JS_DEF_OBJECT:
  ------------------
  |  | 1105|    560|#define JS_DEF_OBJECT         8
  ------------------
  |  Branch (39497:5): [True: 70, False: 7.64k]
  ------------------
39498|    560|        if (JS_DefineAutoInitProperty(ctx, obj, atom, JS_AUTOINIT_ID_PROP,
  ------------------
  |  Branch (39498:13): [True: 0, False: 560]
  ------------------
39499|    560|                                      (void *)e, prop_flags) < 0)
39500|      0|            return -1;
39501|    560|        return 0;
39502|      0|    default:
  ------------------
  |  Branch (39502:5): [True: 0, False: 7.71k]
  ------------------
39503|      0|        abort();
39504|  7.71k|    }
39505|  1.08k|    if (JS_DefinePropertyValue(ctx, obj, atom, val, prop_flags) < 0)
  ------------------
  |  Branch (39505:9): [True: 0, False: 1.08k]
  ------------------
39506|      0|        return -1;
39507|  1.08k|    return 0;
39508|  1.08k|}
quickjs.c:JS_NewObjectProtoList:
39358|    181|{
39359|    181|    JSValue obj;
39360|    181|    obj = JS_NewObjectProtoClassAlloc(ctx, proto, JS_CLASS_OBJECT, n_fields);
39361|    181|    if (JS_IsException(obj))
  ------------------
  |  Branch (39361:9): [True: 0, False: 181]
  ------------------
39362|      0|        return obj;
39363|    181|    if (JS_SetPropertyFunctionList(ctx, obj, fields, n_fields)) {
  ------------------
  |  Branch (39363:9): [True: 0, False: 181]
  ------------------
39364|      0|        JS_FreeValue(ctx, obj);
39365|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
39366|      0|    }
39367|    181|    return obj;
39368|    181|}
quickjs.c:JS_SetConstructor2:
39582|    672|{
39583|    672|    if (JS_DefinePropertyValue(ctx, func_obj, JS_ATOM_prototype,
  ------------------
  |  Branch (39583:9): [True: 0, False: 672]
  ------------------
39584|    672|                               JS_DupValue(ctx, proto), proto_flags) < 0)
39585|      0|        return -1;
39586|    672|    if (JS_DefinePropertyValue(ctx, proto, JS_ATOM_constructor,
  ------------------
  |  Branch (39586:9): [True: 0, False: 672]
  ------------------
39587|    672|                               JS_DupValue(ctx, func_obj),
39588|    672|                               ctor_flags) < 0)
39589|      0|        return -1;
39590|    672|    set_cycle_flag(ctx, func_obj);
39591|    672|    set_cycle_flag(ctx, proto);
39592|    672|    return 0;
39593|    672|}
quickjs.c:JS_ToObject:
39709|     20|{
39710|     20|    int tag = JS_VALUE_GET_NORM_TAG(val);
  ------------------
  |  |  238|     20|#define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
  |  |  ------------------
  |  |  |  |  236|     20|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  ------------------
39711|     20|    JSValue obj;
39712|       |
39713|     20|    switch(tag) {
39714|      0|    default:
  ------------------
  |  Branch (39714:5): [True: 0, False: 20]
  ------------------
39715|      0|    case JS_TAG_NULL:
  ------------------
  |  Branch (39715:5): [True: 0, False: 20]
  ------------------
39716|      0|    case JS_TAG_UNDEFINED:
  ------------------
  |  Branch (39716:5): [True: 0, False: 20]
  ------------------
39717|      0|        return JS_ThrowTypeError(ctx, "cannot convert to object");
39718|     18|    case JS_TAG_OBJECT:
  ------------------
  |  Branch (39718:5): [True: 18, False: 2]
  ------------------
39719|     18|    case JS_TAG_EXCEPTION:
  ------------------
  |  Branch (39719:5): [True: 0, False: 20]
  ------------------
39720|     18|        return JS_DupValue(ctx, val);
39721|      0|    case JS_TAG_SHORT_BIG_INT:
  ------------------
  |  Branch (39721:5): [True: 0, False: 20]
  ------------------
39722|      0|    case JS_TAG_BIG_INT:
  ------------------
  |  Branch (39722:5): [True: 0, False: 20]
  ------------------
39723|      0|        obj = JS_NewObjectClass(ctx, JS_CLASS_BIG_INT);
39724|      0|        goto set_value;
39725|      0|    case JS_TAG_INT:
  ------------------
  |  Branch (39725:5): [True: 0, False: 20]
  ------------------
39726|      0|    case JS_TAG_FLOAT64:
  ------------------
  |  Branch (39726:5): [True: 0, False: 20]
  ------------------
39727|      0|        obj = JS_NewObjectClass(ctx, JS_CLASS_NUMBER);
39728|      0|        goto set_value;
39729|      0|    case JS_TAG_STRING:
  ------------------
  |  Branch (39729:5): [True: 0, False: 20]
  ------------------
39730|      0|    case JS_TAG_STRING_ROPE:
  ------------------
  |  Branch (39730:5): [True: 0, False: 20]
  ------------------
39731|       |        /* XXX: should call the string constructor */
39732|      0|        {
39733|      0|            JSValue str;
39734|      0|            str = JS_ToString(ctx, val); /* ensure that we never store a rope */
39735|      0|            if (JS_IsException(str))
  ------------------
  |  Branch (39735:17): [True: 0, False: 0]
  ------------------
39736|      0|                return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
39737|      0|            obj = JS_NewObjectClass(ctx, JS_CLASS_STRING);
39738|      0|            if (!JS_IsException(obj)) {
  ------------------
  |  Branch (39738:17): [True: 0, False: 0]
  ------------------
39739|      0|                JS_DefinePropertyValue(ctx, obj, JS_ATOM_length,
39740|      0|                                       JS_NewInt32(ctx, JS_VALUE_GET_STRING(str)->len), 0);
  ------------------
  |  |  228|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
39741|      0|                JS_SetObjectData(ctx, obj, JS_DupValue(ctx, str));
39742|      0|            }
39743|      0|            JS_FreeValue(ctx, str);
39744|      0|            return obj;
39745|      0|        }
39746|      2|    case JS_TAG_BOOL:
  ------------------
  |  Branch (39746:5): [True: 2, False: 18]
  ------------------
39747|      2|        obj = JS_NewObjectClass(ctx, JS_CLASS_BOOLEAN);
39748|      2|        goto set_value;
39749|      0|    case JS_TAG_SYMBOL:
  ------------------
  |  Branch (39749:5): [True: 0, False: 20]
  ------------------
39750|      0|        obj = JS_NewObjectClass(ctx, JS_CLASS_SYMBOL);
39751|      2|    set_value:
39752|      2|        if (!JS_IsException(obj))
  ------------------
  |  Branch (39752:13): [True: 2, False: 0]
  ------------------
39753|      2|            JS_SetObjectData(ctx, obj, JS_DupValue(ctx, val));
39754|      2|        return obj;
39755|     20|    }
39756|     20|}
quickjs.c:js_string_define_own_property:
44903|     56|{
44904|     56|    uint32_t idx;
44905|     56|    JSObject *p;
44906|     56|    JSString *p1, *p2;
44907|       |
44908|     56|    if (__JS_AtomIsTaggedInt(prop)) {
  ------------------
  |  Branch (44908:9): [True: 0, False: 56]
  ------------------
44909|      0|        idx = __JS_AtomToUInt32(prop);
44910|      0|        p = JS_VALUE_GET_OBJ(this_obj);
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
44911|      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 (44911:13): [True: 0, False: 0]
  ------------------
44912|      0|            goto def;
44913|      0|        p1 = JS_VALUE_GET_STRING(p->u.object_data);
  ------------------
  |  |  228|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
44914|      0|        if (idx >= p1->len)
  ------------------
  |  Branch (44914:13): [True: 0, False: 0]
  ------------------
44915|      0|            goto def;
44916|      0|        if (!check_define_prop_flags(JS_PROP_ENUMERABLE, flags))
  ------------------
  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
  |  Branch (44916:13): [True: 0, False: 0]
  ------------------
44917|      0|            goto fail;
44918|       |        /* check that the same value is configured */
44919|      0|        if (flags & JS_PROP_HAS_VALUE) {
  ------------------
  |  |  314|      0|#define JS_PROP_HAS_VALUE        (1 << 13)
  ------------------
  |  Branch (44919:13): [True: 0, False: 0]
  ------------------
44920|      0|            if (JS_VALUE_GET_TAG(val) != JS_TAG_STRING)
  ------------------
  |  |  236|      0|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (44920:17): [True: 0, False: 0]
  ------------------
44921|      0|                goto fail;
44922|      0|            p2 = JS_VALUE_GET_STRING(val);
  ------------------
  |  |  228|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
44923|      0|            if (p2->len != 1)
  ------------------
  |  Branch (44923:17): [True: 0, False: 0]
  ------------------
44924|      0|                goto fail;
44925|      0|            if (string_get(p1, idx) != string_get(p2, 0)) {
  ------------------
  |  Branch (44925:17): [True: 0, False: 0]
  ------------------
44926|      0|            fail:
44927|      0|                return JS_ThrowTypeErrorOrFalse(ctx, flags, "property is not configurable");
44928|      0|            }
44929|      0|        }
44930|      0|        return TRUE;
44931|     56|    } else {
44932|     56|    def:
44933|     56|        return JS_DefineProperty(ctx, this_obj, prop, val, getter, setter,
44934|     56|                                 flags | JS_PROP_NO_EXOTIC);
  ------------------
  |  |  323|     56|#define JS_PROP_NO_EXOTIC        (1 << 16) /* internal use */
  ------------------
44935|     56|    }
44936|     56|}
quickjs.c:string_buffer_init2:
 3999|    142|{
 4000|    142|    s->ctx = ctx;
 4001|    142|    s->size = size;
 4002|    142|    s->len = 0;
 4003|    142|    s->is_wide_char = is_wide;
 4004|    142|    s->error_status = 0;
 4005|    142|    s->str = js_alloc_string(ctx, size, is_wide);
 4006|    142|    if (unlikely(!s->str)) {
  ------------------
  |  |   33|    142|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 142]
  |  |  ------------------
  ------------------
 4007|      0|        s->size = 0;
 4008|      0|        return s->error_status = -1;
 4009|      0|    }
 4010|       |#ifdef DUMP_LEAKS
 4011|       |    /* the StringBuffer may reallocate the JSString, only link it at the end */
 4012|       |    list_del(&s->str->link);
 4013|       |#endif
 4014|    142|    return 0;
 4015|    142|}
quickjs.c:string_buffer_putc:
 4147|  11.7M|{
 4148|  11.7M|    if (likely(s->len < s->size)) {
  ------------------
  |  |   32|  11.7M|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 11.7M, False: 325]
  |  |  ------------------
  ------------------
 4149|  11.7M|        if (s->is_wide_char) {
  ------------------
  |  Branch (4149:13): [True: 6.92M, False: 4.81M]
  ------------------
 4150|  6.92M|            if (c < 0x10000) {
  ------------------
  |  Branch (4150:17): [True: 6.92M, False: 3]
  ------------------
 4151|  6.92M|                s->str->u.str16[s->len++] = c;
 4152|  6.92M|                return 0;
 4153|  6.92M|            } else if (likely((s->len + 1) < s->size)) {
  ------------------
  |  |   32|      3|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 3, False: 0]
  |  |  ------------------
  ------------------
 4154|      3|                s->str->u.str16[s->len++] = get_hi_surrogate(c);
 4155|      3|                s->str->u.str16[s->len++] = get_lo_surrogate(c);
 4156|      3|                return 0;
 4157|      3|            }
 4158|  6.92M|        } else if (c < 0x100) {
  ------------------
  |  Branch (4158:20): [True: 4.81M, False: 9]
  ------------------
 4159|  4.81M|            s->str->u.str8[s->len++] = c;
 4160|  4.81M|            return 0;
 4161|  4.81M|        }
 4162|  11.7M|    }
 4163|    334|    return string_buffer_putc_slow(s, c);
 4164|  11.7M|}
quickjs.c:string_buffer_putc_slow:
 4135|    334|{
 4136|    334|    if (unlikely(c >= 0x10000)) {
  ------------------
  |  |   33|    334|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 3, False: 331]
  |  |  ------------------
  ------------------
 4137|       |        /* surrogate pair */
 4138|      3|        if (string_buffer_putc16(s, get_hi_surrogate(c)))
  ------------------
  |  Branch (4138:13): [True: 0, False: 3]
  ------------------
 4139|      0|            return -1;
 4140|      3|        c = get_lo_surrogate(c);
 4141|      3|    }
 4142|    334|    return string_buffer_putc16(s, c);
 4143|    334|}
quickjs.c:string_getc:
 4167|  1.00M|{
 4168|  1.00M|    int idx, c, c1;
 4169|  1.00M|    idx = *pidx;
 4170|  1.00M|    if (p->is_wide_char) {
  ------------------
  |  Branch (4170:9): [True: 1.00M, False: 2]
  ------------------
 4171|  1.00M|        c = p->u.str16[idx++];
 4172|  1.00M|        if (is_hi_surrogate(c) && idx < p->len) {
  ------------------
  |  Branch (4172:13): [True: 1, False: 1.00M]
  |  Branch (4172:35): [True: 1, False: 0]
  ------------------
 4173|      1|            c1 = p->u.str16[idx];
 4174|      1|            if (is_lo_surrogate(c1)) {
  ------------------
  |  Branch (4174:17): [True: 0, False: 1]
  ------------------
 4175|      0|                c = from_surrogate(c, c1);
 4176|      0|                idx++;
 4177|      0|            }
 4178|      1|        }
 4179|  1.00M|    } else {
 4180|      2|        c = p->u.str8[idx++];
 4181|      2|    }
 4182|  1.00M|    *pidx = idx;
 4183|  1.00M|    return c;
 4184|  1.00M|}
quickjs.c:js_check_stack_overflow:
 2051|  1.01M|{
 2052|  1.01M|    uintptr_t sp;
 2053|  1.01M|    sp = js_get_stack_pointer() - alloca_size;
 2054|  1.01M|    return unlikely(sp < rt->stack_limit);
  ------------------
  |  |   33|  1.01M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  ------------------
 2055|  1.01M|}
quickjs.c:js_compile_regexp:
47258|      3|{
47259|      3|    const char *str;
47260|      3|    int re_flags, mask;
47261|      3|    uint8_t *re_bytecode_buf;
47262|      3|    size_t i, len;
47263|      3|    int re_bytecode_len;
47264|      3|    JSValue ret;
47265|      3|    char error_msg[64];
47266|       |
47267|      3|    re_flags = 0;
47268|      3|    if (!JS_IsUndefined(flags)) {
  ------------------
  |  Branch (47268:9): [True: 3, False: 0]
  ------------------
47269|      3|        str = JS_ToCStringLen(ctx, &len, flags);
47270|      3|        if (!str)
  ------------------
  |  Branch (47270:13): [True: 0, False: 3]
  ------------------
47271|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47272|       |        /* XXX: re_flags = LRE_FLAG_OCTAL unless strict mode? */
47273|      8|        for (i = 0; i < len; i++) {
  ------------------
  |  Branch (47273:21): [True: 5, False: 3]
  ------------------
47274|      5|            switch(str[i]) {
47275|      0|            case 'd':
  ------------------
  |  Branch (47275:13): [True: 0, False: 5]
  ------------------
47276|      0|                mask = LRE_FLAG_INDICES;
  ------------------
  |  |   36|      0|#define LRE_FLAG_INDICES    (1 << 6) /* Unused by libregexp, just recorded. */
  ------------------
47277|      0|                break;
47278|      0|            case 'g':
  ------------------
  |  Branch (47278:13): [True: 0, False: 5]
  ------------------
47279|      0|                mask = LRE_FLAG_GLOBAL;
  ------------------
  |  |   30|      0|#define LRE_FLAG_GLOBAL     (1 << 0)
  ------------------
47280|      0|                break;
47281|      0|            case 'i':
  ------------------
  |  Branch (47281:13): [True: 0, False: 5]
  ------------------
47282|      0|                mask = LRE_FLAG_IGNORECASE;
  ------------------
  |  |   31|      0|#define LRE_FLAG_IGNORECASE (1 << 1)
  ------------------
47283|      0|                break;
47284|      0|            case 'm':
  ------------------
  |  Branch (47284:13): [True: 0, False: 5]
  ------------------
47285|      0|                mask = LRE_FLAG_MULTILINE;
  ------------------
  |  |   32|      0|#define LRE_FLAG_MULTILINE  (1 << 2)
  ------------------
47286|      0|                break;
47287|      0|            case 's':
  ------------------
  |  Branch (47287:13): [True: 0, False: 5]
  ------------------
47288|      0|                mask = LRE_FLAG_DOTALL;
  ------------------
  |  |   33|      0|#define LRE_FLAG_DOTALL     (1 << 3)
  ------------------
47289|      0|                break;
47290|      3|            case 'u':
  ------------------
  |  Branch (47290:13): [True: 3, False: 2]
  ------------------
47291|      3|                mask = LRE_FLAG_UNICODE;
  ------------------
  |  |   34|      3|#define LRE_FLAG_UNICODE    (1 << 4)
  ------------------
47292|      3|                break;
47293|      0|            case 'v':
  ------------------
  |  Branch (47293:13): [True: 0, False: 5]
  ------------------
47294|      0|                mask = LRE_FLAG_UNICODE_SETS;
  ------------------
  |  |   38|      0|#define LRE_FLAG_UNICODE_SETS (1 << 8)
  ------------------
47295|      0|                break;
47296|      2|            case 'y':
  ------------------
  |  Branch (47296:13): [True: 2, False: 3]
  ------------------
47297|      2|                mask = LRE_FLAG_STICKY;
  ------------------
  |  |   35|      2|#define LRE_FLAG_STICKY     (1 << 5)
  ------------------
47298|      2|                break;
47299|      0|            default:
  ------------------
  |  Branch (47299:13): [True: 0, False: 5]
  ------------------
47300|      0|                goto bad_flags;
47301|      5|            }
47302|      5|            if ((re_flags & mask) != 0) {
  ------------------
  |  Branch (47302:17): [True: 0, False: 5]
  ------------------
47303|      0|            bad_flags:
47304|      0|                JS_FreeCString(ctx, str);
47305|      0|                goto bad_flags1;
47306|      0|            }
47307|      5|            re_flags |= mask;
47308|      5|        }
47309|      3|        JS_FreeCString(ctx, str);
47310|      3|    }
47311|       |
47312|       |    /* 'u' and 'v' cannot be both set */
47313|      3|    if ((re_flags & LRE_FLAG_UNICODE_SETS) && (re_flags & LRE_FLAG_UNICODE)) {
  ------------------
  |  |   38|      3|#define LRE_FLAG_UNICODE_SETS (1 << 8)
  ------------------
                  if ((re_flags & LRE_FLAG_UNICODE_SETS) && (re_flags & LRE_FLAG_UNICODE)) {
  ------------------
  |  |   34|      0|#define LRE_FLAG_UNICODE    (1 << 4)
  ------------------
  |  Branch (47313:9): [True: 0, False: 3]
  |  Branch (47313:47): [True: 0, False: 0]
  ------------------
47314|      0|    bad_flags1:
47315|      0|        return JS_ThrowSyntaxError(ctx, "invalid regular expression flags");
47316|      0|    }
47317|       |    
47318|      3|    str = JS_ToCStringLen2(ctx, &len, pattern, !(re_flags & (LRE_FLAG_UNICODE | LRE_FLAG_UNICODE_SETS)));
  ------------------
  |  |   34|      3|#define LRE_FLAG_UNICODE    (1 << 4)
  ------------------
                  str = JS_ToCStringLen2(ctx, &len, pattern, !(re_flags & (LRE_FLAG_UNICODE | LRE_FLAG_UNICODE_SETS)));
  ------------------
  |  |   38|      3|#define LRE_FLAG_UNICODE_SETS (1 << 8)
  ------------------
47319|      3|    if (!str)
  ------------------
  |  Branch (47319:9): [True: 0, False: 3]
  ------------------
47320|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47321|      3|    re_bytecode_buf = lre_compile(&re_bytecode_len, error_msg,
47322|      3|                                  sizeof(error_msg), str, len, re_flags, ctx);
47323|      3|    JS_FreeCString(ctx, str);
47324|      3|    if (!re_bytecode_buf) {
  ------------------
  |  Branch (47324:9): [True: 0, False: 3]
  ------------------
47325|      0|        JS_ThrowSyntaxError(ctx, "%s", error_msg);
47326|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47327|      0|    }
47328|       |
47329|      3|    ret = js_new_string8_len(ctx, (const char *)re_bytecode_buf, re_bytecode_len);
47330|      3|    js_free(ctx, re_bytecode_buf);
47331|      3|    return ret;
47332|      3|}
quickjs.c:JS_NewCConstructor:
39618|    644|{
39619|    644|    JSValue ctor = JS_UNDEFINED, proto, parent_proto;
  ------------------
  |  |  289|    644|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|    644|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
39620|    644|    int proto_class_id, proto_flags, ctor_flags;
39621|       |
39622|    644|    proto_flags = 0;
39623|    644|    if (flags & JS_NEW_CTOR_READONLY) {
  ------------------
  |  |39606|    644|#define JS_NEW_CTOR_READONLY    (1 << 3) /* read-only constructor field */
  ------------------
  |  Branch (39623:9): [True: 42, False: 602]
  ------------------
39624|     42|        ctor_flags = JS_PROP_CONFIGURABLE;
  ------------------
  |  |  296|     42|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39625|    602|    } else {
39626|    602|        ctor_flags = JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE;
  ------------------
  |  |  297|    602|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                      ctor_flags = JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE;
  ------------------
  |  |  296|    602|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39627|    602|    }
39628|       |    
39629|    644|    if (JS_IsUndefined(parent_ctor)) {
  ------------------
  |  Branch (39629:9): [True: 322, False: 322]
  ------------------
39630|    322|        parent_proto = JS_DupValue(ctx, ctx->class_proto[JS_CLASS_OBJECT]);
39631|    322|        parent_ctor = ctx->function_proto;
39632|    322|    } else {
39633|    322|        parent_proto = JS_GetProperty(ctx, parent_ctor, JS_ATOM_prototype);
39634|    322|        if (JS_IsException(parent_proto))
  ------------------
  |  Branch (39634:13): [True: 0, False: 322]
  ------------------
39635|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
39636|    322|    }
39637|       |    
39638|    644|    if (flags & JS_NEW_CTOR_PROTO_EXIST) {
  ------------------
  |  |39605|    644|#define JS_NEW_CTOR_PROTO_EXIST (1 << 2) /* the prototype is already defined */
  ------------------
  |  Branch (39638:9): [True: 28, False: 616]
  ------------------
39639|     28|        proto = JS_DupValue(ctx, ctx->class_proto[class_id]);
39640|    616|    } else {
39641|    616|        if (flags & JS_NEW_CTOR_PROTO_CLASS)
  ------------------
  |  |39604|    616|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
  |  Branch (39641:13): [True: 56, False: 560]
  ------------------
39642|     56|            proto_class_id = class_id;
39643|    560|        else
39644|    560|            proto_class_id = JS_CLASS_OBJECT;
39645|       |        /* one additional field: constructor */
39646|    616|        proto = JS_NewObjectProtoClassAlloc(ctx, parent_proto, proto_class_id,
39647|    616|                                            n_proto_fields + 1);
39648|    616|        if (JS_IsException(proto))
  ------------------
  |  Branch (39648:13): [True: 0, False: 616]
  ------------------
39649|      0|            goto fail;
39650|    616|        if (class_id >= 0)
  ------------------
  |  Branch (39650:13): [True: 490, False: 126]
  ------------------
39651|    490|            ctx->class_proto[class_id] = JS_DupValue(ctx, proto);
39652|    616|    }
39653|    644|    if (JS_SetPropertyFunctionList(ctx, proto, proto_fields, n_proto_fields))
  ------------------
  |  Branch (39653:9): [True: 0, False: 644]
  ------------------
39654|      0|        goto fail;
39655|       |
39656|       |    /* additional fields: name, length, prototype */
39657|    644|    ctor = JS_NewCFunction3(ctx, func, name, length, cproto, magic, parent_ctor,
39658|    644|                            n_ctor_fields + 3);
39659|    644|    if (JS_IsException(ctor))
  ------------------
  |  Branch (39659:9): [True: 0, False: 644]
  ------------------
39660|      0|        goto fail;
39661|    644|    if (JS_SetPropertyFunctionList(ctx, ctor, ctor_fields, n_ctor_fields))
  ------------------
  |  Branch (39661:9): [True: 0, False: 644]
  ------------------
39662|      0|        goto fail;
39663|    644|    if (!(flags & JS_NEW_CTOR_NO_GLOBAL)) {
  ------------------
  |  |39603|    644|#define JS_NEW_CTOR_NO_GLOBAL   (1 << 0) /* don't create a global binding */
  ------------------
  |  Branch (39663:9): [True: 588, False: 56]
  ------------------
39664|    588|        if (JS_DefinePropertyValueStr(ctx, ctx->global_obj, name,
  ------------------
  |  Branch (39664:13): [True: 0, False: 588]
  ------------------
39665|    588|                                      JS_DupValue(ctx, ctor),
39666|    588|                                      JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  297|    588|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                                    JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE) < 0)
  ------------------
  |  |  296|    588|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
39667|      0|            goto fail;
39668|    588|    }
39669|    644|    JS_SetConstructor2(ctx, ctor, proto, proto_flags, ctor_flags);
39670|       |
39671|    644|    JS_FreeValue(ctx, proto);
39672|    644|    JS_FreeValue(ctx, parent_proto);
39673|    644|    return ctor;
39674|      0| fail:
39675|      0|    JS_FreeValue(ctx, proto);
39676|      0|    JS_FreeValue(ctx, parent_proto);
39677|      0|    JS_FreeValue(ctx, ctor);
39678|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
39679|    644|}
quickjs.c:js_regexp_constructor:
47421|      2|{
47422|      2|    JSValue pattern, flags, bc, val, obj = JS_UNDEFINED;
  ------------------
  |  |  289|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47423|      2|    JSValueConst pat, flags1;
  ------------------
  |  |  234|      2|#define JSValueConst JSValue
  ------------------
47424|      2|    JSRegExp *re;
47425|      2|    int pat_is_regexp;
47426|       |
47427|      2|    pat = argv[0];
47428|      2|    flags1 = argv[1];
47429|      2|    pat_is_regexp = js_is_regexp(ctx, pat);
47430|      2|    if (pat_is_regexp < 0)
  ------------------
  |  Branch (47430:9): [True: 0, False: 2]
  ------------------
47431|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47432|      2|    if (JS_IsUndefined(new_target)) {
  ------------------
  |  Branch (47432:9): [True: 0, False: 2]
  ------------------
47433|       |        /* called as a function */
47434|      0|        new_target = JS_GetActiveFunction(ctx);
47435|      0|        if (pat_is_regexp && JS_IsUndefined(flags1)) {
  ------------------
  |  Branch (47435:13): [True: 0, False: 0]
  |  Branch (47435:30): [True: 0, False: 0]
  ------------------
47436|      0|            JSValue ctor;
47437|      0|            BOOL res;
47438|      0|            ctor = JS_GetProperty(ctx, pat, JS_ATOM_constructor);
47439|      0|            if (JS_IsException(ctor))
  ------------------
  |  Branch (47439:17): [True: 0, False: 0]
  ------------------
47440|      0|                return ctor;
47441|      0|            res = js_same_value(ctx, ctor, new_target);
47442|      0|            JS_FreeValue(ctx, ctor);
47443|      0|            if (res)
  ------------------
  |  Branch (47443:17): [True: 0, False: 0]
  ------------------
47444|      0|                return JS_DupValue(ctx, pat);
47445|      0|        }
47446|      0|    }
47447|      2|    re = js_get_regexp(ctx, pat, FALSE);
47448|      2|    flags = JS_UNDEFINED;
  ------------------
  |  |  289|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47449|      2|    if (re) {
  ------------------
  |  Branch (47449:9): [True: 2, False: 0]
  ------------------
47450|      2|        pattern = JS_DupValue(ctx, JS_MKPTR(JS_TAG_STRING, re->pattern));
  ------------------
  |  |  246|      2|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
47451|      2|        if (JS_IsUndefined(flags1)) {
  ------------------
  |  Branch (47451:13): [True: 0, False: 2]
  ------------------
47452|      0|            bc = JS_DupValue(ctx, JS_MKPTR(JS_TAG_STRING, re->bytecode));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
47453|      0|            obj = js_create_from_ctor(ctx, new_target, JS_CLASS_REGEXP);
47454|      0|            if (JS_IsException(obj))
  ------------------
  |  Branch (47454:17): [True: 0, False: 0]
  ------------------
47455|      0|                goto fail;
47456|      0|            goto no_compilation;
47457|      2|        } else {
47458|      2|            flags = JS_DupValue(ctx, flags1);
47459|      2|        }
47460|      2|    } else {
47461|      0|        if (pat_is_regexp) {
  ------------------
  |  Branch (47461:13): [True: 0, False: 0]
  ------------------
47462|      0|            pattern = JS_GetProperty(ctx, pat, JS_ATOM_source);
47463|      0|            if (JS_IsException(pattern))
  ------------------
  |  Branch (47463:17): [True: 0, False: 0]
  ------------------
47464|      0|                goto fail;
47465|      0|            if (JS_IsUndefined(flags1)) {
  ------------------
  |  Branch (47465:17): [True: 0, False: 0]
  ------------------
47466|      0|                flags = JS_GetProperty(ctx, pat, JS_ATOM_flags);
47467|      0|                if (JS_IsException(flags))
  ------------------
  |  Branch (47467:21): [True: 0, False: 0]
  ------------------
47468|      0|                    goto fail;
47469|      0|            } else {
47470|      0|                flags = JS_DupValue(ctx, flags1);
47471|      0|            }
47472|      0|        } else {
47473|      0|            pattern = JS_DupValue(ctx, pat);
47474|      0|            flags = JS_DupValue(ctx, flags1);
47475|      0|        }
47476|      0|        if (JS_IsUndefined(pattern)) {
  ------------------
  |  Branch (47476:13): [True: 0, False: 0]
  ------------------
47477|      0|            pattern = JS_AtomToString(ctx, JS_ATOM_empty_string);
47478|      0|        } else {
47479|      0|            val = pattern;
47480|      0|            pattern = JS_ToString(ctx, val);
47481|      0|            JS_FreeValue(ctx, val);
47482|      0|            if (JS_IsException(pattern))
  ------------------
  |  Branch (47482:17): [True: 0, False: 0]
  ------------------
47483|      0|                goto fail;
47484|      0|        }
47485|      0|    }
47486|      2|    obj = js_create_from_ctor(ctx, new_target, JS_CLASS_REGEXP);
47487|      2|    if (JS_IsException(obj))
  ------------------
  |  Branch (47487:9): [True: 0, False: 2]
  ------------------
47488|      0|        goto fail;
47489|      2|    bc = js_compile_regexp(ctx, pattern, flags);
47490|      2|    if (JS_IsException(bc))
  ------------------
  |  Branch (47490:9): [True: 0, False: 2]
  ------------------
47491|      0|        goto fail;
47492|      2|    JS_FreeValue(ctx, flags);
47493|      2| no_compilation:
47494|      2|    return js_regexp_set_internal(ctx, obj, pattern, bc);
47495|      0| fail:
47496|      0|    JS_FreeValue(ctx, pattern);
47497|      0|    JS_FreeValue(ctx, flags);
47498|      0|    JS_FreeValue(ctx, obj);
47499|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47500|      2|}
quickjs.c:js_is_regexp:
47406|      2|{
47407|      2|    JSValue m;
47408|       |
47409|      2|    if (!JS_IsObject(obj))
  ------------------
  |  Branch (47409:9): [True: 0, False: 2]
  ------------------
47410|      0|        return FALSE;
47411|      2|    m = JS_GetProperty(ctx, obj, JS_ATOM_Symbol_match);
47412|      2|    if (JS_IsException(m))
  ------------------
  |  Branch (47412:9): [True: 0, False: 2]
  ------------------
47413|      0|        return -1;
47414|      2|    if (!JS_IsUndefined(m))
  ------------------
  |  Branch (47414:9): [True: 2, False: 0]
  ------------------
47415|      2|        return JS_ToBoolFree(ctx, m);
47416|      0|    return js_get_regexp(ctx, obj, FALSE) != NULL;
47417|      2|}
quickjs.c:js_get_regexp:
47392|  1.00M|{
47393|  1.00M|    if (JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT) {
  ------------------
  |  |  236|  1.00M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (47393:9): [True: 1.00M, False: 0]
  ------------------
47394|  1.00M|        JSObject *p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|  1.00M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.00M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47395|  1.00M|        if (p->class_id == JS_CLASS_REGEXP)
  ------------------
  |  Branch (47395:13): [True: 1.00M, False: 0]
  ------------------
47396|  1.00M|            return &p->u.regexp;
47397|  1.00M|    }
47398|      0|    if (throw_error) {
  ------------------
  |  Branch (47398:9): [True: 0, False: 0]
  ------------------
47399|      0|        JS_ThrowTypeErrorInvalidClass(ctx, JS_CLASS_REGEXP);
47400|      0|    }
47401|       |    return NULL;
47402|  1.00M|}
quickjs.c:js_regexp_set_internal:
47367|      2|{
47368|      2|    JSObject *p;
47369|      2|    JSRegExp *re;
47370|       |
47371|       |    /* sanity check */
47372|      2|    if (unlikely(JS_VALUE_GET_TAG(bc) != JS_TAG_STRING ||
  ------------------
  |  |   33|      4|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 2]
  |  |  |  Branch (33:45): [True: 0, False: 2]
  |  |  |  Branch (33:45): [True: 0, False: 2]
  |  |  ------------------
  ------------------
47373|      2|                 JS_VALUE_GET_TAG(pattern) != JS_TAG_STRING)) {
47374|      0|        JS_ThrowTypeError(ctx, "string expected");
47375|      0|        JS_FreeValue(ctx, obj);
47376|      0|        JS_FreeValue(ctx, bc);
47377|      0|        JS_FreeValue(ctx, pattern);
47378|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47379|      0|    }
47380|       |
47381|      2|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|      2|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47382|      2|    re = &p->u.regexp;
47383|      2|    re->pattern = JS_VALUE_GET_STRING(pattern);
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47384|      2|    re->bytecode = JS_VALUE_GET_STRING(bc);
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47385|       |    /* Note: cannot fail because the field is preallocated */
47386|      2|    JS_DefinePropertyValue(ctx, obj, JS_ATOM_lastIndex, JS_NewInt32(ctx, 0),
47387|      2|                           JS_PROP_WRITABLE);
  ------------------
  |  |  297|      2|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
47388|      2|    return obj;
47389|      2|}
quickjs.c:js_get_this:
41657|      2|{
41658|      2|    return JS_DupValue(ctx, this_val);
41659|      2|}
quickjs.c:js_regexp_get_flags:
47635|      2|{
47636|      2|    char str[RE_FLAG_COUNT], *p = str;
47637|      2|    int res, i;
47638|      2|    static const int flag_atom[RE_FLAG_COUNT] = {
47639|      2|        JS_ATOM_hasIndices,
47640|      2|        JS_ATOM_global,
47641|      2|        JS_ATOM_ignoreCase,
47642|      2|        JS_ATOM_multiline,
47643|      2|        JS_ATOM_dotAll,
47644|      2|        JS_ATOM_unicode,
47645|      2|        JS_ATOM_unicodeSets,
47646|      2|        JS_ATOM_sticky,
47647|      2|    };
47648|      2|    static const char flag_char[RE_FLAG_COUNT] = { 'd', 'g', 'i', 'm', 's', 'u', 'v', 'y' };
47649|       |    
47650|      2|    if (JS_VALUE_GET_TAG(this_val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (47650:9): [True: 0, False: 2]
  ------------------
47651|      0|        return JS_ThrowTypeErrorNotAnObject(ctx);
47652|       |
47653|     18|    for(i = 0; i < RE_FLAG_COUNT; i++) {
  ------------------
  |  |47632|     18|#define RE_FLAG_COUNT 8
  ------------------
  |  Branch (47653:16): [True: 16, False: 2]
  ------------------
47654|     16|        res = JS_ToBoolFree(ctx, JS_GetProperty(ctx, this_val, flag_atom[i]));
47655|     16|        if (res < 0)
  ------------------
  |  Branch (47655:13): [True: 0, False: 16]
  ------------------
47656|      0|            goto exception;
47657|     16|        if (res)
  ------------------
  |  Branch (47657:13): [True: 2, False: 14]
  ------------------
47658|      2|            *p++ = flag_char[i];
47659|     16|    }
47660|      2|    return JS_NewStringLen(ctx, str, p - str);
47661|       |
47662|      0|exception:
47663|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47664|      2|}
quickjs.c:js_regexp_get_flag:
47613|     16|{
47614|     16|    JSRegExp *re;
47615|     16|    int flags;
47616|       |
47617|     16|    if (JS_VALUE_GET_TAG(this_val) != JS_TAG_OBJECT)
  ------------------
  |  |  236|     16|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (47617:9): [True: 0, False: 16]
  ------------------
47618|      0|        return JS_ThrowTypeErrorNotAnObject(ctx);
47619|       |
47620|     16|    re = js_get_regexp(ctx, this_val, FALSE);
47621|     16|    if (!re) {
  ------------------
  |  Branch (47621:9): [True: 0, False: 16]
  ------------------
47622|      0|        if (js_same_value(ctx, this_val, ctx->class_proto[JS_CLASS_REGEXP]))
  ------------------
  |  Branch (47622:13): [True: 0, False: 0]
  ------------------
47623|      0|            return JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47624|      0|        else
47625|      0|            return JS_ThrowTypeErrorInvalidClass(ctx, JS_CLASS_REGEXP);
47626|      0|    }
47627|       |
47628|     16|    flags = lre_get_flags(re->bytecode->u.str8);
47629|     16|    return JS_NewBool(ctx, flags & mask);
47630|     16|}
quickjs.c:js_regexp_exec:
47801|  1.00M|{
47802|  1.00M|    JSRegExp *re = js_get_regexp(ctx, this_val, TRUE);
47803|  1.00M|    JSString *str;
47804|  1.00M|    JSValue t, ret, str_val, obj, groups;
47805|  1.00M|    JSValue indices, indices_groups;
47806|  1.00M|    uint8_t *re_bytecode;
47807|  1.00M|    uint8_t **capture, *str_buf;
47808|  1.00M|    int rc, capture_count, shift, i, re_flags, alloc_count;
47809|  1.00M|    int64_t last_index;
47810|  1.00M|    const char *group_name_ptr;
47811|  1.00M|    JSObject *p_obj;
47812|  1.00M|    JSAtom group_name;
47813|       |    
47814|  1.00M|    if (!re)
  ------------------
  |  Branch (47814:9): [True: 0, False: 1.00M]
  ------------------
47815|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47816|       |
47817|  1.00M|    str_val = JS_ToString(ctx, argv[0]);
47818|  1.00M|    if (JS_IsException(str_val))
  ------------------
  |  Branch (47818:9): [True: 0, False: 1.00M]
  ------------------
47819|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47820|       |
47821|  1.00M|    ret = JS_EXCEPTION;
  ------------------
  |  |  292|  1.00M|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|  1.00M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47822|  1.00M|    obj = JS_NULL;
  ------------------
  |  |  288|  1.00M|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|  1.00M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47823|  1.00M|    groups = JS_UNDEFINED;
  ------------------
  |  |  289|  1.00M|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|  1.00M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47824|  1.00M|    indices = JS_UNDEFINED;
  ------------------
  |  |  289|  1.00M|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|  1.00M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47825|  1.00M|    indices_groups = JS_UNDEFINED;
  ------------------
  |  |  289|  1.00M|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|  1.00M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47826|  1.00M|    capture = NULL;
47827|  1.00M|    group_name = JS_ATOM_NULL;
  ------------------
  |  |  449|  1.00M|#define JS_ATOM_NULL 0
  ------------------
47828|       |    
47829|  1.00M|    if (js_regexp_get_lastIndex(ctx, &last_index, this_val))
  ------------------
  |  Branch (47829:9): [True: 0, False: 1.00M]
  ------------------
47830|      0|        goto fail;
47831|       |
47832|  1.00M|    re_bytecode = re->bytecode->u.str8;
47833|  1.00M|    re_flags = lre_get_flags(re_bytecode);
47834|  1.00M|    if ((re_flags & (LRE_FLAG_GLOBAL | LRE_FLAG_STICKY)) == 0) {
  ------------------
  |  |   30|  1.00M|#define LRE_FLAG_GLOBAL     (1 << 0)
  ------------------
                  if ((re_flags & (LRE_FLAG_GLOBAL | LRE_FLAG_STICKY)) == 0) {
  ------------------
  |  |   35|  1.00M|#define LRE_FLAG_STICKY     (1 << 5)
  ------------------
  |  Branch (47834:9): [True: 0, False: 1.00M]
  ------------------
47835|      0|        last_index = 0;
47836|      0|    }
47837|  1.00M|    str = JS_VALUE_GET_STRING(str_val);
  ------------------
  |  |  228|  1.00M|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.00M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47838|  1.00M|    alloc_count = lre_get_alloc_count(re_bytecode);
47839|  1.00M|    if (alloc_count > 0) {
  ------------------
  |  Branch (47839:9): [True: 1.00M, False: 0]
  ------------------
47840|  1.00M|        capture = js_malloc(ctx, sizeof(capture[0]) * alloc_count);
47841|  1.00M|        if (!capture)
  ------------------
  |  Branch (47841:13): [True: 0, False: 1.00M]
  ------------------
47842|      0|            goto fail;
47843|  1.00M|    }
47844|  1.00M|    capture_count = lre_get_capture_count(re_bytecode);
47845|  1.00M|    shift = str->is_wide_char;
47846|  1.00M|    str_buf = str->u.str8;
47847|  1.00M|    if (last_index > str->len) {
  ------------------
  |  Branch (47847:9): [True: 0, False: 1.00M]
  ------------------
47848|      0|        rc = 2;
47849|  1.00M|    } else {
47850|  1.00M|        rc = lre_exec(capture, re_bytecode,
47851|  1.00M|                      str_buf, last_index, str->len,
47852|  1.00M|                      shift, ctx);
47853|  1.00M|    }
47854|  1.00M|    if (rc != 1) {
  ------------------
  |  Branch (47854:9): [True: 1.00M, False: 4]
  ------------------
47855|  1.00M|        if (rc >= 0) {
  ------------------
  |  Branch (47855:13): [True: 1.00M, False: 0]
  ------------------
47856|  1.00M|            if (rc == 2 || (re_flags & (LRE_FLAG_GLOBAL | LRE_FLAG_STICKY))) {
  ------------------
  |  |   30|  1.00M|#define LRE_FLAG_GLOBAL     (1 << 0)
  ------------------
                          if (rc == 2 || (re_flags & (LRE_FLAG_GLOBAL | LRE_FLAG_STICKY))) {
  ------------------
  |  |   35|  1.00M|#define LRE_FLAG_STICKY     (1 << 5)
  ------------------
  |  Branch (47856:17): [True: 0, False: 1.00M]
  |  Branch (47856:28): [True: 1.00M, False: 0]
  ------------------
47857|  1.00M|                if (js_regexp_set_lastIndex(ctx, this_val, 0) < 0)
  ------------------
  |  Branch (47857:21): [True: 0, False: 1.00M]
  ------------------
47858|      0|                    goto fail;
47859|  1.00M|            }
47860|  1.00M|        } else {
47861|      0|            if (rc == LRE_RET_TIMEOUT) {
  ------------------
  |  |   41|      0|#define LRE_RET_TIMEOUT      (-2)
  ------------------
  |  Branch (47861:17): [True: 0, False: 0]
  ------------------
47862|      0|                JS_ThrowInterrupted(ctx);
47863|      0|            } else {
47864|      0|                JS_ThrowInternalError(ctx, "out of memory in regexp execution");
47865|      0|            }
47866|      0|            goto fail;
47867|      0|        }
47868|  1.00M|    } else {
47869|      4|        int prop_flags;
47870|      4|        JSProperty props[4];
47871|       |        
47872|      4|        if (re_flags & (LRE_FLAG_GLOBAL | LRE_FLAG_STICKY)) {
  ------------------
  |  |   30|      4|#define LRE_FLAG_GLOBAL     (1 << 0)
  ------------------
                      if (re_flags & (LRE_FLAG_GLOBAL | LRE_FLAG_STICKY)) {
  ------------------
  |  |   35|      4|#define LRE_FLAG_STICKY     (1 << 5)
  ------------------
  |  Branch (47872:13): [True: 4, False: 0]
  ------------------
47873|      4|            if (js_regexp_set_lastIndex(ctx, this_val,
  ------------------
  |  Branch (47873:17): [True: 0, False: 4]
  ------------------
47874|      4|                                        (capture[1] - str_buf) >> shift) < 0)
47875|      0|                goto fail;
47876|      4|        }
47877|      4|        prop_flags = JS_PROP_C_W_E | JS_PROP_THROW;
  ------------------
  |  |  299|      4|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|      4|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|      4|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      4|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                      prop_flags = JS_PROP_C_W_E | JS_PROP_THROW;
  ------------------
  |  |  318|      4|#define JS_PROP_THROW            (1 << 14)
  ------------------
47878|      4|        group_name_ptr = lre_get_groupnames(re_bytecode);
47879|      4|        if (group_name_ptr) {
  ------------------
  |  Branch (47879:13): [True: 0, False: 4]
  ------------------
47880|      0|            groups = JS_NewObjectProto(ctx, JS_NULL);
  ------------------
  |  |  288|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47881|      0|            if (JS_IsException(groups))
  ------------------
  |  Branch (47881:17): [True: 0, False: 0]
  ------------------
47882|      0|                goto fail;
47883|      0|        }
47884|      4|        if (re_flags & LRE_FLAG_INDICES) {
  ------------------
  |  |   36|      4|#define LRE_FLAG_INDICES    (1 << 6) /* Unused by libregexp, just recorded. */
  ------------------
  |  Branch (47884:13): [True: 0, False: 4]
  ------------------
47885|      0|            indices = JS_NewArray(ctx);
47886|      0|            if (JS_IsException(indices))
  ------------------
  |  Branch (47886:17): [True: 0, False: 0]
  ------------------
47887|      0|                goto fail;
47888|      0|            if (group_name_ptr) {
  ------------------
  |  Branch (47888:17): [True: 0, False: 0]
  ------------------
47889|      0|                indices_groups = JS_NewObjectProto(ctx, JS_NULL);
  ------------------
  |  |  288|      0|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47890|      0|                if (JS_IsException(indices_groups))
  ------------------
  |  Branch (47890:21): [True: 0, False: 0]
  ------------------
47891|      0|                    goto fail;
47892|      0|            }
47893|      0|        }
47894|       |
47895|      4|        props[0].u.value = JS_NewInt32(ctx, capture_count); /* length */
47896|      4|        props[1].u.value = JS_NewInt32(ctx, (capture[0] - str_buf) >> shift); /* index */
47897|      4|        props[2].u.value = str_val; /* input */
47898|      4|        props[3].u.value = JS_DupValue(ctx, groups); /* groups */
47899|       |
47900|      4|        str_val = JS_UNDEFINED;
  ------------------
  |  |  289|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47901|      4|        obj = JS_NewObjectFromShape(ctx, js_dup_shape(ctx->regexp_result_shape),
47902|      4|                                    JS_CLASS_ARRAY, props);
47903|      4|        if (JS_IsException(obj))
  ------------------
  |  Branch (47903:13): [True: 0, False: 4]
  ------------------
47904|      0|            goto fail;
47905|       |
47906|      4|        p_obj = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|      4|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      4|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47907|      4|        if (expand_fast_array(ctx, p_obj, capture_count))
  ------------------
  |  Branch (47907:13): [True: 0, False: 4]
  ------------------
47908|      0|            goto fail;
47909|       |        
47910|      8|        for(i = 0; i < capture_count; i++) {
  ------------------
  |  Branch (47910:20): [True: 4, False: 4]
  ------------------
47911|      4|            uint8_t **match = &capture[2 * i];
47912|      4|            int start = -1;
47913|      4|            int end = -1;
47914|      4|            JSValue val;
47915|       |
47916|      4|            if (group_name_ptr && i > 0) {
  ------------------
  |  Branch (47916:17): [True: 0, False: 4]
  |  Branch (47916:35): [True: 0, False: 0]
  ------------------
47917|      0|                if (*group_name_ptr) {
  ------------------
  |  Branch (47917:21): [True: 0, False: 0]
  ------------------
47918|       |                    /* XXX: slow, should create a shape when the regexp is
47919|       |                       compiled */
47920|      0|                    group_name = JS_NewAtom(ctx, group_name_ptr);
47921|      0|                    if (group_name == JS_ATOM_NULL)
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (47921:25): [True: 0, False: 0]
  ------------------
47922|      0|                        goto fail;
47923|      0|                }
47924|      0|                group_name_ptr += strlen(group_name_ptr) + LRE_GROUP_NAME_TRAILER_LEN;
  ------------------
  |  |   44|      0|#define LRE_GROUP_NAME_TRAILER_LEN 2 
  ------------------
47925|      0|            }
47926|       |
47927|      4|            if (match[0] && match[1]) {
  ------------------
  |  Branch (47927:17): [True: 4, False: 0]
  |  Branch (47927:29): [True: 4, False: 0]
  ------------------
47928|      4|                start = (match[0] - str_buf) >> shift;
47929|      4|                end = (match[1] - str_buf) >> shift;
47930|      4|            }
47931|       |
47932|      4|            if (!JS_IsUndefined(indices)) {
  ------------------
  |  Branch (47932:17): [True: 0, False: 4]
  ------------------
47933|      0|                val = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47934|      0|                if (start != -1) {
  ------------------
  |  Branch (47934:21): [True: 0, False: 0]
  ------------------
47935|      0|                    val = JS_NewArray(ctx);
47936|      0|                    if (JS_IsException(val))
  ------------------
  |  Branch (47936:25): [True: 0, False: 0]
  ------------------
47937|      0|                        goto fail;
47938|      0|                    if (JS_DefinePropertyValueUint32(ctx, val, 0,
  ------------------
  |  Branch (47938:25): [True: 0, False: 0]
  ------------------
47939|      0|                                                     JS_NewInt32(ctx, start),
47940|      0|                                                     prop_flags) < 0) {
47941|      0|                        JS_FreeValue(ctx, val);
47942|      0|                        goto fail;
47943|      0|                    }
47944|      0|                    if (JS_DefinePropertyValueUint32(ctx, val, 1,
  ------------------
  |  Branch (47944:25): [True: 0, False: 0]
  ------------------
47945|      0|                                                     JS_NewInt32(ctx, end),
47946|      0|                                                     prop_flags) < 0) {
47947|      0|                        JS_FreeValue(ctx, val);
47948|      0|                        goto fail;
47949|      0|                    }
47950|      0|                }
47951|      0|                if (group_name != JS_ATOM_NULL) {
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (47951:21): [True: 0, False: 0]
  ------------------
47952|       |                    /* JS_HasProperty() cannot fail here */
47953|      0|                    if (!JS_IsUndefined(val) ||
  ------------------
  |  Branch (47953:25): [True: 0, False: 0]
  ------------------
47954|      0|                        !JS_HasProperty(ctx, indices_groups, group_name)) {
  ------------------
  |  Branch (47954:25): [True: 0, False: 0]
  ------------------
47955|      0|                        if (JS_DefinePropertyValue(ctx, indices_groups,
  ------------------
  |  Branch (47955:29): [True: 0, False: 0]
  ------------------
47956|      0|                                                   group_name, JS_DupValue(ctx, val), prop_flags) < 0) {
47957|      0|                            JS_FreeValue(ctx, val);
47958|      0|                            goto fail;
47959|      0|                        }
47960|      0|                    }
47961|      0|                }
47962|      0|                if (JS_DefinePropertyValueUint32(ctx, indices, i, val,
  ------------------
  |  Branch (47962:21): [True: 0, False: 0]
  ------------------
47963|      0|                                                 prop_flags) < 0) {
47964|      0|                    goto fail;
47965|      0|                }
47966|      0|            }
47967|       |
47968|      4|            val = JS_UNDEFINED;
  ------------------
  |  |  289|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47969|      4|            if (start != -1) {
  ------------------
  |  Branch (47969:17): [True: 4, False: 0]
  ------------------
47970|      4|                val = js_sub_string(ctx, str, start, end);
47971|      4|                if (JS_IsException(val))
  ------------------
  |  Branch (47971:21): [True: 0, False: 4]
  ------------------
47972|      0|                    goto fail;
47973|      4|            }
47974|       |
47975|      4|            if (group_name != JS_ATOM_NULL) {
  ------------------
  |  |  449|      4|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (47975:17): [True: 0, False: 4]
  ------------------
47976|       |                /* JS_HasProperty() cannot fail here */
47977|      0|                if (!JS_IsUndefined(val) ||
  ------------------
  |  Branch (47977:21): [True: 0, False: 0]
  ------------------
47978|      0|                    !JS_HasProperty(ctx, groups, group_name)) {
  ------------------
  |  Branch (47978:21): [True: 0, False: 0]
  ------------------
47979|      0|                    if (JS_DefinePropertyValue(ctx, groups, group_name,
  ------------------
  |  Branch (47979:25): [True: 0, False: 0]
  ------------------
47980|      0|                                               JS_DupValue(ctx, val),
47981|      0|                                               prop_flags) < 0) {
47982|      0|                        JS_FreeValue(ctx, val);
47983|      0|                        goto fail;
47984|      0|                    }
47985|      0|                }
47986|      0|                JS_FreeAtom(ctx, group_name);
47987|      0|                group_name = JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
47988|      0|            }
47989|      4|            p_obj->u.array.u.values[p_obj->u.array.count++] = val;
47990|      4|        }
47991|       |
47992|      4|        if (!JS_IsUndefined(indices)) {
  ------------------
  |  Branch (47992:13): [True: 0, False: 4]
  ------------------
47993|      0|            t = indices_groups, indices_groups = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47994|      0|            if (JS_DefinePropertyValue(ctx, indices, JS_ATOM_groups,
  ------------------
  |  Branch (47994:17): [True: 0, False: 0]
  ------------------
47995|      0|                                       t, prop_flags) < 0) {
47996|      0|                goto fail;
47997|      0|            }
47998|      0|            t = indices, indices = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
47999|      0|            if (JS_DefinePropertyValue(ctx, obj, JS_ATOM_indices,
  ------------------
  |  Branch (47999:17): [True: 0, False: 0]
  ------------------
48000|      0|                                       t, prop_flags) < 0) {
48001|      0|                goto fail;
48002|      0|            }
48003|      0|        }
48004|      4|    }
48005|  1.00M|    ret = obj;
48006|  1.00M|    obj = JS_UNDEFINED;
  ------------------
  |  |  289|  1.00M|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|  1.00M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
48007|  1.00M|fail:
48008|  1.00M|    JS_FreeAtom(ctx, group_name);
48009|  1.00M|    JS_FreeValue(ctx, indices_groups);
48010|  1.00M|    JS_FreeValue(ctx, indices);
48011|  1.00M|    JS_FreeValue(ctx, str_val);
48012|  1.00M|    JS_FreeValue(ctx, groups);
48013|  1.00M|    JS_FreeValue(ctx, obj);
48014|  1.00M|    js_free(ctx, capture);
48015|  1.00M|    return ret;
48016|  1.00M|}
quickjs.c:js_regexp_get_lastIndex:
47769|  1.00M|{
47770|  1.00M|    JSObject *p = JS_VALUE_GET_OBJ(this_val);
  ------------------
  |  |  227|  1.00M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.00M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47771|       |    
47772|       |    /* lastIndex is always the first property (it is not configurable) */
47773|  1.00M|    if (likely(JS_VALUE_GET_TAG(p->prop[0].u.value) == JS_TAG_INT)) {
  ------------------
  |  |   32|  1.00M|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 1.00M, False: 0]
  |  |  ------------------
  ------------------
47774|  1.00M|        *plast_index = max_int(JS_VALUE_GET_INT(p->prop[0].u.value), 0);
  ------------------
  |  |  239|  1.00M|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
47775|  1.00M|        return 0;
47776|  1.00M|    } else {
47777|      0|        return JS_ToLengthFree(ctx, plast_index, JS_DupValue(ctx, p->prop[0].u.value));
47778|      0|    }
47779|  1.00M|}
quickjs.c:JS_ToLengthFree:
13502|     15|{
13503|     15|    int res = JS_ToInt64Clamp(ctx, plen, val, 0, MAX_SAFE_INTEGER, 0);
  ------------------
  |  |13476|     15|#define MAX_SAFE_INTEGER (((int64_t)1 << 53) - 1)
  ------------------
13504|     15|    JS_FreeValue(ctx, val);
13505|     15|    return res;
13506|     15|}
quickjs.c:js_regexp_set_lastIndex:
47784|  1.00M|{
47785|  1.00M|    JSObject *p = JS_VALUE_GET_OBJ(this_val);
  ------------------
  |  |  227|  1.00M|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|  1.00M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
47786|       |    
47787|       |    /* lastIndex is always the first property (it is not configurable) */
47788|  1.00M|    if (likely(JS_VALUE_GET_TAG(p->prop[0].u.value) == JS_TAG_INT &&
  ------------------
  |  |   32|  2.01M|#define likely(x)       __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (32:25): [True: 1.00M, False: 0]
  |  |  |  Branch (32:45): [True: 1.00M, False: 0]
  |  |  |  Branch (32:45): [True: 1.00M, False: 0]
  |  |  ------------------
  ------------------
47789|  1.00M|               (get_shape_prop(p->shape)->flags & JS_PROP_WRITABLE))) {
47790|  1.00M|        set_value(ctx, &p->prop[0].u.value, JS_NewInt32(ctx, last_index));
47791|  1.00M|    } else {
47792|      0|        if (JS_SetProperty(ctx, this_val, JS_ATOM_lastIndex,
  ------------------
  |  Branch (47792:13): [True: 0, False: 0]
  ------------------
47793|      0|                           JS_NewInt32(ctx, last_index)) < 0)
47794|      0|            return -1;
47795|      0|    }
47796|  1.00M|    return 0;
47797|  1.00M|}
quickjs.c:JS_RegExpExec:
48136|  1.00M|{
48137|  1.00M|    JSValue method, ret;
48138|       |
48139|  1.00M|    method = JS_GetProperty(ctx, r, JS_ATOM_exec);
48140|  1.00M|    if (JS_IsException(method))
  ------------------
  |  Branch (48140:9): [True: 0, False: 1.00M]
  ------------------
48141|      0|        return method;
48142|  1.00M|    if (JS_IsFunction(ctx, method)) {
  ------------------
  |  Branch (48142:9): [True: 1.00M, False: 0]
  ------------------
48143|  1.00M|        ret = JS_CallFree(ctx, method, r, 1, &s);
48144|  1.00M|        if (JS_IsException(ret))
  ------------------
  |  Branch (48144:13): [True: 1, False: 1.00M]
  ------------------
48145|      1|            return ret;
48146|  1.00M|        if (!JS_IsObject(ret) && !JS_IsNull(ret)) {
  ------------------
  |  Branch (48146:13): [True: 1.00M, False: 4]
  |  Branch (48146:34): [True: 0, False: 1.00M]
  ------------------
48147|      0|            JS_FreeValue(ctx, ret);
48148|      0|            return JS_ThrowTypeError(ctx, "RegExp exec method must return an object or null");
48149|      0|        }
48150|  1.00M|        return ret;
48151|  1.00M|    }
48152|      0|    JS_FreeValue(ctx, method);
48153|      0|    return js_regexp_exec(ctx, r, 1, &s);
48154|  1.00M|}
quickjs.c:string_buffer_concat_value_free:
 4281|   343k|{
 4282|   343k|    JSString *p;
 4283|   343k|    int res;
 4284|       |
 4285|   343k|    if (s->error_status) {
  ------------------
  |  Branch (4285:9): [True: 0, False: 343k]
  ------------------
 4286|       |        /* prevent exception overload */
 4287|      0|        JS_FreeValue(s->ctx, v);
 4288|      0|        return -1;
 4289|      0|    }
 4290|   343k|    if (unlikely(JS_VALUE_GET_TAG(v) != JS_TAG_STRING)) {
  ------------------
  |  |   33|   343k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 343k]
  |  |  ------------------
  ------------------
 4291|      0|        v = JS_ToStringFree(s->ctx, v);
 4292|      0|        if (JS_IsException(v))
  ------------------
  |  Branch (4292:13): [True: 0, False: 0]
  ------------------
 4293|      0|            return string_buffer_set_error(s);
 4294|      0|    }
 4295|   343k|    p = JS_VALUE_GET_STRING(v);
  ------------------
  |  |  228|   343k|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|   343k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 4296|   343k|    res = string_buffer_concat(s, p, 0, p->len);
 4297|   343k|    JS_FreeValue(s->ctx, v);
 4298|   343k|    return res;
 4299|   343k|}
quickjs.c:string_indexof_char:
45245|   421k|{
45246|       |    /* assuming 0 <= from <= p->len */
45247|   421k|    int i, len = p->len;
45248|   421k|    if (p->is_wide_char) {
  ------------------
  |  Branch (45248:9): [True: 421k, False: 4]
  ------------------
45249|  1.61M|        for (i = from; i < len; i++) {
  ------------------
  |  Branch (45249:24): [True: 1.61M, False: 2]
  ------------------
45250|  1.61M|            if (p->u.str16[i] == c)
  ------------------
  |  Branch (45250:17): [True: 421k, False: 1.19M]
  ------------------
45251|   421k|                return i;
45252|  1.61M|        }
45253|   421k|    } else {
45254|      4|        if ((c & ~0xff) == 0) {
  ------------------
  |  Branch (45254:13): [True: 4, False: 0]
  ------------------
45255|      6|            for (i = from; i < len; i++) {
  ------------------
  |  Branch (45255:28): [True: 4, False: 2]
  ------------------
45256|      4|                if (p->u.str8[i] == (uint8_t)c)
  ------------------
  |  Branch (45256:21): [True: 2, False: 2]
  ------------------
45257|      2|                    return i;
45258|      4|            }
45259|      4|        }
45260|      4|    }
45261|      4|    return -1;
45262|   421k|}
quickjs.c:string_advance_index:
45281|  1.00M|{
45282|  1.00M|    if (!unicode || index >= p->len || !p->is_wide_char) {
  ------------------
  |  Branch (45282:9): [True: 0, False: 1.00M]
  |  Branch (45282:21): [True: 0, False: 1.00M]
  |  Branch (45282:40): [True: 0, False: 1.00M]
  ------------------
45283|      0|        index++;
45284|  1.00M|    } else {
45285|  1.00M|        int index32 = (int)index;
45286|  1.00M|        string_getc(p, &index32);
45287|  1.00M|        index = index32;
45288|  1.00M|    }
45289|  1.00M|    return index;
45290|  1.00M|}
quickjs.c:js_regexp_Symbol_split:
48795|      2|{
48796|       |    // [Symbol.split](str, limit)
48797|      2|    JSValueConst rx = this_val;
  ------------------
  |  |  234|      2|#define JSValueConst JSValue
  ------------------
48798|      2|    JSValueConst args[2];
  ------------------
  |  |  234|      2|#define JSValueConst JSValue
  ------------------
48799|      2|    JSValue str, ctor, splitter, A, flags, z, sub;
48800|      2|    JSString *strp;
48801|      2|    uint32_t lim, size, p, q;
48802|      2|    int unicodeMatching;
48803|      2|    int64_t lengthA, e, numberOfCaptures, i;
48804|       |
48805|      2|    if (!JS_IsObject(rx))
  ------------------
  |  Branch (48805:9): [True: 0, False: 2]
  ------------------
48806|      0|        return JS_ThrowTypeErrorNotAnObject(ctx);
48807|       |
48808|      2|    ctor = JS_UNDEFINED;
  ------------------
  |  |  289|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
48809|      2|    splitter = JS_UNDEFINED;
  ------------------
  |  |  289|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
48810|      2|    A = JS_UNDEFINED;
  ------------------
  |  |  289|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
48811|      2|    flags = JS_UNDEFINED;
  ------------------
  |  |  289|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
48812|      2|    z = JS_UNDEFINED;
  ------------------
  |  |  289|      2|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
48813|      2|    str = JS_ToString(ctx, argv[0]);
48814|      2|    if (JS_IsException(str))
  ------------------
  |  Branch (48814:9): [True: 0, False: 2]
  ------------------
48815|      0|        goto exception;
48816|      2|    ctor = JS_SpeciesConstructor(ctx, rx, ctx->regexp_ctor);
48817|      2|    if (JS_IsException(ctor))
  ------------------
  |  Branch (48817:9): [True: 0, False: 2]
  ------------------
48818|      0|        goto exception;
48819|      2|    flags = JS_ToStringFree(ctx, JS_GetProperty(ctx, rx, JS_ATOM_flags));
48820|      2|    if (JS_IsException(flags))
  ------------------
  |  Branch (48820:9): [True: 0, False: 2]
  ------------------
48821|      0|        goto exception;
48822|      2|    strp = JS_VALUE_GET_STRING(flags);
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
48823|      2|    unicodeMatching = (string_indexof_char(strp, 'u', 0) >= 0 ||
  ------------------
  |  Branch (48823:24): [True: 2, False: 0]
  ------------------
48824|      0|                       string_indexof_char(strp, 'v', 0) >= 0);
  ------------------
  |  Branch (48824:24): [True: 0, False: 0]
  ------------------
48825|      2|    if (string_indexof_char(strp, 'y', 0) < 0) {
  ------------------
  |  Branch (48825:9): [True: 2, False: 0]
  ------------------
48826|      2|        flags = JS_ConcatString3(ctx, "", flags, "y");
48827|      2|        if (JS_IsException(flags))
  ------------------
  |  Branch (48827:13): [True: 0, False: 2]
  ------------------
48828|      0|            goto exception;
48829|      2|    }
48830|      2|    args[0] = rx;
48831|      2|    args[1] = flags;
48832|      2|    splitter = JS_CallConstructor(ctx, ctor, 2, args);
48833|      2|    if (JS_IsException(splitter))
  ------------------
  |  Branch (48833:9): [True: 0, False: 2]
  ------------------
48834|      0|        goto exception;
48835|      2|    A = JS_NewArray(ctx);
48836|      2|    if (JS_IsException(A))
  ------------------
  |  Branch (48836:9): [True: 0, False: 2]
  ------------------
48837|      0|        goto exception;
48838|      2|    lengthA = 0;
48839|      2|    if (JS_IsUndefined(argv[1])) {
  ------------------
  |  Branch (48839:9): [True: 2, False: 0]
  ------------------
48840|      2|        lim = 0xffffffff;
48841|      2|    } else {
48842|      0|        if (JS_ToUint32(ctx, &lim, argv[1]) < 0)
  ------------------
  |  Branch (48842:13): [True: 0, False: 0]
  ------------------
48843|      0|            goto exception;
48844|      0|        if (lim == 0)
  ------------------
  |  Branch (48844:13): [True: 0, False: 0]
  ------------------
48845|      0|            goto done;
48846|      0|    }
48847|      2|    strp = JS_VALUE_GET_STRING(str);
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
48848|      2|    p = q = 0;
48849|      2|    size = strp->len;
48850|      2|    if (size == 0) {
  ------------------
  |  Branch (48850:9): [True: 0, False: 2]
  ------------------
48851|      0|        z = JS_RegExpExec(ctx, splitter, str);
48852|      0|        if (JS_IsException(z))
  ------------------
  |  Branch (48852:13): [True: 0, False: 0]
  ------------------
48853|      0|            goto exception;
48854|      0|        if (JS_IsNull(z))
  ------------------
  |  Branch (48854:13): [True: 0, False: 0]
  ------------------
48855|      0|            goto add_tail;
48856|      0|        goto done;
48857|      0|    }
48858|  1.00M|    while (q < size) {
  ------------------
  |  Branch (48858:12): [True: 1.00M, False: 1]
  ------------------
48859|  1.00M|        if (JS_SetProperty(ctx, splitter, JS_ATOM_lastIndex, JS_NewInt32(ctx, q)) < 0)
  ------------------
  |  Branch (48859:13): [True: 0, False: 1.00M]
  ------------------
48860|      0|            goto exception;
48861|  1.00M|        JS_FreeValue(ctx, z);
48862|  1.00M|        z = JS_RegExpExec(ctx, splitter, str);
48863|  1.00M|        if (JS_IsException(z))
  ------------------
  |  Branch (48863:13): [True: 1, False: 1.00M]
  ------------------
48864|      1|            goto exception;
48865|  1.00M|        if (JS_IsNull(z)) {
  ------------------
  |  Branch (48865:13): [True: 1.00M, False: 4]
  ------------------
48866|  1.00M|            q = string_advance_index(strp, q, unicodeMatching);
48867|  1.00M|        } else {
48868|      4|            if (JS_ToLengthFree(ctx, &e, JS_GetProperty(ctx, splitter, JS_ATOM_lastIndex)))
  ------------------
  |  Branch (48868:17): [True: 0, False: 4]
  ------------------
48869|      0|                goto exception;
48870|      4|            if (e > size)
  ------------------
  |  Branch (48870:17): [True: 0, False: 4]
  ------------------
48871|      0|                e = size;
48872|      4|            if (e == p) {
  ------------------
  |  Branch (48872:17): [True: 0, False: 4]
  ------------------
48873|      0|                q = string_advance_index(strp, q, unicodeMatching);
48874|      4|            } else {
48875|      4|                sub = js_sub_string(ctx, strp, p, q);
48876|      4|                if (JS_IsException(sub))
  ------------------
  |  Branch (48876:21): [True: 0, False: 4]
  ------------------
48877|      0|                    goto exception;
48878|      4|                if (JS_DefinePropertyValueInt64(ctx, A, lengthA++, sub,
  ------------------
  |  Branch (48878:21): [True: 0, False: 4]
  ------------------
48879|      4|                                                JS_PROP_C_W_E | JS_PROP_THROW) < 0)
  ------------------
  |  |  299|      4|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|      4|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|      4|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      4|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                                                              JS_PROP_C_W_E | JS_PROP_THROW) < 0)
  ------------------
  |  |  318|      4|#define JS_PROP_THROW            (1 << 14)
  ------------------
48880|      0|                    goto exception;
48881|      4|                if (lengthA == lim)
  ------------------
  |  Branch (48881:21): [True: 0, False: 4]
  ------------------
48882|      0|                    goto done;
48883|      4|                p = e;
48884|      4|                if (js_get_length64(ctx, &numberOfCaptures, z))
  ------------------
  |  Branch (48884:21): [True: 0, False: 4]
  ------------------
48885|      0|                    goto exception;
48886|      4|                for(i = 1; i < numberOfCaptures; i++) {
  ------------------
  |  Branch (48886:28): [True: 0, False: 4]
  ------------------
48887|      0|                    sub = JS_GetPropertyInt64(ctx, z, i);
48888|      0|                    if (JS_IsException(sub))
  ------------------
  |  Branch (48888:25): [True: 0, False: 0]
  ------------------
48889|      0|                        goto exception;
48890|      0|                    if (JS_DefinePropertyValueInt64(ctx, A, lengthA++, sub, JS_PROP_C_W_E | JS_PROP_THROW) < 0)
  ------------------
  |  |  299|      0|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|      0|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|      0|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      0|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                                  if (JS_DefinePropertyValueInt64(ctx, A, lengthA++, sub, JS_PROP_C_W_E | JS_PROP_THROW) < 0)
  ------------------
  |  |  318|      0|#define JS_PROP_THROW            (1 << 14)
  ------------------
  |  Branch (48890:25): [True: 0, False: 0]
  ------------------
48891|      0|                        goto exception;
48892|      0|                    if (lengthA == lim)
  ------------------
  |  Branch (48892:25): [True: 0, False: 0]
  ------------------
48893|      0|                        goto done;
48894|      0|                }
48895|      4|                q = p;
48896|      4|            }
48897|      4|        }
48898|  1.00M|    }
48899|      1|add_tail:
48900|      1|    if (p > size)
  ------------------
  |  Branch (48900:9): [True: 0, False: 1]
  ------------------
48901|      0|        p = size;
48902|      1|    sub = js_sub_string(ctx, strp, p, size);
48903|      1|    if (JS_IsException(sub))
  ------------------
  |  Branch (48903:9): [True: 0, False: 1]
  ------------------
48904|      0|        goto exception;
48905|      1|    if (JS_DefinePropertyValueInt64(ctx, A, lengthA++, sub, JS_PROP_C_W_E | JS_PROP_THROW) < 0)
  ------------------
  |  |  299|      1|#define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  296|      1|#define JS_PROP_CONFIGURABLE  (1 << 0)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  297|      1|#define JS_PROP_WRITABLE      (1 << 1)
  |  |  ------------------
  |  |               #define JS_PROP_C_W_E         (JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE | JS_PROP_ENUMERABLE)
  |  |  ------------------
  |  |  |  |  298|      1|#define JS_PROP_ENUMERABLE    (1 << 2)
  |  |  ------------------
  ------------------
                  if (JS_DefinePropertyValueInt64(ctx, A, lengthA++, sub, JS_PROP_C_W_E | JS_PROP_THROW) < 0)
  ------------------
  |  |  318|      1|#define JS_PROP_THROW            (1 << 14)
  ------------------
  |  Branch (48905:9): [True: 0, False: 1]
  ------------------
48906|      0|        goto exception;
48907|      1|    goto done;
48908|      1|exception:
48909|      1|    JS_FreeValue(ctx, A);
48910|      1|    A = JS_EXCEPTION;
  ------------------
  |  |  292|      1|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
48911|      2|done:
48912|      2|    JS_FreeValue(ctx, str);
48913|      2|    JS_FreeValue(ctx, ctor);
48914|      2|    JS_FreeValue(ctx, splitter);
48915|      2|    JS_FreeValue(ctx, flags);
48916|      2|    JS_FreeValue(ctx, z);
48917|      2|    return A;
48918|      1|}
quickjs.c:js_new_shape2:
 5231|  1.05k|{
 5232|  1.05k|    JSRuntime *rt = ctx->rt;
 5233|  1.05k|    JSShape *sh;
 5234|       |
 5235|       |    /* resize the shape hash table if necessary */
 5236|  1.05k|    if (2 * (rt->shape_hash_count + 1) > rt->shape_hash_size) {
  ------------------
  |  Branch (5236:9): [True: 17, False: 1.03k]
  ------------------
 5237|     17|        resize_shape_hash(rt, rt->shape_hash_bits + 1);
 5238|     17|    }
 5239|       |
 5240|  1.05k|    sh = js_new_shape_nohash(ctx, proto, hash_size, prop_size);
 5241|  1.05k|    if (!sh)
  ------------------
  |  Branch (5241:9): [True: 0, False: 1.05k]
  ------------------
 5242|      0|        return NULL;
 5243|       |    
 5244|       |    /* insert in the hash table */
 5245|  1.05k|    sh->hash = shape_initial_hash(proto);
 5246|  1.05k|    sh->is_hashed = TRUE;
 5247|  1.05k|    js_shape_hash_link(ctx->rt, sh);
 5248|  1.05k|    return sh;
 5249|  1.05k|}
quickjs.c:resize_shape_hash:
 5157|     17|{
 5158|     17|    int new_shape_hash_size, i;
 5159|     17|    uint32_t h;
 5160|     17|    JSShape **new_shape_hash, *sh, *sh_next;
 5161|       |
 5162|     17|    new_shape_hash_size = 1 << new_shape_hash_bits;
 5163|     17|    new_shape_hash = js_mallocz_rt(rt, sizeof(rt->shape_hash[0]) *
 5164|     17|                                   new_shape_hash_size);
 5165|     17|    if (!new_shape_hash)
  ------------------
  |  Branch (5165:9): [True: 0, False: 17]
  ------------------
 5166|      0|        return -1;
 5167|    337|    for(i = 0; i < rt->shape_hash_size; i++) {
  ------------------
  |  Branch (5167:16): [True: 320, False: 17]
  ------------------
 5168|    480|        for(sh = rt->shape_hash[i]; sh != NULL; sh = sh_next) {
  ------------------
  |  Branch (5168:37): [True: 160, False: 320]
  ------------------
 5169|    160|            sh_next = sh->shape_hash_next;
 5170|    160|            h = get_shape_hash(sh->hash, new_shape_hash_bits);
 5171|    160|            sh->shape_hash_next = new_shape_hash[h];
 5172|    160|            new_shape_hash[h] = sh;
 5173|    160|        }
 5174|    320|    }
 5175|     17|    js_free_rt(rt, rt->shape_hash);
 5176|     17|    rt->shape_hash_bits = new_shape_hash_bits;
 5177|     17|    rt->shape_hash_size = new_shape_hash_size;
 5178|     17|    rt->shape_hash = new_shape_hash;
 5179|     17|    return 0;
 5180|     17|}
quickjs.c:add_shape_property:
 5462|  14.5k|{
 5463|  14.5k|    JSRuntime *rt = ctx->rt;
 5464|  14.5k|    JSShape *sh = *psh;
 5465|  14.5k|    JSShapeProperty *pr, *prop;
 5466|  14.5k|    uint32_t hash_mask, new_shape_hash = 0;
 5467|  14.5k|    intptr_t h;
 5468|       |
 5469|       |    /* update the shape hash */
 5470|  14.5k|    if (sh->is_hashed) {
  ------------------
  |  Branch (5470:9): [True: 3.56k, False: 10.9k]
  ------------------
 5471|  3.56k|        js_shape_hash_unlink(rt, sh);
 5472|  3.56k|        new_shape_hash = shape_hash(shape_hash(sh->hash, atom), prop_flags);
 5473|  3.56k|    }
 5474|       |
 5475|  14.5k|    if (unlikely(sh->prop_count >= sh->prop_size)) {
  ------------------
  |  |   33|  14.5k|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 452, False: 14.0k]
  |  |  ------------------
  ------------------
 5476|    452|        if (resize_properties(ctx, psh, p, sh->prop_count + 1)) {
  ------------------
  |  Branch (5476:13): [True: 0, False: 452]
  ------------------
 5477|       |            /* in case of error, reinsert in the hash table.
 5478|       |               sh is still valid if resize_properties() failed */
 5479|      0|            if (sh->is_hashed)
  ------------------
  |  Branch (5479:17): [True: 0, False: 0]
  ------------------
 5480|      0|                js_shape_hash_link(rt, sh);
 5481|      0|            return -1;
 5482|      0|        }
 5483|    452|        sh = *psh;
 5484|    452|    }
 5485|  14.5k|    if (sh->is_hashed) {
  ------------------
  |  Branch (5485:9): [True: 3.56k, False: 10.9k]
  ------------------
 5486|  3.56k|        sh->hash = new_shape_hash;
 5487|  3.56k|        js_shape_hash_link(rt, sh);
 5488|  3.56k|    }
 5489|       |    /* Initialize the new shape property.
 5490|       |       The object property at p->prop[sh->prop_count] is uninitialized */
 5491|  14.5k|    prop = get_shape_prop(sh);
 5492|  14.5k|    pr = &prop[sh->prop_count++];
 5493|  14.5k|    pr->atom = JS_DupAtom(ctx, atom);
 5494|  14.5k|    pr->flags = prop_flags;
 5495|       |    /* add in hash table */
 5496|  14.5k|    hash_mask = sh->prop_hash_mask;
 5497|  14.5k|    h = atom & hash_mask;
 5498|  14.5k|    pr->hash_next = sh->hash_table[h];
 5499|  14.5k|    sh->hash_table[h] = sh->prop_count;
 5500|  14.5k|    return 0;
 5501|  14.5k|}
quickjs.c:js_parse_init:
36937|     28|{
36938|     28|    memset(s, 0, sizeof(*s));
36939|     28|    s->ctx = ctx;
36940|     28|    s->filename = filename;
36941|     28|    s->buf_start = s->buf_ptr = (const uint8_t *)input;
36942|     28|    s->buf_end = s->buf_ptr + input_len;
36943|     28|    s->token.val = ' ';
36944|     28|    s->token.ptr = s->buf_ptr;
36945|       |
36946|     28|    s->get_line_col_cache.ptr = s->buf_start;
36947|     28|    s->get_line_col_cache.buf_start = s->buf_start;
36948|     28|    s->get_line_col_cache.line_num = 0;
36949|     28|    s->get_line_col_cache.col_num = 0;
36950|     28|}
quickjs.c:js_parse_error_v:
22151|      2|{
22152|      2|    JSContext *ctx = s->ctx;
22153|      2|    int line_num, col_num;
22154|      2|    line_num = get_line_col(&col_num, s->buf_start, ptr - s->buf_start);
22155|      2|    JS_ThrowError2(ctx, JS_SYNTAX_ERROR, fmt, ap, FALSE);
22156|      2|    build_backtrace(ctx, ctx->rt->current_exception, s->filename,
22157|      2|                    line_num + 1, col_num + 1, 0);
22158|      2|    return -1;
22159|      2|}
quickjs.c:get_line_col:
22095|    136|{
22096|    136|    int line_num, col_num, c;
22097|    136|    size_t i;
22098|       |    
22099|    136|    line_num = 0;
22100|    136|    col_num = 0;
22101|  12.1M|    for(i = 0; i < len; i++) {
  ------------------
  |  Branch (22101:16): [True: 12.1M, False: 136]
  ------------------
22102|  12.1M|        c = buf[i];
22103|  12.1M|        if (c == '\n') {
  ------------------
  |  Branch (22103:13): [True: 3.65M, False: 8.53M]
  ------------------
22104|  3.65M|            line_num++;
22105|  3.65M|            col_num = 0;
22106|  8.53M|        } else if (c < 0x80 || c >= 0xc0) {
  ------------------
  |  Branch (22106:20): [True: 8.53M, False: 7.96k]
  |  Branch (22106:32): [True: 3.98k, False: 3.98k]
  ------------------
22107|  8.53M|            col_num++;
22108|  8.53M|        }
22109|  12.1M|    }
22110|    136|    *pcol_num = col_num;
22111|    136|    return line_num;
22112|    136|}
quickjs.c:ident_realloc:
22527|     46|{
22528|     46|    char *buf, *new_buf;
22529|     46|    size_t size, new_size;
22530|       |
22531|     46|    buf = *pbuf;
22532|     46|    size = *psize;
22533|     46|    if (size >= (SIZE_MAX / 3) * 2)
  ------------------
  |  Branch (22533:9): [True: 0, False: 46]
  ------------------
22534|      0|        new_size = SIZE_MAX;
22535|     46|    else
22536|     46|        new_size = size + (size >> 1);
22537|     46|    if (buf == static_buf) {
  ------------------
  |  Branch (22537:9): [True: 2, False: 44]
  ------------------
22538|      2|        new_buf = js_malloc(ctx, new_size);
22539|      2|        if (!new_buf)
  ------------------
  |  Branch (22539:13): [True: 0, False: 2]
  ------------------
22540|      0|            return -1;
22541|      2|        memcpy(new_buf, buf, size);
22542|     44|    } else {
22543|     44|        new_buf = js_realloc(ctx, buf, new_size);
22544|     44|        if (!new_buf)
  ------------------
  |  Branch (22544:13): [True: 0, False: 44]
  ------------------
22545|      0|            return -1;
22546|     44|    }
22547|     46|    *pbuf = new_buf;
22548|     46|    *psize = new_size;
22549|     46|    return 0;
22550|     46|}
quickjs.c:js_parse_error:
22173|      2|{
22174|      2|    va_list ap;
22175|      2|    int ret;
22176|       |    
22177|      2|    va_start(ap, fmt);
22178|      2|    ret = js_parse_error_v(s, s->token.ptr, fmt, ap);
22179|       |    va_end(ap);
22180|      2|    return ret;
22181|      2|}
quickjs.c:free_token:
22005|    939|{
22006|    939|    switch(token->val) {
22007|     22|    case TOK_NUMBER:
  ------------------
  |  Branch (22007:5): [True: 22, False: 917]
  ------------------
22008|     22|        JS_FreeValue(s->ctx, token->u.num.val);
22009|     22|        break;
22010|     37|    case TOK_STRING:
  ------------------
  |  Branch (22010:5): [True: 37, False: 902]
  ------------------
22011|     80|    case TOK_TEMPLATE:
  ------------------
  |  Branch (22011:5): [True: 43, False: 896]
  ------------------
22012|     80|        JS_FreeValue(s->ctx, token->u.str.str);
22013|     80|        break;
22014|      1|    case TOK_REGEXP:
  ------------------
  |  Branch (22014:5): [True: 1, False: 938]
  ------------------
22015|      1|        JS_FreeValue(s->ctx, token->u.regexp.body);
22016|      1|        JS_FreeValue(s->ctx, token->u.regexp.flags);
22017|      1|        break;
22018|    372|    case TOK_IDENT:
  ------------------
  |  Branch (22018:5): [True: 372, False: 567]
  ------------------
22019|    372|    case TOK_PRIVATE_NAME:
  ------------------
  |  Branch (22019:5): [True: 0, False: 939]
  ------------------
22020|    372|        JS_FreeAtom(s->ctx, token->u.ident.atom);
22021|    372|        break;
22022|    464|    default:
  ------------------
  |  Branch (22022:5): [True: 464, False: 475]
  ------------------
22023|    464|        if (token->val >= TOK_FIRST_KEYWORD &&
  ------------------
  |  |21696|    928|#define TOK_FIRST_KEYWORD   TOK_NULL
  ------------------
  |  Branch (22023:13): [True: 453, False: 11]
  ------------------
22024|    453|            token->val <= TOK_LAST_KEYWORD) {
  ------------------
  |  |21697|    453|#define TOK_LAST_KEYWORD    TOK_AWAIT
  ------------------
  |  Branch (22024:13): [True: 74, False: 379]
  ------------------
22025|     74|            JS_FreeAtom(s->ctx, token->u.ident.atom);
22026|     74|        }
22027|    464|        break;
22028|    939|    }
22029|    939|}
quickjs.c:js_get_length64:
40940|     11|{
40941|     11|    JSValue len_val;
40942|     11|    len_val = JS_GetProperty(ctx, obj, JS_ATOM_length);
40943|     11|    if (JS_IsException(len_val)) {
  ------------------
  |  Branch (40943:9): [True: 0, False: 11]
  ------------------
40944|      0|        *pres = 0;
40945|      0|        return -1;
40946|      0|    }
40947|     11|    return JS_ToLengthFree(ctx, pres, len_val);
40948|     11|}
quickjs.c:JS_ToStringFree:
13642|      3|{
13643|      3|    JSValue ret;
13644|      3|    ret = JS_ToString(ctx, val);
13645|      3|    JS_FreeValue(ctx, val);
13646|      3|    return ret;
13647|      3|}
quickjs.c:js_sub_string:
 3956|   343k|{
 3957|   343k|    int len = end - start;
 3958|   343k|    if (start == 0 && end == p->len) {
  ------------------
  |  Branch (3958:9): [True: 4, False: 343k]
  |  Branch (3958:23): [True: 0, False: 4]
  ------------------
 3959|      0|        return JS_DupValue(ctx, JS_MKPTR(JS_TAG_STRING, p));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3960|      0|    }
 3961|   343k|    if (p->is_wide_char && len > 0) {
  ------------------
  |  Branch (3961:9): [True: 343k, False: 0]
  |  Branch (3961:28): [True: 72.6k, False: 270k]
  ------------------
 3962|  72.6k|        JSString *str;
 3963|  72.6k|        int i;
 3964|  72.6k|        uint16_t c = 0;
 3965|  2.22M|        for (i = start; i < end; i++) {
  ------------------
  |  Branch (3965:25): [True: 2.15M, False: 72.6k]
  ------------------
 3966|  2.15M|            c |= p->u.str16[i];
 3967|  2.15M|        }
 3968|  72.6k|        if (c > 0xFF)
  ------------------
  |  Branch (3968:13): [True: 1.24k, False: 71.4k]
  ------------------
 3969|  1.24k|            return js_new_string16_len(ctx, p->u.str16 + start, len);
 3970|       |
 3971|  71.4k|        str = js_alloc_string(ctx, len, 0);
 3972|  71.4k|        if (!str)
  ------------------
  |  Branch (3972:13): [True: 0, False: 71.4k]
  ------------------
 3973|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
 3974|  1.38M|        for (i = 0; i < len; i++) {
  ------------------
  |  Branch (3974:21): [True: 1.31M, False: 71.4k]
  ------------------
 3975|  1.31M|            str->u.str8[i] = p->u.str16[start + i];
 3976|  1.31M|        }
 3977|  71.4k|        str->u.str8[len] = '\0';
 3978|  71.4k|        return JS_MKPTR(JS_TAG_STRING, str);
  ------------------
  |  |  246|  71.4k|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
 3979|   270k|    } else {
 3980|   270k|        return js_new_string8_len(ctx, (const char *)(p->u.str8 + start), len);
 3981|   270k|    }
 3982|   343k|}
quickjs.c:JS_CreateDataPropertyUint32:
10741|   343k|{
10742|   343k|    return JS_DefinePropertyValueValue(ctx, this_obj, JS_NewInt64(ctx, idx),
10743|   343k|                                       val, flags | JS_PROP_CONFIGURABLE |
  ------------------
  |  |  296|   343k|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
10744|   343k|                                       JS_PROP_ENUMERABLE | JS_PROP_WRITABLE);
  ------------------
  |  |  298|   343k|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                                                     JS_PROP_ENUMERABLE | JS_PROP_WRITABLE);
  ------------------
  |  |  297|   343k|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
10745|   343k|}
quickjs.c:JS_AtomGetStr:
 3582|    345|{
 3583|    345|    return JS_AtomGetStrRT(ctx->rt, buf, buf_size, atom);
 3584|    345|}
quickjs.c:js_new_promise_capability:
53439|     26|{
53440|     26|    JSValue executor, result_promise;
53441|     26|    JSCFunctionDataRecord *s;
53442|     26|    int i;
53443|       |
53444|     26|    executor = js_promise_executor_new(ctx);
53445|     26|    if (JS_IsException(executor))
  ------------------
  |  Branch (53445:9): [True: 0, False: 26]
  ------------------
53446|      0|        return executor;
53447|       |
53448|     26|    if (JS_IsUndefined(ctor)) {
  ------------------
  |  Branch (53448:9): [True: 26, False: 0]
  ------------------
53449|     26|        result_promise = js_promise_constructor(ctx, ctor, 1,
53450|     26|                                                (JSValueConst *)&executor);
53451|     26|    } else {
53452|      0|        result_promise = JS_CallConstructor(ctx, ctor, 1,
53453|      0|                                            (JSValueConst *)&executor);
53454|      0|    }
53455|     26|    if (JS_IsException(result_promise))
  ------------------
  |  Branch (53455:9): [True: 0, False: 26]
  ------------------
53456|      0|        goto fail;
53457|     26|    s = JS_GetOpaque(executor, JS_CLASS_C_FUNCTION_DATA);
53458|     78|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53458:16): [True: 52, False: 26]
  ------------------
53459|     52|        if (check_function(ctx, s->data[i]))
  ------------------
  |  Branch (53459:13): [True: 0, False: 52]
  ------------------
53460|      0|            goto fail;
53461|     52|    }
53462|     78|    for(i = 0; i < 2; i++)
  ------------------
  |  Branch (53462:16): [True: 52, False: 26]
  ------------------
53463|     52|        resolving_funcs[i] = JS_DupValue(ctx, s->data[i]);
53464|     26|    JS_FreeValue(ctx, executor);
53465|     26|    return result_promise;
53466|      0| fail:
53467|      0|    JS_FreeValue(ctx, executor);
53468|      0|    JS_FreeValue(ctx, result_promise);
53469|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53470|     26|}
quickjs.c:js_promise_executor_new:
53427|     26|{
53428|     26|    JSValueConst func_data[2];
  ------------------
  |  |  234|     26|#define JSValueConst JSValue
  ------------------
53429|       |
53430|     26|    func_data[0] = JS_UNDEFINED;
  ------------------
  |  |  289|     26|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     26|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53431|     26|    func_data[1] = JS_UNDEFINED;
  ------------------
  |  |  289|     26|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     26|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53432|     26|    return JS_NewCFunctionData(ctx, js_promise_executor, 2,
53433|     26|                               0, 2, func_data);
53434|     26|}
quickjs.c:js_promise_executor:
53415|     26|{
53416|     26|    int i;
53417|       |
53418|     78|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53418:16): [True: 52, False: 26]
  ------------------
53419|     52|        if (!JS_IsUndefined(func_data[i]))
  ------------------
  |  Branch (53419:13): [True: 0, False: 52]
  ------------------
53420|      0|            return JS_ThrowTypeError(ctx, "resolving function already set");
53421|     52|        func_data[i] = JS_DupValue(ctx, argv[i]);
53422|     52|    }
53423|     26|    return JS_UNDEFINED;
  ------------------
  |  |  289|     26|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     26|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53424|     26|}
quickjs.c:js_promise_finalizer:
53324|     26|{
53325|     26|    JSPromiseData *s = JS_GetOpaque(val, JS_CLASS_PROMISE);
53326|     26|    struct list_head *el, *el1;
53327|     26|    int i;
53328|       |
53329|     26|    if (!s)
  ------------------
  |  Branch (53329:9): [True: 0, False: 26]
  ------------------
53330|      0|        return;
53331|     78|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53331:16): [True: 52, False: 26]
  ------------------
53332|     52|        list_for_each_safe(el, el1, &s->promise_reactions[i]) {
  ------------------
  |  |   89|     52|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 52]
  |  |  ------------------
  |  |   90|     52|        el = el1, el1 = el->next)
  ------------------
53333|      0|            JSPromiseReactionData *rd =
53334|       |                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)))
  |  |  ------------------
  ------------------
53335|      0|            promise_reaction_data_free(rt, rd);
53336|      0|        }
53337|     52|    }
53338|     26|    JS_FreeValueRT(rt, s->promise_result);
53339|     26|    js_free_rt(rt, s);
53340|     26|}
quickjs.c:js_promise_mark:
53344|     48|{
53345|     48|    JSPromiseData *s = JS_GetOpaque(val, JS_CLASS_PROMISE);
53346|     48|    struct list_head *el;
53347|     48|    int i;
53348|       |
53349|     48|    if (!s)
  ------------------
  |  Branch (53349:9): [True: 0, False: 48]
  ------------------
53350|      0|        return;
53351|    144|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53351:16): [True: 96, False: 48]
  ------------------
53352|     96|        list_for_each(el, &s->promise_reactions[i]) {
  ------------------
  |  |   86|     96|  for(el = (head)->next; el != (head); el = el->next)
  |  |  ------------------
  |  |  |  Branch (86:26): [True: 0, False: 96]
  |  |  ------------------
  ------------------
53353|      0|            JSPromiseReactionData *rd =
53354|       |                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)))
  |  |  ------------------
  ------------------
53355|      0|            JS_MarkValue(rt, rd->resolving_funcs[0], mark_func);
53356|      0|            JS_MarkValue(rt, rd->resolving_funcs[1], mark_func);
53357|      0|            JS_MarkValue(rt, rd->handler, mark_func);
53358|      0|        }
53359|     96|    }
53360|     48|    JS_MarkValue(rt, s->promise_result, mark_func);
53361|     48|}
quickjs.c:js_promise_resolve_function_finalizer:
53252|     52|{
53253|     52|    JSPromiseFunctionData *s = JS_VALUE_GET_OBJ(val)->u.promise_function_data;
  ------------------
  |  |  227|     52|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     52|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
53254|     52|    if (s) {
  ------------------
  |  Branch (53254:9): [True: 52, False: 0]
  ------------------
53255|     52|        js_promise_resolve_function_free_resolved(rt, s->presolved);
53256|     52|        JS_FreeValueRT(rt, s->promise);
53257|     52|        js_free_rt(rt, s);
53258|     52|    }
53259|     52|}
quickjs.c:js_promise_resolve_function_free_resolved:
53203|     78|{
53204|     78|    if (--sr->ref_count == 0) {
  ------------------
  |  Branch (53204:9): [True: 26, False: 52]
  ------------------
53205|     26|        js_free_rt(rt, sr);
53206|     26|    }
53207|     78|}
quickjs.c:js_promise_resolve_function_mark:
53263|     96|{
53264|     96|    JSPromiseFunctionData *s = JS_VALUE_GET_OBJ(val)->u.promise_function_data;
  ------------------
  |  |  227|     96|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     96|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
53265|     96|    if (s) {
  ------------------
  |  Branch (53265:9): [True: 96, False: 0]
  ------------------
53266|     96|        JS_MarkValue(rt, s->promise, mark_func);
53267|     96|    }
53268|     96|}
quickjs.c:js_promise_resolve_function_call:
53275|     26|{
53276|     26|    JSObject *p = JS_VALUE_GET_OBJ(func_obj);
  ------------------
  |  |  227|     26|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     26|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
53277|     26|    JSPromiseFunctionData *s;
53278|     26|    JSValueConst resolution, args[3];
  ------------------
  |  |  234|     26|#define JSValueConst JSValue
  ------------------
53279|     26|    JSValue then;
53280|     26|    BOOL is_reject;
53281|       |
53282|     26|    s = p->u.promise_function_data;
53283|     26|    if (!s || s->presolved->already_resolved)
  ------------------
  |  Branch (53283:9): [True: 0, False: 26]
  |  Branch (53283:15): [True: 0, False: 26]
  ------------------
53284|      0|        return JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53285|     26|    s->presolved->already_resolved = TRUE;
53286|     26|    is_reject = p->class_id - JS_CLASS_PROMISE_RESOLVE_FUNCTION;
53287|     26|    if (argc > 0)
  ------------------
  |  Branch (53287:9): [True: 26, False: 0]
  ------------------
53288|     26|        resolution = argv[0];
53289|      0|    else
53290|      0|        resolution = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53291|       |#ifdef DUMP_PROMISE
53292|       |    printf("js_promise_resolving_function_call: is_reject=%d ", is_reject);
53293|       |    JS_DumpValue(ctx, "resolution", resolution);
53294|       |    printf("\n");
53295|       |#endif
53296|     26|    if (is_reject || !JS_IsObject(resolution)) {
  ------------------
  |  Branch (53296:9): [True: 0, False: 26]
  |  Branch (53296:22): [True: 26, False: 0]
  ------------------
53297|     26|        goto done;
53298|     26|    } else if (js_same_value(ctx, resolution, s->promise)) {
  ------------------
  |  Branch (53298:16): [True: 0, False: 0]
  ------------------
53299|      0|        JS_ThrowTypeError(ctx, "promise self resolution");
53300|      0|        goto fail_reject;
53301|      0|    }
53302|      0|    then = JS_GetProperty(ctx, resolution, JS_ATOM_then);
53303|      0|    if (JS_IsException(then)) {
  ------------------
  |  Branch (53303:9): [True: 0, False: 0]
  ------------------
53304|      0|        JSValue error;
53305|      0|    fail_reject:
53306|      0|        error = JS_GetException(ctx);
53307|      0|        reject_promise(ctx, s->promise, error);
53308|      0|        JS_FreeValue(ctx, error);
53309|      0|    } else if (!JS_IsFunction(ctx, then)) {
  ------------------
  |  Branch (53309:16): [True: 0, False: 0]
  ------------------
53310|      0|        JS_FreeValue(ctx, then);
53311|     26|    done:
53312|     26|        fulfill_or_reject_promise(ctx, s->promise, resolution, is_reject);
53313|     26|    } else {
53314|      0|        args[0] = s->promise;
53315|      0|        args[1] = resolution;
53316|      0|        args[2] = then;
53317|      0|        JS_EnqueueJob(ctx, js_promise_resolve_thenable_job, 3, args);
53318|      0|        JS_FreeValue(ctx, then);
53319|      0|    }
53320|     26|    return JS_UNDEFINED;
  ------------------
  |  |  289|     26|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     26|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53321|      0|}
quickjs.c:fulfill_or_reject_promise:
53129|     26|{
53130|     26|    JSPromiseData *s = JS_GetOpaque(promise, JS_CLASS_PROMISE);
53131|     26|    struct list_head *el, *el1;
53132|     26|    JSPromiseReactionData *rd;
53133|     26|    JSValueConst args[5];
  ------------------
  |  |  234|     26|#define JSValueConst JSValue
  ------------------
53134|       |
53135|     26|    if (!s || s->promise_state != JS_PROMISE_PENDING)
  ------------------
  |  Branch (53135:9): [True: 0, False: 26]
  |  Branch (53135:15): [True: 0, False: 26]
  ------------------
53136|      0|        return; /* should never happen */
53137|     26|    set_value(ctx, &s->promise_result, JS_DupValue(ctx, value));
53138|     26|    s->promise_state = JS_PROMISE_FULFILLED + is_reject;
53139|       |#ifdef DUMP_PROMISE
53140|       |    printf("fulfill_or_reject_promise: is_reject=%d\n", is_reject);
53141|       |#endif
53142|     26|    if (s->promise_state == JS_PROMISE_REJECTED && !s->is_handled) {
  ------------------
  |  Branch (53142:9): [True: 0, False: 26]
  |  Branch (53142:52): [True: 0, False: 0]
  ------------------
53143|      0|        JSRuntime *rt = ctx->rt;
53144|      0|        if (rt->host_promise_rejection_tracker) {
  ------------------
  |  Branch (53144:13): [True: 0, False: 0]
  ------------------
53145|      0|            rt->host_promise_rejection_tracker(ctx, promise, value, FALSE,
53146|      0|                                               rt->host_promise_rejection_tracker_opaque);
53147|      0|        }
53148|      0|    }
53149|       |
53150|     26|    list_for_each_safe(el, el1, &s->promise_reactions[is_reject]) {
  ------------------
  |  |   89|     26|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 26]
  |  |  ------------------
  |  |   90|     26|        el = el1, el1 = el->next)
  ------------------
53151|      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)))
  |  |  ------------------
  ------------------
53152|      0|        args[0] = rd->resolving_funcs[0];
53153|      0|        args[1] = rd->resolving_funcs[1];
53154|      0|        args[2] = rd->handler;
53155|      0|        args[3] = JS_NewBool(ctx, is_reject);
53156|      0|        args[4] = value;
53157|      0|        JS_EnqueueJob(ctx, promise_reaction_job, 5, args);
53158|      0|        list_del(&rd->link);
53159|      0|        promise_reaction_data_free(ctx->rt, rd);
53160|      0|    }
53161|       |
53162|     26|    list_for_each_safe(el, el1, &s->promise_reactions[1 - is_reject]) {
  ------------------
  |  |   89|     26|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 0, False: 26]
  |  |  ------------------
  |  |   90|     26|        el = el1, el1 = el->next)
  ------------------
53163|       |        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)))
  |  |  ------------------
  ------------------
53164|      0|        list_del(&rd->link);
53165|      0|        promise_reaction_data_free(ctx->rt, rd);
53166|      0|    }
53167|     26|}
quickjs.c:js_create_resolving_functions:
53213|     26|{
53214|     26|    JSValue obj;
53215|     26|    JSPromiseFunctionData *s;
53216|     26|    JSPromiseFunctionDataResolved *sr;
53217|     26|    int i, ret;
53218|       |
53219|     26|    sr = js_malloc(ctx, sizeof(*sr));
53220|     26|    if (!sr)
  ------------------
  |  Branch (53220:9): [True: 0, False: 26]
  ------------------
53221|      0|        return -1;
53222|     26|    sr->ref_count = 1;
53223|     26|    sr->already_resolved = FALSE; /* must be shared between the two functions */
53224|     26|    ret = 0;
53225|     78|    for(i = 0; i < 2; i++) {
  ------------------
  |  Branch (53225:16): [True: 52, False: 26]
  ------------------
53226|     52|        obj = JS_NewObjectProtoClass(ctx, ctx->function_proto,
53227|     52|                                     JS_CLASS_PROMISE_RESOLVE_FUNCTION + i);
53228|     52|        if (JS_IsException(obj))
  ------------------
  |  Branch (53228:13): [True: 0, False: 52]
  ------------------
53229|      0|            goto fail;
53230|     52|        s = js_malloc(ctx, sizeof(*s));
53231|     52|        if (!s) {
  ------------------
  |  Branch (53231:13): [True: 0, False: 52]
  ------------------
53232|      0|            JS_FreeValue(ctx, obj);
53233|      0|        fail:
53234|       |
53235|      0|            if (i != 0)
  ------------------
  |  Branch (53235:17): [True: 0, False: 0]
  ------------------
53236|      0|                JS_FreeValue(ctx, resolving_funcs[0]);
53237|      0|            ret = -1;
53238|      0|            break;
53239|      0|        }
53240|     52|        sr->ref_count++;
53241|     52|        s->presolved = sr;
53242|     52|        s->promise = JS_DupValue(ctx, promise);
53243|     52|        JS_SetOpaque(obj, s);
53244|     52|        js_function_set_properties(ctx, obj, JS_ATOM_empty_string, 1);
53245|     52|        resolving_funcs[i] = obj;
53246|     52|    }
53247|     26|    js_promise_resolve_function_free_resolved(ctx->rt, sr);
53248|     26|    return ret;
53249|     26|}
quickjs.c:js_async_function_call:
21136|     13|{
21137|     13|    JSValue promise;
21138|     13|    JSAsyncFunctionState *s;
21139|       |
21140|     13|    s = async_func_init(ctx, func_obj, this_obj, argc, argv);
21141|     13|    if (!s)
  ------------------
  |  Branch (21141:9): [True: 0, False: 13]
  ------------------
21142|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
21143|       |
21144|     13|    promise = JS_NewPromiseCapability(ctx, s->resolving_funcs);
21145|     13|    if (JS_IsException(promise)) {
  ------------------
  |  Branch (21145:9): [True: 0, False: 13]
  ------------------
21146|      0|        async_func_free(ctx->rt, s);
21147|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
21148|      0|    }
21149|       |
21150|     13|    js_async_function_resume(ctx, s);
21151|       |
21152|     13|    async_func_free(ctx->rt, s);
21153|       |
21154|     13|    return promise;
21155|     13|}
quickjs.c:js_async_function_resume:
21053|     13|{
21054|     13|    JSValue func_ret, ret2;
21055|       |
21056|     13|    func_ret = async_func_resume(ctx, s);
21057|     13|    if (s->is_completed) {
  ------------------
  |  Branch (21057:9): [True: 13, False: 0]
  ------------------
21058|     13|        if (JS_IsException(func_ret)) {
  ------------------
  |  Branch (21058:13): [True: 0, False: 13]
  ------------------
21059|      0|            JSValue error;
21060|      0|        fail:
21061|      0|            error = JS_GetException(ctx);
21062|      0|            ret2 = JS_Call(ctx, s->resolving_funcs[1], JS_UNDEFINED,
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
21063|      0|                           1, (JSValueConst *)&error);
21064|      0|            JS_FreeValue(ctx, error);
21065|      0|            JS_FreeValue(ctx, ret2); /* XXX: what to do if exception ? */
21066|     13|        } else {
21067|       |            /* normal return */
21068|     13|            ret2 = JS_Call(ctx, s->resolving_funcs[0], JS_UNDEFINED,
  ------------------
  |  |  289|     13|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     13|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
21069|     13|                           1, (JSValueConst *)&func_ret);
21070|     13|            JS_FreeValue(ctx, func_ret);
21071|     13|            JS_FreeValue(ctx, ret2); /* XXX: what to do if exception ? */
21072|     13|        }
21073|     13|    } else {
21074|      0|        JSValue value, promise, resolving_funcs[2], resolving_funcs1[2];
21075|      0|        int i, res;
21076|       |
21077|      0|        value = s->frame.cur_sp[-1];
21078|      0|        s->frame.cur_sp[-1] = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
21079|       |
21080|       |        /* await */
21081|      0|        JS_FreeValue(ctx, func_ret); /* not used */
21082|      0|        promise = js_promise_resolve(ctx, ctx->promise_ctor,
21083|      0|                                     1, (JSValueConst *)&value, 0);
21084|      0|        JS_FreeValue(ctx, value);
21085|      0|        if (JS_IsException(promise))
  ------------------
  |  Branch (21085:13): [True: 0, False: 0]
  ------------------
21086|      0|            goto fail;
21087|      0|        if (js_async_function_resolve_create(ctx, s, resolving_funcs)) {
  ------------------
  |  Branch (21087:13): [True: 0, False: 0]
  ------------------
21088|      0|            JS_FreeValue(ctx, promise);
21089|      0|            goto fail;
21090|      0|        }
21091|       |
21092|       |        /* Note: no need to create 'thrownawayCapability' as in
21093|       |           the spec */
21094|      0|        for(i = 0; i < 2; i++)
  ------------------
  |  Branch (21094:20): [True: 0, False: 0]
  ------------------
21095|      0|            resolving_funcs1[i] = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
21096|      0|        res = perform_promise_then(ctx, promise,
21097|      0|                                   (JSValueConst *)resolving_funcs,
21098|      0|                                   (JSValueConst *)resolving_funcs1);
21099|      0|        JS_FreeValue(ctx, promise);
21100|      0|        for(i = 0; i < 2; i++)
  ------------------
  |  Branch (21100:20): [True: 0, False: 0]
  ------------------
21101|      0|            JS_FreeValue(ctx, resolving_funcs[i]);
21102|      0|        if (res)
  ------------------
  |  Branch (21102:13): [True: 0, False: 0]
  ------------------
21103|      0|            goto fail;
21104|      0|    }
21105|     13|}
quickjs.c:js_promise_constructor:
53365|     26|{
53366|     26|    JSValueConst executor;
  ------------------
  |  |  234|     26|#define JSValueConst JSValue
  ------------------
53367|     26|    JSValue obj;
53368|     26|    JSPromiseData *s;
53369|     26|    JSValue args[2], ret;
53370|     26|    int i;
53371|       |
53372|     26|    executor = argv[0];
53373|     26|    if (check_function(ctx, executor))
  ------------------
  |  Branch (53373:9): [True: 0, False: 26]
  ------------------
53374|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53375|     26|    obj = js_create_from_ctor(ctx, new_target, JS_CLASS_PROMISE);
53376|     26|    if (JS_IsException(obj))
  ------------------
  |  Branch (53376:9): [True: 0, False: 26]
  ------------------
53377|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53378|     26|    s = js_mallocz(ctx, sizeof(*s));
53379|     26|    if (!s)
  ------------------
  |  Branch (53379:9): [True: 0, False: 26]
  ------------------
53380|      0|        goto fail;
53381|     26|    s->promise_state = JS_PROMISE_PENDING;
53382|     26|    s->is_handled = FALSE;
53383|     78|    for(i = 0; i < 2; i++)
  ------------------
  |  Branch (53383:16): [True: 52, False: 26]
  ------------------
53384|     52|        init_list_head(&s->promise_reactions[i]);
53385|     26|    s->promise_result = JS_UNDEFINED;
  ------------------
  |  |  289|     26|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     26|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53386|     26|    JS_SetOpaque(obj, s);
53387|     26|    if (js_create_resolving_functions(ctx, args, obj))
  ------------------
  |  Branch (53387:9): [True: 0, False: 26]
  ------------------
53388|      0|        goto fail;
53389|     26|    ret = JS_Call(ctx, executor, JS_UNDEFINED, 2, (JSValueConst *)args);
  ------------------
  |  |  289|     26|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     26|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53390|     26|    if (JS_IsException(ret)) {
  ------------------
  |  Branch (53390:9): [True: 0, False: 26]
  ------------------
53391|      0|        JSValue ret2, error;
53392|      0|        error = JS_GetException(ctx);
53393|      0|        ret2 = JS_Call(ctx, args[1], JS_UNDEFINED, 1, (JSValueConst *)&error);
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53394|      0|        JS_FreeValue(ctx, error);
53395|      0|        if (JS_IsException(ret2))
  ------------------
  |  Branch (53395:13): [True: 0, False: 0]
  ------------------
53396|      0|            goto fail1;
53397|      0|        JS_FreeValue(ctx, ret2);
53398|      0|    }
53399|     26|    JS_FreeValue(ctx, ret);
53400|     26|    JS_FreeValue(ctx, args[0]);
53401|     26|    JS_FreeValue(ctx, args[1]);
53402|     26|    return obj;
53403|      0| fail1:
53404|      0|    JS_FreeValue(ctx, args[0]);
53405|      0|    JS_FreeValue(ctx, args[1]);
53406|      0| fail:
53407|      0|    JS_FreeValue(ctx, obj);
53408|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
53409|      0|}
quickjs.c:js_create_from_ctor:
20599|     28|{
20600|     28|    JSValue proto, obj;
20601|     28|    JSContext *realm;
20602|       |
20603|     28|    if (JS_IsUndefined(ctor)) {
  ------------------
  |  Branch (20603:9): [True: 26, False: 2]
  ------------------
20604|     26|        proto = JS_DupValue(ctx, ctx->class_proto[class_id]);
20605|     26|    } else {
20606|      2|        proto = JS_GetProperty(ctx, ctor, JS_ATOM_prototype);
20607|      2|        if (JS_IsException(proto))
  ------------------
  |  Branch (20607:13): [True: 0, False: 2]
  ------------------
20608|      0|            return proto;
20609|      2|        if (!JS_IsObject(proto)) {
  ------------------
  |  Branch (20609:13): [True: 0, False: 2]
  ------------------
20610|      0|            JS_FreeValue(ctx, proto);
20611|      0|            realm = JS_GetFunctionRealm(ctx, ctor);
20612|      0|            if (!realm)
  ------------------
  |  Branch (20612:17): [True: 0, False: 0]
  ------------------
20613|      0|                return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
20614|      0|            proto = JS_DupValue(ctx, realm->class_proto[class_id]);
20615|      0|        }
20616|      2|    }
20617|     28|    obj = JS_NewObjectProtoClass(ctx, proto, class_id);
20618|     28|    JS_FreeValue(ctx, proto);
20619|     28|    return obj;
20620|     28|}
quickjs.c:JS_SetObjectData:
 5797|     44|{
 5798|     44|    JSObject *p;
 5799|       |
 5800|     44|    if (JS_VALUE_GET_TAG(obj) == JS_TAG_OBJECT) {
  ------------------
  |  |  236|     44|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (5800:9): [True: 44, False: 0]
  ------------------
 5801|     44|        p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|     44|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     44|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 5802|     44|        switch(p->class_id) {
  ------------------
  |  Branch (5802:16): [True: 44, False: 0]
  ------------------
 5803|     14|        case JS_CLASS_NUMBER:
  ------------------
  |  Branch (5803:9): [True: 14, False: 30]
  ------------------
 5804|     28|        case JS_CLASS_STRING:
  ------------------
  |  Branch (5804:9): [True: 14, False: 30]
  ------------------
 5805|     44|        case JS_CLASS_BOOLEAN:
  ------------------
  |  Branch (5805:9): [True: 16, False: 28]
  ------------------
 5806|     44|        case JS_CLASS_SYMBOL:
  ------------------
  |  Branch (5806:9): [True: 0, False: 44]
  ------------------
 5807|     44|        case JS_CLASS_DATE:
  ------------------
  |  Branch (5807:9): [True: 0, False: 44]
  ------------------
 5808|     44|        case JS_CLASS_BIG_INT:
  ------------------
  |  Branch (5808:9): [True: 0, False: 44]
  ------------------
 5809|     44|            JS_FreeValue(ctx, p->u.object_data);
 5810|     44|            p->u.object_data = val; /* for JS_CLASS_STRING, 'val' must
 5811|       |                                       be JS_TAG_STRING (and not a
 5812|       |                                       rope) */
 5813|     44|            return 0;
 5814|     44|        }
 5815|     44|    }
 5816|      0|    JS_FreeValue(ctx, val);
 5817|      0|    if (!JS_IsException(obj))
  ------------------
  |  Branch (5817:9): [True: 0, False: 0]
  ------------------
 5818|      0|        JS_ThrowTypeError(ctx, "invalid object type");
 5819|      0|    return -1;
 5820|     44|}
quickjs.c:__JS_EvalInternal:
36995|     28|{
36996|     28|    JSParseState s1, *s = &s1;
36997|     28|    int err, js_mode, eval_type;
36998|     28|    JSValue fun_obj, ret_val;
36999|     28|    JSStackFrame *sf;
37000|     28|    JSVarRef **var_refs;
37001|     28|    JSFunctionBytecode *b;
37002|     28|    JSFunctionDef *fd;
37003|     28|    JSModuleDef *m;
37004|       |
37005|     28|    js_parse_init(ctx, s, input, input_len, filename);
37006|     28|    skip_shebang(&s->buf_ptr, s->buf_end);
37007|       |
37008|     28|    eval_type = flags & JS_EVAL_TYPE_MASK;
  ------------------
  |  |  334|     28|#define JS_EVAL_TYPE_MASK     (3 << 0)
  ------------------
37009|     28|    m = NULL;
37010|     28|    if (eval_type == JS_EVAL_TYPE_DIRECT) {
  ------------------
  |  |  332|     28|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
  |  Branch (37010:9): [True: 0, False: 28]
  ------------------
37011|      0|        JSObject *p;
37012|      0|        sf = ctx->rt->current_stack_frame;
37013|      0|        assert(sf != NULL);
  ------------------
  |  Branch (37013:9): [True: 0, False: 0]
  |  Branch (37013:9): [True: 0, False: 0]
  ------------------
37014|      0|        assert(JS_VALUE_GET_TAG(sf->cur_func) == JS_TAG_OBJECT);
  ------------------
  |  Branch (37014:9): [True: 0, False: 0]
  |  Branch (37014:9): [True: 0, False: 0]
  ------------------
37015|      0|        p = JS_VALUE_GET_OBJ(sf->cur_func);
  ------------------
  |  |  227|      0|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
37016|      0|        assert(js_class_has_bytecode(p->class_id));
  ------------------
  |  Branch (37016:9): [True: 0, False: 0]
  |  Branch (37016:9): [True: 0, False: 0]
  ------------------
37017|      0|        b = p->u.func.function_bytecode;
37018|      0|        var_refs = p->u.func.var_refs;
37019|      0|        js_mode = b->js_mode;
37020|     28|    } else {
37021|     28|        sf = NULL;
37022|     28|        b = NULL;
37023|     28|        var_refs = NULL;
37024|     28|        js_mode = 0;
37025|     28|        if (flags & JS_EVAL_FLAG_STRICT)
  ------------------
  |  |  336|     28|#define JS_EVAL_FLAG_STRICT   (1 << 3) /* force 'strict' mode */
  ------------------
  |  Branch (37025:13): [True: 0, False: 28]
  ------------------
37026|      0|            js_mode |= JS_MODE_STRICT;
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
37027|     28|        if (eval_type == JS_EVAL_TYPE_MODULE) {
  ------------------
  |  |  331|     28|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (37027:13): [True: 14, False: 14]
  ------------------
37028|     14|            JSAtom module_name = JS_NewAtom(ctx, filename);
37029|     14|            if (module_name == JS_ATOM_NULL)
  ------------------
  |  |  449|     14|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (37029:17): [True: 0, False: 14]
  ------------------
37030|      0|                return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
37031|     14|            m = js_new_module_def(ctx, module_name);
37032|     14|            if (!m)
  ------------------
  |  Branch (37032:17): [True: 0, False: 14]
  ------------------
37033|      0|                return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
37034|     14|            js_mode |= JS_MODE_STRICT;
  ------------------
  |  |  395|     14|#define JS_MODE_STRICT (1 << 0)
  ------------------
37035|     14|        }
37036|     28|    }
37037|     28|    fd = js_new_function_def(ctx, NULL, TRUE, FALSE, filename,
37038|     28|                             s->buf_start, &s->get_line_col_cache);
37039|     28|    if (!fd)
  ------------------
  |  Branch (37039:9): [True: 0, False: 28]
  ------------------
37040|      0|        goto fail1;
37041|     28|    s->cur_func = fd;
37042|     28|    fd->eval_type = eval_type;
37043|     28|    fd->has_this_binding = (eval_type != JS_EVAL_TYPE_DIRECT);
  ------------------
  |  |  332|     28|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
37044|     28|    if (eval_type == JS_EVAL_TYPE_DIRECT) {
  ------------------
  |  |  332|     28|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
  |  Branch (37044:9): [True: 0, False: 28]
  ------------------
37045|      0|        fd->new_target_allowed = b->new_target_allowed;
37046|      0|        fd->super_call_allowed = b->super_call_allowed;
37047|      0|        fd->super_allowed = b->super_allowed;
37048|      0|        fd->arguments_allowed = b->arguments_allowed;
37049|     28|    } else {
37050|     28|        fd->new_target_allowed = FALSE;
37051|     28|        fd->super_call_allowed = FALSE;
37052|     28|        fd->super_allowed = FALSE;
37053|     28|        fd->arguments_allowed = TRUE;
37054|     28|    }
37055|     28|    fd->js_mode = js_mode;
37056|     28|    fd->func_name = JS_DupAtom(ctx, JS_ATOM__eval_);
37057|     28|    if (b) {
  ------------------
  |  Branch (37057:9): [True: 0, False: 28]
  ------------------
37058|      0|        if (add_closure_variables(ctx, fd, b, scope_idx))
  ------------------
  |  Branch (37058:13): [True: 0, False: 0]
  ------------------
37059|      0|            goto fail;
37060|      0|    }
37061|     28|    fd->module = m;
37062|     28|    if (m != NULL || (flags & JS_EVAL_FLAG_ASYNC)) {
  ------------------
  |  |  345|     14|#define JS_EVAL_FLAG_ASYNC (1 << 7)
  ------------------
  |  Branch (37062:9): [True: 14, False: 14]
  |  Branch (37062:22): [True: 0, False: 14]
  ------------------
37063|     14|        fd->in_function_body = TRUE;
37064|     14|        fd->func_kind = JS_FUNC_ASYNC;
37065|     14|    }
37066|     28|    s->is_module = (m != NULL);
37067|     28|    s->allow_html_comments = !s->is_module;
37068|       |
37069|     28|    push_scope(s); /* body scope */
37070|     28|    fd->body_scope = fd->scope_level;
37071|       |
37072|     28|    err = js_parse_program(s);
37073|     28|    if (err) {
  ------------------
  |  Branch (37073:9): [True: 2, False: 26]
  ------------------
37074|      2|    fail:
37075|      2|        free_token(s, &s->token);
37076|      2|        js_free_function_def(ctx, fd);
37077|      2|        goto fail1;
37078|      2|    }
37079|       |
37080|     26|    if (m != NULL)
  ------------------
  |  Branch (37080:9): [True: 14, False: 12]
  ------------------
37081|     14|        m->has_tla = fd->has_await;
37082|       |
37083|       |    /* create the function object and all the enclosed functions */
37084|     26|    fun_obj = js_create_function(ctx, fd);
37085|     26|    if (JS_IsException(fun_obj))
  ------------------
  |  Branch (37085:9): [True: 0, False: 26]
  ------------------
37086|      0|        goto fail1;
37087|       |    /* Could add a flag to avoid resolution if necessary */
37088|     26|    if (m) {
  ------------------
  |  Branch (37088:9): [True: 14, False: 12]
  ------------------
37089|     14|        m->func_obj = fun_obj;
37090|     14|        if (js_resolve_module(ctx, m) < 0)
  ------------------
  |  Branch (37090:13): [True: 0, False: 14]
  ------------------
37091|      0|            goto fail1;
37092|     14|        fun_obj = JS_NewModuleValue(ctx, m);
37093|     14|    }
37094|     26|    if (flags & JS_EVAL_FLAG_COMPILE_ONLY) {
  ------------------
  |  |  340|     26|#define JS_EVAL_FLAG_COMPILE_ONLY (1 << 5)
  ------------------
  |  Branch (37094:9): [True: 14, False: 12]
  ------------------
37095|     14|        ret_val = fun_obj;
37096|     14|    } else {
37097|     12|        ret_val = JS_EvalFunctionInternal(ctx, fun_obj, this_obj, var_refs, sf);
37098|     12|    }
37099|     26|    return ret_val;
37100|      2| fail1:
37101|       |    /* XXX: should free all the unresolved dependencies */
37102|      2|    if (m)
  ------------------
  |  Branch (37102:9): [True: 0, False: 2]
  ------------------
37103|      0|        JS_FreeValue(ctx, JS_MKPTR(JS_TAG_MODULE, m));
  ------------------
  |  |  246|      0|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
37104|      2|    return JS_EXCEPTION;
  ------------------
  |  |  292|      2|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      2|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
37105|     26|}
quickjs.c:js_new_function_def:
31878|     33|{
31879|     33|    JSFunctionDef *fd;
31880|       |
31881|     33|    fd = js_mallocz(ctx, sizeof(*fd));
31882|     33|    if (!fd)
  ------------------
  |  Branch (31882:9): [True: 0, False: 33]
  ------------------
31883|      0|        return NULL;
31884|       |
31885|     33|    fd->ctx = ctx;
31886|     33|    init_list_head(&fd->child_list);
31887|       |
31888|       |    /* insert in parent list */
31889|     33|    fd->parent = parent;
31890|     33|    fd->parent_cpool_idx = -1;
31891|     33|    if (parent) {
  ------------------
  |  Branch (31891:9): [True: 5, False: 28]
  ------------------
31892|      5|        list_add_tail(&fd->link, &parent->child_list);
31893|      5|        fd->js_mode = parent->js_mode;
31894|      5|        fd->parent_scope_level = parent->scope_level;
31895|      5|    }
31896|     33|    fd->strip_debug = ((ctx->rt->strip_flags & JS_STRIP_DEBUG) != 0);
  ------------------
  |  |  929|     33|#define JS_STRIP_DEBUG  (1 << 1) /* strip all debug info including source code */
  ------------------
31897|     33|    fd->strip_source = ((ctx->rt->strip_flags & (JS_STRIP_DEBUG | JS_STRIP_SOURCE)) != 0);
  ------------------
  |  |  929|     33|#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);
  ------------------
  |  |  928|     33|#define JS_STRIP_SOURCE (1 << 0) /* strip source code */
  ------------------
31898|       |
31899|     33|    fd->is_eval = is_eval;
31900|     33|    fd->is_func_expr = is_func_expr;
31901|     33|    js_dbuf_bytecode_init(ctx, &fd->byte_code);
31902|     33|    fd->last_opcode_pos = -1;
31903|     33|    fd->func_name = JS_ATOM_NULL;
  ------------------
  |  |  449|     33|#define JS_ATOM_NULL 0
  ------------------
31904|     33|    fd->var_object_idx = -1;
31905|     33|    fd->arg_var_object_idx = -1;
31906|     33|    fd->arguments_var_idx = -1;
31907|     33|    fd->arguments_arg_idx = -1;
31908|     33|    fd->func_var_idx = -1;
31909|     33|    fd->eval_ret_idx = -1;
31910|     33|    fd->this_var_idx = -1;
31911|     33|    fd->new_target_var_idx = -1;
31912|     33|    fd->this_active_func_var_idx = -1;
31913|     33|    fd->home_object_var_idx = -1;
31914|       |
31915|       |    /* XXX: should distinguish arg, var and var object and body scopes */
31916|     33|    fd->scopes = fd->def_scope_array;
31917|     33|    fd->scope_size = countof(fd->def_scope_array);
  ------------------
  |  |   47|     33|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
31918|     33|    fd->scope_count = 1;
31919|     33|    fd->scopes[0].first = -1;
31920|     33|    fd->scopes[0].parent = -1;
31921|     33|    fd->scope_level = 0;  /* 0: var/arg scope */
31922|     33|    fd->scope_first = -1;
31923|     33|    fd->body_scope = -1;
31924|       |
31925|     33|    fd->filename = JS_NewAtom(ctx, filename);
31926|     33|    fd->source_pos = source_ptr - get_line_col_cache->buf_start;
31927|     33|    fd->get_line_col_cache = get_line_col_cache;
31928|       |    
31929|     33|    js_dbuf_init(ctx, &fd->pc2line);
31930|       |    //fd->pc2line_last_line_num = line_num;
31931|       |    //fd->pc2line_last_pc = 0;
31932|     33|    fd->last_opcode_source_ptr = source_ptr;
31933|     33|    return fd;
31934|     33|}
quickjs.c:js_dbuf_bytecode_init:
 1944|     89|{
 1945|     89|    dbuf_init2(s, ctx->rt, js_realloc_bytecode_rt);
 1946|     89|}
quickjs.c:js_realloc_bytecode_rt:
 1932|    848|{
 1933|    848|    JSRuntime *rt = opaque;
 1934|    848|    if (size > (INT32_MAX / 2)) {
  ------------------
  |  Branch (1934:9): [True: 0, False: 848]
  ------------------
 1935|       |        /* the bytecode cannot be larger than 2G. Leave some slack to 
 1936|       |           avoid some overflows. */
 1937|      0|        return NULL;
 1938|    848|    } else {
 1939|    848|        return js_realloc_rt(rt, ptr, size);
 1940|    848|    }
 1941|    848|}
quickjs.c:push_scope:
23920|     55|static int push_scope(JSParseState *s) {
23921|     55|    if (s->cur_func) {
  ------------------
  |  Branch (23921:9): [True: 55, False: 0]
  ------------------
23922|     55|        JSFunctionDef *fd = s->cur_func;
23923|     55|        int scope = fd->scope_count;
23924|       |        /* XXX: should check for scope overflow */
23925|     55|        if ((fd->scope_count + 1) > fd->scope_size) {
  ------------------
  |  Branch (23925:13): [True: 5, False: 50]
  ------------------
23926|      5|            int new_size;
23927|      5|            size_t slack;
23928|      5|            JSVarScope *new_buf;
23929|       |            /* XXX: potential arithmetic overflow */
23930|      5|            new_size = max_int(fd->scope_count + 1, fd->scope_size * 3 / 2);
23931|      5|            if (fd->scopes == fd->def_scope_array) {
  ------------------
  |  Branch (23931:17): [True: 2, False: 3]
  ------------------
23932|      2|                new_buf = js_realloc2(s->ctx, NULL, new_size * sizeof(*fd->scopes), &slack);
23933|      2|                if (!new_buf)
  ------------------
  |  Branch (23933:21): [True: 0, False: 2]
  ------------------
23934|      0|                    return -1;
23935|      2|                memcpy(new_buf, fd->scopes, fd->scope_count * sizeof(*fd->scopes));
23936|      3|            } else {
23937|      3|                new_buf = js_realloc2(s->ctx, fd->scopes, new_size * sizeof(*fd->scopes), &slack);
23938|      3|                if (!new_buf)
  ------------------
  |  Branch (23938:21): [True: 0, False: 3]
  ------------------
23939|      0|                    return -1;
23940|      3|            }
23941|      5|            new_size += slack / sizeof(*new_buf);
23942|      5|            fd->scopes = new_buf;
23943|      5|            fd->scope_size = new_size;
23944|      5|        }
23945|     55|        fd->scope_count++;
23946|     55|        fd->scopes[scope].parent = fd->scope_level;
23947|     55|        fd->scopes[scope].first = fd->scope_first;
23948|     55|        emit_op(s, OP_enter_scope);
23949|     55|        emit_u16(s, scope);
23950|     55|        return fd->scope_level = scope;
23951|     55|    }
23952|      0|    return 0;
23953|     55|}
quickjs.c:emit_op:
23679|    801|{
23680|    801|    JSFunctionDef *fd = s->cur_func;
23681|    801|    DynBuf *bc = &fd->byte_code;
23682|       |
23683|    801|    fd->last_opcode_pos = bc->size;
23684|    801|    dbuf_putc(bc, val);
23685|    801|}
quickjs.c:emit_u16:
23657|    309|{
23658|    309|    dbuf_put_u16(&s->cur_func->byte_code, val);
23659|    309|}
quickjs.c:js_parse_program:
36883|     28|{
36884|     28|    JSFunctionDef *fd = s->cur_func;
36885|     28|    int idx;
36886|       |
36887|     28|    if (next_token(s))
  ------------------
  |  Branch (36887:9): [True: 0, False: 28]
  ------------------
36888|      0|        return -1;
36889|       |
36890|     28|    if (js_parse_directives(s))
  ------------------
  |  Branch (36890:9): [True: 0, False: 28]
  ------------------
36891|      0|        return -1;
36892|       |
36893|     28|    fd->is_global_var = (fd->eval_type == JS_EVAL_TYPE_GLOBAL) ||
  ------------------
  |  |  330|     28|#define JS_EVAL_TYPE_GLOBAL   (0 << 0) /* global code (default) */
  ------------------
  |  Branch (36893:25): [True: 14, False: 14]
  ------------------
36894|     14|        (fd->eval_type == JS_EVAL_TYPE_MODULE) ||
  ------------------
  |  |  331|     14|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (36894:9): [True: 14, False: 0]
  ------------------
36895|      0|        !(fd->js_mode & JS_MODE_STRICT);
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (36895:9): [True: 0, False: 0]
  ------------------
36896|       |
36897|     28|    if (!s->is_module) {
  ------------------
  |  Branch (36897:9): [True: 14, False: 14]
  ------------------
36898|       |        /* hidden variable for the return value */
36899|     14|        fd->eval_ret_idx = idx = add_var(s->ctx, fd, JS_ATOM__ret_);
36900|     14|        if (idx < 0)
  ------------------
  |  Branch (36900:13): [True: 0, False: 14]
  ------------------
36901|      0|            return -1;
36902|     14|    }
36903|       |
36904|    111|    while (s->token.val != TOK_EOF) {
  ------------------
  |  Branch (36904:12): [True: 85, False: 26]
  ------------------
36905|     85|        if (js_parse_source_element(s))
  ------------------
  |  Branch (36905:13): [True: 2, False: 83]
  ------------------
36906|      2|            return -1;
36907|     85|    }
36908|       |
36909|     26|    if (!s->is_module) {
  ------------------
  |  Branch (36909:9): [True: 12, False: 14]
  ------------------
36910|       |        /* return the value of the hidden variable eval_ret_idx  */
36911|     12|        if (fd->func_kind == JS_FUNC_ASYNC) {
  ------------------
  |  Branch (36911:13): [True: 0, False: 12]
  ------------------
36912|       |            /* wrap the return value in an object so that promises can
36913|       |               be safely returned */
36914|      0|            emit_op(s, OP_object);
36915|      0|            emit_op(s, OP_dup);
36916|       |
36917|      0|            emit_op(s, OP_get_loc);
36918|      0|            emit_u16(s, fd->eval_ret_idx);
36919|       |
36920|      0|            emit_op(s, OP_put_field);
36921|      0|            emit_atom(s, JS_ATOM_value);
36922|     12|        } else {
36923|     12|            emit_op(s, OP_get_loc);
36924|     12|            emit_u16(s, fd->eval_ret_idx);
36925|     12|        }
36926|     12|        emit_return(s, TRUE);
36927|     14|    } else {
36928|     14|        emit_return(s, FALSE);
36929|     14|    }
36930|       |
36931|     26|    return 0;
36932|     28|}
quickjs.c:next_token:
22644|    937|{
22645|    937|    const uint8_t *p;
22646|    937|    int c;
22647|    937|    BOOL ident_has_escape;
22648|    937|    JSAtom atom;
22649|       |
22650|    937|    if (js_check_stack_overflow(s->ctx->rt, 0)) {
  ------------------
  |  Branch (22650:9): [True: 0, False: 937]
  ------------------
22651|      0|        return js_parse_error(s, "stack overflow");
22652|      0|    }
22653|       |
22654|    937|    free_token(s, &s->token);
22655|       |
22656|    937|    p = s->last_ptr = s->buf_ptr;
22657|    937|    s->got_lf = FALSE;
22658|  1.05M| redo:
22659|  1.05M|    s->token.ptr = p;
22660|  1.05M|    c = *p;
22661|  1.05M|    switch(c) {
22662|     28|    case 0:
  ------------------
  |  Branch (22662:5): [True: 28, False: 1.05M]
  ------------------
22663|     28|        if (p >= s->buf_end) {
  ------------------
  |  Branch (22663:13): [True: 28, False: 0]
  ------------------
22664|     28|            s->token.val = TOK_EOF;
22665|     28|        } else {
22666|      0|            goto def_token;
22667|      0|        }
22668|     28|        break;
22669|     44|    case '`':
  ------------------
  |  Branch (22669:5): [True: 44, False: 1.05M]
  ------------------
22670|     44|        if (js_parse_template_part(s, p + 1))
  ------------------
  |  Branch (22670:13): [True: 1, False: 43]
  ------------------
22671|      1|            goto fail;
22672|     43|        p = s->buf_ptr;
22673|     43|        break;
22674|     37|    case '\'':
  ------------------
  |  Branch (22674:5): [True: 37, False: 1.05M]
  ------------------
22675|     37|    case '\"':
  ------------------
  |  Branch (22675:5): [True: 0, False: 1.05M]
  ------------------
22676|     37|        if (js_parse_string(s, c, TRUE, p + 1, &s->token, &p))
  ------------------
  |  Branch (22676:13): [True: 0, False: 37]
  ------------------
22677|      0|            goto fail;
22678|     37|        break;
22679|     37|    case '\r':  /* accept DOS and MAC newline sequences */
  ------------------
  |  Branch (22679:5): [True: 10, False: 1.05M]
  ------------------
22680|     10|        if (p[1] == '\n') {
  ------------------
  |  Branch (22680:13): [True: 0, False: 10]
  ------------------
22681|      0|            p++;
22682|      0|        }
22683|       |        /* fall thru */
22684|  1.04M|    case '\n':
  ------------------
  |  Branch (22684:5): [True: 1.04M, False: 1.32k]
  ------------------
22685|  1.04M|        p++;
22686|  1.04M|    line_terminator:
22687|  1.04M|        s->got_lf = TRUE;
22688|  1.04M|        goto redo;
22689|      8|    case '\f':
  ------------------
  |  Branch (22689:5): [True: 8, False: 1.05M]
  ------------------
22690|     10|    case '\v':
  ------------------
  |  Branch (22690:5): [True: 2, False: 1.05M]
  ------------------
22691|    214|    case ' ':
  ------------------
  |  Branch (22691:5): [True: 204, False: 1.04M]
  ------------------
22692|    320|    case '\t':
  ------------------
  |  Branch (22692:5): [True: 106, False: 1.04M]
  ------------------
22693|    320|        p++;
22694|    320|        goto redo;
22695|     62|    case '/':
  ------------------
  |  Branch (22695:5): [True: 62, False: 1.05M]
  ------------------
22696|     62|        if (p[1] == '*') {
  ------------------
  |  Branch (22696:13): [True: 0, False: 62]
  ------------------
22697|       |            /* comment */
22698|      0|            p += 2;
22699|      0|            for(;;) {
22700|      0|                if (*p == '\0' && p >= s->buf_end) {
  ------------------
  |  Branch (22700:21): [True: 0, False: 0]
  |  Branch (22700:35): [True: 0, False: 0]
  ------------------
22701|      0|                    js_parse_error(s, "unexpected end of comment");
22702|      0|                    goto fail;
22703|      0|                }
22704|      0|                if (p[0] == '*' && p[1] == '/') {
  ------------------
  |  Branch (22704:21): [True: 0, False: 0]
  |  Branch (22704:36): [True: 0, False: 0]
  ------------------
22705|      0|                    p += 2;
22706|      0|                    break;
22707|      0|                }
22708|      0|                if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (22708:21): [True: 0, False: 0]
  |  Branch (22708:35): [True: 0, False: 0]
  ------------------
22709|      0|                    s->got_lf = TRUE; /* considered as LF for ASI */
22710|      0|                    p++;
22711|      0|                } else if (*p >= 0x80) {
  ------------------
  |  Branch (22711:28): [True: 0, False: 0]
  ------------------
22712|      0|                    c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22713|      0|                    if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21703|      0|#define CP_LS   0x2028
  ------------------
                                  if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21704|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (22713:25): [True: 0, False: 0]
  |  Branch (22713:39): [True: 0, False: 0]
  ------------------
22714|      0|                        s->got_lf = TRUE; /* considered as LF for ASI */
22715|      0|                    } else if (c == -1) {
  ------------------
  |  Branch (22715:32): [True: 0, False: 0]
  ------------------
22716|      0|                        p++; /* skip invalid UTF-8 */
22717|      0|                    }
22718|      0|                } else {
22719|      0|                    p++;
22720|      0|                }
22721|      0|            }
22722|      0|            goto redo;
22723|     62|        } else if (p[1] == '/') {
  ------------------
  |  Branch (22723:20): [True: 61, False: 1]
  ------------------
22724|       |            /* line comment */
22725|     61|            p += 2;
22726|     61|        skip_line_comment:
22727|  2.04M|            for(;;) {
22728|  2.04M|                if (*p == '\0' && p >= s->buf_end)
  ------------------
  |  Branch (22728:21): [True: 2.04M, False: 5.16k]
  |  Branch (22728:35): [True: 7, False: 2.04M]
  ------------------
22729|      7|                    break;
22730|  2.04M|                if (*p == '\r' || *p == '\n')
  ------------------
  |  Branch (22730:21): [True: 3, False: 2.04M]
  |  Branch (22730:35): [True: 51, False: 2.04M]
  ------------------
22731|     54|                    break;
22732|  2.04M|                if (*p >= 0x80) {
  ------------------
  |  Branch (22732:21): [True: 587, False: 2.04M]
  ------------------
22733|    587|                    c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|    587|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22734|       |                    /* LS or PS are considered as line terminator */
22735|    587|                    if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21703|  1.17k|#define CP_LS   0x2028
  ------------------
                                  if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21704|    587|#define CP_PS   0x2029
  ------------------
  |  Branch (22735:25): [True: 0, False: 587]
  |  Branch (22735:39): [True: 0, False: 587]
  ------------------
22736|      0|                        break;
22737|    587|                    } else if (c == -1) {
  ------------------
  |  Branch (22737:32): [True: 545, False: 42]
  ------------------
22738|    545|                        p++; /* skip invalid UTF-8 */
22739|    545|                    }
22740|  2.04M|                } else {
22741|  2.04M|                    p++;
22742|  2.04M|                }
22743|  2.04M|            }
22744|     61|            goto redo;
22745|     61|        } else if (p[1] == '=') {
  ------------------
  |  Branch (22745:20): [True: 0, False: 1]
  ------------------
22746|      0|            p += 2;
22747|      0|            s->token.val = TOK_DIV_ASSIGN;
22748|      1|        } else {
22749|      1|            p++;
22750|      1|            s->token.val = c;
22751|      1|        }
22752|      1|        break;
22753|      1|    case '\\':
  ------------------
  |  Branch (22753:5): [True: 0, False: 1.05M]
  ------------------
22754|      0|        if (p[1] == 'u') {
  ------------------
  |  Branch (22754:13): [True: 0, False: 0]
  ------------------
22755|      0|            const uint8_t *p1 = p + 1;
22756|      0|            int c1 = lre_parse_escape(&p1, TRUE);
22757|      0|            if (c1 >= 0 && lre_js_is_ident_first(c1)) {
  ------------------
  |  Branch (22757:17): [True: 0, False: 0]
  |  Branch (22757:28): [True: 0, False: 0]
  ------------------
22758|      0|                c = c1;
22759|      0|                p = p1;
22760|      0|                ident_has_escape = TRUE;
22761|      0|                goto has_ident;
22762|      0|            } else {
22763|       |                /* XXX: syntax error? */
22764|      0|            }
22765|      0|        }
22766|      0|        goto def_token;
22767|     34|    case 'a': case 'b': case 'c': case 'd':
  ------------------
  |  Branch (22767:5): [True: 33, False: 1.05M]
  |  Branch (22767:15): [True: 0, False: 1.05M]
  |  Branch (22767:25): [True: 0, False: 1.05M]
  |  Branch (22767:35): [True: 1, False: 1.05M]
  ------------------
22768|    119|    case 'e': case 'f': case 'g': case 'h':
  ------------------
  |  Branch (22768:5): [True: 5, False: 1.05M]
  |  Branch (22768:15): [True: 48, False: 1.05M]
  |  Branch (22768:25): [True: 32, False: 1.05M]
  |  Branch (22768:35): [True: 0, False: 1.05M]
  ------------------
22769|    293|    case 'i': case 'j': case 'k': case 'l':
  ------------------
  |  Branch (22769:5): [True: 110, False: 1.04M]
  |  Branch (22769:15): [True: 0, False: 1.05M]
  |  Branch (22769:25): [True: 22, False: 1.05M]
  |  Branch (22769:35): [True: 42, False: 1.05M]
  ------------------
22770|    352|    case 'm': case 'n': case 'o': case 'p':
  ------------------
  |  Branch (22770:5): [True: 3, False: 1.05M]
  |  Branch (22770:15): [True: 11, False: 1.05M]
  |  Branch (22770:25): [True: 45, False: 1.05M]
  |  Branch (22770:35): [True: 0, False: 1.05M]
  ------------------
22771|    400|    case 'q': case 'r': case 's': case 't':
  ------------------
  |  Branch (22771:5): [True: 3, False: 1.05M]
  |  Branch (22771:15): [True: 0, False: 1.05M]
  |  Branch (22771:25): [True: 45, False: 1.05M]
  |  Branch (22771:35): [True: 0, False: 1.05M]
  ------------------
22772|    412|    case 'u': case 'v': case 'w': case 'x':
  ------------------
  |  Branch (22772:5): [True: 5, False: 1.05M]
  |  Branch (22772:15): [True: 7, False: 1.05M]
  |  Branch (22772:25): [True: 0, False: 1.05M]
  |  Branch (22772:35): [True: 0, False: 1.05M]
  ------------------
22773|    416|    case 'y': case 'z':
  ------------------
  |  Branch (22773:5): [True: 0, False: 1.05M]
  |  Branch (22773:15): [True: 4, False: 1.05M]
  ------------------
22774|    416|    case 'A': case 'B': case 'C': case 'D':
  ------------------
  |  Branch (22774:5): [True: 0, False: 1.05M]
  |  Branch (22774:15): [True: 0, False: 1.05M]
  |  Branch (22774:25): [True: 0, False: 1.05M]
  |  Branch (22774:35): [True: 0, False: 1.05M]
  ------------------
22775|    417|    case 'E': case 'F': case 'G': case 'H':
  ------------------
  |  Branch (22775:5): [True: 0, False: 1.05M]
  |  Branch (22775:15): [True: 1, False: 1.05M]
  |  Branch (22775:25): [True: 0, False: 1.05M]
  |  Branch (22775:35): [True: 0, False: 1.05M]
  ------------------
22776|    417|    case 'I': case 'J': case 'K': case 'L':
  ------------------
  |  Branch (22776:5): [True: 0, False: 1.05M]
  |  Branch (22776:15): [True: 0, False: 1.05M]
  |  Branch (22776:25): [True: 0, False: 1.05M]
  |  Branch (22776:35): [True: 0, False: 1.05M]
  ------------------
22777|    424|    case 'M': case 'N': case 'O': case 'P':
  ------------------
  |  Branch (22777:5): [True: 0, False: 1.05M]
  |  Branch (22777:15): [True: 1, False: 1.05M]
  |  Branch (22777:25): [True: 5, False: 1.05M]
  |  Branch (22777:35): [True: 1, False: 1.05M]
  ------------------
22778|    424|    case 'Q': case 'R': case 'S': case 'T':
  ------------------
  |  Branch (22778:5): [True: 0, False: 1.05M]
  |  Branch (22778:15): [True: 0, False: 1.05M]
  |  Branch (22778:25): [True: 0, False: 1.05M]
  |  Branch (22778:35): [True: 0, False: 1.05M]
  ------------------
22779|    428|    case 'U': case 'V': case 'W': case 'X':
  ------------------
  |  Branch (22779:5): [True: 0, False: 1.05M]
  |  Branch (22779:15): [True: 0, False: 1.05M]
  |  Branch (22779:25): [True: 0, False: 1.05M]
  |  Branch (22779:35): [True: 4, False: 1.05M]
  ------------------
22780|    444|    case 'Y': case 'Z':
  ------------------
  |  Branch (22780:5): [True: 0, False: 1.05M]
  |  Branch (22780:15): [True: 16, False: 1.05M]
  ------------------
22781|    444|    case '_':
  ------------------
  |  Branch (22781:5): [True: 0, False: 1.05M]
  ------------------
22782|    444|    case '$':
  ------------------
  |  Branch (22782:5): [True: 0, False: 1.05M]
  ------------------
22783|       |        /* identifier */
22784|    444|        p++;
22785|    444|        ident_has_escape = FALSE;
22786|    446|    has_ident:
22787|    446|        atom = parse_ident(s, &p, &ident_has_escape, c, FALSE);
22788|    446|        if (atom == JS_ATOM_NULL)
  ------------------
  |  |  449|    446|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (22788:13): [True: 0, False: 446]
  ------------------
22789|      0|            goto fail;
22790|    446|        s->token.u.ident.atom = atom;
22791|    446|        s->token.u.ident.has_escape = ident_has_escape;
22792|    446|        s->token.u.ident.is_reserved = FALSE;
22793|    446|        s->token.val = TOK_IDENT;
22794|    446|        update_token_ident(s);
22795|    446|        break;
22796|      0|    case '#':
  ------------------
  |  Branch (22796:5): [True: 0, False: 1.05M]
  ------------------
22797|       |        /* private name */
22798|      0|        {
22799|      0|            const uint8_t *p1;
22800|      0|            p++;
22801|      0|            p1 = p;
22802|      0|            c = *p1++;
22803|      0|            if (c == '\\' && *p1 == 'u') {
  ------------------
  |  Branch (22803:17): [True: 0, False: 0]
  |  Branch (22803:30): [True: 0, False: 0]
  ------------------
22804|      0|                c = lre_parse_escape(&p1, TRUE);
22805|      0|            } else if (c >= 128) {
  ------------------
  |  Branch (22805:24): [True: 0, False: 0]
  ------------------
22806|      0|                c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p1);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22807|      0|            }
22808|      0|            if (!lre_js_is_ident_first(c)) {
  ------------------
  |  Branch (22808:17): [True: 0, False: 0]
  ------------------
22809|      0|                js_parse_error(s, "invalid first character of private name");
22810|      0|                goto fail;
22811|      0|            }
22812|      0|            p = p1;
22813|      0|            ident_has_escape = FALSE; /* not used */
22814|      0|            atom = parse_ident(s, &p, &ident_has_escape, c, TRUE);
22815|      0|            if (atom == JS_ATOM_NULL)
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (22815:17): [True: 0, False: 0]
  ------------------
22816|      0|                goto fail;
22817|      0|            s->token.u.ident.atom = atom;
22818|      0|            s->token.val = TOK_PRIVATE_NAME;
22819|      0|        }
22820|      0|        break;
22821|     40|    case '.':
  ------------------
  |  Branch (22821:5): [True: 40, False: 1.05M]
  ------------------
22822|     40|        if (p[1] == '.' && p[2] == '.') {
  ------------------
  |  Branch (22822:13): [True: 0, False: 40]
  |  Branch (22822:28): [True: 0, False: 0]
  ------------------
22823|      0|            p += 3;
22824|      0|            s->token.val = TOK_ELLIPSIS;
22825|      0|            break;
22826|      0|        }
22827|     40|        if (p[1] >= '0' && p[1] <= '9') {
  ------------------
  |  Branch (22827:13): [True: 40, False: 0]
  |  Branch (22827:28): [True: 0, False: 40]
  ------------------
22828|      0|            goto parse_number;
22829|     40|        } else {
22830|     40|            goto def_token;
22831|     40|        }
22832|      0|        break;
22833|      6|    case '0':
  ------------------
  |  Branch (22833:5): [True: 6, False: 1.05M]
  ------------------
22834|       |        /* in strict mode, octal literals are not accepted */
22835|      6|        if (is_digit(p[1]) && (s->cur_func->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  395|      1|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (22835:13): [True: 1, False: 5]
  |  Branch (22835:31): [True: 0, False: 1]
  ------------------
22836|      0|            js_parse_error(s, "octal literals are deprecated in strict mode");
22837|      0|            goto fail;
22838|      0|        }
22839|      6|        goto parse_number;
22840|     13|    case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (22840:5): [True: 10, False: 1.05M]
  |  Branch (22840:15): [True: 2, False: 1.05M]
  |  Branch (22840:25): [True: 1, False: 1.05M]
  |  Branch (22840:35): [True: 0, False: 1.05M]
  ------------------
22841|     16|    case '5': case '6': case '7': case '8':
  ------------------
  |  Branch (22841:5): [True: 0, False: 1.05M]
  |  Branch (22841:15): [True: 0, False: 1.05M]
  |  Branch (22841:25): [True: 0, False: 1.05M]
  |  Branch (22841:35): [True: 3, False: 1.05M]
  ------------------
22842|     16|    case '9':
  ------------------
  |  Branch (22842:5): [True: 0, False: 1.05M]
  ------------------
22843|       |        /* number */
22844|     22|    parse_number:
22845|     22|        {
22846|     22|            JSValue ret;
22847|     22|            const uint8_t *p1;
22848|     22|            int flags;
22849|     22|            flags = ATOD_ACCEPT_BIN_OCT | ATOD_ACCEPT_LEGACY_OCTAL |
  ------------------
  |  |12737|     22|#define ATOD_ACCEPT_BIN_OCT  (1 << 2)
  ------------------
                          flags = ATOD_ACCEPT_BIN_OCT | ATOD_ACCEPT_LEGACY_OCTAL |
  ------------------
  |  |12739|     22|#define ATOD_ACCEPT_LEGACY_OCTAL  (1 << 4)
  ------------------
22850|     22|                ATOD_ACCEPT_UNDERSCORES | ATOD_ACCEPT_SUFFIX;
  ------------------
  |  |12741|     22|#define ATOD_ACCEPT_UNDERSCORES  (1 << 5)
  ------------------
                              ATOD_ACCEPT_UNDERSCORES | ATOD_ACCEPT_SUFFIX;
  ------------------
  |  |12743|     22|#define ATOD_ACCEPT_SUFFIX    (1 << 6)
  ------------------
22851|     22|            ret = js_atof(s->ctx, (const char *)p, (const char **)&p, 0,
22852|     22|                          flags);
22853|     22|            if (JS_IsException(ret))
  ------------------
  |  Branch (22853:17): [True: 0, False: 22]
  ------------------
22854|      0|                goto fail;
22855|       |            /* reject `10instanceof Number` */
22856|     22|            if (JS_VALUE_IS_NAN(ret) ||
  ------------------
  |  Branch (22856:17): [True: 0, False: 22]
  ------------------
22857|     22|                lre_js_is_ident_next(unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p1))) {
  ------------------
  |  |  330|     22|#define UTF8_CHAR_LEN_MAX 6
  ------------------
  |  Branch (22857:17): [True: 0, False: 22]
  ------------------
22858|      0|                JS_FreeValue(s->ctx, ret);
22859|      0|                js_parse_error(s, "invalid number literal");
22860|      0|                goto fail;
22861|      0|            }
22862|     22|            s->token.val = TOK_NUMBER;
22863|     22|            s->token.u.num.val = ret;
22864|     22|        }
22865|      0|        break;
22866|     37|    case '*':
  ------------------
  |  Branch (22866:5): [True: 37, False: 1.05M]
  ------------------
22867|     37|        if (p[1] == '=') {
  ------------------
  |  Branch (22867:13): [True: 2, False: 35]
  ------------------
22868|      2|            p += 2;
22869|      2|            s->token.val = TOK_MUL_ASSIGN;
22870|     35|        } else if (p[1] == '*') {
  ------------------
  |  Branch (22870:20): [True: 0, False: 35]
  ------------------
22871|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (22871:17): [True: 0, False: 0]
  ------------------
22872|      0|                p += 3;
22873|      0|                s->token.val = TOK_POW_ASSIGN;
22874|      0|            } else {
22875|      0|                p += 2;
22876|      0|                s->token.val = TOK_POW;
22877|      0|            }
22878|     35|        } else {
22879|     35|            goto def_token;
22880|     35|        }
22881|      2|        break;
22882|      4|    case '%':
  ------------------
  |  Branch (22882:5): [True: 4, False: 1.05M]
  ------------------
22883|      4|        if (p[1] == '=') {
  ------------------
  |  Branch (22883:13): [True: 0, False: 4]
  ------------------
22884|      0|            p += 2;
22885|      0|            s->token.val = TOK_MOD_ASSIGN;
22886|      4|        } else {
22887|      4|            goto def_token;
22888|      4|        }
22889|      0|        break;
22890|      3|    case '+':
  ------------------
  |  Branch (22890:5): [True: 3, False: 1.05M]
  ------------------
22891|      3|        if (p[1] == '=') {
  ------------------
  |  Branch (22891:13): [True: 0, False: 3]
  ------------------
22892|      0|            p += 2;
22893|      0|            s->token.val = TOK_PLUS_ASSIGN;
22894|      3|        } else if (p[1] == '+') {
  ------------------
  |  Branch (22894:20): [True: 0, False: 3]
  ------------------
22895|      0|            p += 2;
22896|      0|            s->token.val = TOK_INC;
22897|      3|        } else {
22898|      3|            goto def_token;
22899|      3|        }
22900|      0|        break;
22901|      5|    case '-':
  ------------------
  |  Branch (22901:5): [True: 5, False: 1.05M]
  ------------------
22902|      5|        if (p[1] == '=') {
  ------------------
  |  Branch (22902:13): [True: 0, False: 5]
  ------------------
22903|      0|            p += 2;
22904|      0|            s->token.val = TOK_MINUS_ASSIGN;
22905|      5|        } else if (p[1] == '-') {
  ------------------
  |  Branch (22905:20): [True: 0, False: 5]
  ------------------
22906|      0|            if (s->allow_html_comments && p[2] == '>' &&
  ------------------
  |  Branch (22906:17): [True: 0, False: 0]
  |  Branch (22906:43): [True: 0, False: 0]
  ------------------
22907|      0|                (s->got_lf || s->last_ptr == s->buf_start)) {
  ------------------
  |  Branch (22907:18): [True: 0, False: 0]
  |  Branch (22907:31): [True: 0, False: 0]
  ------------------
22908|       |                /* Annex B: `-->` at beginning of line is an html comment end.
22909|       |                   It extends to the end of the line.
22910|       |                 */
22911|      0|                goto skip_line_comment;
22912|      0|            }
22913|      0|            p += 2;
22914|      0|            s->token.val = TOK_DEC;
22915|      5|        } else {
22916|      5|            goto def_token;
22917|      5|        }
22918|      0|        break;
22919|      0|    case '<':
  ------------------
  |  Branch (22919:5): [True: 0, False: 1.05M]
  ------------------
22920|      0|        if (p[1] == '=') {
  ------------------
  |  Branch (22920:13): [True: 0, False: 0]
  ------------------
22921|      0|            p += 2;
22922|      0|            s->token.val = TOK_LTE;
22923|      0|        } else if (p[1] == '<') {
  ------------------
  |  Branch (22923:20): [True: 0, False: 0]
  ------------------
22924|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (22924:17): [True: 0, False: 0]
  ------------------
22925|      0|                p += 3;
22926|      0|                s->token.val = TOK_SHL_ASSIGN;
22927|      0|            } else {
22928|      0|                p += 2;
22929|      0|                s->token.val = TOK_SHL;
22930|      0|            }
22931|      0|        } else if (s->allow_html_comments &&
  ------------------
  |  Branch (22931:20): [True: 0, False: 0]
  ------------------
22932|      0|                   p[1] == '!' && p[2] == '-' && p[3] == '-') {
  ------------------
  |  Branch (22932:20): [True: 0, False: 0]
  |  Branch (22932:35): [True: 0, False: 0]
  |  Branch (22932:50): [True: 0, False: 0]
  ------------------
22933|       |            /* Annex B: handle `<!--` single line html comments */
22934|      0|            goto skip_line_comment;
22935|      0|        } else {
22936|      0|            goto def_token;
22937|      0|        }
22938|      0|        break;
22939|      0|    case '>':
  ------------------
  |  Branch (22939:5): [True: 0, False: 1.05M]
  ------------------
22940|      0|        if (p[1] == '=') {
  ------------------
  |  Branch (22940:13): [True: 0, False: 0]
  ------------------
22941|      0|            p += 2;
22942|      0|            s->token.val = TOK_GTE;
22943|      0|        } else if (p[1] == '>') {
  ------------------
  |  Branch (22943:20): [True: 0, False: 0]
  ------------------
22944|      0|            if (p[2] == '>') {
  ------------------
  |  Branch (22944:17): [True: 0, False: 0]
  ------------------
22945|      0|                if (p[3] == '=') {
  ------------------
  |  Branch (22945:21): [True: 0, False: 0]
  ------------------
22946|      0|                    p += 4;
22947|      0|                    s->token.val = TOK_SHR_ASSIGN;
22948|      0|                } else {
22949|      0|                    p += 3;
22950|      0|                    s->token.val = TOK_SHR;
22951|      0|                }
22952|      0|            } else if (p[2] == '=') {
  ------------------
  |  Branch (22952:24): [True: 0, False: 0]
  ------------------
22953|      0|                p += 3;
22954|      0|                s->token.val = TOK_SAR_ASSIGN;
22955|      0|            } else {
22956|      0|                p += 2;
22957|      0|                s->token.val = TOK_SAR;
22958|      0|            }
22959|      0|        } else {
22960|      0|            goto def_token;
22961|      0|        }
22962|      0|        break;
22963|     50|    case '=':
  ------------------
  |  Branch (22963:5): [True: 50, False: 1.05M]
  ------------------
22964|     50|        if (p[1] == '=') {
  ------------------
  |  Branch (22964:13): [True: 0, False: 50]
  ------------------
22965|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (22965:17): [True: 0, False: 0]
  ------------------
22966|      0|                p += 3;
22967|      0|                s->token.val = TOK_STRICT_EQ;
22968|      0|            } else {
22969|      0|                p += 2;
22970|      0|                s->token.val = TOK_EQ;
22971|      0|            }
22972|     50|        } else if (p[1] == '>') {
  ------------------
  |  Branch (22972:20): [True: 6, False: 44]
  ------------------
22973|      6|            p += 2;
22974|      6|            s->token.val = TOK_ARROW;
22975|     44|        } else {
22976|     44|            goto def_token;
22977|     44|        }
22978|      6|        break;
22979|      6|    case '!':
  ------------------
  |  Branch (22979:5): [True: 4, False: 1.05M]
  ------------------
22980|      4|        if (p[1] == '=') {
  ------------------
  |  Branch (22980:13): [True: 0, False: 4]
  ------------------
22981|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (22981:17): [True: 0, False: 0]
  ------------------
22982|      0|                p += 3;
22983|      0|                s->token.val = TOK_STRICT_NEQ;
22984|      0|            } else {
22985|      0|                p += 2;
22986|      0|                s->token.val = TOK_NEQ;
22987|      0|            }
22988|      4|        } else {
22989|      4|            goto def_token;
22990|      4|        }
22991|      0|        break;
22992|      1|    case '&':
  ------------------
  |  Branch (22992:5): [True: 1, False: 1.05M]
  ------------------
22993|      1|        if (p[1] == '=') {
  ------------------
  |  Branch (22993:13): [True: 0, False: 1]
  ------------------
22994|      0|            p += 2;
22995|      0|            s->token.val = TOK_AND_ASSIGN;
22996|      1|        } else if (p[1] == '&') {
  ------------------
  |  Branch (22996:20): [True: 0, False: 1]
  ------------------
22997|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (22997:17): [True: 0, False: 0]
  ------------------
22998|      0|                p += 3;
22999|      0|                s->token.val = TOK_LAND_ASSIGN;
23000|      0|            } else {
23001|      0|                p += 2;
23002|      0|                s->token.val = TOK_LAND;
23003|      0|            }
23004|      1|        } else {
23005|      1|            goto def_token;
23006|      1|        }
23007|      0|        break;
23008|      0|    case '^':
  ------------------
  |  Branch (23008:5): [True: 0, False: 1.05M]
  ------------------
23009|      0|        if (p[1] == '=') {
  ------------------
  |  Branch (23009:13): [True: 0, False: 0]
  ------------------
23010|      0|            p += 2;
23011|      0|            s->token.val = TOK_XOR_ASSIGN;
23012|      0|        } else {
23013|      0|            goto def_token;
23014|      0|        }
23015|      0|        break;
23016|      0|    case '|':
  ------------------
  |  Branch (23016:5): [True: 0, False: 1.05M]
  ------------------
23017|      0|        if (p[1] == '=') {
  ------------------
  |  Branch (23017:13): [True: 0, False: 0]
  ------------------
23018|      0|            p += 2;
23019|      0|            s->token.val = TOK_OR_ASSIGN;
23020|      0|        } else if (p[1] == '|') {
  ------------------
  |  Branch (23020:20): [True: 0, False: 0]
  ------------------
23021|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (23021:17): [True: 0, False: 0]
  ------------------
23022|      0|                p += 3;
23023|      0|                s->token.val = TOK_LOR_ASSIGN;
23024|      0|            } else {
23025|      0|                p += 2;
23026|      0|                s->token.val = TOK_LOR;
23027|      0|            }
23028|      0|        } else {
23029|      0|            goto def_token;
23030|      0|        }
23031|      0|        break;
23032|      0|    case '?':
  ------------------
  |  Branch (23032:5): [True: 0, False: 1.05M]
  ------------------
23033|      0|        if (p[1] == '?') {
  ------------------
  |  Branch (23033:13): [True: 0, False: 0]
  ------------------
23034|      0|            if (p[2] == '=') {
  ------------------
  |  Branch (23034:17): [True: 0, False: 0]
  ------------------
23035|      0|                p += 3;
23036|      0|                s->token.val = TOK_DOUBLE_QUESTION_MARK_ASSIGN;
23037|      0|            } else {
23038|      0|                p += 2;
23039|      0|                s->token.val = TOK_DOUBLE_QUESTION_MARK;
23040|      0|            }
23041|      0|        } else if (p[1] == '.' && !(p[2] >= '0' && p[2] <= '9')) {
  ------------------
  |  Branch (23041:20): [True: 0, False: 0]
  |  Branch (23041:37): [True: 0, False: 0]
  |  Branch (23041:52): [True: 0, False: 0]
  ------------------
23042|      0|            p += 2;
23043|      0|            s->token.val = TOK_QUESTION_MARK_DOT;
23044|      0|        } else {
23045|      0|            goto def_token;
23046|      0|        }
23047|      0|        break;
23048|    217|    default:
  ------------------
  |  Branch (23048:5): [True: 217, False: 1.04M]
  ------------------
23049|    217|        if (c >= 128) {
  ------------------
  |  Branch (23049:13): [True: 2, False: 215]
  ------------------
23050|       |            /* unicode value */
23051|      2|            c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p);
  ------------------
  |  |  330|      2|#define UTF8_CHAR_LEN_MAX 6
  ------------------
23052|      2|            switch(c) {
23053|      0|            case CP_PS:
  ------------------
  |  |21704|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (23053:13): [True: 0, False: 2]
  ------------------
23054|      0|            case CP_LS:
  ------------------
  |  |21703|      0|#define CP_LS   0x2028
  ------------------
  |  Branch (23054:13): [True: 0, False: 2]
  ------------------
23055|       |                /* XXX: should avoid incrementing line_number, but
23056|       |                   needed to handle HTML comments */
23057|      0|                goto line_terminator;
23058|      2|            default:
  ------------------
  |  Branch (23058:13): [True: 2, False: 0]
  ------------------
23059|      2|                if (lre_is_space(c)) {
  ------------------
  |  Branch (23059:21): [True: 0, False: 2]
  ------------------
23060|      0|                    goto redo;
23061|      2|                } else if (lre_js_is_ident_first(c)) {
  ------------------
  |  Branch (23061:28): [True: 2, False: 0]
  ------------------
23062|      2|                    ident_has_escape = FALSE;
23063|      2|                    goto has_ident;
23064|      2|                } else {
23065|      0|                    js_parse_error(s, "unexpected character");
23066|      0|                    goto fail;
23067|      0|                }
23068|      2|            }
23069|      2|        }
23070|    351|    def_token:
23071|    351|        s->token.val = c;
23072|    351|        p++;
23073|    351|        break;
23074|  1.05M|    }
23075|    936|    s->buf_ptr = p;
23076|       |
23077|       |    //    dump_token(s, &s->token);
23078|    936|    return 0;
23079|       |
23080|      1| fail:
23081|      1|    s->token.val = TOK_ERROR;
23082|      1|    return -1;
23083|  1.05M|}
quickjs.c:js_parse_template_part:
22213|     44|{
22214|     44|    uint32_t c;
22215|     44|    StringBuffer b_s, *b = &b_s;
22216|     44|    JSValue str;
22217|       |
22218|       |    /* p points to the first byte of the template part */
22219|     44|    if (string_buffer_init(s->ctx, b, 32))
  ------------------
  |  Branch (22219:9): [True: 0, False: 44]
  ------------------
22220|      0|        goto fail;
22221|  7.23M|    for(;;) {
22222|  7.23M|        if (p >= s->buf_end)
  ------------------
  |  Branch (22222:13): [True: 1, False: 7.23M]
  ------------------
22223|      1|            goto unexpected_eof;
22224|  7.23M|        c = *p++;
22225|  7.23M|        if (c == '`') {
  ------------------
  |  Branch (22225:13): [True: 43, False: 7.23M]
  ------------------
22226|       |            /* template end part */
22227|     43|            break;
22228|     43|        }
22229|  7.23M|        if (c == '$' && *p == '{') {
  ------------------
  |  Branch (22229:13): [True: 2.04k, False: 7.23M]
  |  Branch (22229:25): [True: 0, False: 2.04k]
  ------------------
22230|       |            /* template start or middle part */
22231|      0|            p++;
22232|      0|            break;
22233|      0|        }
22234|  7.23M|        if (c == '\\') {
  ------------------
  |  Branch (22234:13): [True: 60.2k, False: 7.17M]
  ------------------
22235|  60.2k|            if (string_buffer_putc8(b, c))
  ------------------
  |  Branch (22235:17): [True: 0, False: 60.2k]
  ------------------
22236|      0|                goto fail;
22237|  60.2k|            if (p >= s->buf_end)
  ------------------
  |  Branch (22237:17): [True: 0, False: 60.2k]
  ------------------
22238|      0|                goto unexpected_eof;
22239|  60.2k|            c = *p++;
22240|  60.2k|        }
22241|       |        /* newline sequences are normalized as single '\n' bytes */
22242|  7.23M|        if (c == '\r') {
  ------------------
  |  Branch (22242:13): [True: 0, False: 7.23M]
  ------------------
22243|      0|            if (*p == '\n')
  ------------------
  |  Branch (22243:17): [True: 0, False: 0]
  ------------------
22244|      0|                p++;
22245|      0|            c = '\n';
22246|      0|        }
22247|  7.23M|        if (c >= 0x80) {
  ------------------
  |  Branch (22247:13): [True: 1.25k, False: 7.23M]
  ------------------
22248|  1.25k|            const uint8_t *p_next;
22249|  1.25k|            c = unicode_from_utf8(p - 1, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|  1.25k|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22250|  1.25k|            if (c > 0x10FFFF) {
  ------------------
  |  Branch (22250:17): [True: 0, False: 1.25k]
  ------------------
22251|      0|                js_parse_error_pos(s, p - 1, "invalid UTF-8 sequence");
22252|      0|                goto fail;
22253|      0|            }
22254|  1.25k|            p = p_next;
22255|  1.25k|        }
22256|  7.23M|        if (string_buffer_putc(b, c))
  ------------------
  |  Branch (22256:13): [True: 0, False: 7.23M]
  ------------------
22257|      0|            goto fail;
22258|  7.23M|    }
22259|     43|    str = string_buffer_end(b);
22260|     43|    if (JS_IsException(str))
  ------------------
  |  Branch (22260:9): [True: 0, False: 43]
  ------------------
22261|      0|        return -1;
22262|     43|    s->token.val = TOK_TEMPLATE;
22263|     43|    s->token.u.str.sep = c;
22264|     43|    s->token.u.str.str = str;
22265|     43|    s->buf_ptr = p;
22266|     43|    return 0;
22267|       |
22268|      1| unexpected_eof:
22269|      1|    js_parse_error(s, "unexpected end of string");
22270|      1| fail:
22271|      1|    string_buffer_free(b);
22272|      1|    return -1;
22273|      1|}
quickjs.c:js_parse_string:
22278|     65|{
22279|     65|    int ret;
22280|     65|    uint32_t c;
22281|     65|    StringBuffer b_s, *b = &b_s;
22282|     65|    const uint8_t *p_escape;
22283|     65|    JSValue str;
22284|       |
22285|       |    /* string */
22286|     65|    if (string_buffer_init(s->ctx, b, 32))
  ------------------
  |  Branch (22286:9): [True: 0, False: 65]
  ------------------
22287|      0|        goto fail;
22288|  4.49M|    for(;;) {
22289|  4.49M|        if (p >= s->buf_end)
  ------------------
  |  Branch (22289:13): [True: 0, False: 4.49M]
  ------------------
22290|      0|            goto invalid_char;
22291|  4.49M|        c = *p;
22292|  4.49M|        if (c < 0x20) {
  ------------------
  |  Branch (22292:13): [True: 1.87M, False: 2.62M]
  ------------------
22293|  1.87M|            if (sep == '`') {
  ------------------
  |  Branch (22293:17): [True: 1.87M, False: 6]
  ------------------
22294|  1.87M|                if (c == '\r') {
  ------------------
  |  Branch (22294:21): [True: 0, False: 1.87M]
  ------------------
22295|      0|                    if (p[1] == '\n')
  ------------------
  |  Branch (22295:25): [True: 0, False: 0]
  ------------------
22296|      0|                        p++;
22297|      0|                    c = '\n';
22298|      0|                }
22299|       |                /* do not update s->line_num */
22300|  1.87M|            } else if (c == '\n' || c == '\r')
  ------------------
  |  Branch (22300:24): [True: 0, False: 6]
  |  Branch (22300:37): [True: 0, False: 6]
  ------------------
22301|      0|                goto invalid_char;
22302|  1.87M|        }
22303|  4.49M|        p++;
22304|  4.49M|        if (c == sep)
  ------------------
  |  Branch (22304:13): [True: 65, False: 4.49M]
  ------------------
22305|     65|            break;
22306|  4.49M|        if (c == '$' && *p == '{' && sep == '`') {
  ------------------
  |  Branch (22306:13): [True: 2.04k, False: 4.49M]
  |  Branch (22306:25): [True: 0, False: 2.04k]
  |  Branch (22306:38): [True: 0, False: 0]
  ------------------
22307|       |            /* template start or middle part */
22308|      0|            p++;
22309|      0|            break;
22310|      0|        }
22311|  4.49M|        if (c == '\\') {
  ------------------
  |  Branch (22311:13): [True: 60.2k, False: 4.43M]
  ------------------
22312|  60.2k|            p_escape = p - 1;
22313|  60.2k|            c = *p;
22314|       |            /* XXX: need a specific JSON case to avoid
22315|       |               accepting invalid escapes */
22316|  60.2k|            switch(c) {
22317|      1|            case '\0':
  ------------------
  |  Branch (22317:13): [True: 1, False: 60.2k]
  ------------------
22318|      1|                if (p >= s->buf_end)
  ------------------
  |  Branch (22318:21): [True: 0, False: 1]
  ------------------
22319|      0|                    goto invalid_char;
22320|      1|                p++;
22321|      1|                break;
22322|      0|            case '\'':
  ------------------
  |  Branch (22322:13): [True: 0, False: 60.2k]
  ------------------
22323|      0|            case '\"':
  ------------------
  |  Branch (22323:13): [True: 0, False: 60.2k]
  ------------------
22324|    639|            case '\\':
  ------------------
  |  Branch (22324:13): [True: 639, False: 59.5k]
  ------------------
22325|    639|                p++;
22326|    639|                break;
22327|      0|            case '\r':  /* accept DOS and MAC newline sequences */
  ------------------
  |  Branch (22327:13): [True: 0, False: 60.2k]
  ------------------
22328|      0|                if (p[1] == '\n') {
  ------------------
  |  Branch (22328:21): [True: 0, False: 0]
  ------------------
22329|      0|                    p++;
22330|      0|                }
22331|       |                /* fall thru */
22332|      0|            case '\n':
  ------------------
  |  Branch (22332:13): [True: 0, False: 60.2k]
  ------------------
22333|       |                /* ignore escaped newline sequence */
22334|      0|                p++;
22335|      0|                continue;
22336|  59.5k|            default:
  ------------------
  |  Branch (22336:13): [True: 59.5k, False: 640]
  ------------------
22337|  59.5k|                if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (22337:21): [True: 56.2k, False: 3.33k]
  |  Branch (22337:33): [True: 0, False: 56.2k]
  ------------------
22338|      0|                    if (!(s->cur_func->js_mode & JS_MODE_STRICT) && sep != '`')
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (22338:25): [True: 0, False: 0]
  |  Branch (22338:69): [True: 0, False: 0]
  ------------------
22339|      0|                        goto parse_escape;
22340|      0|                    if (c == '0' && !(p[1] >= '0' && p[1] <= '9')) {
  ------------------
  |  Branch (22340:25): [True: 0, False: 0]
  |  Branch (22340:39): [True: 0, False: 0]
  |  Branch (22340:54): [True: 0, False: 0]
  ------------------
22341|      0|                        p++;
22342|      0|                        c = '\0';
22343|      0|                    } else {
22344|      0|                        if (c >= '8' || sep == '`') {
  ------------------
  |  Branch (22344:29): [True: 0, False: 0]
  |  Branch (22344:41): [True: 0, False: 0]
  ------------------
22345|       |                            /* Note: according to ES2021, \8 and \9 are not
22346|       |                               accepted in strict mode or in templates. */
22347|      0|                            goto invalid_escape;
22348|      0|                        } else {
22349|      0|                            if (do_throw)
  ------------------
  |  Branch (22349:33): [True: 0, False: 0]
  ------------------
22350|      0|                                js_parse_error_pos(s, p_escape, "octal escape sequences are not allowed in strict mode");
22351|      0|                        }
22352|      0|                        goto fail;
22353|      0|                    }
22354|  59.5k|                } else if (c >= 0x80) {
  ------------------
  |  Branch (22354:28): [True: 0, False: 59.5k]
  ------------------
22355|      0|                    const uint8_t *p_next;
22356|      0|                    c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22357|      0|                    if (c > 0x10FFFF) {
  ------------------
  |  Branch (22357:25): [True: 0, False: 0]
  ------------------
22358|      0|                        goto invalid_utf8;
22359|      0|                    }
22360|      0|                    p = p_next;
22361|       |                    /* LS or PS are skipped */
22362|      0|                    if (c == CP_LS || c == CP_PS)
  ------------------
  |  |21703|      0|#define CP_LS   0x2028
  ------------------
                                  if (c == CP_LS || c == CP_PS)
  ------------------
  |  |21704|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (22362:25): [True: 0, False: 0]
  |  Branch (22362:39): [True: 0, False: 0]
  ------------------
22363|      0|                        continue;
22364|  59.5k|                } else {
22365|  59.5k|                parse_escape:
22366|  59.5k|                    ret = lre_parse_escape(&p, TRUE);
22367|  59.5k|                    if (ret == -1) {
  ------------------
  |  Branch (22367:25): [True: 0, False: 59.5k]
  ------------------
22368|      0|                    invalid_escape:
22369|      0|                        if (do_throw)
  ------------------
  |  Branch (22369:29): [True: 0, False: 0]
  ------------------
22370|      0|                            js_parse_error_pos(s, p_escape, "malformed escape sequence in string literal");
22371|      0|                        goto fail;
22372|  59.5k|                    } else if (ret < 0) {
  ------------------
  |  Branch (22372:32): [True: 56.2k, False: 3.32k]
  ------------------
22373|       |                        /* ignore the '\' (could output a warning) */
22374|  56.2k|                        p++;
22375|  56.2k|                    } else {
22376|  3.32k|                        c = ret;
22377|  3.32k|                    }
22378|  59.5k|                }
22379|  59.5k|                break;
22380|  60.2k|            }
22381|  4.43M|        } else if (c >= 0x80) {
  ------------------
  |  Branch (22381:20): [True: 1.24k, False: 4.43M]
  ------------------
22382|  1.24k|            const uint8_t *p_next;
22383|  1.24k|            c = unicode_from_utf8(p - 1, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|  1.24k|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22384|  1.24k|            if (c > 0x10FFFF)
  ------------------
  |  Branch (22384:17): [True: 0, False: 1.24k]
  ------------------
22385|      0|                goto invalid_utf8;
22386|  1.24k|            p = p_next;
22387|  1.24k|        }
22388|  4.49M|        if (string_buffer_putc(b, c))
  ------------------
  |  Branch (22388:13): [True: 0, False: 4.49M]
  ------------------
22389|      0|            goto fail;
22390|  4.49M|    }
22391|     65|    str = string_buffer_end(b);
22392|     65|    if (JS_IsException(str))
  ------------------
  |  Branch (22392:9): [True: 0, False: 65]
  ------------------
22393|      0|        return -1;
22394|     65|    token->val = TOK_STRING;
22395|     65|    token->u.str.sep = c;
22396|     65|    token->u.str.str = str;
22397|     65|    *pp = p;
22398|     65|    return 0;
22399|       |
22400|      0| invalid_utf8:
22401|      0|    if (do_throw)
  ------------------
  |  Branch (22401:9): [True: 0, False: 0]
  ------------------
22402|      0|        js_parse_error(s, "invalid UTF-8 sequence");
22403|      0|    goto fail;
22404|      0| invalid_char:
22405|      0|    if (do_throw)
  ------------------
  |  Branch (22405:9): [True: 0, False: 0]
  ------------------
22406|      0|        js_parse_error(s, "unexpected end of string");
22407|      0| fail:
22408|      0|    string_buffer_free(b);
22409|      0|    return -1;
22410|      0|}
quickjs.c:parse_ident:
22597|    446|{
22598|    446|    const uint8_t *p, *p1;
22599|    446|    char ident_buf[128], *buf;
22600|    446|    size_t ident_size, ident_pos;
22601|    446|    JSAtom atom;
22602|       |
22603|    446|    p = *pp;
22604|    446|    buf = ident_buf;
22605|    446|    ident_size = sizeof(ident_buf);
22606|    446|    ident_pos = 0;
22607|    446|    if (is_private)
  ------------------
  |  Branch (22607:9): [True: 0, False: 446]
  ------------------
22608|      0|        buf[ident_pos++] = '#';
22609|  2.09M|    for(;;) {
22610|  2.09M|        p1 = p;
22611|       |
22612|  2.09M|        if (c < 128) {
  ------------------
  |  Branch (22612:13): [True: 2.09M, False: 18]
  ------------------
22613|  2.09M|            buf[ident_pos++] = c;
22614|  2.09M|        } else {
22615|     18|            ident_pos += unicode_to_utf8((uint8_t*)buf + ident_pos, c);
22616|     18|        }
22617|  2.09M|        c = *p1++;
22618|  2.09M|        if (c == '\\' && *p1 == 'u') {
  ------------------
  |  Branch (22618:13): [True: 0, False: 2.09M]
  |  Branch (22618:26): [True: 0, False: 0]
  ------------------
22619|      0|            c = lre_parse_escape(&p1, TRUE);
22620|      0|            *pident_has_escape = TRUE;
22621|  2.09M|        } else if (c >= 128) {
  ------------------
  |  Branch (22621:20): [True: 16, False: 2.09M]
  ------------------
22622|     16|            c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p1);
  ------------------
  |  |  330|     16|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22623|     16|        }
22624|  2.09M|        if (!lre_js_is_ident_next(c))
  ------------------
  |  Branch (22624:13): [True: 446, False: 2.09M]
  ------------------
22625|    446|            break;
22626|  2.09M|        p = p1;
22627|  2.09M|        if (unlikely(ident_pos >= ident_size - UTF8_CHAR_LEN_MAX)) {
  ------------------
  |  |   33|  2.09M|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 46, False: 2.09M]
  |  |  ------------------
  ------------------
22628|     46|            if (ident_realloc(s->ctx, &buf, &ident_size, ident_buf)) {
  ------------------
  |  Branch (22628:17): [True: 0, False: 46]
  ------------------
22629|      0|                atom = JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
22630|      0|                goto done;
22631|      0|            }
22632|     46|        }
22633|  2.09M|    }
22634|    446|    atom = JS_NewAtomLen(s->ctx, buf, ident_pos);
22635|    446| done:
22636|    446|    if (unlikely(buf != ident_buf))
  ------------------
  |  |   33|    446|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 2, False: 444]
  |  |  ------------------
  ------------------
22637|      2|        js_free(s->ctx, buf);
22638|    446|    *pp = p;
22639|    446|    return atom;
22640|    446|}
quickjs.c:update_token_ident:
22554|    447|{
22555|    447|    if (s->token.u.ident.atom <= JS_ATOM_LAST_KEYWORD ||
  ------------------
  |  | 1099|    894|#define JS_ATOM_LAST_KEYWORD JS_ATOM_super
  ------------------
  |  Branch (22555:9): [True: 74, False: 373]
  ------------------
22556|    373|        (s->token.u.ident.atom <= JS_ATOM_LAST_STRICT_KEYWORD &&
  ------------------
  |  | 1100|    746|#define JS_ATOM_LAST_STRICT_KEYWORD JS_ATOM_yield
  ------------------
  |  Branch (22556:10): [True: 42, False: 331]
  ------------------
22557|     42|         (s->cur_func->js_mode & JS_MODE_STRICT)) ||
  ------------------
  |  |  395|     42|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (22557:10): [True: 0, False: 42]
  ------------------
22558|    373|        (s->token.u.ident.atom == JS_ATOM_yield &&
  ------------------
  |  Branch (22558:10): [True: 0, False: 373]
  ------------------
22559|      0|         ((s->cur_func->func_kind & JS_FUNC_GENERATOR) ||
  ------------------
  |  Branch (22559:11): [True: 0, False: 0]
  ------------------
22560|      0|          (s->cur_func->func_type == JS_PARSE_FUNC_ARROW &&
  ------------------
  |  Branch (22560:12): [True: 0, False: 0]
  ------------------
22561|      0|           !s->cur_func->in_function_body && s->cur_func->parent &&
  ------------------
  |  Branch (22561:12): [True: 0, False: 0]
  |  Branch (22561:46): [True: 0, False: 0]
  ------------------
22562|      0|           (s->cur_func->parent->func_kind & JS_FUNC_GENERATOR)))) ||
  ------------------
  |  Branch (22562:12): [True: 0, False: 0]
  ------------------
22563|    373|        (s->token.u.ident.atom == JS_ATOM_await &&
  ------------------
  |  Branch (22563:10): [True: 0, False: 373]
  ------------------
22564|      0|         (s->is_module ||
  ------------------
  |  Branch (22564:11): [True: 0, False: 0]
  ------------------
22565|      0|          (s->cur_func->func_kind & JS_FUNC_ASYNC) ||
  ------------------
  |  Branch (22565:11): [True: 0, False: 0]
  ------------------
22566|      0|          s->cur_func->func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT ||
  ------------------
  |  Branch (22566:11): [True: 0, False: 0]
  ------------------
22567|      0|          (s->cur_func->func_type == JS_PARSE_FUNC_ARROW &&
  ------------------
  |  Branch (22567:12): [True: 0, False: 0]
  ------------------
22568|      0|           !s->cur_func->in_function_body && s->cur_func->parent &&
  ------------------
  |  Branch (22568:12): [True: 0, False: 0]
  |  Branch (22568:46): [True: 0, False: 0]
  ------------------
22569|      0|           ((s->cur_func->parent->func_kind & JS_FUNC_ASYNC) ||
  ------------------
  |  Branch (22569:13): [True: 0, False: 0]
  ------------------
22570|     74|            s->cur_func->parent->func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT))))) {
  ------------------
  |  Branch (22570:13): [True: 0, False: 0]
  ------------------
22571|     74|        if (s->token.u.ident.has_escape) {
  ------------------
  |  Branch (22571:13): [True: 0, False: 74]
  ------------------
22572|      0|            s->token.u.ident.is_reserved = TRUE;
22573|      0|            s->token.val = TOK_IDENT;
22574|     74|        } else {
22575|       |            /* The keywords atoms are pre allocated */
22576|     74|            s->token.val = s->token.u.ident.atom - 1 + TOK_FIRST_KEYWORD;
  ------------------
  |  |21696|     74|#define TOK_FIRST_KEYWORD   TOK_NULL
  ------------------
22577|     74|        }
22578|     74|    }
22579|    447|}
quickjs.c:js_parse_directives:
36132|     31|{
36133|     31|    char str[20];
36134|     31|    JSParsePos pos;
36135|     31|    BOOL has_semi;
36136|       |
36137|     31|    if (s->token.val != TOK_STRING)
  ------------------
  |  Branch (36137:9): [True: 29, False: 2]
  ------------------
36138|     29|        return 0;
36139|       |
36140|      2|    js_parse_get_pos(s, &pos);
36141|       |
36142|      4|    while(s->token.val == TOK_STRING) {
  ------------------
  |  Branch (36142:11): [True: 2, False: 2]
  ------------------
36143|       |        /* Copy actual source string representation */
36144|      2|        snprintf(str, sizeof str, "%.*s",
36145|      2|                 (int)(s->buf_ptr - s->token.ptr - 2), s->token.ptr + 1);
36146|       |
36147|      2|        if (next_token(s))
  ------------------
  |  Branch (36147:13): [True: 0, False: 2]
  ------------------
36148|      0|            return -1;
36149|       |
36150|      2|        has_semi = FALSE;
36151|      2|        switch (s->token.val) {
36152|      0|        case ';':
  ------------------
  |  Branch (36152:9): [True: 0, False: 2]
  ------------------
36153|      0|            if (next_token(s))
  ------------------
  |  Branch (36153:17): [True: 0, False: 0]
  ------------------
36154|      0|                return -1;
36155|      0|            has_semi = TRUE;
36156|      0|            break;
36157|      0|        case '}':
  ------------------
  |  Branch (36157:9): [True: 0, False: 2]
  ------------------
36158|      0|        case TOK_EOF:
  ------------------
  |  Branch (36158:9): [True: 0, False: 2]
  ------------------
36159|      0|            has_semi = TRUE;
36160|      0|            break;
36161|      0|        case TOK_NUMBER:
  ------------------
  |  Branch (36161:9): [True: 0, False: 2]
  ------------------
36162|      0|        case TOK_STRING:
  ------------------
  |  Branch (36162:9): [True: 0, False: 2]
  ------------------
36163|      0|        case TOK_TEMPLATE:
  ------------------
  |  Branch (36163:9): [True: 0, False: 2]
  ------------------
36164|      2|        case TOK_IDENT:
  ------------------
  |  Branch (36164:9): [True: 2, False: 0]
  ------------------
36165|      2|        case TOK_REGEXP:
  ------------------
  |  Branch (36165:9): [True: 0, False: 2]
  ------------------
36166|      2|        case TOK_DEC:
  ------------------
  |  Branch (36166:9): [True: 0, False: 2]
  ------------------
36167|      2|        case TOK_INC:
  ------------------
  |  Branch (36167:9): [True: 0, False: 2]
  ------------------
36168|      2|        case TOK_NULL:
  ------------------
  |  Branch (36168:9): [True: 0, False: 2]
  ------------------
36169|      2|        case TOK_FALSE:
  ------------------
  |  Branch (36169:9): [True: 0, False: 2]
  ------------------
36170|      2|        case TOK_TRUE:
  ------------------
  |  Branch (36170:9): [True: 0, False: 2]
  ------------------
36171|      2|        case TOK_IF:
  ------------------
  |  Branch (36171:9): [True: 0, False: 2]
  ------------------
36172|      2|        case TOK_RETURN:
  ------------------
  |  Branch (36172:9): [True: 0, False: 2]
  ------------------
36173|      2|        case TOK_VAR:
  ------------------
  |  Branch (36173:9): [True: 0, False: 2]
  ------------------
36174|      2|        case TOK_THIS:
  ------------------
  |  Branch (36174:9): [True: 0, False: 2]
  ------------------
36175|      2|        case TOK_DELETE:
  ------------------
  |  Branch (36175:9): [True: 0, False: 2]
  ------------------
36176|      2|        case TOK_TYPEOF:
  ------------------
  |  Branch (36176:9): [True: 0, False: 2]
  ------------------
36177|      2|        case TOK_NEW:
  ------------------
  |  Branch (36177:9): [True: 0, False: 2]
  ------------------
36178|      2|        case TOK_DO:
  ------------------
  |  Branch (36178:9): [True: 0, False: 2]
  ------------------
36179|      2|        case TOK_WHILE:
  ------------------
  |  Branch (36179:9): [True: 0, False: 2]
  ------------------
36180|      2|        case TOK_FOR:
  ------------------
  |  Branch (36180:9): [True: 0, False: 2]
  ------------------
36181|      2|        case TOK_SWITCH:
  ------------------
  |  Branch (36181:9): [True: 0, False: 2]
  ------------------
36182|      2|        case TOK_THROW:
  ------------------
  |  Branch (36182:9): [True: 0, False: 2]
  ------------------
36183|      2|        case TOK_TRY:
  ------------------
  |  Branch (36183:9): [True: 0, False: 2]
  ------------------
36184|      2|        case TOK_FUNCTION:
  ------------------
  |  Branch (36184:9): [True: 0, False: 2]
  ------------------
36185|      2|        case TOK_DEBUGGER:
  ------------------
  |  Branch (36185:9): [True: 0, False: 2]
  ------------------
36186|      2|        case TOK_WITH:
  ------------------
  |  Branch (36186:9): [True: 0, False: 2]
  ------------------
36187|      2|        case TOK_CLASS:
  ------------------
  |  Branch (36187:9): [True: 0, False: 2]
  ------------------
36188|      2|        case TOK_CONST:
  ------------------
  |  Branch (36188:9): [True: 0, False: 2]
  ------------------
36189|      2|        case TOK_ENUM:
  ------------------
  |  Branch (36189:9): [True: 0, False: 2]
  ------------------
36190|      2|        case TOK_EXPORT:
  ------------------
  |  Branch (36190:9): [True: 0, False: 2]
  ------------------
36191|      2|        case TOK_IMPORT:
  ------------------
  |  Branch (36191:9): [True: 0, False: 2]
  ------------------
36192|      2|        case TOK_SUPER:
  ------------------
  |  Branch (36192:9): [True: 0, False: 2]
  ------------------
36193|      2|        case TOK_INTERFACE:
  ------------------
  |  Branch (36193:9): [True: 0, False: 2]
  ------------------
36194|      2|        case TOK_LET:
  ------------------
  |  Branch (36194:9): [True: 0, False: 2]
  ------------------
36195|      2|        case TOK_PACKAGE:
  ------------------
  |  Branch (36195:9): [True: 0, False: 2]
  ------------------
36196|      2|        case TOK_PRIVATE:
  ------------------
  |  Branch (36196:9): [True: 0, False: 2]
  ------------------
36197|      2|        case TOK_PROTECTED:
  ------------------
  |  Branch (36197:9): [True: 0, False: 2]
  ------------------
36198|      2|        case TOK_PUBLIC:
  ------------------
  |  Branch (36198:9): [True: 0, False: 2]
  ------------------
36199|      2|        case TOK_STATIC:
  ------------------
  |  Branch (36199:9): [True: 0, False: 2]
  ------------------
36200|       |            /* automatic insertion of ';' */
36201|      2|            if (s->got_lf)
  ------------------
  |  Branch (36201:17): [True: 2, False: 0]
  ------------------
36202|      2|                has_semi = TRUE;
36203|      2|            break;
36204|      0|        default:
  ------------------
  |  Branch (36204:9): [True: 0, False: 2]
  ------------------
36205|      0|            break;
36206|      2|        }
36207|      2|        if (!has_semi)
  ------------------
  |  Branch (36207:13): [True: 0, False: 2]
  ------------------
36208|      0|            break;
36209|      2|        if (!strcmp(str, "use strict")) {
  ------------------
  |  Branch (36209:13): [True: 0, False: 2]
  ------------------
36210|      0|            s->cur_func->has_use_strict = TRUE;
36211|      0|            s->cur_func->js_mode |= JS_MODE_STRICT;
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
36212|      0|        }
36213|      2|    }
36214|      2|    return js_parse_seek_token(s, &pos);
36215|      2|}
quickjs.c:js_parse_get_pos:
24560|     40|{
24561|     40|    sp->ptr = s->token.ptr;
24562|     40|    sp->got_lf = s->got_lf;
24563|     40|    return 0;
24564|     40|}
quickjs.c:js_parse_seek_token:
24567|     40|{
24568|     40|    s->buf_ptr = sp->ptr;
24569|     40|    s->got_lf = sp->got_lf;
24570|     40|    return next_token(s);
24571|     40|}
quickjs.c:add_var:
23989|     36|{
23990|     36|    JSVarDef *vd;
23991|       |
23992|       |    /* the local variable indexes are currently stored on 16 bits */
23993|     36|    if (fd->var_count >= JS_MAX_LOCAL_VARS) {
  ------------------
  |  |  208|     36|#define JS_MAX_LOCAL_VARS 65534
  ------------------
  |  Branch (23993:9): [True: 0, False: 36]
  ------------------
23994|      0|        JS_ThrowInternalError(ctx, "too many local variables");
23995|      0|        return -1;
23996|      0|    }
23997|     36|    if (js_resize_array(ctx, (void **)&fd->vars, sizeof(fd->vars[0]),
  ------------------
  |  Branch (23997:9): [True: 0, False: 36]
  ------------------
23998|     36|                        &fd->var_size, fd->var_count + 1))
23999|      0|        return -1;
24000|     36|    vd = &fd->vars[fd->var_count++];
24001|     36|    memset(vd, 0, sizeof(*vd));
24002|     36|    vd->var_name = JS_DupAtom(ctx, name);
24003|     36|    vd->func_pool_idx = -1;
24004|     36|    return fd->var_count - 1;
24005|     36|}
quickjs.c:js_parse_source_element:
31844|     92|{
31845|     92|    JSFunctionDef *fd = s->cur_func;
31846|     92|    int tok;
31847|       |
31848|     92|    if (s->token.val == TOK_FUNCTION ||
  ------------------
  |  Branch (31848:9): [True: 1, False: 91]
  ------------------
31849|     91|        (token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (31849:10): [True: 0, False: 91]
  ------------------
31850|      1|         peek_token(s, TRUE) == TOK_FUNCTION)) {
  ------------------
  |  Branch (31850:10): [True: 0, False: 0]
  ------------------
31851|      1|        if (js_parse_function_decl(s, JS_PARSE_FUNC_STATEMENT,
  ------------------
  |  Branch (31851:13): [True: 0, False: 1]
  ------------------
31852|      1|                                   JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  449|      1|#define JS_ATOM_NULL 0
  ------------------
31853|      1|                                   s->token.ptr))
31854|      0|            return -1;
31855|     91|    } else if (s->token.val == TOK_EXPORT && fd->module) {
  ------------------
  |  Branch (31855:16): [True: 0, False: 91]
  |  Branch (31855:46): [True: 0, False: 0]
  ------------------
31856|      0|        if (js_parse_export(s))
  ------------------
  |  Branch (31856:13): [True: 0, False: 0]
  ------------------
31857|      0|            return -1;
31858|     91|    } else if (s->token.val == TOK_IMPORT && fd->module &&
  ------------------
  |  Branch (31858:16): [True: 28, False: 63]
  |  Branch (31858:46): [True: 28, False: 0]
  ------------------
31859|     28|               ((tok = peek_token(s, FALSE)) != '(' && tok != '.'))  {
  ------------------
  |  Branch (31859:17): [True: 28, False: 0]
  |  Branch (31859:56): [True: 28, False: 0]
  ------------------
31860|       |        /* the peek_token is needed to avoid confusion with ImportCall
31861|       |           (dynamic import) or import.meta */
31862|     28|        if (js_parse_import(s))
  ------------------
  |  Branch (31862:13): [True: 0, False: 28]
  ------------------
31863|      0|            return -1;
31864|     63|    } else {
31865|     63|        if (js_parse_statement_or_decl(s, DECL_MASK_ALL))
  ------------------
  |  |28299|     63|#define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28295|     63|#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)
  |  |  ------------------
  |  |  |  |28297|     63|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  |  |  ------------------
  |  |               #define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28298|     63|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  |  |  ------------------
  ------------------
  |  Branch (31865:13): [True: 4, False: 59]
  ------------------
31866|      4|            return -1;
31867|     63|    }
31868|     88|    return 0;
31869|     92|}
quickjs.c:token_is_pseudo_keyword:
22412|    658|static inline BOOL token_is_pseudo_keyword(JSParseState *s, JSAtom atom) {
22413|    658|    return s->token.val == TOK_IDENT && s->token.u.ident.atom == atom &&
  ------------------
  |  Branch (22413:12): [True: 550, False: 108]
  |  Branch (22413:41): [True: 72, False: 478]
  ------------------
22414|     72|        !s->token.u.ident.has_escape;
  ------------------
  |  Branch (22414:9): [True: 72, False: 0]
  ------------------
22415|    658|}
quickjs.c:peek_token:
23570|    198|{
23571|    198|    const uint8_t *p = s->buf_ptr;
23572|    198|    return simple_next_token(&p, no_line_terminator);
23573|    198|}
quickjs.c:js_parse_function_decl:
36877|      5|{
36878|      5|    return js_parse_function_decl2(s, func_type, func_kind, func_name, ptr,
36879|       |                                   JS_PARSE_EXPORT_NONE, NULL);
36880|      5|}
quickjs.c:js_parse_function_decl2:
36311|      5|{
36312|      5|    JSContext *ctx = s->ctx;
36313|      5|    JSFunctionDef *fd = s->cur_func;
36314|      5|    BOOL is_expr;
36315|      5|    int func_idx, lexical_func_idx = -1;
36316|      5|    BOOL has_opt_arg;
36317|      5|    BOOL create_func_var = FALSE;
36318|       |
36319|      5|    is_expr = (func_type != JS_PARSE_FUNC_STATEMENT &&
  ------------------
  |  Branch (36319:16): [True: 4, False: 1]
  ------------------
36320|      4|               func_type != JS_PARSE_FUNC_VAR);
  ------------------
  |  Branch (36320:16): [True: 2, False: 2]
  ------------------
36321|       |
36322|      5|    if (func_type == JS_PARSE_FUNC_STATEMENT ||
  ------------------
  |  Branch (36322:9): [True: 1, False: 4]
  ------------------
36323|      4|        func_type == JS_PARSE_FUNC_VAR ||
  ------------------
  |  Branch (36323:9): [True: 2, False: 2]
  ------------------
36324|      3|        func_type == JS_PARSE_FUNC_EXPR) {
  ------------------
  |  Branch (36324:9): [True: 0, False: 2]
  ------------------
36325|      3|        if (func_kind == JS_FUNC_NORMAL &&
  ------------------
  |  Branch (36325:13): [True: 3, False: 0]
  ------------------
36326|      3|            token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (36326:13): [True: 0, False: 3]
  ------------------
36327|      0|            peek_token(s, TRUE) != '\n') {
  ------------------
  |  Branch (36327:13): [True: 0, False: 0]
  ------------------
36328|      0|            if (next_token(s))
  ------------------
  |  Branch (36328:17): [True: 0, False: 0]
  ------------------
36329|      0|                return -1;
36330|      0|            func_kind = JS_FUNC_ASYNC;
36331|      0|        }
36332|      3|        if (next_token(s))
  ------------------
  |  Branch (36332:13): [True: 0, False: 3]
  ------------------
36333|      0|            return -1;
36334|      3|        if (s->token.val == '*') {
  ------------------
  |  Branch (36334:13): [True: 1, False: 2]
  ------------------
36335|      1|            if (next_token(s))
  ------------------
  |  Branch (36335:17): [True: 0, False: 1]
  ------------------
36336|      0|                return -1;
36337|      1|            func_kind |= JS_FUNC_GENERATOR;
36338|      1|        }
36339|       |
36340|      3|        if (s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (36340:13): [True: 3, False: 0]
  ------------------
36341|      3|            if (s->token.u.ident.is_reserved ||
  ------------------
  |  Branch (36341:17): [True: 0, False: 3]
  ------------------
36342|      3|                (s->token.u.ident.atom == JS_ATOM_yield &&
  ------------------
  |  Branch (36342:18): [True: 0, False: 3]
  ------------------
36343|      0|                 func_type == JS_PARSE_FUNC_EXPR &&
  ------------------
  |  Branch (36343:18): [True: 0, False: 0]
  ------------------
36344|      0|                 (func_kind & JS_FUNC_GENERATOR)) ||
  ------------------
  |  Branch (36344:18): [True: 0, False: 0]
  ------------------
36345|      3|                (s->token.u.ident.atom == JS_ATOM_await &&
  ------------------
  |  Branch (36345:18): [True: 0, False: 3]
  ------------------
36346|      0|                 ((func_type == JS_PARSE_FUNC_EXPR &&
  ------------------
  |  Branch (36346:20): [True: 0, False: 0]
  ------------------
36347|      0|                   (func_kind & JS_FUNC_ASYNC)) ||
  ------------------
  |  Branch (36347:20): [True: 0, False: 0]
  ------------------
36348|      0|                  func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT))) {
  ------------------
  |  Branch (36348:19): [True: 0, False: 0]
  ------------------
36349|      0|                return js_parse_error_reserved_identifier(s);
36350|      0|            }
36351|      3|        }
36352|      3|        if (s->token.val == TOK_IDENT ||
  ------------------
  |  Branch (36352:13): [True: 3, False: 0]
  ------------------
36353|      0|            (((s->token.val == TOK_YIELD && !(fd->js_mode & JS_MODE_STRICT)) ||
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (36353:16): [True: 0, False: 0]
  |  Branch (36353:45): [True: 0, False: 0]
  ------------------
36354|      0|             (s->token.val == TOK_AWAIT && !s->is_module)) &&
  ------------------
  |  Branch (36354:15): [True: 0, False: 0]
  |  Branch (36354:44): [True: 0, False: 0]
  ------------------
36355|      3|             func_type == JS_PARSE_FUNC_EXPR)) {
  ------------------
  |  Branch (36355:14): [True: 0, False: 0]
  ------------------
36356|      3|            func_name = JS_DupAtom(ctx, s->token.u.ident.atom);
36357|      3|            if (next_token(s)) {
  ------------------
  |  Branch (36357:17): [True: 0, False: 3]
  ------------------
36358|      0|                JS_FreeAtom(ctx, func_name);
36359|      0|                return -1;
36360|      0|            }
36361|      3|        } else {
36362|      0|            if (func_type != JS_PARSE_FUNC_EXPR &&
  ------------------
  |  Branch (36362:17): [True: 0, False: 0]
  ------------------
36363|      0|                export_flag != JS_PARSE_EXPORT_DEFAULT) {
  ------------------
  |  Branch (36363:17): [True: 0, False: 0]
  ------------------
36364|      0|                return js_parse_error(s, "function name expected");
36365|      0|            }
36366|      0|        }
36367|      3|    } else if (func_type != JS_PARSE_FUNC_ARROW) {
  ------------------
  |  Branch (36367:16): [True: 0, False: 2]
  ------------------
36368|      0|        func_name = JS_DupAtom(ctx, func_name);
36369|      0|    }
36370|       |
36371|      5|    if (fd->is_eval && fd->eval_type == JS_EVAL_TYPE_MODULE &&
  ------------------
  |  |  331|      8|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (36371:9): [True: 3, False: 2]
  |  Branch (36371:24): [True: 0, False: 3]
  ------------------
36372|      0|        (func_type == JS_PARSE_FUNC_STATEMENT || func_type == JS_PARSE_FUNC_VAR)) {
  ------------------
  |  Branch (36372:10): [True: 0, False: 0]
  |  Branch (36372:50): [True: 0, False: 0]
  ------------------
36373|      0|        JSGlobalVar *hf;
36374|      0|        hf = find_global_var(fd, func_name);
36375|       |        /* XXX: should check scope chain */
36376|      0|        if (hf && hf->scope_level == fd->scope_level) {
  ------------------
  |  Branch (36376:13): [True: 0, False: 0]
  |  Branch (36376:19): [True: 0, False: 0]
  ------------------
36377|      0|            js_parse_error(s, "invalid redefinition of global identifier in module code");
36378|      0|            JS_FreeAtom(ctx, func_name);
36379|      0|            return -1;
36380|      0|        }
36381|      0|    }
36382|       |
36383|      5|    if (func_type == JS_PARSE_FUNC_VAR) {
  ------------------
  |  Branch (36383:9): [True: 2, False: 3]
  ------------------
36384|      2|        if (!(fd->js_mode & JS_MODE_STRICT)
  ------------------
  |  |  395|      2|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (36384:13): [True: 2, False: 0]
  ------------------
36385|      2|        && func_kind == JS_FUNC_NORMAL
  ------------------
  |  Branch (36385:12): [True: 1, False: 1]
  ------------------
36386|      1|        &&  find_lexical_decl(ctx, fd, func_name, fd->scope_first, FALSE) < 0
  ------------------
  |  Branch (36386:13): [True: 1, False: 0]
  ------------------
36387|      1|        &&  !((func_idx = find_var(ctx, fd, func_name)) >= 0 && (func_idx & ARGUMENT_VAR_OFFSET))
  ------------------
  |  |16196|      1|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (36387:15): [True: 1, False: 0]
  |  Branch (36387:65): [True: 1, False: 0]
  ------------------
36388|      0|        &&  !(func_name == JS_ATOM_arguments && fd->has_arguments_binding)) {
  ------------------
  |  Branch (36388:15): [True: 0, False: 0]
  |  Branch (36388:49): [True: 0, False: 0]
  ------------------
36389|      0|            create_func_var = TRUE;
36390|      0|        }
36391|       |        /* Create the lexical name here so that the function closure
36392|       |           contains it */
36393|      2|        if (fd->is_eval &&
  ------------------
  |  Branch (36393:13): [True: 1, False: 1]
  ------------------
36394|      1|            (fd->eval_type == JS_EVAL_TYPE_GLOBAL ||
  ------------------
  |  |  330|      2|#define JS_EVAL_TYPE_GLOBAL   (0 << 0) /* global code (default) */
  ------------------
  |  Branch (36394:14): [True: 1, False: 0]
  ------------------
36395|      0|             fd->eval_type == JS_EVAL_TYPE_MODULE) &&
  ------------------
  |  |  331|      0|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (36395:14): [True: 0, False: 0]
  ------------------
36396|      1|            fd->scope_level == fd->body_scope) {
  ------------------
  |  Branch (36396:13): [True: 0, False: 1]
  ------------------
36397|       |            /* avoid creating a lexical variable in the global
36398|       |               scope. XXX: check annex B */
36399|      0|            JSGlobalVar *hf;
36400|      0|            hf = find_global_var(fd, func_name);
36401|       |            /* XXX: should check scope chain */
36402|      0|            if (hf && hf->scope_level == fd->scope_level) {
  ------------------
  |  Branch (36402:17): [True: 0, False: 0]
  |  Branch (36402:23): [True: 0, False: 0]
  ------------------
36403|      0|                js_parse_error(s, "invalid redefinition of global identifier");
36404|      0|                JS_FreeAtom(ctx, func_name);
36405|      0|                return -1;
36406|      0|            }
36407|      2|        } else {
36408|       |            /* Always create a lexical name, fail if at the same scope as
36409|       |               existing name */
36410|       |            /* Lexical variable will be initialized upon entering scope */
36411|      2|            lexical_func_idx = define_var(s, fd, func_name,
36412|      2|                                          func_kind != JS_FUNC_NORMAL ?
  ------------------
  |  Branch (36412:43): [True: 1, False: 1]
  ------------------
36413|      1|                                          JS_VAR_DEF_NEW_FUNCTION_DECL :
36414|      2|                                          JS_VAR_DEF_FUNCTION_DECL);
36415|      2|            if (lexical_func_idx < 0) {
  ------------------
  |  Branch (36415:17): [True: 0, False: 2]
  ------------------
36416|      0|                JS_FreeAtom(ctx, func_name);
36417|      0|                return -1;
36418|      0|            }
36419|      2|        }
36420|      2|    }
36421|       |
36422|      5|    fd = js_new_function_def(ctx, fd, FALSE, is_expr,
36423|      5|                             s->filename, ptr,
36424|      5|                             &s->get_line_col_cache);
36425|      5|    if (!fd) {
  ------------------
  |  Branch (36425:9): [True: 0, False: 5]
  ------------------
36426|      0|        JS_FreeAtom(ctx, func_name);
36427|      0|        return -1;
36428|      0|    }
36429|      5|    if (pfd)
  ------------------
  |  Branch (36429:9): [True: 0, False: 5]
  ------------------
36430|      0|        *pfd = fd;
36431|      5|    s->cur_func = fd;
36432|      5|    fd->func_name = func_name;
36433|       |    /* XXX: test !fd->is_generator is always false */
36434|      5|    fd->has_prototype = (func_type == JS_PARSE_FUNC_STATEMENT ||
  ------------------
  |  Branch (36434:26): [True: 1, False: 4]
  ------------------
36435|      4|                         func_type == JS_PARSE_FUNC_VAR ||
  ------------------
  |  Branch (36435:26): [True: 2, False: 2]
  ------------------
36436|      2|                         func_type == JS_PARSE_FUNC_EXPR) &&
  ------------------
  |  Branch (36436:26): [True: 0, False: 2]
  ------------------
36437|      3|                        func_kind == JS_FUNC_NORMAL;
  ------------------
  |  Branch (36437:25): [True: 2, False: 1]
  ------------------
36438|      5|    fd->has_home_object = (func_type == JS_PARSE_FUNC_METHOD ||
  ------------------
  |  Branch (36438:28): [True: 0, False: 5]
  ------------------
36439|      5|                           func_type == JS_PARSE_FUNC_GETTER ||
  ------------------
  |  Branch (36439:28): [True: 0, False: 5]
  ------------------
36440|      5|                           func_type == JS_PARSE_FUNC_SETTER ||
  ------------------
  |  Branch (36440:28): [True: 0, False: 5]
  ------------------
36441|      5|                           func_type == JS_PARSE_FUNC_CLASS_CONSTRUCTOR ||
  ------------------
  |  Branch (36441:28): [True: 0, False: 5]
  ------------------
36442|      5|                           func_type == JS_PARSE_FUNC_DERIVED_CLASS_CONSTRUCTOR);
  ------------------
  |  Branch (36442:28): [True: 0, False: 5]
  ------------------
36443|      5|    fd->has_arguments_binding = (func_type != JS_PARSE_FUNC_ARROW &&
  ------------------
  |  Branch (36443:34): [True: 3, False: 2]
  ------------------
36444|      3|                                 func_type != JS_PARSE_FUNC_CLASS_STATIC_INIT);
  ------------------
  |  Branch (36444:34): [True: 3, False: 0]
  ------------------
36445|      5|    fd->has_this_binding = fd->has_arguments_binding;
36446|      5|    fd->is_derived_class_constructor = (func_type == JS_PARSE_FUNC_DERIVED_CLASS_CONSTRUCTOR);
36447|      5|    if (func_type == JS_PARSE_FUNC_ARROW) {
  ------------------
  |  Branch (36447:9): [True: 2, False: 3]
  ------------------
36448|      2|        fd->new_target_allowed = fd->parent->new_target_allowed;
36449|      2|        fd->super_call_allowed = fd->parent->super_call_allowed;
36450|      2|        fd->super_allowed = fd->parent->super_allowed;
36451|      2|        fd->arguments_allowed = fd->parent->arguments_allowed;
36452|      3|    } else if (func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT) {
  ------------------
  |  Branch (36452:16): [True: 0, False: 3]
  ------------------
36453|      0|        fd->new_target_allowed = TRUE; // although new.target === undefined
36454|      0|        fd->super_call_allowed = FALSE;
36455|      0|        fd->super_allowed = TRUE;
36456|      0|        fd->arguments_allowed = FALSE;
36457|      3|    } else {
36458|      3|        fd->new_target_allowed = TRUE;
36459|      3|        fd->super_call_allowed = fd->is_derived_class_constructor;
36460|      3|        fd->super_allowed = fd->has_home_object;
36461|      3|        fd->arguments_allowed = TRUE;
36462|      3|    }
36463|       |
36464|       |    /* fd->in_function_body == FALSE prevents yield/await during the parsing
36465|       |       of the arguments in generator/async functions. They are parsed as
36466|       |       regular identifiers for other function kinds. */
36467|      5|    fd->func_kind = func_kind;
36468|      5|    fd->func_type = func_type;
36469|       |
36470|      5|    if (func_type == JS_PARSE_FUNC_CLASS_CONSTRUCTOR ||
  ------------------
  |  Branch (36470:9): [True: 0, False: 5]
  ------------------
36471|      5|        func_type == JS_PARSE_FUNC_DERIVED_CLASS_CONSTRUCTOR) {
  ------------------
  |  Branch (36471:9): [True: 0, False: 5]
  ------------------
36472|       |        /* error if not invoked as a constructor */
36473|      0|        emit_op(s, OP_check_ctor);
36474|      0|    }
36475|       |
36476|      5|    if (func_type == JS_PARSE_FUNC_CLASS_CONSTRUCTOR) {
  ------------------
  |  Branch (36476:9): [True: 0, False: 5]
  ------------------
36477|      0|        emit_class_field_init(s);
36478|      0|    }
36479|       |
36480|       |    /* parse arguments */
36481|      5|    fd->has_simple_parameter_list = TRUE;
36482|      5|    fd->has_parameter_expressions = FALSE;
36483|      5|    has_opt_arg = FALSE;
36484|      5|    if (func_type == JS_PARSE_FUNC_ARROW && s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (36484:9): [True: 2, False: 3]
  |  Branch (36484:45): [True: 0, False: 2]
  ------------------
36485|      0|        JSAtom name;
36486|      0|        if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (36486:13): [True: 0, False: 0]
  ------------------
36487|      0|            js_parse_error_reserved_identifier(s);
36488|      0|            goto fail;
36489|      0|        }
36490|      0|        name = s->token.u.ident.atom;
36491|      0|        if (add_arg(ctx, fd, name) < 0)
  ------------------
  |  Branch (36491:13): [True: 0, False: 0]
  ------------------
36492|      0|            goto fail;
36493|      0|        fd->defined_arg_count = 1;
36494|      5|    } else if (func_type != JS_PARSE_FUNC_CLASS_STATIC_INIT) {
  ------------------
  |  Branch (36494:16): [True: 5, False: 0]
  ------------------
36495|      5|        if (s->token.val == '(') {
  ------------------
  |  Branch (36495:13): [True: 5, False: 0]
  ------------------
36496|      5|            int skip_bits;
36497|       |            /* if there is an '=' inside the parameter list, we
36498|       |               consider there is a parameter expression inside */
36499|      5|            js_parse_skip_parens_token(s, &skip_bits, FALSE);
36500|      5|            if (skip_bits & SKIP_HAS_ASSIGNMENT)
  ------------------
  |  |24598|      5|#define SKIP_HAS_ASSIGNMENT (1 << 2)
  ------------------
  |  Branch (36500:17): [True: 2, False: 3]
  ------------------
36501|      2|                fd->has_parameter_expressions = TRUE;
36502|      5|            if (next_token(s))
  ------------------
  |  Branch (36502:17): [True: 0, False: 5]
  ------------------
36503|      0|                goto fail;
36504|      5|        } else {
36505|      0|            if (js_parse_expect(s, '('))
  ------------------
  |  Branch (36505:17): [True: 0, False: 0]
  ------------------
36506|      0|                goto fail;
36507|      0|        }
36508|       |
36509|      5|        if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36509:13): [True: 2, False: 3]
  ------------------
36510|      2|            fd->scope_level = -1; /* force no parent scope */
36511|      2|            if (push_scope(s) < 0)
  ------------------
  |  Branch (36511:17): [True: 0, False: 2]
  ------------------
36512|      0|                return -1;
36513|      2|        }
36514|       |
36515|      9|        while (s->token.val != ')') {
  ------------------
  |  Branch (36515:16): [True: 8, False: 1]
  ------------------
36516|      8|            JSAtom name;
36517|      8|            BOOL rest = FALSE;
36518|      8|            int idx, has_initializer;
36519|       |
36520|      8|            if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (36520:17): [True: 0, False: 8]
  ------------------
36521|      0|                if (func_type == JS_PARSE_FUNC_SETTER)
  ------------------
  |  Branch (36521:21): [True: 0, False: 0]
  ------------------
36522|      0|                    goto fail_accessor;
36523|      0|                fd->has_simple_parameter_list = FALSE;
36524|      0|                rest = TRUE;
36525|      0|                if (next_token(s))
  ------------------
  |  Branch (36525:21): [True: 0, False: 0]
  ------------------
36526|      0|                    goto fail;
36527|      0|            }
36528|      8|            if (s->token.val == '[' || s->token.val == '{') {
  ------------------
  |  Branch (36528:17): [True: 0, False: 8]
  |  Branch (36528:40): [True: 2, False: 6]
  ------------------
36529|      2|                fd->has_simple_parameter_list = FALSE;
36530|      2|                if (rest) {
  ------------------
  |  Branch (36530:21): [True: 0, False: 2]
  ------------------
36531|      0|                    emit_op(s, OP_rest);
36532|      0|                    emit_u16(s, fd->arg_count);
36533|      2|                } else {
36534|       |                    /* unnamed arg for destructuring */
36535|      2|                    idx = add_arg(ctx, fd, JS_ATOM_NULL);
  ------------------
  |  |  449|      2|#define JS_ATOM_NULL 0
  ------------------
36536|      2|                    emit_op(s, OP_get_arg);
36537|      2|                    emit_u16(s, idx);
36538|      2|                }
36539|      2|                has_initializer = js_parse_destructuring_element(s, fd->has_parameter_expressions ? TOK_LET : TOK_VAR, 1, TRUE, -1, TRUE, FALSE);
  ------------------
  |  Branch (36539:69): [True: 2, False: 0]
  ------------------
36540|      2|                if (has_initializer < 0)
  ------------------
  |  Branch (36540:21): [True: 0, False: 2]
  ------------------
36541|      0|                    goto fail;
36542|      2|                if (has_initializer)
  ------------------
  |  Branch (36542:21): [True: 2, False: 0]
  ------------------
36543|      2|                    has_opt_arg = TRUE;
36544|      2|                if (!has_opt_arg)
  ------------------
  |  Branch (36544:21): [True: 0, False: 2]
  ------------------
36545|      0|                    fd->defined_arg_count++;
36546|      6|            } else if (s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (36546:24): [True: 6, False: 0]
  ------------------
36547|      6|                if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (36547:21): [True: 0, False: 6]
  ------------------
36548|      0|                    js_parse_error_reserved_identifier(s);
36549|      0|                    goto fail;
36550|      0|                }
36551|      6|                name = s->token.u.ident.atom;
36552|      6|                if (name == JS_ATOM_yield && fd->func_kind == JS_FUNC_GENERATOR) {
  ------------------
  |  Branch (36552:21): [True: 0, False: 6]
  |  Branch (36552:46): [True: 0, False: 0]
  ------------------
36553|      0|                    js_parse_error_reserved_identifier(s);
36554|      0|                    goto fail;
36555|      0|                }
36556|      6|                if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36556:21): [True: 2, False: 4]
  ------------------
36557|      2|                    if (js_parse_check_duplicate_parameter(s, name))
  ------------------
  |  Branch (36557:25): [True: 0, False: 2]
  ------------------
36558|      0|                        goto fail;
36559|      2|                    if (define_var(s, fd, name, JS_VAR_DEF_LET) < 0)
  ------------------
  |  Branch (36559:25): [True: 0, False: 2]
  ------------------
36560|      0|                        goto fail;
36561|      2|                }
36562|       |                /* XXX: could avoid allocating an argument if rest is true */
36563|      6|                idx = add_arg(ctx, fd, name);
36564|      6|                if (idx < 0)
  ------------------
  |  Branch (36564:21): [True: 0, False: 6]
  ------------------
36565|      0|                    goto fail;
36566|      6|                if (next_token(s))
  ------------------
  |  Branch (36566:21): [True: 0, False: 6]
  ------------------
36567|      0|                    goto fail;
36568|      6|                if (rest) {
  ------------------
  |  Branch (36568:21): [True: 0, False: 6]
  ------------------
36569|      0|                    emit_op(s, OP_rest);
36570|      0|                    emit_u16(s, idx);
36571|      0|                    if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36571:25): [True: 0, False: 0]
  ------------------
36572|      0|                        emit_op(s, OP_dup);
36573|      0|                        emit_op(s, OP_scope_put_var_init);
36574|      0|                        emit_atom(s, name);
36575|      0|                        emit_u16(s, fd->scope_level);
36576|      0|                    }
36577|      0|                    emit_op(s, OP_put_arg);
36578|      0|                    emit_u16(s, idx);
36579|      0|                    fd->has_simple_parameter_list = FALSE;
36580|      0|                    has_opt_arg = TRUE;
36581|      6|                } else if (s->token.val == '=') {
  ------------------
  |  Branch (36581:28): [True: 0, False: 6]
  ------------------
36582|      0|                    int label;
36583|       |
36584|      0|                    fd->has_simple_parameter_list = FALSE;
36585|      0|                    has_opt_arg = TRUE;
36586|       |
36587|      0|                    if (next_token(s))
  ------------------
  |  Branch (36587:25): [True: 0, False: 0]
  ------------------
36588|      0|                        goto fail;
36589|       |
36590|      0|                    label = new_label(s);
36591|      0|                    emit_op(s, OP_get_arg);
36592|      0|                    emit_u16(s, idx);
36593|      0|                    emit_op(s, OP_dup);
36594|      0|                    emit_op(s, OP_undefined);
36595|      0|                    emit_op(s, OP_strict_eq);
36596|      0|                    emit_goto(s, OP_if_false, label);
36597|      0|                    emit_op(s, OP_drop);
36598|      0|                    if (js_parse_assign_expr(s))
  ------------------
  |  Branch (36598:25): [True: 0, False: 0]
  ------------------
36599|      0|                        goto fail;
36600|      0|                    set_object_name(s, name);
36601|      0|                    emit_op(s, OP_dup);
36602|      0|                    emit_op(s, OP_put_arg);
36603|      0|                    emit_u16(s, idx);
36604|      0|                    emit_label(s, label);
36605|      0|                    emit_op(s, OP_scope_put_var_init);
36606|      0|                    emit_atom(s, name);
36607|      0|                    emit_u16(s, fd->scope_level);
36608|      6|                } else {
36609|      6|                    if (!has_opt_arg) {
  ------------------
  |  Branch (36609:25): [True: 4, False: 2]
  ------------------
36610|      4|                        fd->defined_arg_count++;
36611|      4|                    }
36612|      6|                    if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36612:25): [True: 2, False: 4]
  ------------------
36613|       |                        /* copy the argument to the argument scope */
36614|      2|                        emit_op(s, OP_get_arg);
36615|      2|                        emit_u16(s, idx);
36616|      2|                        emit_op(s, OP_scope_put_var_init);
36617|      2|                        emit_atom(s, name);
36618|      2|                        emit_u16(s, fd->scope_level);
36619|      2|                    }
36620|      6|                }
36621|      6|            } else {
36622|      0|                js_parse_error(s, "missing formal parameter");
36623|      0|                goto fail;
36624|      0|            }
36625|      8|            if (rest && s->token.val != ')') {
  ------------------
  |  Branch (36625:17): [True: 0, False: 8]
  |  Branch (36625:25): [True: 0, False: 0]
  ------------------
36626|      0|                js_parse_expect(s, ')');
36627|      0|                goto fail;
36628|      0|            }
36629|      8|            if (s->token.val == ')')
  ------------------
  |  Branch (36629:17): [True: 4, False: 4]
  ------------------
36630|      4|                break;
36631|      4|            if (js_parse_expect(s, ','))
  ------------------
  |  Branch (36631:17): [True: 0, False: 4]
  ------------------
36632|      0|                goto fail;
36633|      4|        }
36634|      5|        if ((func_type == JS_PARSE_FUNC_GETTER && fd->arg_count != 0) ||
  ------------------
  |  Branch (36634:14): [True: 0, False: 5]
  |  Branch (36634:51): [True: 0, False: 0]
  ------------------
36635|      5|            (func_type == JS_PARSE_FUNC_SETTER && fd->arg_count != 1)) {
  ------------------
  |  Branch (36635:14): [True: 0, False: 5]
  |  Branch (36635:51): [True: 0, False: 0]
  ------------------
36636|      0|        fail_accessor:
36637|      0|            js_parse_error(s, "invalid number of arguments for getter or setter");
36638|      0|            goto fail;
36639|      0|        }
36640|      5|    }
36641|       |
36642|      5|    if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (36642:9): [True: 2, False: 3]
  ------------------
36643|      2|        int idx;
36644|       |
36645|       |        /* Copy the variables in the argument scope to the variable
36646|       |           scope (see FunctionDeclarationInstantiation() in spec). The
36647|       |           normal arguments are already present, so no need to copy
36648|       |           them. */
36649|      2|        idx = fd->scopes[fd->scope_level].first;
36650|      6|        while (idx >= 0) {
  ------------------
  |  Branch (36650:16): [True: 4, False: 2]
  ------------------
36651|      4|            JSVarDef *vd = &fd->vars[idx];
36652|      4|            if (vd->scope_level != fd->scope_level)
  ------------------
  |  Branch (36652:17): [True: 0, False: 4]
  ------------------
36653|      0|                break;
36654|      4|            if (find_var(ctx, fd, vd->var_name) < 0) {
  ------------------
  |  Branch (36654:17): [True: 2, False: 2]
  ------------------
36655|      2|                if (add_var(ctx, fd, vd->var_name) < 0)
  ------------------
  |  Branch (36655:21): [True: 0, False: 2]
  ------------------
36656|      0|                    goto fail;
36657|      2|                vd = &fd->vars[idx]; /* fd->vars may have been reallocated */
36658|      2|                emit_op(s, OP_scope_get_var);
36659|      2|                emit_atom(s, vd->var_name);
36660|      2|                emit_u16(s, fd->scope_level);
36661|      2|                emit_op(s, OP_scope_put_var);
36662|      2|                emit_atom(s, vd->var_name);
36663|      2|                emit_u16(s, 0);
36664|      2|            }
36665|      4|            idx = vd->scope_next;
36666|      4|        }
36667|       |
36668|       |        /* the argument scope has no parent, hence we don't use pop_scope(s) */
36669|      2|        emit_op(s, OP_leave_scope);
36670|      2|        emit_u16(s, fd->scope_level);
36671|       |
36672|       |        /* set the variable scope as the current scope */
36673|      2|        fd->scope_level = 0;
36674|      2|        fd->scope_first = fd->scopes[fd->scope_level].first;
36675|      2|    }
36676|       |
36677|      5|    if (next_token(s))
  ------------------
  |  Branch (36677:9): [True: 0, False: 5]
  ------------------
36678|      0|        goto fail;
36679|       |
36680|       |    /* generator function: yield after the parameters are evaluated */
36681|      5|    if (func_kind == JS_FUNC_GENERATOR ||
  ------------------
  |  Branch (36681:9): [True: 1, False: 4]
  ------------------
36682|      4|        func_kind == JS_FUNC_ASYNC_GENERATOR)
  ------------------
  |  Branch (36682:9): [True: 0, False: 4]
  ------------------
36683|      1|        emit_op(s, OP_initial_yield);
36684|       |
36685|       |    /* in generators, yield expression is forbidden during the parsing
36686|       |       of the arguments */
36687|      5|    fd->in_function_body = TRUE;
36688|      5|    push_scope(s);  /* enter body scope */
36689|      5|    fd->body_scope = fd->scope_level;
36690|       |
36691|      5|    if (s->token.val == TOK_ARROW && func_type == JS_PARSE_FUNC_ARROW) {
  ------------------
  |  Branch (36691:9): [True: 2, False: 3]
  |  Branch (36691:38): [True: 2, False: 0]
  ------------------
36692|      2|        if (next_token(s))
  ------------------
  |  Branch (36692:13): [True: 0, False: 2]
  ------------------
36693|      0|            goto fail;
36694|       |
36695|      2|        if (s->token.val != '{') {
  ------------------
  |  Branch (36695:13): [True: 2, False: 0]
  ------------------
36696|      2|            if (js_parse_function_check_names(s, fd, func_name))
  ------------------
  |  Branch (36696:17): [True: 0, False: 2]
  ------------------
36697|      0|                goto fail;
36698|       |
36699|      2|            if (js_parse_assign_expr(s))
  ------------------
  |  Branch (36699:17): [True: 0, False: 2]
  ------------------
36700|      0|                goto fail;
36701|       |
36702|      2|            if (func_kind != JS_FUNC_NORMAL)
  ------------------
  |  Branch (36702:17): [True: 0, False: 2]
  ------------------
36703|      0|                emit_op(s, OP_return_async);
36704|      2|            else
36705|      2|                emit_op(s, OP_return);
36706|       |
36707|      2|            if (!fd->strip_source) {
  ------------------
  |  Branch (36707:17): [True: 2, False: 0]
  ------------------
36708|       |                /* save the function source code */
36709|       |                /* the end of the function source code is after the last
36710|       |                   token of the function source stored into s->last_ptr */
36711|      2|                fd->source_len = s->last_ptr - ptr;
36712|      2|                fd->source = js_strndup(ctx, (const char *)ptr, fd->source_len);
36713|      2|                if (!fd->source)
  ------------------
  |  Branch (36713:21): [True: 0, False: 2]
  ------------------
36714|      0|                    goto fail;
36715|      2|            }
36716|      2|            goto done;
36717|      2|        }
36718|      2|    }
36719|       |
36720|      3|    if (func_type != JS_PARSE_FUNC_CLASS_STATIC_INIT) {
  ------------------
  |  Branch (36720:9): [True: 3, False: 0]
  ------------------
36721|      3|        if (js_parse_expect(s, '{'))
  ------------------
  |  Branch (36721:13): [True: 0, False: 3]
  ------------------
36722|      0|            goto fail;
36723|      3|    }
36724|       |
36725|      3|    if (js_parse_directives(s))
  ------------------
  |  Branch (36725:9): [True: 0, False: 3]
  ------------------
36726|      0|        goto fail;
36727|       |
36728|       |    /* in strict_mode, check function and argument names */
36729|      3|    if (js_parse_function_check_names(s, fd, func_name))
  ------------------
  |  Branch (36729:9): [True: 0, False: 3]
  ------------------
36730|      0|        goto fail;
36731|       |
36732|      8|    while (s->token.val != '}') {
  ------------------
  |  Branch (36732:12): [True: 7, False: 1]
  ------------------
36733|      7|        if (js_parse_source_element(s))
  ------------------
  |  Branch (36733:13): [True: 2, False: 5]
  ------------------
36734|      2|            goto fail;
36735|      7|    }
36736|      1|    if (!fd->strip_source) {
  ------------------
  |  Branch (36736:9): [True: 1, False: 0]
  ------------------
36737|       |        /* save the function source code */
36738|      1|        fd->source_len = s->buf_ptr - ptr;
36739|      1|        fd->source = js_strndup(ctx, (const char *)ptr, fd->source_len);
36740|      1|        if (!fd->source)
  ------------------
  |  Branch (36740:13): [True: 0, False: 1]
  ------------------
36741|      0|            goto fail;
36742|      1|    }
36743|       |
36744|      1|    if (next_token(s)) {
  ------------------
  |  Branch (36744:9): [True: 0, False: 1]
  ------------------
36745|       |        /* consume the '}' */
36746|      0|        goto fail;
36747|      0|    }
36748|       |
36749|       |    /* in case there is no return, add one */
36750|      1|    if (js_is_live_code(s)) {
  ------------------
  |  Branch (36750:9): [True: 1, False: 0]
  ------------------
36751|      1|        emit_return(s, FALSE);
36752|      1|    }
36753|      3| done:
36754|      3|    s->cur_func = fd->parent;
36755|       |
36756|       |    /* Reparse identifiers after the function is terminated so that
36757|       |       the token is parsed in the englobing function. It could be done
36758|       |       by just using next_token() here for normal functions, but it is
36759|       |       necessary for arrow functions with an expression body. */
36760|      3|    reparse_ident_token(s);
36761|       |
36762|       |    /* create the function object */
36763|      3|    {
36764|      3|        int idx;
36765|      3|        JSAtom func_name = fd->func_name;
36766|       |
36767|       |        /* the real object will be set at the end of the compilation */
36768|      3|        idx = cpool_add(s, JS_NULL);
  ------------------
  |  |  288|      3|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|      3|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
36769|      3|        fd->parent_cpool_idx = idx;
36770|       |
36771|      3|        if (is_expr) {
  ------------------
  |  Branch (36771:13): [True: 2, False: 1]
  ------------------
36772|       |            /* for constructors, no code needs to be generated here */
36773|      2|            if (func_type != JS_PARSE_FUNC_CLASS_CONSTRUCTOR &&
  ------------------
  |  Branch (36773:17): [True: 2, False: 0]
  ------------------
36774|      2|                func_type != JS_PARSE_FUNC_DERIVED_CLASS_CONSTRUCTOR) {
  ------------------
  |  Branch (36774:17): [True: 2, False: 0]
  ------------------
36775|       |                /* OP_fclosure creates the function object from the bytecode
36776|       |                   and adds the scope information */
36777|      2|                emit_op(s, OP_fclosure);
36778|      2|                emit_u32(s, idx);
36779|      2|                if (func_name == JS_ATOM_NULL) {
  ------------------
  |  |  449|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (36779:21): [True: 2, False: 0]
  ------------------
36780|      2|                    emit_op(s, OP_set_name);
36781|      2|                    emit_u32(s, JS_ATOM_NULL);
  ------------------
  |  |  449|      2|#define JS_ATOM_NULL 0
  ------------------
36782|      2|                }
36783|      2|            }
36784|      2|        } else if (func_type == JS_PARSE_FUNC_VAR) {
  ------------------
  |  Branch (36784:20): [True: 0, False: 1]
  ------------------
36785|      0|            emit_op(s, OP_fclosure);
36786|      0|            emit_u32(s, idx);
36787|      0|            if (create_func_var) {
  ------------------
  |  Branch (36787:17): [True: 0, False: 0]
  ------------------
36788|      0|                if (s->cur_func->is_global_var) {
  ------------------
  |  Branch (36788:21): [True: 0, False: 0]
  ------------------
36789|      0|                    JSGlobalVar *hf;
36790|       |                    /* the global variable must be defined at the start of the
36791|       |                       function */
36792|      0|                    hf = add_global_var(ctx, s->cur_func, func_name);
36793|      0|                    if (!hf)
  ------------------
  |  Branch (36793:25): [True: 0, False: 0]
  ------------------
36794|      0|                        goto fail;
36795|       |                    /* it is considered as defined at the top level
36796|       |                       (needed for annex B.3.3.4 and B.3.3.5
36797|       |                       checks) */
36798|      0|                    hf->scope_level = 0;
36799|      0|                    hf->force_init = ((s->cur_func->js_mode & JS_MODE_STRICT) != 0);
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
36800|       |                    /* store directly into global var, bypass lexical scope */
36801|      0|                    emit_op(s, OP_dup);
36802|      0|                    emit_op(s, OP_scope_put_var);
36803|      0|                    emit_atom(s, func_name);
36804|      0|                    emit_u16(s, 0);
36805|      0|                } else {
36806|       |                    /* do not call define_var to bypass lexical scope check */
36807|      0|                    func_idx = find_var(ctx, s->cur_func, func_name);
36808|      0|                    if (func_idx < 0) {
  ------------------
  |  Branch (36808:25): [True: 0, False: 0]
  ------------------
36809|      0|                        func_idx = add_var(ctx, s->cur_func, func_name);
36810|      0|                        if (func_idx < 0)
  ------------------
  |  Branch (36810:29): [True: 0, False: 0]
  ------------------
36811|      0|                            goto fail;
36812|      0|                    }
36813|       |                    /* store directly into local var, bypass lexical catch scope */
36814|      0|                    emit_op(s, OP_dup);
36815|      0|                    emit_op(s, OP_scope_put_var);
36816|      0|                    emit_atom(s, func_name);
36817|      0|                    emit_u16(s, 0);
36818|      0|                }
36819|      0|            }
36820|      0|            if (lexical_func_idx >= 0) {
  ------------------
  |  Branch (36820:17): [True: 0, False: 0]
  ------------------
36821|       |                /* lexical variable will be initialized upon entering scope */
36822|      0|                s->cur_func->vars[lexical_func_idx].func_pool_idx = idx;
36823|      0|                emit_op(s, OP_drop);
36824|      0|            } else {
36825|       |                /* store function object into its lexical name */
36826|       |                /* XXX: could use OP_put_loc directly */
36827|      0|                emit_op(s, OP_scope_put_var_init);
36828|      0|                emit_atom(s, func_name);
36829|      0|                emit_u16(s, s->cur_func->scope_level);
36830|      0|            }
36831|      1|        } else {
36832|      1|            if (!s->cur_func->is_global_var) {
  ------------------
  |  Branch (36832:17): [True: 0, False: 1]
  ------------------
36833|      0|                int var_idx = define_var(s, s->cur_func, func_name, JS_VAR_DEF_VAR);
36834|       |
36835|      0|                if (var_idx < 0)
  ------------------
  |  Branch (36835:21): [True: 0, False: 0]
  ------------------
36836|      0|                    goto fail;
36837|       |                /* the variable will be assigned at the top of the function */
36838|      0|                if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16196|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (36838:21): [True: 0, False: 0]
  ------------------
36839|      0|                    s->cur_func->args[var_idx - ARGUMENT_VAR_OFFSET].func_pool_idx = idx;
  ------------------
  |  |16196|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
36840|      0|                } else {
36841|      0|                    s->cur_func->vars[var_idx].func_pool_idx = idx;
36842|      0|                }
36843|      1|            } else {
36844|      1|                JSAtom func_var_name;
36845|      1|                JSGlobalVar *hf;
36846|      1|                if (func_name == JS_ATOM_NULL)
  ------------------
  |  |  449|      1|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (36846:21): [True: 0, False: 1]
  ------------------
36847|      0|                    func_var_name = JS_ATOM__default_; /* export default */
36848|      1|                else
36849|      1|                    func_var_name = func_name;
36850|       |                /* the variable will be assigned at the top of the function */
36851|      1|                hf = add_global_var(ctx, s->cur_func, func_var_name);
36852|      1|                if (!hf)
  ------------------
  |  Branch (36852:21): [True: 0, False: 1]
  ------------------
36853|      0|                    goto fail;
36854|      1|                hf->cpool_idx = idx;
36855|      1|                if (export_flag != JS_PARSE_EXPORT_NONE) {
  ------------------
  |  Branch (36855:21): [True: 0, False: 1]
  ------------------
36856|      0|                    if (!add_export_entry(s, s->cur_func->module, func_var_name,
  ------------------
  |  Branch (36856:25): [True: 0, False: 0]
  ------------------
36857|      0|                                          export_flag == JS_PARSE_EXPORT_NAMED ? func_var_name : JS_ATOM_default, JS_EXPORT_TYPE_LOCAL))
  ------------------
  |  Branch (36857:43): [True: 0, False: 0]
  ------------------
36858|      0|                        goto fail;
36859|      0|                }
36860|      1|            }
36861|      1|        }
36862|      3|    }
36863|      3|    return 0;
36864|      2| fail:
36865|      2|    s->cur_func = fd->parent;
36866|      2|    js_free_function_def(ctx, fd);
36867|      2|    if (pfd)
  ------------------
  |  Branch (36867:9): [True: 0, False: 2]
  ------------------
36868|      0|        *pfd = NULL;
36869|      2|    return -1;
36870|      3|}
quickjs.c:find_global_var:
23881|     20|{
23882|     20|    int i;
23883|     36|    for(i = 0; i < fd->global_var_count; i++) {
  ------------------
  |  Branch (23883:16): [True: 16, False: 20]
  ------------------
23884|     16|        JSGlobalVar *hf = &fd->global_vars[i];
23885|     16|        if (hf->var_name == name)
  ------------------
  |  Branch (23885:13): [True: 0, False: 16]
  ------------------
23886|      0|            return hf;
23887|     16|    }
23888|     20|    return NULL;
23889|       |
23890|     20|}
quickjs.c:find_lexical_decl:
23903|     21|{
23904|     24|    while (scope_idx >= 0) {
  ------------------
  |  Branch (23904:12): [True: 3, False: 21]
  ------------------
23905|      3|        JSVarDef *vd = &fd->vars[scope_idx];
23906|      3|        if (vd->var_name == name &&
  ------------------
  |  Branch (23906:13): [True: 0, False: 3]
  ------------------
23907|      0|            (vd->is_lexical || (vd->var_kind == JS_VAR_CATCH &&
  ------------------
  |  Branch (23907:14): [True: 0, False: 0]
  |  Branch (23907:33): [True: 0, False: 0]
  ------------------
23908|      0|                                check_catch_var)))
  ------------------
  |  Branch (23908:33): [True: 0, False: 0]
  ------------------
23909|      0|            return scope_idx;
23910|      3|        scope_idx = vd->scope_next;
23911|      3|    }
23912|       |
23913|     21|    if (fd->is_eval && fd->eval_type == JS_EVAL_TYPE_GLOBAL) {
  ------------------
  |  |  330|     10|#define JS_EVAL_TYPE_GLOBAL   (0 << 0) /* global code (default) */
  ------------------
  |  Branch (23913:9): [True: 10, False: 11]
  |  Branch (23913:24): [True: 10, False: 0]
  ------------------
23914|     10|        if (find_lexical_global_var(fd, name))
  ------------------
  |  Branch (23914:13): [True: 0, False: 10]
  ------------------
23915|      0|            return GLOBAL_VAR_OFFSET;
  ------------------
  |  |16195|      0|#define GLOBAL_VAR_OFFSET 0x40000000
  ------------------
23916|     10|    }
23917|     21|    return -1;
23918|     21|}
quickjs.c:find_lexical_global_var:
23893|     10|{
23894|     10|    JSGlobalVar *hf = find_global_var(fd, name);
23895|     10|    if (hf && hf->is_lexical)
  ------------------
  |  Branch (23895:9): [True: 0, False: 10]
  |  Branch (23895:15): [True: 0, False: 0]
  ------------------
23896|      0|        return hf;
23897|     10|    else
23898|     10|        return NULL;
23899|     10|}
quickjs.c:find_var:
23826|     92|{
23827|     92|    int i;
23828|    157|    for(i = fd->var_count; i-- > 0;) {
  ------------------
  |  Branch (23828:28): [True: 65, False: 92]
  ------------------
23829|     65|        if (fd->vars[i].var_name == name && fd->vars[i].scope_level == 0)
  ------------------
  |  Branch (23829:13): [True: 9, False: 56]
  |  Branch (23829:45): [True: 0, False: 9]
  ------------------
23830|      0|            return i;
23831|     65|    }
23832|     92|    return find_arg(ctx, fd, name);
23833|     92|}
quickjs.c:find_arg:
23816|     92|{
23817|     92|    int i;
23818|    108|    for(i = fd->arg_count; i-- > 0;) {
  ------------------
  |  Branch (23818:28): [True: 24, False: 84]
  ------------------
23819|     24|        if (fd->args[i].var_name == name)
  ------------------
  |  Branch (23819:13): [True: 8, False: 16]
  ------------------
23820|      8|            return i | ARGUMENT_VAR_OFFSET;
  ------------------
  |  |16196|      8|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
23821|     24|    }
23822|     84|    return -1;
23823|     92|}
quickjs.c:define_var:
24119|     20|{
24120|     20|    JSContext *ctx = s->ctx;
24121|     20|    JSVarDef *vd;
24122|     20|    int idx;
24123|       |
24124|     20|    switch (var_def_type) {
24125|      0|    case JS_VAR_DEF_WITH:
  ------------------
  |  Branch (24125:5): [True: 0, False: 20]
  ------------------
24126|      0|        idx = add_scope_var(ctx, fd, name, JS_VAR_NORMAL);
24127|      0|        break;
24128|       |
24129|     18|    case JS_VAR_DEF_LET:
  ------------------
  |  Branch (24129:5): [True: 18, False: 2]
  ------------------
24130|     18|    case JS_VAR_DEF_CONST:
  ------------------
  |  Branch (24130:5): [True: 0, False: 20]
  ------------------
24131|     19|    case JS_VAR_DEF_FUNCTION_DECL:
  ------------------
  |  Branch (24131:5): [True: 1, False: 19]
  ------------------
24132|     20|    case JS_VAR_DEF_NEW_FUNCTION_DECL:
  ------------------
  |  Branch (24132:5): [True: 1, False: 19]
  ------------------
24133|     20|        idx = find_lexical_decl(ctx, fd, name, fd->scope_first, TRUE);
24134|     20|        if (idx >= 0) {
  ------------------
  |  Branch (24134:13): [True: 0, False: 20]
  ------------------
24135|      0|            if (idx < GLOBAL_VAR_OFFSET) {
  ------------------
  |  |16195|      0|#define GLOBAL_VAR_OFFSET 0x40000000
  ------------------
  |  Branch (24135:17): [True: 0, False: 0]
  ------------------
24136|      0|                if (fd->vars[idx].scope_level == fd->scope_level) {
  ------------------
  |  Branch (24136:21): [True: 0, False: 0]
  ------------------
24137|       |                    /* same scope: in non strict mode, functions
24138|       |                       can be redefined (annex B.3.3.4). */
24139|      0|                    if (!(!(fd->js_mode & JS_MODE_STRICT) &&
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (24139:27): [True: 0, False: 0]
  ------------------
24140|      0|                          var_def_type == JS_VAR_DEF_FUNCTION_DECL &&
  ------------------
  |  Branch (24140:27): [True: 0, False: 0]
  ------------------
24141|      0|                          fd->vars[idx].var_kind == JS_VAR_FUNCTION_DECL)) {
  ------------------
  |  Branch (24141:27): [True: 0, False: 0]
  ------------------
24142|      0|                        goto redef_lex_error;
24143|      0|                    }
24144|      0|                } else if (fd->vars[idx].var_kind == JS_VAR_CATCH && (fd->vars[idx].scope_level + 2) == fd->scope_level) {
  ------------------
  |  Branch (24144:28): [True: 0, False: 0]
  |  Branch (24144:70): [True: 0, False: 0]
  ------------------
24145|      0|                    goto redef_lex_error;
24146|      0|                }
24147|      0|            } else {
24148|      0|                if (fd->scope_level == fd->body_scope) {
  ------------------
  |  Branch (24148:21): [True: 0, False: 0]
  ------------------
24149|      0|                redef_lex_error:
24150|       |                    /* redefining a scoped var in the same scope: error */
24151|      0|                    return js_parse_error(s, "invalid redefinition of lexical identifier");
24152|      0|                }
24153|      0|            }
24154|      0|        }
24155|     20|        if (var_def_type != JS_VAR_DEF_FUNCTION_DECL &&
  ------------------
  |  Branch (24155:13): [True: 19, False: 1]
  ------------------
24156|     19|            var_def_type != JS_VAR_DEF_NEW_FUNCTION_DECL &&
  ------------------
  |  Branch (24156:13): [True: 18, False: 1]
  ------------------
24157|     18|            fd->scope_level == fd->body_scope &&
  ------------------
  |  Branch (24157:13): [True: 0, False: 18]
  ------------------
24158|      0|            find_arg(ctx, fd, name) >= 0) {
  ------------------
  |  Branch (24158:13): [True: 0, False: 0]
  ------------------
24159|       |            /* lexical variable redefines a parameter name */
24160|      0|            return js_parse_error(s, "invalid redefinition of parameter name");
24161|      0|        }
24162|       |
24163|     20|        if (find_var_in_child_scope(ctx, fd, name, fd->scope_level) >= 0) {
  ------------------
  |  Branch (24163:13): [True: 0, False: 20]
  ------------------
24164|      0|            return js_parse_error(s, "invalid redefinition of a variable");
24165|      0|        }
24166|       |
24167|     20|        if (fd->is_global_var) {
  ------------------
  |  Branch (24167:13): [True: 10, False: 10]
  ------------------
24168|     10|            JSGlobalVar *hf;
24169|     10|            hf = find_global_var(fd, name);
24170|     10|            if (hf && is_child_scope(ctx, fd, hf->scope_level,
  ------------------
  |  Branch (24170:17): [True: 0, False: 10]
  |  Branch (24170:23): [True: 0, False: 0]
  ------------------
24171|      0|                                     fd->scope_level)) {
24172|      0|                return js_parse_error(s, "invalid redefinition of global identifier");
24173|      0|            }
24174|     10|        }
24175|       |
24176|     20|        if (fd->is_eval &&
  ------------------
  |  Branch (24176:13): [True: 10, False: 10]
  ------------------
24177|     10|            (fd->eval_type == JS_EVAL_TYPE_GLOBAL ||
  ------------------
  |  |  330|     20|#define JS_EVAL_TYPE_GLOBAL   (0 << 0) /* global code (default) */
  ------------------
  |  Branch (24177:14): [True: 10, False: 0]
  ------------------
24178|      0|             fd->eval_type == JS_EVAL_TYPE_MODULE) &&
  ------------------
  |  |  331|      0|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (24178:14): [True: 0, False: 0]
  ------------------
24179|     10|            fd->scope_level == fd->body_scope) {
  ------------------
  |  Branch (24179:13): [True: 0, False: 10]
  ------------------
24180|      0|            JSGlobalVar *hf;
24181|      0|            hf = add_global_var(s->ctx, fd, name);
24182|      0|            if (!hf)
  ------------------
  |  Branch (24182:17): [True: 0, False: 0]
  ------------------
24183|      0|                return -1;
24184|      0|            hf->is_lexical = TRUE;
24185|      0|            hf->is_const = (var_def_type == JS_VAR_DEF_CONST);
24186|      0|            idx = GLOBAL_VAR_OFFSET;
  ------------------
  |  |16195|      0|#define GLOBAL_VAR_OFFSET 0x40000000
  ------------------
24187|     20|        } else {
24188|     20|            JSVarKindEnum var_kind;
24189|     20|            if (var_def_type == JS_VAR_DEF_FUNCTION_DECL)
  ------------------
  |  Branch (24189:17): [True: 1, False: 19]
  ------------------
24190|      1|                var_kind = JS_VAR_FUNCTION_DECL;
24191|     19|            else if (var_def_type == JS_VAR_DEF_NEW_FUNCTION_DECL)
  ------------------
  |  Branch (24191:22): [True: 1, False: 18]
  ------------------
24192|      1|                var_kind = JS_VAR_NEW_FUNCTION_DECL;
24193|     18|            else
24194|     18|                var_kind = JS_VAR_NORMAL;
24195|     20|            idx = add_scope_var(ctx, fd, name, var_kind);
24196|     20|            if (idx >= 0) {
  ------------------
  |  Branch (24196:17): [True: 20, False: 0]
  ------------------
24197|     20|                vd = &fd->vars[idx];
24198|     20|                vd->is_lexical = 1;
24199|     20|                vd->is_const = (var_def_type == JS_VAR_DEF_CONST);
24200|     20|            }
24201|     20|        }
24202|     20|        break;
24203|       |
24204|     20|    case JS_VAR_DEF_CATCH:
  ------------------
  |  Branch (24204:5): [True: 0, False: 20]
  ------------------
24205|      0|        idx = add_scope_var(ctx, fd, name, JS_VAR_CATCH);
24206|      0|        break;
24207|       |
24208|      0|    case JS_VAR_DEF_VAR:
  ------------------
  |  Branch (24208:5): [True: 0, False: 20]
  ------------------
24209|      0|        if (find_lexical_decl(ctx, fd, name, fd->scope_first,
  ------------------
  |  Branch (24209:13): [True: 0, False: 0]
  ------------------
24210|      0|                              FALSE) >= 0) {
24211|      0|       invalid_lexical_redefinition:
24212|       |            /* error to redefine a var that inside a lexical scope */
24213|      0|            return js_parse_error(s, "invalid redefinition of lexical identifier");
24214|      0|        }
24215|      0|        if (fd->is_global_var) {
  ------------------
  |  Branch (24215:13): [True: 0, False: 0]
  ------------------
24216|      0|            JSGlobalVar *hf;
24217|      0|            hf = find_global_var(fd, name);
24218|      0|            if (hf && hf->is_lexical && hf->scope_level == fd->scope_level &&
  ------------------
  |  Branch (24218:17): [True: 0, False: 0]
  |  Branch (24218:23): [True: 0, False: 0]
  |  Branch (24218:41): [True: 0, False: 0]
  ------------------
24219|      0|                fd->eval_type == JS_EVAL_TYPE_MODULE) {
  ------------------
  |  |  331|      0|#define JS_EVAL_TYPE_MODULE   (1 << 0) /* module code */
  ------------------
  |  Branch (24219:17): [True: 0, False: 0]
  ------------------
24220|      0|                goto invalid_lexical_redefinition;
24221|      0|            }
24222|      0|            hf = add_global_var(s->ctx, fd, name);
24223|      0|            if (!hf)
  ------------------
  |  Branch (24223:17): [True: 0, False: 0]
  ------------------
24224|      0|                return -1;
24225|      0|            idx = GLOBAL_VAR_OFFSET;
  ------------------
  |  |16195|      0|#define GLOBAL_VAR_OFFSET 0x40000000
  ------------------
24226|      0|        } else {
24227|       |            /* if the variable already exists, don't add it again  */
24228|      0|            idx = find_var(ctx, fd, name);
24229|      0|            if (idx >= 0)
  ------------------
  |  Branch (24229:17): [True: 0, False: 0]
  ------------------
24230|      0|                break;
24231|      0|            idx = add_var(ctx, fd, name);
24232|      0|            if (idx >= 0) {
  ------------------
  |  Branch (24232:17): [True: 0, False: 0]
  ------------------
24233|      0|                if (name == JS_ATOM_arguments && fd->has_arguments_binding)
  ------------------
  |  Branch (24233:21): [True: 0, False: 0]
  |  Branch (24233:50): [True: 0, False: 0]
  ------------------
24234|      0|                    fd->arguments_var_idx = idx;
24235|      0|                fd->vars[idx].scope_next = fd->scope_level;
24236|      0|            }
24237|      0|        }
24238|      0|        break;
24239|      0|    default:
  ------------------
  |  Branch (24239:5): [True: 0, False: 20]
  ------------------
24240|      0|        abort();
24241|     20|    }
24242|     20|    return idx;
24243|     20|}
quickjs.c:add_scope_var:
24009|     20|{
24010|     20|    int idx = add_var(ctx, fd, name);
24011|     20|    if (idx >= 0) {
  ------------------
  |  Branch (24011:9): [True: 20, False: 0]
  ------------------
24012|     20|        JSVarDef *vd = &fd->vars[idx];
24013|     20|        vd->var_kind = var_kind;
24014|     20|        vd->scope_level = fd->scope_level;
24015|     20|        vd->scope_next = fd->scope_first;
24016|     20|        fd->scopes[fd->scope_level].first = idx;
24017|     20|        fd->scope_first = idx;
24018|     20|    }
24019|     20|    return idx;
24020|     20|}
quickjs.c:find_var_in_child_scope:
23866|     20|{
23867|     20|    int i;
23868|     70|    for(i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (23868:16): [True: 50, False: 20]
  ------------------
23869|     50|        JSVarDef *vd = &fd->vars[i];
23870|     50|        if (vd->var_name == name && vd->scope_level == 0) {
  ------------------
  |  Branch (23870:13): [True: 31, False: 19]
  |  Branch (23870:37): [True: 0, False: 31]
  ------------------
23871|      0|            if (is_child_scope(ctx, fd, vd->scope_next,
  ------------------
  |  Branch (23871:17): [True: 0, False: 0]
  ------------------
23872|      0|                               scope_level))
23873|      0|                return i;
23874|      0|        }
23875|     50|    }
23876|     20|    return -1;
23877|     20|}
quickjs.c:add_arg:
24069|      8|{
24070|      8|    JSVarDef *vd;
24071|       |
24072|       |    /* the local variable indexes are currently stored on 16 bits */
24073|      8|    if (fd->arg_count >= JS_MAX_LOCAL_VARS) {
  ------------------
  |  |  208|      8|#define JS_MAX_LOCAL_VARS 65534
  ------------------
  |  Branch (24073:9): [True: 0, False: 8]
  ------------------
24074|      0|        JS_ThrowInternalError(ctx, "too many arguments");
24075|      0|        return -1;
24076|      0|    }
24077|      8|    if (js_resize_array(ctx, (void **)&fd->args, sizeof(fd->args[0]),
  ------------------
  |  Branch (24077:9): [True: 0, False: 8]
  ------------------
24078|      8|                        &fd->arg_size, fd->arg_count + 1))
24079|      0|        return -1;
24080|      8|    vd = &fd->args[fd->arg_count++];
24081|      8|    memset(vd, 0, sizeof(*vd));
24082|      8|    vd->var_name = JS_DupAtom(ctx, name);
24083|      8|    vd->func_pool_idx = -1;
24084|      8|    return fd->arg_count - 1;
24085|      8|}
quickjs.c:js_parse_skip_parens_token:
24615|     24|{
24616|     24|    char state[256];
24617|     24|    size_t level = 0;
24618|     24|    JSParsePos pos;
24619|     24|    int last_tok, tok = TOK_EOF;
24620|     24|    int c, tok_len, bits = 0;
24621|     24|    const uint8_t *last_token_ptr;
24622|       |    
24623|       |    /* protect from underflow */
24624|     24|    state[level++] = 0;
24625|       |
24626|     24|    js_parse_get_pos(s, &pos);
24627|     24|    last_tok = 0;
24628|    159|    for (;;) {
24629|    159|        switch(s->token.val) {
  ------------------
  |  Branch (24629:16): [True: 75, False: 84]
  ------------------
24630|     22|        case '(':
  ------------------
  |  Branch (24630:9): [True: 22, False: 137]
  ------------------
24631|     22|        case '[':
  ------------------
  |  Branch (24631:9): [True: 0, False: 159]
  ------------------
24632|     28|        case '{':
  ------------------
  |  Branch (24632:9): [True: 6, False: 153]
  ------------------
24633|     28|            if (level >= sizeof(state))
  ------------------
  |  Branch (24633:17): [True: 0, False: 28]
  ------------------
24634|      0|                goto done;
24635|     28|            state[level++] = s->token.val;
24636|     28|            break;
24637|     22|        case ')':
  ------------------
  |  Branch (24637:9): [True: 22, False: 137]
  ------------------
24638|     22|            if (state[--level] != '(')
  ------------------
  |  Branch (24638:17): [True: 0, False: 22]
  ------------------
24639|      0|                goto done;
24640|     22|            break;
24641|     22|        case ']':
  ------------------
  |  Branch (24641:9): [True: 0, False: 159]
  ------------------
24642|      0|            if (state[--level] != '[')
  ------------------
  |  Branch (24642:17): [True: 0, False: 0]
  ------------------
24643|      0|                goto done;
24644|      0|            break;
24645|      6|        case '}':
  ------------------
  |  Branch (24645:9): [True: 6, False: 153]
  ------------------
24646|      6|            c = state[--level];
24647|      6|            if (c == '`') {
  ------------------
  |  Branch (24647:17): [True: 0, False: 6]
  ------------------
24648|       |                /* continue the parsing of the template */
24649|      0|                free_token(s, &s->token);
24650|       |                /* Resume TOK_TEMPLATE parsing (s->token.line_num and
24651|       |                 * s->token.ptr are OK) */
24652|      0|                s->got_lf = FALSE;
24653|      0|                if (js_parse_template_part(s, s->buf_ptr))
  ------------------
  |  Branch (24653:21): [True: 0, False: 0]
  ------------------
24654|      0|                    goto done;
24655|      0|                goto handle_template;
24656|      6|            } else if (c != '{') {
  ------------------
  |  Branch (24656:24): [True: 0, False: 6]
  ------------------
24657|      0|                goto done;
24658|      0|            }
24659|      6|            break;
24660|     15|        case TOK_TEMPLATE:
  ------------------
  |  Branch (24660:9): [True: 15, False: 144]
  ------------------
24661|     15|        handle_template:
24662|     15|            if (s->token.u.str.sep != '`') {
  ------------------
  |  Branch (24662:17): [True: 0, False: 15]
  ------------------
24663|       |                /* '${' inside the template : closing '}' and continue
24664|       |                   parsing the template */
24665|      0|                if (level >= sizeof(state))
  ------------------
  |  Branch (24665:21): [True: 0, False: 0]
  ------------------
24666|      0|                    goto done;
24667|      0|                state[level++] = '`';
24668|      0|            }
24669|     15|            break;
24670|     15|        case TOK_EOF:
  ------------------
  |  Branch (24670:9): [True: 0, False: 159]
  ------------------
24671|      0|            goto done;
24672|      0|        case ';':
  ------------------
  |  Branch (24672:9): [True: 0, False: 159]
  ------------------
24673|      0|            if (level == 2) {
  ------------------
  |  Branch (24673:17): [True: 0, False: 0]
  ------------------
24674|      0|                bits |= SKIP_HAS_SEMI;
  ------------------
  |  |24596|      0|#define SKIP_HAS_SEMI       (1 << 0)
  ------------------
24675|      0|            }
24676|      0|            break;
24677|      0|        case TOK_ELLIPSIS:
  ------------------
  |  Branch (24677:9): [True: 0, False: 159]
  ------------------
24678|      0|            if (level == 2) {
  ------------------
  |  Branch (24678:17): [True: 0, False: 0]
  ------------------
24679|      0|                bits |= SKIP_HAS_ELLIPSIS;
  ------------------
  |  |24597|      0|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
24680|      0|            }
24681|      0|            break;
24682|      4|        case '=':
  ------------------
  |  Branch (24682:9): [True: 4, False: 155]
  ------------------
24683|      4|            bits |= SKIP_HAS_ASSIGNMENT;
  ------------------
  |  |24598|      4|#define SKIP_HAS_ASSIGNMENT (1 << 2)
  ------------------
24684|      4|            break;
24685|       |
24686|      0|        case TOK_DIV_ASSIGN:
  ------------------
  |  Branch (24686:9): [True: 0, False: 159]
  ------------------
24687|      0|            tok_len = 2;
24688|      0|            goto parse_regexp;
24689|      0|        case '/':
  ------------------
  |  Branch (24689:9): [True: 0, False: 159]
  ------------------
24690|      0|            tok_len = 1;
24691|      0|        parse_regexp:
24692|      0|            if (is_regexp_allowed(last_tok)) {
  ------------------
  |  Branch (24692:17): [True: 0, False: 0]
  ------------------
24693|      0|                s->buf_ptr -= tok_len;
24694|      0|                if (js_parse_regexp(s)) {
  ------------------
  |  Branch (24694:21): [True: 0, False: 0]
  ------------------
24695|       |                    /* XXX: should clear the exception */
24696|      0|                    goto done;
24697|      0|                }
24698|      0|            }
24699|      0|            break;
24700|    159|        }
24701|       |        /* last_tok is only used to recognize regexps */
24702|    159|        if (s->token.val == TOK_IDENT &&
  ------------------
  |  Branch (24702:13): [True: 50, False: 109]
  ------------------
24703|     50|            (token_is_pseudo_keyword(s, JS_ATOM_of) ||
  ------------------
  |  Branch (24703:14): [True: 1, False: 49]
  ------------------
24704|     49|             token_is_pseudo_keyword(s, JS_ATOM_yield))) {
  ------------------
  |  Branch (24704:14): [True: 0, False: 49]
  ------------------
24705|      1|            last_tok = TOK_OF;
24706|    158|        } else {
24707|    158|            last_tok = s->token.val;
24708|    158|        }
24709|    159|        last_token_ptr = s->token.ptr;
24710|    159|        if (next_token(s)) {
  ------------------
  |  Branch (24710:13): [True: 0, False: 159]
  ------------------
24711|       |            /* XXX: should clear the exception generated by next_token() */
24712|      0|            break;
24713|      0|        }
24714|    159|        if (level <= 1) {
  ------------------
  |  Branch (24714:13): [True: 24, False: 135]
  ------------------
24715|     24|            tok = s->token.val;
24716|     24|            if (token_is_pseudo_keyword(s, JS_ATOM_of))
  ------------------
  |  Branch (24716:17): [True: 0, False: 24]
  ------------------
24717|      0|                tok = TOK_OF;
24718|     24|            if (no_line_terminator && has_lf_in_range(last_token_ptr, s->token.ptr))
  ------------------
  |  Branch (24718:17): [True: 2, False: 22]
  |  Branch (24718:39): [True: 0, False: 2]
  ------------------
24719|      0|                tok = '\n';
24720|     24|            break;
24721|     24|        }
24722|    159|    }
24723|     24| done:
24724|     24|    if (pbits) {
  ------------------
  |  Branch (24724:9): [True: 22, False: 2]
  ------------------
24725|     22|        *pbits = bits;
24726|     22|    }
24727|     24|    if (js_parse_seek_token(s, &pos))
  ------------------
  |  Branch (24727:9): [True: 0, False: 24]
  ------------------
24728|      0|        return -1;
24729|     24|    return tok;
24730|     24|}
quickjs.c:js_parse_regexp:
22418|      1|{
22419|      1|    const uint8_t *p;
22420|      1|    BOOL in_class;
22421|      1|    StringBuffer b_s, *b = &b_s;
22422|      1|    StringBuffer b2_s, *b2 = &b2_s;
22423|      1|    uint32_t c;
22424|      1|    JSValue body_str, flags_str;
22425|       |
22426|      1|    p = s->buf_ptr;
22427|      1|    p++;
22428|      1|    in_class = FALSE;
22429|      1|    if (string_buffer_init(s->ctx, b, 32))
  ------------------
  |  Branch (22429:9): [True: 0, False: 1]
  ------------------
22430|      0|        return -1;
22431|      1|    if (string_buffer_init(s->ctx, b2, 1))
  ------------------
  |  Branch (22431:9): [True: 0, False: 1]
  ------------------
22432|      0|        goto fail;
22433|      3|    for(;;) {
22434|      3|        if (p >= s->buf_end) {
  ------------------
  |  Branch (22434:13): [True: 0, False: 3]
  ------------------
22435|      0|        eof_error:
22436|      0|            js_parse_error(s, "unexpected end of regexp");
22437|      0|            goto fail;
22438|      0|        }
22439|      3|        c = *p++;
22440|      3|        if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (22440:13): [True: 0, False: 3]
  |  Branch (22440:26): [True: 0, False: 3]
  ------------------
22441|      0|            goto eol_error;
22442|      3|        } else if (c == '/') {
  ------------------
  |  Branch (22442:20): [True: 1, False: 2]
  ------------------
22443|      1|            if (!in_class)
  ------------------
  |  Branch (22443:17): [True: 1, False: 0]
  ------------------
22444|      1|                break;
22445|      2|        } else if (c == '[') {
  ------------------
  |  Branch (22445:20): [True: 0, False: 2]
  ------------------
22446|      0|            in_class = TRUE;
22447|      2|        } else if (c == ']') {
  ------------------
  |  Branch (22447:20): [True: 0, False: 2]
  ------------------
22448|       |            /* XXX: incorrect as the first character in a class */
22449|      0|            in_class = FALSE;
22450|      2|        } else if (c == '\\') {
  ------------------
  |  Branch (22450:20): [True: 0, False: 2]
  ------------------
22451|      0|            if (string_buffer_putc8(b, c))
  ------------------
  |  Branch (22451:17): [True: 0, False: 0]
  ------------------
22452|      0|                goto fail;
22453|      0|            c = *p++;
22454|      0|            if (c == '\n' || c == '\r')
  ------------------
  |  Branch (22454:17): [True: 0, False: 0]
  |  Branch (22454:30): [True: 0, False: 0]
  ------------------
22455|      0|                goto eol_error;
22456|      0|            else if (c == '\0' && p >= s->buf_end)
  ------------------
  |  Branch (22456:22): [True: 0, False: 0]
  |  Branch (22456:35): [True: 0, False: 0]
  ------------------
22457|      0|                goto eof_error;
22458|      0|            else if (c >= 0x80) {
  ------------------
  |  Branch (22458:22): [True: 0, False: 0]
  ------------------
22459|      0|                const uint8_t *p_next;
22460|      0|                c = unicode_from_utf8(p - 1, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22461|      0|                if (c > 0x10FFFF) {
  ------------------
  |  Branch (22461:21): [True: 0, False: 0]
  ------------------
22462|      0|                    goto invalid_utf8;
22463|      0|                }
22464|      0|                p = p_next;
22465|      0|                if (c == CP_LS || c == CP_PS)
  ------------------
  |  |21703|      0|#define CP_LS   0x2028
  ------------------
                              if (c == CP_LS || c == CP_PS)
  ------------------
  |  |21704|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (22465:21): [True: 0, False: 0]
  |  Branch (22465:35): [True: 0, False: 0]
  ------------------
22466|      0|                    goto eol_error;
22467|      0|            }
22468|      2|        } else if (c >= 0x80) {
  ------------------
  |  Branch (22468:20): [True: 0, False: 2]
  ------------------
22469|      0|            const uint8_t *p_next;
22470|      0|            c = unicode_from_utf8(p - 1, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22471|      0|            if (c > 0x10FFFF) {
  ------------------
  |  Branch (22471:17): [True: 0, False: 0]
  ------------------
22472|      0|            invalid_utf8:
22473|      0|                js_parse_error_pos(s, p - 1, "invalid UTF-8 sequence");
22474|      0|                goto fail;
22475|      0|            }
22476|       |            /* LS or PS are considered as line terminator */
22477|      0|            if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21703|      0|#define CP_LS   0x2028
  ------------------
                          if (c == CP_LS || c == CP_PS) {
  ------------------
  |  |21704|      0|#define CP_PS   0x2029
  ------------------
  |  Branch (22477:17): [True: 0, False: 0]
  |  Branch (22477:31): [True: 0, False: 0]
  ------------------
22478|      0|            eol_error:
22479|      0|                js_parse_error_pos(s, p - 1, "unexpected line terminator in regexp");
22480|      0|                goto fail;
22481|      0|            }
22482|      0|            p = p_next;
22483|      0|        }
22484|      2|        if (string_buffer_putc(b, c))
  ------------------
  |  Branch (22484:13): [True: 0, False: 2]
  ------------------
22485|      0|            goto fail;
22486|      2|    }
22487|       |
22488|       |    /* flags */
22489|      2|    for(;;) {
22490|      2|        const uint8_t *p_next = p;
22491|      2|        c = *p_next++;
22492|      2|        if (c >= 0x80) {
  ------------------
  |  Branch (22492:13): [True: 0, False: 2]
  ------------------
22493|      0|            c = unicode_from_utf8(p, UTF8_CHAR_LEN_MAX, &p_next);
  ------------------
  |  |  330|      0|#define UTF8_CHAR_LEN_MAX 6
  ------------------
22494|      0|            if (c > 0x10FFFF) {
  ------------------
  |  Branch (22494:17): [True: 0, False: 0]
  ------------------
22495|      0|                p++;
22496|      0|                goto invalid_utf8;
22497|      0|            }
22498|      0|        }
22499|      2|        if (!lre_js_is_ident_next(c))
  ------------------
  |  Branch (22499:13): [True: 1, False: 1]
  ------------------
22500|      1|            break;
22501|      1|        if (string_buffer_putc(b2, c))
  ------------------
  |  Branch (22501:13): [True: 0, False: 1]
  ------------------
22502|      0|            goto fail;
22503|      1|        p = p_next;
22504|      1|    }
22505|       |
22506|      1|    body_str = string_buffer_end(b);
22507|      1|    flags_str = string_buffer_end(b2);
22508|      1|    if (JS_IsException(body_str) ||
  ------------------
  |  Branch (22508:9): [True: 0, False: 1]
  ------------------
22509|      1|        JS_IsException(flags_str)) {
  ------------------
  |  Branch (22509:9): [True: 0, False: 1]
  ------------------
22510|      0|        JS_FreeValue(s->ctx, body_str);
22511|      0|        JS_FreeValue(s->ctx, flags_str);
22512|      0|        return -1;
22513|      0|    }
22514|      1|    s->token.val = TOK_REGEXP;
22515|      1|    s->token.u.regexp.body = body_str;
22516|      1|    s->token.u.regexp.flags = flags_str;
22517|      1|    s->buf_ptr = p;
22518|      1|    return 0;
22519|      0| fail:
22520|      0|    string_buffer_free(b);
22521|      0|    string_buffer_free(b2);
22522|      0|    return -1;
22523|      1|}
quickjs.c:has_lf_in_range:
24601|     16|{
24602|     16|    const uint8_t *tmp;
24603|     16|    if (p1 > p2) {
  ------------------
  |  Branch (24603:9): [True: 0, False: 16]
  ------------------
24604|      0|        tmp = p1;
24605|      0|        p1 = p2;
24606|      0|        p2 = tmp;
24607|      0|    }
24608|       |    return (memchr(p1, '\n', p2 - p1) != NULL);
24609|     16|}
quickjs.c:js_parse_expect:
22184|     59|{
22185|     59|    if (s->token.val != tok) {
  ------------------
  |  Branch (22185:9): [True: 0, False: 59]
  ------------------
22186|       |        /* XXX: dump token correctly in all cases */
22187|      0|        return js_parse_error(s, "expecting '%c'", tok);
22188|      0|    }
22189|     59|    return next_token(s);
22190|     59|}
quickjs.c:js_parse_destructuring_element:
26155|      2|{
26156|      2|    int label_parse, label_assign, label_done, label_lvalue, depth_lvalue;
26157|      2|    int start_addr, assign_addr;
26158|      2|    JSAtom prop_name, var_name;
26159|      2|    int opcode, scope, tok1, skip_bits;
26160|      2|    BOOL has_initializer;
26161|       |
26162|      2|    if (has_ellipsis < 0) {
  ------------------
  |  Branch (26162:9): [True: 2, False: 0]
  ------------------
26163|       |        /* pre-parse destructuration target for spread detection */
26164|      2|        js_parse_skip_parens_token(s, &skip_bits, FALSE);
26165|      2|        has_ellipsis = skip_bits & SKIP_HAS_ELLIPSIS;
  ------------------
  |  |24597|      2|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
26166|      2|    }
26167|       |
26168|      2|    label_parse = new_label(s);
26169|      2|    label_assign = new_label(s);
26170|       |
26171|      2|    start_addr = s->cur_func->byte_code.size;
26172|      2|    if (hasval) {
  ------------------
  |  Branch (26172:9): [True: 2, False: 0]
  ------------------
26173|       |        /* consume value from the stack */
26174|      2|        emit_op(s, OP_dup);
26175|      2|        emit_op(s, OP_undefined);
26176|      2|        emit_op(s, OP_strict_eq);
26177|      2|        emit_goto(s, OP_if_true, label_parse);
26178|      2|        emit_label(s, label_assign);
26179|      2|    } else {
26180|      0|        emit_goto(s, OP_goto, label_parse);
26181|      0|        emit_label(s, label_assign);
26182|       |        /* leave value on the stack */
26183|      0|        emit_op(s, OP_dup);
26184|      0|    }
26185|      2|    assign_addr = s->cur_func->byte_code.size;
26186|      2|    if (s->token.val == '{') {
  ------------------
  |  Branch (26186:9): [True: 2, False: 0]
  ------------------
26187|      2|        if (next_token(s))
  ------------------
  |  Branch (26187:13): [True: 0, False: 2]
  ------------------
26188|      0|            return -1;
26189|       |        /* throw an exception if the value cannot be converted to an object */
26190|      2|        emit_op(s, OP_to_object);
26191|      2|        if (has_ellipsis) {
  ------------------
  |  Branch (26191:13): [True: 0, False: 2]
  ------------------
26192|       |            /* add excludeList on stack just below src object */
26193|      0|            emit_op(s, OP_object);
26194|      0|            emit_op(s, OP_swap);
26195|      0|        }
26196|      2|        while (s->token.val != '}') {
  ------------------
  |  Branch (26196:16): [True: 2, False: 0]
  ------------------
26197|      2|            int prop_type;
26198|      2|            if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (26198:17): [True: 0, False: 2]
  ------------------
26199|      0|                if (!has_ellipsis) {
  ------------------
  |  Branch (26199:21): [True: 0, False: 0]
  ------------------
26200|      0|                    JS_ThrowInternalError(s->ctx, "unexpected ellipsis token");
26201|      0|                    return -1;
26202|      0|                }
26203|      0|                if (next_token(s))
  ------------------
  |  Branch (26203:21): [True: 0, False: 0]
  ------------------
26204|      0|                    return -1;
26205|      0|                if (tok) {
  ------------------
  |  Branch (26205:21): [True: 0, False: 0]
  ------------------
26206|      0|                    var_name = js_parse_destructuring_var(s, tok, is_arg);
26207|      0|                    if (var_name == JS_ATOM_NULL)
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26207:25): [True: 0, False: 0]
  ------------------
26208|      0|                        return -1;
26209|      0|                    if (need_var_reference(s, tok)) {
  ------------------
  |  Branch (26209:25): [True: 0, False: 0]
  ------------------
26210|       |                        /* Must make a reference for proper `with` semantics */
26211|      0|                        emit_op(s, OP_scope_get_var);
26212|      0|                        emit_atom(s, var_name);
26213|      0|                        emit_u16(s, s->cur_func->scope_level);
26214|      0|                        JS_FreeAtom(s->ctx, var_name);
26215|      0|                        goto lvalue0;
26216|      0|                    } else {
26217|      0|                        opcode = OP_scope_get_var;
26218|      0|                        scope = s->cur_func->scope_level;
26219|      0|                        label_lvalue = -1;
26220|      0|                        depth_lvalue = 0;
26221|      0|                    }
26222|      0|                } else {
26223|      0|                    if (js_parse_left_hand_side_expr(s))
  ------------------
  |  Branch (26223:25): [True: 0, False: 0]
  ------------------
26224|      0|                        return -1;
26225|      0|                lvalue0:
26226|      0|                    if (get_lvalue(s, &opcode, &scope, &var_name,
  ------------------
  |  Branch (26226:25): [True: 0, False: 0]
  ------------------
26227|      0|                                   &label_lvalue, &depth_lvalue, FALSE, '{'))
26228|      0|                        return -1;
26229|      0|                }
26230|      0|                if (s->token.val != '}') {
  ------------------
  |  Branch (26230:21): [True: 0, False: 0]
  ------------------
26231|      0|                    js_parse_error(s, "assignment rest property must be last");
26232|      0|                    goto var_error;
26233|      0|                }
26234|      0|                emit_op(s, OP_object);  /* target */
26235|      0|                emit_op(s, OP_copy_data_properties);
26236|      0|                emit_u8(s, 0 | ((depth_lvalue + 1) << 2) | ((depth_lvalue + 2) << 5));
26237|      0|                goto set_val;
26238|      0|            }
26239|      2|            prop_type = js_parse_property_name(s, &prop_name, FALSE, TRUE, FALSE);
26240|      2|            if (prop_type < 0)
  ------------------
  |  Branch (26240:17): [True: 0, False: 2]
  ------------------
26241|      0|                return -1;
26242|      2|            var_name = JS_ATOM_NULL;
  ------------------
  |  |  449|      2|#define JS_ATOM_NULL 0
  ------------------
26243|      2|            if (prop_type == PROP_TYPE_IDENT) {
  ------------------
  |  |24416|      2|#define PROP_TYPE_IDENT 0
  ------------------
  |  Branch (26243:17): [True: 2, False: 0]
  ------------------
26244|      2|                if (next_token(s))
  ------------------
  |  Branch (26244:21): [True: 0, False: 2]
  ------------------
26245|      0|                    goto prop_error;
26246|      2|                if ((s->token.val == '[' || s->token.val == '{')
  ------------------
  |  Branch (26246:22): [True: 0, False: 2]
  |  Branch (26246:45): [True: 0, False: 2]
  ------------------
26247|      0|                    &&  ((tok1 = js_parse_skip_parens_token(s, &skip_bits, FALSE)) == ',' ||
  ------------------
  |  Branch (26247:26): [True: 0, False: 0]
  ------------------
26248|      0|                         tok1 == '=' || tok1 == '}')) {
  ------------------
  |  Branch (26248:26): [True: 0, False: 0]
  |  Branch (26248:41): [True: 0, False: 0]
  ------------------
26249|      0|                    if (prop_name == JS_ATOM_NULL) {
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26249:25): [True: 0, False: 0]
  ------------------
26250|       |                        /* computed property name on stack */
26251|      0|                        if (has_ellipsis) {
  ------------------
  |  Branch (26251:29): [True: 0, False: 0]
  ------------------
26252|       |                            /* define the property in excludeList */
26253|      0|                            emit_op(s, OP_to_propkey); /* avoid calling ToString twice */
26254|      0|                            emit_op(s, OP_perm3); /* TOS: src excludeList prop */
26255|      0|                            emit_op(s, OP_null); /* TOS: src excludeList prop null */
26256|      0|                            emit_op(s, OP_define_array_el); /* TOS: src excludeList prop */
26257|      0|                            emit_op(s, OP_perm3); /* TOS: excludeList src prop */
26258|      0|                        }
26259|       |                        /* get the computed property from the source object */
26260|      0|                        emit_op(s, OP_get_array_el2);
26261|      0|                    } else {
26262|       |                        /* named property */
26263|      0|                        if (has_ellipsis) {
  ------------------
  |  Branch (26263:29): [True: 0, False: 0]
  ------------------
26264|       |                            /* define the property in excludeList */
26265|      0|                            emit_op(s, OP_swap); /* TOS: src excludeList */
26266|      0|                            emit_op(s, OP_null); /* TOS: src excludeList null */
26267|      0|                            emit_op(s, OP_define_field); /* TOS: src excludeList */
26268|      0|                            emit_atom(s, prop_name);
26269|      0|                            emit_op(s, OP_swap); /* TOS: excludeList src */
26270|      0|                        }
26271|       |                        /* get the named property from the source object */
26272|      0|                        emit_op(s, OP_get_field2);
26273|      0|                        emit_u32(s, prop_name);
26274|      0|                    }
26275|      0|                    if (js_parse_destructuring_element(s, tok, is_arg, TRUE, -1, TRUE, export_flag) < 0)
  ------------------
  |  Branch (26275:25): [True: 0, False: 0]
  ------------------
26276|      0|                        return -1;
26277|      0|                    if (s->token.val == '}')
  ------------------
  |  Branch (26277:25): [True: 0, False: 0]
  ------------------
26278|      0|                        break;
26279|       |                    /* accept a trailing comma before the '}' */
26280|      0|                    if (js_parse_expect(s, ','))
  ------------------
  |  Branch (26280:25): [True: 0, False: 0]
  ------------------
26281|      0|                        return -1;
26282|      0|                    continue;
26283|      0|                }
26284|      2|                if (prop_name == JS_ATOM_NULL) {
  ------------------
  |  |  449|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26284:21): [True: 0, False: 2]
  ------------------
26285|      0|                    emit_op(s, OP_to_propkey);
26286|      0|                    if (has_ellipsis) {
  ------------------
  |  Branch (26286:25): [True: 0, False: 0]
  ------------------
26287|       |                        /* define the property in excludeList */
26288|      0|                        emit_op(s, OP_perm3);
26289|      0|                        emit_op(s, OP_null);
26290|      0|                        emit_op(s, OP_define_array_el);
26291|      0|                        emit_op(s, OP_perm3);
26292|      0|                    }
26293|       |                    /* source prop -- source source prop */
26294|      0|                    emit_op(s, OP_dup1);
26295|      2|                } else {
26296|      2|                    if (has_ellipsis) {
  ------------------
  |  Branch (26296:25): [True: 0, False: 2]
  ------------------
26297|       |                        /* define the property in excludeList */
26298|      0|                        emit_op(s, OP_swap);
26299|      0|                        emit_op(s, OP_null);
26300|      0|                        emit_op(s, OP_define_field);
26301|      0|                        emit_atom(s, prop_name);
26302|      0|                        emit_op(s, OP_swap);
26303|      0|                    }
26304|       |                    /* source -- source source */
26305|      2|                    emit_op(s, OP_dup);
26306|      2|                }
26307|      2|                if (tok) {
  ------------------
  |  Branch (26307:21): [True: 2, False: 0]
  ------------------
26308|      2|                    var_name = js_parse_destructuring_var(s, tok, is_arg);
26309|      2|                    if (var_name == JS_ATOM_NULL)
  ------------------
  |  |  449|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26309:25): [True: 0, False: 2]
  ------------------
26310|      0|                        goto prop_error;
26311|      2|                    if (need_var_reference(s, tok)) {
  ------------------
  |  Branch (26311:25): [True: 0, False: 2]
  ------------------
26312|       |                        /* Must make a reference for proper `with` semantics */
26313|      0|                        emit_op(s, OP_scope_get_var);
26314|      0|                        emit_atom(s, var_name);
26315|      0|                        emit_u16(s, s->cur_func->scope_level);
26316|      0|                        JS_FreeAtom(s->ctx, var_name);
26317|      0|                        goto lvalue1;
26318|      2|                    } else {
26319|       |                        /* no need to make a reference for let/const */
26320|      2|                        opcode = OP_scope_get_var;
26321|      2|                        scope = s->cur_func->scope_level;
26322|      2|                        label_lvalue = -1;
26323|      2|                        depth_lvalue = 0;
26324|      2|                    }
26325|      2|                } else {
26326|      0|                    if (js_parse_left_hand_side_expr(s))
  ------------------
  |  Branch (26326:25): [True: 0, False: 0]
  ------------------
26327|      0|                        goto prop_error;
26328|      0|                lvalue1:
26329|      0|                    if (get_lvalue(s, &opcode, &scope, &var_name,
  ------------------
  |  Branch (26329:25): [True: 0, False: 0]
  ------------------
26330|      0|                                   &label_lvalue, &depth_lvalue, FALSE, '{'))
26331|      0|                        goto prop_error;
26332|       |                    /* swap ref and lvalue object if any */
26333|      0|                    if (prop_name == JS_ATOM_NULL) {
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26333:25): [True: 0, False: 0]
  ------------------
26334|      0|                        switch(depth_lvalue) {
26335|      0|                        case 0:
  ------------------
  |  Branch (26335:25): [True: 0, False: 0]
  ------------------
26336|      0|                            break;
26337|      0|                        case 1:
  ------------------
  |  Branch (26337:25): [True: 0, False: 0]
  ------------------
26338|       |                            /* source prop x -> x source prop */
26339|      0|                            emit_op(s, OP_rot3r);
26340|      0|                            break;
26341|      0|                        case 2:
  ------------------
  |  Branch (26341:25): [True: 0, False: 0]
  ------------------
26342|       |                            /* source prop x y -> x y source prop */
26343|      0|                            emit_op(s, OP_swap2);   /* t p2 s p1 */
26344|      0|                            break;
26345|      0|                        case 3:
  ------------------
  |  Branch (26345:25): [True: 0, False: 0]
  ------------------
26346|       |                            /* source prop x y z -> x y z source prop */
26347|      0|                            emit_op(s, OP_rot5l);
26348|      0|                            emit_op(s, OP_rot5l);
26349|      0|                            break;
26350|      0|                        default:
  ------------------
  |  Branch (26350:25): [True: 0, False: 0]
  ------------------
26351|      0|                            abort();
26352|      0|                        }
26353|      0|                    } else {
26354|      0|                        switch(depth_lvalue) {
26355|      0|                        case 0:
  ------------------
  |  Branch (26355:25): [True: 0, False: 0]
  ------------------
26356|      0|                            break;
26357|      0|                        case 1:
  ------------------
  |  Branch (26357:25): [True: 0, False: 0]
  ------------------
26358|       |                            /* source x -> x source */
26359|      0|                            emit_op(s, OP_swap);
26360|      0|                            break;
26361|      0|                        case 2:
  ------------------
  |  Branch (26361:25): [True: 0, False: 0]
  ------------------
26362|       |                            /* source x y -> x y source */
26363|      0|                            emit_op(s, OP_rot3l);
26364|      0|                            break;
26365|      0|                        case 3:
  ------------------
  |  Branch (26365:25): [True: 0, False: 0]
  ------------------
26366|       |                            /* source x y z -> x y z source */
26367|      0|                            emit_op(s, OP_rot4l);
26368|      0|                            break;
26369|      0|                        default:
  ------------------
  |  Branch (26369:25): [True: 0, False: 0]
  ------------------
26370|      0|                            abort();
26371|      0|                        }
26372|      0|                    }
26373|      0|                }
26374|      2|                if (prop_name == JS_ATOM_NULL) {
  ------------------
  |  |  449|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26374:21): [True: 0, False: 2]
  ------------------
26375|       |                    /* computed property name on stack */
26376|       |                    /* XXX: should have OP_get_array_el2x with depth */
26377|       |                    /* source prop -- val */
26378|      0|                    emit_op(s, OP_get_array_el);
26379|      2|                } else {
26380|       |                    /* named property */
26381|       |                    /* XXX: should have OP_get_field2x with depth */
26382|       |                    /* source -- val */
26383|      2|                    emit_op(s, OP_get_field);
26384|      2|                    emit_u32(s, prop_name);
26385|      2|                }
26386|      2|            } else {
26387|       |                /* prop_type = PROP_TYPE_VAR, cannot be a computed property */
26388|      0|                if (is_arg && js_parse_check_duplicate_parameter(s, prop_name))
  ------------------
  |  Branch (26388:21): [True: 0, False: 0]
  |  Branch (26388:31): [True: 0, False: 0]
  ------------------
26389|      0|                    goto prop_error;
26390|      0|                if ((s->cur_func->js_mode & JS_MODE_STRICT) &&
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (26390:21): [True: 0, False: 0]
  ------------------
26391|      0|                    (prop_name == JS_ATOM_eval || prop_name == JS_ATOM_arguments)) {
  ------------------
  |  Branch (26391:22): [True: 0, False: 0]
  |  Branch (26391:51): [True: 0, False: 0]
  ------------------
26392|      0|                    js_parse_error(s, "invalid destructuring target");
26393|      0|                    goto prop_error;
26394|      0|                }
26395|      0|                if (has_ellipsis) {
  ------------------
  |  Branch (26395:21): [True: 0, False: 0]
  ------------------
26396|       |                    /* define the property in excludeList */
26397|      0|                    emit_op(s, OP_swap);
26398|      0|                    emit_op(s, OP_null);
26399|      0|                    emit_op(s, OP_define_field);
26400|      0|                    emit_atom(s, prop_name);
26401|      0|                    emit_op(s, OP_swap);
26402|      0|                }
26403|      0|                if (!tok || need_var_reference(s, tok)) {
  ------------------
  |  Branch (26403:21): [True: 0, False: 0]
  |  Branch (26403:29): [True: 0, False: 0]
  ------------------
26404|       |                    /* generate reference */
26405|       |                    /* source -- source source */
26406|      0|                    emit_op(s, OP_dup);
26407|      0|                    emit_op(s, OP_scope_get_var);
26408|      0|                    emit_atom(s, prop_name);
26409|      0|                    emit_u16(s, s->cur_func->scope_level);
26410|      0|                    goto lvalue1;
26411|      0|                } else {
26412|       |                    /* no need to make a reference for let/const */
26413|      0|                    var_name = JS_DupAtom(s->ctx, prop_name);
26414|      0|                    opcode = OP_scope_get_var;
26415|      0|                    scope = s->cur_func->scope_level;
26416|      0|                    label_lvalue = -1;
26417|      0|                    depth_lvalue = 0;
26418|       |                    
26419|       |                    /* source -- source val */
26420|      0|                    emit_op(s, OP_get_field2);
26421|      0|                    emit_u32(s, prop_name);
26422|      0|                }
26423|      0|            }
26424|      2|        set_val:
26425|      2|            if (tok) {
  ------------------
  |  Branch (26425:17): [True: 2, False: 0]
  ------------------
26426|      2|                if (js_define_var(s, var_name, tok))
  ------------------
  |  Branch (26426:21): [True: 0, False: 2]
  ------------------
26427|      0|                    goto var_error;
26428|      2|                if (export_flag) {
  ------------------
  |  Branch (26428:21): [True: 0, False: 2]
  ------------------
26429|      0|                    if (!add_export_entry(s, s->cur_func->module, var_name, var_name,
  ------------------
  |  Branch (26429:25): [True: 0, False: 0]
  ------------------
26430|      0|                                          JS_EXPORT_TYPE_LOCAL))
26431|      0|                        goto var_error;
26432|      0|                }
26433|      2|                scope = s->cur_func->scope_level; /* XXX: check */
26434|      2|            }
26435|      2|            if (s->token.val == '=') {  /* handle optional default value */
  ------------------
  |  Branch (26435:17): [True: 0, False: 2]
  ------------------
26436|      0|                int label_hasval;
26437|      0|                emit_op(s, OP_dup);
26438|      0|                emit_op(s, OP_undefined);
26439|      0|                emit_op(s, OP_strict_eq);
26440|      0|                label_hasval = emit_goto(s, OP_if_false, -1);
26441|      0|                if (next_token(s))
  ------------------
  |  Branch (26441:21): [True: 0, False: 0]
  ------------------
26442|      0|                    goto var_error;
26443|      0|                emit_op(s, OP_drop);
26444|      0|                if (js_parse_assign_expr(s))
  ------------------
  |  Branch (26444:21): [True: 0, False: 0]
  ------------------
26445|      0|                    goto var_error;
26446|      0|                if (opcode == OP_scope_get_var || opcode == OP_get_ref_value)
  ------------------
  |  Branch (26446:21): [True: 0, False: 0]
  |  Branch (26446:51): [True: 0, False: 0]
  ------------------
26447|      0|                    set_object_name(s, var_name);
26448|      0|                emit_label(s, label_hasval);
26449|      0|            }
26450|       |            /* store value into lvalue object */
26451|      2|            put_lvalue(s, opcode, scope, var_name, label_lvalue,
26452|      2|                       PUT_LVALUE_NOKEEP_DEPTH,
26453|      2|                       (tok == TOK_CONST || tok == TOK_LET));
  ------------------
  |  Branch (26453:25): [True: 0, False: 2]
  |  Branch (26453:45): [True: 2, False: 0]
  ------------------
26454|      2|            if (s->token.val == '}')
  ------------------
  |  Branch (26454:17): [True: 2, False: 0]
  ------------------
26455|      2|                break;
26456|       |            /* accept a trailing comma before the '}' */
26457|      0|            if (js_parse_expect(s, ','))
  ------------------
  |  Branch (26457:17): [True: 0, False: 0]
  ------------------
26458|      0|                return -1;
26459|      0|        }
26460|       |        /* drop the source object */
26461|      2|        emit_op(s, OP_drop);
26462|      2|        if (has_ellipsis) {
  ------------------
  |  Branch (26462:13): [True: 0, False: 2]
  ------------------
26463|      0|            emit_op(s, OP_drop); /* pop excludeList */
26464|      0|        }
26465|      2|        if (next_token(s))
  ------------------
  |  Branch (26465:13): [True: 0, False: 2]
  ------------------
26466|      0|            return -1;
26467|      2|    } else if (s->token.val == '[') {
  ------------------
  |  Branch (26467:16): [True: 0, False: 0]
  ------------------
26468|      0|        BOOL has_spread;
26469|      0|        int enum_depth;
26470|      0|        BlockEnv block_env;
26471|       |
26472|      0|        if (next_token(s))
  ------------------
  |  Branch (26472:13): [True: 0, False: 0]
  ------------------
26473|      0|            return -1;
26474|       |        /* the block environment is only needed in generators in case
26475|       |           'yield' triggers a 'return' */
26476|      0|        push_break_entry(s->cur_func, &block_env,
26477|      0|                         JS_ATOM_NULL, -1, -1, 2);
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
26478|      0|        block_env.has_iterator = TRUE;
26479|      0|        emit_op(s, OP_for_of_start);
26480|      0|        has_spread = FALSE;
26481|      0|        while (s->token.val != ']') {
  ------------------
  |  Branch (26481:16): [True: 0, False: 0]
  ------------------
26482|       |            /* get the next value */
26483|      0|            if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (26483:17): [True: 0, False: 0]
  ------------------
26484|      0|                if (next_token(s))
  ------------------
  |  Branch (26484:21): [True: 0, False: 0]
  ------------------
26485|      0|                    return -1;
26486|      0|                if (s->token.val == ',' || s->token.val == ']')
  ------------------
  |  Branch (26486:21): [True: 0, False: 0]
  |  Branch (26486:44): [True: 0, False: 0]
  ------------------
26487|      0|                    return js_parse_error(s, "missing binding pattern...");
26488|      0|                has_spread = TRUE;
26489|      0|            }
26490|      0|            if (s->token.val == ',') {
  ------------------
  |  Branch (26490:17): [True: 0, False: 0]
  ------------------
26491|       |                /* do nothing, skip the value, has_spread is false */
26492|      0|                emit_op(s, OP_for_of_next);
26493|      0|                emit_u8(s, 0);
26494|      0|                emit_op(s, OP_drop);
26495|      0|                emit_op(s, OP_drop);
26496|      0|            } else if ((s->token.val == '[' || s->token.val == '{')
  ------------------
  |  Branch (26496:25): [True: 0, False: 0]
  |  Branch (26496:48): [True: 0, False: 0]
  ------------------
26497|      0|                   &&  ((tok1 = js_parse_skip_parens_token(s, &skip_bits, FALSE)) == ',' ||
  ------------------
  |  Branch (26497:25): [True: 0, False: 0]
  ------------------
26498|      0|                        tok1 == '=' || tok1 == ']')) {
  ------------------
  |  Branch (26498:25): [True: 0, False: 0]
  |  Branch (26498:40): [True: 0, False: 0]
  ------------------
26499|      0|                if (has_spread) {
  ------------------
  |  Branch (26499:21): [True: 0, False: 0]
  ------------------
26500|      0|                    if (tok1 == '=')
  ------------------
  |  Branch (26500:25): [True: 0, False: 0]
  ------------------
26501|      0|                        return js_parse_error(s, "rest element cannot have a default value");
26502|      0|                    js_emit_spread_code(s, 0);
26503|      0|                } else {
26504|      0|                    emit_op(s, OP_for_of_next);
26505|      0|                    emit_u8(s, 0);
26506|      0|                    emit_op(s, OP_drop);
26507|      0|                }
26508|      0|                if (js_parse_destructuring_element(s, tok, is_arg, TRUE, skip_bits & SKIP_HAS_ELLIPSIS, TRUE, export_flag) < 0)
  ------------------
  |  |24597|      0|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
  |  Branch (26508:21): [True: 0, False: 0]
  ------------------
26509|      0|                    return -1;
26510|      0|            } else {
26511|      0|                var_name = JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
26512|      0|                if (tok) {
  ------------------
  |  Branch (26512:21): [True: 0, False: 0]
  ------------------
26513|      0|                    var_name = js_parse_destructuring_var(s, tok, is_arg);
26514|      0|                    if (var_name == JS_ATOM_NULL)
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (26514:25): [True: 0, False: 0]
  ------------------
26515|      0|                        goto var_error;
26516|      0|                    if (js_define_var(s, var_name, tok))
  ------------------
  |  Branch (26516:25): [True: 0, False: 0]
  ------------------
26517|      0|                        goto var_error;
26518|      0|                    if (need_var_reference(s, tok)) {
  ------------------
  |  Branch (26518:25): [True: 0, False: 0]
  ------------------
26519|       |                        /* Must make a reference for proper `with` semantics */
26520|      0|                        emit_op(s, OP_scope_get_var);
26521|      0|                        emit_atom(s, var_name);
26522|      0|                        emit_u16(s, s->cur_func->scope_level);
26523|      0|                        JS_FreeAtom(s->ctx, var_name);
26524|      0|                        goto lvalue2;
26525|      0|                    } else {
26526|       |                        /* no need to make a reference for let/const */
26527|      0|                        opcode = OP_scope_get_var;
26528|      0|                        scope = s->cur_func->scope_level;
26529|      0|                        label_lvalue = -1;
26530|      0|                        enum_depth = 0;
26531|      0|                    }
26532|      0|                } else {
26533|      0|                    if (js_parse_left_hand_side_expr(s))
  ------------------
  |  Branch (26533:25): [True: 0, False: 0]
  ------------------
26534|      0|                        return -1;
26535|      0|                lvalue2:
26536|      0|                    if (get_lvalue(s, &opcode, &scope, &var_name,
  ------------------
  |  Branch (26536:25): [True: 0, False: 0]
  ------------------
26537|      0|                                   &label_lvalue, &enum_depth, FALSE, '[')) {
26538|      0|                        return -1;
26539|      0|                    }
26540|      0|                }
26541|      0|                if (has_spread) {
  ------------------
  |  Branch (26541:21): [True: 0, False: 0]
  ------------------
26542|      0|                    js_emit_spread_code(s, enum_depth);
26543|      0|                } else {
26544|      0|                    emit_op(s, OP_for_of_next);
26545|      0|                    emit_u8(s, enum_depth);
26546|      0|                    emit_op(s, OP_drop);
26547|      0|                }
26548|      0|                if (s->token.val == '=' && !has_spread) {
  ------------------
  |  Branch (26548:21): [True: 0, False: 0]
  |  Branch (26548:44): [True: 0, False: 0]
  ------------------
26549|       |                    /* handle optional default value */
26550|      0|                    int label_hasval;
26551|      0|                    emit_op(s, OP_dup);
26552|      0|                    emit_op(s, OP_undefined);
26553|      0|                    emit_op(s, OP_strict_eq);
26554|      0|                    label_hasval = emit_goto(s, OP_if_false, -1);
26555|      0|                    if (next_token(s))
  ------------------
  |  Branch (26555:25): [True: 0, False: 0]
  ------------------
26556|      0|                        goto var_error;
26557|      0|                    emit_op(s, OP_drop);
26558|      0|                    if (js_parse_assign_expr(s))
  ------------------
  |  Branch (26558:25): [True: 0, False: 0]
  ------------------
26559|      0|                        goto var_error;
26560|      0|                    if (opcode == OP_scope_get_var || opcode == OP_get_ref_value)
  ------------------
  |  Branch (26560:25): [True: 0, False: 0]
  |  Branch (26560:55): [True: 0, False: 0]
  ------------------
26561|      0|                        set_object_name(s, var_name);
26562|      0|                    emit_label(s, label_hasval);
26563|      0|                }
26564|       |                /* store value into lvalue object */
26565|      0|                put_lvalue(s, opcode, scope, var_name,
26566|      0|                           label_lvalue, PUT_LVALUE_NOKEEP_DEPTH,
26567|      0|                           (tok == TOK_CONST || tok == TOK_LET));
  ------------------
  |  Branch (26567:29): [True: 0, False: 0]
  |  Branch (26567:49): [True: 0, False: 0]
  ------------------
26568|      0|            }
26569|      0|            if (s->token.val == ']')
  ------------------
  |  Branch (26569:17): [True: 0, False: 0]
  ------------------
26570|      0|                break;
26571|      0|            if (has_spread)
  ------------------
  |  Branch (26571:17): [True: 0, False: 0]
  ------------------
26572|      0|                return js_parse_error(s, "rest element must be the last one");
26573|       |            /* accept a trailing comma before the ']' */
26574|      0|            if (js_parse_expect(s, ','))
  ------------------
  |  Branch (26574:17): [True: 0, False: 0]
  ------------------
26575|      0|                return -1;
26576|      0|        }
26577|       |        /* close iterator object:
26578|       |           if completed, enum_obj has been replaced by undefined */
26579|      0|        emit_op(s, OP_iterator_close);
26580|      0|        pop_break_entry(s->cur_func);
26581|      0|        if (next_token(s))
  ------------------
  |  Branch (26581:13): [True: 0, False: 0]
  ------------------
26582|      0|            return -1;
26583|      0|    } else {
26584|      0|        return js_parse_error(s, "invalid assignment syntax");
26585|      0|    }
26586|      2|    if (s->token.val == '=' && allow_initializer) {
  ------------------
  |  Branch (26586:9): [True: 2, False: 0]
  |  Branch (26586:32): [True: 2, False: 0]
  ------------------
26587|      2|        label_done = emit_goto(s, OP_goto, -1);
26588|      2|        if (next_token(s))
  ------------------
  |  Branch (26588:13): [True: 0, False: 2]
  ------------------
26589|      0|            return -1;
26590|      2|        emit_label(s, label_parse);
26591|      2|        if (hasval)
  ------------------
  |  Branch (26591:13): [True: 2, False: 0]
  ------------------
26592|      2|            emit_op(s, OP_drop);
26593|      2|        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (26593:13): [True: 0, False: 2]
  ------------------
26594|      0|            return -1;
26595|      2|        emit_goto(s, OP_goto, label_assign);
26596|      2|        emit_label(s, label_done);
26597|      2|        has_initializer = TRUE;
26598|      2|    } else {
26599|       |        /* normally hasval is true except if
26600|       |           js_parse_skip_parens_token() was wrong in the parsing */
26601|       |        //        assert(hasval);
26602|      0|        if (!hasval) {
  ------------------
  |  Branch (26602:13): [True: 0, False: 0]
  ------------------
26603|      0|            js_parse_error(s, "too complicated destructuring expression");
26604|      0|            return -1;
26605|      0|        }
26606|       |        /* remove test and decrement label ref count */
26607|      0|        memset(s->cur_func->byte_code.buf + start_addr, OP_nop,
26608|      0|               assign_addr - start_addr);
26609|      0|        s->cur_func->label_slots[label_parse].ref_count--;
26610|      0|        has_initializer = FALSE;
26611|      0|    }
26612|      2|    return has_initializer;
26613|       |
26614|      0| prop_error:
26615|      0|    JS_FreeAtom(s->ctx, prop_name);
26616|      0| var_error:
26617|      0|    JS_FreeAtom(s->ctx, var_name);
26618|      0|    return -1;
26619|      0|}
quickjs.c:js_parse_destructuring_var:
26129|      2|{
26130|      2|    JSAtom name;
26131|       |
26132|      2|    if (!(s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved)
  ------------------
  |  Branch (26132:11): [True: 2, False: 0]
  |  Branch (26132:40): [True: 2, False: 0]
  ------------------
26133|      2|    ||  ((s->cur_func->js_mode & JS_MODE_STRICT) &&
  ------------------
  |  |  395|      2|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (26133:10): [True: 0, False: 2]
  ------------------
26134|      0|         (s->token.u.ident.atom == JS_ATOM_eval || s->token.u.ident.atom == JS_ATOM_arguments))) {
  ------------------
  |  Branch (26134:11): [True: 0, False: 0]
  |  Branch (26134:52): [True: 0, False: 0]
  ------------------
26135|      0|        js_parse_error(s, "invalid destructuring target");
26136|      0|        return JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
26137|      0|    }
26138|      2|    name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
26139|      2|    if (is_arg && js_parse_check_duplicate_parameter(s, name))
  ------------------
  |  Branch (26139:9): [True: 2, False: 0]
  |  Branch (26139:19): [True: 0, False: 2]
  ------------------
26140|      0|        goto fail;
26141|      2|    if (next_token(s))
  ------------------
  |  Branch (26141:9): [True: 0, False: 2]
  ------------------
26142|      0|        goto fail;
26143|       |
26144|      2|    return name;
26145|      0|fail:
26146|      0|    JS_FreeAtom(s->ctx, name);
26147|      0|    return JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
26148|      2|}
quickjs.c:need_var_reference:
26115|      2|{
26116|      2|    JSFunctionDef *fd = s->cur_func;
26117|      2|    if (tok != TOK_VAR)
  ------------------
  |  Branch (26117:9): [True: 2, False: 0]
  ------------------
26118|      2|        return FALSE; /* no reference for let/const */
26119|      0|    if (fd->js_mode & JS_MODE_STRICT) {
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (26119:9): [True: 0, False: 0]
  ------------------
26120|      0|        if (!fd->is_global_var)
  ------------------
  |  Branch (26120:13): [True: 0, False: 0]
  ------------------
26121|      0|            return FALSE; /* local definitions in strict mode in function or direct eval */
26122|      0|        if (s->is_module)
  ------------------
  |  Branch (26122:13): [True: 0, False: 0]
  ------------------
26123|      0|            return FALSE; /* in a module global variables are like closure variables */
26124|      0|    }
26125|      0|    return TRUE;
26126|      0|}
quickjs.c:js_parse_left_hand_side_expr:
24919|      1|{
24920|      1|    return js_parse_postfix_expr(s, PF_POSTFIX_CALL);
  ------------------
  |  |24901|      1|#define PF_POSTFIX_CALL (1 << 1)
  ------------------
24921|      1|}
quickjs.c:js_parse_postfix_expr:
26647|    152|{
26648|    152|    FuncCallType call_type;
26649|    152|    int optional_chaining_label;
26650|    152|    BOOL accept_lparen = (parse_flags & PF_POSTFIX_CALL) != 0;
  ------------------
  |  |24901|    152|#define PF_POSTFIX_CALL (1 << 1)
  ------------------
26651|    152|    const uint8_t *op_token_ptr;
26652|       |    
26653|    152|    call_type = FUNC_CALL_NORMAL;
26654|    152|    switch(s->token.val) {
26655|     12|    case TOK_NUMBER:
  ------------------
  |  Branch (26655:5): [True: 12, False: 140]
  ------------------
26656|     12|        {
26657|     12|            JSValue val;
26658|     12|            val = s->token.u.num.val;
26659|       |
26660|     12|            if (JS_VALUE_GET_TAG(val) == JS_TAG_INT) {
  ------------------
  |  |  236|     12|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (26660:17): [True: 7, False: 5]
  ------------------
26661|      7|                emit_op(s, OP_push_i32);
26662|      7|                emit_u32(s, JS_VALUE_GET_INT(val));
  ------------------
  |  |  239|      7|#define JS_VALUE_GET_INT(v) ((v).u.int32)
  ------------------
26663|      7|            } else if (JS_VALUE_GET_TAG(val) == JS_TAG_SHORT_BIG_INT) {
  ------------------
  |  |  236|      5|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (26663:24): [True: 0, False: 5]
  ------------------
26664|      0|                int64_t v;
26665|      0|                v = JS_VALUE_GET_SHORT_BIG_INT(val);
  ------------------
  |  |  242|      0|#define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
  ------------------
26666|      0|                if (v >= INT32_MIN && v <= INT32_MAX) {
  ------------------
  |  Branch (26666:21): [True: 0, False: 0]
  |  Branch (26666:39): [True: 0, False: 0]
  ------------------
26667|      0|                    emit_op(s, OP_push_bigint_i32);
26668|      0|                    emit_u32(s, v);
26669|      0|                } else {
26670|      0|                    goto large_number;
26671|      0|                }
26672|      5|            } else {
26673|      5|            large_number:
26674|      5|                if (emit_push_const(s, val, 0) < 0)
  ------------------
  |  Branch (26674:21): [True: 0, False: 5]
  ------------------
26675|      0|                    return -1;
26676|      5|            }
26677|     12|        }
26678|     12|        if (next_token(s))
  ------------------
  |  Branch (26678:13): [True: 0, False: 12]
  ------------------
26679|      0|            return -1;
26680|     12|        break;
26681|     22|    case TOK_TEMPLATE:
  ------------------
  |  Branch (26681:5): [True: 22, False: 130]
  ------------------
26682|     22|        if (js_parse_template(s, 0, NULL))
  ------------------
  |  Branch (26682:13): [True: 0, False: 22]
  ------------------
26683|      0|            return -1;
26684|     22|        break;
26685|     22|    case TOK_STRING:
  ------------------
  |  Branch (26685:5): [True: 7, False: 145]
  ------------------
26686|      7|        if (emit_push_const(s, s->token.u.str.str, 1))
  ------------------
  |  Branch (26686:13): [True: 0, False: 7]
  ------------------
26687|      0|            return -1;
26688|      7|        if (next_token(s))
  ------------------
  |  Branch (26688:13): [True: 0, False: 7]
  ------------------
26689|      0|            return -1;
26690|      7|        break;
26691|       |
26692|      7|    case TOK_DIV_ASSIGN:
  ------------------
  |  Branch (26692:5): [True: 0, False: 152]
  ------------------
26693|      0|        s->buf_ptr -= 2;
26694|      0|        goto parse_regexp;
26695|      1|    case '/':
  ------------------
  |  Branch (26695:5): [True: 1, False: 151]
  ------------------
26696|      1|        s->buf_ptr--;
26697|      1|    parse_regexp:
26698|      1|        {
26699|      1|            JSValue str;
26700|      1|            int ret;
26701|      1|            if (!s->ctx->compile_regexp)
  ------------------
  |  Branch (26701:17): [True: 0, False: 1]
  ------------------
26702|      0|                return js_parse_error(s, "RegExp are not supported");
26703|       |            /* the previous token is '/' or '/=', so no need to free */
26704|      1|            if (js_parse_regexp(s))
  ------------------
  |  Branch (26704:17): [True: 0, False: 1]
  ------------------
26705|      0|                return -1;
26706|      1|            ret = emit_push_const(s, s->token.u.regexp.body, 0);
26707|      1|            str = s->ctx->compile_regexp(s->ctx, s->token.u.regexp.body,
26708|      1|                                         s->token.u.regexp.flags);
26709|      1|            if (JS_IsException(str)) {
  ------------------
  |  Branch (26709:17): [True: 0, False: 1]
  ------------------
26710|       |                /* add the line number info */
26711|      0|                int line_num, col_num;
26712|      0|                line_num = get_line_col(&col_num, s->buf_start, s->token.ptr - s->buf_start);
26713|      0|                build_backtrace(s->ctx, s->ctx->rt->current_exception,
26714|      0|                                s->filename, line_num + 1, col_num + 1, 0);
26715|      0|                return -1;
26716|      0|            }
26717|      1|            ret = emit_push_const(s, str, 0);
26718|      1|            JS_FreeValue(s->ctx, str);
26719|      1|            if (ret)
  ------------------
  |  Branch (26719:17): [True: 0, False: 1]
  ------------------
26720|      0|                return -1;
26721|       |            /* we use a specific opcode to be sure the correct
26722|       |               function is called (otherwise the bytecode would have
26723|       |               to be verified by the RegExp constructor) */
26724|      1|            emit_op(s, OP_regexp);
26725|      1|            if (next_token(s))
  ------------------
  |  Branch (26725:17): [True: 0, False: 1]
  ------------------
26726|      0|                return -1;
26727|      1|        }
26728|      1|        break;
26729|      1|    case '(':
  ------------------
  |  Branch (26729:5): [True: 0, False: 152]
  ------------------
26730|      0|        if (js_parse_expr_paren(s))
  ------------------
  |  Branch (26730:13): [True: 0, False: 0]
  ------------------
26731|      0|            return -1;
26732|      0|        break;
26733|      0|    case TOK_FUNCTION:
  ------------------
  |  Branch (26733:5): [True: 0, False: 152]
  ------------------
26734|      0|        if (js_parse_function_decl(s, JS_PARSE_FUNC_EXPR,
  ------------------
  |  Branch (26734:13): [True: 0, False: 0]
  ------------------
26735|      0|                                   JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
26736|      0|                                   s->token.ptr))
26737|      0|            return -1;
26738|      0|        break;
26739|      0|    case TOK_CLASS:
  ------------------
  |  Branch (26739:5): [True: 0, False: 152]
  ------------------
26740|      0|        if (js_parse_class(s, TRUE, JS_PARSE_EXPORT_NONE))
  ------------------
  |  Branch (26740:13): [True: 0, False: 0]
  ------------------
26741|      0|            return -1;
26742|      0|        break;
26743|      0|    case TOK_NULL:
  ------------------
  |  Branch (26743:5): [True: 0, False: 152]
  ------------------
26744|      0|        if (next_token(s))
  ------------------
  |  Branch (26744:13): [True: 0, False: 0]
  ------------------
26745|      0|            return -1;
26746|      0|        emit_op(s, OP_null);
26747|      0|        break;
26748|      0|    case TOK_THIS:
  ------------------
  |  Branch (26748:5): [True: 0, False: 152]
  ------------------
26749|      0|        if (next_token(s))
  ------------------
  |  Branch (26749:13): [True: 0, False: 0]
  ------------------
26750|      0|            return -1;
26751|      0|        emit_op(s, OP_scope_get_var);
26752|      0|        emit_atom(s, JS_ATOM_this);
26753|      0|        emit_u16(s, 0);
26754|      0|        break;
26755|      0|    case TOK_FALSE:
  ------------------
  |  Branch (26755:5): [True: 0, False: 152]
  ------------------
26756|      0|        if (next_token(s))
  ------------------
  |  Branch (26756:13): [True: 0, False: 0]
  ------------------
26757|      0|            return -1;
26758|      0|        emit_op(s, OP_push_false);
26759|      0|        break;
26760|      0|    case TOK_TRUE:
  ------------------
  |  Branch (26760:5): [True: 0, False: 152]
  ------------------
26761|      0|        if (next_token(s))
  ------------------
  |  Branch (26761:13): [True: 0, False: 0]
  ------------------
26762|      0|            return -1;
26763|      0|        emit_op(s, OP_push_true);
26764|      0|        break;
26765|    109|    case TOK_IDENT:
  ------------------
  |  Branch (26765:5): [True: 109, False: 43]
  ------------------
26766|    109|        {
26767|    109|            JSAtom name;
26768|    109|            const uint8_t *source_ptr;
26769|    109|            if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (26769:17): [True: 0, False: 109]
  ------------------
26770|      0|                return js_parse_error_reserved_identifier(s);
26771|      0|            }
26772|    109|            source_ptr = s->token.ptr;
26773|    109|            if (token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (26773:17): [True: 0, False: 109]
  ------------------
26774|      0|                peek_token(s, TRUE) != '\n') {
  ------------------
  |  Branch (26774:17): [True: 0, False: 0]
  ------------------
26775|      0|                if (next_token(s))
  ------------------
  |  Branch (26775:21): [True: 0, False: 0]
  ------------------
26776|      0|                    return -1;
26777|      0|                if (s->token.val == TOK_FUNCTION) {
  ------------------
  |  Branch (26777:21): [True: 0, False: 0]
  ------------------
26778|      0|                    if (js_parse_function_decl(s, JS_PARSE_FUNC_EXPR,
  ------------------
  |  Branch (26778:25): [True: 0, False: 0]
  ------------------
26779|      0|                                               JS_FUNC_ASYNC, JS_ATOM_NULL,
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
26780|      0|                                               source_ptr))
26781|      0|                        return -1;
26782|      0|                } else {
26783|      0|                    name = JS_DupAtom(s->ctx, JS_ATOM_async);
26784|      0|                    goto do_get_var;
26785|      0|                }
26786|    109|            } else {
26787|    109|                if (s->token.u.ident.atom == JS_ATOM_arguments &&
  ------------------
  |  Branch (26787:21): [True: 0, False: 109]
  ------------------
26788|      0|                    !s->cur_func->arguments_allowed) {
  ------------------
  |  Branch (26788:21): [True: 0, False: 0]
  ------------------
26789|      0|                    js_parse_error(s, "'arguments' identifier is not allowed in class field initializer");
26790|      0|                    return -1;
26791|      0|                }
26792|    109|                name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
26793|    109|                if (next_token(s)) {
  ------------------
  |  Branch (26793:21): [True: 0, False: 109]
  ------------------
26794|      0|                    JS_FreeAtom(s->ctx, name);
26795|      0|                    return -1;
26796|      0|                }
26797|    109|            do_get_var:
26798|    109|                emit_source_pos(s, source_ptr);
26799|    109|                emit_op(s, OP_scope_get_var);
26800|    109|                emit_u32(s, name);
26801|    109|                emit_u16(s, s->cur_func->scope_level);
26802|    109|            }
26803|    109|        }
26804|    109|        break;
26805|    109|    case '{':
  ------------------
  |  Branch (26805:5): [True: 0, False: 152]
  ------------------
26806|      0|    case '[':
  ------------------
  |  Branch (26806:5): [True: 0, False: 152]
  ------------------
26807|      0|        if (s->token.val == '{') {
  ------------------
  |  Branch (26807:13): [True: 0, False: 0]
  ------------------
26808|      0|            if (js_parse_object_literal(s))
  ------------------
  |  Branch (26808:17): [True: 0, False: 0]
  ------------------
26809|      0|                return -1;
26810|      0|        } else {
26811|      0|            if (js_parse_array_literal(s))
  ------------------
  |  Branch (26811:17): [True: 0, False: 0]
  ------------------
26812|      0|                return -1;
26813|      0|        }
26814|      0|        break;
26815|      0|    case TOK_NEW:
  ------------------
  |  Branch (26815:5): [True: 0, False: 152]
  ------------------
26816|      0|        if (next_token(s))
  ------------------
  |  Branch (26816:13): [True: 0, False: 0]
  ------------------
26817|      0|            return -1;
26818|      0|        if (s->token.val == '.') {
  ------------------
  |  Branch (26818:13): [True: 0, False: 0]
  ------------------
26819|      0|            if (next_token(s))
  ------------------
  |  Branch (26819:17): [True: 0, False: 0]
  ------------------
26820|      0|                return -1;
26821|      0|            if (!token_is_pseudo_keyword(s, JS_ATOM_target))
  ------------------
  |  Branch (26821:17): [True: 0, False: 0]
  ------------------
26822|      0|                return js_parse_error(s, "expecting target");
26823|      0|            if (!s->cur_func->new_target_allowed)
  ------------------
  |  Branch (26823:17): [True: 0, False: 0]
  ------------------
26824|      0|                return js_parse_error(s, "new.target only allowed within functions");
26825|      0|            if (next_token(s))
  ------------------
  |  Branch (26825:17): [True: 0, False: 0]
  ------------------
26826|      0|                return -1;
26827|      0|            emit_op(s, OP_scope_get_var);
26828|      0|            emit_atom(s, JS_ATOM_new_target);
26829|      0|            emit_u16(s, 0);
26830|      0|        } else {
26831|      0|            if (js_parse_postfix_expr(s, 0))
  ------------------
  |  Branch (26831:17): [True: 0, False: 0]
  ------------------
26832|      0|                return -1;
26833|      0|            accept_lparen = TRUE;
26834|      0|            if (s->token.val != '(') {
  ------------------
  |  Branch (26834:17): [True: 0, False: 0]
  ------------------
26835|       |                /* new operator on an object */
26836|      0|                emit_source_pos(s, s->token.ptr);
26837|      0|                emit_op(s, OP_dup);
26838|      0|                emit_op(s, OP_call_constructor);
26839|      0|                emit_u16(s, 0);
26840|      0|            } else {
26841|      0|                call_type = FUNC_CALL_NEW;
26842|      0|            }
26843|      0|        }
26844|      0|        break;
26845|      0|    case TOK_SUPER:
  ------------------
  |  Branch (26845:5): [True: 0, False: 152]
  ------------------
26846|      0|        if (next_token(s))
  ------------------
  |  Branch (26846:13): [True: 0, False: 0]
  ------------------
26847|      0|            return -1;
26848|      0|        if (s->token.val == '(') {
  ------------------
  |  Branch (26848:13): [True: 0, False: 0]
  ------------------
26849|      0|            if (!s->cur_func->super_call_allowed)
  ------------------
  |  Branch (26849:17): [True: 0, False: 0]
  ------------------
26850|      0|                return js_parse_error(s, "super() is only valid in a derived class constructor");
26851|      0|            call_type = FUNC_CALL_SUPER_CTOR;
26852|      0|        } else if (s->token.val == '.' || s->token.val == '[') {
  ------------------
  |  Branch (26852:20): [True: 0, False: 0]
  |  Branch (26852:43): [True: 0, False: 0]
  ------------------
26853|      0|            if (!s->cur_func->super_allowed)
  ------------------
  |  Branch (26853:17): [True: 0, False: 0]
  ------------------
26854|      0|                return js_parse_error(s, "'super' is only valid in a method");
26855|      0|            emit_op(s, OP_scope_get_var);
26856|      0|            emit_atom(s, JS_ATOM_this);
26857|      0|            emit_u16(s, 0);
26858|      0|            emit_op(s, OP_scope_get_var);
26859|      0|            emit_atom(s, JS_ATOM_home_object);
26860|      0|            emit_u16(s, 0);
26861|      0|            emit_op(s, OP_get_super);
26862|      0|        } else {
26863|      0|            return js_parse_error(s, "invalid use of 'super'");
26864|      0|        }
26865|      0|        break;
26866|      0|    case TOK_IMPORT:
  ------------------
  |  Branch (26866:5): [True: 0, False: 152]
  ------------------
26867|      0|        if (next_token(s))
  ------------------
  |  Branch (26867:13): [True: 0, False: 0]
  ------------------
26868|      0|            return -1;
26869|      0|        if (s->token.val == '.') {
  ------------------
  |  Branch (26869:13): [True: 0, False: 0]
  ------------------
26870|      0|            if (next_token(s))
  ------------------
  |  Branch (26870:17): [True: 0, False: 0]
  ------------------
26871|      0|                return -1;
26872|      0|            if (!token_is_pseudo_keyword(s, JS_ATOM_meta))
  ------------------
  |  Branch (26872:17): [True: 0, False: 0]
  ------------------
26873|      0|                return js_parse_error(s, "meta expected");
26874|      0|            if (!s->is_module)
  ------------------
  |  Branch (26874:17): [True: 0, False: 0]
  ------------------
26875|      0|                return js_parse_error(s, "import.meta only valid in module code");
26876|      0|            if (next_token(s))
  ------------------
  |  Branch (26876:17): [True: 0, False: 0]
  ------------------
26877|      0|                return -1;
26878|      0|            emit_op(s, OP_special_object);
26879|      0|            emit_u8(s, OP_SPECIAL_OBJECT_IMPORT_META);
26880|      0|        } else {
26881|      0|            if (js_parse_expect(s, '('))
  ------------------
  |  Branch (26881:17): [True: 0, False: 0]
  ------------------
26882|      0|                return -1;
26883|      0|            if (!accept_lparen)
  ------------------
  |  Branch (26883:17): [True: 0, False: 0]
  ------------------
26884|      0|                return js_parse_error(s, "invalid use of 'import()'");
26885|      0|            if (js_parse_assign_expr(s))
  ------------------
  |  Branch (26885:17): [True: 0, False: 0]
  ------------------
26886|      0|                return -1;
26887|      0|            if (s->token.val == ',') {
  ------------------
  |  Branch (26887:17): [True: 0, False: 0]
  ------------------
26888|      0|                if (next_token(s))
  ------------------
  |  Branch (26888:21): [True: 0, False: 0]
  ------------------
26889|      0|                    return -1;
26890|      0|                if (s->token.val != ')') {
  ------------------
  |  Branch (26890:21): [True: 0, False: 0]
  ------------------
26891|      0|                    if (js_parse_assign_expr(s))
  ------------------
  |  Branch (26891:25): [True: 0, False: 0]
  ------------------
26892|      0|                        return -1;
26893|       |                    /* accept a trailing comma */
26894|      0|                    if (s->token.val == ',') {
  ------------------
  |  Branch (26894:25): [True: 0, False: 0]
  ------------------
26895|      0|                        if (next_token(s))
  ------------------
  |  Branch (26895:29): [True: 0, False: 0]
  ------------------
26896|      0|                            return -1;
26897|      0|                    }
26898|      0|                } else {
26899|      0|                    emit_op(s, OP_undefined);
26900|      0|                }
26901|      0|            } else {
26902|      0|                emit_op(s, OP_undefined);
26903|      0|            }
26904|      0|            if (js_parse_expect(s, ')'))
  ------------------
  |  Branch (26904:17): [True: 0, False: 0]
  ------------------
26905|      0|                return -1;
26906|      0|            emit_op(s, OP_import);
26907|      0|        }
26908|      0|        break;
26909|      1|    default:
  ------------------
  |  Branch (26909:5): [True: 1, False: 151]
  ------------------
26910|      1|        return js_parse_error(s, "unexpected token in expression: '%.*s'",
26911|      1|                              (int)(s->buf_ptr - s->token.ptr), s->token.ptr);
26912|    152|    }
26913|       |
26914|    151|    optional_chaining_label = -1;
26915|    194|    for(;;) {
26916|    194|        JSFunctionDef *fd = s->cur_func;
26917|    194|        BOOL has_optional_chain = FALSE;
26918|       |
26919|    194|        if (s->token.val == TOK_QUESTION_MARK_DOT) {
  ------------------
  |  Branch (26919:13): [True: 0, False: 194]
  ------------------
26920|      0|            if ((parse_flags & PF_POSTFIX_CALL) == 0)
  ------------------
  |  |24901|      0|#define PF_POSTFIX_CALL (1 << 1)
  ------------------
  |  Branch (26920:17): [True: 0, False: 0]
  ------------------
26921|      0|                return js_parse_error(s, "new keyword cannot be used with an optional chain");
26922|      0|            op_token_ptr = s->token.ptr;
26923|       |            /* optional chaining */
26924|      0|            if (next_token(s))
  ------------------
  |  Branch (26924:17): [True: 0, False: 0]
  ------------------
26925|      0|                return -1;
26926|      0|            has_optional_chain = TRUE;
26927|      0|            if (s->token.val == '(' && accept_lparen) {
  ------------------
  |  Branch (26927:17): [True: 0, False: 0]
  |  Branch (26927:40): [True: 0, False: 0]
  ------------------
26928|      0|                goto parse_func_call;
26929|      0|            } else if (s->token.val == '[') {
  ------------------
  |  Branch (26929:24): [True: 0, False: 0]
  ------------------
26930|      0|                goto parse_array_access;
26931|      0|            } else {
26932|      0|                goto parse_property;
26933|      0|            }
26934|    194|        } else if (s->token.val == TOK_TEMPLATE &&
  ------------------
  |  Branch (26934:20): [True: 6, False: 188]
  ------------------
26935|      6|                   call_type == FUNC_CALL_NORMAL) {
  ------------------
  |  Branch (26935:20): [True: 6, False: 0]
  ------------------
26936|      6|            if (optional_chaining_label >= 0) {
  ------------------
  |  Branch (26936:17): [True: 0, False: 6]
  ------------------
26937|      0|                return js_parse_error(s, "template literal cannot appear in an optional chain");
26938|      0|            }
26939|      6|            call_type = FUNC_CALL_TEMPLATE;
26940|      6|            op_token_ptr = s->token.ptr; /* XXX: check if right position */
26941|      6|            goto parse_func_call2;
26942|    188|        } else if (s->token.val == '(' && accept_lparen) {
  ------------------
  |  Branch (26942:20): [True: 6, False: 182]
  |  Branch (26942:43): [True: 6, False: 0]
  ------------------
26943|      6|            int opcode, arg_count, drop_count;
26944|       |
26945|       |            /* function call */
26946|      6|        parse_func_call:
26947|      6|            op_token_ptr = s->token.ptr;
26948|      6|            if (next_token(s))
  ------------------
  |  Branch (26948:17): [True: 0, False: 6]
  ------------------
26949|      0|                return -1;
26950|       |
26951|      6|            if (call_type == FUNC_CALL_NORMAL) {
  ------------------
  |  Branch (26951:17): [True: 6, False: 0]
  ------------------
26952|     12|            parse_func_call2:
26953|     12|                switch(opcode = get_prev_opcode(fd)) {
26954|      3|                case OP_get_field:
  ------------------
  |  Branch (26954:17): [True: 3, False: 9]
  ------------------
26955|       |                    /* keep the object on the stack */
26956|      3|                    fd->byte_code.buf[fd->last_opcode_pos] = OP_get_field2;
26957|      3|                    drop_count = 2;
26958|      3|                    break;
26959|      0|                case OP_get_field_opt_chain:
  ------------------
  |  Branch (26959:17): [True: 0, False: 12]
  ------------------
26960|      0|                    {
26961|      0|                        int opt_chain_label, next_label;
26962|      0|                        opt_chain_label = get_u32(fd->byte_code.buf +
26963|      0|                                                  fd->last_opcode_pos + 1 + 4 + 1);
26964|       |                        /* keep the object on the stack */
26965|      0|                        fd->byte_code.buf[fd->last_opcode_pos] = OP_get_field2;
26966|      0|                        fd->byte_code.size = fd->last_opcode_pos + 1 + 4;
26967|      0|                        next_label = emit_goto(s, OP_goto, -1);
26968|      0|                        emit_label(s, opt_chain_label);
26969|       |                        /* need an additional undefined value for the
26970|       |                           case where the optional field does not
26971|       |                           exists */
26972|      0|                        emit_op(s, OP_undefined);
26973|      0|                        emit_label(s, next_label);
26974|      0|                        drop_count = 2;
26975|      0|                        opcode = OP_get_field;
26976|      0|                    }
26977|      0|                    break;
26978|      0|                case OP_scope_get_private_field:
  ------------------
  |  Branch (26978:17): [True: 0, False: 12]
  ------------------
26979|       |                    /* keep the object on the stack */
26980|      0|                    fd->byte_code.buf[fd->last_opcode_pos] = OP_scope_get_private_field2;
26981|      0|                    drop_count = 2;
26982|      0|                    break;
26983|      0|                case OP_get_array_el:
  ------------------
  |  Branch (26983:17): [True: 0, False: 12]
  ------------------
26984|       |                    /* keep the object on the stack */
26985|      0|                    fd->byte_code.buf[fd->last_opcode_pos] = OP_get_array_el2;
26986|      0|                    drop_count = 2;
26987|      0|                    break;
26988|      0|                case OP_get_array_el_opt_chain:
  ------------------
  |  Branch (26988:17): [True: 0, False: 12]
  ------------------
26989|      0|                    {
26990|      0|                        int opt_chain_label, next_label;
26991|      0|                        opt_chain_label = get_u32(fd->byte_code.buf +
26992|      0|                                                  fd->last_opcode_pos + 1 + 1);
26993|       |                        /* keep the object on the stack */
26994|      0|                        fd->byte_code.buf[fd->last_opcode_pos] = OP_get_array_el2;
26995|      0|                        fd->byte_code.size = fd->last_opcode_pos + 1;
26996|      0|                        next_label = emit_goto(s, OP_goto, -1);
26997|      0|                        emit_label(s, opt_chain_label);
26998|       |                        /* need an additional undefined value for the
26999|       |                           case where the optional field does not
27000|       |                           exists */
27001|      0|                        emit_op(s, OP_undefined);
27002|      0|                        emit_label(s, next_label);
27003|      0|                        drop_count = 2;
27004|      0|                        opcode = OP_get_array_el;
27005|      0|                    }
27006|      0|                    break;
27007|      9|                case OP_scope_get_var:
  ------------------
  |  Branch (27007:17): [True: 9, False: 3]
  ------------------
27008|      9|                    {
27009|      9|                        JSAtom name;
27010|      9|                        int scope;
27011|      9|                        name = get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
27012|      9|                        scope = get_u16(fd->byte_code.buf + fd->last_opcode_pos + 5);
27013|      9|                        if (name == JS_ATOM_eval && call_type == FUNC_CALL_NORMAL && !has_optional_chain) {
  ------------------
  |  Branch (27013:29): [True: 0, False: 9]
  |  Branch (27013:53): [True: 0, False: 0]
  |  Branch (27013:86): [True: 0, False: 0]
  ------------------
27014|       |                            /* direct 'eval' */
27015|      0|                            opcode = OP_eval;
27016|      9|                        } else {
27017|       |                            /* verify if function name resolves to a simple
27018|       |                               get_loc/get_arg: a function call inside a `with`
27019|       |                               statement can resolve to a method call of the
27020|       |                               `with` context object
27021|       |                             */
27022|       |                            /* XXX: always generate the OP_scope_get_ref
27023|       |                               and remove it in variable resolution
27024|       |                               pass ? */
27025|      9|                            if (has_with_scope(fd, scope)) {
  ------------------
  |  Branch (27025:33): [True: 0, False: 9]
  ------------------
27026|      0|                                opcode = OP_scope_get_ref;
27027|      0|                                fd->byte_code.buf[fd->last_opcode_pos] = opcode;
27028|      0|                            }
27029|      9|                        }
27030|      9|                        drop_count = 1;
27031|      9|                    }
27032|      9|                    break;
27033|      0|                case OP_get_super_value:
  ------------------
  |  Branch (27033:17): [True: 0, False: 12]
  ------------------
27034|      0|                    fd->byte_code.buf[fd->last_opcode_pos] = OP_get_array_el;
27035|       |                    /* on stack: this func_obj */
27036|      0|                    opcode = OP_get_array_el;
27037|      0|                    drop_count = 2;
27038|      0|                    break;
27039|      0|                default:
  ------------------
  |  Branch (27039:17): [True: 0, False: 12]
  ------------------
27040|      0|                    opcode = OP_invalid;
27041|      0|                    drop_count = 1;
27042|      0|                    break;
27043|     12|                }
27044|     12|                if (has_optional_chain) {
  ------------------
  |  Branch (27044:21): [True: 0, False: 12]
  ------------------
27045|      0|                    optional_chain_test(s, &optional_chaining_label,
27046|      0|                                        drop_count);
27047|      0|                }
27048|     12|            } else {
27049|      0|                opcode = OP_invalid;
27050|      0|            }
27051|       |
27052|     12|            if (call_type == FUNC_CALL_TEMPLATE) {
  ------------------
  |  Branch (27052:17): [True: 6, False: 6]
  ------------------
27053|      6|                if (js_parse_template(s, 1, &arg_count))
  ------------------
  |  Branch (27053:21): [True: 0, False: 6]
  ------------------
27054|      0|                    return -1;
27055|      6|                goto emit_func_call;
27056|      6|            } else if (call_type == FUNC_CALL_SUPER_CTOR) {
  ------------------
  |  Branch (27056:24): [True: 0, False: 6]
  ------------------
27057|      0|                emit_op(s, OP_scope_get_var);
27058|      0|                emit_atom(s, JS_ATOM_this_active_func);
27059|      0|                emit_u16(s, 0);
27060|       |
27061|      0|                emit_op(s, OP_get_super);
27062|       |
27063|      0|                emit_op(s, OP_scope_get_var);
27064|      0|                emit_atom(s, JS_ATOM_new_target);
27065|      0|                emit_u16(s, 0);
27066|      6|            } else if (call_type == FUNC_CALL_NEW) {
  ------------------
  |  Branch (27066:24): [True: 0, False: 6]
  ------------------
27067|      0|                emit_op(s, OP_dup); /* new.target = function */
27068|      0|            }
27069|       |
27070|       |            /* parse arguments */
27071|      6|            arg_count = 0;
27072|      6|            while (s->token.val != ')') {
  ------------------
  |  Branch (27072:20): [True: 5, False: 1]
  ------------------
27073|      5|                if (arg_count >= 65535) {
  ------------------
  |  Branch (27073:21): [True: 0, False: 5]
  ------------------
27074|      0|                    return js_parse_error(s, "Too many call arguments");
27075|      0|                }
27076|      5|                if (s->token.val == TOK_ELLIPSIS)
  ------------------
  |  Branch (27076:21): [True: 0, False: 5]
  ------------------
27077|      0|                    break;
27078|      5|                if (js_parse_assign_expr(s))
  ------------------
  |  Branch (27078:21): [True: 0, False: 5]
  ------------------
27079|      0|                    return -1;
27080|      5|                arg_count++;
27081|      5|                if (s->token.val == ')')
  ------------------
  |  Branch (27081:21): [True: 5, False: 0]
  ------------------
27082|      5|                    break;
27083|       |                /* accept a trailing comma before the ')' */
27084|      0|                if (js_parse_expect(s, ','))
  ------------------
  |  Branch (27084:21): [True: 0, False: 0]
  ------------------
27085|      0|                    return -1;
27086|      0|            }
27087|      6|            if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (27087:17): [True: 0, False: 6]
  ------------------
27088|      0|                emit_op(s, OP_array_from);
27089|      0|                emit_u16(s, arg_count);
27090|      0|                emit_op(s, OP_push_i32);
27091|      0|                emit_u32(s, arg_count);
27092|       |
27093|       |                /* on stack: array idx */
27094|      0|                while (s->token.val != ')') {
  ------------------
  |  Branch (27094:24): [True: 0, False: 0]
  ------------------
27095|      0|                    if (s->token.val == TOK_ELLIPSIS) {
  ------------------
  |  Branch (27095:25): [True: 0, False: 0]
  ------------------
27096|      0|                        if (next_token(s))
  ------------------
  |  Branch (27096:29): [True: 0, False: 0]
  ------------------
27097|      0|                            return -1;
27098|      0|                        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (27098:29): [True: 0, False: 0]
  ------------------
27099|      0|                            return -1;
27100|      0|#if 1
27101|       |                        /* XXX: could pass is_last indicator? */
27102|      0|                        emit_op(s, OP_append);
27103|       |#else
27104|       |                        int label_next, label_done;
27105|       |                        label_next = new_label(s);
27106|       |                        label_done = new_label(s);
27107|       |                        /* push enumerate object below array/idx pair */
27108|       |                        emit_op(s, OP_for_of_start);
27109|       |                        emit_op(s, OP_rot5l);
27110|       |                        emit_op(s, OP_rot5l);
27111|       |                        emit_label(s, label_next);
27112|       |                        /* on stack: enum_rec array idx */
27113|       |                        emit_op(s, OP_for_of_next);
27114|       |                        emit_u8(s, 2);
27115|       |                        emit_goto(s, OP_if_true, label_done);
27116|       |                        /* append element */
27117|       |                        /* enum_rec array idx val -> enum_rec array new_idx */
27118|       |                        emit_op(s, OP_define_array_el);
27119|       |                        emit_op(s, OP_inc);
27120|       |                        emit_goto(s, OP_goto, label_next);
27121|       |                        emit_label(s, label_done);
27122|       |                        /* close enumeration, drop enum_rec and idx */
27123|       |                        emit_op(s, OP_drop); /* drop undef */
27124|       |                        emit_op(s, OP_nip1); /* drop enum_rec */
27125|       |                        emit_op(s, OP_nip1);
27126|       |                        emit_op(s, OP_nip1);
27127|       |#endif
27128|      0|                    } else {
27129|      0|                        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (27129:29): [True: 0, False: 0]
  ------------------
27130|      0|                            return -1;
27131|       |                        /* array idx val */
27132|      0|                        emit_op(s, OP_define_array_el);
27133|      0|                        emit_op(s, OP_inc);
27134|      0|                    }
27135|      0|                    if (s->token.val == ')')
  ------------------
  |  Branch (27135:25): [True: 0, False: 0]
  ------------------
27136|      0|                        break;
27137|       |                    /* accept a trailing comma before the ')' */
27138|      0|                    if (js_parse_expect(s, ','))
  ------------------
  |  Branch (27138:25): [True: 0, False: 0]
  ------------------
27139|      0|                        return -1;
27140|      0|                }
27141|      0|                if (next_token(s))
  ------------------
  |  Branch (27141:21): [True: 0, False: 0]
  ------------------
27142|      0|                    return -1;
27143|       |                /* drop the index */
27144|      0|                emit_op(s, OP_drop);
27145|       |
27146|      0|                emit_source_pos(s, op_token_ptr);
27147|       |                /* apply function call */
27148|      0|                switch(opcode) {
27149|      0|                case OP_get_field:
  ------------------
  |  Branch (27149:17): [True: 0, False: 0]
  ------------------
27150|      0|                case OP_scope_get_private_field:
  ------------------
  |  Branch (27150:17): [True: 0, False: 0]
  ------------------
27151|      0|                case OP_get_array_el:
  ------------------
  |  Branch (27151:17): [True: 0, False: 0]
  ------------------
27152|      0|                case OP_scope_get_ref:
  ------------------
  |  Branch (27152:17): [True: 0, False: 0]
  ------------------
27153|       |                    /* obj func array -> func obj array */
27154|      0|                    emit_op(s, OP_perm3);
27155|      0|                    emit_op(s, OP_apply);
27156|      0|                    emit_u16(s, call_type == FUNC_CALL_NEW);
27157|      0|                    break;
27158|      0|                case OP_eval:
  ------------------
  |  Branch (27158:17): [True: 0, False: 0]
  ------------------
27159|      0|                    emit_op(s, OP_apply_eval);
27160|      0|                    emit_u16(s, fd->scope_level);
27161|      0|                    fd->has_eval_call = TRUE;
27162|      0|                    break;
27163|      0|                default:
  ------------------
  |  Branch (27163:17): [True: 0, False: 0]
  ------------------
27164|      0|                    if (call_type == FUNC_CALL_SUPER_CTOR) {
  ------------------
  |  Branch (27164:25): [True: 0, False: 0]
  ------------------
27165|      0|                        emit_op(s, OP_apply);
27166|      0|                        emit_u16(s, 1);
27167|       |                        /* set the 'this' value */
27168|      0|                        emit_op(s, OP_dup);
27169|      0|                        emit_op(s, OP_scope_put_var_init);
27170|      0|                        emit_atom(s, JS_ATOM_this);
27171|      0|                        emit_u16(s, 0);
27172|       |
27173|      0|                        emit_class_field_init(s);
27174|      0|                    } else if (call_type == FUNC_CALL_NEW) {
  ------------------
  |  Branch (27174:32): [True: 0, False: 0]
  ------------------
27175|       |                        /* obj func array -> func obj array */
27176|      0|                        emit_op(s, OP_perm3);
27177|      0|                        emit_op(s, OP_apply);
27178|      0|                        emit_u16(s, 1);
27179|      0|                    } else {
27180|       |                        /* func array -> func undef array */
27181|      0|                        emit_op(s, OP_undefined);
27182|      0|                        emit_op(s, OP_swap);
27183|      0|                        emit_op(s, OP_apply);
27184|      0|                        emit_u16(s, 0);
27185|      0|                    }
27186|      0|                    break;
27187|      0|                }
27188|      6|            } else {
27189|      6|                if (next_token(s))
  ------------------
  |  Branch (27189:21): [True: 0, False: 6]
  ------------------
27190|      0|                    return -1;
27191|     12|            emit_func_call:
27192|     12|                emit_source_pos(s, op_token_ptr);
27193|     12|                switch(opcode) {
27194|      3|                case OP_get_field:
  ------------------
  |  Branch (27194:17): [True: 3, False: 9]
  ------------------
27195|      3|                case OP_scope_get_private_field:
  ------------------
  |  Branch (27195:17): [True: 0, False: 12]
  ------------------
27196|      3|                case OP_get_array_el:
  ------------------
  |  Branch (27196:17): [True: 0, False: 12]
  ------------------
27197|      3|                case OP_scope_get_ref:
  ------------------
  |  Branch (27197:17): [True: 0, False: 12]
  ------------------
27198|      3|                    emit_op(s, OP_call_method);
27199|      3|                    emit_u16(s, arg_count);
27200|      3|                    break;
27201|      0|                case OP_eval:
  ------------------
  |  Branch (27201:17): [True: 0, False: 12]
  ------------------
27202|      0|                    emit_op(s, OP_eval);
27203|      0|                    emit_u16(s, arg_count);
27204|      0|                    emit_u16(s, fd->scope_level);
27205|      0|                    fd->has_eval_call = TRUE;
27206|      0|                    break;
27207|      9|                default:
  ------------------
  |  Branch (27207:17): [True: 9, False: 3]
  ------------------
27208|      9|                    if (call_type == FUNC_CALL_SUPER_CTOR) {
  ------------------
  |  Branch (27208:25): [True: 0, False: 9]
  ------------------
27209|      0|                        emit_op(s, OP_call_constructor);
27210|      0|                        emit_u16(s, arg_count);
27211|       |
27212|       |                        /* set the 'this' value */
27213|      0|                        emit_op(s, OP_dup);
27214|      0|                        emit_op(s, OP_scope_put_var_init);
27215|      0|                        emit_atom(s, JS_ATOM_this);
27216|      0|                        emit_u16(s, 0);
27217|       |
27218|      0|                        emit_class_field_init(s);
27219|      9|                    } else if (call_type == FUNC_CALL_NEW) {
  ------------------
  |  Branch (27219:32): [True: 0, False: 9]
  ------------------
27220|      0|                        emit_op(s, OP_call_constructor);
27221|      0|                        emit_u16(s, arg_count);
27222|      9|                    } else {
27223|      9|                        emit_op(s, OP_call);
27224|      9|                        emit_u16(s, arg_count);
27225|      9|                    }
27226|      9|                    break;
27227|     12|                }
27228|     12|            }
27229|     12|            call_type = FUNC_CALL_NORMAL;
27230|    182|        } else if (s->token.val == '.') {
  ------------------
  |  Branch (27230:20): [True: 32, False: 150]
  ------------------
27231|     32|            op_token_ptr = s->token.ptr;
27232|     32|            if (next_token(s))
  ------------------
  |  Branch (27232:17): [True: 0, False: 32]
  ------------------
27233|      0|                return -1;
27234|     32|        parse_property:
27235|     32|            emit_source_pos(s, op_token_ptr);
27236|     32|            if (s->token.val == TOK_PRIVATE_NAME) {
  ------------------
  |  Branch (27236:17): [True: 0, False: 32]
  ------------------
27237|       |                /* private class field */
27238|      0|                if (get_prev_opcode(fd) == OP_get_super) {
  ------------------
  |  Branch (27238:21): [True: 0, False: 0]
  ------------------
27239|      0|                    return js_parse_error(s, "private class field forbidden after super");
27240|      0|                }
27241|      0|                if (has_optional_chain) {
  ------------------
  |  Branch (27241:21): [True: 0, False: 0]
  ------------------
27242|      0|                    optional_chain_test(s, &optional_chaining_label, 1);
27243|      0|                }
27244|      0|                emit_op(s, OP_scope_get_private_field);
27245|      0|                emit_atom(s, s->token.u.ident.atom);
27246|      0|                emit_u16(s, s->cur_func->scope_level);
27247|     32|            } else {
27248|     32|                if (!token_is_ident(s->token.val)) {
  ------------------
  |  Branch (27248:21): [True: 0, False: 32]
  ------------------
27249|      0|                    return js_parse_error(s, "expecting field name");
27250|      0|                }
27251|     32|                if (get_prev_opcode(fd) == OP_get_super) {
  ------------------
  |  Branch (27251:21): [True: 0, False: 32]
  ------------------
27252|      0|                    JSValue val;
27253|      0|                    int ret;
27254|      0|                    val = JS_AtomToValue(s->ctx, s->token.u.ident.atom);
27255|      0|                    ret = emit_push_const(s, val, 1);
27256|      0|                    JS_FreeValue(s->ctx, val);
27257|      0|                    if (ret)
  ------------------
  |  Branch (27257:25): [True: 0, False: 0]
  ------------------
27258|      0|                        return -1;
27259|      0|                    emit_op(s, OP_get_super_value);
27260|     32|                } else {
27261|     32|                    if (has_optional_chain) {
  ------------------
  |  Branch (27261:25): [True: 0, False: 32]
  ------------------
27262|      0|                        optional_chain_test(s, &optional_chaining_label, 1);
27263|      0|                    }
27264|     32|                    emit_op(s, OP_get_field);
27265|     32|                    emit_atom(s, s->token.u.ident.atom);
27266|     32|                }
27267|     32|            }
27268|     32|            if (next_token(s))
  ------------------
  |  Branch (27268:17): [True: 1, False: 31]
  ------------------
27269|      1|                return -1;
27270|    150|        } else if (s->token.val == '[') {
  ------------------
  |  Branch (27270:20): [True: 0, False: 150]
  ------------------
27271|      0|            int prev_op;
27272|      0|            op_token_ptr = s->token.ptr;
27273|      0|        parse_array_access:
27274|      0|            prev_op = get_prev_opcode(fd);
27275|      0|            if (has_optional_chain) {
  ------------------
  |  Branch (27275:17): [True: 0, False: 0]
  ------------------
27276|      0|                optional_chain_test(s, &optional_chaining_label, 1);
27277|      0|            }
27278|      0|            if (next_token(s))
  ------------------
  |  Branch (27278:17): [True: 0, False: 0]
  ------------------
27279|      0|                return -1;
27280|      0|            if (js_parse_expr(s))
  ------------------
  |  Branch (27280:17): [True: 0, False: 0]
  ------------------
27281|      0|                return -1;
27282|      0|            if (js_parse_expect(s, ']'))
  ------------------
  |  Branch (27282:17): [True: 0, False: 0]
  ------------------
27283|      0|                return -1;
27284|      0|            emit_source_pos(s, op_token_ptr);
27285|      0|            if (prev_op == OP_get_super) {
  ------------------
  |  Branch (27285:17): [True: 0, False: 0]
  ------------------
27286|      0|                emit_op(s, OP_get_super_value);
27287|      0|            } else {
27288|      0|                emit_op(s, OP_get_array_el);
27289|      0|            }
27290|    150|        } else {
27291|    150|            break;
27292|    150|        }
27293|    194|    }
27294|    150|    if (optional_chaining_label >= 0) {
  ------------------
  |  Branch (27294:9): [True: 0, False: 150]
  ------------------
27295|      0|        JSFunctionDef *fd = s->cur_func;
27296|      0|        int opcode;
27297|      0|        emit_label_raw(s, optional_chaining_label);
27298|       |        /* modify the last opcode so that it is an indicator of an
27299|       |           optional chain */
27300|      0|        opcode = get_prev_opcode(fd);
27301|      0|        if (opcode == OP_get_field || opcode == OP_get_array_el) {
  ------------------
  |  Branch (27301:13): [True: 0, False: 0]
  |  Branch (27301:39): [True: 0, False: 0]
  ------------------
27302|      0|            if (opcode == OP_get_field)
  ------------------
  |  Branch (27302:17): [True: 0, False: 0]
  ------------------
27303|      0|                opcode = OP_get_field_opt_chain;
27304|      0|            else
27305|      0|                opcode = OP_get_array_el_opt_chain;
27306|      0|            fd->byte_code.buf[fd->last_opcode_pos] = opcode;
27307|      0|        } else {
27308|      0|            fd->last_opcode_pos = -1;
27309|      0|        }
27310|      0|    }
27311|    150|    return 0;
27312|    151|}
quickjs.c:emit_push_const:
23790|     42|{
23791|     42|    int idx;
23792|       |
23793|     42|    if (JS_VALUE_GET_TAG(val) == JS_TAG_STRING && as_atom) {
  ------------------
  |  |  236|     42|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (23793:9): [True: 31, False: 11]
  |  Branch (23793:51): [True: 29, False: 2]
  ------------------
23794|     29|        JSAtom atom;
23795|       |        /* warning: JS_NewAtomStr frees the string value */
23796|     29|        JS_DupValue(s->ctx, val);
23797|     29|        atom = JS_NewAtomStr(s->ctx, JS_VALUE_GET_STRING(val));
  ------------------
  |  |  228|     29|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     29|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
23798|     29|        if (atom != JS_ATOM_NULL && !__JS_AtomIsTaggedInt(atom)) {
  ------------------
  |  |  449|     58|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (23798:13): [True: 29, False: 0]
  |  Branch (23798:37): [True: 29, False: 0]
  ------------------
23799|     29|            emit_op(s, OP_push_atom_value);
23800|     29|            emit_u32(s, atom);
23801|     29|            return 0;
23802|     29|        }
23803|     29|    }
23804|       |
23805|     13|    idx = cpool_add(s, JS_DupValue(s->ctx, val));
23806|     13|    if (idx < 0)
  ------------------
  |  Branch (23806:9): [True: 0, False: 13]
  ------------------
23807|      0|        return -1;
23808|     13|    emit_op(s, OP_push_const);
23809|     13|    emit_u32(s, idx);
23810|     13|    return 0;
23811|     13|}
quickjs.c:js_parse_template:
24306|     28|{
24307|     28|    JSContext *ctx = s->ctx;
24308|     28|    JSValue raw_array, template_object;
24309|     28|    JSToken cooked;
24310|     28|    int depth, ret;
24311|       |
24312|     28|    raw_array = JS_UNDEFINED; /* avoid warning */
  ------------------
  |  |  289|     28|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     28|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
24313|     28|    template_object = JS_UNDEFINED; /* avoid warning */
  ------------------
  |  |  289|     28|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     28|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
24314|     28|    if (call) {
  ------------------
  |  Branch (24314:9): [True: 6, False: 22]
  ------------------
24315|       |        /* Create a template object: an array of cooked strings */
24316|       |        /* Create an array of raw strings and store it to the raw property */
24317|      6|        template_object = JS_NewArray(ctx);
24318|      6|        if (JS_IsException(template_object))
  ------------------
  |  Branch (24318:13): [True: 0, False: 6]
  ------------------
24319|      0|            return -1;
24320|       |        //        pool_idx = s->cur_func->cpool_count;
24321|      6|        ret = emit_push_const(s, template_object, 0);
24322|      6|        JS_FreeValue(ctx, template_object);
24323|      6|        if (ret)
  ------------------
  |  Branch (24323:13): [True: 0, False: 6]
  ------------------
24324|      0|            return -1;
24325|      6|        raw_array = JS_NewArray(ctx);
24326|      6|        if (JS_IsException(raw_array))
  ------------------
  |  Branch (24326:13): [True: 0, False: 6]
  ------------------
24327|      0|            return -1;
24328|      6|        if (JS_DefinePropertyValue(ctx, template_object, JS_ATOM_raw,
  ------------------
  |  Branch (24328:13): [True: 0, False: 6]
  ------------------
24329|      6|                                   raw_array, JS_PROP_THROW) < 0) {
  ------------------
  |  |  318|      6|#define JS_PROP_THROW            (1 << 14)
  ------------------
24330|      0|            return -1;
24331|      0|        }
24332|      6|    }
24333|       |
24334|     28|    depth = 0;
24335|     28|    while (s->token.val == TOK_TEMPLATE) {
  ------------------
  |  Branch (24335:12): [True: 28, False: 0]
  ------------------
24336|     28|        const uint8_t *p = s->token.ptr + 1;
24337|     28|        cooked = s->token;
24338|     28|        if (call) {
  ------------------
  |  Branch (24338:13): [True: 6, False: 22]
  ------------------
24339|      6|            if (JS_DefinePropertyValueUint32(ctx, raw_array, depth,
  ------------------
  |  Branch (24339:17): [True: 0, False: 6]
  ------------------
24340|      6|                                             JS_DupValue(ctx, s->token.u.str.str),
24341|      6|                                             JS_PROP_ENUMERABLE | JS_PROP_THROW) < 0) {
  ------------------
  |  |  298|      6|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                                                           JS_PROP_ENUMERABLE | JS_PROP_THROW) < 0) {
  ------------------
  |  |  318|      6|#define JS_PROP_THROW            (1 << 14)
  ------------------
24342|      0|                return -1;
24343|      0|            }
24344|       |            /* re-parse the string with escape sequences but do not throw a
24345|       |               syntax error if it contains invalid sequences
24346|       |             */
24347|      6|            if (js_parse_string(s, '`', FALSE, p, &cooked, &p)) {
  ------------------
  |  Branch (24347:17): [True: 0, False: 6]
  ------------------
24348|      0|                cooked.u.str.str = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
24349|      0|            }
24350|      6|            if (JS_DefinePropertyValueUint32(ctx, template_object, depth,
  ------------------
  |  Branch (24350:17): [True: 0, False: 6]
  ------------------
24351|      6|                                             cooked.u.str.str,
24352|      6|                                             JS_PROP_ENUMERABLE | JS_PROP_THROW) < 0) {
  ------------------
  |  |  298|      6|#define JS_PROP_ENUMERABLE    (1 << 2)
  ------------------
                                                           JS_PROP_ENUMERABLE | JS_PROP_THROW) < 0) {
  ------------------
  |  |  318|      6|#define JS_PROP_THROW            (1 << 14)
  ------------------
24353|      0|                return -1;
24354|      0|            }
24355|     22|        } else {
24356|     22|            JSString *str;
24357|       |            /* re-parse the string with escape sequences and throw a
24358|       |               syntax error if it contains invalid sequences
24359|       |             */
24360|     22|            JS_FreeValue(ctx, s->token.u.str.str);
24361|     22|            s->token.u.str.str = JS_UNDEFINED;
  ------------------
  |  |  289|     22|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     22|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
24362|     22|            if (js_parse_string(s, '`', TRUE, p, &cooked, &p))
  ------------------
  |  Branch (24362:17): [True: 0, False: 22]
  ------------------
24363|      0|                return -1;
24364|     22|            str = JS_VALUE_GET_STRING(cooked.u.str.str);
  ------------------
  |  |  228|     22|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     22|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
24365|     22|            if (str->len != 0 || depth == 0) {
  ------------------
  |  Branch (24365:17): [True: 20, False: 2]
  |  Branch (24365:34): [True: 2, False: 0]
  ------------------
24366|     22|                ret = emit_push_const(s, cooked.u.str.str, 1);
24367|     22|                JS_FreeValue(s->ctx, cooked.u.str.str);
24368|     22|                if (ret)
  ------------------
  |  Branch (24368:21): [True: 0, False: 22]
  ------------------
24369|      0|                    return -1;
24370|     22|                if (depth == 0) {
  ------------------
  |  Branch (24370:21): [True: 22, False: 0]
  ------------------
24371|     22|                    if (s->token.u.str.sep == '`')
  ------------------
  |  Branch (24371:25): [True: 22, False: 0]
  ------------------
24372|     22|                        goto done1;
24373|      0|                    emit_op(s, OP_get_field2);
24374|      0|                    emit_atom(s, JS_ATOM_concat);
24375|      0|                }
24376|      0|                depth++;
24377|      0|            } else {
24378|      0|                JS_FreeValue(s->ctx, cooked.u.str.str);
24379|      0|            }
24380|     22|        }
24381|      6|        if (s->token.u.str.sep == '`')
  ------------------
  |  Branch (24381:13): [True: 6, False: 0]
  ------------------
24382|      6|            goto done;
24383|      0|        if (next_token(s))
  ------------------
  |  Branch (24383:13): [True: 0, False: 0]
  ------------------
24384|      0|            return -1;
24385|      0|        if (js_parse_expr(s))
  ------------------
  |  Branch (24385:13): [True: 0, False: 0]
  ------------------
24386|      0|            return -1;
24387|      0|        depth++;
24388|      0|        if (s->token.val != '}') {
  ------------------
  |  Branch (24388:13): [True: 0, False: 0]
  ------------------
24389|      0|            return js_parse_error(s, "expected '}' after template expression");
24390|      0|        }
24391|       |        /* XXX: should convert to string at this stage? */
24392|      0|        free_token(s, &s->token);
24393|       |        /* Resume TOK_TEMPLATE parsing (s->token.line_num and
24394|       |         * s->token.ptr are OK) */
24395|      0|        s->got_lf = FALSE;
24396|      0|        if (js_parse_template_part(s, s->buf_ptr))
  ------------------
  |  Branch (24396:13): [True: 0, False: 0]
  ------------------
24397|      0|            return -1;
24398|      0|    }
24399|      0|    return js_parse_expect(s, TOK_TEMPLATE);
24400|       |
24401|      6| done:
24402|      6|    if (call) {
  ------------------
  |  Branch (24402:9): [True: 6, False: 0]
  ------------------
24403|       |        /* Seal the objects */
24404|      6|        seal_template_obj(ctx, raw_array);
24405|      6|        seal_template_obj(ctx, template_object);
24406|      6|        *argc = depth + 1;
24407|      6|    } else {
24408|      0|        emit_op(s, OP_call_method);
24409|      0|        emit_u16(s, depth - 1);
24410|      0|    }
24411|     28| done1:
24412|     28|    return next_token(s);
24413|      6|}
quickjs.c:seal_template_obj:
24290|     12|{
24291|     12|    JSObject *p;
24292|     12|    JSShapeProperty *prs;
24293|       |
24294|     12|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|     12|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     12|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
24295|     12|    prs = find_own_property1(p, JS_ATOM_length);
24296|     12|    if (prs) {
  ------------------
  |  Branch (24296:9): [True: 12, False: 0]
  ------------------
24297|     12|        if (js_update_property_flags(ctx, p, &prs,
  ------------------
  |  Branch (24297:13): [True: 0, False: 12]
  ------------------
24298|     12|                                     prs->flags & ~(JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE)))
  ------------------
  |  |  296|     12|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
                                                   prs->flags & ~(JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE)))
  ------------------
  |  |  297|     12|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
24299|      0|            return -1;
24300|     12|    }
24301|     12|    p->extensible = FALSE;
24302|     12|    return 0;
24303|     12|}
quickjs.c:pop_scope:
23966|     13|static void pop_scope(JSParseState *s) {
23967|     13|    if (s->cur_func) {
  ------------------
  |  Branch (23967:9): [True: 13, False: 0]
  ------------------
23968|       |        /* disable scoped variables */
23969|     13|        JSFunctionDef *fd = s->cur_func;
23970|     13|        int scope = fd->scope_level;
23971|     13|        emit_op(s, OP_leave_scope);
23972|     13|        emit_u16(s, scope);
23973|     13|        fd->scope_level = fd->scopes[scope].parent;
23974|     13|        fd->scope_first = get_first_lexical_var(fd, fd->scope_level);
23975|     13|    }
23976|     13|}
quickjs.c:get_first_lexical_var:
23956|     13|{
23957|     47|    while (scope >= 0) {
  ------------------
  |  Branch (23957:12): [True: 34, False: 13]
  ------------------
23958|     34|        int scope_idx = fd->scopes[scope].first;
23959|     34|        if (scope_idx >= 0)
  ------------------
  |  Branch (23959:13): [True: 0, False: 34]
  ------------------
23960|      0|            return scope_idx;
23961|     34|        scope = fd->scopes[scope].parent;
23962|     34|    }
23963|     13|    return -1;
23964|     13|}
quickjs.c:js_parse_expect_semi:
22193|     99|{
22194|     99|    if (s->token.val != ';') {
  ------------------
  |  Branch (22194:9): [True: 43, False: 56]
  ------------------
22195|       |        /* automatic insertion of ';' */
22196|     43|        if (s->token.val == TOK_EOF || s->token.val == '}' || s->got_lf) {
  ------------------
  |  Branch (22196:13): [True: 12, False: 31]
  |  Branch (22196:40): [True: 0, False: 31]
  |  Branch (22196:63): [True: 31, False: 0]
  ------------------
22197|     43|            return 0;
22198|     43|        }
22199|      0|        return js_parse_error(s, "expecting '%c'", ';');
22200|     43|    }
22201|     56|    return next_token(s);
22202|     99|}
quickjs.c:emit_source_pos:
23667|    249|{
23668|    249|    JSFunctionDef *fd = s->cur_func;
23669|    249|    DynBuf *bc = &fd->byte_code;
23670|       |
23671|    249|    if (unlikely(fd->last_opcode_source_ptr != source_ptr)) {
  ------------------
  |  |   33|    249|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 184, False: 65]
  |  |  ------------------
  ------------------
23672|    184|        dbuf_putc(bc, OP_line_num);
23673|    184|        dbuf_put_u32(bc, source_ptr - s->buf_start);
23674|    184|        fd->last_opcode_source_ptr = source_ptr;
23675|    184|    }
23676|    249|}
quickjs.c:get_prev_opcode:
23623|    156|static inline int get_prev_opcode(JSFunctionDef *fd) {
23624|    156|    if (fd->last_opcode_pos < 0 || dbuf_error(&fd->byte_code))
  ------------------
  |  Branch (23624:9): [True: 0, False: 156]
  |  Branch (23624:36): [True: 0, False: 156]
  ------------------
23625|      0|        return OP_invalid;
23626|    156|    else
23627|    156|        return fd->byte_code.buf[fd->last_opcode_pos];
23628|    156|}
quickjs.c:has_with_scope:
25728|     20|{
25729|     60|    while (s) {
  ------------------
  |  Branch (25729:12): [True: 40, False: 20]
  ------------------
25730|       |        /* no with in strict mode */
25731|     40|        if (!(s->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  395|     40|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (25731:13): [True: 40, False: 0]
  ------------------
25732|     40|            int scope_idx = s->scopes[scope_level].first;
25733|     51|            while (scope_idx >= 0) {
  ------------------
  |  Branch (25733:20): [True: 11, False: 40]
  ------------------
25734|     11|                JSVarDef *vd = &s->vars[scope_idx];
25735|     11|                if (vd->var_name == JS_ATOM__with_)
  ------------------
  |  Branch (25735:21): [True: 0, False: 11]
  ------------------
25736|      0|                    return TRUE;
25737|     11|                scope_idx = vd->scope_next;
25738|     11|            }
25739|     40|        }
25740|       |        /* check parent scopes */
25741|     40|        scope_level = s->parent_scope_level;
25742|     40|        s = s->parent;
25743|     40|    }
25744|     20|    return FALSE;
25745|     20|}
quickjs.c:token_is_ident:
24427|     62|{
24428|       |    /* Accept keywords and reserved words as property names */
24429|     62|    return (tok == TOK_IDENT ||
  ------------------
  |  Branch (24429:13): [True: 60, False: 2]
  ------------------
24430|      2|            (tok >= TOK_FIRST_KEYWORD &&
  ------------------
  |  |21696|      4|#define TOK_FIRST_KEYWORD   TOK_NULL
  ------------------
  |  Branch (24430:14): [True: 0, False: 2]
  ------------------
24431|      0|             tok <= TOK_LAST_KEYWORD));
  ------------------
  |  |21697|      0|#define TOK_LAST_KEYWORD    TOK_AWAIT
  ------------------
  |  Branch (24431:14): [True: 0, False: 0]
  ------------------
24432|     62|}
quickjs.c:js_parse_expr:
28128|     87|{
28129|     87|    return js_parse_expr2(s, PF_IN_ACCEPTED);
  ------------------
  |  |24899|     87|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
28130|     87|}
quickjs.c:js_parse_expr2:
28104|     87|{
28105|     87|    BOOL comma = FALSE;
28106|     91|    for(;;) {
28107|     91|        if (js_parse_assign_expr2(s, parse_flags))
  ------------------
  |  Branch (28107:13): [True: 2, False: 89]
  ------------------
28108|      2|            return -1;
28109|     89|        if (comma) {
  ------------------
  |  Branch (28109:13): [True: 4, False: 85]
  ------------------
28110|       |            /* prevent get_lvalue from using the last expression
28111|       |               as an lvalue. This also prevents the conversion of
28112|       |               of get_var to get_ref for method lookup in function
28113|       |               call inside `with` statement.
28114|       |             */
28115|      4|            s->cur_func->last_opcode_pos = -1;
28116|      4|        }
28117|     89|        if (s->token.val != ',')
  ------------------
  |  Branch (28117:13): [True: 85, False: 4]
  ------------------
28118|     85|            break;
28119|      4|        comma = TRUE;
28120|      4|        if (next_token(s))
  ------------------
  |  Branch (28120:13): [True: 0, False: 4]
  ------------------
28121|      0|            return -1;
28122|      4|        emit_op(s, OP_drop);
28123|      4|    }
28124|     85|    return 0;
28125|     87|}
quickjs.c:js_parse_assign_expr2:
27814|    139|{
27815|    139|    int opcode, op, scope, skip_bits;
27816|    139|    JSAtom name0 = JS_ATOM_NULL;
  ------------------
  |  |  449|    139|#define JS_ATOM_NULL 0
  ------------------
27817|    139|    JSAtom name;
27818|       |
27819|    139|    if (s->token.val == TOK_YIELD) {
  ------------------
  |  Branch (27819:9): [True: 0, False: 139]
  ------------------
27820|      0|        BOOL is_star = FALSE, is_async;
27821|       |
27822|      0|        if (!(s->cur_func->func_kind & JS_FUNC_GENERATOR))
  ------------------
  |  Branch (27822:13): [True: 0, False: 0]
  ------------------
27823|      0|            return js_parse_error(s, "unexpected 'yield' keyword");
27824|      0|        if (!s->cur_func->in_function_body)
  ------------------
  |  Branch (27824:13): [True: 0, False: 0]
  ------------------
27825|      0|            return js_parse_error(s, "yield in default expression");
27826|      0|        if (next_token(s))
  ------------------
  |  Branch (27826:13): [True: 0, False: 0]
  ------------------
27827|      0|            return -1;
27828|       |        /* XXX: is there a better method to detect 'yield' without
27829|       |           parameters ? */
27830|      0|        if (s->token.val != ';' && s->token.val != ')' &&
  ------------------
  |  Branch (27830:13): [True: 0, False: 0]
  |  Branch (27830:36): [True: 0, False: 0]
  ------------------
27831|      0|            s->token.val != ']' && s->token.val != '}' &&
  ------------------
  |  Branch (27831:13): [True: 0, False: 0]
  |  Branch (27831:36): [True: 0, False: 0]
  ------------------
27832|      0|            s->token.val != ',' && s->token.val != ':' && !s->got_lf) {
  ------------------
  |  Branch (27832:13): [True: 0, False: 0]
  |  Branch (27832:36): [True: 0, False: 0]
  |  Branch (27832:59): [True: 0, False: 0]
  ------------------
27833|      0|            if (s->token.val == '*') {
  ------------------
  |  Branch (27833:17): [True: 0, False: 0]
  ------------------
27834|      0|                is_star = TRUE;
27835|      0|                if (next_token(s))
  ------------------
  |  Branch (27835:21): [True: 0, False: 0]
  ------------------
27836|      0|                    return -1;
27837|      0|            }
27838|      0|            if (js_parse_assign_expr2(s, parse_flags))
  ------------------
  |  Branch (27838:17): [True: 0, False: 0]
  ------------------
27839|      0|                return -1;
27840|      0|        } else {
27841|      0|            emit_op(s, OP_undefined);
27842|      0|        }
27843|      0|        is_async = (s->cur_func->func_kind == JS_FUNC_ASYNC_GENERATOR);
27844|       |
27845|      0|        if (is_star) {
  ------------------
  |  Branch (27845:13): [True: 0, False: 0]
  ------------------
27846|      0|            int label_loop, label_return, label_next;
27847|      0|            int label_return1, label_yield, label_throw, label_throw1;
27848|      0|            int label_throw2;
27849|       |
27850|      0|            label_loop = new_label(s);
27851|      0|            label_yield = new_label(s);
27852|       |
27853|      0|            emit_op(s, is_async ? OP_for_await_of_start : OP_for_of_start);
  ------------------
  |  Branch (27853:24): [True: 0, False: 0]
  ------------------
27854|       |
27855|       |            /* remove the catch offset (XXX: could avoid pushing back
27856|       |               undefined) */
27857|      0|            emit_op(s, OP_drop);
27858|      0|            emit_op(s, OP_undefined);
27859|       |
27860|      0|            emit_op(s, OP_undefined); /* initial value */
27861|       |
27862|      0|            emit_label(s, label_loop);
27863|      0|            emit_op(s, OP_iterator_next);
27864|      0|            if (is_async)
  ------------------
  |  Branch (27864:17): [True: 0, False: 0]
  ------------------
27865|      0|                emit_op(s, OP_await);
27866|      0|            emit_op(s, OP_iterator_check_object);
27867|      0|            emit_op(s, OP_get_field2);
27868|      0|            emit_atom(s, JS_ATOM_done);
27869|      0|            label_next = emit_goto(s, OP_if_true, -1); /* end of loop */
27870|      0|            emit_label(s, label_yield);
27871|      0|            if (is_async) {
  ------------------
  |  Branch (27871:17): [True: 0, False: 0]
  ------------------
27872|       |                /* OP_async_yield_star takes the value as parameter */
27873|      0|                emit_op(s, OP_get_field);
27874|      0|                emit_atom(s, JS_ATOM_value);
27875|      0|                emit_op(s, OP_async_yield_star);
27876|      0|            } else {
27877|       |                /* OP_yield_star takes (value, done) as parameter */
27878|      0|                emit_op(s, OP_yield_star);
27879|      0|            }
27880|      0|            emit_op(s, OP_dup);
27881|      0|            label_return = emit_goto(s, OP_if_true, -1);
27882|      0|            emit_op(s, OP_drop);
27883|      0|            emit_goto(s, OP_goto, label_loop);
27884|       |
27885|      0|            emit_label(s, label_return);
27886|      0|            emit_op(s, OP_push_i32);
27887|      0|            emit_u32(s, 2);
27888|      0|            emit_op(s, OP_strict_eq);
27889|      0|            label_throw = emit_goto(s, OP_if_true, -1);
27890|       |
27891|       |            /* return handling */
27892|      0|            if (is_async)
  ------------------
  |  Branch (27892:17): [True: 0, False: 0]
  ------------------
27893|      0|                emit_op(s, OP_await);
27894|      0|            emit_op(s, OP_iterator_call);
27895|      0|            emit_u8(s, 0);
27896|      0|            label_return1 = emit_goto(s, OP_if_true, -1);
27897|      0|            if (is_async)
  ------------------
  |  Branch (27897:17): [True: 0, False: 0]
  ------------------
27898|      0|                emit_op(s, OP_await);
27899|      0|            emit_op(s, OP_iterator_check_object);
27900|      0|            emit_op(s, OP_get_field2);
27901|      0|            emit_atom(s, JS_ATOM_done);
27902|      0|            emit_goto(s, OP_if_false, label_yield);
27903|       |
27904|      0|            emit_op(s, OP_get_field);
27905|      0|            emit_atom(s, JS_ATOM_value);
27906|       |
27907|      0|            emit_label(s, label_return1);
27908|      0|            emit_op(s, OP_nip);
27909|      0|            emit_op(s, OP_nip);
27910|      0|            emit_op(s, OP_nip);
27911|      0|            emit_return(s, TRUE);
27912|       |
27913|       |            /* throw handling */
27914|      0|            emit_label(s, label_throw);
27915|      0|            emit_op(s, OP_iterator_call);
27916|      0|            emit_u8(s, 1);
27917|      0|            label_throw1 = emit_goto(s, OP_if_true, -1);
27918|      0|            if (is_async)
  ------------------
  |  Branch (27918:17): [True: 0, False: 0]
  ------------------
27919|      0|                emit_op(s, OP_await);
27920|      0|            emit_op(s, OP_iterator_check_object);
27921|      0|            emit_op(s, OP_get_field2);
27922|      0|            emit_atom(s, JS_ATOM_done);
27923|      0|            emit_goto(s, OP_if_false, label_yield);
27924|      0|            emit_goto(s, OP_goto, label_next);
27925|       |            /* close the iterator and throw a type error exception */
27926|      0|            emit_label(s, label_throw1);
27927|      0|            emit_op(s, OP_iterator_call);
27928|      0|            emit_u8(s, 2);
27929|      0|            label_throw2 = emit_goto(s, OP_if_true, -1);
27930|      0|            if (is_async)
  ------------------
  |  Branch (27930:17): [True: 0, False: 0]
  ------------------
27931|      0|                emit_op(s, OP_await);
27932|      0|            emit_label(s, label_throw2);
27933|       |
27934|      0|            emit_op(s, OP_throw_error);
27935|      0|            emit_atom(s, JS_ATOM_NULL);
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
27936|      0|            emit_u8(s, JS_THROW_ERROR_ITERATOR_THROW);
  ------------------
  |  |18345|      0|#define JS_THROW_ERROR_ITERATOR_THROW 4
  ------------------
27937|       |
27938|      0|            emit_label(s, label_next);
27939|      0|            emit_op(s, OP_get_field);
27940|      0|            emit_atom(s, JS_ATOM_value);
27941|      0|            emit_op(s, OP_nip); /* keep the value associated with
27942|       |                                   done = true */
27943|      0|            emit_op(s, OP_nip);
27944|      0|            emit_op(s, OP_nip);
27945|      0|        } else {
27946|      0|            int label_next;
27947|       |
27948|      0|            if (is_async)
  ------------------
  |  Branch (27948:17): [True: 0, False: 0]
  ------------------
27949|      0|                emit_op(s, OP_await);
27950|      0|            emit_op(s, OP_yield);
27951|      0|            label_next = emit_goto(s, OP_if_false, -1);
27952|      0|            emit_return(s, TRUE);
27953|      0|            emit_label(s, label_next);
27954|      0|        }
27955|      0|        return 0;
27956|    139|    } else if (s->token.val == '(' &&
  ------------------
  |  Branch (27956:16): [True: 2, False: 137]
  ------------------
27957|      2|               js_parse_skip_parens_token(s, NULL, TRUE) == TOK_ARROW) {
  ------------------
  |  Branch (27957:16): [True: 2, False: 0]
  ------------------
27958|      2|        return js_parse_function_decl(s, JS_PARSE_FUNC_ARROW,
27959|      2|                                      JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  449|      2|#define JS_ATOM_NULL 0
  ------------------
27960|      2|                                      s->token.ptr);
27961|    137|    } else if (token_is_pseudo_keyword(s, JS_ATOM_async)) {
  ------------------
  |  Branch (27961:16): [True: 0, False: 137]
  ------------------
27962|      0|        const uint8_t *source_ptr;
27963|      0|        int tok;
27964|      0|        JSParsePos pos;
27965|       |
27966|       |        /* fast test */
27967|      0|        tok = peek_token(s, TRUE);
27968|      0|        if (tok == TOK_FUNCTION || tok == '\n')
  ------------------
  |  Branch (27968:13): [True: 0, False: 0]
  |  Branch (27968:36): [True: 0, False: 0]
  ------------------
27969|      0|            goto next;
27970|       |
27971|      0|        source_ptr = s->token.ptr;
27972|      0|        js_parse_get_pos(s, &pos);
27973|      0|        if (next_token(s))
  ------------------
  |  Branch (27973:13): [True: 0, False: 0]
  ------------------
27974|      0|            return -1;
27975|      0|        if ((s->token.val == '(' &&
  ------------------
  |  Branch (27975:14): [True: 0, False: 0]
  ------------------
27976|      0|             js_parse_skip_parens_token(s, NULL, TRUE) == TOK_ARROW) ||
  ------------------
  |  Branch (27976:14): [True: 0, False: 0]
  ------------------
27977|      0|            (s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved &&
  ------------------
  |  Branch (27977:14): [True: 0, False: 0]
  |  Branch (27977:43): [True: 0, False: 0]
  ------------------
27978|      0|             peek_token(s, TRUE) == TOK_ARROW)) {
  ------------------
  |  Branch (27978:14): [True: 0, False: 0]
  ------------------
27979|      0|            return js_parse_function_decl(s, JS_PARSE_FUNC_ARROW,
27980|      0|                                          JS_FUNC_ASYNC, JS_ATOM_NULL,
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
27981|      0|                                          source_ptr);
27982|      0|        } else {
27983|       |            /* undo the token parsing */
27984|      0|            if (js_parse_seek_token(s, &pos))
  ------------------
  |  Branch (27984:17): [True: 0, False: 0]
  ------------------
27985|      0|                return -1;
27986|      0|        }
27987|    137|    } else if (s->token.val == TOK_IDENT &&
  ------------------
  |  Branch (27987:16): [True: 100, False: 37]
  ------------------
27988|    100|               peek_token(s, TRUE) == TOK_ARROW) {
  ------------------
  |  Branch (27988:16): [True: 0, False: 100]
  ------------------
27989|      0|        return js_parse_function_decl(s, JS_PARSE_FUNC_ARROW,
27990|      0|                                      JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
27991|      0|                                      s->token.ptr);
27992|    137|    } else if ((s->token.val == '{' || s->token.val == '[') &&
  ------------------
  |  Branch (27992:17): [True: 0, False: 137]
  |  Branch (27992:40): [True: 0, False: 137]
  ------------------
27993|      0|               js_parse_skip_parens_token(s, &skip_bits, FALSE) == '=') {
  ------------------
  |  Branch (27993:16): [True: 0, False: 0]
  ------------------
27994|      0|        if (js_parse_destructuring_element(s, 0, 0, FALSE, skip_bits & SKIP_HAS_ELLIPSIS, TRUE, FALSE) < 0)
  ------------------
  |  |24597|      0|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
  |  Branch (27994:13): [True: 0, False: 0]
  ------------------
27995|      0|            return -1;
27996|      0|        return 0;
27997|      0|    }
27998|    137| next:
27999|    137|    if (s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (27999:9): [True: 100, False: 37]
  ------------------
28000|       |        /* name0 is used to check for OP_set_name pattern, not duplicated */
28001|    100|        name0 = s->token.u.ident.atom;
28002|    100|    }
28003|    137|    if (js_parse_cond_expr(s, parse_flags))
  ------------------
  |  Branch (28003:9): [True: 2, False: 135]
  ------------------
28004|      2|        return -1;
28005|       |
28006|    135|    op = s->token.val;
28007|    135|    if (op == '=' || (op >= TOK_MUL_ASSIGN && op <= TOK_POW_ASSIGN)) {
  ------------------
  |  Branch (28007:9): [True: 36, False: 99]
  |  Branch (28007:23): [True: 76, False: 23]
  |  Branch (28007:47): [True: 2, False: 74]
  ------------------
28008|     38|        int label;
28009|     38|        const uint8_t *op_token_ptr;
28010|     38|        op_token_ptr = s->token.ptr;
28011|     38|        if (next_token(s))
  ------------------
  |  Branch (28011:13): [True: 0, False: 38]
  ------------------
28012|      0|            return -1;
28013|     38|        if (get_lvalue(s, &opcode, &scope, &name, &label, NULL, (op != '='), op) < 0)
  ------------------
  |  Branch (28013:13): [True: 0, False: 38]
  ------------------
28014|      0|            return -1;
28015|       |
28016|     38|        if (js_parse_assign_expr2(s, parse_flags)) {
  ------------------
  |  Branch (28016:13): [True: 0, False: 38]
  ------------------
28017|      0|            JS_FreeAtom(s->ctx, name);
28018|      0|            return -1;
28019|      0|        }
28020|       |
28021|     38|        if (op == '=') {
  ------------------
  |  Branch (28021:13): [True: 36, False: 2]
  ------------------
28022|     36|            if ((opcode == OP_get_ref_value || opcode == OP_scope_get_var) && name == name0) {
  ------------------
  |  Branch (28022:18): [True: 0, False: 36]
  |  Branch (28022:48): [True: 8, False: 28]
  |  Branch (28022:79): [True: 8, False: 0]
  ------------------
28023|      8|                set_object_name(s, name);
28024|      8|            }
28025|     36|        } else {
28026|      2|            static const uint8_t assign_opcodes[] = {
28027|      2|                OP_mul, OP_div, OP_mod, OP_add, OP_sub,
28028|      2|                OP_shl, OP_sar, OP_shr, OP_and, OP_xor, OP_or,
28029|      2|                OP_pow,
28030|      2|            };
28031|      2|            op = assign_opcodes[op - TOK_MUL_ASSIGN];
28032|      2|            emit_source_pos(s, op_token_ptr);
28033|      2|            emit_op(s, op);
28034|      2|        }
28035|     38|        put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_KEEP_TOP, FALSE);
28036|     97|    } else if (op >= TOK_LAND_ASSIGN && op <= TOK_DOUBLE_QUESTION_MARK_ASSIGN) {
  ------------------
  |  Branch (28036:16): [True: 74, False: 23]
  |  Branch (28036:41): [True: 0, False: 74]
  ------------------
28037|      0|        int label, label1, depth_lvalue, label2;
28038|       |
28039|      0|        if (next_token(s))
  ------------------
  |  Branch (28039:13): [True: 0, False: 0]
  ------------------
28040|      0|            return -1;
28041|      0|        if (get_lvalue(s, &opcode, &scope, &name, &label,
  ------------------
  |  Branch (28041:13): [True: 0, False: 0]
  ------------------
28042|      0|                       &depth_lvalue, TRUE, op) < 0)
28043|      0|            return -1;
28044|       |
28045|      0|        emit_op(s, OP_dup);
28046|      0|        if (op == TOK_DOUBLE_QUESTION_MARK_ASSIGN)
  ------------------
  |  Branch (28046:13): [True: 0, False: 0]
  ------------------
28047|      0|            emit_op(s, OP_is_undefined_or_null);
28048|      0|        label1 = emit_goto(s, op == TOK_LOR_ASSIGN ? OP_if_true : OP_if_false,
  ------------------
  |  Branch (28048:31): [True: 0, False: 0]
  ------------------
28049|      0|                           -1);
28050|      0|        emit_op(s, OP_drop);
28051|       |
28052|      0|        if (js_parse_assign_expr2(s, parse_flags)) {
  ------------------
  |  Branch (28052:13): [True: 0, False: 0]
  ------------------
28053|      0|            JS_FreeAtom(s->ctx, name);
28054|      0|            return -1;
28055|      0|        }
28056|       |
28057|      0|        if ((opcode == OP_get_ref_value || opcode == OP_scope_get_var) && name == name0) {
  ------------------
  |  Branch (28057:14): [True: 0, False: 0]
  |  Branch (28057:44): [True: 0, False: 0]
  |  Branch (28057:75): [True: 0, False: 0]
  ------------------
28058|      0|            set_object_name(s, name);
28059|      0|        }
28060|       |
28061|      0|        switch(depth_lvalue) {
28062|      0|        case 0:
  ------------------
  |  Branch (28062:9): [True: 0, False: 0]
  ------------------
28063|      0|            emit_op(s, OP_dup);
28064|      0|            break;
28065|      0|        case 1:
  ------------------
  |  Branch (28065:9): [True: 0, False: 0]
  ------------------
28066|      0|            emit_op(s, OP_insert2);
28067|      0|            break;
28068|      0|        case 2:
  ------------------
  |  Branch (28068:9): [True: 0, False: 0]
  ------------------
28069|      0|            emit_op(s, OP_insert3);
28070|      0|            break;
28071|      0|        case 3:
  ------------------
  |  Branch (28071:9): [True: 0, False: 0]
  ------------------
28072|      0|            emit_op(s, OP_insert4);
28073|      0|            break;
28074|      0|        default:
  ------------------
  |  Branch (28074:9): [True: 0, False: 0]
  ------------------
28075|      0|            abort();
28076|      0|        }
28077|       |
28078|       |        /* XXX: we disable the OP_put_ref_value optimization by not
28079|       |           using put_lvalue() otherwise depth_lvalue is not correct */
28080|      0|        put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_NOKEEP_DEPTH,
28081|      0|                   FALSE);
28082|      0|        label2 = emit_goto(s, OP_goto, -1);
28083|       |
28084|      0|        emit_label(s, label1);
28085|       |
28086|       |        /* remove the lvalue stack entries */
28087|      0|        while (depth_lvalue != 0) {
  ------------------
  |  Branch (28087:16): [True: 0, False: 0]
  ------------------
28088|      0|            emit_op(s, OP_nip);
28089|      0|            depth_lvalue--;
28090|      0|        }
28091|       |
28092|      0|        emit_label(s, label2);
28093|      0|    }
28094|    135|    return 0;
28095|    135|}
quickjs.c:js_parse_cond_expr:
27785|    137|{
27786|    137|    int label1, label2;
27787|       |
27788|    137|    if (js_parse_coalesce_expr(s, parse_flags))
  ------------------
  |  Branch (27788:9): [True: 2, False: 135]
  ------------------
27789|      2|        return -1;
27790|    135|    if (s->token.val == '?') {
  ------------------
  |  Branch (27790:9): [True: 0, False: 135]
  ------------------
27791|      0|        if (next_token(s))
  ------------------
  |  Branch (27791:13): [True: 0, False: 0]
  ------------------
27792|      0|            return -1;
27793|      0|        label1 = emit_goto(s, OP_if_false, -1);
27794|       |
27795|      0|        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (27795:13): [True: 0, False: 0]
  ------------------
27796|      0|            return -1;
27797|      0|        if (js_parse_expect(s, ':'))
  ------------------
  |  Branch (27797:13): [True: 0, False: 0]
  ------------------
27798|      0|            return -1;
27799|       |
27800|      0|        label2 = emit_goto(s, OP_goto, -1);
27801|       |
27802|      0|        emit_label(s, label1);
27803|       |
27804|      0|        if (js_parse_assign_expr2(s, parse_flags & PF_IN_ACCEPTED))
  ------------------
  |  |24899|      0|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
  |  Branch (27804:13): [True: 0, False: 0]
  ------------------
27805|      0|            return -1;
27806|       |
27807|      0|        emit_label(s, label2);
27808|      0|    }
27809|    135|    return 0;
27810|    135|}
quickjs.c:js_parse_coalesce_expr:
27757|    137|{
27758|    137|    int label1;
27759|       |
27760|    137|    if (js_parse_logical_and_or(s, TOK_LOR, parse_flags))
  ------------------
  |  Branch (27760:9): [True: 2, False: 135]
  ------------------
27761|      2|        return -1;
27762|    135|    if (s->token.val == TOK_DOUBLE_QUESTION_MARK) {
  ------------------
  |  Branch (27762:9): [True: 0, False: 135]
  ------------------
27763|      0|        label1 = new_label(s);
27764|      0|        for(;;) {
27765|      0|            if (next_token(s))
  ------------------
  |  Branch (27765:17): [True: 0, False: 0]
  ------------------
27766|      0|                return -1;
27767|       |
27768|      0|            emit_op(s, OP_dup);
27769|      0|            emit_op(s, OP_is_undefined_or_null);
27770|      0|            emit_goto(s, OP_if_false, label1);
27771|      0|            emit_op(s, OP_drop);
27772|       |
27773|      0|            if (js_parse_expr_binary(s, 8, parse_flags))
  ------------------
  |  Branch (27773:17): [True: 0, False: 0]
  ------------------
27774|      0|                return -1;
27775|      0|            if (s->token.val != TOK_DOUBLE_QUESTION_MARK)
  ------------------
  |  Branch (27775:17): [True: 0, False: 0]
  ------------------
27776|      0|                break;
27777|      0|        }
27778|      0|        emit_label(s, label1);
27779|      0|    }
27780|    135|    return 0;
27781|    135|}
quickjs.c:js_parse_logical_and_or:
27716|    274|{
27717|    274|    int label1;
27718|       |
27719|    274|    if (op == TOK_LAND) {
  ------------------
  |  Branch (27719:9): [True: 137, False: 137]
  ------------------
27720|    137|        if (js_parse_expr_binary(s, 8, parse_flags))
  ------------------
  |  Branch (27720:13): [True: 2, False: 135]
  ------------------
27721|      2|            return -1;
27722|    137|    } else {
27723|    137|        if (js_parse_logical_and_or(s, TOK_LAND, parse_flags))
  ------------------
  |  Branch (27723:13): [True: 2, False: 135]
  ------------------
27724|      2|            return -1;
27725|    137|    }
27726|    270|    if (s->token.val == op) {
  ------------------
  |  Branch (27726:9): [True: 0, False: 270]
  ------------------
27727|      0|        label1 = new_label(s);
27728|       |
27729|      0|        for(;;) {
27730|      0|            if (next_token(s))
  ------------------
  |  Branch (27730:17): [True: 0, False: 0]
  ------------------
27731|      0|                return -1;
27732|      0|            emit_op(s, OP_dup);
27733|      0|            emit_goto(s, op == TOK_LAND ? OP_if_false : OP_if_true, label1);
  ------------------
  |  Branch (27733:26): [True: 0, False: 0]
  ------------------
27734|      0|            emit_op(s, OP_drop);
27735|       |
27736|      0|            if (op == TOK_LAND) {
  ------------------
  |  Branch (27736:17): [True: 0, False: 0]
  ------------------
27737|      0|                if (js_parse_expr_binary(s, 8, parse_flags))
  ------------------
  |  Branch (27737:21): [True: 0, False: 0]
  ------------------
27738|      0|                    return -1;
27739|      0|            } else {
27740|      0|                if (js_parse_logical_and_or(s, TOK_LAND,
  ------------------
  |  Branch (27740:21): [True: 0, False: 0]
  ------------------
27741|      0|                                            parse_flags))
27742|      0|                    return -1;
27743|      0|            }
27744|      0|            if (s->token.val != op) {
  ------------------
  |  Branch (27744:17): [True: 0, False: 0]
  ------------------
27745|      0|                if (s->token.val == TOK_DOUBLE_QUESTION_MARK)
  ------------------
  |  Branch (27745:21): [True: 0, False: 0]
  ------------------
27746|      0|                    return js_parse_error(s, "cannot mix ?? with && or ||");
27747|      0|                break;
27748|      0|            }
27749|      0|        }
27750|       |
27751|      0|        emit_label(s, label1);
27752|      0|    }
27753|    270|    return 0;
27754|    270|}
quickjs.c:js_parse_expr_binary:
27549|  1.25k|{
27550|  1.25k|    int op, opcode;
27551|  1.25k|    const uint8_t *op_token_ptr;
27552|       |    
27553|  1.25k|    if (level == 0) {
  ------------------
  |  Branch (27553:9): [True: 151, False: 1.10k]
  ------------------
27554|    151|        return js_parse_unary(s, PF_POW_ALLOWED);
  ------------------
  |  |24903|    151|#define PF_POW_ALLOWED  (1 << 2)
  ------------------
27555|  1.10k|    } else if (s->token.val == TOK_PRIVATE_NAME &&
  ------------------
  |  Branch (27555:16): [True: 0, False: 1.10k]
  ------------------
27556|      0|               (parse_flags & PF_IN_ACCEPTED) && level == 4 &&
  ------------------
  |  |24899|      0|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
  |  Branch (27556:16): [True: 0, False: 0]
  |  Branch (27556:50): [True: 0, False: 0]
  ------------------
27557|      0|               peek_token(s, FALSE) == TOK_IN) {
  ------------------
  |  Branch (27557:16): [True: 0, False: 0]
  ------------------
27558|      0|        JSAtom atom;
27559|       |
27560|      0|        atom = JS_DupAtom(s->ctx, s->token.u.ident.atom);
27561|      0|        if (next_token(s))
  ------------------
  |  Branch (27561:13): [True: 0, False: 0]
  ------------------
27562|      0|            goto fail_private_in;
27563|      0|        if (s->token.val != TOK_IN)
  ------------------
  |  Branch (27563:13): [True: 0, False: 0]
  ------------------
27564|      0|            goto fail_private_in;
27565|      0|        if (next_token(s))
  ------------------
  |  Branch (27565:13): [True: 0, False: 0]
  ------------------
27566|      0|            goto fail_private_in;
27567|      0|        if (js_parse_expr_binary(s, level - 1, parse_flags)) {
  ------------------
  |  Branch (27567:13): [True: 0, False: 0]
  ------------------
27568|      0|        fail_private_in:
27569|      0|            JS_FreeAtom(s->ctx, atom);
27570|      0|            return -1;
27571|      0|        }
27572|      0|        emit_op(s, OP_scope_in_private_field);
27573|      0|        emit_atom(s, atom);
27574|      0|        emit_u16(s, s->cur_func->scope_level);
27575|      0|        JS_FreeAtom(s->ctx, atom);
27576|      0|        return 0;
27577|  1.10k|    } else {
27578|  1.10k|        if (js_parse_expr_binary(s, level - 1, parse_flags))
  ------------------
  |  Branch (27578:13): [True: 16, False: 1.08k]
  ------------------
27579|     16|            return -1;
27580|  1.10k|    }
27581|  1.10k|    for(;;) {
27582|  1.10k|        op = s->token.val;
27583|  1.10k|        op_token_ptr = s->token.ptr;
27584|  1.10k|        switch(level) {
27585|    149|        case 1:
  ------------------
  |  Branch (27585:9): [True: 149, False: 953]
  ------------------
27586|    149|            switch(op) {
27587|      6|            case '*':
  ------------------
  |  Branch (27587:13): [True: 6, False: 143]
  ------------------
27588|      6|                opcode = OP_mul;
27589|      6|                break;
27590|      0|            case '/':
  ------------------
  |  Branch (27590:13): [True: 0, False: 149]
  ------------------
27591|      0|                opcode = OP_div;
27592|      0|                break;
27593|      4|            case '%':
  ------------------
  |  Branch (27593:13): [True: 4, False: 145]
  ------------------
27594|      4|                opcode = OP_mod;
27595|      4|                break;
27596|    139|            default:
  ------------------
  |  Branch (27596:13): [True: 139, False: 10]
  ------------------
27597|    139|                return 0;
27598|    149|            }
27599|     10|            break;
27600|    139|        case 2:
  ------------------
  |  Branch (27600:9): [True: 139, False: 963]
  ------------------
27601|    139|            switch(op) {
27602|      3|            case '+':
  ------------------
  |  Branch (27602:13): [True: 3, False: 136]
  ------------------
27603|      3|                opcode = OP_add;
27604|      3|                break;
27605|      0|            case '-':
  ------------------
  |  Branch (27605:13): [True: 0, False: 139]
  ------------------
27606|      0|                opcode = OP_sub;
27607|      0|                break;
27608|    136|            default:
  ------------------
  |  Branch (27608:13): [True: 136, False: 3]
  ------------------
27609|    136|                return 0;
27610|    139|            }
27611|      3|            break;
27612|    136|        case 3:
  ------------------
  |  Branch (27612:9): [True: 136, False: 966]
  ------------------
27613|    136|            switch(op) {
27614|      0|            case TOK_SHL:
  ------------------
  |  Branch (27614:13): [True: 0, False: 136]
  ------------------
27615|      0|                opcode = OP_shl;
27616|      0|                break;
27617|      0|            case TOK_SAR:
  ------------------
  |  Branch (27617:13): [True: 0, False: 136]
  ------------------
27618|      0|                opcode = OP_sar;
27619|      0|                break;
27620|      0|            case TOK_SHR:
  ------------------
  |  Branch (27620:13): [True: 0, False: 136]
  ------------------
27621|      0|                opcode = OP_shr;
27622|      0|                break;
27623|    136|            default:
  ------------------
  |  Branch (27623:13): [True: 136, False: 0]
  ------------------
27624|    136|                return 0;
27625|    136|            }
27626|      0|            break;
27627|    136|        case 4:
  ------------------
  |  Branch (27627:9): [True: 136, False: 966]
  ------------------
27628|    136|            switch(op) {
27629|      0|            case '<':
  ------------------
  |  Branch (27629:13): [True: 0, False: 136]
  ------------------
27630|      0|                opcode = OP_lt;
27631|      0|                break;
27632|      0|            case '>':
  ------------------
  |  Branch (27632:13): [True: 0, False: 136]
  ------------------
27633|      0|                opcode = OP_gt;
27634|      0|                break;
27635|      0|            case TOK_LTE:
  ------------------
  |  Branch (27635:13): [True: 0, False: 136]
  ------------------
27636|      0|                opcode = OP_lte;
27637|      0|                break;
27638|      0|            case TOK_GTE:
  ------------------
  |  Branch (27638:13): [True: 0, False: 136]
  ------------------
27639|      0|                opcode = OP_gte;
27640|      0|                break;
27641|      0|            case TOK_INSTANCEOF:
  ------------------
  |  Branch (27641:13): [True: 0, False: 136]
  ------------------
27642|      0|                opcode = OP_instanceof;
27643|      0|                break;
27644|      0|            case TOK_IN:
  ------------------
  |  Branch (27644:13): [True: 0, False: 136]
  ------------------
27645|      0|                if (parse_flags & PF_IN_ACCEPTED) {
  ------------------
  |  |24899|      0|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
  |  Branch (27645:21): [True: 0, False: 0]
  ------------------
27646|      0|                    opcode = OP_in;
27647|      0|                } else {
27648|      0|                    return 0;
27649|      0|                }
27650|      0|                break;
27651|    136|            default:
  ------------------
  |  Branch (27651:13): [True: 136, False: 0]
  ------------------
27652|    136|                return 0;
27653|    136|            }
27654|      0|            break;
27655|    136|        case 5:
  ------------------
  |  Branch (27655:9): [True: 136, False: 966]
  ------------------
27656|    136|            switch(op) {
27657|      0|            case TOK_EQ:
  ------------------
  |  Branch (27657:13): [True: 0, False: 136]
  ------------------
27658|      0|                opcode = OP_eq;
27659|      0|                break;
27660|      0|            case TOK_NEQ:
  ------------------
  |  Branch (27660:13): [True: 0, False: 136]
  ------------------
27661|      0|                opcode = OP_neq;
27662|      0|                break;
27663|      0|            case TOK_STRICT_EQ:
  ------------------
  |  Branch (27663:13): [True: 0, False: 136]
  ------------------
27664|      0|                opcode = OP_strict_eq;
27665|      0|                break;
27666|      0|            case TOK_STRICT_NEQ:
  ------------------
  |  Branch (27666:13): [True: 0, False: 136]
  ------------------
27667|      0|                opcode = OP_strict_neq;
27668|      0|                break;
27669|    136|            default:
  ------------------
  |  Branch (27669:13): [True: 136, False: 0]
  ------------------
27670|    136|                return 0;
27671|    136|            }
27672|      0|            break;
27673|    136|        case 6:
  ------------------
  |  Branch (27673:9): [True: 136, False: 966]
  ------------------
27674|    136|            switch(op) {
27675|      1|            case '&':
  ------------------
  |  Branch (27675:13): [True: 1, False: 135]
  ------------------
27676|      1|                opcode = OP_and;
27677|      1|                break;
27678|    135|            default:
  ------------------
  |  Branch (27678:13): [True: 135, False: 1]
  ------------------
27679|    135|                return 0;
27680|    136|            }
27681|      1|            break;
27682|    135|        case 7:
  ------------------
  |  Branch (27682:9): [True: 135, False: 967]
  ------------------
27683|    135|            switch(op) {
27684|      0|            case '^':
  ------------------
  |  Branch (27684:13): [True: 0, False: 135]
  ------------------
27685|      0|                opcode = OP_xor;
27686|      0|                break;
27687|    135|            default:
  ------------------
  |  Branch (27687:13): [True: 135, False: 0]
  ------------------
27688|    135|                return 0;
27689|    135|            }
27690|      0|            break;
27691|    135|        case 8:
  ------------------
  |  Branch (27691:9): [True: 135, False: 967]
  ------------------
27692|    135|            switch(op) {
27693|      0|            case '|':
  ------------------
  |  Branch (27693:13): [True: 0, False: 135]
  ------------------
27694|      0|                opcode = OP_or;
27695|      0|                break;
27696|    135|            default:
  ------------------
  |  Branch (27696:13): [True: 135, False: 0]
  ------------------
27697|    135|                return 0;
27698|    135|            }
27699|      0|            break;
27700|      0|        default:
  ------------------
  |  Branch (27700:9): [True: 0, False: 1.10k]
  ------------------
27701|      0|            abort();
27702|  1.10k|        }
27703|     14|        if (next_token(s))
  ------------------
  |  Branch (27703:13): [True: 0, False: 14]
  ------------------
27704|      0|            return -1;
27705|     14|        if (js_parse_expr_binary(s, level - 1, parse_flags))
  ------------------
  |  Branch (27705:13): [True: 0, False: 14]
  ------------------
27706|      0|            return -1;
27707|     14|        emit_source_pos(s, op_token_ptr);
27708|     14|        emit_op(s, opcode);
27709|     14|    }
27710|      0|    return 0;
27711|  1.08k|}
quickjs.c:js_parse_unary:
27408|    160|{
27409|    160|    int op;
27410|    160|    const uint8_t *op_token_ptr;
27411|       |
27412|    160|    switch(s->token.val) {
27413|      0|    case '+':
  ------------------
  |  Branch (27413:5): [True: 0, False: 160]
  ------------------
27414|      5|    case '-':
  ------------------
  |  Branch (27414:5): [True: 5, False: 155]
  ------------------
27415|      7|    case '!':
  ------------------
  |  Branch (27415:5): [True: 2, False: 158]
  ------------------
27416|      9|    case '~':
  ------------------
  |  Branch (27416:5): [True: 2, False: 158]
  ------------------
27417|      9|    case TOK_VOID:
  ------------------
  |  Branch (27417:5): [True: 0, False: 160]
  ------------------
27418|      9|        op_token_ptr = s->token.ptr;
27419|      9|        op = s->token.val;
27420|      9|        if (next_token(s))
  ------------------
  |  Branch (27420:13): [True: 0, False: 9]
  ------------------
27421|      0|            return -1;
27422|      9|        if (js_parse_unary(s, PF_POW_FORBIDDEN))
  ------------------
  |  |24905|      9|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27422:13): [True: 0, False: 9]
  ------------------
27423|      0|            return -1;
27424|      9|        switch(op) {
27425|      5|        case '-':
  ------------------
  |  Branch (27425:9): [True: 5, False: 4]
  ------------------
27426|      5|            emit_source_pos(s, op_token_ptr);
27427|      5|            emit_op(s, OP_neg);
27428|      5|            break;
27429|      0|        case '+':
  ------------------
  |  Branch (27429:9): [True: 0, False: 9]
  ------------------
27430|      0|            emit_source_pos(s, op_token_ptr);
27431|      0|            emit_op(s, OP_plus);
27432|      0|            break;
27433|      2|        case '!':
  ------------------
  |  Branch (27433:9): [True: 2, False: 7]
  ------------------
27434|      2|            emit_op(s, OP_lnot);
27435|      2|            break;
27436|      2|        case '~':
  ------------------
  |  Branch (27436:9): [True: 2, False: 7]
  ------------------
27437|      2|            emit_source_pos(s, op_token_ptr);
27438|      2|            emit_op(s, OP_not);
27439|      2|            break;
27440|      0|        case TOK_VOID:
  ------------------
  |  Branch (27440:9): [True: 0, False: 9]
  ------------------
27441|      0|            emit_op(s, OP_drop);
27442|      0|            emit_op(s, OP_undefined);
27443|      0|            break;
27444|      0|        default:
  ------------------
  |  Branch (27444:9): [True: 0, False: 9]
  ------------------
27445|      0|            abort();
27446|      9|        }
27447|      9|        parse_flags = 0;
27448|      9|        break;
27449|      0|    case TOK_DEC:
  ------------------
  |  Branch (27449:5): [True: 0, False: 160]
  ------------------
27450|      0|    case TOK_INC:
  ------------------
  |  Branch (27450:5): [True: 0, False: 160]
  ------------------
27451|      0|        {
27452|      0|            int opcode, op, scope, label;
27453|      0|            JSAtom name;
27454|      0|            op = s->token.val;
27455|      0|            op_token_ptr = s->token.ptr;
27456|      0|            if (next_token(s))
  ------------------
  |  Branch (27456:17): [True: 0, False: 0]
  ------------------
27457|      0|                return -1;
27458|      0|            if (js_parse_unary(s, 0))
  ------------------
  |  Branch (27458:17): [True: 0, False: 0]
  ------------------
27459|      0|                return -1;
27460|      0|            if (get_lvalue(s, &opcode, &scope, &name, &label, NULL, TRUE, op))
  ------------------
  |  Branch (27460:17): [True: 0, False: 0]
  ------------------
27461|      0|                return -1;
27462|      0|            emit_source_pos(s, op_token_ptr);
27463|      0|            emit_op(s, OP_dec + op - TOK_DEC);
27464|      0|            put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_KEEP_TOP,
27465|      0|                       FALSE);
27466|      0|        }
27467|      0|        break;
27468|      0|    case TOK_TYPEOF:
  ------------------
  |  Branch (27468:5): [True: 0, False: 160]
  ------------------
27469|      0|        {
27470|      0|            JSFunctionDef *fd;
27471|      0|            if (next_token(s))
  ------------------
  |  Branch (27471:17): [True: 0, False: 0]
  ------------------
27472|      0|                return -1;
27473|      0|            if (js_parse_unary(s, PF_POW_FORBIDDEN))
  ------------------
  |  |24905|      0|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27473:17): [True: 0, False: 0]
  ------------------
27474|      0|                return -1;
27475|       |            /* reference access should not return an exception, so we
27476|       |               patch the get_var */
27477|      0|            fd = s->cur_func;
27478|      0|            if (get_prev_opcode(fd) == OP_scope_get_var) {
  ------------------
  |  Branch (27478:17): [True: 0, False: 0]
  ------------------
27479|      0|                fd->byte_code.buf[fd->last_opcode_pos] = OP_scope_get_var_undef;
27480|      0|            }
27481|      0|            emit_op(s, OP_typeof);
27482|      0|            parse_flags = 0;
27483|      0|        }
27484|      0|        break;
27485|      0|    case TOK_DELETE:
  ------------------
  |  Branch (27485:5): [True: 0, False: 160]
  ------------------
27486|      0|        if (js_parse_delete(s))
  ------------------
  |  Branch (27486:13): [True: 0, False: 0]
  ------------------
27487|      0|            return -1;
27488|      0|        parse_flags = 0;
27489|      0|        break;
27490|      0|    case TOK_AWAIT:
  ------------------
  |  Branch (27490:5): [True: 0, False: 160]
  ------------------
27491|      0|        if (!(s->cur_func->func_kind & JS_FUNC_ASYNC))
  ------------------
  |  Branch (27491:13): [True: 0, False: 0]
  ------------------
27492|      0|            return js_parse_error(s, "unexpected 'await' keyword");
27493|      0|        if (!s->cur_func->in_function_body)
  ------------------
  |  Branch (27493:13): [True: 0, False: 0]
  ------------------
27494|      0|            return js_parse_error(s, "await in default expression");
27495|      0|        if (next_token(s))
  ------------------
  |  Branch (27495:13): [True: 0, False: 0]
  ------------------
27496|      0|            return -1;
27497|      0|        if (js_parse_unary(s, PF_POW_FORBIDDEN))
  ------------------
  |  |24905|      0|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27497:13): [True: 0, False: 0]
  ------------------
27498|      0|            return -1;
27499|      0|        s->cur_func->has_await = TRUE;
27500|      0|        emit_op(s, OP_await);
27501|      0|        parse_flags = 0;
27502|      0|        break;
27503|    151|    default:
  ------------------
  |  Branch (27503:5): [True: 151, False: 9]
  ------------------
27504|    151|        if (js_parse_postfix_expr(s, PF_POSTFIX_CALL))
  ------------------
  |  |24901|    151|#define PF_POSTFIX_CALL (1 << 1)
  ------------------
  |  Branch (27504:13): [True: 2, False: 149]
  ------------------
27505|      2|            return -1;
27506|    149|        if (!s->got_lf &&
  ------------------
  |  Branch (27506:13): [True: 116, False: 33]
  ------------------
27507|    116|            (s->token.val == TOK_DEC || s->token.val == TOK_INC)) {
  ------------------
  |  Branch (27507:14): [True: 0, False: 116]
  |  Branch (27507:41): [True: 0, False: 116]
  ------------------
27508|      0|            int opcode, op, scope, label;
27509|      0|            JSAtom name;
27510|      0|            op = s->token.val;
27511|      0|            op_token_ptr = s->token.ptr;
27512|      0|            if (get_lvalue(s, &opcode, &scope, &name, &label, NULL, TRUE, op))
  ------------------
  |  Branch (27512:17): [True: 0, False: 0]
  ------------------
27513|      0|                return -1;
27514|      0|            emit_source_pos(s, op_token_ptr);
27515|      0|            emit_op(s, OP_post_dec + op - TOK_DEC);
27516|      0|            put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_KEEP_SECOND,
27517|      0|                       FALSE);
27518|      0|            if (next_token(s))
  ------------------
  |  Branch (27518:17): [True: 0, False: 0]
  ------------------
27519|      0|                return -1;
27520|      0|        }
27521|    149|        break;
27522|    160|    }
27523|    158|    if (parse_flags & (PF_POW_ALLOWED | PF_POW_FORBIDDEN)) {
  ------------------
  |  |24903|    158|#define PF_POW_ALLOWED  (1 << 2)
  ------------------
                  if (parse_flags & (PF_POW_ALLOWED | PF_POW_FORBIDDEN)) {
  ------------------
  |  |24905|    158|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27523:9): [True: 149, False: 9]
  ------------------
27524|    149|        if (s->token.val == TOK_POW) {
  ------------------
  |  Branch (27524:13): [True: 0, False: 149]
  ------------------
27525|       |            /* Strict ES7 exponentiation syntax rules: To solve
27526|       |               conficting semantics between different implementations
27527|       |               regarding the precedence of prefix operators and the
27528|       |               postifx exponential, ES7 specifies that -2**2 is a
27529|       |               syntax error. */
27530|      0|            if (parse_flags & PF_POW_FORBIDDEN) {
  ------------------
  |  |24905|      0|#define PF_POW_FORBIDDEN (1 << 3)
  ------------------
  |  Branch (27530:17): [True: 0, False: 0]
  ------------------
27531|      0|                JS_ThrowSyntaxError(s->ctx, "unparenthesized unary expression can't appear on the left-hand side of '**'");
27532|      0|                return -1;
27533|      0|            }
27534|      0|            op_token_ptr = s->token.ptr;
27535|      0|            if (next_token(s))
  ------------------
  |  Branch (27535:17): [True: 0, False: 0]
  ------------------
27536|      0|                return -1;
27537|      0|            if (js_parse_unary(s, PF_POW_ALLOWED))
  ------------------
  |  |24903|      0|#define PF_POW_ALLOWED  (1 << 2)
  ------------------
  |  Branch (27537:17): [True: 0, False: 0]
  ------------------
27538|      0|                return -1;
27539|      0|            emit_source_pos(s, op_token_ptr);
27540|      0|            emit_op(s, OP_pow);
27541|      0|        }
27542|    149|    }
27543|    158|    return 0;
27544|    158|}
quickjs.c:get_lvalue:
25750|     39|{
25751|     39|    JSFunctionDef *fd;
25752|     39|    int opcode, scope, label, depth;
25753|     39|    JSAtom name;
25754|       |
25755|       |    /* we check the last opcode to get the lvalue type */
25756|     39|    fd = s->cur_func;
25757|     39|    scope = 0;
25758|     39|    name = JS_ATOM_NULL;
  ------------------
  |  |  449|     39|#define JS_ATOM_NULL 0
  ------------------
25759|     39|    label = -1;
25760|     39|    depth = 0;
25761|     39|    switch(opcode = get_prev_opcode(fd)) {
25762|     11|    case OP_scope_get_var:
  ------------------
  |  Branch (25762:5): [True: 11, False: 28]
  ------------------
25763|     11|        name = get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
25764|     11|        scope = get_u16(fd->byte_code.buf + fd->last_opcode_pos + 5);
25765|     11|        if ((name == JS_ATOM_arguments || name == JS_ATOM_eval) &&
  ------------------
  |  Branch (25765:14): [True: 0, False: 11]
  |  Branch (25765:43): [True: 0, False: 11]
  ------------------
25766|      0|            (fd->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (25766:13): [True: 0, False: 0]
  ------------------
25767|      0|            return js_parse_error(s, "invalid lvalue in strict mode");
25768|      0|        }
25769|     11|        if (name == JS_ATOM_this || name == JS_ATOM_new_target)
  ------------------
  |  Branch (25769:13): [True: 0, False: 11]
  |  Branch (25769:37): [True: 0, False: 11]
  ------------------
25770|      0|            goto invalid_lvalue;
25771|     11|        if (has_with_scope(fd, scope)) {
  ------------------
  |  Branch (25771:13): [True: 0, False: 11]
  ------------------
25772|      0|            depth = 2;  /* will generate OP_get_ref_value */
25773|     11|        } else {
25774|     11|            depth = 0;
25775|     11|        }
25776|     11|        break;
25777|     28|    case OP_get_field:
  ------------------
  |  Branch (25777:5): [True: 28, False: 11]
  ------------------
25778|     28|        name = get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
25779|     28|        depth = 1;
25780|     28|        break;
25781|      0|    case OP_scope_get_private_field:
  ------------------
  |  Branch (25781:5): [True: 0, False: 39]
  ------------------
25782|      0|        name = get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
25783|      0|        scope = get_u16(fd->byte_code.buf + fd->last_opcode_pos + 5);
25784|      0|        depth = 1;
25785|      0|        break;
25786|      0|    case OP_get_array_el:
  ------------------
  |  Branch (25786:5): [True: 0, False: 39]
  ------------------
25787|      0|        depth = 2;
25788|      0|        break;
25789|      0|    case OP_get_super_value:
  ------------------
  |  Branch (25789:5): [True: 0, False: 39]
  ------------------
25790|      0|        depth = 3;
25791|      0|        break;
25792|      0|    default:
  ------------------
  |  Branch (25792:5): [True: 0, False: 39]
  ------------------
25793|      0|    invalid_lvalue:
25794|      0|        if (tok == TOK_FOR) {
  ------------------
  |  Branch (25794:13): [True: 0, False: 0]
  ------------------
25795|      0|            return js_parse_error(s, "invalid for in/of left hand-side");
25796|      0|        } else if (tok == TOK_INC || tok == TOK_DEC) {
  ------------------
  |  Branch (25796:20): [True: 0, False: 0]
  |  Branch (25796:38): [True: 0, False: 0]
  ------------------
25797|      0|            return js_parse_error(s, "invalid increment/decrement operand");
25798|      0|        } else if (tok == '[' || tok == '{') {
  ------------------
  |  Branch (25798:20): [True: 0, False: 0]
  |  Branch (25798:34): [True: 0, False: 0]
  ------------------
25799|      0|            return js_parse_error(s, "invalid destructuring target");
25800|      0|        } else {
25801|      0|            return js_parse_error(s, "invalid assignment left-hand side");
25802|      0|        }
25803|     39|    }
25804|       |    /* remove the last opcode */
25805|     39|    fd->byte_code.size = fd->last_opcode_pos;
25806|     39|    fd->last_opcode_pos = -1;
25807|       |
25808|     39|    if (keep) {
  ------------------
  |  Branch (25808:9): [True: 2, False: 37]
  ------------------
25809|       |        /* get the value but keep the object/fields on the stack */
25810|      2|        switch(opcode) {
25811|      2|        case OP_scope_get_var:
  ------------------
  |  Branch (25811:9): [True: 2, False: 0]
  ------------------
25812|      2|            if (depth != 0) {
  ------------------
  |  Branch (25812:17): [True: 0, False: 2]
  ------------------
25813|      0|                label = new_label(s);
25814|      0|                if (label < 0)
  ------------------
  |  Branch (25814:21): [True: 0, False: 0]
  ------------------
25815|      0|                    return -1;
25816|      0|                emit_op(s, OP_scope_make_ref);
25817|      0|                emit_atom(s, name);
25818|      0|                emit_u32(s, label);
25819|      0|                emit_u16(s, scope);
25820|      0|                update_label(fd, label, 1);
25821|      0|                emit_op(s, OP_get_ref_value);
25822|      0|                opcode = OP_get_ref_value;
25823|      2|            } else {
25824|      2|                emit_op(s, OP_scope_get_var);
25825|      2|                emit_atom(s, name);
25826|      2|                emit_u16(s, scope);
25827|      2|            }
25828|      2|            break;
25829|      2|        case OP_get_field:
  ------------------
  |  Branch (25829:9): [True: 0, False: 2]
  ------------------
25830|      0|            emit_op(s, OP_get_field2);
25831|      0|            emit_atom(s, name);
25832|      0|            break;
25833|      0|        case OP_scope_get_private_field:
  ------------------
  |  Branch (25833:9): [True: 0, False: 2]
  ------------------
25834|      0|            emit_op(s, OP_scope_get_private_field2);
25835|      0|            emit_atom(s, name);
25836|      0|            emit_u16(s, scope);
25837|      0|            break;
25838|      0|        case OP_get_array_el:
  ------------------
  |  Branch (25838:9): [True: 0, False: 2]
  ------------------
25839|      0|            emit_op(s, OP_get_array_el3);
25840|      0|            break;
25841|      0|        case OP_get_super_value:
  ------------------
  |  Branch (25841:9): [True: 0, False: 2]
  ------------------
25842|      0|            emit_op(s, OP_to_propkey);
25843|      0|            emit_op(s, OP_dup3);
25844|      0|            emit_op(s, OP_get_super_value);
25845|      0|            break;
25846|      0|        default:
  ------------------
  |  Branch (25846:9): [True: 0, False: 2]
  ------------------
25847|      0|            abort();
25848|      2|        }
25849|     37|    } else {
25850|     37|        switch(opcode) {
25851|      9|        case OP_scope_get_var:
  ------------------
  |  Branch (25851:9): [True: 9, False: 28]
  ------------------
25852|      9|            if (depth != 0) {
  ------------------
  |  Branch (25852:17): [True: 0, False: 9]
  ------------------
25853|      0|                label = new_label(s);
25854|      0|                if (label < 0)
  ------------------
  |  Branch (25854:21): [True: 0, False: 0]
  ------------------
25855|      0|                    return -1;
25856|      0|                emit_op(s, OP_scope_make_ref);
25857|      0|                emit_atom(s, name);
25858|      0|                emit_u32(s, label);
25859|      0|                emit_u16(s, scope);
25860|      0|                update_label(fd, label, 1);
25861|      0|                opcode = OP_get_ref_value;
25862|      0|            }
25863|      9|            break;
25864|     28|        default:
  ------------------
  |  Branch (25864:9): [True: 28, False: 9]
  ------------------
25865|     28|            break;
25866|     37|        }
25867|     37|    }
25868|       |
25869|     39|    *popcode = opcode;
25870|     39|    *pscope = scope;
25871|       |    /* name has refcount for OP_get_field and OP_get_ref_value,
25872|       |       and JS_ATOM_NULL for other opcodes */
25873|     39|    *pname = name;
25874|     39|    *plabel = label;
25875|     39|    if (pdepth)
  ------------------
  |  Branch (25875:9): [True: 0, False: 39]
  ------------------
25876|      0|        *pdepth = depth;
25877|     39|    return 0;
25878|     39|}
quickjs.c:update_label:
23697|    118|{
23698|    118|    LabelSlot *ls;
23699|       |
23700|    118|    assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (23700:5): [True: 0, False: 118]
  |  Branch (23700:5): [True: 0, False: 0]
  |  Branch (23700:5): [True: 118, False: 0]
  |  Branch (23700:5): [True: 118, False: 0]
  ------------------
23701|    118|    ls = &s->label_slots[label];
23702|    118|    ls->ref_count += delta;
23703|    118|    assert(ls->ref_count >= 0);
  ------------------
  |  Branch (23703:5): [True: 0, False: 118]
  |  Branch (23703:5): [True: 118, False: 0]
  ------------------
23704|    118|    return ls->ref_count;
23705|    118|}
quickjs.c:emit_u8:
23652|      1|{
23653|      1|    dbuf_putc(&s->cur_func->byte_code, val);
23654|      1|}
quickjs.c:js_parse_property_name:
24439|      2|{
24440|      2|    int is_private = 0;
24441|      2|    BOOL is_non_reserved_ident;
24442|      2|    JSAtom name;
24443|      2|    int prop_type;
24444|       |
24445|      2|    prop_type = PROP_TYPE_IDENT;
  ------------------
  |  |24416|      2|#define PROP_TYPE_IDENT 0
  ------------------
24446|      2|    if (allow_method) {
  ------------------
  |  Branch (24446:9): [True: 0, False: 2]
  ------------------
24447|       |        /* if allow_private is true (for class field parsing) and
24448|       |           get/set is following by ';' (or LF with ASI), then it
24449|       |           is a field name */
24450|      0|        if ((token_is_pseudo_keyword(s, JS_ATOM_get) ||
  ------------------
  |  Branch (24450:14): [True: 0, False: 0]
  ------------------
24451|      0|             token_is_pseudo_keyword(s, JS_ATOM_set)) &&
  ------------------
  |  Branch (24451:14): [True: 0, False: 0]
  ------------------
24452|      0|            (!allow_private || peek_token(s, TRUE) != '\n')) {
  ------------------
  |  Branch (24452:14): [True: 0, False: 0]
  |  Branch (24452:32): [True: 0, False: 0]
  ------------------
24453|       |            /* get x(), set x() */
24454|      0|            name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
24455|      0|            if (next_token(s))
  ------------------
  |  Branch (24455:17): [True: 0, False: 0]
  ------------------
24456|      0|                goto fail1;
24457|      0|            if (s->token.val == ':' || s->token.val == ',' ||
  ------------------
  |  Branch (24457:17): [True: 0, False: 0]
  |  Branch (24457:40): [True: 0, False: 0]
  ------------------
24458|      0|                s->token.val == '}' || s->token.val == '(' ||
  ------------------
  |  Branch (24458:17): [True: 0, False: 0]
  |  Branch (24458:40): [True: 0, False: 0]
  ------------------
24459|      0|                s->token.val == '=' ||
  ------------------
  |  Branch (24459:17): [True: 0, False: 0]
  ------------------
24460|      0|                (s->token.val == ';' && allow_private)) {
  ------------------
  |  Branch (24460:18): [True: 0, False: 0]
  |  Branch (24460:41): [True: 0, False: 0]
  ------------------
24461|      0|                is_non_reserved_ident = TRUE;
24462|      0|                goto ident_found;
24463|      0|            }
24464|      0|            prop_type = PROP_TYPE_GET + (name == JS_ATOM_set);
  ------------------
  |  |24418|      0|#define PROP_TYPE_GET   2
  ------------------
24465|      0|            JS_FreeAtom(s->ctx, name);
24466|      0|        } else if (s->token.val == '*') {
  ------------------
  |  Branch (24466:20): [True: 0, False: 0]
  ------------------
24467|      0|            if (next_token(s))
  ------------------
  |  Branch (24467:17): [True: 0, False: 0]
  ------------------
24468|      0|                goto fail;
24469|      0|            prop_type = PROP_TYPE_STAR;
  ------------------
  |  |24420|      0|#define PROP_TYPE_STAR  4
  ------------------
24470|      0|        } else if (token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (24470:20): [True: 0, False: 0]
  ------------------
24471|      0|                   peek_token(s, TRUE) != '\n') {
  ------------------
  |  Branch (24471:20): [True: 0, False: 0]
  ------------------
24472|      0|            name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
24473|      0|            if (next_token(s))
  ------------------
  |  Branch (24473:17): [True: 0, False: 0]
  ------------------
24474|      0|                goto fail1;
24475|      0|            if (s->token.val == ':' || s->token.val == ',' ||
  ------------------
  |  Branch (24475:17): [True: 0, False: 0]
  |  Branch (24475:40): [True: 0, False: 0]
  ------------------
24476|      0|                s->token.val == '}' || s->token.val == '(' ||
  ------------------
  |  Branch (24476:17): [True: 0, False: 0]
  |  Branch (24476:40): [True: 0, False: 0]
  ------------------
24477|      0|                s->token.val == '=') {
  ------------------
  |  Branch (24477:17): [True: 0, False: 0]
  ------------------
24478|      0|                is_non_reserved_ident = TRUE;
24479|      0|                goto ident_found;
24480|      0|            }
24481|      0|            JS_FreeAtom(s->ctx, name);
24482|      0|            if (s->token.val == '*') {
  ------------------
  |  Branch (24482:17): [True: 0, False: 0]
  ------------------
24483|      0|                if (next_token(s))
  ------------------
  |  Branch (24483:21): [True: 0, False: 0]
  ------------------
24484|      0|                    goto fail;
24485|      0|                prop_type = PROP_TYPE_ASYNC_STAR;
  ------------------
  |  |24422|      0|#define PROP_TYPE_ASYNC_STAR 6
  ------------------
24486|      0|            } else {
24487|      0|                prop_type = PROP_TYPE_ASYNC;
  ------------------
  |  |24421|      0|#define PROP_TYPE_ASYNC 5
  ------------------
24488|      0|            }
24489|      0|        }
24490|      0|    }
24491|       |
24492|      2|    if (token_is_ident(s->token.val)) {
  ------------------
  |  Branch (24492:9): [True: 0, False: 2]
  ------------------
24493|       |        /* variable can only be a non-reserved identifier */
24494|      0|        is_non_reserved_ident =
24495|      0|            (s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved);
  ------------------
  |  Branch (24495:14): [True: 0, False: 0]
  |  Branch (24495:43): [True: 0, False: 0]
  ------------------
24496|       |        /* keywords and reserved words have a valid atom */
24497|      0|        name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
24498|      0|        if (next_token(s))
  ------------------
  |  Branch (24498:13): [True: 0, False: 0]
  ------------------
24499|      0|            goto fail1;
24500|      0|    ident_found:
24501|      0|        if (is_non_reserved_ident &&
  ------------------
  |  Branch (24501:13): [True: 0, False: 0]
  ------------------
24502|      0|            prop_type == PROP_TYPE_IDENT && allow_var) {
  ------------------
  |  |24416|      0|#define PROP_TYPE_IDENT 0
  ------------------
  |  Branch (24502:13): [True: 0, False: 0]
  |  Branch (24502:45): [True: 0, False: 0]
  ------------------
24503|      0|            if (!(s->token.val == ':' ||
  ------------------
  |  Branch (24503:19): [True: 0, False: 0]
  ------------------
24504|      0|                  (s->token.val == '(' && allow_method))) {
  ------------------
  |  Branch (24504:20): [True: 0, False: 0]
  |  Branch (24504:43): [True: 0, False: 0]
  ------------------
24505|      0|                prop_type = PROP_TYPE_VAR;
  ------------------
  |  |24417|      0|#define PROP_TYPE_VAR   1
  ------------------
24506|      0|            }
24507|      0|        }
24508|      2|    } else if (s->token.val == TOK_STRING) {
  ------------------
  |  Branch (24508:16): [True: 0, False: 2]
  ------------------
24509|      0|        name = JS_ValueToAtom(s->ctx, s->token.u.str.str);
24510|      0|        if (name == JS_ATOM_NULL)
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (24510:13): [True: 0, False: 0]
  ------------------
24511|      0|            goto fail;
24512|      0|        if (next_token(s))
  ------------------
  |  Branch (24512:13): [True: 0, False: 0]
  ------------------
24513|      0|            goto fail1;
24514|      2|    } else if (s->token.val == TOK_NUMBER) {
  ------------------
  |  Branch (24514:16): [True: 2, False: 0]
  ------------------
24515|      2|        JSValue val;
24516|      2|        val = s->token.u.num.val;
24517|      2|        name = JS_ValueToAtom(s->ctx, val);
24518|      2|        if (name == JS_ATOM_NULL)
  ------------------
  |  |  449|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (24518:13): [True: 0, False: 2]
  ------------------
24519|      0|            goto fail;
24520|      2|        if (next_token(s))
  ------------------
  |  Branch (24520:13): [True: 0, False: 2]
  ------------------
24521|      0|            goto fail1;
24522|      2|    } else if (s->token.val == '[') {
  ------------------
  |  Branch (24522:16): [True: 0, False: 0]
  ------------------
24523|      0|        if (next_token(s))
  ------------------
  |  Branch (24523:13): [True: 0, False: 0]
  ------------------
24524|      0|            goto fail;
24525|      0|        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (24525:13): [True: 0, False: 0]
  ------------------
24526|      0|            goto fail;
24527|      0|        if (js_parse_expect(s, ']'))
  ------------------
  |  Branch (24527:13): [True: 0, False: 0]
  ------------------
24528|      0|            goto fail;
24529|      0|        name = JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
24530|      0|    } else if (s->token.val == TOK_PRIVATE_NAME && allow_private) {
  ------------------
  |  Branch (24530:16): [True: 0, False: 0]
  |  Branch (24530:52): [True: 0, False: 0]
  ------------------
24531|      0|        name = JS_DupAtom(s->ctx, s->token.u.ident.atom);
24532|      0|        if (next_token(s))
  ------------------
  |  Branch (24532:13): [True: 0, False: 0]
  ------------------
24533|      0|            goto fail1;
24534|      0|        is_private = PROP_TYPE_PRIVATE;
  ------------------
  |  |24424|      0|#define PROP_TYPE_PRIVATE (1 << 4)
  ------------------
24535|      0|    } else {
24536|      0|        goto invalid_prop;
24537|      0|    }
24538|      2|    if (prop_type != PROP_TYPE_IDENT && prop_type != PROP_TYPE_VAR &&
  ------------------
  |  |24416|      4|#define PROP_TYPE_IDENT 0
  ------------------
                  if (prop_type != PROP_TYPE_IDENT && prop_type != PROP_TYPE_VAR &&
  ------------------
  |  |24417|      2|#define PROP_TYPE_VAR   1
  ------------------
  |  Branch (24538:9): [True: 0, False: 2]
  |  Branch (24538:41): [True: 0, False: 0]
  ------------------
24539|      0|        s->token.val != '(') {
  ------------------
  |  Branch (24539:9): [True: 0, False: 0]
  ------------------
24540|      0|        JS_FreeAtom(s->ctx, name);
24541|      0|    invalid_prop:
24542|      0|        js_parse_error(s, "invalid property name");
24543|      0|        goto fail;
24544|      0|    }
24545|      2|    *pname = name;
24546|      2|    return prop_type | is_private;
24547|      0| fail1:
24548|      0|    JS_FreeAtom(s->ctx, name);
24549|      0| fail:
24550|      0|    *pname = JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
24551|      0|    return -1;
24552|      0|}
quickjs.c:js_define_var:
26028|     16|{
26029|     16|    JSFunctionDef *fd = s->cur_func;
26030|     16|    JSVarDefEnum var_def_type;
26031|       |
26032|     16|    if (name == JS_ATOM_yield && fd->func_kind == JS_FUNC_GENERATOR) {
  ------------------
  |  Branch (26032:9): [True: 0, False: 16]
  |  Branch (26032:34): [True: 0, False: 0]
  ------------------
26033|      0|        return js_parse_error(s, "yield is a reserved identifier");
26034|      0|    }
26035|     16|    if ((name == JS_ATOM_arguments || name == JS_ATOM_eval)
  ------------------
  |  Branch (26035:10): [True: 0, False: 16]
  |  Branch (26035:39): [True: 0, False: 16]
  ------------------
26036|      0|    &&  (fd->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (26036:9): [True: 0, False: 0]
  ------------------
26037|      0|        return js_parse_error(s, "invalid variable name in strict mode");
26038|      0|    }
26039|     16|    if (name == JS_ATOM_let
  ------------------
  |  Branch (26039:9): [True: 0, False: 16]
  ------------------
26040|      0|    &&  (tok == TOK_LET || tok == TOK_CONST)) {
  ------------------
  |  Branch (26040:10): [True: 0, False: 0]
  |  Branch (26040:28): [True: 0, False: 0]
  ------------------
26041|      0|        return js_parse_error(s, "invalid lexical variable name");
26042|      0|    }
26043|     16|    switch(tok) {
26044|     16|    case TOK_LET:
  ------------------
  |  Branch (26044:5): [True: 16, False: 0]
  ------------------
26045|     16|        var_def_type = JS_VAR_DEF_LET;
26046|     16|        break;
26047|      0|    case TOK_CONST:
  ------------------
  |  Branch (26047:5): [True: 0, False: 16]
  ------------------
26048|      0|        var_def_type = JS_VAR_DEF_CONST;
26049|      0|        break;
26050|      0|    case TOK_VAR:
  ------------------
  |  Branch (26050:5): [True: 0, False: 16]
  ------------------
26051|      0|        var_def_type = JS_VAR_DEF_VAR;
26052|      0|        break;
26053|      0|    case TOK_CATCH:
  ------------------
  |  Branch (26053:5): [True: 0, False: 16]
  ------------------
26054|      0|        var_def_type = JS_VAR_DEF_CATCH;
26055|      0|        break;
26056|      0|    default:
  ------------------
  |  Branch (26056:5): [True: 0, False: 16]
  ------------------
26057|      0|        abort();
26058|     16|    }
26059|     16|    if (define_var(s, fd, name, var_def_type) < 0)
  ------------------
  |  Branch (26059:9): [True: 0, False: 16]
  ------------------
26060|      0|        return -1;
26061|     16|    return 0;
26062|     16|}
quickjs.c:put_lvalue:
25894|     41|{
25895|     41|    switch(opcode) {
25896|     13|    case OP_scope_get_var:
  ------------------
  |  Branch (25896:5): [True: 13, False: 28]
  ------------------
25897|       |        /* depth = 0 */
25898|     13|        switch(special) {
25899|      0|        case PUT_LVALUE_NOKEEP:
  ------------------
  |  Branch (25899:9): [True: 0, False: 13]
  ------------------
25900|      2|        case PUT_LVALUE_NOKEEP_DEPTH:
  ------------------
  |  Branch (25900:9): [True: 2, False: 11]
  ------------------
25901|      2|        case PUT_LVALUE_KEEP_SECOND:
  ------------------
  |  Branch (25901:9): [True: 0, False: 13]
  ------------------
25902|      3|        case PUT_LVALUE_NOKEEP_BOTTOM:
  ------------------
  |  Branch (25902:9): [True: 1, False: 12]
  ------------------
25903|      3|            break;
25904|     10|        case PUT_LVALUE_KEEP_TOP:
  ------------------
  |  Branch (25904:9): [True: 10, False: 3]
  ------------------
25905|     10|            emit_op(s, OP_dup);
25906|     10|            break;
25907|      0|        default:
  ------------------
  |  Branch (25907:9): [True: 0, False: 13]
  ------------------
25908|      0|            abort();
25909|     13|        }
25910|     13|        break;
25911|     28|    case OP_get_field:
  ------------------
  |  Branch (25911:5): [True: 28, False: 13]
  ------------------
25912|     28|    case OP_scope_get_private_field:
  ------------------
  |  Branch (25912:5): [True: 0, False: 41]
  ------------------
25913|       |        /* depth = 1 */
25914|     28|        switch(special) {
25915|      0|        case PUT_LVALUE_NOKEEP:
  ------------------
  |  Branch (25915:9): [True: 0, False: 28]
  ------------------
25916|      0|        case PUT_LVALUE_NOKEEP_DEPTH:
  ------------------
  |  Branch (25916:9): [True: 0, False: 28]
  ------------------
25917|      0|            break;
25918|     28|        case PUT_LVALUE_KEEP_TOP:
  ------------------
  |  Branch (25918:9): [True: 28, False: 0]
  ------------------
25919|     28|            emit_op(s, OP_insert2); /* obj v -> v obj v */
25920|     28|            break;
25921|      0|        case PUT_LVALUE_KEEP_SECOND:
  ------------------
  |  Branch (25921:9): [True: 0, False: 28]
  ------------------
25922|      0|            emit_op(s, OP_perm3); /* obj v0 v -> v0 obj v */
25923|      0|            break;
25924|      0|        case PUT_LVALUE_NOKEEP_BOTTOM:
  ------------------
  |  Branch (25924:9): [True: 0, False: 28]
  ------------------
25925|      0|            emit_op(s, OP_swap);
25926|      0|            break;
25927|      0|        default:
  ------------------
  |  Branch (25927:9): [True: 0, False: 28]
  ------------------
25928|      0|            abort();
25929|     28|        }
25930|     28|        break;
25931|     28|    case OP_get_array_el:
  ------------------
  |  Branch (25931:5): [True: 0, False: 41]
  ------------------
25932|      0|    case OP_get_ref_value:
  ------------------
  |  Branch (25932:5): [True: 0, False: 41]
  ------------------
25933|       |        /* depth = 2 */
25934|      0|        if (opcode == OP_get_ref_value) {
  ------------------
  |  Branch (25934:13): [True: 0, False: 0]
  ------------------
25935|      0|            JS_FreeAtom(s->ctx, name);
25936|      0|            emit_label(s, label);
25937|      0|        }
25938|      0|        switch(special) {
25939|      0|        case PUT_LVALUE_NOKEEP:
  ------------------
  |  Branch (25939:9): [True: 0, False: 0]
  ------------------
25940|      0|            emit_op(s, OP_nop); /* will trigger optimization */
25941|      0|            break;
25942|      0|        case PUT_LVALUE_NOKEEP_DEPTH:
  ------------------
  |  Branch (25942:9): [True: 0, False: 0]
  ------------------
25943|      0|            break;
25944|      0|        case PUT_LVALUE_KEEP_TOP:
  ------------------
  |  Branch (25944:9): [True: 0, False: 0]
  ------------------
25945|      0|            emit_op(s, OP_insert3); /* obj prop v -> v obj prop v */
25946|      0|            break;
25947|      0|        case PUT_LVALUE_KEEP_SECOND:
  ------------------
  |  Branch (25947:9): [True: 0, False: 0]
  ------------------
25948|      0|            emit_op(s, OP_perm4); /* obj prop v0 v -> v0 obj prop v */
25949|      0|            break;
25950|      0|        case PUT_LVALUE_NOKEEP_BOTTOM:
  ------------------
  |  Branch (25950:9): [True: 0, False: 0]
  ------------------
25951|      0|            emit_op(s, OP_rot3l);
25952|      0|            break;
25953|      0|        default:
  ------------------
  |  Branch (25953:9): [True: 0, False: 0]
  ------------------
25954|      0|            abort();
25955|      0|        }
25956|      0|        break;
25957|      0|    case OP_get_super_value:
  ------------------
  |  Branch (25957:5): [True: 0, False: 41]
  ------------------
25958|       |        /* depth = 3 */
25959|      0|        switch(special) {
25960|      0|        case PUT_LVALUE_NOKEEP:
  ------------------
  |  Branch (25960:9): [True: 0, False: 0]
  ------------------
25961|      0|        case PUT_LVALUE_NOKEEP_DEPTH:
  ------------------
  |  Branch (25961:9): [True: 0, False: 0]
  ------------------
25962|      0|            break;
25963|      0|        case PUT_LVALUE_KEEP_TOP:
  ------------------
  |  Branch (25963:9): [True: 0, False: 0]
  ------------------
25964|      0|            emit_op(s, OP_insert4); /* this obj prop v -> v this obj prop v */
25965|      0|            break;
25966|      0|        case PUT_LVALUE_KEEP_SECOND:
  ------------------
  |  Branch (25966:9): [True: 0, False: 0]
  ------------------
25967|      0|            emit_op(s, OP_perm5); /* this obj prop v0 v -> v0 this obj prop v */
25968|      0|            break;
25969|      0|        case PUT_LVALUE_NOKEEP_BOTTOM:
  ------------------
  |  Branch (25969:9): [True: 0, False: 0]
  ------------------
25970|      0|            emit_op(s, OP_rot4l);
25971|      0|            break;
25972|      0|        default:
  ------------------
  |  Branch (25972:9): [True: 0, False: 0]
  ------------------
25973|      0|            abort();
25974|      0|        }
25975|      0|        break;
25976|      0|    default:
  ------------------
  |  Branch (25976:5): [True: 0, False: 41]
  ------------------
25977|      0|        break;
25978|     41|    }
25979|       |
25980|     41|    switch(opcode) {
25981|     13|    case OP_scope_get_var:  /* val -- */
  ------------------
  |  Branch (25981:5): [True: 13, False: 28]
  ------------------
25982|     13|        emit_op(s, is_let ? OP_scope_put_var_init : OP_scope_put_var);
  ------------------
  |  Branch (25982:20): [True: 2, False: 11]
  ------------------
25983|     13|        emit_u32(s, name);  /* has refcount */
25984|     13|        emit_u16(s, scope);
25985|     13|        break;
25986|     28|    case OP_get_field:
  ------------------
  |  Branch (25986:5): [True: 28, False: 13]
  ------------------
25987|     28|        emit_op(s, OP_put_field);
25988|     28|        emit_u32(s, name);  /* name has refcount */
25989|     28|        break;
25990|      0|    case OP_scope_get_private_field:
  ------------------
  |  Branch (25990:5): [True: 0, False: 41]
  ------------------
25991|      0|        emit_op(s, OP_scope_put_private_field);
25992|      0|        emit_u32(s, name);  /* name has refcount */
25993|      0|        emit_u16(s, scope);
25994|      0|        break;
25995|      0|    case OP_get_array_el:
  ------------------
  |  Branch (25995:5): [True: 0, False: 41]
  ------------------
25996|      0|        emit_op(s, OP_put_array_el);
25997|      0|        break;
25998|      0|    case OP_get_ref_value:
  ------------------
  |  Branch (25998:5): [True: 0, False: 41]
  ------------------
25999|      0|        emit_op(s, OP_put_ref_value);
26000|      0|        break;
26001|      0|    case OP_get_super_value:
  ------------------
  |  Branch (26001:5): [True: 0, False: 41]
  ------------------
26002|      0|        emit_op(s, OP_put_super_value);
26003|      0|        break;
26004|      0|    default:
  ------------------
  |  Branch (26004:5): [True: 0, False: 41]
  ------------------
26005|      0|        abort();
26006|     41|    }
26007|     41|}
quickjs.c:push_break_entry:
28136|     17|{
28137|     17|    be->prev = fd->top_break;
28138|     17|    fd->top_break = be;
28139|     17|    be->label_name = label_name;
28140|     17|    be->label_break = label_break;
28141|     17|    be->label_cont = label_cont;
28142|     17|    be->drop_count = drop_count;
28143|     17|    be->label_finally = -1;
28144|     17|    be->scope_level = fd->scope_level;
28145|     17|    be->has_iterator = FALSE;
28146|     17|    be->is_regular_stmt = FALSE;
28147|     17|}
quickjs.c:pop_break_entry:
28150|     15|{
28151|     15|    BlockEnv *be;
28152|     15|    be = fd->top_break;
28153|     15|    fd->top_break = be->prev;
28154|     15|}
quickjs.c:js_parse_check_duplicate_parameter:
26091|      4|{
26092|       |    /* Check for duplicate parameter names */
26093|      4|    JSFunctionDef *fd = s->cur_func;
26094|      4|    int i;
26095|      8|    for (i = 0; i < fd->arg_count; i++) {
  ------------------
  |  Branch (26095:17): [True: 4, False: 4]
  ------------------
26096|      4|        if (fd->args[i].var_name == name)
  ------------------
  |  Branch (26096:13): [True: 0, False: 4]
  ------------------
26097|      0|            goto duplicate;
26098|      4|    }
26099|      6|    for (i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (26099:17): [True: 2, False: 4]
  ------------------
26100|      2|        if (fd->vars[i].var_name == name)
  ------------------
  |  Branch (26100:13): [True: 0, False: 2]
  ------------------
26101|      0|            goto duplicate;
26102|      2|    }
26103|      4|    return 0;
26104|       |
26105|      0|duplicate:
26106|      0|    return js_parse_error(s, "duplicate parameter names not allowed in this context");
26107|      4|}
quickjs.c:new_label:
23727|     83|{
23728|     83|    int label;
23729|     83|    label = new_label_fd(s->cur_func);
23730|     83|    if (unlikely(label < 0)) {
  ------------------
  |  |   33|     83|#define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (33:25): [True: 0, False: 83]
  |  |  ------------------
  ------------------
23731|      0|        dbuf_set_error(&s->cur_func->byte_code);
23732|      0|    }
23733|     83|    return label;
23734|     83|}
quickjs.c:new_label_fd:
23708|     97|{
23709|     97|    int label;
23710|     97|    LabelSlot *ls;
23711|       |
23712|     97|    if (js_resize_array(fd->ctx, (void *)&fd->label_slots,
  ------------------
  |  Branch (23712:9): [True: 0, False: 97]
  ------------------
23713|     97|                        sizeof(fd->label_slots[0]),
23714|     97|                        &fd->label_size, fd->label_count + 1))
23715|      0|        return -1;
23716|     97|    label = fd->label_count++;
23717|     97|    ls = &fd->label_slots[label];
23718|     97|    ls->ref_count = 0;
23719|     97|    ls->pos = -1;
23720|     97|    ls->pos2 = -1;
23721|     97|    ls->addr = -1;
23722|       |    ls->first_reloc = NULL;
23723|     97|    return label;
23724|     97|}
quickjs.c:emit_goto:
23759|     64|{
23760|     64|    if (js_is_live_code(s)) {
  ------------------
  |  Branch (23760:9): [True: 64, False: 0]
  ------------------
23761|     64|        if (label < 0) {
  ------------------
  |  Branch (23761:13): [True: 17, False: 47]
  ------------------
23762|     17|            label = new_label(s);
23763|     17|            if (label < 0)
  ------------------
  |  Branch (23763:17): [True: 0, False: 17]
  ------------------
23764|      0|                return -1;
23765|     17|        }
23766|     64|        emit_op(s, opcode);
23767|     64|        emit_u32(s, label);
23768|     64|        s->cur_func->label_slots[label].ref_count++;
23769|     64|        return label;
23770|     64|    }
23771|      0|    return -1;
23772|     64|}
quickjs.c:js_parse_assign_expr:
28098|     10|{
28099|     10|    return js_parse_assign_expr2(s, PF_IN_ACCEPTED);
  ------------------
  |  |24899|     10|#define PF_IN_ACCEPTED  (1 << 0)
  ------------------
28100|     10|}
quickjs.c:set_object_name:
24733|      8|{
24734|      8|    JSFunctionDef *fd = s->cur_func;
24735|      8|    int opcode;
24736|       |
24737|      8|    opcode = get_prev_opcode(fd);
24738|      8|    if (opcode == OP_set_name) {
  ------------------
  |  Branch (24738:9): [True: 2, False: 6]
  ------------------
24739|       |        /* XXX: should free atom after OP_set_name? */
24740|      2|        fd->byte_code.size = fd->last_opcode_pos;
24741|      2|        fd->last_opcode_pos = -1;
24742|      2|        emit_op(s, OP_set_name);
24743|      2|        emit_atom(s, name);
24744|      6|    } else if (opcode == OP_set_class_name) {
  ------------------
  |  Branch (24744:16): [True: 0, False: 6]
  ------------------
24745|      0|        int define_class_pos;
24746|      0|        JSAtom atom;
24747|      0|        define_class_pos = fd->last_opcode_pos + 1 -
24748|      0|            get_u32(fd->byte_code.buf + fd->last_opcode_pos + 1);
24749|      0|        assert(fd->byte_code.buf[define_class_pos] == OP_define_class);
  ------------------
  |  Branch (24749:9): [True: 0, False: 0]
  |  Branch (24749:9): [True: 0, False: 0]
  ------------------
24750|       |        /* for consistency we free the previous atom which is
24751|       |           JS_ATOM_empty_string */
24752|      0|        atom = get_u32(fd->byte_code.buf + define_class_pos + 1);
24753|      0|        JS_FreeAtom(s->ctx, atom);
24754|      0|        put_u32(fd->byte_code.buf + define_class_pos + 1,
24755|      0|                JS_DupAtom(s->ctx, name));
24756|      0|        fd->last_opcode_pos = -1;
24757|      0|    }
24758|      8|}
quickjs.c:emit_label:
23746|     79|{
23747|     79|    if (label >= 0) {
  ------------------
  |  Branch (23747:9): [True: 79, False: 0]
  ------------------
23748|     79|        emit_op(s, OP_label);
23749|     79|        emit_u32(s, label);
23750|     79|        s->cur_func->label_slots[label].pos = s->cur_func->byte_code.size;
23751|     79|        return s->cur_func->byte_code.size - 4;
23752|     79|    } else {
23753|      0|        return -1;
23754|      0|    }
23755|     79|}
quickjs.c:js_parse_function_check_names:
36225|      5|{
36226|      5|    JSAtom name;
36227|      5|    int i, idx;
36228|       |
36229|      5|    if (fd->js_mode & JS_MODE_STRICT) {
  ------------------
  |  |  395|      5|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (36229:9): [True: 0, False: 5]
  ------------------
36230|      0|        if (!fd->has_simple_parameter_list && fd->has_use_strict) {
  ------------------
  |  Branch (36230:13): [True: 0, False: 0]
  |  Branch (36230:47): [True: 0, False: 0]
  ------------------
36231|      0|            return js_parse_error(s, "\"use strict\" not allowed in function with default or destructuring parameter");
36232|      0|        }
36233|      0|        if (func_name == JS_ATOM_eval || func_name == JS_ATOM_arguments ||
  ------------------
  |  Branch (36233:13): [True: 0, False: 0]
  |  Branch (36233:42): [True: 0, False: 0]
  ------------------
36234|      0|            is_strict_future_keyword(func_name)) {
  ------------------
  |  Branch (36234:13): [True: 0, False: 0]
  ------------------
36235|      0|            return js_parse_error(s, "invalid function name in strict code");
36236|      0|        }
36237|      0|        for (idx = 0; idx < fd->arg_count; idx++) {
  ------------------
  |  Branch (36237:23): [True: 0, False: 0]
  ------------------
36238|      0|            name = fd->args[idx].var_name;
36239|       |
36240|      0|            if (name == JS_ATOM_eval || name == JS_ATOM_arguments ||
  ------------------
  |  Branch (36240:17): [True: 0, False: 0]
  |  Branch (36240:41): [True: 0, False: 0]
  ------------------
36241|      0|                is_strict_future_keyword(name)) {
  ------------------
  |  Branch (36241:17): [True: 0, False: 0]
  ------------------
36242|      0|                return js_parse_error(s, "invalid argument name in strict code");
36243|      0|            }
36244|      0|        }
36245|      0|    }
36246|       |    /* check async_generator case */
36247|      5|    if ((fd->js_mode & JS_MODE_STRICT)
  ------------------
  |  |  395|      5|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (36247:9): [True: 0, False: 5]
  ------------------
36248|      5|    ||  !fd->has_simple_parameter_list
  ------------------
  |  Branch (36248:9): [True: 2, False: 3]
  ------------------
36249|      3|    ||  (fd->func_type == JS_PARSE_FUNC_METHOD && fd->func_kind == JS_FUNC_ASYNC)
  ------------------
  |  Branch (36249:10): [True: 0, False: 3]
  |  Branch (36249:51): [True: 0, False: 0]
  ------------------
36250|      3|    ||  fd->func_type == JS_PARSE_FUNC_ARROW
  ------------------
  |  Branch (36250:9): [True: 0, False: 3]
  ------------------
36251|      3|    ||  fd->func_type == JS_PARSE_FUNC_METHOD) {
  ------------------
  |  Branch (36251:9): [True: 0, False: 3]
  ------------------
36252|      6|        for (idx = 0; idx < fd->arg_count; idx++) {
  ------------------
  |  Branch (36252:23): [True: 4, False: 2]
  ------------------
36253|      4|            name = fd->args[idx].var_name;
36254|      4|            if (name != JS_ATOM_NULL) {
  ------------------
  |  |  449|      4|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (36254:17): [True: 2, False: 2]
  ------------------
36255|      4|                for (i = 0; i < idx; i++) {
  ------------------
  |  Branch (36255:29): [True: 2, False: 2]
  ------------------
36256|      2|                    if (fd->args[i].var_name == name)
  ------------------
  |  Branch (36256:25): [True: 0, False: 2]
  ------------------
36257|      0|                        goto duplicate;
36258|      2|                }
36259|       |                /* Check if argument name duplicates a destructuring parameter */
36260|       |                /* XXX: should have a flag for such variables */
36261|      8|                for (i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (36261:29): [True: 6, False: 2]
  ------------------
36262|      6|                    if (fd->vars[i].var_name == name &&
  ------------------
  |  Branch (36262:25): [True: 2, False: 4]
  ------------------
36263|      2|                        fd->vars[i].scope_level == 0)
  ------------------
  |  Branch (36263:25): [True: 0, False: 2]
  ------------------
36264|      0|                        goto duplicate;
36265|      6|                }
36266|      2|            }
36267|      4|        }
36268|      2|    }
36269|      5|    return 0;
36270|       |
36271|      0|duplicate:
36272|      0|    return js_parse_error(s, "duplicate argument names not allowed in this context");
36273|      5|}
quickjs.c:js_is_live_code:
23630|     65|static BOOL js_is_live_code(JSParseState *s) {
23631|     65|    switch (get_prev_opcode(s->cur_func)) {
23632|      0|    case OP_tail_call:
  ------------------
  |  Branch (23632:5): [True: 0, False: 65]
  ------------------
23633|      0|    case OP_tail_call_method:
  ------------------
  |  Branch (23633:5): [True: 0, False: 65]
  ------------------
23634|      0|    case OP_return:
  ------------------
  |  Branch (23634:5): [True: 0, False: 65]
  ------------------
23635|      0|    case OP_return_undef:
  ------------------
  |  Branch (23635:5): [True: 0, False: 65]
  ------------------
23636|      0|    case OP_return_async:
  ------------------
  |  Branch (23636:5): [True: 0, False: 65]
  ------------------
23637|      0|    case OP_throw:
  ------------------
  |  Branch (23637:5): [True: 0, False: 65]
  ------------------
23638|      0|    case OP_throw_error:
  ------------------
  |  Branch (23638:5): [True: 0, False: 65]
  ------------------
23639|      0|    case OP_goto:
  ------------------
  |  Branch (23639:5): [True: 0, False: 65]
  ------------------
23640|      0|#if SHORT_OPCODES
23641|      0|    case OP_goto8:
  ------------------
  |  Branch (23641:5): [True: 0, False: 65]
  ------------------
23642|      0|    case OP_goto16:
  ------------------
  |  Branch (23642:5): [True: 0, False: 65]
  ------------------
23643|      0|#endif
23644|      0|    case OP_ret:
  ------------------
  |  Branch (23644:5): [True: 0, False: 65]
  ------------------
23645|      0|        return FALSE;
23646|     65|    default:
  ------------------
  |  Branch (23646:5): [True: 65, False: 0]
  ------------------
23647|     65|        return TRUE;
23648|     65|    }
23649|     65|}
quickjs.c:reparse_ident_token:
22584|      3|{
22585|      3|    if (s->token.val == TOK_IDENT ||
  ------------------
  |  Branch (22585:9): [True: 1, False: 2]
  ------------------
22586|      2|        (s->token.val >= TOK_FIRST_KEYWORD &&
  ------------------
  |  |21696|      4|#define TOK_FIRST_KEYWORD   TOK_NULL
  ------------------
  |  Branch (22586:10): [True: 2, False: 0]
  ------------------
22587|      2|         s->token.val <= TOK_LAST_KEYWORD)) {
  ------------------
  |  |21697|      2|#define TOK_LAST_KEYWORD    TOK_AWAIT
  ------------------
  |  Branch (22587:10): [True: 0, False: 2]
  ------------------
22588|      1|        s->token.val = TOK_IDENT;
22589|      1|        s->token.u.ident.is_reserved = FALSE;
22590|      1|        update_token_ident(s);
22591|      1|    }
22592|      3|}
quickjs.c:cpool_add:
23776|     16|{
23777|     16|    JSFunctionDef *fd = s->cur_func;
23778|       |
23779|     16|    if (js_resize_array(s->ctx, (void *)&fd->cpool, sizeof(fd->cpool[0]),
  ------------------
  |  Branch (23779:9): [True: 0, False: 16]
  ------------------
23780|     16|                        &fd->cpool_size, fd->cpool_count + 1)) {
23781|      0|        JS_FreeValue(s->ctx, val);
23782|      0|        return -1;
23783|      0|    }
23784|     16|    fd->cpool[fd->cpool_count++] = val;
23785|     16|    return fd->cpool_count - 1;
23786|     16|}
quickjs.c:emit_u32:
23662|    348|{
23663|    348|    dbuf_put_u32(&s->cur_func->byte_code, val);
23664|    348|}
quickjs.c:add_global_var:
24090|      1|{
24091|      1|    JSGlobalVar *hf;
24092|       |
24093|      1|    if (js_resize_array(ctx, (void **)&s->global_vars,
  ------------------
  |  Branch (24093:9): [True: 0, False: 1]
  ------------------
24094|      1|                        sizeof(s->global_vars[0]),
24095|      1|                        &s->global_var_size, s->global_var_count + 1))
24096|      0|        return NULL;
24097|      1|    hf = &s->global_vars[s->global_var_count++];
24098|      1|    hf->cpool_idx = -1;
24099|      1|    hf->force_init = FALSE;
24100|      1|    hf->is_lexical = FALSE;
24101|      1|    hf->is_const = FALSE;
24102|      1|    hf->scope_level = s->scope_level;
24103|      1|    hf->var_name = JS_DupAtom(ctx, name);
24104|      1|    return hf;
24105|      1|}
quickjs.c:js_parse_from_clause:
31475|     28|{
31476|     28|    JSAtom module_name;
31477|     28|    int idx;
31478|       |
31479|     28|    if (!token_is_pseudo_keyword(s, JS_ATOM_from)) {
  ------------------
  |  Branch (31479:9): [True: 0, False: 28]
  ------------------
31480|      0|        js_parse_error(s, "from clause expected");
31481|      0|        return -1;
31482|      0|    }
31483|     28|    if (next_token(s))
  ------------------
  |  Branch (31483:9): [True: 0, False: 28]
  ------------------
31484|      0|        return -1;
31485|     28|    if (s->token.val != TOK_STRING) {
  ------------------
  |  Branch (31485:9): [True: 0, False: 28]
  ------------------
31486|      0|        js_parse_error(s, "string expected");
31487|      0|        return -1;
31488|      0|    }
31489|     28|    module_name = JS_ValueToAtom(s->ctx, s->token.u.str.str);
31490|     28|    if (module_name == JS_ATOM_NULL)
  ------------------
  |  |  449|     28|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (31490:9): [True: 0, False: 28]
  ------------------
31491|      0|        return -1;
31492|     28|    if (next_token(s)) {
  ------------------
  |  Branch (31492:9): [True: 0, False: 28]
  ------------------
31493|      0|        JS_FreeAtom(s->ctx, module_name);
31494|      0|        return -1;
31495|      0|    }
31496|       |
31497|     28|    idx = add_req_module_entry(s->ctx, m, module_name);
31498|     28|    JS_FreeAtom(s->ctx, module_name);
31499|     28|    if (idx < 0)
  ------------------
  |  Branch (31499:9): [True: 0, False: 28]
  ------------------
31500|      0|        return -1;
31501|     28|    if (s->token.val == TOK_WITH) {
  ------------------
  |  Branch (31501:9): [True: 0, False: 28]
  ------------------
31502|      0|        if (js_parse_with_clause(s, &m->req_module_entries[idx]))
  ------------------
  |  Branch (31502:13): [True: 0, False: 0]
  ------------------
31503|      0|            return -1;
31504|      0|    }
31505|     28|    return idx;
31506|     28|}
quickjs.c:add_req_module_entry:
29578|     28|{
29579|     28|    JSReqModuleEntry *rme;
29580|       |
29581|     28|    if (js_resize_array(ctx, (void **)&m->req_module_entries,
  ------------------
  |  Branch (29581:9): [True: 0, False: 28]
  ------------------
29582|     28|                        sizeof(JSReqModuleEntry),
29583|     28|                        &m->req_module_entries_size,
29584|     28|                        m->req_module_entries_count + 1))
29585|      0|        return -1;
29586|     28|    rme = &m->req_module_entries[m->req_module_entries_count++];
29587|     28|    rme->module_name = JS_DupAtom(ctx, module_name);
29588|     28|    rme->module = NULL;
29589|     28|    rme->attributes = JS_UNDEFINED;
  ------------------
  |  |  289|     28|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     28|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
29590|     28|    return m->req_module_entries_count - 1;
29591|     28|}
quickjs.c:js_parse_import:
31709|     28|{
31710|     28|    JSContext *ctx = s->ctx;
31711|     28|    JSModuleDef *m = s->cur_func->module;
31712|     28|    JSAtom local_name, import_name, module_name;
31713|     28|    int first_import, i, idx;
31714|       |
31715|     28|    if (next_token(s))
  ------------------
  |  Branch (31715:9): [True: 0, False: 28]
  ------------------
31716|      0|        return -1;
31717|       |
31718|     28|    first_import = m->import_entries_count;
31719|     28|    if (s->token.val == TOK_STRING) {
  ------------------
  |  Branch (31719:9): [True: 0, False: 28]
  ------------------
31720|      0|        module_name = JS_ValueToAtom(ctx, s->token.u.str.str);
31721|      0|        if (module_name == JS_ATOM_NULL)
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (31721:13): [True: 0, False: 0]
  ------------------
31722|      0|            return -1;
31723|      0|        if (next_token(s)) {
  ------------------
  |  Branch (31723:13): [True: 0, False: 0]
  ------------------
31724|      0|            JS_FreeAtom(ctx, module_name);
31725|      0|            return -1;
31726|      0|        }
31727|      0|        idx = add_req_module_entry(ctx, m, module_name);
31728|      0|        JS_FreeAtom(ctx, module_name);
31729|      0|        if (idx < 0)
  ------------------
  |  Branch (31729:13): [True: 0, False: 0]
  ------------------
31730|      0|            return -1;
31731|      0|        if (s->token.val == TOK_WITH) {
  ------------------
  |  Branch (31731:13): [True: 0, False: 0]
  ------------------
31732|      0|            if (js_parse_with_clause(s, &m->req_module_entries[idx]))
  ------------------
  |  Branch (31732:17): [True: 0, False: 0]
  ------------------
31733|      0|                return -1;
31734|      0|        }
31735|     28|    } else {
31736|     28|        if (s->token.val == TOK_IDENT) {
  ------------------
  |  Branch (31736:13): [True: 0, False: 28]
  ------------------
31737|      0|            if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (31737:17): [True: 0, False: 0]
  ------------------
31738|      0|                return js_parse_error_reserved_identifier(s);
31739|      0|            }
31740|       |            /* "default" import */
31741|      0|            local_name = JS_DupAtom(ctx, s->token.u.ident.atom);
31742|      0|            import_name = JS_ATOM_default;
31743|      0|            if (next_token(s))
  ------------------
  |  Branch (31743:17): [True: 0, False: 0]
  ------------------
31744|      0|                goto fail;
31745|      0|            if (add_import(s, m, local_name, import_name, FALSE))
  ------------------
  |  Branch (31745:17): [True: 0, False: 0]
  ------------------
31746|      0|                goto fail;
31747|      0|            JS_FreeAtom(ctx, local_name);
31748|       |
31749|      0|            if (s->token.val != ',')
  ------------------
  |  Branch (31749:17): [True: 0, False: 0]
  ------------------
31750|      0|                goto end_import_clause;
31751|      0|            if (next_token(s))
  ------------------
  |  Branch (31751:17): [True: 0, False: 0]
  ------------------
31752|      0|                return -1;
31753|      0|        }
31754|       |
31755|     28|        if (s->token.val == '*') {
  ------------------
  |  Branch (31755:13): [True: 28, False: 0]
  ------------------
31756|       |            /* name space import */
31757|     28|            if (next_token(s))
  ------------------
  |  Branch (31757:17): [True: 0, False: 28]
  ------------------
31758|      0|                return -1;
31759|     28|            if (!token_is_pseudo_keyword(s, JS_ATOM_as))
  ------------------
  |  Branch (31759:17): [True: 0, False: 28]
  ------------------
31760|      0|                return js_parse_error(s, "expecting 'as'");
31761|     28|            if (next_token(s))
  ------------------
  |  Branch (31761:17): [True: 0, False: 28]
  ------------------
31762|      0|                return -1;
31763|     28|            if (!token_is_ident(s->token.val)) {
  ------------------
  |  Branch (31763:17): [True: 0, False: 28]
  ------------------
31764|      0|                js_parse_error(s, "identifier expected");
31765|      0|                return -1;
31766|      0|            }
31767|     28|            local_name = JS_DupAtom(ctx, s->token.u.ident.atom);
31768|     28|            import_name = JS_ATOM__star_;
31769|     28|            if (next_token(s))
  ------------------
  |  Branch (31769:17): [True: 0, False: 28]
  ------------------
31770|      0|                goto fail;
31771|     28|            if (add_import(s, m, local_name, import_name, TRUE))
  ------------------
  |  Branch (31771:17): [True: 0, False: 28]
  ------------------
31772|      0|                goto fail;
31773|     28|            JS_FreeAtom(ctx, local_name);
31774|     28|        } else if (s->token.val == '{') {
  ------------------
  |  Branch (31774:20): [True: 0, False: 0]
  ------------------
31775|      0|            if (next_token(s))
  ------------------
  |  Branch (31775:17): [True: 0, False: 0]
  ------------------
31776|      0|                return -1;
31777|       |
31778|      0|            while (s->token.val != '}') {
  ------------------
  |  Branch (31778:20): [True: 0, False: 0]
  ------------------
31779|      0|                BOOL is_string;
31780|      0|                if (s->token.val == TOK_STRING) {
  ------------------
  |  Branch (31780:21): [True: 0, False: 0]
  ------------------
31781|      0|                    is_string = TRUE;
31782|      0|                    if (js_string_find_invalid_codepoint(JS_VALUE_GET_STRING(s->token.u.str.str)) >= 0) {
  ------------------
  |  |  228|      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 (31782:25): [True: 0, False: 0]
  ------------------
31783|      0|                        js_parse_error(s, "contains unpaired surrogate");
31784|      0|                        return -1;
31785|      0|                    }
31786|      0|                    import_name = JS_ValueToAtom(s->ctx, s->token.u.str.str);
31787|      0|                    if (import_name == JS_ATOM_NULL)
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (31787:25): [True: 0, False: 0]
  ------------------
31788|      0|                        return -1;
31789|      0|                } else {
31790|      0|                    is_string = FALSE;
31791|      0|                    if (!token_is_ident(s->token.val)) {
  ------------------
  |  Branch (31791:25): [True: 0, False: 0]
  ------------------
31792|      0|                        js_parse_error(s, "identifier expected");
31793|      0|                        return -1;
31794|      0|                    }
31795|      0|                    import_name = JS_DupAtom(ctx, s->token.u.ident.atom);
31796|      0|                }
31797|      0|                local_name = JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
31798|      0|                if (next_token(s))
  ------------------
  |  Branch (31798:21): [True: 0, False: 0]
  ------------------
31799|      0|                    goto fail;
31800|      0|                if (token_is_pseudo_keyword(s, JS_ATOM_as)) {
  ------------------
  |  Branch (31800:21): [True: 0, False: 0]
  ------------------
31801|      0|                    if (next_token(s))
  ------------------
  |  Branch (31801:25): [True: 0, False: 0]
  ------------------
31802|      0|                        goto fail;
31803|      0|                    if (!token_is_ident(s->token.val)) {
  ------------------
  |  Branch (31803:25): [True: 0, False: 0]
  ------------------
31804|      0|                        js_parse_error(s, "identifier expected");
31805|      0|                        goto fail;
31806|      0|                    }
31807|      0|                    local_name = JS_DupAtom(ctx, s->token.u.ident.atom);
31808|      0|                    if (next_token(s))
  ------------------
  |  Branch (31808:25): [True: 0, False: 0]
  ------------------
31809|      0|                        goto fail;
31810|      0|                } else {
31811|      0|                    if (is_string) {
  ------------------
  |  Branch (31811:25): [True: 0, False: 0]
  ------------------
31812|      0|                        js_parse_error(s, "expecting 'as'");
31813|      0|                    fail:
31814|      0|                        JS_FreeAtom(ctx, local_name);
31815|      0|                        JS_FreeAtom(ctx, import_name);
31816|      0|                        return -1;
31817|      0|                    }
31818|      0|                    local_name = JS_DupAtom(ctx, import_name);
31819|      0|                }
31820|      0|                if (add_import(s, m, local_name, import_name, FALSE))
  ------------------
  |  Branch (31820:21): [True: 0, False: 0]
  ------------------
31821|      0|                    goto fail;
31822|      0|                JS_FreeAtom(ctx, local_name);
31823|      0|                JS_FreeAtom(ctx, import_name);
31824|      0|                if (s->token.val != ',')
  ------------------
  |  Branch (31824:21): [True: 0, False: 0]
  ------------------
31825|      0|                    break;
31826|      0|                if (next_token(s))
  ------------------
  |  Branch (31826:21): [True: 0, False: 0]
  ------------------
31827|      0|                    return -1;
31828|      0|            }
31829|      0|            if (js_parse_expect(s, '}'))
  ------------------
  |  Branch (31829:17): [True: 0, False: 0]
  ------------------
31830|      0|                return -1;
31831|      0|        }
31832|     28|    end_import_clause:
31833|     28|        idx = js_parse_from_clause(s, m);
31834|     28|        if (idx < 0)
  ------------------
  |  Branch (31834:13): [True: 0, False: 28]
  ------------------
31835|      0|            return -1;
31836|     28|    }
31837|     56|    for(i = first_import; i < m->import_entries_count; i++)
  ------------------
  |  Branch (31837:27): [True: 28, False: 28]
  ------------------
31838|     28|        m->import_entries[i].req_module_idx = idx;
31839|       |
31840|     28|    return js_parse_expect_semi(s);
31841|     28|}
quickjs.c:add_import:
31675|     28|{
31676|     28|    JSContext *ctx = s->ctx;
31677|     28|    int i, var_idx;
31678|     28|    JSImportEntry *mi;
31679|       |
31680|     28|    if (local_name == JS_ATOM_arguments || local_name == JS_ATOM_eval)
  ------------------
  |  Branch (31680:9): [True: 0, False: 28]
  |  Branch (31680:44): [True: 0, False: 28]
  ------------------
31681|      0|        return js_parse_error(s, "invalid import binding");
31682|       |
31683|     28|    if (local_name != JS_ATOM_default) {
  ------------------
  |  Branch (31683:9): [True: 28, False: 0]
  ------------------
31684|     42|        for (i = 0; i < s->cur_func->closure_var_count; i++) {
  ------------------
  |  Branch (31684:21): [True: 14, False: 28]
  ------------------
31685|     14|            if (s->cur_func->closure_var[i].var_name == local_name)
  ------------------
  |  Branch (31685:17): [True: 0, False: 14]
  ------------------
31686|      0|                return js_parse_error(s, "duplicate import binding");
31687|     14|        }
31688|     28|    }
31689|       |
31690|     28|    var_idx = add_closure_var(ctx, s->cur_func,
31691|     28|                              is_star ? JS_CLOSURE_MODULE_DECL : JS_CLOSURE_MODULE_IMPORT,
  ------------------
  |  Branch (31691:31): [True: 28, False: 0]
  ------------------
31692|     28|                              m->import_entries_count,
31693|     28|                              local_name, TRUE, TRUE, JS_VAR_NORMAL);
31694|     28|    if (var_idx < 0)
  ------------------
  |  Branch (31694:9): [True: 0, False: 28]
  ------------------
31695|      0|        return -1;
31696|     28|    if (js_resize_array(ctx, (void **)&m->import_entries,
  ------------------
  |  Branch (31696:9): [True: 0, False: 28]
  ------------------
31697|     28|                        sizeof(JSImportEntry),
31698|     28|                        &m->import_entries_size,
31699|     28|                        m->import_entries_count + 1))
31700|      0|        return -1;
31701|     28|    mi = &m->import_entries[m->import_entries_count++];
31702|     28|    mi->import_name = JS_DupAtom(ctx, import_name);
31703|     28|    mi->var_idx = var_idx;
31704|     28|    mi->is_star = is_star;
31705|     28|    return 0;
31706|     28|}
quickjs.c:add_closure_var:
32503|     64|{
32504|     64|    JSClosureVar *cv;
32505|       |
32506|       |    /* the closure variable indexes are currently stored on 16 bits */
32507|     64|    if (s->closure_var_count >= JS_MAX_LOCAL_VARS) {
  ------------------
  |  |  208|     64|#define JS_MAX_LOCAL_VARS 65534
  ------------------
  |  Branch (32507:9): [True: 0, False: 64]
  ------------------
32508|      0|        JS_ThrowInternalError(ctx, "too many closure variables");
32509|      0|        return -1;
32510|      0|    }
32511|       |
32512|     64|    if (js_resize_array(ctx, (void **)&s->closure_var,
  ------------------
  |  Branch (32512:9): [True: 0, False: 64]
  ------------------
32513|     64|                        sizeof(s->closure_var[0]),
32514|     64|                        &s->closure_var_size, s->closure_var_count + 1))
32515|      0|        return -1;
32516|     64|    cv = &s->closure_var[s->closure_var_count++];
32517|     64|    cv->closure_type = closure_type;
32518|     64|    cv->is_const = is_const;
32519|     64|    cv->is_lexical = is_lexical;
32520|     64|    cv->var_kind = var_kind;
32521|     64|    cv->var_idx = var_idx;
32522|     64|    cv->var_name = JS_DupAtom(ctx, var_name);
32523|     64|    return s->closure_var_count - 1;
32524|     64|}
quickjs.c:js_parse_statement_or_decl:
28713|     98|{
28714|     98|    JSContext *ctx = s->ctx;
28715|     98|    JSAtom label_name;
28716|     98|    int tok;
28717|       |
28718|       |    /* specific label handling */
28719|       |    /* XXX: support multiple labels on loop statements */
28720|     98|    label_name = JS_ATOM_NULL;
  ------------------
  |  |  449|     98|#define JS_ATOM_NULL 0
  ------------------
28721|     98|    if (is_label(s)) {
  ------------------
  |  Branch (28721:9): [True: 16, False: 82]
  ------------------
28722|     16|        BlockEnv *be;
28723|       |
28724|     16|        label_name = JS_DupAtom(ctx, s->token.u.ident.atom);
28725|       |
28726|     16|        for (be = s->cur_func->top_break; be; be = be->prev) {
  ------------------
  |  Branch (28726:43): [True: 0, False: 16]
  ------------------
28727|      0|            if (be->label_name == label_name) {
  ------------------
  |  Branch (28727:17): [True: 0, False: 0]
  ------------------
28728|      0|                js_parse_error(s, "duplicate label name");
28729|      0|                goto fail;
28730|      0|            }
28731|      0|        }
28732|       |
28733|     16|        if (next_token(s))
  ------------------
  |  Branch (28733:13): [True: 0, False: 16]
  ------------------
28734|      0|            goto fail;
28735|     16|        if (js_parse_expect(s, ':'))
  ------------------
  |  Branch (28735:13): [True: 0, False: 16]
  ------------------
28736|      0|            goto fail;
28737|     16|        if (s->token.val != TOK_FOR
  ------------------
  |  Branch (28737:13): [True: 2, False: 14]
  ------------------
28738|      2|        &&  s->token.val != TOK_DO
  ------------------
  |  Branch (28738:13): [True: 2, False: 0]
  ------------------
28739|      2|        &&  s->token.val != TOK_WHILE) {
  ------------------
  |  Branch (28739:13): [True: 2, False: 0]
  ------------------
28740|       |            /* labelled regular statement */
28741|      2|            int label_break, mask;
28742|      2|            BlockEnv break_entry;
28743|       |
28744|      2|            label_break = new_label(s);
28745|      2|            push_break_entry(s->cur_func, &break_entry,
28746|      2|                             label_name, label_break, -1, 0);
28747|      2|            break_entry.is_regular_stmt = TRUE;
28748|      2|            if (!(s->cur_func->js_mode & JS_MODE_STRICT) &&
  ------------------
  |  |  395|      2|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (28748:17): [True: 2, False: 0]
  ------------------
28749|      2|                (decl_mask & DECL_MASK_FUNC_WITH_LABEL)) {
  ------------------
  |  |28297|      2|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  ------------------
  |  Branch (28749:17): [True: 2, False: 0]
  ------------------
28750|      2|                mask = DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL;
  ------------------
  |  |28295|      2|#define DECL_MASK_FUNC  (1 << 0) /* allow normal function declaration */
  ------------------
                              mask = DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL;
  ------------------
  |  |28297|      2|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  ------------------
28751|      2|            } else {
28752|      0|                mask = 0;
28753|      0|            }
28754|      2|            if (js_parse_statement_or_decl(s, mask))
  ------------------
  |  Branch (28754:17): [True: 0, False: 2]
  ------------------
28755|      0|                goto fail;
28756|      2|            emit_label(s, label_break);
28757|      2|            pop_break_entry(s->cur_func);
28758|      2|            goto done;
28759|      2|        }
28760|     16|    }
28761|       |
28762|     96|    switch(tok = s->token.val) {
28763|      6|    case '{':
  ------------------
  |  Branch (28763:5): [True: 6, False: 90]
  ------------------
28764|      6|        if (js_parse_block(s))
  ------------------
  |  Branch (28764:13): [True: 5, False: 1]
  ------------------
28765|      5|            goto fail;
28766|      1|        break;
28767|      1|    case TOK_RETURN:
  ------------------
  |  Branch (28767:5): [True: 0, False: 96]
  ------------------
28768|      0|        {
28769|      0|            const uint8_t *op_token_ptr;
28770|      0|            if (s->cur_func->is_eval) {
  ------------------
  |  Branch (28770:17): [True: 0, False: 0]
  ------------------
28771|      0|                js_parse_error(s, "return not in a function");
28772|      0|                goto fail;
28773|      0|            }
28774|      0|            if (s->cur_func->func_type == JS_PARSE_FUNC_CLASS_STATIC_INIT) {
  ------------------
  |  Branch (28774:17): [True: 0, False: 0]
  ------------------
28775|      0|                js_parse_error(s, "return in a static initializer block");
28776|      0|                goto fail;
28777|      0|            }
28778|      0|            op_token_ptr = s->token.ptr;
28779|      0|            if (next_token(s))
  ------------------
  |  Branch (28779:17): [True: 0, False: 0]
  ------------------
28780|      0|                goto fail;
28781|      0|            if (s->token.val != ';' && s->token.val != '}' && !s->got_lf) {
  ------------------
  |  Branch (28781:17): [True: 0, False: 0]
  |  Branch (28781:40): [True: 0, False: 0]
  |  Branch (28781:63): [True: 0, False: 0]
  ------------------
28782|      0|                if (js_parse_expr(s))
  ------------------
  |  Branch (28782:21): [True: 0, False: 0]
  ------------------
28783|      0|                    goto fail;
28784|      0|                emit_source_pos(s, op_token_ptr);
28785|      0|                emit_return(s, TRUE);
28786|      0|            } else {
28787|      0|                emit_source_pos(s, op_token_ptr);
28788|      0|                emit_return(s, FALSE);
28789|      0|            }
28790|      0|            if (js_parse_expect_semi(s))
  ------------------
  |  Branch (28790:17): [True: 0, False: 0]
  ------------------
28791|      0|                goto fail;
28792|      0|        }
28793|      0|        break;
28794|      0|    case TOK_THROW:
  ------------------
  |  Branch (28794:5): [True: 0, False: 96]
  ------------------
28795|      0|        {
28796|      0|            const uint8_t *op_token_ptr;
28797|      0|            op_token_ptr = s->token.ptr;
28798|      0|            if (next_token(s))
  ------------------
  |  Branch (28798:17): [True: 0, False: 0]
  ------------------
28799|      0|                goto fail;
28800|      0|            if (s->got_lf) {
  ------------------
  |  Branch (28800:17): [True: 0, False: 0]
  ------------------
28801|      0|                js_parse_error(s, "line terminator not allowed after throw");
28802|      0|                goto fail;
28803|      0|            }
28804|      0|            if (js_parse_expr(s))
  ------------------
  |  Branch (28804:17): [True: 0, False: 0]
  ------------------
28805|      0|                goto fail;
28806|      0|            emit_source_pos(s, op_token_ptr);
28807|      0|            emit_op(s, OP_throw);
28808|      0|            if (js_parse_expect_semi(s))
  ------------------
  |  Branch (28808:17): [True: 0, False: 0]
  ------------------
28809|      0|                goto fail;
28810|      0|        }
28811|      0|        break;
28812|      0|    case TOK_LET:
  ------------------
  |  Branch (28812:5): [True: 0, False: 96]
  ------------------
28813|      0|    case TOK_CONST:
  ------------------
  |  Branch (28813:5): [True: 0, False: 96]
  ------------------
28814|      0|    haslet:
28815|      0|        if (!(decl_mask & DECL_MASK_OTHER)) {
  ------------------
  |  |28298|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (28815:13): [True: 0, False: 0]
  ------------------
28816|      0|            js_parse_error(s, "lexical declarations can't appear in single-statement context");
28817|      0|            goto fail;
28818|      0|        }
28819|       |        /* fall thru */
28820|      0|    case TOK_VAR:
  ------------------
  |  Branch (28820:5): [True: 0, False: 96]
  ------------------
28821|      0|        if (next_token(s))
  ------------------
  |  Branch (28821:13): [True: 0, False: 0]
  ------------------
28822|      0|            goto fail;
28823|      0|        if (js_parse_var(s, TRUE, tok, FALSE))
  ------------------
  |  Branch (28823:13): [True: 0, False: 0]
  ------------------
28824|      0|            goto fail;
28825|      0|        if (js_parse_expect_semi(s))
  ------------------
  |  Branch (28825:13): [True: 0, False: 0]
  ------------------
28826|      0|            goto fail;
28827|      0|        break;
28828|      0|    case TOK_IF:
  ------------------
  |  Branch (28828:5): [True: 0, False: 96]
  ------------------
28829|      0|        {
28830|      0|            int label1, label2, mask;
28831|      0|            if (next_token(s))
  ------------------
  |  Branch (28831:17): [True: 0, False: 0]
  ------------------
28832|      0|                goto fail;
28833|       |            /* create a new scope for `let f;if(1) function f(){}` */
28834|      0|            push_scope(s);
28835|      0|            set_eval_ret_undefined(s);
28836|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (28836:17): [True: 0, False: 0]
  ------------------
28837|      0|                goto fail;
28838|      0|            label1 = emit_goto(s, OP_if_false, -1);
28839|      0|            if (s->cur_func->js_mode & JS_MODE_STRICT)
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (28839:17): [True: 0, False: 0]
  ------------------
28840|      0|                mask = 0;
28841|      0|            else
28842|      0|                mask = DECL_MASK_FUNC; /* Annex B.3.4 */
  ------------------
  |  |28295|      0|#define DECL_MASK_FUNC  (1 << 0) /* allow normal function declaration */
  ------------------
28843|       |
28844|      0|            if (js_parse_statement_or_decl(s, mask))
  ------------------
  |  Branch (28844:17): [True: 0, False: 0]
  ------------------
28845|      0|                goto fail;
28846|       |
28847|      0|            if (s->token.val == TOK_ELSE) {
  ------------------
  |  Branch (28847:17): [True: 0, False: 0]
  ------------------
28848|      0|                label2 = emit_goto(s, OP_goto, -1);
28849|      0|                if (next_token(s))
  ------------------
  |  Branch (28849:21): [True: 0, False: 0]
  ------------------
28850|      0|                    goto fail;
28851|       |
28852|      0|                emit_label(s, label1);
28853|      0|                if (js_parse_statement_or_decl(s, mask))
  ------------------
  |  Branch (28853:21): [True: 0, False: 0]
  ------------------
28854|      0|                    goto fail;
28855|       |
28856|      0|                label1 = label2;
28857|      0|            }
28858|      0|            emit_label(s, label1);
28859|      0|            pop_scope(s);
28860|      0|        }
28861|      0|        break;
28862|      0|    case TOK_WHILE:
  ------------------
  |  Branch (28862:5): [True: 0, False: 96]
  ------------------
28863|      0|        {
28864|      0|            int label_cont, label_break;
28865|      0|            BlockEnv break_entry;
28866|       |
28867|      0|            label_cont = new_label(s);
28868|      0|            label_break = new_label(s);
28869|       |
28870|      0|            push_break_entry(s->cur_func, &break_entry,
28871|      0|                             label_name, label_break, label_cont, 0);
28872|       |
28873|      0|            if (next_token(s))
  ------------------
  |  Branch (28873:17): [True: 0, False: 0]
  ------------------
28874|      0|                goto fail;
28875|       |
28876|      0|            set_eval_ret_undefined(s);
28877|       |
28878|      0|            emit_label(s, label_cont);
28879|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (28879:17): [True: 0, False: 0]
  ------------------
28880|      0|                goto fail;
28881|      0|            emit_goto(s, OP_if_false, label_break);
28882|       |
28883|      0|            if (js_parse_statement(s))
  ------------------
  |  Branch (28883:17): [True: 0, False: 0]
  ------------------
28884|      0|                goto fail;
28885|      0|            emit_goto(s, OP_goto, label_cont);
28886|       |
28887|      0|            emit_label(s, label_break);
28888|       |
28889|      0|            pop_break_entry(s->cur_func);
28890|      0|        }
28891|      0|        break;
28892|      0|    case TOK_DO:
  ------------------
  |  Branch (28892:5): [True: 0, False: 96]
  ------------------
28893|      0|        {
28894|      0|            int label_cont, label_break, label1;
28895|      0|            BlockEnv break_entry;
28896|       |
28897|      0|            label_cont = new_label(s);
28898|      0|            label_break = new_label(s);
28899|      0|            label1 = new_label(s);
28900|       |
28901|      0|            push_break_entry(s->cur_func, &break_entry,
28902|      0|                             label_name, label_break, label_cont, 0);
28903|       |
28904|      0|            if (next_token(s))
  ------------------
  |  Branch (28904:17): [True: 0, False: 0]
  ------------------
28905|      0|                goto fail;
28906|       |
28907|      0|            emit_label(s, label1);
28908|       |
28909|      0|            set_eval_ret_undefined(s);
28910|       |
28911|      0|            if (js_parse_statement(s))
  ------------------
  |  Branch (28911:17): [True: 0, False: 0]
  ------------------
28912|      0|                goto fail;
28913|       |
28914|      0|            emit_label(s, label_cont);
28915|      0|            if (js_parse_expect(s, TOK_WHILE))
  ------------------
  |  Branch (28915:17): [True: 0, False: 0]
  ------------------
28916|      0|                goto fail;
28917|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (28917:17): [True: 0, False: 0]
  ------------------
28918|      0|                goto fail;
28919|       |            /* Insert semicolon if missing */
28920|      0|            if (s->token.val == ';') {
  ------------------
  |  Branch (28920:17): [True: 0, False: 0]
  ------------------
28921|      0|                if (next_token(s))
  ------------------
  |  Branch (28921:21): [True: 0, False: 0]
  ------------------
28922|      0|                    goto fail;
28923|      0|            }
28924|      0|            emit_goto(s, OP_if_true, label1);
28925|       |
28926|      0|            emit_label(s, label_break);
28927|       |
28928|      0|            pop_break_entry(s->cur_func);
28929|      0|        }
28930|      0|        break;
28931|     15|    case TOK_FOR:
  ------------------
  |  Branch (28931:5): [True: 15, False: 81]
  ------------------
28932|     15|        {
28933|     15|            int label_cont, label_break, label_body, label_test;
28934|     15|            int pos_cont, pos_body, block_scope_level;
28935|     15|            BlockEnv break_entry;
28936|     15|            int tok, bits;
28937|     15|            BOOL is_async;
28938|       |
28939|     15|            if (next_token(s))
  ------------------
  |  Branch (28939:17): [True: 0, False: 15]
  ------------------
28940|      0|                goto fail;
28941|       |
28942|     15|            set_eval_ret_undefined(s);
28943|     15|            bits = 0;
28944|     15|            is_async = FALSE;
28945|     15|            if (s->token.val == '(') {
  ------------------
  |  Branch (28945:17): [True: 15, False: 0]
  ------------------
28946|     15|                js_parse_skip_parens_token(s, &bits, FALSE);
28947|     15|            } else if (s->token.val == TOK_AWAIT) {
  ------------------
  |  Branch (28947:24): [True: 0, False: 0]
  ------------------
28948|      0|                if (!(s->cur_func->func_kind & JS_FUNC_ASYNC)) {
  ------------------
  |  Branch (28948:21): [True: 0, False: 0]
  ------------------
28949|      0|                    js_parse_error(s, "for await is only valid in asynchronous functions");
28950|      0|                    goto fail;
28951|      0|                }
28952|      0|                is_async = TRUE;
28953|      0|                if (next_token(s))
  ------------------
  |  Branch (28953:21): [True: 0, False: 0]
  ------------------
28954|      0|                    goto fail;
28955|      0|                s->cur_func->has_await = TRUE;
28956|      0|            }
28957|     15|            if (js_parse_expect(s, '('))
  ------------------
  |  Branch (28957:17): [True: 0, False: 15]
  ------------------
28958|      0|                goto fail;
28959|       |
28960|     15|            if (!(bits & SKIP_HAS_SEMI)) {
  ------------------
  |  |24596|     15|#define SKIP_HAS_SEMI       (1 << 0)
  ------------------
  |  Branch (28960:17): [True: 15, False: 0]
  ------------------
28961|       |                /* parse for/in or for/of */
28962|     15|                if (js_parse_for_in_of(s, label_name, is_async))
  ------------------
  |  Branch (28962:21): [True: 2, False: 13]
  ------------------
28963|      2|                    goto fail;
28964|     13|                break;
28965|     15|            }
28966|      0|            block_scope_level = s->cur_func->scope_level;
28967|       |
28968|       |            /* create scope for the lexical variables declared in the initial,
28969|       |               test and increment expressions */
28970|      0|            push_scope(s);
28971|       |            /* initial expression */
28972|      0|            tok = s->token.val;
28973|      0|            if (tok != ';') {
  ------------------
  |  Branch (28973:17): [True: 0, False: 0]
  ------------------
28974|      0|                switch (is_let(s, DECL_MASK_OTHER)) {
  ------------------
  |  |28298|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
28975|      0|                case TRUE:
  ------------------
  |  Branch (28975:17): [True: 0, False: 0]
  ------------------
28976|      0|                    tok = TOK_LET;
28977|      0|                    break;
28978|      0|                case FALSE:
  ------------------
  |  Branch (28978:17): [True: 0, False: 0]
  ------------------
28979|      0|                    break;
28980|      0|                default:
  ------------------
  |  Branch (28980:17): [True: 0, False: 0]
  ------------------
28981|      0|                    goto fail;
28982|      0|                }
28983|      0|                if (tok == TOK_VAR || tok == TOK_LET || tok == TOK_CONST) {
  ------------------
  |  Branch (28983:21): [True: 0, False: 0]
  |  Branch (28983:39): [True: 0, False: 0]
  |  Branch (28983:57): [True: 0, False: 0]
  ------------------
28984|      0|                    if (next_token(s))
  ------------------
  |  Branch (28984:25): [True: 0, False: 0]
  ------------------
28985|      0|                        goto fail;
28986|      0|                    if (js_parse_var(s, FALSE, tok, FALSE))
  ------------------
  |  Branch (28986:25): [True: 0, False: 0]
  ------------------
28987|      0|                        goto fail;
28988|      0|                } else {
28989|      0|                    if (js_parse_expr2(s, FALSE))
  ------------------
  |  Branch (28989:25): [True: 0, False: 0]
  ------------------
28990|      0|                        goto fail;
28991|      0|                    emit_op(s, OP_drop);
28992|      0|                }
28993|       |
28994|       |                /* close the closures before the first iteration */
28995|      0|                close_scopes(s, s->cur_func->scope_level, block_scope_level);
28996|      0|            }
28997|      0|            if (js_parse_expect(s, ';'))
  ------------------
  |  Branch (28997:17): [True: 0, False: 0]
  ------------------
28998|      0|                goto fail;
28999|       |
29000|      0|            label_test = new_label(s);
29001|      0|            label_cont = new_label(s);
29002|      0|            label_body = new_label(s);
29003|      0|            label_break = new_label(s);
29004|       |
29005|      0|            push_break_entry(s->cur_func, &break_entry,
29006|      0|                             label_name, label_break, label_cont, 0);
29007|       |
29008|       |            /* test expression */
29009|      0|            if (s->token.val == ';') {
  ------------------
  |  Branch (29009:17): [True: 0, False: 0]
  ------------------
29010|       |                /* no test expression */
29011|      0|                label_test = label_body;
29012|      0|            } else {
29013|      0|                emit_label(s, label_test);
29014|      0|                if (js_parse_expr(s))
  ------------------
  |  Branch (29014:21): [True: 0, False: 0]
  ------------------
29015|      0|                    goto fail;
29016|      0|                emit_goto(s, OP_if_false, label_break);
29017|      0|            }
29018|      0|            if (js_parse_expect(s, ';'))
  ------------------
  |  Branch (29018:17): [True: 0, False: 0]
  ------------------
29019|      0|                goto fail;
29020|       |
29021|      0|            if (s->token.val == ')') {
  ------------------
  |  Branch (29021:17): [True: 0, False: 0]
  ------------------
29022|       |                /* no end expression */
29023|      0|                break_entry.label_cont = label_cont = label_test;
29024|      0|                pos_cont = 0; /* avoid warning */
29025|      0|            } else {
29026|       |                /* skip the end expression */
29027|      0|                emit_goto(s, OP_goto, label_body);
29028|       |
29029|      0|                pos_cont = s->cur_func->byte_code.size;
29030|      0|                emit_label(s, label_cont);
29031|      0|                if (js_parse_expr(s))
  ------------------
  |  Branch (29031:21): [True: 0, False: 0]
  ------------------
29032|      0|                    goto fail;
29033|      0|                emit_op(s, OP_drop);
29034|      0|                if (label_test != label_body)
  ------------------
  |  Branch (29034:21): [True: 0, False: 0]
  ------------------
29035|      0|                    emit_goto(s, OP_goto, label_test);
29036|      0|            }
29037|      0|            if (js_parse_expect(s, ')'))
  ------------------
  |  Branch (29037:17): [True: 0, False: 0]
  ------------------
29038|      0|                goto fail;
29039|       |
29040|      0|            pos_body = s->cur_func->byte_code.size;
29041|      0|            emit_label(s, label_body);
29042|      0|            if (js_parse_statement(s))
  ------------------
  |  Branch (29042:17): [True: 0, False: 0]
  ------------------
29043|      0|                goto fail;
29044|       |
29045|       |            /* close the closures before the next iteration */
29046|       |            /* XXX: check continue case */
29047|      0|            close_scopes(s, s->cur_func->scope_level, block_scope_level);
29048|       |
29049|      0|            if (OPTIMIZE && label_test != label_body && label_cont != label_test) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
  |  Branch (29049:29): [True: 0, False: 0]
  |  Branch (29049:57): [True: 0, False: 0]
  ------------------
29050|       |                /* move the increment code here */
29051|      0|                DynBuf *bc = &s->cur_func->byte_code;
29052|      0|                int chunk_size = pos_body - pos_cont;
29053|      0|                int offset = bc->size - pos_cont;
29054|      0|                int i;
29055|      0|                dbuf_claim(bc, chunk_size);
29056|      0|                dbuf_put(bc, bc->buf + pos_cont, chunk_size);
29057|      0|                memset(bc->buf + pos_cont, OP_nop, chunk_size);
29058|       |                /* increment part ends with a goto */
29059|      0|                s->cur_func->last_opcode_pos = bc->size - 5;
29060|       |                /* relocate labels */
29061|      0|                for (i = label_cont; i < s->cur_func->label_count; i++) {
  ------------------
  |  Branch (29061:38): [True: 0, False: 0]
  ------------------
29062|      0|                    LabelSlot *ls = &s->cur_func->label_slots[i];
29063|      0|                    if (ls->pos >= pos_cont && ls->pos < pos_body)
  ------------------
  |  Branch (29063:25): [True: 0, False: 0]
  |  Branch (29063:48): [True: 0, False: 0]
  ------------------
29064|      0|                        ls->pos += offset;
29065|      0|                }
29066|      0|            } else {
29067|      0|                emit_goto(s, OP_goto, label_cont);
29068|      0|            }
29069|       |
29070|      0|            emit_label(s, label_break);
29071|       |
29072|      0|            pop_break_entry(s->cur_func);
29073|      0|            pop_scope(s);
29074|      0|        }
29075|      0|        break;
29076|      0|    case TOK_BREAK:
  ------------------
  |  Branch (29076:5): [True: 0, False: 96]
  ------------------
29077|      0|    case TOK_CONTINUE:
  ------------------
  |  Branch (29077:5): [True: 0, False: 96]
  ------------------
29078|      0|        {
29079|      0|            int is_cont = s->token.val - TOK_BREAK;
29080|      0|            int label;
29081|       |
29082|      0|            if (next_token(s))
  ------------------
  |  Branch (29082:17): [True: 0, False: 0]
  ------------------
29083|      0|                goto fail;
29084|      0|            if (!s->got_lf && s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved)
  ------------------
  |  Branch (29084:17): [True: 0, False: 0]
  |  Branch (29084:31): [True: 0, False: 0]
  |  Branch (29084:60): [True: 0, False: 0]
  ------------------
29085|      0|                label = s->token.u.ident.atom;
29086|      0|            else
29087|      0|                label = JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
29088|      0|            if (emit_break(s, label, is_cont))
  ------------------
  |  Branch (29088:17): [True: 0, False: 0]
  ------------------
29089|      0|                goto fail;
29090|      0|            if (label != JS_ATOM_NULL) {
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (29090:17): [True: 0, False: 0]
  ------------------
29091|      0|                if (next_token(s))
  ------------------
  |  Branch (29091:21): [True: 0, False: 0]
  ------------------
29092|      0|                    goto fail;
29093|      0|            }
29094|      0|            if (js_parse_expect_semi(s))
  ------------------
  |  Branch (29094:17): [True: 0, False: 0]
  ------------------
29095|      0|                goto fail;
29096|      0|        }
29097|      0|        break;
29098|      0|    case TOK_SWITCH:
  ------------------
  |  Branch (29098:5): [True: 0, False: 96]
  ------------------
29099|      0|        {
29100|      0|            int label_case, label_break, label1;
29101|      0|            int default_label_pos;
29102|      0|            BlockEnv break_entry;
29103|       |
29104|      0|            if (next_token(s))
  ------------------
  |  Branch (29104:17): [True: 0, False: 0]
  ------------------
29105|      0|                goto fail;
29106|       |
29107|      0|            set_eval_ret_undefined(s);
29108|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (29108:17): [True: 0, False: 0]
  ------------------
29109|      0|                goto fail;
29110|       |
29111|      0|            push_scope(s);
29112|      0|            label_break = new_label(s);
29113|      0|            push_break_entry(s->cur_func, &break_entry,
29114|      0|                             label_name, label_break, -1, 1);
29115|       |
29116|      0|            if (js_parse_expect(s, '{'))
  ------------------
  |  Branch (29116:17): [True: 0, False: 0]
  ------------------
29117|      0|                goto fail;
29118|       |
29119|      0|            default_label_pos = -1;
29120|      0|            label_case = -1;
29121|      0|            while (s->token.val != '}') {
  ------------------
  |  Branch (29121:20): [True: 0, False: 0]
  ------------------
29122|      0|                if (s->token.val == TOK_CASE) {
  ------------------
  |  Branch (29122:21): [True: 0, False: 0]
  ------------------
29123|      0|                    label1 = -1;
29124|      0|                    if (label_case >= 0) {
  ------------------
  |  Branch (29124:25): [True: 0, False: 0]
  ------------------
29125|       |                        /* skip the case if needed */
29126|      0|                        label1 = emit_goto(s, OP_goto, -1);
29127|      0|                    }
29128|      0|                    emit_label(s, label_case);
29129|      0|                    label_case = -1;
29130|      0|                    for (;;) {
29131|       |                        /* parse a sequence of case clauses */
29132|      0|                        if (next_token(s))
  ------------------
  |  Branch (29132:29): [True: 0, False: 0]
  ------------------
29133|      0|                            goto fail;
29134|      0|                        emit_op(s, OP_dup);
29135|      0|                        if (js_parse_expr(s))
  ------------------
  |  Branch (29135:29): [True: 0, False: 0]
  ------------------
29136|      0|                            goto fail;
29137|      0|                        if (js_parse_expect(s, ':'))
  ------------------
  |  Branch (29137:29): [True: 0, False: 0]
  ------------------
29138|      0|                            goto fail;
29139|      0|                        emit_op(s, OP_strict_eq);
29140|      0|                        if (s->token.val == TOK_CASE) {
  ------------------
  |  Branch (29140:29): [True: 0, False: 0]
  ------------------
29141|      0|                            label1 = emit_goto(s, OP_if_true, label1);
29142|      0|                        } else {
29143|      0|                            label_case = emit_goto(s, OP_if_false, -1);
29144|      0|                            emit_label(s, label1);
29145|      0|                            break;
29146|      0|                        }
29147|      0|                    }
29148|      0|                } else if (s->token.val == TOK_DEFAULT) {
  ------------------
  |  Branch (29148:28): [True: 0, False: 0]
  ------------------
29149|      0|                    if (next_token(s))
  ------------------
  |  Branch (29149:25): [True: 0, False: 0]
  ------------------
29150|      0|                        goto fail;
29151|      0|                    if (js_parse_expect(s, ':'))
  ------------------
  |  Branch (29151:25): [True: 0, False: 0]
  ------------------
29152|      0|                        goto fail;
29153|      0|                    if (default_label_pos >= 0) {
  ------------------
  |  Branch (29153:25): [True: 0, False: 0]
  ------------------
29154|      0|                        js_parse_error(s, "duplicate default");
29155|      0|                        goto fail;
29156|      0|                    }
29157|      0|                    if (label_case < 0) {
  ------------------
  |  Branch (29157:25): [True: 0, False: 0]
  ------------------
29158|       |                        /* falling thru direct from switch expression */
29159|      0|                        label_case = emit_goto(s, OP_goto, -1);
29160|      0|                    }
29161|       |                    /* Emit a dummy label opcode. Label will be patched after
29162|       |                       the end of the switch body. Do not use emit_label(s, 0)
29163|       |                       because it would clobber label 0 address, preventing
29164|       |                       proper optimizer operation.
29165|       |                     */
29166|      0|                    emit_op(s, OP_label);
29167|      0|                    emit_u32(s, 0);
29168|      0|                    default_label_pos = s->cur_func->byte_code.size - 4;
29169|      0|                } else {
29170|      0|                    if (label_case < 0) {
  ------------------
  |  Branch (29170:25): [True: 0, False: 0]
  ------------------
29171|       |                        /* falling thru direct from switch expression */
29172|      0|                        js_parse_error(s, "invalid switch statement");
29173|      0|                        goto fail;
29174|      0|                    }
29175|      0|                    if (js_parse_statement_or_decl(s, DECL_MASK_ALL))
  ------------------
  |  |28299|      0|#define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28295|      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)
  |  |  ------------------
  |  |  |  |28297|      0|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  |  |  ------------------
  |  |               #define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28298|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  |  |  ------------------
  ------------------
  |  Branch (29175:25): [True: 0, False: 0]
  ------------------
29176|      0|                        goto fail;
29177|      0|                }
29178|      0|            }
29179|      0|            if (js_parse_expect(s, '}'))
  ------------------
  |  Branch (29179:17): [True: 0, False: 0]
  ------------------
29180|      0|                goto fail;
29181|      0|            if (default_label_pos >= 0) {
  ------------------
  |  Branch (29181:17): [True: 0, False: 0]
  ------------------
29182|       |                /* Ugly patch for the `default` label, shameful and risky */
29183|      0|                put_u32(s->cur_func->byte_code.buf + default_label_pos,
29184|      0|                        label_case);
29185|      0|                s->cur_func->label_slots[label_case].pos = default_label_pos + 4;
29186|      0|            } else {
29187|      0|                emit_label(s, label_case);
29188|      0|            }
29189|      0|            emit_label(s, label_break);
29190|      0|            emit_op(s, OP_drop); /* drop the switch expression */
29191|       |
29192|      0|            pop_break_entry(s->cur_func);
29193|      0|            pop_scope(s);
29194|      0|        }
29195|      0|        break;
29196|      0|    case TOK_TRY:
  ------------------
  |  Branch (29196:5): [True: 0, False: 96]
  ------------------
29197|      0|        {
29198|      0|            int label_catch, label_catch2, label_finally, label_end;
29199|      0|            JSAtom name;
29200|      0|            BlockEnv block_env;
29201|       |
29202|      0|            set_eval_ret_undefined(s);
29203|      0|            if (next_token(s))
  ------------------
  |  Branch (29203:17): [True: 0, False: 0]
  ------------------
29204|      0|                goto fail;
29205|      0|            label_catch = new_label(s);
29206|      0|            label_catch2 = new_label(s);
29207|      0|            label_finally = new_label(s);
29208|      0|            label_end = new_label(s);
29209|       |
29210|      0|            emit_goto(s, OP_catch, label_catch);
29211|       |
29212|      0|            push_break_entry(s->cur_func, &block_env,
29213|      0|                             JS_ATOM_NULL, -1, -1, 1);
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
29214|      0|            block_env.label_finally = label_finally;
29215|       |
29216|      0|            if (js_parse_block(s))
  ------------------
  |  Branch (29216:17): [True: 0, False: 0]
  ------------------
29217|      0|                goto fail;
29218|       |
29219|      0|            pop_break_entry(s->cur_func);
29220|       |
29221|      0|            if (js_is_live_code(s)) {
  ------------------
  |  Branch (29221:17): [True: 0, False: 0]
  ------------------
29222|       |                /* drop the catch offset */
29223|      0|                emit_op(s, OP_drop);
29224|       |                /* must push dummy value to keep same stack size */
29225|      0|                emit_op(s, OP_undefined);
29226|      0|                emit_goto(s, OP_gosub, label_finally);
29227|      0|                emit_op(s, OP_drop);
29228|       |
29229|      0|                emit_goto(s, OP_goto, label_end);
29230|      0|            }
29231|       |
29232|      0|            if (s->token.val == TOK_CATCH) {
  ------------------
  |  Branch (29232:17): [True: 0, False: 0]
  ------------------
29233|      0|                if (next_token(s))
  ------------------
  |  Branch (29233:21): [True: 0, False: 0]
  ------------------
29234|      0|                    goto fail;
29235|       |
29236|      0|                push_scope(s);  /* catch variable */
29237|      0|                emit_label(s, label_catch);
29238|       |
29239|      0|                if (s->token.val == '{') {
  ------------------
  |  Branch (29239:21): [True: 0, False: 0]
  ------------------
29240|       |                    /* support optional-catch-binding feature */
29241|      0|                    emit_op(s, OP_drop);    /* pop the exception object */
29242|      0|                } else {
29243|      0|                    if (js_parse_expect(s, '('))
  ------------------
  |  Branch (29243:25): [True: 0, False: 0]
  ------------------
29244|      0|                        goto fail;
29245|      0|                    if (!(s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved)) {
  ------------------
  |  Branch (29245:27): [True: 0, False: 0]
  |  Branch (29245:56): [True: 0, False: 0]
  ------------------
29246|      0|                        if (s->token.val == '[' || s->token.val == '{') {
  ------------------
  |  Branch (29246:29): [True: 0, False: 0]
  |  Branch (29246:52): [True: 0, False: 0]
  ------------------
29247|       |                            /* XXX: TOK_LET is not completely correct */
29248|      0|                            if (js_parse_destructuring_element(s, TOK_LET, 0, TRUE, -1, TRUE, FALSE) < 0)
  ------------------
  |  Branch (29248:33): [True: 0, False: 0]
  ------------------
29249|      0|                                goto fail;
29250|      0|                        } else {
29251|      0|                            js_parse_error(s, "identifier expected");
29252|      0|                            goto fail;
29253|      0|                        }
29254|      0|                    } else {
29255|      0|                        name = JS_DupAtom(ctx, s->token.u.ident.atom);
29256|      0|                        if (next_token(s)
  ------------------
  |  Branch (29256:29): [True: 0, False: 0]
  ------------------
29257|      0|                        ||  js_define_var(s, name, TOK_CATCH) < 0) {
  ------------------
  |  Branch (29257:29): [True: 0, False: 0]
  ------------------
29258|      0|                            JS_FreeAtom(ctx, name);
29259|      0|                            goto fail;
29260|      0|                        }
29261|       |                        /* store the exception value in the catch variable */
29262|      0|                        emit_op(s, OP_scope_put_var);
29263|      0|                        emit_u32(s, name);
29264|      0|                        emit_u16(s, s->cur_func->scope_level);
29265|      0|                    }
29266|      0|                    if (js_parse_expect(s, ')'))
  ------------------
  |  Branch (29266:25): [True: 0, False: 0]
  ------------------
29267|      0|                        goto fail;
29268|      0|                }
29269|       |                /* XXX: should keep the address to nop it out if there is no finally block */
29270|      0|                emit_goto(s, OP_catch, label_catch2);
29271|       |
29272|      0|                push_scope(s);  /* catch block */
29273|      0|                push_break_entry(s->cur_func, &block_env, JS_ATOM_NULL,
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
29274|      0|                                 -1, -1, 1);
29275|      0|                block_env.label_finally = label_finally;
29276|       |
29277|      0|                if (js_parse_block(s))
  ------------------
  |  Branch (29277:21): [True: 0, False: 0]
  ------------------
29278|      0|                    goto fail;
29279|       |
29280|      0|                pop_break_entry(s->cur_func);
29281|      0|                pop_scope(s);  /* catch block */
29282|      0|                pop_scope(s);  /* catch variable */
29283|       |
29284|      0|                if (js_is_live_code(s)) {
  ------------------
  |  Branch (29284:21): [True: 0, False: 0]
  ------------------
29285|       |                    /* drop the catch2 offset */
29286|      0|                    emit_op(s, OP_drop);
29287|       |                    /* XXX: should keep the address to nop it out if there is no finally block */
29288|       |                    /* must push dummy value to keep same stack size */
29289|      0|                    emit_op(s, OP_undefined);
29290|      0|                    emit_goto(s, OP_gosub, label_finally);
29291|      0|                    emit_op(s, OP_drop);
29292|      0|                    emit_goto(s, OP_goto, label_end);
29293|      0|                }
29294|       |                /* catch exceptions thrown in the catch block to execute the
29295|       |                 * finally clause and rethrow the exception */
29296|      0|                emit_label(s, label_catch2);
29297|       |                /* catch value is at TOS, no need to push undefined */
29298|      0|                emit_goto(s, OP_gosub, label_finally);
29299|      0|                emit_op(s, OP_throw);
29300|       |
29301|      0|            } else if (s->token.val == TOK_FINALLY) {
  ------------------
  |  Branch (29301:24): [True: 0, False: 0]
  ------------------
29302|       |                /* finally without catch : execute the finally clause
29303|       |                 * and rethrow the exception */
29304|      0|                emit_label(s, label_catch);
29305|       |                /* catch value is at TOS, no need to push undefined */
29306|      0|                emit_goto(s, OP_gosub, label_finally);
29307|      0|                emit_op(s, OP_throw);
29308|      0|            } else {
29309|      0|                js_parse_error(s, "expecting catch or finally");
29310|      0|                goto fail;
29311|      0|            }
29312|      0|            emit_label(s, label_finally);
29313|      0|            if (s->token.val == TOK_FINALLY) {
  ------------------
  |  Branch (29313:17): [True: 0, False: 0]
  ------------------
29314|      0|                int saved_eval_ret_idx = 0; /* avoid warning */
29315|       |
29316|      0|                if (next_token(s))
  ------------------
  |  Branch (29316:21): [True: 0, False: 0]
  ------------------
29317|      0|                    goto fail;
29318|       |                /* on the stack: ret_value gosub_ret_value */
29319|      0|                push_break_entry(s->cur_func, &block_env, JS_ATOM_NULL,
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
29320|      0|                                 -1, -1, 2);
29321|       |
29322|      0|                if (s->cur_func->eval_ret_idx >= 0) {
  ------------------
  |  Branch (29322:21): [True: 0, False: 0]
  ------------------
29323|       |                    /* 'finally' updates eval_ret only if not a normal
29324|       |                       termination */
29325|      0|                    saved_eval_ret_idx =
29326|      0|                        add_var(s->ctx, s->cur_func, JS_ATOM__ret_);
29327|      0|                    if (saved_eval_ret_idx < 0)
  ------------------
  |  Branch (29327:25): [True: 0, False: 0]
  ------------------
29328|      0|                        goto fail;
29329|      0|                    emit_op(s, OP_get_loc);
29330|      0|                    emit_u16(s, s->cur_func->eval_ret_idx);
29331|      0|                    emit_op(s, OP_put_loc);
29332|      0|                    emit_u16(s, saved_eval_ret_idx);
29333|      0|                    set_eval_ret_undefined(s);
29334|      0|                }
29335|       |
29336|      0|                if (js_parse_block(s))
  ------------------
  |  Branch (29336:21): [True: 0, False: 0]
  ------------------
29337|      0|                    goto fail;
29338|       |
29339|      0|                if (s->cur_func->eval_ret_idx >= 0) {
  ------------------
  |  Branch (29339:21): [True: 0, False: 0]
  ------------------
29340|      0|                    emit_op(s, OP_get_loc);
29341|      0|                    emit_u16(s, saved_eval_ret_idx);
29342|      0|                    emit_op(s, OP_put_loc);
29343|      0|                    emit_u16(s, s->cur_func->eval_ret_idx);
29344|      0|                }
29345|      0|                pop_break_entry(s->cur_func);
29346|      0|            }
29347|      0|            emit_op(s, OP_ret);
29348|      0|            emit_label(s, label_end);
29349|      0|        }
29350|      0|        break;
29351|      0|    case ';':
  ------------------
  |  Branch (29351:5): [True: 0, False: 96]
  ------------------
29352|       |        /* empty statement */
29353|      0|        if (next_token(s))
  ------------------
  |  Branch (29353:13): [True: 0, False: 0]
  ------------------
29354|      0|            goto fail;
29355|      0|        break;
29356|      0|    case TOK_WITH:
  ------------------
  |  Branch (29356:5): [True: 0, False: 96]
  ------------------
29357|      0|        if (s->cur_func->js_mode & JS_MODE_STRICT) {
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (29357:13): [True: 0, False: 0]
  ------------------
29358|      0|            js_parse_error(s, "invalid keyword: with");
29359|      0|            goto fail;
29360|      0|        } else {
29361|      0|            int with_idx;
29362|       |
29363|      0|            if (next_token(s))
  ------------------
  |  Branch (29363:17): [True: 0, False: 0]
  ------------------
29364|      0|                goto fail;
29365|       |
29366|      0|            if (js_parse_expr_paren(s))
  ------------------
  |  Branch (29366:17): [True: 0, False: 0]
  ------------------
29367|      0|                goto fail;
29368|       |
29369|      0|            push_scope(s);
29370|      0|            with_idx = define_var(s, s->cur_func, JS_ATOM__with_,
29371|      0|                                  JS_VAR_DEF_WITH);
29372|      0|            if (with_idx < 0)
  ------------------
  |  Branch (29372:17): [True: 0, False: 0]
  ------------------
29373|      0|                goto fail;
29374|      0|            emit_op(s, OP_to_object);
29375|      0|            emit_op(s, OP_put_loc);
29376|      0|            emit_u16(s, with_idx);
29377|       |
29378|      0|            set_eval_ret_undefined(s);
29379|      0|            if (js_parse_statement(s))
  ------------------
  |  Branch (29379:17): [True: 0, False: 0]
  ------------------
29380|      0|                goto fail;
29381|       |
29382|       |            /* Popping scope drops lexical context for the with object variable */
29383|      0|            pop_scope(s);
29384|      0|        }
29385|      0|        break;
29386|      2|    case TOK_FUNCTION:
  ------------------
  |  Branch (29386:5): [True: 2, False: 94]
  ------------------
29387|       |        /* ES6 Annex B.3.2 and B.3.3 semantics */
29388|      2|        if (!(decl_mask & DECL_MASK_FUNC))
  ------------------
  |  |28295|      2|#define DECL_MASK_FUNC  (1 << 0) /* allow normal function declaration */
  ------------------
  |  Branch (29388:13): [True: 0, False: 2]
  ------------------
29389|      0|            goto func_decl_error;
29390|      2|        if (!(decl_mask & DECL_MASK_OTHER) && peek_token(s, FALSE) == '*')
  ------------------
  |  |28298|      2|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (29390:13): [True: 0, False: 2]
  |  Branch (29390:47): [True: 0, False: 0]
  ------------------
29391|      0|            goto func_decl_error;
29392|      2|        goto parse_func_var;
29393|     54|    case TOK_IDENT:
  ------------------
  |  Branch (29393:5): [True: 54, False: 42]
  ------------------
29394|     54|        if (s->token.u.ident.is_reserved) {
  ------------------
  |  Branch (29394:13): [True: 0, False: 54]
  ------------------
29395|      0|            js_parse_error_reserved_identifier(s);
29396|      0|            goto fail;
29397|      0|        }
29398|       |        /* Determine if `let` introduces a Declaration or an ExpressionStatement */
29399|     54|        switch (is_let(s, decl_mask)) {
29400|      0|        case TRUE:
  ------------------
  |  Branch (29400:9): [True: 0, False: 54]
  ------------------
29401|      0|            tok = TOK_LET;
29402|      0|            goto haslet;
29403|     54|        case FALSE:
  ------------------
  |  Branch (29403:9): [True: 54, False: 0]
  ------------------
29404|     54|            break;
29405|      0|        default:
  ------------------
  |  Branch (29405:9): [True: 0, False: 54]
  ------------------
29406|      0|            goto fail;
29407|     54|        }
29408|     54|        if (token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (29408:13): [True: 0, False: 54]
  ------------------
29409|      0|            peek_token(s, TRUE) == TOK_FUNCTION) {
  ------------------
  |  Branch (29409:13): [True: 0, False: 0]
  ------------------
29410|      0|            if (!(decl_mask & DECL_MASK_OTHER)) {
  ------------------
  |  |28298|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (29410:17): [True: 0, False: 0]
  ------------------
29411|      0|            func_decl_error:
29412|      0|                js_parse_error(s, "function declarations can't appear in single-statement context");
29413|      0|                goto fail;
29414|      0|            }
29415|      2|        parse_func_var:
29416|      2|            if (js_parse_function_decl(s, JS_PARSE_FUNC_VAR,
  ------------------
  |  Branch (29416:17): [True: 2, False: 0]
  ------------------
29417|      2|                                       JS_FUNC_NORMAL, JS_ATOM_NULL,
  ------------------
  |  |  449|      2|#define JS_ATOM_NULL 0
  ------------------
29418|      2|                                       s->token.ptr))
29419|      2|                goto fail;
29420|      0|            break;
29421|      2|        }
29422|     54|        goto hasexpr;
29423|       |
29424|     54|    case TOK_CLASS:
  ------------------
  |  Branch (29424:5): [True: 0, False: 96]
  ------------------
29425|      0|        if (!(decl_mask & DECL_MASK_OTHER)) {
  ------------------
  |  |28298|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (29425:13): [True: 0, False: 0]
  ------------------
29426|      0|            js_parse_error(s, "class declarations can't appear in single-statement context");
29427|      0|            goto fail;
29428|      0|        }
29429|      0|        if (js_parse_class(s, FALSE, JS_PARSE_EXPORT_NONE))
  ------------------
  |  Branch (29429:13): [True: 0, False: 0]
  ------------------
29430|      0|            return -1;
29431|      0|        break;
29432|       |
29433|      0|    case TOK_DEBUGGER:
  ------------------
  |  Branch (29433:5): [True: 0, False: 96]
  ------------------
29434|       |        /* currently no debugger, so just skip the keyword */
29435|      0|        if (next_token(s))
  ------------------
  |  Branch (29435:13): [True: 0, False: 0]
  ------------------
29436|      0|            goto fail;
29437|      0|        if (js_parse_expect_semi(s))
  ------------------
  |  Branch (29437:13): [True: 0, False: 0]
  ------------------
29438|      0|            goto fail;
29439|      0|        break;
29440|       |
29441|      0|    case TOK_ENUM:
  ------------------
  |  Branch (29441:5): [True: 0, False: 96]
  ------------------
29442|      0|    case TOK_EXPORT:
  ------------------
  |  Branch (29442:5): [True: 0, False: 96]
  ------------------
29443|      0|    case TOK_EXTENDS:
  ------------------
  |  Branch (29443:5): [True: 0, False: 96]
  ------------------
29444|      0|        js_unsupported_keyword(s, s->token.u.ident.atom);
29445|      0|        goto fail;
29446|       |
29447|     19|    default:
  ------------------
  |  Branch (29447:5): [True: 19, False: 77]
  ------------------
29448|     73|    hasexpr:
29449|     73|        emit_source_pos(s, s->token.ptr);
29450|     73|        if (js_parse_expr(s))
  ------------------
  |  Branch (29450:13): [True: 2, False: 71]
  ------------------
29451|      2|            goto fail;
29452|     71|        if (s->cur_func->eval_ret_idx >= 0) {
  ------------------
  |  Branch (29452:13): [True: 29, False: 42]
  ------------------
29453|       |            /* store the expression value so that it can be returned
29454|       |               by eval() */
29455|     29|            emit_op(s, OP_put_loc);
29456|     29|            emit_u16(s, s->cur_func->eval_ret_idx);
29457|     42|        } else {
29458|     42|            emit_op(s, OP_drop); /* drop the result */
29459|     42|        }
29460|     71|        if (js_parse_expect_semi(s))
  ------------------
  |  Branch (29460:13): [True: 0, False: 71]
  ------------------
29461|      0|            goto fail;
29462|     71|        break;
29463|     96|    }
29464|     87|done:
29465|     87|    JS_FreeAtom(ctx, label_name);
29466|     87|    return 0;
29467|     11|fail:
29468|     11|    JS_FreeAtom(ctx, label_name);
29469|     11|    return -1;
29470|     96|}
quickjs.c:is_label:
28424|     98|{
28425|     98|    return (s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved &&
  ------------------
  |  Branch (28425:13): [True: 70, False: 28]
  |  Branch (28425:42): [True: 70, False: 0]
  ------------------
28426|     70|            peek_token(s, FALSE) == ':');
  ------------------
  |  Branch (28426:13): [True: 16, False: 54]
  ------------------
28427|     98|}
quickjs.c:js_parse_block:
28310|      6|{
28311|      6|    if (js_parse_expect(s, '{'))
  ------------------
  |  Branch (28311:9): [True: 0, False: 6]
  ------------------
28312|      0|        return -1;
28313|      6|    if (s->token.val != '}') {
  ------------------
  |  Branch (28313:9): [True: 5, False: 1]
  ------------------
28314|      5|        push_scope(s);
28315|     18|        for(;;) {
28316|     18|            if (js_parse_statement_or_decl(s, DECL_MASK_ALL))
  ------------------
  |  |28299|     18|#define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28295|     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)
  |  |  ------------------
  |  |  |  |28297|     18|#define DECL_MASK_FUNC_WITH_LABEL (1 << 1)
  |  |  ------------------
  |  |               #define DECL_MASK_ALL   (DECL_MASK_FUNC | DECL_MASK_FUNC_WITH_LABEL | DECL_MASK_OTHER)
  |  |  ------------------
  |  |  |  |28298|     18|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  |  |  ------------------
  ------------------
  |  Branch (28316:17): [True: 5, False: 13]
  ------------------
28317|      5|                return -1;
28318|     13|            if (s->token.val == '}')
  ------------------
  |  Branch (28318:17): [True: 0, False: 13]
  ------------------
28319|      0|                break;
28320|     13|        }
28321|      0|        pop_scope(s);
28322|      0|    }
28323|      1|    if (next_token(s))
  ------------------
  |  Branch (28323:9): [True: 0, False: 1]
  ------------------
28324|      0|        return -1;
28325|      1|    return 0;
28326|      1|}
quickjs.c:set_eval_ret_undefined:
28703|     15|{
28704|     15|    if (s->cur_func->eval_ret_idx >= 0) {
  ------------------
  |  Branch (28704:9): [True: 10, False: 5]
  ------------------
28705|     10|        emit_op(s, OP_undefined);
28706|     10|        emit_op(s, OP_put_loc);
28707|     10|        emit_u16(s, s->cur_func->eval_ret_idx);
28708|     10|    }
28709|     15|}
quickjs.c:js_parse_statement:
28305|     15|{
28306|     15|    return js_parse_statement_or_decl(s, 0);
28307|     15|}
quickjs.c:js_parse_for_in_of:
28478|     15|{
28479|     15|    JSContext *ctx = s->ctx;
28480|     15|    JSFunctionDef *fd = s->cur_func;
28481|     15|    JSAtom var_name;
28482|     15|    BOOL has_initializer, is_for_of, has_destructuring;
28483|     15|    int tok, tok1, opcode, scope, block_scope_level;
28484|     15|    int label_next, label_expr, label_cont, label_body, label_break;
28485|     15|    int pos_next, pos_expr;
28486|     15|    BlockEnv break_entry;
28487|       |
28488|     15|    has_initializer = FALSE;
28489|     15|    has_destructuring = FALSE;
28490|     15|    is_for_of = FALSE;
28491|     15|    block_scope_level = fd->scope_level;
28492|     15|    label_cont = new_label(s);
28493|     15|    label_body = new_label(s);
28494|     15|    label_break = new_label(s);
28495|     15|    label_next = new_label(s);
28496|       |
28497|       |    /* create scope for the lexical variables declared in the enumeration
28498|       |       expressions. XXX: Not completely correct because of weird capturing
28499|       |       semantics in `for (i of o) a.push(function(){return i})` */
28500|     15|    push_scope(s);
28501|       |
28502|       |    /* local for_in scope starts here so individual elements
28503|       |       can be closed in statement. */
28504|     15|    push_break_entry(s->cur_func, &break_entry,
28505|     15|                     label_name, label_break, label_cont, 1);
28506|     15|    break_entry.scope_level = block_scope_level;
28507|       |
28508|     15|    label_expr = emit_goto(s, OP_goto, -1);
28509|       |
28510|     15|    pos_next = s->cur_func->byte_code.size;
28511|     15|    emit_label(s, label_next);
28512|       |
28513|     15|    tok = s->token.val;
28514|     15|    switch (is_let(s, DECL_MASK_OTHER)) {
  ------------------
  |  |28298|     15|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
28515|     14|    case TRUE:
  ------------------
  |  Branch (28515:5): [True: 14, False: 1]
  ------------------
28516|     14|        tok = TOK_LET;
28517|     14|        break;
28518|      1|    case FALSE:
  ------------------
  |  Branch (28518:5): [True: 1, False: 14]
  ------------------
28519|      1|        break;
28520|      0|    default:
  ------------------
  |  Branch (28520:5): [True: 0, False: 15]
  ------------------
28521|      0|        return -1;
28522|     15|    }
28523|     15|    if (tok == TOK_VAR || tok == TOK_LET || tok == TOK_CONST) {
  ------------------
  |  Branch (28523:9): [True: 0, False: 15]
  |  Branch (28523:27): [True: 14, False: 1]
  |  Branch (28523:45): [True: 0, False: 1]
  ------------------
28524|     14|        if (next_token(s))
  ------------------
  |  Branch (28524:13): [True: 0, False: 14]
  ------------------
28525|      0|            return -1;
28526|       |
28527|     14|        if (!(s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved)) {
  ------------------
  |  Branch (28527:15): [True: 14, False: 0]
  |  Branch (28527:44): [True: 14, False: 0]
  ------------------
28528|      0|            if (s->token.val == '[' || s->token.val == '{') {
  ------------------
  |  Branch (28528:17): [True: 0, False: 0]
  |  Branch (28528:40): [True: 0, False: 0]
  ------------------
28529|      0|                if (js_parse_destructuring_element(s, tok, 0, TRUE, -1, FALSE, FALSE) < 0)
  ------------------
  |  Branch (28529:21): [True: 0, False: 0]
  ------------------
28530|      0|                    return -1;
28531|      0|                has_destructuring = TRUE;
28532|      0|            } else {
28533|      0|                return js_parse_error(s, "variable name expected");
28534|      0|            }
28535|      0|            var_name = JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
28536|     14|        } else {
28537|     14|            var_name = JS_DupAtom(ctx, s->token.u.ident.atom);
28538|     14|            if (next_token(s)) {
  ------------------
  |  Branch (28538:17): [True: 0, False: 14]
  ------------------
28539|      0|                JS_FreeAtom(s->ctx, var_name);
28540|      0|                return -1;
28541|      0|            }
28542|     14|            if (js_define_var(s, var_name, tok)) {
  ------------------
  |  Branch (28542:17): [True: 0, False: 14]
  ------------------
28543|      0|                JS_FreeAtom(s->ctx, var_name);
28544|      0|                return -1;
28545|      0|            }
28546|     14|            emit_op(s, (tok == TOK_CONST || tok == TOK_LET) ?
  ------------------
  |  Branch (28546:25): [True: 0, False: 14]
  |  Branch (28546:45): [True: 14, False: 0]
  ------------------
28547|     14|                    OP_scope_put_var_init : OP_scope_put_var);
28548|     14|            emit_atom(s, var_name);
28549|     14|            emit_u16(s, fd->scope_level);
28550|     14|        }
28551|     14|    } else if (!is_async && token_is_pseudo_keyword(s, JS_ATOM_async) &&
  ------------------
  |  Branch (28551:16): [True: 1, False: 0]
  |  Branch (28551:29): [True: 0, False: 1]
  ------------------
28552|      0|               peek_token(s, FALSE) == TOK_OF) {
  ------------------
  |  Branch (28552:16): [True: 0, False: 0]
  ------------------
28553|      0|        return js_parse_error(s, "'for of' expression cannot start with 'async'");
28554|      1|    } else {
28555|      1|        int skip_bits;
28556|      1|        if ((s->token.val == '[' || s->token.val == '{')
  ------------------
  |  Branch (28556:14): [True: 0, False: 1]
  |  Branch (28556:37): [True: 0, False: 1]
  ------------------
28557|      0|        &&  ((tok1 = js_parse_skip_parens_token(s, &skip_bits, FALSE)) == TOK_IN || tok1 == TOK_OF)) {
  ------------------
  |  Branch (28557:14): [True: 0, False: 0]
  |  Branch (28557:85): [True: 0, False: 0]
  ------------------
28558|      0|            if (js_parse_destructuring_element(s, 0, 0, TRUE, skip_bits & SKIP_HAS_ELLIPSIS, TRUE, FALSE) < 0)
  ------------------
  |  |24597|      0|#define SKIP_HAS_ELLIPSIS   (1 << 1)
  ------------------
  |  Branch (28558:17): [True: 0, False: 0]
  ------------------
28559|      0|                return -1;
28560|      1|        } else {
28561|      1|            int lvalue_label;
28562|      1|            if (js_parse_left_hand_side_expr(s))
  ------------------
  |  Branch (28562:17): [True: 0, False: 1]
  ------------------
28563|      0|                return -1;
28564|      1|            if (get_lvalue(s, &opcode, &scope, &var_name, &lvalue_label,
  ------------------
  |  Branch (28564:17): [True: 0, False: 1]
  ------------------
28565|      1|                           NULL, FALSE, TOK_FOR))
28566|      0|                return -1;
28567|      1|            put_lvalue(s, opcode, scope, var_name, lvalue_label,
28568|      1|                       PUT_LVALUE_NOKEEP_BOTTOM, FALSE);
28569|      1|        }
28570|      1|        var_name = JS_ATOM_NULL;
  ------------------
  |  |  449|      1|#define JS_ATOM_NULL 0
  ------------------
28571|      1|    }
28572|     15|    emit_goto(s, OP_goto, label_body);
28573|       |
28574|     15|    pos_expr = s->cur_func->byte_code.size;
28575|     15|    emit_label(s, label_expr);
28576|     15|    if (s->token.val == '=') {
  ------------------
  |  Branch (28576:9): [True: 0, False: 15]
  ------------------
28577|       |        /* XXX: potential scoping issue if inside `with` statement */
28578|      0|        has_initializer = TRUE;
28579|       |        /* parse and evaluate initializer prior to evaluating the
28580|       |           object (only used with "for in" with a non lexical variable
28581|       |           in non strict mode */
28582|      0|        if (next_token(s) || js_parse_assign_expr2(s, 0)) {
  ------------------
  |  Branch (28582:13): [True: 0, False: 0]
  |  Branch (28582:30): [True: 0, False: 0]
  ------------------
28583|      0|            JS_FreeAtom(ctx, var_name);
28584|      0|            return -1;
28585|      0|        }
28586|      0|        if (var_name != JS_ATOM_NULL) {
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (28586:13): [True: 0, False: 0]
  ------------------
28587|      0|            emit_op(s, OP_scope_put_var);
28588|      0|            emit_atom(s, var_name);
28589|      0|            emit_u16(s, fd->scope_level);
28590|      0|        }
28591|      0|    }
28592|     15|    JS_FreeAtom(ctx, var_name);
28593|       |
28594|     15|    if (token_is_pseudo_keyword(s, JS_ATOM_of)) {
  ------------------
  |  Branch (28594:9): [True: 1, False: 14]
  ------------------
28595|      1|        is_for_of = TRUE;
28596|      1|        if (has_initializer)
  ------------------
  |  Branch (28596:13): [True: 0, False: 1]
  ------------------
28597|      0|            goto initializer_error;
28598|     14|    } else if (s->token.val == TOK_IN) {
  ------------------
  |  Branch (28598:16): [True: 14, False: 0]
  ------------------
28599|     14|        if (is_async)
  ------------------
  |  Branch (28599:13): [True: 0, False: 14]
  ------------------
28600|      0|            return js_parse_error(s, "'for await' loop should be used with 'of'");
28601|     14|        if (has_initializer &&
  ------------------
  |  Branch (28601:13): [True: 0, False: 14]
  ------------------
28602|      0|            (tok != TOK_VAR || (fd->js_mode & JS_MODE_STRICT) ||
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (28602:14): [True: 0, False: 0]
  |  Branch (28602:32): [True: 0, False: 0]
  ------------------
28603|      0|             has_destructuring)) {
  ------------------
  |  Branch (28603:14): [True: 0, False: 0]
  ------------------
28604|      0|        initializer_error:
28605|      0|            return js_parse_error(s, "a declaration in the head of a for-%s loop can't have an initializer",
28606|      0|                                  is_for_of ? "of" : "in");
  ------------------
  |  Branch (28606:35): [True: 0, False: 0]
  ------------------
28607|      0|        }
28608|     14|    } else {
28609|      0|        return js_parse_error(s, "expected 'of' or 'in' in for control expression");
28610|      0|    }
28611|     15|    if (next_token(s))
  ------------------
  |  Branch (28611:9): [True: 0, False: 15]
  ------------------
28612|      0|        return -1;
28613|     15|    if (is_for_of) {
  ------------------
  |  Branch (28613:9): [True: 1, False: 14]
  ------------------
28614|      1|        if (js_parse_assign_expr(s))
  ------------------
  |  Branch (28614:13): [True: 0, False: 1]
  ------------------
28615|      0|            return -1;
28616|     14|    } else {
28617|     14|        if (js_parse_expr(s))
  ------------------
  |  Branch (28617:13): [True: 0, False: 14]
  ------------------
28618|      0|            return -1;
28619|     14|    }
28620|       |    /* close the scope after having evaluated the expression so that
28621|       |       the TDZ values are in the closures */
28622|     15|    close_scopes(s, s->cur_func->scope_level, block_scope_level);
28623|     15|    if (is_for_of) {
  ------------------
  |  Branch (28623:9): [True: 1, False: 14]
  ------------------
28624|       |        /* set has_iterator after the iterable expression is parsed so
28625|       |           that a yield in the expression does not try to close a
28626|       |           not-yet-created iterator */
28627|      1|        break_entry.has_iterator = TRUE;
28628|      1|        break_entry.drop_count += 2;
28629|      1|        if (is_async)
  ------------------
  |  Branch (28629:13): [True: 0, False: 1]
  ------------------
28630|      0|            emit_op(s, OP_for_await_of_start);
28631|      1|        else
28632|      1|            emit_op(s, OP_for_of_start);
28633|       |        /* on stack: enum_rec */
28634|     14|    } else {
28635|     14|        emit_op(s, OP_for_in_start);
28636|       |        /* on stack: enum_obj */
28637|     14|    }
28638|     15|    emit_goto(s, OP_goto, label_cont);
28639|       |
28640|     15|    if (js_parse_expect(s, ')'))
  ------------------
  |  Branch (28640:9): [True: 0, False: 15]
  ------------------
28641|      0|        return -1;
28642|       |
28643|     15|    if (OPTIMIZE) {
  ------------------
  |  |   50|     15|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 15, Folded]
  |  |  ------------------
  ------------------
28644|       |        /* move the `next` code here */
28645|     15|        DynBuf *bc = &s->cur_func->byte_code;
28646|     15|        int chunk_size = pos_expr - pos_next;
28647|     15|        int offset = bc->size - pos_next;
28648|     15|        int i;
28649|     15|        dbuf_claim(bc, chunk_size);
28650|     15|        dbuf_put(bc, bc->buf + pos_next, chunk_size);
28651|     15|        memset(bc->buf + pos_next, OP_nop, chunk_size);
28652|       |        /* `next` part ends with a goto */
28653|     15|        s->cur_func->last_opcode_pos = bc->size - 5;
28654|       |        /* relocate labels */
28655|     90|        for (i = label_cont; i < s->cur_func->label_count; i++) {
  ------------------
  |  Branch (28655:30): [True: 75, False: 15]
  ------------------
28656|     75|            LabelSlot *ls = &s->cur_func->label_slots[i];
28657|     75|            if (ls->pos >= pos_next && ls->pos < pos_expr)
  ------------------
  |  Branch (28657:17): [True: 30, False: 45]
  |  Branch (28657:40): [True: 15, False: 15]
  ------------------
28658|     15|                ls->pos += offset;
28659|     75|        }
28660|     15|    }
28661|       |
28662|     15|    emit_label(s, label_body);
28663|     15|    if (js_parse_statement(s))
  ------------------
  |  Branch (28663:9): [True: 2, False: 13]
  ------------------
28664|      2|        return -1;
28665|       |
28666|     13|    close_scopes(s, s->cur_func->scope_level, block_scope_level);
28667|       |
28668|     13|    emit_label(s, label_cont);
28669|     13|    if (is_for_of) {
  ------------------
  |  Branch (28669:9): [True: 1, False: 12]
  ------------------
28670|      1|        if (is_async) {
  ------------------
  |  Branch (28670:13): [True: 0, False: 1]
  ------------------
28671|       |            /* stack: iter_obj next catch_offset */
28672|       |            /* call the next method */
28673|      0|            emit_op(s, OP_for_await_of_next); 
28674|       |            /* get the result of the promise */
28675|      0|            emit_op(s, OP_await);
28676|       |            /* unwrap the value and done values */
28677|      0|            emit_op(s, OP_iterator_get_value_done);
28678|      1|        } else {
28679|      1|            emit_op(s, OP_for_of_next);
28680|      1|            emit_u8(s, 0);
28681|      1|        }
28682|     12|    } else {
28683|     12|        emit_op(s, OP_for_in_next);
28684|     12|    }
28685|       |    /* on stack: enum_rec / enum_obj value bool */
28686|     13|    emit_goto(s, OP_if_false, label_next);
28687|       |    /* drop the undefined value from for_xx_next */
28688|     13|    emit_op(s, OP_drop);
28689|       |
28690|     13|    emit_label(s, label_break);
28691|     13|    if (is_for_of) {
  ------------------
  |  Branch (28691:9): [True: 1, False: 12]
  ------------------
28692|       |        /* close and drop enum_rec */
28693|      1|        emit_op(s, OP_iterator_close);
28694|     12|    } else {
28695|     12|        emit_op(s, OP_drop);
28696|     12|    }
28697|     13|    pop_break_entry(s->cur_func);
28698|     13|    pop_scope(s);
28699|     13|    return 0;
28700|     15|}
quickjs.c:is_let:
28431|     69|{
28432|     69|    int res = FALSE;
28433|     69|    const uint8_t *last_token_ptr;
28434|       |    
28435|     69|    if (token_is_pseudo_keyword(s, JS_ATOM_let)) {
  ------------------
  |  Branch (28435:9): [True: 14, False: 55]
  ------------------
28436|     14|        JSParsePos pos;
28437|     14|        js_parse_get_pos(s, &pos);
28438|     14|        for (;;) {
28439|     14|            last_token_ptr = s->token.ptr;
28440|     14|            if (next_token(s)) {
  ------------------
  |  Branch (28440:17): [True: 0, False: 14]
  ------------------
28441|      0|                res = -1;
28442|      0|                break;
28443|      0|            }
28444|     14|            if (s->token.val == '[') {
  ------------------
  |  Branch (28444:17): [True: 0, False: 14]
  ------------------
28445|       |                /* let [ is a syntax restriction:
28446|       |                   it never introduces an ExpressionStatement */
28447|      0|                res = TRUE;
28448|      0|                break;
28449|      0|            }
28450|     14|            if (s->token.val == '{' ||
  ------------------
  |  Branch (28450:17): [True: 0, False: 14]
  ------------------
28451|     14|                (s->token.val == TOK_IDENT && !s->token.u.ident.is_reserved) ||
  ------------------
  |  Branch (28451:18): [True: 14, False: 0]
  |  Branch (28451:47): [True: 14, False: 0]
  ------------------
28452|      0|                s->token.val == TOK_LET ||
  ------------------
  |  Branch (28452:17): [True: 0, False: 0]
  ------------------
28453|      0|                s->token.val == TOK_YIELD ||
  ------------------
  |  Branch (28453:17): [True: 0, False: 0]
  ------------------
28454|     14|                s->token.val == TOK_AWAIT) {
  ------------------
  |  Branch (28454:17): [True: 0, False: 0]
  ------------------
28455|       |                /* Check for possible ASI if not scanning for Declaration */
28456|       |                /* XXX: should also check that `{` introduces a BindingPattern,
28457|       |                   but Firefox does not and rejects eval("let=1;let\n{if(1)2;}") */
28458|     14|                if (!has_lf_in_range(last_token_ptr, s->token.ptr) ||
  ------------------
  |  Branch (28458:21): [True: 14, False: 0]
  ------------------
28459|     14|                    (decl_mask & DECL_MASK_OTHER)) {
  ------------------
  |  |28298|      0|#define DECL_MASK_OTHER (1 << 2) /* all other declarations */
  ------------------
  |  Branch (28459:21): [True: 0, False: 0]
  ------------------
28460|     14|                    res = TRUE;
28461|     14|                    break;
28462|     14|                }
28463|      0|                break;
28464|     14|            }
28465|      0|            break;
28466|     14|        }
28467|     14|        if (js_parse_seek_token(s, &pos)) {
  ------------------
  |  Branch (28467:13): [True: 0, False: 14]
  ------------------
28468|      0|            res = -1;
28469|      0|        }
28470|     14|    }
28471|     69|    return res;
28472|     69|}
quickjs.c:close_scopes:
23979|     28|{
23980|     56|    while (scope > scope_stop) {
  ------------------
  |  Branch (23980:12): [True: 28, False: 28]
  ------------------
23981|     28|        emit_op(s, OP_leave_scope);
23982|     28|        emit_u16(s, scope);
23983|     28|        scope = s->cur_func->scopes[scope].parent;
23984|     28|    }
23985|     28|}
quickjs.c:emit_atom:
23688|     56|{
23689|     56|    DynBuf *bc = &s->cur_func->byte_code;
23690|     56|    if (dbuf_claim(bc, 4))
  ------------------
  |  Branch (23690:9): [True: 0, False: 56]
  ------------------
23691|      0|        return; /* not enough memory : don't duplicate the atom */
23692|     56|    put_u32(bc->buf + bc->size, JS_DupAtom(s->ctx, name));
23693|     56|    bc->size += 4;
23694|     56|}
quickjs.c:emit_return:
28207|     27|{
28208|     27|    BlockEnv *top;
28209|       |
28210|     27|    if (s->cur_func->func_kind != JS_FUNC_NORMAL) {
  ------------------
  |  Branch (28210:9): [True: 14, False: 13]
  ------------------
28211|     14|        if (!hasval) {
  ------------------
  |  Branch (28211:13): [True: 14, False: 0]
  ------------------
28212|       |            /* no value: direct return in case of async generator */
28213|     14|            emit_op(s, OP_undefined);
28214|     14|            hasval = TRUE;
28215|     14|        } else if (s->cur_func->func_kind == JS_FUNC_ASYNC_GENERATOR) {
  ------------------
  |  Branch (28215:20): [True: 0, False: 0]
  ------------------
28216|       |            /* the await must be done before handling the "finally" in
28217|       |               case it raises an exception */
28218|      0|            emit_op(s, OP_await);
28219|      0|        }
28220|     14|    }
28221|       |
28222|     27|    top = s->cur_func->top_break;
28223|     27|    while (top != NULL) {
  ------------------
  |  Branch (28223:12): [True: 0, False: 27]
  ------------------
28224|      0|        if (top->has_iterator || top->label_finally != -1) {
  ------------------
  |  Branch (28224:13): [True: 0, False: 0]
  |  Branch (28224:34): [True: 0, False: 0]
  ------------------
28225|      0|            if (!hasval) {
  ------------------
  |  Branch (28225:17): [True: 0, False: 0]
  ------------------
28226|      0|                emit_op(s, OP_undefined);
28227|      0|                hasval = TRUE;
28228|      0|            }
28229|       |            /* Remove the stack elements up to and including the catch
28230|       |               offset. When 'yield' is used in an expression we have
28231|       |               no easy way to count them, so we use this specific
28232|       |               instruction instead. */
28233|      0|            emit_op(s, OP_nip_catch);
28234|       |            /* stack: iter_obj next ret_val */
28235|      0|            if (top->has_iterator) {
  ------------------
  |  Branch (28235:17): [True: 0, False: 0]
  ------------------
28236|      0|                if (s->cur_func->func_kind == JS_FUNC_ASYNC_GENERATOR) {
  ------------------
  |  Branch (28236:21): [True: 0, False: 0]
  ------------------
28237|      0|                    int label_next, label_next2;
28238|      0|                    emit_op(s, OP_nip); /* next */
28239|      0|                    emit_op(s, OP_swap);
28240|      0|                    emit_op(s, OP_get_field2);
28241|      0|                    emit_atom(s, JS_ATOM_return);
28242|       |                    /* stack: iter_obj return_func */
28243|      0|                    emit_op(s, OP_dup);
28244|      0|                    emit_op(s, OP_is_undefined_or_null);
28245|      0|                    label_next = emit_goto(s, OP_if_true, -1);
28246|      0|                    emit_op(s, OP_call_method);
28247|      0|                    emit_u16(s, 0);
28248|      0|                    emit_op(s, OP_iterator_check_object);
28249|      0|                    emit_op(s, OP_await);
28250|      0|                    label_next2 = emit_goto(s, OP_goto, -1);
28251|      0|                    emit_label(s, label_next);
28252|      0|                    emit_op(s, OP_drop);
28253|      0|                    emit_label(s, label_next2);
28254|      0|                    emit_op(s, OP_drop);
28255|      0|                } else {
28256|      0|                    emit_op(s, OP_rot3r);
28257|      0|                    emit_op(s, OP_undefined); /* dummy catch offset */
28258|      0|                    emit_op(s, OP_iterator_close);
28259|      0|                }
28260|      0|            } else {
28261|       |                /* execute the "finally" block */
28262|      0|                emit_goto(s, OP_gosub, top->label_finally);
28263|      0|            }
28264|      0|        }
28265|      0|        top = top->prev;
28266|      0|    }
28267|     27|    if (s->cur_func->is_derived_class_constructor) {
  ------------------
  |  Branch (28267:9): [True: 0, False: 27]
  ------------------
28268|      0|        int label_return;
28269|       |
28270|       |        /* 'this' can be uninitialized, so it may be accessed only if
28271|       |           the derived class constructor does not return an object */
28272|      0|        if (hasval) {
  ------------------
  |  Branch (28272:13): [True: 0, False: 0]
  ------------------
28273|      0|            emit_op(s, OP_check_ctor_return);
28274|      0|            label_return = emit_goto(s, OP_if_false, -1);
28275|      0|            emit_op(s, OP_drop);
28276|      0|        } else {
28277|      0|            label_return = -1;
28278|      0|        }
28279|       |
28280|       |        /* The error should be raised in the caller context, so we use
28281|       |           a specific opcode */
28282|      0|        emit_op(s, OP_scope_get_var_checkthis);
28283|      0|        emit_atom(s, JS_ATOM_this);
28284|      0|        emit_u16(s, 0);
28285|       |
28286|      0|        emit_label(s, label_return);
28287|      0|        emit_op(s, OP_return);
28288|     27|    } else if (s->cur_func->func_kind != JS_FUNC_NORMAL) {
  ------------------
  |  Branch (28288:16): [True: 14, False: 13]
  ------------------
28289|     14|        emit_op(s, OP_return_async);
28290|     14|    } else {
28291|     13|        emit_op(s, hasval ? OP_return : OP_return_undef);
  ------------------
  |  Branch (28291:20): [True: 12, False: 1]
  ------------------
28292|     13|    }
28293|     27|}
quickjs.c:js_free_function_def:
31972|      5|{
31973|      5|    int i;
31974|      5|    struct list_head *el, *el1;
31975|       |
31976|       |    /* free the child functions */
31977|      5|    list_for_each_safe(el, el1, &fd->child_list) {
  ------------------
  |  |   89|      6|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 1, False: 5]
  |  |  ------------------
  |  |   90|      5|        el = el1, el1 = el->next)
  ------------------
31978|      1|        JSFunctionDef *fd1;
31979|      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)))
  |  |  ------------------
  ------------------
31980|      1|        js_free_function_def(ctx, fd1);
31981|      1|    }
31982|       |
31983|      5|    free_bytecode_atoms(ctx->rt, fd->byte_code.buf, fd->byte_code.size,
31984|      5|                        fd->use_short_opcodes);
31985|      5|    dbuf_free(&fd->byte_code);
31986|      5|    js_free(ctx, fd->jump_slots);
31987|      5|    js_free(ctx, fd->label_slots);
31988|      5|    js_free(ctx, fd->line_number_slots);
31989|       |
31990|      6|    for(i = 0; i < fd->cpool_count; i++) {
  ------------------
  |  Branch (31990:16): [True: 1, False: 5]
  ------------------
31991|      1|        JS_FreeValue(ctx, fd->cpool[i]);
31992|      1|    }
31993|      5|    js_free(ctx, fd->cpool);
31994|       |
31995|      5|    JS_FreeAtom(ctx, fd->func_name);
31996|       |
31997|     21|    for(i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (31997:16): [True: 16, False: 5]
  ------------------
31998|     16|        JS_FreeAtom(ctx, fd->vars[i].var_name);
31999|     16|    }
32000|      5|    js_free(ctx, fd->vars);
32001|      9|    for(i = 0; i < fd->arg_count; i++) {
  ------------------
  |  Branch (32001:16): [True: 4, False: 5]
  ------------------
32002|      4|        JS_FreeAtom(ctx, fd->args[i].var_name);
32003|      4|    }
32004|      5|    js_free(ctx, fd->args);
32005|       |
32006|      6|    for(i = 0; i < fd->global_var_count; i++) {
  ------------------
  |  Branch (32006:16): [True: 1, False: 5]
  ------------------
32007|      1|        JS_FreeAtom(ctx, fd->global_vars[i].var_name);
32008|      1|    }
32009|      5|    js_free(ctx, fd->global_vars);
32010|       |
32011|      5|    for(i = 0; i < fd->closure_var_count; i++) {
  ------------------
  |  Branch (32011:16): [True: 0, False: 5]
  ------------------
32012|      0|        JSClosureVar *cv = &fd->closure_var[i];
32013|      0|        JS_FreeAtom(ctx, cv->var_name);
32014|      0|    }
32015|      5|    js_free(ctx, fd->closure_var);
32016|       |
32017|      5|    if (fd->scopes != fd->def_scope_array)
  ------------------
  |  Branch (32017:9): [True: 2, False: 3]
  ------------------
32018|      2|        js_free(ctx, fd->scopes);
32019|       |
32020|      5|    JS_FreeAtom(ctx, fd->filename);
32021|      5|    dbuf_free(&fd->pc2line);
32022|       |
32023|      5|    js_free(ctx, fd->source);
32024|       |
32025|      5|    if (fd->parent) {
  ------------------
  |  Branch (32025:9): [True: 3, False: 2]
  ------------------
32026|       |        /* remove in parent list */
32027|      3|        list_del(&fd->link);
32028|      3|    }
32029|      5|    js_free(ctx, fd);
32030|      5|}
quickjs.c:js_create_function:
35829|     28|{
35830|     28|    JSValue func_obj;
35831|     28|    JSFunctionBytecode *b;
35832|     28|    struct list_head *el, *el1;
35833|     28|    int stack_size, scope, idx;
35834|     28|    int function_size, byte_code_offset, cpool_offset;
35835|     28|    int closure_var_offset, vardefs_offset;
35836|     28|    BOOL strip_var_debug;
35837|       |    
35838|       |    /* recompute scope linkage */
35839|     89|    for (scope = 0; scope < fd->scope_count; scope++) {
  ------------------
  |  Branch (35839:21): [True: 61, False: 28]
  ------------------
35840|     61|        fd->scopes[scope].first = -1;
35841|     61|    }
35842|     28|    if (fd->has_parameter_expressions) {
  ------------------
  |  Branch (35842:9): [True: 2, False: 26]
  ------------------
35843|       |        /* special end of variable list marker for the argument scope */
35844|      2|        fd->scopes[ARG_SCOPE_INDEX].first = ARG_SCOPE_END;
  ------------------
  |  |  627|      2|#define ARG_SCOPE_INDEX 1
  ------------------
                      fd->scopes[ARG_SCOPE_INDEX].first = ARG_SCOPE_END;
  ------------------
  |  |  628|      2|#define ARG_SCOPE_END (-2)
  ------------------
35845|      2|    }
35846|     48|    for (idx = 0; idx < fd->var_count; idx++) {
  ------------------
  |  Branch (35846:19): [True: 20, False: 28]
  ------------------
35847|     20|        JSVarDef *vd = &fd->vars[idx];
35848|     20|        vd->scope_next = fd->scopes[vd->scope_level].first;
35849|     20|        fd->scopes[vd->scope_level].first = idx;
35850|     20|    }
35851|     33|    for (scope = 2; scope < fd->scope_count; scope++) {
  ------------------
  |  Branch (35851:21): [True: 5, False: 28]
  ------------------
35852|      5|        JSVarScope *sd = &fd->scopes[scope];
35853|      5|        if (sd->first < 0)
  ------------------
  |  Branch (35853:13): [True: 3, False: 2]
  ------------------
35854|      3|            sd->first = fd->scopes[sd->parent].first;
35855|      5|    }
35856|     48|    for (idx = 0; idx < fd->var_count; idx++) {
  ------------------
  |  Branch (35856:19): [True: 20, False: 28]
  ------------------
35857|     20|        JSVarDef *vd = &fd->vars[idx];
35858|     20|        if (vd->scope_next < 0 && vd->scope_level > 1) {
  ------------------
  |  Branch (35858:13): [True: 18, False: 2]
  |  Branch (35858:35): [True: 2, False: 16]
  ------------------
35859|      2|            scope = fd->scopes[vd->scope_level].parent;
35860|      2|            vd->scope_next = fd->scopes[scope].first;
35861|      2|        }
35862|     20|    }
35863|       |
35864|       |    /* if the function contains an eval call, the closure variables
35865|       |       are used to compile the eval and they must be ordered by scope,
35866|       |       so it is necessary to create the closure variables before any
35867|       |       other variable lookup is done. */
35868|     28|    if (fd->has_eval_call)
  ------------------
  |  Branch (35868:9): [True: 0, False: 28]
  ------------------
35869|      0|        add_eval_variables(ctx, fd);
35870|       |
35871|       |    /* add the module global variables in the closure */
35872|     28|    if (fd->is_eval) {
  ------------------
  |  Branch (35872:9): [True: 26, False: 2]
  ------------------
35873|     26|        if (add_global_variables(ctx, fd))
  ------------------
  |  Branch (35873:13): [True: 0, False: 26]
  ------------------
35874|      0|            goto fail;
35875|     26|    } 
35876|       |
35877|       |    /* first create all the child functions */
35878|     28|    list_for_each_safe(el, el1, &fd->child_list) {
  ------------------
  |  |   89|     30|    for(el = (head)->next, el1 = el->next; el != (head); \
  |  |  ------------------
  |  |  |  Branch (89:44): [True: 2, False: 28]
  |  |  ------------------
  |  |   90|     28|        el = el1, el1 = el->next)
  ------------------
35879|      2|        JSFunctionDef *fd1;
35880|      2|        int cpool_idx;
35881|       |
35882|      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)))
  |  |  ------------------
  ------------------
35883|      2|        cpool_idx = fd1->parent_cpool_idx;
35884|      2|        func_obj = js_create_function(ctx, fd1);
35885|      2|        if (JS_IsException(func_obj))
  ------------------
  |  Branch (35885:13): [True: 0, False: 2]
  ------------------
35886|      0|            goto fail;
35887|       |        /* save it in the constant pool */
35888|      2|        assert(cpool_idx >= 0);
  ------------------
  |  Branch (35888:9): [True: 0, False: 2]
  |  Branch (35888:9): [True: 2, False: 0]
  ------------------
35889|      2|        fd->cpool[cpool_idx] = func_obj;
35890|      2|    }
35891|       |
35892|       |#if defined(DUMP_BYTECODE) && (DUMP_BYTECODE & 4)
35893|       |    if (!fd->strip_debug) {
35894|       |        printf("pass 1\n");
35895|       |        dump_byte_code(ctx, 1, fd->byte_code.buf, fd->byte_code.size,
35896|       |                       NULL, fd->args, fd->arg_count, fd->vars, fd->var_count,
35897|       |                       fd->closure_var, fd->closure_var_count,
35898|       |                       fd->cpool, fd->cpool_count, fd->source,
35899|       |                       fd->label_slots, NULL);
35900|       |        printf("\n");
35901|       |    }
35902|       |#endif
35903|       |
35904|     28|    if (resolve_variables(ctx, fd))
  ------------------
  |  Branch (35904:9): [True: 0, False: 28]
  ------------------
35905|      0|        goto fail;
35906|       |
35907|       |#if defined(DUMP_BYTECODE) && (DUMP_BYTECODE & 2)
35908|       |    if (!fd->strip_debug) {
35909|       |        printf("pass 2\n");
35910|       |        dump_byte_code(ctx, 2, fd->byte_code.buf, fd->byte_code.size,
35911|       |                       NULL, fd->args, fd->arg_count, fd->vars, fd->var_count,
35912|       |                       fd->closure_var, fd->closure_var_count,
35913|       |                       fd->cpool, fd->cpool_count, fd->source,
35914|       |                       fd->label_slots, NULL);
35915|       |        printf("\n");
35916|       |    }
35917|       |#endif
35918|       |
35919|     28|    if (resolve_labels(ctx, fd))
  ------------------
  |  Branch (35919:9): [True: 0, False: 28]
  ------------------
35920|      0|        goto fail;
35921|       |
35922|     28|    if (compute_stack_size(ctx, fd, &stack_size) < 0)
  ------------------
  |  Branch (35922:9): [True: 0, False: 28]
  ------------------
35923|      0|        goto fail;
35924|       |
35925|     28|    if (fd->strip_debug) {
  ------------------
  |  Branch (35925:9): [True: 0, False: 28]
  ------------------
35926|      0|        function_size = offsetof(JSFunctionBytecode, debug);
35927|     28|    } else {
35928|     28|        function_size = sizeof(*b);
35929|     28|    }
35930|     28|    cpool_offset = function_size;
35931|     28|    function_size += fd->cpool_count * sizeof(*fd->cpool);
35932|     28|    vardefs_offset = function_size;
35933|     28|    function_size += (fd->arg_count + fd->var_count) * sizeof(*b->vardefs);
35934|     28|    closure_var_offset = function_size;
35935|     28|    function_size += fd->closure_var_count * sizeof(*fd->closure_var);
35936|     28|    byte_code_offset = function_size;
35937|     28|    function_size += fd->byte_code.size;
35938|       |
35939|     28|    b = js_mallocz(ctx, function_size);
35940|     28|    if (!b)
  ------------------
  |  Branch (35940:9): [True: 0, False: 28]
  ------------------
35941|      0|        goto fail;
35942|     28|    js_rc(b)->ref_count = 1;
35943|       |
35944|     28|    b->byte_code_buf = (void *)((uint8_t*)b + byte_code_offset);
35945|     28|    b->byte_code_len = fd->byte_code.size;
35946|     28|    memcpy(b->byte_code_buf, fd->byte_code.buf, fd->byte_code.size);
35947|     28|    js_free(ctx, fd->byte_code.buf);
35948|     28|    fd->byte_code.buf = NULL;
35949|       |
35950|     28|    strip_var_debug = fd->strip_debug && !fd->has_eval_call; /* XXX: check */
  ------------------
  |  Branch (35950:23): [True: 0, False: 28]
  |  Branch (35950:42): [True: 0, False: 0]
  ------------------
35951|     28|    b->func_name = fd->func_name;
35952|     28|    if (fd->arg_count + fd->var_count > 0) {
  ------------------
  |  Branch (35952:9): [True: 14, False: 14]
  ------------------
35953|     14|        int i;
35954|     14|        b->vardefs = (void *)((uint8_t*)b + vardefs_offset);
35955|     18|        for(i = 0; i < fd->arg_count; i++) {
  ------------------
  |  Branch (35955:20): [True: 4, False: 14]
  ------------------
35956|      4|            JSVarDef *vd = &fd->args[i];
35957|      4|            JSBytecodeVarDef *vd1 = &b->vardefs[i];
35958|      4|            if (strip_var_debug) {
  ------------------
  |  Branch (35958:17): [True: 0, False: 4]
  ------------------
35959|      0|                JS_FreeAtom(ctx, vd->var_name);
35960|      0|                vd1->var_name = JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
35961|      4|            } else {
35962|      4|                vd1->var_name = vd->var_name;
35963|      4|            }
35964|      4|            vd1->has_scope = (vd->scope_level != 0);
35965|      4|            vd1->scope_next = vd->scope_next;
35966|      4|            vd1->is_const = vd->is_const;
35967|      4|            vd1->is_lexical = vd->is_lexical;
35968|      4|            vd1->is_captured = vd->is_captured;
35969|      4|            vd1->var_kind = vd->var_kind;
35970|      4|            vd1->var_ref_idx = vd->var_ref_idx;
35971|      4|        }
35972|       |        
35973|     34|        for(i = 0; i < fd->var_count; i++) {
  ------------------
  |  Branch (35973:20): [True: 20, False: 14]
  ------------------
35974|     20|            JSVarDef *vd = &fd->vars[i];
35975|     20|            JSBytecodeVarDef *vd1 = &b->vardefs[i + fd->arg_count];
35976|     20|            if (strip_var_debug) {
  ------------------
  |  Branch (35976:17): [True: 0, False: 20]
  ------------------
35977|      0|                JS_FreeAtom(ctx, vd->var_name);
35978|      0|                vd1->var_name = JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
35979|     20|            } else {
35980|     20|                vd1->var_name = vd->var_name;
35981|     20|            }
35982|     20|            vd1->has_scope = (vd->scope_level != 0);
35983|     20|            vd1->scope_next = vd->scope_next;
35984|     20|            vd1->is_const = vd->is_const;
35985|     20|            vd1->is_lexical = vd->is_lexical;
35986|     20|            vd1->is_captured = vd->is_captured;
35987|     20|            vd1->var_kind = vd->var_kind;
35988|     20|            vd1->var_ref_idx = vd->var_ref_idx;
35989|     20|        }
35990|     14|        b->var_count = fd->var_count;
35991|     14|        b->arg_count = fd->arg_count;
35992|     14|        b->defined_arg_count = fd->defined_arg_count;
35993|     14|        b->var_ref_count = fd->var_ref_count;
35994|     14|        js_free(ctx, fd->args);
35995|     14|        js_free(ctx, fd->vars);
35996|     14|    }
35997|     28|    b->cpool_count = fd->cpool_count;
35998|     28|    if (b->cpool_count) {
  ------------------
  |  Branch (35998:9): [True: 10, False: 18]
  ------------------
35999|     10|        b->cpool = (void *)((uint8_t*)b + cpool_offset);
36000|     10|        memcpy(b->cpool, fd->cpool, b->cpool_count * sizeof(*b->cpool));
36001|     10|    }
36002|     28|    js_free(ctx, fd->cpool);
36003|     28|    fd->cpool = NULL;
36004|       |
36005|     28|    b->stack_size = stack_size;
36006|       |
36007|     28|    if (fd->strip_debug) {
  ------------------
  |  Branch (36007:9): [True: 0, False: 28]
  ------------------
36008|      0|        JS_FreeAtom(ctx, fd->filename);
36009|      0|        dbuf_free(&fd->pc2line);    // probably useless
36010|     28|    } else {
36011|       |        /* XXX: source and pc2line info should be packed at the end of the
36012|       |           JSFunctionBytecode structure, avoiding allocation overhead
36013|       |         */
36014|     28|        b->has_debug = 1;
36015|     28|        b->debug.filename = fd->filename;
36016|       |
36017|       |        //DynBuf pc2line;
36018|       |        //compute_pc2line_info(fd, &pc2line);
36019|       |        //js_free(ctx, fd->line_number_slots)
36020|     28|        b->debug.pc2line_buf = js_realloc(ctx, fd->pc2line.buf, fd->pc2line.size);
36021|     28|        if (!b->debug.pc2line_buf)
  ------------------
  |  Branch (36021:13): [True: 0, False: 28]
  ------------------
36022|      0|            b->debug.pc2line_buf = fd->pc2line.buf;
36023|     28|        b->debug.pc2line_len = fd->pc2line.size;
36024|     28|        b->debug.source = fd->source;
36025|     28|        b->debug.source_len = fd->source_len;
36026|     28|    }
36027|     28|    if (fd->scopes != fd->def_scope_array)
  ------------------
  |  Branch (36027:9): [True: 0, False: 28]
  ------------------
36028|      0|        js_free(ctx, fd->scopes);
36029|       |
36030|     28|    b->closure_var_count = fd->closure_var_count;
36031|     28|    if (b->closure_var_count) {
  ------------------
  |  Branch (36031:9): [True: 26, False: 2]
  ------------------
36032|     26|        if (strip_var_debug) {
  ------------------
  |  Branch (36032:13): [True: 0, False: 26]
  ------------------
36033|      0|            int i;
36034|      0|            for(i = 0; i < fd->closure_var_count; i++) {
  ------------------
  |  Branch (36034:24): [True: 0, False: 0]
  ------------------
36035|      0|                JSClosureVar *cv = &fd->closure_var[i];
36036|      0|                if (cv->closure_type != JS_CLOSURE_GLOBAL_REF &&
  ------------------
  |  Branch (36036:21): [True: 0, False: 0]
  ------------------
36037|      0|                    cv->closure_type != JS_CLOSURE_GLOBAL_DECL &&
  ------------------
  |  Branch (36037:21): [True: 0, False: 0]
  ------------------
36038|      0|                    cv->closure_type != JS_CLOSURE_GLOBAL &&
  ------------------
  |  Branch (36038:21): [True: 0, False: 0]
  ------------------
36039|      0|                    cv->closure_type != JS_CLOSURE_MODULE_DECL &&
  ------------------
  |  Branch (36039:21): [True: 0, False: 0]
  ------------------
36040|      0|                    cv->closure_type != JS_CLOSURE_MODULE_IMPORT) {
  ------------------
  |  Branch (36040:21): [True: 0, False: 0]
  ------------------
36041|      0|                    JS_FreeAtom(ctx, cv->var_name);
36042|      0|                    cv->var_name = JS_ATOM_NULL;
  ------------------
  |  |  449|      0|#define JS_ATOM_NULL 0
  ------------------
36043|      0|                }
36044|      0|            }
36045|      0|        }
36046|     26|        b->closure_var = (void *)((uint8_t*)b + closure_var_offset);
36047|     26|        memcpy(b->closure_var, fd->closure_var, b->closure_var_count * sizeof(*b->closure_var));
36048|     26|    }
36049|     28|    js_free(ctx, fd->closure_var);
36050|     28|    fd->closure_var = NULL;
36051|       |
36052|     28|    b->has_prototype = fd->has_prototype;
36053|     28|    b->has_simple_parameter_list = fd->has_simple_parameter_list;
36054|     28|    b->js_mode = fd->js_mode;
36055|     28|    b->is_derived_class_constructor = fd->is_derived_class_constructor;
36056|     28|    b->func_kind = fd->func_kind;
36057|     28|    b->need_home_object = (fd->home_object_var_idx >= 0 ||
  ------------------
  |  Branch (36057:28): [True: 0, False: 28]
  ------------------
36058|     28|                           fd->need_home_object);
  ------------------
  |  Branch (36058:28): [True: 0, False: 28]
  ------------------
36059|     28|    b->new_target_allowed = fd->new_target_allowed;
36060|     28|    b->super_call_allowed = fd->super_call_allowed;
36061|     28|    b->super_allowed = fd->super_allowed;
36062|     28|    b->arguments_allowed = fd->arguments_allowed;
36063|     28|    b->is_direct_or_indirect_eval = (fd->eval_type == JS_EVAL_TYPE_DIRECT ||
  ------------------
  |  |  332|     56|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
  |  Branch (36063:38): [True: 0, False: 28]
  ------------------
36064|     28|                                     fd->eval_type == JS_EVAL_TYPE_INDIRECT);
  ------------------
  |  |  333|     28|#define JS_EVAL_TYPE_INDIRECT (3 << 0) /* indirect call (internal use) */
  ------------------
  |  Branch (36064:38): [True: 0, False: 28]
  ------------------
36065|     28|    b->realm = JS_DupContext(ctx);
36066|       |
36067|     28|    add_gc_object(ctx->rt, &b->header, JS_GC_OBJ_TYPE_FUNCTION_BYTECODE);
36068|       |
36069|       |#if defined(DUMP_BYTECODE) && (DUMP_BYTECODE & 1)
36070|       |    if (!fd->strip_debug) {
36071|       |        js_dump_function_bytecode(ctx, b);
36072|       |    }
36073|       |#endif
36074|       |
36075|     28|    if (fd->parent) {
  ------------------
  |  Branch (36075:9): [True: 2, False: 26]
  ------------------
36076|       |        /* remove from parent list */
36077|      2|        list_del(&fd->link);
36078|      2|    }
36079|       |
36080|     28|    js_free(ctx, fd);
36081|     28|    return JS_MKPTR(JS_TAG_FUNCTION_BYTECODE, b);
  ------------------
  |  |  246|     28|#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
  ------------------
36082|      0| fail:
36083|      0|    js_free_function_def(ctx, fd);
36084|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
36085|     28|}
quickjs.c:get_closure_var:
32545|      8|{
32546|      8|    int i;
32547|       |
32548|      8|    if (fd != s->parent) {
  ------------------
  |  Branch (32548:9): [True: 3, False: 5]
  ------------------
32549|      3|        var_idx = get_closure_var(ctx, s->parent, fd, closure_type,
32550|      3|                                  var_idx, var_name,
32551|      3|                                  is_const, is_lexical, var_kind);
32552|      3|        if (var_idx < 0)
  ------------------
  |  Branch (32552:13): [True: 0, False: 3]
  ------------------
32553|      0|            return -1;
32554|      3|        if (closure_type != JS_CLOSURE_GLOBAL_REF)
  ------------------
  |  Branch (32554:13): [True: 0, False: 3]
  ------------------
32555|      0|            closure_type = JS_CLOSURE_REF;
32556|      3|    }
32557|     17|    for(i = 0; i < s->closure_var_count; i++) {
  ------------------
  |  Branch (32557:16): [True: 10, False: 7]
  ------------------
32558|     10|        JSClosureVar *cv = &s->closure_var[i];
32559|     10|        if (cv->var_idx == var_idx && cv->closure_type == closure_type)
  ------------------
  |  Branch (32559:13): [True: 1, False: 9]
  |  Branch (32559:39): [True: 1, False: 0]
  ------------------
32560|      1|            return i;
32561|     10|    }
32562|      7|    return add_closure_var(ctx, s, closure_type, var_idx, var_name,
32563|      7|                           is_const, is_lexical, var_kind);
32564|      8|}
quickjs.c:add_global_variables:
35759|     26|{
35760|     26|    int i, idx;
35761|     26|    JSModuleDef *m = fd->module;
35762|     26|    JSExportEntry *me;
35763|     26|    JSGlobalVar *hf;
35764|     26|    BOOL need_global_closures;
35765|       |    
35766|       |    /* Script: add the defined global variables. In the non strict
35767|       |       direct eval not in global scope, the global variables are
35768|       |       created in the enclosing scope so they are not created as
35769|       |       variable references.
35770|       |
35771|       |       In modules, the imported global variables were added as closure
35772|       |       global variables in js_parse_import().
35773|       |    */
35774|     26|    need_global_closures = TRUE;
35775|     26|    if (fd->eval_type == JS_EVAL_TYPE_DIRECT && !(fd->js_mode & JS_MODE_STRICT)) {
  ------------------
  |  |  332|     52|#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)) {
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (35775:9): [True: 0, False: 26]
  |  Branch (35775:49): [True: 0, False: 0]
  ------------------
35776|       |        /* XXX: add a flag ? */
35777|      0|        for(idx = 0; idx < fd->closure_var_count; idx++) {
  ------------------
  |  Branch (35777:22): [True: 0, False: 0]
  ------------------
35778|      0|            JSClosureVar *cv = &fd->closure_var[idx];
35779|      0|            if (cv->var_name == JS_ATOM__var_ ||
  ------------------
  |  Branch (35779:17): [True: 0, False: 0]
  ------------------
35780|      0|                cv->var_name == JS_ATOM__arg_var_) {
  ------------------
  |  Branch (35780:17): [True: 0, False: 0]
  ------------------
35781|      0|                need_global_closures = FALSE;
35782|      0|                break;
35783|      0|            }
35784|      0|        }
35785|      0|    }
35786|       |
35787|     26|    if (need_global_closures) {
  ------------------
  |  Branch (35787:9): [True: 26, False: 0]
  ------------------
35788|     26|        JSClosureTypeEnum closure_type;
35789|     26|        if (fd->module)
  ------------------
  |  Branch (35789:13): [True: 14, False: 12]
  ------------------
35790|     14|            closure_type = JS_CLOSURE_MODULE_DECL;
35791|     12|        else
35792|     12|            closure_type = JS_CLOSURE_GLOBAL_DECL;
35793|     26|        for(i = 0; i < fd->global_var_count; i++) {
  ------------------
  |  Branch (35793:20): [True: 0, False: 26]
  ------------------
35794|      0|            JSVarKindEnum var_kind;
35795|      0|            hf = &fd->global_vars[i];
35796|      0|            if (hf->cpool_idx >= 0 && !hf->is_lexical) {
  ------------------
  |  Branch (35796:17): [True: 0, False: 0]
  |  Branch (35796:39): [True: 0, False: 0]
  ------------------
35797|      0|                var_kind = JS_VAR_GLOBAL_FUNCTION_DECL;
35798|      0|            } else {
35799|      0|                var_kind = JS_VAR_NORMAL;
35800|      0|            }
35801|      0|            if (add_closure_var(ctx, fd, closure_type, i, hf->var_name, hf->is_const,
  ------------------
  |  Branch (35801:17): [True: 0, False: 0]
  ------------------
35802|      0|                                hf->is_lexical, var_kind) < 0)
35803|      0|                return -1;
35804|      0|        }
35805|     26|    }
35806|       |
35807|     26|    if (fd->module) {
  ------------------
  |  Branch (35807:9): [True: 14, False: 12]
  ------------------
35808|       |        /* resolve the variable names of the local exports */
35809|     14|        for(i = 0; i < m->export_entries_count; i++) {
  ------------------
  |  Branch (35809:20): [True: 0, False: 14]
  ------------------
35810|      0|            me = &m->export_entries[i];
35811|      0|            if (me->export_type == JS_EXPORT_TYPE_LOCAL) {
  ------------------
  |  Branch (35811:17): [True: 0, False: 0]
  ------------------
35812|      0|                idx = find_closure_var(ctx, fd, me->local_name);
35813|      0|                if (idx < 0) {
  ------------------
  |  Branch (35813:21): [True: 0, False: 0]
  ------------------
35814|      0|                    JS_ThrowSyntaxErrorAtom(ctx, "exported variable '%s' does not exist",
  ------------------
  |  | 7723|      0|#define JS_ThrowSyntaxErrorAtom(ctx, fmt, atom) __JS_ThrowSyntaxErrorAtom(ctx, atom, fmt, "")
  ------------------
35815|      0|                                            me->local_name);
35816|      0|                    return -1;
35817|      0|                }
35818|      0|                me->u.local.var_idx = idx;
35819|      0|            }
35820|      0|        }
35821|     14|    }
35822|     26|    return 0;
35823|     26|}
quickjs.c:resolve_variables:
33992|     28|{
33993|     28|    int pos, pos_next, bc_len, op, len, line_num, i, idx;
33994|     28|    uint8_t *bc_buf;
33995|     28|    JSAtom var_name;
33996|     28|    DynBuf bc_out;
33997|     28|    CodeContext cc;
33998|     28|    int scope;
33999|       |
34000|     28|    cc.bc_buf = bc_buf = s->byte_code.buf;
34001|     28|    cc.bc_len = bc_len = s->byte_code.size;
34002|     28|    js_dbuf_bytecode_init(ctx, &bc_out);
34003|       |
34004|       |    /* first pass for runtime checks (must be done before the
34005|       |       variables are created) */
34006|       |    /* XXX: inefficient */
34007|     28|    for(i = 0; i < s->global_var_count; i++) {
  ------------------
  |  Branch (34007:16): [True: 0, False: 28]
  ------------------
34008|      0|        JSGlobalVar *hf = &s->global_vars[i];
34009|       |
34010|       |        /* check if global variable (XXX: simplify) */
34011|      0|        for(idx = 0; idx < s->closure_var_count; idx++) {
  ------------------
  |  Branch (34011:22): [True: 0, False: 0]
  ------------------
34012|      0|            JSClosureVar *cv = &s->closure_var[idx];
34013|      0|            if (cv->closure_type == JS_CLOSURE_GLOBAL_REF ||
  ------------------
  |  Branch (34013:17): [True: 0, False: 0]
  ------------------
34014|      0|                cv->closure_type == JS_CLOSURE_GLOBAL_DECL ||
  ------------------
  |  Branch (34014:17): [True: 0, False: 0]
  ------------------
34015|      0|                cv->closure_type == JS_CLOSURE_GLOBAL ||
  ------------------
  |  Branch (34015:17): [True: 0, False: 0]
  ------------------
34016|      0|                cv->closure_type == JS_CLOSURE_MODULE_DECL ||
  ------------------
  |  Branch (34016:17): [True: 0, False: 0]
  ------------------
34017|      0|                cv->closure_type == JS_CLOSURE_MODULE_IMPORT)
  ------------------
  |  Branch (34017:17): [True: 0, False: 0]
  ------------------
34018|      0|                goto next; /* don't look at global variables (they are at the end) */
34019|      0|            if (cv->var_name == hf->var_name) {
  ------------------
  |  Branch (34019:17): [True: 0, False: 0]
  ------------------
34020|      0|                if (s->eval_type == JS_EVAL_TYPE_DIRECT &&
  ------------------
  |  |  332|      0|#define JS_EVAL_TYPE_DIRECT   (2 << 0) /* direct call (internal use) */
  ------------------
  |  Branch (34020:21): [True: 0, False: 0]
  ------------------
34021|      0|                    cv->is_lexical) {
  ------------------
  |  Branch (34021:21): [True: 0, False: 0]
  ------------------
34022|       |                    /* Check if a lexical variable is
34023|       |                       redefined as 'var'. XXX: Could abort
34024|       |                       compilation here, but for consistency
34025|       |                       with the other checks, we delay the
34026|       |                       error generation. */
34027|      0|                    dbuf_putc(&bc_out, OP_throw_error);
34028|      0|                    dbuf_put_u32(&bc_out, JS_DupAtom(ctx, hf->var_name));
34029|      0|                    dbuf_putc(&bc_out, JS_THROW_VAR_REDECL);
  ------------------
  |  |18342|      0|#define JS_THROW_VAR_REDECL         1
  ------------------
34030|      0|                }
34031|      0|                goto next;
34032|      0|            }
34033|      0|            if (cv->var_name == JS_ATOM__var_ ||
  ------------------
  |  Branch (34033:17): [True: 0, False: 0]
  ------------------
34034|      0|                cv->var_name == JS_ATOM__arg_var_)
  ------------------
  |  Branch (34034:17): [True: 0, False: 0]
  ------------------
34035|      0|                goto next;
34036|      0|        }
34037|      0|    next: ;
34038|      0|    }
34039|       |
34040|     28|    line_num = 0; /* avoid warning */
34041|    626|    for (pos = 0; pos < bc_len; pos = pos_next) {
  ------------------
  |  Branch (34041:19): [True: 598, False: 28]
  ------------------
34042|    598|        op = bc_buf[pos];
34043|    598|        len = opcode_info[op].size;
34044|    598|        pos_next = pos + len;
34045|    598|        switch(op) {
34046|    142|        case OP_line_num:
  ------------------
  |  Branch (34046:9): [True: 142, False: 456]
  ------------------
34047|    142|            line_num = get_u32(bc_buf + pos + 1);
34048|    142|            s->line_number_size++;
34049|    142|            goto no_change;
34050|       |
34051|      0|        case OP_eval: /* convert scope index to adjusted variable index */
  ------------------
  |  Branch (34051:9): [True: 0, False: 598]
  ------------------
34052|      0|            {
34053|      0|                int call_argc = get_u16(bc_buf + pos + 1);
34054|      0|                scope = get_u16(bc_buf + pos + 1 + 2);
34055|      0|                mark_eval_captured_variables(ctx, s, scope);
34056|      0|                dbuf_putc(&bc_out, op);
34057|      0|                dbuf_put_u16(&bc_out, call_argc);
34058|      0|                dbuf_put_u16(&bc_out, s->scopes[scope].first - ARG_SCOPE_END);
  ------------------
  |  |  628|      0|#define ARG_SCOPE_END (-2)
  ------------------
34059|      0|            }
34060|      0|            break;
34061|      0|        case OP_apply_eval: /* convert scope index to adjusted variable index */
  ------------------
  |  Branch (34061:9): [True: 0, False: 598]
  ------------------
34062|      0|            scope = get_u16(bc_buf + pos + 1);
34063|      0|            mark_eval_captured_variables(ctx, s, scope);
34064|      0|            dbuf_putc(&bc_out, op);
34065|      0|            dbuf_put_u16(&bc_out, s->scopes[scope].first - ARG_SCOPE_END);
  ------------------
  |  |  628|      0|#define ARG_SCOPE_END (-2)
  ------------------
34066|      0|            break;
34067|      0|        case OP_scope_get_var_checkthis:
  ------------------
  |  Branch (34067:9): [True: 0, False: 598]
  ------------------
34068|      0|        case OP_scope_get_var_undef:
  ------------------
  |  Branch (34068:9): [True: 0, False: 598]
  ------------------
34069|     76|        case OP_scope_get_var:
  ------------------
  |  Branch (34069:9): [True: 76, False: 522]
  ------------------
34070|     89|        case OP_scope_put_var:
  ------------------
  |  Branch (34070:9): [True: 13, False: 585]
  ------------------
34071|     89|        case OP_scope_delete_var:
  ------------------
  |  Branch (34071:9): [True: 0, False: 598]
  ------------------
34072|     89|        case OP_scope_get_ref:
  ------------------
  |  Branch (34072:9): [True: 0, False: 598]
  ------------------
34073|     95|        case OP_scope_put_var_init:
  ------------------
  |  Branch (34073:9): [True: 6, False: 592]
  ------------------
34074|     95|            var_name = get_u32(bc_buf + pos + 1);
34075|     95|            scope = get_u16(bc_buf + pos + 5);
34076|     95|            pos_next = resolve_scope_var(ctx, s, var_name, scope, op, &bc_out,
34077|     95|                                         NULL, NULL, pos_next);
34078|     95|            JS_FreeAtom(ctx, var_name);
34079|     95|            break;
34080|      0|        case OP_scope_make_ref:
  ------------------
  |  Branch (34080:9): [True: 0, False: 598]
  ------------------
34081|      0|            {
34082|      0|                int label;
34083|      0|                LabelSlot *ls;
34084|      0|                var_name = get_u32(bc_buf + pos + 1);
34085|      0|                label = get_u32(bc_buf + pos + 5);
34086|      0|                scope = get_u16(bc_buf + pos + 9);
34087|      0|                ls = &s->label_slots[label];
34088|      0|                ls->ref_count--;  /* always remove label reference */
34089|      0|                pos_next = resolve_scope_var(ctx, s, var_name, scope, op, &bc_out,
34090|      0|                                             bc_buf, ls, pos_next);
34091|      0|                JS_FreeAtom(ctx, var_name);
34092|      0|            }
34093|      0|            break;
34094|      0|        case OP_scope_get_private_field:
  ------------------
  |  Branch (34094:9): [True: 0, False: 598]
  ------------------
34095|      0|        case OP_scope_get_private_field2:
  ------------------
  |  Branch (34095:9): [True: 0, False: 598]
  ------------------
34096|      0|        case OP_scope_put_private_field:
  ------------------
  |  Branch (34096:9): [True: 0, False: 598]
  ------------------
34097|      0|        case OP_scope_in_private_field:
  ------------------
  |  Branch (34097:9): [True: 0, False: 598]
  ------------------
34098|      0|            {
34099|      0|                int ret;
34100|      0|                var_name = get_u32(bc_buf + pos + 1);
34101|      0|                scope = get_u16(bc_buf + pos + 5);
34102|      0|                ret = resolve_scope_private_field(ctx, s, var_name, scope, op, &bc_out);
34103|      0|                if (ret < 0)
  ------------------
  |  Branch (34103:21): [True: 0, False: 0]
  ------------------
34104|      0|                    goto fail;
34105|      0|                JS_FreeAtom(ctx, var_name);
34106|      0|            }
34107|      0|            break;
34108|      0|        case OP_gosub:
  ------------------
  |  Branch (34108:9): [True: 0, False: 598]
  ------------------
34109|      0|            s->jump_size++;
34110|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
34111|       |                /* remove calls to empty finalizers  */
34112|      0|                int label;
34113|      0|                LabelSlot *ls;
34114|       |
34115|      0|                label = get_u32(bc_buf + pos + 1);
34116|      0|                assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34116:17): [True: 0, False: 0]
  |  Branch (34116:17): [True: 0, False: 0]
  |  Branch (34116:17): [True: 0, False: 0]
  |  Branch (34116:17): [True: 0, False: 0]
  ------------------
34117|      0|                ls = &s->label_slots[label];
34118|      0|                if (code_match(&cc, ls->pos, OP_ret, -1)) {
  ------------------
  |  Branch (34118:21): [True: 0, False: 0]
  ------------------
34119|      0|                    ls->ref_count--;
34120|      0|                    break;
34121|      0|                }
34122|      0|            }
34123|      0|            goto no_change;
34124|     41|        case OP_drop:
  ------------------
  |  Branch (34124:9): [True: 41, False: 557]
  ------------------
34125|     41|            if (0) {
  ------------------
  |  Branch (34125:17): [Folded, False: 41]
  ------------------
34126|       |                /* remove drops before return_undef */
34127|       |                /* do not perform this optimization in pass2 because
34128|       |                   it breaks patterns recognised in resolve_labels */
34129|      0|                int pos1 = pos_next;
34130|      0|                int line1 = line_num;
34131|      0|                while (code_match(&cc, pos1, OP_drop, -1)) {
  ------------------
  |  Branch (34131:24): [True: 0, False: 0]
  ------------------
34132|      0|                    if (cc.line_num >= 0) line1 = cc.line_num;
  ------------------
  |  Branch (34132:25): [True: 0, False: 0]
  ------------------
34133|      0|                    pos1 = cc.pos;
34134|      0|                }
34135|      0|                if (code_match(&cc, pos1, OP_return_undef, -1)) {
  ------------------
  |  Branch (34135:21): [True: 0, False: 0]
  ------------------
34136|      0|                    pos_next = pos1;
34137|      0|                    if (line1 != -1 && line1 != line_num) {
  ------------------
  |  Branch (34137:25): [True: 0, False: 0]
  |  Branch (34137:40): [True: 0, False: 0]
  ------------------
34138|      0|                        line_num = line1;
34139|      0|                        s->line_number_size++;
34140|      0|                        dbuf_putc(&bc_out, OP_line_num);
34141|      0|                        dbuf_put_u32(&bc_out, line_num);
34142|      0|                    }
34143|      0|                    break;
34144|      0|                }
34145|      0|            }
34146|     41|            goto no_change;
34147|     41|        case OP_insert3:
  ------------------
  |  Branch (34147:9): [True: 0, False: 598]
  ------------------
34148|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
34149|       |                /* Transformation: insert3 put_array_el|put_ref_value drop -> put_array_el|put_ref_value */
34150|      0|                if (code_match(&cc, pos_next, M2(OP_put_array_el, OP_put_ref_value), OP_drop, -1)) {
  ------------------
  |  |33681|      0|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (34150:21): [True: 0, False: 0]
  ------------------
34151|      0|                    dbuf_putc(&bc_out, cc.op);
34152|      0|                    pos_next = cc.pos;
34153|      0|                    if (cc.line_num != -1 && cc.line_num != line_num) {
  ------------------
  |  Branch (34153:25): [True: 0, False: 0]
  |  Branch (34153:46): [True: 0, False: 0]
  ------------------
34154|      0|                        line_num = cc.line_num;
34155|      0|                        s->line_number_size++;
34156|      0|                        dbuf_putc(&bc_out, OP_line_num);
34157|      0|                        dbuf_put_u32(&bc_out, line_num);
34158|      0|                    }
34159|      0|                    break;
34160|      0|                }
34161|      0|            }
34162|      0|            goto no_change;
34163|       |
34164|     13|        case OP_goto:
  ------------------
  |  Branch (34164:9): [True: 13, False: 585]
  ------------------
34165|     13|            s->jump_size++;
34166|       |            /* fall thru */
34167|     13|        case OP_tail_call:
  ------------------
  |  Branch (34167:9): [True: 0, False: 598]
  ------------------
34168|     13|        case OP_tail_call_method:
  ------------------
  |  Branch (34168:9): [True: 0, False: 598]
  ------------------
34169|     27|        case OP_return:
  ------------------
  |  Branch (34169:9): [True: 14, False: 584]
  ------------------
34170|     27|        case OP_return_undef:
  ------------------
  |  Branch (34170:9): [True: 0, False: 598]
  ------------------
34171|     27|        case OP_throw:
  ------------------
  |  Branch (34171:9): [True: 0, False: 598]
  ------------------
34172|     27|        case OP_throw_error:
  ------------------
  |  Branch (34172:9): [True: 0, False: 598]
  ------------------
34173|     27|        case OP_ret:
  ------------------
  |  Branch (34173:9): [True: 0, False: 598]
  ------------------
34174|     27|            if (OPTIMIZE) {
  ------------------
  |  |   50|     27|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 27, Folded]
  |  |  ------------------
  ------------------
34175|       |                /* remove dead code */
34176|     27|                int line = -1;
34177|     27|                dbuf_put(&bc_out, bc_buf + pos, len);
34178|     27|                pos = skip_dead_code(s, bc_buf, bc_len, pos + len, &line);
34179|     27|                pos_next = pos;
34180|     27|                if (pos < bc_len && line >= 0 && line_num != line) {
  ------------------
  |  Branch (34180:21): [True: 13, False: 14]
  |  Branch (34180:37): [True: 0, False: 13]
  |  Branch (34180:50): [True: 0, False: 0]
  ------------------
34181|      0|                    line_num = line;
34182|      0|                    s->line_number_size++;
34183|      0|                    dbuf_putc(&bc_out, OP_line_num);
34184|      0|                    dbuf_put_u32(&bc_out, line_num);
34185|      0|                }
34186|     27|                break;
34187|     27|            }
34188|      0|            goto no_change;
34189|       |
34190|     23|        case OP_label:
  ------------------
  |  Branch (34190:9): [True: 23, False: 575]
  ------------------
34191|     23|            {
34192|     23|                int label;
34193|     23|                LabelSlot *ls;
34194|       |
34195|     23|                label = get_u32(bc_buf + pos + 1);
34196|     23|                assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34196:17): [True: 0, False: 23]
  |  Branch (34196:17): [True: 0, False: 0]
  |  Branch (34196:17): [True: 23, False: 0]
  |  Branch (34196:17): [True: 23, False: 0]
  ------------------
34197|     23|                ls = &s->label_slots[label];
34198|     23|                ls->pos2 = bc_out.size + opcode_info[op].size;
34199|     23|            }
34200|     23|            goto no_change;
34201|       |
34202|     33|        case OP_enter_scope:
  ------------------
  |  Branch (34202:9): [True: 33, False: 565]
  ------------------
34203|     33|            {
34204|     33|                int scope_idx, scope = get_u16(bc_buf + pos + 1);
34205|       |
34206|     33|                if (scope == s->body_scope) {
  ------------------
  |  Branch (34206:21): [True: 28, False: 5]
  ------------------
34207|     28|                    instantiate_hoisted_definitions(ctx, s, &bc_out);
34208|     28|                }
34209|       |
34210|     39|                for(scope_idx = s->scopes[scope].first; scope_idx >= 0;) {
  ------------------
  |  Branch (34210:57): [True: 8, False: 31]
  ------------------
34211|      8|                    JSVarDef *vd = &s->vars[scope_idx];
34212|      8|                    if (vd->scope_level == scope) {
  ------------------
  |  Branch (34212:25): [True: 6, False: 2]
  ------------------
34213|      6|                        if (scope_idx != s->arguments_arg_idx) {
  ------------------
  |  Branch (34213:29): [True: 6, False: 0]
  ------------------
34214|      6|                            if (vd->var_kind == JS_VAR_FUNCTION_DECL ||
  ------------------
  |  Branch (34214:33): [True: 0, False: 6]
  ------------------
34215|      6|                                vd->var_kind == JS_VAR_NEW_FUNCTION_DECL) {
  ------------------
  |  Branch (34215:33): [True: 0, False: 6]
  ------------------
34216|       |                                /* Initialize lexical variable upon entering scope */
34217|      0|                                dbuf_putc(&bc_out, OP_fclosure);
34218|      0|                                dbuf_put_u32(&bc_out, vd->func_pool_idx);
34219|      0|                                dbuf_putc(&bc_out, OP_put_loc);
34220|      0|                                dbuf_put_u16(&bc_out, scope_idx);
34221|      6|                            } else {
34222|       |                                /* XXX: should check if variable can be used
34223|       |                                   before initialization */
34224|      6|                                dbuf_putc(&bc_out, OP_set_loc_uninitialized);
34225|      6|                                dbuf_put_u16(&bc_out, scope_idx);
34226|      6|                            }
34227|      6|                        }
34228|      6|                        scope_idx = vd->scope_next;
34229|      6|                    } else {
34230|      2|                        break;
34231|      2|                    }
34232|      8|                }
34233|     33|            }
34234|     33|            break;
34235|       |
34236|     11|        case OP_leave_scope:
  ------------------
  |  Branch (34236:9): [True: 11, False: 587]
  ------------------
34237|     11|            {
34238|     11|                int scope_idx, scope = get_u16(bc_buf + pos + 1);
34239|       |
34240|     21|                for(scope_idx = s->scopes[scope].first; scope_idx >= 0;) {
  ------------------
  |  Branch (34240:57): [True: 10, False: 11]
  ------------------
34241|     10|                    JSVarDef *vd = &s->vars[scope_idx];
34242|     10|                    if (vd->scope_level == scope) {
  ------------------
  |  Branch (34242:25): [True: 10, False: 0]
  ------------------
34243|     10|                        if (vd->is_captured) {
  ------------------
  |  Branch (34243:29): [True: 0, False: 10]
  ------------------
34244|      0|                            dbuf_putc(&bc_out, OP_close_loc);
34245|      0|                            dbuf_put_u16(&bc_out, scope_idx);
34246|      0|                        }
34247|     10|                        scope_idx = vd->scope_next;
34248|     10|                    } else {
34249|      0|                        break;
34250|      0|                    }
34251|     10|                }
34252|     11|            }
34253|     11|            break;
34254|       |
34255|      2|        case OP_set_name:
  ------------------
  |  Branch (34255:9): [True: 2, False: 596]
  ------------------
34256|      2|            {
34257|       |                /* remove dummy set_name opcodes */
34258|      2|                JSAtom name = get_u32(bc_buf + pos + 1);
34259|      2|                if (name == JS_ATOM_NULL)
  ------------------
  |  |  449|      2|#define JS_ATOM_NULL 0
  ------------------
  |  Branch (34259:21): [True: 0, False: 2]
  ------------------
34260|      0|                    break;
34261|      2|            }
34262|      2|            goto no_change;
34263|       |
34264|      3|        case OP_if_false:
  ------------------
  |  Branch (34264:9): [True: 3, False: 595]
  ------------------
34265|      5|        case OP_if_true:
  ------------------
  |  Branch (34265:9): [True: 2, False: 596]
  ------------------
34266|      5|        case OP_catch:
  ------------------
  |  Branch (34266:9): [True: 0, False: 598]
  ------------------
34267|      5|            s->jump_size++;
34268|      5|            goto no_change;
34269|       |
34270|     14|        case OP_dup:
  ------------------
  |  Branch (34270:9): [True: 14, False: 584]
  ------------------
34271|     14|            if (OPTIMIZE) {
  ------------------
  |  |   50|     14|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 14, Folded]
  |  |  ------------------
  ------------------
34272|       |                /* Transformation: dup if_false(l1) drop, l1: if_false(l2) -> if_false(l2) */
34273|       |                /* Transformation: dup if_true(l1) drop, l1: if_true(l2) -> if_true(l2) */
34274|     14|                if (code_match(&cc, pos_next, M2(OP_if_false, OP_if_true), OP_drop, -1)) {
  ------------------
  |  |33681|     14|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (34274:21): [True: 0, False: 14]
  ------------------
34275|      0|                    int lab0, lab1, op1, pos1, line1, pos2;
34276|      0|                    lab0 = lab1 = cc.label;
34277|      0|                    assert(lab1 >= 0 && lab1 < s->label_count);
  ------------------
  |  Branch (34277:21): [True: 0, False: 0]
  |  Branch (34277:21): [True: 0, False: 0]
  |  Branch (34277:21): [True: 0, False: 0]
  |  Branch (34277:21): [True: 0, False: 0]
  ------------------
34278|      0|                    op1 = cc.op;
34279|      0|                    pos1 = cc.pos;
34280|      0|                    line1 = cc.line_num;
34281|      0|                    while (code_match(&cc, (pos2 = get_label_pos(s, lab1)), OP_dup, op1, OP_drop, -1)) {
  ------------------
  |  Branch (34281:28): [True: 0, False: 0]
  ------------------
34282|      0|                        lab1 = cc.label;
34283|      0|                    }
34284|      0|                    if (code_match(&cc, pos2, op1, -1)) {
  ------------------
  |  Branch (34284:25): [True: 0, False: 0]
  ------------------
34285|      0|                        s->jump_size++;
34286|      0|                        update_label(s, lab0, -1);
34287|      0|                        update_label(s, cc.label, +1);
34288|      0|                        dbuf_putc(&bc_out, op1);
34289|      0|                        dbuf_put_u32(&bc_out, cc.label);
34290|      0|                        pos_next = pos1;
34291|      0|                        if (line1 != -1 && line1 != line_num) {
  ------------------
  |  Branch (34291:29): [True: 0, False: 0]
  |  Branch (34291:44): [True: 0, False: 0]
  ------------------
34292|      0|                            line_num = line1;
34293|      0|                            s->line_number_size++;
34294|      0|                            dbuf_putc(&bc_out, OP_line_num);
34295|      0|                            dbuf_put_u32(&bc_out, line_num);
34296|      0|                        }
34297|      0|                        break;
34298|      0|                    }
34299|      0|                }
34300|     14|            }
34301|     14|            goto no_change;
34302|       |
34303|     14|        case OP_nop:
  ------------------
  |  Branch (34303:9): [True: 0, False: 598]
  ------------------
34304|       |            /* remove erased code */
34305|      0|            break;
34306|      0|        case OP_set_class_name:
  ------------------
  |  Branch (34306:9): [True: 0, False: 598]
  ------------------
34307|       |            /* only used during parsing */
34308|      0|            break;
34309|       |
34310|      0|        case OP_get_field_opt_chain: /* equivalent to OP_get_field */
  ------------------
  |  Branch (34310:9): [True: 0, False: 598]
  ------------------
34311|      0|            {
34312|      0|                JSAtom name = get_u32(bc_buf + pos + 1);
34313|      0|                dbuf_putc(&bc_out, OP_get_field);
34314|      0|                dbuf_put_u32(&bc_out, name);
34315|      0|            }
34316|      0|            break;
34317|      0|        case OP_get_array_el_opt_chain: /* equivalent to OP_get_array_el */
  ------------------
  |  Branch (34317:9): [True: 0, False: 598]
  ------------------
34318|      0|            dbuf_putc(&bc_out, OP_get_array_el);
34319|      0|            break;
34320|       |
34321|    205|        default:
  ------------------
  |  Branch (34321:9): [True: 205, False: 393]
  ------------------
34322|    432|        no_change:
34323|    432|            dbuf_put(&bc_out, bc_buf + pos, len);
34324|    432|            break;
34325|    598|        }
34326|    598|    }
34327|       |
34328|       |    /* set the new byte code */
34329|     28|    dbuf_free(&s->byte_code);
34330|     28|    s->byte_code = bc_out;
34331|     28|    if (dbuf_error(&s->byte_code)) {
  ------------------
  |  Branch (34331:9): [True: 0, False: 28]
  ------------------
34332|      0|        JS_ThrowOutOfMemory(ctx);
34333|      0|        return -1;
34334|      0|    }
34335|     28|    return 0;
34336|      0| fail:
34337|       |    /* continue the copy to keep the atom refcounts consistent */
34338|       |    /* XXX: find a better solution ? */
34339|      0|    for (; pos < bc_len; pos = pos_next) {
  ------------------
  |  Branch (34339:12): [True: 0, False: 0]
  ------------------
34340|      0|        op = bc_buf[pos];
34341|      0|        len = opcode_info[op].size;
34342|      0|        pos_next = pos + len;
34343|      0|        dbuf_put(&bc_out, bc_buf + pos, len);
34344|      0|    }
34345|      0|    dbuf_free(&s->byte_code);
34346|      0|    s->byte_code = bc_out;
34347|      0|    return -1;
34348|     28|}
quickjs.c:resolve_scope_var:
32724|     95|{
32725|     95|    int idx, var_idx, is_put;
32726|     95|    int label_done;
32727|     95|    JSFunctionDef *fd;
32728|     95|    JSVarDef *vd;
32729|     95|    BOOL is_pseudo_var, is_arg_scope;
32730|       |
32731|     95|    label_done = -1;
32732|       |
32733|       |    /* XXX: could be simpler to use a specific function to
32734|       |       resolve the pseudo variables */
32735|     95|    is_pseudo_var = (var_name == JS_ATOM_home_object ||
  ------------------
  |  Branch (32735:22): [True: 0, False: 95]
  ------------------
32736|     95|                     var_name == JS_ATOM_this_active_func ||
  ------------------
  |  Branch (32736:22): [True: 0, False: 95]
  ------------------
32737|     95|                     var_name == JS_ATOM_new_target ||
  ------------------
  |  Branch (32737:22): [True: 0, False: 95]
  ------------------
32738|     95|                     var_name == JS_ATOM_this);
  ------------------
  |  Branch (32738:22): [True: 0, False: 95]
  ------------------
32739|       |
32740|       |    /* resolve local scoped variables */
32741|     95|    var_idx = -1;
32742|    113|    for (idx = s->scopes[scope_level].first; idx >= 0;) {
  ------------------
  |  Branch (32742:46): [True: 32, False: 81]
  ------------------
32743|     32|        vd = &s->vars[idx];
32744|     32|        if (vd->var_name == var_name) {
  ------------------
  |  Branch (32744:13): [True: 14, False: 18]
  ------------------
32745|     14|            if (op == OP_scope_put_var || op == OP_scope_make_ref) {
  ------------------
  |  Branch (32745:17): [True: 4, False: 10]
  |  Branch (32745:43): [True: 0, False: 10]
  ------------------
32746|      4|                if (vd->is_const) {
  ------------------
  |  Branch (32746:21): [True: 0, False: 4]
  ------------------
32747|      0|                    dbuf_putc(bc, OP_throw_error);
32748|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32749|      0|                    dbuf_putc(bc, JS_THROW_VAR_RO);
  ------------------
  |  |18341|      0|#define JS_THROW_VAR_RO             0
  ------------------
32750|      0|                    goto done;
32751|      0|                }
32752|      4|            }
32753|     14|            var_idx = idx;
32754|     14|            break;
32755|     14|        } else
32756|     18|        if (vd->var_name == JS_ATOM__with_ && !is_pseudo_var) {
  ------------------
  |  Branch (32756:13): [True: 0, False: 18]
  |  Branch (32756:47): [True: 0, False: 0]
  ------------------
32757|      0|            dbuf_putc(bc, OP_get_loc);
32758|      0|            dbuf_put_u16(bc, idx);
32759|      0|            var_object_test(ctx, s, var_name, op, bc, &label_done, 1);
32760|      0|        }
32761|     18|        idx = vd->scope_next;
32762|     18|    }
32763|     95|    is_arg_scope = (idx == ARG_SCOPE_END);
  ------------------
  |  |  628|     95|#define ARG_SCOPE_END (-2)
  ------------------
32764|     95|    if (var_idx < 0) {
  ------------------
  |  Branch (32764:9): [True: 81, False: 14]
  ------------------
32765|       |        /* argument scope: variables are not visible but pseudo
32766|       |           variables are visible */
32767|     81|        if (!is_arg_scope) {
  ------------------
  |  Branch (32767:13): [True: 79, False: 2]
  ------------------
32768|     79|            var_idx = find_var(ctx, s, var_name);
32769|     79|        }
32770|       |
32771|     81|        if (var_idx < 0 && is_pseudo_var)
  ------------------
  |  Branch (32771:13): [True: 76, False: 5]
  |  Branch (32771:28): [True: 0, False: 76]
  ------------------
32772|      0|            var_idx = resolve_pseudo_var(ctx, s, var_name);
32773|       |
32774|     81|        if (var_idx < 0 && var_name == JS_ATOM_arguments &&
  ------------------
  |  Branch (32774:13): [True: 76, False: 5]
  |  Branch (32774:28): [True: 0, False: 76]
  ------------------
32775|      0|            s->has_arguments_binding) {
  ------------------
  |  Branch (32775:13): [True: 0, False: 0]
  ------------------
32776|       |            /* 'arguments' pseudo variable */
32777|      0|            var_idx = add_arguments_var(ctx, s);
32778|      0|        }
32779|     81|        if (var_idx < 0 && s->is_func_expr && var_name == s->func_name) {
  ------------------
  |  Branch (32779:13): [True: 76, False: 5]
  |  Branch (32779:28): [True: 5, False: 71]
  |  Branch (32779:47): [True: 0, False: 5]
  ------------------
32780|       |            /* add a new variable with the function name */
32781|      0|            var_idx = add_func_var(ctx, s, var_name);
32782|      0|        }
32783|     81|    }
32784|     95|    if (var_idx >= 0) {
  ------------------
  |  Branch (32784:9): [True: 19, False: 76]
  ------------------
32785|     19|        if ((op == OP_scope_put_var || op == OP_scope_make_ref) &&
  ------------------
  |  Branch (32785:14): [True: 9, False: 10]
  |  Branch (32785:40): [True: 0, False: 10]
  ------------------
32786|      9|            !(var_idx & ARGUMENT_VAR_OFFSET) &&
  ------------------
  |  |16196|      9|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (32786:13): [True: 4, False: 5]
  ------------------
32787|      4|            s->vars[var_idx].is_const) {
  ------------------
  |  Branch (32787:13): [True: 0, False: 4]
  ------------------
32788|       |            /* only happens when assigning a function expression name
32789|       |               in strict mode */
32790|      0|            dbuf_putc(bc, OP_throw_error);
32791|      0|            dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32792|      0|            dbuf_putc(bc, JS_THROW_VAR_RO);
  ------------------
  |  |18341|      0|#define JS_THROW_VAR_RO             0
  ------------------
32793|      0|            goto done;
32794|      0|        }
32795|       |        /* OP_scope_put_var_init is only used to initialize a
32796|       |           lexical variable, so it is never used in a with or var object. It
32797|       |           can be used with a closure (module global variable case). */
32798|     19|        switch (op) {
  ------------------
  |  Branch (32798:17): [True: 19, False: 0]
  ------------------
32799|      0|        case OP_scope_make_ref:
  ------------------
  |  Branch (32799:9): [True: 0, False: 19]
  ------------------
32800|      0|            if (!(var_idx & ARGUMENT_VAR_OFFSET) &&
  ------------------
  |  |16196|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (32800:17): [True: 0, False: 0]
  ------------------
32801|      0|                s->vars[var_idx].var_kind == JS_VAR_FUNCTION_NAME) {
  ------------------
  |  Branch (32801:17): [True: 0, False: 0]
  ------------------
32802|       |                /* Create a dummy object reference for the func_var */
32803|      0|                dbuf_putc(bc, OP_object);
32804|      0|                dbuf_putc(bc, OP_get_loc);
32805|      0|                dbuf_put_u16(bc, var_idx);
32806|      0|                dbuf_putc(bc, OP_define_field);
32807|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32808|      0|                dbuf_putc(bc, OP_push_atom_value);
32809|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32810|      0|            } else
32811|      0|            if (label_done == -1 && can_opt_put_ref_value(bc_buf, ls->pos)) {
  ------------------
  |  Branch (32811:17): [True: 0, False: 0]
  |  Branch (32811:37): [True: 0, False: 0]
  ------------------
32812|      0|                int get_op;
32813|      0|                if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16196|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (32813:21): [True: 0, False: 0]
  ------------------
32814|      0|                    get_op = OP_get_arg;
32815|      0|                    var_idx -= ARGUMENT_VAR_OFFSET;
  ------------------
  |  |16196|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
32816|      0|                } else {
32817|      0|                    if (s->vars[var_idx].is_lexical)
  ------------------
  |  Branch (32817:25): [True: 0, False: 0]
  ------------------
32818|      0|                        get_op = OP_get_loc_check;
32819|      0|                    else
32820|      0|                        get_op = OP_get_loc;
32821|      0|                }
32822|      0|                pos_next = optimize_scope_make_ref(ctx, s, bc, bc_buf, ls,
32823|      0|                                                   pos_next, get_op, var_idx);
32824|      0|            } else {
32825|       |                /* Create a dummy object with a named slot that is
32826|       |                   a reference to the local variable */
32827|      0|                if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16196|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (32827:21): [True: 0, False: 0]
  ------------------
32828|      0|                    capture_var(s, &s->args[var_idx - ARGUMENT_VAR_OFFSET]);
  ------------------
  |  |16196|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
32829|      0|                    dbuf_putc(bc, OP_make_arg_ref);
32830|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32831|      0|                    dbuf_put_u16(bc, var_idx - ARGUMENT_VAR_OFFSET);
  ------------------
  |  |16196|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
32832|      0|                } else {
32833|      0|                    capture_var(s, &s->vars[var_idx]);
32834|      0|                    dbuf_putc(bc, OP_make_loc_ref);
32835|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32836|      0|                    dbuf_put_u16(bc, var_idx);
32837|      0|                }
32838|      0|            }
32839|      0|            break;
32840|      9|        case OP_scope_put_var:
  ------------------
  |  Branch (32840:9): [True: 9, False: 10]
  ------------------
32841|      9|            if (!(var_idx & ARGUMENT_VAR_OFFSET) &&
  ------------------
  |  |16196|      9|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (32841:17): [True: 4, False: 5]
  ------------------
32842|      4|                s->vars[var_idx].var_kind == JS_VAR_FUNCTION_NAME) {
  ------------------
  |  Branch (32842:17): [True: 0, False: 4]
  ------------------
32843|       |                /* in non strict mode, modifying the function name is ignored */
32844|      0|                dbuf_putc(bc, OP_drop);
32845|      0|                goto done;
32846|      0|            }
32847|      9|            goto local_scope_var;
32848|      9|        case OP_scope_get_ref:
  ------------------
  |  Branch (32848:9): [True: 0, False: 19]
  ------------------
32849|      0|            dbuf_putc(bc, OP_undefined);
32850|      0|            goto local_scope_var;
32851|      0|        case OP_scope_get_var_checkthis:
  ------------------
  |  Branch (32851:9): [True: 0, False: 19]
  ------------------
32852|      0|        case OP_scope_get_var_undef:
  ------------------
  |  Branch (32852:9): [True: 0, False: 19]
  ------------------
32853|      4|        case OP_scope_get_var:
  ------------------
  |  Branch (32853:9): [True: 4, False: 15]
  ------------------
32854|     10|        case OP_scope_put_var_init:
  ------------------
  |  Branch (32854:9): [True: 6, False: 13]
  ------------------
32855|     19|        local_scope_var:
32856|     19|            is_put = (op == OP_scope_put_var || op == OP_scope_put_var_init);
  ------------------
  |  Branch (32856:23): [True: 9, False: 10]
  |  Branch (32856:49): [True: 6, False: 4]
  ------------------
32857|     19|            if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16196|     19|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (32857:17): [True: 5, False: 14]
  ------------------
32858|      5|                dbuf_putc(bc, OP_get_arg + is_put);
32859|      5|                dbuf_put_u16(bc, var_idx - ARGUMENT_VAR_OFFSET);
  ------------------
  |  |16196|      5|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
32860|     14|            } else {
32861|     14|                if (is_put) {
  ------------------
  |  Branch (32861:21): [True: 10, False: 4]
  ------------------
32862|     10|                    if (s->vars[var_idx].is_lexical) {
  ------------------
  |  Branch (32862:25): [True: 6, False: 4]
  ------------------
32863|      6|                        if (op == OP_scope_put_var_init) {
  ------------------
  |  Branch (32863:29): [True: 6, False: 0]
  ------------------
32864|       |                            /* 'this' can only be initialized once */
32865|      6|                            if (var_name == JS_ATOM_this)
  ------------------
  |  Branch (32865:33): [True: 0, False: 6]
  ------------------
32866|      0|                                dbuf_putc(bc, OP_put_loc_check_init);
32867|      6|                            else
32868|      6|                                dbuf_putc(bc, OP_put_loc);
32869|      6|                        } else {
32870|      0|                            dbuf_putc(bc, OP_put_loc_check);
32871|      0|                        }
32872|      6|                    } else {
32873|      4|                        dbuf_putc(bc, OP_put_loc);
32874|      4|                    }
32875|     10|                } else {
32876|      4|                    if (s->vars[var_idx].is_lexical) {
  ------------------
  |  Branch (32876:25): [True: 2, False: 2]
  ------------------
32877|      2|                        if (op == OP_scope_get_var_checkthis) {
  ------------------
  |  Branch (32877:29): [True: 0, False: 2]
  ------------------
32878|       |                            /* only used for 'this' return in derived class constructors */
32879|      0|                            dbuf_putc(bc, OP_get_loc_checkthis);
32880|      2|                        } else {
32881|      2|                            dbuf_putc(bc, OP_get_loc_check);
32882|      2|                        }
32883|      2|                    } else {
32884|      2|                        dbuf_putc(bc, OP_get_loc);
32885|      2|                    }
32886|      4|                }
32887|     14|                dbuf_put_u16(bc, var_idx);
32888|     14|            }
32889|     19|            break;
32890|      0|        case OP_scope_delete_var:
  ------------------
  |  Branch (32890:9): [True: 0, False: 19]
  ------------------
32891|      0|            dbuf_putc(bc, OP_push_false);
32892|      0|            break;
32893|     19|        }
32894|     19|        goto done;
32895|     19|    }
32896|       |    /* check eval object */
32897|     76|    if (!is_arg_scope && s->var_object_idx >= 0 && !is_pseudo_var) {
  ------------------
  |  Branch (32897:9): [True: 74, False: 2]
  |  Branch (32897:26): [True: 0, False: 74]
  |  Branch (32897:52): [True: 0, False: 0]
  ------------------
32898|      0|        dbuf_putc(bc, OP_get_loc);
32899|      0|        dbuf_put_u16(bc, s->var_object_idx);
32900|      0|        var_object_test(ctx, s, var_name, op, bc, &label_done, 0);
32901|      0|    }
32902|       |    /* check eval object in argument scope */
32903|     76|    if (s->arg_var_object_idx >= 0 && !is_pseudo_var) {
  ------------------
  |  Branch (32903:9): [True: 0, False: 76]
  |  Branch (32903:39): [True: 0, False: 0]
  ------------------
32904|      0|        dbuf_putc(bc, OP_get_loc);
32905|      0|        dbuf_put_u16(bc, s->arg_var_object_idx);
32906|      0|        var_object_test(ctx, s, var_name, op, bc, &label_done, 0);
32907|      0|    }
32908|       |
32909|       |    /* check parent scopes */
32910|     79|    for (fd = s; fd->parent;) {
  ------------------
  |  Branch (32910:18): [True: 8, False: 71]
  ------------------
32911|      8|        scope_level = fd->parent_scope_level;
32912|      8|        fd = fd->parent;
32913|     11|        for (idx = fd->scopes[scope_level].first; idx >= 0;) {
  ------------------
  |  Branch (32913:51): [True: 3, False: 8]
  ------------------
32914|      3|            vd = &fd->vars[idx];
32915|      3|            if (vd->var_name == var_name) {
  ------------------
  |  Branch (32915:17): [True: 0, False: 3]
  ------------------
32916|      0|                if (op == OP_scope_put_var || op == OP_scope_make_ref) {
  ------------------
  |  Branch (32916:21): [True: 0, False: 0]
  |  Branch (32916:47): [True: 0, False: 0]
  ------------------
32917|      0|                    if (vd->is_const) {
  ------------------
  |  Branch (32917:25): [True: 0, False: 0]
  ------------------
32918|      0|                        dbuf_putc(bc, OP_throw_error);
32919|      0|                        dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
32920|      0|                        dbuf_putc(bc, JS_THROW_VAR_RO);
  ------------------
  |  |18341|      0|#define JS_THROW_VAR_RO             0
  ------------------
32921|      0|                        goto done;
32922|      0|                    }
32923|      0|                }
32924|      0|                var_idx = idx;
32925|      0|                break;
32926|      3|            } else if (vd->var_name == JS_ATOM__with_ && !is_pseudo_var) {
  ------------------
  |  Branch (32926:24): [True: 0, False: 3]
  |  Branch (32926:58): [True: 0, False: 0]
  ------------------
32927|      0|                capture_var(fd, vd);
32928|      0|                idx = get_closure_var(ctx, s, fd, JS_CLOSURE_LOCAL, idx, vd->var_name, FALSE, FALSE, JS_VAR_NORMAL);
32929|      0|                if (idx >= 0) {
  ------------------
  |  Branch (32929:21): [True: 0, False: 0]
  ------------------
32930|      0|                    dbuf_putc(bc, OP_get_var_ref);
32931|      0|                    dbuf_put_u16(bc, idx);
32932|      0|                    var_object_test(ctx, s, var_name, op, bc, &label_done, 1);
32933|      0|                }
32934|      0|            }
32935|      3|            idx = vd->scope_next;
32936|      3|        }
32937|      8|        is_arg_scope = (idx == ARG_SCOPE_END);
  ------------------
  |  |  628|      8|#define ARG_SCOPE_END (-2)
  ------------------
32938|      8|        if (var_idx >= 0)
  ------------------
  |  Branch (32938:13): [True: 0, False: 8]
  ------------------
32939|      0|            break;
32940|       |
32941|      8|        if (!is_arg_scope) {
  ------------------
  |  Branch (32941:13): [True: 8, False: 0]
  ------------------
32942|      8|            var_idx = find_var(ctx, fd, var_name);
32943|      8|            if (var_idx >= 0)
  ------------------
  |  Branch (32943:17): [True: 0, False: 8]
  ------------------
32944|      0|                break;
32945|      8|        }
32946|      8|        if (is_pseudo_var) {
  ------------------
  |  Branch (32946:13): [True: 0, False: 8]
  ------------------
32947|      0|            var_idx = resolve_pseudo_var(ctx, fd, var_name);
32948|      0|            if (var_idx >= 0)
  ------------------
  |  Branch (32948:17): [True: 0, False: 0]
  ------------------
32949|      0|                break;
32950|      0|        }
32951|      8|        if (var_name == JS_ATOM_arguments && fd->has_arguments_binding) {
  ------------------
  |  Branch (32951:13): [True: 0, False: 8]
  |  Branch (32951:46): [True: 0, False: 0]
  ------------------
32952|      0|            var_idx = add_arguments_var(ctx, fd);
32953|      0|            break;
32954|      0|        }
32955|      8|        if (fd->is_func_expr && fd->func_name == var_name) {
  ------------------
  |  Branch (32955:13): [True: 3, False: 5]
  |  Branch (32955:33): [True: 0, False: 3]
  ------------------
32956|       |            /* add a new variable with the function name */
32957|      0|            var_idx = add_func_var(ctx, fd, var_name);
32958|      0|            break;
32959|      0|        }
32960|       |
32961|       |        /* check eval object */
32962|      8|        if (!is_arg_scope && fd->var_object_idx >= 0 && !is_pseudo_var) {
  ------------------
  |  Branch (32962:13): [True: 8, False: 0]
  |  Branch (32962:30): [True: 0, False: 8]
  |  Branch (32962:57): [True: 0, False: 0]
  ------------------
32963|      0|            vd = &fd->vars[fd->var_object_idx];
32964|      0|            capture_var(fd, vd);
32965|      0|            idx = get_closure_var(ctx, s, fd, JS_CLOSURE_LOCAL,
32966|      0|                                  fd->var_object_idx, vd->var_name,
32967|      0|                                  FALSE, FALSE, JS_VAR_NORMAL);
32968|      0|            dbuf_putc(bc, OP_get_var_ref);
32969|      0|            dbuf_put_u16(bc, idx);
32970|      0|            var_object_test(ctx, s, var_name, op, bc, &label_done, 0);
32971|      0|        }
32972|       |
32973|       |        /* check eval object in argument scope */
32974|      8|        if (fd->arg_var_object_idx >= 0 && !is_pseudo_var) {
  ------------------
  |  Branch (32974:13): [True: 0, False: 8]
  |  Branch (32974:44): [True: 0, False: 0]
  ------------------
32975|      0|            vd = &fd->vars[fd->arg_var_object_idx];
32976|      0|            capture_var(fd, vd);
32977|      0|            idx = get_closure_var(ctx, s, fd, JS_CLOSURE_LOCAL,
32978|      0|                                  fd->arg_var_object_idx, vd->var_name,
32979|      0|                                  FALSE, FALSE, JS_VAR_NORMAL);
32980|      0|            dbuf_putc(bc, OP_get_var_ref);
32981|      0|            dbuf_put_u16(bc, idx);
32982|      0|            var_object_test(ctx, s, var_name, op, bc, &label_done, 0);
32983|      0|        }
32984|       |
32985|      8|        if (fd->is_eval)
  ------------------
  |  Branch (32985:13): [True: 5, False: 3]
  ------------------
32986|      5|            break; /* it it necessarily the top level function */
32987|      8|    }
32988|       |
32989|       |    /* check direct eval scope (in the closure of the eval function
32990|       |       which is necessarily at the top level) */
32991|     76|    if (!fd)
  ------------------
  |  Branch (32991:9): [True: 0, False: 76]
  ------------------
32992|      0|        fd = s;
32993|     76|    if (var_idx < 0 && fd->is_eval) {
  ------------------
  |  Branch (32993:9): [True: 76, False: 0]
  |  Branch (32993:24): [True: 76, False: 0]
  ------------------
32994|     76|        int idx1;
32995|    163|        for (idx1 = 0; idx1 < fd->closure_var_count; idx1++) {
  ------------------
  |  Branch (32995:24): [True: 134, False: 29]
  ------------------
32996|    134|            JSClosureVar *cv = &fd->closure_var[idx1];
32997|    134|            if (var_name == cv->var_name) {
  ------------------
  |  Branch (32997:17): [True: 47, False: 87]
  ------------------
32998|     47|                if (fd != s) {
  ------------------
  |  Branch (32998:21): [True: 1, False: 46]
  ------------------
32999|      1|                    JSClosureTypeEnum closure_type;
33000|      1|                    if (cv->closure_type == JS_CLOSURE_GLOBAL ||
  ------------------
  |  Branch (33000:25): [True: 1, False: 0]
  ------------------
33001|      0|                        cv->closure_type == JS_CLOSURE_GLOBAL_DECL ||
  ------------------
  |  Branch (33001:25): [True: 0, False: 0]
  ------------------
33002|      0|                        cv->closure_type == JS_CLOSURE_GLOBAL_REF)
  ------------------
  |  Branch (33002:25): [True: 0, False: 0]
  ------------------
33003|      1|                        closure_type = JS_CLOSURE_GLOBAL_REF;
33004|      0|                    else
33005|      0|                        closure_type = JS_CLOSURE_REF;
33006|      1|                    idx = get_closure_var(ctx, s, fd,
33007|      1|                                          closure_type,
33008|      1|                                          idx1,
33009|      1|                                          cv->var_name, cv->is_const,
33010|      1|                                          cv->is_lexical, cv->var_kind);
33011|     46|                } else {
33012|     46|                    idx = idx1;
33013|     46|                }
33014|     47|                if (cv->closure_type == JS_CLOSURE_GLOBAL ||
  ------------------
  |  Branch (33014:21): [True: 19, False: 28]
  ------------------
33015|     28|                    cv->closure_type == JS_CLOSURE_GLOBAL_DECL ||
  ------------------
  |  Branch (33015:21): [True: 0, False: 28]
  ------------------
33016|     28|                    cv->closure_type == JS_CLOSURE_GLOBAL_REF)
  ------------------
  |  Branch (33016:21): [True: 0, False: 28]
  ------------------
33017|     19|                    goto has_global_idx;
33018|     28|                else
33019|     28|                    goto has_idx;
33020|     87|            } else if ((cv->var_name == JS_ATOM__var_ ||
  ------------------
  |  Branch (33020:25): [True: 0, False: 87]
  ------------------
33021|     87|                        cv->var_name == JS_ATOM__arg_var_ ||
  ------------------
  |  Branch (33021:25): [True: 0, False: 87]
  ------------------
33022|     87|                        cv->var_name == JS_ATOM__with_) && !is_pseudo_var) {
  ------------------
  |  Branch (33022:25): [True: 0, False: 87]
  |  Branch (33022:60): [True: 0, False: 0]
  ------------------
33023|      0|                int is_with = (cv->var_name == JS_ATOM__with_);
33024|      0|                if (fd != s) {
  ------------------
  |  Branch (33024:21): [True: 0, False: 0]
  ------------------
33025|      0|                    idx = get_closure_var(ctx, s, fd,
33026|      0|                                          JS_CLOSURE_REF,
33027|      0|                                          idx1,
33028|      0|                                          cv->var_name, FALSE, FALSE,
33029|      0|                                          JS_VAR_NORMAL);
33030|      0|                } else {
33031|      0|                    idx = idx1;
33032|      0|                }
33033|      0|                dbuf_putc(bc, OP_get_var_ref);
33034|      0|                dbuf_put_u16(bc, idx);
33035|      0|                var_object_test(ctx, s, var_name, op, bc, &label_done, is_with);
33036|      0|            }
33037|    134|        }
33038|       |
33039|       |        /* not found: add a closure for a global variable access */
33040|     29|        idx1 = add_closure_var(ctx, fd, JS_CLOSURE_GLOBAL, 0, var_name,
33041|     29|                              FALSE, FALSE, JS_VAR_NORMAL);
33042|     29|        if (idx1 < 0)
  ------------------
  |  Branch (33042:13): [True: 0, False: 29]
  ------------------
33043|      0|            return -1;
33044|     29|        if (fd != s) {
  ------------------
  |  Branch (33044:13): [True: 4, False: 25]
  ------------------
33045|      4|            idx = get_closure_var(ctx, s, fd,
33046|      4|                                  JS_CLOSURE_GLOBAL_REF,
33047|      4|                                  idx1,
33048|      4|                                  var_name, FALSE, FALSE, 
33049|      4|                                  JS_VAR_NORMAL);
33050|     25|        } else {
33051|     25|            idx = idx1;
33052|     25|        }
33053|     48|    has_global_idx:
33054|       |        /* global variable access */
33055|     48|        switch (op) {
  ------------------
  |  Branch (33055:17): [True: 48, False: 0]
  ------------------
33056|      0|        case OP_scope_make_ref:
  ------------------
  |  Branch (33056:9): [True: 0, False: 48]
  ------------------
33057|      0|            if (label_done == -1 && can_opt_put_global_ref_value(bc_buf, ls->pos)) {
  ------------------
  |  Branch (33057:17): [True: 0, False: 0]
  |  Branch (33057:37): [True: 0, False: 0]
  ------------------
33058|      0|                pos_next = optimize_scope_make_ref(ctx, s, bc, bc_buf, ls,
33059|      0|                                                   pos_next,
33060|      0|                                                   OP_get_var, idx);
33061|      0|            } else {
33062|      0|                dbuf_putc(bc, OP_make_var_ref);
33063|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33064|      0|            }
33065|      0|            break;
33066|      0|        case OP_scope_get_ref:
  ------------------
  |  Branch (33066:9): [True: 0, False: 48]
  ------------------
33067|       |            /* XXX: should create a dummy object with a named slot that is
33068|       |               a reference to the global variable */
33069|      0|            dbuf_putc(bc, OP_undefined);
33070|      0|            dbuf_putc(bc, OP_get_var);
33071|      0|            dbuf_put_u16(bc, idx);
33072|      0|            break;
33073|      0|        case OP_scope_get_var_undef:
  ------------------
  |  Branch (33073:9): [True: 0, False: 48]
  ------------------
33074|     44|        case OP_scope_get_var:
  ------------------
  |  Branch (33074:9): [True: 44, False: 4]
  ------------------
33075|     48|        case OP_scope_put_var:
  ------------------
  |  Branch (33075:9): [True: 4, False: 44]
  ------------------
33076|     48|            dbuf_putc(bc, OP_get_var_undef + (op - OP_scope_get_var_undef));
33077|     48|            dbuf_put_u16(bc, idx);
33078|     48|            break;
33079|      0|        case OP_scope_put_var_init:
  ------------------
  |  Branch (33079:9): [True: 0, False: 48]
  ------------------
33080|      0|            dbuf_putc(bc, OP_put_var_init);
33081|      0|            dbuf_put_u16(bc, idx);
33082|      0|            break;
33083|      0|        case OP_scope_delete_var:
  ------------------
  |  Branch (33083:9): [True: 0, False: 48]
  ------------------
33084|      0|            dbuf_putc(bc, OP_delete_var);
33085|      0|            dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33086|      0|            break;
33087|     48|        }
33088|     48|    } else {
33089|       |        /* find the corresponding closure variable */
33090|      0|        if (var_idx & ARGUMENT_VAR_OFFSET) {
  ------------------
  |  |16196|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
  |  Branch (33090:13): [True: 0, False: 0]
  ------------------
33091|      0|            capture_var(fd, &fd->args[var_idx - ARGUMENT_VAR_OFFSET]);
  ------------------
  |  |16196|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
33092|      0|            idx = get_closure_var(ctx, s, fd,
33093|      0|                                  JS_CLOSURE_ARG, var_idx - ARGUMENT_VAR_OFFSET,
  ------------------
  |  |16196|      0|#define ARGUMENT_VAR_OFFSET 0x20000000
  ------------------
33094|      0|                                  var_name, FALSE, FALSE, JS_VAR_NORMAL);
33095|      0|        } else {
33096|      0|            capture_var(fd, &fd->vars[var_idx]);
33097|      0|            idx = get_closure_var(ctx, s, fd,
33098|      0|                                  JS_CLOSURE_LOCAL, var_idx,
33099|      0|                                  var_name,
33100|      0|                                  fd->vars[var_idx].is_const,
33101|      0|                                  fd->vars[var_idx].is_lexical,
33102|      0|                                  fd->vars[var_idx].var_kind);
33103|      0|        }
33104|      0|        if (idx >= 0) {
  ------------------
  |  Branch (33104:13): [True: 0, False: 0]
  ------------------
33105|     28|        has_idx:
33106|     28|            if ((op == OP_scope_put_var || op == OP_scope_make_ref) &&
  ------------------
  |  Branch (33106:18): [True: 0, False: 28]
  |  Branch (33106:44): [True: 0, False: 28]
  ------------------
33107|      0|                s->closure_var[idx].is_const) {
  ------------------
  |  Branch (33107:17): [True: 0, False: 0]
  ------------------
33108|      0|                dbuf_putc(bc, OP_throw_error);
33109|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33110|      0|                dbuf_putc(bc, JS_THROW_VAR_RO);
  ------------------
  |  |18341|      0|#define JS_THROW_VAR_RO             0
  ------------------
33111|      0|                goto done;
33112|      0|            }
33113|     28|            switch (op) {
  ------------------
  |  Branch (33113:21): [True: 28, False: 0]
  ------------------
33114|      0|            case OP_scope_make_ref:
  ------------------
  |  Branch (33114:13): [True: 0, False: 28]
  ------------------
33115|      0|                if (s->closure_var[idx].var_kind == JS_VAR_FUNCTION_NAME) {
  ------------------
  |  Branch (33115:21): [True: 0, False: 0]
  ------------------
33116|       |                    /* Create a dummy object reference for the func_var */
33117|      0|                    dbuf_putc(bc, OP_object);
33118|      0|                    dbuf_putc(bc, OP_get_var_ref);
33119|      0|                    dbuf_put_u16(bc, idx);
33120|      0|                    dbuf_putc(bc, OP_define_field);
33121|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33122|      0|                    dbuf_putc(bc, OP_push_atom_value);
33123|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33124|      0|                } else
33125|      0|                if (label_done == -1 &&
  ------------------
  |  Branch (33125:21): [True: 0, False: 0]
  ------------------
33126|      0|                    can_opt_put_ref_value(bc_buf, ls->pos)) {
  ------------------
  |  Branch (33126:21): [True: 0, False: 0]
  ------------------
33127|      0|                    int get_op;
33128|      0|                    if (s->closure_var[idx].is_lexical)
  ------------------
  |  Branch (33128:25): [True: 0, False: 0]
  ------------------
33129|      0|                        get_op = OP_get_var_ref_check;
33130|      0|                    else
33131|      0|                        get_op = OP_get_var_ref;
33132|      0|                    pos_next = optimize_scope_make_ref(ctx, s, bc, bc_buf, ls,
33133|      0|                                                       pos_next,
33134|      0|                                                       get_op, idx);
33135|      0|                } else {
33136|       |                    /* Create a dummy object with a named slot that is
33137|       |                       a reference to the closure variable */
33138|      0|                    dbuf_putc(bc, OP_make_var_ref_ref);
33139|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, var_name));
33140|      0|                    dbuf_put_u16(bc, idx);
33141|      0|                }
33142|      0|                break;
33143|      0|            case OP_scope_put_var:
  ------------------
  |  Branch (33143:13): [True: 0, False: 28]
  ------------------
33144|      0|                if (s->closure_var[idx].var_kind == JS_VAR_FUNCTION_NAME) {
  ------------------
  |  Branch (33144:21): [True: 0, False: 0]
  ------------------
33145|       |                    /* in non strict mode, modifying the function name is ignored */
33146|      0|                    dbuf_putc(bc, OP_drop);
33147|      0|                    goto done;
33148|      0|                }
33149|      0|                goto closure_scope_var;
33150|      0|            case OP_scope_get_ref:
  ------------------
  |  Branch (33150:13): [True: 0, False: 28]
  ------------------
33151|       |                /* XXX: should create a dummy object with a named slot that is
33152|       |                   a reference to the closure variable */
33153|      0|                dbuf_putc(bc, OP_undefined);
33154|      0|                goto closure_scope_var;
33155|      0|            case OP_scope_get_var_undef:
  ------------------
  |  Branch (33155:13): [True: 0, False: 28]
  ------------------
33156|     28|            case OP_scope_get_var:
  ------------------
  |  Branch (33156:13): [True: 28, False: 0]
  ------------------
33157|     28|            case OP_scope_put_var_init:
  ------------------
  |  Branch (33157:13): [True: 0, False: 28]
  ------------------
33158|     28|            closure_scope_var:
33159|     28|                is_put = (op == OP_scope_put_var ||
  ------------------
  |  Branch (33159:27): [True: 0, False: 28]
  ------------------
33160|     28|                          op == OP_scope_put_var_init);
  ------------------
  |  Branch (33160:27): [True: 0, False: 28]
  ------------------
33161|     28|                if (is_put) {
  ------------------
  |  Branch (33161:21): [True: 0, False: 28]
  ------------------
33162|      0|                    if (s->closure_var[idx].is_lexical) {
  ------------------
  |  Branch (33162:25): [True: 0, False: 0]
  ------------------
33163|      0|                        if (op == OP_scope_put_var_init) {
  ------------------
  |  Branch (33163:29): [True: 0, False: 0]
  ------------------
33164|       |                            /* 'this' can only be initialized once */
33165|      0|                            if (var_name == JS_ATOM_this)
  ------------------
  |  Branch (33165:33): [True: 0, False: 0]
  ------------------
33166|      0|                                dbuf_putc(bc, OP_put_var_ref_check_init);
33167|      0|                            else
33168|      0|                                dbuf_putc(bc, OP_put_var_ref);
33169|      0|                        } else {
33170|      0|                            dbuf_putc(bc, OP_put_var_ref_check);
33171|      0|                        }
33172|      0|                    } else {
33173|      0|                        dbuf_putc(bc, OP_put_var_ref);
33174|      0|                    }
33175|     28|                } else {
33176|     28|                    if (s->closure_var[idx].is_lexical) {
  ------------------
  |  Branch (33176:25): [True: 28, False: 0]
  ------------------
33177|     28|                        dbuf_putc(bc, OP_get_var_ref_check);
33178|     28|                    } else {
33179|      0|                        dbuf_putc(bc, OP_get_var_ref);
33180|      0|                    }
33181|     28|                }
33182|     28|                dbuf_put_u16(bc, idx);
33183|     28|                break;
33184|      0|            case OP_scope_delete_var:
  ------------------
  |  Branch (33184:13): [True: 0, False: 28]
  ------------------
33185|      0|                dbuf_putc(bc, OP_push_false);
33186|      0|                break;
33187|     28|            }
33188|     28|            goto done;
33189|     28|        }
33190|      0|    }
33191|       |
33192|     95|done:
33193|     95|    if (label_done >= 0) {
  ------------------
  |  Branch (33193:9): [True: 0, False: 95]
  ------------------
33194|      0|        dbuf_putc(bc, OP_label);
33195|      0|        dbuf_put_u32(bc, label_done);
33196|      0|        s->label_slots[label_done].pos2 = bc->size;
33197|      0|    }
33198|     95|    return pos_next;
33199|     76|}
quickjs.c:code_match:
33686|    266|{
33687|    266|    const uint8_t *tab = s->bc_buf;
33688|    266|    int op, len, op1, line_num, pos_next;
33689|    266|    va_list ap;
33690|    266|    BOOL ret = FALSE;
33691|       |
33692|    266|    line_num = -1;
33693|    266|    va_start(ap, pos);
33694|       |
33695|    344|    for(;;) {
33696|    344|        op1 = va_arg(ap, int);
33697|    344|        if (op1 == -1) {
  ------------------
  |  Branch (33697:13): [True: 50, False: 294]
  ------------------
33698|     50|            s->pos = pos;
33699|     50|            s->line_num = line_num;
33700|     50|            ret = TRUE;
33701|     50|            break;
33702|     50|        }
33703|    326|        for (;;) {
33704|    326|            if (pos >= s->bc_len)
  ------------------
  |  Branch (33704:17): [True: 0, False: 326]
  ------------------
33705|      0|                goto done;
33706|    326|            op = tab[pos];
33707|    326|            len = opcode_info[op].size;
33708|    326|            pos_next = pos + len;
33709|    326|            if (pos_next > s->bc_len)
  ------------------
  |  Branch (33709:17): [True: 0, False: 326]
  ------------------
33710|      0|                goto done;
33711|    326|            if (op == OP_line_num) {
  ------------------
  |  Branch (33711:17): [True: 32, False: 294]
  ------------------
33712|     32|                line_num = get_u32(tab + pos + 1);
33713|     32|                pos = pos_next;
33714|    294|            } else {
33715|    294|                break;
33716|    294|            }
33717|    326|        }
33718|    294|        if (op != op1) {
  ------------------
  |  Branch (33718:13): [True: 223, False: 71]
  ------------------
33719|    223|            if (op1 == (uint8_t)op1 || !op)
  ------------------
  |  Branch (33719:17): [True: 162, False: 61]
  |  Branch (33719:40): [True: 0, False: 61]
  ------------------
33720|    162|                break;
33721|     61|            if (op != (uint8_t)op1
  ------------------
  |  Branch (33721:17): [True: 59, False: 2]
  ------------------
33722|     59|            &&  op != (uint8_t)(op1 >> 8)
  ------------------
  |  Branch (33722:17): [True: 59, False: 0]
  ------------------
33723|     59|            &&  op != (uint8_t)(op1 >> 16)
  ------------------
  |  Branch (33723:17): [True: 54, False: 5]
  ------------------
33724|     54|            &&  op != (uint8_t)(op1 >> 24)) {
  ------------------
  |  Branch (33724:17): [True: 54, False: 0]
  ------------------
33725|     54|                break;
33726|     54|            }
33727|      7|            s->op = op;
33728|      7|        }
33729|       |
33730|     78|        pos++;
33731|     78|        switch(opcode_info[op].fmt) {
33732|      0|        case OP_FMT_loc8:
  ------------------
  |  Branch (33732:9): [True: 0, False: 78]
  ------------------
33733|      0|        case OP_FMT_u8:
  ------------------
  |  Branch (33733:9): [True: 0, False: 78]
  ------------------
33734|      0|            {
33735|      0|                int idx = tab[pos];
33736|      0|                int arg = va_arg(ap, int);
33737|      0|                if (arg == -1) {
  ------------------
  |  Branch (33737:21): [True: 0, False: 0]
  ------------------
33738|      0|                    s->idx = idx;
33739|      0|                } else {
33740|      0|                    if (arg != idx)
  ------------------
  |  Branch (33740:25): [True: 0, False: 0]
  ------------------
33741|      0|                        goto done;
33742|      0|                }
33743|      0|                break;
33744|      0|            }
33745|      0|        case OP_FMT_u16:
  ------------------
  |  Branch (33745:9): [True: 0, False: 78]
  ------------------
33746|      0|        case OP_FMT_npop:
  ------------------
  |  Branch (33746:9): [True: 0, False: 78]
  ------------------
33747|     13|        case OP_FMT_loc:
  ------------------
  |  Branch (33747:9): [True: 13, False: 65]
  ------------------
33748|     18|        case OP_FMT_arg:
  ------------------
  |  Branch (33748:9): [True: 5, False: 73]
  ------------------
33749|     18|        case OP_FMT_var_ref:
  ------------------
  |  Branch (33749:9): [True: 0, False: 78]
  ------------------
33750|     18|            {
33751|     18|                int idx = get_u16(tab + pos);
33752|     18|                int arg = va_arg(ap, int);
33753|     18|                if (arg == -1) {
  ------------------
  |  Branch (33753:21): [True: 7, False: 11]
  ------------------
33754|      7|                    s->idx = idx;
33755|     11|                } else {
33756|     11|                    if (arg != idx)
  ------------------
  |  Branch (33756:25): [True: 0, False: 11]
  ------------------
33757|      0|                        goto done;
33758|     11|                }
33759|     18|                break;
33760|     18|            }
33761|     18|        case OP_FMT_i32:
  ------------------
  |  Branch (33761:9): [True: 0, False: 78]
  ------------------
33762|      0|        case OP_FMT_u32:
  ------------------
  |  Branch (33762:9): [True: 0, False: 78]
  ------------------
33763|      0|        case OP_FMT_label:
  ------------------
  |  Branch (33763:9): [True: 0, False: 78]
  ------------------
33764|      0|        case OP_FMT_const:
  ------------------
  |  Branch (33764:9): [True: 0, False: 78]
  ------------------
33765|      0|            {
33766|      0|                s->label = get_u32(tab + pos);
33767|      0|                break;
33768|      0|            }
33769|      0|        case OP_FMT_label_u16:
  ------------------
  |  Branch (33769:9): [True: 0, False: 78]
  ------------------
33770|      0|            {
33771|      0|                s->label = get_u32(tab + pos);
33772|      0|                s->val = get_u16(tab + pos + 4);
33773|      0|                break;
33774|      0|            }
33775|     28|        case OP_FMT_atom:
  ------------------
  |  Branch (33775:9): [True: 28, False: 50]
  ------------------
33776|     28|            {
33777|     28|                s->atom = get_u32(tab + pos);
33778|     28|                break;
33779|      0|            }
33780|      0|        case OP_FMT_atom_u8:
  ------------------
  |  Branch (33780:9): [True: 0, False: 78]
  ------------------
33781|      0|            {
33782|      0|                s->atom = get_u32(tab + pos);
33783|      0|                s->val = get_u8(tab + pos + 4);
33784|      0|                break;
33785|      0|            }
33786|      0|        case OP_FMT_atom_u16:
  ------------------
  |  Branch (33786:9): [True: 0, False: 78]
  ------------------
33787|      0|            {
33788|      0|                s->atom = get_u32(tab + pos);
33789|      0|                s->val = get_u16(tab + pos + 4);
33790|      0|                break;
33791|      0|            }
33792|      0|        case OP_FMT_atom_label_u8:
  ------------------
  |  Branch (33792:9): [True: 0, False: 78]
  ------------------
33793|      0|            {
33794|      0|                s->atom = get_u32(tab + pos);
33795|      0|                s->label = get_u32(tab + pos + 4);
33796|      0|                s->val = get_u8(tab + pos + 8);
33797|      0|                break;
33798|      0|            }
33799|     32|        default:
  ------------------
  |  Branch (33799:9): [True: 32, False: 46]
  ------------------
33800|     32|            break;
33801|     78|        }
33802|     78|        pos = pos_next;
33803|     78|    }
33804|    266| done:
33805|       |    va_end(ap);
33806|    266|    return ret;
33807|    266|}
quickjs.c:skip_dead_code:
33918|     76|{
33919|     76|    int op, len, label;
33920|       |
33921|    132|    for (; pos < bc_len; pos += len) {
  ------------------
  |  Branch (33921:12): [True: 90, False: 42]
  ------------------
33922|     90|        op = bc_buf[pos];
33923|     90|        len = opcode_info[op].size;
33924|     90|        if (op == OP_line_num) {
  ------------------
  |  Branch (33924:13): [True: 0, False: 90]
  ------------------
33925|      0|            *linep = get_u32(bc_buf + pos + 1);
33926|      0|        } else
33927|     90|        if (op == OP_label) {
  ------------------
  |  Branch (33927:13): [True: 34, False: 56]
  ------------------
33928|     34|            label = get_u32(bc_buf + pos + 1);
33929|     34|            if (update_label(s, label, 0) > 0)
  ------------------
  |  Branch (33929:17): [True: 34, False: 0]
  ------------------
33930|     34|                break;
33931|       |#if 0
33932|       |            if (s->label_slots[label].first_reloc) {
33933|       |                printf("line %d: unreferenced label %d:%d has relocations\n",
33934|       |                       *linep, label, s->label_slots[label].pos2);
33935|       |            }
33936|       |#endif
33937|     34|            assert(s->label_slots[label].first_reloc == NULL);
  ------------------
  |  Branch (33937:13): [True: 0, False: 0]
  |  Branch (33937:13): [True: 0, False: 0]
  ------------------
33938|     56|        } else {
33939|       |            /* XXX: output a warning for unreachable code? */
33940|     56|            JSAtom atom;
33941|     56|            switch(opcode_info[op].fmt) {
33942|      0|            case OP_FMT_label:
  ------------------
  |  Branch (33942:13): [True: 0, False: 56]
  ------------------
33943|      0|            case OP_FMT_label_u16:
  ------------------
  |  Branch (33943:13): [True: 0, False: 56]
  ------------------
33944|      0|                label = get_u32(bc_buf + pos + 1);
33945|      0|                update_label(s, label, -1);
33946|      0|                break;
33947|      0|            case OP_FMT_atom_label_u8:
  ------------------
  |  Branch (33947:13): [True: 0, False: 56]
  ------------------
33948|      0|            case OP_FMT_atom_label_u16:
  ------------------
  |  Branch (33948:13): [True: 0, False: 56]
  ------------------
33949|      0|                label = get_u32(bc_buf + pos + 5);
33950|      0|                update_label(s, label, -1);
33951|       |                /* fall thru */
33952|      0|            case OP_FMT_atom:
  ------------------
  |  Branch (33952:13): [True: 0, False: 56]
  ------------------
33953|      0|            case OP_FMT_atom_u8:
  ------------------
  |  Branch (33953:13): [True: 0, False: 56]
  ------------------
33954|      0|            case OP_FMT_atom_u16:
  ------------------
  |  Branch (33954:13): [True: 0, False: 56]
  ------------------
33955|      0|                atom = get_u32(bc_buf + pos + 1);
33956|      0|                JS_FreeAtom(s->ctx, atom);
33957|      0|                break;
33958|     56|            default:
  ------------------
  |  Branch (33958:13): [True: 56, False: 0]
  ------------------
33959|     56|                break;
33960|     56|            }
33961|     56|        }
33962|     90|    }
33963|     76|    return pos;
33964|     76|}
quickjs.c:instantiate_hoisted_definitions:
33810|     28|{
33811|     28|    int i, idx, label_next = -1;
33812|       |
33813|       |    /* add the hoisted functions in arguments and local variables */
33814|     32|    for(i = 0; i < s->arg_count; i++) {
  ------------------
  |  Branch (33814:16): [True: 4, False: 28]
  ------------------
33815|      4|        JSVarDef *vd = &s->args[i];
33816|      4|        if (vd->func_pool_idx >= 0) {
  ------------------
  |  Branch (33816:13): [True: 0, False: 4]
  ------------------
33817|      0|            dbuf_putc(bc, OP_fclosure);
33818|      0|            dbuf_put_u32(bc, vd->func_pool_idx);
33819|      0|            dbuf_putc(bc, OP_put_arg);
33820|      0|            dbuf_put_u16(bc, i);
33821|      0|        }
33822|      4|    }
33823|     48|    for(i = 0; i < s->var_count; i++) {
  ------------------
  |  Branch (33823:16): [True: 20, False: 28]
  ------------------
33824|     20|        JSVarDef *vd = &s->vars[i];
33825|     20|        if (vd->scope_level == 0 && vd->func_pool_idx >= 0) {
  ------------------
  |  Branch (33825:13): [True: 14, False: 6]
  |  Branch (33825:37): [True: 0, False: 14]
  ------------------
33826|      0|            dbuf_putc(bc, OP_fclosure);
33827|      0|            dbuf_put_u32(bc, vd->func_pool_idx);
33828|      0|            dbuf_putc(bc, OP_put_loc);
33829|      0|            dbuf_put_u16(bc, i);
33830|      0|        }
33831|     20|    }
33832|       |
33833|       |    /* the module global variables must be initialized before
33834|       |       evaluating the module so that the exported functions are
33835|       |       visible if there are cyclic module references */
33836|     28|    if (s->module) {
  ------------------
  |  Branch (33836:9): [True: 14, False: 14]
  ------------------
33837|     14|        label_next = new_label_fd(s);
33838|     14|        if (label_next < 0) {
  ------------------
  |  Branch (33838:13): [True: 0, False: 14]
  ------------------
33839|      0|            dbuf_set_error(bc);
33840|      0|            return;
33841|      0|        }
33842|       |        /* if 'this' is true, initialize the global variables and return */
33843|     14|        dbuf_putc(bc, OP_push_this);
33844|     14|        dbuf_putc(bc, OP_if_false);
33845|     14|        dbuf_put_u32(bc, label_next);
33846|     14|        update_label(s, label_next, 1);
33847|     14|        s->jump_size++;
33848|     14|    }
33849|       |
33850|       |    /* add the global variables (only happens if s->is_global_var is
33851|       |       true) */
33852|       |    /* XXX: inefficient, add a closure index in JSGlobalVar */
33853|     28|    for(i = 0; i < s->global_var_count; i++) {
  ------------------
  |  Branch (33853:16): [True: 0, False: 28]
  ------------------
33854|      0|        JSGlobalVar *hf = &s->global_vars[i];
33855|      0|        BOOL has_var_obj = FALSE;
33856|      0|        BOOL force_init = hf->force_init;
33857|       |        /* we are in an eval, so the closure contains all the
33858|       |           enclosing variables */
33859|       |        /* If the outer function has a variable environment,
33860|       |           create a property for the variable there */
33861|      0|        for(idx = 0; idx < s->closure_var_count; idx++) {
  ------------------
  |  Branch (33861:22): [True: 0, False: 0]
  ------------------
33862|      0|            JSClosureVar *cv = &s->closure_var[idx];
33863|      0|            if (cv->var_name == hf->var_name) {
  ------------------
  |  Branch (33863:17): [True: 0, False: 0]
  ------------------
33864|      0|                force_init = FALSE;
33865|      0|                goto closure_found;
33866|      0|            }
33867|      0|            if (cv->var_name == JS_ATOM__var_ ||
  ------------------
  |  Branch (33867:17): [True: 0, False: 0]
  ------------------
33868|      0|                cv->var_name == JS_ATOM__arg_var_) {
  ------------------
  |  Branch (33868:17): [True: 0, False: 0]
  ------------------
33869|      0|                dbuf_putc(bc, OP_get_var_ref);
33870|      0|                dbuf_put_u16(bc, idx);
33871|      0|                has_var_obj = TRUE;
33872|      0|                force_init = TRUE;
33873|      0|                goto closure_found;
33874|      0|            }
33875|      0|        }
33876|      0|        abort();
33877|      0|    closure_found:
33878|      0|        if (hf->cpool_idx >= 0 || force_init) {
  ------------------
  |  Branch (33878:13): [True: 0, False: 0]
  |  Branch (33878:35): [True: 0, False: 0]
  ------------------
33879|      0|            if (hf->cpool_idx >= 0) {
  ------------------
  |  Branch (33879:17): [True: 0, False: 0]
  ------------------
33880|      0|                dbuf_putc(bc, OP_fclosure);
33881|      0|                dbuf_put_u32(bc, hf->cpool_idx);
33882|      0|                if (hf->var_name == JS_ATOM__default_) {
  ------------------
  |  Branch (33882:21): [True: 0, False: 0]
  ------------------
33883|       |                    /* set default export function name */
33884|      0|                    dbuf_putc(bc, OP_set_name);
33885|      0|                    dbuf_put_u32(bc, JS_DupAtom(ctx, JS_ATOM_default));
33886|      0|                }
33887|      0|            } else {
33888|      0|                dbuf_putc(bc, OP_undefined);
33889|      0|            }
33890|      0|            if (!has_var_obj) {
  ------------------
  |  Branch (33890:17): [True: 0, False: 0]
  ------------------
33891|      0|                dbuf_putc(bc, OP_put_var_ref);
33892|      0|                dbuf_put_u16(bc, idx);
33893|      0|            } else {
33894|      0|                dbuf_putc(bc, OP_define_field);
33895|      0|                dbuf_put_u32(bc, JS_DupAtom(ctx, hf->var_name));
33896|      0|                dbuf_putc(bc, OP_drop);
33897|      0|            }
33898|      0|        }
33899|      0|        JS_FreeAtom(ctx, hf->var_name);
33900|      0|    }
33901|       |
33902|     28|    if (s->module) {
  ------------------
  |  Branch (33902:9): [True: 14, False: 14]
  ------------------
33903|     14|        dbuf_putc(bc, OP_return_undef);
33904|       |
33905|     14|        dbuf_putc(bc, OP_label);
33906|     14|        dbuf_put_u32(bc, label_next);
33907|     14|        s->label_slots[label_next].pos2 = bc->size;
33908|     14|    }
33909|       |
33910|     28|    js_free(ctx, s->global_vars);
33911|       |    s->global_vars = NULL;
33912|     28|    s->global_var_count = 0;
33913|     28|    s->global_var_size = 0;
33914|     28|}
quickjs.c:resolve_labels:
34601|     28|{
34602|     28|    int pos, pos_next, bc_len, op, op1, len, i, line_num;
34603|     28|    const uint8_t *bc_buf;
34604|     28|    DynBuf bc_out;
34605|     28|    LabelSlot *label_slots, *ls;
34606|     28|    RelocEntry *re, *re_next;
34607|     28|    CodeContext cc;
34608|     28|    int label;
34609|     28|#if SHORT_OPCODES
34610|     28|    JumpSlot *jp;
34611|     28|#endif
34612|       |
34613|     28|    label_slots = s->label_slots;
34614|       |
34615|     28|    line_num = s->source_pos;
34616|       |
34617|     28|    cc.bc_buf = bc_buf = s->byte_code.buf;
34618|     28|    cc.bc_len = bc_len = s->byte_code.size;
34619|     28|    js_dbuf_bytecode_init(ctx, &bc_out);
34620|       |
34621|     28|#if SHORT_OPCODES
34622|     28|    if (s->jump_size) {
  ------------------
  |  Branch (34622:9): [True: 19, False: 9]
  ------------------
34623|     19|        s->jump_slots = js_mallocz(s->ctx, sizeof(*s->jump_slots) * s->jump_size);
34624|     19|        if (s->jump_slots == NULL)
  ------------------
  |  Branch (34624:13): [True: 0, False: 19]
  ------------------
34625|      0|            return -1;
34626|     19|    }
34627|     28|#endif
34628|       |    /* XXX: Should skip this phase if not generating SHORT_OPCODES */
34629|     28|    if (s->line_number_size && !s->strip_debug) {
  ------------------
  |  Branch (34629:9): [True: 24, False: 4]
  |  Branch (34629:32): [True: 24, False: 0]
  ------------------
34630|     24|        s->line_number_slots = js_mallocz(s->ctx, sizeof(*s->line_number_slots) * s->line_number_size);
34631|     24|        if (s->line_number_slots == NULL)
  ------------------
  |  Branch (34631:13): [True: 0, False: 24]
  ------------------
34632|      0|            return -1;
34633|     24|        s->line_number_last = s->source_pos;
34634|     24|        s->line_number_last_pc = 0;
34635|     24|    }
34636|       |
34637|       |    /* initialize the 'home_object' variable if needed */
34638|     28|    if (s->home_object_var_idx >= 0) {
  ------------------
  |  Branch (34638:9): [True: 0, False: 28]
  ------------------
34639|      0|        dbuf_putc(&bc_out, OP_special_object);
34640|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_HOME_OBJECT);
34641|      0|        put_short_code(&bc_out, OP_put_loc, s->home_object_var_idx);
34642|      0|    }
34643|       |    /* initialize the 'this.active_func' variable if needed */
34644|     28|    if (s->this_active_func_var_idx >= 0) {
  ------------------
  |  Branch (34644:9): [True: 0, False: 28]
  ------------------
34645|      0|        dbuf_putc(&bc_out, OP_special_object);
34646|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_THIS_FUNC);
34647|      0|        put_short_code(&bc_out, OP_put_loc, s->this_active_func_var_idx);
34648|      0|    }
34649|       |    /* initialize the 'new.target' variable if needed */
34650|     28|    if (s->new_target_var_idx >= 0) {
  ------------------
  |  Branch (34650:9): [True: 0, False: 28]
  ------------------
34651|      0|        dbuf_putc(&bc_out, OP_special_object);
34652|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_NEW_TARGET);
34653|      0|        put_short_code(&bc_out, OP_put_loc, s->new_target_var_idx);
34654|      0|    }
34655|       |    /* initialize the 'this' variable if needed. In a derived class
34656|       |       constructor, this is initially uninitialized. */
34657|     28|    if (s->this_var_idx >= 0) {
  ------------------
  |  Branch (34657:9): [True: 0, False: 28]
  ------------------
34658|      0|        if (s->is_derived_class_constructor) {
  ------------------
  |  Branch (34658:13): [True: 0, False: 0]
  ------------------
34659|      0|            dbuf_putc(&bc_out, OP_set_loc_uninitialized);
34660|      0|            dbuf_put_u16(&bc_out, s->this_var_idx);
34661|      0|        } else {
34662|      0|            dbuf_putc(&bc_out, OP_push_this);
34663|      0|            put_short_code(&bc_out, OP_put_loc, s->this_var_idx);
34664|      0|        }
34665|      0|    }
34666|       |    /* initialize the 'arguments' variable if needed */
34667|     28|    if (s->arguments_var_idx >= 0) {
  ------------------
  |  Branch (34667:9): [True: 0, False: 28]
  ------------------
34668|      0|        if ((s->js_mode & JS_MODE_STRICT) || !s->has_simple_parameter_list) {
  ------------------
  |  |  395|      0|#define JS_MODE_STRICT (1 << 0)
  ------------------
  |  Branch (34668:13): [True: 0, False: 0]
  |  Branch (34668:46): [True: 0, False: 0]
  ------------------
34669|      0|            dbuf_putc(&bc_out, OP_special_object);
34670|      0|            dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_ARGUMENTS);
34671|      0|        } else {
34672|      0|            dbuf_putc(&bc_out, OP_special_object);
34673|      0|            dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_MAPPED_ARGUMENTS);
34674|       |            /* the arguments are implicitly captured because
34675|       |               references to them are created with the 'argument'
34676|       |               object */
34677|      0|            for(i = 0; i < s->arg_count; i++)
  ------------------
  |  Branch (34677:24): [True: 0, False: 0]
  ------------------
34678|      0|                capture_var(s, &s->args[i]);
34679|      0|        }
34680|      0|        if (s->arguments_arg_idx >= 0)
  ------------------
  |  Branch (34680:13): [True: 0, False: 0]
  ------------------
34681|      0|            put_short_code(&bc_out, OP_set_loc, s->arguments_arg_idx);
34682|      0|        put_short_code(&bc_out, OP_put_loc, s->arguments_var_idx);
34683|      0|    }
34684|       |    /* initialize a reference to the current function if needed */
34685|     28|    if (s->func_var_idx >= 0) {
  ------------------
  |  Branch (34685:9): [True: 0, False: 28]
  ------------------
34686|      0|        dbuf_putc(&bc_out, OP_special_object);
34687|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_THIS_FUNC);
34688|      0|        put_short_code(&bc_out, OP_put_loc, s->func_var_idx);
34689|      0|    }
34690|       |    /* initialize the variable environment object if needed */
34691|     28|    if (s->var_object_idx >= 0) {
  ------------------
  |  Branch (34691:9): [True: 0, False: 28]
  ------------------
34692|      0|        dbuf_putc(&bc_out, OP_special_object);
34693|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_VAR_OBJECT);
34694|      0|        put_short_code(&bc_out, OP_put_loc, s->var_object_idx);
34695|      0|    }
34696|     28|    if (s->arg_var_object_idx >= 0) {
  ------------------
  |  Branch (34696:9): [True: 0, False: 28]
  ------------------
34697|      0|        dbuf_putc(&bc_out, OP_special_object);
34698|      0|        dbuf_putc(&bc_out, OP_SPECIAL_OBJECT_VAR_OBJECT);
34699|      0|        put_short_code(&bc_out, OP_put_loc, s->arg_var_object_idx);
34700|      0|    }
34701|       |
34702|    560|    for (pos = 0; pos < bc_len; pos = pos_next) {
  ------------------
  |  Branch (34702:19): [True: 532, False: 28]
  ------------------
34703|    532|        int val;
34704|    532|        op = bc_buf[pos];
34705|    532|        len = opcode_info[op].size;
34706|    532|        pos_next = pos + len;
34707|    532|        switch(op) {
34708|    136|        case OP_line_num:
  ------------------
  |  Branch (34708:9): [True: 136, False: 396]
  ------------------
34709|       |            /* line number info (for debug). We put it in a separate
34710|       |               compressed table to reduce memory usage and get better
34711|       |               performance */
34712|    136|            line_num = get_u32(bc_buf + pos + 1);
34713|    136|            break;
34714|       |
34715|     37|        case OP_label:
  ------------------
  |  Branch (34715:9): [True: 37, False: 495]
  ------------------
34716|     37|            {
34717|     37|                label = get_u32(bc_buf + pos + 1);
34718|     37|                assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34718:17): [True: 0, False: 37]
  |  Branch (34718:17): [True: 0, False: 0]
  |  Branch (34718:17): [True: 37, False: 0]
  |  Branch (34718:17): [True: 37, False: 0]
  ------------------
34719|     37|                ls = &label_slots[label];
34720|     37|                assert(ls->addr == -1);
  ------------------
  |  Branch (34720:17): [True: 0, False: 37]
  |  Branch (34720:17): [True: 37, False: 0]
  ------------------
34721|     37|                ls->addr = bc_out.size;
34722|       |                /* resolve the relocation entries */
34723|     58|                for(re = ls->first_reloc; re != NULL; re = re_next) {
  ------------------
  |  Branch (34723:43): [True: 21, False: 37]
  ------------------
34724|     21|                    int diff = ls->addr - re->addr;
34725|     21|                    re_next = re->next;
34726|     21|                    switch (re->size) {
  ------------------
  |  Branch (34726:29): [True: 21, False: 0]
  ------------------
34727|      0|                    case 4:
  ------------------
  |  Branch (34727:21): [True: 0, False: 21]
  ------------------
34728|      0|                        put_u32(bc_out.buf + re->addr, diff);
34729|      0|                        break;
34730|      0|                    case 2:
  ------------------
  |  Branch (34730:21): [True: 0, False: 21]
  ------------------
34731|      0|                        assert(diff == (int16_t)diff);
  ------------------
  |  Branch (34731:25): [True: 0, False: 0]
  |  Branch (34731:25): [True: 0, False: 0]
  ------------------
34732|      0|                        put_u16(bc_out.buf + re->addr, diff);
34733|      0|                        break;
34734|     21|                    case 1:
  ------------------
  |  Branch (34734:21): [True: 21, False: 0]
  ------------------
34735|     21|                        assert(diff == (int8_t)diff);
  ------------------
  |  Branch (34735:25): [True: 0, False: 21]
  |  Branch (34735:25): [True: 21, False: 0]
  ------------------
34736|     21|                        put_u8(bc_out.buf + re->addr, diff);
34737|     21|                        break;
34738|     21|                    }
34739|     21|                    js_free(ctx, re);
34740|     21|                }
34741|     37|                ls->first_reloc = NULL;
34742|     37|            }
34743|      0|            break;
34744|       |
34745|      5|        case OP_call:
  ------------------
  |  Branch (34745:9): [True: 5, False: 527]
  ------------------
34746|      8|        case OP_call_method:
  ------------------
  |  Branch (34746:9): [True: 3, False: 529]
  ------------------
34747|      8|            {
34748|       |                /* detect and transform tail calls */
34749|      8|                int argc;
34750|      8|                argc = get_u16(bc_buf + pos + 1);
34751|      8|                if (code_match(&cc, pos_next, OP_return, -1)) {
  ------------------
  |  Branch (34751:21): [True: 0, False: 8]
  ------------------
34752|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (34752:25): [True: 0, False: 0]
  ------------------
34753|      0|                    add_pc2line_info(s, bc_out.size, line_num);
34754|      0|                    put_short_code(&bc_out, op + 1, argc);
34755|      0|                    pos_next = skip_dead_code(s, bc_buf, bc_len, cc.pos, &line_num);
34756|      0|                    break;
34757|      0|                }
34758|      8|                add_pc2line_info(s, bc_out.size, line_num);
34759|      8|                put_short_code(&bc_out, op, argc);
34760|      8|                break;
34761|      8|            }
34762|      0|            goto no_change;
34763|       |
34764|     14|        case OP_return:
  ------------------
  |  Branch (34764:9): [True: 14, False: 518]
  ------------------
34765|     28|        case OP_return_undef:
  ------------------
  |  Branch (34765:9): [True: 14, False: 518]
  ------------------
34766|     42|        case OP_return_async:
  ------------------
  |  Branch (34766:9): [True: 14, False: 518]
  ------------------
34767|     42|        case OP_throw:
  ------------------
  |  Branch (34767:9): [True: 0, False: 532]
  ------------------
34768|     42|        case OP_throw_error:
  ------------------
  |  Branch (34768:9): [True: 0, False: 532]
  ------------------
34769|     42|            pos_next = skip_dead_code(s, bc_buf, bc_len, pos_next, &line_num);
34770|     42|            goto no_change;
34771|       |
34772|     13|        case OP_goto:
  ------------------
  |  Branch (34772:9): [True: 13, False: 519]
  ------------------
34773|     13|            label = get_u32(bc_buf + pos + 1);
34774|     13|        has_goto:
34775|     13|            if (OPTIMIZE) {
  ------------------
  |  |   50|     13|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 13, Folded]
  |  |  ------------------
  ------------------
34776|     13|                int line1 = -1;
34777|       |                /* Use custom matcher because multiple labels can follow */
34778|     13|                label = find_jump_target(s, label, &op1, &line1);
34779|     13|                if (code_has_label(&cc, pos_next, label)) {
  ------------------
  |  Branch (34779:21): [True: 6, False: 7]
  ------------------
34780|       |                    /* jump to next instruction: remove jump */
34781|      6|                    update_label(s, label, -1);
34782|      6|                    break;
34783|      6|                }
34784|      7|                if (op1 == OP_return || op1 == OP_return_undef || op1 == OP_throw) {
  ------------------
  |  Branch (34784:21): [True: 0, False: 7]
  |  Branch (34784:41): [True: 0, False: 7]
  |  Branch (34784:67): [True: 0, False: 7]
  ------------------
34785|       |                    /* jump to return/throw: remove jump, append return/throw */
34786|       |                    /* updating the line number obfuscates assembly listing */
34787|       |                    //if (line1 != -1) line_num = line1;
34788|      0|                    update_label(s, label, -1);
34789|      0|                    add_pc2line_info(s, bc_out.size, line_num);
34790|      0|                    dbuf_putc(&bc_out, op1);
34791|      0|                    pos_next = skip_dead_code(s, bc_buf, bc_len, pos_next, &line_num);
34792|      0|                    break;
34793|      0|                }
34794|       |                /* XXX: should duplicate single instructions followed by goto or return */
34795|       |                /* For example, can match one of these followed by return:
34796|       |                   push_i32 / push_const / push_atom_value / get_var /
34797|       |                   undefined / null / push_false / push_true / get_ref_value /
34798|       |                   get_loc / get_arg / get_var_ref
34799|       |                 */
34800|      7|            }
34801|      7|            goto has_label;
34802|       |
34803|      7|        case OP_gosub:
  ------------------
  |  Branch (34803:9): [True: 0, False: 532]
  ------------------
34804|      0|            label = get_u32(bc_buf + pos + 1);
34805|      0|            if (0 && OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
  |  Branch (34805:17): [Folded, False: 0]
  ------------------
34806|      0|                label = find_jump_target(s, label, &op1, NULL);
34807|      0|                if (op1 == OP_ret) {
  ------------------
  |  Branch (34807:21): [True: 0, False: 0]
  ------------------
34808|      0|                    update_label(s, label, -1);
34809|       |                    /* empty finally clause: remove gosub */
34810|      0|                    break;
34811|      0|                }
34812|      0|            }
34813|      0|            goto has_label;
34814|       |
34815|      0|        case OP_catch:
  ------------------
  |  Branch (34815:9): [True: 0, False: 532]
  ------------------
34816|      0|            label = get_u32(bc_buf + pos + 1);
34817|      0|            goto has_label;
34818|       |
34819|      2|        case OP_if_true:
  ------------------
  |  Branch (34819:9): [True: 2, False: 530]
  ------------------
34820|     19|        case OP_if_false:
  ------------------
  |  Branch (34820:9): [True: 17, False: 515]
  ------------------
34821|     19|            label = get_u32(bc_buf + pos + 1);
34822|     19|            if (OPTIMIZE) {
  ------------------
  |  |   50|     19|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 19, Folded]
  |  |  ------------------
  ------------------
34823|     19|                label = find_jump_target(s, label, &op1, NULL);
34824|       |                /* transform if_false/if_true(l1) label(l1) -> drop label(l1) */
34825|     19|                if (code_has_label(&cc, pos_next, label)) {
  ------------------
  |  Branch (34825:21): [True: 0, False: 19]
  ------------------
34826|      0|                    update_label(s, label, -1);
34827|      0|                    dbuf_putc(&bc_out, OP_drop);
34828|      0|                    break;
34829|      0|                }
34830|       |                /* transform if_false(l1) goto(l2) label(l1) -> if_false(l2) label(l1) */
34831|     19|                if (code_match(&cc, pos_next, OP_goto, -1)) {
  ------------------
  |  Branch (34831:21): [True: 0, False: 19]
  ------------------
34832|      0|                    int pos1 = cc.pos;
34833|      0|                    int line1 = cc.line_num;
34834|      0|                    if (code_has_label(&cc, pos1, label)) {
  ------------------
  |  Branch (34834:25): [True: 0, False: 0]
  ------------------
34835|      0|                        if (line1 != -1) line_num = line1;
  ------------------
  |  Branch (34835:29): [True: 0, False: 0]
  ------------------
34836|      0|                        pos_next = pos1;
34837|      0|                        update_label(s, label, -1);
34838|      0|                        label = cc.label;
34839|      0|                        op ^= OP_if_true ^ OP_if_false;
34840|      0|                    }
34841|      0|                }
34842|     19|            }
34843|     26|        has_label:
34844|     26|            add_pc2line_info(s, bc_out.size, line_num);
34845|     26|            if (op == OP_goto) {
  ------------------
  |  Branch (34845:17): [True: 7, False: 19]
  ------------------
34846|      7|                pos_next = skip_dead_code(s, bc_buf, bc_len, pos_next, &line_num);
34847|      7|            }
34848|     26|            assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34848:13): [True: 0, False: 26]
  |  Branch (34848:13): [True: 0, False: 0]
  |  Branch (34848:13): [True: 26, False: 0]
  |  Branch (34848:13): [True: 26, False: 0]
  ------------------
34849|     26|            ls = &label_slots[label];
34850|     26|#if SHORT_OPCODES
34851|     26|            jp = &s->jump_slots[s->jump_count++];
34852|     26|            jp->op = op;
34853|     26|            jp->size = 4;
34854|     26|            jp->pos = bc_out.size + 1;
34855|     26|            jp->label = label;
34856|       |
34857|     26|            if (ls->addr == -1) {
  ------------------
  |  Branch (34857:17): [True: 21, False: 5]
  ------------------
34858|     21|                int diff = ls->pos2 - pos - 1;
34859|     21|                if (diff < 128 && (op == OP_if_false || op == OP_if_true || op == OP_goto)) {
  ------------------
  |  Branch (34859:21): [True: 21, False: 0]
  |  Branch (34859:36): [True: 14, False: 7]
  |  Branch (34859:57): [True: 2, False: 5]
  |  Branch (34859:77): [True: 5, False: 0]
  ------------------
34860|     21|                    jp->size = 1;
34861|     21|                    jp->op = OP_if_false8 + (op - OP_if_false);
34862|     21|                    dbuf_putc(&bc_out, OP_if_false8 + (op - OP_if_false));
34863|     21|                    dbuf_putc(&bc_out, 0);
34864|     21|                    if (!add_reloc(ctx, ls, bc_out.size - 1, 1))
  ------------------
  |  Branch (34864:25): [True: 0, False: 21]
  ------------------
34865|      0|                        goto fail;
34866|     21|                    break;
34867|     21|                }
34868|      0|                if (diff < 32768 && op == OP_goto) {
  ------------------
  |  Branch (34868:21): [True: 0, False: 0]
  |  Branch (34868:37): [True: 0, False: 0]
  ------------------
34869|      0|                    jp->size = 2;
34870|      0|                    jp->op = OP_goto16;
34871|      0|                    dbuf_putc(&bc_out, OP_goto16);
34872|      0|                    dbuf_put_u16(&bc_out, 0);
34873|      0|                    if (!add_reloc(ctx, ls, bc_out.size - 2, 2))
  ------------------
  |  Branch (34873:25): [True: 0, False: 0]
  ------------------
34874|      0|                        goto fail;
34875|      0|                    break;
34876|      0|                }
34877|      5|            } else {
34878|      5|                int diff = ls->addr - bc_out.size - 1;
34879|      5|                if (diff == (int8_t)diff && (op == OP_if_false || op == OP_if_true || op == OP_goto)) {
  ------------------
  |  Branch (34879:21): [True: 5, False: 0]
  |  Branch (34879:46): [True: 3, False: 2]
  |  Branch (34879:67): [True: 0, False: 2]
  |  Branch (34879:87): [True: 2, False: 0]
  ------------------
34880|      5|                    jp->size = 1;
34881|      5|                    jp->op = OP_if_false8 + (op - OP_if_false);
34882|      5|                    dbuf_putc(&bc_out, OP_if_false8 + (op - OP_if_false));
34883|      5|                    dbuf_putc(&bc_out, diff);
34884|      5|                    break;
34885|      5|                }
34886|      0|                if (diff == (int16_t)diff && op == OP_goto) {
  ------------------
  |  Branch (34886:21): [True: 0, False: 0]
  |  Branch (34886:46): [True: 0, False: 0]
  ------------------
34887|      0|                    jp->size = 2;
34888|      0|                    jp->op = OP_goto16;
34889|      0|                    dbuf_putc(&bc_out, OP_goto16);
34890|      0|                    dbuf_put_u16(&bc_out, diff);
34891|      0|                    break;
34892|      0|                }
34893|      0|            }
34894|      0|#endif
34895|      0|            dbuf_putc(&bc_out, op);
34896|      0|            dbuf_put_u32(&bc_out, ls->addr - bc_out.size);
34897|      0|            if (ls->addr == -1) {
  ------------------
  |  Branch (34897:17): [True: 0, False: 0]
  ------------------
34898|       |                /* unresolved yet: create a new relocation entry */
34899|      0|                if (!add_reloc(ctx, ls, bc_out.size - 4, 4))
  ------------------
  |  Branch (34899:21): [True: 0, False: 0]
  ------------------
34900|      0|                    goto fail;
34901|      0|            }
34902|      0|            break;
34903|      0|        case OP_with_get_var:
  ------------------
  |  Branch (34903:9): [True: 0, False: 532]
  ------------------
34904|      0|        case OP_with_put_var:
  ------------------
  |  Branch (34904:9): [True: 0, False: 532]
  ------------------
34905|      0|        case OP_with_delete_var:
  ------------------
  |  Branch (34905:9): [True: 0, False: 532]
  ------------------
34906|      0|        case OP_with_make_ref:
  ------------------
  |  Branch (34906:9): [True: 0, False: 532]
  ------------------
34907|      0|        case OP_with_get_ref:
  ------------------
  |  Branch (34907:9): [True: 0, False: 532]
  ------------------
34908|      0|            {
34909|      0|                JSAtom atom;
34910|      0|                int is_with;
34911|       |
34912|      0|                atom = get_u32(bc_buf + pos + 1);
34913|      0|                label = get_u32(bc_buf + pos + 5);
34914|      0|                is_with = bc_buf[pos + 9];
34915|      0|                if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
34916|      0|                    label = find_jump_target(s, label, &op1, NULL);
34917|      0|                }
34918|      0|                assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34918:17): [True: 0, False: 0]
  |  Branch (34918:17): [True: 0, False: 0]
  |  Branch (34918:17): [True: 0, False: 0]
  |  Branch (34918:17): [True: 0, False: 0]
  ------------------
34919|      0|                ls = &label_slots[label];
34920|      0|                add_pc2line_info(s, bc_out.size, line_num);
34921|      0|#if SHORT_OPCODES
34922|      0|                jp = &s->jump_slots[s->jump_count++];
34923|      0|                jp->op = op;
34924|      0|                jp->size = 4;
34925|      0|                jp->pos = bc_out.size + 5;
34926|      0|                jp->label = label;
34927|      0|#endif
34928|      0|                dbuf_putc(&bc_out, op);
34929|      0|                dbuf_put_u32(&bc_out, atom);
34930|      0|                dbuf_put_u32(&bc_out, ls->addr - bc_out.size);
34931|      0|                if (ls->addr == -1) {
  ------------------
  |  Branch (34931:21): [True: 0, False: 0]
  ------------------
34932|       |                    /* unresolved yet: create a new relocation entry */
34933|      0|                    if (!add_reloc(ctx, ls, bc_out.size - 4, 4))
  ------------------
  |  Branch (34933:25): [True: 0, False: 0]
  ------------------
34934|      0|                        goto fail;
34935|      0|                }
34936|      0|                dbuf_putc(&bc_out, is_with);
34937|      0|            }
34938|      0|            break;
34939|       |
34940|     11|        case OP_drop:
  ------------------
  |  Branch (34940:9): [True: 11, False: 521]
  ------------------
34941|     11|            if (OPTIMIZE) {
  ------------------
  |  |   50|     11|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 11, Folded]
  |  |  ------------------
  ------------------
34942|       |                /* remove useless drops before return */
34943|     11|                if (code_match(&cc, pos_next, OP_return_undef, -1)) {
  ------------------
  |  Branch (34943:21): [True: 0, False: 11]
  ------------------
34944|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (34944:25): [True: 0, False: 0]
  ------------------
34945|      0|                    break;
34946|      0|                }
34947|     11|            }
34948|     11|            goto no_change;
34949|       |
34950|     11|        case OP_null:
  ------------------
  |  Branch (34950:9): [True: 0, False: 532]
  ------------------
34951|      0|#if SHORT_OPCODES
34952|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
34953|       |                /* transform null strict_eq into is_null */
34954|      0|                if (code_match(&cc, pos_next, OP_strict_eq, -1)) {
  ------------------
  |  Branch (34954:21): [True: 0, False: 0]
  ------------------
34955|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (34955:25): [True: 0, False: 0]
  ------------------
34956|      0|                    add_pc2line_info(s, bc_out.size, line_num);
34957|      0|                    dbuf_putc(&bc_out, OP_is_null);
34958|      0|                    pos_next = cc.pos;
34959|      0|                    break;
34960|      0|                }
34961|       |                /* transform null strict_neq if_false/if_true -> is_null if_true/if_false */
34962|      0|                if (code_match(&cc, pos_next, OP_strict_neq, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33681|      0|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (34962:21): [True: 0, False: 0]
  ------------------
34963|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (34963:25): [True: 0, False: 0]
  ------------------
34964|      0|                    add_pc2line_info(s, bc_out.size, line_num);
34965|      0|                    dbuf_putc(&bc_out, OP_is_null);
34966|      0|                    pos_next = cc.pos;
34967|      0|                    label = cc.label;
34968|      0|                    op = cc.op ^ OP_if_false ^ OP_if_true;
34969|      0|                    goto has_label;
34970|      0|                }
34971|      0|            }
34972|      0|#endif
34973|       |            /* fall thru */
34974|      0|        case OP_push_false:
  ------------------
  |  Branch (34974:9): [True: 0, False: 532]
  ------------------
34975|      0|        case OP_push_true:
  ------------------
  |  Branch (34975:9): [True: 0, False: 532]
  ------------------
34976|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
34977|      0|                val = (op == OP_push_true);
34978|      0|                if (code_match(&cc, pos_next, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33681|      0|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (34978:21): [True: 0, False: 0]
  ------------------
34979|      0|                has_constant_test:
34980|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (34980:25): [True: 0, False: 0]
  ------------------
34981|      0|                    if (val == cc.op - OP_if_false) {
  ------------------
  |  Branch (34981:25): [True: 0, False: 0]
  ------------------
34982|       |                        /* transform null if_false(l1) -> goto l1 */
34983|       |                        /* transform false if_false(l1) -> goto l1 */
34984|       |                        /* transform true if_true(l1) -> goto l1 */
34985|      0|                        pos_next = cc.pos;
34986|      0|                        op = OP_goto;
34987|      0|                        label = cc.label;
34988|      0|                        goto has_goto;
34989|      0|                    } else {
34990|       |                        /* transform null if_true(l1) -> nop */
34991|       |                        /* transform false if_true(l1) -> nop */
34992|       |                        /* transform true if_false(l1) -> nop */
34993|      0|                        pos_next = cc.pos;
34994|      0|                        update_label(s, cc.label, -1);
34995|      0|                        break;
34996|      0|                    }
34997|      0|                }
34998|      0|            }
34999|      0|            goto no_change;
35000|       |
35001|      7|        case OP_push_i32:
  ------------------
  |  Branch (35001:9): [True: 7, False: 525]
  ------------------
35002|      7|            if (OPTIMIZE) {
  ------------------
  |  |   50|      7|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 7, Folded]
  |  |  ------------------
  ------------------
35003|       |                /* transform i32(val) neg -> i32(-val) */
35004|      7|                val = get_i32(bc_buf + pos + 1);
35005|      7|                if ((val != INT32_MIN && val != 0)
  ------------------
  |  Branch (35005:22): [True: 7, False: 0]
  |  Branch (35005:42): [True: 5, False: 2]
  ------------------
35006|      5|                &&  code_match(&cc, pos_next, OP_neg, -1)) {
  ------------------
  |  Branch (35006:21): [True: 0, False: 5]
  ------------------
35007|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35007:25): [True: 0, False: 0]
  ------------------
35008|      0|                    if (code_match(&cc, cc.pos, OP_drop, -1)) {
  ------------------
  |  Branch (35008:25): [True: 0, False: 0]
  ------------------
35009|      0|                        if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35009:29): [True: 0, False: 0]
  ------------------
35010|      0|                    } else {
35011|      0|                        add_pc2line_info(s, bc_out.size, line_num);
35012|      0|                        push_short_int(&bc_out, -val);
35013|      0|                    }
35014|      0|                    pos_next = cc.pos;
35015|      0|                    break;
35016|      0|                }
35017|       |                /* remove push/drop pairs generated by the parser */
35018|      7|                if (code_match(&cc, pos_next, OP_drop, -1)) {
  ------------------
  |  Branch (35018:21): [True: 2, False: 5]
  ------------------
35019|      2|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35019:25): [True: 0, False: 2]
  ------------------
35020|      2|                    pos_next = cc.pos;
35021|      2|                    break;
35022|      2|                }
35023|       |                /* Optimize constant tests: `if (0)`, `if (1)`, `if (!0)`... */
35024|      5|                if (code_match(&cc, pos_next, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33681|      5|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35024:21): [True: 0, False: 5]
  ------------------
35025|      0|                    val = (val != 0);
35026|      0|                    goto has_constant_test;
35027|      0|                }
35028|      5|                add_pc2line_info(s, bc_out.size, line_num);
35029|      5|                push_short_int(&bc_out, val);
35030|      5|                break;
35031|      5|            }
35032|      0|            goto no_change;
35033|       |
35034|      0|        case OP_push_bigint_i32:
  ------------------
  |  Branch (35034:9): [True: 0, False: 532]
  ------------------
35035|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35036|       |                /* transform i32(val) neg -> i32(-val) */
35037|      0|                val = get_i32(bc_buf + pos + 1);
35038|      0|                if (val != INT32_MIN
  ------------------
  |  Branch (35038:21): [True: 0, False: 0]
  ------------------
35039|      0|                &&  code_match(&cc, pos_next, OP_neg, -1)) {
  ------------------
  |  Branch (35039:21): [True: 0, False: 0]
  ------------------
35040|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35040:25): [True: 0, False: 0]
  ------------------
35041|      0|                    if (code_match(&cc, cc.pos, OP_drop, -1)) {
  ------------------
  |  Branch (35041:25): [True: 0, False: 0]
  ------------------
35042|      0|                        if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35042:29): [True: 0, False: 0]
  ------------------
35043|      0|                    } else {
35044|      0|                        add_pc2line_info(s, bc_out.size, line_num);
35045|      0|                        dbuf_putc(&bc_out, OP_push_bigint_i32);
35046|      0|                        dbuf_put_u32(&bc_out, -val);
35047|      0|                    }
35048|      0|                    pos_next = cc.pos;
35049|      0|                    break;
35050|      0|                }
35051|      0|            }
35052|      0|            goto no_change;
35053|       |
35054|      0|#if SHORT_OPCODES
35055|     13|        case OP_push_const:
  ------------------
  |  Branch (35055:9): [True: 13, False: 519]
  ------------------
35056|     15|        case OP_fclosure:
  ------------------
  |  Branch (35056:9): [True: 2, False: 530]
  ------------------
35057|     15|            if (OPTIMIZE) {
  ------------------
  |  |   50|     15|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 15, Folded]
  |  |  ------------------
  ------------------
35058|     15|                int idx = get_u32(bc_buf + pos + 1);
35059|     15|                if (idx < 256) {
  ------------------
  |  Branch (35059:21): [True: 15, False: 0]
  ------------------
35060|     15|                    add_pc2line_info(s, bc_out.size, line_num);
35061|     15|                    dbuf_putc(&bc_out, OP_push_const8 + op - OP_push_const);
35062|     15|                    dbuf_putc(&bc_out, idx);
35063|     15|                    break;
35064|     15|                }
35065|     15|            }
35066|      0|            goto no_change;
35067|       |
35068|      2|        case OP_get_field:
  ------------------
  |  Branch (35068:9): [True: 2, False: 530]
  ------------------
35069|      2|            if (OPTIMIZE) {
  ------------------
  |  |   50|      2|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 2, Folded]
  |  |  ------------------
  ------------------
35070|      2|                JSAtom atom = get_u32(bc_buf + pos + 1);
35071|      2|                if (atom == JS_ATOM_length) {
  ------------------
  |  Branch (35071:21): [True: 0, False: 2]
  ------------------
35072|      0|                    JS_FreeAtom(ctx, atom);
35073|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35074|      0|                    dbuf_putc(&bc_out, OP_get_length);
35075|      0|                    break;
35076|      0|                }
35077|      2|            }
35078|      2|            goto no_change;
35079|      2|#endif
35080|     10|        case OP_push_atom_value:
  ------------------
  |  Branch (35080:9): [True: 10, False: 522]
  ------------------
35081|     10|            if (OPTIMIZE) {
  ------------------
  |  |   50|     10|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 10, Folded]
  |  |  ------------------
  ------------------
35082|     10|                JSAtom atom = get_u32(bc_buf + pos + 1);
35083|       |                /* remove push/drop pairs generated by the parser */
35084|     10|                if (code_match(&cc, pos_next, OP_drop, -1)) {
  ------------------
  |  Branch (35084:21): [True: 0, False: 10]
  ------------------
35085|      0|                    JS_FreeAtom(ctx, atom);
35086|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35086:25): [True: 0, False: 0]
  ------------------
35087|      0|                    pos_next = cc.pos;
35088|      0|                    break;
35089|      0|                }
35090|     10|#if SHORT_OPCODES
35091|     10|                if (atom == JS_ATOM_empty_string) {
  ------------------
  |  Branch (35091:21): [True: 2, False: 8]
  ------------------
35092|      2|                    JS_FreeAtom(ctx, atom);
35093|      2|                    add_pc2line_info(s, bc_out.size, line_num);
35094|      2|                    dbuf_putc(&bc_out, OP_push_empty_string);
35095|      2|                    break;
35096|      2|                }
35097|     10|#endif
35098|     10|            }
35099|      8|            goto no_change;
35100|       |
35101|      8|        case OP_to_propkey:
  ------------------
  |  Branch (35101:9): [True: 0, False: 532]
  ------------------
35102|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35103|       |                /* remove redundant to_propkey opcodes when storing simple data */
35104|      0|                if (code_match(&cc, pos_next, M3(OP_get_loc, OP_get_arg, OP_get_var_ref), -1, OP_put_array_el, -1)
  ------------------
  |  |33682|      0|#define M3(op1, op2, op3)       ((op1) | ((op2) << 8) | ((op3) << 16))
  ------------------
  |  Branch (35104:21): [True: 0, False: 0]
  ------------------
35105|      0|                ||  code_match(&cc, pos_next, M3(OP_push_i32, OP_push_const, OP_push_atom_value), OP_put_array_el, -1)
  ------------------
  |  |33682|      0|#define M3(op1, op2, op3)       ((op1) | ((op2) << 8) | ((op3) << 16))
  ------------------
  |  Branch (35105:21): [True: 0, False: 0]
  ------------------
35106|      0|                ||  code_match(&cc, pos_next, M4(OP_undefined, OP_null, OP_push_true, OP_push_false), OP_put_array_el, -1)) {
  ------------------
  |  |33683|      0|#define M4(op1, op2, op3, op4)  ((op1) | ((op2) << 8) | ((op3) << 16) | ((op4) << 24))
  ------------------
  |  Branch (35106:21): [True: 0, False: 0]
  ------------------
35107|      0|                    break;
35108|      0|                }
35109|      0|            }
35110|      0|            goto no_change;
35111|       |
35112|     19|        case OP_undefined:
  ------------------
  |  Branch (35112:9): [True: 19, False: 513]
  ------------------
35113|     19|            if (OPTIMIZE) {
  ------------------
  |  |   50|     19|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 19, Folded]
  |  |  ------------------
  ------------------
35114|       |                /* remove push/drop pairs generated by the parser */
35115|     19|                if (code_match(&cc, pos_next, OP_drop, -1)) {
  ------------------
  |  Branch (35115:21): [True: 0, False: 19]
  ------------------
35116|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35116:25): [True: 0, False: 0]
  ------------------
35117|      0|                    pos_next = cc.pos;
35118|      0|                    break;
35119|      0|                }
35120|       |                /* transform undefined return -> return_undefined */
35121|     19|                if (code_match(&cc, pos_next, OP_return, -1)) {
  ------------------
  |  Branch (35121:21): [True: 0, False: 19]
  ------------------
35122|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35122:25): [True: 0, False: 0]
  ------------------
35123|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35124|      0|                    dbuf_putc(&bc_out, OP_return_undef);
35125|      0|                    pos_next = cc.pos;
35126|      0|                    break;
35127|      0|                }
35128|       |                /* transform undefined if_true(l1)/if_false(l1) -> nop/goto(l1) */
35129|     19|                if (code_match(&cc, pos_next, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33681|     19|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35129:21): [True: 0, False: 19]
  ------------------
35130|      0|                    val = 0;
35131|      0|                    goto has_constant_test;
35132|      0|                }
35133|     19|#if SHORT_OPCODES
35134|       |                /* transform undefined strict_eq -> is_undefined */
35135|     19|                if (code_match(&cc, pos_next, OP_strict_eq, -1)) {
  ------------------
  |  Branch (35135:21): [True: 2, False: 17]
  ------------------
35136|      2|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35136:25): [True: 0, False: 2]
  ------------------
35137|      2|                    add_pc2line_info(s, bc_out.size, line_num);
35138|      2|                    dbuf_putc(&bc_out, OP_is_undefined);
35139|      2|                    pos_next = cc.pos;
35140|      2|                    break;
35141|      2|                }
35142|       |                /* transform undefined strict_neq if_false/if_true -> is_undefined if_true/if_false */
35143|     17|                if (code_match(&cc, pos_next, OP_strict_neq, M2(OP_if_false, OP_if_true), -1)) {
  ------------------
  |  |33681|     17|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35143:21): [True: 0, False: 17]
  ------------------
35144|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35144:25): [True: 0, False: 0]
  ------------------
35145|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35146|      0|                    dbuf_putc(&bc_out, OP_is_undefined);
35147|      0|                    pos_next = cc.pos;
35148|      0|                    label = cc.label;
35149|      0|                    op = cc.op ^ OP_if_false ^ OP_if_true;
35150|      0|                    goto has_label;
35151|      0|                }
35152|     17|#endif
35153|     17|            }
35154|     17|            goto no_change;
35155|       |
35156|     28|        case OP_insert2:
  ------------------
  |  Branch (35156:9): [True: 28, False: 504]
  ------------------
35157|     28|            if (OPTIMIZE) {
  ------------------
  |  |   50|     28|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 28, Folded]
  |  |  ------------------
  ------------------
35158|       |                /* Transformation:
35159|       |                   insert2 put_field(a) drop -> put_field(a)
35160|       |                */
35161|     28|                if (code_match(&cc, pos_next, OP_put_field, OP_drop, -1)) {
  ------------------
  |  Branch (35161:21): [True: 28, False: 0]
  ------------------
35162|     28|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35162:25): [True: 0, False: 28]
  ------------------
35163|     28|                    add_pc2line_info(s, bc_out.size, line_num);
35164|     28|                    dbuf_putc(&bc_out, OP_put_field);
35165|     28|                    dbuf_put_u32(&bc_out, cc.atom);
35166|     28|                    pos_next = cc.pos;
35167|     28|                    break;
35168|     28|                }
35169|     28|            }
35170|      0|            goto no_change;
35171|       |
35172|     14|        case OP_dup:
  ------------------
  |  Branch (35172:9): [True: 14, False: 518]
  ------------------
35173|     14|            if (OPTIMIZE) {
  ------------------
  |  |   50|     14|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 14, Folded]
  |  |  ------------------
  ------------------
35174|       |                /* Transformation: dup put_x(n) drop -> put_x(n) */
35175|     14|                int op1, line2 = -1;
35176|       |                /* Transformation: dup put_x(n) -> set_x(n) */
35177|     14|                if (code_match(&cc, pos_next, M4(OP_put_loc, OP_put_loc_check, OP_put_arg, OP_put_var_ref), -1, -1)) {
  ------------------
  |  |33683|     14|#define M4(op1, op2, op3, op4)  ((op1) | ((op2) << 8) | ((op3) << 16) | ((op4) << 24))
  ------------------
  |  Branch (35177:21): [True: 7, False: 7]
  ------------------
35178|      7|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35178:25): [True: 0, False: 7]
  ------------------
35179|      7|                    op1 = cc.op + 1;  /* put_x -> set_x */
35180|      7|                    pos_next = cc.pos;
35181|      7|                    if (code_match(&cc, cc.pos, OP_drop, -1)) {
  ------------------
  |  Branch (35181:25): [True: 0, False: 7]
  ------------------
35182|      0|                        if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35182:29): [True: 0, False: 0]
  ------------------
35183|      0|                        op1 -= 1; /* set_x drop -> put_x */
35184|      0|                        pos_next = cc.pos;
35185|      0|                        if (code_match(&cc, cc.pos, op1 - 1, cc.idx, -1)) {
  ------------------
  |  Branch (35185:29): [True: 0, False: 0]
  ------------------
35186|      0|                            line2 = cc.line_num; /* delay line number update */
35187|      0|                            op1 += 1;   /* put_x(n) get_x(n) -> set_x(n) */
35188|      0|                            pos_next = cc.pos;
35189|      0|                        }
35190|      0|                    }
35191|      7|                    add_pc2line_info(s, bc_out.size, line_num);
35192|      7|                    put_short_code(&bc_out, op1, cc.idx);
35193|      7|                    if (line2 >= 0) line_num = line2;
  ------------------
  |  Branch (35193:25): [True: 0, False: 7]
  ------------------
35194|      7|                    break;
35195|      7|                }
35196|     14|            }
35197|      7|            goto no_change;
35198|       |
35199|      7|        case OP_get_loc:
  ------------------
  |  Branch (35199:9): [True: 3, False: 529]
  ------------------
35200|      3|            if (OPTIMIZE) {
  ------------------
  |  |   50|      3|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 3, Folded]
  |  |  ------------------
  ------------------
35201|       |                /* transformation:
35202|       |                   get_loc(n) post_dec put_loc(n) drop -> dec_loc(n)
35203|       |                   get_loc(n) post_inc put_loc(n) drop -> inc_loc(n)
35204|       |                   get_loc(n) dec dup put_loc(n) drop -> dec_loc(n)
35205|       |                   get_loc(n) inc dup put_loc(n) drop -> inc_loc(n)
35206|       |                 */
35207|      3|                int idx;
35208|      3|                idx = get_u16(bc_buf + pos + 1);
35209|      3|                if (idx >= 256)
  ------------------
  |  Branch (35209:21): [True: 0, False: 3]
  ------------------
35210|      0|                    goto no_change;
35211|      3|                if (code_match(&cc, pos_next, M2(OP_post_dec, OP_post_inc), OP_put_loc, idx, OP_drop, -1) ||
  ------------------
  |  |33681|      3|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35211:21): [True: 0, False: 3]
  ------------------
35212|      3|                    code_match(&cc, pos_next, M2(OP_dec, OP_inc), OP_dup, OP_put_loc, idx, OP_drop, -1)) {
  ------------------
  |  |33681|      3|#define M2(op1, op2)            ((op1) | ((op2) << 8))
  ------------------
  |  Branch (35212:21): [True: 0, False: 3]
  ------------------
35213|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35213:25): [True: 0, False: 0]
  ------------------
35214|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35215|      0|                    dbuf_putc(&bc_out, (cc.op == OP_inc || cc.op == OP_post_inc) ? OP_inc_loc : OP_dec_loc);
  ------------------
  |  Branch (35215:41): [True: 0, False: 0]
  |  Branch (35215:60): [True: 0, False: 0]
  ------------------
35216|      0|                    dbuf_putc(&bc_out, idx);
35217|      0|                    pos_next = cc.pos;
35218|      0|                    break;
35219|      0|                }
35220|       |                /* transformation:
35221|       |                   get_loc(n) push_atom_value(x) add dup put_loc(n) drop -> push_atom_value(x) add_loc(n)
35222|       |                 */
35223|      3|                if (code_match(&cc, pos_next, OP_push_atom_value, OP_add, OP_dup, OP_put_loc, idx, OP_drop, -1)) {
  ------------------
  |  Branch (35223:21): [True: 0, False: 3]
  ------------------
35224|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35224:25): [True: 0, False: 0]
  ------------------
35225|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35226|      0|#if SHORT_OPCODES
35227|      0|                    if (cc.atom == JS_ATOM_empty_string) {
  ------------------
  |  Branch (35227:25): [True: 0, False: 0]
  ------------------
35228|      0|                        JS_FreeAtom(ctx, cc.atom);
35229|      0|                        dbuf_putc(&bc_out, OP_push_empty_string);
35230|      0|                    } else
35231|      0|#endif
35232|      0|                    {
35233|      0|                        dbuf_putc(&bc_out, OP_push_atom_value);
35234|      0|                        dbuf_put_u32(&bc_out, cc.atom);
35235|      0|                    }
35236|      0|                    dbuf_putc(&bc_out, OP_add_loc);
35237|      0|                    dbuf_putc(&bc_out, idx);
35238|      0|                    pos_next = cc.pos;
35239|      0|                    break;
35240|      0|                }
35241|       |                /* transformation:
35242|       |                   get_loc(n) push_i32(x) add dup put_loc(n) drop -> push_i32(x) add_loc(n)
35243|       |                 */
35244|      3|                if (code_match(&cc, pos_next, OP_push_i32, OP_add, OP_dup, OP_put_loc, idx, OP_drop, -1)) {
  ------------------
  |  Branch (35244:21): [True: 0, False: 3]
  ------------------
35245|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35245:25): [True: 0, False: 0]
  ------------------
35246|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35247|      0|                    push_short_int(&bc_out, cc.label);
35248|      0|                    dbuf_putc(&bc_out, OP_add_loc);
35249|      0|                    dbuf_putc(&bc_out, idx);
35250|      0|                    pos_next = cc.pos;
35251|      0|                    break;
35252|      0|                }
35253|       |                /* transformation: XXX: also do these:
35254|       |                   get_loc(n) get_loc(x) add dup put_loc(n) drop -> get_loc(x) add_loc(n)
35255|       |                   get_loc(n) get_arg(x) add dup put_loc(n) drop -> get_arg(x) add_loc(n)
35256|       |                   get_loc(n) get_var_ref(x) add dup put_loc(n) drop -> get_var_ref(x) add_loc(n)
35257|       |                 */
35258|      3|                if (code_match(&cc, pos_next, M3(OP_get_loc, OP_get_arg, OP_get_var_ref), -1, OP_add, OP_dup, OP_put_loc, idx, OP_drop, -1)) {
  ------------------
  |  |33682|      3|#define M3(op1, op2, op3)       ((op1) | ((op2) << 8) | ((op3) << 16))
  ------------------
  |  Branch (35258:21): [True: 0, False: 3]
  ------------------
35259|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35259:25): [True: 0, False: 0]
  ------------------
35260|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35261|      0|                    put_short_code(&bc_out, cc.op, cc.idx);
35262|      0|                    dbuf_putc(&bc_out, OP_add_loc);
35263|      0|                    dbuf_putc(&bc_out, idx);
35264|      0|                    pos_next = cc.pos;
35265|      0|                    break;
35266|      0|                }
35267|      3|                add_pc2line_info(s, bc_out.size, line_num);
35268|      3|                put_short_code(&bc_out, op, idx);
35269|      3|                break;
35270|      3|            }
35271|      0|            goto no_change;
35272|      0|#if SHORT_OPCODES
35273|      4|        case OP_get_arg:
  ------------------
  |  Branch (35273:9): [True: 4, False: 528]
  ------------------
35274|      4|        case OP_get_var_ref:
  ------------------
  |  Branch (35274:9): [True: 0, False: 532]
  ------------------
35275|      4|            if (OPTIMIZE) {
  ------------------
  |  |   50|      4|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 4, Folded]
  |  |  ------------------
  ------------------
35276|      4|                int idx;
35277|      4|                idx = get_u16(bc_buf + pos + 1);
35278|      4|                add_pc2line_info(s, bc_out.size, line_num);
35279|      4|                put_short_code(&bc_out, op, idx);
35280|      4|                break;
35281|      4|            }
35282|      0|            goto no_change;
35283|      0|#endif
35284|     30|        case OP_put_loc:
  ------------------
  |  Branch (35284:9): [True: 30, False: 502]
  ------------------
35285|     30|        case OP_put_loc_check:
  ------------------
  |  Branch (35285:9): [True: 0, False: 532]
  ------------------
35286|     30|        case OP_put_arg:
  ------------------
  |  Branch (35286:9): [True: 0, False: 532]
  ------------------
35287|     30|        case OP_put_var_ref:
  ------------------
  |  Branch (35287:9): [True: 0, False: 532]
  ------------------
35288|     30|            if (OPTIMIZE) {
  ------------------
  |  |   50|     30|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 30, Folded]
  |  |  ------------------
  ------------------
35289|       |                /* transformation: put_x(n) get_x(n) -> set_x(n) */
35290|     30|                int idx;
35291|     30|                idx = get_u16(bc_buf + pos + 1);
35292|     30|                if (code_match(&cc, pos_next, op - 1, idx, -1)) {
  ------------------
  |  Branch (35292:21): [True: 11, False: 19]
  ------------------
35293|     11|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35293:25): [True: 2, False: 9]
  ------------------
35294|     11|                    add_pc2line_info(s, bc_out.size, line_num);
35295|     11|                    put_short_code(&bc_out, op + 1, idx);
35296|     11|                    pos_next = cc.pos;
35297|     11|                    break;
35298|     11|                }
35299|     19|                add_pc2line_info(s, bc_out.size, line_num);
35300|     19|                put_short_code(&bc_out, op, idx);
35301|     19|                break;
35302|     30|            }
35303|      0|            goto no_change;
35304|       |
35305|      0|        case OP_post_inc:
  ------------------
  |  Branch (35305:9): [True: 0, False: 532]
  ------------------
35306|      0|        case OP_post_dec:
  ------------------
  |  Branch (35306:9): [True: 0, False: 532]
  ------------------
35307|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35308|       |                /* transformation:
35309|       |                   post_inc put_x drop -> inc put_x
35310|       |                   post_inc perm3 put_field drop -> inc put_field
35311|       |                   post_inc perm4 put_array_el drop -> inc put_array_el
35312|       |                 */
35313|      0|                int op1, idx;
35314|      0|                if (code_match(&cc, pos_next, M3(OP_put_loc, OP_put_arg, OP_put_var_ref), -1, OP_drop, -1)) {
  ------------------
  |  |33682|      0|#define M3(op1, op2, op3)       ((op1) | ((op2) << 8) | ((op3) << 16))
  ------------------
  |  Branch (35314:21): [True: 0, False: 0]
  ------------------
35315|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35315:25): [True: 0, False: 0]
  ------------------
35316|      0|                    op1 = cc.op;
35317|      0|                    idx = cc.idx;
35318|      0|                    pos_next = cc.pos;
35319|      0|                    if (code_match(&cc, cc.pos, op1 - 1, idx, -1)) {
  ------------------
  |  Branch (35319:25): [True: 0, False: 0]
  ------------------
35320|      0|                        if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35320:29): [True: 0, False: 0]
  ------------------
35321|      0|                        op1 += 1;   /* put_x(n) get_x(n) -> set_x(n) */
35322|      0|                        pos_next = cc.pos;
35323|      0|                    }
35324|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35325|      0|                    dbuf_putc(&bc_out, OP_dec + (op - OP_post_dec));
35326|      0|                    put_short_code(&bc_out, op1, idx);
35327|      0|                    break;
35328|      0|                }
35329|      0|                if (code_match(&cc, pos_next, OP_perm3, OP_put_field, OP_drop, -1)) {
  ------------------
  |  Branch (35329:21): [True: 0, False: 0]
  ------------------
35330|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35330:25): [True: 0, False: 0]
  ------------------
35331|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35332|      0|                    dbuf_putc(&bc_out, OP_dec + (op - OP_post_dec));
35333|      0|                    dbuf_putc(&bc_out, OP_put_field);
35334|      0|                    dbuf_put_u32(&bc_out, cc.atom);
35335|      0|                    pos_next = cc.pos;
35336|      0|                    break;
35337|      0|                }
35338|      0|                if (code_match(&cc, pos_next, OP_perm4, OP_put_array_el, OP_drop, -1)) {
  ------------------
  |  Branch (35338:21): [True: 0, False: 0]
  ------------------
35339|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35339:25): [True: 0, False: 0]
  ------------------
35340|      0|                    add_pc2line_info(s, bc_out.size, line_num);
35341|      0|                    dbuf_putc(&bc_out, OP_dec + (op - OP_post_dec));
35342|      0|                    dbuf_putc(&bc_out, OP_put_array_el);
35343|      0|                    pos_next = cc.pos;
35344|      0|                    break;
35345|      0|                }
35346|      0|            }
35347|      0|            goto no_change;
35348|       |
35349|      0|#if SHORT_OPCODES
35350|      0|        case OP_typeof:
  ------------------
  |  Branch (35350:9): [True: 0, False: 532]
  ------------------
35351|      0|            if (OPTIMIZE) {
  ------------------
  |  |   50|      0|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
35352|       |                /* simplify typeof tests */
35353|      0|                if (code_match(&cc, pos_next, OP_push_atom_value, M4(OP_strict_eq, OP_strict_neq, OP_eq, OP_neq), -1)) {
  ------------------
  |  |33683|      0|#define M4(op1, op2, op3, op4)  ((op1) | ((op2) << 8) | ((op3) << 16) | ((op4) << 24))
  ------------------
  |  Branch (35353:21): [True: 0, False: 0]
  ------------------
35354|      0|                    if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35354:25): [True: 0, False: 0]
  ------------------
35355|      0|                    int op1 = (cc.op == OP_strict_eq || cc.op == OP_eq) ? OP_strict_eq : OP_strict_neq;
  ------------------
  |  Branch (35355:32): [True: 0, False: 0]
  |  Branch (35355:57): [True: 0, False: 0]
  ------------------
35356|      0|                    int op2 = -1;
35357|      0|                    switch (cc.atom) {
  ------------------
  |  Branch (35357:29): [True: 0, False: 0]
  ------------------
35358|      0|                    case JS_ATOM_undefined:
  ------------------
  |  Branch (35358:21): [True: 0, False: 0]
  ------------------
35359|      0|                        op2 = OP_typeof_is_undefined;
35360|      0|                        break;
35361|      0|                    case JS_ATOM_function:
  ------------------
  |  Branch (35361:21): [True: 0, False: 0]
  ------------------
35362|      0|                        op2 = OP_typeof_is_function;
35363|      0|                        break;
35364|      0|                    }
35365|      0|                    if (op2 >= 0) {
  ------------------
  |  Branch (35365:25): [True: 0, False: 0]
  ------------------
35366|       |                        /* transform typeof(s) == "<type>" into is_<type> */
35367|      0|                        if (op1 == OP_strict_eq) {
  ------------------
  |  Branch (35367:29): [True: 0, False: 0]
  ------------------
35368|      0|                            add_pc2line_info(s, bc_out.size, line_num);
35369|      0|                            dbuf_putc(&bc_out, op2);
35370|      0|                            JS_FreeAtom(ctx, cc.atom);
35371|      0|                            pos_next = cc.pos;
35372|      0|                            break;
35373|      0|                        }
35374|      0|                        if (op1 == OP_strict_neq && code_match(&cc, cc.pos, OP_if_false, -1)) {
  ------------------
  |  Branch (35374:29): [True: 0, False: 0]
  |  Branch (35374:53): [True: 0, False: 0]
  ------------------
35375|       |                            /* transform typeof(s) != "<type>" if_false into is_<type> if_true */
35376|      0|                            if (cc.line_num >= 0) line_num = cc.line_num;
  ------------------
  |  Branch (35376:33): [True: 0, False: 0]
  ------------------
35377|      0|                            add_pc2line_info(s, bc_out.size, line_num);
35378|      0|                            dbuf_putc(&bc_out, op2);
35379|      0|                            JS_FreeAtom(ctx, cc.atom);
35380|      0|                            pos_next = cc.pos;
35381|      0|                            label = cc.label;
35382|      0|                            op = OP_if_true;
35383|      0|                            goto has_label;
35384|      0|                        }
35385|      0|                    }
35386|      0|                }
35387|      0|            }
35388|      0|            goto no_change;
35389|      0|#endif
35390|       |
35391|    134|        default:
  ------------------
  |  Branch (35391:9): [True: 134, False: 398]
  ------------------
35392|    221|        no_change:
35393|    221|            add_pc2line_info(s, bc_out.size, line_num);
35394|    221|            dbuf_put(&bc_out, bc_buf + pos, len);
35395|    221|            break;
35396|    532|        }
35397|    532|    }
35398|       |
35399|       |    /* check that there were no missing labels */
35400|     65|    for(i = 0; i < s->label_count; i++) {
  ------------------
  |  Branch (35400:16): [True: 37, False: 28]
  ------------------
35401|     37|        assert(label_slots[i].first_reloc == NULL);
  ------------------
  |  Branch (35401:9): [True: 0, False: 37]
  |  Branch (35401:9): [True: 37, False: 0]
  ------------------
35402|     37|    }
35403|     28|#if SHORT_OPCODES
35404|     28|    if (OPTIMIZE) {
  ------------------
  |  |   50|     28|#define OPTIMIZE         1
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 28, Folded]
  |  |  ------------------
  ------------------
35405|       |        /* more jump optimizations */
35406|     28|        int patch_offsets = 0;
35407|     54|        for (i = 0, jp = s->jump_slots; i < s->jump_count; i++, jp++) {
  ------------------
  |  Branch (35407:41): [True: 26, False: 28]
  ------------------
35408|     26|            LabelSlot *ls;
35409|     26|            JumpSlot *jp1;
35410|     26|            int j, pos, diff, delta;
35411|       |
35412|     26|            delta = 3;
35413|     26|            switch (op = jp->op) {
  ------------------
  |  Branch (35413:21): [True: 0, False: 26]
  ------------------
35414|      0|            case OP_goto16:
  ------------------
  |  Branch (35414:13): [True: 0, False: 26]
  ------------------
35415|      0|                delta = 1;
35416|       |                /* fall thru */
35417|      0|            case OP_if_false:
  ------------------
  |  Branch (35417:13): [True: 0, False: 26]
  ------------------
35418|      0|            case OP_if_true:
  ------------------
  |  Branch (35418:13): [True: 0, False: 26]
  ------------------
35419|      0|            case OP_goto:
  ------------------
  |  Branch (35419:13): [True: 0, False: 26]
  ------------------
35420|      0|                pos = jp->pos;
35421|      0|                diff = s->label_slots[jp->label].addr - pos;
35422|      0|                if (diff >= -128 && diff <= 127 + delta) {
  ------------------
  |  Branch (35422:21): [True: 0, False: 0]
  |  Branch (35422:37): [True: 0, False: 0]
  ------------------
35423|       |                    //put_u8(bc_out.buf + pos, diff);
35424|      0|                    jp->size = 1;
35425|      0|                    if (op == OP_goto16) {
  ------------------
  |  Branch (35425:25): [True: 0, False: 0]
  ------------------
35426|      0|                        bc_out.buf[pos - 1] = jp->op = OP_goto8;
35427|      0|                    } else {
35428|      0|                        bc_out.buf[pos - 1] = jp->op = OP_if_false8 + (op - OP_if_false);
35429|      0|                    }
35430|      0|                    goto shrink;
35431|      0|                } else
35432|      0|                if (diff == (int16_t)diff && op == OP_goto) {
  ------------------
  |  Branch (35432:21): [True: 0, False: 0]
  |  Branch (35432:46): [True: 0, False: 0]
  ------------------
35433|       |                    //put_u16(bc_out.buf + pos, diff);
35434|      0|                    jp->size = 2;
35435|      0|                    delta = 2;
35436|      0|                    bc_out.buf[pos - 1] = jp->op = OP_goto16;
35437|      0|                shrink:
35438|       |                    /* XXX: should reduce complexity, using 2 finger copy scheme */
35439|      0|                    memmove(bc_out.buf + pos + jp->size, bc_out.buf + pos + jp->size + delta,
35440|      0|                            bc_out.size - pos - jp->size - delta);
35441|      0|                    bc_out.size -= delta;
35442|      0|                    patch_offsets++;
35443|      0|                    for (j = 0, ls = s->label_slots; j < s->label_count; j++, ls++) {
  ------------------
  |  Branch (35443:54): [True: 0, False: 0]
  ------------------
35444|      0|                        if (ls->addr > pos)
  ------------------
  |  Branch (35444:29): [True: 0, False: 0]
  ------------------
35445|      0|                            ls->addr -= delta;
35446|      0|                    }
35447|      0|                    for (j = i + 1, jp1 = jp + 1; j < s->jump_count; j++, jp1++) {
  ------------------
  |  Branch (35447:51): [True: 0, False: 0]
  ------------------
35448|      0|                        if (jp1->pos > pos)
  ------------------
  |  Branch (35448:29): [True: 0, False: 0]
  ------------------
35449|      0|                            jp1->pos -= delta;
35450|      0|                    }
35451|      0|                    for (j = 0; j < s->line_number_count; j++) {
  ------------------
  |  Branch (35451:33): [True: 0, False: 0]
  ------------------
35452|      0|                        if (s->line_number_slots[j].pc > pos)
  ------------------
  |  Branch (35452:29): [True: 0, False: 0]
  ------------------
35453|      0|                            s->line_number_slots[j].pc -= delta;
35454|      0|                    }
35455|      0|                    continue;
35456|      0|                }
35457|      0|                break;
35458|     26|            }
35459|     26|        }
35460|     28|        if (patch_offsets) {
  ------------------
  |  Branch (35460:13): [True: 0, False: 28]
  ------------------
35461|      0|            JumpSlot *jp1;
35462|      0|            int j;
35463|      0|            for (j = 0, jp1 = s->jump_slots; j < s->jump_count; j++, jp1++) {
  ------------------
  |  Branch (35463:46): [True: 0, False: 0]
  ------------------
35464|      0|                int diff1 = s->label_slots[jp1->label].addr - jp1->pos;
35465|      0|                switch (jp1->size) {
  ------------------
  |  Branch (35465:25): [True: 0, False: 0]
  ------------------
35466|      0|                case 1:
  ------------------
  |  Branch (35466:17): [True: 0, False: 0]
  ------------------
35467|      0|                    put_u8(bc_out.buf + jp1->pos, diff1);
35468|      0|                    break;
35469|      0|                case 2:
  ------------------
  |  Branch (35469:17): [True: 0, False: 0]
  ------------------
35470|      0|                    put_u16(bc_out.buf + jp1->pos, diff1);
35471|      0|                    break;
35472|      0|                case 4:
  ------------------
  |  Branch (35472:17): [True: 0, False: 0]
  ------------------
35473|      0|                    put_u32(bc_out.buf + jp1->pos, diff1);
35474|      0|                    break;
35475|      0|                }
35476|      0|            }
35477|      0|        }
35478|     28|    }
35479|     28|    js_free(ctx, s->jump_slots);
35480|     28|    s->jump_slots = NULL;
35481|     28|#endif
35482|     28|    js_free(ctx, s->label_slots);
35483|     28|    s->label_slots = NULL;
35484|       |    /* XXX: should delay until copying to runtime bytecode function */
35485|     28|    compute_pc2line_info(s);
35486|     28|    js_free(ctx, s->line_number_slots);
35487|     28|    s->line_number_slots = NULL;
35488|       |    /* set the new byte code */
35489|     28|    dbuf_free(&s->byte_code);
35490|     28|    s->byte_code = bc_out;
35491|     28|    s->use_short_opcodes = TRUE;
35492|     28|    if (dbuf_error(&s->byte_code)) {
  ------------------
  |  Branch (35492:9): [True: 0, False: 28]
  ------------------
35493|      0|        JS_ThrowOutOfMemory(ctx);
35494|      0|        return -1;
35495|      0|    }
35496|     28|    return 0;
35497|      0| fail:
35498|       |    /* XXX: not safe */
35499|      0|    dbuf_free(&bc_out);
35500|      0|    return -1;
35501|     28|}
quickjs.c:put_short_code:
34542|     52|{
34543|     52|#if SHORT_OPCODES
34544|     52|    if (idx < 4) {
  ------------------
  |  Branch (34544:9): [True: 52, False: 0]
  ------------------
34545|     52|        switch (op) {
  ------------------
  |  Branch (34545:17): [True: 49, False: 3]
  ------------------
34546|      3|        case OP_get_loc:
  ------------------
  |  Branch (34546:9): [True: 3, False: 49]
  ------------------
34547|      3|            dbuf_putc(bc_out, OP_get_loc0 + idx);
34548|      3|            return;
34549|     19|        case OP_put_loc:
  ------------------
  |  Branch (34549:9): [True: 19, False: 33]
  ------------------
34550|     19|            dbuf_putc(bc_out, OP_put_loc0 + idx);
34551|     19|            return;
34552|     13|        case OP_set_loc:
  ------------------
  |  Branch (34552:9): [True: 13, False: 39]
  ------------------
34553|     13|            dbuf_putc(bc_out, OP_set_loc0 + idx);
34554|     13|            return;
34555|      4|        case OP_get_arg:
  ------------------
  |  Branch (34555:9): [True: 4, False: 48]
  ------------------
34556|      4|            dbuf_putc(bc_out, OP_get_arg0 + idx);
34557|      4|            return;
34558|      0|        case OP_put_arg:
  ------------------
  |  Branch (34558:9): [True: 0, False: 52]
  ------------------
34559|      0|            dbuf_putc(bc_out, OP_put_arg0 + idx);
34560|      0|            return;
34561|      5|        case OP_set_arg:
  ------------------
  |  Branch (34561:9): [True: 5, False: 47]
  ------------------
34562|      5|            dbuf_putc(bc_out, OP_set_arg0 + idx);
34563|      5|            return;
34564|      0|        case OP_get_var_ref:
  ------------------
  |  Branch (34564:9): [True: 0, False: 52]
  ------------------
34565|      0|            dbuf_putc(bc_out, OP_get_var_ref0 + idx);
34566|      0|            return;
34567|      0|        case OP_put_var_ref:
  ------------------
  |  Branch (34567:9): [True: 0, False: 52]
  ------------------
34568|      0|            dbuf_putc(bc_out, OP_put_var_ref0 + idx);
34569|      0|            return;
34570|      0|        case OP_set_var_ref:
  ------------------
  |  Branch (34570:9): [True: 0, False: 52]
  ------------------
34571|      0|            dbuf_putc(bc_out, OP_set_var_ref0 + idx);
34572|      0|            return;
34573|      5|        case OP_call:
  ------------------
  |  Branch (34573:9): [True: 5, False: 47]
  ------------------
34574|      5|            dbuf_putc(bc_out, OP_call0 + idx);
34575|      5|            return;
34576|     52|        }
34577|     52|    }
34578|      3|    if (idx < 256) {
  ------------------
  |  Branch (34578:9): [True: 3, False: 0]
  ------------------
34579|      3|        switch (op) {
  ------------------
  |  Branch (34579:17): [True: 0, False: 3]
  ------------------
34580|      0|        case OP_get_loc:
  ------------------
  |  Branch (34580:9): [True: 0, False: 3]
  ------------------
34581|      0|            dbuf_putc(bc_out, OP_get_loc8);
34582|      0|            dbuf_putc(bc_out, idx);
34583|      0|            return;
34584|      0|        case OP_put_loc:
  ------------------
  |  Branch (34584:9): [True: 0, False: 3]
  ------------------
34585|      0|            dbuf_putc(bc_out, OP_put_loc8);
34586|      0|            dbuf_putc(bc_out, idx);
34587|      0|            return;
34588|      0|        case OP_set_loc:
  ------------------
  |  Branch (34588:9): [True: 0, False: 3]
  ------------------
34589|      0|            dbuf_putc(bc_out, OP_set_loc8);
34590|      0|            dbuf_putc(bc_out, idx);
34591|      0|            return;
34592|      3|        }
34593|      3|    }
34594|      3|#endif
34595|      3|    dbuf_putc(bc_out, op);
34596|      3|    dbuf_put_u16(bc_out, idx);
34597|      3|}
quickjs.c:add_pc2line_info:
34352|    351|{
34353|    351|    if (s->line_number_slots != NULL
  ------------------
  |  Branch (34353:9): [True: 339, False: 12]
  ------------------
34354|    339|    &&  s->line_number_count < s->line_number_size
  ------------------
  |  Branch (34354:9): [True: 319, False: 20]
  ------------------
34355|    319|    &&  pc >= s->line_number_last_pc
  ------------------
  |  Branch (34355:9): [True: 319, False: 0]
  ------------------
34356|    319|    &&  source_pos != s->line_number_last) {
  ------------------
  |  Branch (34356:9): [True: 106, False: 213]
  ------------------
34357|    106|        s->line_number_slots[s->line_number_count].pc = pc;
34358|    106|        s->line_number_slots[s->line_number_count].source_pos = source_pos;
34359|    106|        s->line_number_count++;
34360|    106|        s->line_number_last_pc = pc;
34361|    106|        s->line_number_last = source_pos;
34362|    106|    }
34363|    351|}
quickjs.c:find_jump_target:
34466|     32|{
34467|     32|    int i, pos, op, label;
34468|       |
34469|     32|    label = label0;
34470|     32|    update_label(s, label, -1);
34471|     32|    for (i = 0; i < 10; i++) {
  ------------------
  |  Branch (34471:17): [True: 32, False: 0]
  ------------------
34472|     32|        assert(label >= 0 && label < s->label_count);
  ------------------
  |  Branch (34472:9): [True: 0, False: 32]
  |  Branch (34472:9): [True: 0, False: 0]
  |  Branch (34472:9): [True: 32, False: 0]
  |  Branch (34472:9): [True: 32, False: 0]
  ------------------
34473|     32|        pos = s->label_slots[label].pos2;
34474|     52|        for (;;) {
34475|     52|            switch(op = s->byte_code.buf[pos]) {
34476|     20|            case OP_line_num:
  ------------------
  |  Branch (34476:13): [True: 20, False: 32]
  ------------------
34477|     20|                if (pline)
  ------------------
  |  Branch (34477:21): [True: 5, False: 15]
  ------------------
34478|      5|                    *pline = get_u32(s->byte_code.buf + pos + 1);
34479|       |                /* fall thru */
34480|     20|            case OP_label:
  ------------------
  |  Branch (34480:13): [True: 0, False: 52]
  ------------------
34481|     20|                pos += opcode_info[op].size;
34482|     20|                continue;
34483|      0|            case OP_goto:
  ------------------
  |  Branch (34483:13): [True: 0, False: 52]
  ------------------
34484|      0|                label = get_u32(s->byte_code.buf + pos + 1);
34485|      0|                break;
34486|      2|            case OP_drop:
  ------------------
  |  Branch (34486:13): [True: 2, False: 50]
  ------------------
34487|       |                /* ignore drop opcodes if followed by OP_return_undef */
34488|      2|                while (s->byte_code.buf[++pos] == OP_drop)
  ------------------
  |  Branch (34488:24): [True: 0, False: 2]
  ------------------
34489|      0|                    continue;
34490|      2|                if (s->byte_code.buf[pos] == OP_return_undef)
  ------------------
  |  Branch (34490:21): [True: 0, False: 2]
  ------------------
34491|      0|                    op = OP_return_undef;
34492|       |                /* fall thru */
34493|     32|            default:
  ------------------
  |  Branch (34493:13): [True: 30, False: 22]
  ------------------
34494|     32|                goto done;
34495|     52|            }
34496|      0|            break;
34497|     52|        }
34498|     32|    }
34499|       |    /* cycle detected, could issue a warning */
34500|       |    /* XXX: the combination of find_jump_target() and skip_dead_code()
34501|       |       seems incorrect with cyclic labels. See for exemple:
34502|       |
34503|       |       for (;;) {
34504|       |       l:break l;
34505|       |       l:break l;
34506|       |       l:break l;
34507|       |       l:break l;
34508|       |       }
34509|       |
34510|       |       Avoiding changing the target is just a workaround and might not
34511|       |       suffice to completely fix the problem. */
34512|      0|    label = label0;
34513|     32| done:
34514|     32|    *pop = op;
34515|     32|    update_label(s, label, +1);
34516|     32|    return label;
34517|      0|}
quickjs.c:code_has_label:
34438|     32|{
34439|     42|    while (pos < s->bc_len) {
  ------------------
  |  Branch (34439:12): [True: 42, False: 0]
  ------------------
34440|     42|        int op = s->bc_buf[pos];
34441|     42|        if (op == OP_line_num) {
  ------------------
  |  Branch (34441:13): [True: 1, False: 41]
  ------------------
34442|      1|            pos += 5;
34443|      1|            continue;
34444|      1|        }
34445|     41|        if (op == OP_label) {
  ------------------
  |  Branch (34445:13): [True: 15, False: 26]
  ------------------
34446|     15|            int lab = get_u32(s->bc_buf + pos + 1);
34447|     15|            if (lab == label)
  ------------------
  |  Branch (34447:17): [True: 6, False: 9]
  ------------------
34448|      6|                return TRUE;
34449|      9|            pos += 5;
34450|      9|            continue;
34451|     15|        }
34452|     26|        if (op == OP_goto) {
  ------------------
  |  Branch (34452:13): [True: 0, False: 26]
  ------------------
34453|      0|            int lab = get_u32(s->bc_buf + pos + 1);
34454|      0|            if (lab == label)
  ------------------
  |  Branch (34454:17): [True: 0, False: 0]
  ------------------
34455|      0|                return TRUE;
34456|      0|        }
34457|     26|        break;
34458|     26|    }
34459|     26|    return FALSE;
34460|     32|}
quickjs.c:add_reloc:
34425|     21|{
34426|     21|    RelocEntry *re;
34427|     21|    re = js_malloc(ctx, sizeof(*re));
34428|     21|    if (!re)
  ------------------
  |  Branch (34428:9): [True: 0, False: 21]
  ------------------
34429|      0|        return NULL;
34430|     21|    re->addr = addr;
34431|     21|    re->size = size;
34432|     21|    re->next = ls->first_reloc;
34433|     21|    ls->first_reloc = re;
34434|     21|    return re;
34435|     21|}
quickjs.c:push_short_int:
34520|      5|{
34521|      5|#if SHORT_OPCODES
34522|      5|    if (val >= -1 && val <= 7) {
  ------------------
  |  Branch (34522:9): [True: 5, False: 0]
  |  Branch (34522:22): [True: 4, False: 1]
  ------------------
34523|      4|        dbuf_putc(bc_out, OP_push_0 + val);
34524|      4|        return;
34525|      4|    }
34526|      1|    if (val == (int8_t)val) {
  ------------------
  |  Branch (34526:9): [True: 1, False: 0]
  ------------------
34527|      1|        dbuf_putc(bc_out, OP_push_i8);
34528|      1|        dbuf_putc(bc_out, val);
34529|      1|        return;
34530|      1|    }
34531|      0|    if (val == (int16_t)val) {
  ------------------
  |  Branch (34531:9): [True: 0, False: 0]
  ------------------
34532|      0|        dbuf_putc(bc_out, OP_push_i16);
34533|      0|        dbuf_put_u16(bc_out, val);
34534|      0|        return;
34535|      0|    }
34536|      0|#endif
34537|      0|    dbuf_putc(bc_out, OP_push_i32);
34538|      0|    dbuf_put_u32(bc_out, val);
34539|      0|}
quickjs.c:compute_pc2line_info:
34372|     28|{
34373|     28|    if (!s->strip_debug) {
  ------------------
  |  Branch (34373:9): [True: 28, False: 0]
  ------------------
34374|     28|        int last_line_num, last_col_num;
34375|     28|        uint32_t last_pc = 0;
34376|     28|        int i, line_num, col_num;
34377|     28|        const uint8_t *buf_start = s->get_line_col_cache->buf_start;
34378|     28|        js_dbuf_init(s->ctx, &s->pc2line);
34379|       |
34380|     28|        last_line_num = get_line_col_cached(s->get_line_col_cache,
34381|     28|                                            &last_col_num,
34382|     28|                                            buf_start + s->source_pos);
34383|     28|        dbuf_put_leb128(&s->pc2line, last_line_num); /* line number minus 1 */
34384|     28|        dbuf_put_leb128(&s->pc2line, last_col_num); /* column number minus 1 */
34385|       |
34386|    134|        for (i = 0; i < s->line_number_count; i++) {
  ------------------
  |  Branch (34386:21): [True: 106, False: 28]
  ------------------
34387|    106|            uint32_t pc = s->line_number_slots[i].pc;
34388|    106|            uint32_t source_pos = s->line_number_slots[i].source_pos;
34389|    106|            int diff_pc, diff_line, diff_col;
34390|       |
34391|    106|            if (source_pos == -1)
  ------------------
  |  Branch (34391:17): [True: 0, False: 106]
  ------------------
34392|      0|                continue;
34393|    106|            diff_pc = pc - last_pc;
34394|    106|            if (diff_pc < 0)
  ------------------
  |  Branch (34394:17): [True: 0, False: 106]
  ------------------
34395|      0|                continue;
34396|       |
34397|    106|            line_num = get_line_col_cached(s->get_line_col_cache, &col_num,
34398|    106|                                           buf_start + source_pos);
34399|    106|            diff_line = line_num - last_line_num;
34400|    106|            diff_col = col_num - last_col_num;
34401|    106|            if (diff_line == 0 && diff_col == 0)
  ------------------
  |  Branch (34401:17): [True: 56, False: 50]
  |  Branch (34401:35): [True: 0, False: 56]
  ------------------
34402|      0|                continue;
34403|       |
34404|    106|            if (diff_line >= PC2LINE_BASE &&
  ------------------
  |  |  665|    212|#define PC2LINE_BASE     (-1)
  ------------------
  |  Branch (34404:17): [True: 102, False: 4]
  ------------------
34405|    102|                diff_line < PC2LINE_BASE + PC2LINE_RANGE &&
  ------------------
  |  |  665|    102|#define PC2LINE_BASE     (-1)
  ------------------
                              diff_line < PC2LINE_BASE + PC2LINE_RANGE &&
  ------------------
  |  |  666|    208|#define PC2LINE_RANGE    5
  ------------------
  |  Branch (34405:17): [True: 92, False: 10]
  ------------------
34406|     92|                diff_pc <= PC2LINE_DIFF_PC_MAX) {
  ------------------
  |  |  668|     92|#define PC2LINE_DIFF_PC_MAX ((255 - PC2LINE_OP_FIRST) / PC2LINE_RANGE)
  |  |  ------------------
  |  |  |  |  667|     92|#define PC2LINE_OP_FIRST 1
  |  |  ------------------
  |  |               #define PC2LINE_DIFF_PC_MAX ((255 - PC2LINE_OP_FIRST) / PC2LINE_RANGE)
  |  |  ------------------
  |  |  |  |  666|     92|#define PC2LINE_RANGE    5
  |  |  ------------------
  ------------------
  |  Branch (34406:17): [True: 92, False: 0]
  ------------------
34407|     92|                dbuf_putc(&s->pc2line, (diff_line - PC2LINE_BASE) +
  ------------------
  |  |  665|     92|#define PC2LINE_BASE     (-1)
  ------------------
34408|     92|                          diff_pc * PC2LINE_RANGE + PC2LINE_OP_FIRST);
  ------------------
  |  |  666|     92|#define PC2LINE_RANGE    5
  ------------------
                                        diff_pc * PC2LINE_RANGE + PC2LINE_OP_FIRST);
  ------------------
  |  |  667|     92|#define PC2LINE_OP_FIRST 1
  ------------------
34409|     92|            } else {
34410|       |                /* longer encoding */
34411|     14|                dbuf_putc(&s->pc2line, 0);
34412|     14|                dbuf_put_leb128(&s->pc2line, diff_pc);
34413|     14|                dbuf_put_sleb128(&s->pc2line, diff_line);
34414|     14|            }
34415|    106|            dbuf_put_sleb128(&s->pc2line, diff_col);
34416|       |                
34417|    106|            last_pc = pc;
34418|    106|            last_line_num = line_num;
34419|    106|            last_col_num = col_num;
34420|    106|        }
34421|     28|    }
34422|     28|}
quickjs.c:get_line_col_cached:
22115|    134|{
22116|    134|    int line_num, col_num;
22117|    134|    if (ptr >= s->ptr) {
  ------------------
  |  Branch (22117:9): [True: 121, False: 13]
  ------------------
22118|    121|        line_num = get_line_col(&col_num, s->ptr, ptr - s->ptr);
22119|    121|        if (line_num == 0) {
  ------------------
  |  Branch (22119:13): [True: 75, False: 46]
  ------------------
22120|     75|            s->col_num += col_num;
22121|     75|        } else {
22122|     46|            s->line_num += line_num;
22123|     46|            s->col_num = col_num;
22124|     46|        }
22125|    121|    } else {
22126|     13|        line_num = get_line_col(&col_num, ptr, s->ptr - ptr);
22127|     13|        if (line_num == 0) {
  ------------------
  |  Branch (22127:13): [True: 6, False: 7]
  ------------------
22128|      6|            s->col_num -= col_num;
22129|      7|        } else {
22130|      7|            const uint8_t *p;
22131|      7|            s->line_num -= line_num;
22132|       |            /* find the absolute column position */
22133|      7|            col_num = 0;
22134|    135|            for(p = ptr - 1; p >= s->buf_start; p--) {
  ------------------
  |  Branch (22134:30): [True: 131, False: 4]
  ------------------
22135|    131|                if (*p == '\n') {
  ------------------
  |  Branch (22135:21): [True: 3, False: 128]
  ------------------
22136|      3|                    break;
22137|    128|                } else if (*p < 0x80 || *p >= 0xc0) {
  ------------------
  |  Branch (22137:28): [True: 121, False: 7]
  |  Branch (22137:41): [True: 0, False: 7]
  ------------------
22138|    121|                    col_num++;
22139|    121|                }
22140|    131|            }
22141|      7|            s->col_num = col_num;
22142|      7|        }
22143|     13|    }
22144|    134|    s->ptr = ptr;
22145|    134|    *pcol_num = s->col_num;
22146|    134|    return s->line_num;
22147|    134|}
quickjs.c:compute_stack_size:
35560|     28|{
35561|     28|    StackSizeState s_s, *s = &s_s;
35562|     28|    int i, diff, n_pop, pos_next, stack_len, pos, op, catch_pos, catch_level;
35563|     28|    const JSOpCode *oi;
35564|     28|    const uint8_t *bc_buf;
35565|       |
35566|     28|    bc_buf = fd->byte_code.buf;
35567|     28|    s->bc_len = fd->byte_code.size;
35568|       |    /* bc_len > 0 */
35569|     28|    s->stack_level_tab = js_malloc(ctx, sizeof(s->stack_level_tab[0]) *
35570|     28|                                   s->bc_len);
35571|     28|    if (!s->stack_level_tab)
  ------------------
  |  Branch (35571:9): [True: 0, False: 28]
  ------------------
35572|      0|        return -1;
35573|    768|    for(i = 0; i < s->bc_len; i++)
  ------------------
  |  Branch (35573:16): [True: 740, False: 28]
  ------------------
35574|    740|        s->stack_level_tab[i] = 0xffff;
35575|     28|    s->pc_stack = NULL;
35576|     28|    s->catch_pos_tab = js_malloc(ctx, sizeof(s->catch_pos_tab[0]) *
35577|     28|                                   s->bc_len);
35578|     28|    if (!s->catch_pos_tab)
  ------------------
  |  Branch (35578:9): [True: 0, False: 28]
  ------------------
35579|      0|        goto fail;
35580|       |
35581|     28|    s->stack_len_max = 0;
35582|     28|    s->pc_stack_len = 0;
35583|     28|    s->pc_stack_size = 0;
35584|       |
35585|       |    /* breadth-first graph exploration */
35586|     28|    if (ss_check(ctx, s, 0, OP_invalid, 0, -1))
  ------------------
  |  Branch (35586:9): [True: 0, False: 28]
  ------------------
35587|      0|        goto fail;
35588|       |
35589|    379|    while (s->pc_stack_len > 0) {
  ------------------
  |  Branch (35589:12): [True: 351, False: 28]
  ------------------
35590|    351|        pos = s->pc_stack[--s->pc_stack_len];
35591|    351|        stack_len = s->stack_level_tab[pos];
35592|    351|        catch_pos = s->catch_pos_tab[pos];
35593|    351|        op = bc_buf[pos];
35594|    351|        if (op == 0 || op >= OP_COUNT) {
  ------------------
  |  Branch (35594:13): [True: 0, False: 351]
  |  Branch (35594:24): [True: 0, False: 351]
  ------------------
35595|      0|            JS_ThrowInternalError(ctx, "invalid opcode (op=%d, pc=%d)", op, pos);
35596|      0|            goto fail;
35597|      0|        }
35598|    351|        oi = &short_opcode_info(op);
  ------------------
  |  |21996|    351|    opcode_info[(op) >= OP_TEMP_START ? \
  |  |  ------------------
  |  |  |  Branch (21996:17): [True: 99, False: 252]
  |  |  ------------------
  |  |21997|    351|                (op) + (OP_TEMP_END - OP_TEMP_START) : (op)]
  ------------------
35599|       |#if defined(DUMP_BYTECODE) && (DUMP_BYTECODE & 64)
35600|       |        printf("%5d: %10s %5d %5d\n", pos, oi->name, stack_len, catch_pos);
35601|       |#endif
35602|    351|        pos_next = pos + oi->size;
35603|    351|        if (pos_next > s->bc_len) {
  ------------------
  |  Branch (35603:13): [True: 0, False: 351]
  ------------------
35604|      0|            JS_ThrowInternalError(ctx, "bytecode buffer overflow (op=%d, pc=%d)", op, pos);
35605|      0|            goto fail;
35606|      0|        }
35607|    351|        n_pop = oi->n_pop;
35608|       |        /* call pops a variable number of arguments */
35609|    351|        if (oi->fmt == OP_FMT_npop || oi->fmt == OP_FMT_npop_u16) {
  ------------------
  |  Branch (35609:13): [True: 3, False: 348]
  |  Branch (35609:39): [True: 0, False: 348]
  ------------------
35610|      3|            n_pop += get_u16(bc_buf + pos + 1);
35611|    348|        } else {
35612|    348|#if SHORT_OPCODES
35613|    348|            if (oi->fmt == OP_FMT_npopx) {
  ------------------
  |  Branch (35613:17): [True: 5, False: 343]
  ------------------
35614|      5|                n_pop += op - OP_call0;
35615|      5|            }
35616|    348|#endif
35617|    348|        }
35618|       |
35619|    351|        if (stack_len < n_pop) {
  ------------------
  |  Branch (35619:13): [True: 0, False: 351]
  ------------------
35620|      0|            JS_ThrowInternalError(ctx, "stack underflow (op=%d, pc=%d)", op, pos);
35621|      0|            goto fail;
35622|      0|        }
35623|    351|        stack_len += oi->n_push - n_pop;
35624|    351|        if (stack_len > s->stack_len_max) {
  ------------------
  |  Branch (35624:13): [True: 62, False: 289]
  ------------------
35625|     62|            s->stack_len_max = stack_len;
35626|     62|            if (s->stack_len_max > JS_STACK_SIZE_MAX) {
  ------------------
  |  |  209|     62|#define JS_STACK_SIZE_MAX 65534
  ------------------
  |  Branch (35626:17): [True: 0, False: 62]
  ------------------
35627|      0|                JS_ThrowInternalError(ctx, "stack overflow (op=%d, pc=%d)", op, pos);
35628|      0|                goto fail;
35629|      0|            }
35630|     62|        }
35631|    351|        switch(op) {
35632|      0|        case OP_tail_call:
  ------------------
  |  Branch (35632:9): [True: 0, False: 351]
  ------------------
35633|      0|        case OP_tail_call_method:
  ------------------
  |  Branch (35633:9): [True: 0, False: 351]
  ------------------
35634|     14|        case OP_return:
  ------------------
  |  Branch (35634:9): [True: 14, False: 337]
  ------------------
35635|     28|        case OP_return_undef:
  ------------------
  |  Branch (35635:9): [True: 14, False: 337]
  ------------------
35636|     42|        case OP_return_async:
  ------------------
  |  Branch (35636:9): [True: 14, False: 337]
  ------------------
35637|     42|        case OP_throw:
  ------------------
  |  Branch (35637:9): [True: 0, False: 351]
  ------------------
35638|     42|        case OP_throw_error:
  ------------------
  |  Branch (35638:9): [True: 0, False: 351]
  ------------------
35639|     42|        case OP_ret:
  ------------------
  |  Branch (35639:9): [True: 0, False: 351]
  ------------------
35640|     42|            goto done_insn;
35641|      0|        case OP_goto:
  ------------------
  |  Branch (35641:9): [True: 0, False: 351]
  ------------------
35642|      0|            diff = get_u32(bc_buf + pos + 1);
35643|      0|            pos_next = pos + 1 + diff;
35644|      0|            break;
35645|      0|#if SHORT_OPCODES
35646|      0|        case OP_goto16:
  ------------------
  |  Branch (35646:9): [True: 0, False: 351]
  ------------------
35647|      0|            diff = (int16_t)get_u16(bc_buf + pos + 1);
35648|      0|            pos_next = pos + 1 + diff;
35649|      0|            break;
35650|      7|        case OP_goto8:
  ------------------
  |  Branch (35650:9): [True: 7, False: 344]
  ------------------
35651|      7|            diff = (int8_t)bc_buf[pos + 1];
35652|      7|            pos_next = pos + 1 + diff;
35653|      7|            break;
35654|      2|        case OP_if_true8:
  ------------------
  |  Branch (35654:9): [True: 2, False: 349]
  ------------------
35655|     19|        case OP_if_false8:
  ------------------
  |  Branch (35655:9): [True: 17, False: 334]
  ------------------
35656|     19|            diff = (int8_t)bc_buf[pos + 1];
35657|     19|            if (ss_check(ctx, s, pos + 1 + diff, op, stack_len, catch_pos))
  ------------------
  |  Branch (35657:17): [True: 0, False: 19]
  ------------------
35658|      0|                goto fail;
35659|     19|            break;
35660|     19|#endif
35661|     19|        case OP_if_true:
  ------------------
  |  Branch (35661:9): [True: 0, False: 351]
  ------------------
35662|      0|        case OP_if_false:
  ------------------
  |  Branch (35662:9): [True: 0, False: 351]
  ------------------
35663|      0|            diff = get_u32(bc_buf + pos + 1);
35664|      0|            if (ss_check(ctx, s, pos + 1 + diff, op, stack_len, catch_pos))
  ------------------
  |  Branch (35664:17): [True: 0, False: 0]
  ------------------
35665|      0|                goto fail;
35666|      0|            break;
35667|      0|        case OP_gosub:
  ------------------
  |  Branch (35667:9): [True: 0, False: 351]
  ------------------
35668|      0|            diff = get_u32(bc_buf + pos + 1);
35669|      0|            if (ss_check(ctx, s, pos + 1 + diff, op, stack_len + 1, catch_pos))
  ------------------
  |  Branch (35669:17): [True: 0, False: 0]
  ------------------
35670|      0|                goto fail;
35671|      0|            break;
35672|      0|        case OP_with_get_var:
  ------------------
  |  Branch (35672:9): [True: 0, False: 351]
  ------------------
35673|      0|        case OP_with_delete_var:
  ------------------
  |  Branch (35673:9): [True: 0, False: 351]
  ------------------
35674|      0|            diff = get_u32(bc_buf + pos + 5);
35675|      0|            if (ss_check(ctx, s, pos + 5 + diff, op, stack_len + 1, catch_pos))
  ------------------
  |  Branch (35675:17): [True: 0, False: 0]
  ------------------
35676|      0|                goto fail;
35677|      0|            break;
35678|      0|        case OP_with_make_ref:
  ------------------
  |  Branch (35678:9): [True: 0, False: 351]
  ------------------
35679|      0|        case OP_with_get_ref:
  ------------------
  |  Branch (35679:9): [True: 0, False: 351]
  ------------------
35680|      0|            diff = get_u32(bc_buf + pos + 5);
35681|      0|            if (ss_check(ctx, s, pos + 5 + diff, op, stack_len + 2, catch_pos))
  ------------------
  |  Branch (35681:17): [True: 0, False: 0]
  ------------------
35682|      0|                goto fail;
35683|      0|            break;
35684|      0|        case OP_with_put_var:
  ------------------
  |  Branch (35684:9): [True: 0, False: 351]
  ------------------
35685|      0|            diff = get_u32(bc_buf + pos + 5);
35686|      0|            if (ss_check(ctx, s, pos + 5 + diff, op, stack_len - 1, catch_pos))
  ------------------
  |  Branch (35686:17): [True: 0, False: 0]
  ------------------
35687|      0|                goto fail;
35688|      0|            break;
35689|      0|        case OP_catch:
  ------------------
  |  Branch (35689:9): [True: 0, False: 351]
  ------------------
35690|      0|            diff = get_u32(bc_buf + pos + 1);
35691|      0|            if (ss_check(ctx, s, pos + 1 + diff, op, stack_len, catch_pos))
  ------------------
  |  Branch (35691:17): [True: 0, False: 0]
  ------------------
35692|      0|                goto fail;
35693|      0|            catch_pos = pos;
35694|      0|            break;
35695|      1|        case OP_for_of_start:
  ------------------
  |  Branch (35695:9): [True: 1, False: 350]
  ------------------
35696|      1|        case OP_for_await_of_start:
  ------------------
  |  Branch (35696:9): [True: 0, False: 351]
  ------------------
35697|      1|            catch_pos = pos;
35698|      1|            break;
35699|       |            /* we assume the catch offset entry is only removed with
35700|       |               some op codes */
35701|     11|        case OP_drop:
  ------------------
  |  Branch (35701:9): [True: 11, False: 340]
  ------------------
35702|     11|            catch_level = stack_len;
35703|     11|            goto check_catch;
35704|      0|        case OP_nip:
  ------------------
  |  Branch (35704:9): [True: 0, False: 351]
  ------------------
35705|      0|            catch_level = stack_len - 1;
35706|      0|            goto check_catch;
35707|      0|        case OP_nip1:
  ------------------
  |  Branch (35707:9): [True: 0, False: 351]
  ------------------
35708|      0|            catch_level = stack_len - 1;
35709|      0|            goto check_catch;
35710|      1|        case OP_iterator_close:
  ------------------
  |  Branch (35710:9): [True: 1, False: 350]
  ------------------
35711|      1|            catch_level = stack_len + 2;
35712|     12|        check_catch:
35713|       |            /* Note: for for_of_start/for_await_of_start we consider
35714|       |               the catch offset is on the first stack entry instead of
35715|       |               the thirst */
35716|     12|            if (catch_pos >= 0) {
  ------------------
  |  Branch (35716:17): [True: 2, False: 10]
  ------------------
35717|      2|                int level;
35718|      2|                level = s->stack_level_tab[catch_pos];
35719|      2|                if (bc_buf[catch_pos] != OP_catch)
  ------------------
  |  Branch (35719:21): [True: 2, False: 0]
  ------------------
35720|      2|                    level++; /* for_of_start, for_wait_of_start */
35721|       |                /* catch_level = stack_level before op_catch is executed ? */
35722|      2|                if (catch_level == level) {
  ------------------
  |  Branch (35722:21): [True: 1, False: 1]
  ------------------
35723|      1|                    catch_pos = s->catch_pos_tab[catch_pos];
35724|      1|                }
35725|      2|            }
35726|     12|            break;
35727|      0|        case OP_nip_catch:
  ------------------
  |  Branch (35727:9): [True: 0, False: 351]
  ------------------
35728|      0|            if (catch_pos < 0) {
  ------------------
  |  Branch (35728:17): [True: 0, False: 0]
  ------------------
35729|      0|                JS_ThrowInternalError(ctx, "nip_catch: no catch op (pc=%d)", pos);
35730|      0|                goto fail;
35731|      0|            }
35732|      0|            stack_len = s->stack_level_tab[catch_pos];
35733|      0|            if (bc_buf[catch_pos] != OP_catch)
  ------------------
  |  Branch (35733:17): [True: 0, False: 0]
  ------------------
35734|      0|                stack_len++; /* for_of_start, for_wait_of_start */
35735|      0|            stack_len++; /* no stack overflow is possible by construction */
35736|      0|            catch_pos = s->catch_pos_tab[catch_pos];
35737|      0|            break;
35738|    270|        default:
  ------------------
  |  Branch (35738:9): [True: 270, False: 81]
  ------------------
35739|    270|            break;
35740|    351|        }
35741|    309|        if (ss_check(ctx, s, pos_next, op, stack_len, catch_pos))
  ------------------
  |  Branch (35741:13): [True: 0, False: 309]
  ------------------
35742|      0|            goto fail;
35743|    351|    done_insn: ;
35744|    351|    }
35745|     28|    js_free(ctx, s->pc_stack);
35746|     28|    js_free(ctx, s->catch_pos_tab);
35747|     28|    js_free(ctx, s->stack_level_tab);
35748|     28|    *pstack_size = s->stack_len_max;
35749|     28|    return 0;
35750|      0| fail:
35751|      0|    js_free(ctx, s->pc_stack);
35752|      0|    js_free(ctx, s->catch_pos_tab);
35753|      0|    js_free(ctx, s->stack_level_tab);
35754|      0|    *pstack_size = 0;
35755|      0|    return -1;
35756|     28|}
quickjs.c:ss_check:
35518|    356|{
35519|    356|    if ((unsigned)pos >= s->bc_len) {
  ------------------
  |  Branch (35519:9): [True: 0, False: 356]
  ------------------
35520|      0|        JS_ThrowInternalError(ctx, "bytecode buffer overflow (op=%d, pc=%d)", op, pos);
35521|      0|        return -1;
35522|      0|    }
35523|    356|    if (stack_len > s->stack_len_max) {
  ------------------
  |  Branch (35523:9): [True: 0, False: 356]
  ------------------
35524|      0|        s->stack_len_max = stack_len;
35525|      0|        if (s->stack_len_max > JS_STACK_SIZE_MAX) {
  ------------------
  |  |  209|      0|#define JS_STACK_SIZE_MAX 65534
  ------------------
  |  Branch (35525:13): [True: 0, False: 0]
  ------------------
35526|      0|            JS_ThrowInternalError(ctx, "stack overflow (op=%d, pc=%d)", op, pos);
35527|      0|            return -1;
35528|      0|        }
35529|      0|    }
35530|    356|    if (s->stack_level_tab[pos] != 0xffff) {
  ------------------
  |  Branch (35530:9): [True: 5, False: 351]
  ------------------
35531|       |        /* already explored: check that the stack size is consistent */
35532|      5|        if (s->stack_level_tab[pos] != stack_len) {
  ------------------
  |  Branch (35532:13): [True: 0, False: 5]
  ------------------
35533|      0|            JS_ThrowInternalError(ctx, "inconsistent stack size: %d %d (pc=%d)",
35534|      0|                                  s->stack_level_tab[pos], stack_len, pos);
35535|      0|            return -1;
35536|      5|        } else if (s->catch_pos_tab[pos] != catch_pos) {
  ------------------
  |  Branch (35536:20): [True: 0, False: 5]
  ------------------
35537|      0|            JS_ThrowInternalError(ctx, "inconsistent catch position: %d %d (pc=%d)",
35538|      0|                                  s->catch_pos_tab[pos], catch_pos, pos);
35539|      0|            return -1;
35540|      5|        } else {
35541|      5|            return 0;
35542|      5|        }
35543|      5|    }
35544|       |
35545|       |    /* mark as explored and store the stack size */
35546|    351|    s->stack_level_tab[pos] = stack_len;
35547|    351|    s->catch_pos_tab[pos] = catch_pos;
35548|       |
35549|       |    /* queue the new PC to explore */
35550|    351|    if (js_resize_array(ctx, (void **)&s->pc_stack, sizeof(s->pc_stack[0]),
  ------------------
  |  Branch (35550:9): [True: 0, False: 351]
  ------------------
35551|    351|                        &s->pc_stack_size, s->pc_stack_len + 1))
35552|      0|        return -1;
35553|    351|    s->pc_stack[s->pc_stack_len++] = pos;
35554|    351|    return 0;
35555|    351|}
quickjs.c:JS_AddIntrinsicBasicObjects:
56071|     14|{
56072|     14|    JSValue obj;
56073|     14|    JSCFunctionType ft;
56074|     14|    int i;
56075|       |
56076|       |    /* warning: ordering is tricky */
56077|     14|    ctx->class_proto[JS_CLASS_OBJECT] =
56078|     14|        JS_NewObjectProtoClassAlloc(ctx, JS_NULL, JS_CLASS_OBJECT,
  ------------------
  |  |  288|     14|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56079|     14|                                    countof(js_object_proto_funcs) + 1);
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56080|     14|    if (JS_IsException(ctx->class_proto[JS_CLASS_OBJECT]))
  ------------------
  |  Branch (56080:9): [True: 0, False: 14]
  ------------------
56081|      0|        return -1;
56082|     14|    JS_SetImmutablePrototype(ctx, ctx->class_proto[JS_CLASS_OBJECT]);
56083|       |
56084|       |    /* 2 more properties: caller and arguments */
56085|     14|    ctx->function_proto = JS_NewCFunction3(ctx, js_function_proto, "", 0,
56086|     14|                                           JS_CFUNC_generic, 0,
56087|     14|                                           ctx->class_proto[JS_CLASS_OBJECT],
56088|     14|                                           countof(js_function_proto_funcs) + 3 + 2);
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56089|     14|    if (JS_IsException(ctx->function_proto))
  ------------------
  |  Branch (56089:9): [True: 0, False: 14]
  ------------------
56090|      0|        return -1;
56091|     14|    ctx->class_proto[JS_CLASS_BYTECODE_FUNCTION] = JS_DupValue(ctx, ctx->function_proto);
56092|       |
56093|     14|    ctx->global_obj = JS_NewObjectProtoClassAlloc(ctx, ctx->class_proto[JS_CLASS_OBJECT],
56094|     14|                                                  JS_CLASS_GLOBAL_OBJECT, 64);
56095|     14|    if (JS_IsException(ctx->global_obj))
  ------------------
  |  Branch (56095:9): [True: 0, False: 14]
  ------------------
56096|      0|        return -1;
56097|     14|    {
56098|     14|        JSObject *p;
56099|     14|        obj = JS_NewObjectProtoClassAlloc(ctx, JS_NULL, JS_CLASS_OBJECT, 4);
  ------------------
  |  |  288|     14|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56100|     14|        p = JS_VALUE_GET_OBJ(ctx->global_obj);
  ------------------
  |  |  227|     14|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
56101|     14|        p->u.global_object.uninitialized_vars = obj;
56102|     14|    }
56103|     14|    ctx->global_var_obj = JS_NewObjectProtoClassAlloc(ctx, JS_NULL,
  ------------------
  |  |  288|     14|#define JS_NULL      JS_MKVAL(JS_TAG_NULL, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56104|     14|                                                      JS_CLASS_OBJECT, 16);
56105|     14|    if (JS_IsException(ctx->global_var_obj))
  ------------------
  |  Branch (56105:9): [True: 0, False: 14]
  ------------------
56106|      0|        return -1;
56107|       |
56108|       |    /* Error */
56109|     14|    ft.generic_magic = js_error_constructor;
56110|     14|    obj = JS_NewCConstructor(ctx, JS_CLASS_ERROR, "Error",
56111|     14|                                    ft.generic, 1, JS_CFUNC_constructor_or_func_magic, -1,
56112|     14|                                    JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56113|     14|                                    js_error_funcs, countof(js_error_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56114|     14|                                    js_error_proto_funcs, countof(js_error_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56115|     14|                                    0);
56116|     14|    if (JS_IsException(obj))
  ------------------
  |  Branch (56116:9): [True: 0, False: 14]
  ------------------
56117|      0|        return -1;
56118|       |
56119|    126|    for(i = 0; i < JS_NATIVE_ERROR_COUNT; i++) {
  ------------------
  |  Branch (56119:16): [True: 112, False: 14]
  ------------------
56120|    112|        JSValue func_obj;
56121|    112|        const JSCFunctionListEntry *funcs;
56122|    112|        int n_args;
56123|    112|        char buf[ATOM_GET_STR_BUF_SIZE];
56124|    112|        const char *name = JS_AtomGetStr(ctx, buf, sizeof(buf),
56125|    112|                                         JS_ATOM_EvalError + i);
56126|    112|        n_args = 1 + (i == JS_AGGREGATE_ERROR);
56127|    112|        funcs = js_native_error_proto_funcs + 2 * i;
56128|    112|        func_obj = JS_NewCConstructor(ctx, -1, name,
56129|    112|                                      ft.generic, n_args, JS_CFUNC_constructor_or_func_magic, i,
56130|    112|                                      obj,
56131|    112|                                      NULL, 0,
56132|    112|                                      funcs, 2,
56133|    112|                                      0);
56134|    112|        if (JS_IsException(func_obj)) {
  ------------------
  |  Branch (56134:13): [True: 0, False: 112]
  ------------------
56135|      0|            JS_FreeValue(ctx, obj);
56136|      0|            return -1;
56137|      0|        }
56138|    112|        ctx->native_error_proto[i] = JS_GetProperty(ctx, func_obj, JS_ATOM_prototype);
56139|    112|        JS_FreeValue(ctx, func_obj);
56140|    112|        if (JS_IsException(ctx->native_error_proto[i])) {
  ------------------
  |  Branch (56140:13): [True: 0, False: 112]
  ------------------
56141|      0|            JS_FreeValue(ctx, obj);
56142|      0|            return -1;
56143|      0|        }
56144|    112|    }
56145|     14|    JS_FreeValue(ctx, obj);
56146|       |
56147|       |    /* Array */
56148|     14|    obj = JS_NewCConstructor(ctx, JS_CLASS_ARRAY, "Array",
56149|     14|                                    js_array_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56150|     14|                                    JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56151|     14|                                    js_array_funcs, countof(js_array_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56152|     14|                                    js_array_proto_funcs, countof(js_array_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56153|     14|                                    JS_NEW_CTOR_PROTO_CLASS);
  ------------------
  |  |39604|     14|#define JS_NEW_CTOR_PROTO_CLASS (1 << 1) /* the prototype class is 'class_id' instead of JS_CLASS_OBJECT */
  ------------------
56154|     14|    if (JS_IsException(obj))
  ------------------
  |  Branch (56154:9): [True: 0, False: 14]
  ------------------
56155|      0|        return -1;
56156|     14|    ctx->array_ctor = obj;
56157|       |
56158|     14|    {
56159|     14|        JSObject *p = JS_VALUE_GET_OBJ(ctx->class_proto[JS_CLASS_ARRAY]);
  ------------------
  |  |  227|     14|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
56160|     14|        p->is_std_array_prototype = TRUE;
56161|     14|    }
56162|       |    
56163|     14|    ctx->array_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_ARRAY]),
56164|     14|                                     JS_PROP_INITIAL_HASH_SIZE, 1);
  ------------------
  |  |  958|     14|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
56165|     14|    if (!ctx->array_shape)
  ------------------
  |  Branch (56165:9): [True: 0, False: 14]
  ------------------
56166|      0|        return -1;
56167|     14|    if (add_shape_property(ctx, &ctx->array_shape, NULL,
  ------------------
  |  Branch (56167:9): [True: 0, False: 14]
  ------------------
56168|     14|                           JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_LENGTH))
  ------------------
  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_LENGTH))
  ------------------
  |  |  300|     14|#define JS_PROP_LENGTH        (1 << 3) /* used internally in Arrays */
  ------------------
56169|      0|        return -1;
56170|       |
56171|     14|    ctx->arguments_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_OBJECT]),
56172|     14|                                         JS_PROP_INITIAL_HASH_SIZE, 3);
  ------------------
  |  |  958|     14|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
56173|     14|    if (!ctx->arguments_shape)
  ------------------
  |  Branch (56173:9): [True: 0, False: 14]
  ------------------
56174|      0|        return -1;
56175|     14|    if (add_shape_property(ctx, &ctx->arguments_shape, NULL,
  ------------------
  |  Branch (56175:9): [True: 0, False: 14]
  ------------------
56176|     14|                           JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56177|      0|        return -1;
56178|     14|    if (add_shape_property(ctx, &ctx->arguments_shape, NULL,
  ------------------
  |  Branch (56178:9): [True: 0, False: 14]
  ------------------
56179|     14|                           JS_ATOM_Symbol_iterator, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_Symbol_iterator, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56180|      0|        return -1;
56181|     14|    if (add_shape_property(ctx, &ctx->arguments_shape, NULL,
  ------------------
  |  Branch (56181:9): [True: 0, False: 14]
  ------------------
56182|     14|                           JS_ATOM_callee, JS_PROP_GETSET))
  ------------------
  |  |  303|     14|#define JS_PROP_GETSET         (1 << 4)
  ------------------
56183|      0|        return -1;
56184|       |
56185|     14|    ctx->mapped_arguments_shape = js_new_shape2(ctx, get_proto_obj(ctx->class_proto[JS_CLASS_OBJECT]),
56186|     14|                                         JS_PROP_INITIAL_HASH_SIZE, 3);
  ------------------
  |  |  958|     14|#define JS_PROP_INITIAL_HASH_SIZE 4 /* must be a power of two */
  ------------------
56187|     14|    if (!ctx->mapped_arguments_shape)
  ------------------
  |  Branch (56187:9): [True: 0, False: 14]
  ------------------
56188|      0|        return -1;
56189|     14|    if (add_shape_property(ctx, &ctx->mapped_arguments_shape, NULL,
  ------------------
  |  Branch (56189:9): [True: 0, False: 14]
  ------------------
56190|     14|                           JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_length, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56191|      0|        return -1;
56192|     14|    if (add_shape_property(ctx, &ctx->mapped_arguments_shape, NULL,
  ------------------
  |  Branch (56192:9): [True: 0, False: 14]
  ------------------
56193|     14|                           JS_ATOM_Symbol_iterator, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_Symbol_iterator, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56194|      0|        return -1;
56195|     14|    if (add_shape_property(ctx, &ctx->mapped_arguments_shape, NULL,
  ------------------
  |  Branch (56195:9): [True: 0, False: 14]
  ------------------
56196|     14|                           JS_ATOM_callee, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  297|     14|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
                                         JS_ATOM_callee, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE))
  ------------------
  |  |  296|     14|#define JS_PROP_CONFIGURABLE  (1 << 0)
  ------------------
56197|      0|        return -1;
56198|       |    
56199|     14|    return 0;
56200|     14|}
quickjs.c:JS_SetImmutablePrototype:
 7878|     14|{
 7879|     14|    JSObject *p;
 7880|     14|    if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT)
  ------------------
  |  |  236|     14|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (7880:9): [True: 0, False: 14]
  ------------------
 7881|      0|        return;
 7882|     14|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|     14|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
 7883|     14|    p->has_immutable_prototype = TRUE;
 7884|     14|}
quickjs.c:js_array_join:
42425|      7|{
42426|      7|    JSValue obj, sep = JS_UNDEFINED, el;
  ------------------
  |  |  289|      7|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      7|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
42427|      7|    StringBuffer b_s, *b = &b_s;
42428|      7|    JSString *p = NULL;
42429|      7|    int64_t i, n;
42430|      7|    int c;
42431|       |
42432|      7|    obj = JS_ToObject(ctx, this_val);
42433|      7|    if (js_get_length64(ctx, &n, obj))
  ------------------
  |  Branch (42433:9): [True: 0, False: 7]
  ------------------
42434|      0|        goto exception;
42435|       |
42436|      7|    c = ',';    /* default separator */
42437|      7|    if (!toLocaleString && argc > 0 && !JS_IsUndefined(argv[0])) {
  ------------------
  |  Branch (42437:9): [True: 7, False: 0]
  |  Branch (42437:28): [True: 0, False: 7]
  |  Branch (42437:40): [True: 0, False: 0]
  ------------------
42438|      0|        sep = JS_ToString(ctx, argv[0]);
42439|      0|        if (JS_IsException(sep))
  ------------------
  |  Branch (42439:13): [True: 0, False: 0]
  ------------------
42440|      0|            goto exception;
42441|      0|        p = JS_VALUE_GET_STRING(sep);
  ------------------
  |  |  228|      0|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
42442|      0|        if (p->len == 1 && !p->is_wide_char)
  ------------------
  |  Branch (42442:13): [True: 0, False: 0]
  |  Branch (42442:28): [True: 0, False: 0]
  ------------------
42443|      0|            c = p->u.str8[0];
42444|      0|        else
42445|      0|            c = -1;
42446|      0|    }
42447|      7|    string_buffer_init(ctx, b, 0);
42448|       |
42449|   343k|    for(i = 0; i < n; i++) {
  ------------------
  |  Branch (42449:16): [True: 343k, False: 7]
  ------------------
42450|   343k|        if (i > 0) {
  ------------------
  |  Branch (42450:13): [True: 343k, False: 7]
  ------------------
42451|   343k|            if (c >= 0) {
  ------------------
  |  Branch (42451:17): [True: 343k, False: 0]
  ------------------
42452|   343k|                string_buffer_putc8(b, c);
42453|   343k|            } else {
42454|      0|                string_buffer_concat(b, p, 0, p->len);
42455|      0|            }
42456|   343k|        }
42457|   343k|        el = JS_GetPropertyUint32(ctx, obj, i);
42458|   343k|        if (JS_IsException(el))
  ------------------
  |  Branch (42458:13): [True: 0, False: 343k]
  ------------------
42459|      0|            goto fail;
42460|   343k|        if (!JS_IsNull(el) && !JS_IsUndefined(el)) {
  ------------------
  |  Branch (42460:13): [True: 343k, False: 0]
  |  Branch (42460:31): [True: 343k, False: 0]
  ------------------
42461|   343k|            if (toLocaleString) {
  ------------------
  |  Branch (42461:17): [True: 0, False: 343k]
  ------------------
42462|      0|                el = JS_ToLocaleStringFree(ctx, el);
42463|      0|            }
42464|   343k|            if (string_buffer_concat_value_free(b, el))
  ------------------
  |  Branch (42464:17): [True: 0, False: 343k]
  ------------------
42465|      0|                goto fail;
42466|   343k|        }
42467|   343k|    }
42468|      7|    JS_FreeValue(ctx, sep);
42469|      7|    JS_FreeValue(ctx, obj);
42470|      7|    return string_buffer_end(b);
42471|       |
42472|      0|fail:
42473|      0|    string_buffer_free(b);
42474|      0|    JS_FreeValue(ctx, sep);
42475|      0|exception:
42476|      0|    JS_FreeValue(ctx, obj);
42477|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
42478|      0|}
quickjs.c:js_array_toString:
42402|      7|{
42403|      7|    JSValue obj, method, ret;
42404|       |
42405|      7|    obj = JS_ToObject(ctx, this_val);
42406|      7|    if (JS_IsException(obj))
  ------------------
  |  Branch (42406:9): [True: 0, False: 7]
  ------------------
42407|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
42408|      7|    method = JS_GetProperty(ctx, obj, JS_ATOM_join);
42409|      7|    if (JS_IsException(method)) {
  ------------------
  |  Branch (42409:9): [True: 0, False: 7]
  ------------------
42410|      0|        ret = JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
42411|      0|    } else
42412|      7|    if (!JS_IsFunction(ctx, method)) {
  ------------------
  |  Branch (42412:9): [True: 0, False: 7]
  ------------------
42413|       |        /* Use intrinsic Object.prototype.toString */
42414|      0|        JS_FreeValue(ctx, method);
42415|      0|        ret = js_object_toString(ctx, obj, 0, NULL);
42416|      7|    } else {
42417|       |        ret = JS_CallFree(ctx, method, obj, 0, NULL);
42418|      7|    }
42419|      7|    JS_FreeValue(ctx, obj);
42420|      7|    return ret;
42421|      7|}
quickjs.c:js_object_seal:
40469|     14|{
40470|     14|    JSValueConst obj = argv[0];
  ------------------
  |  |  234|     14|#define JSValueConst JSValue
  ------------------
40471|     14|    JSObject *p;
40472|     14|    JSPropertyEnum *props;
40473|     14|    uint32_t len, i;
40474|     14|    int flags, desc_flags, res;
40475|       |
40476|     14|    if (!JS_IsObject(obj))
  ------------------
  |  Branch (40476:9): [True: 0, False: 14]
  ------------------
40477|      0|        return JS_DupValue(ctx, obj);
40478|       |
40479|     14|    res = JS_PreventExtensions(ctx, obj);
40480|     14|    if (res < 0)
  ------------------
  |  Branch (40480:9): [True: 0, False: 14]
  ------------------
40481|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
40482|     14|    if (!res) {
  ------------------
  |  Branch (40482:9): [True: 0, False: 14]
  ------------------
40483|      0|        return JS_ThrowTypeError(ctx, "proxy preventExtensions handler returned false");
40484|      0|    }
40485|       |
40486|     14|    p = JS_VALUE_GET_OBJ(obj);
  ------------------
  |  |  227|     14|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|     14|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
40487|     14|    flags = JS_GPN_STRING_MASK | JS_GPN_SYMBOL_MASK;
  ------------------
  |  |  808|     14|#define JS_GPN_STRING_MASK  (1 << 0)
  ------------------
                  flags = JS_GPN_STRING_MASK | JS_GPN_SYMBOL_MASK;
  ------------------
  |  |  809|     14|#define JS_GPN_SYMBOL_MASK  (1 << 1)
  ------------------
40488|     14|    if (JS_GetOwnPropertyNamesInternal(ctx, &props, &len, p, flags))
  ------------------
  |  Branch (40488:9): [True: 0, False: 14]
  ------------------
40489|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
40490|       |
40491|     42|    for(i = 0; i < len; i++) {
  ------------------
  |  Branch (40491:16): [True: 28, False: 14]
  ------------------
40492|     28|        JSPropertyDescriptor desc;
40493|     28|        JSAtom prop = props[i].atom;
40494|       |
40495|     28|        desc_flags = JS_PROP_THROW | JS_PROP_HAS_CONFIGURABLE;
  ------------------
  |  |  318|     28|#define JS_PROP_THROW            (1 << 14)
  ------------------
                      desc_flags = JS_PROP_THROW | JS_PROP_HAS_CONFIGURABLE;
  ------------------
  |  |  309|     28|#define JS_PROP_HAS_CONFIGURABLE (1 << 8)
  ------------------
40496|     28|        if (freeze_flag) {
  ------------------
  |  Branch (40496:13): [True: 28, False: 0]
  ------------------
40497|     28|            res = JS_GetOwnPropertyInternal(ctx, &desc, p, prop);
40498|     28|            if (res < 0)
  ------------------
  |  Branch (40498:17): [True: 0, False: 28]
  ------------------
40499|      0|                goto exception;
40500|     28|            if (res) {
  ------------------
  |  Branch (40500:17): [True: 28, False: 0]
  ------------------
40501|     28|                if (desc.flags & JS_PROP_WRITABLE)
  ------------------
  |  |  297|     28|#define JS_PROP_WRITABLE      (1 << 1)
  ------------------
  |  Branch (40501:21): [True: 0, False: 28]
  ------------------
40502|      0|                    desc_flags |= JS_PROP_HAS_WRITABLE;
  ------------------
  |  |  310|      0|#define JS_PROP_HAS_WRITABLE     (1 << 9)
  ------------------
40503|     28|                js_free_desc(ctx, &desc);
40504|     28|            }
40505|     28|        }
40506|     28|        if (JS_DefineProperty(ctx, obj, prop, JS_UNDEFINED,
  ------------------
  |  |  289|     28|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     28|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
  |  Branch (40506:13): [True: 0, False: 28]
  ------------------
40507|     28|                              JS_UNDEFINED, JS_UNDEFINED, desc_flags) < 0)
  ------------------
  |  |  289|     28|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     28|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
                                            JS_UNDEFINED, JS_UNDEFINED, desc_flags) < 0)
  ------------------
  |  |  289|     28|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     28|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
40508|      0|            goto exception;
40509|     28|    }
40510|     14|    JS_FreePropertyEnum(ctx, props, len);
40511|     14|    return JS_DupValue(ctx, obj);
40512|       |
40513|      0| exception:
40514|      0|    JS_FreePropertyEnum(ctx, props, len);
40515|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
40516|     14|}
quickjs.c:js_object_valueOf:
40374|      4|{
40375|      4|    return JS_ToObject(ctx, this_val);
40376|      4|}
quickjs.c:js_function_toString:
41138|      1|{
41139|      1|    JSObject *p;
41140|      1|    JSFunctionKindEnum func_kind = JS_FUNC_NORMAL;
41141|       |
41142|      1|    if (check_function(ctx, this_val))
  ------------------
  |  Branch (41142:9): [True: 0, False: 1]
  ------------------
41143|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
41144|       |
41145|      1|    p = JS_VALUE_GET_OBJ(this_val);
  ------------------
  |  |  227|      1|#define JS_VALUE_GET_OBJ(v) ((JSObject *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      1|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
41146|      1|    if (js_class_has_bytecode(p->class_id)) {
  ------------------
  |  Branch (41146:9): [True: 1, False: 0]
  ------------------
41147|      1|        JSFunctionBytecode *b = p->u.func.function_bytecode;
41148|      1|        if (b->has_debug && b->debug.source) {
  ------------------
  |  Branch (41148:13): [True: 1, False: 0]
  |  Branch (41148:29): [True: 1, False: 0]
  ------------------
41149|      1|            return JS_NewStringLen(ctx, b->debug.source, b->debug.source_len);
41150|      1|        }
41151|      0|        func_kind = b->func_kind;
41152|      0|    }
41153|      0|    {
41154|      0|        JSValue name;
41155|      0|        const char *pref, *suff;
41156|       |
41157|      0|        switch(func_kind) {
41158|      0|        default:
  ------------------
  |  Branch (41158:9): [True: 0, False: 0]
  ------------------
41159|      0|        case JS_FUNC_NORMAL:
  ------------------
  |  Branch (41159:9): [True: 0, False: 0]
  ------------------
41160|      0|            pref = "function ";
41161|      0|            break;
41162|      0|        case JS_FUNC_GENERATOR:
  ------------------
  |  Branch (41162:9): [True: 0, False: 0]
  ------------------
41163|      0|            pref = "function *";
41164|      0|            break;
41165|      0|        case JS_FUNC_ASYNC:
  ------------------
  |  Branch (41165:9): [True: 0, False: 0]
  ------------------
41166|      0|            pref = "async function ";
41167|      0|            break;
41168|      0|        case JS_FUNC_ASYNC_GENERATOR:
  ------------------
  |  Branch (41168:9): [True: 0, False: 0]
  ------------------
41169|      0|            pref = "async function *";
41170|      0|            break;
41171|      0|        }
41172|      0|        suff = "() {\n    [native code]\n}";
41173|      0|        name = JS_GetProperty(ctx, this_val, JS_ATOM_name);
41174|      0|        if (JS_IsUndefined(name))
  ------------------
  |  Branch (41174:13): [True: 0, False: 0]
  ------------------
41175|      0|            name = JS_AtomToString(ctx, JS_ATOM_empty_string);
41176|      0|        return JS_ConcatString3(ctx, pref, name, suff);
41177|      0|    }
41178|      0|}
quickjs.c:string_get_hex:
54411|  34.8k|static int string_get_hex(JSString *p, int k, int n) {
54412|  34.8k|    int c = 0, h;
54413|   100k|    while (n-- > 0) {
  ------------------
  |  Branch (54413:12): [True: 73.5k, False: 27.0k]
  ------------------
54414|  73.5k|        if ((h = from_hex(string_get(p, k++))) < 0)
  ------------------
  |  Branch (54414:13): [True: 7.79k, False: 65.7k]
  ------------------
54415|  7.79k|            return -1;
54416|  65.7k|        c = (c << 4) | h;
54417|  65.7k|    }
54418|  27.0k|    return c;
54419|  34.8k|}
quickjs.c:js_global_unescape:
54650|      2|{
54651|      2|    JSValue str;
54652|      2|    StringBuffer b_s, *b = &b_s;
54653|      2|    JSString *p;
54654|      2|    int i, len, c, n;
54655|       |
54656|      2|    str = JS_ToString(ctx, argv[0]);
54657|      2|    if (JS_IsException(str))
  ------------------
  |  Branch (54657:9): [True: 0, False: 2]
  ------------------
54658|      0|        return str;
54659|       |
54660|      2|    string_buffer_init(ctx, b, 0);
54661|      2|    p = JS_VALUE_GET_STRING(str);
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
54662|  1.62M|    for (i = 0, len = p->len; i < len; i++) {
  ------------------
  |  Branch (54662:31): [True: 1.62M, False: 2]
  ------------------
54663|  1.62M|        c = string_get(p, i);
54664|  1.62M|        if (c == '%') {
  ------------------
  |  Branch (54664:13): [True: 30.9k, False: 1.59M]
  ------------------
54665|  30.9k|            if (i + 6 <= len
  ------------------
  |  Branch (54665:17): [True: 30.9k, False: 0]
  ------------------
54666|  30.9k|            &&  string_get(p, i + 1) == 'u'
  ------------------
  |  Branch (54666:17): [True: 7.76k, False: 23.1k]
  ------------------
54667|  7.76k|            &&  (n = string_get_hex(p, i + 2, 4)) >= 0) {
  ------------------
  |  Branch (54667:17): [True: 3.88k, False: 3.88k]
  ------------------
54668|  3.88k|                c = n;
54669|  3.88k|                i += 6 - 1;
54670|  3.88k|            } else
54671|  27.0k|            if (i + 3 <= len
  ------------------
  |  Branch (54671:17): [True: 27.0k, False: 0]
  ------------------
54672|  27.0k|            &&  (n = string_get_hex(p, i + 1, 2)) >= 0) {
  ------------------
  |  Branch (54672:17): [True: 23.1k, False: 3.90k]
  ------------------
54673|  23.1k|                c = n;
54674|  23.1k|                i += 3 - 1;
54675|  23.1k|            }
54676|  30.9k|        }
54677|  1.62M|        string_buffer_putc16(b, c);
54678|  1.62M|    }
54679|      2|    JS_FreeValue(ctx, str);
54680|      2|    return string_buffer_end(b);
54681|      2|}
quickjs.c:string_cmp:
45235|   421k|{
45236|   421k|    int i, c1, c2;
45237|   765k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (45237:17): [True: 421k, False: 343k]
  ------------------
45238|   421k|        if ((c1 = string_get(p1, x1 + i)) != (c2 = string_get(p2, x2 + i)))
  ------------------
  |  Branch (45238:13): [True: 78.4k, False: 343k]
  ------------------
45239|  78.4k|            return c1 - c2;
45240|   421k|    }
45241|   343k|    return 0;
45242|   421k|}
quickjs.c:js_string_split:
45814|      4|{
45815|       |    // split(sep, limit)
45816|      4|    JSValueConst O = this_val, separator = argv[0], limit = argv[1];
  ------------------
  |  |  234|      4|#define JSValueConst JSValue
  ------------------
45817|      4|    JSValueConst args[2];
  ------------------
  |  |  234|      4|#define JSValueConst JSValue
  ------------------
45818|      4|    JSValue S, A, R, T;
45819|      4|    uint32_t lim, lengthA;
45820|      4|    int64_t p, q, s, r, e;
45821|      4|    JSString *sp, *rp;
45822|       |
45823|      4|    if (JS_IsUndefined(O) || JS_IsNull(O))
  ------------------
  |  Branch (45823:9): [True: 0, False: 4]
  |  Branch (45823:30): [True: 0, False: 4]
  ------------------
45824|      0|        return JS_ThrowTypeError(ctx, "cannot convert to object");
45825|       |
45826|      4|    S = JS_UNDEFINED;
  ------------------
  |  |  289|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
45827|      4|    A = JS_UNDEFINED;
  ------------------
  |  |  289|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
45828|      4|    R = JS_UNDEFINED;
  ------------------
  |  |  289|      4|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      4|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
45829|       |
45830|      4|    if (JS_IsObject(separator)) {
  ------------------
  |  Branch (45830:9): [True: 4, False: 0]
  ------------------
45831|      4|        JSValue splitter;
45832|      4|        splitter = JS_GetProperty(ctx, separator, JS_ATOM_Symbol_split);
45833|      4|        if (JS_IsException(splitter))
  ------------------
  |  Branch (45833:13): [True: 0, False: 4]
  ------------------
45834|      0|            return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
45835|      4|        if (!JS_IsUndefined(splitter) && !JS_IsNull(splitter)) {
  ------------------
  |  Branch (45835:13): [True: 2, False: 2]
  |  Branch (45835:42): [True: 2, False: 0]
  ------------------
45836|      2|            args[0] = O;
45837|      2|            args[1] = limit;
45838|      2|            return JS_CallFree(ctx, splitter, separator, 2, args);
45839|      2|        }
45840|      4|    }
45841|      2|    S = JS_ToString(ctx, O);
45842|      2|    if (JS_IsException(S))
  ------------------
  |  Branch (45842:9): [True: 0, False: 2]
  ------------------
45843|      0|        goto exception;
45844|      2|    A = JS_NewArray(ctx);
45845|      2|    if (JS_IsException(A))
  ------------------
  |  Branch (45845:9): [True: 0, False: 2]
  ------------------
45846|      0|        goto exception;
45847|      2|    lengthA = 0;
45848|      2|    if (JS_IsUndefined(limit)) {
  ------------------
  |  Branch (45848:9): [True: 2, False: 0]
  ------------------
45849|      2|        lim = 0xffffffff;
45850|      2|    } else {
45851|      0|        if (JS_ToUint32(ctx, &lim, limit) < 0)
  ------------------
  |  Branch (45851:13): [True: 0, False: 0]
  ------------------
45852|      0|            goto exception;
45853|      0|    }
45854|      2|    sp = JS_VALUE_GET_STRING(S);
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
45855|      2|    s = sp->len;
45856|      2|    R = JS_ToString(ctx, separator);
45857|      2|    if (JS_IsException(R))
  ------------------
  |  Branch (45857:9): [True: 0, False: 2]
  ------------------
45858|      0|        goto exception;
45859|      2|    rp = JS_VALUE_GET_STRING(R);
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
45860|      2|    r = rp->len;
45861|      2|    p = 0;
45862|      2|    if (lim == 0)
  ------------------
  |  Branch (45862:9): [True: 0, False: 2]
  ------------------
45863|      0|        goto done;
45864|      2|    if (JS_IsUndefined(separator))
  ------------------
  |  Branch (45864:9): [True: 0, False: 2]
  ------------------
45865|      0|        goto add_tail;
45866|      2|    if (s == 0) {
  ------------------
  |  Branch (45866:9): [True: 0, False: 2]
  ------------------
45867|      0|        if (r != 0)
  ------------------
  |  Branch (45867:13): [True: 0, False: 0]
  ------------------
45868|      0|            goto add_tail;
45869|      0|        goto done;
45870|      0|    }
45871|   343k|    for (q = p; (q += !r) <= s - r - !r; q = p = e + r) {
  ------------------
  |  Branch (45871:17): [True: 343k, False: 0]
  ------------------
45872|   343k|        e = string_indexof(sp, rp, q);
45873|   343k|        if (e < 0)
  ------------------
  |  Branch (45873:13): [True: 2, False: 343k]
  ------------------
45874|      2|            break;
45875|   343k|        T = js_sub_string(ctx, sp, p, e);
45876|   343k|        if (JS_IsException(T))
  ------------------
  |  Branch (45876:13): [True: 0, False: 343k]
  ------------------
45877|      0|            goto exception;
45878|   343k|        if (JS_CreateDataPropertyUint32(ctx, A, lengthA++, T, 0) < 0)
  ------------------
  |  Branch (45878:13): [True: 0, False: 343k]
  ------------------
45879|      0|            goto exception;
45880|   343k|        if (lengthA == lim)
  ------------------
  |  Branch (45880:13): [True: 0, False: 343k]
  ------------------
45881|      0|            goto done;
45882|   343k|    }
45883|      2|add_tail:
45884|      2|    T = js_sub_string(ctx, sp, p, s);
45885|      2|    if (JS_IsException(T))
  ------------------
  |  Branch (45885:9): [True: 0, False: 2]
  ------------------
45886|      0|        goto exception;
45887|      2|    if (JS_CreateDataPropertyUint32(ctx, A, lengthA++, T,0 ) < 0)
  ------------------
  |  Branch (45887:9): [True: 0, False: 2]
  ------------------
45888|      0|        goto exception;
45889|      2|done:
45890|      2|    JS_FreeValue(ctx, S);
45891|      2|    JS_FreeValue(ctx, R);
45892|      2|    return A;
45893|       |
45894|      0|exception:
45895|      0|    JS_FreeValue(ctx, A);
45896|      0|    JS_FreeValue(ctx, S);
45897|      0|    JS_FreeValue(ctx, R);
45898|      0|    return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
45899|      2|}
quickjs.c:string_indexof:
45265|   343k|{
45266|       |    /* assuming 0 <= from <= p1->len */
45267|   343k|    int c, i, j, len1 = p1->len, len2 = p2->len;
45268|   343k|    if (len2 == 0)
  ------------------
  |  Branch (45268:9): [True: 0, False: 343k]
  ------------------
45269|      0|        return from;
45270|   421k|    for (i = from, c = string_get(p2, 0); i + len2 <= len1; i = j + 1) {
  ------------------
  |  Branch (45270:43): [True: 421k, False: 0]
  ------------------
45271|   421k|        j = string_indexof_char(p1, c, i);
45272|   421k|        if (j < 0 || j + len2 > len1)
  ------------------
  |  Branch (45272:13): [True: 2, False: 421k]
  |  Branch (45272:22): [True: 0, False: 421k]
  ------------------
45273|      2|            break;
45274|   421k|        if (!string_cmp(p1, p2, j + 1, 1, len2 - 1))
  ------------------
  |  Branch (45274:13): [True: 343k, False: 78.4k]
  ------------------
45275|   343k|            return j;
45276|   421k|    }
45277|      2|    return -1;
45278|   343k|}
quickjs.c:js_string_iterator_next:
46431|      2|{
46432|      2|    JSArrayIteratorData *it;
46433|      2|    uint32_t idx, c, start;
46434|      2|    JSString *p;
46435|       |
46436|      2|    it = JS_GetOpaque2(ctx, this_val, JS_CLASS_STRING_ITERATOR);
46437|      2|    if (!it) {
  ------------------
  |  Branch (46437:9): [True: 0, False: 2]
  ------------------
46438|      0|        *pdone = FALSE;
46439|      0|        return JS_EXCEPTION;
  ------------------
  |  |  292|      0|#define JS_EXCEPTION JS_MKVAL(JS_TAG_EXCEPTION, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
46440|      0|    }
46441|      2|    if (JS_IsUndefined(it->obj))
  ------------------
  |  Branch (46441:9): [True: 0, False: 2]
  ------------------
46442|      0|        goto done;
46443|      2|    p = JS_VALUE_GET_STRING(it->obj);
  ------------------
  |  |  228|      2|#define JS_VALUE_GET_STRING(v) ((JSString *)JS_VALUE_GET_PTR(v))
  |  |  ------------------
  |  |  |  |  243|      2|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  |  |  ------------------
  ------------------
46444|      2|    idx = it->idx;
46445|      2|    if (idx >= p->len) {
  ------------------
  |  Branch (46445:9): [True: 0, False: 2]
  ------------------
46446|      0|        JS_FreeValue(ctx, it->obj);
46447|      0|        it->obj = JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
46448|      0|    done:
46449|      0|        *pdone = TRUE;
46450|      0|        return JS_UNDEFINED;
  ------------------
  |  |  289|      0|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|      0|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
46451|      0|    }
46452|       |
46453|      2|    start = idx;
46454|      2|    c = string_getc(p, (int *)&idx);
46455|      2|    it->idx = idx;
46456|      2|    *pdone = FALSE;
46457|      2|    if (c <= 0xffff) {
  ------------------
  |  Branch (46457:9): [True: 2, False: 0]
  ------------------
46458|      2|        return js_new_string_char(ctx, c);
46459|      2|    } else {
46460|      0|        return js_new_string16_len(ctx, p->u.str16 + start, 2);
46461|      0|    }
46462|      2|}
quickjs.c:js_random_init:
47065|     14|{
47066|     14|    struct timeval tv;
47067|     14|    gettimeofday(&tv, NULL);
47068|     14|    ctx->random_state = ((int64_t)tv.tv_sec * 1000000) + tv.tv_usec;
47069|       |    /* the state must be non zero */
47070|     14|    if (ctx->random_state == 0)
  ------------------
  |  Branch (47070:9): [True: 0, False: 14]
  ------------------
47071|      0|        ctx->random_state = 1;
47072|     14|}
quickjs.c:JS_AddIntrinsicBigInt:
56053|     14|{
56054|     14|    JSValue obj1;
56055|       |
56056|     14|    obj1 = JS_NewCConstructor(ctx, JS_CLASS_BIG_INT, "BigInt",
56057|     14|                                     js_bigint_constructor, 1, JS_CFUNC_constructor_or_func, 0,
56058|     14|                                     JS_UNDEFINED,
  ------------------
  |  |  289|     14|#define JS_UNDEFINED JS_MKVAL(JS_TAG_UNDEFINED, 0)
  |  |  ------------------
  |  |  |  |  245|     14|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  |  |  ------------------
  ------------------
56059|     14|                                     js_bigint_funcs, countof(js_bigint_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56060|     14|                                     js_bigint_proto_funcs, countof(js_bigint_proto_funcs),
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
56061|     14|                                     0);
56062|     14|    if (JS_IsException(obj1))
  ------------------
  |  Branch (56062:9): [True: 0, False: 14]
  ------------------
56063|      0|        return -1;
56064|     14|    JS_FreeValue(ctx, obj1);
56065|     14|    return 0;
56066|     14|}
quickjs.c:JS_AddIntrinsicAtomics:
60697|     14|{
60698|       |    /* add Atomics as autoinit object */
60699|     14|    return JS_SetPropertyFunctionList(ctx, ctx->global_obj, js_atomics_obj, countof(js_atomics_obj));
  ------------------
  |  |   47|     14|#define countof(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
60700|     14|}

fuzz_eval.c:JS_IsException:
  640|     14|{
  641|     14|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_EXCEPTION);
  ------------------
  |  |   38|     14|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  642|     14|}
fuzz_eval.c:JS_FreeValue:
  686|      2|{
  687|      2|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  285|      2|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (285:35): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  688|      0|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  689|      0|        if (--p->ref_count <= 0) {
  ------------------
  |  Branch (689:13): [True: 0, False: 0]
  ------------------
  690|      0|            __JS_FreeValue(ctx, v);
  691|      0|        }
  692|      0|    }
  693|      2|}
fuzz_common.c:JS_IsException:
  640|     14|{
  641|     14|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_EXCEPTION);
  ------------------
  |  |   38|     14|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  642|     14|}
fuzz_common.c:JS_FreeValue:
  686|     14|{
  687|     14|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  285|     14|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|     14|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (285:35): [True: 0, False: 14]
  |  |  ------------------
  ------------------
  688|      0|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|      0|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  689|      0|        if (--p->ref_count <= 0) {
  ------------------
  |  Branch (689:13): [True: 0, False: 0]
  ------------------
  690|      0|            __JS_FreeValue(ctx, v);
  691|      0|        }
  692|      0|    }
  693|     14|}
quickjs.c:JS_FreeValue:
  686|  10.1M|{
  687|  10.1M|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  285|  10.1M|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|  10.1M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (285:35): [True: 2.72M, False: 7.41M]
  |  |  ------------------
  ------------------
  688|  2.72M|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|  2.72M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  689|  2.72M|        if (--p->ref_count <= 0) {
  ------------------
  |  Branch (689:13): [True: 1.09k, False: 2.72M]
  ------------------
  690|  1.09k|            __JS_FreeValue(ctx, v);
  691|  1.09k|        }
  692|  2.72M|    }
  693|  10.1M|}
quickjs.c:__js_rc:
  681|  6.08M|{
  682|  6.08M|    return (JSRefCountHeader *)((uint32_t *)ptr - 1);
  683|  6.08M|}
quickjs.c:JS_IsException:
  640|  4.75M|{
  641|  4.75M|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_EXCEPTION);
  ------------------
  |  |   38|  4.75M|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  642|  4.75M|}
quickjs.c:JS_FreeValueRT:
  696|   357k|{
  697|   357k|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  285|   357k|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|   357k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (285:35): [True: 353k, False: 4.02k]
  |  |  ------------------
  ------------------
  698|   353k|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|   353k|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  699|   353k|        if (--p->ref_count <= 0) {
  ------------------
  |  Branch (699:13): [True: 75.6k, False: 277k]
  ------------------
  700|  75.6k|            __JS_FreeValueRT(rt, v);
  701|  75.6k|        }
  702|   353k|    }
  703|   357k|}
quickjs.c:JS_DupValue:
  706|  3.00M|{
  707|  3.00M|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  285|  3.00M|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|  3.00M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (285:35): [True: 3.00M, False: 3.20k]
  |  |  ------------------
  ------------------
  708|  3.00M|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|  3.00M|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  709|  3.00M|        p->ref_count++;
  710|  3.00M|    }
  711|  3.00M|    return (JSValue)v;
  712|  3.00M|}
quickjs.c:JS_ToCStringLen:
  751|     89|{
  752|     89|    return JS_ToCStringLen2(ctx, plen, val1, 0);
  753|     89|}
quickjs.c:JS_IsObject:
  661|  1.01M|{
  662|  1.01M|    return JS_VALUE_GET_TAG(v) == JS_TAG_OBJECT;
  ------------------
  |  |  236|  1.01M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  663|  1.01M|}
quickjs.c:JS_IsUninitialized:
  645|    115|{
  646|    115|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_UNINITIALIZED);
  ------------------
  |  |   38|    115|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  647|    115|}
quickjs.c:JS_ToCString:
  755|     13|{
  756|       |    return JS_ToCStringLen2(ctx, NULL, val1, 0);
  757|     13|}
quickjs.c:JS_AtomToCString:
  461|     67|{
  462|       |    return JS_AtomToCStringLen(ctx, NULL, atom);
  463|     67|}
quickjs.c:JS_GetProperty:
  779|  1.01M|{
  780|  1.01M|    return JS_GetPropertyInternal(ctx, this_obj, prop, this_obj, 0);
  781|  1.01M|}
quickjs.c:JS_IsNull:
  630|  2.36M|{
  631|  2.36M|    return JS_VALUE_GET_TAG(v) == JS_TAG_NULL;
  ------------------
  |  |  236|  2.36M|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  632|  2.36M|}
quickjs.c:JS_IsUndefined:
  635|   344k|{
  636|   344k|    return JS_VALUE_GET_TAG(v) == JS_TAG_UNDEFINED;
  ------------------
  |  |  236|   344k|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  637|   344k|}
quickjs.c:JS_NewInt32:
  559|  3.05M|{
  560|  3.05M|    return JS_MKVAL(JS_TAG_INT, val);
  ------------------
  |  |  245|  3.05M|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  ------------------
  561|  3.05M|}
quickjs.c:JS_NewUint32:
  580|   343k|{
  581|   343k|    JSValue v;
  582|   343k|    if (val <= 0x7fffffff) {
  ------------------
  |  Branch (582:9): [True: 343k, False: 0]
  ------------------
  583|   343k|        v = JS_NewInt32(ctx, val);
  584|   343k|    } else {
  585|      0|        v = __JS_NewFloat64(ctx, val);
  586|      0|    }
  587|   343k|    return v;
  588|   343k|}
quickjs.c:JS_SetProperty:
  792|  1.00M|{
  793|  1.00M|    return JS_SetPropertyInternal(ctx, this_obj, prop, val, this_obj, JS_PROP_THROW);
  ------------------
  |  |  318|  1.00M|#define JS_PROP_THROW            (1 << 14)
  ------------------
  794|  1.00M|}
quickjs.c:JS_NewInt64:
  569|   343k|{
  570|   343k|    JSValue v;
  571|   343k|    if (val == (int32_t)val) {
  ------------------
  |  Branch (571:9): [True: 343k, False: 0]
  ------------------
  572|   343k|        v = JS_NewInt32(ctx, val);
  573|   343k|    } else {
  574|      0|        v = __JS_NewFloat64(ctx, val);
  575|      0|    }
  576|   343k|    return v;
  577|   343k|}
quickjs.c:JS_NewFloat64:
  594|     24|{
  595|     24|    int32_t val;
  596|     24|    union {
  597|     24|        double d;
  598|     24|        uint64_t u;
  599|     24|    } u, t;
  600|     24|    if (d >= INT32_MIN && d <= INT32_MAX) {
  ------------------
  |  Branch (600:9): [True: 24, False: 0]
  |  Branch (600:27): [True: 21, False: 3]
  ------------------
  601|     21|        u.d = d;
  602|     21|        val = (int32_t)d;
  603|     21|        t.d = val;
  604|       |        /* -0 cannot be represented as integer, so we compare the bit
  605|       |           representation */
  606|     21|        if (u.u == t.u)
  ------------------
  |  Branch (606:13): [True: 19, False: 2]
  ------------------
  607|     19|            return JS_MKVAL(JS_TAG_INT, val);
  ------------------
  |  |  245|     19|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  ------------------
  608|     21|    }
  609|      5|    return __JS_NewFloat64(ctx, d);
  610|     24|}
quickjs.c:JS_VALUE_IS_NAN:
  261|     22|{
  262|     22|    union {
  263|     22|        double d;
  264|     22|        uint64_t u64;
  265|     22|    } u;
  266|     22|    if (v.tag != JS_TAG_FLOAT64)
  ------------------
  |  Branch (266:9): [True: 17, False: 5]
  ------------------
  267|     17|        return 0;
  268|      5|    u.d = v.u.float64;
  269|      5|    return (u.u64 & 0x7fffffffffffffff) > 0x7ff0000000000000;
  270|     22|}
quickjs.c:JS_NewCatchOffset:
  564|      1|{
  565|      1|    return JS_MKVAL(JS_TAG_CATCH_OFFSET, val);
  ------------------
  |  |  245|      1|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  ------------------
  566|      1|}
quickjs.c:JS_NewString:
  743|     69|{
  744|     69|    return JS_NewStringLen(ctx, str, strlen(str));
  745|     69|}
quickjs.c:__JS_NewFloat64:
  253|    150|{
  254|    150|    JSValue v;
  255|    150|    v.tag = JS_TAG_FLOAT64;
  256|    150|    v.u.float64 = d;
  257|    150|    return v;
  258|    150|}
quickjs.c:JS_ToUint32:
  730|     12|{
  731|     12|    return JS_ToInt32(ctx, (int32_t*)pres, val);
  732|     12|}
quickjs.c:JS_IsString:
  650|      3|{
  651|      3|    return JS_VALUE_GET_TAG(v) == JS_TAG_STRING ||
  ------------------
  |  |  236|      3|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (651:12): [True: 1, False: 2]
  ------------------
  652|      2|        JS_VALUE_GET_TAG(v) == JS_TAG_STRING_ROPE;
  ------------------
  |  |  236|      2|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  ------------------
  |  Branch (652:9): [True: 0, False: 2]
  ------------------
  653|      3|}
quickjs.c:JS_NewCFunction:
 1050|     14|{
 1051|     14|    return JS_NewCFunction2(ctx, func, name, length, JS_CFUNC_generic, 0);
 1052|     14|}
quickjs.c:JS_NewBool:
  554|     34|{
  555|     34|    return JS_MKVAL(JS_TAG_BOOL, (val != 0));
  ------------------
  |  |  245|     34|#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
  ------------------
  556|     34|}
quickjs-libc.c:JS_AtomToCString:
  461|     14|{
  462|       |    return JS_AtomToCStringLen(ctx, NULL, atom);
  463|     14|}
quickjs-libc.c:JS_IsException:
  640|     39|{
  641|     39|    return js_unlikely(JS_VALUE_GET_TAG(v) == JS_TAG_EXCEPTION);
  ------------------
  |  |   38|     39|#define js_unlikely(x)        __builtin_expect(!!(x), 0)
  ------------------
  642|     39|}
quickjs-libc.c:JS_FreeValue:
  686|     27|{
  687|     27|    if (JS_VALUE_HAS_REF_COUNT(v)) {
  ------------------
  |  |  285|     27|#define JS_VALUE_HAS_REF_COUNT(v) ((unsigned)JS_VALUE_GET_TAG(v) >= (unsigned)JS_TAG_FIRST)
  |  |  ------------------
  |  |  |  |  236|     27|#define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
  |  |  ------------------
  |  |  |  Branch (285:35): [True: 27, False: 0]
  |  |  ------------------
  ------------------
  688|     27|        JSRefCountHeader *p = __js_rc(JS_VALUE_GET_PTR(v));
  ------------------
  |  |  243|     27|#define JS_VALUE_GET_PTR(v) ((v).u.ptr)
  ------------------
  689|     27|        if (--p->ref_count <= 0) {
  ------------------
  |  Branch (689:13): [True: 0, False: 27]
  ------------------
  690|      0|            __JS_FreeValue(ctx, v);
  691|      0|        }
  692|     27|    }
  693|     27|}
quickjs-libc.c:__js_rc:
  681|     27|{
  682|     27|    return (JSRefCountHeader *)((uint32_t *)ptr - 1);
  683|     27|}
quickjs-libc.c:JS_NewCFunction:
 1050|     56|{
 1051|     56|    return JS_NewCFunction2(ctx, func, name, length, JS_CFUNC_generic, 0);
 1052|     56|}

