|
|
@@ -167,6 +167,11 @@ static __inline__ unsigned long long duk_rdtsc(void) {
|
|
|
#define DUK_F_M68K
|
|
|
#endif
|
|
|
|
|
|
+/* PowerPC */
|
|
|
+#if defined(__powerpc) || defined(__powerpc__) || defined(__PPC__)
|
|
|
+#define DUK_F_PPC
|
|
|
+#endif
|
|
|
+
|
|
|
/* Linux */
|
|
|
#if defined(__linux) || defined(__linux__) || defined(linux)
|
|
|
#define DUK_F_LINUX
|
|
|
@@ -451,8 +456,18 @@ static __inline__ unsigned long long duk_rdtsc(void) {
|
|
|
#define DUK_USE_DATE_FMT_STRFTIME
|
|
|
#include <limits.h>
|
|
|
#include <time.h>
|
|
|
+#elif defined(DUK_F_PPC)
|
|
|
+#define DUK_USE_DATE_NOW_GETTIMEOFDAY
|
|
|
+#define DUK_USE_DATE_TZO_GMTIME_R
|
|
|
+#define DUK_USE_DATE_PRS_STRPTIME
|
|
|
+#define DUK_USE_DATE_FMT_STRFTIME
|
|
|
+#include <limits.h>
|
|
|
+#include <time.h>
|
|
|
+#ifndef UINTPTR_MAX
|
|
|
+#define UINTPTR_MAX UINT_MAX
|
|
|
+#endif
|
|
|
#else
|
|
|
-#error AmigaOS but not M68K, not supported now
|
|
|
+#error AmigaOS but not M68K/PPC, not supported now
|
|
|
#endif
|
|
|
#elif defined(DUK_F_WINDOWS)
|
|
|
/* Windows 32-bit and 64-bit are currently the same. */
|
|
|
@@ -1391,9 +1406,9 @@ typedef struct duk_hthread duk_context;
|
|
|
#define DUK_F_BYTEORDER 3
|
|
|
#endif
|
|
|
|
|
|
-/* AmigaOS on M68k */
|
|
|
+/* AmigaOS on M68K or PPC */
|
|
|
#if !defined(DUK_F_BYTEORDER) && defined(DUK_F_AMIGAOS)
|
|
|
-#if defined(DUK_F_M68K)
|
|
|
+#if defined(DUK_F_M68K) || defined(DUK_F_PPC)
|
|
|
#define DUK_F_BYTEORDER 3
|
|
|
#endif
|
|
|
#endif
|
|
|
@@ -1494,6 +1509,11 @@ typedef struct duk_hthread duk_context;
|
|
|
#define DUK_USE_PACKED_TVAL_POSSIBLE
|
|
|
#endif
|
|
|
|
|
|
+/* PPC: packed always possible */
|
|
|
+#if !defined(DUK_USE_PACKED_TVAL_POSSIBLE) && defined(DUK_F_PPC)
|
|
|
+#define DUK_USE_PACKED_TVAL_POSSIBLE
|
|
|
+#endif
|
|
|
+
|
|
|
/* With Emscripten, force unpacked duk_tval just to be safe, as it seems to
|
|
|
* break at least on Firefox (probably IEEE double arithmetic is not 100%
|
|
|
* supported, especially for NaNs).
|
|
|
@@ -2146,6 +2166,8 @@ typedef FILE duk_file;
|
|
|
#define DUK_USE_ARCH_STRING "mips64"
|
|
|
#elif defined(DUK_F_SUPERH)
|
|
|
#define DUK_USE_ARCH_STRING "sh"
|
|
|
+#elif defined(DUK_F_PPC)
|
|
|
+#define DUK_USE_ARCH_STRING "ppc"
|
|
|
#elif defined(DUK_F_M68K)
|
|
|
#define DUK_USE_ARCH_STRING "m68k"
|
|
|
#elif defined(DUK_F_FLASHPLAYER)
|
|
|
@@ -2695,20 +2717,6 @@ typedef FILE duk_file;
|
|
|
#undef DUK_USE_TAILCALL
|
|
|
#endif
|
|
|
|
|
|
-/*
|
|
|
- * Deep vs. shallow stack.
|
|
|
- *
|
|
|
- * Some embedded platforms have very shallow stack (e.g. 64kB); default to
|
|
|
- * a shallow stack on unknown platforms or known embedded platforms.
|
|
|
- */
|
|
|
-
|
|
|
-#if defined(DUK_F_LINUX) || defined(DUK_F_BSD) || defined(DUK_F_WINDOWS) || \
|
|
|
- defined(DUK_F_APPLE) || defined(DUK_OPT_DEEP_C_STACK)
|
|
|
-#define DUK_USE_DEEP_C_STACK
|
|
|
-#else
|
|
|
-#undef DUK_USE_DEEP_C_STACK
|
|
|
-#endif
|
|
|
-
|
|
|
/*
|
|
|
* Ecmascript compiler
|
|
|
*/
|
|
|
@@ -2979,6 +2987,59 @@ typedef FILE duk_file;
|
|
|
#undef DUK_USE_GCC_PRAGMAS
|
|
|
#endif
|
|
|
|
|
|
+/*
|
|
|
+ * User declarations
|
|
|
+ */
|
|
|
+
|
|
|
+#if defined(DUK_OPT_DECLARE)
|
|
|
+#define DUK_USE_USER_DECLARE() DUK_OPT_DECLARE
|
|
|
+#else
|
|
|
+#define DUK_USE_USER_DECLARE() /* no user declarations */
|
|
|
+#endif
|
|
|
+
|
|
|
+/*
|
|
|
+ * Autogenerated defaults
|
|
|
+ */
|
|
|
+
|
|
|
+#define DUK_USE_COMPILER_RECLIMIT 2500
|
|
|
+#undef DUK_USE_DATE_FORMAT_STRING
|
|
|
+#undef DUK_USE_DATE_GET_LOCAL_TZOFFSET
|
|
|
+#undef DUK_USE_DATE_GET_NOW
|
|
|
+#undef DUK_USE_DATE_PARSE_STRING
|
|
|
+#undef DUK_USE_DATE_PRS_GETDATE
|
|
|
+#undef DUK_USE_INTEGER_ME
|
|
|
+#define DUK_USE_JSON_DECNUMBER_FASTPATH
|
|
|
+#define DUK_USE_JSON_DECSTRING_FASTPATH
|
|
|
+#define DUK_USE_JSON_DEC_RECLIMIT 1000
|
|
|
+#define DUK_USE_JSON_EATWHITE_FASTPATH
|
|
|
+#define DUK_USE_JSON_ENC_RECLIMIT 1000
|
|
|
+#define DUK_USE_JSON_QUOTESTRING_FASTPATH
|
|
|
+#undef DUK_USE_JSON_STRINGIFY_FASTPATH
|
|
|
+#define DUK_USE_MARK_AND_SWEEP_RECLIMIT 256
|
|
|
+#define DUK_USE_NATIVE_CALL_RECLIMIT 1000
|
|
|
+#define DUK_USE_REGEXP_COMPILER_RECLIMIT 10000
|
|
|
+#define DUK_USE_REGEXP_EXECUTOR_RECLIMIT 10000
|
|
|
+
|
|
|
+/*
|
|
|
+ * Alternative customization header
|
|
|
+ *
|
|
|
+ * If you want to modify the final DUK_USE_xxx flags directly (without
|
|
|
+ * using the available DUK_OPT_xxx flags), define DUK_OPT_HAVE_CUSTOM_H
|
|
|
+ * and tweak the final flags there.
|
|
|
+ */
|
|
|
+
|
|
|
+#if defined(DUK_OPT_HAVE_CUSTOM_H)
|
|
|
+#include "duk_custom.h"
|
|
|
+#endif
|
|
|
+
|
|
|
+/*
|
|
|
+ * You may add overriding #define/#undef directives below for
|
|
|
+ * customization. You of course cannot un-#include or un-typedef
|
|
|
+ * anything; these require direct changes above.
|
|
|
+ */
|
|
|
+
|
|
|
+/* __OVERRIDE_DEFINES__ */
|
|
|
+
|
|
|
/*
|
|
|
* Date provider selection
|
|
|
*
|
|
|
@@ -3040,48 +3101,6 @@ DUK_INTERNAL_DECL duk_bool_t duk_bi_date_format_parts_strftime(duk_context *ctx,
|
|
|
|
|
|
#endif /* DUK_COMPILING_DUKTAPE */
|
|
|
|
|
|
-/*
|
|
|
- * User declarations
|
|
|
- */
|
|
|
-
|
|
|
-#if defined(DUK_OPT_DECLARE)
|
|
|
-#define DUK_USE_USER_DECLARE() DUK_OPT_DECLARE
|
|
|
-#else
|
|
|
-#define DUK_USE_USER_DECLARE() /* no user declarations */
|
|
|
-#endif
|
|
|
-
|
|
|
-/*
|
|
|
- * Autogenerated defaults
|
|
|
- */
|
|
|
-
|
|
|
-#undef DUK_USE_DATE_PRS_GETDATE
|
|
|
-#undef DUK_USE_INTEGER_ME
|
|
|
-#define DUK_USE_JSON_DECNUMBER_FASTPATH
|
|
|
-#define DUK_USE_JSON_DECSTRING_FASTPATH
|
|
|
-#define DUK_USE_JSON_EATWHITE_FASTPATH
|
|
|
-#define DUK_USE_JSON_QUOTESTRING_FASTPATH
|
|
|
-// #undef DUK_USE_JSON_STRINGIFY_FASTPATH
|
|
|
-
|
|
|
-/*
|
|
|
- * Alternative customization header
|
|
|
- *
|
|
|
- * If you want to modify the final DUK_USE_xxx flags directly (without
|
|
|
- * using the available DUK_OPT_xxx flags), define DUK_OPT_HAVE_CUSTOM_H
|
|
|
- * and tweak the final flags there.
|
|
|
- */
|
|
|
-
|
|
|
-#if defined(DUK_OPT_HAVE_CUSTOM_H)
|
|
|
-#include "duk_custom.h"
|
|
|
-#endif
|
|
|
-
|
|
|
-/*
|
|
|
- * You may add overriding #define/#undef directives below for
|
|
|
- * customization. You of course cannot un-#include or un-typedef
|
|
|
- * anything; these require direct changes above.
|
|
|
- */
|
|
|
-
|
|
|
-/* __OVERRIDE_DEFINES__ */
|
|
|
-
|
|
|
/*
|
|
|
* Sanity check for the final effective internal defines. Also
|
|
|
* double checks user tweaks made by an optional duk_custom.h header.
|