Skip to content

Commit 86cd073

Browse files
committed
Split internal allocs to hot/cold paths
1 parent 06846a6 commit 86cd073

5 files changed

Lines changed: 228 additions & 168 deletions

File tree

src-input/duk_api_internal.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,28 @@
66
#if !defined(DUK_API_INTERNAL_H_INCLUDED)
77
#define DUK_API_INTERNAL_H_INCLUDED
88

9+
/* Inline macro helpers. */
10+
#if defined(DUK_USE_PREFER_SIZE)
11+
#define DUK_INLINE_PERF
12+
#define DUK_ALWAYS_INLINE_PERF
13+
#define DUK_NOINLINE_PERF
14+
#else
15+
#define DUK_INLINE_PERF DUK_INLINE
16+
#define DUK_ALWAYS_INLINE_PERF DUK_ALWAYS_INLINE
17+
#define DUK_NOINLINE_PERF DUK_NOINLINE
18+
#endif
19+
20+
/* Inline macro helpers, for bytecode executor. */
21+
#if defined(DUK_USE_EXEC_PREFER_SIZE)
22+
#define DUK_EXEC_INLINE_PERF
23+
#define DUK_EXEC_ALWAYS_INLINE_PERF
24+
#define DUK_EXEC_NOINLINE_PERF
25+
#else
26+
#define DUK_EXEC_INLINE_PERF DUK_INLINE
27+
#define DUK_EXEC_ALWAYS_INLINE_PERF DUK_ALWAYS_INLINE
28+
#define DUK_EXEC_NOINLINE_PERF DUK_NOINLINE
29+
#endif
30+
931
/* duk_push_sprintf constants */
1032
#define DUK_PUSH_SPRINTF_INITIAL_SIZE 256L
1133
#define DUK_PUSH_SPRINTF_SANITY_LIMIT (1L * 1024L * 1024L * 1024L)

src-input/duk_heap.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,17 @@
6868
*/
6969
#define DUK_MS_FLAG_EMERGENCY (1U << 0)
7070

71-
/* Voluntary mark-and-sweep: triggered periodically. */
72-
#define DUK_MS_FLAG_VOLUNTARY (1U << 1)
73-
7471
/* Postpone rescue decisions for reachable objects with FINALIZED set.
7572
* Used during finalize_list processing to avoid incorrect rescue
7673
* decisions due to finalize_list being a reachability root.
7774
*/
78-
#define DUK_MS_FLAG_POSTPONE_RESCUE (1U << 2)
75+
#define DUK_MS_FLAG_POSTPONE_RESCUE (1U << 1)
7976

8077
/* Don't compact objects; needed during object property table resize
8178
* to prevent a recursive resize. It would suffice to protect only the
8279
* current object being resized, but this is not yet implemented.
8380
*/
84-
#define DUK_MS_FLAG_NO_OBJECT_COMPACTION (1U << 3)
81+
#define DUK_MS_FLAG_NO_OBJECT_COMPACTION (1U << 2)
8582

8683
/*
8784
* Thread switching

0 commit comments

Comments
 (0)