duktape 2.0.1.1 → 2.3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/ext/duktape/duk_config.h +329 -118
- data/ext/duktape/duktape.c +22491 -17285
- data/ext/duktape/duktape.h +294 -536
- data/lib/duktape/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb1c81939c930da5931c156d092800ce1a1d46db
|
4
|
+
data.tar.gz: fddc0fee4d0b9b047ca9ccab96f80e7e5e511590
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2235641010578d7a47564799435145360357389e358f6a1611372782629fff551e0c70d998189afda7801479847c098e5d49d0b80bba0ec34ee34d5f9d4bd8b4
|
7
|
+
data.tar.gz: 80e1165ed988c883fa90f59f2ce7a38d12d66e50f923ac30f94acadb7b473f7d05feb8f192673be1306eb39b069170739f8df97ee021eb8598769f3c5f4901d5
|
data/CHANGELOG.md
CHANGED
data/ext/duktape/duk_config.h
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
/*
|
2
2
|
* duk_config.h configuration header generated by genconfig.py.
|
3
3
|
*
|
4
|
-
* Git commit:
|
5
|
-
* Git describe:
|
4
|
+
* Git commit: 7551eee6615c2633375bff51ceb297bc3bc7c77e
|
5
|
+
* Git describe: v2.0.1.0-5-g7551eee-dirty
|
6
6
|
* Git branch: master
|
7
7
|
*
|
8
8
|
* Supported platforms:
|
@@ -12,6 +12,7 @@
|
|
12
12
|
* - Generic BSD
|
13
13
|
* - Atari ST TOS
|
14
14
|
* - AmigaOS
|
15
|
+
* - Durango (XboxOne)
|
15
16
|
* - Windows
|
16
17
|
* - Flashplayer (Crossbridge)
|
17
18
|
* - QNX
|
@@ -19,6 +20,8 @@
|
|
19
20
|
* - Emscripten
|
20
21
|
* - Linux
|
21
22
|
* - Solaris
|
23
|
+
* - AIX
|
24
|
+
* - HPUX
|
22
25
|
* - Generic POSIX
|
23
26
|
* - Cygwin
|
24
27
|
* - Generic UNIX
|
@@ -126,6 +129,11 @@
|
|
126
129
|
#endif
|
127
130
|
#endif
|
128
131
|
|
132
|
+
/* Durango (Xbox One) */
|
133
|
+
#if defined(_DURANGO) || defined(_XBOX_ONE)
|
134
|
+
#define DUK_F_DURANGO
|
135
|
+
#endif
|
136
|
+
|
129
137
|
/* Windows, both 32-bit and 64-bit */
|
130
138
|
#if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) || \
|
131
139
|
defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__)
|
@@ -170,6 +178,28 @@
|
|
170
178
|
/* illumos / Solaris */
|
171
179
|
#if defined(__sun) && defined(__SVR4)
|
172
180
|
#define DUK_F_SUN
|
181
|
+
#if defined(__SUNPRO_C) && (__SUNPRO_C < 0x550)
|
182
|
+
#define DUK_F_OLD_SOLARIS
|
183
|
+
/* Defines _ILP32 / _LP64 required by DUK_F_X86/DUK_F_X64. Platforms
|
184
|
+
* are processed before architectures, so this happens before the
|
185
|
+
* DUK_F_X86/DUK_F_X64 detection is emitted.
|
186
|
+
*/
|
187
|
+
#include <sys/isa_defs.h>
|
188
|
+
#endif
|
189
|
+
#endif
|
190
|
+
|
191
|
+
/* AIX */
|
192
|
+
#if defined(_AIX)
|
193
|
+
/* defined(__xlc__) || defined(__IBMC__): works but too wide */
|
194
|
+
#define DUK_F_AIX
|
195
|
+
#endif
|
196
|
+
|
197
|
+
/* HPUX */
|
198
|
+
#if defined(__hpux)
|
199
|
+
#define DUK_F_HPUX
|
200
|
+
#if defined(__ia64)
|
201
|
+
#define DUK_F_HPUX_ITANIUM
|
202
|
+
#endif
|
173
203
|
#endif
|
174
204
|
|
175
205
|
/* POSIX */
|
@@ -188,26 +218,12 @@
|
|
188
218
|
#define DUK_F_UNIX
|
189
219
|
#endif
|
190
220
|
|
191
|
-
/* stdint.h not available */
|
192
|
-
#if defined(DUK_F_WINDOWS) && defined(_MSC_VER)
|
193
|
-
#if (_MSC_VER < 1700)
|
194
|
-
/* VS2012+ has stdint.h, < VS2012 does not (but it's available for download). */
|
195
|
-
#define DUK_F_NO_STDINT_H
|
196
|
-
#endif
|
197
|
-
#endif
|
198
|
-
#if !defined(DUK_F_NO_STDINT_H) && (defined(DUK_F_TOS) || defined(DUK_F_BCC))
|
199
|
-
#define DUK_F_NO_STDINT_H
|
200
|
-
#endif
|
201
|
-
|
202
|
-
/* C++ */
|
203
|
-
#undef DUK_F_CPP
|
204
|
-
#if defined(__cplusplus)
|
205
|
-
#define DUK_F_CPP
|
206
|
-
#endif
|
207
|
-
|
208
221
|
/* Intel x86 (32-bit), x64 (64-bit) or x32 (64-bit but 32-bit pointers),
|
209
222
|
* define only one of DUK_F_X86, DUK_F_X64, DUK_F_X32.
|
210
223
|
* https://sites.google.com/site/x32abi/
|
224
|
+
*
|
225
|
+
* With DUK_F_OLD_SOLARIS the <sys/isa_defs.h> header must be included
|
226
|
+
* before this.
|
211
227
|
*/
|
212
228
|
#if defined(__amd64__) || defined(__amd64) || \
|
213
229
|
defined(__x86_64__) || defined(__x86_64) || \
|
@@ -279,6 +295,12 @@
|
|
279
295
|
#define DUK_F_CLANG
|
280
296
|
#endif
|
281
297
|
|
298
|
+
/* C++ */
|
299
|
+
#undef DUK_F_CPP
|
300
|
+
#if defined(__cplusplus)
|
301
|
+
#define DUK_F_CPP
|
302
|
+
#endif
|
303
|
+
|
282
304
|
/* C99 or above */
|
283
305
|
#undef DUK_F_C99
|
284
306
|
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
@@ -334,6 +356,15 @@
|
|
334
356
|
#define DUK_F_VBCC
|
335
357
|
#endif
|
336
358
|
|
359
|
+
#if defined(ANDROID) || defined(__ANDROID__)
|
360
|
+
#define DUK_F_ANDROID
|
361
|
+
#endif
|
362
|
+
|
363
|
+
/* Atari Mint */
|
364
|
+
#if defined(__MINT__)
|
365
|
+
#define DUK_F_MINT
|
366
|
+
#endif
|
367
|
+
|
337
368
|
/*
|
338
369
|
* Platform autodetection
|
339
370
|
*/
|
@@ -458,8 +489,13 @@
|
|
458
489
|
#if !defined(DUK_USE_BYTEORDER) && (defined(DUK_F_M68K) || defined(DUK_F_PPC))
|
459
490
|
#define DUK_USE_BYTEORDER 3
|
460
491
|
#endif
|
461
|
-
#elif defined(
|
462
|
-
/* ---
|
492
|
+
#elif defined(DUK_F_DURANGO)
|
493
|
+
/* --- Durango (XboxOne) --- */
|
494
|
+
/* Durango = XboxOne
|
495
|
+
* Configuration is nearly identical to Windows, except for
|
496
|
+
* DUK_USE_DATE_TZO_WINDOWS.
|
497
|
+
*/
|
498
|
+
|
463
499
|
/* Initial fix: disable secure CRT related warnings when compiling Duktape
|
464
500
|
* itself (must be defined before including Windows headers). Don't define
|
465
501
|
* for user code including duktape.h.
|
@@ -468,10 +504,9 @@
|
|
468
504
|
#define _CRT_SECURE_NO_WARNINGS
|
469
505
|
#endif
|
470
506
|
|
471
|
-
/* Windows 32-bit and 64-bit are currently the same. */
|
472
507
|
/* MSVC does not have sys/param.h */
|
473
508
|
#define DUK_USE_DATE_NOW_WINDOWS
|
474
|
-
#define
|
509
|
+
#define DUK_USE_DATE_TZO_WINDOWS_NO_DST
|
475
510
|
/* Note: PRS and FMT are intentionally left undefined for now. This means
|
476
511
|
* there is no platform specific date parsing/formatting but there is still
|
477
512
|
* the ISO 8601 standard format.
|
@@ -483,6 +518,64 @@
|
|
483
518
|
#include <windows.h>
|
484
519
|
#endif
|
485
520
|
|
521
|
+
#define DUK_USE_OS_STRING "durango"
|
522
|
+
|
523
|
+
#if !defined(DUK_USE_BYTEORDER)
|
524
|
+
#define DUK_USE_BYTEORDER 1
|
525
|
+
#endif
|
526
|
+
#elif defined(DUK_F_WINDOWS)
|
527
|
+
/* --- Windows --- */
|
528
|
+
/* Windows version can't obviously be determined at compile time,
|
529
|
+
* but _WIN32_WINNT indicates the minimum version targeted:
|
530
|
+
* - https://msdn.microsoft.com/en-us/library/6sehtctf.aspx
|
531
|
+
*/
|
532
|
+
|
533
|
+
/* Initial fix: disable secure CRT related warnings when compiling Duktape
|
534
|
+
* itself (must be defined before including Windows headers). Don't define
|
535
|
+
* for user code including duktape.h.
|
536
|
+
*/
|
537
|
+
#if defined(DUK_COMPILING_DUKTAPE) && !defined(_CRT_SECURE_NO_WARNINGS)
|
538
|
+
#define _CRT_SECURE_NO_WARNINGS
|
539
|
+
#endif
|
540
|
+
|
541
|
+
/* Windows 32-bit and 64-bit are currently the same. */
|
542
|
+
/* MSVC does not have sys/param.h */
|
543
|
+
|
544
|
+
#if defined(DUK_COMPILING_DUKTAPE)
|
545
|
+
/* Only include when compiling Duktape to avoid polluting application build
|
546
|
+
* with a lot of unnecessary defines.
|
547
|
+
*/
|
548
|
+
#include <windows.h>
|
549
|
+
#endif
|
550
|
+
|
551
|
+
/* GetSystemTimePreciseAsFileTime() available from Windows 8:
|
552
|
+
* https://msdn.microsoft.com/en-us/library/windows/desktop/hh706895(v=vs.85).aspx
|
553
|
+
*/
|
554
|
+
#if defined(DUK_USE_DATE_NOW_WINDOWS_SUBMS) || defined(DUK_USE_DATE_NOW_WINDOWS)
|
555
|
+
/* User forced provider. */
|
556
|
+
#else
|
557
|
+
#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0602)
|
558
|
+
#define DUK_USE_DATE_NOW_WINDOWS_SUBMS
|
559
|
+
#else
|
560
|
+
#define DUK_USE_DATE_NOW_WINDOWS
|
561
|
+
#endif
|
562
|
+
#endif
|
563
|
+
|
564
|
+
#define DUK_USE_DATE_TZO_WINDOWS
|
565
|
+
|
566
|
+
/* Note: PRS and FMT are intentionally left undefined for now. This means
|
567
|
+
* there is no platform specific date parsing/formatting but there is still
|
568
|
+
* the ISO 8601 standard format.
|
569
|
+
*/
|
570
|
+
|
571
|
+
/* QueryPerformanceCounter() may go backwards in Windows XP, so enable for
|
572
|
+
* Vista and later: https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx#qpc_support_in_windows_versions
|
573
|
+
*/
|
574
|
+
#if !defined(DUK_USE_GET_MONOTONIC_TIME_WINDOWS_QPC) && \
|
575
|
+
defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600)
|
576
|
+
#define DUK_USE_GET_MONOTONIC_TIME_WINDOWS_QPC
|
577
|
+
#endif
|
578
|
+
|
486
579
|
#define DUK_USE_OS_STRING "windows"
|
487
580
|
|
488
581
|
/* On Windows, assume we're little endian. Even Itanium which has a
|
@@ -527,6 +620,10 @@
|
|
527
620
|
#define DUK_USE_OS_STRING "qnx"
|
528
621
|
#elif defined(DUK_F_TINSPIRE)
|
529
622
|
/* --- TI-Nspire --- */
|
623
|
+
#if defined(DUK_COMPILING_DUKTAPE) && !defined(_XOPEN_SOURCE)
|
624
|
+
#define _XOPEN_SOURCE /* e.g. strptime */
|
625
|
+
#endif
|
626
|
+
|
530
627
|
#define DUK_USE_DATE_NOW_GETTIMEOFDAY
|
531
628
|
#define DUK_USE_DATE_TZO_GMTIME_R
|
532
629
|
#define DUK_USE_DATE_PRS_STRPTIME
|
@@ -598,6 +695,10 @@
|
|
598
695
|
#define DUK_USE_DATE_PRS_STRPTIME
|
599
696
|
#define DUK_USE_DATE_FMT_STRFTIME
|
600
697
|
|
698
|
+
#if 0 /* XXX: safe condition? */
|
699
|
+
#define DUK_USE_GET_MONOTONIC_TIME_CLOCK_GETTIME
|
700
|
+
#endif
|
701
|
+
|
601
702
|
#define DUK_USE_OS_STRING "linux"
|
602
703
|
#elif defined(DUK_F_SUN)
|
603
704
|
/* --- Solaris --- */
|
@@ -607,12 +708,50 @@
|
|
607
708
|
#define DUK_USE_DATE_FMT_STRFTIME
|
608
709
|
|
609
710
|
#include <sys/types.h>
|
711
|
+
#if defined(DUK_F_OLD_SOLARIS)
|
712
|
+
/* Old Solaris with no endian.h, stdint.h */
|
713
|
+
#define DUK_F_NO_STDINT_H
|
714
|
+
#if !defined(DUK_USE_BYTEORDER)
|
715
|
+
#define DUK_USE_BYTEORDER 3
|
716
|
+
#endif
|
717
|
+
#else /* DUK_F_OLD_SOLARIS */
|
610
718
|
#include <ast/endian.h>
|
719
|
+
#endif /* DUK_F_OLD_SOLARIS */
|
720
|
+
|
611
721
|
#include <sys/param.h>
|
612
722
|
#include <sys/time.h>
|
613
723
|
#include <time.h>
|
614
724
|
|
615
725
|
#define DUK_USE_OS_STRING "solaris"
|
726
|
+
#elif defined(DUK_F_AIX)
|
727
|
+
/* --- AIX --- */
|
728
|
+
#if !defined(DUK_USE_BYTEORDER)
|
729
|
+
#define DUK_USE_BYTEORDER 3
|
730
|
+
#endif
|
731
|
+
#define DUK_USE_DATE_NOW_GETTIMEOFDAY
|
732
|
+
#define DUK_USE_DATE_TZO_GMTIME_R
|
733
|
+
#define DUK_USE_DATE_PRS_STRPTIME
|
734
|
+
#define DUK_USE_DATE_FMT_STRFTIME
|
735
|
+
#include <sys/param.h>
|
736
|
+
#include <sys/time.h>
|
737
|
+
#include <time.h>
|
738
|
+
|
739
|
+
#define DUK_USE_OS_STRING "aix"
|
740
|
+
#elif defined(DUK_F_HPUX)
|
741
|
+
/* --- HPUX --- */
|
742
|
+
#define DUK_F_NO_STDINT_H
|
743
|
+
#if !defined(DUK_USE_BYTEORDER)
|
744
|
+
#define DUK_USE_BYTEORDER 3
|
745
|
+
#endif
|
746
|
+
#define DUK_USE_DATE_NOW_GETTIMEOFDAY
|
747
|
+
#define DUK_USE_DATE_TZO_GMTIME_R
|
748
|
+
#define DUK_USE_DATE_PRS_STRPTIME
|
749
|
+
#define DUK_USE_DATE_FMT_STRFTIME
|
750
|
+
#include <sys/param.h>
|
751
|
+
#include <sys/time.h>
|
752
|
+
#include <time.h>
|
753
|
+
|
754
|
+
#define DUK_USE_OS_STRING "hpux"
|
616
755
|
#elif defined(DUK_F_POSIX)
|
617
756
|
/* --- Generic POSIX --- */
|
618
757
|
#define DUK_USE_DATE_NOW_GETTIMEOFDAY
|
@@ -697,9 +836,7 @@
|
|
697
836
|
#include <stdint.h>
|
698
837
|
#endif
|
699
838
|
|
700
|
-
|
701
|
-
#include <exception> /* std::exception */
|
702
|
-
#endif
|
839
|
+
/* <exception> is only included if needed, based on DUK_USE_xxx flags. */
|
703
840
|
|
704
841
|
/*
|
705
842
|
* Architecture autodetection
|
@@ -711,13 +848,16 @@
|
|
711
848
|
#if !defined(DUK_USE_BYTEORDER)
|
712
849
|
#define DUK_USE_BYTEORDER 1
|
713
850
|
#endif
|
714
|
-
|
715
|
-
|
851
|
+
|
852
|
+
#define DUK_USE_PACKED_TVAL
|
853
|
+
|
854
|
+
/* FreeBSD, -m32, and clang prior to 5.0 has union aliasing issues which
|
855
|
+
* break duk_tval copying. Disable packed duk_tval automatically.
|
716
856
|
*/
|
717
|
-
#if
|
718
|
-
|
857
|
+
#if defined(DUK_F_FREEBSD) && defined(DUK_F_X86) && \
|
858
|
+
defined(__clang__) && defined(__clang_major__) && (__clang_major__ < 5)
|
859
|
+
#undef DUK_USE_PACKED_TVAL
|
719
860
|
#endif
|
720
|
-
#define DUK_USE_PACKED_TVAL
|
721
861
|
#define DUK_F_PACKED_TVAL_PROVIDED
|
722
862
|
#elif defined(DUK_F_X64)
|
723
863
|
/* --- x64 --- */
|
@@ -725,12 +865,6 @@
|
|
725
865
|
#if !defined(DUK_USE_BYTEORDER)
|
726
866
|
#define DUK_USE_BYTEORDER 1
|
727
867
|
#endif
|
728
|
-
/* XXX: This is technically not guaranteed because it's possible to configure
|
729
|
-
* an x86 to require aligned accesses with Alignment Check (AC) flag.
|
730
|
-
*/
|
731
|
-
#if !defined(DUK_USE_ALIGN_BY)
|
732
|
-
#define DUK_USE_ALIGN_BY 1
|
733
|
-
#endif
|
734
868
|
#undef DUK_USE_PACKED_TVAL
|
735
869
|
#define DUK_F_PACKED_TVAL_PROVIDED
|
736
870
|
#elif defined(DUK_F_X32)
|
@@ -739,55 +873,30 @@
|
|
739
873
|
#if !defined(DUK_USE_BYTEORDER)
|
740
874
|
#define DUK_USE_BYTEORDER 1
|
741
875
|
#endif
|
742
|
-
/* XXX: This is technically not guaranteed because it's possible to configure
|
743
|
-
* an x86 to require aligned accesses with Alignment Check (AC) flag.
|
744
|
-
*/
|
745
|
-
#if !defined(DUK_USE_ALIGN_BY)
|
746
|
-
#define DUK_USE_ALIGN_BY 1
|
747
|
-
#endif
|
748
876
|
#define DUK_USE_PACKED_TVAL
|
749
877
|
#define DUK_F_PACKED_TVAL_PROVIDED
|
750
878
|
#elif defined(DUK_F_ARM32)
|
751
879
|
/* --- ARM 32-bit --- */
|
752
880
|
#define DUK_USE_ARCH_STRING "arm32"
|
753
881
|
/* Byte order varies, so rely on autodetect. */
|
754
|
-
#if !defined(DUK_USE_ALIGN_BY)
|
755
|
-
#define DUK_USE_ALIGN_BY 4
|
756
|
-
#endif
|
757
882
|
#define DUK_USE_PACKED_TVAL
|
758
883
|
#define DUK_F_PACKED_TVAL_PROVIDED
|
759
884
|
#elif defined(DUK_F_ARM64)
|
760
885
|
/* --- ARM 64-bit --- */
|
761
886
|
#define DUK_USE_ARCH_STRING "arm64"
|
762
887
|
/* Byte order varies, so rely on autodetect. */
|
763
|
-
#if !defined(DUK_USE_ALIGN_BY)
|
764
|
-
#define DUK_USE_ALIGN_BY 8
|
765
|
-
#endif
|
766
888
|
#undef DUK_USE_PACKED_TVAL
|
767
889
|
#define DUK_F_PACKED_TVAL_PROVIDED
|
768
890
|
#elif defined(DUK_F_MIPS32)
|
769
891
|
/* --- MIPS 32-bit --- */
|
770
892
|
#define DUK_USE_ARCH_STRING "mips32"
|
771
893
|
/* MIPS byte order varies so rely on autodetection. */
|
772
|
-
/* Based on 'make checkalign' there are no alignment requirements on
|
773
|
-
* Linux MIPS except for doubles, which need align by 4. Alignment
|
774
|
-
* requirements vary based on target though.
|
775
|
-
*/
|
776
|
-
#if !defined(DUK_USE_ALIGN_BY)
|
777
|
-
#define DUK_USE_ALIGN_BY 4
|
778
|
-
#endif
|
779
894
|
#define DUK_USE_PACKED_TVAL
|
780
895
|
#define DUK_F_PACKED_TVAL_PROVIDED
|
781
896
|
#elif defined(DUK_F_MIPS64)
|
782
897
|
/* --- MIPS 64-bit --- */
|
783
898
|
#define DUK_USE_ARCH_STRING "mips64"
|
784
899
|
/* MIPS byte order varies so rely on autodetection. */
|
785
|
-
/* Good default is a bit arbitrary because alignment requirements
|
786
|
-
* depend on target. See https://github.com/svaarala/duktape/issues/102.
|
787
|
-
*/
|
788
|
-
#if !defined(DUK_USE_ALIGN_BY)
|
789
|
-
#define DUK_USE_ALIGN_BY 8
|
790
|
-
#endif
|
791
900
|
#undef DUK_USE_PACKED_TVAL
|
792
901
|
#define DUK_F_PACKED_TVAL_PROVIDED
|
793
902
|
#elif defined(DUK_F_PPC32)
|
@@ -796,9 +905,6 @@
|
|
796
905
|
#if !defined(DUK_USE_BYTEORDER)
|
797
906
|
#define DUK_USE_BYTEORDER 3
|
798
907
|
#endif
|
799
|
-
#if !defined(DUK_USE_ALIGN_BY)
|
800
|
-
#define DUK_USE_ALIGN_BY 8
|
801
|
-
#endif
|
802
908
|
#define DUK_USE_PACKED_TVAL
|
803
909
|
#define DUK_F_PACKED_TVAL_PROVIDED
|
804
910
|
#elif defined(DUK_F_PPC64)
|
@@ -807,39 +913,24 @@
|
|
807
913
|
#if !defined(DUK_USE_BYTEORDER)
|
808
914
|
#define DUK_USE_BYTEORDER 3
|
809
915
|
#endif
|
810
|
-
#if !defined(DUK_USE_ALIGN_BY)
|
811
|
-
#define DUK_USE_ALIGN_BY 8
|
812
|
-
#endif
|
813
916
|
#undef DUK_USE_PACKED_TVAL
|
814
917
|
#define DUK_F_PACKED_TVAL_PROVIDED
|
815
918
|
#elif defined(DUK_F_SPARC32)
|
816
919
|
/* --- SPARC 32-bit --- */
|
817
920
|
#define DUK_USE_ARCH_STRING "sparc32"
|
818
921
|
/* SPARC byte order varies so rely on autodetection. */
|
819
|
-
#if !defined(DUK_USE_ALIGN_BY)
|
820
|
-
#define DUK_USE_ALIGN_BY 8
|
821
|
-
#endif
|
822
922
|
#define DUK_USE_PACKED_TVAL
|
823
923
|
#define DUK_F_PACKED_TVAL_PROVIDED
|
824
924
|
#elif defined(DUK_F_SPARC64)
|
825
925
|
/* --- SPARC 64-bit --- */
|
826
926
|
#define DUK_USE_ARCH_STRING "sparc64"
|
827
927
|
/* SPARC byte order varies so rely on autodetection. */
|
828
|
-
#if !defined(DUK_USE_ALIGN_BY)
|
829
|
-
#define DUK_USE_ALIGN_BY 8
|
830
|
-
#endif
|
831
928
|
#undef DUK_USE_PACKED_TVAL
|
832
929
|
#define DUK_F_PACKED_TVAL_PROVIDED
|
833
930
|
#elif defined(DUK_F_SUPERH)
|
834
931
|
/* --- SuperH --- */
|
835
932
|
#define DUK_USE_ARCH_STRING "sh"
|
836
933
|
/* Byte order varies, rely on autodetection. */
|
837
|
-
/* Based on 'make checkalign' there are no alignment requirements on
|
838
|
-
* Linux SH4, but align by 4 is probably a good basic default.
|
839
|
-
*/
|
840
|
-
#if !defined(DUK_USE_ALIGN_BY)
|
841
|
-
#define DUK_USE_ALIGN_BY 4
|
842
|
-
#endif
|
843
934
|
#define DUK_USE_PACKED_TVAL
|
844
935
|
#define DUK_F_PACKED_TVAL_PROVIDED
|
845
936
|
#elif defined(DUK_F_M68K)
|
@@ -848,9 +939,6 @@
|
|
848
939
|
#if !defined(DUK_USE_BYTEORDER)
|
849
940
|
#define DUK_USE_BYTEORDER 3
|
850
941
|
#endif
|
851
|
-
#if !defined(DUK_USE_ALIGN_BY)
|
852
|
-
#define DUK_USE_ALIGN_BY 8
|
853
|
-
#endif
|
854
942
|
#define DUK_USE_PACKED_TVAL
|
855
943
|
#define DUK_F_PACKED_TVAL_PROVIDED
|
856
944
|
#elif defined(DUK_F_EMSCRIPTEN)
|
@@ -859,9 +947,6 @@
|
|
859
947
|
#if !defined(DUK_USE_BYTEORDER)
|
860
948
|
#define DUK_USE_BYTEORDER 1
|
861
949
|
#endif
|
862
|
-
#if !defined(DUK_USE_ALIGN_BY)
|
863
|
-
#define DUK_USE_ALIGN_BY 8
|
864
|
-
#endif
|
865
950
|
#undef DUK_USE_PACKED_TVAL
|
866
951
|
#define DUK_F_PACKED_TVAL_PROVIDED
|
867
952
|
#else
|
@@ -908,6 +993,9 @@
|
|
908
993
|
#define DUK_ALWAYS_INLINE inline __attribute__((always_inline))
|
909
994
|
#endif
|
910
995
|
|
996
|
+
/* DUK_HOT */
|
997
|
+
/* DUK_COLD */
|
998
|
+
|
911
999
|
#if defined(DUK_F_DLL_BUILD) && defined(DUK_F_WINDOWS)
|
912
1000
|
/* MSVC dllexport/dllimport: appropriate __declspec depends on whether we're
|
913
1001
|
* compiling Duktape or the application.
|
@@ -1018,6 +1106,12 @@
|
|
1018
1106
|
#define DUK_ALWAYS_INLINE inline __attribute__((always_inline))
|
1019
1107
|
#endif
|
1020
1108
|
|
1109
|
+
#if (defined(DUK_F_C99) || defined(DUK_F_CPP11)) && \
|
1110
|
+
defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 40300)
|
1111
|
+
#define DUK_HOT __attribute__((hot))
|
1112
|
+
#define DUK_COLD __attribute__((cold))
|
1113
|
+
#endif
|
1114
|
+
|
1021
1115
|
#if defined(DUK_F_DLL_BUILD) && defined(DUK_F_WINDOWS)
|
1022
1116
|
/* MSVC dllexport/dllimport: appropriate __declspec depends on whether we're
|
1023
1117
|
* compiling Duktape or the application.
|
@@ -1198,7 +1292,16 @@
|
|
1198
1292
|
#endif
|
1199
1293
|
|
1200
1294
|
/* Avoid warning when doing DUK_UNREF(some_function). */
|
1295
|
+
#if defined(_MSC_VER) && (_MSC_VER < 1500)
|
1296
|
+
#pragma warning(disable: 4100 4101 4550 4551)
|
1297
|
+
#define DUK_UNREF(x)
|
1298
|
+
#else
|
1201
1299
|
#define DUK_UNREF(x) do { __pragma(warning(suppress:4100 4101 4550 4551)) (x); } while (0)
|
1300
|
+
#endif
|
1301
|
+
|
1302
|
+
/* Older versions of MSVC don't support the LL/ULL suffix. */
|
1303
|
+
#define DUK_U64_CONSTANT(x) x##ui64
|
1304
|
+
#define DUK_I64_CONSTANT(x) x##i64
|
1202
1305
|
#elif defined(DUK_F_EMSCRIPTEN)
|
1203
1306
|
/* --- Emscripten --- */
|
1204
1307
|
#define DUK_NORETURN(decl) decl __attribute__((noreturn))
|
@@ -1424,10 +1527,16 @@
|
|
1424
1527
|
#if defined(DUK_F_X86) || defined(DUK_F_X32) || \
|
1425
1528
|
defined(DUK_F_M68K) || defined(DUK_F_PPC32) || \
|
1426
1529
|
defined(DUK_F_BCC) || \
|
1427
|
-
(defined(__WORDSIZE) && (__WORDSIZE == 32))
|
1530
|
+
(defined(__WORDSIZE) && (__WORDSIZE == 32)) || \
|
1531
|
+
((defined(DUK_F_OLD_SOLARIS) || defined(DUK_F_AIX) || \
|
1532
|
+
defined(DUK_F_HPUX)) && defined(_ILP32)) || \
|
1533
|
+
defined(DUK_F_ARM32)
|
1428
1534
|
#define DUK_F_32BIT_PTRS
|
1429
1535
|
#elif defined(DUK_F_X64) || \
|
1430
|
-
(defined(__WORDSIZE) && (__WORDSIZE == 64))
|
1536
|
+
(defined(__WORDSIZE) && (__WORDSIZE == 64)) || \
|
1537
|
+
((defined(DUK_F_OLD_SOLARIS) || defined(DUK_F_AIX) || \
|
1538
|
+
defined(DUK_F_HPUX)) && defined(_LP64)) || \
|
1539
|
+
defined(DUK_F_ARM64)
|
1431
1540
|
#define DUK_F_64BIT_PTRS
|
1432
1541
|
#else
|
1433
1542
|
/* not sure, not needed with C99 anyway */
|
@@ -1630,13 +1739,16 @@ typedef unsigned long long duk_uint64_t;
|
|
1630
1739
|
typedef signed long long duk_int64_t;
|
1631
1740
|
#endif
|
1632
1741
|
#endif
|
1633
|
-
#if !defined(DUK_F_HAVE_64BIT) &&
|
1634
|
-
(defined(DUK_F_MINGW) || defined(DUK_F_MSVC))
|
1635
|
-
/* Both MinGW and MSVC have a 64-bit type. */
|
1742
|
+
#if !defined(DUK_F_HAVE_64BIT) && defined(DUK_F_MINGW)
|
1636
1743
|
#define DUK_F_HAVE_64BIT
|
1637
1744
|
typedef unsigned long duk_uint64_t;
|
1638
1745
|
typedef signed long duk_int64_t;
|
1639
1746
|
#endif
|
1747
|
+
#if !defined(DUK_F_HAVE_64BIT) && defined(DUK_F_MSVC)
|
1748
|
+
#define DUK_F_HAVE_64BIT
|
1749
|
+
typedef unsigned __int64 duk_uint64_t;
|
1750
|
+
typedef signed __int64 duk_int64_t;
|
1751
|
+
#endif
|
1640
1752
|
#if !defined(DUK_F_HAVE_64BIT)
|
1641
1753
|
/* cannot detect 64-bit type, not always needed so don't error */
|
1642
1754
|
#endif
|
@@ -1844,10 +1956,10 @@ typedef duk_uint_fast16_t duk_small_uint_fast_t;
|
|
1844
1956
|
#define DUK_SMALL_UINT_FAST_MIN DUK_UINT_FAST16_MIN
|
1845
1957
|
#define DUK_SMALL_UINT_FAST_MAX DUK_UINT_FAST16_MAX
|
1846
1958
|
|
1847
|
-
/* Boolean values are represented with the platform 'int'. */
|
1848
|
-
typedef
|
1849
|
-
#define DUK_BOOL_MIN
|
1850
|
-
#define DUK_BOOL_MAX
|
1959
|
+
/* Boolean values are represented with the platform 'unsigned int'. */
|
1960
|
+
typedef duk_small_uint_t duk_bool_t;
|
1961
|
+
#define DUK_BOOL_MIN DUK_SMALL_UINT_MIN
|
1962
|
+
#define DUK_BOOL_MAX DUK_SMALL_UINT_MAX
|
1851
1963
|
|
1852
1964
|
/* Index values must have at least 32-bit signed range. */
|
1853
1965
|
typedef duk_int_t duk_idx_t;
|
@@ -1916,7 +2028,10 @@ typedef double duk_double_t;
|
|
1916
2028
|
#endif
|
1917
2029
|
#endif
|
1918
2030
|
|
1919
|
-
/* Type
|
2031
|
+
/* Type used in public API declarations and user code. Typedef maps to
|
2032
|
+
* 'struct duk_hthread' like the 'duk_hthread' typedef which is used
|
2033
|
+
* exclusively in internals.
|
2034
|
+
*/
|
1920
2035
|
typedef struct duk_hthread duk_context;
|
1921
2036
|
|
1922
2037
|
/* Check whether we should use 64-bit integers or not.
|
@@ -2050,7 +2165,8 @@ typedef struct duk_hthread duk_context;
|
|
2050
2165
|
#define DUK_DOUBLE_INFINITY (__builtin_inf())
|
2051
2166
|
#elif defined(INFINITY)
|
2052
2167
|
#define DUK_DOUBLE_INFINITY ((double) INFINITY)
|
2053
|
-
#elif !defined(DUK_F_VBCC) && !defined(DUK_F_MSVC) && !defined(DUK_F_BCC)
|
2168
|
+
#elif !defined(DUK_F_VBCC) && !defined(DUK_F_MSVC) && !defined(DUK_F_BCC) && \
|
2169
|
+
!defined(DUK_F_OLD_SOLARIS) && !defined(DUK_F_AIX)
|
2054
2170
|
#define DUK_DOUBLE_INFINITY (1.0 / 0.0)
|
2055
2171
|
#else
|
2056
2172
|
/* In VBCC (1.0 / 0.0) results in a warning and 0.0 instead of infinity.
|
@@ -2066,7 +2182,8 @@ typedef struct duk_hthread duk_context;
|
|
2066
2182
|
#undef DUK_USE_COMPUTED_NAN
|
2067
2183
|
#if defined(NAN)
|
2068
2184
|
#define DUK_DOUBLE_NAN NAN
|
2069
|
-
#elif !defined(DUK_F_VBCC) && !defined(DUK_F_MSVC) && !defined(DUK_F_BCC)
|
2185
|
+
#elif !defined(DUK_F_VBCC) && !defined(DUK_F_MSVC) && !defined(DUK_F_BCC) && \
|
2186
|
+
!defined(DUK_F_OLD_SOLARIS) && !defined(DUK_F_AIX)
|
2070
2187
|
#define DUK_DOUBLE_NAN (0.0 / 0.0)
|
2071
2188
|
#else
|
2072
2189
|
/* In VBCC (0.0 / 0.0) results in a warning and 0.0 instead of NaN.
|
@@ -2115,6 +2232,9 @@ typedef struct duk_hthread duk_context;
|
|
2115
2232
|
* To be safe, use replacements.
|
2116
2233
|
*/
|
2117
2234
|
#define DUK_F_USE_REPL_ALL
|
2235
|
+
#elif defined(DUK_F_AIX)
|
2236
|
+
/* Older versions may be missing isnan(), etc. */
|
2237
|
+
#define DUK_F_USE_REPL_ALL
|
2118
2238
|
#endif
|
2119
2239
|
|
2120
2240
|
#if defined(DUK_F_USE_REPL_ALL)
|
@@ -2203,9 +2323,10 @@ typedef struct duk_hthread duk_context;
|
|
2203
2323
|
/* The functions below exist only in C99/C++11 or later and need a workaround
|
2204
2324
|
* for platforms that don't include them. MSVC isn't detected as C99, but
|
2205
2325
|
* these functions also exist in MSVC 2013 and later so include a clause for
|
2206
|
-
* that too.
|
2326
|
+
* that too. Android doesn't have log2; disable all of these for Android.
|
2207
2327
|
*/
|
2208
|
-
#if defined(DUK_F_C99) || defined(DUK_F_CPP11) || (defined(_MSC_VER) && (_MSC_VER >= 1800))
|
2328
|
+
#if (defined(DUK_F_C99) || defined(DUK_F_CPP11) || (defined(_MSC_VER) && (_MSC_VER >= 1800))) && \
|
2329
|
+
!defined(DUK_F_ANDROID) && !defined(DUK_F_MINT)
|
2209
2330
|
#if !defined(DUK_CBRT)
|
2210
2331
|
#define DUK_CBRT cbrt
|
2211
2332
|
#endif
|
@@ -2218,7 +2339,7 @@ typedef struct duk_hthread duk_context;
|
|
2218
2339
|
#if !defined(DUK_TRUNC)
|
2219
2340
|
#define DUK_TRUNC trunc
|
2220
2341
|
#endif
|
2221
|
-
#endif /* DUK_F_C99 */
|
2342
|
+
#endif /* DUK_F_C99 etc */
|
2222
2343
|
|
2223
2344
|
/* NetBSD 6.0 x86 (at least) has a few problems with pow() semantics,
|
2224
2345
|
* see test-bug-netbsd-math-pow.js. MinGW has similar (but different)
|
@@ -2372,10 +2493,13 @@ typedef struct duk_hthread duk_context;
|
|
2372
2493
|
*
|
2373
2494
|
* Assume unaligned accesses are not supported unless specifically allowed
|
2374
2495
|
* in the target platform. Some platforms may support unaligned accesses
|
2375
|
-
* but alignment to 4 or 8 may still be desirable.
|
2496
|
+
* but alignment to 4 or 8 may still be desirable. Note that unaligned
|
2497
|
+
* accesses (and even pointers) relative to natural alignment (regardless
|
2498
|
+
* of target alignment) are technically undefined behavior and thus
|
2499
|
+
* compiler/architecture specific.
|
2376
2500
|
*/
|
2377
2501
|
|
2378
|
-
/* If not
|
2502
|
+
/* If not forced, use safe default for alignment. */
|
2379
2503
|
#if !defined(DUK_USE_ALIGN_BY)
|
2380
2504
|
#define DUK_USE_ALIGN_BY 8
|
2381
2505
|
#endif
|
@@ -2427,17 +2551,34 @@ typedef struct duk_hthread duk_context;
|
|
2427
2551
|
*/
|
2428
2552
|
#define DUK_CAUSE_SEGFAULT() do { *((volatile duk_uint32_t *) NULL) = (duk_uint32_t) 0xdeadbeefUL; } while (0)
|
2429
2553
|
#endif
|
2554
|
+
|
2430
2555
|
#if !defined(DUK_UNREF)
|
2431
2556
|
/* Macro for suppressing warnings for potentially unreferenced variables.
|
2432
2557
|
* The variables can be actually unreferenced or unreferenced in some
|
2433
2558
|
* specific cases only; for instance, if a variable is only debug printed,
|
2434
|
-
* it is unreferenced when debug printing is disabled.
|
2559
|
+
* it is unreferenced when debug printing is disabled. May cause warnings
|
2560
|
+
* for volatile arguments.
|
2435
2561
|
*/
|
2436
2562
|
#define DUK_UNREF(x) do { (void) (x); } while (0)
|
2437
2563
|
#endif
|
2438
|
-
|
2564
|
+
|
2565
|
+
/* Fillin for DUK_NORETURN; DUK_WO_NORETURN() is used to insert dummy
|
2566
|
+
* dummy statements after noreturn calls to silence harmless compiler
|
2567
|
+
* warnings, e.g.:
|
2568
|
+
*
|
2569
|
+
* DUK_ERROR_TYPE(thr, "aiee");
|
2570
|
+
* DUK_WO_NORETURN(return 0;);
|
2571
|
+
*
|
2572
|
+
* Statements inside DUK_WO_NORETURN() must NEVER be actually reachable,
|
2573
|
+
* and they're only included to satisfy the compiler.
|
2574
|
+
*/
|
2575
|
+
#if defined(DUK_NORETURN)
|
2576
|
+
#define DUK_WO_NORETURN(stmt) do { } while (0)
|
2577
|
+
#else
|
2439
2578
|
#define DUK_NORETURN(decl) decl
|
2579
|
+
#define DUK_WO_NORETURN(stmt) do { stmt } while (0)
|
2440
2580
|
#endif
|
2581
|
+
|
2441
2582
|
#if !defined(DUK_UNREACHABLE)
|
2442
2583
|
/* Don't know how to declare unreachable point, so don't do it; this
|
2443
2584
|
* may cause some spurious compilation warnings (e.g. "variable used
|
@@ -2445,6 +2586,7 @@ typedef struct duk_hthread duk_context;
|
|
2445
2586
|
*/
|
2446
2587
|
#define DUK_UNREACHABLE() do { } while (0)
|
2447
2588
|
#endif
|
2589
|
+
|
2448
2590
|
#if !defined(DUK_LOSE_CONST)
|
2449
2591
|
/* Convert any input pointer into a "void *", losing a const qualifier.
|
2450
2592
|
* This is not fully portable because casting through duk_uintptr_t may
|
@@ -2473,6 +2615,13 @@ typedef struct duk_hthread duk_context;
|
|
2473
2615
|
#define DUK_ALWAYS_INLINE /*nop*/
|
2474
2616
|
#endif
|
2475
2617
|
|
2618
|
+
#if !defined(DUK_HOT)
|
2619
|
+
#define DUK_HOT /*nop*/
|
2620
|
+
#endif
|
2621
|
+
#if !defined(DUK_COLD)
|
2622
|
+
#define DUK_COLD /*nop*/
|
2623
|
+
#endif
|
2624
|
+
|
2476
2625
|
#if !defined(DUK_EXTERNAL_DECL)
|
2477
2626
|
#define DUK_EXTERNAL_DECL extern
|
2478
2627
|
#endif
|
@@ -2549,6 +2698,13 @@ typedef struct duk_hthread duk_context;
|
|
2549
2698
|
#undef DUK_USE_GCC_PRAGMAS
|
2550
2699
|
#endif
|
2551
2700
|
|
2701
|
+
#if !defined(DUK_U64_CONSTANT)
|
2702
|
+
#define DUK_U64_CONSTANT(x) x##ULL
|
2703
|
+
#endif
|
2704
|
+
#if !defined(DUK_I64_CONSTANT)
|
2705
|
+
#define DUK_I64_CONSTANT(x) x##LL
|
2706
|
+
#endif
|
2707
|
+
|
2552
2708
|
/* Workaround for GH-323: avoid inlining control when compiling from
|
2553
2709
|
* multiple sources, as it causes compiler portability trouble.
|
2554
2710
|
*/
|
@@ -2598,8 +2754,8 @@ typedef struct duk_hthread duk_context;
|
|
2598
2754
|
#if defined(DUK_F_PACKED_TVAL_POSSIBLE)
|
2599
2755
|
#define DUK_USE_PACKED_TVAL
|
2600
2756
|
#endif
|
2601
|
-
|
2602
2757
|
#undef DUK_F_PACKED_TVAL_POSSIBLE
|
2758
|
+
|
2603
2759
|
#endif /* DUK_F_PACKED_TVAL_PROVIDED */
|
2604
2760
|
/* Object property allocation layout has implications for memory and code
|
2605
2761
|
* footprint and generated code size/speed. The best layout also depends
|
@@ -2634,6 +2790,7 @@ typedef struct duk_hthread duk_context;
|
|
2634
2790
|
* Autogenerated defaults
|
2635
2791
|
*/
|
2636
2792
|
|
2793
|
+
#undef DUK_USE_ALLOW_UNDEFINED_BEHAVIOR
|
2637
2794
|
#define DUK_USE_ARRAY_BUILTIN
|
2638
2795
|
#define DUK_USE_ARRAY_FASTPATH
|
2639
2796
|
#define DUK_USE_ARRAY_PROP_FASTPATH
|
@@ -2642,10 +2799,14 @@ typedef struct duk_hthread duk_context;
|
|
2642
2799
|
#define DUK_USE_AUGMENT_ERROR_THROW
|
2643
2800
|
#define DUK_USE_AVOID_PLATFORM_FUNCPTRS
|
2644
2801
|
#define DUK_USE_BASE64_FASTPATH
|
2802
|
+
#define DUK_USE_BASE64_SUPPORT
|
2645
2803
|
#define DUK_USE_BOOLEAN_BUILTIN
|
2646
2804
|
#define DUK_USE_BUFFEROBJECT_SUPPORT
|
2647
2805
|
#undef DUK_USE_BUFLEN16
|
2648
2806
|
#define DUK_USE_BYTECODE_DUMP_SUPPORT
|
2807
|
+
#define DUK_USE_CACHE_ACTIVATION
|
2808
|
+
#define DUK_USE_CACHE_CATCHER
|
2809
|
+
#define DUK_USE_CALLSTACK_LIMIT 10000
|
2649
2810
|
#define DUK_USE_COMMONJS_MODULES
|
2650
2811
|
#define DUK_USE_COMPILER_RECLIMIT 2500
|
2651
2812
|
#define DUK_USE_COROUTINE_SUPPORT
|
@@ -2680,7 +2841,10 @@ typedef struct duk_hthread duk_context;
|
|
2680
2841
|
#define DUK_USE_ES6_PROXY
|
2681
2842
|
#define DUK_USE_ES6_REGEXP_SYNTAX
|
2682
2843
|
#define DUK_USE_ES6_UNICODE_ESCAPE
|
2844
|
+
#define DUK_USE_ES7
|
2683
2845
|
#define DUK_USE_ES7_EXP_OPERATOR
|
2846
|
+
#define DUK_USE_ES8
|
2847
|
+
#define DUK_USE_ES9
|
2684
2848
|
#define DUK_USE_ESBC_LIMITS
|
2685
2849
|
#define DUK_USE_ESBC_MAX_BYTES 2147418112L
|
2686
2850
|
#define DUK_USE_ESBC_MAX_LINENUMBER 2147418112L
|
@@ -2695,7 +2859,9 @@ typedef struct duk_hthread duk_context;
|
|
2695
2859
|
#undef DUK_USE_FASTINT
|
2696
2860
|
#define DUK_USE_FAST_REFCOUNT_DEFAULT
|
2697
2861
|
#undef DUK_USE_FATAL_HANDLER
|
2862
|
+
#define DUK_USE_FATAL_MAXLEN 128
|
2698
2863
|
#define DUK_USE_FINALIZER_SUPPORT
|
2864
|
+
#undef DUK_USE_FINALIZER_TORTURE
|
2699
2865
|
#undef DUK_USE_FUNCPTR16
|
2700
2866
|
#undef DUK_USE_FUNCPTR_DEC16
|
2701
2867
|
#undef DUK_USE_FUNCPTR_ENC16
|
@@ -2703,17 +2869,30 @@ typedef struct duk_hthread duk_context;
|
|
2703
2869
|
#define DUK_USE_FUNC_FILENAME_PROPERTY
|
2704
2870
|
#define DUK_USE_FUNC_NAME_PROPERTY
|
2705
2871
|
#undef DUK_USE_GC_TORTURE
|
2872
|
+
#undef DUK_USE_GET_MONOTONIC_TIME
|
2706
2873
|
#undef DUK_USE_GET_RANDOM_DOUBLE
|
2874
|
+
#undef DUK_USE_GLOBAL_BINDING
|
2707
2875
|
#define DUK_USE_GLOBAL_BUILTIN
|
2708
2876
|
#undef DUK_USE_HEAPPTR16
|
2709
2877
|
#undef DUK_USE_HEAPPTR_DEC16
|
2710
2878
|
#undef DUK_USE_HEAPPTR_ENC16
|
2711
2879
|
#define DUK_USE_HEX_FASTPATH
|
2880
|
+
#define DUK_USE_HEX_SUPPORT
|
2881
|
+
#define DUK_USE_HOBJECT_ARRAY_ABANDON_LIMIT 2
|
2882
|
+
#define DUK_USE_HOBJECT_ARRAY_FAST_RESIZE_LIMIT 9
|
2883
|
+
#define DUK_USE_HOBJECT_ARRAY_MINGROW_ADD 16
|
2884
|
+
#define DUK_USE_HOBJECT_ARRAY_MINGROW_DIVISOR 8
|
2885
|
+
#define DUK_USE_HOBJECT_ENTRY_MINGROW_ADD 16
|
2886
|
+
#define DUK_USE_HOBJECT_ENTRY_MINGROW_DIVISOR 8
|
2712
2887
|
#define DUK_USE_HOBJECT_HASH_PART
|
2888
|
+
#define DUK_USE_HOBJECT_HASH_PROP_LIMIT 8
|
2713
2889
|
#define DUK_USE_HSTRING_ARRIDX
|
2714
2890
|
#define DUK_USE_HSTRING_CLEN
|
2715
2891
|
#undef DUK_USE_HSTRING_EXTDATA
|
2892
|
+
#define DUK_USE_HSTRING_LAZY_CLEN
|
2893
|
+
#define DUK_USE_HTML_COMMENTS
|
2716
2894
|
#define DUK_USE_IDCHAR_FASTPATH
|
2895
|
+
#undef DUK_USE_INJECT_HEAP_ALLOC_ERROR
|
2717
2896
|
#undef DUK_USE_INTERRUPT_COUNTER
|
2718
2897
|
#undef DUK_USE_INTERRUPT_DEBUG_FIXUP
|
2719
2898
|
#define DUK_USE_JC
|
@@ -2729,13 +2908,10 @@ typedef struct duk_hthread duk_context;
|
|
2729
2908
|
#define DUK_USE_JX
|
2730
2909
|
#define DUK_USE_LEXER_SLIDING_WINDOW
|
2731
2910
|
#undef DUK_USE_LIGHTFUNC_BUILTINS
|
2732
|
-
#
|
2911
|
+
#define DUK_USE_LITCACHE_SIZE 256
|
2733
2912
|
#define DUK_USE_MARK_AND_SWEEP_RECLIMIT 256
|
2734
2913
|
#define DUK_USE_MATH_BUILTIN
|
2735
|
-
#define DUK_USE_MS_STRINGTABLE_RESIZE
|
2736
2914
|
#define DUK_USE_NATIVE_CALL_RECLIMIT 1000
|
2737
|
-
#define DUK_USE_NONSTD_ARRAY_CONCAT_TRAILER
|
2738
|
-
#define DUK_USE_NONSTD_ARRAY_MAP_TRAILER
|
2739
2915
|
#define DUK_USE_NONSTD_ARRAY_SPLICE_DELCOUNT
|
2740
2916
|
#undef DUK_USE_NONSTD_FUNC_CALLER_PROPERTY
|
2741
2917
|
#undef DUK_USE_NONSTD_FUNC_SOURCE_PROPERTY
|
@@ -2749,12 +2925,15 @@ typedef struct duk_hthread duk_context;
|
|
2749
2925
|
#undef DUK_USE_OBJSIZES16
|
2750
2926
|
#undef DUK_USE_PARANOID_ERRORS
|
2751
2927
|
#define DUK_USE_PC2LINE
|
2928
|
+
#define DUK_USE_PERFORMANCE_BUILTIN
|
2752
2929
|
#undef DUK_USE_PREFER_SIZE
|
2930
|
+
#undef DUK_USE_PROMISE_BUILTIN
|
2753
2931
|
#define DUK_USE_PROVIDE_DEFAULT_ALLOC_FUNCTIONS
|
2754
2932
|
#undef DUK_USE_REFCOUNT16
|
2933
|
+
#define DUK_USE_REFCOUNT32
|
2755
2934
|
#define DUK_USE_REFERENCE_COUNTING
|
2756
2935
|
#define DUK_USE_REFLECT_BUILTIN
|
2757
|
-
#
|
2936
|
+
#define DUK_USE_REGEXP_CANON_BITMAP
|
2758
2937
|
#undef DUK_USE_REGEXP_CANON_WORKAROUND
|
2759
2938
|
#define DUK_USE_REGEXP_COMPILER_RECLIMIT 10000
|
2760
2939
|
#define DUK_USE_REGEXP_EXECUTOR_RECLIMIT 10000
|
@@ -2766,6 +2945,7 @@ typedef struct duk_hthread duk_context;
|
|
2766
2945
|
#undef DUK_USE_ROM_STRINGS
|
2767
2946
|
#define DUK_USE_SECTION_B
|
2768
2947
|
#undef DUK_USE_SELF_TESTS
|
2948
|
+
#define DUK_USE_SHEBANG_COMMENTS
|
2769
2949
|
#undef DUK_USE_SHUFFLE_TORTURE
|
2770
2950
|
#define DUK_USE_SOURCE_NONBMP
|
2771
2951
|
#undef DUK_USE_STRHASH16
|
@@ -2775,15 +2955,23 @@ typedef struct duk_hthread duk_context;
|
|
2775
2955
|
#undef DUK_USE_STRICT_UTF8_SOURCE
|
2776
2956
|
#define DUK_USE_STRING_BUILTIN
|
2777
2957
|
#undef DUK_USE_STRLEN16
|
2778
|
-
#
|
2779
|
-
#
|
2780
|
-
#define
|
2958
|
+
#define DUK_USE_STRTAB_GROW_LIMIT 17
|
2959
|
+
#define DUK_USE_STRTAB_MAXSIZE 268435456L
|
2960
|
+
#define DUK_USE_STRTAB_MINSIZE 1024
|
2961
|
+
#undef DUK_USE_STRTAB_PTRCOMP
|
2962
|
+
#define DUK_USE_STRTAB_RESIZE_CHECK_MASK 255
|
2963
|
+
#define DUK_USE_STRTAB_SHRINK_LIMIT 6
|
2964
|
+
#undef DUK_USE_STRTAB_TORTURE
|
2781
2965
|
#undef DUK_USE_SYMBOL_BUILTIN
|
2782
2966
|
#define DUK_USE_TAILCALL
|
2783
2967
|
#define DUK_USE_TARGET_INFO "unknown"
|
2784
2968
|
#define DUK_USE_TRACEBACKS
|
2785
2969
|
#define DUK_USE_TRACEBACK_DEPTH 10
|
2786
2970
|
#define DUK_USE_USER_DECLARE() /* no user declarations */
|
2971
|
+
#define DUK_USE_VALSTACK_GROW_SHIFT 2
|
2972
|
+
#define DUK_USE_VALSTACK_LIMIT 1000000L
|
2973
|
+
#define DUK_USE_VALSTACK_SHRINK_CHECK_SHIFT 2
|
2974
|
+
#define DUK_USE_VALSTACK_SHRINK_SLACK_SHIFT 4
|
2787
2975
|
#undef DUK_USE_VALSTACK_UNSAFE
|
2788
2976
|
#define DUK_USE_VERBOSE_ERRORS
|
2789
2977
|
#define DUK_USE_VERBOSE_EXECUTOR_ERRORS
|
@@ -2798,6 +2986,15 @@ typedef struct duk_hthread duk_context;
|
|
2798
2986
|
|
2799
2987
|
/* __OVERRIDE_DEFINES__ */
|
2800
2988
|
|
2989
|
+
/*
|
2990
|
+
* Conditional includes
|
2991
|
+
*/
|
2992
|
+
|
2993
|
+
#if defined(DUK_F_CPP) && defined(DUK_USE_CPP_EXCEPTIONS)
|
2994
|
+
#include <exception> /* std::exception */
|
2995
|
+
#include <stdexcept> /* std::runtime_error */
|
2996
|
+
#endif
|
2997
|
+
|
2801
2998
|
/*
|
2802
2999
|
* Date provider selection
|
2803
3000
|
*
|
@@ -2811,21 +3008,25 @@ typedef struct duk_hthread duk_context;
|
|
2811
3008
|
#if defined(DUK_USE_DATE_GET_NOW)
|
2812
3009
|
/* External provider already defined. */
|
2813
3010
|
#elif defined(DUK_USE_DATE_NOW_GETTIMEOFDAY)
|
2814
|
-
#define DUK_USE_DATE_GET_NOW(ctx) duk_bi_date_get_now_gettimeofday(
|
3011
|
+
#define DUK_USE_DATE_GET_NOW(ctx) duk_bi_date_get_now_gettimeofday()
|
2815
3012
|
#elif defined(DUK_USE_DATE_NOW_TIME)
|
2816
|
-
#define DUK_USE_DATE_GET_NOW(ctx) duk_bi_date_get_now_time(
|
3013
|
+
#define DUK_USE_DATE_GET_NOW(ctx) duk_bi_date_get_now_time()
|
2817
3014
|
#elif defined(DUK_USE_DATE_NOW_WINDOWS)
|
2818
|
-
#define DUK_USE_DATE_GET_NOW(ctx) duk_bi_date_get_now_windows(
|
3015
|
+
#define DUK_USE_DATE_GET_NOW(ctx) duk_bi_date_get_now_windows()
|
3016
|
+
#elif defined(DUK_USE_DATE_NOW_WINDOWS_SUBMS)
|
3017
|
+
#define DUK_USE_DATE_GET_NOW(ctx) duk_bi_date_get_now_windows_subms()
|
2819
3018
|
#else
|
2820
3019
|
#error no provider for DUK_USE_DATE_GET_NOW()
|
2821
3020
|
#endif
|
2822
3021
|
|
2823
3022
|
#if defined(DUK_USE_DATE_GET_LOCAL_TZOFFSET)
|
2824
3023
|
/* External provider already defined. */
|
2825
|
-
#elif defined(DUK_USE_DATE_TZO_GMTIME_R) || defined(DUK_USE_DATE_TZO_GMTIME)
|
3024
|
+
#elif defined(DUK_USE_DATE_TZO_GMTIME_R) || defined(DUK_USE_DATE_TZO_GMTIME_S) || defined(DUK_USE_DATE_TZO_GMTIME)
|
2826
3025
|
#define DUK_USE_DATE_GET_LOCAL_TZOFFSET(d) duk_bi_date_get_local_tzoffset_gmtime((d))
|
2827
3026
|
#elif defined(DUK_USE_DATE_TZO_WINDOWS)
|
2828
3027
|
#define DUK_USE_DATE_GET_LOCAL_TZOFFSET(d) duk_bi_date_get_local_tzoffset_windows((d))
|
3028
|
+
#elif defined(DUK_USE_DATE_TZO_WINDOWS_NO_DST)
|
3029
|
+
#define DUK_USE_DATE_GET_LOCAL_TZOFFSET(d) duk_bi_date_get_local_tzoffset_windows_no_dst((d))
|
2829
3030
|
#else
|
2830
3031
|
#error no provider for DUK_USE_DATE_GET_LOCAL_TZOFFSET()
|
2831
3032
|
#endif
|
@@ -2849,6 +3050,16 @@ typedef struct duk_hthread duk_context;
|
|
2849
3050
|
/* No provider for DUK_USE_DATE_FORMAT_STRING(), fall back to ISO 8601 only. */
|
2850
3051
|
#endif
|
2851
3052
|
|
3053
|
+
#if defined(DUK_USE_GET_MONOTONIC_TIME)
|
3054
|
+
/* External provider already defined. */
|
3055
|
+
#elif defined(DUK_USE_GET_MONOTONIC_TIME_CLOCK_GETTIME)
|
3056
|
+
#define DUK_USE_GET_MONOTONIC_TIME(ctx) duk_bi_date_get_monotonic_time_clock_gettime()
|
3057
|
+
#elif defined(DUK_USE_GET_MONOTONIC_TIME_WINDOWS_QPC)
|
3058
|
+
#define DUK_USE_GET_MONOTONIC_TIME(ctx) duk_bi_date_get_monotonic_time_windows_qpc()
|
3059
|
+
#else
|
3060
|
+
/* No provider for DUK_USE_GET_MONOTONIC_TIME(), fall back to DUK_USE_DATE_GET_NOW(). */
|
3061
|
+
#endif
|
3062
|
+
|
2852
3063
|
#endif /* DUK_COMPILING_DUKTAPE */
|
2853
3064
|
|
2854
3065
|
/*
|