xbintsc 0.3.25 → 0.3.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/README.md +39 -3
  2. package/dist/src/cli/main.js +124 -30
  3. package/dist/src/cli/main.js.map +1 -1
  4. package/dist/src/codegen/generator/calls/access.js +8 -1
  5. package/dist/src/codegen/generator/calls/access.js.map +1 -1
  6. package/dist/src/codegen/generator/module.js +10 -0
  7. package/dist/src/codegen/generator/module.js.map +1 -1
  8. package/dist/src/codegen/generator/state.js +24 -0
  9. package/dist/src/codegen/generator/state.js.map +1 -1
  10. package/dist/src/codegen/generator/tables.d.ts +6 -0
  11. package/dist/src/codegen/generator/tables.js +38 -0
  12. package/dist/src/codegen/generator/tables.js.map +1 -1
  13. package/dist/src/driver/bundler/commonjs.d.ts +52 -0
  14. package/dist/src/driver/bundler/commonjs.js +493 -0
  15. package/dist/src/driver/bundler/commonjs.js.map +1 -0
  16. package/dist/src/driver/bundler/graph.js +14 -0
  17. package/dist/src/driver/bundler/graph.js.map +1 -1
  18. package/dist/src/driver/bundler/merge.js +14 -0
  19. package/dist/src/driver/bundler/merge.js.map +1 -1
  20. package/dist/src/driver/bundler/types.d.ts +8 -0
  21. package/dist/src/driver/compiler.d.ts +8 -1
  22. package/dist/src/driver/compiler.js +73 -5
  23. package/dist/src/driver/compiler.js.map +1 -1
  24. package/dist/src/driver/config.d.ts +53 -0
  25. package/dist/src/driver/config.js +141 -0
  26. package/dist/src/driver/config.js.map +1 -0
  27. package/dist/src/driver/icon.d.ts +62 -0
  28. package/dist/src/driver/icon.js +151 -0
  29. package/dist/src/driver/icon.js.map +1 -0
  30. package/dist/src/driver/index.d.ts +4 -0
  31. package/dist/src/driver/index.js +4 -0
  32. package/dist/src/driver/index.js.map +1 -1
  33. package/dist/src/driver/mac-bundle.d.ts +41 -0
  34. package/dist/src/driver/mac-bundle.js +123 -0
  35. package/dist/src/driver/mac-bundle.js.map +1 -0
  36. package/dist/src/driver/win-icon.d.ts +27 -0
  37. package/dist/src/driver/win-icon.js +80 -0
  38. package/dist/src/driver/win-icon.js.map +1 -0
  39. package/dist/src/parser/statements.js +17 -4
  40. package/dist/src/parser/statements.js.map +1 -1
  41. package/dist/tests/cli/main.test.js +46 -1
  42. package/dist/tests/cli/main.test.js.map +1 -1
  43. package/dist/tests/driver/config.test.d.ts +1 -0
  44. package/dist/tests/driver/config.test.js +124 -0
  45. package/dist/tests/driver/config.test.js.map +1 -0
  46. package/dist/tests/driver/icon.test.d.ts +1 -0
  47. package/dist/tests/driver/icon.test.js +421 -0
  48. package/dist/tests/driver/icon.test.js.map +1 -0
  49. package/dist/tests/driver/modules.test.js +109 -0
  50. package/dist/tests/driver/modules.test.js.map +1 -1
  51. package/dist/tests/e2e/fetch.test.d.ts +12 -0
  52. package/dist/tests/e2e/fetch.test.js +272 -0
  53. package/dist/tests/e2e/fetch.test.js.map +1 -0
  54. package/dist/tests/e2e/gc.test.d.ts +1 -0
  55. package/dist/tests/e2e/gc.test.js +168 -0
  56. package/dist/tests/e2e/gc.test.js.map +1 -0
  57. package/dist/tests/e2e/gui-dom.test.d.ts +5 -0
  58. package/dist/tests/e2e/gui-dom.test.js +102 -0
  59. package/dist/tests/e2e/gui-dom.test.js.map +1 -0
  60. package/dist/tests/e2e/gui-events.test.d.ts +5 -0
  61. package/dist/tests/e2e/gui-events.test.js +60 -0
  62. package/dist/tests/e2e/gui-events.test.js.map +1 -0
  63. package/dist/tests/e2e/gui-helpers.d.ts +31 -0
  64. package/dist/tests/e2e/gui-helpers.js +74 -0
  65. package/dist/tests/e2e/gui-helpers.js.map +1 -0
  66. package/dist/tests/e2e/gui-layout.test.d.ts +4 -0
  67. package/dist/tests/e2e/gui-layout.test.js +88 -0
  68. package/dist/tests/e2e/gui-layout.test.js.map +1 -0
  69. package/dist/tests/e2e/gui-lifecycle.test.d.ts +5 -0
  70. package/dist/tests/e2e/gui-lifecycle.test.js +58 -0
  71. package/dist/tests/e2e/gui-lifecycle.test.js.map +1 -0
  72. package/dist/tests/e2e/gui-paint.test.d.ts +5 -0
  73. package/dist/tests/e2e/gui-paint.test.js +111 -0
  74. package/dist/tests/e2e/gui-paint.test.js.map +1 -0
  75. package/dist/tests/e2e/gui-script.test.d.ts +5 -0
  76. package/dist/tests/e2e/gui-script.test.js +78 -0
  77. package/dist/tests/e2e/gui-script.test.js.map +1 -0
  78. package/dist/tests/e2e/gui-style.test.d.ts +5 -0
  79. package/dist/tests/e2e/gui-style.test.js +175 -0
  80. package/dist/tests/e2e/gui-style.test.js.map +1 -0
  81. package/dist/tests/e2e/harness.d.ts +2 -0
  82. package/dist/tests/e2e/harness.js +1 -0
  83. package/dist/tests/e2e/harness.js.map +1 -1
  84. package/dist/tests/e2e/icon.test.d.ts +7 -0
  85. package/dist/tests/e2e/icon.test.js +80 -0
  86. package/dist/tests/e2e/icon.test.js.map +1 -0
  87. package/dist/tests/e2e/npm-modules.test.d.ts +4 -1
  88. package/dist/tests/e2e/npm-modules.test.js +47 -1
  89. package/dist/tests/e2e/npm-modules.test.js.map +1 -1
  90. package/dist/tests/e2e/runtime-coverage-typed-array.test.d.ts +9 -0
  91. package/dist/tests/e2e/runtime-coverage-typed-array.test.js +140 -0
  92. package/dist/tests/e2e/runtime-coverage-typed-array.test.js.map +1 -0
  93. package/dist/tests/parser/statements.test.js +11 -0
  94. package/dist/tests/parser/statements.test.js.map +1 -1
  95. package/package.json +3 -2
  96. package/runtime/ext_gui/css.cpp +4 -517
  97. package/runtime/ext_gui/css_internal.h +27 -0
  98. package/runtime/ext_gui/css_match.cpp +195 -0
  99. package/runtime/ext_gui/css_selector.cpp +207 -0
  100. package/runtime/ext_gui/css_sheet.cpp +129 -0
  101. package/runtime/ext_gui/dom.cpp +7 -403
  102. package/runtime/ext_gui/dom_api.cpp +63 -1146
  103. package/runtime/ext_gui/dom_api_document.cpp +96 -0
  104. package/runtime/ext_gui/dom_api_events.cpp +123 -0
  105. package/runtime/ext_gui/dom_api_internal.h +135 -0
  106. package/runtime/ext_gui/dom_api_node.cpp +329 -0
  107. package/runtime/ext_gui/dom_api_node_read.cpp +294 -0
  108. package/runtime/ext_gui/dom_api_proto.cpp +135 -0
  109. package/runtime/ext_gui/dom_api_style.cpp +192 -0
  110. package/runtime/ext_gui/dom_internal.h +39 -0
  111. package/runtime/ext_gui/dom_parse.cpp +348 -0
  112. package/runtime/ext_gui/dom_serialize.cpp +54 -0
  113. package/runtime/ext_gui/gui.cpp +56 -286
  114. package/runtime/ext_gui/gui_events.cpp +294 -0
  115. package/runtime/ext_gui/gui_internal.h +29 -0
  116. package/runtime/ext_gui/layout.cpp +6 -597
  117. package/runtime/ext_gui/layout_flex.cpp +200 -0
  118. package/runtime/ext_gui/layout_flow.cpp +191 -0
  119. package/runtime/ext_gui/layout_flow_internal.h +149 -0
  120. package/runtime/ext_gui/layout_inline.cpp +181 -0
  121. package/runtime/ext_gui/layout_internal.h +20 -0
  122. package/runtime/ext_gui/renderer.cpp +15 -679
  123. package/runtime/ext_gui/renderer_image.cpp +233 -0
  124. package/runtime/ext_gui/renderer_internal.h +112 -0
  125. package/runtime/ext_gui/renderer_shaders.h +108 -0
  126. package/runtime/ext_gui/renderer_text.cpp +342 -0
  127. package/runtime/ext_gui/style.cpp +12 -660
  128. package/runtime/ext_gui/style_internal.h +33 -0
  129. package/runtime/ext_gui/style_print.cpp +113 -0
  130. package/runtime/ext_gui/style_ua.cpp +98 -0
  131. package/runtime/ext_gui/style_values.cpp +468 -0
  132. package/runtime/ext_gui/window.cpp +1 -0
  133. package/runtime/ext_node/buffer/parts/prototype.inc +1 -0
  134. package/runtime/ext_node/dgram/dgram.c +1 -0
  135. package/runtime/ext_node/events/events.c +1 -0
  136. package/runtime/ext_node/fs/fs_ops.c +10 -25
  137. package/runtime/ext_node/fs/glob.c +13 -30
  138. package/runtime/ext_node/fs/promises.c +1 -0
  139. package/runtime/ext_node/http/parts/prototypes.inc +5 -0
  140. package/runtime/ext_node/net/parts/prototypes.inc +2 -0
  141. package/runtime/ext_node/process/process.c +9 -7
  142. package/runtime/ext_node/stream/stream.c +1 -0
  143. package/runtime/ext_node/util/util.c +6 -6
  144. package/runtime/rt.h +16 -0
  145. package/runtime/rt_internal.h +67 -2
  146. package/runtime/xt_alloc.c +442 -5
  147. package/runtime/xt_builtins.c +1 -0
  148. package/runtime/xt_containers/access.inc +32 -1
  149. package/runtime/xt_fetch/buffer.inc +64 -0
  150. package/runtime/xt_fetch/headers.inc +312 -0
  151. package/runtime/xt_fetch/request.inc +386 -0
  152. package/runtime/xt_fetch/response.inc +107 -0
  153. package/runtime/xt_fetch/socket.inc +72 -0
  154. package/runtime/xt_fetch/url.inc +108 -0
  155. package/runtime/xt_fetch.c +39 -0
  156. package/runtime/xt_generator.c +95 -1
  157. package/runtime/xt_loop.c +35 -1
  158. package/runtime/xt_promise.c +46 -0
  159. package/runtime/xt_stdlib2/error.inc +1 -0
  160. package/runtime/xt_stdlib2/regexp-match.inc +8 -7
  161. package/runtime/xt_stdlib2/set.inc +1 -1
  162. package/runtime/xt_symbol.c +2 -0
  163. package/runtime/xt_typed_array/construction.inc +142 -0
  164. package/runtime/xt_typed_array/elements.inc +92 -0
  165. package/runtime/xt_typed_array/methods.inc +329 -0
  166. package/runtime/xt_typed_array.c +72 -0
  167. package/runtime/xt_values/number-format.inc +26 -0
  168. package/scripts/check-file-length.ts +85 -0
  169. package/src/cli/main.ts +137 -29
  170. package/src/codegen/generator/calls/access.ts +9 -1
  171. package/src/codegen/generator/module.ts +10 -0
  172. package/src/codegen/generator/state.ts +24 -0
  173. package/src/codegen/generator/tables.ts +40 -0
  174. package/src/driver/bundler/commonjs.ts +553 -0
  175. package/src/driver/bundler/graph.ts +14 -0
  176. package/src/driver/bundler/merge.ts +15 -0
  177. package/src/driver/bundler/types.ts +8 -0
  178. package/src/driver/compiler.ts +83 -5
  179. package/src/driver/config.ts +173 -0
  180. package/src/driver/icon.ts +184 -0
  181. package/src/driver/index.ts +30 -0
  182. package/src/driver/mac-bundle.ts +156 -0
  183. package/src/driver/win-icon.ts +96 -0
  184. package/src/parser/statements.ts +17 -4
  185. package/dist/tests/e2e/gui.test.d.ts +0 -12
  186. package/dist/tests/e2e/gui.test.js +0 -702
  187. package/dist/tests/e2e/gui.test.js.map +0 -1
@@ -2,6 +2,7 @@
2
2
 
3
3
  static xt_value xt_http_server_proto(void) {
4
4
  static xt_value proto = 0;
5
+ xt_gc_add_root(&proto);
5
6
  if (proto) return proto;
6
7
  proto = xt_object_new();
7
8
  xt_node_install_emitter(proto);
@@ -13,6 +14,7 @@ static xt_value xt_http_server_proto(void) {
13
14
 
14
15
  static xt_value xt_http_response_proto(void) {
15
16
  static xt_value proto = 0;
17
+ xt_gc_add_root(&proto);
16
18
  if (proto) return proto;
17
19
  proto = xt_object_new();
18
20
  xt_node_install_emitter(proto);
@@ -28,6 +30,7 @@ static xt_value xt_http_response_proto(void) {
28
30
 
29
31
  static xt_value xt_http_request_proto(void) {
30
32
  static xt_value proto = 0;
33
+ xt_gc_add_root(&proto);
31
34
  if (proto) return proto;
32
35
  proto = xt_object_new();
33
36
  xt_node_install_emitter(proto);
@@ -37,6 +40,7 @@ static xt_value xt_http_request_proto(void) {
37
40
 
38
41
  static xt_value xt_http_client_proto(void) {
39
42
  static xt_value proto = 0;
43
+ xt_gc_add_root(&proto);
40
44
  if (proto) return proto;
41
45
  proto = xt_object_new();
42
46
  xt_node_install_emitter(proto);
@@ -49,6 +53,7 @@ static xt_value xt_http_client_proto(void) {
49
53
 
50
54
  static xt_value xt_http_client_response_proto(void) {
51
55
  static xt_value proto = 0;
56
+ xt_gc_add_root(&proto);
52
57
  if (proto) return proto;
53
58
  proto = xt_object_new();
54
59
  xt_node_install_emitter(proto);
@@ -2,6 +2,7 @@
2
2
 
3
3
  static xt_value xt_net_socket_proto(void) {
4
4
  static xt_value proto = 0;
5
+ xt_gc_add_root(&proto);
5
6
  if (proto) return proto;
6
7
  proto = xt_object_new();
7
8
  xt_node_install_emitter(proto);
@@ -22,6 +23,7 @@ static xt_value xt_net_socket_proto(void) {
22
23
 
23
24
  static xt_value xt_net_server_proto(void) {
24
25
  static xt_value proto = 0;
26
+ xt_gc_add_root(&proto);
25
27
  if (proto) return proto;
26
28
  proto = xt_object_new();
27
29
  xt_node_install_emitter(proto);
@@ -70,16 +70,18 @@ static xt_value xt_process_env(void) {
70
70
 
71
71
  static xt_value xt_process_argv(void) {
72
72
  int32_t count = xt_program_argc;
73
- if (count <= 0 || !xt_program_argv) return xt_array_new(0, NULL);
73
+ /* Fill an `xt_array` element by element rather than a raw `xt_value` buffer:
74
+ the collector cannot see a plain malloc'd buffer, so strings created here
75
+ would be swept as soon as a later element allocates (demonstrated by
76
+ `process.argv` returning recycled strings under GC stress). The array is a
77
+ stack local, so the conservative scan keeps it and its elements alive. */
78
+ xt_value result = xt_array_new(0, NULL);
79
+ if (count <= 0 || !xt_program_argv) return result;
74
80
  /* Node semantics: `[execPath, scriptPath, ...args]`. A standalone binary is
75
81
  both the executable and the script, so the executable path is repeated;
76
82
  user arguments therefore start at index 2, matching `node script.js a b`. */
77
- xt_value *items = (xt_value *)malloc(sizeof(xt_value) * (size_t)(count + 1));
78
- if (!items) return xt_array_new(0, NULL);
79
- items[0] = xt_string_from_cstr(xt_program_argv[0]);
80
- for (int32_t i = 0; i < count; i++) items[i + 1] = xt_string_from_cstr(xt_program_argv[i]);
81
- xt_value result = xt_array_new(count + 1, items);
82
- free(items);
83
+ xt_array_push(result, xt_string_from_cstr(xt_program_argv[0]));
84
+ for (int32_t i = 0; i < count; i++) xt_array_push(result, xt_string_from_cstr(xt_program_argv[i]));
83
85
  return result;
84
86
  }
85
87
 
@@ -363,6 +363,7 @@ xt_value xt_stream_static(xt_value name, int32_t argc, xt_value *argv) {
363
363
 
364
364
  static xt_value xt_stream_proto(void) {
365
365
  static xt_value proto = 0;
366
+ xt_gc_add_root(&proto);
366
367
  if (proto) return proto;
367
368
  proto = xt_object_new();
368
369
  xt_node_install_emitter(proto);
@@ -363,13 +363,13 @@ static xt_value util_promisify_executor(xt_value thisValue, xt_value env, int32_
363
363
  xt_value resolve = xt_arg(argc, argv, 0);
364
364
  xt_value reject = xt_arg(argc, argv, 1);
365
365
  int32_t count = (int32_t)xt_to_number(xt_array_length(args));
366
- xt_value *callArgs = (xt_value *)malloc(sizeof(xt_value) * (size_t)(count + 1));
367
- if (!callArgs) return xt_undefined();
368
- for (int32_t i = 0; i < count; i++) callArgs[i] = xt_array_get(args, xt_number((double)i));
366
+ /* An `xt_array` keeps the arguments, and the freshly created callback
367
+ closure, reachable if the call below triggers a collection. */
368
+ xt_value argArray = xt_array_new(0, NULL);
369
+ for (int32_t i = 0; i < count; i++) xt_array_push(argArray, xt_array_get(args, xt_number((double)i)));
369
370
  xt_value callbackEnv[2] = {resolve, reject};
370
- callArgs[count] = xt_closure_new((void *)util_promisify_callback, 2, callbackEnv);
371
- if (XT_IS_FUNCTION(fn)) xt_closure_call(fn, count + 1, callArgs);
372
- free(callArgs);
371
+ xt_array_push(argArray, xt_closure_new((void *)util_promisify_callback, 2, callbackEnv));
372
+ if (XT_IS_FUNCTION(fn)) xt_closure_call(fn, count + 1, xt_as_array(argArray)->items);
373
373
  return xt_undefined();
374
374
  }
375
375
 
package/runtime/rt.h CHANGED
@@ -218,6 +218,12 @@ xt_value xt_crypto_create_hash(int32_t argc, xt_value *argv);
218
218
  /* -- node:child_process --------------------------------------------------- */
219
219
  xt_value xt_child_process_spawn_sync(int32_t argc, xt_value *argv);
220
220
 
221
+ /* -- fetch ---------------------------------------------------------------- */
222
+ /** Implements the global `fetch(input, init)`; returns a settled promise. */
223
+ xt_value xt_fetch(int32_t argc, xt_value *argv);
224
+ /** Construct a `TypeError` with one message argument (used by `fetch`). */
225
+ xt_value xt_type_error_ctor(int32_t argc, xt_value *argv);
226
+
221
227
  /* -- promises / async ----------------------------------------------------- */
222
228
  xt_value xt_promise_resolve(xt_value value);
223
229
  xt_value xt_promise_reject(xt_value value);
@@ -356,6 +362,16 @@ void xt_println(xt_value v);
356
362
  size_t xt_heap_bytes(void);
357
363
  size_t xt_heap_allocations(void);
358
364
 
365
+ /* -- garbage collector ---------------------------------------------------- */
366
+ /**
367
+ * Register `slot` as a GC root: a static prototype cache or any value cell
368
+ * that lives outside the heap graph. The slot may be registered before it
369
+ * holds a value; it is marked on every collection and registration is
370
+ * idempotent. `xt_gc_add_root_range` registers `count` consecutive cells.
371
+ */
372
+ void xt_gc_add_root(xt_value *slot);
373
+ void xt_gc_add_root_range(xt_value *base, size_t count);
374
+
359
375
  #ifdef __cplusplus
360
376
  }
361
377
  #endif
@@ -52,7 +52,8 @@
52
52
  #define XT_OBJECT_KIND_GENERATOR 13
53
53
  #define XT_OBJECT_KIND_ITERATOR 14
54
54
 
55
- /* Common header for every heap object. */
55
+ /* Common header for every heap object. `flags` bit 0 is the collector's mark
56
+ * bit; it is cleared on every surviving object at the end of a sweep. */
56
57
  typedef struct xt_header {
57
58
  uint8_t kind;
58
59
  uint8_t flags;
@@ -61,6 +62,8 @@ typedef struct xt_header {
61
62
  struct xt_header *gc_next;
62
63
  } xt_header;
63
64
 
65
+ #define XT_GC_MARK 0x01u
66
+
64
67
  typedef struct {
65
68
  xt_header header;
66
69
  uint32_t length;
@@ -122,9 +125,67 @@ typedef struct {
122
125
  uint8_t is_generator;
123
126
  } xt_function;
124
127
 
125
- /* Allocation (xt_alloc.c). */
128
+ /* Allocation and garbage collection (xt_alloc.c).
129
+ *
130
+ * The collector is a non-moving mark-sweep over the linked list of every
131
+ * allocation. Roots are (a) explicitly registered value slots, (b) root
132
+ * providers registered by runtime subsystems and extensions, and (c) a
133
+ * conservative scan of the active C stack (plus a setjmp buffer for the
134
+ * callee-saved registers). Heap objects are traced precisely for their own
135
+ * value fields, with a conservative scan of their payload for the raw pointer
136
+ * fields that older code still stores directly. */
126
137
  void *xt_alloc(size_t size, int kind);
127
138
 
139
+ /* Record the current stack as the base of the root set. Call once, as early as
140
+ * possible, before any allocation (generated `main` does this). */
141
+ void xt_gc_init(void);
142
+ /* Record the high bound of the main stack. The generated `main` passes the
143
+ * address of one of its own locals, which lives above every frame its callees
144
+ * ever use, so the conservative scan reaches spilled roots. Without this the
145
+ * bound would be taken from inside the runtime and would cut off the top of
146
+ * the caller's frame. Safe to call before `xt_gc_init`. */
147
+ void xt_gc_set_stack_base(void *base);
148
+ /* Enable automatic collection once the heap crosses the threshold. Programs
149
+ * that never arm the collector still get `xt_gc_collect()` on demand. */
150
+ void xt_gc_arm(void);
151
+ /* Run a full collection now. Re-entrant calls are ignored. */
152
+ void xt_gc_collect(void);
153
+ /* Override the automatic trigger threshold (bytes of live heap). */
154
+ void xt_gc_set_threshold(size_t bytes);
155
+
156
+ /* Explicit roots: the address of a slot that always holds a live value (a
157
+ * module global, a runtime prototype cache, ...). */
158
+ void xt_gc_add_root(xt_value *slot);
159
+ void xt_gc_add_root_range(xt_value *base, size_t count);
160
+ /* Subsystems whose live set is not reachable through value slots (the event
161
+ * loop's timers, the promise microtask queue, ...) register a provider that
162
+ * marks its reachable objects. Providers run during every collection. */
163
+ void xt_gc_register_root_provider(void (*provider)(void));
164
+
165
+ /* Track the active C stack so the conservative scan has an upper bound. The
166
+ * initial region is installed by `xt_gc_init`; each generator pushes its own
167
+ * private stack while it runs. Before switching to a deeper region the caller
168
+ * records where its own stack was suspended, so every active region is scanned
169
+ * and suspended callers stay reachable. */
170
+ void xt_gc_push_stack(uintptr_t low, uintptr_t high);
171
+ /* Mark the currently-executing region as suspended at `sp` (its frames above
172
+ * `sp` stay live while a deeper generator region runs). */
173
+ void xt_gc_suspend(uintptr_t sp);
174
+ void xt_gc_pop_stack(void);
175
+
176
+ /* Marking primitives used by root providers and per-kind trace hooks. */
177
+ void xt_gc_mark_value(xt_value value);
178
+ void xt_gc_mark_header(xt_header *header);
179
+ /* Conservatively mark every pointer-sized word in `[base, base + bytes)`. */
180
+ void xt_gc_scan_region(const void *base, size_t bytes);
181
+
182
+ /* Kind-specific hooks for allocations with separately allocated sub-objects.
183
+ * Implemented by the translation unit that owns the representation. */
184
+ void xt_promise_gc_trace(xt_header *header);
185
+ void xt_promise_gc_release(xt_header *header);
186
+ void xt_generator_gc_trace(xt_header *header);
187
+ void xt_generator_gc_release(xt_header *header);
188
+
128
189
  /* Value / string helpers shared across translation units (xt_values.c). */
129
190
  xt_string *xt_string_alloc(size_t length);
130
191
  xt_string *xt_as_string(xt_value value);
@@ -286,4 +347,8 @@ int xt_value_equals(xt_value a, xt_value b);
286
347
  xt_array *xt_as_array(xt_value value);
287
348
  xt_value xt_arg_at(int32_t argc, xt_value *argv, int32_t index);
288
349
 
350
+ /* Typed arrays (xt_typed_array.c). */
351
+ int xt_typed_array_kind_of(xt_value value);
352
+ double xt_typed_array_coerce(int kind, double value);
353
+
289
354
  #endif /* XT_RT_INTERNAL_H */