From a3a53beeabe2e310fbbdb2d6d22aded0f36b45a2 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Tue, 2 Apr 2024 16:31:37 +0200 Subject: [PATCH 1/9] [spec] Fix typo --- document/core/valid/instructions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/document/core/valid/instructions.rst b/document/core/valid/instructions.rst index 43dfe9abfb..44bd241912 100644 --- a/document/core/valid/instructions.rst +++ b/document/core/valid/instructions.rst @@ -408,7 +408,7 @@ The following auxiliary function denotes the number of lanes in a vector shape, \frac{ \laneidx < \dim(\shape) }{ - C \vdashinstr t\K{x}N\K{.}\EXTRACTLANE\K{\_}\sx^?~\laneidx : [\V128] \to [\unpacked(\shape)] + C \vdashinstr \shape\K{.}\EXTRACTLANE\K{\_}\sx^?~\laneidx : [\V128] \to [\unpacked(\shape)] } From 2ee3c46df9db27ad934882f22ad9f532e8c8deda Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Tue, 2 Apr 2024 16:55:35 +0200 Subject: [PATCH 2/9] [spec] Fix refs field in context in appendix (#1741) --- document/core/appendix/properties.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/document/core/appendix/properties.rst b/document/core/appendix/properties.rst index c42a85a54b..36bc6f8020 100644 --- a/document/core/appendix/properties.rst +++ b/document/core/appendix/properties.rst @@ -362,10 +362,14 @@ Module instances are classified by *module contexts*, which are regular :ref:`co * Let :math:`\reftype^\ast` be the concatenation of all :math:`\reftype_i` in order. +* Let :math:`m` be the length of :math:`\moduleinst.\MIFUNCS`. + * Let :math:`n` be the length of :math:`\moduleinst.\MIDATAS`. +* Let :math:`x^\ast` be the sequence of :ref:`function indices ` from :math:`0` to :math:`m-1`. + * Then the module instance is valid with :ref:`context ` - :math:`\{\CTYPES~\functype^\ast,` :math:`\CFUNCS~{\functype'}^\ast,` :math:`\CTABLES~\tabletype^\ast,` :math:`\CMEMS~\memtype^\ast,` :math:`\CGLOBALS~\globaltype^\ast,` :math:`\CELEMS~\reftype^\ast,` :math:`\CDATAS~{\ok}^n\}`. + :math:`\{\CTYPES~\functype^\ast,` :math:`\CFUNCS~{\functype'}^\ast,` :math:`\CTABLES~\tabletype^\ast,` :math:`\CMEMS~\memtype^\ast,` :math:`\CGLOBALS~\globaltype^\ast,` :math:`\CELEMS~\reftype^\ast,` :math:`\CDATAS~{\ok}^n,` :math:`\CREFS~x^\ast\}`. .. math:: ~\\[-1ex] @@ -407,7 +411,8 @@ Module instances are classified by *module contexts*, which are regular :ref:`co \CMEMS & \memtype^\ast, \\ \CGLOBALS & \globaltype^\ast, \\ \CELEMS & \reftype^\ast, \\ - \CDATAS & {\ok}^n ~\} + \CDATAS & {\ok}^n, \\ + \CREFS & 0 \dots (|\funcaddr^\ast|-1) ~\} \end{array} \end{array} } From cd770402008fcb56b68f5be911848f3c6dd15bd3 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Wed, 3 Apr 2024 09:03:23 +0200 Subject: [PATCH 3/9] [spec] Typo --- document/core/exec/instructions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/document/core/exec/instructions.rst b/document/core/exec/instructions.rst index 4e926b5ce8..b03b600bfc 100644 --- a/document/core/exec/instructions.rst +++ b/document/core/exec/instructions.rst @@ -557,7 +557,7 @@ Most other vector instructions are defined in terms of numeric operators that ar .. math:: \begin{array}{lcl@{\qquad}l} - (\V128\K{.}\VCONST~c_1)~\V128\K{.}\vunop &\stepto& (\V128\K{.}\VCONST~c) + (\V128\K{.}\VCONST~c_1)~\shape\K{.}\vunop &\stepto& (\V128\K{.}\VCONST~c) & (\iff c = \vunop_{\shape}(c_1)) \end{array} From bc76fd79cfe61033d7f4ad4a7e8fc4f996dc5ba8 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Wed, 3 Apr 2024 03:34:03 -0700 Subject: [PATCH 4/9] [js-api] Integrate with the ResizableArrayBuffer proposal (#1300) Co-authored-by: Ioanna M. Dimitriou H Co-authored-by: Ms2ger --- document/js-api/index.bs | 110 ++++++++++++++++++++++++++++++++++----- 1 file changed, 98 insertions(+), 12 deletions(-) diff --git a/document/js-api/index.bs b/document/js-api/index.bs index 541fe51ed7..de3419cff6 100644 --- a/document/js-api/index.bs +++ b/document/js-api/index.bs @@ -45,6 +45,7 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT text: NativeError Object Structure; url: sec-nativeerror-object-structure text: 𝔽; url: #𝔽 text: ℤ; url: #ℤ + text: SameValue; url: sec-samevalue urlPrefix: https://webassembly.github.io/spec/core/; spec: WebAssembly; type: dfn url: valid/modules.html#valid-module text: valid @@ -102,6 +103,7 @@ urlPrefix: https://webassembly.github.io/spec/core/; spec: WebAssembly; type: df text: memory address; url: exec/runtime.html#syntax-memaddr text: global address; url: exec/runtime.html#syntax-globaladdr text: extern address; url: exec/runtime.html#syntax-externaddr + text: page size; url: exec/runtime.html#page-size url: syntax/types.html#syntax-numtype text: i32 text: i64 @@ -148,6 +150,11 @@ urlPrefix: https://webassembly.github.io/spec/core/; spec: WebAssembly; type: df urlPrefix: https://heycam.github.io/webidl/; spec: WebIDL type: dfn text: create a namespace object; url: create-a-namespace-object +urlPrefix: https://tc39.es/proposal-resizablearraybuffer/; spec: ResizableArrayBuffer proposal + type: dfn + text: handled; url: sec-hostresizearraybuffer + text: IsFixedLengthArrayBuffer; url: sec-isfixedarraybuffer + text: HostResizeArrayBuffer; url: sec-hostresizearraybuffer @@ -598,10 +607,27 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each * \[[BufferObject]] : an {{ArrayBuffer}} whose [=Data Block=] is [=identified with=] the above memory address
- To create a memory buffer from a [=memory address=] |memaddr|, perform the following steps: + To create a fixed length memory buffer from a [=memory address=] |memaddr|, perform the following steps: + + 1. Let |block| be a [=Data Block=] which is [=identified with=] the underlying memory of |memaddr|. + 1. Let |buffer| be a new {{ArrayBuffer}} with the internal slots \[[ArrayBufferData]], \[[ArrayBufferByteLength]], and \[[ArrayBufferDetachKey]]. + 1. Set |buffer|.\[[ArrayBufferData]] to |block|. + 1. Set |buffer|.\[[ArrayBufferByteLength]] to the length of |block|. + 1. Set |buffer|.\[[ArrayBufferDetachKey]] to "WebAssembly.Memory". + 1. Return |buffer|. +
+ +
+ To create a resizable memory buffer from a [=memory address=] |memaddr| and a |maxsize|, perform the following steps: 1. Let |block| be a [=Data Block=] which is [=identified with=] the underlying memory of |memaddr|. - 1. Let |buffer| be a new {{ArrayBuffer}} whose \[[ArrayBufferData]] is |block| and \[[ArrayBufferByteLength]] is set to the length of |block|. + 1. Let |length| be the length of |block|. + 1. If |maxsize| > (65536 × 65536), + 1. Throw a {{RangeError}} exception. + 1. Let |buffer| be a new {{ArrayBuffer}} with the internal slots \[[ArrayBufferData]], \[[ArrayBufferByteLength]], \[[ArrayBufferMaxByteLength]], and \[[ArrayBufferDetachKey]]. + 1. Set |buffer|.\[[ArrayBufferData]] to |block|. + 1. Set |buffer|.\[[ArrayBufferByteLength]] to |length|. + 1. Set |buffer|.\[[ArrayBufferMaxByteLength]] is |maxsize|. 1. Set |buffer|.\[[ArrayBufferDetachKey]] to "WebAssembly.Memory". 1. Return |buffer|.
@@ -610,7 +636,7 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each To initialize a memory object |memory| from a [=memory address=] |memaddr|, perform the following steps: 1. Let |map| be the [=surrounding agent=]'s associated [=Memory object cache=]. 1. Assert: |map|[|memaddr|] doesn't [=map/exist=]. - 1. Let |buffer| be the result of [=create a memory buffer|creating a memory buffer=] from |memaddr|. + 1. Let |buffer| be the result of [=create a fixed length memory buffer|creating a fixed length memory buffer=] from |memaddr|. 1. Set |memory|.\[[Memory]] to |memaddr|. 1. Set |memory|.\[[BufferObject]] to |buffer|. 1. [=map/Set=] |map|[|memaddr|] to |memory|. @@ -640,28 +666,40 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each
- To reset the Memory buffer of |memaddr|, perform the following steps: + To refresh the Memory buffer of |memaddr|, perform the following steps: 1. Let |map| be the [=surrounding agent=]'s associated [=Memory object cache=]. 1. Assert: |map|[|memaddr|] [=map/exists=]. 1. Let |memory| be |map|[|memaddr|]. - 1. Perform [=!=] [$DetachArrayBuffer$](|memory|.\[[BufferObject]], "WebAssembly.Memory"). - 1. Let |buffer| be the result of [=create a memory buffer|creating a memory buffer=] from |memaddr|. - 1. Set |memory|.\[[BufferObject]] to |buffer|. + 1. Let |buffer| be |memory|.\[[BufferObject]]. + 1. If [=IsFixedLengthArrayBuffer=](|buffer|) is true, + 1. Perform [=!=] [$DetachArrayBuffer$](|buffer|, "WebAssembly.Memory"). + 1. Let |buffer| be the result of [=create a fixed length memory buffer|creating a fixed length memory buffer=] from |memaddr|. + 1. Set |memory|.\[[BufferObject]] to |buffer|. + 1. Otherwise, + 1. Let |block| be a [=Data Block=] which is [=identified with=] the underlying memory of |memaddr|. + 1. Set |buffer|.\[[ArrayBufferData]] to |block|. + 1. Set |buffer|.\[[ArrayBufferByteLength]] to the length of |block|.
-
- The grow(|delta|) method, when invoked, performs the following steps: +
+ To grow the memory buffer associated with a [=memory address=] |memaddr| by |delta|, perform the following steps: + 1. Let |store| be the [=surrounding agent=]'s [=associated store=]. - 1. Let |memaddr| be **this**.\[[Memory]]. 1. Let |ret| be the [=mem_size=](|store|, |memaddr|). 1. Let |store| be [=mem_grow=](|store|, |memaddr|, |delta|). 1. If |store| is [=error=], throw a {{RangeError}} exception. 1. Set the [=surrounding agent=]'s [=associated store=] to |store|. - 1. [=Reset the memory buffer=] of |memaddr|. + 1. [=Refresh the memory buffer=] of |memaddr|. 1. Return |ret|.
+
+ The grow(|delta|) method, when invoked, performs the following steps: + 1. Let |memaddr| be **this**.\[[Memory]]. + 1. Return the result of [=grow the memory buffer|growing the memory buffer=] associated with |memaddr| by |delta|. +
+ Immediately after a WebAssembly [=memory.grow=] instruction executes, perform the following steps:
@@ -669,7 +707,55 @@ Immediately after a WebAssembly [=memory.grow=] instruction executes, perform th 1. Let |frame| be the [=current frame=]. 1. Assert: due to validation, |frame|.[=frame/module=].[=moduleinst/memaddrs=][0] exists. 1. Let |memaddr| be the memory address |frame|.[=frame/module=].[=moduleinst/memaddrs=][0]. - 1. [=Reset the memory buffer=] of |memaddr|. + 1. [=Refresh the memory buffer=] of |memaddr|. +
+ +
+ The toFixedLengthBuffer() method, when invoked, performs the following steps: + 1. Let |buffer| be **this**.\[[BufferObject]]. + 1. If [=IsFixedLengthArrayBuffer=](|buffer|) is true, return |buffer|. + 1. Let |memaddr| be **this**.\[[Memory]]. + 1. Let |fixedBuffer| be the result of [=create a fixed length memory buffer|creating a fixed length memory buffer=] from |memaddr|. + 1. Perform [=!=] [$DetachArrayBuffer$](|buffer|, "WebAssembly.Memory"). + 1. Set **this**.\[[BufferObject]] to |fixedBuffer|. + 1. Return |fixedBuffer|. +
+ +
+ The toResizableBuffer() method, when invoked, performs the following steps: + 1. Let |buffer| be **this**.\[[BufferObject]]. + 1. If [=IsFixedLengthArrayBuffer=](|buffer|) is false, return |buffer|. + 1. Let |memaddr| be **this**.\[[Memory]]. + 1. Let |store| be the [=surrounding agent=]'s [=associated store=]. + 1. Let |memtype| be [=mem_type=](|store|, |memaddr|). + 1. If |memtype| has a max, + 1. Let |maxsize| be the max value in |memtype|. + 1. Otherwise, + 1. Let |maxsize| be 65536 × 65536. + 1. Let |resizableBuffer| be the result of [=create a resizable memory buffer|creating a resizable memory buffer=] from |memaddr| and |maxsize|. + 1. Perform [=!=] [$DetachArrayBuffer$](|buffer|, "WebAssembly.Memory"). + 1. Set **this**.\[[BufferObject]] to |resizableBuffer|. + 1. Return |resizableBuffer|. +
+ +{{ArrayBuffer}} objects returned by a {{Memory}} object must have a size that is a multiple of a WebAssembly [=page size=] (the constant 65536). For this reason [=HostResizeArrayBuffer=] is redefined as follows. + +
+ The abstract operation [=HostResizeArrayBuffer=] takes arguments |buffer| (an {{ArrayBuffer}}) and |newLength|. It performs the following steps when called. + + 1. If |buffer|.\[[ArrayBufferDetachKey]] is "WebAssembly.Memory", + 1. Let |map| be the [=surrounding agent=]'s associated [=Memory object cache=]. + 1. Assert: |buffer| is the \[[BufferObject]] of exactly one value in |map|. + 1. [=map/iterate|For each=] |memaddr| → |mem| in |map|, + 1. If [=SameValue=](|mem|.\[[BufferObject]], |buffer|) is true, + 1. Assert: |buffer|.\[[ArrayBufferByteLength]] modulo 65536 is 0. + 1. Let |lengthDelta| be |newLength| - |buffer|.\[[ArrayBufferByteLength]]. + 1. If |lengthDelta| < 0 or |lengthDelta| modulo 65536 is not 0, + 1. Throw a {{RangeError}} exception. + 1. Let |delta| be |lengthDelta| ÷ 65536. + 1. [=Grow the memory buffer=] associated with |memaddr| by |delta|. + 1. Return handled. + 1. Otherwise, return unhandled.
From 908640a9eb408c6eeae7d54c6b17599b8225ae0f Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Wed, 10 Apr 2024 13:39:18 +0200 Subject: [PATCH 5/9] [interpreter] Remove bogus position transformation --- interpreter/text/parse.ml | 2 -- 1 file changed, 2 deletions(-) diff --git a/interpreter/text/parse.ml b/interpreter/text/parse.ml index 14da6079ac..0932b463f6 100644 --- a/interpreter/text/parse.ml +++ b/interpreter/text/parse.ml @@ -31,8 +31,6 @@ let make (type a) (start : _ -> _ -> a) : (module S with type t = a) = with | Parser.Error -> raise (Syntax (convert_pos buf, "unexpected token")) - | Syntax (region, s) when region <> Source.no_region -> - raise (Syntax (convert_pos buf, s)) let parse_string s = parse "string" (Lexing.from_string ~with_positions:true s) From 2bd0759fc44cbd0c02c9f8d7ba2508c5de5ef985 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Wed, 10 Apr 2024 14:47:36 +0200 Subject: [PATCH 6/9] [interpreter] Simplify lexer invocation --- interpreter/text/parse.ml | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/interpreter/text/parse.ml b/interpreter/text/parse.ml index 0932b463f6..94e5d55495 100644 --- a/interpreter/text/parse.ml +++ b/interpreter/text/parse.ml @@ -9,28 +9,19 @@ sig val parse_channel : in_channel -> t end -let provider buf () = - let tok = Lexer.token buf in - let start = Lexing.lexeme_start_p buf in - let stop = Lexing.lexeme_end_p buf in - tok, start, stop - -let convert_pos buf = - { Source.left = Lexer.convert_pos buf.Lexing.lex_start_p; - Source.right = Lexer.convert_pos buf.Lexing.lex_curr_p +let convert_pos lexbuf = + { Source.left = Lexer.convert_pos lexbuf.Lexing.lex_start_p; + Source.right = Lexer.convert_pos lexbuf.Lexing.lex_curr_p } let make (type a) (start : _ -> _ -> a) : (module S with type t = a) = (module struct type t = a - let parse name buf = - Lexing.set_filename buf name; - try - MenhirLib.Convert.Simplified.traditional2revised start (provider buf) - with - | Parser.Error -> - raise (Syntax (convert_pos buf, "unexpected token")) + let parse name lexbuf = + Lexing.set_filename lexbuf name; + try start Lexer.token lexbuf with Parser.Error -> + raise (Syntax (convert_pos lexbuf, "unexpected token")) let parse_string s = parse "string" (Lexing.from_string ~with_positions:true s) From 9e9db5cf474a517594ebfbb612f49a0b7bb61677 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Wed, 10 Apr 2024 16:42:55 +0200 Subject: [PATCH 7/9] [spec] Fix module context for constants (#1712) --- document/core/valid/modules.rst | 42 ++++++++++++--------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/document/core/valid/modules.rst b/document/core/valid/modules.rst index 59a2fffed2..257c371be7 100644 --- a/document/core/valid/modules.rst +++ b/document/core/valid/modules.rst @@ -536,22 +536,27 @@ Instead, the context :math:`C` for validation of the module's content is constru * :math:`C.\CREFS` is the set :math:`\freefuncidx(\module \with \MFUNCS = \epsilon \with \MSTART = \epsilon)`, i.e., the set of :ref:`function indices ` occurring in the module, except in its :ref:`functions ` or :ref:`start function `. -* Let :math:`C'` be the :ref:`context ` where: +* Let :math:`C'` be the same :ref:`context ` as :math:`C`, except that :math:`C'.\CGLOBALS` is just the sequence :math:`\etglobals(\X{it}^\ast)`. - * :math:`C'.\CGLOBALS` is the sequence :math:`\etglobals(\X{it}^\ast)`, +* For each :math:`\functype_i` in :math:`\module.\MTYPES`, + the :ref:`function type ` :math:`\functype_i` must be :ref:`valid `. - * :math:`C'.\CFUNCS` is the same as :math:`C.\CFUNCS`, +* Under the context :math:`C'`: - * :math:`C'.\CTABLES` is the same as :math:`C.\CTABLES`, + * For each :math:`\table_i` in :math:`\module.\MTABLES`, + the definition :math:`\table_i` must be :ref:`valid ` with a :ref:`table type ` :math:`\X{tt}_i`. - * :math:`C'.\CMEMS` is the same as :math:`C.\CMEMS`, + * For each :math:`\mem_i` in :math:`\module.\MMEMS`, + the definition :math:`\mem_i` must be :ref:`valid ` with a :ref:`memory type ` :math:`\X{mt}_i`. - * :math:`C'.\CREFS` is the same as :math:`C.\CREFS`, + * For each :math:`\global_i` in :math:`\module.\MGLOBALS`, + the definition :math:`\global_i` must be :ref:`valid ` with a :ref:`global type ` :math:`\X{gt}_i`. - * all other fields are empty. + * For each :math:`\elem_i` in :math:`\module.\MELEMS`, + the segment :math:`\elem_i` must be :ref:`valid ` with :ref:`reference type ` :math:`\X{rt}_i`. -* For each :math:`\functype_i` in :math:`\module.\MTYPES`, - the :ref:`function type ` :math:`\functype_i` must be :ref:`valid `. + * For each :math:`\data_i` in :math:`\module.\MDATAS`, + the segment :math:`\data_i` must be :ref:`valid `. * Under the context :math:`C`: @@ -567,23 +572,6 @@ Instead, the context :math:`C` for validation of the module's content is constru * For each :math:`\export_i` in :math:`\module.\MEXPORTS`, the segment :math:`\export_i` must be :ref:`valid ` with :ref:`external type ` :math:`\X{et}_i`. -* Under the context :math:`C'`: - - * For each :math:`\table_i` in :math:`\module.\MTABLES`, - the definition :math:`\table_i` must be :ref:`valid ` with a :ref:`table type ` :math:`\X{tt}_i`. - - * For each :math:`\mem_i` in :math:`\module.\MMEMS`, - the definition :math:`\mem_i` must be :ref:`valid ` with a :ref:`memory type ` :math:`\X{mt}_i`. - - * For each :math:`\global_i` in :math:`\module.\MGLOBALS`, - the definition :math:`\global_i` must be :ref:`valid ` with a :ref:`global type ` :math:`\X{gt}_i`. - - * For each :math:`\elem_i` in :math:`\module.\MELEMS`, - the segment :math:`\elem_i` must be :ref:`valid ` with :ref:`reference type ` :math:`\X{rt}_i`. - - * For each :math:`\data_i` in :math:`\module.\MDATAS`, - the segment :math:`\data_i` must be :ref:`valid `. - * The length of :math:`C.\CMEMS` must not be larger than :math:`1`. * All export names :math:`\export_i.\ENAME` must be different. @@ -639,7 +627,7 @@ Instead, the context :math:`C` for validation of the module's content is constru \\ C = \{ \CTYPES~\type^\ast, \CFUNCS~\X{ift}^\ast\,\X{ft}^\ast, \CTABLES~\X{itt}^\ast\,\X{tt}^\ast, \CMEMS~\X{imt}^\ast\,\X{mt}^\ast, \CGLOBALS~\X{igt}^\ast\,\X{gt}^\ast, \CELEMS~\X{rt}^\ast, \CDATAS~{\ok}^n, \CREFS~x^\ast \} \\ - C' = \{ \CGLOBALS~\X{igt}^\ast, \CFUNCS~(C.\CFUNCS), \CTABLES~(C.\CTABLES), \CMEMS~(C.\CMEMS), \CREFS~(C.\CREFS) \} + C' = C \with \CGLOBALS = \X{igt}^\ast \qquad |C.\CMEMS| \leq 1 \qquad From ba26db7cd087f5482885b43be2bd74dd9e9ab93d Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Wed, 10 Apr 2024 21:33:37 +0200 Subject: [PATCH 8/9] [interpreter] Minor dune simplifications --- interpreter/dune | 82 ++++++++++++++++++---------------------- interpreter/dune-project | 17 ++++----- 2 files changed, 45 insertions(+), 54 deletions(-) diff --git a/interpreter/dune b/interpreter/dune index e221bea7a1..fc62062483 100644 --- a/interpreter/dune +++ b/interpreter/dune @@ -1,64 +1,56 @@ (include_subdirs unqualified) (library - (public_name wasm) - ; The 'wasm' module shall not be part of the library, as it would start the - ; Wasm REPL every time in all the dependencies. - ; We exclude the 'wast' module as it is only used for the JS build. - ; 'smallint' is a separate test module. - (modules :standard \ main wasm smallint wast) - (libraries menhirLib)) + (public_name wasm) + (modules :standard \ main wasm wast smallint) +) (executable - (public_name wasm) - (modules wasm) - (libraries wasm) - (flags - (-open Wasm))) + (public_name wasm) + (modules wasm) + (libraries wasm) + (flags (-open Wasm)) +) (executable - (name smallint) - (modules smallint) - (libraries wasm) - (flags - (-open Wasm))) + (name smallint) + (modules smallint) + (libraries wasm) + (flags (-open Wasm)) +) (executable (name wast) (modules wast) (modes js) (libraries js_of_ocaml wasm) - (preprocess (pps js_of_ocaml-ppx))) + (preprocess (pps js_of_ocaml-ppx)) +) + +(env (_ (flags (-w +a-4-27-42-44-45-70 -warn-error +a-3)))) + +(subdir text + (ocamllex (modules lexer)) + (menhir (modules parser)) +) (rule (targets wasm.ml) (deps main/main.ml) - (action (copy main/main.ml wasm.ml))) - -(subdir - text - (rule - (target lexer.ml) - (deps lexer.mll) - (action - (chdir - %{workspace_root} - (run %{bin:ocamllex} -ml -q -o %{target} %{deps})))) - (menhir - (modules parser))) - -(env - (_ - (flags - (-w +a-4-27-42-44-45-70 -warn-error +a-3)))) + (action (copy main/main.ml wasm.ml)) +) (rule - (alias runtest) - (deps - ./wasm.exe - ./smallint.exe - (source_tree ../test)) - (action - (progn - (run ../test/core/run.py --wasm ./wasm.exe) - (run ./smallint.exe)))) + (alias runtest) + (deps + ./wasm.exe + ./smallint.exe + (source_tree ../test) + ) + (action + (progn + (run ../test/core/run.py --wasm ./wasm.exe) + (run ./smallint.exe) + ) + ) +) diff --git a/interpreter/dune-project b/interpreter/dune-project index 8392b339f5..87233ebc8d 100644 --- a/interpreter/dune-project +++ b/interpreter/dune-project @@ -1,23 +1,22 @@ (lang dune 2.9) (name wasm) - -(generate_opam_files true) -(using menhir 2.1) -(implicit_transitive_deps false) - (license Apache-2.0) - -(source - (github WebAssembly/spec)) +(source (github WebAssembly/spec)) (authors "Andreas Rossberg = 4.12)) - (menhir (>= 20220210)))) + (menhir (>= 20220210)) + ) +) From e6afe0abf5ebb5a493d61012d03bde8799bc5429 Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Fri, 12 Apr 2024 14:58:51 +0200 Subject: [PATCH 9/9] [ci] Only run w3c-publish on original repo --- .github/workflows/w3c-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/w3c-publish.yml b/.github/workflows/w3c-publish.yml index eeade04ebf..d68183abfc 100644 --- a/.github/workflows/w3c-publish.yml +++ b/.github/workflows/w3c-publish.yml @@ -10,6 +10,7 @@ on: jobs: publish-to-w3c-TR: + if: github.repository == 'WebAssembly/spec' runs-on: ubuntu-latest steps: - name: Checkout repo