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

Method move

src/hx/cppia/CppiaCompiler.cpp:751–805  ·  view source on GitHub ↗

May required indirect offsets

Source from the content-addressed store, hash-verified

749
750 // May required indirect offsets
751 void move(const JitVal &inDest, const JitVal &inSrc) HXCPP_OVERRIDE
752 {
753 // TODO - better equality test
754 if (inDest==inSrc || !inDest.valid())
755 return;
756
757 switch(getCommonType(inDest,inSrc))
758 {
759 case jtInt:
760 emit_op1(SLJIT_MOV_S32, inDest, inSrc);
761 break;
762 case jtPointer:
763 if (inSrc.reg0==sLocalReg && inSrc.position==jposRegister)
764 {
765 sljit_s32 tDest = getTarget(inDest);
766 if (compiler)
767 sljit_get_local_base(compiler, tDest, getData(inDest), inSrc.offset );
768 }
769 else
770 emit_op1(SLJIT_MOV_P, inDest, inSrc);
771 break;
772 case jtFloat:
773 emit_fop1(SLJIT_MOV_F64, inDest, inSrc);
774 break;
775
776 case jtFloat32:
777 emit_fop1(SLJIT_MOV_F32, inDest, inSrc);
778 break;
779
780 case jtByte:
781 emit_op1(SLJIT_MOV32_U8, inDest, inSrc);
782 break;
783
784 case jtShort:
785 emit_op1(SLJIT_MOV32_U16, inDest, inSrc);
786 break;
787
788 case jtString:
789 if (!isMemoryVal(inDest) || !isMemoryVal(inSrc))
790 {
791 setError("Bad string move");
792 }
793 else
794 {
795 emit_op1(SLJIT_MOV_S32, inDest.as(jtInt), inSrc.as(jtInt));
796 emit_op1(SLJIT_MOV_P, inDest.as(jtPointer) + StringOffset::Ptr, inSrc.as(jtPointer) + StringOffset::Ptr);
797 }
798 break;
799
800 case jtVoid:
801 case jtUnknown:
802 case jtAny:
803 setError("Bad move target");
804 }
805 }
806
807
808 void setMaxPointer() HXCPP_OVERRIDE

Callers 15

genCodeMethod · 0.80
genCodeMethod · 0.80
JitSaveMethod · 0.80
~JitSaveMethod · 0.80
genCodeMethod · 0.80
genCodeFunction · 0.80
genFunctionResultFunction · 0.80
genFunctionCallFunction · 0.80
genCodeMethod · 0.80
genCodeMethod · 0.80
genCodeMethod · 0.80

Calls 4

isMemoryValFunction · 0.85
validMethod · 0.80
asMethod · 0.80
sljit_get_local_baseFunction · 0.50

Tested by

no test coverage detected