Remove the start decorator in favor of a command line option

This commit is contained in:
dcode
2019-06-05 18:52:04 +02:00
parent dfe04d08e4
commit eaea26b7ae
44 changed files with 3676 additions and 3228 deletions

View File

@ -1,6 +1,7 @@
{
"asc_flags": [
"--runtime full",
"--runtime half",
"--explicitStart",
"--use ASC_RTRACE=1"
]
}

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,6 @@
import { Array } from "array";
import { COMPARATOR } from "util/sort";
@start export function main(): void {}
// Obtains the internal capacity of an array from its backing buffer.
function internalCapacity<T>(array: Array<T>): i32 {
// the memory region used by the backing buffer might still be larger in that the ArrayBuffer

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
{
"asc_flags": [
"--runtime half",
"--explicitStart",
"--use ASC_RTRACE=1"
]
}

View File

@ -193,9 +193,9 @@
(global $~lib/util/number/_frc_pow (mut i64) (i64.const 0))
(global $~lib/util/number/_exp_pow (mut i32) (i32.const 0))
(global $~lib/started (mut i32) (i32.const 0))
(export "__start" (func $start))
(export "memory" (memory $0))
(export "getString" (func $std/string/getString))
(export "main" (func $std/string/main))
(func $~lib/string/String#get:length (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.const 16
@ -8925,14 +8925,15 @@
global.get $std/string/str
call $~lib/rt/pure/__retain
)
(func $std/string/main (; 75 ;) (type $FUNCSIG$v)
(func $start (; 75 ;) (type $FUNCSIG$v)
global.get $~lib/started
i32.eqz
if
call $start:std/string
return
else
i32.const 1
global.set $~lib/started
end
call $start:std/string
)
(func $~lib/rt/pure/markGray (; 76 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)

View File

@ -310,5 +310,3 @@ export function getString(): string {
// Unleak globals
__release(changetype<usize>(str));
@start export function main(): void {}

View File

@ -211,9 +211,9 @@
(global $~lib/started (mut i32) (i32.const 0))
(global $~lib/rt/__rtti_base i32 (i32.const 7032))
(global $~lib/heap/__heap_base i32 (i32.const 7100))
(export "__start" (func $start))
(export "memory" (memory $0))
(export "getString" (func $std/string/getString))
(export "main" (func $std/string/main))
(func $~lib/string/String#get:length (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.const 16
@ -12141,19 +12141,17 @@
global.get $std/string/str
call $~lib/rt/pure/__retain
)
(func $std/string/main (; 84 ;) (type $FUNCSIG$v)
(func $start (; 84 ;) (type $FUNCSIG$v)
global.get $~lib/started
i32.eqz
if
call $start
return
else
i32.const 1
global.set $~lib/started
end
)
(func $start (; 85 ;) (type $FUNCSIG$v)
call $start:std/string
)
(func $~lib/rt/pure/markGray (; 86 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/rt/pure/markGray (; 85 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
local.get $0
i32.load offset=4
@ -12180,7 +12178,7 @@
call $~lib/rt/__visit_members
end
)
(func $~lib/rt/pure/scanBlack (; 87 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/rt/pure/scanBlack (; 86 ;) (type $FUNCSIG$vi) (param $0 i32)
local.get $0
local.get $0
i32.load offset=4
@ -12197,7 +12195,7 @@
i32.const 4
call $~lib/rt/__visit_members
)
(func $~lib/rt/pure/scan (; 88 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/rt/pure/scan (; 87 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
local.get $0
i32.load offset=4
@ -12234,7 +12232,7 @@
end
end
)
(func $~lib/rt/pure/collectWhite (; 89 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/rt/pure/collectWhite (; 88 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
local.get $0
i32.load offset=4
@ -12272,7 +12270,7 @@
call $~lib/rt/tlsf/freeBlock
end
)
(func $~lib/rt/pure/__visit (; 90 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/rt/pure/__visit (; 89 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
local.get $0
@ -12426,7 +12424,7 @@
end
end
)
(func $~lib/array/Array<~lib/string/String>#__visit_impl (; 91 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/array/Array<~lib/string/String>#__visit_impl (; 90 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -12464,19 +12462,19 @@
end
end
)
(func $~lib/array/Array<i32>#__visit_impl (; 92 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/array/Array<i32>#__visit_impl (; 91 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
nop
)
(func $~lib/array/Array<u32>#__visit_impl (; 93 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/array/Array<u32>#__visit_impl (; 92 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
nop
)
(func $~lib/array/Array<u64>#__visit_impl (; 94 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/array/Array<u64>#__visit_impl (; 93 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
nop
)
(func $~lib/array/Array<i16>#__visit_impl (; 95 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/array/Array<i16>#__visit_impl (; 94 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
nop
)
(func $~lib/rt/__visit_members (; 96 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/rt/__visit_members (; 95 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
block $block$4$break
block
@ -12626,6 +12624,6 @@
end
unreachable
)
(func $null (; 97 ;) (type $FUNCSIG$v)
(func $null (; 96 ;) (type $FUNCSIG$v)
)
)

View File

@ -1,5 +1,6 @@
{
"asc_flags": [
"--runtime none"
"--runtime none",
"--explicitStart"
]
}

View File

@ -12,8 +12,8 @@
(data (i32.const 240) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00f\00i\00v\00e\00_\00i\00n\00t")
(data (i32.const 272) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00f\00i\00v\00e\00_\00d\00b\00l")
(global $~lib/started (mut i32) (i32.const 0))
(export "__start" (func $start))
(export "memory" (memory $0))
(export "main" (func $std/trace/main))
(func $start:std/trace (; 1 ;) (type $FUNCSIG$v)
i32.const 24
i32.const 0
@ -80,14 +80,15 @@
f64.const 5.5
call $~lib/builtins/trace
)
(func $std/trace/main (; 2 ;) (type $FUNCSIG$v)
(func $start (; 2 ;) (type $FUNCSIG$v)
global.get $~lib/started
i32.eqz
if
call $start:std/trace
return
else
i32.const 1
global.set $~lib/started
end
call $start:std/trace
)
(func $null (; 3 ;) (type $FUNCSIG$v)
nop

View File

@ -6,6 +6,3 @@ trace("three_int", 3, 1, 2, 3);
trace("four_int", 4, 1, 2, 3, 4);
trace("five_int", 5, 1, 2, 3, 4, 5);
trace("five_dbl", 5, 1.1, 2.2, 3.3, 4.4, 5.5);
@start
export function main(): void {}

View File

@ -14,8 +14,8 @@
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/started (mut i32) (i32.const 0))
(export "__start" (func $start))
(export "memory" (memory $0))
(export "main" (func $std/trace/main))
(func $start:std/trace (; 1 ;) (type $FUNCSIG$v)
i32.const 24
i32.const 0
@ -82,18 +82,16 @@
f64.const 5.5
call $~lib/builtins/trace
)
(func $std/trace/main (; 2 ;) (type $FUNCSIG$v)
(func $start (; 2 ;) (type $FUNCSIG$v)
global.get $~lib/started
i32.eqz
if
call $start
return
else
i32.const 1
global.set $~lib/started
end
)
(func $start (; 3 ;) (type $FUNCSIG$v)
call $start:std/trace
)
(func $null (; 4 ;) (type $FUNCSIG$v)
(func $null (; 3 ;) (type $FUNCSIG$v)
)
)

View File

@ -1,6 +1,7 @@
{
"asc_flags": [
"--runtime half",
"--explicitStart",
"--use ASC_RTRACE=1"
]
}

View File

@ -87,8 +87,8 @@
(global $std/typedarray/forEachValues i32 (i32.const 1112))
(global $std/typedarray/testArrayReverseValues i32 (i32.const 1480))
(global $~lib/started (mut i32) (i32.const 0))
(export "__start" (func $start))
(export "memory" (memory $0))
(export "main" (func $std/typedarray/main))
(func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
@ -15524,14 +15524,15 @@
global.get $std/typedarray/testArrayReverseValues
call $~lib/rt/pure/__release
)
(func $std/typedarray/main (; 285 ;) (type $FUNCSIG$v)
(func $start (; 285 ;) (type $FUNCSIG$v)
global.get $~lib/started
i32.eqz
if
call $start:std/typedarray
return
else
i32.const 1
global.set $~lib/started
end
call $start:std/typedarray
)
(func $~lib/rt/pure/markGray (; 286 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)

View File

@ -491,8 +491,6 @@ testArrayReverse<Uint64Array, u64>();
testArrayReverse<Float32Array, f32>();
testArrayReverse<Float64Array, f64>();
@start export function main(): void {}
// Unleak globals
__release(changetype<usize>(forEachValues));

View File

@ -104,8 +104,8 @@
(global $~lib/started (mut i32) (i32.const 0))
(global $~lib/rt/__rtti_base i32 (i32.const 1688))
(global $~lib/heap/__heap_base i32 (i32.const 1820))
(export "__start" (func $start))
(export "memory" (memory $0))
(export "main" (func $std/typedarray/main))
(func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
@ -23151,25 +23151,23 @@
global.get $std/typedarray/testArrayReverseValues
call $~lib/rt/pure/__release
)
(func $std/typedarray/main (; 393 ;) (type $FUNCSIG$v)
(func $start (; 393 ;) (type $FUNCSIG$v)
global.get $~lib/started
i32.eqz
if
call $start
return
else
i32.const 1
global.set $~lib/started
end
)
(func $start (; 394 ;) (type $FUNCSIG$v)
call $start:std/typedarray
)
(func $~lib/array/Array<i8>#__visit_impl (; 395 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/array/Array<i8>#__visit_impl (; 394 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
nop
)
(func $~lib/array/Array<i32>#__visit_impl (; 396 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/array/Array<i32>#__visit_impl (; 395 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
nop
)
(func $~lib/rt/pure/markGray (; 397 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/rt/pure/markGray (; 396 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
local.get $0
i32.load offset=4
@ -23196,7 +23194,7 @@
call $~lib/rt/__visit_members
end
)
(func $~lib/rt/pure/scanBlack (; 398 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/rt/pure/scanBlack (; 397 ;) (type $FUNCSIG$vi) (param $0 i32)
local.get $0
local.get $0
i32.load offset=4
@ -23213,7 +23211,7 @@
i32.const 4
call $~lib/rt/__visit_members
)
(func $~lib/rt/pure/scan (; 399 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/rt/pure/scan (; 398 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
local.get $0
i32.load offset=4
@ -23250,7 +23248,7 @@
end
end
)
(func $~lib/rt/pure/collectWhite (; 400 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/rt/pure/collectWhite (; 399 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
local.get $0
i32.load offset=4
@ -23288,7 +23286,7 @@
call $~lib/rt/tlsf/freeBlock
end
)
(func $~lib/rt/pure/__visit (; 401 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/rt/pure/__visit (; 400 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
local.get $0
@ -23442,7 +23440,7 @@
end
end
)
(func $~lib/rt/__visit_members (; 402 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/rt/__visit_members (; 401 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
block $block$4$break
block
@ -23538,6 +23536,6 @@
end
unreachable
)
(func $null (; 403 ;) (type $FUNCSIG$v)
(func $null (; 402 ;) (type $FUNCSIG$v)
)
)