Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a6a8008
Use wasm-interp in the test suite
nomeata Dec 15, 2018
218fc2f
Add test case for nary calls and returns
nomeata Dec 15, 2018
acef67f
Bump dev to allow n-ary function calls
nomeata Dec 15, 2018
61cbbe6
Merge remote-tracking branch 'origin/master' into HEAD
nomeata Dec 15, 2018
e55b821
Use n-ary return values
nomeata Dec 15, 2018
5a91b6f
N-ary expression refactor part 1
nomeata Dec 15, 2018
c4361c1
Compiler: Avoid tuple boxing even when returning from Blocks
nomeata Dec 15, 2018
02dc038
Optimize `let (x,y) = foo()` to avoid tuple
nomeata Dec 15, 2018
329ea1a
Nix tweaks
nomeata Dec 15, 2018
4e9b8ba
Further refactoring of stack representations in the compiler
nomeata Dec 17, 2018
aa7efd4
Use Vanilla StackRep around Label and Break
nomeata Dec 17, 2018
8783539
Copy Wasm.Ast and Wasm.Types into this repository
nomeata Dec 20, 2018
680ade7
Generate proper multi-value Wasm
nomeata Dec 20, 2018
6be25b1
Join the stack representations of the branches of an if
nomeata Dec 20, 2018
9ca47b9
New StackRep: UnboxedInt
nomeata Dec 20, 2018
1e74dc9
Less boxing around IsE
nomeata Dec 20, 2018
0f5b08e
Less boxing/unboxing around binary operations
nomeata Dec 20, 2018
08458d2
Less unboxing around binary relations
nomeata Dec 20, 2018
4f89398
Less unboxing around unary operations
nomeata Dec 20, 2018
f13e13e
Correctly drop scrutinee if compile_n_ary_pat encounters `WildP`
nomeata Dec 20, 2018
751f92e
Throw in some extra Unreachable
nomeata Dec 20, 2018
05e76b0
Delete more dead Wasm code in `instrList.optimize`.
nomeata Dec 20, 2018
16aee16
Remove Binary-Drop-eliminiation in `instrList.optimize`
nomeata Dec 20, 2018
81cc2c9
Get rid of `tmp` local in all functions
nomeata Dec 20, 2018
82cae9b
More systematic handling of source locations in the compiler
nomeata Dec 22, 2018
38d85fa
Merge branch 'master' into joachim/n-ary-return
nomeata Dec 22, 2018
f232d02
Resolve operator overloading in desugarer
nomeata Jan 2, 2019
8a0960b
Correctly implement == on Text
nomeata Jan 2, 2019
a431331
Numbers are now 64 bits!
nomeata Jan 2, 2019
0e465e6
Overloading of BinE: Use result type, not argument type
nomeata Jan 2, 2019
a5b2d13
Introduce a stack representation for (unboxed) references
nomeata Jan 2, 2019
c4d27a5
Pass `con_env` to desguar
nomeata Jan 2, 2019
0bdd494
Only do dynamic dispatch on `DotE` if the field could be that of an a…
nomeata Jan 2, 2019
025d3bc
Update dev (no particular reason)
nomeata Jan 2, 2019
d3af081
Add test case for #122
nomeata Jan 3, 2019
41830d0
Record type of overloaded operators
nomeata Jan 3, 2019
04933cc
Traps in `dvm` are now silent, as they should
nomeata Jan 3, 2019
45544b7
A simple test case for trap-on-array-out-of-bounds
nomeata Jan 3, 2019
429c7ad
Switch to multi-value fork of wasm-spec
nomeata Jan 8, 2019
878f2be
Switch back to using the AST from the wasm library
nomeata Jan 8, 2019
34bcf44
Revert "Use wasm-interp in the test suite"
nomeata Jan 8, 2019
45556f5
Merge branch 'master' of github.com:dfinity-lab/actorscript into joac…
nomeata Jan 8, 2019
ae7542f
Lots of new comments in compile.ml (and some mild code cleanup)
nomeata Jan 9, 2019
c95a5e6
Avoid building asc when invoking `nix-shell`
nomeata Jan 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "vendor/wasm-spec"]
path = vendor/wasm-spec
url = https://github.com/WebAssembly/spec/
url = https://github.com/WebAssembly/multi-value/
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pipeline {
steps {
sh 'git submodule update --init --recursive'
sh 'git clone --recursive git@github.com:dfinity-lab/dev nix/dev'
sh 'git -C nix/dev checkout f2bbb3d91ef87a037044ed3822a222a0654cd835'
sh 'git -C nix/dev checkout 268a453421fc345bf170435a264c03826b14999f'
sh 'git -C nix/dev submodule update --init --recursive'
}
}
Expand Down
4 changes: 3 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ rec {
"src/.*.mli"
"src/.*.mly"
"src/.*.mll"
"src/.*.mlpack"
"src/_tags"
"test/"
"test/node-test.js"
Expand Down Expand Up @@ -101,6 +102,7 @@ rec {
buildInputs =
[ native
ocaml_wasm
nixpkgs.wabt
nixpkgs.bash
nixpkgs.perl
] ++
Expand Down Expand Up @@ -149,7 +151,7 @@ rec {

buildInputs =
[ native-coverage
ocaml_wasm
nixpkgs.wabt
nixpkgs.bash
nixpkgs.perl
ocaml_bisect_ppx
Expand Down
6 changes: 3 additions & 3 deletions nix/ocaml-wasm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ stdenv.mkDerivation rec {
#src = ../vendor/wasm-spec;
src = fetchFromGitHub {
owner = "WebAssembly";
repo = "spec";
rev = "639bb02f851d9468bdae533457d40731156ef12a";
sha256 = "0vqkz428bkwpm0jdy717sfxvp9mh0ai9n849f3wq0vbiw0k6vzmk";
repo = "multi-value";
rev = "fa755dfe0c8ab3ec93636a092fc3dfbe8c8a232c";
sha256 = "0867nd4k2lypal7g2a7816wi5zs4kp4w2dv9dxan9vvn3wi19b5i";
};

buildInputs = [ ocaml findlib ocamlbuild ];
Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let default = import ./default.nix { inherit nixpkgs test-dvm; }; in
nixpkgs.mkShell {
buildInputs =
default.native.buildInputs ++
default.native_test.buildInputs ++
builtins.filter (i: i != default.native) default.native_test.buildInputs ++
[ nixpkgs.ncurses ];
}

2 changes: 1 addition & 1 deletion src/_tags
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<*>: coverage
<**/*>: coverage
10 changes: 6 additions & 4 deletions src/arrange.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ let ($$) head inner = Node (head, inner)
let rec exp e = match e.it with
| VarE i -> "VarE" $$ [id i]
| LitE l -> "LitE" $$ [lit !l]
| UnE (uo, e) -> "UnE" $$ [unop uo; exp e]
| BinE (e1, bo, e2) -> "BinE" $$ [exp e1; binop bo; exp e2]
| RelE (e1, ro, e2) -> "RelE" $$ [exp e1; relop ro; exp e2]
| UnE (ot, uo, e) -> "UnE" $$ [operator_type !ot; unop uo; exp e]
| BinE (ot, e1, bo, e2) -> "BinE" $$ [operator_type !ot; exp e1; binop bo; exp e2]
| RelE (ot, e1, ro, e2) -> "RelE" $$ [operator_type !ot; exp e1; relop ro; exp e2]
| TupE es -> "TupE" $$ List.map exp es
| ProjE (e, i) -> "ProjE" $$ [exp e; Atom (string_of_int i)]
| ObjE (s, i, efs) -> "ObjE" $$ [obj_sort s; id i] @ List.map exp_field efs
Expand Down Expand Up @@ -136,7 +136,9 @@ and exp_field (ef : exp_field)
= (string_of_name ef.it.name.it) $$ [id ef.it.id; exp ef.it.exp; mut ef.it.mut; priv ef.it.priv]

and inst t = typ t.it


and operator_type t = Atom (Type.string_of_typ t)

and typ t = match t.it with
| VarT (s, ts) -> "VarT" $$ [id s] @ List.map typ ts
| PrimT p -> "PrimT" $$ [Atom p]
Expand Down
9 changes: 5 additions & 4 deletions src/arrange_ir.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ let ($$) head inner = Node (head, inner)
let rec exp e = match e.it with
| VarE i -> "VarE" $$ [id i]
| LitE l -> "LitE" $$ [Arrange.lit l]
| UnE (uo, e) -> "UnE" $$ [Arrange.unop uo; exp e]
| BinE (e1, bo, e2) -> "BinE" $$ [exp e1; Arrange.binop bo; exp e2]
| RelE (e1, ro, e2) -> "RelE" $$ [exp e1; Arrange.relop ro; exp e2]
| UnE (t, uo, e) -> "UnE" $$ [typ t; Arrange.unop uo; exp e]
| BinE (t, e1, bo, e2)-> "BinE" $$ [typ t; exp e1; Arrange.binop bo; exp e2]
| RelE (t, e1, ro, e2)-> "RelE" $$ [typ t; exp e1; Arrange.relop ro; exp e2]
| TupE es -> "TupE" $$ List.map exp es
| ProjE (e, i) -> "ProjE" $$ [exp e; Atom (string_of_int i)]
| ActorE (i, efs) -> "ActorE" $$ [id i] @ List.map exp_field efs
| DotE (e, n) -> "DotE" $$ [exp e; name n]
| ActorDotE (e, n) -> "ActorDotE" $$ [exp e; name n]
| AssignE (e1, e2) -> "AssignE" $$ [exp e1; exp e2]
| ArrayE (m, es) -> "ArrayE" $$ [Arrange.mut m] @ List.map exp es
| IdxE (e1, e2) -> "IdxE" $$ [exp e1; exp e2]
Expand Down Expand Up @@ -50,7 +51,7 @@ and pat p = match p.it with

and case c = "case" $$ [pat c.it.pat; exp c.it.exp]

and prim p = Atom (Type.string_of_prim p)
and typ t = Atom (Type.string_of_typ t)

and exp_field (ef : exp_field)
= (Syntax.string_of_name ef.it.name.it) $$ [id ef.it.id; exp ef.it.exp; Arrange.mut ef.it.mut; Arrange.priv ef.it.priv]
Expand Down
18 changes: 12 additions & 6 deletions src/async.ml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ let rec t_typ (t:T.typ) =
and t_bind {var; bound} =
{var; bound = t_typ bound}

and t_operator_type ot =
(* We recreate the reference here. That is ok, because it
we run after type inference. Once we move async past desugaring,
it will be a pure value anyways. *)
ref (t_typ !ot)

and t_field {name; typ} =
{name; typ = t_typ typ}
let rec t_exp (exp:Syntax.exp) =
Expand All @@ -214,12 +220,12 @@ and t_exp' (exp:Syntax.exp) =
| PrimE _
| LitE _ -> exp'
| VarE id -> exp'
| UnE (op, exp1) ->
UnE (op, t_exp exp1)
| BinE (exp1, op, exp2) ->
BinE (t_exp exp1, op, t_exp exp2)
| RelE (exp1, op, exp2) ->
RelE (t_exp exp1, op, t_exp exp2)
| UnE (ot, op, exp1) ->
UnE (t_operator_type ot, op, t_exp exp1)
| BinE (ot, exp1, op, exp2) ->
BinE (t_operator_type ot, t_exp exp1, op, t_exp exp2)
| RelE (ot, exp1, op, exp2) ->
RelE (t_operator_type ot, t_exp exp1, op, t_exp exp2)
| TupE exps ->
TupE (List.map t_exp exps)
| OptE exp1 ->
Expand Down
24 changes: 12 additions & 12 deletions src/awaitopt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ and t_exp' context exp' =
| PrimE _
| VarE _
| LitE _ -> exp'
| UnE (op, exp1) ->
UnE (op, t_exp context exp1)
| BinE (exp1, op, exp2) ->
BinE (t_exp context exp1, op, t_exp context exp2)
| RelE (exp1, op, exp2) ->
RelE (t_exp context exp1, op, t_exp context exp2)
| UnE (ot, op, exp1) ->
UnE (ot, op, t_exp context exp1)
| BinE (ot, exp1, op, exp2) ->
BinE (ot, t_exp context exp1, op, t_exp context exp2)
| RelE (ot, exp1, op, exp2) ->
RelE (ot, t_exp context exp1, op, t_exp context exp2)
| TupE exps ->
TupE (List.map (t_exp context) exps)
| OptE exp1 ->
Expand Down Expand Up @@ -393,12 +393,12 @@ and c_exp' context exp k =
| VarE _
| LitE _ ->
assert false
| UnE (op, exp1) ->
unary context k (fun v1 -> e (UnE(op, v1))) exp1
| BinE (exp1, op, exp2) ->
binary context k (fun v1 v2 -> e (BinE (v1, op, v2))) exp1 exp2
| RelE (exp1, op, exp2) ->
binary context k (fun v1 v2 -> e (RelE (v1, op, v2))) exp1 exp2
| UnE (ot, op, exp1) ->
unary context k (fun v1 -> e (UnE (ot, op, v1))) exp1
| BinE (ot, exp1, op, exp2) ->
binary context k (fun v1 v2 -> e (BinE (ot, v1, op, v2))) exp1 exp2
| RelE (ot, exp1, op, exp2) ->
binary context k (fun v1 v2 -> e (RelE (ot, v1, op, v2))) exp1 exp2
| TupE exps ->
nary context k (fun vs -> e (TupE vs)) exps
| OptE exp1 ->
Expand Down
Loading