Stabel

Check-in [e726f26c61]
Login
Overview
Comment:Fix regression in codegen due to a wrong available function id constant.
Timelines: family | ancestors | descendants | both | arrays
Files: files | file ages | folders
SHA3-256: e726f26c61952d22f207584153780cf4c9d5eab11b25bdf34f811de52d9cba4e
User & Date: robin.hansen on 2021-08-23 17:37:31
Other Links: branch diff | manifest | tags
Context
2021-08-24
17:21
Implement array-push. check-in: 72850142b1 user: robin.hansen tags: arrays
2021-08-23
17:37
Fix regression in codegen due to a wrong available function id constant. check-in: e726f26c61 user: robin.hansen tags: arrays
17:28
Added array integration test, and implemented two of the array built ins. check-in: df837b4584 user: robin.hansen tags: arrays
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified src/Stabel/Codegen/BaseModule.elm from [f7e03d54e9] to [71f9fe9cb0].

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
initialHeapPositionOffset : Int
initialHeapPositionOffset =
    stackPositionOffset + wasmPtrSize


firstAvailableFunctionId : Int
firstAvailableFunctionId =
    20



-- Bultin function names


allocFn : String







|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
initialHeapPositionOffset : Int
initialHeapPositionOffset =
    stackPositionOffset + wasmPtrSize


firstAvailableFunctionId : Int
firstAvailableFunctionId =
    List.length baseFunctions



-- Bultin function names


allocFn : String

Modified wasm_tests/array.test.js from [f7afc2c637] to [798d028502].

2
3
4
5
6
7
8
9
10
11
12
13
14

test('Simple literal', async () => {
    const wat = await compiler.toWat('main', `
        def: main
        : { 1 2 3 4 5 } array-length
    `);

    console.log(wat);

    const result = await compiler.run(wat, 'main');

    expect(result.stackElement()).toBe(2);
});







<
<


|

2
3
4
5
6
7
8


9
10
11
12

test('Simple literal', async () => {
    const wat = await compiler.toWat('main', `
        def: main
        : { 1 2 3 4 5 } array-length
    `);



    const result = await compiler.run(wat, 'main');

    expect(result.stackElement()).toBe(5);
});