Implementing reflection mechanism in blockchain
AssigneeAnt Blockchain Technology (Shanghai) Co., Ltd.
InventorWei Zhou
Life of this patent
Estimating the term…
Loading patent…
AssigneeAnt Blockchain Technology (Shanghai) Co., Ltd.
InventorWei Zhou
Estimating the term…
Methods, apparatuses, and computer-readable media for implementing a reflection mechanism in a blockchain are described. In an example process, a compiler compiles contract source code comprising reflective programming into a Wasm file. The compiler generates metadata of a first type and a first function in the first type, and packages the metadata in the Wasm file; and generates contract bytecode of a second function that obtains a first function type and first function content according to dynamic parameters. After receiving a transaction that calls a contract, a virtual machine loads the Wasm file, uses the metadata in the Wasm file to initialize a part of a memory in a created linear memory region; and parses and executes the contract bytecode in the Wasm file. When executing the bytecode of the second function, the virtual machine determines and executes, based on the metadata, the first function in the linear memory region.
A method for implementing a reflection mechanism in a blockchain, comprising:
A method for compiling contract source code that comprises reflective programming into a Wasm file, comprising:
A method for executing a Wasm file compiled from contract source code that comprises reflective programming by a process comprising:
Dependencies are inferred from the claim text.