mirror of
https://github.com/fluencelabs/wasm-utils
synced 2025-03-28 08:51:05 +00:00
44 lines
881 B
C
44 lines
881 B
C
int data;
|
|
|
|
extern void log_event(void* ptr);
|
|
|
|
int main() {
|
|
log_event(0);
|
|
}
|
|
|
|
void call() {
|
|
log_event(0);
|
|
}
|
|
|
|
/* produces the following code (with gas counter and call optimization)
|
|
(module
|
|
(type (;0;) (func (param i32) (result i32)))
|
|
(type (;1;) (func))
|
|
(type (;2;) (func (param i32)))
|
|
(import "env" "memoryBase" (global (;0;) i32))
|
|
(import "env" "memory" (memory (;0;) 256))
|
|
(import "env" "table" (table (;0;) 0 anyfunc))
|
|
(import "env" "gas" (func (;0;) (type 2)))
|
|
(func (;1;) (type 0) (param i32) (result i32)
|
|
i32.const 2
|
|
call 0
|
|
block i32 ;; label = @1
|
|
i32.const 13
|
|
call 0
|
|
get_global 0
|
|
i32.const 5242880
|
|
i32.add
|
|
get_global 0
|
|
i32.const 5242880
|
|
i32.add
|
|
i32.load
|
|
get_local 0
|
|
i32.load offset=4
|
|
i32.add
|
|
i32.store
|
|
i32.const 0
|
|
end)
|
|
(export "_call" (func 1)))
|
|
|
|
*/
|