retValueToJS(rvaluePtr, tcode, callbackArg) {
	        switch (tcode) {
	            case 0 /* Int */:
	            case 1 /* UInt */:
	                return this.memory.loadI64(rvaluePtr);
	            case 2 /* Float */:
	                return this.memory.loadF64(rvaluePtr);
	            case 3 /* TVMOpaqueHandle */: {
	                return this.memory.loadPointer(rvaluePtr);
	            }
	            case 13 /* TVMNDArrayHandle */: {
	                return this.ctx.attachToCurrentScope(new NDArray(this.memory.loadPointer(rvaluePtr), false, this.lib, this.ctx));
	            }
	            case 7 /* TVMDLTensorHandle */: {
	                support.assert(callbackArg);
	                // no need to attach as we are only looking at view
	                return new NDArray(this.memory.loadPointer(rvaluePtr), true, this.lib, this.ctx);
	            }
	            case 10 /* TVMPackedFuncHandle */: {
	                return this.ctx.attachToCurrentScope(this.makePackedFunc(this.memory.loadPointer(rvaluePtr)));
	            }
	            case 9 /* TVMModuleHandle */: {
	                return this.ctx.attachToCurrentScope(new Module(this.memory.loadPointer(rvaluePtr), this.lib, (ptr) => {
	                    return this.ctx.attachToCurrentScope(this.makePackedFunc(ptr));
	                }));
	            }
	            case 8 /* TVMObjectHandle */: {
	                const obj = new TVMObject(this.memory.loadPointer(rvaluePtr), this.lib, this.ctx);
	                const func = this.objFactory.get(obj.typeIndex());
	                if (func != undefined) {
	                    return this.ctx.attachToCurrentScope(func(obj.getHandle(), this.lib, this.ctx));
	                }
	                else {
	                    return this.ctx.attachToCurrentScope(obj);
	                }
	            }
	            case 4 /* Null */: return undefined;
	            case 6 /* DLDevice */: {
	                const deviceType = this.memory.loadI32(rvaluePtr);
	                const deviceId = this.memory.loadI32(rvaluePtr + 4 /* I32 */);
	                return this.device(deviceType, deviceId);
	            }
	            case 11 /* TVMStr */: {
	                const ret = this.memory.loadCString(this.memory.loadPointer(rvaluePtr));
	                return ret;
	            }
	            case 12 /* TVMBytes */: {
	                return this.memory.loadTVMBytes(this.memory.loadPointer(rvaluePtr));
	            }
	            default:
	                throw new Error("Unsupported return type code=" + tcode);
	        }
	    }
Creaye return value of the packed func. The value us auto-tracked for dispose.
@param rvaluePtr The location of rvalue
@param tcode     The type code.
@param callbackArg Whether it is being used in callbackArg.
@returns The JS value.