From 73888d442f01688262a59584617791d6242d760c Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Sat, 9 Mar 2019 00:59:04 +0100 Subject: [PATCH 01/13] Update compile.ml --- src/compile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile.ml b/src/compile.ml index 7a4c5423c2d..a87a2056875 100644 --- a/src/compile.ml +++ b/src/compile.ml @@ -2771,7 +2771,7 @@ module GC = struct (* Returns the new end of to_space *) (* Invariant: Must not be called on the same pointer twice. *) (* All pointers, including ptr_loc and space end markers, are skewed *) - let evacuate env = Func.share_code4 env "evaucate" (("begin_from_space", I32Type), ("begin_to_space", I32Type), ("end_to_space", I32Type), ("ptr_loc", I32Type)) [I32Type] (fun env get_begin_from_space get_begin_to_space get_end_to_space get_ptr_loc -> + let evacuate env = Func.share_code4 env "evacuate" (("begin_from_space", I32Type), ("begin_to_space", I32Type), ("end_to_space", I32Type), ("ptr_loc", I32Type)) [I32Type] (fun env get_begin_from_space get_begin_to_space get_end_to_space get_ptr_loc -> let (set_len, get_len) = new_local env "len" in let (set_new_ptr, get_new_ptr) = new_local env "new_ptr" in From d5fcc82db1e23e02ebb83fa9b69f7a592d8bd35d Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Sat, 9 Mar 2019 23:29:17 +0100 Subject: [PATCH 02/13] Update compile.ml --- src/compile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile.ml b/src/compile.ml index a87a2056875..76dbe0df58f 100644 --- a/src/compile.ml +++ b/src/compile.ml @@ -963,7 +963,7 @@ module Var = struct | Some (Deferred d) -> G.i Unreachable | None -> G.i Unreachable - (* Returns the payload (vanialla representation) *) + (* Returns the payload (vanilla representation) *) let get_val_vanilla env var = match E.lookup_var env var with | Some (Local i) -> G.i (LocalGet (nr i)) | Some (HeapInd (i, off)) -> G.i (LocalGet (nr i)) ^^ Heap.load_field off From f3436cf6daa0e7d6e47027796cf607b4fa6589d0 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Sun, 10 Mar 2019 00:04:56 +0100 Subject: [PATCH 03/13] Update compile.ml --- src/compile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile.ml b/src/compile.ml index 76dbe0df58f..b46f0052c8d 100644 --- a/src/compile.ml +++ b/src/compile.ml @@ -3749,7 +3749,7 @@ and compile_exp_unit (env : E.t) exp = (* The compilation of declarations (and patterns!) needs to handle mutual recursion. -This requires conceptually thre passes: +This requires conceptually three passes: 1. First we need to collect all names bound in a block, and find locations for then (which extends the environment). The environment is extended monotonously: The type-checker ensures that From b83fdb8db1392b71114b9e80d7eb0ac3d0196a92 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Sun, 10 Mar 2019 00:08:19 +0100 Subject: [PATCH 04/13] Update compile.ml --- src/compile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile.ml b/src/compile.ml index b46f0052c8d..4a4da667be7 100644 --- a/src/compile.ml +++ b/src/compile.ml @@ -3567,7 +3567,7 @@ and compile_exp (env : E.t) exp = (* The value here can come from many places -- the expression, or any of the nested returns. Hard to tell which is the best stack representation here. - So let’s go with Vanialla. *) + So let’s go with Vanilla. *) SR.Vanilla, G.block_ (StackRep.to_block_type env SR.Vanilla) ( G.with_current_depth (fun depth -> From 4ef8f5ad9e04ae22be004e54cfb13f0e9fcc97f3 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Sun, 10 Mar 2019 00:15:35 +0100 Subject: [PATCH 05/13] Update compile.ml --- src/compile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile.ml b/src/compile.ml index 4a4da667be7..da27de907a8 100644 --- a/src/compile.ml +++ b/src/compile.ml @@ -803,7 +803,7 @@ module BitTagged = struct This means we can store a small unboxed scalar x as (x << 2), and still tell it apart from a pointer. - We actually use the *second* lowest bit to tell apointer apart from a + We actually use the *second* lowest bit to tell a pointer apart from a scalar. It means that 0 and 1 are also recognized as non-pointers, and we can use From e031b5e4a2054c92ef813933cedf756001a57a39 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Sun, 10 Mar 2019 00:22:47 +0100 Subject: [PATCH 06/13] don't use "shifted" for pointers --- src/compile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile.ml b/src/compile.ml index da27de907a8..5e20f844e95 100644 --- a/src/compile.ml +++ b/src/compile.ml @@ -26,7 +26,7 @@ let (^^) = G.(^^) (* is this how we import a single operator from a module that let page_size = Int32.of_int (64*1024) (* -Pointers are shifted -1 relative to the actual offset. +Pointers are skewed (translated) -1 relative to the actual offset. See documentation of module BitTagged for more detail. *) let ptr_skew = -1l From b68bf2c98f65052126def27eba33c5eb44a53d09 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Sun, 10 Mar 2019 00:40:04 +0100 Subject: [PATCH 07/13] Update compile.ml --- src/compile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile.ml b/src/compile.ml index 5e20f844e95..e75773a0fad 100644 --- a/src/compile.ml +++ b/src/compile.ml @@ -2896,7 +2896,7 @@ module StackRep = struct open SR (* - Most expression have a “preferred”, most optimal, form. Hence, + Most expressions have a “preferred”, most optimal, form. Hence, compile_exp put them on the stack in that form, and also returns the form it chose. From 7d00f26f6794545b6171fc5c810e8230868f65d6 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Sun, 10 Mar 2019 00:47:00 +0100 Subject: [PATCH 08/13] fix grammar --- src/compile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile.ml b/src/compile.ml index e75773a0fad..e43bfe544a7 100644 --- a/src/compile.ml +++ b/src/compile.ml @@ -598,7 +598,7 @@ module Heap = struct let offset = Int32.(add (mul word_size i) ptr_unskew) in G.i (Store {ty = I32Type; align = 2; offset; sz = None}) - (* Although we occationally want to treat to of them as a 64 bit number *) + (* Although we occasionally want to treat them as 64 bit numbers *) let load_field64 (i : int32) : G.t = let offset = Int32.(add (mul word_size i) ptr_unskew) in From 3efc8557b9393c2e75292152be642d8ae95022e7 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Mon, 11 Mar 2019 20:22:34 +0100 Subject: [PATCH 09/13] Update compile.ml --- src/compile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile.ml b/src/compile.ml index e43bfe544a7..2293b70cbd7 100644 --- a/src/compile.ml +++ b/src/compile.ml @@ -2853,7 +2853,7 @@ module GC = struct evacuate env ^^ set_end_to_space in - (* Go through the roots, and evacaute them *) + (* Go through the roots, and evacuate them *) ClosureTable.get_counter ^^ from_0_to_n env (fun get_i -> evac ( get_i ^^ From c07e7e671ac71dbb304be9399342bc2e199396ad Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Mon, 11 Mar 2019 20:29:29 +0100 Subject: [PATCH 10/13] Update compile.ml --- src/compile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile.ml b/src/compile.ml index 2293b70cbd7..a3f9f265341 100644 --- a/src/compile.ml +++ b/src/compile.ml @@ -2844,7 +2844,7 @@ module GC = struct Heap.get_skewed_heap_ptr ^^ set_end_to_space ^^ - (* Common arguments for evalcuate *) + (* Common arguments for evacuate *) let evac get_ptr_loc = get_begin_from_space ^^ get_begin_to_space ^^ From c6c4703d0f9102b65d24d1d1d840c43d221f5807 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Mon, 11 Mar 2019 22:43:24 +0100 Subject: [PATCH 11/13] Update compile.ml --- src/compile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile.ml b/src/compile.ml index a3f9f265341..510879b8545 100644 --- a/src/compile.ml +++ b/src/compile.ml @@ -1015,7 +1015,7 @@ module Var = struct end (* Var *) module Opt = struct - (* The Option type. Not much intereting to see here *) + (* The Option type. Not much interesting to see here *) let payload_field = Tagged.header_size From eef87dd722ea3f51666301b390b2c645de47923b Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Mon, 11 Mar 2019 22:47:38 +0100 Subject: [PATCH 12/13] Update src/compile.ml --- src/compile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile.ml b/src/compile.ml index 510879b8545..16a6863f68b 100644 --- a/src/compile.ml +++ b/src/compile.ml @@ -598,7 +598,7 @@ module Heap = struct let offset = Int32.(add (mul word_size i) ptr_unskew) in G.i (Store {ty = I32Type; align = 2; offset; sz = None}) - (* Although we occasionally want to treat them as 64 bit numbers *) + (* Although we occasionally want to treat two 32 bit fields as one 64 bit number *) let load_field64 (i : int32) : G.t = let offset = Int32.(add (mul word_size i) ptr_unskew) in From 851212dd9f456f66c678a072d671d63fec9532d2 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Mon, 11 Mar 2019 23:11:18 +0100 Subject: [PATCH 13/13] Update compile.ml --- src/compile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile.ml b/src/compile.ml index 16a6863f68b..341afe2c617 100644 --- a/src/compile.ml +++ b/src/compile.ml @@ -2039,7 +2039,7 @@ module Dfinity = struct G.i Unreachable let default_exports env = - (* these export seems to be wanted by the hypervisor/v8 *) + (* these exports seem to be wanted by the hypervisor/v8 *) E.add_export env (nr { name = explode "mem"; edesc = nr (MemoryExport (nr 0l))