32#define DUK__CONST_MARKER DUK_JS_CONST_MARKER
35#define DUK__MAX_ARRAY_INIT_VALUES 20
36#define DUK__MAX_OBJECT_INIT_PAIRS 10
39#define DUK__GETCONST_MAX_CONSTS_CHECK 256
44#define DUK__MAX_CONSTS DUK_BC_BC_MAX
45#define DUK__MAX_FUNCS DUK_BC_BC_MAX
46#define DUK__MAX_TEMPS 0xffffL
49#define DUK__BC_INITIAL_INSTS 256
51#define DUK__RECURSION_INCREASE(comp_ctx,thr) do { \
52 DUK_DDD(DUK_DDDPRINT("RECURSION INCREASE: %s:%ld", (const char *) DUK_FILE_MACRO, (long) DUK_LINE_MACRO)); \
53 duk__recursion_increase((comp_ctx)); \
56#define DUK__RECURSION_DECREASE(comp_ctx,thr) do { \
57 DUK_DDD(DUK_DDDPRINT("RECURSION DECREASE: %s:%ld", (const char *) DUK_FILE_MACRO, (long) DUK_LINE_MACRO)); \
58 duk__recursion_decrease((comp_ctx)); \
64#define DUK__COMPILE_ENTRY_SLOTS 8
65#define DUK__FUNCTION_INIT_REQUIRE_SLOTS 16
66#define DUK__FUNCTION_BODY_REQUIRE_SLOTS 16
67#define DUK__PARSE_STATEMENTS_SLOTS 16
68#define DUK__PARSE_EXPR_SLOTS 16
242#define DUK__BP_INVALID 0
244#define DUK__BP_CLOSING 4
245#define DUK__BP_FOR_EXPR DUK__BP_CLOSING
246#define DUK__BP_COMMA 6
247#define DUK__BP_ASSIGNMENT 8
248#define DUK__BP_CONDITIONAL 10
249#define DUK__BP_LOR 12
250#define DUK__BP_LAND 14
251#define DUK__BP_BOR 16
252#define DUK__BP_BXOR 18
253#define DUK__BP_BAND 20
254#define DUK__BP_EQUALITY 22
255#define DUK__BP_RELATIONAL 24
256#define DUK__BP_SHIFT 26
257#define DUK__BP_ADDITIVE 28
258#define DUK__BP_MULTIPLICATIVE 30
259#define DUK__BP_POSTFIX 32
260#define DUK__BP_CALL 34
261#define DUK__BP_MEMBER 36
263#define DUK__TOKEN_LBP_BP_MASK 0x1f
264#define DUK__TOKEN_LBP_FLAG_NO_REGEXP (1 << 5)
265#define DUK__TOKEN_LBP_FLAG_TERMINATES (1 << 6)
266#define DUK__TOKEN_LBP_FLAG_UNUSED (1 << 7)
268#define DUK__TOKEN_LBP_GET_BP(x) ((duk_small_uint_t) (((x) & DUK__TOKEN_LBP_BP_MASK) * 2))
270#define DUK__MK_LBP(bp) ((bp) >> 1)
271#define DUK__MK_LBP_FLAGS(bp,flags) (((bp) >> 1) | (flags))
440 if (expect >= 0 && comp_ctx->
curr_token.
t != expect) {
458 "prev: tok=%ld/%ld,%ld,term=%ld,%!T,%!T",
497#ifdef DUK_USE_EXPLICIT_NULL_INIT
586 duk_uint32_t i, e_next;
596 for (i = 0; i < e_next; i++) {
673 "indirectly -> set CREATEARGS"));
721 data_size = consts_count *
sizeof(
duk_tval) +
726 "data_size=%ld*%ld + %ld*%ld + %ld = %ld",
727 (
long) consts_count, (
long) funcs_count, (
long) code_size,
728 (
long) consts_count, (
long)
sizeof(
duk_tval),
730 (
long) code_size, (
long) data_size));
740 for (i = 0; i < consts_count; i++) {
753 for (i = 0; i < funcs_count; i++) {
774 for (i = 0; i < code_count; i++) {
775 p_instr[i] = q_instr[i].
ins;
799#if defined(DUK_USE_DEBUGGER_SUPPORT)
838#if defined(DUK_USE_NONSTD_FUNC_SOURCE_PROPERTY)
886#if defined(DUK_USE_PC2LINE)
926#if defined(DUK_USE_DEBUGGER_SUPPORT)
927 h_res->start_line = (duk_uint32_t) func->min_line;
928 h_res->end_line = (duk_uint32_t) func->max_line;
944#ifdef DUK_USE_DDDPRINT
956 (
long) (p - p_start),
958 (
unsigned long) (*p),
1004#define DUK__EMIT_FLAG_NO_SHUFFLE_A (1 << 8)
1005#define DUK__EMIT_FLAG_NO_SHUFFLE_B (1 << 9)
1006#define DUK__EMIT_FLAG_NO_SHUFFLE_C (1 << 10)
1007#define DUK__EMIT_FLAG_A_IS_SOURCE (1 << 11)
1008#define DUK__EMIT_FLAG_B_IS_TARGET (1 << 12)
1009#define DUK__EMIT_FLAG_C_IS_TARGET (1 << 13)
1010#define DUK__EMIT_FLAG_B_IS_TARGETSOURCE (1 << 14)
1011#define DUK__EMIT_FLAG_RESERVE_JUMPSLOT (1 << 15)
1033#if defined(DUK_USE_PC2LINE)
1038 DUK_DDD(
DUK_DDDPRINT(
"duk__emit: 0x%08lx curr_token.start_line=%ld prev_token.start_line=%ld pc=%ld --> %!I",
1039 (
unsigned long) ins,
1048#if defined(DUK_USE_PC2LINE)
1065#if defined(DUK_USE_PC2LINE)
1068#if defined(DUK_USE_DEBUGGER_SUPPORT)
1069 if (line < comp_ctx->
curr_func.min_line) {
1072 if (line > comp_ctx->
curr_func.max_line) {
1081#if defined(DUK_USE_PC2LINE) && defined(DUK_USE_ESBC_LIMITS)
1082#if defined(DUK_USE_BUFLEN16)
1106#if defined(DUK_USE_DEBUGGER_SUPPORT)
1113 if (line < comp_ctx->
curr_func.min_line) {
1116 if (line > comp_ctx->
curr_func.max_line) {
1139 (
unsigned long) op_flags, (
long)
a, (
long) b, (
long) c));
1159#if defined(DUK_USE_SHUFFLE_TORTURE)
1166 DUK_D(
DUK_DPRINT(
"out of regs: 'a' (reg) needs shuffling but shuffle prohibited, a: %ld", (
long)
a));
1167 goto error_outofregs;
1192 DUK_D(
DUK_DPRINT(
"out of regs: 'a' (reg) needs shuffling but does not fit into BC, a: %ld", (
long)
a));
1193 goto error_outofregs;
1203 b = b & ~DUK__CONST_MARKER;
1204#if defined(DUK_USE_SHUFFLE_TORTURE)
1216 DUK_D(
DUK_DPRINT(
"out of regs: 'b' (const) needs shuffling but does not fit into BC, b: %ld", (
long) b));
1217 goto error_outofregs;
1220#if defined(DUK_USE_SHUFFLE_TORTURE)
1229 DUK_D(
DUK_DPRINT(
"out of regs: 'b' (reg) needs shuffling but shuffle prohibited, b: %ld", (
long) b));
1230 goto error_outofregs;
1261 DUK_D(
DUK_DPRINT(
"out of regs: 'b' (reg) needs shuffling but does not fit into BC, b: %ld", (
long) b));
1262 goto error_outofregs;
1271 c = c & ~DUK__CONST_MARKER;
1272#if defined(DUK_USE_SHUFFLE_TORTURE)
1284 DUK_D(
DUK_DPRINT(
"out of regs: 'c' (const) needs shuffling but does not fit into BC, c: %ld", (
long) c));
1285 goto error_outofregs;
1288#if defined(DUK_USE_SHUFFLE_TORTURE)
1297 DUK_D(
DUK_DPRINT(
"out of regs: 'c' (reg) needs shuffling but shuffle prohibited, c: %ld", (
long) c));
1298 goto error_outofregs;
1325 DUK_D(
DUK_DPRINT(
"out of regs: 'c' (reg) needs shuffling but does not fit into BC, c: %ld", (
long) c));
1326 goto error_outofregs;
1363 }
else if (b_out >= 0) {
1367 }
else if (c_out >= 0) {
1394 bc = bc & (~DUK__CONST_MARKER);
1406 goto error_outofregs;
1409#if defined(DUK_USE_SHUFFLE_TORTURE)
1417 goto error_outofregs;
1430 goto error_outofregs;
1450 goto error_outofregs;
1472 extraop_flags & 0xff,
1485 extraop_flags & 0xff,
1511 extraop_flags & 0xff,
1531 (
long) reg, (
long) val, (
long) hi, (
long) lo));
1541#if defined(DUK_USE_SHUFFLE_TORTURE)
1581#if defined(DUK_USE_PC2LINE)
1594#if defined(DUK_USE_PC2LINE)
1598#if defined(DUK_USE_PC2LINE)
1622 (
long) jump_pc, (
long) target_pc));
1632 offset = target_pc - jump_pc - 1;
1636 (
long) jump_pc, (
long) target_pc, (
long) offset));
1653 const_varname = const_varname & (~DUK__CONST_MARKER);
1662 DUK_D(
DUK_DPRINT(
"failed to patch trycatch: flags=%ld, reg_catch=%ld, const_varname=%ld (0x%08lx)",
1663 (
long) flags, (
long) reg_catch, (
long) const_varname, (
long) const_varname));
1715#if defined(DUK_USE_BUFLEN16)
1725 for (i = 0; i < n; i++) {
1736 DUK_DDD(
DUK_DDDPRINT(
"consider jump at pc %ld; target_pc=%ld", (
long) i, (
long) target_pc1));
1745 ins = bc[target_pc1].
ins;
1753 (
long) i, (
long) target_pc1, (
long) target_pc2));
1760 DUK_DD(
DUK_DDPRINT(
"optimized %ld jumps on peephole round %ld", (
long) count_opt, (
long) (iter + 1)));
1762 if (count_opt == 0) {
1772#define DUK__ISREG(comp_ctx,x) (((x) & DUK__CONST_MARKER) == 0)
1773#define DUK__ISCONST(comp_ctx,x) (((x) & DUK__CONST_MARKER) != 0)
1774#define DUK__ISTEMP(comp_ctx,x) (DUK__ISREG((comp_ctx), (x)) && (duk_regconst_t) (x) >= (duk_regconst_t) ((comp_ctx)->curr_func.temp_first))
1775#define DUK__GETTEMP(comp_ctx) ((comp_ctx)->curr_func.temp_next)
1776#define DUK__SETTEMP(comp_ctx,x) ((comp_ctx)->curr_func.temp_next = (x))
1777#define DUK__SETTEMP_CHECKMAX(comp_ctx,x) duk__settemp_checkmax((comp_ctx),(x))
1778#define DUK__ALLOCTEMP(comp_ctx) duk__alloctemp((comp_ctx))
1779#define DUK__ALLOCTEMPS(comp_ctx,count) duk__alloctemps((comp_ctx),(count))
1785#define DUK__IVAL_FLAG_ALLOW_CONST (1 << 0)
1786#define DUK__IVAL_FLAG_REQUIRE_TEMP (1 << 1)
1787#define DUK__IVAL_FLAG_REQUIRE_SHORT (1 << 2)
1792#define DUK__DUMP_ISPEC(compctx,ispec) do { duk__dump_ispec((compctx), (ispec)); } while (0)
1793#define DUK__DUMP_IVALUE(compctx,ivalue) do { duk__dump_ivalue((compctx), (ivalue)); } while (0)
1796 DUK_D(
DUK_DPRINT(
"ispec dump: t=%ld regconst=0x%08lx, valstack_idx=%ld, value=%!T",
1802 "x1={t=%ld regconst=0x%08lx valstack_idx=%ld value=%!T} "
1803 "x2={t=%ld regconst=0x%08lx valstack_idx=%ld value=%!T}",
1804 (
long) x->
t, (
long) x->
op,
1811#define DUK__DUMP_ISPEC(comp_ctx,x) do {} while (0)
1812#define DUK__DUMP_IVALUE(comp_ctx,x) do {} while (0)
1846 t = (duk_int32_t) x;
1898#if defined(DUK_USE_FASTINT)
1908 for (i = 0; i < n_check; i++) {
1957 "forced_reg=%ld, flags 0x%08lx: allow_const=%ld require_temp=%ld require_short=%ld",
1962 (
unsigned long) flags,
2024 dest = (forced_reg >= 0 ? forced_reg :
DUK__ALLOCTEMP(comp_ctx));
2040#if defined(DUK_USE_FASTINT)
2041 case DUK_TAG_FASTINT:
2062 dest = (forced_reg >= 0 ? forced_reg :
DUK__ALLOCTEMP(comp_ctx));
2074 dest = (forced_reg >= 0 ? forced_reg :
DUK__ALLOCTEMP(comp_ctx));
2082 if (forced_reg >= 0) {
2134 DUK_DDD(
DUK_DDDPRINT(
"duk__ivalue_toplain_raw(): x={t=%ld,op=%ld,x1={%ld:%ld:%!T},x2={%ld:%ld:%!T}}, "
2136 (
long) x->
t, (
long) x->
op,
2141 (
long) forced_reg));
2177 (
double) d1, (
double) d2, (
long) x->
op));
2183 default: accept = 0;
break;
2219 if (forced_reg >= 0) {
2295 if (forced_reg >= 0) {
2326 dest = (forced_reg >= 0 ? forced_reg :
DUK__ALLOCTEMP(comp_ctx));
2379 DUK_DDD(
DUK_DDDPRINT(
"duk__ivalue_toregconst_raw(): x={t=%ld,op=%ld,x1={%ld:%ld:%!T},x2={%ld:%ld:%!T}}, "
2380 "forced_reg=%ld, flags 0x%08lx: allow_const=%ld require_temp=%ld require_short=%ld",
2381 (
long) x->
t, (
long) x->
op,
2387 (
unsigned long) flags,
2516 if (reg_varbind >= 0) {
2517 *out_reg_varbind = reg_varbind;
2518 *out_rc_varname = 0;
2523 *out_reg_varbind = -1;
2524 *out_rc_varname = rc_varname;
2559 while (li > li_start) {
2595 DUK_DDD(
DUK_DDDPRINT(
"registered label: flags=0x%08lx, id=%ld, name=%!O, catch_depth=%ld, pc_label=%ld",
2613 while (li > li_start) {
2620 DUK_DDD(
DUK_DDDPRINT(
"updating (overwriting) label flags for li=%p, label_id=%ld, flags=%ld",
2621 (
void *) li, (
long) label_id, (
long) flags));
2662 while (li > li_start) {
2667 (
long) (li - li_start),
2673 DUK_DDD(
DUK_DDDPRINT(
"labelinfo[%ld] -> '%!O' label name matches (still need to check type)",
2674 (
long) (li - li_start), (
duk_heaphdr *) h_label));
2696 "allow a continue -> continue lookup deeper in label stack"));
2712 *out_is_closest = (li == li_end - 1);
2736#define DUK__OBJ_LIT_KEY_PLAIN (1 << 0)
2737#define DUK__OBJ_LIT_KEY_GET (1 << 1)
2738#define DUK__OBJ_LIT_KEY_SET (1 << 2)
2796 if (require_comma) {
2817 if (num_values == 0) {
2818 start_idx = curr_idx;
2832 if (num_values >= max_init_values) {
2838 if (num_values > 0) {
2854 init_idx = start_idx + num_values;
2864 (
long) curr_idx, (
long) init_idx));
2867 if (curr_idx > init_idx) {
2929 if (key_flags & new_key_flags) {
2936 new_key_flags |= key_flags;
2939 (
unsigned long) key_flags,
2940 (
unsigned long) new_key_flags));
3023 if (num_pairs >= max_init_pairs) {
3077 if (num_pairs > 0) {
3158 if (num_pairs > 0) {
3227 DUK_DDD(
DUK_DDDPRINT(
"argument #%ld written into reg %ld", (
long) nargs, (
long) reg_temp));
3314#ifdef DUK_USE_REGEXP_SUPPORT
3556 "at compile time, need to use special run-time handling"));
3638 }
else if (d == 1.0) {
3719 (
duk_heaphdr *) h_varname, (
long) reg_varbind, (
long) rc_varname));
3901 "-> enabling EVALCALL flag, marking function "
3902 "as may_direct_eval"));
4083 goto binary_logical;
4088 goto binary_logical;
4235 res->
op = (args >> 8) & 0xff;
4245 DUK_DDD(
DUK_DDDPRINT(
"binary op, res: t=%ld, x1.t=%ld, x1.regconst=0x%08lx, x2.t=%ld, x2.regconst=0x%08lx",
4352 (
long) toplevel_assign));
4365 goto syntax_error_lvalue;
4372 if (toplevel_assign) {
4377 DUK_DDD(
DUK_DDDPRINT(
"plain assignment, not toplevel assign, ensure not a reg-bound identifier"));
4394 if (reg_varbind >= 0) {
4401 if (toplevel_assign) {
4406 DUK_DD(
DUK_DDPRINT(
"<op>= expression is top level, write directly to reg_varbind"));
4407 reg_res = reg_varbind;
4436 (
long) pc_temp_load, (
long) pc_before_rhs,
4437 (
long) pc_after_rhs));
4439 if (pc_after_rhs == pc_before_rhs) {
4444 DUK_DD(
DUK_DDPRINT(
"rhs is side effect free, rewind and avoid unnecessary temp for reg-based <op>="));
4446 reg_src = reg_varbind;
4448 DUK_DD(
DUK_DDPRINT(
"rhs evaluation emitted code, not sure if rhs is side effect free; use temp reg for LHS"));
4495 if (reg_varbind >= 0) {
4501 if (toplevel_assign) {
4679 (
duk_heaphdr *) h_varname, (
long) reg_varbind, (
long) rc_varname));
4716 syntax_error_lvalue:
4759#define DUK__EXPR_RBP_MASK 0xff
4760#define DUK__EXPR_FLAG_REJECT_IN (1 << 8)
4761#define DUK__EXPR_FLAG_ALLOW_EMPTY (1 << 9)
4762#define DUK__EXPR_FLAG_REQUIRE_INIT (1 << 10)
4779 DUK_DDD(
DUK_DDDPRINT(
"duk__expr(), rbp_flags=%ld, rbp=%ld, allow_in=%ld, paren_level=%ld",
4862 return duk__ivalue_totemp(comp_ctx, res);
4902 return duk__ivalue_totemp(comp_ctx, res);
4942#ifdef DUK__ALLOW_AUTO_SEMI_ALWAYS
4943#undef DUK__ALLOW_AUTO_SEMI_ALWAYS
4945#ifdef DUK__STILL_PROLOGUE
4946#undef DUK__STILL_PROLOGUE
4948#ifdef DUK__IS_TERMINAL
4949#undef DUK__IS_TERMINAL
4952#define DUK__HAS_VAL (1 << 0)
4953#define DUK__HAS_TERM (1 << 1)
4954#define DUK__ALLOW_AUTO_SEMI_ALWAYS (1 << 2)
4955#define DUK__STILL_PROLOGUE (1 << 3)
4956#define DUK__IS_TERMINAL (1 << 4)
5022 (
duk_heaphdr *) h_varname, (
long) reg_varbind, (
long) rc_varname));
5026 if (reg_varbind >= 0) {
5045 *out_rc_varname = rc_varname;
5046 *out_reg_varbind = reg_varbind;
5131 DUK_DDD(
DUK_DDDPRINT(
"detected for variant 4: for (var VariableDeclarationNoIn in Expression) Statement"));
5133 if (reg_varbind >= 0) {
5150 DUK_DDD(
DUK_DDDPRINT(
"detected for variant 2: for (var VariableDeclarationNoIn; Expression_opt; Expression_opt) Statement"));
5182 DUK_DDD(
DUK_DDDPRINT(
"detected for variant 3: for (LeftHandSideExpression in Expression) Statement"));
5227 DUK_DDD(
DUK_DDDPRINT(
"detected for variant 1: for (ExpressionNoIn_opt; Expression_opt; Expression_opt) Statement"));
5250 temp_reset = reg_temps + 0;
5298 "break: %ld->%ld, continue: %ld->%ld",
5299 (
long) pc_jumpto_l3, (
long) pc_l3, (
long) pc_jumpto_l4, (
long) pc_l4,
5300 (
long) (pc_label_site + 1), (
long) pc_l4, (
long) (pc_label_site + 2), (
long) pc_l2));
5309 expr_c_empty ? pc_l1 : pc_l2);
5333 duk_int_t pc_l1, pc_l2, pc_l3, pc_l4, pc_l5;
5334 duk_int_t pc_jumpto_l2, pc_jumpto_l3, pc_jumpto_l4, pc_jumpto_l5;
5337 DUK_DDD(
DUK_DDDPRINT(
"shared code for parsing variants 3 and 4, pc_v34_lhs=%ld", (
long) pc_v34_lhs));
5349 pc_jumpto_l2 = pc_v34_lhs;
5350 pc_l1 = pc_v34_lhs + 1;
5403 "jumpto_l4: %ld->%ld, jumpto_l5: %ld->%ld, "
5404 "break: %ld->%ld, continue: %ld->%ld",
5405 (
long) pc_jumpto_l2, (
long) pc_l2, (
long) pc_jumpto_l3, (
long) pc_l3,
5406 (
long) pc_jumpto_l4, (
long) pc_l4, (
long) pc_jumpto_l5, (
long) pc_l5,
5407 (
long) (pc_label_site + 1), (
long) pc_l5, (
long) (pc_label_site + 2), (
long) pc_l4));
5520 if (pc_default >= 0) {
5530 if (pc_prevcase < 0) {
5553 if (pc_default == -2) {
5595 if (pc_default >= 0) {
5768 "label_catch_depth=%ld, catch_depth=%ld "
5769 "-> use fast variant (direct jump)",
5770 (
long) is_break, (
long) label_id, (
long) label_is_closest,
5776 "label_catch_depth=%ld, catch_depth=%ld "
5777 "-> use slow variant (longjmp)",
5778 (
long) is_break, (
long) label_id, (
long) label_is_closest,
5856#if defined(DUK_USE_TAILCALL)
5858 pc_after_expr > pc_before_expr) {
5869 "catch depth is 0, duk__exprtop() emitted >= 1 instructions, "
5870 "and last instruction is a CALL "
5871 "-> set TAILCALL flag"));
6002 DUK_DDD(
DUK_DDDPRINT(
"catch identifier 'eval' or 'arguments' in strict mode -> SyntaxError"));
6009 (
unsigned long) rc_varname, (
long) rc_varname));
6055 if (varmap_value == -2) {
6059 if (varmap_value == -1) {
6181 if (label_id >= 0) {
6224 DUK_DDD(
DUK_DDDPRINT(
"parsing a statement, stmt_id=%ld, temp_at_entry=%ld, labels_len_at_entry=%ld, "
6225 "is_strict=%ld, in_directive_prologue=%ld, catch_depth=%ld",
6226 (
long) stmt_id, (
long) temp_at_entry, (
long) labels_len_at_entry,
6239 DUK_DDD(
DUK_DDDPRINT(
"try stmt parse, stmt_id=%ld, label_id=%ld, allow_source_elem=%ld, catch_depth=%ld",
6240 (
long) stmt_id, (
long) label_id, (
long) allow_source_elem,
6279#if defined(DUK_USE_NONSTD_FUNC_STMT)
6286 if (allow_source_elem)
6337 if (label_id >= 0) {
6364 if (label_id >= 0) {
6433 if (label_id >= 0) {
6468#if defined(DUK_USE_DEBUGGER_SUPPORT)
6550 allow_source_elem = 0;
6558 if (dir_prol_at_entry &&
6581 "but we ignore such directives"));
6590#if defined(DUK_USE_STRICT_DECL)
6609 "prologue terminated if still active"));
6638 if (reg_stmt_value >= 0) {
6662 DUK_DDD(
DUK_DDDPRINT(
"automatic semicolon terminates statement (allowed for compatibility "
6663 "even though no lineterm present before next token)"));
6688 if (label_id >= 0) {
6705#undef DUK__ALLOW_AUTO_SEMI_ALWAYS
6816#ifdef DUK_USE_ASSERTIONS
6820#ifdef DUK_USE_ASSERTIONS
6842 for (i = 0; i < num_args; i++) {
6891 if (out_stmt_value_reg) {
6899 DUK_D(
DUK_DPRINT(
"shuffle registers needed by function, allocated: %ld %ld %ld",
6906 goto error_outofregs;
6917 for (i = 0; i < num_decls; i += 2) {
6923 fnum = decl_type >> 8;
6924 decl_type = decl_type & 0xff;
6978 if (configurable_bindings) {
7007 "-> arguments object creation can be skipped"));
7019 for (i = 0; i < num_decls; i += 2) {
7024 decl_type = decl_type & 0xff;
7044 "but appears as a variable declaration -> treat as "
7045 "a no-op for variable declaration purposes"));
7063 if (configurable_bindings) {
7145 thr = comp_ctx->
thr;
7171 if (implicit_return_value) {
7202#if defined(DUK_USE_DEBUGGER_SUPPORT)
7208 if (expect_token >= 0) {
7277 (implicit_return_value ? ®_stmt_value :
NULL));
7303 goto error_funcname;
7307 goto error_funcname;
7313 goto error_funcname;
7322 if (implicit_return_value) {
7341 if (compile_round >= 3) {
7343 DUK_D(
DUK_DPRINT(
"more than 3 compile passes needed, should never happen"));
7346 DUK_D(
DUK_DPRINT(
"need additional round to compile function, round now %d", (
int) compile_round));
7365 if (reg_stmt_value >= 0) {
7591 DUK_DDD(
DUK_DDDPRINT(
"second pass of an inner func, skip the function, reparse closing brace; lex offset=%ld, line=%ld",
7711 flags = comp_stk->
flags;
7723#ifdef DUK_USE_EXPLICIT_NULL_INIT
7740 comp_ctx->
thr = thr;
7846 comp_stk.
flags = flags;
#define DUK_UNREACHABLE()
unsigned int duk_small_uint_t
#define DUK_USE_COMPILER_RECLIMIT
duk_small_int_t duk_ret_t
#define DUK_USE_ESBC_MAX_BYTES
duk_int_fast32_t duk_int_t
#define DUK_MEMZERO(p, n)
#define DUK_USE_ESBC_MAX_LINENUMBER
duk_small_int_t duk_bool_t
duk_uint32_t duk_uint_fast32_t
DUK_EXTERNAL void duk_concat(duk_context *ctx, duk_idx_t count)
#define DUK_TOK_ARSHIFT_EQ
#define DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(heap, x)
#define DUK_LABEL_FLAG_ALLOW_CONTINUE
#define DUK_HCOMPILEDFUNCTION_SET_FUNCS(heap, h, v)
#define DUK_TVAL_SET_TVAL(v, x)
#define DUK_ERROR_RANGE(thr, msg)
#define DUK_EXTRAOP_INVLHS
#define DUK_COMPILER_MAX_BYTECODE_LENGTH
#define DUK_TOK_INCREMENT
#define DUK_HOBJECT_A_GET_VALUE_PTR(heap, h, i)
DUK_EXTERNAL void duk_pop_2(duk_context *ctx)
#define DUK_BW_ADD_PTR(thr, bw_ctx, delta)
DUK_EXTERNAL const char * duk_push_string(duk_context *ctx, const char *str)
DUK_INTERNAL_DECL void duk_hbuffer_resize(duk_hthread *thr, duk_hbuffer_dynamic *buf, duk_size_t new_size)
#define DUK_EXTRAOP_THROW
#define DUK_HSTRING_GET_DATA(x)
#define DUK_LABEL_FLAG_ALLOW_BREAK
#define DUK_DECL_TYPE_VAR
DUK_EXTERNAL void duk_throw(duk_context *ctx)
DUK_EXTERNAL duk_bool_t duk_is_undefined(duk_context *ctx, duk_idx_t index)
#define DUK_HCOMPILEDFUNCTION_GET_CODE_BASE(heap, h)
DUK_INTERNAL_DECL duk_bool_t duk_put_prop_stridx(duk_context *ctx, duk_idx_t obj_index, duk_small_int_t stridx)
#define DUK_BC_TRYCATCH_FLAG_HAVE_FINALLY
#define DUK_TVAL_IS_NUMBER(tv)
#define DUK_STR_INVALID_ARG_NAME
#define DUK_HCOMPILEDFUNCTION_SET_BYTECODE(heap, h, v)
#define DUK_TOK_EQUALSIGN
DUK_INTERNAL_DECL duk_bool_t duk_get_prop_stridx(duk_context *ctx, duk_idx_t obj_index, duk_small_int_t stridx)
#define DUK_STR_INVALID_LABEL
DUK_EXTERNAL void duk_push_true(duk_context *ctx)
#define DUK_STRIDX_INT_FORMALS
#define DUK_STR_INVALID_EXPRESSION
#define DUK_STR_INVALID_FUNC_NAME
#define DUK_IVAL_ARITH_EXTRAOP
#define DUK_BC_TRYCATCH_FLAG_CATCH_BINDING
#define DUK_STR_INVALID_TRY
#define DUK_JS_COMPILE_FLAG_EVAL
DUK_INTERNAL_DECL void duk_hobject_set_length_zero(duk_hthread *thr, duk_hobject *obj)
#define DUK_STRIDX_LC_ARGUMENTS
#define DUK_STRIDX_GLOBAL
#define DUK_TOK_IDENTIFIER
#define DUK_BC_EXTRAOP_MAX
#define DUK_STR_INVALID_SWITCH
#define DUK_HOBJECT_GET_ENEXT(h)
#define DUK_HSTRING_HAS_RESERVED_WORD(x)
#define DUK_GET_HOBJECT_NEGIDX(ctx, idx)
#define DUK_TVAL_GET_OBJECT(tv)
DUK_EXTERNAL void duk_compact(duk_context *ctx, duk_idx_t obj_index)
#define DUK_STR_INVALID_VAR_DECLARATION
DUK_EXTERNAL duk_bool_t duk_put_prop_index(duk_context *ctx, duk_idx_t obj_idx, duk_uarridx_t arr_idx)
#define DUK_HOBJECT_E_GET_VALUE_TVAL_PTR(heap, h, i)
#define DUK_COMPILER_TOKEN_LIMIT
#define DUK_EXTRAOP_ENDTRY
DUK_INTERNAL_DECL void duk_hobject_pc2line_pack(duk_hthread *thr, duk_compiler_instr *instrs, duk_uint_fast32_t length)
#define DUK_HCOMPILEDFUNCTION_GET_CODE_END(heap, h)
#define DUK_DECL_TYPE_FUNC
#define DUK_EXTRAOP_SETALEN
#define DUK_STRIDX_FILE_NAME
#define DUK_HOBJECT_IS_COMPILEDFUNCTION(h)
#define DUK_LEXER_GETPOINT(ctx, pt)
#define DUK_EXTRAOP_NEXTENUM
#define DUK_TVAL_IS_OBJECT(tv)
DUK_EXTERNAL duk_size_t duk_get_length(duk_context *ctx, duk_idx_t index)
#define DUK_HOBJECT_SET_CREATEARGS(h)
#define DUK_ERROR_SYNTAX(thr, msg)
DUK_INTERNAL_DECL duk_bool_t duk_has_prop_stridx(duk_context *ctx, duk_idx_t obj_index, duk_small_int_t stridx)
#define DUK_PROPDESC_FLAGS_NONE
DUK_INTERNAL_DECL void duk_push_hstring_stridx(duk_context *ctx, duk_small_int_t stridx)
#define duk_push_size_t(ctx, val)
DUK_EXTERNAL void duk_require_stack(duk_context *ctx, duk_idx_t extra)
#define DUK_ENC_OP_A_B_C(op, a, b, c)
struct duk_compiler_instr duk_compiler_instr
#define DUK_EXTRAOP_ENDFIN
#define duk_js_samevalue(tv_x, tv_y)
#define DUK_TVAL_INCREF(thr, tv)
#define DUK_EXTRAOP_LDNULL
DUK_INTERNAL_DECL duk_tval * duk_hobject_find_existing_array_entry_tval_ptr(duk_heap *heap, duk_hobject *obj, duk_uarridx_t i)
#define DUK_BW_RESET_SIZE(thr, bw_ctx)
#define DUK_HCOMPILEDFUNCTION_SET_DATA(heap, h, v)
#define DUK_HOBJECT_E_GET_KEY(heap, h, i)
#define DUK_ERROR_INTERNAL_DEFMSG(thr)
#define DUK_STR_CANNOT_DELETE_IDENTIFIER
#define DUK_TVAL_GET_TAG(tv)
#define DUK_TOK_ALSHIFT_EQ
#define DUK_STR_EMPTY_EXPR_NOT_ALLOWED
#define DUK_TVAL_IS_UNUSED(tv)
#define DUK_HOBJECT_E_SET_KEY(heap, h, i, k)
#define DUK_EXTRAOP_TYPEOFID
#define DUK_BW_GET_BASEPTR(thr, bw_ctx)
#define DUK_ASSERT_DISABLE(x)
DUK_EXTERNAL void duk_push_null(duk_context *ctx)
#define DUK_HOBJECT_SET_NOTAIL(h)
DUK_EXTERNAL void duk_push_int(duk_context *ctx, duk_int_t val)
#define DUK_STR_REG_LIMIT
DUK_EXTERNAL duk_int_t duk_get_int(duk_context *ctx, duk_idx_t index)
#define DUK_EXTRAOP_ENDLABEL
duk_uint32_t duk_regconst_t
DUK_EXTERNAL void duk_dup_top(duk_context *ctx)
DUK_EXTERNAL duk_bool_t duk_is_number(duk_context *ctx, duk_idx_t index)
#define DUK_HOBJECT_SET_STRICT(h)
#define DUK_EXTRAOP_NEWOBJ
#define DUK_LEXER_INITCTX(ctx)
#define DUK_TVAL_GET_STRING(tv)
DUK_EXTERNAL void duk_replace(duk_context *ctx, duk_idx_t to_index)
#define DUK_BC_DECLVAR_FLAG_UNDEF_VALUE
#define DUK_LEXER_SETPOINT(ctx, pt)
#define DUK_TOK_SEMICOLON
#define DUK_EXTRAOP_BREAK
DUK_EXTERNAL void duk_push_pointer(duk_context *ctx, void *val)
#define DUK_STR_EXPECTED_IDENTIFIER
#define DUK_HSTRING_DECREF(thr, h)
#define DUK_BC_TRYCATCH_FLAG_HAVE_CATCH
#define DUK_STR_COMPILER_RECURSION_LIMIT
DUK_EXTERNAL void * duk_require_pointer(duk_context *ctx, duk_idx_t index)
#define DUK_GET_HOBJECT_POSIDX(ctx, idx)
#define DUK_HTHREAD_STRING_LC_ARGUMENTS(thr)
#define DUK_TOK_DECREMENT
#define DUK_EXTRAOP_INITENUM
#define DUK_COMPILER_PEEPHOLE_MAXITER
DUK_INTERNAL_DECL void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, duk_token *out_token, duk_bool_t strict_mode, duk_bool_t regexp_mode)
#define DUK_TVAL_IS_STRING(tv)
#define DUK_STR_INVALID_FOR
#define DUK_STR_PARSE_ERROR
#define DUK_STR_INVALID_ARRAY_LITERAL
DUK_EXTERNAL duk_bool_t duk_del_prop(duk_context *ctx, duk_idx_t obj_index)
#define DUK_EXTRAOP_INSTOF
#define DUK_HSTRING_GET_BYTELEN(x)
DUK_EXTERNAL void duk_set_top(duk_context *ctx, duk_idx_t index)
#define DUK_ENC_OP_A_BC(op, a, bc)
#define DUK_BW_GET_SIZE(thr, bw_ctx)
#define DUK_BC_RETURN_FLAG_HAVE_RETVAL
DUK_EXTERNAL duk_idx_t duk_push_object(duk_context *ctx)
#define DUK_STRIDX_INT_VARMAP
#define DUK_STRIDX_LENGTH
DUK_EXTERNAL void duk_dup(duk_context *ctx, duk_idx_t from_index)
#define DUK_TVAL_CHKFAST_INPLACE(v)
DUK_INTERNAL_DECL duk_hbuffer * duk_get_hbuffer(duk_context *ctx, duk_idx_t index)
#define DUK_TVAL_SET_BOOLEAN_TRUE(v)
#define DUK_HTHREAD_STRING_SET(thr)
DUK_EXTERNAL duk_bool_t duk_is_null(duk_context *ctx, duk_idx_t index)
#define DUK_ENC_OP_A(op, a)
#define DUK_STR_BYTECODE_LIMIT
#define DUK_PROPDESC_FLAG_CONFIGURABLE
#define DUK_EXTRAOP_INVALID
DUK_EXTERNAL duk_idx_t duk_get_top(duk_context *ctx)
#define DUK_EXTRAOP_INITSET
#define DUK_EXTRAOP_LDFALSE
#define DUK_STR_UNTERMINATED_STMT
#define DUK_HOBJECT_E_SLOT_IS_ACCESSOR(heap, h, i)
DUK_EXTERNAL void duk_copy(duk_context *ctx, duk_idx_t from_index, duk_idx_t to_index)
#define DUK_HSTRING_HAS_EVAL_OR_ARGUMENTS(x)
#define DUK_JS_COMPILE_FLAG_FUNCEXPR
DUK_EXTERNAL duk_bool_t duk_get_prop_index(duk_context *ctx, duk_idx_t obj_index, duk_uarridx_t arr_index)
#define DUK_TVAL_IS_HEAP_ALLOCATED(tv)
#define DUK_HTHREAD_STRING_EVAL(thr)
#define DUK_EXTRAOP_ENDCATCH
#define DUK_TOK_RSHIFT_EQ
#define DUK_EXTRAOP_LDTHIS
#define DUK_STR_TEMP_LIMIT
DUK_EXTERNAL duk_int_t duk_safe_call(duk_context *ctx, duk_safe_call_function func, duk_idx_t nargs, duk_idx_t nrets)
#define DUK_BW_INIT_PUSHBUF(thr, bw_ctx, sz)
#define DUK_STR_INVALID_BREAK_CONT_LABEL
struct duk_tval_struct duk_tval
#define DUK_HBUFFER_FIXED_GET_DATA_PTR(heap, x)
DUK_EXTERNAL void duk_push_undefined(duk_context *ctx)
#define DUK_STR_WITH_IN_STRICT_MODE
#define DUK_EXTRAOP_DEBUGGER
#define DUK_ISPEC_REGCONST
#define DUK_TAG_UNDEFINED
#define DUK_PROPDESC_FLAG_WRITABLE
DUK_EXTERNAL duk_bool_t duk_get_prop(duk_context *ctx, duk_idx_t obj_index)
#define DUK_BC_LDINTX_SHIFT
#define DUK_BC_TRYCATCH_FLAG_WITH_BINDING
#define DUK_STR_FUNC_LIMIT
DUK_EXTERNAL void duk_push_number(duk_context *ctx, duk_double_t val)
DUK_EXTERNAL void duk_pop_n(duk_context *ctx, duk_idx_t count)
#define DUK_GET_TVAL_NEGIDX(ctx, idx)
#define DUK_ASSERT_TOP(ctx, n)
DUK_EXTERNAL void duk_push_false(duk_context *ctx)
#define DUK_BC_CALL_FLAG_EVALCALL
#define DUK_JS_COMPILE_FLAG_STRICT
#define duk_push_uarridx(ctx, val)
#define DUK_EXTRAOP_NEWARR
#define DUK_ENC_OP_ABC(op, abc)
DUK_INTERNAL_DECL void duk_hbuffer_reset(duk_hthread *thr, duk_hbuffer_dynamic *buf)
DUK_INTERNAL_DECL duk_uint32_t duk_hobject_get_length(duk_hthread *thr, duk_hobject *obj)
#define DUK_HEAPHDR_INCREF(thr, h)
#define DUK_STR_CONST_LIMIT
#define DUK_STR_INVALID_GETSET_NAME
#define DUK_BC_EXTRAOP_MIN
DUK_INTERNAL_DECL duk_idx_t duk_push_compiledfunction(duk_context *ctx)
#define DUK_HOBJECT_HAS_NEWENV(h)
DUK_INTERNAL_DECL duk_idx_t duk_push_object_internal(duk_context *ctx)
#define DUK_EXTRAOP_INITSETI
#define DUK_STRIDX_INT_PC2LINE
#define DUK_STR_FUNC_NAME_REQUIRED
#define DUK_TVAL_SET_BOOLEAN_FALSE(v)
#define DUK_TOK_INSTANCEOF
#define DUK_PROPDESC_FLAG_ENUMERABLE
#define DUK_STR_FUNC_STMT_NOT_ALLOWED
#define DUK_EXTRAOP_LDTRUE
#define DUK_TVAL_GET_BOOLEAN(tv)
DUK_EXTERNAL const char * duk_to_string(duk_context *ctx, duk_idx_t index)
#define DUK_BC_DECLVAR_FLAG_FUNC_DECL
#define DUK_TVAL_SET_BOOLEAN(tv, val)
#define DUK_GET_TVAL_POSIDX(ctx, idx)
#define DUK_HOBJECT_INCREF(thr, h)
#define DUK_STR_INVALID_THROW
#define DUK_STR_INVALID_LVALUE
#define DUK_EXTRAOP_LABEL
DUK_EXTERNAL void duk_pop(duk_context *ctx)
#define DUK_HOBJECT_SET_NAMEBINDING(h)
DUK_INTERNAL_DECL duk_hobject * duk_get_hobject(duk_context *ctx, duk_idx_t index)
#define DUK_HSTRING_HAS_STRICT_RESERVED_WORD(x)
#define DUK_HTHREAD_STRING_EMPTY_STRING(thr)
DUK_EXTERNAL duk_idx_t duk_push_array(duk_context *ctx)
#define DUK_TVAL_GET_NUMBER(tv)
DUK_INTERNAL_DECL void duk_xdef_prop_stridx(duk_context *ctx, duk_idx_t obj_index, duk_small_int_t stridx, duk_small_uint_t desc_flags)
DUK_INTERNAL_DECL void duk_push_hstring(duk_context *ctx, duk_hstring *h)
DUK_INTERNAL_DECL duk_hstring * duk_get_hstring(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL duk_bool_t duk_is_string(duk_context *ctx, duk_idx_t index)
#define DUK_EXTRAOP_CONTINUE
#define DUK_HTHREAD_STRING_GET(thr)
#define DUK_HBUFFER_HAS_EXTERNAL(x)
#define DUK_HBUFFER_HAS_DYNAMIC(x)
#define DUK_STR_INVALID_RETURN
#define DUK_BW_ENSURE_GETPTR(thr, bw_ctx, sz)
#define DUK_BC_LDINT_BIAS
#define DUK_STRIDX_INT_SOURCE
#define DUK_EXTRAOP_INITGET
#define DUK_STR_DUPLICATE_LABEL
#define DUK_STR_INVALID_OBJECT_LITERAL
#define DUK_HOBJECT_SET_NEWENV(h)
#define DUK_EXTRAOP_TYPEOF
#define DUK_EXTRAOP_INITGETI
DUK_EXTERNAL duk_int_t duk_to_int(duk_context *ctx, duk_idx_t index)
#define DUK_TVAL_IS_BOOLEAN(tv)
#define DUK_EXTRAOP_LDUNDEF
#define DUK_TVAL_SET_NUMBER(tv, val)
#define DUK_HBUFFER_GET_SIZE(x)
DUK_EXTERNAL duk_bool_t duk_put_prop(duk_context *ctx, duk_idx_t obj_idx)
DUK_EXTERNAL duk_bool_t duk_has_prop(duk_context *ctx, duk_idx_t obj_index)
DUK_INTERNAL_DECL duk_tval * duk_get_tval(duk_context *ctx, duk_idx_t index)
#define DUK_TAG_LIGHTFUNC
#define DUK_BC_CALL_FLAG_TAILCALL
DUK_INTERNAL_DECL void duk_regexp_compile(duk_hthread *thr)
#define DUK_BW_INSERT_ENSURE_AREA(thr, bw, off, len)
#define duk_push_fixed_buffer(ctx, size)
#define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u)
#define duk_push_dynamic_buffer(ctx, size)
DUK_LOCAL_DECL void duk__patch_jump(duk_compiler_ctx *comp_ctx, duk_int_t jump_pc, duk_int_t target_pc)
DUK_LOCAL_DECL void duk__emit_a_bc(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_flags, duk_regconst_t a, duk_regconst_t bc)
#define DUK__EMIT_FLAG_NO_SHUFFLE_B
DUK_LOCAL_DECL void duk__emit_load_int32(duk_compiler_ctx *comp_ctx, duk_reg_t reg, duk_int32_t val)
#define DUK__FUNCTION_BODY_REQUIRE_SLOTS
#define DUK__BP_ASSIGNMENT
DUK_LOCAL_DECL void duk__emit_abc(duk_compiler_ctx *comp_ctx, duk_small_uint_t op, duk_regconst_t abc)
DUK_LOCAL_DECL duk_small_uint_t duk__expr_lbp(duk_compiler_ctx *comp_ctx)
DUK_LOCAL_DECL void duk__parse_func_formals(duk_compiler_ctx *comp_ctx)
DUK_LOCAL_DECL void duk__emit(duk_compiler_ctx *comp_ctx, duk_instr_t ins)
DUK_LOCAL_DECL duk_reg_t duk__ivalue_toreg(duk_compiler_ctx *comp_ctx, duk_ivalue *x)
#define DUK__EXPR_FLAG_REQUIRE_INIT
DUK_LOCAL_DECL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx, duk_bool_t force_no_namebind)
#define DUK__SETTEMP_CHECKMAX(comp_ctx, x)
DUK_LOCAL_DECL void duk__advance(duk_compiler_ctx *ctx)
DUK_LOCAL const duk_uint8_t duk__token_lbp[]
DUK_LOCAL_DECL void duk__parse_func_like_raw(duk_compiler_ctx *comp_ctx, duk_bool_t is_decl, duk_bool_t is_setget)
DUK_LOCAL_DECL duk_regconst_t duk__ispec_toregconst_raw(duk_compiler_ctx *comp_ctx, duk_ispec *x, duk_reg_t forced_reg, duk_small_uint_t flags)
#define DUK__MAX_OBJECT_INIT_PAIRS
#define DUK__MAX_ARRAY_INIT_VALUES
#define DUK__IVAL_FLAG_ALLOW_CONST
#define DUK__SETTEMP(comp_ctx, x)
#define DUK__GETTEMP(comp_ctx)
DUK_LOCAL_DECL void duk__expr_toplain(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags)
#define DUK__OBJ_LIT_KEY_PLAIN
#define DUK__STILL_PROLOGUE
DUK_LOCAL_DECL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ctx, duk_reg_t *out_stmt_value_reg)
#define DUK__EMIT_FLAG_B_IS_TARGETSOURCE
DUK_LOCAL_DECL duk_regconst_t duk__ivalue_toregconst_raw(duk_compiler_ctx *comp_ctx, duk_ivalue *x, duk_reg_t forced_reg, duk_small_uint_t flags)
DUK_LOCAL_DECL void duk__add_label(duk_compiler_ctx *comp_ctx, duk_hstring *h_label, duk_int_t pc_label, duk_int_t label_id)
#define DUK__EXPR_FLAG_REJECT_IN
#define DUK__EXPR_FLAG_ALLOW_EMPTY
DUK_LOCAL_DECL duk_regconst_t duk__ivalue_totempconst(duk_compiler_ctx *comp_ctx, duk_ivalue *x)
DUK_LOCAL_DECL void duk__exprtop(duk_compiler_ctx *ctx, duk_ivalue *res, duk_small_uint_t rbp_flags)
DUK_LOCAL void duk__emit_load_int32_raw(duk_compiler_ctx *comp_ctx, duk_reg_t reg, duk_int32_t val, duk_small_uint_t op_flags)
DUK_LOCAL_DECL void duk__parse_try_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res)
DUK_LOCAL_DECL void duk__emit_jump(duk_compiler_ctx *comp_ctx, duk_int_t target_pc)
DUK_LOCAL_DECL void duk__copy_ispec(duk_compiler_ctx *comp_ctx, duk_ispec *src, duk_ispec *dst)
#define DUK__BP_RELATIONAL
DUK_LOCAL_DECL void duk__nud_array_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *res)
DUK_LOCAL_DECL void duk__ivalue_toplain(duk_compiler_ctx *comp_ctx, duk_ivalue *x)
DUK_LOCAL_DECL void duk__expr_toplain_ignore(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags)
#define DUK__GETCONST_MAX_CONSTS_CHECK
DUK_LOCAL_DECL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_bool_t allow_source_elem)
DUK_LOCAL_DECL void duk__emit_load_int32_noshuffle(duk_compiler_ctx *comp_ctx, duk_reg_t reg, duk_int32_t val)
#define DUK__IVAL_FLAG_REQUIRE_TEMP
DUK_LOCAL_DECL void duk__parse_func_body(duk_compiler_ctx *comp_ctx, duk_bool_t expect_eof, duk_bool_t implicit_return_value, duk_small_int_t expect_token)
#define DUK__FUNCTION_INIT_REQUIRE_SLOTS
#define DUK__EXPR_RBP_MASK
#define DUK__OBJ_LIT_KEY_GET
DUK_LOCAL void duk__recursion_decrease(duk_compiler_ctx *comp_ctx)
DUK_LOCAL_DECL void duk__parse_if_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res)
DUK_LOCAL_DECL void duk__advance_expect(duk_compiler_ctx *comp_ctx, duk_small_int_t expect)
DUK_LOCAL_DECL void duk__insert_jump_entry(duk_compiler_ctx *comp_ctx, duk_int_t jump_pc)
DUK_LOCAL_DECL void duk__parse_var_decl(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t expr_flags, duk_reg_t *out_reg_varbind, duk_regconst_t *out_rc_varname)
DUK_LOCAL_DECL duk_bool_t duk__nud_object_literal_key_check(duk_compiler_ctx *comp_ctx, duk_small_uint_t new_key_flags)
DUK_LOCAL_DECL duk_regconst_t duk__exprtop_toregconst(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags)
DUK_INTERNAL void duk_js_compile(duk_hthread *thr, const duk_uint8_t *src_buffer, duk_size_t src_length, duk_small_uint_t flags)
DUK_LOCAL_DECL void duk__advance_helper(duk_compiler_ctx *comp_ctx, duk_small_int_t expect)
DUK_LOCAL_DECL duk_regconst_t duk__ivalue_toregconst(duk_compiler_ctx *comp_ctx, duk_ivalue *x)
#define DUK__ALLOCTEMP(comp_ctx)
DUK_LOCAL_DECL void duk__emit_invalid(duk_compiler_ctx *comp_ctx)
DUK_LOCAL_DECL void duk__settemp_checkmax(duk_compiler_ctx *comp_ctx, duk_reg_t temp_next)
DUK_LOCAL_DECL void duk__emit_if_false_skip(duk_compiler_ctx *comp_ctx, duk_regconst_t regconst)
DUK_LOCAL_DECL void duk__reset_func_for_pass2(duk_compiler_ctx *comp_ctx)
DUK_LOCAL_DECL void duk__nud_object_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *res)
DUK_LOCAL void duk__peephole_optimize_bytecode(duk_compiler_ctx *comp_ctx)
#define DUK__IVAL_FLAG_REQUIRE_SHORT
DUK_LOCAL_DECL void duk__init_func_valstack_slots(duk_compiler_ctx *comp_ctx)
DUK_LOCAL_DECL void duk__patch_jump_here(duk_compiler_ctx *comp_ctx, duk_int_t jump_pc)
#define DUK__TOKEN_LBP_GET_BP(x)
DUK_LOCAL_DECL void duk__patch_trycatch(duk_compiler_ctx *comp_ctx, duk_int_t ldconst_pc, duk_int_t trycatch_pc, duk_regconst_t reg_catch, duk_regconst_t const_varname, duk_small_uint_t flags)
DUK_LOCAL_DECL void duk__lookup_active_label(duk_compiler_ctx *comp_ctx, duk_hstring *h_label, duk_bool_t is_break, duk_int_t *out_label_id, duk_int_t *out_label_catch_depth, duk_int_t *out_label_pc, duk_bool_t *out_is_closest)
DUK_LOCAL_DECL void duk__parse_stmts(duk_compiler_ctx *comp_ctx, duk_bool_t allow_source_elem, duk_bool_t expect_eof)
#define DUK__BP_CONDITIONAL
DUK_LOCAL_DECL void duk__parse_break_or_continue_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res)
DUK_LOCAL_DECL duk_int_t duk__get_current_pc(duk_compiler_ctx *comp_ctx)
DUK_LOCAL_DECL duk_int_t duk__cleanup_varmap(duk_compiler_ctx *comp_ctx)
DUK_LOCAL_DECL void duk__parse_var_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t expr_flags)
#define DUK__ALLOW_AUTO_SEMI_ALWAYS
DUK_LOCAL_DECL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_int_t pc_label_site)
#define DUK__BC_INITIAL_INSTS
DUK_LOCAL_DECL void duk__parse_with_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res)
DUK_LOCAL_DECL void duk__emit_a_b_c(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_flags, duk_regconst_t a, duk_regconst_t b, duk_regconst_t c)
#define DUK__MK_LBP_FLAGS(bp, flags)
DUK_LOCAL_DECL void duk__exprtop_toforcedreg(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags, duk_reg_t forced_reg)
#define DUK__TOKEN_LBP_FLAG_NO_REGEXP
DUK_LOCAL_DECL duk_reg_t duk__alloctemps(duk_compiler_ctx *comp_ctx, duk_small_int_t num)
DUK_LOCAL_DECL duk_int_t duk__emit_jump_empty(duk_compiler_ctx *comp_ctx)
DUK_LOCAL_DECL duk_bool_t duk__lookup_lhs(duk_compiler_ctx *ctx, duk_reg_t *out_reg_varbind, duk_regconst_t *out_rc_varname)
DUK_LOCAL duk_bool_t duk__hstring_is_eval_or_arguments(duk_compiler_ctx *comp_ctx, duk_hstring *h)
DUK_LOCAL_DECL void duk__ivalue_toplain_ignore(duk_compiler_ctx *comp_ctx, duk_ivalue *x)
#define DUK__COMPILE_ENTRY_SLOTS
#define DUK__ISTEMP(comp_ctx, x)
DUK_LOCAL void duk__recursion_increase(duk_compiler_ctx *comp_ctx)
#define DUK__ISREG(comp_ctx, x)
DUK_LOCAL_DECL duk_reg_t duk__alloctemp(duk_compiler_ctx *comp_ctx)
DUK_LOCAL_DECL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_ivalue *res)
#define DUK__ALLOCTEMPS(comp_ctx, count)
#define DUK__CONST_MARKER
DUK_LOCAL void duk__update_lineinfo_currtoken(duk_compiler_ctx *comp_ctx)
#define DUK__RECURSION_INCREASE(comp_ctx, thr)
#define DUK__PARSE_STATEMENTS_SLOTS
DUK_LOCAL_DECL void duk__ivalue_toforcedreg(duk_compiler_ctx *comp_ctx, duk_ivalue *x, duk_int_t forced_reg)
#define DUK__EMIT_FLAG_NO_SHUFFLE_A
#define DUK__BP_MULTIPLICATIVE
DUK_LOCAL_DECL void duk__parse_do_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_int_t pc_label_site)
DUK_LOCAL_DECL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res)
DUK_LOCAL_DECL void duk__expr(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags)
DUK_LOCAL_DECL void duk__parse_switch_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_int_t pc_label_site)
DUK_LOCAL_DECL void duk__emit_if_true_skip(duk_compiler_ctx *comp_ctx, duk_regconst_t regconst)
#define DUK__PARSE_EXPR_SLOTS
DUK_LOCAL_DECL void duk__emit_extraop_b(duk_compiler_ctx *comp_ctx, duk_small_uint_t extraop_flags, duk_regconst_t b)
#define DUK__EMIT_FLAG_A_IS_SOURCE
DUK_LOCAL_DECL void duk__copy_ivalue(duk_compiler_ctx *comp_ctx, duk_ivalue *src, duk_ivalue *dst)
#define DUK__EMIT_FLAG_B_IS_TARGET
DUK_LOCAL_DECL duk_regconst_t duk__getconst(duk_compiler_ctx *comp_ctx)
DUK_LOCAL_DECL void duk__ispec_toforcedreg(duk_compiler_ctx *comp_ctx, duk_ispec *x, duk_reg_t forced_reg)
#define DUK__EMIT_FLAG_RESERVE_JUMPSLOT
DUK_LOCAL_DECL duk_reg_t duk__lookup_active_register_binding(duk_compiler_ctx *comp_ctx)
DUK_LOCAL_DECL duk_reg_t duk__exprtop_toreg(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags)
DUK_LOCAL_DECL void duk__parse_throw_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res)
DUK_LOCAL_DECL duk_bool_t duk__is_whole_get_int32(duk_double_t x, duk_int32_t *ival)
DUK_LOCAL_DECL duk_int_t duk__parse_func_like_fnum(duk_compiler_ctx *comp_ctx, duk_bool_t is_decl, duk_bool_t is_setget)
DUK_LOCAL_DECL void duk__parse_while_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_int_t pc_label_site)
DUK_LOCAL_DECL void duk__emit_extraop_b_c(duk_compiler_ctx *comp_ctx, duk_small_uint_t extraop_flags, duk_regconst_t b, duk_regconst_t c)
DUK_LOCAL_DECL void duk__emit_a_b(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_flags, duk_regconst_t a, duk_regconst_t b)
DUK_LOCAL_DECL void duk__emit_extraop_bc(duk_compiler_ctx *comp_ctx, duk_small_uint_t extraop, duk_regconst_t bc)
DUK_LOCAL_DECL duk_compiler_instr * duk__get_instr_ptr(duk_compiler_ctx *comp_ctx, duk_int_t pc)
DUK_LOCAL_DECL void duk__ivalue_toplain_raw(duk_compiler_ctx *comp_ctx, duk_ivalue *x, duk_reg_t forced_reg)
DUK_LOCAL_DECL duk_int_t duk__parse_arguments(duk_compiler_ctx *comp_ctx, duk_ivalue *res)
#define DUK__OBJ_LIT_KEY_SET
#define DUK__EMIT_FLAG_C_IS_TARGET
DUK_LOCAL duk_bool_t duk__hstring_is_eval_or_arguments_in_strict_mode(duk_compiler_ctx *comp_ctx, duk_hstring *h)
DUK_LOCAL_DECL duk_bool_t duk__expr_is_empty(duk_compiler_ctx *comp_ctx)
#define DUK__EMIT_FLAG_NO_SHUFFLE_C
#define DUK__ISCONST(comp_ctx, x)
#define DUK__RECURSION_DECREASE(comp_ctx, thr)
DUK_LOCAL_DECL void duk__reset_labels_to_length(duk_compiler_ctx *comp_ctx, duk_int_t len)
DUK_LOCAL_DECL void duk__parse_return_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res)
DUK_LOCAL_DECL void duk__emit_extraop_only(duk_compiler_ctx *comp_ctx, duk_small_uint_t extraop_flags)
DUK_LOCAL_DECL void duk__expr_toforcedreg(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags, duk_reg_t forced_reg)
DUK_LOCAL_DECL duk_int_t duk__stmt_label_site(duk_compiler_ctx *comp_ctx, duk_int_t label_id)
DUK_LOCAL_DECL duk_regconst_t duk__expr_toregconst(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags)
DUK_LOCAL_DECL void duk__update_label_flags(duk_compiler_ctx *comp_ctx, duk_int_t label_id, duk_small_uint_t flags)
DUK_LOCAL duk_ret_t duk__js_compile_raw(duk_context *ctx)
static const char * match(MatchState *ms, const char *s, const char *p)
duk_lexer_point lex_pt_alloc
duk_compiler_ctx comp_ctx_alloc
duk_compiler_func curr_func
duk_int_t recursion_limit
duk_int_t recursion_depth
duk_int_t emit_jumpslot_pc
duk_bool_t id_access_slow
duk_bool_t may_direct_eval
duk_bool_t in_directive_prologue
duk_hobject * h_labelnames
duk_bool_t id_access_arguments
duk_hbuffer_dynamic * h_labelinfos
duk_bufwriter_ctx bw_code
duk_bool_t reject_regexp_in_adv
duk_bool_t is_arguments_shadowed
duk_compiler_ctx * compile_ctx
duk_hbuffer_dynamic * buf
const duk_uint8_t * input
duk_bool_t allow_auto_semi