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

Method genCode

src/hx/cppia/CppiaClasses.cpp:278–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276
277 #ifdef CPPIA_JIT
278 void genCode(CppiaCompiler *compiler, const JitVal &inDest, ExprType destType) HXCPP_OVERRIDE
279 {
280 int s = args.size();
281 if (s==0)
282 {
283 // TODO GC pin
284 if (destType==etObject)
285 compiler->move(inDest, (void *)getValue());
286 }
287 else if (value)
288 {
289 value->genCode(compiler, args, inDest, destType);
290 }
291 else
292 {
293 {
294 AutoFramePos frame(compiler);
295
296 for(int a=0;a<s;a++)
297 {
298 args[a]->genCode(compiler, JitFramePos(compiler->getCurrentFrameSize(),etObject), etObject);
299 compiler->addFrame(etObject);
300 }
301
302 }
303
304 compiler->add(sJitCtxFrame, sJitFrame, compiler->getCurrentFrameSize());
305
306 compiler->callNative((void *)createEnum,(void *)enumClass.mPtr,(void *)&enumName,(int)args.size() );
307
308 if (destType!=etVoid && destType!=etNull)
309 compiler->convertResult( etObject, inDest, destType );
310 }
311 }
312 #endif
313
314};

Callers 1

genCodeMethod · 0.45

Calls 8

JitFramePosClass · 0.85
moveMethod · 0.80
getCurrentFrameSizeMethod · 0.80
addFrameMethod · 0.80
callNativeMethod · 0.80
convertResultMethod · 0.80
sizeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected