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

Method runObject

src/hx/cppia/ArrayBuiltin.cpp:696–828  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

694 return runObject(ctx)->toString();
695 }
696 hx::Object *runObject(CppiaCtx *ctx) HXCPP_OVERRIDE
697 {
698 if (FUNC==af__get)
699 {
700 Array_obj<ELEM> *thisVal = (Array_obj<ELEM>*)thisExpr->runObject(ctx);
701 BCR_CHECK;
702 int idx = args[0]->runInt(ctx);
703 BCR_CHECK;
704 return thisVal->__GetItem(idx).mPtr;
705 }
706 if (FUNC==af__set)
707 {
708 Array_obj<ELEM> *thisVal = (Array_obj<ELEM>*)thisExpr->runObject(ctx);
709 BCR_CHECK;
710 int i = args[0]->runInt(ctx);
711 BCR_CHECK;
712 ELEM elem;
713 thisVal->Item(i) = runValue(elem,ctx,args[1]);
714 #ifdef HXCPP_GC_GENERATIONAL
715 if (hx::ContainsPointers<ELEM>())
716 HX_OBJ_WB_GET(thisVal, hx::PointerOf(elem));
717 #endif
718 return Dynamic(elem).mPtr;
719 }
720 if (FUNC==af__crement)
721 {
722 Array_obj<ELEM> *thisVal = (Array_obj<ELEM>*)thisExpr->runObject(ctx);
723 BCR_CHECK;
724 int idx = args[0]->runInt(ctx);
725 BCR_CHECK;
726 ELEM &elem = thisVal->Item(idx);
727 Dynamic result(CREMENT::run(elem));
728 #ifdef HXCPP_GC_GENERATIONAL
729 if (hx::ContainsPointers<ELEM>())
730 HX_OBJ_WB_CTX(thisVal,hx::PointerOf(elem),ctx);
731 #endif
732 return result.mPtr;
733
734 }
735
736 if (FUNC==afPop)
737 {
738 Array_obj<ELEM> *thisVal = (Array_obj<ELEM>*)thisExpr->runObject(ctx);
739 BCR_CHECK;
740 return Dynamic(thisVal->pop()).mPtr;
741 }
742 if (FUNC==afShift)
743 {
744 Array_obj<ELEM> *thisVal = (Array_obj<ELEM>*)thisExpr->runObject(ctx);
745 BCR_CHECK;
746 return Dynamic(thisVal->shift()).mPtr;
747 }
748
749
750 if (FUNC==afConcat)
751 {
752 Array_obj<ELEM> *thisVal = (Array_obj<ELEM>*)thisExpr->runObject(ctx);
753 BCR_CHECK;

Callers

nothing calls this directly

Calls 15

PointerOfFunction · 0.85
runFunction · 0.85
concatMethod · 0.80
copyMethod · 0.80
iteratorMethod · 0.80
keyValueIteratorMethod · 0.80
DynamicClass · 0.50
runObjectMethod · 0.45
runIntMethod · 0.45
__GetItemMethod · 0.45
popMethod · 0.45
spliceMethod · 0.45

Tested by

no test coverage detected