Skip to content

Commit f9bb33f

Browse files
authored
Rename __start to _start (AssemblyScript#994)
1 parent 7c5e50e commit f9bb33f

27 files changed

+28
-28
lines changed

lib/loader/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ API
3030

3131
Besides demangling classes exported from your entry file to a handy object structure one can use like JS objects, instances are automatically populated with useful utility:
3232

33-
* **__start**(): `void`<br />
33+
* **_start**(): `void`<br />
3434
Explicit start function if the `--explicitStart` option is used. Must be called before any other exports if present.
3535

3636
* **__allocString**(str: `string`): `number`<br />

lib/loader/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface ASUtil {
1616
table?: WebAssembly.Table;
1717

1818
/** Explicit start function, if requested. */
19-
__start(): void;
19+
_start(): void;
2020
/** Allocates a new string in the module's memory and returns a reference (pointer) to it. */
2121
__allocString(str: string): number;
2222
/** Reads (copies) the value of a string from the module's memory. */

src/compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ export class Compiler extends DiagnosticEmitter {
404404
);
405405
startFunctionInstance.finalize(module, funcRef);
406406
if (!explicitStart) module.setStart(funcRef);
407-
else module.addFunctionExport(startFunctionInstance.internalName, "__start");
407+
else module.addFunctionExport(startFunctionInstance.internalName, "_start");
408408
}
409409

410410
// compile runtime features

tests/compiler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,9 @@ function testInstantiate(basename, binaryBuffer, name, glue) {
324324
}
325325
var instance = new WebAssembly.Instance(new WebAssembly.Module(binaryBuffer), imports);
326326
Object.setPrototypeOf(exports, instance.exports);
327-
if (exports.__start) {
327+
if (exports._start) {
328328
console.log(colorsUtil.white(" [start]"));
329-
exports.__start();
329+
exports._start();
330330
}
331331
if (glue.postInstantiate) {
332332
console.log(colorsUtil.white(" [postInstantiate]"));

tests/compiler/features/js-bigint-integration.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
(data (i32.const 16) "B\00\00\00\01\00\00\00\01\00\00\00B\00\00\00f\00e\00a\00t\00u\00r\00e\00s\00/\00j\00s\00-\00b\00i\00g\00i\00n\00t\00-\00i\00n\00t\00e\00g\00r\00a\00t\00i\00o\00n\00.\00t\00s")
1010
(global $features/js-bigint-integration/internalValue i64 (i64.const 9007199254740991))
1111
(global $~lib/started (mut i32) (i32.const 0))
12-
(export "__start" (func $start))
12+
(export "_start" (func $start))
1313
(export "memory" (memory $0))
1414
(export "internalValue" (global $features/js-bigint-integration/internalValue))
1515
(export "getInternalValue" (func $features/js-bigint-integration/getInternalValue))

tests/compiler/features/js-bigint-integration.untouched.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
(table $0 1 funcref)
1111
(global $features/js-bigint-integration/internalValue i64 (i64.const 9007199254740991))
1212
(global $~lib/started (mut i32) (i32.const 0))
13-
(export "__start" (func $start))
13+
(export "_start" (func $start))
1414
(export "memory" (memory $0))
1515
(export "internalValue" (global $features/js-bigint-integration/internalValue))
1616
(export "getInternalValue" (func $features/js-bigint-integration/getInternalValue))

tests/compiler/features/mutable-globals.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
(data (i32.const 16) "6\00\00\00\01\00\00\00\01\00\00\006\00\00\00f\00e\00a\00t\00u\00r\00e\00s\00/\00m\00u\00t\00a\00b\00l\00e\00-\00g\00l\00o\00b\00a\00l\00s\00.\00t\00s")
88
(global $features/mutable-globals/internal (mut i32) (i32.const 124))
99
(global $~lib/started (mut i32) (i32.const 0))
10-
(export "__start" (func $start))
10+
(export "_start" (func $start))
1111
(export "memory" (memory $0))
1212
(export "external" (global $features/mutable-globals/external))
1313
(export "internal" (global $features/mutable-globals/internal))

tests/compiler/features/mutable-globals.untouched.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
(table $0 1 funcref)
99
(global $features/mutable-globals/internal (mut i32) (i32.const 124))
1010
(global $~lib/started (mut i32) (i32.const 0))
11-
(export "__start" (func $start))
11+
(export "_start" (func $start))
1212
(export "memory" (memory $0))
1313
(export "external" (global $features/mutable-globals/external))
1414
(export "internal" (global $features/mutable-globals/internal))

tests/compiler/retain-release.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
(global $retain-release/TARGET (mut i32) (i32.const 0))
1818
(global $~lib/argc (mut i32) (i32.const 0))
1919
(global $~lib/started (mut i32) (i32.const 0))
20-
(export "__start" (func $start))
20+
(export "_start" (func $start))
2121
(export "memory" (memory $0))
2222
(export "returnRef" (func $retain-release/returnRef))
2323
(export "receiveRef" (func $retain-release/receiveRef))

tests/compiler/retain-release.untouched.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
(global $~lib/argc (mut i32) (i32.const 0))
1919
(global $~lib/started (mut i32) (i32.const 0))
2020
(global $~lib/heap/__heap_base i32 (i32.const 100))
21-
(export "__start" (func $start))
21+
(export "_start" (func $start))
2222
(export "memory" (memory $0))
2323
(export "returnRef" (func $retain-release/returnRef))
2424
(export "receiveRef" (func $retain-release/receiveRef))

tests/compiler/retain-return.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
(global $retain-return/ref (mut i32) (i32.const 0))
2424
(global $~lib/argc (mut i32) (i32.const 0))
2525
(global $~lib/started (mut i32) (i32.const 0))
26-
(export "__start" (func $start))
26+
(export "_start" (func $start))
2727
(export "memory" (memory $0))
2828
(func $~lib/rt/tlsf/removeBlock (; 1 ;) (param $0 i32) (param $1 i32)
2929
(local $2 i32)

tests/compiler/retain-return.untouched.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
(global $~lib/started (mut i32) (i32.const 0))
3737
(global $~lib/rt/__rtti_base i32 (i32.const 288))
3838
(global $~lib/heap/__heap_base i32 (i32.const 324))
39-
(export "__start" (func $start))
39+
(export "_start" (func $start))
4040
(export "memory" (memory $0))
4141
(func $~lib/rt/tlsf/removeBlock (; 1 ;) (param $0 i32) (param $1 i32)
4242
(local $2 i32)

tests/compiler/rt/instanceof.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
(global $rt/instanceof/nullableCat (mut i32) (i32.const 0))
1919
(global $rt/instanceof/nullableBlackcat (mut i32) (i32.const 0))
2020
(global $~lib/started (mut i32) (i32.const 0))
21-
(export "__start" (func $start))
21+
(export "_start" (func $start))
2222
(export "memory" (memory $0))
2323
(func $~lib/rt/stub/maybeGrowMemory (; 1 ;) (param $0 i32)
2424
(local $1 i32)

tests/compiler/rt/instanceof.untouched.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
(global $~lib/started (mut i32) (i32.const 0))
2424
(global $~lib/rt/__rtti_base i32 (i32.const 64))
2525
(global $~lib/heap/__heap_base i32 (i32.const 116))
26-
(export "__start" (func $start))
26+
(export "_start" (func $start))
2727
(export "memory" (memory $0))
2828
(func $~lib/rt/stub/maybeGrowMemory (; 1 ;) (param $0 i32)
2929
(local $1 i32)

tests/compiler/rt/stub-realloc.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
(global $rt/stub-realloc/newLastPtr (mut i32) (i32.const 0))
1818
(global $~lib/started (mut i32) (i32.const 0))
1919
(global $~lib/rt/__rtti_base i32 (i32.const 128))
20-
(export "__start" (func $start))
20+
(export "_start" (func $start))
2121
(export "memory" (memory $0))
2222
(export "__alloc" (func $~lib/rt/stub/__alloc))
2323
(export "__retain" (func $~lib/rt/stub/__retain))

tests/compiler/rt/stub-realloc.untouched.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
(global $~lib/started (mut i32) (i32.const 0))
2121
(global $~lib/rt/__rtti_base i32 (i32.const 128))
2222
(global $~lib/heap/__heap_base i32 (i32.const 156))
23-
(export "__start" (func $start))
23+
(export "_start" (func $start))
2424
(export "memory" (memory $0))
2525
(export "__alloc" (func $~lib/rt/stub/__alloc))
2626
(export "__retain" (func $~lib/rt/stub/__retain))

tests/compiler/std/array.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
(global $~lib/util/number/_frc_pow (mut i64) (i64.const 0))
243243
(global $~lib/util/number/_exp_pow (mut i32) (i32.const 0))
244244
(global $~lib/started (mut i32) (i32.const 0))
245-
(export "__start" (func $start))
245+
(export "_start" (func $start))
246246
(export "memory" (memory $0))
247247
(func $~lib/rt/tlsf/removeBlock (; 6 ;) (param $0 i32) (param $1 i32)
248248
(local $2 i32)

tests/compiler/std/array.untouched.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
(global $~lib/started (mut i32) (i32.const 0))
250250
(global $~lib/rt/__rtti_base i32 (i32.const 8896))
251251
(global $~lib/heap/__heap_base i32 (i32.const 9108))
252-
(export "__start" (func $start))
252+
(export "_start" (func $start))
253253
(export "memory" (memory $0))
254254
(func $~lib/rt/tlsf/removeBlock (; 6 ;) (param $0 i32) (param $1 i32)
255255
(local $2 i32)

tests/compiler/std/string.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@
504504
(global $~lib/util/number/_frc_pow (mut i64) (i64.const 0))
505505
(global $~lib/util/number/_exp_pow (mut i32) (i32.const 0))
506506
(global $~lib/started (mut i32) (i32.const 0))
507-
(export "__start" (func $start))
507+
(export "_start" (func $start))
508508
(export "memory" (memory $0))
509509
(export "getString" (func $std/string/getString))
510510
(func $~lib/rt/pure/increment (; 8 ;) (param $0 i32)

tests/compiler/std/string.untouched.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@
514514
(global $~lib/started (mut i32) (i32.const 0))
515515
(global $~lib/rt/__rtti_base i32 (i32.const 28320))
516516
(global $~lib/heap/__heap_base i32 (i32.const 28412))
517-
(export "__start" (func $start))
517+
(export "_start" (func $start))
518518
(export "memory" (memory $0))
519519
(export "getString" (func $std/string/getString))
520520
(func $~lib/rt/pure/increment (; 8 ;) (param $0 i32)

tests/compiler/std/trace.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
(data (i32.const 256) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00f\00i\00v\00e\00_\00i\00n\00t")
1313
(data (i32.const 288) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00f\00i\00v\00e\00_\00d\00b\00l")
1414
(global $~lib/started (mut i32) (i32.const 0))
15-
(export "__start" (func $start))
15+
(export "_start" (func $start))
1616
(export "memory" (memory $0))
1717
(func $start:std/trace (; 1 ;)
1818
i32.const 32

tests/compiler/std/trace.untouched.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
(data (i32.const 288) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00f\00i\00v\00e\00_\00d\00b\00l\00")
1414
(table $0 1 funcref)
1515
(global $~lib/started (mut i32) (i32.const 0))
16-
(export "__start" (func $start))
16+
(export "_start" (func $start))
1717
(export "memory" (memory $0))
1818
(func $start:std/trace (; 1 ;)
1919
i32.const 32

tests/compiler/std/typedarray.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@
214214
(global $~lib/util/number/_frc_pow (mut i64) (i64.const 0))
215215
(global $~lib/util/number/_exp_pow (mut i32) (i32.const 0))
216216
(global $~lib/started (mut i32) (i32.const 0))
217-
(export "__start" (func $start))
217+
(export "_start" (func $start))
218218
(export "memory" (memory $0))
219219
(func $~lib/rt/tlsf/removeBlock (; 6 ;) (param $0 i32) (param $1 i32)
220220
(local $2 i32)

tests/compiler/std/typedarray.untouched.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@
231231
(global $~lib/started (mut i32) (i32.const 0))
232232
(global $~lib/rt/__rtti_base i32 (i32.const 8016))
233233
(global $~lib/heap/__heap_base i32 (i32.const 8212))
234-
(export "__start" (func $start))
234+
(export "_start" (func $start))
235235
(export "memory" (memory $0))
236236
(func $~lib/rt/tlsf/removeBlock (; 6 ;) (param $0 i32) (param $1 i32)
237237
(local $2 i32)

tests/compiler/typeof.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
(global $~lib/rt/stub/offset (mut i32) (i32.const 0))
2121
(global $typeof/c (mut i32) (i32.const 0))
2222
(global $~lib/started (mut i32) (i32.const 0))
23-
(export "__start" (func $start))
23+
(export "_start" (func $start))
2424
(export "memory" (memory $0))
2525
(func $~lib/string/String#get:length (; 1 ;) (param $0 i32) (result i32)
2626
local.get $0

tests/compiler/typeof.untouched.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
(global $typeof/c (mut i32) (i32.const 0))
3232
(global $~lib/started (mut i32) (i32.const 0))
3333
(global $~lib/heap/__heap_base i32 (i32.const 292))
34-
(export "__start" (func $start))
34+
(export "_start" (func $start))
3535
(export "memory" (memory $0))
3636
(func $~lib/rt/stub/__retain (; 1 ;) (param $0 i32) (result i32)
3737
local.get $0

tests/runtime/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
})
2828
).then(result => {
2929
exports = result.instance.exports;
30-
if (exports.__start) exports.__start();
30+
if (exports._start) exports._start();
3131
U32 = new Uint32Array(exports.memory.buffer);
3232
var first = exports.__alloc(255);
3333
exports.__free(first);

0 commit comments

Comments
 (0)