@agoric/xsnap 0.14.3-u14.0 → 0.14.3-u16.0

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 (137) hide show
  1. package/README.md +3 -3
  2. package/api.js +4 -2
  3. package/build.env +1 -1
  4. package/moddable/modules/data/base64/base64.js +28 -0
  5. package/moddable/modules/data/base64/manifest.json +11 -0
  6. package/moddable/modules/data/base64/modBase64.c +188 -0
  7. package/moddable/modules/data/binaryMessage/BinaryMessage.js +106 -0
  8. package/moddable/modules/data/crc/crc.c +205 -0
  9. package/moddable/modules/data/crc/crc.js +36 -0
  10. package/moddable/modules/data/crc/manifest.json +8 -0
  11. package/moddable/modules/data/hex/hex.js +28 -0
  12. package/moddable/modules/data/hex/manifest.json +11 -0
  13. package/moddable/modules/data/hex/modHex.c +139 -0
  14. package/moddable/modules/data/logical/logical.js +32 -0
  15. package/moddable/modules/data/logical/modLogical.c +98 -0
  16. package/moddable/modules/data/qrcode/manifest.json +9 -0
  17. package/moddable/modules/data/qrcode/qrcode.c +93 -0
  18. package/moddable/modules/data/qrcode/qrcode.js +23 -0
  19. package/moddable/modules/data/qrcode/qrcodegen.c +1025 -0
  20. package/moddable/modules/data/qrcode/qrcodegen.h +267 -0
  21. package/moddable/modules/data/text/decoder/manifest.json +8 -0
  22. package/moddable/modules/data/text/decoder/textdecoder.c +480 -0
  23. package/moddable/modules/data/text/decoder/textdecoder.js +27 -0
  24. package/moddable/modules/data/text/encoder/manifest.json +8 -0
  25. package/moddable/modules/data/text/encoder/textencoder.c +232 -0
  26. package/moddable/modules/data/text/encoder/textencoder.js +24 -0
  27. package/moddable/modules/data/tinyint/tinyint.c +150 -0
  28. package/moddable/modules/data/tinyint/tinyint.js +53 -0
  29. package/moddable/modules/data/url/manifest.json +17 -0
  30. package/moddable/modules/data/url/url.c +1959 -0
  31. package/moddable/modules/data/url/url.js +210 -0
  32. package/moddable/modules/data/wavreader/manifest.json +8 -0
  33. package/moddable/modules/data/wavreader/wavreader.js +128 -0
  34. package/moddable/modules/data/zlib/deflate.c +161 -0
  35. package/moddable/modules/data/zlib/deflate.js +63 -0
  36. package/moddable/modules/data/zlib/inflate.c +145 -0
  37. package/moddable/modules/data/zlib/inflate.js +66 -0
  38. package/moddable/modules/data/zlib/manifest_deflate.json +9 -0
  39. package/moddable/modules/data/zlib/manifest_inflate.json +9 -0
  40. package/moddable/modules/data/zlib/miniz.c +4924 -0
  41. package/moddable/xs/includes/xs.d.ts +73 -0
  42. package/moddable/xs/includes/xs.h +1533 -0
  43. package/moddable/xs/includes/xsmc.h +206 -0
  44. package/moddable/xs/makefiles/lin/makefile +33 -0
  45. package/moddable/xs/makefiles/lin/xsc.mk +118 -0
  46. package/moddable/xs/makefiles/lin/xsid.mk +90 -0
  47. package/moddable/xs/makefiles/lin/xsl.mk +168 -0
  48. package/moddable/xs/makefiles/lin/xst.mk +201 -0
  49. package/moddable/xs/makefiles/mac/makefile +33 -0
  50. package/moddable/xs/makefiles/mac/xsc.mk +130 -0
  51. package/moddable/xs/makefiles/mac/xsid.mk +102 -0
  52. package/moddable/xs/makefiles/mac/xsl.mk +177 -0
  53. package/moddable/xs/makefiles/mac/xst.mk +203 -0
  54. package/moddable/xs/makefiles/mac/xst_no_asan.txt +52 -0
  55. package/moddable/xs/makefiles/win/build.bat +26 -0
  56. package/moddable/xs/makefiles/win/xsc.mak +142 -0
  57. package/moddable/xs/makefiles/win/xsid.mak +113 -0
  58. package/moddable/xs/makefiles/win/xsl.mak +186 -0
  59. package/moddable/xs/makefiles/win/xst.mak +195 -0
  60. package/moddable/xs/platforms/lin_xs.h +99 -0
  61. package/moddable/xs/platforms/mac_xs.h +97 -0
  62. package/moddable/xs/platforms/wasm_xs.h +79 -0
  63. package/moddable/xs/platforms/win_xs.h +104 -0
  64. package/moddable/xs/platforms/xsHost.h +63 -0
  65. package/moddable/xs/platforms/xsPlatform.h +618 -0
  66. package/moddable/xs/sources/xsAPI.c +2555 -0
  67. package/moddable/xs/sources/xsAll.c +294 -0
  68. package/moddable/xs/sources/xsAll.h +2741 -0
  69. package/moddable/xs/sources/xsArguments.c +222 -0
  70. package/moddable/xs/sources/xsArray.c +2657 -0
  71. package/moddable/xs/sources/xsAtomics.c +844 -0
  72. package/moddable/xs/sources/xsBigInt.c +1859 -0
  73. package/moddable/xs/sources/xsBoolean.c +109 -0
  74. package/moddable/xs/sources/xsCode.c +4493 -0
  75. package/moddable/xs/sources/xsCommon.c +1710 -0
  76. package/moddable/xs/sources/xsCommon.h +1142 -0
  77. package/moddable/xs/sources/xsDataView.c +2890 -0
  78. package/moddable/xs/sources/xsDate.c +1541 -0
  79. package/moddable/xs/sources/xsDebug.c +2710 -0
  80. package/moddable/xs/sources/xsDefaults.c +134 -0
  81. package/moddable/xs/sources/xsError.c +353 -0
  82. package/moddable/xs/sources/xsFunction.c +776 -0
  83. package/moddable/xs/sources/xsGenerator.c +865 -0
  84. package/moddable/xs/sources/xsGlobal.c +839 -0
  85. package/moddable/xs/sources/xsJSON.c +1091 -0
  86. package/moddable/xs/sources/xsLexical.c +1969 -0
  87. package/moddable/xs/sources/xsLockdown.c +933 -0
  88. package/moddable/xs/sources/xsMapSet.c +1649 -0
  89. package/moddable/xs/sources/xsMarshall.c +1020 -0
  90. package/moddable/xs/sources/xsMath.c +624 -0
  91. package/moddable/xs/sources/xsMemory.c +1941 -0
  92. package/moddable/xs/sources/xsModule.c +3101 -0
  93. package/moddable/xs/sources/xsNumber.c +560 -0
  94. package/moddable/xs/sources/xsObject.c +1102 -0
  95. package/moddable/xs/sources/xsPlatforms.c +480 -0
  96. package/moddable/xs/sources/xsProfile.c +577 -0
  97. package/moddable/xs/sources/xsPromise.c +1199 -0
  98. package/moddable/xs/sources/xsProperty.c +636 -0
  99. package/moddable/xs/sources/xsProxy.c +1014 -0
  100. package/moddable/xs/sources/xsRegExp.c +1168 -0
  101. package/moddable/xs/sources/xsRun.c +4889 -0
  102. package/moddable/xs/sources/xsScope.c +1293 -0
  103. package/moddable/xs/sources/xsScript.c +288 -0
  104. package/moddable/xs/sources/xsScript.h +1186 -0
  105. package/moddable/xs/sources/xsSnapshot.c +2161 -0
  106. package/moddable/xs/sources/xsSnapshot.h +51 -0
  107. package/moddable/xs/sources/xsSourceMap.c +218 -0
  108. package/moddable/xs/sources/xsString.c +3332 -0
  109. package/moddable/xs/sources/xsSymbol.c +503 -0
  110. package/moddable/xs/sources/xsSyntaxical.c +4193 -0
  111. package/moddable/xs/sources/xsTree.c +1893 -0
  112. package/moddable/xs/sources/xsType.c +1488 -0
  113. package/moddable/xs/sources/xsdtoa.c +6672 -0
  114. package/moddable/xs/sources/xsmc.c +340 -0
  115. package/moddable/xs/sources/xsre.c +7578 -0
  116. package/package.json +37 -20
  117. package/scripts/get_xsnap_version.sh +14 -0
  118. package/scripts/test-package.sh +21 -0
  119. package/src/avaAssertXS.js +6 -2
  120. package/src/avaHandler.cjs +2 -5
  121. package/src/avaXS.js +7 -8
  122. package/src/build.js +161 -28
  123. package/src/replay.js +0 -3
  124. package/src/xsnap.js +105 -91
  125. package/src/xsrepl.js +2 -3
  126. package/xsnap-native/xsnap/makefiles/lin/makefile +10 -0
  127. package/xsnap-native/xsnap/makefiles/lin/xsnap-worker.mk +156 -0
  128. package/xsnap-native/xsnap/makefiles/lin/xsnap.mk +144 -0
  129. package/xsnap-native/xsnap/makefiles/mac/makefile +10 -0
  130. package/xsnap-native/xsnap/makefiles/mac/xsnap-worker.mk +165 -0
  131. package/xsnap-native/xsnap/makefiles/mac/xsnap.mk +153 -0
  132. package/xsnap-native/xsnap/sources/xsnap-worker.c +1008 -0
  133. package/xsnap-native/xsnap/sources/xsnap.c +717 -0
  134. package/xsnap-native/xsnap/sources/xsnap.h +142 -0
  135. package/xsnap-native/xsnap/sources/xsnapPlatform.c +1501 -0
  136. package/xsnap-native/xsnap/sources/xsnapPlatform.h +105 -0
  137. package/CHANGELOG.md +0 -654
@@ -0,0 +1,2741 @@
1
+ /*
2
+ * Copyright (c) 2016-2018 Moddable Tech, Inc.
3
+ *
4
+ * This file is part of the Moddable SDK Runtime.
5
+ *
6
+ * The Moddable SDK Runtime is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Lesser General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * The Moddable SDK Runtime is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public License
17
+ * along with the Moddable SDK Runtime. If not, see <http://www.gnu.org/licenses/>.
18
+ *
19
+ * This file incorporates work covered by the following copyright and
20
+ * permission notice:
21
+ *
22
+ * Copyright (C) 2010-2016 Marvell International Ltd.
23
+ * Copyright (C) 2002-2010 Kinoma, Inc.
24
+ *
25
+ * Licensed under the Apache License, Version 2.0 (the "License");
26
+ * you may not use this file except in compliance with the License.
27
+ * You may obtain a copy of the License at
28
+ *
29
+ * http://www.apache.org/licenses/LICENSE-2.0
30
+ *
31
+ * Unless required by applicable law or agreed to in writing, software
32
+ * distributed under the License is distributed on an "AS IS" BASIS,
33
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
+ * See the License for the specific language governing permissions and
35
+ * limitations under the License.
36
+ */
37
+
38
+ #ifndef __XSALL__
39
+ #define __XSALL__
40
+
41
+ #include "xsCommon.h"
42
+
43
+ #ifdef __cplusplus
44
+ extern "C" {
45
+ #endif
46
+
47
+ //#define mxFrequency 1
48
+ #ifndef mxBoundsCheck
49
+ #ifdef mxDebug
50
+ #define mxBoundsCheck 1
51
+ #else
52
+ #define mxBoundsCheck 0
53
+ #endif
54
+ #endif
55
+ #ifndef mxRegExp
56
+ #define mxRegExp 1
57
+ #endif
58
+ #ifndef mxMachinePlatform
59
+ #define mxMachinePlatform \
60
+ void* host;
61
+ #endif
62
+
63
+ typedef struct sxMachine txMachine;
64
+ typedef struct sxSlot txSlot;
65
+ typedef struct sxBlock txBlock;
66
+ typedef struct sxChunk txChunk;
67
+ typedef struct sxJump txJump;
68
+ typedef struct sxProfileRecord txProfileRecord;
69
+ typedef struct sxCreation txCreation;
70
+ typedef struct sxPreparation txPreparation;
71
+ typedef struct sxHostFunctionBuilder txHostFunctionBuilder;
72
+ typedef struct sxHostHooks txHostHooks;
73
+ typedef struct sxInspectorNameLink txInspectorNameLink;
74
+ typedef struct sxInspectorNameList txInspectorNameList;
75
+
76
+ typedef txBoolean (*txArchiveRead)(void* src, size_t offset, void* buffer, size_t size);
77
+ typedef txBoolean (*txArchiveWrite)(void* dst, size_t offset, void* buffer, size_t size);
78
+ typedef void (*txCallback)(txMachine*);
79
+ typedef txCallback (*txCallbackAt)(txID index);
80
+ typedef void (*txDestructor)(void*);
81
+ typedef void (*txMarkRoot)(txMachine*, txSlot*);
82
+ typedef void (*txMarker)(txMachine*, void*, txMarkRoot);
83
+ typedef void (*txStep)(txMachine*, txSlot*, txID, txIndex, txSlot*);
84
+ typedef void (*txSweepRoot)(txMachine*, txSlot*);
85
+ typedef void (*txSweeper)(txMachine*, void*, txSweepRoot);
86
+ typedef void (*txTypeCallback)(txMachine*, txSlot*, txInteger, txSlot*, int);
87
+ typedef void (*txTypeCoerce)(txMachine*, txSlot*);
88
+ typedef int (*txTypeCompare)(const void*, const void*);
89
+ typedef void (*txTypeOperator)(txMachine*, txSlot*, txInteger, txSlot*, int, int);
90
+ typedef txInteger (*txTypeWait)(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, txNumber timeout);
91
+
92
+ typedef void (*txBehaviorCall)(txMachine* the, txSlot* instance, txSlot* _this, txSlot* arguments);
93
+ typedef void (*txBehaviorConstruct)(txMachine* the, txSlot* instance, txSlot* arguments, txSlot* target);
94
+ typedef txBoolean (*txBehaviorDefineOwnProperty)(txMachine* the, txSlot* instance, txID id, txIndex index, txSlot* slot, txFlag mask);
95
+ typedef txBoolean (*txBehaviorDeleteProperty)(txMachine* the, txSlot* instance, txID id, txIndex index);
96
+ typedef txBoolean (*txBehaviorGetOwnProperty)(txMachine* the, txSlot* instance, txID id, txIndex index, txSlot* slot);
97
+ typedef txSlot* (*txBehaviorGetProperty)(txMachine* the, txSlot* instance, txID id, txIndex index, txFlag flag);
98
+ typedef txBoolean (*txBehaviorGetPropertyValue)(txMachine* the, txSlot* instance, txID id, txIndex index, txSlot* receiver, txSlot* value);
99
+ typedef txBoolean (*txBehaviorGetPrototype)(txMachine* the, txSlot* instance, txSlot* result);
100
+ typedef txBoolean (*txBehaviorHasProperty)(txMachine* the, txSlot* instance, txID id, txIndex index);
101
+ typedef txBoolean (*txBehaviorIsExtensible)(txMachine* the, txSlot* instance);
102
+ typedef void (*txBehaviorOwnKeys)(txMachine* the, txSlot* instance, txFlag flag, txSlot* keys);
103
+ typedef txBoolean (*txBehaviorPreventExtensions)(txMachine* the, txSlot* instance);
104
+ typedef txSlot* (*txBehaviorSetProperty)(txMachine* the, txSlot* instance, txID id, txIndex index, txFlag flag);
105
+ typedef txBoolean (*txBehaviorSetPropertyValue)(txMachine* the, txSlot* instance, txID id, txIndex index, txSlot* value, txSlot* receiver);
106
+ typedef txBoolean (*txBehaviorSetPrototype)(txMachine* the, txSlot* instance, txSlot* prototype);
107
+
108
+ typedef struct {
109
+ txSlot* (*newAsyncInstance)(txMachine*);
110
+ void (*runAsync)(txMachine*, txSlot*);
111
+ txSlot* (*newGeneratorInstance)(txMachine*);
112
+ txSlot* (*newGeneratorFunctionInstance)(txMachine*, txID name);
113
+ txSlot* (*newAsyncGeneratorInstance)(txMachine*);
114
+ txSlot* (*newAsyncGeneratorFunctionInstance)(txMachine*, txID name);
115
+ void (*runForAwaitOf)(txMachine*);
116
+ txSlot* (*newArgumentsSloppyInstance)(txMachine*, txIndex count);
117
+ txSlot* (*newArgumentsStrictInstance)(txMachine*, txIndex count);
118
+ void (*runEval)(txMachine*);
119
+ void (*runEvalEnvironment)(txMachine*);
120
+ void (*runProgramEnvironment)(txMachine*);
121
+ void (*initializeSharedCluster)();
122
+ void (*terminateSharedCluster)();
123
+ txSlot* (*newFunctionLength)(txMachine* the, txSlot* instance, txNumber length);
124
+ txSlot* (*newFunctionName)(txMachine* the, txSlot* instance, txID id, txIndex index, txID former, txString prefix);
125
+ void (*runImport)(txMachine* the, txSlot* realm, txID id);
126
+ txBoolean (*definePrivateProperty)(txMachine* the, txSlot* instance, txSlot* check, txID id, txSlot* slot, txFlag mask);
127
+ txSlot* (*getPrivateProperty)(txMachine* the, txSlot* instance, txSlot* check, txID id);
128
+ txSlot* (*setPrivateProperty)(txMachine* the, txSlot* instance, txSlot* check, txID id);
129
+ void (*cleanupFinalizationRegistries)(txMachine*);
130
+ void (*captureErrorStack)(txMachine* the, txSlot* internal, txSlot* frame);
131
+ } txDefaults;
132
+
133
+ enum {
134
+ XS_ORDINARY_BEHAVIOR = 0,
135
+ XS_ARGUMENTS_SLOPPY_BEHAVIOR,
136
+ XS_ARGUMENTS_STRICT_BEHAVIOR,
137
+ XS_ARRAY_BEHAVIOR,
138
+ XS_ENVIRONMENT_BEHAVIOR,
139
+ XS_GLOBAL_BEHAVIOR,
140
+ XS_MODULE_BEHAVIOR,
141
+ XS_PROXY_BEHAVIOR,
142
+ XS_STRING_BEHAVIOR,
143
+ XS_TYPED_ARRAY_BEHAVIOR,
144
+ XS_BEHAVIOR_COUNT
145
+ };
146
+
147
+ typedef struct {
148
+ txBehaviorGetProperty getProperty;
149
+ txBehaviorSetProperty setProperty;
150
+ txBehaviorCall call;
151
+ txBehaviorConstruct construct;
152
+ txBehaviorDefineOwnProperty defineOwnProperty;
153
+ txBehaviorDeleteProperty deleteProperty;
154
+ txBehaviorGetOwnProperty getOwnProperty;
155
+ txBehaviorGetPropertyValue getPropertyValue;
156
+ txBehaviorGetPrototype getPrototype;
157
+ txBehaviorHasProperty hasProperty;
158
+ txBehaviorIsExtensible isExtensible;
159
+ txBehaviorOwnKeys ownKeys;
160
+ txBehaviorPreventExtensions preventExtensions;
161
+ txBehaviorSetPropertyValue setPropertyValue;
162
+ txBehaviorSetPrototype setPrototype;
163
+ } txBehavior;
164
+
165
+ typedef struct {
166
+ txInteger lo;
167
+ txInteger hi;
168
+ } txSortPartition;
169
+ #define mxSortThreshold 4
170
+ #define mxSortPartitionCount 30
171
+
172
+ #define mxTypeArrayCount 11
173
+
174
+ typedef struct {
175
+ txU2 size;
176
+ txU2 shift; // (1 << shift) == size
177
+ txTypeCallback getter;
178
+ txTypeCallback setter;
179
+ txTypeCoerce coerce;
180
+ txTypeCompare compare;
181
+ txID getID;
182
+ txID setID;
183
+ txID constructorID;
184
+ } txTypeDispatch;
185
+
186
+ typedef struct {
187
+ txTypeCallback add;
188
+ txTypeCallback and;
189
+ txTypeCallback compareExchange;
190
+ txTypeCallback exchange;
191
+ txTypeCallback load;
192
+ txTypeCallback or;
193
+ txTypeCallback store;
194
+ txTypeCallback sub;
195
+ txTypeCallback xor;
196
+ txTypeWait wait;
197
+ } txTypeAtomics;
198
+
199
+ typedef txBigInt* (*txBigIntBinary)(txMachine*, txBigInt* r, txBigInt* a, txBigInt* b);
200
+ typedef txBoolean (*txBigIntCompare)(txMachine*, txBoolean less, txBoolean equal, txBoolean more, txSlot*, txSlot*);
201
+ typedef void (*txBigIntDecode)(txMachine*, txSize);
202
+ typedef void (*txBigIntToArrayBuffer)(txMachine* the, txSlot* slot, txU4 minBytes, txBoolean sign, int endian);
203
+ typedef txSlot* (*txBigIntToInstance)(txMachine* the, txSlot* slot);
204
+ typedef void (*txBigintToString)(txMachine* the, txSlot* slot, txU4 radix);
205
+ typedef txNumber (*txBigIntToNumber)(txMachine* the, txSlot* slot);
206
+ typedef txBigInt* (*txBigIntUnary)(txMachine*, txBigInt* r, txBigInt* a);
207
+
208
+ typedef struct {
209
+ txBigIntCompare compare;
210
+ txBigIntDecode decode;
211
+ txBigIntToArrayBuffer toArrayBuffer;
212
+ txBigIntToInstance toInstance;
213
+ txBigIntToNumber toNumber;
214
+ txBigintToString toString;
215
+ txBigIntBinary _add;
216
+ txBigIntBinary _and;
217
+ txBigIntUnary _dec;
218
+ txBigIntBinary _div;
219
+ txBigIntBinary _exp;
220
+ txBigIntUnary _inc;
221
+ txBigIntBinary _lsl;
222
+ txBigIntBinary _lsr;
223
+ txBigIntBinary _mul;
224
+ txBigIntUnary _neg;
225
+ txBigIntBinary _nop;
226
+ txBigIntUnary _not;
227
+ txBigIntBinary _or;
228
+ txBigIntBinary _rem;
229
+ txBigIntBinary _sub;
230
+ txBigIntBinary _xor;
231
+ } txTypeBigInt;
232
+
233
+
234
+ struct sxHostHooks {
235
+ txDestructor destructor;
236
+ txMarker marker;
237
+ txSweeper sweeper;
238
+ };
239
+
240
+ typedef union {
241
+ txBoolean boolean;
242
+ txInteger integer;
243
+ txNumber number;
244
+ txString string;
245
+ txID symbol;
246
+ txBigInt bigint;
247
+
248
+ txSlot* reference;
249
+
250
+ txSlot* closure;
251
+
252
+ struct { union { txSlot* reference; txInteger count; } variable; txInteger line; } environment; // id == file
253
+ struct { txByte* code; txSlot* scope; } frame;
254
+
255
+ struct { txSlot* garbage; txSlot* prototype; } instance;
256
+
257
+ struct { txSlot* address; txIndex length; } array;
258
+ struct { txByte* address; void* detachKey; } arrayBuffer;
259
+ struct { txInteger length; txInteger maxLength; } bufferInfo;
260
+ struct { txCallback address; txSlot* closures; } callback;
261
+ struct { txByte* address; txSlot* closures; } code;
262
+ struct { txInteger offset; txInteger size; } dataView;
263
+ struct { txSlot* info; txError which; } error;
264
+ struct { void* data; union { txDestructor destructor; txHostHooks* hooks; } variant; } host;
265
+ struct { txSlot* handler; txSlot* target; } proxy;
266
+ struct { txInteger* code; txInteger* data; } regexp;
267
+ struct { txSlot* address; txIndex length; } stack;
268
+ struct { txSlot** address; txSize length; } table;
269
+ struct { txTypeDispatch* dispatch; txTypeAtomics* atomics; } typedArray;
270
+ struct { txSlot* check; txSlot* value; } weakEntry;
271
+ struct { txSlot* first; txSlot* link; } weakList;
272
+ struct { txSlot* target; txSlot* link; } weakRef;
273
+ struct { txSlot* callback; txUnsigned flags; } finalizationRegistry;
274
+ struct { txSlot* target; txSlot* token; } finalizationCell;
275
+
276
+ struct { txSlot* getter; txSlot* setter; } accessor;
277
+ struct { txU4 index; txID id; } at;
278
+ struct { txSlot* slot; txU4 sum; } entry;
279
+ struct { txSlot* first; txIndex length; } errors;
280
+ struct { txSlot* object; txSlot* module; } home;
281
+ struct { txString string; txU4 sum; } key;
282
+ struct { txSlot* first; txSlot* last; } list;
283
+ struct { txSlot* realm; txID id; } module;
284
+ #ifdef mxHostFunctionPrimitive
285
+ struct { const txHostFunctionBuilder* builder; txID profileID; } hostFunction;
286
+ #endif
287
+ struct { txSlot* cache; txSlot* instance; } hostInspector;
288
+ struct { txSlot* slot; txInspectorNameLink* link; } instanceInspector;
289
+ struct { txSlot* closure; txSlot* module; } export;
290
+ struct { txSlot* check; txSlot* first; } private;
291
+
292
+ txID* IDs;
293
+ } txValue;
294
+
295
+ struct sxBlock {
296
+ txBlock* nextBlock;
297
+ txByte* current;
298
+ txByte* limit;
299
+ txByte* temporary;
300
+ };
301
+
302
+ struct sxChunk {
303
+ txSize size;
304
+ #if INTPTR_MAX == INT64_MAX
305
+ txS4 dummy;
306
+ #endif
307
+ txByte* temporary;
308
+ };
309
+
310
+ struct sxJump {
311
+ c_jmp_buf buffer; /* xs.h */
312
+ txJump* nextJump; /* xs.h */
313
+ txSlot* stack; /* xs.h */
314
+ txSlot* scope; /* xs.h */
315
+ txSlot* frame; /* xs.h */
316
+ txSlot* environment; /* xs.h */
317
+ txByte* code; /* xs.h */
318
+ txBoolean flag; /* xs.h */
319
+ };
320
+
321
+ struct sxSlot {
322
+ txSlot* next;
323
+ #if mx32bitID
324
+ #if mxBigEndian
325
+ union {
326
+ struct {
327
+ txID ID;
328
+ txS2 dummy;
329
+ txFlag flag;
330
+ txKind kind;
331
+ };
332
+ txS8 ID_FLAG_KIND;
333
+ };
334
+ #else
335
+ union {
336
+ struct {
337
+ txKind kind;
338
+ txFlag flag;
339
+ txS2 dummy;
340
+ txID ID;
341
+ };
342
+ txS8 KIND_FLAG_ID;
343
+ };
344
+ #endif
345
+ #else
346
+ #if mxBigEndian
347
+ union {
348
+ struct {
349
+ txID ID;
350
+ txFlag flag;
351
+ txKind kind;
352
+ };
353
+ txS4 ID_FLAG_KIND;
354
+ };
355
+ #else
356
+ union {
357
+ struct {
358
+ txKind kind;
359
+ txFlag flag;
360
+ txID ID;
361
+ };
362
+ txS4 KIND_FLAG_ID;
363
+ };
364
+ #endif
365
+ #if INTPTR_MAX == INT64_MAX
366
+ txS4 dummy;
367
+ #endif
368
+ #endif
369
+ txValue value;
370
+ };
371
+
372
+ struct sxInspectorNameLink {
373
+ txInspectorNameLink* previous;
374
+ txInspectorNameLink* next;
375
+ txString name;
376
+ };
377
+
378
+ struct sxInspectorNameList {
379
+ txInspectorNameLink *first;
380
+ txInspectorNameLink* last;
381
+ };
382
+
383
+ struct sxMachine {
384
+ txSlot* stack; /* xs.h */
385
+ txSlot* scope; /* xs.h */
386
+ txSlot* frame; /* xs.h */
387
+ txByte* code; /* xs.h */
388
+ txSlot* stackBottom; /* xs.h */
389
+ txSlot* stackTop; /* xs.h */
390
+ txSlot* stackPrototypes; /* xs.h */
391
+ txJump* firstJump; /* xs.h */
392
+ void* context; /* xs.h */
393
+ void* archive; /* xs.h */
394
+ txSlot scratch; /* xs.h */
395
+ mxMachinePlatform /* xs.h */
396
+ txFlag status;
397
+
398
+ txSlot* cRoot;
399
+
400
+ txBlock* firstBlock;
401
+
402
+ txSlot* freeHeap;
403
+ txSlot* firstHeap;
404
+
405
+ txSize nameModulo;
406
+ txSlot** nameTable;
407
+ txSize symbolModulo;
408
+ txSlot** symbolTable;
409
+
410
+ txID* colors;
411
+ txSlot** keyArray;
412
+ txID keyCount;
413
+ txID keyDelta;
414
+ txID keyIndex;
415
+ txID keyOffset;
416
+ txSlot** keyArrayHost;
417
+
418
+ txID aliasCount;
419
+ txID aliasIndex;
420
+ txSlot** aliasArray;
421
+
422
+ char* stackLimit;
423
+
424
+ txSlot* firstWeakListLink;
425
+ txSlot* firstWeakRefLink;
426
+
427
+ txSize currentChunksSize;
428
+ txSize peakChunksSize;
429
+ txSize maximumChunksSize;
430
+ txSize minimumChunksSize;
431
+
432
+ txSize currentHeapCount;
433
+ txSize peakHeapCount;
434
+ txSize maximumHeapCount;
435
+ txSize minimumHeapCount;
436
+
437
+ txSize parserBufferSize;
438
+ txSize parserTableModulo;
439
+
440
+ txBoolean shared;
441
+ txMachine* sharedMachine;
442
+
443
+ txBoolean collectFlag;
444
+ void* dtoa;
445
+ void* preparation;
446
+
447
+ txInteger tag;
448
+ char nameBuffer[256];
449
+ #ifdef mxDebug
450
+ txString name;
451
+ txFlag breakOnExceptionsFlag;
452
+ txFlag breakOnStartFlag;
453
+ txFlag debugAttribute;
454
+ txFlag debugExit;
455
+ txFlag debugState;
456
+ txFlag debugTag;
457
+ txFlag nameIndex;
458
+ txFlag pathIndex;
459
+ txSlot* debugModule;
460
+ size_t idValue;
461
+ txInteger lineValue;
462
+ char pathValue[256];
463
+ txSize debugOffset;
464
+ char debugBuffer[256];
465
+ txSize echoOffset;
466
+ char echoBuffer[256];
467
+ #endif
468
+ #ifdef mxFrequency
469
+ txNumber exits[XS_CODE_COUNT];
470
+ txNumber frequencies[XS_CODE_COUNT];
471
+ #endif
472
+ #ifdef mxInstrument
473
+ txU2 garbageCollectionCount;
474
+ txU2 loadedModulesCount;
475
+ txSize peakParserSize;
476
+ txSlot* stackPeak;
477
+ txSize floatingPointOps;
478
+ void (*onBreak)(txMachine*, txU1 stop);
479
+ #endif
480
+ #ifdef mxMetering
481
+ txBoolean (*meterCallback)(txMachine*, txU4);
482
+ txU4 meterCount;
483
+ txU4 meterIndex;
484
+ txU4 meterInterval;
485
+ #endif
486
+ txID profileID;
487
+ #if defined(mxInstrument) || defined(mxProfile)
488
+ void* profiler;
489
+ #endif
490
+ };
491
+
492
+ struct sxCreation {
493
+ txSize initialChunkSize; /* xs.h */
494
+ txSize incrementalChunkSize; /* xs.h */
495
+ txSize initialHeapCount; /* xs.h */
496
+ txSize incrementalHeapCount; /* xs.h */
497
+ txSize stackCount; /* xs.h */
498
+ txSize initialKeyCount; /* xs.h */
499
+ txSize incrementalKeyCount; /* xs.h */
500
+ txSize nameModulo; /* xs.h */
501
+ txSize symbolModulo; /* xs.h */
502
+ txSize parserBufferSize; /* xs.h */
503
+ txSize parserTableModulo; /* xs.h */
504
+ txSize staticSize; /* xs.h */
505
+ };
506
+
507
+ struct sxPreparation {
508
+ txS1 version[4];
509
+
510
+ txSize aliasCount;
511
+ txSize heapCount;
512
+ txSlot* heap;
513
+ txSize stackCount;
514
+ txSlot* stack;
515
+
516
+ txID* colors;
517
+ txSize keyCount;
518
+ txSlot** keys;
519
+ txSize nameModulo;
520
+ txSlot** names;
521
+ txSize symbolModulo;
522
+ txSlot** symbols;
523
+
524
+ txSize scriptCount;
525
+ txScript* scripts;
526
+
527
+ txID profileID;
528
+
529
+ txCreation creation;
530
+ txString main;
531
+
532
+ txU1 checksum[16];
533
+ };
534
+
535
+ struct sxHostFunctionBuilder {
536
+ txCallback callback;
537
+ txInteger length;
538
+ txID id;
539
+ };
540
+
541
+ typedef struct {
542
+ txSlot* slot;
543
+ txSize offset;
544
+ txSize size;
545
+ } txStringStream;
546
+
547
+ typedef struct {
548
+ txString buffer;
549
+ txSize offset;
550
+ txSize size;
551
+ } txStringCStream;
552
+
553
+ /* xsAPI.c */
554
+
555
+ mxExport txKind fxTypeOf(txMachine*, txSlot*);
556
+
557
+ mxExport void fxUndefined(txMachine*, txSlot*);
558
+ mxExport void fxNull(txMachine*, txSlot*);
559
+ mxExport void fxBoolean(txMachine*, txSlot*, txS1);
560
+ mxExport txBoolean fxToBoolean(txMachine*, txSlot*);
561
+ mxExport void fxInteger(txMachine*, txSlot*, txInteger);
562
+ mxExport txInteger fxToInteger(txMachine*, txSlot*);
563
+ mxExport void fxNumber(txMachine*, txSlot*, txNumber);
564
+ mxExport txNumber fxToNumber(txMachine*, txSlot*);
565
+ mxExport void fxString(txMachine*, txSlot*, txString);
566
+ mxExport void fxStringBuffer(txMachine* the, txSlot* theSlot, txString theValue, txSize theSize);
567
+ mxExport txString fxToString(txMachine*, txSlot*);
568
+ mxExport txString fxToStringBuffer(txMachine*, txSlot*, txString, txSize);
569
+ mxExport txString fxToStringCopy(txMachine*, txSlot*);
570
+ mxExport void fxStringX(txMachine* the, txSlot* theSlot, txString theValue);
571
+ mxExport void fxUnsigned(txMachine*, txSlot*, txUnsigned);
572
+ mxExport txUnsigned fxToUnsigned(txMachine*, txSlot*);
573
+
574
+ mxExport void fxClosure(txMachine* the, txSlot* theSlot, txSlot* theClosure);
575
+ mxExport txSlot* fxToClosure(txMachine* the, txSlot* theSlot);
576
+ mxExport void fxReference(txMachine* the, txSlot* theSlot, txSlot* theReference);
577
+ mxExport txSlot* fxToReference(txMachine* the, txSlot* theSlot);
578
+
579
+ mxExport txSlot* fxNewArray(txMachine*, txInteger);
580
+ mxExport txSlot* fxNewObject(txMachine*);
581
+ mxExport txBoolean fxIsInstanceOf(txMachine*);
582
+ mxExport void fxArrayCacheBegin(txMachine*, txSlot*);
583
+ mxExport void fxArrayCacheEnd(txMachine*, txSlot*);
584
+ mxExport void fxArrayCacheItem(txMachine*, txSlot*, txSlot*);
585
+
586
+ mxExport void fxBuildHosts(txMachine*, txInteger, const txHostFunctionBuilder*);
587
+ mxExport txSlot* fxNewHostConstructor(txMachine*, txCallback, txInteger, txInteger);
588
+ mxExport txSlot* fxNewHostFunction(txMachine*, txCallback, txInteger, txInteger, txInteger);
589
+ mxExport txSlot* fxNewHostInstance(txMachine* the);
590
+ mxExport txSlot* fxNewHostObject(txMachine*, txDestructor);
591
+ mxExport txInteger fxGetHostBufferLength(txMachine* the, txSlot* slot);
592
+ mxExport void* fxGetHostChunk(txMachine*, txSlot*);
593
+ mxExport void* fxGetHostChunkIf(txMachine*, txSlot*);
594
+ mxExport void* fxGetHostData(txMachine*, txSlot*);
595
+ mxExport void* fxGetHostDataIf(txMachine*, txSlot*);
596
+ mxExport void* fxGetHostHandle(txMachine*, txSlot*);
597
+ mxExport txDestructor fxGetHostDestructor(txMachine*, txSlot*);
598
+ mxExport txHostHooks* fxGetHostHooks(txMachine*, txSlot*);
599
+ mxExport void fxPetrifyHostBuffer(txMachine* the, txSlot* slot);
600
+ mxExport void fxSetHostBuffer(txMachine* the, txSlot* slot, void* theData, txSize theSize);
601
+ mxExport void *fxSetHostChunk(txMachine* the, txSlot* slot, void* theValue, txSize theSize);
602
+ mxExport void fxSetHostData(txMachine*, txSlot*, void*);
603
+ mxExport void fxSetHostDestructor(txMachine*, txSlot*, txDestructor);
604
+ mxExport void fxSetHostHooks(txMachine*, txSlot*, const txHostHooks*);
605
+ mxExport void* fxToHostHandle(txMachine* the, txSlot* slot);
606
+
607
+ mxExport txID fxID(txMachine*, txString);
608
+ mxExport txID fxFindID(txMachine* the, txString theName);
609
+ mxExport txS1 fxIsID(txMachine*, txString);
610
+ mxExport txID fxToID(txMachine* the, txSlot* theSlot);
611
+ mxExport txString fxName(txMachine*, txID);
612
+
613
+ mxExport void fxEnumerate(txMachine* the);
614
+ mxExport txBoolean fxHasAll(txMachine* the, txID id, txIndex index);
615
+ mxExport txBoolean fxHasAt(txMachine* the);
616
+ mxExport txBoolean fxHasID(txMachine*, txID);
617
+ mxExport txBoolean fxHasIndex(txMachine* the, txIndex index);
618
+ mxExport void fxGetAll(txMachine* the, txID id, txIndex index);
619
+ mxExport void fxGetAt(txMachine*);
620
+ mxExport void fxGetID(txMachine*, txID);
621
+ mxExport void fxGetIndex(txMachine*, txIndex);
622
+ mxExport void fxSetAll(txMachine* the, txID id, txIndex index);
623
+ mxExport void fxSetAt(txMachine*);
624
+ mxExport void fxSetID(txMachine*, txID);
625
+ mxExport void fxSetIndex(txMachine*, txIndex);
626
+ mxExport void fxDefineAll(txMachine* the, txID id, txIndex index, txFlag flag, txFlag mask);
627
+ mxExport void fxDefineAt(txMachine* the, txFlag flag, txFlag mask);
628
+ mxExport void fxDefineID(txMachine* the, txID id, txFlag flag, txFlag mask);
629
+ mxExport void fxDefineIndex(txMachine* the, txIndex index, txFlag flag, txFlag mask);
630
+ mxExport void fxDeleteAll(txMachine*, txID, txIndex);
631
+ mxExport void fxDeleteAt(txMachine*);
632
+ mxExport void fxDeleteID(txMachine*, txID);
633
+ mxExport void fxDeleteIndex(txMachine*, txIndex);
634
+ mxExport void fxCall(txMachine*);
635
+ mxExport void fxCallID(txMachine*, txID);
636
+ mxExport void fxNew(txMachine*);
637
+ mxExport void fxNewID(txMachine*, txID);
638
+ mxExport void fxRunCount(txMachine*, txInteger);
639
+ mxExport txBoolean fxRunTest(txMachine* the);
640
+
641
+ mxExport void fxCallFrame(txMachine*);
642
+ mxExport void fxNewFrame(txMachine* the);
643
+ mxExport void fxVars(txMachine*, txInteger);
644
+
645
+ mxExport txInteger fxCheckArg(txMachine*, txInteger);
646
+ mxExport txInteger fxCheckVar(txMachine*, txInteger);
647
+ mxExport void fxOverflow(txMachine*, txInteger, txString thePath, txInteger theLine);
648
+ mxExport void fxThrow(txMachine* the, txString thePath, txInteger theLine) XS_FUNCTION_NORETURN;
649
+ mxExport void fxThrowMessage(txMachine* the, txString thePath, txInteger theLine, txError theError, txString theMessage, ...) XS_FUNCTION_NORETURN;
650
+ mxExport void fxDebugger(txMachine* the, txString thePath, txInteger theLine);
651
+
652
+ mxExport const txByte gxNoCode[] ICACHE_FLASH_ATTR;
653
+ mxExport txMachine* fxCreateMachine(txCreation* theCreation, txString theName, void* theContext, txID profileID);
654
+ mxExport void fxDeleteMachine(txMachine*);
655
+ mxExport txMachine* fxCloneMachine(txCreation* theCreation, txMachine* theMachine, txString theName, void* theContext);
656
+ mxExport txMachine* fxPrepareMachine(txCreation* creation, txPreparation* preparation, txString name, void* context, void* archive);
657
+ mxExport void fxShareMachine(txMachine* the);
658
+
659
+ mxExport txMachine* fxBeginHost(txMachine*);
660
+ mxExport void fxEndHost(txMachine*);
661
+ mxExport void fxEndJob(txMachine* the);
662
+ mxExport void fxExitToHost(txMachine*) XS_FUNCTION_NORETURN;
663
+
664
+ mxExport void fxCollectGarbage(txMachine*);
665
+ mxExport void fxEnableGarbageCollection(txMachine* the, txBoolean enableIt);
666
+ mxExport void fxRemember(txMachine*, txSlot*);
667
+ mxExport void fxForget(txMachine*, txSlot*);
668
+ mxExport void fxAccess(txMachine*, txSlot*);
669
+
670
+ mxExport void fxDemarshall(txMachine* the, void* theData, txBoolean alien);
671
+ mxExport void* fxMarshall(txMachine* the, txBoolean alien);
672
+
673
+ mxExport void fxBuildArchiveKeys(txMachine* the);
674
+ mxExport void* fxGetArchiveCode(txMachine* the, void* archive, txString path, size_t* size);
675
+ mxExport txInteger fxGetArchiveCodeCount(txMachine* the, void* archive);
676
+ mxExport void* fxGetArchiveCodeName(txMachine* the, void* archive, txInteger index);
677
+ mxExport void* fxGetArchiveData(txMachine* the, void* archive, txString path, size_t* size);
678
+ mxExport txInteger fxGetArchiveDataCount(txMachine* the, void* archive);
679
+ mxExport void* fxGetArchiveDataName(txMachine* the, void* archive, txInteger index);
680
+ mxExport void* fxGetArchiveName(txMachine* the, void* archive);
681
+ mxExport void* fxMapArchive(txMachine* the, txPreparation* preparation, void* archive, size_t bufferSize, txArchiveRead read, txArchiveWrite write);
682
+
683
+ mxExport txBoolean fxIsProfiling(txMachine* the);
684
+ mxExport void fxStartProfiling(txMachine* the);
685
+ mxExport void fxStopProfiling(txMachine* the, void* stream);
686
+
687
+ mxExport void fxAwaitImport(txMachine*, txBoolean defaultFlag);
688
+
689
+ #ifdef mxMetering
690
+ mxExport void fxBeginMetering(txMachine* the, txBoolean (*callback)(txMachine*, txU4), txU4 interval);
691
+ mxExport void fxCheckMetering(txMachine* the);
692
+ mxExport void fxEndMetering(txMachine* the);
693
+ #endif
694
+
695
+ /* xsmc.c */
696
+ mxExport void _xsNewArray(txMachine *the, txSlot *res, txInteger length);
697
+ mxExport void _xsNewObject(txMachine *the, txSlot *res);
698
+ mxExport void _xsNewHostInstance(txMachine*, txSlot*, txSlot*);
699
+ mxExport txBoolean _xsIsInstanceOf(txMachine*, txSlot*, txSlot*);
700
+ mxExport txBoolean _xsHas(txMachine*, txSlot*, txID);
701
+ mxExport txBoolean _xsHasIndex(txMachine*, txSlot*, txIndex);
702
+ mxExport void _xsGet(txMachine*, txSlot*, txSlot*, txID);
703
+ mxExport void _xsGetAt(txMachine*, txSlot*, txSlot*, txSlot*);
704
+ mxExport void _xsGetIndex(txMachine*, txSlot*, txSlot*, txIndex);
705
+ mxExport void _xsSet(txMachine*, txSlot*, txID, txSlot*);
706
+ mxExport void _xsSetAt(txMachine*, txSlot*, txSlot*, txSlot*);
707
+ mxExport void _xsSetIndex(txMachine*, txSlot*, txIndex, txSlot*);
708
+ mxExport void _xsDelete(txMachine*, txSlot*, txID);
709
+ mxExport void _xsDeleteAt(txMachine*, txSlot*, txSlot*);
710
+ mxExport void _xsCall(txMachine*, txSlot*, txSlot*, txUnsigned, ...);
711
+ mxExport void _xsNew(txMachine*, txSlot*, txSlot*, txUnsigned, ...);
712
+ mxExport txBoolean _xsTest(txMachine*, txSlot*);
713
+ mxExport txInteger fxIncrementalVars(txMachine*, txInteger);
714
+
715
+ /* xsPlatforms.c */
716
+ extern void* fxAllocateChunks(txMachine* the, txSize theSize);
717
+ extern txSlot* fxAllocateSlots(txMachine* the, txSize theCount);
718
+ extern void fxBuildKeys(txMachine* the);
719
+ extern void fxCreateMachinePlatform(txMachine* the);
720
+ extern void fxDeleteMachinePlatform(txMachine* the);
721
+ extern void fxFreeChunks(txMachine* the, void* theChunks);
722
+ extern void fxFreeSlots(txMachine* the, void* theSlots);
723
+ extern txID fxFindModule(txMachine* the, txSlot* realm, txID moduleID, txSlot* slot);
724
+ extern void fxLoadModule(txMachine* the, txSlot* module, txID moduleID);
725
+ extern txScript* fxParseScript(txMachine* the, void* stream, txGetter getter, txUnsigned flags);
726
+ extern void fxQueuePromiseJobs(txMachine* the);
727
+ extern void fxInitializeSharedCluster();
728
+ extern void fxTerminateSharedCluster();
729
+ extern void* fxCreateSharedChunk(txInteger byteLength);
730
+ extern void fxLockSharedChunk(void* data);
731
+ extern void fxLinkSharedChunk(txMachine* the);
732
+ extern txInteger fxMeasureSharedChunk(void* data);
733
+ extern txInteger fxNotifySharedChunk(txMachine* the, void* data, txInteger offset, txInteger count);
734
+ extern void fxReleaseSharedChunk(void* data);
735
+ extern void* fxRetainSharedChunk(void* data);
736
+ extern void fxUnlinkSharedChunk(txMachine* the);
737
+ extern void fxUnlockSharedChunk(void* data);
738
+ extern txInteger fxWaitSharedChunk(txMachine* the, void* address, txNumber timeout);
739
+ extern void fxAbort(txMachine* the, int status);
740
+ #ifdef mxDebug
741
+ extern void fxConnect(txMachine* the);
742
+ extern void fxDisconnect(txMachine* the);
743
+ extern txBoolean fxIsConnected(txMachine* the);
744
+ extern txBoolean fxIsReadable(txMachine* the);
745
+ extern void fxReceive(txMachine* the);
746
+ extern void fxSend(txMachine* the, txBoolean more);
747
+ #endif
748
+
749
+ /* xsDefaults.c */
750
+ extern const txDefaults gxDefaults;
751
+ extern const txBehavior* gxBehaviors[];
752
+ extern const txTypeBigInt gxTypeBigInt;
753
+
754
+ /* xsAll.c */
755
+ extern txString fxAdornStringC(txMachine* the, txString prefix, txSlot* string, txString suffix);
756
+ extern txSlot* fxArgToCallback(txMachine* the, txInteger argi);
757
+ extern void fxBufferFrameName(txMachine* the, txString buffer, txSize size, txSlot* frame, txString suffix);
758
+ extern void fxBufferFunctionName(txMachine* the, txString buffer, txSize size, txSlot* function, txString suffix);
759
+ extern void fxBufferObjectName(txMachine* the, txString buffer, txSize size, txSlot* object, txString suffix);
760
+ extern txString fxConcatString(txMachine* the, txSlot* a, txSlot* b);
761
+ extern txString fxConcatStringC(txMachine* the, txSlot* a, txString b);
762
+ extern txString fxCopyString(txMachine* the, txSlot* a, txSlot* b);
763
+ extern txString fxCopyStringC(txMachine* the, txSlot* a, txString b);
764
+ extern txBoolean fxIsCanonicalIndex(txMachine* the, txID id);
765
+
766
+ extern int fxStringGetter(void*);
767
+ extern int fxStringCGetter(void*);
768
+ extern void fxJump(txMachine*) XS_FUNCTION_NORETURN;
769
+
770
+ /* xsRun.c */
771
+ extern void fxRunEval(txMachine* the);
772
+ extern void fxRunForAwaitOf(txMachine* the);
773
+ extern void fxRunID(txMachine* the, txSlot* generator, txInteger count);
774
+ extern void fxRunScript(txMachine* the, txScript* script, txSlot* _this, txSlot* _target, txSlot* environment, txSlot* object, txSlot* module);
775
+ extern txBoolean fxIsSameReference(txMachine* the, txSlot* a, txSlot* b);
776
+ extern txBoolean fxIsSameSlot(txMachine* the, txSlot* a, txSlot* b);
777
+ extern txBoolean fxIsSameValue(txMachine* the, txSlot* a, txSlot* b, txBoolean zero);
778
+
779
+ /* xsMemory.c */
780
+ extern txSize fxAddChunkSizes(txMachine* the, txSize a, txSize b);
781
+ extern void fxCheckCStack(txMachine* the);
782
+ extern void fxAllocate(txMachine* the, txCreation* theCreation);
783
+ extern void fxCollect(txMachine* the, txFlag theFlag);
784
+ mxExport txSlot* fxDuplicateSlot(txMachine* the, txSlot* theSlot);
785
+ extern void fxFree(txMachine* the);
786
+ extern void fxGrowKeys(txMachine* the, txID theCount);
787
+ extern txSize fxMultiplyChunkSizes(txMachine* the, txSize a, txSize b);
788
+ mxExport void* fxNewChunk(txMachine* the, txSize theSize);
789
+ mxExport void* fxNewGrowableChunk(txMachine* the, txSize size, txSize overflow);
790
+ extern txSlot* fxNewSlot(txMachine* the);
791
+ mxExport void* fxRenewChunk(txMachine* the, void* theData, txSize theSize);
792
+ extern void fxShare(txMachine* the);
793
+
794
+ /* xsDebug.c */
795
+ #ifdef mxDebug
796
+ mxExport void fxCheck(txMachine* the, txString thePath, txInteger theLine);
797
+ extern void fxDebugCommand(txMachine* the);
798
+ extern void fxDebugLine(txMachine* the, txID id, txInteger line);
799
+ extern void fxDebugLoop(txMachine* the, txString thePath, txInteger theLine, txString message);
800
+ extern void fxDebugThrow(txMachine* the, txString thePath, txInteger theLine, txString message);
801
+ mxExport void fxLogin(txMachine* the);
802
+ mxExport void fxLogout(txMachine* the);
803
+ #endif
804
+ mxExport void fxBubble(txMachine* the, txInteger flags, void* message, txInteger length, txString conversation);
805
+ mxExport void fxFileEvalString(txMachine* the, txString string, txString tag);
806
+ mxExport void fxReport(txMachine* the, txString theFormat, ...);
807
+ mxExport void fxReportError(txMachine* the, txString thePath, txInteger theLine, txString theFormat, ...);
808
+ mxExport void fxReportWarning(txMachine* the, txString thePath, txInteger theLine, txString theFormat, ...);
809
+ #ifdef mxInstrument
810
+ extern void fxDescribeInstrumentation(txMachine* the, txInteger count, txString* names, txString* units);
811
+ extern void fxSampleInstrumentation(txMachine* the, txInteger count, txInteger* values);
812
+ extern void fxCheckProfiler(txMachine* the, txSlot* frame);
813
+ extern void fxCreateProfiler(txMachine* the);
814
+ extern void fxDeleteProfiler(txMachine* the, void* stream);
815
+ extern void fxResumeProfiler(txMachine* the);
816
+ extern void fxSuspendProfiler(txMachine* the);
817
+ #define mxFloatingPointOp(operation) \
818
+ /* fprintf(stderr, "float: %s\n", operation); */ \
819
+ the->floatingPointOps += 1
820
+ #else
821
+ #define mxFloatingPointOp(operation)
822
+ #endif
823
+
824
+ /* xsType.c */
825
+
826
+ extern txSlot* fxAliasInstance(txMachine* the, txSlot* instance);
827
+ extern txSlot* fxDuplicateInstance(txMachine* the, txSlot* instance);
828
+ extern txSlot* fxGetInstance(txMachine* the, txSlot* theSlot);
829
+ extern txSlot* fxGetPrototype(txMachine* the, txSlot* instance);
830
+ extern txBoolean fxIsSameInstance(txMachine* the, txSlot* a, txSlot* b);
831
+ extern txSlot* fxNewInstance(txMachine* the);
832
+ extern txSlot* fxToInstance(txMachine* the, txSlot* theSlot);
833
+ extern void fxToPrimitive(txMachine* the, txSlot* theSlot, txBoolean theHint);
834
+ extern void fxToSpeciesConstructor(txMachine* the, txSlot* constructor);
835
+ extern txFlag fxDescriptorToSlot(txMachine* the, txSlot* descriptor);
836
+ extern void fxDescribeProperty(txMachine* the, txSlot* property, txFlag mask);
837
+ extern txBoolean fxIsPropertyCompatible(txMachine* the, txSlot* property, txSlot* slot, txFlag mask);
838
+ mxExport void fx_species_get(txMachine* the);
839
+
840
+ extern const txBehavior gxOrdinaryBehavior;
841
+ extern void fxOrdinaryCall(txMachine* the, txSlot* instance, txSlot* _this, txSlot* arguments);
842
+ extern void fxOrdinaryConstruct(txMachine* the, txSlot* instance, txSlot* arguments, txSlot* target);
843
+ extern txBoolean fxOrdinaryDefineOwnProperty(txMachine* the, txSlot* instance, txID id, txIndex index, txSlot* slot, txFlag mask);
844
+ extern txBoolean fxOrdinaryDeleteProperty(txMachine* the, txSlot* instance, txID id, txIndex index);
845
+ extern txBoolean fxOrdinaryGetOwnProperty(txMachine* the, txSlot* instance, txID id, txIndex index, txSlot* slot);
846
+ extern txSlot* fxOrdinaryGetProperty(txMachine* the, txSlot* instance, txID id, txIndex index, txFlag flag);
847
+ extern txBoolean fxOrdinaryGetPropertyValue(txMachine* the, txSlot* instance, txID id, txIndex index, txSlot* receiver, txSlot* value);
848
+ extern txBoolean fxOrdinaryGetPrototype(txMachine* the, txSlot* instance, txSlot* result);
849
+ extern txBoolean fxOrdinaryHasProperty(txMachine* the, txSlot* instance, txID id, txIndex index);
850
+ extern txSlot* fxOrdinarySetProperty(txMachine* the, txSlot* instance, txID id, txIndex index, txFlag flag);
851
+ extern txBoolean fxOrdinarySetPropertyValue(txMachine* the, txSlot* instance, txID id, txIndex index, txSlot* value, txSlot* receiver);
852
+ extern txBoolean fxOrdinaryIsExtensible(txMachine* the, txSlot* instance);
853
+ extern void fxOrdinaryOwnKeys(txMachine* the, txSlot* target, txFlag flag, txSlot* keys);
854
+ extern txBoolean fxOrdinaryPreventExtensions(txMachine* the, txSlot* instance);
855
+ extern txBoolean fxOrdinarySetPrototype(txMachine* the, txSlot* instance, txSlot* prototype);
856
+ mxExport void fxOrdinaryToPrimitive(txMachine* the);
857
+
858
+ extern const txBehavior gxEnvironmentBehavior;
859
+ extern txSlot* fxNewEnvironmentInstance(txMachine* the, txSlot* environment);
860
+ extern void fxRunEvalEnvironment(txMachine* the);
861
+ extern void fxRunProgramEnvironment(txMachine* the);
862
+
863
+ extern txSlot* fxNewRealmInstance(txMachine* the);
864
+ extern txSlot* fxNewProgramInstance(txMachine* the);
865
+
866
+ /* xsProperty.c */
867
+ extern txSlot* fxNextHostAccessorProperty(txMachine* the, txSlot* property, txCallback get, txCallback set, txID id, txFlag flag);
868
+ extern txSlot* fxNextHostFunctionProperty(txMachine* the, txSlot* property, txCallback call, txInteger length, txID id, txFlag flag);
869
+
870
+ extern txSlot* fxLastProperty(txMachine* the, txSlot* slot);
871
+ extern txSlot* fxNextUndefinedProperty(txMachine* the, txSlot* property, txID id, txFlag flag);
872
+ extern txSlot* fxNextNullProperty(txMachine* the, txSlot* property, txID id, txFlag flag);
873
+ extern txSlot* fxNextBooleanProperty(txMachine* the, txSlot* property, txBoolean boolean, txID id, txFlag flag);
874
+ extern txSlot* fxNextIntegerProperty(txMachine* the, txSlot* property, txInteger integer, txID id, txFlag flag);
875
+ extern txSlot* fxNextNumberProperty(txMachine* the, txSlot* property, txNumber number, txID id, txFlag flag);
876
+ extern txSlot* fxNextReferenceProperty(txMachine* the, txSlot* property, txSlot* slot, txID id, txFlag flag);
877
+ extern txSlot* fxNextSlotProperty(txMachine* the, txSlot* property, txSlot* slot, txID id, txFlag flag);
878
+ extern txSlot* fxNextStringProperty(txMachine* the, txSlot* property, txString string, txID id, txFlag flag);
879
+ extern txSlot* fxNextStringXProperty(txMachine* the, txSlot* property, txString string, txID id, txFlag flag);
880
+ extern txSlot* fxNextSymbolProperty(txMachine* the, txSlot* property, txID symbol, txID id, txFlag flag);
881
+ extern txSlot* fxNextTypeDispatchProperty(txMachine* the, txSlot* property, txTypeDispatch* dispatch, txTypeAtomics* atomics, txID id, txFlag flag);
882
+
883
+ extern txSlot* fxQueueIDKeys(txMachine* the, txSlot* first, txFlag flag, txSlot* keys);
884
+ extern txSlot* fxQueueIndexKeys(txMachine* the, txSlot* array, txFlag flag, txSlot* keys);
885
+ extern txSlot* fxQueueKey(txMachine* the, txID id, txIndex index, txSlot* keys);
886
+
887
+ extern txBoolean fxDeleteIndexProperty(txMachine* the, txSlot* array, txIndex index);
888
+ extern txSlot* fxGetIndexProperty(txMachine* the, txSlot* array, txIndex index);
889
+ extern txIndex fxGetIndexSize(txMachine* the, txSlot* array);
890
+ extern txSlot* fxSetIndexProperty(txMachine* the, txSlot* instance, txSlot* array, txIndex index);
891
+ extern void fxSetIndexSize(txMachine* the, txSlot* array, txIndex target, txBoolean growable);
892
+
893
+ extern txBoolean fxDefinePrivateProperty(txMachine* the, txSlot* instance, txSlot* check, txID id, txSlot* slot, txFlag mask);
894
+ extern txSlot* fxGetPrivateProperty(txMachine* the, txSlot* instance, txSlot* check, txID id);
895
+ extern txSlot* fxSetPrivateProperty(txMachine* the, txSlot* instance, txSlot* check, txID id);
896
+
897
+ /* xsGlobal.c */
898
+ extern const txBehavior gxGlobalBehavior;
899
+ extern void fxBuildGlobal(txMachine* the);
900
+ extern txSlot* fxNewGlobalInstance(txMachine* the);
901
+
902
+ extern txBoolean fxGlobalDeleteProperty(txMachine* the, txSlot* instance, txID id, txIndex index);
903
+ extern txSlot* fxGlobalGetProperty(txMachine* the, txSlot* instance, txID id, txIndex index, txFlag flag);
904
+ extern txSlot* fxGlobalSetProperty(txMachine* the, txSlot* instance, txID id, txIndex index, txFlag flag);
905
+
906
+ mxExport void fx_Iterator_iterator(txMachine* the);
907
+ mxExport void fx_Enumerator(txMachine* the);
908
+ mxExport void fx_Enumerator_next(txMachine* the);
909
+ mxExport void fx_decodeURI(txMachine* the);
910
+ mxExport void fx_decodeURIComponent(txMachine* the);
911
+ mxExport void fx_encodeURI(txMachine* the);
912
+ mxExport void fx_encodeURIComponent(txMachine* the);
913
+ mxExport void fx_escape(txMachine* the);
914
+ mxExport void fx_eval(txMachine* the);
915
+ mxExport void fx_trace(txMachine* the);
916
+ mxExport void fx_trace_center(txMachine* the);
917
+ mxExport void fx_trace_left(txMachine* the);
918
+ mxExport void fx_trace_right(txMachine* the);
919
+ mxExport void fx_unescape(txMachine* the);
920
+
921
+ extern txSlot* fxCheckIteratorInstance(txMachine* the, txSlot* slot, txID id);
922
+ extern txSlot* fxCheckIteratorResult(txMachine* the, txSlot* result);
923
+ extern txBoolean fxGetIterator(txMachine* the, txSlot* iterable, txSlot* iterator, txSlot* next, txBoolean optional);
924
+ extern txBoolean fxIteratorNext(txMachine* the, txSlot* iterator, txSlot* next, txSlot* value);
925
+ extern void fxIteratorReturn(txMachine* the, txSlot* iterator);
926
+ extern txSlot* fxNewIteratorInstance(txMachine* the, txSlot* iterable, txID id);
927
+ mxExport void fxDecodeURI(txMachine* the, txString theSet);
928
+ mxExport void fxEncodeURI(txMachine* the, txString theSet);
929
+
930
+ /* xsObject.c */
931
+ mxExport void fx_Object(txMachine* the);
932
+ mxExport void fx_Object_prototype___proto__get(txMachine* the);
933
+ mxExport void fx_Object_prototype___proto__set(txMachine* the);
934
+ mxExport void fx_Object_prototype___defineGetter__(txMachine* the);
935
+ mxExport void fx_Object_prototype___defineSetter__(txMachine* the);
936
+ mxExport void fx_Object_prototype___lookupGetter__(txMachine* the);
937
+ mxExport void fx_Object_prototype___lookupSetter__(txMachine* the);
938
+ mxExport void fx_Object_prototype_hasOwnProperty(txMachine* the);
939
+ mxExport void fx_Object_prototype_isPrototypeOf(txMachine* the);
940
+ mxExport void fx_Object_prototype_propertyIsEnumerable(txMachine* the);
941
+ mxExport void fx_Object_prototype_toLocaleString(txMachine* the);
942
+ mxExport void fx_Object_prototype_toString(txMachine* the);
943
+ mxExport void fx_Object_prototype_valueOf(txMachine* the);
944
+ mxExport void fx_Object_assign(txMachine* the);
945
+ mxExport void fx_Object_copy(txMachine* the);
946
+ mxExport void fx_Object_create(txMachine* the);
947
+ mxExport void fx_Object_defineProperties(txMachine* the);
948
+ mxExport void fx_Object_defineProperty(txMachine* the);
949
+ mxExport void fx_Object_entries(txMachine* the);
950
+ mxExport void fx_Object_freeze(txMachine* the);
951
+ mxExport void fx_Object_fromEntries(txMachine* the);
952
+ mxExport void fx_Object_getOwnPropertyDescriptor(txMachine* the);
953
+ mxExport void fx_Object_getOwnPropertyDescriptors(txMachine* the);
954
+ mxExport void fx_Object_getOwnPropertyNames(txMachine* the);
955
+ mxExport void fx_Object_getOwnPropertySymbols(txMachine* the);
956
+ mxExport void fx_Object_getPrototypeOf(txMachine* the);
957
+ mxExport void fx_Object_hasOwn(txMachine* the);
958
+ mxExport void fx_Object_is(txMachine* the);
959
+ mxExport void fx_Object_isExtensible(txMachine* the);
960
+ mxExport void fx_Object_isFrozen(txMachine* the);
961
+ mxExport void fx_Object_isSealed(txMachine* the);
962
+ mxExport void fx_Object_keys(txMachine* the);
963
+ mxExport void fx_Object_preventExtensions(txMachine* the);
964
+ mxExport void fx_Object_seal(txMachine* the);
965
+ mxExport void fx_Object_setPrototypeOf(txMachine* the);
966
+ mxExport void fx_Object_values(txMachine* the);
967
+
968
+ extern void fxBuildObject(txMachine* the);
969
+ extern txSlot* fxNewObjectInstance(txMachine* the);
970
+ extern void fxFreezePropertyStep(txMachine* the, txSlot* context, txID id, txIndex index, txSlot* property);
971
+ extern void fxIsPropertyFrozenStep(txMachine* the, txSlot* context, txID id, txIndex index, txSlot* property);
972
+
973
+ /* xsFunction.c */
974
+ mxExport void fx_Function(txMachine* the);
975
+ mxExport void fx_Function_prototype_apply(txMachine* the);
976
+ mxExport void fx_Function_prototype_bind(txMachine* the);
977
+ mxExport void fx_Function_prototype_bound(txMachine* the);
978
+ mxExport void fx_Function_prototype_call(txMachine* the);
979
+ mxExport void fx_Function_prototype_hasInstance(txMachine* the);
980
+ mxExport void fx_Function_prototype_toString(txMachine* the);
981
+
982
+ extern void fxBuildFunction(txMachine* the);
983
+ extern void fxDefaultFunctionPrototype(txMachine* the);
984
+ extern txSlot* fxGetPrototypeFromConstructor(txMachine* the, txSlot* defaultPrototype);
985
+ mxExport txBoolean fxIsCallable(txMachine* the, txSlot* slot);
986
+ extern txBoolean fxIsFunction(txMachine* the, txSlot* slot);
987
+ extern txSlot* fxNewFunctionInstance(txMachine* the, txID name);
988
+ extern txSlot* fxNewFunctionLength(txMachine* the, txSlot* instance, txNumber length);
989
+ extern txSlot* fxNewFunctionName(txMachine* the, txSlot* instance, txID id, txIndex index, txID former, txString prefix);
990
+ extern void fxRenameFunction(txMachine* the, txSlot* function, txID id, txIndex index, txID former, txString prefix);
991
+
992
+ mxExport void fx_AsyncFunction(txMachine* the);
993
+
994
+ extern txSlot* fxNewAsyncInstance(txMachine* the);
995
+ extern void fxResolveAwait(txMachine* the);
996
+ extern void fxRejectAwait(txMachine* the);
997
+ extern void fxRunAsync(txMachine* the, txSlot* instance);
998
+
999
+ /* xsBoolean.c */
1000
+ mxExport void fx_Boolean(txMachine* the);
1001
+ mxExport void fx_Boolean_prototype_toString(txMachine* the);
1002
+ mxExport void fx_Boolean_prototype_valueOf(txMachine* the);
1003
+
1004
+ extern void fxBuildBoolean(txMachine* the);
1005
+ extern txSlot* fxNewBooleanInstance(txMachine* the);
1006
+
1007
+ /* xsSymbol.c */
1008
+ mxExport void fx_Symbol(txMachine* the);
1009
+ mxExport void fx_Symbol_for(txMachine* the);
1010
+ mxExport void fx_Symbol_keyFor(txMachine* the);
1011
+ mxExport void fx_Symbol_prototype_get_description(txMachine* the);
1012
+ mxExport void fx_Symbol_prototype_toPrimitive(txMachine* the);
1013
+ mxExport void fx_Symbol_prototype_toString(txMachine* the);
1014
+ mxExport void fx_Symbol_prototype_valueOf(txMachine* the);
1015
+
1016
+ extern void fxBuildSymbol(txMachine* the);
1017
+ extern txSlot* fxNewSymbolInstance(txMachine* the);
1018
+ extern void fxSymbolToString(txMachine* the, txSlot* slot);
1019
+ extern txSlot* fxGetKey(txMachine* the, txID theID);
1020
+ extern char* fxGetKeyName(txMachine* the, txID theID);
1021
+ extern txID fxFindName(txMachine* the, txString theString);
1022
+ extern txBoolean fxIsKeyName(txMachine* the, txID theID);
1023
+ extern txBoolean fxIsKeySymbol(txMachine* the, txID theID);
1024
+ extern txID fxNewName(txMachine* the, txSlot* theSlot);
1025
+ extern txID fxNewNameC(txMachine* the, txString theString);
1026
+ extern txID fxNewNameX(txMachine* the, txString theString);
1027
+ extern txSlot* fxAt(txMachine* the, txSlot* slot);
1028
+ extern void fxKeyAt(txMachine* the, txID id, txIndex index, txSlot* slot);
1029
+ extern void fxIDToString(txMachine* the, txID id, txString theBuffer, txSize theSize);
1030
+
1031
+ /* xsError.c */
1032
+ mxExport void fx_Error(txMachine* the);
1033
+ mxExport void fx_Error_toString(txMachine* the);
1034
+ mxExport void fx_AggregateError(txMachine* the);
1035
+ mxExport void fx_EvalError(txMachine* the);
1036
+ mxExport void fx_RangeError(txMachine* the);
1037
+ mxExport void fx_ReferenceError(txMachine* the);
1038
+ mxExport void fx_SyntaxError(txMachine* the);
1039
+ mxExport void fx_TypeError(txMachine* the);
1040
+ mxExport void fx_URIError(txMachine* the);
1041
+ mxExport void fx_Error_prototype_get_stack(txMachine* the);
1042
+
1043
+ extern void fxBuildError(txMachine* the);
1044
+ extern void fxCaptureErrorStack(txMachine* the, txSlot* internal, txSlot* frame);
1045
+
1046
+ /* xsNumber.c */
1047
+ mxExport void fx_isFinite(txMachine* the);
1048
+ mxExport void fx_isNaN(txMachine* the);
1049
+ mxExport void fx_parseFloat(txMachine* the);
1050
+ mxExport void fx_parseInt(txMachine* the);
1051
+ mxExport void fx_Number(txMachine* the);
1052
+ mxExport void fx_Number_isFinite(txMachine* the);
1053
+ mxExport void fx_Number_isInteger(txMachine* the);
1054
+ mxExport void fx_Number_isNaN(txMachine* the);
1055
+ mxExport void fx_Number_isSafeInteger(txMachine* the);
1056
+ mxExport void fx_Number_prototype_toExponential(txMachine* the);
1057
+ mxExport void fx_Number_prototype_toFixed(txMachine* the);
1058
+ mxExport void fx_Number_prototype_toLocaleString(txMachine* the);
1059
+ mxExport void fx_Number_prototype_toPrecision(txMachine* the);
1060
+ mxExport void fx_Number_prototype_toString(txMachine* the);
1061
+ mxExport void fx_Number_prototype_valueOf(txMachine* the);
1062
+
1063
+ extern void fxBuildNumber(txMachine* the);
1064
+ extern txSlot* fxNewNumberInstance(txMachine* the);
1065
+ extern void fxNumberCoerce(txMachine* the, txSlot* slot);
1066
+ extern void fxIntCoerce(txMachine* the, txSlot* slot);
1067
+ extern void fxUintCoerce(txMachine* the, txSlot* slot);
1068
+
1069
+ /* xsMath.c */
1070
+ mxExport void fx_Math_abs(txMachine* the);
1071
+ mxExport void fx_Math_acos(txMachine* the);
1072
+ mxExport void fx_Math_acosh(txMachine* the);
1073
+ mxExport void fx_Math_asin(txMachine* the);
1074
+ mxExport void fx_Math_asinh(txMachine* the);
1075
+ mxExport void fx_Math_atan(txMachine* the);
1076
+ mxExport void fx_Math_atanh(txMachine* the);
1077
+ mxExport void fx_Math_atan2(txMachine* the);
1078
+ mxExport void fx_Math_cbrt(txMachine* the);
1079
+ mxExport void fx_Math_ceil(txMachine* the);
1080
+ mxExport void fx_Math_clz32(txMachine* the);
1081
+ mxExport void fx_Math_cos(txMachine* the);
1082
+ mxExport void fx_Math_cosh(txMachine* the);
1083
+ mxExport void fx_Math_exp(txMachine* the);
1084
+ mxExport void fx_Math_expm1(txMachine* the);
1085
+ mxExport void fx_Math_floor(txMachine* the);
1086
+ mxExport void fx_Math_fround(txMachine* the);
1087
+ mxExport void fx_Math_hypot(txMachine* the);
1088
+ mxExport void fx_Math_idiv(txMachine* the);
1089
+ mxExport void fx_Math_idivmod(txMachine* the);
1090
+ mxExport void fx_Math_imod(txMachine* the);
1091
+ mxExport void fx_Math_imul(txMachine* the);
1092
+ mxExport void fx_Math_imuldiv(txMachine* the);
1093
+ mxExport void fx_Math_irem(txMachine* the);
1094
+ mxExport void fx_Math_log(txMachine* the);
1095
+ mxExport void fx_Math_log1p(txMachine* the);
1096
+ mxExport void fx_Math_log10(txMachine* the);
1097
+ mxExport void fx_Math_log2(txMachine* the);
1098
+ mxExport void fx_Math_max(txMachine* the);
1099
+ mxExport void fx_Math_min(txMachine* the);
1100
+ mxExport void fx_Math_mod(txMachine* the);
1101
+ mxExport void fx_Math_pow(txMachine* the);
1102
+ mxExport void fx_Math_random(txMachine* the);
1103
+ mxExport void fx_Math_random_secure(txMachine* the);
1104
+ mxExport void fx_Math_round(txMachine* the);
1105
+ mxExport void fx_Math_sign(txMachine* the);
1106
+ mxExport void fx_Math_sin(txMachine* the);
1107
+ mxExport void fx_Math_sinh(txMachine* the);
1108
+ mxExport void fx_Math_sqrt(txMachine* the);
1109
+ mxExport void fx_Math_tan(txMachine* the);
1110
+ mxExport void fx_Math_tanh(txMachine* the);
1111
+ mxExport void fx_Math_trunc(txMachine* the);
1112
+ mxExport void fx_Math_toInteger(txMachine* the);
1113
+
1114
+ extern void fxBuildMath(txMachine* the);
1115
+ extern txNumber fx_pow(txNumber x, txNumber y);
1116
+
1117
+ /* xsBigInt.c */
1118
+ mxExport void fx_BigInt(txMachine* the);
1119
+ mxExport void fx_BigInt_asIntN(txMachine* the);
1120
+ mxExport void fx_BigInt_asUintN(txMachine* the);
1121
+ mxExport void fx_BigInt_bitLength(txMachine* the);
1122
+ mxExport void fx_BigInt_fromArrayBuffer(txMachine* the);
1123
+ mxExport void fx_BigInt_prototype_toString(txMachine* the);
1124
+ mxExport void fx_BigInt_prototype_valueOf(txMachine* the);
1125
+
1126
+ extern void fxBuildBigInt(txMachine* the);
1127
+ extern void fxBigIntCoerce(txMachine* the, txSlot* slot);
1128
+ extern txBoolean fxBigIntCompare(txMachine* the, txBoolean less, txBoolean equal, txBoolean more, txSlot* left, txSlot* right);
1129
+ extern void fxBigIntDecode(txMachine* the, txSize size);
1130
+ extern void fxBigintToArrayBuffer(txMachine* the, txSlot* slot, txU4 minBytes, txBoolean sign, int endian);
1131
+ extern txSlot* fxBigIntToInstance(txMachine* the, txSlot* slot);
1132
+ extern txNumber fxBigIntToNumber(txMachine* the, txSlot* slot);
1133
+ extern void fxBigintToString(txMachine* the, txSlot* slot, txU4 radix);
1134
+ extern txS8 fxToBigInt64(txMachine* the, txSlot* slot);
1135
+ extern txU8 fxToBigUint64(txMachine* the, txSlot* slot);
1136
+
1137
+ mxExport void fxBigInt(txMachine* the, txSlot* slot, txU1 sign, txU2 size, txU4* data);
1138
+ mxExport void fxBigIntX(txMachine* the, txSlot* slot, txU1 sign, txU2 size, txU4* data);
1139
+ mxExport txBigInt* fxToBigInt(txMachine* the, txSlot* slot, txFlag strict);
1140
+ mxExport void fxFromBigInt64(txMachine* the, txSlot* slot, txS8 value);
1141
+ mxExport void fxFromBigUint64(txMachine* the, txSlot* slot, txU8 value);
1142
+
1143
+ mxExport txBigInt* fxBigInt_add(txMachine* the, txBigInt* r, txBigInt* a, txBigInt* b);
1144
+ mxExport txBigInt* fxBigInt_and(txMachine* the, txBigInt* r, txBigInt* a, txBigInt* b);
1145
+ mxExport txBigInt* fxBigInt_dec(txMachine* the, txBigInt* r, txBigInt* a);
1146
+ mxExport txBigInt* fxBigInt_div(txMachine* the, txBigInt* r, txBigInt* a, txBigInt* b);
1147
+ mxExport txBigInt* fxBigInt_exp(txMachine* the, txBigInt* r, txBigInt* a, txBigInt* b);
1148
+ mxExport txBigInt* fxBigInt_inc(txMachine* the, txBigInt* r, txBigInt* a);
1149
+ mxExport txBigInt* fxBigInt_lsl(txMachine* the, txBigInt* r, txBigInt* a, txBigInt* b);
1150
+ mxExport txBigInt* fxBigInt_lsr(txMachine* the, txBigInt* r, txBigInt* a, txBigInt* b);
1151
+ mxExport txBigInt* fxBigInt_mul(txMachine* the, txBigInt* r, txBigInt* a, txBigInt* b);
1152
+ mxExport txBigInt* fxBigInt_neg(txMachine* the, txBigInt* r, txBigInt* a);
1153
+ mxExport txBigInt* fxBigInt_nop(txMachine* the, txBigInt* r, txBigInt* a, txBigInt* b);
1154
+ mxExport txBigInt* fxBigInt_not(txMachine* the, txBigInt* r, txBigInt* a);
1155
+ mxExport txBigInt* fxBigInt_or(txMachine* the, txBigInt* r, txBigInt* a, txBigInt* b);
1156
+ mxExport txBigInt* fxBigInt_rem(txMachine* the, txBigInt* r, txBigInt* a, txBigInt* b);
1157
+ mxExport txBigInt* fxBigInt_sub(txMachine* the, txBigInt* r, txBigInt* a, txBigInt* b);
1158
+ mxExport txBigInt* fxBigInt_xor(txMachine* the, txBigInt* r, txBigInt* a, txBigInt* b);
1159
+
1160
+ mxExport txBigInt *fxBigInt_alloc(txMachine* the, txU4 size);
1161
+ mxExport void fxBigInt_free(txMachine* the, txBigInt*);
1162
+
1163
+ mxExport int fxBigInt_comp(txBigInt* a, txBigInt* b);
1164
+ mxExport void fxBigInt_copy(txBigInt* a, txBigInt* b);
1165
+ mxExport txBigInt* fxBigInt_mod(txMachine* the, txBigInt* r, txBigInt* a, txBigInt* b);
1166
+ mxExport txBigInt* fxBigInt_sqr(txMachine* the, txBigInt* r, txBigInt* a);
1167
+
1168
+ mxExport int fxBigInt_iszero(txBigInt *a);
1169
+ mxExport txBigInt *fxBigInt_dup(txMachine* the, txBigInt *a);
1170
+ mxExport int fxBigInt_bitsize(txBigInt *e);
1171
+
1172
+ mxExport int fxBigInt_ucomp(txBigInt *a, txBigInt *b);
1173
+
1174
+ mxExport txBigInt *fxBigInt_uand(txMachine* the, txBigInt *r, txBigInt *a, txBigInt *b);
1175
+ mxExport txBigInt *fxBigInt_uor(txMachine* the, txBigInt *r, txBigInt *a, txBigInt *b);
1176
+ mxExport txBigInt *fxBigInt_uxor(txMachine* the, txBigInt *r, txBigInt *a, txBigInt *b);
1177
+
1178
+ mxExport txBigInt *fxBigInt_ulsl1(txMachine* the, txBigInt *r, txBigInt *a, txU4 sw);
1179
+ mxExport txBigInt *fxBigInt_ulsr1(txMachine* the, txBigInt *r, txBigInt *a, txU4 sw);
1180
+
1181
+ mxExport txBigInt *fxBigInt_uadd(txMachine* the, txBigInt *rr, txBigInt *aa, txBigInt *bb);
1182
+ mxExport txBigInt *fxBigInt_usub(txMachine* the, txBigInt *rr, txBigInt *aa, txBigInt *bb);
1183
+
1184
+ mxExport txBigInt *fxBigInt_umul(txMachine* the, txBigInt *rr, txBigInt *aa, txBigInt *bb);
1185
+ mxExport txBigInt *fxBigInt_umul1(txMachine* the, txBigInt *r, txBigInt *a, txU4 b);
1186
+ mxExport txBigInt *fxBigInt_udiv(txMachine* the, txBigInt *q, txBigInt *a, txBigInt *b, txBigInt **r);
1187
+
1188
+ mxExport int fxBigInt_isset(txBigInt *e, txU4 i);
1189
+ mxExport void fxBigInt_fill0(txBigInt *r);
1190
+
1191
+ /* xsDate.c */
1192
+ mxExport void fx_Date(txMachine* the);
1193
+ mxExport void fx_Date_secure(txMachine* the);
1194
+ mxExport void fx_Date_now(txMachine* the);
1195
+ mxExport void fx_Date_now_secure(txMachine* the);
1196
+ mxExport void fx_Date_parse(txMachine* the);
1197
+ mxExport void fx_Date_UTC(txMachine* the);
1198
+ mxExport void fx_Date_prototype_getMilliseconds(txMachine* the);
1199
+ mxExport void fx_Date_prototype_getSeconds(txMachine* the);
1200
+ mxExport void fx_Date_prototype_getMinutes(txMachine* the);
1201
+ mxExport void fx_Date_prototype_getHours(txMachine* the);
1202
+ mxExport void fx_Date_prototype_getDay(txMachine* the);
1203
+ mxExport void fx_Date_prototype_getDate(txMachine* the);
1204
+ mxExport void fx_Date_prototype_getMonth(txMachine* the);
1205
+ mxExport void fx_Date_prototype_getYear(txMachine* the);
1206
+ mxExport void fx_Date_prototype_getFullYear(txMachine* the);
1207
+ mxExport void fx_Date_prototype_getUTCMilliseconds(txMachine* the);
1208
+ mxExport void fx_Date_prototype_getUTCSeconds(txMachine* the);
1209
+ mxExport void fx_Date_prototype_getUTCMinutes(txMachine* the);
1210
+ mxExport void fx_Date_prototype_getUTCHours(txMachine* the);
1211
+ mxExport void fx_Date_prototype_getUTCDay(txMachine* the);
1212
+ mxExport void fx_Date_prototype_getUTCDate(txMachine* the);
1213
+ mxExport void fx_Date_prototype_getUTCMonth(txMachine* the);
1214
+ mxExport void fx_Date_prototype_getUTCFullYear(txMachine* the);
1215
+ mxExport void fx_Date_prototype_getTimezoneOffset(txMachine* the);
1216
+ mxExport void fx_Date_prototype_setMilliseconds(txMachine* the);
1217
+ mxExport void fx_Date_prototype_setSeconds(txMachine* the);
1218
+ mxExport void fx_Date_prototype_setMinutes(txMachine* the);
1219
+ mxExport void fx_Date_prototype_setHours(txMachine* the);
1220
+ mxExport void fx_Date_prototype_setDate(txMachine* the);
1221
+ mxExport void fx_Date_prototype_setMonth(txMachine* the);
1222
+ mxExport void fx_Date_prototype_setYear(txMachine* the);
1223
+ mxExport void fx_Date_prototype_setFullYear(txMachine* the);
1224
+ mxExport void fx_Date_prototype_setTime(txMachine* the);
1225
+ mxExport void fx_Date_prototype_setUTCMilliseconds(txMachine* the);
1226
+ mxExport void fx_Date_prototype_setUTCSeconds(txMachine* the);
1227
+ mxExport void fx_Date_prototype_setUTCMinutes(txMachine* the);
1228
+ mxExport void fx_Date_prototype_setUTCHours(txMachine* the);
1229
+ mxExport void fx_Date_prototype_setUTCDate(txMachine* the);
1230
+ mxExport void fx_Date_prototype_setUTCMonth(txMachine* the);
1231
+ mxExport void fx_Date_prototype_setUTCFullYear(txMachine* the);
1232
+ mxExport void fx_Date_prototype_toDateString(txMachine* the);
1233
+ mxExport void fx_Date_prototype_toISOString(txMachine* the);
1234
+ mxExport void fx_Date_prototype_toJSON(txMachine* the);
1235
+ mxExport void fx_Date_prototype_toPrimitive(txMachine* the);
1236
+ mxExport void fx_Date_prototype_toString(txMachine* the);
1237
+ mxExport void fx_Date_prototype_toTimeString(txMachine* the);
1238
+ mxExport void fx_Date_prototype_toUTCString(txMachine* the);
1239
+ mxExport void fx_Date_prototype_valueOf(txMachine* the);
1240
+
1241
+ extern void fxBuildDate(txMachine* the);
1242
+ extern txNumber fxDateNow();
1243
+
1244
+ /* xsString.c */
1245
+ extern const txBehavior gxStringBehavior;
1246
+
1247
+ mxExport void fx_String(txMachine* the);
1248
+ #ifndef mxCESU8
1249
+ mxExport void fx_String_fromArrayBuffer(txMachine* the);
1250
+ #endif
1251
+ mxExport void fx_String_fromCharCode(txMachine* the);
1252
+ mxExport void fx_String_fromCodePoint(txMachine* the);
1253
+ mxExport void fx_String_raw(txMachine* the);
1254
+ mxExport void fx_String_prototype_at(txMachine* the);
1255
+ mxExport void fx_String_prototype_charAt(txMachine* the);
1256
+ mxExport void fx_String_prototype_charCodeAt(txMachine* the);
1257
+ mxExport void fx_String_prototype_codePointAt(txMachine* the);
1258
+ mxExport void fx_String_prototype_compare(txMachine* the);
1259
+ mxExport void fx_String_prototype_concat(txMachine* the);
1260
+ mxExport void fx_String_prototype_endsWith(txMachine* the);
1261
+ mxExport void fx_String_prototype_includes(txMachine* the);
1262
+ mxExport void fx_String_prototype_indexOf(txMachine* the);
1263
+ mxExport void fx_String_prototype_lastIndexOf(txMachine* the);
1264
+ mxExport void fx_String_prototype_localeCompare(txMachine* the);
1265
+ mxExport void fx_String_prototype_match(txMachine* the);
1266
+ mxExport void fx_String_prototype_matchAll(txMachine* the);
1267
+ mxExport void fx_String_prototype_normalize(txMachine* the);
1268
+ mxExport void fx_String_prototype_padEnd(txMachine* the);
1269
+ mxExport void fx_String_prototype_padStart(txMachine* the);
1270
+ mxExport void fx_String_prototype_repeat(txMachine* the);
1271
+ mxExport void fx_String_prototype_replace(txMachine* the);
1272
+ mxExport void fx_String_prototype_replaceAll(txMachine* the);
1273
+ mxExport void fx_String_prototype_search(txMachine* the);
1274
+ mxExport void fx_String_prototype_slice(txMachine* the);
1275
+ mxExport void fx_String_prototype_split(txMachine* the);
1276
+ mxExport void fx_String_prototype_startsWith(txMachine* the);
1277
+ mxExport void fx_String_prototype_substr(txMachine* the);
1278
+ mxExport void fx_String_prototype_substring(txMachine* the);
1279
+ mxExport void fx_String_prototype_toLowerCase(txMachine* the);
1280
+ mxExport void fx_String_prototype_toUpperCase(txMachine* the);
1281
+ mxExport void fx_String_prototype_trim(txMachine* the);
1282
+ mxExport void fx_String_prototype_trimEnd(txMachine* the);
1283
+ mxExport void fx_String_prototype_trimStart(txMachine* the);
1284
+ mxExport void fx_String_prototype_valueOf(txMachine* the);
1285
+ mxExport void fx_String_prototype_iterator(txMachine* the);
1286
+ mxExport void fx_String_prototype_iterator_next(txMachine* the);
1287
+ mxExport void fxStringAccessorGetter(txMachine* the);
1288
+ mxExport void fxStringAccessorSetter(txMachine* the);
1289
+
1290
+ extern void fxBuildString(txMachine* the);
1291
+ extern txSlot* fxNewStringInstance(txMachine* the);
1292
+ extern txSlot* fxAccessStringProperty(txMachine* the, txSlot* instance, txInteger index);
1293
+ extern void fxPushSubstitutionString(txMachine* the, txSlot* string, txInteger size, txInteger offset, txSlot* match, txInteger length, txInteger count, txSlot* captures, txSlot* groups, txSlot* replace);
1294
+
1295
+ /* xsRegExp.c */
1296
+ mxExport void fx_RegExp(txMachine* the);
1297
+ mxExport void fx_RegExp_prototype_get_dotAll(txMachine* the);
1298
+ mxExport void fx_RegExp_prototype_get_flags(txMachine* the);
1299
+ mxExport void fx_RegExp_prototype_get_global(txMachine* the);
1300
+ mxExport void fx_RegExp_prototype_get_hasIndices(txMachine* the);
1301
+ mxExport void fx_RegExp_prototype_get_ignoreCase(txMachine* the);
1302
+ mxExport void fx_RegExp_prototype_get_multiline(txMachine* the);
1303
+ mxExport void fx_RegExp_prototype_get_source(txMachine* the);
1304
+ mxExport void fx_RegExp_prototype_get_sticky(txMachine* the);
1305
+ mxExport void fx_RegExp_prototype_get_unicode(txMachine* the);
1306
+ mxExport void fx_RegExp_prototype_compile(txMachine* the);
1307
+ mxExport void fx_RegExp_prototype_exec(txMachine* the);
1308
+ mxExport void fx_RegExp_prototype_match(txMachine* the);
1309
+ mxExport void fx_RegExp_prototype_matchAll(txMachine* the);
1310
+ mxExport void fx_RegExp_prototype_matchAll_next(txMachine* the);
1311
+ mxExport void fx_RegExp_prototype_replace(txMachine* the);
1312
+ mxExport void fx_RegExp_prototype_search(txMachine* the);
1313
+ mxExport void fx_RegExp_prototype_split(txMachine* the);
1314
+ mxExport void fx_RegExp_prototype_test(txMachine* the);
1315
+ mxExport void fx_RegExp_prototype_toString(txMachine* the);
1316
+ mxExport void fxInitializeRegExp(txMachine* the);
1317
+
1318
+ extern void fxBuildRegExp(txMachine* the);
1319
+ extern txBoolean fxIsRegExp(txMachine* the, txSlot* slot);
1320
+ extern txSlot* fxNewRegExpInstance(txMachine* the);
1321
+ extern void fx_String_prototype_toCase(txMachine* the, txBoolean flag);
1322
+
1323
+ /* xsArguments.c */
1324
+ extern const txBehavior gxArgumentsSloppyBehavior;
1325
+
1326
+ extern void fxBuildArguments(txMachine* the);
1327
+
1328
+ extern txSlot* fxNewArgumentsSloppyInstance(txMachine* the, txIndex count);
1329
+ extern txSlot* fxNewArgumentsStrictInstance(txMachine* the, txIndex count);
1330
+ mxExport void fxThrowTypeError(txMachine* the);
1331
+
1332
+ /* xsArray.c */
1333
+ extern const txBehavior gxArrayBehavior;
1334
+
1335
+ extern void fxBuildArray(txMachine* the);
1336
+
1337
+ mxExport void fxArrayLengthGetter(txMachine* the);
1338
+ mxExport void fxArrayLengthSetter(txMachine* the);
1339
+
1340
+ mxExport void fx_Array(txMachine* the);
1341
+ mxExport void fx_Array_from(txMachine* the);
1342
+ mxExport void fx_Array_isArray(txMachine* the);
1343
+ mxExport void fx_Array_of(txMachine* the);
1344
+ mxExport void fx_Array_prototype_at(txMachine* the);
1345
+ mxExport void fx_Array_prototype_concat(txMachine* the);
1346
+ mxExport void fx_Array_prototype_copyWithin(txMachine* the);
1347
+ mxExport void fx_Array_prototype_entries(txMachine* the);
1348
+ mxExport void fx_Array_prototype_every(txMachine* the);
1349
+ mxExport void fx_Array_prototype_fill(txMachine* the);
1350
+ mxExport void fx_Array_prototype_filter(txMachine* the);
1351
+ mxExport void fx_Array_prototype_find(txMachine* the);
1352
+ mxExport void fx_Array_prototype_findIndex(txMachine* the);
1353
+ mxExport void fx_Array_prototype_findLast(txMachine* the);
1354
+ mxExport void fx_Array_prototype_findLastIndex(txMachine* the);
1355
+ mxExport void fx_Array_prototype_flat(txMachine* the);
1356
+ mxExport void fx_Array_prototype_flatMap(txMachine* the);
1357
+ mxExport void fx_Array_prototype_forEach(txMachine* the);
1358
+ mxExport void fx_Array_prototype_includes(txMachine* the);
1359
+ mxExport void fx_Array_prototype_indexOf(txMachine* the);
1360
+ mxExport void fx_Array_prototype_join(txMachine* the);
1361
+ mxExport void fx_Array_prototype_keys(txMachine* the);
1362
+ mxExport void fx_Array_prototype_lastIndexOf(txMachine* the);
1363
+ mxExport void fx_Array_prototype_map(txMachine* the);
1364
+ mxExport void fx_Array_prototype_pop(txMachine* the);
1365
+ mxExport void fx_Array_prototype_push(txMachine* the);
1366
+ mxExport void fx_Array_prototype_reduce(txMachine* the);
1367
+ mxExport void fx_Array_prototype_reduceRight(txMachine* the);
1368
+ mxExport void fx_Array_prototype_reverse(txMachine* the);
1369
+ mxExport void fx_Array_prototype_shift(txMachine* the);
1370
+ mxExport void fx_Array_prototype_slice(txMachine* the);
1371
+ mxExport void fx_Array_prototype_some(txMachine* the);
1372
+ mxExport void fx_Array_prototype_sort(txMachine* the);
1373
+ mxExport void fx_Array_prototype_splice(txMachine* the);
1374
+ mxExport void fx_Array_prototype_toLocaleString(txMachine* the);
1375
+ mxExport void fx_Array_prototype_toString(txMachine* the);
1376
+ mxExport void fx_Array_prototype_unshift(txMachine* the);
1377
+ mxExport void fx_Array_prototype_values(txMachine* the);
1378
+ mxExport void fx_ArrayIterator_prototype_next(txMachine* the);
1379
+
1380
+ extern txNumber fxArgToIndex(txMachine* the, txInteger argi, txNumber index, txNumber length);
1381
+ extern txNumber fxArgToLastIndex(txMachine* the, txInteger argi, txNumber index, txNumber length);
1382
+ extern txNumber fxArgToRange(txMachine* the, txInteger argi, txNumber index, txNumber min, txNumber max);
1383
+ extern void fxCacheArray(txMachine* the, txSlot* theArray);
1384
+ extern void fxConstructArrayEntry(txMachine* the, txSlot* entry);
1385
+ extern txBoolean fxIsArray(txMachine* the, txSlot* instance);
1386
+ extern txSlot* fxNewArrayInstance(txMachine* the);
1387
+ extern void fxSortArrayItems(txMachine* the, txSlot* function, txSlot* array, txNumber LENGTH);
1388
+ extern txNumber fxToLength(txMachine* the, txSlot* slot);
1389
+
1390
+ /* xsDataView.c */
1391
+
1392
+ enum {
1393
+ EndianNative = 0,
1394
+ EndianLittle = 1,
1395
+ EndianBig = 2
1396
+ };
1397
+
1398
+ extern int fxBigInt64Compare(const void* p, const void* q);
1399
+ extern void fxBigInt64Getter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1400
+ extern void fxBigInt64Setter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1401
+ extern int fxBigUint64Compare(const void* p, const void* q);
1402
+ extern void fxBigUint64Getter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1403
+ extern void fxBigUint64Setter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1404
+ extern int fxFloat32Compare(const void* p, const void* q);
1405
+ extern void fxFloat32Getter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1406
+ extern void fxFloat32Setter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1407
+ extern int fxFloat64Compare(const void* p, const void* q);
1408
+ extern void fxFloat64Getter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1409
+ extern void fxFloat64Setter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1410
+ extern int fxInt8Compare(const void* p, const void* q);
1411
+ extern void fxInt8Getter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1412
+ extern void fxInt8Setter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1413
+ extern int fxInt16Compare(const void* p, const void* q);
1414
+ extern void fxInt16Getter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1415
+ extern void fxInt16Setter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1416
+ extern int fxInt32Compare(const void* p, const void* q);
1417
+ extern void fxInt32Getter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1418
+ extern void fxInt32Setter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1419
+ extern int fxUint8Compare(const void* p, const void* q);
1420
+ extern void fxUint8Getter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1421
+ extern void fxUint8Setter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1422
+ extern int fxUint16Compare(const void* p, const void* q);
1423
+ extern void fxUint16Getter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1424
+ extern void fxUint16Setter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1425
+ extern int fxUint32Compare(const void* p, const void* q);
1426
+ extern void fxUint32Getter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1427
+ extern void fxUint32Setter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1428
+ extern void fxUint8ClampedSetter(txMachine* the, txSlot* data, txInteger offset, txSlot* slot, int endian);
1429
+
1430
+ mxExport void *fxArrayBuffer(txMachine* the, txSlot* slot, void* data, txInteger byteLength, txInteger maxByteLength);
1431
+ mxExport void fxGetArrayBufferData(txMachine* the, txSlot* slot, txInteger byteOffset, void* data, txInteger byteLength);
1432
+ mxExport txInteger fxGetArrayBufferLength(txMachine* the, txSlot* slot);
1433
+ mxExport txInteger fxGetArrayBufferMaxLength(txMachine* the, txSlot* slot);
1434
+ mxExport void fxSetArrayBufferData(txMachine* the, txSlot* slot, txInteger byteOffset, void* data, txInteger byteLength);
1435
+ mxExport void fxSetArrayBufferLength(txMachine* the, txSlot* slot, txInteger byteLength);
1436
+ mxExport void* fxToArrayBuffer(txMachine* the, txSlot* slot);
1437
+
1438
+ mxExport void fx_ArrayBuffer(txMachine* the);
1439
+ mxExport void fx_ArrayBuffer_fromBigInt(txMachine* the);
1440
+ #ifndef mxCESU8
1441
+ mxExport void fx_ArrayBuffer_fromString(txMachine* the);
1442
+ #endif
1443
+ mxExport void fx_ArrayBuffer_isView(txMachine* the);
1444
+ mxExport void fx_ArrayBuffer_prototype_get_byteLength(txMachine* the);
1445
+ mxExport void fx_ArrayBuffer_prototype_get_maxByteLength(txMachine* the);
1446
+ mxExport void fx_ArrayBuffer_prototype_get_resizable(txMachine* the);
1447
+ mxExport void fx_ArrayBuffer_prototype_concat(txMachine* the);
1448
+ mxExport void fx_ArrayBuffer_prototype_resize(txMachine* the);
1449
+ mxExport void fx_ArrayBuffer_prototype_slice(txMachine* the);
1450
+ mxExport void fx_ArrayBuffer_prototype_transfer(txMachine* the);
1451
+
1452
+ mxExport void fx_DataView(txMachine* the);
1453
+ mxExport void fx_DataView_prototype_buffer_get(txMachine* the);
1454
+ mxExport void fx_DataView_prototype_byteLength_get(txMachine* the);
1455
+ mxExport void fx_DataView_prototype_byteOffset_get(txMachine* the);
1456
+ mxExport void fx_DataView_prototype_getBigInt64(txMachine* the);
1457
+ mxExport void fx_DataView_prototype_getBigUint64(txMachine* the);
1458
+ mxExport void fx_DataView_prototype_getFloat32(txMachine* the);
1459
+ mxExport void fx_DataView_prototype_getFloat64(txMachine* the);
1460
+ mxExport void fx_DataView_prototype_getInt8(txMachine* the);
1461
+ mxExport void fx_DataView_prototype_getInt16(txMachine* the);
1462
+ mxExport void fx_DataView_prototype_getInt32(txMachine* the);
1463
+ mxExport void fx_DataView_prototype_getUint8(txMachine* the);
1464
+ mxExport void fx_DataView_prototype_getUint16(txMachine* the);
1465
+ mxExport void fx_DataView_prototype_getUint32(txMachine* the);
1466
+ mxExport void fx_DataView_prototype_setBigInt64(txMachine* the);
1467
+ mxExport void fx_DataView_prototype_setBigUint64(txMachine* the);
1468
+ mxExport void fx_DataView_prototype_setFloat32(txMachine* the);
1469
+ mxExport void fx_DataView_prototype_setFloat64(txMachine* the);
1470
+ mxExport void fx_DataView_prototype_setInt8(txMachine* the);
1471
+ mxExport void fx_DataView_prototype_setInt16(txMachine* the);
1472
+ mxExport void fx_DataView_prototype_setInt32(txMachine* the);
1473
+ mxExport void fx_DataView_prototype_setUint8(txMachine* the);
1474
+ mxExport void fx_DataView_prototype_setUint16(txMachine* the);
1475
+ mxExport void fx_DataView_prototype_setUint32(txMachine* the);
1476
+
1477
+ mxExport const txTypeDispatch gxTypeDispatches[];
1478
+ mxExport const txBehavior gxTypedArrayBehavior;
1479
+
1480
+ mxExport void fxTypedArrayGetter(txMachine* the);
1481
+ mxExport void fxTypedArraySetter(txMachine* the);
1482
+
1483
+ mxExport void fx_TypedArray(txMachine* the);
1484
+ mxExport void fx_TypedArray_from(txMachine* the);
1485
+ mxExport void fx_TypedArray_of(txMachine* the);
1486
+ mxExport void fx_TypedArray_prototype_at(txMachine* the);
1487
+ mxExport void fx_TypedArray_prototype_buffer_get(txMachine* the);
1488
+ mxExport void fx_TypedArray_prototype_byteLength_get(txMachine* the);
1489
+ mxExport void fx_TypedArray_prototype_byteOffset_get(txMachine* the);
1490
+ mxExport void fx_TypedArray_prototype_copyWithin(txMachine* the);
1491
+ mxExport void fx_TypedArray_prototype_entries(txMachine* the);
1492
+ mxExport void fx_TypedArray_prototype_every(txMachine* the);
1493
+ mxExport void fx_TypedArray_prototype_fill(txMachine* the);
1494
+ mxExport void fx_TypedArray_prototype_filter(txMachine* the);
1495
+ mxExport void fx_TypedArray_prototype_find(txMachine* the);
1496
+ mxExport void fx_TypedArray_prototype_findIndex(txMachine* the);
1497
+ mxExport void fx_TypedArray_prototype_findLast(txMachine* the);
1498
+ mxExport void fx_TypedArray_prototype_findLastIndex(txMachine* the);
1499
+ mxExport void fx_TypedArray_prototype_forEach(txMachine* the);
1500
+ mxExport void fx_TypedArray_prototype_includes(txMachine* the);
1501
+ mxExport void fx_TypedArray_prototype_indexOf(txMachine* the);
1502
+ mxExport void fx_TypedArray_prototype_join(txMachine* the);
1503
+ mxExport void fx_TypedArray_prototype_keys(txMachine* the);
1504
+ mxExport void fx_TypedArray_prototype_lastIndexOf(txMachine* the);
1505
+ mxExport void fx_TypedArray_prototype_length_get(txMachine* the);
1506
+ mxExport void fx_TypedArray_prototype_map(txMachine* the);
1507
+ mxExport void fx_TypedArray_prototype_reduce(txMachine* the);
1508
+ mxExport void fx_TypedArray_prototype_reduceRight(txMachine* the);
1509
+ mxExport void fx_TypedArray_prototype_reverse(txMachine* the);
1510
+ mxExport void fx_TypedArray_prototype_set(txMachine* the);
1511
+ mxExport void fx_TypedArray_prototype_slice(txMachine* the);
1512
+ mxExport void fx_TypedArray_prototype_some(txMachine* the);
1513
+ mxExport void fx_TypedArray_prototype_sort(txMachine* the);
1514
+ mxExport void fx_TypedArray_prototype_subarray(txMachine* the);
1515
+ mxExport void fx_TypedArray_prototype_toLocaleString(txMachine* the);
1516
+ mxExport void fx_TypedArray_prototype_toStringTag_get(txMachine* the);
1517
+ mxExport void fx_TypedArray_prototype_values(txMachine* the);
1518
+
1519
+ extern void fxBuildDataView(txMachine* the);
1520
+ extern void fxConstructArrayBufferResult(txMachine* the, txSlot* constructor, txInteger length);
1521
+
1522
+ extern txInteger fxArgToByteLength(txMachine* the, txInteger argi, txInteger length);
1523
+ extern txInteger fxGetDataViewSize(txMachine* the, txSlot* view, txSlot* buffer);
1524
+
1525
+ /* xsAtomics.c */
1526
+ extern void fxInt8Add(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1527
+ extern void fxInt16Add(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1528
+ extern void fxInt32Add(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1529
+ extern void fxInt64Add(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1530
+ extern void fxUint8Add(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1531
+ extern void fxUint16Add(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1532
+ extern void fxUint32Add(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1533
+ extern void fxUint64Add(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1534
+
1535
+ extern void fxInt8And(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1536
+ extern void fxInt16And(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1537
+ extern void fxInt32And(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1538
+ extern void fxInt64And(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1539
+ extern void fxUint8And(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1540
+ extern void fxUint16And(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1541
+ extern void fxUint32And(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1542
+ extern void fxUint64And(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1543
+
1544
+ extern void fxInt8CompareExchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1545
+ extern void fxInt16CompareExchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1546
+ extern void fxInt32CompareExchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1547
+ extern void fxInt64CompareExchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1548
+ extern void fxUint8CompareExchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1549
+ extern void fxUint16CompareExchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1550
+ extern void fxUint32CompareExchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1551
+ extern void fxUint64CompareExchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1552
+
1553
+ extern void fxInt8Exchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1554
+ extern void fxInt16Exchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1555
+ extern void fxInt32Exchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1556
+ extern void fxInt64Exchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1557
+ extern void fxUint8Exchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1558
+ extern void fxUint16Exchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1559
+ extern void fxUint32Exchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1560
+ extern void fxUint64Exchange(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1561
+
1562
+ extern void fxInt8Load(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1563
+ extern void fxInt16Load(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1564
+ extern void fxInt32Load(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1565
+ extern void fxInt64Load(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1566
+ extern void fxUint8Load(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1567
+ extern void fxUint16Load(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1568
+ extern void fxUint32Load(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1569
+ extern void fxUint64Load(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1570
+
1571
+ extern void fxInt8Or(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1572
+ extern void fxInt16Or(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1573
+ extern void fxInt32Or(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1574
+ extern void fxInt64Or(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1575
+ extern void fxUint8Or(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1576
+ extern void fxUint16Or(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1577
+ extern void fxUint32Or(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1578
+ extern void fxUint64Or(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1579
+
1580
+ extern void fxInt8Store(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1581
+ extern void fxInt16Store(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1582
+ extern void fxInt32Store(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1583
+ extern void fxInt64Store(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1584
+ extern void fxUint8Store(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1585
+ extern void fxUint16Store(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1586
+ extern void fxUint32Store(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1587
+ extern void fxUint64Store(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1588
+
1589
+ extern void fxInt8Sub(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1590
+ extern void fxInt16Sub(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1591
+ extern void fxInt32Sub(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1592
+ extern void fxInt64Sub(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1593
+ extern void fxUint8Sub(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1594
+ extern void fxUint16Sub(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1595
+ extern void fxUint32Sub(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1596
+ extern void fxUint64Sub(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1597
+
1598
+ extern void fxInt8Xor(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1599
+ extern void fxInt16Xor(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1600
+ extern void fxInt32Xor(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1601
+ extern void fxInt64Xor(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1602
+ extern void fxUint8Xor(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1603
+ extern void fxUint16Xor(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1604
+ extern void fxUint32Xor(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1605
+ extern void fxUint64Xor(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, int endian);
1606
+
1607
+ extern txInteger fxInt32Wait(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, txNumber timeout);
1608
+ extern txInteger fxInt64Wait(txMachine* the, txSlot* host, txInteger offset, txSlot* slot, txNumber timeout);
1609
+
1610
+ mxExport const txTypeAtomics gxTypeAtomics[];
1611
+ extern void fxBuildAtomics(txMachine* the);
1612
+
1613
+ mxExport void fx_SharedArrayBuffer(txMachine* the);
1614
+ mxExport void fx_SharedArrayBuffer_prototype_get_byteLength(txMachine* the);
1615
+ mxExport void fx_SharedArrayBuffer_prototype_get_growable(txMachine* the);
1616
+ mxExport void fx_SharedArrayBuffer_prototype_get_maxByteLength(txMachine* the);
1617
+ mxExport void fx_SharedArrayBuffer_prototype_grow(txMachine* the);
1618
+ mxExport void fx_SharedArrayBuffer_prototype_slice(txMachine* the);
1619
+ mxExport void fx_Atomics_add(txMachine* the);
1620
+ mxExport void fx_Atomics_and(txMachine* the);
1621
+ mxExport void fx_Atomics_compareExchange(txMachine* the);
1622
+ mxExport void fx_Atomics_exchange(txMachine* the);
1623
+ mxExport void fx_Atomics_isLockFree(txMachine* the);
1624
+ mxExport void fx_Atomics_load(txMachine* the);
1625
+ mxExport void fx_Atomics_or(txMachine* the);
1626
+ mxExport void fx_Atomics_notify(txMachine* the);
1627
+ mxExport void fx_Atomics_store(txMachine* the);
1628
+ mxExport void fx_Atomics_sub(txMachine* the);
1629
+ mxExport void fx_Atomics_wait(txMachine* the);
1630
+ mxExport void fx_Atomics_xor(txMachine* the);
1631
+
1632
+ /* xsMapSet.c */
1633
+ mxExport void fx_Map(txMachine* the);
1634
+ mxExport void fx_Map_prototype_clear(txMachine* the);
1635
+ mxExport void fx_Map_prototype_delete(txMachine* the);
1636
+ mxExport void fx_Map_prototype_entries(txMachine* the);
1637
+ mxExport void fx_Map_prototype_forEach(txMachine* the);
1638
+ mxExport void fx_Map_prototype_get(txMachine* the);
1639
+ mxExport void fx_Map_prototype_has(txMachine* the);
1640
+ mxExport void fx_Map_prototype_keys(txMachine* the);
1641
+ mxExport void fx_Map_prototype_set(txMachine* the);
1642
+ mxExport void fx_Map_prototype_size(txMachine* the);
1643
+ mxExport void fx_Map_prototype_values(txMachine* the);
1644
+ mxExport void fx_MapIterator_prototype_next(txMachine* the);
1645
+ mxExport void fx_Set(txMachine* the);
1646
+ mxExport void fx_Set_prototype_add(txMachine* the);
1647
+ mxExport void fx_Set_prototype_clear(txMachine* the);
1648
+ mxExport void fx_Set_prototype_delete(txMachine* the);
1649
+ mxExport void fx_Set_prototype_entries(txMachine* the);
1650
+ mxExport void fx_Set_prototype_forEach(txMachine* the);
1651
+ mxExport void fx_Set_prototype_has(txMachine* the);
1652
+ mxExport void fx_Set_prototype_size(txMachine* the);
1653
+ mxExport void fx_Set_prototype_values(txMachine* the);
1654
+ mxExport void fx_SetIterator_prototype_next(txMachine* the);
1655
+ mxExport void fx_WeakMap(txMachine* the);
1656
+ mxExport void fx_WeakMap_prototype_delete(txMachine* the);
1657
+ mxExport void fx_WeakMap_prototype_get(txMachine* the);
1658
+ mxExport void fx_WeakMap_prototype_has(txMachine* the);
1659
+ mxExport void fx_WeakMap_prototype_set(txMachine* the);
1660
+ mxExport void fx_WeakSet(txMachine* the);
1661
+ mxExport void fx_WeakSet_prototype_add(txMachine* the);
1662
+ mxExport void fx_WeakSet_prototype_delete(txMachine* the);
1663
+ mxExport void fx_WeakSet_prototype_has(txMachine* the);
1664
+ mxExport void fx_WeakRef(txMachine* the);
1665
+ mxExport void fx_WeakRef_prototype_deref(txMachine* the);
1666
+ mxExport void fx_FinalizationRegistry(txMachine* the);
1667
+ //mxExport void fx_FinalizationRegistry_prototype_cleanupSome(txMachine* the);
1668
+ mxExport void fx_FinalizationRegistry_prototype_register(txMachine* the);
1669
+ mxExport void fx_FinalizationRegistry_prototype_unregister(txMachine* the);
1670
+
1671
+ extern void fxBuildMapSet(txMachine* the);
1672
+ extern txSlot* fxNewMapInstance(txMachine* the);
1673
+ extern txSlot* fxNewSetInstance(txMachine* the);
1674
+ extern txSlot* fxNewWeakMapInstance(txMachine* the);
1675
+ extern txSlot* fxNewWeakSetInstance(txMachine* the);
1676
+ extern void fxCleanupFinalizationRegistries(txMachine* the);
1677
+ extern txU4 fxSumEntry(txMachine* the, txSlot* slot);
1678
+
1679
+ /* xsJSON.c */
1680
+ mxExport void fx_JSON_parse(txMachine* the);
1681
+ mxExport void fx_JSON_stringify(txMachine* the);
1682
+
1683
+ extern void fxBuildJSON(txMachine* the);
1684
+
1685
+ /* xsGenerator.c */
1686
+ mxExport void fx_Generator(txMachine* the);
1687
+ mxExport void fx_Generator_prototype_next(txMachine* the);
1688
+ mxExport void fx_Generator_prototype_return(txMachine* the);
1689
+ mxExport void fx_Generator_prototype_throw(txMachine* the);
1690
+ mxExport void fx_GeneratorFunction(txMachine* the);
1691
+
1692
+ mxExport void fx_AsyncGenerator(txMachine* the);
1693
+ mxExport void fx_AsyncGenerator_prototype_next(txMachine* the);
1694
+ mxExport void fx_AsyncGenerator_prototype_return(txMachine* the);
1695
+ mxExport void fx_AsyncGenerator_prototype_throw(txMachine* the);
1696
+ mxExport void fx_AsyncGeneratorFunction(txMachine* the);
1697
+
1698
+ mxExport void fx_AsyncIterator_asyncIterator(txMachine* the);
1699
+ mxExport void fx_AsyncFromSyncIterator_prototype_next(txMachine* the);
1700
+ mxExport void fx_AsyncFromSyncIterator_prototype_return(txMachine* the);
1701
+ mxExport void fx_AsyncFromSyncIterator_prototype_throw(txMachine* the);
1702
+
1703
+ extern void fxBuildGenerator(txMachine* the);
1704
+ extern txSlot* fxNewGeneratorInstance(txMachine* the);
1705
+ extern txSlot* fxNewGeneratorFunctionInstance(txMachine* the, txID name);
1706
+ extern txSlot* fxNewAsyncGeneratorInstance(txMachine* the);
1707
+ extern txSlot* fxNewAsyncGeneratorFunctionInstance(txMachine* the, txID name);
1708
+ extern txSlot* fxNewAsyncFromSyncIteratorInstance(txMachine* the);
1709
+ extern void fxAsyncGeneratorRejectAwait(txMachine* the);
1710
+ extern void fxAsyncGeneratorRejectYield(txMachine* the);
1711
+ extern void fxAsyncGeneratorResolveAwait(txMachine* the);
1712
+ extern void fxAsyncGeneratorResolveYield(txMachine* the);
1713
+ extern void fxAsyncFromSyncIteratorDone(txMachine* the);
1714
+
1715
+ /* xsPromise.c */
1716
+ mxExport void fx_Promise(txMachine* the);
1717
+ mxExport void fx_Promise_all(txMachine* the);
1718
+ mxExport void fx_Promise_allSettled(txMachine* the);
1719
+ mxExport void fx_Promise_any(txMachine* the);
1720
+ mxExport void fx_Promise_race(txMachine* the);
1721
+ mxExport void fx_Promise_reject(txMachine* the);
1722
+ mxExport void fx_Promise_resolve(txMachine* the);
1723
+ mxExport void fx_Promise_prototype_catch(txMachine* the);
1724
+ mxExport void fx_Promise_prototype_finally(txMachine* the);
1725
+ mxExport void fx_Promise_prototype_then(txMachine* the);
1726
+ mxExport void fxOnRejectedPromise(txMachine* the);
1727
+ mxExport void fxOnResolvedPromise(txMachine* the);
1728
+ mxExport void fxOnThenable(txMachine* the);
1729
+
1730
+ extern void fx_Promise_resolveAux(txMachine* the);
1731
+ extern void fx_Promise_prototype_finallyAux(txMachine* the);
1732
+ extern void fx_Promise_prototype_finallyReturn(txMachine* the);
1733
+ extern void fx_Promise_prototype_finallyThrow(txMachine* the);
1734
+
1735
+ extern void fxBuildPromise(txMachine* the);
1736
+ extern void fxCheckUnhandledRejections(txMachine* the, txBoolean atExit);
1737
+ extern void fxCombinePromisesCallback(txMachine* the);
1738
+ extern txSlot* fxNewPromiseCapability(txMachine* the, txSlot* resolveFunction, txSlot* rejectFunction);
1739
+ extern void fxNewPromiseCapabilityCallback(txMachine* the);
1740
+ extern txSlot* fxNewPromiseInstance(txMachine* the);
1741
+ extern void fxPromiseThen(txMachine* the, txSlot* promise, txSlot* onFullfilled, txSlot* onRejected, txSlot* resolveFunction, txSlot* rejectFunction);
1742
+ extern void fxPushPromiseFunctions(txMachine* the, txSlot* promise);
1743
+ extern void fxQueueJob(txMachine* the, txInteger count, txSlot* promise);
1744
+ extern void fxRejectException(txMachine* the, txSlot* rejectFunction);
1745
+ extern void fxRejectPromise(txMachine* the);
1746
+ extern void fxResolvePromise(txMachine* the);
1747
+ extern void fxRunPromiseJobs(txMachine* the);
1748
+
1749
+ /* xsProxy.c */
1750
+ extern void fxBuildProxy(txMachine* the);
1751
+
1752
+ mxExport const txBehavior gxProxyBehavior;
1753
+
1754
+ mxExport void fxProxyGetter(txMachine* the);
1755
+ mxExport void fxProxySetter(txMachine* the);
1756
+
1757
+ mxExport void fx_Proxy(txMachine* the);
1758
+ mxExport void fx_Proxy_revocable(txMachine* the);
1759
+ mxExport void fx_Proxy_revoke(txMachine* the);
1760
+ mxExport void fx_Reflect_apply(txMachine* the);
1761
+ mxExport void fx_Reflect_construct(txMachine* the);
1762
+ mxExport void fx_Reflect_defineProperty(txMachine* the);
1763
+ mxExport void fx_Reflect_deleteProperty(txMachine* the);
1764
+ mxExport void fx_Reflect_get(txMachine* the);
1765
+ mxExport void fx_Reflect_getOwnPropertyDescriptor(txMachine* the);
1766
+ mxExport void fx_Reflect_getPrototypeOf(txMachine* the);
1767
+ mxExport void fx_Reflect_has(txMachine* the);
1768
+ mxExport void fx_Reflect_isExtensible(txMachine* the);
1769
+ mxExport void fx_Reflect_ownKeys(txMachine* the);
1770
+ mxExport void fx_Reflect_preventExtensions(txMachine* the);
1771
+ mxExport void fx_Reflect_set(txMachine* the);
1772
+ mxExport void fx_Reflect_setPrototypeOf(txMachine* the);
1773
+
1774
+ /* xsModule.c */
1775
+ extern const txBehavior gxModuleBehavior;
1776
+
1777
+ extern void fxBuildModule(txMachine* the);
1778
+
1779
+ extern txBoolean fxIsLoadingModule(txMachine* the, txSlot* realm, txID moduleID);
1780
+ extern void fxRunModule(txMachine* the, txSlot* realm, txID moduleID, txScript* script);
1781
+
1782
+ extern void fxExecuteModulesFulfilled(txMachine* the);
1783
+ extern void fxExecuteModulesRejected(txMachine* the);
1784
+ extern void fxLoadModulesFulfilled(txMachine* the);
1785
+ extern void fxLoadModulesRejected(txMachine* the);
1786
+ extern void fxPrepareModule(txMachine* the, txFlag flag);
1787
+ extern void fxPrepareTransfer(txMachine* the);
1788
+ extern void fxResolveModule(txMachine* the, txSlot* module, txID moduleID, txScript* script, void* data, txDestructor destructor);
1789
+ extern void fxRunImport(txMachine* the, txSlot* realm, txID id);
1790
+
1791
+ mxExport void fxModuleGetter(txMachine* the);
1792
+
1793
+ mxExport void fx_Compartment(txMachine* the);
1794
+ mxExport void fx_Compartment_prototype_get_globalThis(txMachine* the);
1795
+ mxExport void fx_Compartment_prototype_evaluate(txMachine* the);
1796
+ mxExport void fx_Compartment_prototype_import(txMachine* the);
1797
+ mxExport void fx_Compartment_prototype_importNow(txMachine* the);
1798
+
1799
+ mxExport void fx_ModuleSource(txMachine* the);
1800
+ mxExport void fx_ModuleSource_prototype_get_bindings(txMachine* the);
1801
+ mxExport void fx_ModuleSource_prototype_get_needsImport(txMachine* the);
1802
+ mxExport void fx_ModuleSource_prototype_get_needsImportMeta(txMachine* the);
1803
+
1804
+ mxExport void fxExecuteVirtualModuleSource(txMachine* the);
1805
+ mxExport void fxExecuteVirtualModuleSourceImport(txMachine* the);
1806
+
1807
+ /* xsLockdown.c */
1808
+ #ifdef mxLockdown
1809
+ mxExport void fx_harden(txMachine* the);
1810
+ mxExport void fx_lockdown(txMachine* the);
1811
+ mxExport void fx_petrify(txMachine* the);
1812
+ mxExport void fx_mutabilities(txMachine* the);
1813
+ #endif
1814
+
1815
+ /* xsProfile.c */
1816
+ #ifdef mxProfile
1817
+ extern void fxCheckProfiler(txMachine* the, txSlot* frame);
1818
+ extern void fxCreateProfiler(txMachine* the);
1819
+ extern void fxDeleteProfiler(txMachine* the, void* stream);
1820
+ extern void fxResumeProfiler(txMachine* the);
1821
+ extern void fxSuspendProfiler(txMachine* the);
1822
+ #endif
1823
+
1824
+ enum {
1825
+ XS_NO_ERROR = 0,
1826
+ XS_UNKNOWN_ERROR,
1827
+ XS_EVAL_ERROR,
1828
+ XS_RANGE_ERROR,
1829
+ XS_REFERENCE_ERROR,
1830
+ XS_SYNTAX_ERROR,
1831
+ XS_TYPE_ERROR,
1832
+ XS_URI_ERROR,
1833
+ XS_AGGREGATE_ERROR,
1834
+ XS_ERROR_COUNT
1835
+ };
1836
+
1837
+ enum {
1838
+ XS_IMMUTABLE = 0,
1839
+ XS_MUTABLE = 1,
1840
+ };
1841
+
1842
+ enum {
1843
+ XS_CHUNK = 0,
1844
+ XS_GROWABLE_CHUNK = 1,
1845
+ };
1846
+
1847
+ enum {
1848
+ XS_NO_STATUS = 0,
1849
+ XS_RETURN_STATUS = 1,
1850
+ XS_THROW_STATUS = 2,
1851
+
1852
+ XS_NO_HINT = 0,
1853
+ XS_NUMBER_HINT = 1,
1854
+ XS_STRING_HINT = 2,
1855
+
1856
+ XS_NO_FLAG = 0,
1857
+ XS_ASYNC_FLAG = 1,
1858
+
1859
+ XS_IMPORT_NAMESPACE = 0,
1860
+ XS_IMPORT_DEFAULT = 1,
1861
+ XS_IMPORT_PREFLIGHT = 2,
1862
+ XS_IMPORT_ASYNC = 4,
1863
+
1864
+ XS_OWN = 0,
1865
+ XS_ANY = 1,
1866
+
1867
+ /* frame flags */
1868
+ /* ? = 1, */
1869
+ XS_C_FLAG = 2,
1870
+ XS_FIELD_FLAG = 4,
1871
+ XS_STEP_INTO_FLAG = 8,
1872
+ XS_STEP_OVER_FLAG = 16,
1873
+ XS_STRICT_FLAG = 32,
1874
+ XS_DEBUG_FLAG = 64,
1875
+ XS_MARK_FLAG = 128,
1876
+
1877
+ /* instance flags */
1878
+ XS_EXOTIC_FLAG = 1,
1879
+ XS_CAN_CALL_FLAG = 2,
1880
+ XS_CAN_CONSTRUCT_FLAG = 4,
1881
+ XS_DONT_MODIFY_FLAG = 8,
1882
+ XS_DONT_PATCH_FLAG = 16,
1883
+ XS_LEVEL_FLAG = 32,
1884
+ XS_DONT_MARSHALL_FLAG = 64,
1885
+ /* XS_MARK_FLAG = 128, */
1886
+
1887
+ /* property flags */
1888
+ XS_INTERNAL_FLAG = 1,
1889
+ /* XS_DONT_DELETE_FLAG = 2, */
1890
+ /* XS_DONT_ENUM_FLAG = 4, */
1891
+ /* XS_DONT_SET_FLAG = 8 , */
1892
+ XS_INSPECTOR_FLAG = 16,
1893
+ XS_BASE_FLAG = 32,
1894
+ XS_DERIVED_FLAG = 64,
1895
+ /* XS_MARK_FLAG = 128, */
1896
+
1897
+ /* mxBehaviorOwnKeys flags */
1898
+ XS_EACH_NAME_FLAG = 1,
1899
+ XS_EACH_SYMBOL_FLAG = 2,
1900
+
1901
+ /* mxBehaviorDefineOwnProperty flags */
1902
+ /* XS_NAME_FLAG = 1, */
1903
+ /* XS_DONT_DELETE_FLAG = 2, */
1904
+ /* XS_DONT_ENUM_FLAG = 4, */
1905
+ /* XS_DONT_SET_FLAG = 8, */
1906
+ /* XS_METHOD_FLAG = 16, */
1907
+ /* XS_GETTER_FLAG = 32, */
1908
+ /* XS_SETTER_FLAG = 64, */
1909
+ XS_ACCESSOR_FLAG = XS_GETTER_FLAG | XS_SETTER_FLAG,
1910
+ XS_GET_ONLY = XS_DONT_DELETE_FLAG | XS_DONT_ENUM_FLAG | XS_DONT_SET_FLAG,
1911
+
1912
+ /* collect flags */
1913
+ XS_COMPACT_FLAG = 1,
1914
+ XS_ORGANIC_FLAG = 2,
1915
+ XS_COLLECTING_FLAG = 4,
1916
+ XS_TRASHING_FLAG = 8,
1917
+ XS_SKIPPED_COLLECT_FLAG = 16,
1918
+ XS_HOST_CHUNK_FLAG = 32,
1919
+ XS_HOST_HOOKS_FLAG = 64,
1920
+
1921
+ /* finalization registry flags */
1922
+ XS_FINALIZATION_REGISTRY_CHANGED = 1,
1923
+
1924
+ /* bubble flags */
1925
+ XS_BUBBLE_LEFT = 1,
1926
+ XS_BUBBLE_RIGHT = 2,
1927
+ XS_BUBBLE_BINARY = 4,
1928
+ };
1929
+
1930
+ enum {
1931
+ XS_UNINITIALIZED_KIND = -1,
1932
+ XS_UNDEFINED_KIND = 0,
1933
+ XS_NULL_KIND,
1934
+ XS_BOOLEAN_KIND,
1935
+ XS_INTEGER_KIND,
1936
+ XS_NUMBER_KIND,
1937
+ XS_STRING_KIND, // 5
1938
+ XS_STRING_X_KIND,
1939
+ XS_SYMBOL_KIND,
1940
+ XS_BIGINT_KIND,
1941
+ XS_BIGINT_X_KIND,
1942
+
1943
+ XS_REFERENCE_KIND, //10
1944
+
1945
+ XS_CLOSURE_KIND,
1946
+ XS_FRAME_KIND,
1947
+
1948
+ XS_INSTANCE_KIND,
1949
+
1950
+ XS_ARGUMENTS_SLOPPY_KIND,
1951
+ XS_ARGUMENTS_STRICT_KIND, // 15
1952
+ XS_ARRAY_KIND,
1953
+ XS_ARRAY_BUFFER_KIND,
1954
+ XS_CALLBACK_KIND,
1955
+ XS_CODE_KIND,
1956
+ XS_CODE_X_KIND, // 20
1957
+ XS_DATE_KIND,
1958
+ XS_DATA_VIEW_KIND,
1959
+ XS_FINALIZATION_CELL_KIND,
1960
+ XS_FINALIZATION_REGISTRY_KIND,
1961
+ XS_GLOBAL_KIND, // 25
1962
+ XS_HOST_KIND,
1963
+ XS_MAP_KIND,
1964
+ XS_MODULE_KIND,
1965
+ XS_PROGRAM_KIND,
1966
+ XS_PROMISE_KIND, // 30
1967
+ XS_PROXY_KIND,
1968
+ XS_REGEXP_KIND,
1969
+ XS_SET_KIND,
1970
+ XS_TYPED_ARRAY_KIND,
1971
+ XS_WEAK_MAP_KIND, // 35
1972
+ XS_WEAK_REF_KIND,
1973
+ XS_WEAK_SET_KIND,
1974
+
1975
+ XS_ACCESSOR_KIND,
1976
+ XS_AT_KIND,
1977
+ XS_ENTRY_KIND, //40
1978
+ XS_ERROR_KIND,
1979
+ XS_HOME_KIND,
1980
+ XS_KEY_KIND,
1981
+ XS_KEY_X_KIND,
1982
+ XS_LIST_KIND, // 45
1983
+ XS_PRIVATE_KIND,
1984
+ XS_STACK_KIND,
1985
+ XS_VAR_KIND,
1986
+ XS_CALLBACK_X_KIND,
1987
+ #ifdef mxHostFunctionPrimitive
1988
+ XS_HOST_FUNCTION_KIND,
1989
+ #endif
1990
+ XS_HOST_INSPECTOR_KIND,
1991
+ XS_INSTANCE_INSPECTOR_KIND,
1992
+ XS_EXPORT_KIND,
1993
+ XS_WEAK_ENTRY_KIND,
1994
+ XS_BUFFER_INFO_KIND,
1995
+ XS_MODULE_SOURCE_KIND,
1996
+ XS_IDS_KIND,
1997
+ };
1998
+ enum {
1999
+ XS_DEBUGGER_EXIT = 0,
2000
+ XS_NOT_ENOUGH_MEMORY_EXIT,
2001
+ XS_STACK_OVERFLOW_EXIT,
2002
+ XS_FATAL_CHECK_EXIT,
2003
+ XS_DEAD_STRIP_EXIT,
2004
+ XS_UNHANDLED_EXCEPTION_EXIT,
2005
+ XS_NO_MORE_KEYS_EXIT,
2006
+ XS_TOO_MUCH_COMPUTATION_EXIT,
2007
+ XS_UNHANDLED_REJECTION_EXIT,
2008
+ };
2009
+
2010
+ #if mxBigEndian
2011
+ #define mxInitSlotKind(SLOT,KIND) ((SLOT)->ID_FLAG_KIND = (uint8_t)(KIND))
2012
+ #else
2013
+ #define mxInitSlotKind(SLOT,KIND) ((SLOT)->KIND_FLAG_ID = (uint8_t)(KIND))
2014
+ #endif
2015
+
2016
+ #define mxTry(THE_MACHINE) \
2017
+ txJump __JUMP__; \
2018
+ __JUMP__.nextJump = (THE_MACHINE)->firstJump; \
2019
+ __JUMP__.stack = the->stack; \
2020
+ __JUMP__.scope = the->scope; \
2021
+ __JUMP__.frame = the->frame; \
2022
+ __JUMP__.code = the->code; \
2023
+ __JUMP__.flag = 0; \
2024
+ (THE_MACHINE)->firstJump = &__JUMP__; \
2025
+ if (c_setjmp(__JUMP__.buffer) == 0) {
2026
+
2027
+ #define mxCatch(THE_MACHINE) \
2028
+ (THE_MACHINE)->firstJump = __JUMP__.nextJump; \
2029
+ } \
2030
+ else for ( \
2031
+ the->stack = __JUMP__.stack, \
2032
+ the->scope = __JUMP__.scope, \
2033
+ the->frame = __JUMP__.frame, \
2034
+ the->code = __JUMP__.code, \
2035
+ (THE_MACHINE)->firstJump = __JUMP__.nextJump; \
2036
+ (__JUMP__.stack); \
2037
+ __JUMP__.stack = NULL)
2038
+
2039
+
2040
+ #ifdef mxDebug
2041
+ #define mxCheck(THE, THE_ASSERTION) \
2042
+ if (!(THE_ASSERTION)) \
2043
+ fxCheck(THE, __FILE__,__LINE__)
2044
+ #else
2045
+ #define mxCheck(THE, THE_ASSERTION)
2046
+ #endif
2047
+
2048
+ #define mxThrowMessage(_CODE,...) fxThrowMessage(the, C_NULL, 0, _CODE, __VA_ARGS__)
2049
+
2050
+ #ifdef mxDebug
2051
+ #define mxUnknownError(...) fxThrowMessage(the, NULL, 0, XS_UNKNOWN_ERROR, __VA_ARGS__)
2052
+ #define mxEvalError(...) fxThrowMessage(the, NULL, 0, XS_EVAL_ERROR, __VA_ARGS__)
2053
+ #define mxRangeError(...) fxThrowMessage(the, NULL, 0, XS_RANGE_ERROR, __VA_ARGS__)
2054
+ #define mxReferenceError(...) fxThrowMessage(the, NULL, 0, XS_REFERENCE_ERROR, __VA_ARGS__)
2055
+ #define mxSyntaxError(...) fxThrowMessage(the, NULL, 0, XS_SYNTAX_ERROR, __VA_ARGS__)
2056
+ #define mxTypeError(...) fxThrowMessage(the, NULL, 0, XS_TYPE_ERROR, __VA_ARGS__)
2057
+ #define mxURIError(...) fxThrowMessage(the, NULL, 0, XS_URI_ERROR, __VA_ARGS__)
2058
+ #define mxDebugID(THE_ERROR, THE_FORMAT, THE_ID) ( \
2059
+ fxIDToString(the, THE_ID, the->nameBuffer, sizeof(the->nameBuffer)), \
2060
+ fxThrowMessage(the, NULL, 0, THE_ERROR, THE_FORMAT, the->nameBuffer) \
2061
+ )
2062
+ #else
2063
+ #define mxUnknownError(...) fxThrowMessage(the, NULL, 0, XS_UNKNOWN_ERROR, __VA_ARGS__)
2064
+ #define mxEvalError(...) fxThrowMessage(the, NULL, 0, XS_EVAL_ERROR, __VA_ARGS__)
2065
+ #define mxRangeError(...) fxThrowMessage(the, NULL, 0, XS_RANGE_ERROR, __VA_ARGS__)
2066
+ #define mxReferenceError(...) fxThrowMessage(the, NULL, 0, XS_REFERENCE_ERROR, __VA_ARGS__)
2067
+ #define mxSyntaxError(...) fxThrowMessage(the, NULL, 0, XS_SYNTAX_ERROR, __VA_ARGS__)
2068
+ #define mxTypeError(...) fxThrowMessage(the, NULL, 0, XS_TYPE_ERROR, __VA_ARGS__)
2069
+ #define mxURIError(...) fxThrowMessage(the, NULL, 0, XS_URI_ERROR, __VA_ARGS__)
2070
+ #define mxDebugID(THE_ERROR, THE_FORMAT, THE_ID) ( \
2071
+ fxIDToString(the, THE_ID, the->nameBuffer, sizeof(the->nameBuffer)), \
2072
+ fxThrowMessage(the, NULL, 0, THE_ERROR, THE_FORMAT, the->nameBuffer) \
2073
+ )
2074
+ #endif
2075
+
2076
+ #define mxIsUndefined(THE_SLOT) \
2077
+ ((THE_SLOT)->kind == XS_UNDEFINED_KIND)
2078
+ #define mxIsNull(THE_SLOT) \
2079
+ ((THE_SLOT)->kind == XS_NULL_KIND)
2080
+ #define mxIsBigInt(THE_SLOT) \
2081
+ (((THE_SLOT)->kind == XS_BIGINT_KIND) || ((THE_SLOT)->kind == XS_BIGINT_X_KIND))
2082
+ #define mxIsReference(THE_SLOT) \
2083
+ ((THE_SLOT)->kind == XS_REFERENCE_KIND)
2084
+ #define mxIsFunction(THE_SLOT) \
2085
+ ( (THE_SLOT) && ((THE_SLOT)->next) && ((THE_SLOT)->next->flag & XS_INTERNAL_FLAG) && (((THE_SLOT)->next->kind == XS_CALLBACK_KIND) || ((THE_SLOT)->next->kind == XS_CALLBACK_X_KIND) || ((THE_SLOT)->next->kind == XS_CODE_KIND) || ((THE_SLOT)->next->kind == XS_CODE_X_KIND)))
2086
+ #define mxIsString(THE_SLOT) \
2087
+ (/* (THE_SLOT) && */ ((THE_SLOT)->next) && ((THE_SLOT)->next->flag & XS_INTERNAL_FLAG) && (((THE_SLOT)->next->kind == XS_STRING_KIND) || ((THE_SLOT)->next->kind == XS_STRING_X_KIND)))
2088
+ #define mxIsBoolean(THE_SLOT) \
2089
+ (/* (THE_SLOT) && */ ((THE_SLOT)->next) && ((THE_SLOT)->next->flag & XS_INTERNAL_FLAG) && ((THE_SLOT)->next->kind == XS_BOOLEAN_KIND))
2090
+ #define mxIsNumber(THE_SLOT) \
2091
+ (/* (THE_SLOT) && */ ((THE_SLOT)->next) && ((THE_SLOT)->next->flag & XS_INTERNAL_FLAG) && ((THE_SLOT)->next->kind == XS_NUMBER_KIND))
2092
+ #define mxIsDate(THE_SLOT) \
2093
+ (/* (THE_SLOT) && */ ((THE_SLOT)->next) && ((THE_SLOT)->next->flag & XS_INTERNAL_FLAG) && ((THE_SLOT)->next->kind == XS_DATE_KIND))
2094
+ #define mxIsRegExp(THE_SLOT) \
2095
+ (/* (THE_SLOT) && */ ((THE_SLOT)->next) && ((THE_SLOT)->next->flag & XS_INTERNAL_FLAG) && ((THE_SLOT)->next->kind == XS_REGEXP_KIND))
2096
+ #define mxIsSymbol(THE_SLOT) \
2097
+ (/* (THE_SLOT) && */ ((THE_SLOT)->next) && ((THE_SLOT)->next->flag & XS_INTERNAL_FLAG) && ((THE_SLOT)->next->kind == XS_SYMBOL_KIND))
2098
+ #define mxIsHost(THE_SLOT) \
2099
+ (/* (THE_SLOT) && */ ((THE_SLOT)->next) && ((THE_SLOT)->next->flag & XS_INTERNAL_FLAG) && ((THE_SLOT)->next->kind == XS_HOST_KIND))
2100
+ #define mxIsPromise(THE_SLOT) \
2101
+ ((THE_SLOT) && ((THE_SLOT)->next) && ((THE_SLOT)->next->flag & XS_INTERNAL_FLAG) && ((THE_SLOT)->next->kind == XS_PROMISE_KIND) && (THE_SLOT != mxPromisePrototype.value.reference))
2102
+ #define mxIsProxy(THE_SLOT) \
2103
+ (/* (THE_SLOT) && */ ((THE_SLOT)->next) && ((THE_SLOT)->next->flag & XS_INTERNAL_FLAG) && ((THE_SLOT)->next->kind == XS_PROXY_KIND))
2104
+ #define mxIsCallable(THE_SLOT) \
2105
+ ( (THE_SLOT) && ((THE_SLOT)->next) && (((THE_SLOT)->next->kind == XS_CALLBACK_KIND) || ((THE_SLOT)->next->kind == XS_CALLBACK_X_KIND) || ((THE_SLOT)->next->kind == XS_CODE_KIND) || ((THE_SLOT)->next->kind == XS_CODE_X_KIND) || ((THE_SLOT)->next->kind == XS_PROXY_KIND)))
2106
+ #define mxIsConstructor(THE_SLOT) \
2107
+ ((THE_SLOT) && ((THE_SLOT)->flag & XS_CAN_CONSTRUCT_FLAG))
2108
+
2109
+ #define mxIsStringPrimitive(THE_SLOT) \
2110
+ (((THE_SLOT)->kind == XS_STRING_KIND) || ((THE_SLOT)->kind == XS_STRING_X_KIND))
2111
+
2112
+ #ifdef mxMetering
2113
+ #define mxMeterOne() \
2114
+ (the->meterIndex++)
2115
+ #define mxMeterSome(_COUNT) \
2116
+ (the->meterIndex += _COUNT)
2117
+ #else
2118
+ #define mxMeterOne() \
2119
+ ((void)0)
2120
+ #define mxMeterSome(_COUNT) \
2121
+ ((void)0)
2122
+ #endif
2123
+
2124
+ #if mxBoundsCheck
2125
+ #define mxCheckCStack() \
2126
+ (fxCheckCStack(the))
2127
+ #define mxOverflow(_COUNT) \
2128
+ (mxMeterOne(), fxOverflow(the,_COUNT,C_NULL, 0))
2129
+ #else
2130
+ #define mxCheckCStack() \
2131
+ ((void)0)
2132
+ #define mxOverflow(_COUNT) \
2133
+ ((void)0)
2134
+ #endif
2135
+
2136
+ #define mxCall() \
2137
+ (mxOverflow(-4), \
2138
+ fxCall(the))
2139
+
2140
+ #define mxDefineAll(ID, INDEX, FLAG, MASK) \
2141
+ (mxMeterOne(), fxDefineAll(the, ID, INDEX, FLAG, MASK))
2142
+ #define mxDefineAt(FLAG, MASK) \
2143
+ (mxMeterOne(), fxDefineAt(the, FLAG, MASK))
2144
+ #define mxDefineID(ID, FLAG, MASK) \
2145
+ (mxMeterOne(), fxDefineAll(the, ID, 0, FLAG, MASK))
2146
+ #define mxDefineIndex(INDEX, FLAG, MASK) \
2147
+ (mxMeterOne(), fxDefineAll(the, XS_NO_ID, INDEX, FLAG, MASK))
2148
+
2149
+ #define mxDeleteAll(ID, INDEX) \
2150
+ (mxMeterOne(), fxDeleteAll(the, ID, INDEX))
2151
+ #define mxDeleteAt() \
2152
+ (mxMeterOne(), fxDeleteAt(the))
2153
+ #define mxDeleteID(ID) \
2154
+ (mxMeterOne(), fxDeleteAll(the, ID, 0))
2155
+ #define mxDeleteIndex(INDEX) \
2156
+ (mxMeterOne(), fxDeleteAll(the, XS_NO_ID, INDEX))
2157
+
2158
+ #define mxDub() \
2159
+ (mxOverflow(-1), \
2160
+ ((--the->stack)->next = C_NULL, \
2161
+ the->stack->flag = XS_NO_FLAG, \
2162
+ mxInitSlotKind(the->stack, (the->stack + 1)->kind), \
2163
+ the->stack->value = (the->stack + 1)->value))
2164
+
2165
+ #define mxGetAll(ID, INDEX) \
2166
+ (mxMeterOne(), fxGetAll(the, ID, INDEX))
2167
+ #define mxGetAt() \
2168
+ (mxMeterOne(), fxGetAt(the))
2169
+ #define mxGetID(ID) \
2170
+ (mxMeterOne(), fxGetAll(the, ID, 0))
2171
+ #define mxGetIndex(INDEX) \
2172
+ (mxMeterOne(), fxGetAll(the, XS_NO_ID, INDEX))
2173
+
2174
+ #define mxHasAll(ID, INDEX) \
2175
+ (mxMeterOne(), fxHasAll(the, ID, INDEX))
2176
+ #define mxHasAt() \
2177
+ (mxMeterOne(), fxHasAt(the))
2178
+ #define mxHasID(ID) \
2179
+ (mxMeterOne(), fxHasAll(the, ID, 0))
2180
+ #define mxHasIndex(INDEX) \
2181
+ (mxMeterOne(), fxHasAll(the, XS_NO_ID, INDEX))
2182
+
2183
+ #define mxNew() \
2184
+ (mxOverflow(-5), \
2185
+ fxNew(the))
2186
+
2187
+ #define mxRunCount(_COUNT) \
2188
+ (mxMeterOne(), fxRunID(the, C_NULL, _COUNT))
2189
+
2190
+ #define mxSetAll(ID, INDEX) \
2191
+ (mxMeterOne(), fxSetAll(the, ID, INDEX))
2192
+ #define mxSetAt() \
2193
+ (mxMeterOne(), fxSetAt(the))
2194
+ #define mxSetID(ID) \
2195
+ (mxMeterOne(), fxSetAll(the, ID, 0))
2196
+ #define mxSetIndex(INDEX) \
2197
+ (mxMeterOne(), fxSetAll(the, XS_NO_ID, INDEX))
2198
+
2199
+ #define mxPush(THE_SLOT) \
2200
+ (mxOverflow(-1), \
2201
+ (--the->stack)->next = C_NULL, \
2202
+ mxInitSlotKind(the->stack, (THE_SLOT).kind), \
2203
+ the->stack->value = (THE_SLOT).value)
2204
+ #define mxPushSlot(THE_SLOT) \
2205
+ (mxOverflow(-1), \
2206
+ (--the->stack)->next = C_NULL, \
2207
+ mxInitSlotKind(the->stack, (THE_SLOT)->kind), \
2208
+ the->stack->value = (THE_SLOT)->value)
2209
+
2210
+ #define mxPushAt(ID,INDEX) \
2211
+ (mxOverflow(-1), \
2212
+ (--the->stack)->next = C_NULL, \
2213
+ mxInitSlotKind(the->stack, XS_AT_KIND), \
2214
+ the->stack->value.at.index = (INDEX), \
2215
+ the->stack->value.at.id = (ID))
2216
+ #define mxPushBigInt(THE_BIGINT) \
2217
+ (mxOverflow(-1), \
2218
+ (--the->stack)->next = C_NULL, \
2219
+ mxInitSlotKind(the->stack, XS_BIGINT_KIND), \
2220
+ the->stack->value.bigint = (THE_BIGINT))
2221
+ #define mxPushBoolean(THE_BOOLEAN) \
2222
+ (mxOverflow(-1), \
2223
+ (--the->stack)->next = C_NULL, \
2224
+ mxInitSlotKind(the->stack, XS_BOOLEAN_KIND), \
2225
+ the->stack->value.boolean = (THE_BOOLEAN))
2226
+ #define mxPushClosure(THE_SLOT) \
2227
+ (mxOverflow(-1), \
2228
+ (--the->stack)->next = C_NULL, \
2229
+ mxInitSlotKind(the->stack, XS_CLOSURE_KIND), \
2230
+ the->stack->value.closure = (THE_SLOT))
2231
+ #define mxPushInteger(THE_NUMBER) \
2232
+ (mxOverflow(-1), \
2233
+ (--the->stack)->next = C_NULL, \
2234
+ mxInitSlotKind(the->stack, XS_INTEGER_KIND), \
2235
+ the->stack->value.integer = (THE_NUMBER))
2236
+ #define mxPushList() \
2237
+ (mxOverflow(-1), \
2238
+ (--the->stack)->next = C_NULL, \
2239
+ mxInitSlotKind(the->stack, XS_LIST_KIND), \
2240
+ the->stack->value.list.first = C_NULL, \
2241
+ the->stack->value.list.last = C_NULL)
2242
+ #define mxPushNull() \
2243
+ (mxOverflow(-1), \
2244
+ (--the->stack)->next = C_NULL, \
2245
+ mxInitSlotKind(the->stack, XS_NULL_KIND))
2246
+ #define mxPushNumber(THE_NUMBER) \
2247
+ (mxOverflow(-1), \
2248
+ (--the->stack)->next = C_NULL, \
2249
+ mxInitSlotKind(the->stack, XS_NUMBER_KIND), \
2250
+ the->stack->value.number = (THE_NUMBER))
2251
+ #define mxPushReference(THE_SLOT) \
2252
+ (mxOverflow(-1), \
2253
+ (--the->stack)->next = C_NULL, \
2254
+ mxInitSlotKind(the->stack, XS_REFERENCE_KIND), \
2255
+ the->stack->value.reference = (THE_SLOT))
2256
+ #define mxPushString(THE_STRING) \
2257
+ (mxOverflow(-1), \
2258
+ (--the->stack)->next = C_NULL, \
2259
+ mxInitSlotKind(the->stack, XS_STRING_KIND), \
2260
+ the->stack->value.string = (THE_STRING))
2261
+ #define mxPushStringC(THE_STRING) \
2262
+ (mxOverflow(-1), \
2263
+ (--the->stack)->next = C_NULL, \
2264
+ mxInitSlotKind(the->stack, XS_UNDEFINED_KIND), \
2265
+ fxCopyStringC(the, the->stack, THE_STRING))
2266
+ #ifdef mxSnapshot
2267
+ #define mxPushStringX(THE_STRING) \
2268
+ (mxOverflow(-1), \
2269
+ (--the->stack)->next = C_NULL, \
2270
+ mxInitSlotKind(the->stack, XS_UNDEFINED_KIND), \
2271
+ fxCopyStringC(the, the->stack, THE_STRING))
2272
+ #else
2273
+ #define mxPushStringX(THE_STRING) \
2274
+ (mxOverflow(-1), \
2275
+ (--the->stack)->next = C_NULL, \
2276
+ mxInitSlotKind(the->stack, XS_STRING_X_KIND), \
2277
+ the->stack->value.string = (THE_STRING))
2278
+ #endif
2279
+
2280
+ #define mxPushSymbol(THE_SYMBOL) \
2281
+ (mxOverflow(-1), \
2282
+ (--the->stack)->next = C_NULL, \
2283
+ mxInitSlotKind(the->stack, XS_SYMBOL_KIND), \
2284
+ the->stack->value.symbol = (THE_SYMBOL))
2285
+ #define mxPushUndefined() \
2286
+ (mxOverflow(-1), \
2287
+ (--the->stack)->next = C_NULL, \
2288
+ mxInitSlotKind(the->stack, XS_UNDEFINED_KIND))
2289
+ #define mxPushUninitialized() \
2290
+ (mxOverflow(-1), \
2291
+ (--the->stack)->next = C_NULL, \
2292
+ mxInitSlotKind(the->stack, XS_UNINITIALIZED_KIND))
2293
+ #define mxPushUnsigned(THE_NUMBER) \
2294
+ (mxOverflow(-1), \
2295
+ (--the->stack)->next = C_NULL, \
2296
+ (THE_NUMBER < 0x7FFFFFFF) ? \
2297
+ (mxInitSlotKind(the->stack, XS_INTEGER_KIND), \
2298
+ the->stack->value.integer = (txInteger)(THE_NUMBER)) \
2299
+ : \
2300
+ (mxInitSlotKind(the->stack, XS_NUMBER_KIND), \
2301
+ the->stack->value.number = (txNumber)(THE_NUMBER)) \
2302
+ )
2303
+ #define mxTemporary(_SLOT) \
2304
+ (mxOverflow(-1), \
2305
+ _SLOT = --the->stack, \
2306
+ mxInitSlotKind(the->stack, XS_UNDEFINED_KIND))
2307
+
2308
+ #define mxPop() \
2309
+ (mxMeterOne(), the->stack++)
2310
+ #define mxPull(THE_SLOT) \
2311
+ (mxMeterOne(), \
2312
+ (THE_SLOT).value = the->stack->value, \
2313
+ (THE_SLOT).kind = (the->stack++)->kind)
2314
+ #define mxPullSlot(THE_SLOT) \
2315
+ (mxMeterOne(), \
2316
+ (THE_SLOT)->value = the->stack->value, \
2317
+ (THE_SLOT)->kind = (the->stack++)->kind)
2318
+
2319
+
2320
+
2321
+ #define mxThis (the->frame + 4)
2322
+ #define mxFunction (the->frame + 3)
2323
+ #define mxTarget (the->frame + 2)
2324
+ #define mxResult (the->frame + 1)
2325
+ #define mxArgc ((the->frame - 1)->value.integer)
2326
+ #define mxArgv(THE_INDEX) (the->frame - 2 - (THE_INDEX))
2327
+ #define mxVarc (the->scope->value.environment.variable.count)
2328
+ #define mxVarv(THE_INDEX) (the->scope - 1 - (THE_INDEX))
2329
+
2330
+ #define mxFrameToEnvironment(FRAME) ((FRAME) - 1 - ((FRAME) - 1)->value.integer - 1)
2331
+
2332
+ #define mxFunctionInstanceCode(INSTANCE) ((INSTANCE)->next)
2333
+ #define mxFunctionInstanceHome(INSTANCE) ((INSTANCE)->next->next)
2334
+
2335
+ #define mxRealmGlobal(REALM) ((REALM)->next)
2336
+ #define mxRealmClosures(REALM) ((REALM)->next->next)
2337
+ #define mxRealmTemplateCache(REALM) ((REALM)->next->next->next)
2338
+ #define mxOwnModules(REALM) ((REALM)->next->next->next->next)
2339
+ #define mxResolveHook(REALM) ((REALM)->next->next->next->next->next)
2340
+ #define mxModuleMap(REALM) ((REALM)->next->next->next->next->next->next)
2341
+ #define mxModuleMapHook(REALM) ((REALM)->next->next->next->next->next->next->next)
2342
+ #define mxLoadHook(REALM) ((REALM)->next->next->next->next->next->next->next->next)
2343
+ #define mxLoadNowHook(REALM) ((REALM)->next->next->next->next->next->next->next->next->next)
2344
+ #define mxImportMetaHook(REALM) ((REALM)->next->next->next->next->next->next->next->next->next->next)
2345
+ #define mxRealmParent(REALM) ((REALM)->next->next->next->next->next->next->next->next->next->next->next)
2346
+
2347
+ #define mxModuleInstanceInternal(MODULE) ((MODULE)->next)
2348
+ #define mxModuleInstanceExports(MODULE) ((MODULE)->next->next)
2349
+ #define mxModuleInstanceMeta(MODULE) ((MODULE)->next->next->next)
2350
+ #define mxModuleInstanceTransfers(MODULE) ((MODULE)->next->next->next->next)
2351
+ #define mxModuleInstanceInitialize(MODULE) ((MODULE)->next->next->next->next->next)
2352
+ #define mxModuleInstanceExecute(MODULE) ((MODULE)->next->next->next->next->next->next)
2353
+ #define mxModuleInstanceHosts(MODULE) ((MODULE)->next->next->next->next->next->next->next)
2354
+ #define mxModuleInstanceLoader(MODULE) ((MODULE)->next->next->next->next->next->next->next->next)
2355
+ #define mxModuleInstanceFulfill(MODULE) ((MODULE)->next->next->next->next->next->next->next->next->next)
2356
+ #define mxModuleInstanceReject(MODULE) ((MODULE)->next->next->next->next->next->next->next->next->next->next)
2357
+
2358
+ #define mxModuleInternal(MODULE) mxModuleInstanceInternal((MODULE)->value.reference)
2359
+ #define mxModuleExports(MODULE) mxModuleInstanceExports((MODULE)->value.reference)
2360
+ #define mxModuleMeta(MODULE) mxModuleInstanceMeta((MODULE)->value.reference)
2361
+ #define mxModuleTransfers(MODULE) mxModuleInstanceTransfers((MODULE)->value.reference)
2362
+ #define mxModuleInitialize(MODULE) mxModuleInstanceInitialize((MODULE)->value.reference)
2363
+ #define mxModuleExecute(MODULE) mxModuleInstanceExecute((MODULE)->value.reference)
2364
+ #define mxModuleHosts(MODULE) mxModuleInstanceHosts((MODULE)->value.reference)
2365
+ #define mxModuleLoader(MODULE) mxModuleInstanceLoader((MODULE)->value.reference)
2366
+ #define mxModuleFulfill(MODULE) mxModuleInstanceFulfill((MODULE)->value.reference)
2367
+ #define mxModuleReject(MODULE) mxModuleInstanceReject((MODULE)->value.reference)
2368
+
2369
+ #define mxTransferLocal(TRANSFER) (TRANSFER)->value.reference->next
2370
+ #define mxTransferFrom(TRANSFER) (TRANSFER)->value.reference->next->next
2371
+ #define mxTransferImport(TRANSFER) (TRANSFER)->value.reference->next->next->next
2372
+ #define mxTransferAliases(TRANSFER) (TRANSFER)->value.reference->next->next->next->next
2373
+ #define mxTransferClosure(TRANSFER) (TRANSFER)->value.reference->next->next->next->next->next
2374
+
2375
+ #define mxPromiseStatus(INSTANCE) ((INSTANCE)->next)
2376
+ #define mxPromiseThens(INSTANCE) ((INSTANCE)->next->next)
2377
+ #define mxPromiseResult(INSTANCE) ((INSTANCE)->next->next->next)
2378
+ #define mxPromiseEnvironment(INSTANCE) ((INSTANCE)->next->next->next->next)
2379
+
2380
+ enum {
2381
+ mxUndefinedStatus,
2382
+ mxPendingStatus,
2383
+ mxFulfilledStatus,
2384
+ mxRejectedStatus
2385
+ };
2386
+
2387
+ #define mxBehavior(INSTANCE) (gxBehaviors[((INSTANCE)->flag & XS_EXOTIC_FLAG) ? (INSTANCE)->next->ID : 0])
2388
+ #define mxBehaviorCall(THE, INSTANCE, THIS, ARGUMENTS) \
2389
+ (*mxBehavior(INSTANCE)->call)(THE, INSTANCE, THIS, ARGUMENTS)
2390
+ #define mxBehaviorConstruct(THE, INSTANCE, ARGUMENTS, TARGET) \
2391
+ (*mxBehavior(INSTANCE)->construct)(THE, INSTANCE, ARGUMENTS, TARGET)
2392
+ #define mxBehaviorDefineOwnProperty(THE, INSTANCE, ID, INDEX, VALUE, MASK) \
2393
+ (*mxBehavior(INSTANCE)->defineOwnProperty)(THE, INSTANCE, ID, INDEX, VALUE, MASK)
2394
+ #define mxBehaviorDeleteProperty(THE, INSTANCE, ID, INDEX) \
2395
+ (*mxBehavior(INSTANCE)->deleteProperty)(THE, INSTANCE, ID, INDEX)
2396
+ #define mxBehaviorGetOwnProperty(THE, INSTANCE, ID, INDEX, VALUE) \
2397
+ (*mxBehavior(INSTANCE)->getOwnProperty)(THE, INSTANCE, ID, INDEX, VALUE)
2398
+ #define mxBehaviorGetProperty(THE, INSTANCE, ID, INDEX, FLAG) \
2399
+ (*mxBehavior(INSTANCE)->getProperty)(THE, INSTANCE, ID, INDEX, FLAG)
2400
+ #define mxBehaviorGetPropertyValue(THE, INSTANCE, ID, INDEX, RECEIVER, VALUE) \
2401
+ (*mxBehavior(INSTANCE)->getPropertyValue)(THE, INSTANCE, ID, INDEX, RECEIVER, VALUE)
2402
+ #define mxBehaviorGetPrototype(THE, INSTANCE, PROTOTYPE) \
2403
+ (*mxBehavior(INSTANCE)->getPrototype)(THE, INSTANCE, PROTOTYPE)
2404
+ #define mxBehaviorHasProperty(THE, INSTANCE, ID, INDEX) \
2405
+ (*mxBehavior(INSTANCE)->hasProperty)(THE, INSTANCE, ID, INDEX)
2406
+ #define mxBehaviorIsExtensible(THE, INSTANCE) \
2407
+ (*mxBehavior(INSTANCE)->isExtensible)(THE, INSTANCE)
2408
+ #define mxBehaviorOwnKeys(THE, INSTANCE, FLAG, KEYS) \
2409
+ (*mxBehavior(INSTANCE)->ownKeys)(THE, INSTANCE, FLAG, KEYS)
2410
+ #define mxBehaviorPreventExtensions(THE, INSTANCE) \
2411
+ (*mxBehavior(INSTANCE)->preventExtensions)(THE, INSTANCE)
2412
+ #define mxBehaviorSetProperty(THE, INSTANCE, ID, INDEX, FLAG) \
2413
+ (*mxBehavior(INSTANCE)->setProperty)(THE, INSTANCE, ID, INDEX, FLAG)
2414
+ #define mxBehaviorSetPropertyValue(THE, INSTANCE, ID, INDEX, VALUE, RECEIVER) \
2415
+ (*mxBehavior(INSTANCE)->setPropertyValue)(THE, INSTANCE, ID, INDEX, VALUE, RECEIVER)
2416
+ #define mxBehaviorSetPrototype(THE, INSTANCE, PROTOTYPE) \
2417
+ (*mxBehavior(INSTANCE)->setPrototype)(THE, INSTANCE, PROTOTYPE)
2418
+
2419
+ enum {
2420
+ mxGlobalStackIndex,
2421
+ mxExceptionStackIndex,
2422
+ mxProgramStackIndex,
2423
+ mxHostsStackIndex,
2424
+ mxModuleQueueStackIndex,
2425
+
2426
+ mxUnhandledPromisesStackIndex,
2427
+ mxDuringJobsStackIndex,
2428
+ mxFinalizationRegistriesStackIndex,
2429
+ mxPendingJobsStackIndex,
2430
+ mxRunningJobsStackIndex,
2431
+ mxBreakpointsStackIndex,
2432
+ mxHostInspectorsStackIndex,
2433
+ mxInstanceInspectorsStackIndex,
2434
+
2435
+ mxObjectPrototypeStackIndex = XS_INTRINSICS_COUNT,
2436
+ mxFunctionPrototypeStackIndex,
2437
+ mxArrayPrototypeStackIndex,
2438
+ mxStringPrototypeStackIndex,
2439
+ mxBooleanPrototypeStackIndex,
2440
+ mxNumberPrototypeStackIndex,
2441
+ mxDatePrototypeStackIndex,
2442
+ mxRegExpPrototypeStackIndex,
2443
+ mxHostPrototypeStackIndex,
2444
+
2445
+ mxErrorPrototypeStackIndex,
2446
+ mxEvalErrorPrototypeStackIndex,
2447
+ mxRangeErrorPrototypeStackIndex,
2448
+ mxReferenceErrorPrototypeStackIndex,
2449
+ mxSyntaxErrorPrototypeStackIndex,
2450
+ mxTypeErrorPrototypeStackIndex,
2451
+ mxURIErrorPrototypeStackIndex,
2452
+ mxAggregateErrorPrototypeStackIndex,
2453
+
2454
+ mxSymbolPrototypeStackIndex,
2455
+ mxArrayBufferPrototypeStackIndex,
2456
+ mxDataViewPrototypeStackIndex,
2457
+ mxTypedArrayPrototypeStackIndex,
2458
+ mxMapPrototypeStackIndex,
2459
+ mxSetPrototypeStackIndex,
2460
+ mxWeakMapPrototypeStackIndex,
2461
+ mxWeakSetPrototypeStackIndex,
2462
+ mxPromisePrototypeStackIndex,
2463
+ mxProxyPrototypeStackIndex,
2464
+ mxSharedArrayBufferPrototypeStackIndex,
2465
+ mxBigIntPrototypeStackIndex,
2466
+ mxCompartmentPrototypeStackIndex,
2467
+ mxModuleSourcePrototypeStackIndex,
2468
+ mxWeakRefPrototypeStackIndex,
2469
+ mxFinalizationRegistryPrototypeStackIndex,
2470
+
2471
+ mxEnumeratorFunctionStackIndex,
2472
+ mxAssignObjectFunctionStackIndex,
2473
+ mxCopyObjectFunctionStackIndex,
2474
+
2475
+ mxAsyncFunctionPrototypeStackIndex,
2476
+ mxGeneratorPrototypeStackIndex,
2477
+ mxGeneratorFunctionPrototypeStackIndex,
2478
+ mxModulePrototypeStackIndex,
2479
+ mxTransferPrototypeStackIndex,
2480
+ mxOnRejectedPromiseFunctionStackIndex,
2481
+ mxOnResolvedPromiseFunctionStackIndex,
2482
+ mxOnThenableFunctionStackIndex,
2483
+ mxArrayLengthAccessorStackIndex,
2484
+ mxModuleAccessorStackIndex,
2485
+ mxProxyAccessorStackIndex,
2486
+ mxStringAccessorStackIndex,
2487
+ mxTypedArrayAccessorStackIndex,
2488
+
2489
+ mxIteratorPrototypeStackIndex,
2490
+ mxArrayIteratorPrototypeStackIndex,
2491
+ mxMapIteratorPrototypeStackIndex,
2492
+ mxRegExpStringIteratorPrototypeStackIndex,
2493
+ mxSetIteratorPrototypeStackIndex,
2494
+ mxStringIteratorPrototypeStackIndex,
2495
+
2496
+ mxAsyncIteratorPrototypeStackIndex,
2497
+ mxAsyncFromSyncIteratorPrototypeStackIndex,
2498
+ mxAsyncGeneratorPrototypeStackIndex,
2499
+ mxAsyncGeneratorFunctionPrototypeStackIndex,
2500
+
2501
+ mxArgumentsSloppyPrototypeStackIndex,
2502
+ mxArgumentsStrictPrototypeStackIndex,
2503
+ mxThrowTypeErrorFunctionStackIndex,
2504
+
2505
+ mxHookInstanceIndex,
2506
+
2507
+ mxExecuteRegExpFunctionIndex,
2508
+ mxInitializeRegExpFunctionIndex,
2509
+ mxArrayIteratorFunctionIndex,
2510
+ mxOrdinaryToPrimitiveFunctionStackIndex,
2511
+ mxCompartmentGlobalStackIndex,
2512
+
2513
+ mxEmptyCodeStackIndex,
2514
+ mxEmptyStringStackIndex,
2515
+ mxEmptyRegExpStackIndex,
2516
+ mxBigIntStringStackIndex,
2517
+ mxBooleanStringStackIndex,
2518
+ mxDefaultStringStackIndex,
2519
+ mxFunctionStringStackIndex,
2520
+ mxNumberStringStackIndex,
2521
+ mxObjectStringStackIndex,
2522
+ mxStringStringStackIndex,
2523
+ mxSymbolStringStackIndex,
2524
+ mxUndefinedStringStackIndex,
2525
+
2526
+ mxStackIndexCount
2527
+ };
2528
+
2529
+ #define mxGlobal the->stackTop[-1 - mxGlobalStackIndex]
2530
+ #define mxException the->stackTop[-1 - mxExceptionStackIndex]
2531
+ #define mxProgram the->stackTop[-1 - mxProgramStackIndex]
2532
+ #define mxHosts the->stackTop[-1 - mxHostsStackIndex]
2533
+ #define mxModuleQueue the->stackTop[-1 - mxModuleQueueStackIndex]
2534
+ #define mxUnhandledPromises the->stackTop[-1 - mxUnhandledPromisesStackIndex]
2535
+ #define mxDuringJobs the->stackTop[-1 - mxDuringJobsStackIndex]
2536
+ #define mxFinalizationRegistries the->stackTop[-1 - mxFinalizationRegistriesStackIndex]
2537
+ #define mxPendingJobs the->stackTop[-1 - mxPendingJobsStackIndex]
2538
+ #define mxRunningJobs the->stackTop[-1 - mxRunningJobsStackIndex]
2539
+ #define mxBreakpoints the->stackTop[-1 - mxBreakpointsStackIndex]
2540
+ #define mxHostInspectors the->stackTop[-1 - mxHostInspectorsStackIndex]
2541
+ #define mxInstanceInspectors the->stackTop[-1 - mxInstanceInspectorsStackIndex]
2542
+
2543
+ #define mxAggregateErrorConstructor the->stackPrototypes[-1 - _AggregateError]
2544
+ #define mxArrayConstructor the->stackPrototypes[-1 - _Array]
2545
+ #define mxArrayBufferConstructor the->stackPrototypes[-1 - _ArrayBuffer]
2546
+ #define mxAtomicsObject the->stackPrototypes[-1 - _Atomics]
2547
+ #define mxBigIntConstructor the->stackPrototypes[-1 - _BigInt]
2548
+ #define mxBigInt64ArrayConstructor the->stackPrototypes[-1 - _BigInt64Array]
2549
+ #define mxBigUint64ArrayConstructor the->stackPrototypes[-1 - _BigUint64Array]
2550
+ #define mxBooleanConstructor the->stackPrototypes[-1 - _Boolean]
2551
+ #define mxCompartmentConstructor the->stackPrototypes[-1 - _Compartment]
2552
+ #define mxDataViewConstructor the->stackPrototypes[-1 - _DataView]
2553
+ #define mxDateConstructor the->stackPrototypes[-1 - _Date]
2554
+ #define mxErrorConstructor the->stackPrototypes[-1 - _Error]
2555
+ #define mxEvalErrorConstructor the->stackPrototypes[-1 - _EvalError]
2556
+ #define mxFinalizationRegistryConstructor the->stackPrototypes[-1 - _FinalizationRegistry]
2557
+ #define mxFloat32ArrayConstructor the->stackPrototypes[-1 - _Float32Array]
2558
+ #define mxFloat64ArrayConstructor the->stackPrototypes[-1 - _Float64Array]
2559
+ #define mxFunctionConstructor the->stackPrototypes[-1 - _Function]
2560
+ #define mxInfinity the->stackPrototypes[-1 - _Infinity]
2561
+ #define mxInt16ArrayConstructor the->stackPrototypes[-1 - _Int16Array]
2562
+ #define mxInt32ArrayConstructor the->stackPrototypes[-1 - _Int32Array]
2563
+ #define mxInt8ArrayConstructor the->stackPrototypes[-1 - _Int8Array]
2564
+ #define mxJSONObject the->stackPrototypes[-1 - _JSON]
2565
+ #define mxMapConstructor the->stackPrototypes[-1 - _Map]
2566
+ #define mxMathObject the->stackPrototypes[-1 - _Math]
2567
+ #define mxNaN the->stackPrototypes[-1 - _NaN]
2568
+ #define mxNumberConstructor the->stackPrototypes[-1 - _Number]
2569
+ #define mxObjectConstructor the->stackPrototypes[-1 - _Object]
2570
+ #define mxPromiseConstructor the->stackPrototypes[-1 - _Promise]
2571
+ #define mxProxyConstructor the->stackPrototypes[-1 - _Proxy]
2572
+ #define mxRangeErrorConstructor the->stackPrototypes[-1 - _RangeError]
2573
+ #define mxReferenceErrorConstructor the->stackPrototypes[-1 - _ReferenceError]
2574
+ #define mxReflectObject the->stackPrototypes[-1 - _Reflect]
2575
+ #define mxRegExpConstructor the->stackPrototypes[-1 - _RegExp]
2576
+ #define mxSetConstructor the->stackPrototypes[-1 - _Set]
2577
+ #define mxSharedArrayBufferConstructor the->stackPrototypes[-1 - _SharedArrayBuffer]
2578
+ #define mxModuleSourceConstructor the->stackPrototypes[-1 - _ModuleSource]
2579
+ #define mxStringConstructor the->stackPrototypes[-1 - _String]
2580
+ #define mxSymbolConstructor the->stackPrototypes[-1 - _Symbol]
2581
+ #define mxSyntaxErrorConstructor the->stackPrototypes[-1 - _SyntaxError]
2582
+ #define mxTypeErrorConstructor the->stackPrototypes[-1 - _TypeError]
2583
+ #define mxTypedArrayConstructor the->stackPrototypes[-1 - _TypedArray]
2584
+ #define mxURIErrorConstructor the->stackPrototypes[-1 - _URIError]
2585
+ #define mxUint16ArrayConstructor the->stackPrototypes[-1 - _Uint16Array]
2586
+ #define mxUint32ArrayConstructor the->stackPrototypes[-1 - _Uint32Array]
2587
+ #define mxUint8ArrayConstructor the->stackPrototypes[-1 - _Uint8Array]
2588
+ #define mxUint8ClampedArrayConstructor the->stackPrototypes[-1 - _Uint8ClampedArray]
2589
+ #define mxWeakMapConstructor the->stackPrototypes[-1 - _WeakMap]
2590
+ #define mxWeakRefConstructor the->stackPrototypes[-1 - _WeakRef]
2591
+ #define mxWeakSetConstructor the->stackPrototypes[-1 - _WeakSet]
2592
+ #define mxDecodeURIFunction the->stackPrototypes[-1 - _decodeURI]
2593
+ #define mxDecodeURIComponentFunction the->stackPrototypes[-1 - _decodeURIComponent]
2594
+ #define mxEncodeURIFunction the->stackPrototypes[-1 - _encodeURI]
2595
+ #define mxEncodeURIComponentFunction the->stackPrototypes[-1 - _encodeURIComponent]
2596
+ #define mxEscapeFunction the->stackPrototypes[-1 - _escape]
2597
+ #define mxEvalFunction the->stackPrototypes[-1 - _eval]
2598
+ #define mxIsFiniteFunction the->stackPrototypes[-1 - _isFinite]
2599
+ #define mxIsNaNFunction the->stackPrototypes[-1 - _isNaN]
2600
+ #define mxParseFloatFunction the->stackPrototypes[-1 - _parseFloat]
2601
+ #define mxParseIntFunction the->stackPrototypes[-1 - _parseInt]
2602
+ #define mxTraceFunction the->stackPrototypes[-1 - _trace]
2603
+ #define mxUndefined the->stackPrototypes[-1 - _undefined]
2604
+ #define mxUnescapeFunction the->stackPrototypes[-1 - _unescape]
2605
+
2606
+ #define mxObjectPrototype the->stackPrototypes[-1 - mxObjectPrototypeStackIndex]
2607
+ #define mxFunctionPrototype the->stackPrototypes[-1 - mxFunctionPrototypeStackIndex]
2608
+ #define mxArrayPrototype the->stackPrototypes[-1 - mxArrayPrototypeStackIndex]
2609
+ #define mxStringPrototype the->stackPrototypes[-1 - mxStringPrototypeStackIndex]
2610
+ #define mxBooleanPrototype the->stackPrototypes[-1 - mxBooleanPrototypeStackIndex]
2611
+ #define mxNumberPrototype the->stackPrototypes[-1 - mxNumberPrototypeStackIndex]
2612
+ #define mxDatePrototype the->stackPrototypes[-1 - mxDatePrototypeStackIndex]
2613
+ #define mxRegExpPrototype the->stackPrototypes[-1 - mxRegExpPrototypeStackIndex]
2614
+ #define mxHostPrototype the->stackPrototypes[-1 - mxHostPrototypeStackIndex]
2615
+
2616
+ #define mxErrorPrototypes(THE_ERROR) (the->stackPrototypes[-mxErrorPrototypeStackIndex-(THE_ERROR)])
2617
+ #define mxErrorPrototype the->stackPrototypes[-1 - mxErrorPrototypeStackIndex]
2618
+ #define mxEvalErrorPrototype the->stackPrototypes[-1 - mxEvalErrorPrototypeStackIndex]
2619
+ #define mxRangeErrorPrototype the->stackPrototypes[-1 - mxRangeErrorPrototypeStackIndex]
2620
+ #define mxReferenceErrorPrototype the->stackPrototypes[-1 - mxReferenceErrorPrototypeStackIndex]
2621
+ #define mxSyntaxErrorPrototype the->stackPrototypes[-1 - mxSyntaxErrorPrototypeStackIndex]
2622
+ #define mxTypeErrorPrototype the->stackPrototypes[-1 - mxTypeErrorPrototypeStackIndex]
2623
+ #define mxURIErrorPrototype the->stackPrototypes[-1 - mxURIErrorPrototypeStackIndex]
2624
+ #define mxAggregateErrorPrototype the->stackPrototypes[-1 - mxAggregateErrorPrototypeStackIndex]
2625
+
2626
+ #define mxSymbolPrototype the->stackPrototypes[-1 - mxSymbolPrototypeStackIndex]
2627
+ #define mxArrayBufferPrototype the->stackPrototypes[-1 - mxArrayBufferPrototypeStackIndex]
2628
+ #define mxDataViewPrototype the->stackPrototypes[-1 - mxDataViewPrototypeStackIndex]
2629
+ #define mxTypedArrayPrototype the->stackPrototypes[-1 - mxTypedArrayPrototypeStackIndex]
2630
+ #define mxMapPrototype the->stackPrototypes[-1 - mxMapPrototypeStackIndex]
2631
+ #define mxSetPrototype the->stackPrototypes[-1 - mxSetPrototypeStackIndex]
2632
+ #define mxWeakMapPrototype the->stackPrototypes[-1 - mxWeakMapPrototypeStackIndex]
2633
+ #define mxWeakSetPrototype the->stackPrototypes[-1 - mxWeakSetPrototypeStackIndex]
2634
+ #define mxPromisePrototype the->stackPrototypes[-1 - mxPromisePrototypeStackIndex]
2635
+ #define mxProxyPrototype the->stackPrototypes[-1 - mxProxyPrototypeStackIndex]
2636
+ #define mxSharedArrayBufferPrototype the->stackPrototypes[-1 - mxSharedArrayBufferPrototypeStackIndex]
2637
+ #define mxBigIntPrototype the->stackPrototypes[-1 - mxBigIntPrototypeStackIndex]
2638
+ #define mxCompartmentPrototype the->stackPrototypes[-1 - mxCompartmentPrototypeStackIndex]
2639
+ #define mxModuleSourcePrototype the->stackPrototypes[-1 - mxModuleSourcePrototypeStackIndex]
2640
+ #define mxWeakRefPrototype the->stackPrototypes[-1 - mxWeakRefPrototypeStackIndex]
2641
+ #define mxFinalizationRegistryPrototype the->stackPrototypes[-1 - mxFinalizationRegistryPrototypeStackIndex]
2642
+
2643
+ #define mxEmptyCode the->stackPrototypes[-1 - mxEmptyCodeStackIndex]
2644
+ #define mxEmptyString the->stackPrototypes[-1 - mxEmptyStringStackIndex]
2645
+ #define mxEmptyRegExp the->stackPrototypes[-1 - mxEmptyRegExpStackIndex]
2646
+ #define mxBigIntString the->stackPrototypes[-1 - mxBigIntStringStackIndex]
2647
+ #define mxBooleanString the->stackPrototypes[-1 - mxBooleanStringStackIndex]
2648
+ #define mxDefaultString the->stackPrototypes[-1 - mxDefaultStringStackIndex]
2649
+ #define mxFunctionString the->stackPrototypes[-1 - mxFunctionStringStackIndex]
2650
+ #define mxNumberString the->stackPrototypes[-1 - mxNumberStringStackIndex]
2651
+ #define mxObjectString the->stackPrototypes[-1 - mxObjectStringStackIndex]
2652
+ #define mxStringString the->stackPrototypes[-1 - mxStringStringStackIndex]
2653
+ #define mxSymbolString the->stackPrototypes[-1 - mxSymbolStringStackIndex]
2654
+ #define mxUndefinedString the->stackPrototypes[-1 - mxUndefinedStringStackIndex]
2655
+
2656
+ #define mxEnumeratorFunction the->stackPrototypes[-1 - mxEnumeratorFunctionStackIndex]
2657
+ #define mxAssignObjectFunction the->stackPrototypes[-1 - mxAssignObjectFunctionStackIndex]
2658
+ #define mxCopyObjectFunction the->stackPrototypes[-1 - mxCopyObjectFunctionStackIndex]
2659
+
2660
+ #define mxAsyncFunctionPrototype the->stackPrototypes[-1 - mxAsyncFunctionPrototypeStackIndex]
2661
+ #define mxGeneratorPrototype the->stackPrototypes[-1 - mxGeneratorPrototypeStackIndex]
2662
+ #define mxGeneratorFunctionPrototype the->stackPrototypes[-1 - mxGeneratorFunctionPrototypeStackIndex]
2663
+ #define mxModulePrototype the->stackPrototypes[-1 - mxModulePrototypeStackIndex]
2664
+ #define mxTransferPrototype the->stackPrototypes[-1 - mxTransferPrototypeStackIndex]
2665
+ #define mxOnRejectedPromiseFunction the->stackPrototypes[-1 - mxOnRejectedPromiseFunctionStackIndex]
2666
+ #define mxOnResolvedPromiseFunction the->stackPrototypes[-1 - mxOnResolvedPromiseFunctionStackIndex]
2667
+ #define mxOnThenableFunction the->stackPrototypes[-1 - mxOnThenableFunctionStackIndex]
2668
+ #define mxArrayLengthAccessor the->stackPrototypes[-1 - mxArrayLengthAccessorStackIndex]
2669
+ #define mxModuleAccessor the->stackPrototypes[-1 - mxModuleAccessorStackIndex]
2670
+ #define mxProxyAccessor the->stackPrototypes[-1 - mxProxyAccessorStackIndex]
2671
+ #define mxStringAccessor the->stackPrototypes[-1 - mxStringAccessorStackIndex]
2672
+ #define mxTypedArrayAccessor the->stackPrototypes[-1 - mxTypedArrayAccessorStackIndex]
2673
+
2674
+ #define mxIteratorPrototype the->stackPrototypes[-1 - mxIteratorPrototypeStackIndex]
2675
+ #define mxArrayIteratorPrototype the->stackPrototypes[-1 - mxArrayIteratorPrototypeStackIndex]
2676
+ #define mxMapIteratorPrototype the->stackPrototypes[-1 - mxMapIteratorPrototypeStackIndex]
2677
+ #define mxRegExpStringIteratorPrototype the->stackPrototypes[-1 - mxRegExpStringIteratorPrototypeStackIndex]
2678
+ #define mxSetIteratorPrototype the->stackPrototypes[-1 - mxSetIteratorPrototypeStackIndex]
2679
+ #define mxStringIteratorPrototype the->stackPrototypes[-1 - mxStringIteratorPrototypeStackIndex]
2680
+
2681
+ #define mxAsyncIteratorPrototype the->stackPrototypes[-1 - mxAsyncIteratorPrototypeStackIndex]
2682
+ #define mxAsyncFromSyncIteratorPrototype the->stackPrototypes[-1 - mxAsyncFromSyncIteratorPrototypeStackIndex]
2683
+ #define mxAsyncGeneratorPrototype the->stackPrototypes[-1 - mxAsyncGeneratorPrototypeStackIndex]
2684
+ #define mxAsyncGeneratorFunctionPrototype the->stackPrototypes[-1 - mxAsyncGeneratorFunctionPrototypeStackIndex]
2685
+
2686
+ #define mxArgumentsSloppyPrototype the->stackPrototypes[-1 - mxArgumentsSloppyPrototypeStackIndex]
2687
+ #define mxArgumentsStrictPrototype the->stackPrototypes[-1 - mxArgumentsStrictPrototypeStackIndex]
2688
+ #define mxThrowTypeErrorFunction the->stackPrototypes[-1 - mxThrowTypeErrorFunctionStackIndex]
2689
+
2690
+ #define mxHookInstance the->stackPrototypes[-1 - mxHookInstanceIndex]
2691
+ #define mxExecuteRegExpFunction the->stackPrototypes[-1 - mxExecuteRegExpFunctionIndex]
2692
+ #define mxInitializeRegExpFunction the->stackPrototypes[-1 - mxInitializeRegExpFunctionIndex]
2693
+ #define mxArrayIteratorFunction the->stackPrototypes[-1 - mxArrayIteratorFunctionIndex]
2694
+ #define mxOrdinaryToPrimitiveFunction the->stackPrototypes[-1 - mxOrdinaryToPrimitiveFunctionStackIndex]
2695
+ #define mxCompartmentGlobal the->stackPrototypes[-1 - mxCompartmentGlobalStackIndex]
2696
+
2697
+ #define mxID(ID) ((txID)(ID))
2698
+
2699
+ #ifdef mxLink
2700
+ extern txCallback fxNewLinkerCallback(txMachine*, txCallback, txString);
2701
+ #define mxCallback(CALLBACK) fxNewLinkerCallback(the, CALLBACK, #CALLBACK)
2702
+ extern txSlot* fxBuildHostConstructor(txMachine* the, txCallback theCallback, txInteger theLength, txInteger name);
2703
+ extern txSlot* fxBuildHostFunction(txMachine* the, txCallback theCallback, txInteger theLength, txInteger name);
2704
+ #else
2705
+ #define mxCallback(CALLBACK) CALLBACK
2706
+ #define fxBuildHostConstructor(THE, CALLBACK, LENGTH, NAME) fxNewHostConstructor(THE, CALLBACK, LENGTH, NAME)
2707
+ #define fxBuildHostFunction(THE, CALLBACK, LENGTH, NAME) fxNewHostFunction(THE, CALLBACK, LENGTH, NAME, XS_NO_ID)
2708
+ #endif
2709
+
2710
+ enum {
2711
+ mxHostProfileID,
2712
+ mxGarbageCollectorProfileID,
2713
+ mx_Promise_prototype_finallyAuxProfileID,
2714
+ mx_Promise_prototype_finallyReturnProfileID,
2715
+ mx_Promise_prototype_finallyThrowProfileID,
2716
+ mx_Proxy_revokeProfileID,
2717
+ mxAsyncGeneratorRejectAwaitProfileID,
2718
+ mxAsyncGeneratorRejectYieldProfileID,
2719
+ mxAsyncGeneratorResolveAwaitProfileID,
2720
+ mxAsyncGeneratorResolveYieldProfileID,
2721
+ mxAsyncFromSyncIteratorDoneProfileID,
2722
+ mxCombinePromisesCallbackProfileID,
2723
+ mxExecuteModulesFulfilledProfileID,
2724
+ mxExecuteModulesRejectedProfileID,
2725
+ mxExecuteVirtualModuleSourceProfileID,
2726
+ mxExecuteVirtualModuleSourceImportProfileID,
2727
+ mxLoadModulesFulfilledProfileID,
2728
+ mxLoadModulesRejectedProfileID,
2729
+ mxNewPromiseCapabilityCallbackProfileID,
2730
+ mxRejectAwaitProfileID,
2731
+ mxRejectPromiseProfileID,
2732
+ mxResolveAwaitProfileID,
2733
+ mxResolvePromiseProfileID,
2734
+ mxBaseProfileID
2735
+ };
2736
+
2737
+ #ifdef __cplusplus
2738
+ }
2739
+ #endif
2740
+
2741
+ #endif /* __XSALL__ */