setPackedArguments(stack, args, argsValue, argsCode) {
	        for (let i = 0; i < args.length; ++i) {
	            let val = args[i];
	            const tp = typeof val;
	            const valueOffset = argsValue + i * 8 /* TVMValue */;
	            const codeOffset = argsCode + i * 4 /* I32 */;
	            if (val instanceof NDArray) {
	                if (!val.isView) {
	                    stack.storePtr(valueOffset, val.getHandle());
	                    stack.storeI32(codeOffset, 13 /* TVMNDArrayHandle */);
	                }
	                else {
	                    stack.storePtr(valueOffset, val.getHandle());
	                    stack.storeI32(codeOffset, 7 /* TVMDLTensorHandle */);
	                }
	            }
	            else if (val instanceof Scalar) {
	                if (val.dtype.startsWith("int") || val.dtype.startsWith("uint")) {
	                    stack.storeI64(valueOffset, val.value);
	                    stack.storeI32(codeOffset, 0 /* Int */);
	                }
	                else if (val.dtype.startsWith("float")) {
	                    stack.storeF64(valueOffset, val.value);
	                    stack.storeI32(codeOffset, 2 /* Float */);
	                }
	                else {
	                    support.assert(val.dtype == "handle", "Expect handle");
	                    stack.storePtr(valueOffset, val.value);
	                    stack.storeI32(codeOffset, 3 /* TVMOpaqueHandle */);
	                }
	            }
	            else if (val instanceof DLDevice) {
	                stack.storeI32(valueOffset, val.deviceType);
	                stack.storeI32(valueOffset + 4 /* I32 */, val.deviceType);
	                stack.storeI32(codeOffset, 6 /* DLDevice */);
	            }
	            else if (tp == "number") {
	                stack.storeF64(valueOffset, val);
	                stack.storeI32(codeOffset, 2 /* Float */);
	                // eslint-disable-next-line no-prototype-builtins
	            }
	            else if (tp == "function" && val.hasOwnProperty("_tvmPackedCell")) {
	                stack.storePtr(valueOffset, val._tvmPackedCell.getHandle());
	                stack.storeI32(codeOffset, 10 /* TVMPackedFuncHandle */);
	            }
	            else if (val === null || val == undefined) {
	                stack.storePtr(valueOffset, 0);
	                stack.storeI32(codeOffset, 4 /* Null */);
	            }
	            else if (tp == "string") {
	                stack.allocThenSetArgString(valueOffset, val);
	                stack.storeI32(codeOffset, 11 /* TVMStr */);
	            }
	            else if (val instanceof Uint8Array) {
	                stack.allocThenSetArgBytes(valueOffset, val);
	                stack.storeI32(codeOffset, 12 /* TVMBytes */);
	            }
	            else if (val instanceof Function) {
	                val = this.toPackedFuncInternal(val, false);
	                stack.tempArgs.push(val);
	                stack.storePtr(valueOffset, val._tvmPackedCell.getHandle());
	                stack.storeI32(codeOffset, 10 /* TVMPackedFuncHandle */);
	            }
	            else if (val instanceof Module) {
	                stack.storePtr(valueOffset, val.getHandle());
	                stack.storeI32(codeOffset, 9 /* TVMModuleHandle */);
	            }
	            else if (val instanceof TVMObject) {
	                stack.storePtr(valueOffset, val.getHandle());
	                stack.storeI32(codeOffset, 8 /* TVMObjectHandle */);
	            }
	            else {
	                throw new Error("Unsupported argument type " + tp);
	            }
	        }
	    }
Set packed function arguments into the location indicated by argsValue and argsCode.
Allocate new temporary space from the stack if necessary.

@parma stack The call stack
@param args  The input arguments.
@param argsValue The offset of argsValue.
@param argsCode The offset of argsCode.