@@ -105,48 +105,6 @@ struct OIArray {
105
105
)" ;
106
106
}
107
107
108
- void defineJitLog (FeatureSet features, std::string& code) {
109
- if (features[Feature::JitLogging]) {
110
- code += R"(
111
- extern int logFile;
112
-
113
- void __jlogptr(uintptr_t ptr) {
114
- static constexpr char hexdigits[] = "0123456789abcdef";
115
- static constexpr size_t ptrlen = 2 * sizeof(ptr);
116
-
117
- static char hexstr[ptrlen + 1] = {};
118
-
119
- size_t i = ptrlen;
120
- while (i--) {
121
- hexstr[i] = hexdigits[ptr & 0xf];
122
- ptr = ptr >> 4;
123
- }
124
- hexstr[ptrlen] = '\n';
125
- write(logFile, hexstr, sizeof(hexstr));
126
- }
127
-
128
- #define JLOG(str) \
129
- do { \
130
- if (__builtin_expect(logFile, 0)) { \
131
- write(logFile, str, sizeof(str) - 1); \
132
- } \
133
- } while (false)
134
-
135
- #define JLOGPTR(ptr) \
136
- do { \
137
- if (__builtin_expect(logFile, 0)) { \
138
- __jlogptr((uintptr_t)ptr); \
139
- } \
140
- } while (false)
141
- )" ;
142
- } else {
143
- code += R"(
144
- #define JLOG(str)
145
- #define JLOGPTR(ptr)
146
- )" ;
147
- }
148
- }
149
-
150
108
void addIncludes (const TypeGraph& typeGraph,
151
109
FeatureSet features,
152
110
std::string& code) {
@@ -1137,7 +1095,7 @@ void CodeGen::generate(
1137
1095
}
1138
1096
addIncludes (typeGraph, config_.features , code);
1139
1097
defineArray (code);
1140
- defineJitLog ( config_.features , code );
1098
+ FuncGen::DefineJitLog (code, config_.features );
1141
1099
1142
1100
if (config_.features [Feature::TypedDataSegment]) {
1143
1101
if (config_.features [Feature::Library]) {
0 commit comments