Lines Matching refs:future
467 ;; Test when realloc is called to communicate stream/future values that various
470 ;; Component that will drive the reader forward and write to the future/stream
472 (type $FT (future string))
476 (export "run-future" (func async (param "future" $FT) (result u32)))
482 …(core func $run-reader-future (canon lower (func $reader "run-future") (memory $libc "memory") asy…
485 (import "" "future.write" (func $future.write (param i32 i32) (result i32)))
490 (import "" "future.new" (func $future.new (result i64)))
492 (import "" "run-reader-future" (func $run-reader-future (param i32 i32) (result i32)))
500 (global $future-subtask (mut i32) (i32.const 0))
502 (global $future-retp i32 (i32.const 0x60))
513 (local.set $ret64 (call $future.new))
520 (local.set $ret (call $run-reader-future (local.get $fr) (global.get $future-retp)))
521 (global.set $future-subtask (i32.shr_u (local.get $ret) (i32.const 4)))
522 (local.set $ret (call $future.write (global.get $fw) (i32.const 40)))
534 (call $waitable.join (global.get $future-subtask) (global.get $ws))
538 (global $future-completed (mut i32) (i32.const 0))
549 (if (i32.eq (local.get $index) (global.get $future-subtask))
551 (if (i32.ne (i32.load (global.get $future-retp)) (i32.const 42)) (then (unreachable)))
552 (global.set $future-completed (i32.const 1)))
562 (i32.and (i32.eq (global.get $future-completed) (i32.const 1))
573 (canon future.new $FT (core func $future.new))
574 (canon future.write $FT async
575 (memory $libc "memory") (core func $future.write))
586 (export "future.new" (func $future.new))
587 (export "future.write" (func $future.write))
593 (export "run-reader-future" (func $run-reader-future))
644 (type $FT (future string))
646 (canon future.new $FT (core func $future.new))
647 (canon future.read $FT
648 (memory $libc "memory") (realloc (func $libc "realloc")) (core func $future.read))
658 (import "" "future.read" (func $future.read (param i32 i32) (result i32)))
665 ;; Set context[0] to 400, then read the future, which should call realloc and set
667 (func (export "run-future") (param $fr i32) (result i32)
671 (local.set $ret (call $future.read (local.get $fr) (i32.const 40)))
695 (export "future.read" (func $future.read))
701 (func (export "run-future") async (param "future" $FT) (result u32)
702 … (canon lift (core func $M "run-future") (memory $libc "memory") (realloc (func $libc "realloc"))