Browse code

app_jsdt: duktape interpreter upgraded to v2.7.0

Daniel-Constantin Mierla authored on 07/05/2022 18:20:42
Showing 3 changed files
... ...
@@ -1,9 +1,9 @@
1 1
 /*
2 2
  *  duk_config.h configuration header generated by genconfig.py.
3 3
  *
4
- *  Git commit: fffa346eff06a8764b02c31d4336f63a773a95c3
5
- *  Git describe: v2.6.0
6
- *  Git branch: v2-maintenance
4
+ *  Git commit: 03d4d728f8365021de6955c649e6dcd05dcca99f
5
+ *  Git describe: 03d4d72-dirty
6
+ *  Git branch: HEAD
7 7
  *
8 8
  *  Supported platforms:
9 9
  *      - Mac OSX, iPhone, Darwin
... ...
@@ -1,8 +1,8 @@
1 1
 /*
2
- *  Single source autogenerated distributable for Duktape 2.6.0.
2
+ *  Single source autogenerated distributable for Duktape 2.7.0.
3 3
  *
4
- *  Git commit fffa346eff06a8764b02c31d4336f63a773a95c3 (v2.6.0).
5
- *  Git branch v2-maintenance.
4
+ *  Git commit 03d4d728f8365021de6955c649e6dcd05dcca99f (03d4d72-dirty).
5
+ *  Git branch HEAD.
6 6
  *
7 7
  *  See Duktape AUTHORS.rst and LICENSE.txt for copyright and
8 8
  *  licensing information.
... ...
@@ -16,7 +16,7 @@
16 16
 *
17 17
 *  (http://opensource.org/licenses/MIT)
18 18
 *
19
-*  Copyright (c) 2013-2019 by Duktape authors (see AUTHORS.rst)
19
+*  Copyright (c) 2013-present by Duktape authors (see AUTHORS.rst)
20 20
 *
21 21
 *  Permission is hereby granted, free of charge, to any person obtaining a copy
22 22
 *  of this software and associated documentation files (the "Software"), to deal
... ...
@@ -105,6 +105,12 @@
105 105
 *  * Luis de Bethencourt (https://github.com/luisbg)
106 106
 *  * Ian Whyman (https://github.com/v00d00)
107 107
 *  * Rick Sayre (https://github.com/whorfin)
108
+*  * Craig Leres (https://github.com/leres)
109
+*  * Maurici Abad (https://github.com/mauriciabad)
110
+*  * Nancy Li (https://github.com/NancyLi1013)
111
+*  * William Parks (https://github.com/WilliamParks)
112
+*  * Sam Hellawell (https://github.com/samhellawell)
113
+*  * Vladislavs Sokurenko (https://github.com/sokurenko)
108 114
 *
109 115
 *  Other contributions
110 116
 *  ===================
... ...
@@ -269,7 +275,7 @@ union duk_double_union {
269 275
 	duk_uint16_t us[4];
270 276
 	duk_uint8_t uc[8];
271 277
 #if defined(DUK_USE_PACKED_TVAL)
272
-	void *vp[2];  /* used by packed duk_tval, assumes sizeof(void *) == 4 */
278
+	void *vp[2]; /* used by packed duk_tval, assumes sizeof(void *) == 4 */
273 279
 #endif
274 280
 };
275 281
 
... ...
@@ -281,64 +287,64 @@ typedef union duk_double_union duk_double_union;
281 287
 
282 288
 #if defined(DUK_USE_DOUBLE_LE)
283 289
 #if defined(DUK_USE_64BIT_OPS)
284
-#define DUK_DBL_IDX_ULL0   0
285
-#endif
286
-#define DUK_DBL_IDX_UI0    1
287
-#define DUK_DBL_IDX_UI1    0
288
-#define DUK_DBL_IDX_US0    3
289
-#define DUK_DBL_IDX_US1    2
290
-#define DUK_DBL_IDX_US2    1
291
-#define DUK_DBL_IDX_US3    0
292
-#define DUK_DBL_IDX_UC0    7
293
-#define DUK_DBL_IDX_UC1    6
294
-#define DUK_DBL_IDX_UC2    5
295
-#define DUK_DBL_IDX_UC3    4
296
-#define DUK_DBL_IDX_UC4    3
297
-#define DUK_DBL_IDX_UC5    2
298
-#define DUK_DBL_IDX_UC6    1
299
-#define DUK_DBL_IDX_UC7    0
300
-#define DUK_DBL_IDX_VP0    DUK_DBL_IDX_UI0  /* packed tval */
301
-#define DUK_DBL_IDX_VP1    DUK_DBL_IDX_UI1  /* packed tval */
290
+#define DUK_DBL_IDX_ULL0 0
291
+#endif
292
+#define DUK_DBL_IDX_UI0 1
293
+#define DUK_DBL_IDX_UI1 0
294
+#define DUK_DBL_IDX_US0 3
295
+#define DUK_DBL_IDX_US1 2
296
+#define DUK_DBL_IDX_US2 1
297
+#define DUK_DBL_IDX_US3 0
298
+#define DUK_DBL_IDX_UC0 7
299
+#define DUK_DBL_IDX_UC1 6
300
+#define DUK_DBL_IDX_UC2 5
301
+#define DUK_DBL_IDX_UC3 4
302
+#define DUK_DBL_IDX_UC4 3
303
+#define DUK_DBL_IDX_UC5 2
304
+#define DUK_DBL_IDX_UC6 1
305
+#define DUK_DBL_IDX_UC7 0
306
+#define DUK_DBL_IDX_VP0 DUK_DBL_IDX_UI0 /* packed tval */
307
+#define DUK_DBL_IDX_VP1 DUK_DBL_IDX_UI1 /* packed tval */
302 308
 #elif defined(DUK_USE_DOUBLE_BE)
303 309
 #if defined(DUK_USE_64BIT_OPS)
304
-#define DUK_DBL_IDX_ULL0   0
305
-#endif
306
-#define DUK_DBL_IDX_UI0    0
307
-#define DUK_DBL_IDX_UI1    1
308
-#define DUK_DBL_IDX_US0    0
309
-#define DUK_DBL_IDX_US1    1
310
-#define DUK_DBL_IDX_US2    2
311
-#define DUK_DBL_IDX_US3    3
312
-#define DUK_DBL_IDX_UC0    0
313
-#define DUK_DBL_IDX_UC1    1
314
-#define DUK_DBL_IDX_UC2    2
315
-#define DUK_DBL_IDX_UC3    3
316
-#define DUK_DBL_IDX_UC4    4
317
-#define DUK_DBL_IDX_UC5    5
318
-#define DUK_DBL_IDX_UC6    6
319
-#define DUK_DBL_IDX_UC7    7
320
-#define DUK_DBL_IDX_VP0    DUK_DBL_IDX_UI0  /* packed tval */
321
-#define DUK_DBL_IDX_VP1    DUK_DBL_IDX_UI1  /* packed tval */
310
+#define DUK_DBL_IDX_ULL0 0
311
+#endif
312
+#define DUK_DBL_IDX_UI0 0
313
+#define DUK_DBL_IDX_UI1 1
314
+#define DUK_DBL_IDX_US0 0
315
+#define DUK_DBL_IDX_US1 1
316
+#define DUK_DBL_IDX_US2 2
317
+#define DUK_DBL_IDX_US3 3
318
+#define DUK_DBL_IDX_UC0 0
319
+#define DUK_DBL_IDX_UC1 1
320
+#define DUK_DBL_IDX_UC2 2
321
+#define DUK_DBL_IDX_UC3 3
322
+#define DUK_DBL_IDX_UC4 4
323
+#define DUK_DBL_IDX_UC5 5
324
+#define DUK_DBL_IDX_UC6 6
325
+#define DUK_DBL_IDX_UC7 7
326
+#define DUK_DBL_IDX_VP0 DUK_DBL_IDX_UI0 /* packed tval */
327
+#define DUK_DBL_IDX_VP1 DUK_DBL_IDX_UI1 /* packed tval */
322 328
 #elif defined(DUK_USE_DOUBLE_ME)
323 329
 #if defined(DUK_USE_64BIT_OPS)
324
-#define DUK_DBL_IDX_ULL0   0  /* not directly applicable, byte order differs from a double */
325
-#endif
326
-#define DUK_DBL_IDX_UI0    0
327
-#define DUK_DBL_IDX_UI1    1
328
-#define DUK_DBL_IDX_US0    1
329
-#define DUK_DBL_IDX_US1    0
330
-#define DUK_DBL_IDX_US2    3
331
-#define DUK_DBL_IDX_US3    2
332
-#define DUK_DBL_IDX_UC0    3
333
-#define DUK_DBL_IDX_UC1    2
334
-#define DUK_DBL_IDX_UC2    1
335
-#define DUK_DBL_IDX_UC3    0
336
-#define DUK_DBL_IDX_UC4    7
337
-#define DUK_DBL_IDX_UC5    6
338
-#define DUK_DBL_IDX_UC6    5
339
-#define DUK_DBL_IDX_UC7    4
340
-#define DUK_DBL_IDX_VP0    DUK_DBL_IDX_UI0  /* packed tval */
341
-#define DUK_DBL_IDX_VP1    DUK_DBL_IDX_UI1  /* packed tval */
330
+#define DUK_DBL_IDX_ULL0 0 /* not directly applicable, byte order differs from a double */
331
+#endif
332
+#define DUK_DBL_IDX_UI0 0
333
+#define DUK_DBL_IDX_UI1 1
334
+#define DUK_DBL_IDX_US0 1
335
+#define DUK_DBL_IDX_US1 0
336
+#define DUK_DBL_IDX_US2 3
337
+#define DUK_DBL_IDX_US3 2
338
+#define DUK_DBL_IDX_UC0 3
339
+#define DUK_DBL_IDX_UC1 2
340
+#define DUK_DBL_IDX_UC2 1
341
+#define DUK_DBL_IDX_UC3 0
342
+#define DUK_DBL_IDX_UC4 7
343
+#define DUK_DBL_IDX_UC5 6
344
+#define DUK_DBL_IDX_UC6 5
345
+#define DUK_DBL_IDX_UC7 4
346
+#define DUK_DBL_IDX_VP0 DUK_DBL_IDX_UI0 /* packed tval */
347
+#define DUK_DBL_IDX_VP1 DUK_DBL_IDX_UI1 /* packed tval */
342 348
 #else
343 349
 #error internal error
344 350
 #endif
... ...
@@ -348,57 +354,63 @@ typedef union duk_double_union duk_double_union;
348 354
  *  by duk_numconv.c and duk_tval.h.
349 355
  */
350 356
 
351
-#define DUK_DBLUNION_SET_DOUBLE(u,v)  do {  \
357
+#define DUK_DBLUNION_SET_DOUBLE(u, v) \
358
+	do { \
352 359
 		(u)->d = (v); \
353 360
 	} while (0)
354 361
 
355
-#define DUK_DBLUNION_SET_HIGH32(u,v)  do {  \
362
+#define DUK_DBLUNION_SET_HIGH32(u, v) \
363
+	do { \
356 364
 		(u)->ui[DUK_DBL_IDX_UI0] = (duk_uint32_t) (v); \
357 365
 	} while (0)
358 366
 
359 367
 #if defined(DUK_USE_64BIT_OPS)
360 368
 #if defined(DUK_USE_DOUBLE_ME)
361
-#define DUK_DBLUNION_SET_HIGH32_ZERO_LOW32(u,v)  do { \
369
+#define DUK_DBLUNION_SET_HIGH32_ZERO_LOW32(u, v) \
370
+	do { \
362 371
 		(u)->ull[DUK_DBL_IDX_ULL0] = (duk_uint64_t) (v); \
363 372
 	} while (0)
364 373
 #else
365
-#define DUK_DBLUNION_SET_HIGH32_ZERO_LOW32(u,v)  do { \
374
+#define DUK_DBLUNION_SET_HIGH32_ZERO_LOW32(u, v) \
375
+	do { \
366 376
 		(u)->ull[DUK_DBL_IDX_ULL0] = ((duk_uint64_t) (v)) << 32; \
367 377
 	} while (0)
368 378
 #endif
369
-#else  /* DUK_USE_64BIT_OPS */
370
-#define DUK_DBLUNION_SET_HIGH32_ZERO_LOW32(u,v)  do { \
379
+#else /* DUK_USE_64BIT_OPS */
380
+#define DUK_DBLUNION_SET_HIGH32_ZERO_LOW32(u, v) \
381
+	do { \
371 382
 		(u)->ui[DUK_DBL_IDX_UI0] = (duk_uint32_t) (v); \
372 383
 		(u)->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) 0; \
373 384
 	} while (0)
374
-#endif  /* DUK_USE_64BIT_OPS */
385
+#endif /* DUK_USE_64BIT_OPS */
375 386
 
376
-#define DUK_DBLUNION_SET_LOW32(u,v)  do {  \
387
+#define DUK_DBLUNION_SET_LOW32(u, v) \
388
+	do { \
377 389
 		(u)->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) (v); \
378 390
 	} while (0)
379 391
 
380
-#define DUK_DBLUNION_GET_DOUBLE(u)  ((u)->d)
381
-#define DUK_DBLUNION_GET_HIGH32(u)  ((u)->ui[DUK_DBL_IDX_UI0])
382
-#define DUK_DBLUNION_GET_LOW32(u)   ((u)->ui[DUK_DBL_IDX_UI1])
392
+#define DUK_DBLUNION_GET_DOUBLE(u) ((u)->d)
393
+#define DUK_DBLUNION_GET_HIGH32(u) ((u)->ui[DUK_DBL_IDX_UI0])
394
+#define DUK_DBLUNION_GET_LOW32(u)  ((u)->ui[DUK_DBL_IDX_UI1])
383 395
 
384 396
 #if defined(DUK_USE_64BIT_OPS)
385 397
 #if defined(DUK_USE_DOUBLE_ME)
386
-#define DUK_DBLUNION_SET_UINT64(u,v)  do { \
398
+#define DUK_DBLUNION_SET_UINT64(u, v) \
399
+	do { \
387 400
 		(u)->ui[DUK_DBL_IDX_UI0] = (duk_uint32_t) ((v) >> 32); \
388 401
 		(u)->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) (v); \
389 402
 	} while (0)
390
-#define DUK_DBLUNION_GET_UINT64(u) \
391
-	((((duk_uint64_t) (u)->ui[DUK_DBL_IDX_UI0]) << 32) | \
392
-	 ((duk_uint64_t) (u)->ui[DUK_DBL_IDX_UI1]))
403
+#define DUK_DBLUNION_GET_UINT64(u) ((((duk_uint64_t) (u)->ui[DUK_DBL_IDX_UI0]) << 32) | ((duk_uint64_t) (u)->ui[DUK_DBL_IDX_UI1]))
393 404
 #else
394
-#define DUK_DBLUNION_SET_UINT64(u,v)  do { \
405
+#define DUK_DBLUNION_SET_UINT64(u, v) \
406
+	do { \
395 407
 		(u)->ull[DUK_DBL_IDX_ULL0] = (duk_uint64_t) (v); \
396 408
 	} while (0)
397
-#define DUK_DBLUNION_GET_UINT64(u)  ((u)->ull[DUK_DBL_IDX_ULL0])
409
+#define DUK_DBLUNION_GET_UINT64(u) ((u)->ull[DUK_DBL_IDX_ULL0])
398 410
 #endif
399
-#define DUK_DBLUNION_SET_INT64(u,v) DUK_DBLUNION_SET_UINT64((u), (duk_uint64_t) (v))
400
-#define DUK_DBLUNION_GET_INT64(u)   ((duk_int64_t) DUK_DBLUNION_GET_UINT64((u)))
401
-#endif  /* DUK_USE_64BIT_OPS */
411
+#define DUK_DBLUNION_SET_INT64(u, v) DUK_DBLUNION_SET_UINT64((u), (duk_uint64_t) (v))
412
+#define DUK_DBLUNION_GET_INT64(u)    ((duk_int64_t) DUK_DBLUNION_GET_UINT64((u)))
413
+#endif /* DUK_USE_64BIT_OPS */
402 414
 
403 415
 /*
404 416
  *  Double NaN manipulation macros related to NaN normalization needed when
... ...
@@ -429,102 +441,85 @@ typedef union duk_double_union duk_double_union;
429 441
 #if defined(DUK_USE_64BIT_OPS)
430 442
 #if defined(DUK_USE_DOUBLE_ME)
431 443
 /* Macros for 64-bit ops + mixed endian doubles. */
432
-#define DUK__DBLUNION_SET_NAN_FULL(u)  do { \
444
+#define DUK__DBLUNION_SET_NAN_FULL(u) \
445
+	do { \
433 446
 		(u)->ull[DUK_DBL_IDX_ULL0] = DUK_U64_CONSTANT(0x000000007ff80000); \
434 447
 	} while (0)
435 448
 #define DUK__DBLUNION_IS_NAN_FULL(u) \
436 449
 	((((u)->ull[DUK_DBL_IDX_ULL0] & DUK_U64_CONSTANT(0x000000007ff00000)) == DUK_U64_CONSTANT(0x000000007ff00000)) && \
437 450
 	 ((((u)->ull[DUK_DBL_IDX_ULL0]) & DUK_U64_CONSTANT(0xffffffff000fffff)) != 0))
438
-#define DUK__DBLUNION_IS_NORMALIZED_NAN_FULL(u) \
439
-	((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x000000007ff80000))
451
+#define DUK__DBLUNION_IS_NORMALIZED_NAN_FULL(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x000000007ff80000))
440 452
 #define DUK__DBLUNION_IS_ANYINF(u) \
441 453
 	(((u)->ull[DUK_DBL_IDX_ULL0] & DUK_U64_CONSTANT(0xffffffff7fffffff)) == DUK_U64_CONSTANT(0x000000007ff00000))
442
-#define DUK__DBLUNION_IS_POSINF(u) \
443
-	((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x000000007ff00000))
444
-#define DUK__DBLUNION_IS_NEGINF(u) \
445
-	((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x00000000fff00000))
454
+#define DUK__DBLUNION_IS_POSINF(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x000000007ff00000))
455
+#define DUK__DBLUNION_IS_NEGINF(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x00000000fff00000))
446 456
 #define DUK__DBLUNION_IS_ANYZERO(u) \
447 457
 	(((u)->ull[DUK_DBL_IDX_ULL0] & DUK_U64_CONSTANT(0xffffffff7fffffff)) == DUK_U64_CONSTANT(0x0000000000000000))
448
-#define DUK__DBLUNION_IS_POSZERO(u) \
449
-	((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x0000000000000000))
450
-#define DUK__DBLUNION_IS_NEGZERO(u) \
451
-	((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x0000000080000000))
458
+#define DUK__DBLUNION_IS_POSZERO(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x0000000000000000))
459
+#define DUK__DBLUNION_IS_NEGZERO(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x0000000080000000))
452 460
 #else
453 461
 /* Macros for 64-bit ops + big/little endian doubles. */
454
-#define DUK__DBLUNION_SET_NAN_FULL(u)  do { \
462
+#define DUK__DBLUNION_SET_NAN_FULL(u) \
463
+	do { \
455 464
 		(u)->ull[DUK_DBL_IDX_ULL0] = DUK_U64_CONSTANT(0x7ff8000000000000); \
456 465
 	} while (0)
457 466
 #define DUK__DBLUNION_IS_NAN_FULL(u) \
458 467
 	((((u)->ull[DUK_DBL_IDX_ULL0] & DUK_U64_CONSTANT(0x7ff0000000000000)) == DUK_U64_CONSTANT(0x7ff0000000000000)) && \
459 468
 	 ((((u)->ull[DUK_DBL_IDX_ULL0]) & DUK_U64_CONSTANT(0x000fffffffffffff)) != 0))
460
-#define DUK__DBLUNION_IS_NORMALIZED_NAN_FULL(u) \
461
-	((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x7ff8000000000000))
469
+#define DUK__DBLUNION_IS_NORMALIZED_NAN_FULL(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x7ff8000000000000))
462 470
 #define DUK__DBLUNION_IS_ANYINF(u) \
463 471
 	(((u)->ull[DUK_DBL_IDX_ULL0] & DUK_U64_CONSTANT(0x7fffffffffffffff)) == DUK_U64_CONSTANT(0x7ff0000000000000))
464
-#define DUK__DBLUNION_IS_POSINF(u) \
465
-	((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x7ff0000000000000))
466
-#define DUK__DBLUNION_IS_NEGINF(u) \
467
-	((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0xfff0000000000000))
472
+#define DUK__DBLUNION_IS_POSINF(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x7ff0000000000000))
473
+#define DUK__DBLUNION_IS_NEGINF(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0xfff0000000000000))
468 474
 #define DUK__DBLUNION_IS_ANYZERO(u) \
469 475
 	(((u)->ull[DUK_DBL_IDX_ULL0] & DUK_U64_CONSTANT(0x7fffffffffffffff)) == DUK_U64_CONSTANT(0x0000000000000000))
470
-#define DUK__DBLUNION_IS_POSZERO(u) \
471
-	((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x0000000000000000))
472
-#define DUK__DBLUNION_IS_NEGZERO(u) \
473
-	((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x8000000000000000))
476
+#define DUK__DBLUNION_IS_POSZERO(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x0000000000000000))
477
+#define DUK__DBLUNION_IS_NEGZERO(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x8000000000000000))
474 478
 #endif
475
-#else  /* DUK_USE_64BIT_OPS */
479
+#else /* DUK_USE_64BIT_OPS */
476 480
 /* Macros for no 64-bit ops, any endianness. */
477
-#define DUK__DBLUNION_SET_NAN_FULL(u)  do { \
481
+#define DUK__DBLUNION_SET_NAN_FULL(u) \
482
+	do { \
478 483
 		(u)->ui[DUK_DBL_IDX_UI0] = (duk_uint32_t) 0x7ff80000UL; \
479 484
 		(u)->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) 0x00000000UL; \
480 485
 	} while (0)
481 486
 #define DUK__DBLUNION_IS_NAN_FULL(u) \
482 487
 	((((u)->ui[DUK_DBL_IDX_UI0] & 0x7ff00000UL) == 0x7ff00000UL) && \
483
-	 (((u)->ui[DUK_DBL_IDX_UI0] & 0x000fffffUL) != 0 || \
484
-          (u)->ui[DUK_DBL_IDX_UI1] != 0))
488
+	 (((u)->ui[DUK_DBL_IDX_UI0] & 0x000fffffUL) != 0 || (u)->ui[DUK_DBL_IDX_UI1] != 0))
485 489
 #define DUK__DBLUNION_IS_NORMALIZED_NAN_FULL(u) \
486
-	(((u)->ui[DUK_DBL_IDX_UI0] == 0x7ff80000UL) && \
487
-	 ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL))
490
+	(((u)->ui[DUK_DBL_IDX_UI0] == 0x7ff80000UL) && ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL))
488 491
 #define DUK__DBLUNION_IS_ANYINF(u) \
489
-	((((u)->ui[DUK_DBL_IDX_UI0] & 0x7fffffffUL) == 0x7ff00000UL) && \
490
-	 ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL))
491
-#define DUK__DBLUNION_IS_POSINF(u) \
492
-	(((u)->ui[DUK_DBL_IDX_UI0] == 0x7ff00000UL) && \
493
-	 ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL))
494
-#define DUK__DBLUNION_IS_NEGINF(u) \
495
-	(((u)->ui[DUK_DBL_IDX_UI0] == 0xfff00000UL) && \
496
-	 ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL))
492
+	((((u)->ui[DUK_DBL_IDX_UI0] & 0x7fffffffUL) == 0x7ff00000UL) && ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL))
493
+#define DUK__DBLUNION_IS_POSINF(u) (((u)->ui[DUK_DBL_IDX_UI0] == 0x7ff00000UL) && ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL))
494
+#define DUK__DBLUNION_IS_NEGINF(u) (((u)->ui[DUK_DBL_IDX_UI0] == 0xfff00000UL) && ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL))
497 495
 #define DUK__DBLUNION_IS_ANYZERO(u) \
498
-	((((u)->ui[DUK_DBL_IDX_UI0] & 0x7fffffffUL) == 0x00000000UL) && \
499
-	 ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL))
500
-#define DUK__DBLUNION_IS_POSZERO(u) \
501
-	(((u)->ui[DUK_DBL_IDX_UI0] == 0x00000000UL) && \
502
-	 ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL))
503
-#define DUK__DBLUNION_IS_NEGZERO(u) \
504
-	(((u)->ui[DUK_DBL_IDX_UI0] == 0x80000000UL) && \
505
-	 ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL))
506
-#endif  /* DUK_USE_64BIT_OPS */
507
-
508
-#define DUK__DBLUNION_SET_NAN_NOTFULL(u)  do { \
496
+	((((u)->ui[DUK_DBL_IDX_UI0] & 0x7fffffffUL) == 0x00000000UL) && ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL))
497
+#define DUK__DBLUNION_IS_POSZERO(u) (((u)->ui[DUK_DBL_IDX_UI0] == 0x00000000UL) && ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL))
498
+#define DUK__DBLUNION_IS_NEGZERO(u) (((u)->ui[DUK_DBL_IDX_UI0] == 0x80000000UL) && ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL))
499
+#endif /* DUK_USE_64BIT_OPS */
500
+
501
+#define DUK__DBLUNION_SET_NAN_NOTFULL(u) \
502
+	do { \
509 503
 		(u)->us[DUK_DBL_IDX_US0] = 0x7ff8UL; \
510 504
 	} while (0)
511 505
 
512 506
 #define DUK__DBLUNION_IS_NAN_NOTFULL(u) \
513 507
 	/* E == 0x7ff, topmost four bits of F != 0 => assume NaN */ \
514
-	((((u)->us[DUK_DBL_IDX_US0] & 0x7ff0UL) == 0x7ff0UL) && \
515
-	 (((u)->us[DUK_DBL_IDX_US0] & 0x000fUL) != 0x0000UL))
508
+	((((u)->us[DUK_DBL_IDX_US0] & 0x7ff0UL) == 0x7ff0UL) && (((u)->us[DUK_DBL_IDX_US0] & 0x000fUL) != 0x0000UL))
516 509
 
517 510
 #define DUK__DBLUNION_IS_NORMALIZED_NAN_NOTFULL(u) \
518 511
 	/* E == 0x7ff, F == 8 => normalized NaN */ \
519 512
 	((u)->us[DUK_DBL_IDX_US0] == 0x7ff8UL)
520 513
 
521
-#define DUK__DBLUNION_NORMALIZE_NAN_CHECK_FULL(u)  do { \
514
+#define DUK__DBLUNION_NORMALIZE_NAN_CHECK_FULL(u) \
515
+	do { \
522 516
 		if (DUK__DBLUNION_IS_NAN_FULL((u))) { \
523 517
 			DUK__DBLUNION_SET_NAN_FULL((u)); \
524 518
 		} \
525 519
 	} while (0)
526 520
 
527
-#define DUK__DBLUNION_NORMALIZE_NAN_CHECK_NOTFULL(u)  do { \
521
+#define DUK__DBLUNION_NORMALIZE_NAN_CHECK_NOTFULL(u) \
522
+	do { \
528 523
 		/* Check must be full. */ \
529 524
 		if (DUK__DBLUNION_IS_NAN_FULL((u))) { \
530 525
 			DUK__DBLUNION_SET_NAN_NOTFULL((u)); \
... ...
@@ -538,29 +533,30 @@ typedef union duk_double_union duk_double_union;
538 533
  */
539 534
 
540 535
 #if defined(DUK_USE_PACKED_TVAL)
541
-#define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u)  DUK__DBLUNION_NORMALIZE_NAN_CHECK_FULL((u))
542
-#define DUK_DBLUNION_IS_NAN(u)               DUK__DBLUNION_IS_NAN_FULL((u))
543
-#define DUK_DBLUNION_IS_NORMALIZED_NAN(u)    DUK__DBLUNION_IS_NORMALIZED_NAN_FULL((u))
544
-#define DUK_DBLUNION_SET_NAN(d)              DUK__DBLUNION_SET_NAN_FULL((d))
536
+#define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u) DUK__DBLUNION_NORMALIZE_NAN_CHECK_FULL((u))
537
+#define DUK_DBLUNION_IS_NAN(u)              DUK__DBLUNION_IS_NAN_FULL((u))
538
+#define DUK_DBLUNION_IS_NORMALIZED_NAN(u)   DUK__DBLUNION_IS_NORMALIZED_NAN_FULL((u))
539
+#define DUK_DBLUNION_SET_NAN(d)             DUK__DBLUNION_SET_NAN_FULL((d))
545 540
 #if 0
546
-#define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u)  DUK__DBLUNION_NORMALIZE_NAN_CHECK_NOTFULL((u))
547
-#define DUK_DBLUNION_IS_NAN(u)               DUK__DBLUNION_IS_NAN_NOTFULL((u))
548
-#define DUK_DBLUNION_IS_NORMALIZED_NAN(u)    DUK__DBLUNION_IS_NORMALIZED_NAN_NOTFULL((u))
549
-#define DUK_DBLUNION_SET_NAN(d)              DUK__DBLUNION_SET_NAN_NOTFULL((d))
541
+#define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u) DUK__DBLUNION_NORMALIZE_NAN_CHECK_NOTFULL((u))
542
+#define DUK_DBLUNION_IS_NAN(u)              DUK__DBLUNION_IS_NAN_NOTFULL((u))
543
+#define DUK_DBLUNION_IS_NORMALIZED_NAN(u)   DUK__DBLUNION_IS_NORMALIZED_NAN_NOTFULL((u))
544
+#define DUK_DBLUNION_SET_NAN(d)             DUK__DBLUNION_SET_NAN_NOTFULL((d))
550 545
 #endif
551 546
 #define DUK_DBLUNION_IS_NORMALIZED(u) \
552
-	(!DUK_DBLUNION_IS_NAN((u)) ||  /* either not a NaN */ \
553
-	 DUK_DBLUNION_IS_NORMALIZED_NAN((u)))  /* or is a normalized NaN */
554
-#else  /* DUK_USE_PACKED_TVAL */
555
-#define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u)  /* nop: no need to normalize */
556
-#define DUK_DBLUNION_IS_NAN(u)               DUK__DBLUNION_IS_NAN_FULL((u))  /* (DUK_ISNAN((u)->d)) */
557
-#define DUK_DBLUNION_IS_NORMALIZED_NAN(u)    DUK__DBLUNION_IS_NAN_FULL((u))  /* (DUK_ISNAN((u)->d)) */
558
-#define DUK_DBLUNION_IS_NORMALIZED(u)        1  /* all doubles are considered normalized */
559
-#define DUK_DBLUNION_SET_NAN(u)  do { \
547
+	(!DUK_DBLUNION_IS_NAN((u)) || /* either not a NaN */ \
548
+	 DUK_DBLUNION_IS_NORMALIZED_NAN((u))) /* or is a normalized NaN */
549
+#else /* DUK_USE_PACKED_TVAL */
550
+#define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u) /* nop: no need to normalize */
551
+#define DUK_DBLUNION_IS_NAN(u)              DUK__DBLUNION_IS_NAN_FULL((u)) /* (DUK_ISNAN((u)->d)) */
552
+#define DUK_DBLUNION_IS_NORMALIZED_NAN(u)   DUK__DBLUNION_IS_NAN_FULL((u)) /* (DUK_ISNAN((u)->d)) */
553
+#define DUK_DBLUNION_IS_NORMALIZED(u)       1 /* all doubles are considered normalized */
554
+#define DUK_DBLUNION_SET_NAN(u) \
555
+	do { \
560 556
 		/* in non-packed representation we don't care about which NaN is used */ \
561 557
 		(u)->d = DUK_DOUBLE_NAN; \
562 558
 	} while (0)
563
-#endif  /* DUK_USE_PACKED_TVAL */
559
+#endif /* DUK_USE_PACKED_TVAL */
564 560
 
565 561
 #define DUK_DBLUNION_IS_ANYINF(u) DUK__DBLUNION_IS_ANYINF((u))
566 562
 #define DUK_DBLUNION_IS_POSINF(u) DUK__DBLUNION_IS_POSINF((u))
... ...
@@ -573,7 +569,8 @@ typedef union duk_double_union duk_double_union;
573 569
 /* XXX: native 64-bit byteswaps when available */
574 570
 
575 571
 /* 64-bit byteswap, same operation independent of target endianness. */
576
-#define DUK_DBLUNION_BSWAP64(u) do { \
572
+#define DUK_DBLUNION_BSWAP64(u) \
573
+	do { \
577 574
 		duk_uint32_t duk__bswaptmp1, duk__bswaptmp2; \
578 575
 		duk__bswaptmp1 = (u)->ui[0]; \
579 576
 		duk__bswaptmp2 = (u)->ui[1]; \
... ...
@@ -587,7 +584,8 @@ typedef union duk_double_union duk_double_union;
587 584
  * order.  For a big endian target this is a no-op.
588 585
  */
589 586
 #if defined(DUK_USE_DOUBLE_LE)
590
-#define DUK_DBLUNION_DOUBLE_HTON(u) do { \
587
+#define DUK_DBLUNION_DOUBLE_HTON(u) \
588
+	do { \
591 589
 		duk_uint32_t duk__bswaptmp1, duk__bswaptmp2; \
592 590
 		duk__bswaptmp1 = (u)->ui[0]; \
593 591
 		duk__bswaptmp2 = (u)->ui[1]; \
... ...
@@ -597,7 +595,8 @@ typedef union duk_double_union duk_double_union;
597 595
 		(u)->ui[1] = duk__bswaptmp1; \
598 596
 	} while (0)
599 597
 #elif defined(DUK_USE_DOUBLE_ME)
600
-#define DUK_DBLUNION_DOUBLE_HTON(u) do { \
598
+#define DUK_DBLUNION_DOUBLE_HTON(u) \
599
+	do { \
601 600
 		duk_uint32_t duk__bswaptmp1, duk__bswaptmp2; \
602 601
 		duk__bswaptmp1 = (u)->ui[0]; \
603 602
 		duk__bswaptmp2 = (u)->ui[1]; \
... ...
@@ -607,7 +606,9 @@ typedef union duk_double_union duk_double_union;
607 606
 		(u)->ui[1] = duk__bswaptmp2; \
608 607
 	} while (0)
609 608
 #elif defined(DUK_USE_DOUBLE_BE)
610
-#define DUK_DBLUNION_DOUBLE_HTON(u) do { } while (0)
609
+#define DUK_DBLUNION_DOUBLE_HTON(u) \
610
+	do { \
611
+	} while (0)
611 612
 #else
612 613
 #error internal error, double endianness insane
613 614
 #endif
... ...
@@ -624,7 +625,7 @@ typedef union duk_double_union duk_double_union;
624 625
 #define DUK_DBLUNION_GET_SIGNBIT(u) (((u)->ui[DUK_DBL_IDX_UI0] >> 31U))
625 626
 #endif
626 627
 
627
-#endif  /* DUK_DBLUNION_H_INCLUDED */
628
+#endif /* DUK_DBLUNION_H_INCLUDED */
628 629
 /* #include duk_fltunion.h */
629 630
 #line 1 "duk_fltunion.h"
630 631
 /*
... ...
@@ -646,26 +647,26 @@ union duk_float_union {
646 647
 typedef union duk_float_union duk_float_union;
647 648
 
648 649
 #if defined(DUK_USE_DOUBLE_LE) || defined(DUK_USE_DOUBLE_ME)
649
-#define DUK_FLT_IDX_UI0    0
650
-#define DUK_FLT_IDX_US0    1
651
-#define DUK_FLT_IDX_US1    0
652
-#define DUK_FLT_IDX_UC0    3
653
-#define DUK_FLT_IDX_UC1    2
654
-#define DUK_FLT_IDX_UC2    1
655
-#define DUK_FLT_IDX_UC3    0
650
+#define DUK_FLT_IDX_UI0 0
651
+#define DUK_FLT_IDX_US0 1
652
+#define DUK_FLT_IDX_US1 0
653
+#define DUK_FLT_IDX_UC0 3
654
+#define DUK_FLT_IDX_UC1 2
655
+#define DUK_FLT_IDX_UC2 1
656
+#define DUK_FLT_IDX_UC3 0
656 657
 #elif defined(DUK_USE_DOUBLE_BE)
657
-#define DUK_FLT_IDX_UI0    0
658
-#define DUK_FLT_IDX_US0    0
659
-#define DUK_FLT_IDX_US1    1
660
-#define DUK_FLT_IDX_UC0    0
661
-#define DUK_FLT_IDX_UC1    1
662
-#define DUK_FLT_IDX_UC2    2
663
-#define DUK_FLT_IDX_UC3    3
658
+#define DUK_FLT_IDX_UI0 0
659
+#define DUK_FLT_IDX_US0 0
660
+#define DUK_FLT_IDX_US1 1
661
+#define DUK_FLT_IDX_UC0 0
662
+#define DUK_FLT_IDX_UC1 1
663
+#define DUK_FLT_IDX_UC2 2
664
+#define DUK_FLT_IDX_UC3 3
664 665
 #else
665 666
 #error internal error
666 667
 #endif
667 668
 
668
-#endif  /* DUK_FLTUNION_H_INCLUDED */
669
+#endif /* DUK_FLTUNION_H_INCLUDED */
669 670
 /* #include duk_replacements.h */
670 671
 #line 1 "duk_replacements.h"
671 672
 #if !defined(DUK_REPLACEMENTS_H_INCLUDED)
... ...
@@ -678,7 +679,7 @@ DUK_INTERNAL_DECL double duk_computed_infinity;
678 679
 #if defined(DUK_USE_COMPUTED_NAN)
679 680
 DUK_INTERNAL_DECL double duk_computed_nan;
680 681
 #endif
681
-#endif  /* !DUK_SINGLE_FILE */
682
+#endif /* !DUK_SINGLE_FILE */
682 683
 
683 684
 #if defined(DUK_USE_REPL_FPCLASSIFY)
684 685
 DUK_INTERNAL_DECL int duk_repl_fpclassify(double x);
... ...
@@ -696,7 +697,7 @@ DUK_INTERNAL_DECL int duk_repl_isnan(double x);
696 697
 DUK_INTERNAL_DECL int duk_repl_isinf(double x);
697 698
 #endif
698 699
 
699
-#endif  /* DUK_REPLACEMENTS_H_INCLUDED */
700
+#endif /* DUK_REPLACEMENTS_H_INCLUDED */
700 701
 /* #include duk_jmpbuf.h */
701 702
 #line 1 "duk_jmpbuf.h"
702 703
 /*
... ...
@@ -714,7 +715,7 @@ DUK_INTERNAL_DECL int duk_repl_isinf(double x);
714 715
 
715 716
 #if defined(DUK_USE_CPP_EXCEPTIONS)
716 717
 struct duk_jmpbuf {
717
-	duk_small_int_t dummy;  /* unused */
718
+	duk_small_int_t dummy; /* unused */
718 719
 };
719 720
 #else
720 721
 struct duk_jmpbuf {
... ...
@@ -722,7 +723,7 @@ struct duk_jmpbuf {
722 723
 };
723 724
 #endif
724 725
 
725
-#endif  /* DUK_JMPBUF_H_INCLUDED */
726
+#endif /* DUK_JMPBUF_H_INCLUDED */
726 727
 /* #include duk_exception.h */
727 728
 #line 1 "duk_exception.h"
728 729
 /*
... ...
@@ -749,12 +750,13 @@ class duk_internal_exception {
749 750
  * aware of the "unsafe to continue" semantics.
750 751
  */
751 752
 class duk_fatal_exception : public virtual std::runtime_error {
752
- public:
753
-	duk_fatal_exception(const char *message) : std::runtime_error(message) {}
753
+      public:
754
+	duk_fatal_exception(const char *message) : std::runtime_error(message) {
755
+	}
754 756
 };
755 757
 #endif
756 758
 
757
-#endif  /* DUK_EXCEPTION_H_INCLUDED */
759
+#endif /* DUK_EXCEPTION_H_INCLUDED */
758 760
 /* #include duk_forwdecl.h */
759 761
 #line 1 "duk_forwdecl.h"
760 762
 /*
... ...
@@ -890,7 +892,7 @@ typedef struct duk_compiler_ctx duk_compiler_ctx;
890 892
 typedef struct duk_re_matcher_ctx duk_re_matcher_ctx;
891 893
 typedef struct duk_re_compiler_ctx duk_re_compiler_ctx;
892 894
 
893
-#endif  /* DUK_FORWDECL_H_INCLUDED */
895
+#endif /* DUK_FORWDECL_H_INCLUDED */
894 896
 /* #include duk_tval.h */
895 897
 #line 1 "duk_tval.h"
896 898
 /*
... ...
@@ -936,30 +938,29 @@ typedef struct {
936 938
 } duk_tval_unused;
937 939
 
938 940
 /* tags */
939
-#define DUK_TAG_NORMALIZED_NAN    0x7ff8UL   /* the NaN variant we use */
941
+#define DUK_TAG_NORMALIZED_NAN 0x7ff8UL /* the NaN variant we use */
940 942
 /* avoid tag 0xfff0, no risk of confusion with negative infinity */
941
-#define DUK_TAG_MIN               0xfff1UL
943
+#define DUK_TAG_MIN            0xfff1UL
942 944
 #if defined(DUK_USE_FASTINT)
943
-#define DUK_TAG_FASTINT           0xfff1UL   /* embed: integer value */
945
+#define DUK_TAG_FASTINT 0xfff1UL /* embed: integer value */
944 946
 #endif
945
-#define DUK_TAG_UNUSED            0xfff2UL   /* marker; not actual tagged value */
946
-#define DUK_TAG_UNDEFINED         0xfff3UL   /* embed: nothing */
947
-#define DUK_TAG_NULL              0xfff4UL   /* embed: nothing */
948
-#define DUK_TAG_BOOLEAN           0xfff5UL   /* embed: 0 or 1 (false or true) */
947
+#define DUK_TAG_UNUSED    0xfff2UL /* marker; not actual tagged value */
948
+#define DUK_TAG_UNDEFINED 0xfff3UL /* embed: nothing */
949
+#define DUK_TAG_NULL      0xfff4UL /* embed: nothing */
950
+#define DUK_TAG_BOOLEAN   0xfff5UL /* embed: 0 or 1 (false or true) */
949 951
 /* DUK_TAG_NUMBER would logically go here, but it has multiple 'tags' */
950
-#define DUK_TAG_POINTER           0xfff6UL   /* embed: void ptr */
951
-#define DUK_TAG_LIGHTFUNC         0xfff7UL   /* embed: func ptr */
952
-#define DUK_TAG_STRING            0xfff8UL   /* embed: duk_hstring ptr */
953
-#define DUK_TAG_OBJECT            0xfff9UL   /* embed: duk_hobject ptr */
954
-#define DUK_TAG_BUFFER            0xfffaUL   /* embed: duk_hbuffer ptr */
955
-#define DUK_TAG_MAX               0xfffaUL
952
+#define DUK_TAG_POINTER   0xfff6UL /* embed: void ptr */
953
+#define DUK_TAG_LIGHTFUNC 0xfff7UL /* embed: func ptr */
954
+#define DUK_TAG_STRING    0xfff8UL /* embed: duk_hstring ptr */
955
+#define DUK_TAG_OBJECT    0xfff9UL /* embed: duk_hobject ptr */
956
+#define DUK_TAG_BUFFER    0xfffaUL /* embed: duk_hbuffer ptr */
957
+#define DUK_TAG_MAX       0xfffaUL
956 958
 
957 959
 /* for convenience */
958
-#define DUK_XTAG_BOOLEAN_FALSE    0xfff50000UL
959
-#define DUK_XTAG_BOOLEAN_TRUE     0xfff50001UL
960
+#define DUK_XTAG_BOOLEAN_FALSE 0xfff50000UL
961
+#define DUK_XTAG_BOOLEAN_TRUE  0xfff50001UL
960 962
 
961
-#define DUK_TVAL_IS_VALID_TAG(tv) \
962
-	(DUK_TVAL_GET_TAG((tv)) - DUK_TAG_MIN <= DUK_TAG_MAX - DUK_TAG_MIN)
963
+#define DUK_TVAL_IS_VALID_TAG(tv) (DUK_TVAL_GET_TAG((tv)) - DUK_TAG_MIN <= DUK_TAG_MAX - DUK_TAG_MIN)
963 964
 
964 965
 /* DUK_TVAL_UNUSED initializer for duk_tval_unused, works for any endianness. */
965 966
 #define DUK_TVAL_UNUSED_INITIALIZER() \
... ...
@@ -968,116 +969,136 @@ typedef struct {
968 969
 /* two casts to avoid gcc warning: "warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]" */
969 970
 #if defined(DUK_USE_64BIT_OPS)
970 971
 #if defined(DUK_USE_DOUBLE_ME)
971
-#define DUK__TVAL_SET_TAGGEDPOINTER(tv,h,tag)  do { \
972
+#define DUK__TVAL_SET_TAGGEDPOINTER(tv, h, tag) \
973
+	do { \
972 974
 		(tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) (tag)) << 16) | (((duk_uint64_t) (duk_uint32_t) (h)) << 32); \
973 975
 	} while (0)
974 976
 #else
975
-#define DUK__TVAL_SET_TAGGEDPOINTER(tv,h,tag)  do { \
977
+#define DUK__TVAL_SET_TAGGEDPOINTER(tv, h, tag) \
978
+	do { \
976 979
 		(tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) (tag)) << 48) | ((duk_uint64_t) (duk_uint32_t) (h)); \
977 980
 	} while (0)
978 981
 #endif
979
-#else  /* DUK_USE_64BIT_OPS */
980
-#define DUK__TVAL_SET_TAGGEDPOINTER(tv,h,tag)  do { \
982
+#else /* DUK_USE_64BIT_OPS */
983
+#define DUK__TVAL_SET_TAGGEDPOINTER(tv, h, tag) \
984
+	do { \
981 985
 		duk_tval *duk__tv; \
982 986
 		duk__tv = (tv); \
983 987
 		duk__tv->ui[DUK_DBL_IDX_UI0] = ((duk_uint32_t) (tag)) << 16; \
984 988
 		duk__tv->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) (h); \
985 989
 	} while (0)
986
-#endif  /* DUK_USE_64BIT_OPS */
990
+#endif /* DUK_USE_64BIT_OPS */
987 991
 
988 992
 #if defined(DUK_USE_64BIT_OPS)
989 993
 /* Double casting for pointer to avoid gcc warning (cast from pointer to integer of different size) */
990 994
 #if defined(DUK_USE_DOUBLE_ME)
991
-#define DUK__TVAL_SET_LIGHTFUNC(tv,fp,flags)  do { \
992
-		(tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) DUK_TAG_LIGHTFUNC) << 16) | \
993
-		                              ((duk_uint64_t) (flags)) | \
995
+#define DUK__TVAL_SET_LIGHTFUNC(tv, fp, flags) \
996
+	do { \
997
+		(tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) DUK_TAG_LIGHTFUNC) << 16) | ((duk_uint64_t) (flags)) | \
994 998
 		                              (((duk_uint64_t) (duk_uint32_t) (fp)) << 32); \
995 999
 	} while (0)
996 1000
 #else
997
-#define DUK__TVAL_SET_LIGHTFUNC(tv,fp,flags)  do { \
998
-		(tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) DUK_TAG_LIGHTFUNC) << 48) | \
999
-		                              (((duk_uint64_t) (flags)) << 32) | \
1001
+#define DUK__TVAL_SET_LIGHTFUNC(tv, fp, flags) \
1002
+	do { \
1003
+		(tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) DUK_TAG_LIGHTFUNC) << 48) | (((duk_uint64_t) (flags)) << 32) | \
1000 1004
 		                              ((duk_uint64_t) (duk_uint32_t) (fp)); \
1001 1005
 	} while (0)
1002 1006
 #endif
1003
-#else  /* DUK_USE_64BIT_OPS */
1004
-#define DUK__TVAL_SET_LIGHTFUNC(tv,fp,flags)  do { \
1007
+#else /* DUK_USE_64BIT_OPS */
1008
+#define DUK__TVAL_SET_LIGHTFUNC(tv, fp, flags) \
1009
+	do { \
1005 1010
 		duk_tval *duk__tv; \
1006 1011
 		duk__tv = (tv); \
1007 1012
 		duk__tv->ui[DUK_DBL_IDX_UI0] = (((duk_uint32_t) DUK_TAG_LIGHTFUNC) << 16) | ((duk_uint32_t) (flags)); \
1008 1013
 		duk__tv->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) (fp); \
1009 1014
 	} while (0)
1010
-#endif  /* DUK_USE_64BIT_OPS */
1015
+#endif /* DUK_USE_64BIT_OPS */
1011 1016
 
1012 1017
 #if defined(DUK_USE_FASTINT)
1013 1018
 /* Note: masking is done for 'i' to deal with negative numbers correctly */
1014 1019
 #if defined(DUK_USE_DOUBLE_ME)
1015
-#define DUK__TVAL_SET_I48(tv,i)  do { \
1020
+#define DUK__TVAL_SET_I48(tv, i) \
1021
+	do { \
1016 1022
 		duk_tval *duk__tv; \
1017 1023
 		duk__tv = (tv); \
1018
-		duk__tv->ui[DUK_DBL_IDX_UI0] = ((duk_uint32_t) DUK_TAG_FASTINT) << 16 | (((duk_uint32_t) ((i) >> 32)) & 0x0000ffffUL); \
1024
+		duk__tv->ui[DUK_DBL_IDX_UI0] = \
1025
+		    ((duk_uint32_t) DUK_TAG_FASTINT) << 16 | (((duk_uint32_t) ((i) >> 32)) & 0x0000ffffUL); \
1019 1026
 		duk__tv->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) (i); \
1020 1027
 	} while (0)
1021
-#define DUK__TVAL_SET_U32(tv,i)  do { \
1028
+#define DUK__TVAL_SET_U32(tv, i) \
1029
+	do { \
1022 1030
 		duk_tval *duk__tv; \
1023 1031
 		duk__tv = (tv); \
1024 1032
 		duk__tv->ui[DUK_DBL_IDX_UI0] = ((duk_uint32_t) DUK_TAG_FASTINT) << 16; \
1025 1033
 		duk__tv->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) (i); \
1026 1034
 	} while (0)
1027 1035
 #else
1028
-#define DUK__TVAL_SET_I48(tv,i)  do { \
1029
-		(tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) DUK_TAG_FASTINT) << 48) | (((duk_uint64_t) (i)) & DUK_U64_CONSTANT(0x0000ffffffffffff)); \
1036
+#define DUK__TVAL_SET_I48(tv, i) \
1037
+	do { \
1038
+		(tv)->ull[DUK_DBL_IDX_ULL0] = \
1039
+		    (((duk_uint64_t) DUK_TAG_FASTINT) << 48) | (((duk_uint64_t) (i)) & DUK_U64_CONSTANT(0x0000ffffffffffff)); \
1030 1040
 	} while (0)
1031
-#define DUK__TVAL_SET_U32(tv,i)  do { \
1041
+#define DUK__TVAL_SET_U32(tv, i) \
1042
+	do { \
1032 1043
 		(tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) DUK_TAG_FASTINT) << 48) | (duk_uint64_t) (i); \
1033 1044
 	} while (0)
1034 1045
 #endif
1035 1046
 
1036 1047
 /* This needs to go through a cast because sign extension is needed. */
1037
-#define DUK__TVAL_SET_I32(tv,i)  do { \
1048
+#define DUK__TVAL_SET_I32(tv, i) \
1049
+	do { \
1038 1050
 		duk_int64_t duk__tmp = (duk_int64_t) (i); \
1039 1051
 		DUK_TVAL_SET_I48((tv), duk__tmp); \
1040 1052
 	} while (0)
1041 1053
 
1042 1054
 /* XXX: Clumsy sign extend and masking of 16 topmost bits. */
1043 1055
 #if defined(DUK_USE_DOUBLE_ME)
1044
-#define DUK__TVAL_GET_FASTINT(tv)      (((duk_int64_t) ((((duk_uint64_t) (tv)->ui[DUK_DBL_IDX_UI0]) << 32) | ((duk_uint64_t) (tv)->ui[DUK_DBL_IDX_UI1]))) << 16 >> 16)
1056
+#define DUK__TVAL_GET_FASTINT(tv) \
1057
+	(((duk_int64_t) ((((duk_uint64_t) (tv)->ui[DUK_DBL_IDX_UI0]) << 32) | ((duk_uint64_t) (tv)->ui[DUK_DBL_IDX_UI1]))) \
1058
+	     << 16 >> \
1059
+	 16)
1045 1060
 #else
1046
-#define DUK__TVAL_GET_FASTINT(tv)      ((((duk_int64_t) (tv)->ull[DUK_DBL_IDX_ULL0]) << 16) >> 16)
1061
+#define DUK__TVAL_GET_FASTINT(tv) ((((duk_int64_t) (tv)->ull[DUK_DBL_IDX_ULL0]) << 16) >> 16)
1047 1062
 #endif
1048
-#define DUK__TVAL_GET_FASTINT_U32(tv)  ((tv)->ui[DUK_DBL_IDX_UI1])
1049
-#define DUK__TVAL_GET_FASTINT_I32(tv)  ((duk_int32_t) (tv)->ui[DUK_DBL_IDX_UI1])
1050
-#endif  /* DUK_USE_FASTINT */
1063
+#define DUK__TVAL_GET_FASTINT_U32(tv) ((tv)->ui[DUK_DBL_IDX_UI1])
1064
+#define DUK__TVAL_GET_FASTINT_I32(tv) ((duk_int32_t) (tv)->ui[DUK_DBL_IDX_UI1])
1065
+#endif /* DUK_USE_FASTINT */
1051 1066
 
1052
-#define DUK_TVAL_SET_UNDEFINED(tv)  do { \
1067
+#define DUK_TVAL_SET_UNDEFINED(tv) \
1068
+	do { \
1053 1069
 		(tv)->us[DUK_DBL_IDX_US0] = (duk_uint16_t) DUK_TAG_UNDEFINED; \
1054 1070
 	} while (0)
1055
-#define DUK_TVAL_SET_UNUSED(tv)  do { \
1071
+#define DUK_TVAL_SET_UNUSED(tv) \
1072
+	do { \
1056 1073
 		(tv)->us[DUK_DBL_IDX_US0] = (duk_uint16_t) DUK_TAG_UNUSED; \
1057 1074
 	} while (0)
1058
-#define DUK_TVAL_SET_NULL(tv)  do { \
1075
+#define DUK_TVAL_SET_NULL(tv) \
1076
+	do { \
1059 1077
 		(tv)->us[DUK_DBL_IDX_US0] = (duk_uint16_t) DUK_TAG_NULL; \
1060 1078
 	} while (0)
1061 1079
 
1062
-#define DUK_TVAL_SET_BOOLEAN(tv,val)         DUK_DBLUNION_SET_HIGH32((tv), (((duk_uint32_t) DUK_TAG_BOOLEAN) << 16) | ((duk_uint32_t) (val)))
1080
+#define DUK_TVAL_SET_BOOLEAN(tv, val) \
1081
+	DUK_DBLUNION_SET_HIGH32((tv), (((duk_uint32_t) DUK_TAG_BOOLEAN) << 16) | ((duk_uint32_t) (val)))
1063 1082
 
1064
-#define DUK_TVAL_SET_NAN(tv)                 DUK_DBLUNION_SET_NAN_FULL((tv))
1083
+#define DUK_TVAL_SET_NAN(tv) DUK_DBLUNION_SET_NAN_FULL((tv))
1065 1084
 
1066 1085
 /* Assumes that caller has normalized NaNs, otherwise trouble ahead. */
1067 1086
 #if defined(DUK_USE_FASTINT)
1068
-#define DUK_TVAL_SET_DOUBLE(tv,d)  do { \
1087
+#define DUK_TVAL_SET_DOUBLE(tv, d) \
1088
+	do { \
1069 1089
 		duk_double_t duk__dblval; \
1070 1090
 		duk__dblval = (d); \
1071 1091
 		DUK_ASSERT_DOUBLE_IS_NORMALIZED(duk__dblval); \
1072 1092
 		DUK_DBLUNION_SET_DOUBLE((tv), duk__dblval); \
1073 1093
 	} while (0)
1074
-#define DUK_TVAL_SET_I48(tv,i)               DUK__TVAL_SET_I48((tv), (i))
1075
-#define DUK_TVAL_SET_I32(tv,i)               DUK__TVAL_SET_I32((tv), (i))
1076
-#define DUK_TVAL_SET_U32(tv,i)               DUK__TVAL_SET_U32((tv), (i))
1077
-#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv,d)  duk_tval_set_number_chkfast_fast((tv), (d))
1078
-#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv,d)  duk_tval_set_number_chkfast_slow((tv), (d))
1079
-#define DUK_TVAL_SET_NUMBER(tv,d)            DUK_TVAL_SET_DOUBLE((tv), (d))
1080
-#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv)  do { \
1094
+#define DUK_TVAL_SET_I48(tv, i)                 DUK__TVAL_SET_I48((tv), (i))
1095
+#define DUK_TVAL_SET_I32(tv, i)                 DUK__TVAL_SET_I32((tv), (i))
1096
+#define DUK_TVAL_SET_U32(tv, i)                 DUK__TVAL_SET_U32((tv), (i))
1097
+#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv, d) duk_tval_set_number_chkfast_fast((tv), (d))
1098
+#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv, d) duk_tval_set_number_chkfast_slow((tv), (d))
1099
+#define DUK_TVAL_SET_NUMBER(tv, d)              DUK_TVAL_SET_DOUBLE((tv), (d))
1100
+#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv) \
1101
+	do { \
1081 1102
 		duk_tval *duk__tv; \
1082 1103
 		duk_double_t duk__d; \
1083 1104
 		duk__tv = (tv); \
... ...
@@ -1086,7 +1107,8 @@ typedef struct {
1086 1107
 			DUK_TVAL_SET_NUMBER_CHKFAST_FAST(duk__tv, duk__d); \
1087 1108
 		} \
1088 1109
 	} while (0)
1089
-#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv)  do { \
1110
+#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv) \
1111
+	do { \
1090 1112
 		duk_tval *duk__tv; \
1091 1113
 		duk_double_t duk__d; \
1092 1114
 		duk__tv = (tv); \
... ...
@@ -1095,89 +1117,98 @@ typedef struct {
1095 1117
 			DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(duk__tv, duk__d); \
1096 1118
 		} \
1097 1119
 	} while (0)
1098
-#else  /* DUK_USE_FASTINT */
1099
-#define DUK_TVAL_SET_DOUBLE(tv,d)  do { \
1120
+#else /* DUK_USE_FASTINT */
1121
+#define DUK_TVAL_SET_DOUBLE(tv, d) \
1122
+	do { \
1100 1123
 		duk_double_t duk__dblval; \
1101 1124
 		duk__dblval = (d); \
1102 1125
 		DUK_ASSERT_DOUBLE_IS_NORMALIZED(duk__dblval); \
1103 1126
 		DUK_DBLUNION_SET_DOUBLE((tv), duk__dblval); \
1104 1127
 	} while (0)
1105
-#define DUK_TVAL_SET_I48(tv,i)               DUK_TVAL_SET_DOUBLE((tv), (duk_double_t) (i))  /* XXX: fast int-to-double */
1106
-#define DUK_TVAL_SET_I32(tv,i)               DUK_TVAL_SET_DOUBLE((tv), (duk_double_t) (i))
1107
-#define DUK_TVAL_SET_U32(tv,i)               DUK_TVAL_SET_DOUBLE((tv), (duk_double_t) (i))
1108
-#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv,d)    DUK_TVAL_SET_DOUBLE((tv), (d))
1109
-#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv,d)    DUK_TVAL_SET_DOUBLE((tv), (d))
1110
-#define DUK_TVAL_SET_NUMBER(tv,d)            DUK_TVAL_SET_DOUBLE((tv), (d))
1111
-#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv)  do { } while (0)
1112
-#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv)  do { } while (0)
1113
-#endif  /* DUK_USE_FASTINT */
1114
-
1115
-#define DUK_TVAL_SET_FASTINT(tv,i)           DUK_TVAL_SET_I48((tv), (i))  /* alias */
1116
-
1117
-#define DUK_TVAL_SET_LIGHTFUNC(tv,fp,flags)  DUK__TVAL_SET_LIGHTFUNC((tv), (fp), (flags))
1118
-#define DUK_TVAL_SET_STRING(tv,h)            DUK__TVAL_SET_TAGGEDPOINTER((tv), (h), DUK_TAG_STRING)
1119
-#define DUK_TVAL_SET_OBJECT(tv,h)            DUK__TVAL_SET_TAGGEDPOINTER((tv), (h), DUK_TAG_OBJECT)
1120
-#define DUK_TVAL_SET_BUFFER(tv,h)            DUK__TVAL_SET_TAGGEDPOINTER((tv), (h), DUK_TAG_BUFFER)
1121
-#define DUK_TVAL_SET_POINTER(tv,p)           DUK__TVAL_SET_TAGGEDPOINTER((tv), (p), DUK_TAG_POINTER)
1122
-
1123
-#define DUK_TVAL_SET_TVAL(tv,x)              do { *(tv) = *(x); } while (0)
1128
+#define DUK_TVAL_SET_I48(tv, i)                 DUK_TVAL_SET_DOUBLE((tv), (duk_double_t) (i)) /* XXX: fast int-to-double */
1129
+#define DUK_TVAL_SET_I32(tv, i)                 DUK_TVAL_SET_DOUBLE((tv), (duk_double_t) (i))
1130
+#define DUK_TVAL_SET_U32(tv, i)                 DUK_TVAL_SET_DOUBLE((tv), (duk_double_t) (i))
1131
+#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv, d) DUK_TVAL_SET_DOUBLE((tv), (d))
1132
+#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv, d) DUK_TVAL_SET_DOUBLE((tv), (d))
1133
+#define DUK_TVAL_SET_NUMBER(tv, d)              DUK_TVAL_SET_DOUBLE((tv), (d))
1134
+#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv) \
1135
+	do { \
1136
+	} while (0)
1137
+#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv) \
1138
+	do { \
1139
+	} while (0)
1140
+#endif /* DUK_USE_FASTINT */
1141
+
1142
+#define DUK_TVAL_SET_FASTINT(tv, i) DUK_TVAL_SET_I48((tv), (i)) /* alias */
1143
+
1144
+#define DUK_TVAL_SET_LIGHTFUNC(tv, fp, flags) DUK__TVAL_SET_LIGHTFUNC((tv), (fp), (flags))
1145
+#define DUK_TVAL_SET_STRING(tv, h)            DUK__TVAL_SET_TAGGEDPOINTER((tv), (h), DUK_TAG_STRING)
1146
+#define DUK_TVAL_SET_OBJECT(tv, h)            DUK__TVAL_SET_TAGGEDPOINTER((tv), (h), DUK_TAG_OBJECT)
1147
+#define DUK_TVAL_SET_BUFFER(tv, h)            DUK__TVAL_SET_TAGGEDPOINTER((tv), (h), DUK_TAG_BUFFER)
1148
+#define DUK_TVAL_SET_POINTER(tv, p)           DUK__TVAL_SET_TAGGEDPOINTER((tv), (p), DUK_TAG_POINTER)
1149
+
1150
+#define DUK_TVAL_SET_TVAL(tv, x) \
1151
+	do { \
1152
+		*(tv) = *(x); \
1153
+	} while (0)
1124 1154
 
1125 1155
 /* getters */
1126
-#define DUK_TVAL_GET_BOOLEAN(tv)             ((duk_small_uint_t) (tv)->us[DUK_DBL_IDX_US1])
1156
+#define DUK_TVAL_GET_BOOLEAN(tv) ((duk_small_uint_t) (tv)->us[DUK_DBL_IDX_US1])
1127 1157
 #if defined(DUK_USE_FASTINT)
1128
-#define DUK_TVAL_GET_DOUBLE(tv)              ((tv)->d)
1129
-#define DUK_TVAL_GET_FASTINT(tv)             DUK__TVAL_GET_FASTINT((tv))
1130
-#define DUK_TVAL_GET_FASTINT_U32(tv)         DUK__TVAL_GET_FASTINT_U32((tv))
1131
-#define DUK_TVAL_GET_FASTINT_I32(tv)         DUK__TVAL_GET_FASTINT_I32((tv))
1132
-#define DUK_TVAL_GET_NUMBER(tv)              duk_tval_get_number_packed((tv))
1158
+#define DUK_TVAL_GET_DOUBLE(tv)      ((tv)->d)
1159
+#define DUK_TVAL_GET_FASTINT(tv)     DUK__TVAL_GET_FASTINT((tv))
1160
+#define DUK_TVAL_GET_FASTINT_U32(tv) DUK__TVAL_GET_FASTINT_U32((tv))
1161
+#define DUK_TVAL_GET_FASTINT_I32(tv) DUK__TVAL_GET_FASTINT_I32((tv))
1162
+#define DUK_TVAL_GET_NUMBER(tv)      duk_tval_get_number_packed((tv))
1133 1163
 #else
1134
-#define DUK_TVAL_GET_NUMBER(tv)              ((tv)->d)
1135
-#define DUK_TVAL_GET_DOUBLE(tv)              ((tv)->d)
1164
+#define DUK_TVAL_GET_NUMBER(tv) ((tv)->d)
1165
+#define DUK_TVAL_GET_DOUBLE(tv) ((tv)->d)
1136 1166
 #endif
1137
-#define DUK_TVAL_GET_LIGHTFUNC(tv,out_fp,out_flags)  do { \
1167
+#define DUK_TVAL_GET_LIGHTFUNC(tv, out_fp, out_flags) \
1168
+	do { \
1138 1169
 		(out_flags) = (tv)->ui[DUK_DBL_IDX_UI0] & 0xffffUL; \
1139 1170
 		(out_fp) = (duk_c_function) (tv)->ui[DUK_DBL_IDX_UI1]; \
1140 1171
 	} while (0)
1141
-#define DUK_TVAL_GET_LIGHTFUNC_FUNCPTR(tv)   ((duk_c_function) ((tv)->ui[DUK_DBL_IDX_UI1]))
1142
-#define DUK_TVAL_GET_LIGHTFUNC_FLAGS(tv)     (((duk_small_uint_t) (tv)->ui[DUK_DBL_IDX_UI0]) & 0xffffUL)
1143
-#define DUK_TVAL_GET_STRING(tv)              ((duk_hstring *) (tv)->vp[DUK_DBL_IDX_VP1])
1144
-#define DUK_TVAL_GET_OBJECT(tv)              ((duk_hobject *) (tv)->vp[DUK_DBL_IDX_VP1])
1145
-#define DUK_TVAL_GET_BUFFER(tv)              ((duk_hbuffer *) (tv)->vp[DUK_DBL_IDX_VP1])
1146
-#define DUK_TVAL_GET_POINTER(tv)             ((void *) (tv)->vp[DUK_DBL_IDX_VP1])
1147
-#define DUK_TVAL_GET_HEAPHDR(tv)             ((duk_heaphdr *) (tv)->vp[DUK_DBL_IDX_VP1])
1172
+#define DUK_TVAL_GET_LIGHTFUNC_FUNCPTR(tv) ((duk_c_function) ((tv)->ui[DUK_DBL_IDX_UI1]))
1173
+#define DUK_TVAL_GET_LIGHTFUNC_FLAGS(tv)   (((duk_small_uint_t) (tv)->ui[DUK_DBL_IDX_UI0]) & 0xffffUL)
1174
+#define DUK_TVAL_GET_STRING(tv)            ((duk_hstring *) (tv)->vp[DUK_DBL_IDX_VP1])
1175
+#define DUK_TVAL_GET_OBJECT(tv)            ((duk_hobject *) (tv)->vp[DUK_DBL_IDX_VP1])
1176
+#define DUK_TVAL_GET_BUFFER(tv)            ((duk_hbuffer *) (tv)->vp[DUK_DBL_IDX_VP1])
1177
+#define DUK_TVAL_GET_POINTER(tv)           ((void *) (tv)->vp[DUK_DBL_IDX_VP1])
1178
+#define DUK_TVAL_GET_HEAPHDR(tv)           ((duk_heaphdr *) (tv)->vp[DUK_DBL_IDX_VP1])
1148 1179
 
1149 1180
 /* decoding */
1150
-#define DUK_TVAL_GET_TAG(tv)                 ((duk_small_uint_t) (tv)->us[DUK_DBL_IDX_US0])
1151
-
1152
-#define DUK_TVAL_IS_UNDEFINED(tv)            (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_UNDEFINED)
1153
-#define DUK_TVAL_IS_UNUSED(tv)               (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_UNUSED)
1154
-#define DUK_TVAL_IS_NULL(tv)                 (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_NULL)
1155
-#define DUK_TVAL_IS_BOOLEAN(tv)              (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_BOOLEAN)
1156
-#define DUK_TVAL_IS_BOOLEAN_TRUE(tv)         ((tv)->ui[DUK_DBL_IDX_UI0] == DUK_XTAG_BOOLEAN_TRUE)
1157
-#define DUK_TVAL_IS_BOOLEAN_FALSE(tv)        ((tv)->ui[DUK_DBL_IDX_UI0] == DUK_XTAG_BOOLEAN_FALSE)
1158
-#define DUK_TVAL_IS_LIGHTFUNC(tv)            (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_LIGHTFUNC)
1159
-#define DUK_TVAL_IS_STRING(tv)               (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_STRING)
1160
-#define DUK_TVAL_IS_OBJECT(tv)               (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_OBJECT)
1161
-#define DUK_TVAL_IS_BUFFER(tv)               (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_BUFFER)
1162
-#define DUK_TVAL_IS_POINTER(tv)              (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_POINTER)
1181
+#define DUK_TVAL_GET_TAG(tv) ((duk_small_uint_t) (tv)->us[DUK_DBL_IDX_US0])
1182
+
1183
+#define DUK_TVAL_IS_UNDEFINED(tv)     (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_UNDEFINED)
1184
+#define DUK_TVAL_IS_UNUSED(tv)        (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_UNUSED)
1185
+#define DUK_TVAL_IS_NULL(tv)          (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_NULL)
1186
+#define DUK_TVAL_IS_BOOLEAN(tv)       (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_BOOLEAN)
1187
+#define DUK_TVAL_IS_BOOLEAN_TRUE(tv)  ((tv)->ui[DUK_DBL_IDX_UI0] == DUK_XTAG_BOOLEAN_TRUE)
1188
+#define DUK_TVAL_IS_BOOLEAN_FALSE(tv) ((tv)->ui[DUK_DBL_IDX_UI0] == DUK_XTAG_BOOLEAN_FALSE)
1189
+#define DUK_TVAL_IS_LIGHTFUNC(tv)     (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_LIGHTFUNC)
1190
+#define DUK_TVAL_IS_STRING(tv)        (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_STRING)
1191
+#define DUK_TVAL_IS_OBJECT(tv)        (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_OBJECT)
1192
+#define DUK_TVAL_IS_BUFFER(tv)        (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_BUFFER)
1193
+#define DUK_TVAL_IS_POINTER(tv)       (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_POINTER)
1163 1194
 #if defined(DUK_USE_FASTINT)
1164 1195
 /* 0xfff0 is -Infinity */
1165
-#define DUK_TVAL_IS_DOUBLE(tv)               (DUK_TVAL_GET_TAG((tv)) <= 0xfff0UL)
1166
-#define DUK_TVAL_IS_FASTINT(tv)              (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_FASTINT)
1167
-#define DUK_TVAL_IS_NUMBER(tv)               (DUK_TVAL_GET_TAG((tv)) <= 0xfff1UL)
1196
+#define DUK_TVAL_IS_DOUBLE(tv)  (DUK_TVAL_GET_TAG((tv)) <= 0xfff0UL)
1197
+#define DUK_TVAL_IS_FASTINT(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_FASTINT)
1198
+#define DUK_TVAL_IS_NUMBER(tv)  (DUK_TVAL_GET_TAG((tv)) <= 0xfff1UL)
1168 1199
 #else
1169
-#define DUK_TVAL_IS_NUMBER(tv)               (DUK_TVAL_GET_TAG((tv)) <= 0xfff0UL)
1170
-#define DUK_TVAL_IS_DOUBLE(tv)               DUK_TVAL_IS_NUMBER((tv))
1200
+#define DUK_TVAL_IS_NUMBER(tv) (DUK_TVAL_GET_TAG((tv)) <= 0xfff0UL)
1201
+#define DUK_TVAL_IS_DOUBLE(tv) DUK_TVAL_IS_NUMBER((tv))
1171 1202
 #endif
1172 1203
 
1173 1204
 /* This is performance critical because it appears in every DECREF. */
1174
-#define DUK_TVAL_IS_HEAP_ALLOCATED(tv)       (DUK_TVAL_GET_TAG((tv)) >= DUK_TAG_STRING)
1205
+#define DUK_TVAL_IS_HEAP_ALLOCATED(tv) (DUK_TVAL_GET_TAG((tv)) >= DUK_TAG_STRING)
1175 1206
 
1176 1207
 #if defined(DUK_USE_FASTINT)
1177 1208
 DUK_INTERNAL_DECL duk_double_t duk_tval_get_number_packed(duk_tval *tv);
1178 1209
 #endif
1179 1210
 
1180
-#else  /* DUK_USE_PACKED_TVAL */
1211
+#else /* DUK_USE_PACKED_TVAL */
1181 1212
 /* ======================================================================== */
1182 1213
 
1183 1214
 /*
... ...
@@ -1201,7 +1232,7 @@ struct duk_tval_struct {
1201 1232
 		duk_double_t d;
1202 1233
 		duk_small_int_t i;
1203 1234
 #if defined(DUK_USE_FASTINT)
1204
-		duk_int64_t fi;  /* if present, forces 16-byte duk_tval */
1235
+		duk_int64_t fi; /* if present, forces 16-byte duk_tval */
1205 1236
 #endif
1206 1237
 		void *voidptr;
1207 1238
 		duk_hstring *hstring;
... ...
@@ -1229,24 +1260,23 @@ typedef struct {
1229 1260
 #define DUK_TVAL_UNUSED_INITIALIZER() \
1230 1261
 	{ DUK_TAG_UNUSED, 0, 0.0 }
1231 1262
 
1232
-#define DUK_TAG_MIN                   0
1233
-#define DUK_TAG_NUMBER                0  /* DUK_TAG_NUMBER only defined for non-packed duk_tval */
1263
+#define DUK_TAG_MIN    0
1264
+#define DUK_TAG_NUMBER 0 /* DUK_TAG_NUMBER only defined for non-packed duk_tval */
1234 1265
 #if defined(DUK_USE_FASTINT)
1235
-#define DUK_TAG_FASTINT               1
1236
-#endif
1237
-#define DUK_TAG_UNDEFINED             2
1238
-#define DUK_TAG_NULL                  3
1239
-#define DUK_TAG_BOOLEAN               4
1240
-#define DUK_TAG_POINTER               5
1241
-#define DUK_TAG_LIGHTFUNC             6
1242
-#define DUK_TAG_UNUSED                7  /* marker; not actual tagged type */
1243
-#define DUK_TAG_STRING                8  /* first heap allocated, match bit boundary */
1244
-#define DUK_TAG_OBJECT                9
1245
-#define DUK_TAG_BUFFER                10
1246
-#define DUK_TAG_MAX                   10
1247
-
1248
-#define DUK_TVAL_IS_VALID_TAG(tv) \
1249
-	(DUK_TVAL_GET_TAG((tv)) - DUK_TAG_MIN <= DUK_TAG_MAX - DUK_TAG_MIN)
1266
+#define DUK_TAG_FASTINT 1
1267
+#endif
1268
+#define DUK_TAG_UNDEFINED 2
1269
+#define DUK_TAG_NULL      3
1270
+#define DUK_TAG_BOOLEAN   4
1271
+#define DUK_TAG_POINTER   5
1272
+#define DUK_TAG_LIGHTFUNC 6
1273
+#define DUK_TAG_UNUSED    7 /* marker; not actual tagged type */
1274
+#define DUK_TAG_STRING    8 /* first heap allocated, match bit boundary */
1275
+#define DUK_TAG_OBJECT    9
1276
+#define DUK_TAG_BUFFER    10
1277
+#define DUK_TAG_MAX       10
1278
+
1279
+#define DUK_TVAL_IS_VALID_TAG(tv) (DUK_TVAL_GET_TAG((tv)) - DUK_TAG_MIN <= DUK_TAG_MAX - DUK_TAG_MIN)
1250 1280
 
1251 1281
 /* DUK_TAG_NUMBER is intentionally first, as it is the default clause in code
1252 1282
  * to support the 8-byte representation.  Further, it is a non-heap-allocated
... ...
@@ -1255,25 +1285,29 @@ typedef struct {
1255 1285
  */
1256 1286
 
1257 1287
 /* setters */
1258
-#define DUK_TVAL_SET_UNDEFINED(tv)  do { \
1288
+#define DUK_TVAL_SET_UNDEFINED(tv) \
1289
+	do { \
1259 1290
 		duk_tval *duk__tv; \
1260 1291
 		duk__tv = (tv); \
1261 1292
 		duk__tv->t = DUK_TAG_UNDEFINED; \
1262 1293
 	} while (0)
1263 1294
 
1264
-#define DUK_TVAL_SET_UNUSED(tv)  do { \
1295
+#define DUK_TVAL_SET_UNUSED(tv) \
1296
+	do { \
1265 1297
 		duk_tval *duk__tv; \
1266 1298
 		duk__tv = (tv); \
1267 1299
 		duk__tv->t = DUK_TAG_UNUSED; \
1268 1300
 	} while (0)
1269 1301
 
1270
-#define DUK_TVAL_SET_NULL(tv)  do { \
1302
+#define DUK_TVAL_SET_NULL(tv) \
1303
+	do { \
1271 1304
 		duk_tval *duk__tv; \
1272 1305
 		duk__tv = (tv); \
1273 1306
 		duk__tv->t = DUK_TAG_NULL; \
1274 1307
 	} while (0)
1275 1308
 
1276
-#define DUK_TVAL_SET_BOOLEAN(tv,val)  do { \
1309
+#define DUK_TVAL_SET_BOOLEAN(tv, val) \
1310
+	do { \
1277 1311
 		duk_tval *duk__tv; \
1278 1312
 		duk__tv = (tv); \
1279 1313
 		duk__tv->t = DUK_TAG_BOOLEAN; \
... ...
@@ -1281,7 +1315,8 @@ typedef struct {
1281 1315
 	} while (0)
1282 1316
 
1283 1317
 #if defined(DUK_USE_FASTINT)
1284
-#define DUK_TVAL_SET_DOUBLE(tv,val)  do { \
1318
+#define DUK_TVAL_SET_DOUBLE(tv, val) \
1319
+	do { \
1285 1320
 		duk_tval *duk__tv; \
1286 1321
 		duk_double_t duk__dblval; \
1287 1322
 		duk__dblval = (val); \
... ...
@@ -1290,31 +1325,32 @@ typedef struct {
1290 1325
 		duk__tv->t = DUK_TAG_NUMBER; \
1291 1326
 		duk__tv->v.d = duk__dblval; \
1292 1327
 	} while (0)
1293
-#define DUK_TVAL_SET_I48(tv,val)  do { \
1328
+#define DUK_TVAL_SET_I48(tv, val) \
1329
+	do { \
1294 1330
 		duk_tval *duk__tv; \
1295 1331
 		duk__tv = (tv); \
1296 1332
 		duk__tv->t = DUK_TAG_FASTINT; \
1297 1333
 		duk__tv->v.fi = (val); \
1298 1334
 	} while (0)
1299
-#define DUK_TVAL_SET_U32(tv,val)  do { \
1335
+#define DUK_TVAL_SET_U32(tv, val) \
1336
+	do { \
1300 1337
 		duk_tval *duk__tv; \
1301 1338
 		duk__tv = (tv); \
1302 1339
 		duk__tv->t = DUK_TAG_FASTINT; \
1303 1340
 		duk__tv->v.fi = (duk_int64_t) (val); \
1304 1341
 	} while (0)
1305
-#define DUK_TVAL_SET_I32(tv,val)  do { \
1342
+#define DUK_TVAL_SET_I32(tv, val) \
1343
+	do { \
1306 1344
 		duk_tval *duk__tv; \
1307 1345
 		duk__tv = (tv); \
1308 1346
 		duk__tv->t = DUK_TAG_FASTINT; \
1309 1347
 		duk__tv->v.fi = (duk_int64_t) (val); \
1310 1348
 	} while (0)
1311
-#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv,d) \
1312
-	duk_tval_set_number_chkfast_fast((tv), (d))
1313
-#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv,d) \
1314
-	duk_tval_set_number_chkfast_slow((tv), (d))
1315
-#define DUK_TVAL_SET_NUMBER(tv,val) \
1316
-	DUK_TVAL_SET_DOUBLE((tv), (val))
1317
-#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv)  do { \
1349
+#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv, d) duk_tval_set_number_chkfast_fast((tv), (d))
1350
+#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv, d) duk_tval_set_number_chkfast_slow((tv), (d))
1351
+#define DUK_TVAL_SET_NUMBER(tv, val)            DUK_TVAL_SET_DOUBLE((tv), (val))
1352
+#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv) \
1353
+	do { \
1318 1354
 		duk_tval *duk__tv; \
1319 1355
 		duk_double_t duk__d; \
1320 1356
 		duk__tv = (tv); \
... ...
@@ -1323,7 +1359,8 @@ typedef struct {
1323 1359
 			DUK_TVAL_SET_NUMBER_CHKFAST_FAST(duk__tv, duk__d); \
1324 1360
 		} \
1325 1361
 	} while (0)
1326
-#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv)  do { \
1362
+#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv) \
1363
+	do { \
1327 1364
 		duk_tval *duk__tv; \
1328 1365
 		duk_double_t duk__d; \
1329 1366
 		duk__tv = (tv); \
... ...
@@ -1332,16 +1369,13 @@ typedef struct {
1332 1369
 			DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(duk__tv, duk__d); \
1333 1370
 		} \
1334 1371
 	} while (0)
1335
-#else  /* DUK_USE_FASTINT */
1336
-#define DUK_TVAL_SET_DOUBLE(tv,d) \
1337
-	DUK_TVAL_SET_NUMBER((tv), (d))
1338
-#define DUK_TVAL_SET_I48(tv,val) \
1339
-	DUK_TVAL_SET_NUMBER((tv), (duk_double_t) (val))  /* XXX: fast int-to-double */
1340
-#define DUK_TVAL_SET_U32(tv,val) \
1341
-	DUK_TVAL_SET_NUMBER((tv), (duk_double_t) (val))
1342
-#define DUK_TVAL_SET_I32(tv,val) \
1343
-	DUK_TVAL_SET_NUMBER((tv), (duk_double_t) (val))
1344
-#define DUK_TVAL_SET_NUMBER(tv,val)  do { \
1372
+#else /* DUK_USE_FASTINT */
1373
+#define DUK_TVAL_SET_DOUBLE(tv, d) DUK_TVAL_SET_NUMBER((tv), (d))
1374
+#define DUK_TVAL_SET_I48(tv, val)  DUK_TVAL_SET_NUMBER((tv), (duk_double_t) (val)) /* XXX: fast int-to-double */
1375
+#define DUK_TVAL_SET_U32(tv, val)  DUK_TVAL_SET_NUMBER((tv), (duk_double_t) (val))
1376
+#define DUK_TVAL_SET_I32(tv, val)  DUK_TVAL_SET_NUMBER((tv), (duk_double_t) (val))
1377
+#define DUK_TVAL_SET_NUMBER(tv, val) \
1378
+	do { \
1345 1379
 		duk_tval *duk__tv; \
1346 1380
 		duk_double_t duk__dblval; \
1347 1381
 		duk__dblval = (val); \
... ...
@@ -1350,25 +1384,28 @@ typedef struct {
1350 1384
 		duk__tv->t = DUK_TAG_NUMBER; \
1351 1385
 		duk__tv->v.d = duk__dblval; \
1352 1386
 	} while (0)
1353
-#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv,d) \
1354
-	DUK_TVAL_SET_NUMBER((tv), (d))
1355
-#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv,d) \
1356
-	DUK_TVAL_SET_NUMBER((tv), (d))
1357
-#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv)  do { } while (0)
1358
-#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv)  do { } while (0)
1359
-#endif  /* DUK_USE_FASTINT */
1360
-
1361
-#define DUK_TVAL_SET_FASTINT(tv,i) \
1362
-	DUK_TVAL_SET_I48((tv), (i))  /* alias */
1363
-
1364
-#define DUK_TVAL_SET_POINTER(tv,hptr)  do { \
1387
+#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv, d) DUK_TVAL_SET_NUMBER((tv), (d))
1388
+#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv, d) DUK_TVAL_SET_NUMBER((tv), (d))
1389
+#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv) \
1390
+	do { \
1391
+	} while (0)
1392
+#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv) \
1393
+	do { \
1394
+	} while (0)
1395
+#endif /* DUK_USE_FASTINT */
1396
+
1397
+#define DUK_TVAL_SET_FASTINT(tv, i) DUK_TVAL_SET_I48((tv), (i)) /* alias */
1398
+
1399
+#define DUK_TVAL_SET_POINTER(tv, hptr) \
1400
+	do { \
1365 1401
 		duk_tval *duk__tv; \
1366 1402
 		duk__tv = (tv); \
1367 1403
 		duk__tv->t = DUK_TAG_POINTER; \
1368 1404
 		duk__tv->v.voidptr = (hptr); \
1369 1405
 	} while (0)
1370 1406
 
1371
-#define DUK_TVAL_SET_LIGHTFUNC(tv,fp,flags)  do { \
1407
+#define DUK_TVAL_SET_LIGHTFUNC(tv, fp, flags) \
1408
+	do { \
1372 1409
 		duk_tval *duk__tv; \
1373 1410
 		duk__tv = (tv); \
1374 1411
 		duk__tv->t = DUK_TAG_LIGHTFUNC; \
... ...
@@ -1376,28 +1413,32 @@ typedef struct {
1376 1413
 		duk__tv->v.lightfunc = (duk_c_function) (fp); \
1377 1414
 	} while (0)
1378 1415
 
1379
-#define DUK_TVAL_SET_STRING(tv,hptr)  do { \
1416
+#define DUK_TVAL_SET_STRING(tv, hptr) \
1417
+	do { \
1380 1418
 		duk_tval *duk__tv; \
1381 1419
 		duk__tv = (tv); \
1382 1420
 		duk__tv->t = DUK_TAG_STRING; \
1383 1421
 		duk__tv->v.hstring = (hptr); \
1384 1422
 	} while (0)
1385 1423
 
1386
-#define DUK_TVAL_SET_OBJECT(tv,hptr)  do { \
1424
+#define DUK_TVAL_SET_OBJECT(tv, hptr) \
1425
+	do { \
1387 1426
 		duk_tval *duk__tv; \
1388 1427
 		duk__tv = (tv); \
1389 1428
 		duk__tv->t = DUK_TAG_OBJECT; \
1390 1429
 		duk__tv->v.hobject = (hptr); \
1391 1430
 	} while (0)
1392 1431
 
1393
-#define DUK_TVAL_SET_BUFFER(tv,hptr)  do { \
1432
+#define DUK_TVAL_SET_BUFFER(tv, hptr) \
1433
+	do { \
1394 1434
 		duk_tval *duk__tv; \
1395 1435
 		duk__tv = (tv); \
1396 1436
 		duk__tv->t = DUK_TAG_BUFFER; \
1397 1437
 		duk__tv->v.hbuffer = (hptr); \
1398 1438
 	} while (0)
1399 1439
 
1400
-#define DUK_TVAL_SET_NAN(tv)  do { \
1440
+#define DUK_TVAL_SET_NAN(tv) \
1441
+	do { \
1401 1442
 		/* in non-packed representation we don't care about which NaN is used */ \
1402 1443
 		duk_tval *duk__tv; \
1403 1444
 		duk__tv = (tv); \
... ...
@@ -1405,32 +1446,32 @@ typedef struct {
1405 1446
 		duk__tv->v.d = DUK_DOUBLE_NAN; \
1406 1447
 	} while (0)
1407 1448
 
1408
-#define DUK_TVAL_SET_TVAL(tv,x)            do { *(tv) = *(x); } while (0)
1449
+#define DUK_TVAL_SET_TVAL(tv, x) \
1450
+	do { \
1451
+		*(tv) = *(x); \
1452
+	} while (0)
1409 1453
 
1410 1454
 /* getters */
1411
-#define DUK_TVAL_GET_BOOLEAN(tv)           ((duk_small_uint_t) (tv)->v.i)
1455
+#define DUK_TVAL_GET_BOOLEAN(tv) ((duk_small_uint_t) (tv)->v.i)
1412 1456
 #if defined(DUK_USE_FASTINT)
1413
-#define DUK_TVAL_GET_DOUBLE(tv)            ((tv)->v.d)
1414
-#define DUK_TVAL_GET_FASTINT(tv)           ((tv)->v.fi)
1415
-#define DUK_TVAL_GET_FASTINT_U32(tv)       ((duk_uint32_t) ((tv)->v.fi))
1416
-#define DUK_TVAL_GET_FASTINT_I32(tv)       ((duk_int32_t) ((tv)->v.fi))
1457
+#define DUK_TVAL_GET_DOUBLE(tv)      ((tv)->v.d)
1458
+#define DUK_TVAL_GET_FASTINT(tv)     ((tv)->v.fi)
1459
+#define DUK_TVAL_GET_FASTINT_U32(tv) ((duk_uint32_t) ((tv)->v.fi))
1460
+#define DUK_TVAL_GET_FASTINT_I32(tv) ((duk_int32_t) ((tv)->v.fi))
1417 1461
 #if 0
1418
-#define DUK_TVAL_GET_NUMBER(tv)            (DUK_TVAL_IS_FASTINT((tv)) ? \
1419
-                                               (duk_double_t) DUK_TVAL_GET_FASTINT((tv)) : \
1420
-                                               DUK_TVAL_GET_DOUBLE((tv)))
1421
-#define DUK_TVAL_GET_NUMBER(tv)            duk_tval_get_number_unpacked((tv))
1462
+#define DUK_TVAL_GET_NUMBER(tv) (DUK_TVAL_IS_FASTINT((tv)) ? (duk_double_t) DUK_TVAL_GET_FASTINT((tv)) : DUK_TVAL_GET_DOUBLE((tv)))
1463
+#define DUK_TVAL_GET_NUMBER(tv) duk_tval_get_number_unpacked((tv))
1422 1464
 #else
1423 1465
 /* This seems reasonable overall. */
1424
-#define DUK_TVAL_GET_NUMBER(tv)            (DUK_TVAL_IS_FASTINT((tv)) ? \
1425
-                                               duk_tval_get_number_unpacked_fastint((tv)) : \
1426
-                                               DUK_TVAL_GET_DOUBLE((tv)))
1466
+#define DUK_TVAL_GET_NUMBER(tv) (DUK_TVAL_IS_FASTINT((tv)) ? duk_tval_get_number_unpacked_fastint((tv)) : DUK_TVAL_GET_DOUBLE((tv)))
1427 1467
 #endif
1428 1468
 #else
1429
-#define DUK_TVAL_GET_NUMBER(tv)            ((tv)->v.d)
1430
-#define DUK_TVAL_GET_DOUBLE(tv)            ((tv)->v.d)
1431
-#endif  /* DUK_USE_FASTINT */
1432
-#define DUK_TVAL_GET_POINTER(tv)           ((tv)->v.voidptr)
1433
-#define DUK_TVAL_GET_LIGHTFUNC(tv,out_fp,out_flags)  do { \
1469
+#define DUK_TVAL_GET_NUMBER(tv) ((tv)->v.d)
1470
+#define DUK_TVAL_GET_DOUBLE(tv) ((tv)->v.d)
1471
+#endif /* DUK_USE_FASTINT */
1472
+#define DUK_TVAL_GET_POINTER(tv) ((tv)->v.voidptr)
1473
+#define DUK_TVAL_GET_LIGHTFUNC(tv, out_fp, out_flags) \
1474
+	do { \
1434 1475
 		(out_flags) = (duk_uint32_t) (tv)->v_extra; \
1435 1476
 		(out_fp) = (tv)->v.lightfunc; \
1436 1477
 	} while (0)
... ...
@@ -1450,19 +1491,18 @@ typedef struct {
1450 1491
 #define DUK_TVAL_IS_BOOLEAN_TRUE(tv)       (((tv)->t == DUK_TAG_BOOLEAN) && ((tv)->v.i != 0))
1451 1492
 #define DUK_TVAL_IS_BOOLEAN_FALSE(tv)      (((tv)->t == DUK_TAG_BOOLEAN) && ((tv)->v.i == 0))
1452 1493
 #if defined(DUK_USE_FASTINT)
1453
-#define DUK_TVAL_IS_DOUBLE(tv)             ((tv)->t == DUK_TAG_NUMBER)
1454
-#define DUK_TVAL_IS_FASTINT(tv)            ((tv)->t == DUK_TAG_FASTINT)
1455
-#define DUK_TVAL_IS_NUMBER(tv)             ((tv)->t == DUK_TAG_NUMBER || \
1456
-                                            (tv)->t == DUK_TAG_FASTINT)
1494
+#define DUK_TVAL_IS_DOUBLE(tv)  ((tv)->t == DUK_TAG_NUMBER)
1495
+#define DUK_TVAL_IS_FASTINT(tv) ((tv)->t == DUK_TAG_FASTINT)
1496
+#define DUK_TVAL_IS_NUMBER(tv)  ((tv)->t == DUK_TAG_NUMBER || (tv)->t == DUK_TAG_FASTINT)
1457 1497
 #else
1458
-#define DUK_TVAL_IS_NUMBER(tv)             ((tv)->t == DUK_TAG_NUMBER)
1459
-#define DUK_TVAL_IS_DOUBLE(tv)             DUK_TVAL_IS_NUMBER((tv))
1460
-#endif  /* DUK_USE_FASTINT */
1461
-#define DUK_TVAL_IS_POINTER(tv)            ((tv)->t == DUK_TAG_POINTER)
1462
-#define DUK_TVAL_IS_LIGHTFUNC(tv)          ((tv)->t == DUK_TAG_LIGHTFUNC)
1463
-#define DUK_TVAL_IS_STRING(tv)             ((tv)->t == DUK_TAG_STRING)
1464
-#define DUK_TVAL_IS_OBJECT(tv)             ((tv)->t == DUK_TAG_OBJECT)
1465
-#define DUK_TVAL_IS_BUFFER(tv)             ((tv)->t == DUK_TAG_BUFFER)
1498
+#define DUK_TVAL_IS_NUMBER(tv) ((tv)->t == DUK_TAG_NUMBER)
1499
+#define DUK_TVAL_IS_DOUBLE(tv) DUK_TVAL_IS_NUMBER((tv))
1500
+#endif /* DUK_USE_FASTINT */
1501
+#define DUK_TVAL_IS_POINTER(tv)   ((tv)->t == DUK_TAG_POINTER)
1502
+#define DUK_TVAL_IS_LIGHTFUNC(tv) ((tv)->t == DUK_TAG_LIGHTFUNC)
1503
+#define DUK_TVAL_IS_STRING(tv)    ((tv)->t == DUK_TAG_STRING)
1504
+#define DUK_TVAL_IS_OBJECT(tv)    ((tv)->t == DUK_TAG_OBJECT)
1505
+#define DUK_TVAL_IS_BUFFER(tv)    ((tv)->t == DUK_TAG_BUFFER)
1466 1506
 
1467 1507
 /* This is performance critical because it's needed for every DECREF.
1468 1508
  * Take advantage of the fact that the first heap allocated tag is 8,
... ...
@@ -1470,9 +1510,9 @@ typedef struct {
1470 1510
  * non-heap-allocated tags).
1471 1511
  */
1472 1512
 #if 0
1473
-#define DUK_TVAL_IS_HEAP_ALLOCATED(tv)     ((tv)->t >= DUK_TAG_STRING)
1513
+#define DUK_TVAL_IS_HEAP_ALLOCATED(tv) ((tv)->t >= DUK_TAG_STRING)
1474 1514
 #endif
1475
-#define DUK_TVAL_IS_HEAP_ALLOCATED(tv)     ((tv)->t & 0x08)
1515
+#define DUK_TVAL_IS_HEAP_ALLOCATED(tv) ((tv)->t & 0x08)
1476 1516
 
1477 1517
 #if defined(DUK_USE_FASTINT)
1478 1518
 #if 0
... ...
@@ -1481,44 +1521,39 @@ DUK_INTERNAL_DECL duk_double_t duk_tval_get_number_unpacked(duk_tval *tv);
1481 1521
 DUK_INTERNAL_DECL duk_double_t duk_tval_get_number_unpacked_fastint(duk_tval *tv);
1482 1522
 #endif
1483 1523
 
1484
-#endif  /* DUK_USE_PACKED_TVAL */
1524
+#endif /* DUK_USE_PACKED_TVAL */
1485 1525
 
1486 1526
 /*
1487 1527
  *  Convenience (independent of representation)
1488 1528
  */
1489 1529
 
1490
-#define DUK_TVAL_SET_BOOLEAN_TRUE(tv)        DUK_TVAL_SET_BOOLEAN((tv), 1)
1491
-#define DUK_TVAL_SET_BOOLEAN_FALSE(tv)       DUK_TVAL_SET_BOOLEAN((tv), 0)
1530
+#define DUK_TVAL_SET_BOOLEAN_TRUE(tv)  DUK_TVAL_SET_BOOLEAN((tv), 1)
1531
+#define DUK_TVAL_SET_BOOLEAN_FALSE(tv) DUK_TVAL_SET_BOOLEAN((tv), 0)
1492 1532
 
1493
-#define DUK_TVAL_STRING_IS_SYMBOL(tv) \
1494
-	DUK_HSTRING_HAS_SYMBOL(DUK_TVAL_GET_STRING((tv)))
1533
+#define DUK_TVAL_STRING_IS_SYMBOL(tv) DUK_HSTRING_HAS_SYMBOL(DUK_TVAL_GET_STRING((tv)))
1495 1534
 
1496 1535
 /* Lightfunc flags packing and unpacking. */
1497 1536
 /* Sign extend: 0x0000##00 -> 0x##000000 -> sign extend to 0xssssss##.
1498 1537
  * Avoid signed shifts due to portability limitations.
1499 1538
  */
1500
-#define DUK_LFUNC_FLAGS_GET_MAGIC(lf_flags) \
1501
-	((duk_int32_t) (duk_int8_t) (((duk_uint16_t) (lf_flags)) >> 8))
1502
-#define DUK_LFUNC_FLAGS_GET_LENGTH(lf_flags) \
1503
-	(((lf_flags) >> 4) & 0x0fU)
1504
-#define DUK_LFUNC_FLAGS_GET_NARGS(lf_flags) \
1505
-	((lf_flags) & 0x0fU)
1506
-#define DUK_LFUNC_FLAGS_PACK(magic,length,nargs) \
1507
-	((((duk_small_uint_t) (magic)) & 0xffU) << 8) | ((length) << 4) | (nargs)
1508
-
1509
-#define DUK_LFUNC_NARGS_VARARGS             0x0f   /* varargs marker */
1510
-#define DUK_LFUNC_NARGS_MIN                 0x00
1511
-#define DUK_LFUNC_NARGS_MAX                 0x0e   /* max, excl. varargs marker */
1512
-#define DUK_LFUNC_LENGTH_MIN                0x00
1513
-#define DUK_LFUNC_LENGTH_MAX                0x0f
1514
-#define DUK_LFUNC_MAGIC_MIN                 (-0x80)
1515
-#define DUK_LFUNC_MAGIC_MAX                 0x7f
1539
+#define DUK_LFUNC_FLAGS_GET_MAGIC(lf_flags)        ((duk_int32_t) (duk_int8_t) (((duk_uint16_t) (lf_flags)) >> 8))
1540
+#define DUK_LFUNC_FLAGS_GET_LENGTH(lf_flags)       (((lf_flags) >> 4) & 0x0fU)
1541
+#define DUK_LFUNC_FLAGS_GET_NARGS(lf_flags)        ((lf_flags) &0x0fU)
1542
+#define DUK_LFUNC_FLAGS_PACK(magic, length, nargs) ((((duk_small_uint_t) (magic)) & 0xffU) << 8) | ((length) << 4) | (nargs)
1543
+
1544
+#define DUK_LFUNC_NARGS_VARARGS 0x0f /* varargs marker */
1545
+#define DUK_LFUNC_NARGS_MIN     0x00
1546
+#define DUK_LFUNC_NARGS_MAX     0x0e /* max, excl. varargs marker */
1547
+#define DUK_LFUNC_LENGTH_MIN    0x00
1548
+#define DUK_LFUNC_LENGTH_MAX    0x0f
1549
+#define DUK_LFUNC_MAGIC_MIN     (-0x80)
1550
+#define DUK_LFUNC_MAGIC_MAX     0x7f
1516 1551
 
1517 1552
 /* fastint constants etc */
1518 1553
 #if defined(DUK_USE_FASTINT)
1519
-#define DUK_FASTINT_MIN           (DUK_I64_CONSTANT(-0x800000000000))
1520
-#define DUK_FASTINT_MAX           (DUK_I64_CONSTANT(0x7fffffffffff))
1521
-#define DUK_FASTINT_BITS          48
1554
+#define DUK_FASTINT_MIN  (DUK_I64_CONSTANT(-0x800000000000))
1555
+#define DUK_FASTINT_MAX  (DUK_I64_CONSTANT(0x7fffffffffff))
1556
+#define DUK_FASTINT_BITS 48
1522 1557
 
1523 1558
 DUK_INTERNAL_DECL void duk_tval_set_number_chkfast_fast(duk_tval *tv, duk_double_t x);
1524 1559
 DUK_INTERNAL_DECL void duk_tval_set_number_chkfast_slow(duk_tval *tv, duk_double_t x);
... ...
@@ -1526,12 +1561,17 @@ DUK_INTERNAL_DECL void duk_tval_set_number_chkfast_slow(duk_tval *tv, duk_double
1526 1561
 
1527 1562
 #if defined(DUK_USE_ASSERTIONS)
1528 1563
 DUK_INTERNAL_DECL void duk_tval_assert_valid(duk_tval *tv);
1529
-#define DUK_TVAL_ASSERT_VALID(tv)  do { duk