MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / genCode

Method genCode

src/hx/cppia/StringBuiltin.cpp:232–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230 }
231
232 void genCode(CppiaCompiler *compiler, const JitVal &inDest,ExprType destType) HXCPP_OVERRIDE
233 {
234 JitTemp value(compiler,jtString);
235 strVal->genCode(compiler, value, etString);
236 a0->genCode(compiler, sJitTemp1, etInt);
237
238 if (CODE)
239 {
240 if (AS_INT)
241 {
242 #ifdef HX_SMART_STRINGS
243 compiler->callNative( (void *)runCca, value, sJitTemp1.as(jtInt));
244 compiler->convertReturnReg( etInt, inDest, destType);
245 #else
246 // sJitTemp1 = __s
247 compiler->move( sJitTemp0.as(jtPointer), value.star(jtPointer,offsetof(String,__s)) );
248 if (destType==etInt)
249 {
250 compiler->move(inDest.as(jtInt), sJitTemp0.atReg(sJitTemp1,0,jtByte) );
251 }
252 else
253 {
254 compiler->move(sJitTemp0.as(jtInt), sJitTemp0.atReg(sJitTemp1,0,jtByte) );
255 compiler->convertReturnReg(etInt, inDest, destType);
256 }
257 #endif
258 }
259 else
260 {
261 compiler->callNative( (void *)runCharCodeAt, value, sJitTemp1.as(jtInt));
262 compiler->convertReturnReg( etObject, inDest, destType);
263 }
264 }
265 else
266 {
267 compiler->callNative( (void *)runCharAt, value, sJitTemp1.as(jtInt));
268 compiler->convert(value, etString, inDest, destType);
269 }
270 }
271 #endif
272};
273

Callers

nothing calls this directly

Calls 8

callNativeMethod · 0.80
asMethod · 0.80
convertReturnRegMethod · 0.80
moveMethod · 0.80
atRegMethod · 0.80
convertMethod · 0.80
genCodeMethod · 0.45
starMethod · 0.45

Tested by

no test coverage detected