Skip to content

Commit

Permalink
[wasm] wasm-gc based string type 1/n: starting stubs (#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamChou19815 authored Oct 19, 2024
1 parent 85bed5a commit 1a632db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-node@v4
with:
node-version: 22.x
- uses: oven-sh/setup-bun@v1
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
Expand Down
5 changes: 5 additions & 0 deletions crates/samlang-compiler/src/libsam.wat
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
(import "env" "memory" (memory $env.memory 2))
(import "builtins" "__Process$println" (func $__Process$println (param i32) (param i32) (result i32)))
(import "builtins" "__Process$panic" (func $__Process$panic (param i32) (param i32) (result i32)))
(type $__$Str (array (mut i8)))
(global $g0 (mut i32) (i32.const 66688))
(global $g1 (mut (ref null $__$Str)) (ref.null $__$Str))
(data $d0 (i32.const 1024) "0\00-2147483648\00\00\00\08\00\00\00\10\00\00\00\18\00\00\00 \00\00\00(\00\00\000\00\00\00@\00\00\00P\00\00\00\80\00\00\00\00\01\00\00")
(data $d1 (i32.const 1088) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
(func $__$getBuiltinString (param $offset i32) (param $size i32) (result (ref $__$Str))
(array.new_data $__$Str $d0 (local.get $offset) (local.get $size))
)
(func $__$malloc (param $p0 i32) (result i32)
(local $l1 i32) (local $l2 i32) (local $l3 i32) (local $l4 i32) (local $l5 i32) (local $l6 i32)
(local.set $l1 (i32.const 0))
Expand Down

0 comments on commit 1a632db

Please sign in to comment.