registerFunc(name, func, override = false) {
	        this.withNewScope(() => {
	            const autoAttachToScope = true;
	            // packed func can be released once it is registered
	            const packedFunc = this.toPackedFuncInternal(func, autoAttachToScope);
	            const ioverride = override ? 1 : 0;
	            const stack = this.lib.getOrAllocCallStack();
	            const nameOffset = stack.allocRawBytes(name.length + 1);
	            stack.storeRawBytes(nameOffset, support.StringToUint8Array(name));
	            stack.commitToWasmMemory();
	            this.lib.checkCall(this.lib.exports.TVMFuncRegisterGlobal(stack.ptrFromOffset(nameOffset), packedFunc._tvmPackedCell.getHandle(), ioverride));
	            this.lib.recycleCallStack(stack);
	        });
	    }
Register function to be global function in tvm runtime.
@param name The name of the function.
@param f function to be registered.
@param override Whether overwrite function in existing registry.