mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-18 09:21:35 +00:00
Integrate Buffer<T> experiment into Pointer<T>; Remove CArray
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
(module
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(type $iiiiv (func (param i32 i32 i32 i32)))
|
||||
(type $iifv (func (param i32 i32 f32)))
|
||||
(type $iif (func (param i32 i32) (result f32)))
|
||||
(type $v (func))
|
||||
(type $iv (func (param i32)))
|
||||
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
||||
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
||||
(global $std/pointer/one (mut i32) (i32.const 0))
|
||||
@ -10,17 +10,38 @@
|
||||
(global $std/pointer/add (mut i32) (i32.const 0))
|
||||
(global $std/pointer/sub (mut i32) (i32.const 0))
|
||||
(global $std/pointer/nextOne (mut i32) (i32.const 0))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $std/pointer/buf (mut i32) (i32.const 0))
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\0e\00\00\00s\00t\00d\00/\00p\00o\00i\00n\00t\00e\00r\00.\00t\00s")
|
||||
(export "memory" (memory $0))
|
||||
(export "_setargc" (func $~setargc))
|
||||
(export "Pointer<Entry>#constructor" (func $std/pointer/Pointer<Entry>#constructor|trampoline))
|
||||
(start $start)
|
||||
(func $std/pointer/Pointer<Entry>#constructor (; 1 ;) (; has Stack IR ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(get_local $0)
|
||||
)
|
||||
(func $start (; 2 ;) (; has Stack IR ;) (type $v)
|
||||
(func $std/pointer/Pointer<f32>#set (; 2 ;) (; has Stack IR ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32)
|
||||
(f32.store
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.shl
|
||||
(get_local $1)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
(get_local $2)
|
||||
)
|
||||
)
|
||||
(func $std/pointer/Pointer<f32>#get (; 3 ;) (; has Stack IR ;) (type $iif) (param $0 i32) (param $1 i32) (result f32)
|
||||
(f32.load
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.shl
|
||||
(get_local $1)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $start (; 4 ;) (; has Stack IR ;) (type $v)
|
||||
(set_global $std/pointer/one
|
||||
(call $std/pointer/Pointer<Entry>#constructor
|
||||
(i32.const 8)
|
||||
@ -40,7 +61,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 52)
|
||||
(i32.const 66)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -55,7 +76,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 53)
|
||||
(i32.const 67)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -80,7 +101,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 57)
|
||||
(i32.const 71)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -97,7 +118,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 58)
|
||||
(i32.const 72)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -118,7 +139,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 61)
|
||||
(i32.const 75)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -139,7 +160,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 64)
|
||||
(i32.const 78)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -154,7 +175,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 66)
|
||||
(i32.const 80)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -178,7 +199,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 68)
|
||||
(i32.const 82)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -193,7 +214,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 69)
|
||||
(i32.const 83)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -208,7 +229,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 71)
|
||||
(i32.const 85)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -235,7 +256,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 74)
|
||||
(i32.const 88)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -252,7 +273,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 75)
|
||||
(i32.const 89)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@ -269,34 +290,195 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 76)
|
||||
(i32.const 90)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $std/pointer/buf
|
||||
(call $std/pointer/Pointer<Entry>#constructor
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(call $std/pointer/Pointer<f32>#set
|
||||
(get_global $std/pointer/buf)
|
||||
(i32.const 0)
|
||||
(f32.const 1.100000023841858)
|
||||
)
|
||||
(call $std/pointer/Pointer<f32>#set
|
||||
(get_global $std/pointer/buf)
|
||||
(i32.const 1)
|
||||
(f32.const 1.2000000476837158)
|
||||
)
|
||||
(if
|
||||
(f32.ne
|
||||
(call $std/pointer/Pointer<f32>#get
|
||||
(get_global $std/pointer/buf)
|
||||
(i32.const 0)
|
||||
)
|
||||
(f32.const 1.100000023841858)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 96)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(f32.ne
|
||||
(call $std/pointer/Pointer<f32>#get
|
||||
(get_global $std/pointer/buf)
|
||||
(i32.const 1)
|
||||
)
|
||||
(f32.const 1.2000000476837158)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 97)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(f32.ne
|
||||
(f32.load
|
||||
(get_global $std/pointer/buf)
|
||||
)
|
||||
(f32.const 1.100000023841858)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 99)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(f32.ne
|
||||
(f32.load
|
||||
(i32.add
|
||||
(get_global $std/pointer/buf)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(f32.const 1.2000000476837158)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 100)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(f32.ne
|
||||
(f32.load
|
||||
(i32.const 0)
|
||||
)
|
||||
(f32.const 1.100000023841858)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 102)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(f32.ne
|
||||
(f32.load
|
||||
(i32.const 4)
|
||||
)
|
||||
(f32.const 1.2000000476837158)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 103)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(f32.store
|
||||
(i32.add
|
||||
(get_global $std/pointer/buf)
|
||||
(i32.const 8)
|
||||
)
|
||||
(f32.const 1.2999999523162842)
|
||||
)
|
||||
(if
|
||||
(f32.ne
|
||||
(call $std/pointer/Pointer<f32>#get
|
||||
(get_global $std/pointer/buf)
|
||||
(i32.const 2)
|
||||
)
|
||||
(f32.const 1.2999999523162842)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 106)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(f32.ne
|
||||
(f32.load
|
||||
(i32.add
|
||||
(get_global $std/pointer/buf)
|
||||
(i32.const 8)
|
||||
)
|
||||
)
|
||||
(f32.const 1.2999999523162842)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 107)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(f32.ne
|
||||
(f32.load
|
||||
(i32.const 8)
|
||||
)
|
||||
(f32.const 1.2999999523162842)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 108)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std/pointer/Pointer<Entry>#constructor|trampoline (; 3 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(block $1of1
|
||||
(block $0of1
|
||||
(block $outOfRange
|
||||
(br_table $0of1 $1of1 $outOfRange
|
||||
(get_global $~argc)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $1
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(call $std/pointer/Pointer<Entry>#constructor
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
(func $~setargc (; 4 ;) (; has Stack IR ;) (type $iv) (param $0 i32)
|
||||
(set_global $~argc
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user