Skip to content

Commit efc52c8

Browse files
committed
Separate (marker) unused tag
Reorder tags to accommodate a separate 'unused' tag so that 'undefined' can become a single tag write (instead of tag + value like booleans). This is good because 'undefined' values are involved in e.g. value stack resizes and are performance relevant. Also reorder tags so that "is heap allocated" check can be a single bit test instead of a comparison when using non-packed duk_tval. This makes every DECREF potentially faster because an "is heap allocated" test appears in every DECREF. Because "unused" is not intended to appear anywhere in actual use (e.g. as a value stack value, as a property value, etc), "unused" values will fall into the default clause of DUK_TAG_xxx switch case statements. Add an assert to every such default clause that the value is not intended to be "unused". Remove duk_push_unused() as it should no longer be used. It was only used by the debugger protocol; refuse an inbound "unused" value in the debugger. This is not breaking compatibility because there was no legitimate usage for the debug client sending requests with "unused" values.
1 parent d7ee8df commit efc52c8

16 files changed

Lines changed: 136 additions & 129 deletions

src/duk_api_internal.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ DUK_INTERNAL_DECL duk_hnativefunction *duk_require_hnativefunction(duk_context *
124124
DUK_INTERNAL_DECL duk_hobject *duk_require_hobject_or_lfunc(duk_context *ctx, duk_idx_t index);
125125
DUK_INTERNAL_DECL duk_hobject *duk_require_hobject_or_lfunc_coerce(duk_context *ctx, duk_idx_t index);
126126

127-
#if defined(DUK_USE_DEBUGGER_SUPPORT)
128-
DUK_INTERNAL_DECL void duk_push_unused(duk_context *ctx);
129-
#endif
130127
DUK_INTERNAL_DECL void duk_push_hstring(duk_context *ctx, duk_hstring *h);
131128
DUK_INTERNAL_DECL void duk_push_hstring_stridx(duk_context *ctx, duk_small_int_t stridx);
132129
DUK_INTERNAL_DECL void duk_push_hobject(duk_context *ctx, duk_hobject *h);

src/duk_api_stack.c

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ DUK_EXTERNAL void duk_set_top(duk_context *ctx, duk_idx_t index) {
392392
while (count != 0) {
393393
count--;
394394
tv = thr->valstack_top + count;
395-
DUK_ASSERT(DUK_TVAL_IS_UNDEFINED_ACTUAL(tv));
395+
DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(tv));
396396
}
397397
#endif
398398
thr->valstack_top = thr->valstack_bottom + uindex;
@@ -407,7 +407,7 @@ DUK_EXTERNAL void duk_set_top(duk_context *ctx, duk_idx_t index) {
407407
count--;
408408
tv = --thr->valstack_top; /* tv -> value just before prev top value; must relookup */
409409
DUK_ASSERT(tv >= thr->valstack_bottom);
410-
DUK_TVAL_SET_UNDEFINED_ACTUAL_UPDREF(thr, tv); /* side effects */
410+
DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv); /* side effects */
411411
}
412412
#else /* DUK_USE_REFERENCE_COUNTING */
413413
duk_uidx_t count;
@@ -419,7 +419,7 @@ DUK_EXTERNAL void duk_set_top(duk_context *ctx, duk_idx_t index) {
419419
DUK_ASSERT(tv > tv_end);
420420
do {
421421
tv--;
422-
DUK_TVAL_SET_UNDEFINED_ACTUAL(tv);
422+
DUK_TVAL_SET_UNDEFINED(tv);
423423
} while (tv != tv_end);
424424
thr->valstack_top = tv_end;
425425
#endif /* DUK_USE_REFERENCE_COUNTING */
@@ -541,7 +541,7 @@ DUK_LOCAL duk_bool_t duk__resize_valstack(duk_context *ctx, duk_size_t new_size)
541541
* because mark-and-sweep must adhere to a strict stack policy.
542542
* In other words, logical bottom and top MUST NOT have changed.
543543
* - All values above the top are unreachable but are initialized
544-
* to UNDEFINED_UNUSED, up to the post-realloc valstack_end.
544+
* to UNDEFINED, up to the post-realloc valstack_end.
545545
* - 'old_end_offset' must be computed after realloc to be correct.
546546
*/
547547

@@ -592,15 +592,15 @@ DUK_LOCAL duk_bool_t duk__resize_valstack(duk_context *ctx, duk_size_t new_size)
592592
p = (duk_tval *) (void *) ((duk_uint8_t *) thr->valstack + old_end_offset_post);
593593
while (p < thr->valstack_end) {
594594
/* Never executed if new size is smaller. */
595-
DUK_TVAL_SET_UNDEFINED_ACTUAL(p);
595+
DUK_TVAL_SET_UNDEFINED(p);
596596
p++;
597597
}
598598

599599
/* Assert for value stack initialization policy. */
600600
#if defined(DUK_USE_ASSERTIONS)
601601
p = thr->valstack_top;
602602
while (p < thr->valstack_end) {
603-
DUK_ASSERT(DUK_TVAL_IS_UNDEFINED_ACTUAL(p));
603+
DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(p));
604604
p++;
605605
}
606606
#endif
@@ -915,7 +915,7 @@ DUK_EXTERNAL void duk_replace(duk_context *ctx, duk_idx_t to_index) {
915915
*/
916916
DUK_TVAL_SET_TVAL(&tv_tmp, tv2);
917917
DUK_TVAL_SET_TVAL(tv2, tv1);
918-
DUK_TVAL_SET_UNDEFINED_ACTUAL(tv1);
918+
DUK_TVAL_SET_UNDEFINED(tv1);
919919
thr->valstack_top--;
920920
DUK_TVAL_DECREF(thr, &tv_tmp); /* side effects */
921921
}
@@ -969,7 +969,7 @@ DUK_EXTERNAL void duk_remove(duk_context *ctx, duk_idx_t index) {
969969
nbytes = (duk_size_t) (((duk_uint8_t *) q) - ((duk_uint8_t *) p)); /* Note: 'q' is top-1 */
970970
DUK_MEMMOVE(p, p + 1, nbytes); /* zero size not an issue: pointers are valid */
971971

972-
DUK_TVAL_SET_UNDEFINED_ACTUAL(q);
972+
DUK_TVAL_SET_UNDEFINED(q);
973973
thr->valstack_top--;
974974

975975
#ifdef DUK_USE_REFERENCE_COUNTING
@@ -1044,7 +1044,7 @@ DUK_EXTERNAL void duk_xcopymove_raw(duk_context *to_ctx, duk_context *from_ctx,
10441044

10451045
while (p > q) {
10461046
p--;
1047-
DUK_TVAL_SET_UNDEFINED_ACTUAL(p);
1047+
DUK_TVAL_SET_UNDEFINED(p);
10481048
/* XXX: fast primitive to set a bunch of values to UNDEFINED */
10491049
}
10501050
}
@@ -1712,6 +1712,7 @@ DUK_EXTERNAL duk_size_t duk_get_length(duk_context *ctx, duk_idx_t index) {
17121712
#endif
17131713
default:
17141714
/* number */
1715+
DUK_ASSERT(!DUK_TVAL_IS_UNUSED(tv));
17151716
DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv));
17161717
return 0;
17171718
}
@@ -1808,7 +1809,7 @@ DUK_EXTERNAL void duk_to_undefined(duk_context *ctx, duk_idx_t index) {
18081809

18091810
tv = duk_require_tval(ctx, index);
18101811
DUK_ASSERT(tv != NULL);
1811-
DUK_TVAL_SET_UNDEFINED_ACTUAL_UPDREF(thr, tv); /* side effects */
1812+
DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv); /* side effects */
18121813
}
18131814

18141815
DUK_EXTERNAL void duk_to_null(duk_context *ctx, duk_idx_t index) {
@@ -2222,6 +2223,7 @@ DUK_EXTERNAL const char *duk_to_string(duk_context *ctx, duk_idx_t index) {
22222223
#endif
22232224
default: {
22242225
/* number */
2226+
DUK_ASSERT(!DUK_TVAL_IS_UNUSED(tv));
22252227
DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv));
22262228
duk_push_tval(ctx, tv);
22272229
duk_numconv_stringify(ctx,
@@ -2347,6 +2349,8 @@ DUK_EXTERNAL void *duk_to_pointer(duk_context *ctx, duk_idx_t index) {
23472349
#endif
23482350
default:
23492351
/* number */
2352+
DUK_ASSERT(!DUK_TVAL_IS_UNUSED(tv));
2353+
DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv));
23502354
res = NULL;
23512355
break;
23522356
}
@@ -2482,6 +2486,8 @@ DUK_EXTERNAL void duk_to_object(duk_context *ctx, duk_idx_t index) {
24822486
case DUK_TAG_FASTINT:
24832487
#endif
24842488
default: {
2489+
DUK_ASSERT(!DUK_TVAL_IS_UNUSED(tv));
2490+
DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv));
24852491
flags = DUK_HOBJECT_FLAG_EXTENSIBLE |
24862492
DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_NUMBER);
24872493
proto = DUK_BIDX_NUMBER_PROTOTYPE;
@@ -2564,6 +2570,7 @@ DUK_EXTERNAL duk_int_t duk_get_type(duk_context *ctx, duk_idx_t index) {
25642570
#endif
25652571
default:
25662572
/* Note: number has no explicit tag (in 8-byte representation) */
2573+
DUK_ASSERT(!DUK_TVAL_IS_UNUSED(tv));
25672574
DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv));
25682575
return DUK_TYPE_NUMBER;
25692576
}
@@ -2607,6 +2614,7 @@ DUK_EXTERNAL duk_uint_t duk_get_type_mask(duk_context *ctx, duk_idx_t index) {
26072614
#endif
26082615
default:
26092616
/* Note: number has no explicit tag (in 8-byte representation) */
2617+
DUK_ASSERT(!DUK_TVAL_IS_UNUSED(tv));
26102618
DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv));
26112619
return DUK_TYPE_MASK_NUMBER;
26122620
}
@@ -2882,20 +2890,6 @@ DUK_INTERNAL void duk_push_tval(duk_context *ctx, duk_tval *tv) {
28822890
DUK_TVAL_INCREF(thr, tv); /* no side effects */
28832891
}
28842892

2885-
#if defined(DUK_USE_DEBUGGER_SUPPORT)
2886-
/* Right now only needed by the debugger. */
2887-
DUK_INTERNAL void duk_push_unused(duk_context *ctx) {
2888-
duk_hthread *thr;
2889-
duk_tval *tv_slot;
2890-
2891-
DUK_ASSERT_CTX_VALID(ctx);
2892-
thr = (duk_hthread *) ctx;
2893-
DUK__CHECK_SPACE();
2894-
tv_slot = thr->valstack_top++;
2895-
DUK_TVAL_SET_UNDEFINED_UNUSED(tv_slot);
2896-
}
2897-
#endif
2898-
28992893
DUK_EXTERNAL void duk_push_undefined(duk_context *ctx) {
29002894
duk_hthread *thr;
29012895

@@ -2907,7 +2901,7 @@ DUK_EXTERNAL void duk_push_undefined(duk_context *ctx) {
29072901
* we don't need to write, just assert.
29082902
*/
29092903
thr->valstack_top++;
2910-
DUK_ASSERT(DUK_TVAL_IS_UNDEFINED_ACTUAL(thr->valstack_top - 1));
2904+
DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(thr->valstack_top - 1));
29112905
}
29122906

29132907
DUK_EXTERNAL void duk_push_null(duk_context *ctx) {
@@ -4175,15 +4169,15 @@ DUK_EXTERNAL void duk_pop_n(duk_context *ctx, duk_idx_t count) {
41754169
count--;
41764170
tv = --thr->valstack_top; /* tv points to element just below prev top */
41774171
DUK_ASSERT(tv >= thr->valstack_bottom);
4178-
DUK_TVAL_SET_UNDEFINED_ACTUAL_UPDREF(thr, tv); /* side effects */
4172+
DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv); /* side effects */
41794173
}
41804174
#else
41814175
tv = thr->valstack_top;
41824176
while (count > 0) {
41834177
count--;
41844178
tv--;
41854179
DUK_ASSERT(tv >= thr->valstack_bottom);
4186-
DUK_TVAL_SET_UNDEFINED_ACTUAL(tv);
4180+
DUK_TVAL_SET_UNDEFINED(tv);
41874181
}
41884182
thr->valstack_top = tv;
41894183
#endif
@@ -4213,9 +4207,9 @@ DUK_EXTERNAL void duk_pop(duk_context *ctx) {
42134207
tv = --thr->valstack_top; /* tv points to element just below prev top */
42144208
DUK_ASSERT(tv >= thr->valstack_bottom);
42154209
#ifdef DUK_USE_REFERENCE_COUNTING
4216-
DUK_TVAL_SET_UNDEFINED_ACTUAL_UPDREF(thr, tv); /* side effects */
4210+
DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv); /* side effects */
42174211
#else
4218-
DUK_TVAL_SET_UNDEFINED_ACTUAL(tv);
4212+
DUK_TVAL_SET_UNDEFINED(tv);
42194213
#endif
42204214
DUK_ASSERT(thr->valstack_top >= thr->valstack_bottom);
42214215
}

src/duk_bi_json.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2012,6 +2012,8 @@ DUK_LOCAL void duk__enc_value2(duk_json_enc_ctx *js_ctx) {
20122012
#endif
20132013
default: {
20142014
/* number */
2015+
DUK_ASSERT(!DUK_TVAL_IS_UNUSED(tv));
2016+
DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv));
20152017
/* XXX: A fast path for usual integers would be useful when
20162018
* fastint support is not enabled.
20172019
*/
@@ -2258,7 +2260,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du
22582260

22592261
tv_val = DUK_HOBJECT_A_GET_VALUE_PTR(js_ctx->thr->heap, obj, i);
22602262

2261-
if (DUK_UNLIKELY(DUK_TVAL_IS_UNDEFINED_UNUSED(tv_val))) {
2263+
if (DUK_UNLIKELY(DUK_TVAL_IS_UNUSED(tv_val))) {
22622264
/* Gap in array; check for inherited property,
22632265
* bail out if one exists. This should be enough
22642266
* to support gappy arrays for all practical code.
@@ -2360,6 +2362,9 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du
23602362
/* XXX: A fast path for usual integers would be useful when
23612363
* fastint support is not enabled.
23622364
*/
2365+
DUK_ASSERT(!DUK_TVAL_IS_UNUSED(tv));
2366+
DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv));
2367+
23632368
/* XXX: Stack discipline is annoying, could be changed in numconv. */
23642369
duk_push_tval((duk_context *) js_ctx->thr, tv);
23652370
duk__enc_double(js_ctx);

src/duk_debug_vsnprintf.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ DUK_LOCAL void duk__print_hobject(duk__dprint_state *st, duk_hobject *h) {
388388
/* leave out trailing 'unused' elements */
389389
while (a_limit > 0) {
390390
tv = DUK_HOBJECT_A_GET_VALUE_PTR(NULL, h, a_limit - 1);
391-
if (!DUK_TVAL_IS_UNDEFINED_UNUSED(tv)) {
391+
if (!DUK_TVAL_IS_UNUSED(tv)) {
392392
break;
393393
}
394394
a_limit--;
@@ -717,11 +717,11 @@ DUK_LOCAL void duk__print_tval(duk__dprint_state *st, duk_tval *tv) {
717717
}
718718
switch (DUK_TVAL_GET_TAG(tv)) {
719719
case DUK_TAG_UNDEFINED: {
720-
if (DUK_TVAL_IS_UNDEFINED_UNUSED(tv)) {
721-
duk_fb_put_cstring(fb, "unused");
722-
} else {
723-
duk_fb_put_cstring(fb, "undefined");
724-
}
720+
duk_fb_put_cstring(fb, "undefined");
721+
break;
722+
}
723+
case DUK_TAG_UNUSED: {
724+
duk_fb_put_cstring(fb, "unused");
725725
break;
726726
}
727727
case DUK_TAG_NULL: {
@@ -764,6 +764,7 @@ DUK_LOCAL void duk__print_tval(duk__dprint_state *st, duk_tval *tv) {
764764
#endif
765765
default: {
766766
/* IEEE double is approximately 16 decimal digits; print a couple extra */
767+
DUK_ASSERT(!DUK_TVAL_IS_UNUSED(tv));
767768
DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv));
768769
duk_fb_sprintf(fb, "%.18g", (double) DUK_TVAL_GET_NUMBER(tv));
769770
break;

src/duk_debugger.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,6 @@ DUK_INTERNAL void duk_debug_read_tval(duk_hthread *thr) {
399399
len = duk__debug_read_uint16_raw(thr);
400400
duk__debug_read_hbuffer_raw(thr, len);
401401
break;
402-
case 0x15:
403-
duk_push_unused(ctx);
404-
break;
405402
case 0x16:
406403
duk_push_undefined(ctx);
407404
break;
@@ -440,6 +437,7 @@ DUK_INTERNAL void duk_debug_read_tval(duk_hthread *thr) {
440437
duk_push_heapptr(thr, (void *) h);
441438
break;
442439
}
440+
case 0x15: /* unused: not accepted in inbound messages */
443441
default:
444442
goto fail;
445443
}
@@ -689,8 +687,10 @@ DUK_INTERNAL void duk_debug_write_tval(duk_hthread *thr, duk_tval *tv) {
689687

690688
switch (DUK_TVAL_GET_TAG(tv)) {
691689
case DUK_TAG_UNDEFINED:
692-
duk_debug_write_byte(thr,
693-
DUK_TVAL_IS_UNDEFINED_UNUSED(tv) ? 0x15 : 0x16);
690+
duk_debug_write_byte(thr, 0x16);
691+
break;
692+
case DUK_TAG_UNUSED:
693+
duk_debug_write_byte(thr, 0x15);
694694
break;
695695
case DUK_TAG_NULL:
696696
duk_debug_write_byte(thr, 0x17);
@@ -726,6 +726,7 @@ DUK_INTERNAL void duk_debug_write_tval(duk_hthread *thr, duk_tval *tv) {
726726
#endif
727727
default:
728728
/* Numbers are normalized to big (network) endian. */
729+
DUK_ASSERT(!DUK_TVAL_IS_UNUSED(tv));
729730
DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv));
730731
du.d = DUK_TVAL_GET_NUMBER(tv);
731732
DUK_DBLUNION_DOUBLE_HTON(&du);

src/duk_heap_alloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,8 @@ duk_heap *duk_heap_alloc(duk_alloc_function alloc_func,
777777
#endif
778778
DUK_ASSERT(res->lj.type == DUK_LJ_TYPE_UNKNOWN); /* zero */
779779

780-
DUK_TVAL_SET_UNDEFINED_UNUSED(&res->lj.value1);
781-
DUK_TVAL_SET_UNDEFINED_UNUSED(&res->lj.value2);
780+
DUK_TVAL_SET_UNDEFINED(&res->lj.value1);
781+
DUK_TVAL_SET_UNDEFINED(&res->lj.value2);
782782

783783
#if (DUK_STRTAB_INITIAL_SIZE < DUK_UTIL_MIN_HASH_PRIME)
784784
#error initial heap stringtable size is defined incorrectly

src/duk_heaphdr.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -356,17 +356,17 @@ struct duk_heaphdr_string {
356356
* and footprint critical; any changes made should be measured for size/speed.
357357
*/
358358

359-
#define DUK_TVAL_SET_UNDEFINED_ACTUAL_UPDREF_ALT0(thr,tvptr_dst) do { \
359+
#define DUK_TVAL_SET_UNDEFINED_UPDREF_ALT0(thr,tvptr_dst) do { \
360360
duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \
361361
DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \
362-
DUK_TVAL_SET_UNDEFINED_ACTUAL(tv__dst); \
362+
DUK_TVAL_SET_UNDEFINED(tv__dst); \
363363
DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \
364364
} while (0)
365365

366-
#define DUK_TVAL_SET_UNDEFINED_UNUSED_UPDREF_ALT0(thr,tvptr_dst) do { \
366+
#define DUK_TVAL_SET_UNUSED_UPDREF_ALT0(thr,tvptr_dst) do { \
367367
duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \
368368
DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \
369-
DUK_TVAL_SET_UNDEFINED_UNUSED(tv__dst); \
369+
DUK_TVAL_SET_UNUSED(tv__dst); \
370370
DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \
371371
} while (0)
372372

@@ -563,8 +563,8 @@ struct duk_heaphdr_string {
563563
#endif
564564

565565
/* XXX: no optimized variants yet */
566-
#define DUK_TVAL_SET_UNDEFINED_ACTUAL_UPDREF DUK_TVAL_SET_UNDEFINED_ACTUAL_UPDREF_ALT0
567-
#define DUK_TVAL_SET_UNDEFINED_UNUSED_UPDREF DUK_TVAL_SET_UNDEFINED_UNUSED_UPDREF_ALT0
566+
#define DUK_TVAL_SET_UNDEFINED_UPDREF DUK_TVAL_SET_UNDEFINED_UPDREF_ALT0
567+
#define DUK_TVAL_SET_UNUSED_UPDREF DUK_TVAL_SET_UNUSED_UPDREF_ALT0
568568
#define DUK_TVAL_SET_NULL_UPDREF DUK_TVAL_SET_NULL_UPDREF_ALT0
569569
#define DUK_TVAL_SET_BOOLEAN_UPDREF DUK_TVAL_SET_BOOLEAN_UPDREF_ALT0
570570
#define DUK_TVAL_SET_NUMBER_UPDREF DUK_TVAL_SET_NUMBER_UPDREF_ALT0
@@ -625,15 +625,15 @@ struct duk_heaphdr_string {
625625
#define DUK_HOBJECT_INCREF_ALLOWNULL(thr,h) do {} while (0) /* nop */
626626
#define DUK_HOBJECT_DECREF_ALLOWNULL(thr,h) do {} while (0) /* nop */
627627

628-
#define DUK_TVAL_SET_UNDEFINED_ACTUAL_UPDREF_ALT0(thr,tvptr_dst) do { \
628+
#define DUK_TVAL_SET_UNDEFINED_UPDREF_ALT0(thr,tvptr_dst) do { \
629629
duk_tval *tv__dst; tv__dst = (tvptr_dst); \
630-
DUK_TVAL_SET_UNDEFINED_ACTUAL(tv__dst); \
630+
DUK_TVAL_SET_UNDEFINED(tv__dst); \
631631
DUK_UNREF((thr)); \
632632
} while (0)
633633

634-
#define DUK_TVAL_SET_UNDEFINED_UNUSED_UPDREF_ALT0(thr,tvptr_dst) do { \
634+
#define DUK_TVAL_SET_UNUSED_UPDREF_ALT0(thr,tvptr_dst) do { \
635635
duk_tval *tv__dst; tv__dst = (tvptr_dst); \
636-
DUK_TVAL_SET_UNDEFINED_UNUSED(tv__dst); \
636+
DUK_TVAL_SET_UNUSED(tv__dst); \
637637
DUK_UNREF((thr)); \
638638
} while (0)
639639

@@ -724,8 +724,8 @@ struct duk_heaphdr_string {
724724
DUK_UNREF((thr)); \
725725
} while (0)
726726

727-
#define DUK_TVAL_SET_UNDEFINED_ACTUAL_UPDREF DUK_TVAL_SET_UNDEFINED_ACTUAL_UPDREF_ALT0
728-
#define DUK_TVAL_SET_UNDEFINED_UNUSED_UPDREF DUK_TVAL_SET_UNDEFINED_UNUSED_UPDREF_ALT0
727+
#define DUK_TVAL_SET_UNDEFINED_UPDREF DUK_TVAL_SET_UNDEFINED_UPDREF_ALT0
728+
#define DUK_TVAL_SET_UNUSED_UPDREF DUK_TVAL_SET_UNUSED_UPDREF_ALT0
729729
#define DUK_TVAL_SET_NULL_UPDREF DUK_TVAL_SET_NULL_UPDREF_ALT0
730730
#define DUK_TVAL_SET_BOOLEAN_UPDREF DUK_TVAL_SET_BOOLEAN_UPDREF_ALT0
731731
#define DUK_TVAL_SET_NUMBER_UPDREF DUK_TVAL_SET_NUMBER_UPDREF_ALT0

0 commit comments

Comments
 (0)