xbintsc 0.6.23 → 0.6.28
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.
- package/AGENTS.md +1 -1
- package/dist/src/cli/extensions.js +11 -3
- package/dist/src/cli/extensions.js.map +1 -1
- package/dist/src/cli/help.d.ts +1 -1
- package/dist/src/cli/help.js +1 -1
- package/dist/src/codegen/generator/state.js +7 -0
- package/dist/src/codegen/generator/state.js.map +1 -1
- package/dist/src/codegen/generator/tables.js +19 -1
- package/dist/src/codegen/generator/tables.js.map +1 -1
- package/dist/src/driver/bundler/concatenate.d.ts +23 -0
- package/dist/src/driver/bundler/concatenate.js +210 -0
- package/dist/src/driver/bundler/concatenate.js.map +1 -0
- package/dist/src/driver/bundler/graph.js +9 -5
- package/dist/src/driver/bundler/graph.js.map +1 -1
- package/dist/src/driver/bundler/merge.d.ts +4 -4
- package/dist/src/driver/bundler/merge.js +24 -207
- package/dist/src/driver/bundler/merge.js.map +1 -1
- package/dist/src/driver/bundler/{namespace-import.d.ts → namespace-object.d.ts} +5 -1
- package/dist/src/driver/bundler/{namespace-import.js → namespace-object.js} +6 -2
- package/dist/src/driver/bundler/namespace-object.js.map +1 -0
- package/dist/src/driver/bundler/{reexport-fixup.d.ts → reexport-resolution.d.ts} +9 -3
- package/dist/src/driver/bundler/{reexport-fixup.js → reexport-resolution.js} +16 -6
- package/dist/src/driver/bundler/reexport-resolution.js.map +1 -0
- package/dist/src/driver/fingerprint.d.ts +2 -2
- package/dist/src/driver/fingerprint.js +3 -3
- package/dist/src/driver/fingerprint.js.map +1 -1
- package/dist/src/driver/link-features.js +1 -1
- package/dist/src/driver/link-features.js.map +1 -1
- package/dist/src/driver/modules.d.ts +12 -5
- package/dist/src/driver/modules.js +12 -5
- package/dist/src/driver/modules.js.map +1 -1
- package/dist/src/driver/paths.js +8 -4
- package/dist/src/driver/paths.js.map +1 -1
- package/dist/src/driver/runtime-objects.d.ts +1 -1
- package/dist/src/driver/runtime-objects.js +13 -1
- package/dist/src/driver/runtime-objects.js.map +1 -1
- package/dist/src/driver/version.d.ts +1 -1
- package/dist/src/driver/version.js +1 -1
- package/dist/src/extensions/catalog.js +5 -1
- package/dist/src/extensions/catalog.js.map +1 -1
- package/dist/src/extensions/gui/index.js +0 -1
- package/dist/src/extensions/gui/index.js.map +1 -1
- package/dist/src/extensions/link-feature.d.ts +8 -0
- package/dist/src/extensions/node/stream-web/index.d.ts +6 -1
- package/dist/src/extensions/node/stream-web/index.js +59 -4
- package/dist/src/extensions/node/stream-web/index.js.map +1 -1
- package/dist/src/extensions/node/worker_threads/index.d.ts +14 -4
- package/dist/src/extensions/node/worker_threads/index.js +24 -11
- package/dist/src/extensions/node/worker_threads/index.js.map +1 -1
- package/dist/src/extensions/registry.d.ts +9 -1
- package/dist/src/extensions/registry.js +4 -1
- package/dist/src/extensions/registry.js.map +1 -1
- package/dist/src/extensions/wasm-asset.d.ts +16 -0
- package/dist/src/extensions/wasm-asset.js +28 -0
- package/dist/src/extensions/wasm-asset.js.map +1 -0
- package/dist/src/extensions/wasm.d.ts +17 -0
- package/dist/src/extensions/wasm.js +68 -0
- package/dist/src/extensions/wasm.js.map +1 -0
- package/dist/src/extensions/webworker/index.d.ts +24 -0
- package/dist/src/extensions/webworker/index.js +54 -0
- package/dist/src/extensions/webworker/index.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/tests/driver/deferred-reexport.test.js +25 -0
- package/dist/tests/driver/deferred-reexport.test.js.map +1 -1
- package/dist/tests/driver/link-features.test.js +9 -0
- package/dist/tests/driver/link-features.test.js.map +1 -1
- package/dist/tests/e2e/async-fs.test.js +44 -0
- package/dist/tests/e2e/async-fs.test.js.map +1 -1
- package/dist/tests/e2e/harness.d.ts +6 -0
- package/dist/tests/e2e/harness.js +13 -1
- package/dist/tests/e2e/harness.js.map +1 -1
- package/dist/tests/e2e/node-crypto-random.test.d.ts +8 -0
- package/dist/tests/e2e/node-crypto-random.test.js +148 -0
- package/dist/tests/e2e/node-crypto-random.test.js.map +1 -0
- package/dist/tests/e2e/node-modules.test.js +1 -1
- package/dist/tests/e2e/node-modules.test.js.map +1 -1
- package/dist/tests/e2e/web-streams.test.d.ts +8 -0
- package/dist/tests/e2e/web-streams.test.js +274 -0
- package/dist/tests/e2e/web-streams.test.js.map +1 -0
- package/dist/tests/e2e/web-worker.test.d.ts +7 -0
- package/dist/tests/e2e/web-worker.test.js +74 -0
- package/dist/tests/e2e/web-worker.test.js.map +1 -0
- package/dist/tests/e2e/webassembly.test.d.ts +8 -0
- package/dist/tests/e2e/webassembly.test.js +113 -0
- package/dist/tests/e2e/webassembly.test.js.map +1 -0
- package/dist/tests/e2e/worker-api.test.d.ts +14 -0
- package/dist/tests/e2e/worker-api.test.js +460 -0
- package/dist/tests/e2e/worker-api.test.js.map +1 -0
- package/dist/tests/e2e/worker-threads.test.d.ts +8 -0
- package/dist/tests/e2e/worker-threads.test.js +160 -0
- package/dist/tests/e2e/worker-threads.test.js.map +1 -0
- package/dist/tests/extensions/wasm.test.d.ts +1 -0
- package/dist/tests/extensions/wasm.test.js +53 -0
- package/dist/tests/extensions/wasm.test.js.map +1 -0
- package/doc/ai/cli.md +1 -1
- package/doc/ai/contributing.md +11 -4
- package/doc/ai/extensions.md +25 -2
- package/doc/ai/language-support.md +14 -2
- package/doc/ai/zh-CN/cli.md +1 -1
- package/doc/ai/zh-CN/contributing.md +8 -3
- package/doc/ai/zh-CN/extensions.md +23 -2
- package/doc/ai/zh-CN/language-support.md +13 -2
- package/doc/gui/api.md +1 -1
- package/doc/implemented/cli.md +1 -1
- package/doc/implemented/extensions.md +6 -5
- package/doc/implemented/node/stream-web.md +31 -0
- package/doc/implemented/node/worker-threads.md +88 -5
- package/doc/implemented/node.md +2 -1
- package/doc/implemented/streams.md +82 -0
- package/doc/implemented/wasm.md +80 -18
- package/doc/implemented/web-worker.md +84 -0
- package/doc/implemented.md +6 -2
- package/doc/unimplemented/deviations.md +1 -0
- package/doc/unimplemented/node/worker-threads.md +23 -0
- package/doc/unimplemented/node.md +1 -0
- package/doc/unimplemented/stdlib.md +2 -1
- package/doc/unimplemented/wasm.md +21 -9
- package/doc/unimplemented.md +1 -1
- package/doc/zh-CN/gui/api.md +1 -1
- package/doc/zh-CN/implemented/cli.md +1 -1
- package/doc/zh-CN/implemented/extensions.md +7 -6
- package/doc/zh-CN/implemented/node/stream-web.md +24 -0
- package/doc/zh-CN/implemented/node/worker-threads.md +77 -4
- package/doc/zh-CN/implemented/node.md +2 -1
- package/doc/zh-CN/implemented/streams.md +60 -0
- package/doc/zh-CN/implemented/wasm.md +73 -16
- package/doc/zh-CN/implemented/web-worker.md +79 -0
- package/doc/zh-CN/implemented.md +6 -2
- package/doc/zh-CN/unimplemented/deviations.md +1 -0
- package/doc/zh-CN/unimplemented/node/worker-threads.md +20 -0
- package/doc/zh-CN/unimplemented/node.md +1 -0
- package/doc/zh-CN/unimplemented/stdlib.md +2 -1
- package/doc/zh-CN/unimplemented/wasm.md +16 -8
- package/doc/zh-CN/unimplemented.md +1 -1
- package/llms.txt +2 -0
- package/package.json +8 -7
- package/runtime/ext_gui/browser.cpp +1 -1
- package/runtime/ext_node/stream_web/stream_web.c +20 -6
- package/runtime/worker/worker_api.c +422 -0
- package/runtime/worker/worker_codec.c +489 -0
- package/runtime/worker/worker_core.c +445 -0
- package/runtime/worker/worker_internal.h +223 -0
- package/runtime/worker/worker_platform.c +344 -0
- package/runtime/worker/worker_ports.c +203 -0
- package/runtime/worker/worker_transport.c +464 -0
- package/runtime/worker/worker_wire.c +150 -0
- package/runtime/xt_builtins.c +15 -0
- package/runtime/xt_constructors.c +49 -2
- package/runtime/xt_stdlib2/error.inc +4 -0
- package/runtime/xt_streams/common.inc +232 -0
- package/runtime/xt_streams/constructors.inc +232 -0
- package/runtime/xt_streams/encoding.inc +124 -0
- package/runtime/xt_streams/readable-extra.inc +372 -0
- package/runtime/xt_streams/readable.inc +415 -0
- package/runtime/xt_streams/transform.inc +195 -0
- package/runtime/xt_streams/writable.inc +542 -0
- package/runtime/xt_streams.c +30 -0
- package/runtime/xt_wasm/wasm.h +148 -0
- package/runtime/xt_wasm/wasm_api.c +357 -0
- package/runtime/xt_wasm/wasm_api.h +37 -0
- package/runtime/xt_wasm/wasm_bridge.c +30 -0
- package/runtime/xt_wasm/wasm_instance.c +591 -0
- package/runtime/xt_wasm/wasm_module.c +270 -0
- package/runtime/xt_wasm/wasm_values.c +177 -0
- package/runtime/xt_webassembly.c +15 -4
- package/scripts/fetch-vendored.ts +187 -20
- package/scripts/package-release.ts +3 -2
- package/src/cli/extensions.ts +11 -3
- package/src/cli/help.ts +1 -1
- package/src/codegen/generator/state.ts +7 -0
- package/src/codegen/generator/tables.ts +19 -1
- package/src/driver/bundler/README.md +55 -0
- package/src/driver/bundler/concatenate.ts +244 -0
- package/src/driver/bundler/graph.ts +9 -5
- package/src/driver/bundler/merge.ts +24 -215
- package/src/driver/bundler/{namespace-import.ts → namespace-object.ts} +5 -1
- package/src/driver/bundler/{reexport-fixup.ts → reexport-resolution.ts} +15 -5
- package/src/driver/fingerprint.ts +3 -3
- package/src/driver/link-features.ts +1 -1
- package/src/driver/modules.ts +12 -5
- package/src/driver/paths.ts +8 -4
- package/src/driver/runtime-objects.ts +13 -1
- package/src/driver/version.ts +1 -1
- package/src/extensions/catalog.ts +5 -1
- package/src/extensions/gui/index.ts +0 -1
- package/src/extensions/link-feature.ts +8 -0
- package/src/extensions/node/stream-web/index.ts +59 -4
- package/src/extensions/node/worker_threads/index.ts +24 -11
- package/src/extensions/registry.ts +13 -2
- package/src/extensions/wasm-asset.ts +32 -0
- package/src/extensions/wasm.ts +74 -0
- package/src/extensions/webworker/index.ts +58 -0
- package/src/index.ts +1 -0
- package/vendor/wasm3/.pin +1 -0
- package/vendor/wasm3/LICENSE +21 -0
- package/vendor/wasm3/m3_api_libc.c +265 -0
- package/vendor/wasm3/m3_api_libc.h +19 -0
- package/vendor/wasm3/m3_api_meta_wasi.c +1107 -0
- package/vendor/wasm3/m3_api_tracer.c +173 -0
- package/vendor/wasm3/m3_api_tracer.h +19 -0
- package/vendor/wasm3/m3_api_uvwasi.c +1290 -0
- package/vendor/wasm3/m3_api_wasi.c +1207 -0
- package/vendor/wasm3/m3_api_wasi.h +74 -0
- package/vendor/wasm3/m3_api_wasi_host.h +137 -0
- package/vendor/wasm3/m3_api_wasi_posix.h +979 -0
- package/vendor/wasm3/m3_api_wasi_win32.h +1093 -0
- package/vendor/wasm3/m3_atomic.h +114 -0
- package/vendor/wasm3/m3_bind.c +174 -0
- package/vendor/wasm3/m3_bind.h +20 -0
- package/vendor/wasm3/m3_code.c +232 -0
- package/vendor/wasm3/m3_code.h +74 -0
- package/vendor/wasm3/m3_compile.c +6603 -0
- package/vendor/wasm3/m3_compile.h +354 -0
- package/vendor/wasm3/m3_config.h +448 -0
- package/vendor/wasm3/m3_config_platforms.h +345 -0
- package/vendor/wasm3/m3_core.c +1034 -0
- package/vendor/wasm3/m3_core.h +526 -0
- package/vendor/wasm3/m3_deterministic.c +65 -0
- package/vendor/wasm3/m3_deterministic.h +59 -0
- package/vendor/wasm3/m3_env.c +3146 -0
- package/vendor/wasm3/m3_env.h +748 -0
- package/vendor/wasm3/m3_exception.h +33 -0
- package/vendor/wasm3/m3_exec.c +8 -0
- package/vendor/wasm3/m3_exec.h +4110 -0
- package/vendor/wasm3/m3_exec_atomic.h +146 -0
- package/vendor/wasm3/m3_exec_defs.h +76 -0
- package/vendor/wasm3/m3_function.c +278 -0
- package/vendor/wasm3/m3_function.h +244 -0
- package/vendor/wasm3/m3_host.h +226 -0
- package/vendor/wasm3/m3_host_none.h +76 -0
- package/vendor/wasm3/m3_host_posix.h +543 -0
- package/vendor/wasm3/m3_host_win32.h +253 -0
- package/vendor/wasm3/m3_info.c +616 -0
- package/vendor/wasm3/m3_info.h +38 -0
- package/vendor/wasm3/m3_math_utils.h +560 -0
- package/vendor/wasm3/m3_module.c +431 -0
- package/vendor/wasm3/m3_parse.c +1549 -0
- package/vendor/wasm3/m3_snapshot.c +3825 -0
- package/vendor/wasm3/m3_validate.c +1770 -0
- package/vendor/wasm3/m3_validate.h +25 -0
- package/vendor/wasm3/m3_wasi.h +10 -0
- package/vendor/wasm3/m3_xxh64.c +211 -0
- package/vendor/wasm3/wasm3.h +684 -0
- package/vendor/wasm3/wasm3_defs.h +350 -0
- package/dist/src/driver/bundler/namespace-import.js.map +0 -1
- package/dist/src/driver/bundler/reexport-fixup.js.map +0 -1
- package/runtime/ext_node/worker_threads/worker_threads.c +0 -214
|
@@ -0,0 +1,616 @@
|
|
|
1
|
+
//
|
|
2
|
+
// m3_info.c
|
|
3
|
+
//
|
|
4
|
+
// Created by Steven Massey on 4/27/19.
|
|
5
|
+
// Copyright © 2019 Steven Massey. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#include "m3_env.h"
|
|
9
|
+
#include "m3_info.h"
|
|
10
|
+
#include "m3_compile.h"
|
|
11
|
+
|
|
12
|
+
#if defined(DEBUG) || (d_m3EnableStrace >= 1)
|
|
13
|
+
|
|
14
|
+
size_t SPrintArg (char* o_string, size_t i_stringBufferSize, voidptr_t i_sp, m3type_t i_type)
|
|
15
|
+
{
|
|
16
|
+
int len = 0;
|
|
17
|
+
|
|
18
|
+
*o_string = 0;
|
|
19
|
+
|
|
20
|
+
if (i_type == c_m3Type_i32) {
|
|
21
|
+
len = snprintf(o_string, i_stringBufferSize, "%" PRIi32, *(i32*)i_sp);
|
|
22
|
+
} else if (i_type == c_m3Type_i64) {
|
|
23
|
+
len = snprintf(o_string, i_stringBufferSize, "%" PRIi64, *(i64*)i_sp);
|
|
24
|
+
}
|
|
25
|
+
# if d_m3HasFloat
|
|
26
|
+
else if (i_type == c_m3Type_f32) {
|
|
27
|
+
len = snprintf(o_string, i_stringBufferSize, "%" PRIf32, *(f32*)i_sp);
|
|
28
|
+
} else if (i_type == c_m3Type_f64) {
|
|
29
|
+
len = snprintf(o_string, i_stringBufferSize, "%" PRIf64, *(f64*)i_sp);
|
|
30
|
+
}
|
|
31
|
+
# endif
|
|
32
|
+
|
|
33
|
+
len = M3_MAX(0, len);
|
|
34
|
+
|
|
35
|
+
return len;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
cstr_t SPrintFunctionArgList (IM3Function i_function, m3stack_t i_sp)
|
|
40
|
+
{
|
|
41
|
+
int ret;
|
|
42
|
+
|
|
43
|
+
static char string[256];
|
|
44
|
+
|
|
45
|
+
char* s = string;
|
|
46
|
+
ccstr_t e = string + sizeof(string) - 1;
|
|
47
|
+
|
|
48
|
+
ret = snprintf(s, e - s, "(");
|
|
49
|
+
s += M3_MAX(0, ret);
|
|
50
|
+
|
|
51
|
+
u64* argSp = (u64*)i_sp;
|
|
52
|
+
|
|
53
|
+
IM3FuncType funcType = i_function->funcType;
|
|
54
|
+
if (funcType) {
|
|
55
|
+
u32 numArgs = funcType->numArgs;
|
|
56
|
+
|
|
57
|
+
for (u32 i = 0; i < numArgs; ++i) {
|
|
58
|
+
m3type_t type = d_FuncArgType(funcType, i);
|
|
59
|
+
|
|
60
|
+
ret = snprintf(s, e - s, "%s: ", c_waTypes[BaseTypeOf(type)]);
|
|
61
|
+
s += M3_MAX(0, ret);
|
|
62
|
+
|
|
63
|
+
s += SPrintArg(s, e - s, argSp + i, type);
|
|
64
|
+
|
|
65
|
+
if (i != numArgs - 1) {
|
|
66
|
+
ret = snprintf(s, e - s, ", ");
|
|
67
|
+
s += M3_MAX(0, ret);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
printf("null signature");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
ret = snprintf(s, e - s, ")");
|
|
75
|
+
s += M3_MAX(0, ret);
|
|
76
|
+
|
|
77
|
+
return string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// The results of a call, comma separated, for the strace return line. Empty when
|
|
81
|
+
// the function returns nothing, so the caller can leave the " = " off entirely.
|
|
82
|
+
// Every result occupies a full u64 in the I/O area, whatever its type - the same
|
|
83
|
+
// layout m3_GetResults reads.
|
|
84
|
+
cstr_t SPrintFunctionRetList (IM3FuncType i_funcType, m3stack_t i_sp)
|
|
85
|
+
{
|
|
86
|
+
int ret;
|
|
87
|
+
|
|
88
|
+
static char string[256];
|
|
89
|
+
|
|
90
|
+
char* s = string;
|
|
91
|
+
ccstr_t e = string + sizeof(string) - 1;
|
|
92
|
+
|
|
93
|
+
*s = 0;
|
|
94
|
+
|
|
95
|
+
u64* retSp = (u64*)i_sp;
|
|
96
|
+
|
|
97
|
+
u32 numRets = i_funcType ? i_funcType->numRets : 0;
|
|
98
|
+
|
|
99
|
+
for (u32 i = 0; i < numRets; ++i) {
|
|
100
|
+
s += SPrintArg(s, e - s, retSp + i, d_FuncRetType(i_funcType, i));
|
|
101
|
+
|
|
102
|
+
if (i != numRets - 1) {
|
|
103
|
+
ret = snprintf(s, e - s, ", ");
|
|
104
|
+
s += M3_MAX(0, ret);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
#endif
|
|
112
|
+
|
|
113
|
+
#ifdef DEBUG
|
|
114
|
+
|
|
115
|
+
// a central function you can be breakpoint:
|
|
116
|
+
void ExceptionBreakpoint (cstr_t i_exception, cstr_t i_message)
|
|
117
|
+
{
|
|
118
|
+
printf("\nexception: '%s' @ %s\n", i_exception, i_message);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
typedef struct OpInfo {
|
|
124
|
+
IM3OpInfo info;
|
|
125
|
+
m3opcode_t opcode;
|
|
126
|
+
} OpInfo;
|
|
127
|
+
|
|
128
|
+
void m3_PrintM3Info ()
|
|
129
|
+
{
|
|
130
|
+
printf("\n-- m3 configuration --------------------------------------------\n");
|
|
131
|
+
// printf (" sizeof M3CodePage : %zu bytes (%d slots) \n", sizeof (M3CodePage), c_m3CodePageNumSlots);
|
|
132
|
+
printf(" sizeof M3MemPage : %u bytes \n", d_m3DefaultMemPageSize);
|
|
133
|
+
printf(" sizeof M3Compilation : %zu bytes \n", sizeof(M3Compilation));
|
|
134
|
+
printf(" sizeof M3Function : %zu bytes \n", sizeof(M3Function));
|
|
135
|
+
printf("----------------------------------------------------------------\n\n");
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
void* v_PrintEnvModuleInfo (IM3Module i_module, void* i_info)
|
|
140
|
+
{
|
|
141
|
+
u32* io_index = (u32*)i_info;
|
|
142
|
+
printf(" module [%u] name: '%s'; funcs: %d \n", (*io_index)++, i_module->name, i_module->numFunctions);
|
|
143
|
+
|
|
144
|
+
return NULL;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
void m3_PrintRuntimeInfo (IM3Runtime i_runtime)
|
|
149
|
+
{
|
|
150
|
+
printf("\n-- m3 runtime -------------------------------------------------\n");
|
|
151
|
+
|
|
152
|
+
printf(" stack-size: %zu \n\n", i_runtime->numStackSlots * sizeof(m3slot_t));
|
|
153
|
+
|
|
154
|
+
u32 moduleIndex = 0;
|
|
155
|
+
ForEachModule(i_runtime, v_PrintEnvModuleInfo, &moduleIndex);
|
|
156
|
+
|
|
157
|
+
printf("----------------------------------------------------------------\n\n");
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
cstr_t GetTypeName (m3type_t i_m3Type)
|
|
162
|
+
{
|
|
163
|
+
u8 base = BaseTypeOf(i_m3Type);
|
|
164
|
+
|
|
165
|
+
if (base <= c_m3Type_unknown) {
|
|
166
|
+
return c_waTypes[base];
|
|
167
|
+
} else {
|
|
168
|
+
return "?";
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
// Appends to a string that is built up over several calls, and returns the length
|
|
174
|
+
// reached. snprintf reports the length it wanted to write rather than the length
|
|
175
|
+
// it wrote, so an append that truncates has to leave the cursor inside the buffer.
|
|
176
|
+
static
|
|
177
|
+
size_t SPrintAppend (char* o_string, size_t i_stringBufferSize, size_t i_len, ccstr_t i_format, ...)
|
|
178
|
+
{
|
|
179
|
+
if (i_len + 1 >= i_stringBufferSize) {
|
|
180
|
+
return i_len;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
va_list args;
|
|
184
|
+
va_start(args, i_format);
|
|
185
|
+
int ret = vsnprintf(o_string + i_len, i_stringBufferSize - i_len, i_format, args);
|
|
186
|
+
va_end(args);
|
|
187
|
+
|
|
188
|
+
return M3_MIN(i_len + (size_t)M3_MAX(0, ret), i_stringBufferSize - 1);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
// TODO: these 'static char string []' aren't thread-friendly. though these functions are
|
|
193
|
+
// mainly for simple diagnostics during development, it'd be nice if they were fully reliable.
|
|
194
|
+
|
|
195
|
+
cstr_t SPrintFuncTypeSignature (IM3FuncType i_funcType)
|
|
196
|
+
{
|
|
197
|
+
static char string[256];
|
|
198
|
+
|
|
199
|
+
size_t len = SPrintAppend(string, sizeof(string), 0, "(");
|
|
200
|
+
|
|
201
|
+
for (u32 i = 0; i < i_funcType->numArgs; ++i) {
|
|
202
|
+
len = SPrintAppend(string, sizeof(string), len, "%s%s", i ? ", " : "",
|
|
203
|
+
GetTypeName(d_FuncArgType(i_funcType, i)));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
len = SPrintAppend(string, sizeof(string), len, ") -> ");
|
|
207
|
+
|
|
208
|
+
for (u32 i = 0; i < i_funcType->numRets; ++i) {
|
|
209
|
+
len = SPrintAppend(string, sizeof(string), len, "%s%s", i ? ", " : "",
|
|
210
|
+
GetTypeName(d_FuncRetType(i_funcType, i)));
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
cstr_t SPrintValue (void* i_value, m3type_t i_type)
|
|
218
|
+
{
|
|
219
|
+
static char string[100];
|
|
220
|
+
SPrintArg(string, 100, (m3stack_t)i_value, i_type);
|
|
221
|
+
return string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Finds i_operation in one operation table. i_opcodeBase tags the result, so an
|
|
225
|
+
// extended entry comes back as the 0xFCxx opcode the rest of the code speaks.
|
|
226
|
+
static
|
|
227
|
+
bool ScanOperationTable (OpInfo* io_info, IM3OpInfo i_table, u32 i_numOps, m3opcode_t i_opcodeBase, IM3Operation i_operation)
|
|
228
|
+
{
|
|
229
|
+
for (u32 i = 0; i < i_numOps; ++i) {
|
|
230
|
+
IM3OpInfo oi = &i_table[i];
|
|
231
|
+
|
|
232
|
+
for (u32 o = 0; o < 4; ++o) {
|
|
233
|
+
if (oi->operations[o] == i_operation) {
|
|
234
|
+
io_info->info = oi;
|
|
235
|
+
io_info->opcode = i_opcodeBase | i;
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
static
|
|
245
|
+
OpInfo find_operation_info (IM3Operation i_operation)
|
|
246
|
+
{
|
|
247
|
+
OpInfo opInfo = { NULL, 0 };
|
|
248
|
+
|
|
249
|
+
if (!i_operation) {
|
|
250
|
+
return opInfo;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Scans the tables directly rather than through GetOpInfo (), which rejects
|
|
254
|
+
// the reserved slots and the internal operations kept past the last opcode.
|
|
255
|
+
// Reserved slots are zeroed, so they never match a real operation here.
|
|
256
|
+
// c_operationsHigh is not scanned: every entry in it is compiler-driven with
|
|
257
|
+
// an empty operation list, so nothing there could match.
|
|
258
|
+
if (not ScanOperationTable(&opInfo, c_operations, c_numOperations, 0, i_operation)) {
|
|
259
|
+
if (not ScanOperationTable(&opInfo, c_operationsFC, c_numOperationsFC, c_waOp_extended << 8, i_operation)) {
|
|
260
|
+
# if d_m3HasAtomics
|
|
261
|
+
// one entry serves a whole kind, so the opcode it comes back with is only the entry's index
|
|
262
|
+
ScanOperationTable(&opInfo, c_operationsFE, c_numOperationsFE, c_waOp_atomic << 8, i_operation);
|
|
263
|
+
# endif
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return opInfo;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
# undef fetch
|
|
272
|
+
# define fetch(TYPE) (* (TYPE *) ((*o_pc)++))
|
|
273
|
+
|
|
274
|
+
# define d_m3Decoder(FUNC) void Decode_##FUNC (char * o_string, size_t i_stringBufferSize, m3opcode_t i_opcode, IM3Operation i_operation, IM3OpInfo i_opInfo, pc_t * o_pc)
|
|
275
|
+
|
|
276
|
+
d_m3Decoder(Call)
|
|
277
|
+
{
|
|
278
|
+
void* function = fetch(void*);
|
|
279
|
+
i32 stackOffset = fetch(i32);
|
|
280
|
+
|
|
281
|
+
snprintf(o_string, i_stringBufferSize, "%p; stack-offset: %d", function, stackOffset);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
d_m3Decoder(Entry)
|
|
286
|
+
{
|
|
287
|
+
IM3Function function = fetch(IM3Function);
|
|
288
|
+
|
|
289
|
+
// only prints out the first registered name for the function
|
|
290
|
+
snprintf(o_string, i_stringBufferSize, "%s", m3_GetFunctionName(function));
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
d_m3Decoder(f64_Store)
|
|
295
|
+
{
|
|
296
|
+
if (i_operation == i_opInfo->operations[0]) {
|
|
297
|
+
u32 operand = fetch(u32);
|
|
298
|
+
u32 offset = fetch(u32);
|
|
299
|
+
|
|
300
|
+
snprintf(o_string, i_stringBufferSize, "offset= slot:%d + immediate:%d", operand, offset);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
d_m3Decoder(Branch)
|
|
306
|
+
{
|
|
307
|
+
void* target = fetch(void*);
|
|
308
|
+
snprintf(o_string, i_stringBufferSize, "%p", target);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
d_m3Decoder(BranchTable)
|
|
312
|
+
{
|
|
313
|
+
u32 slot = fetch(u32);
|
|
314
|
+
|
|
315
|
+
size_t len = SPrintAppend(o_string, i_stringBufferSize, 0, "slot: %" PRIu32 "; targets: ", slot);
|
|
316
|
+
|
|
317
|
+
// IM3Function function = fetch2 (IM3Function);
|
|
318
|
+
|
|
319
|
+
i32 targets = fetch(i32);
|
|
320
|
+
|
|
321
|
+
for (i32 i = 0; i < targets; ++i) {
|
|
322
|
+
pc_t addr = fetch(pc_t);
|
|
323
|
+
len = SPrintAppend(o_string, i_stringBufferSize, len, "%" PRIi32 "=%p, ", i, addr);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
pc_t addr = fetch(pc_t);
|
|
327
|
+
SPrintAppend(o_string, i_stringBufferSize, len, "def=%p ", addr);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
d_m3Decoder(Const)
|
|
332
|
+
{
|
|
333
|
+
u64 value = fetch(u64);
|
|
334
|
+
i32 offset = fetch(i32);
|
|
335
|
+
snprintf(o_string, i_stringBufferSize, " slot [%d] = %" PRIu64, offset, value);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
# undef fetch
|
|
340
|
+
|
|
341
|
+
void DecodeOperation (char* o_string, size_t i_stringBufferSize, m3opcode_t i_opcode, IM3Operation i_operation, IM3OpInfo i_opInfo, pc_t* o_pc)
|
|
342
|
+
{
|
|
343
|
+
# define d_m3Decode(OPCODE, FUNC) case OPCODE: Decode_##FUNC (o_string, i_stringBufferSize, i_opcode, i_operation, i_opInfo, o_pc); break;
|
|
344
|
+
|
|
345
|
+
switch (i_opcode) {
|
|
346
|
+
//d_m3Decode (0xc0, Const)
|
|
347
|
+
d_m3Decode(0xc5, Entry)
|
|
348
|
+
d_m3Decode(c_waOp_call, Call)
|
|
349
|
+
d_m3Decode(c_waOp_branch, Branch)
|
|
350
|
+
d_m3Decode(c_waOp_branchTable, BranchTable)
|
|
351
|
+
d_m3Decode(0x39, f64_Store)
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// TODO: this isn't fully implemented. it blindly assumes each word is a Operation pointer
|
|
356
|
+
// and, if an operation happens to missing from the c_operations table it won't be recognized here
|
|
357
|
+
void dump_code_page (IM3CodePage i_codePage, pc_t i_startPC)
|
|
358
|
+
{
|
|
359
|
+
m3log(code, "code page seq: %d", i_codePage->info.sequence);
|
|
360
|
+
|
|
361
|
+
pc_t pc = i_startPC ? i_startPC : GetPageStartPC(i_codePage);
|
|
362
|
+
pc_t end = GetPagePC(i_codePage);
|
|
363
|
+
|
|
364
|
+
m3log(code, "---------------------------------------------------------------------------------------");
|
|
365
|
+
|
|
366
|
+
while (pc < end) {
|
|
367
|
+
const pc_t operationPC = pc;
|
|
368
|
+
(void)operationPC; // avoid unused variable warning if DEBUG is not defined
|
|
369
|
+
IM3Operation op = (IM3Operation)(*pc++);
|
|
370
|
+
|
|
371
|
+
OpInfo i = find_operation_info(op);
|
|
372
|
+
|
|
373
|
+
if (i.info) {
|
|
374
|
+
char infoString[8 * 1024] = { 0 };
|
|
375
|
+
|
|
376
|
+
DecodeOperation(infoString, sizeof(infoString), i.opcode, op, i.info, &pc);
|
|
377
|
+
|
|
378
|
+
m3log(code, "%p | %20s %s", operationPC, i.info->name, infoString);
|
|
379
|
+
} else {
|
|
380
|
+
m3log(code, "%p | %p", operationPC, op);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
m3log(code, "---------------------------------------------------------------------------------------");
|
|
385
|
+
|
|
386
|
+
m3log(code, "free-lines: %d", i_codePage->info.numLines - i_codePage->info.lineIndex);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
void dump_type_stack (IM3Compilation o)
|
|
391
|
+
{
|
|
392
|
+
/* Reminders about how the stack works! :)
|
|
393
|
+
-- args & locals remain on the type stack for duration of the function. Denoted with a constant 'A' and 'L' in this dump.
|
|
394
|
+
-- the initial stack dumps originate from the CompileLocals () function, so these identifiers won't/can't be
|
|
395
|
+
applied until this compilation stage is finished
|
|
396
|
+
-- constants are not statically represented in the type stack (like args & constants) since they don't have/need
|
|
397
|
+
write counts
|
|
398
|
+
|
|
399
|
+
-- the number shown for static args and locals (value in wasmStack [i]) represents the write count for the variable
|
|
400
|
+
|
|
401
|
+
-- (does Wasm ever write to an arg? I dunno/don't remember.)
|
|
402
|
+
-- the number for the dynamic stack values represents the slot number.
|
|
403
|
+
-- if the slot index points to arg, local or constant it's denoted with a lowercase 'a', 'l' or 'c'
|
|
404
|
+
|
|
405
|
+
*/
|
|
406
|
+
|
|
407
|
+
// for the assert at end of dump:
|
|
408
|
+
i32 regAllocated[2] = { (i32)IsRegisterAllocated(o, 0), (i32)IsRegisterAllocated(o, 1) };
|
|
409
|
+
|
|
410
|
+
// display whether r0 or fp0 is allocated. these should then also be reflected somewhere in the stack too.
|
|
411
|
+
d_m3Log(stack, "\n");
|
|
412
|
+
d_m3Log(stack, " ");
|
|
413
|
+
printf("%s %s ", regAllocated[0] ? "(r0)" : " ", regAllocated[1] ? "(fp0)" : " ");
|
|
414
|
+
printf("\n");
|
|
415
|
+
|
|
416
|
+
for (u32 p = 1; p <= 2; ++p) {
|
|
417
|
+
d_m3Log(stack, " ");
|
|
418
|
+
|
|
419
|
+
for (u16 i = 0; i < o->stackIndex; ++i) {
|
|
420
|
+
if (i > 0 and i == o->stackFirstDynamicIndex) {
|
|
421
|
+
printf("#");
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
if (i == o->block.blockStackIndex) {
|
|
425
|
+
printf(">");
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
const char* type = c_waCompactTypes[BaseTypeOf(o->typeStack[i])];
|
|
429
|
+
|
|
430
|
+
const char* location = "";
|
|
431
|
+
|
|
432
|
+
i32 slot = o->wasmStack[i];
|
|
433
|
+
|
|
434
|
+
if (IsRegisterSlotAlias(slot)) {
|
|
435
|
+
bool isFp = IsFpRegisterSlotAlias(slot);
|
|
436
|
+
location = isFp ? "/f" : "/r";
|
|
437
|
+
|
|
438
|
+
regAllocated[isFp]--;
|
|
439
|
+
slot = -1;
|
|
440
|
+
} else {
|
|
441
|
+
if (slot < o->slotFirstDynamicIndex) {
|
|
442
|
+
if (slot >= o->slotFirstConstIndex) {
|
|
443
|
+
location = "c";
|
|
444
|
+
} else if (slot >= o->function->numRetAndArgSlots) {
|
|
445
|
+
location = "L";
|
|
446
|
+
} else {
|
|
447
|
+
location = "a";
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
char item[100];
|
|
453
|
+
|
|
454
|
+
if (slot >= 0) {
|
|
455
|
+
snprintf(item, sizeof(item), "%s%s%d", type, location, slot);
|
|
456
|
+
} else {
|
|
457
|
+
snprintf(item, sizeof(item), "%s%s", type, location);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
if (p == 1) {
|
|
461
|
+
size_t s = strlen(item);
|
|
462
|
+
|
|
463
|
+
snprintf(item, sizeof(item), "%d", i);
|
|
464
|
+
|
|
465
|
+
while (strlen(item) < s) {
|
|
466
|
+
strcat(item, " ");
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
printf("|%s ", item);
|
|
471
|
+
}
|
|
472
|
+
printf("\n");
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
// for (u32 r = 0; r < 2; ++r)
|
|
476
|
+
// d_m3Assert (regAllocated [r] == 0); // reg allocation & stack out of sync
|
|
477
|
+
|
|
478
|
+
u16 maxSlot = GetMaxUsedSlotPlusOne(o);
|
|
479
|
+
|
|
480
|
+
if (maxSlot > o->slotFirstDynamicIndex) {
|
|
481
|
+
d_m3Log(stack, " -");
|
|
482
|
+
|
|
483
|
+
for (u16 i = o->slotFirstDynamicIndex; i < maxSlot; ++i) {
|
|
484
|
+
printf("----");
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
printf("\n");
|
|
488
|
+
|
|
489
|
+
d_m3Log(stack, " slot |");
|
|
490
|
+
for (u16 i = o->slotFirstDynamicIndex; i < maxSlot; ++i) {
|
|
491
|
+
printf("%3d|", i);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
printf("\n");
|
|
495
|
+
d_m3Log(stack, " alloc |");
|
|
496
|
+
|
|
497
|
+
for (u16 i = o->slotFirstDynamicIndex; i < maxSlot; ++i) {
|
|
498
|
+
printf("%3d|", o->m3Slots[i]);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
printf("\n");
|
|
502
|
+
}
|
|
503
|
+
d_m3Log(stack, "\n");
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
static
|
|
508
|
+
const char* GetOpcodeIndentionString (i32 blockDepth)
|
|
509
|
+
{
|
|
510
|
+
blockDepth += 1;
|
|
511
|
+
|
|
512
|
+
if (blockDepth < 0) {
|
|
513
|
+
blockDepth = 0;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
static const char* s_spaces = ".......................................................................................";
|
|
517
|
+
|
|
518
|
+
const char* indent = s_spaces + strlen(s_spaces);
|
|
519
|
+
indent -= (blockDepth * 2);
|
|
520
|
+
if (indent < s_spaces) {
|
|
521
|
+
indent = s_spaces;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
return indent;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
const char* get_indention_string (IM3Compilation o)
|
|
529
|
+
{
|
|
530
|
+
return GetOpcodeIndentionString(o->block.depth + 4);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
void log_opcode (IM3Compilation o, m3opcode_t i_opcode)
|
|
535
|
+
{
|
|
536
|
+
i32 depth = o->block.depth;
|
|
537
|
+
if (i_opcode == c_waOp_end or i_opcode == c_waOp_else) {
|
|
538
|
+
depth--;
|
|
539
|
+
}
|
|
540
|
+
(void)depth;
|
|
541
|
+
|
|
542
|
+
m3log(compile, "%4d | 0x%02x %s %s", o->numOpcodes++, i_opcode, GetOpcodeIndentionString(depth), GetOpInfo(i_opcode)->name);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
void log_emit (IM3Compilation o, IM3Operation i_operation)
|
|
547
|
+
{
|
|
548
|
+
OpInfo i = find_operation_info(i_operation);
|
|
549
|
+
|
|
550
|
+
d_m3Log(emit, "");
|
|
551
|
+
if (i.info) {
|
|
552
|
+
printf("%p: %s\n", GetPagePC(o->page), i.info->name);
|
|
553
|
+
} else {
|
|
554
|
+
printf("not found: %p\n", i_operation);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
#endif // DEBUG
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
#if d_m3EnableOpProfiling
|
|
562
|
+
|
|
563
|
+
typedef struct M3ProfilerSlot {
|
|
564
|
+
cstr_t opName;
|
|
565
|
+
u64 hitCount;
|
|
566
|
+
} M3ProfilerSlot;
|
|
567
|
+
|
|
568
|
+
static M3ProfilerSlot s_opProfilerCounts[d_m3ProfilerSlotMask + 1] = {};
|
|
569
|
+
|
|
570
|
+
void ProfileHit (cstr_t i_operationName)
|
|
571
|
+
{
|
|
572
|
+
u64 ptr = (u64)i_operationName;
|
|
573
|
+
|
|
574
|
+
M3ProfilerSlot* slot = &s_opProfilerCounts[ptr & d_m3ProfilerSlotMask];
|
|
575
|
+
|
|
576
|
+
if (slot->opName) {
|
|
577
|
+
if (slot->opName != i_operationName) {
|
|
578
|
+
m3_Abort("profiler slot collision; increase d_m3ProfilerSlotMask");
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
slot->opName = i_operationName;
|
|
583
|
+
slot->hitCount++;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
void m3_PrintProfilerInfo ()
|
|
588
|
+
{
|
|
589
|
+
M3ProfilerSlot dummy;
|
|
590
|
+
M3ProfilerSlot* maxSlot = &dummy;
|
|
591
|
+
|
|
592
|
+
do {
|
|
593
|
+
maxSlot->hitCount = 0;
|
|
594
|
+
|
|
595
|
+
for (u32 i = 0; i <= d_m3ProfilerSlotMask; ++i) {
|
|
596
|
+
M3ProfilerSlot* slot = &s_opProfilerCounts[i];
|
|
597
|
+
|
|
598
|
+
if (slot->opName) {
|
|
599
|
+
if (slot->hitCount > maxSlot->hitCount) {
|
|
600
|
+
maxSlot = slot;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
if (maxSlot->opName) {
|
|
606
|
+
fprintf(stderr, "%13" PRIu64 " %s\n", maxSlot->hitCount, maxSlot->opName);
|
|
607
|
+
maxSlot->opName = NULL;
|
|
608
|
+
}
|
|
609
|
+
} while (maxSlot->hitCount);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
#else
|
|
613
|
+
|
|
614
|
+
void m3_PrintProfilerInfo () {}
|
|
615
|
+
|
|
616
|
+
#endif
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//
|
|
2
|
+
// m3_info.h
|
|
3
|
+
//
|
|
4
|
+
// Created by Steven Massey on 12/6/19.
|
|
5
|
+
// Copyright © 2019 Steven Massey. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#ifndef m3_info_h
|
|
9
|
+
#define m3_info_h
|
|
10
|
+
|
|
11
|
+
#include "m3_compile.h"
|
|
12
|
+
|
|
13
|
+
d_m3BeginExternC
|
|
14
|
+
|
|
15
|
+
void ProfileHit (cstr_t i_operationName);
|
|
16
|
+
|
|
17
|
+
#ifdef DEBUG
|
|
18
|
+
|
|
19
|
+
void dump_type_stack (IM3Compilation o);
|
|
20
|
+
void log_opcode (IM3Compilation o, m3opcode_t i_opcode);
|
|
21
|
+
const char* get_indention_string (IM3Compilation o);
|
|
22
|
+
void log_emit (IM3Compilation o, IM3Operation i_operation);
|
|
23
|
+
|
|
24
|
+
cstr_t SPrintFuncTypeSignature (IM3FuncType i_funcType);
|
|
25
|
+
|
|
26
|
+
#else // DEBUG
|
|
27
|
+
|
|
28
|
+
# define dump_type_stack(...) {}
|
|
29
|
+
# define log_opcode(...) {}
|
|
30
|
+
# define get_indention_string(...) ""
|
|
31
|
+
# define emit_stack_dump(...) {}
|
|
32
|
+
# define log_emit(...) {}
|
|
33
|
+
|
|
34
|
+
#endif // DEBUG
|
|
35
|
+
|
|
36
|
+
d_m3EndExternC
|
|
37
|
+
|
|
38
|
+
#endif // m3_info_h
|