Skip to content

Commit

Permalink
deploy: 44870b3
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Apr 9, 2024
1 parent 8d07860 commit 4db7c7b
Show file tree
Hide file tree
Showing 143 changed files with 41,974 additions and 27,327 deletions.
2 changes: 1 addition & 1 deletion core/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 7145f2d013e45cd137de679bf316cda9
config: 8b936450fa4292b1f32a923d62f5bfca
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified core/_download/WebAssembly.pdf
Binary file not shown.
23 changes: 14 additions & 9 deletions core/_static/alabaster.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ div.relations {
}


div.sphinxsidebar {
max-height: 100%;
overflow-y: auto;
}

div.sphinxsidebar a {
color: #444;
text-decoration: none;
Expand Down Expand Up @@ -155,6 +160,14 @@ div.sphinxsidebar input {
font-size: 1em;
}

div.sphinxsidebar #searchbox input[type="text"] {
width: 160px;
}

div.sphinxsidebar .search > div {
display: table-cell;
}

div.sphinxsidebar hr {
border: none;
height: 1px;
Expand Down Expand Up @@ -644,15 +657,7 @@ a:hover tt, a:hover code {
display: none!important;
}

/* Make nested-list/multi-paragraph items look better in Releases changelog
* pages. Without this, docutils' magical list fuckery causes inconsistent
* formatting between different release sub-lists.
*/
div#changelog > div.section > ul > li > p:only-child {
margin-bottom: 0;
}

/* Hide fugly table cell borders in ..bibliography:: directive output */
/* Hide ugly table cell borders in ..bibliography:: directive output */
table.docutils.citation, table.docutils.citation td, table.docutils.citation th {
border: none;
/* Below needed in some edge cases; if not applied, bottom shadows appear */
Expand Down
2 changes: 1 addition & 1 deletion core/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ table.modindextable td {
/* -- general body styles --------------------------------------------------- */

div.body {
min-width: 360px;
min-width: inherit;
max-width: 800px;
}

Expand Down
2 changes: 2 additions & 0 deletions core/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ div.admonition p.admonition-title {
div.math {
background-color: #F0F0F0;
padding: 3px 0 3px 0;
overflow-x: auto;
overflow-y: hidden;
}

div.relations {
Expand Down
2 changes: 1 addition & 1 deletion core/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '1.1 (Draft 2023-11-15)',
VERSION: '2.0 (Draft 2024-04-09)',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
1 change: 1 addition & 0 deletions core/_static/pygments.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
Expand Down
62 changes: 33 additions & 29 deletions core/appendix/algorithm.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,26 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

<title>Validation Algorithm &#8212; WebAssembly 1.1 (Draft 2023-11-15)</title>
<title>Validation Algorithm &#8212; WebAssembly 2.0 (Draft 2024-04-09)</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/alabaster.css" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../_static/doctools.js"></script>
<script type="text/x-mathjax-config">MathJax.Hub.Config({"TeX": {"MAXBUFFER": 30720}})</script>
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script>window.MathJax = {"tex": {"maxBuffer": 30720}}</script>
<script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Custom Sections" href="custom.html" />
<link rel="prev" title="Implementation Limitations" href="implementation.html" />

<link rel="stylesheet" href="../_static/custom.css" type="text/css" />




<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

</head><body>
<div class="document">
Expand Down Expand Up @@ -97,11 +98,14 @@ <h3 id="searchlabel">Quick search</h3>
<section id="data-structures">
<span id="index-1"></span><h2>Data Structures<a class="headerlink" href="#data-structures" title="Permalink to this heading"></a></h2>
<p>Types are representable as an enumeration.</p>
<div class="highlight-pseudo notranslate"><div class="highlight"><pre><span></span><span class="k">type</span> <span class="nf">val_type</span> = I32 | I64 | F32 | F64 | Funcref | Externref
<div class="highlight-pseudo notranslate"><div class="highlight"><pre><span></span><span class="k">type</span> <span class="nf">val_type</span> = I32 | I64 | F32 | F64 | V128 | Funcref | Externref

<span class="k">func</span> <span class="nf">is_num</span>(<span class="nf">t</span> : val_type | Unknown) : bool =
<span class="k">return</span> t = I32 || t = I64 || t = F32 || t = F64 || t = Unknown

<span class="k">func</span> <span class="nf">is_vec</span>(<span class="nf">t</span> : val_type | Unknown) : bool =
<span class="k">return</span> t = V128 || t = Unknown

<span class="k">func</span> <span class="nf">is_ref</span>(<span class="nf">t</span> : val_type | Unknown) : bool =
<span class="k">return</span> t = Funcref || t = Externref || t = Unknown
</pre></div>
Expand Down Expand Up @@ -139,15 +143,13 @@ <h3 id="searchlabel">Quick search</h3>

<span class="k">func</span> <span class="nf">pop_val</span>(<span class="nf">expect</span> : val_type | Unknown) : val_type | Unknown =
<span class="k">let</span> <span class="nf">actual</span> = pop_val()
<span class="k">if</span> (actual = Unknown) <span class="k">return</span> expect
<span class="k">if</span> (expect = Unknown) <span class="k">return</span> actual
error_if(actual =/= expect)
error_if(actual =/= expect &amp;&amp; actual =/= Unknown &amp;&amp; expect =/= Unknown)
<span class="k">return</span> actual

<span class="k">func</span> <span class="nf">push_vals</span>(<span class="nf">types</span> : list(val_type)) = <span class="k">foreach</span> (t <span class="k">in</span> types) push_val(t)
<span class="k">func</span> <span class="nf">pop_vals</span>(<span class="nf">types</span> : list(val_type)) : list(val_type) =
<span class="k">var</span> <span class="nf">popped</span> := []
<span class="k">foreach</span> (t <span class="k">in</span> reverse(types)) popped.append(pop_val(t))
<span class="k">foreach</span> (t <span class="k">in</span> reverse(types)) popped.prepend(pop_val(t))
<span class="k">return</span> popped
</pre></div>
</div>
Expand All @@ -167,13 +169,13 @@ <h3 id="searchlabel">Quick search</h3>
</div>
<p>The control stack is likewise manipulated through auxiliary functions:</p>
<div class="highlight-pseudo notranslate"><div class="highlight"><pre><span></span><span class="k">func</span> <span class="nf">push_ctrl</span>(<span class="nf">opcode</span> : opcode, <span class="k">in</span> : list(val_type), <span class="nf">out</span> : list(val_type)) =
 <span class="k">let</span> <span class="nf">frame</span> = ctrl_frame(opcode, <span class="k">in</span>, out, vals.size(), false)
<span class="k">let</span> <span class="nf">frame</span> = ctrl_frame(opcode, <span class="k">in</span>, out, vals.size(), false)
ctrls.push(frame)
push_vals(<span class="k">in</span>)

<span class="k">func</span> <span class="nf">pop_ctrl</span>() : ctrl_frame =
 error_if(ctrls.is_empty())
 <span class="k">let</span> <span class="nf">frame</span> = ctrls[0]
error_if(ctrls.is_empty())
<span class="k">let</span> <span class="nf">frame</span> = ctrls[0]
pop_vals(frame.end_types)
error_if(vals.size() =/= frame.height)
ctrls.pop()
Expand All @@ -194,7 +196,9 @@ <h3 id="searchlabel">Quick search</h3>
Afterwards, it checks that the stack has shrunk back to its initial height.</p>
<p>The type of the <a class="reference internal" href="../exec/runtime.html#syntax-label"><span class="std std-ref">label</span></a> associated with a control frame is either that of the stack at the start or the end of the frame, determined by the opcode that it originates from.</p>
<p>Finally, the current frame can be marked as unreachable.
In that case, all existing operand types are purged from the value stack, in order to allow for the <a class="reference internal" href="../valid/instructions.html#polymorphism"><span class="std std-ref">stack-polymorphism</span></a> logic in <code class="code docutils literal notranslate"><span class="pre">pop_val</span></code> to take effect.</p>
In that case, all existing operand types are purged from the value stack, in order to allow for the <a class="reference internal" href="../valid/instructions.html#polymorphism"><span class="std std-ref">stack-polymorphism</span></a> logic in <code class="code docutils literal notranslate"><span class="pre">pop_val</span></code> to take effect.
Because every function has an implicit outermost label that corresponds to an implicit block frame,
it is an invariant of the validation algorithm that there always is at least one frame on the control stack when validating an instruction, and hence, <cite>ctrls[0]</cite> is always defined.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Even with the unreachable flag set, consecutive operands are still pushed to and popped from the operand stack.
Expand Down Expand Up @@ -225,7 +229,7 @@ <h3 id="searchlabel">Quick search</h3>
pop_val(I32)
<span class="k">let</span> <span class="nf">t1</span> = pop_val()
<span class="k">let</span> <span class="nf">t2</span> = pop_val()
error_if(not (is_num(t1) &amp;&amp; is_num(t2)))
error_if(not ((is_num(t1) &amp;&amp; is_num(t2)) || (is_vec(t1) &amp;&amp; is_vec(t2))))
error_if(t1 =/= t2 &amp;&amp; t1 =/= Unknown &amp;&amp; t2 =/= Unknown)
push_val(if (t1 = Unknown) t2 else t1)

Expand All @@ -235,8 +239,8 @@ <h3 id="searchlabel">Quick search</h3>
pop_val(t)
push_val(t)

   <span class="k">case</span> (unreachable)
   unreachable()
<span class="k">case</span> (unreachable)
unreachable()

<span class="k">case</span> (block t1*-&gt;t2*)
pop_vals([t1*])
Expand All @@ -261,26 +265,26 @@ <h3 id="searchlabel">Quick search</h3>
push_ctrl(else, frame.start_types, frame.end_types)

<span class="k">case</span> (br n)
     error_if(ctrls.size() &lt; n)
   pop_vals(label_types(ctrls[n]))
    unreachable()
error_if(ctrls.size() &lt; n)
pop_vals(label_types(ctrls[n]))
unreachable()

<span class="k">case</span> (br_if n)
     error_if(ctrls.size() &lt; n)
error_if(ctrls.size() &lt; n)
pop_val(I32)
   pop_vals(label_types(ctrls[n]))
   push_vals(label_types(ctrls[n]))
pop_vals(label_types(ctrls[n]))
push_vals(label_types(ctrls[n]))

   <span class="k">case</span> (br_table n* m)
<span class="k">case</span> (br_table n* m)
pop_val(I32)
   error_if(ctrls.size() &lt; m)
error_if(ctrls.size() &lt; m)
<span class="k">let</span> <span class="nf">arity</span> = label_types(ctrls[m]).size()
    <span class="k">foreach</span> (n <span class="k">in</span> n*)
      error_if(ctrls.size() &lt; n)
      error_if(label_types(ctrls[n]).size() =/= arity)
<span class="k">foreach</span> (n <span class="k">in</span> n*)
error_if(ctrls.size() &lt; n)
error_if(label_types(ctrls[n]).size() =/= arity)
push_vals(pop_vals(label_types(ctrls[n])))
pop_vals(label_types(ctrls[m]))
    unreachable()
unreachable()
</pre></div>
</div>
<div class="admonition note">
Expand All @@ -300,7 +304,7 @@ <h3 id="searchlabel">Quick search</h3>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2017, WebAssembly Community Group.
&#169;2022, WebAssembly Community Group.

</div>

Expand Down
Loading

0 comments on commit 4db7c7b

Please sign in to comment.