@@ -6061,7 +6061,6 @@ void JS_DumpMemoryUsage(FILE *fp, const JSMemoryUsage *s, JSRuntime *rt)
6061
6061
{
6062
6062
fprintf(fp, "QuickJS-ng memory usage -- %s version, %d-bit, malloc limit: %"PRId64"\n\n",
6063
6063
JS_GetVersion(), (int)sizeof(void *) * 8, (int64_t)(ssize_t)s->malloc_limit);
6064
- #if 1
6065
6064
if (rt) {
6066
6065
static const struct {
6067
6066
const char *name;
@@ -6117,7 +6116,6 @@ void JS_DumpMemoryUsage(FILE *fp, const JSMemoryUsage *s, JSRuntime *rt)
6117
6116
}
6118
6117
fprintf(fp, "\n");
6119
6118
}
6120
- #endif
6121
6119
fprintf(fp, "%-20s %8s %8s\n", "NAME", "COUNT", "SIZE");
6122
6120
6123
6121
if (s->malloc_count) {
@@ -21557,33 +21555,7 @@ static __exception int js_parse_array_literal(JSParseState *s)
21557
21555
return -1;
21558
21556
if (js_parse_assign_expr(s))
21559
21557
return -1;
21560
- #if 1
21561
21558
emit_op(s, OP_append);
21562
- #else
21563
- int label_next, label_done;
21564
- label_next = new_label(s);
21565
- label_done = new_label(s);
21566
- /* enumerate object */
21567
- emit_op(s, OP_for_of_start);
21568
- emit_op(s, OP_rot5l);
21569
- emit_op(s, OP_rot5l);
21570
- emit_label(s, label_next);
21571
- /* on stack: enum_rec array idx */
21572
- emit_op(s, OP_for_of_next);
21573
- emit_u8(s, 2);
21574
- emit_goto(s, OP_if_true, label_done);
21575
- /* append element */
21576
- /* enum_rec array idx val -> enum_rec array new_idx */
21577
- emit_op(s, OP_define_array_el);
21578
- emit_op(s, OP_inc);
21579
- emit_goto(s, OP_goto, label_next);
21580
- emit_label(s, label_done);
21581
- /* close enumeration */
21582
- emit_op(s, OP_drop); /* drop undef val */
21583
- emit_op(s, OP_nip1); /* drop enum_rec */
21584
- emit_op(s, OP_nip1);
21585
- emit_op(s, OP_nip1);
21586
- #endif
21587
21559
} else {
21588
21560
need_length = TRUE;
21589
21561
if (s->token.val != ',') {
@@ -22861,34 +22833,8 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags)
22861
22833
return -1;
22862
22834
if (js_parse_assign_expr(s))
22863
22835
return -1;
22864
- #if 1
22865
22836
/* XXX: could pass is_last indicator? */
22866
22837
emit_op(s, OP_append);
22867
- #else
22868
- int label_next, label_done;
22869
- label_next = new_label(s);
22870
- label_done = new_label(s);
22871
- /* push enumerate object below array/idx pair */
22872
- emit_op(s, OP_for_of_start);
22873
- emit_op(s, OP_rot5l);
22874
- emit_op(s, OP_rot5l);
22875
- emit_label(s, label_next);
22876
- /* on stack: enum_rec array idx */
22877
- emit_op(s, OP_for_of_next);
22878
- emit_u8(s, 2);
22879
- emit_goto(s, OP_if_true, label_done);
22880
- /* append element */
22881
- /* enum_rec array idx val -> enum_rec array new_idx */
22882
- emit_op(s, OP_define_array_el);
22883
- emit_op(s, OP_inc);
22884
- emit_goto(s, OP_goto, label_next);
22885
- emit_label(s, label_done);
22886
- /* close enumeration, drop enum_rec and idx */
22887
- emit_op(s, OP_drop); /* drop undef */
22888
- emit_op(s, OP_nip1); /* drop enum_rec */
22889
- emit_op(s, OP_nip1);
22890
- emit_op(s, OP_nip1);
22891
- #endif
22892
22838
} else {
22893
22839
if (js_parse_assign_expr(s))
22894
22840
return -1;
@@ -24066,7 +24012,6 @@ static int is_let(JSParseState *s, int decl_mask)
24066
24012
int res = FALSE;
24067
24013
24068
24014
if (token_is_pseudo_keyword(s, JS_ATOM_let)) {
24069
- #if 1
24070
24015
JSParsePos pos;
24071
24016
js_parse_get_pos(s, &pos);
24072
24017
for (;;) {
@@ -24099,12 +24044,6 @@ static int is_let(JSParseState *s, int decl_mask)
24099
24044
if (js_parse_seek_token(s, &pos)) {
24100
24045
res = -1;
24101
24046
}
24102
- #else
24103
- int tok = peek_token(s, TRUE);
24104
- if (tok == '{' || tok == TOK_IDENT || peek_token(s, FALSE) == '[') {
24105
- res = TRUE;
24106
- }
24107
- #endif
24108
24047
}
24109
24048
return res;
24110
24049
}
@@ -29044,29 +28983,6 @@ static __exception int resolve_variables(JSContext *ctx, JSFunctionDef *s)
29044
28983
}
29045
28984
}
29046
28985
goto no_change;
29047
- case OP_drop:
29048
- if (0) {
29049
- /* remove drops before return_undef */
29050
- /* do not perform this optimization in pass2 because
29051
- it breaks patterns recognised in resolve_labels */
29052
- int pos1 = pos_next;
29053
- int line1 = line_num;
29054
- while (code_match(&cc, pos1, OP_drop, -1)) {
29055
- if (cc.line_num >= 0) line1 = cc.line_num;
29056
- pos1 = cc.pos;
29057
- }
29058
- if (code_match(&cc, pos1, OP_return_undef, -1)) {
29059
- pos_next = pos1;
29060
- if (line1 != -1 && line1 != line_num) {
29061
- line_num = line1;
29062
- s->line_number_size++;
29063
- dbuf_putc(&bc_out, OP_line_num);
29064
- dbuf_put_u32(&bc_out, line_num);
29065
- }
29066
- break;
29067
- }
29068
- }
29069
- goto no_change;
29070
28986
case OP_insert3:
29071
28987
/* Transformation: insert3 put_array_el|put_ref_value drop -> put_array_el|put_ref_value */
29072
28988
if (code_match(&cc, pos_next, M2(OP_put_array_el, OP_put_ref_value), OP_drop, -1)) {
0 commit comments