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

Method genCode

src/hx/cppia/Cppia.cpp:4766–4791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4764
4765 #ifdef CPPIA_JIT
4766 void genCode(CppiaCompiler *compiler, const JitVal &inDest,ExprType destType) HXCPP_OVERRIDE
4767 {
4768 switch(destType)
4769 {
4770 case etObject:
4771 //TODO - GC!
4772 if (!value.mPtr)
4773 value = strVal;
4774 compiler->move(inDest, (void *) value.mPtr );
4775 break;
4776
4777
4778 case etString:
4779 if (!isMemoryVal(inDest))
4780 compiler->setError("Bad String target");
4781 else
4782 {
4783 compiler->move(inDest.as(jtInt),JitVal(strVal.length));
4784 compiler->move(inDest.as(jtPointer)+StringOffset::Ptr,JitVal((void *)strVal.raw_ptr()));
4785 }
4786 break;
4787
4788 default:
4789 compiler->setError("Bad String conversion type");
4790 }
4791 }
4792 #endif
4793
4794};

Callers

nothing calls this directly

Calls 5

isMemoryValFunction · 0.85
JitValClass · 0.85
moveMethod · 0.80
setErrorMethod · 0.80
asMethod · 0.80

Tested by

no test coverage detected