| 1760 | |
| 1761 | template<typename T> |
| 1762 | void run(CppiaCtx *ctx,T &outValue) |
| 1763 | { |
| 1764 | unsigned char *pointer = ctx->pointer; |
| 1765 | ctx->pushObject(isStatic ? 0: thisExpr ? thisExpr->runObject(ctx) : ctx->getThis(false)); |
| 1766 | BCR_VCHECK; |
| 1767 | |
| 1768 | const char *s = function.signature+1; |
| 1769 | for(int a=0;a<args.size();a++) |
| 1770 | { |
| 1771 | CppiaExpr *arg = args[a]; |
| 1772 | switch(*s++) |
| 1773 | { |
| 1774 | case sigInt: |
| 1775 | case sigBool: |
| 1776 | ctx->pushInt( arg->runInt(ctx) ); break; |
| 1777 | case sigFloat: ctx->pushFloat( arg->runFloat(ctx) ); break; |
| 1778 | case sigString: ctx->pushString( arg->runString(ctx) ); break; |
| 1779 | case sigObject: ctx->pushObject( arg->runObject(ctx) ); break; |
| 1780 | default: ;// huh? |
| 1781 | } |
| 1782 | BCR_VCHECK; |
| 1783 | } |
| 1784 | |
| 1785 | AutoStack a(ctx,pointer); |
| 1786 | if (isSuper) |
| 1787 | function.superExecute(ctx); |
| 1788 | else |
| 1789 | function.execute(ctx); |
| 1790 | |
| 1791 | #ifdef DEBUG_RETURN_TYPE |
| 1792 | gLastRet = returnType; |
| 1793 | #endif |
| 1794 | if (sizeof(outValue)>0) |
| 1795 | { |
| 1796 | if (returnType == etInt) |
| 1797 | SetVal(outValue,ctx->getInt()); |
| 1798 | else if (returnType == etFloat) |
| 1799 | SetVal(outValue,ctx->getFloat()); |
| 1800 | else if (returnType == etString) |
| 1801 | SetVal(outValue,ctx->getString()); |
| 1802 | else if (returnType == etObject) |
| 1803 | SetVal(outValue,ctx->getObject()); |
| 1804 | } |
| 1805 | } |
| 1806 | |
| 1807 | void runVoid(CppiaCtx *ctx) HXCPP_OVERRIDE |
| 1808 | { |
nothing calls this directly
no test coverage detected