Skip to content

Commit 1a2f8bf

Browse files
committed
metadata/code: fixes to spec document
1 parent 64c6799 commit 1a2f8bf

File tree

6 files changed

+19
-13
lines changed

6 files changed

+19
-13
lines changed

document/metadata/code/binary.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Binary Format
88
Code Metadata
99
-------------
1010

11-
All code metadata items of a given format *T* are grouped under a custom section
11+
All code metadata items of a format named *T* are grouped under a custom section
1212
named *'metadata.code.T'*.
1313
The following parametrized grammar rules define the generic structure of a code metadata
1414
section of format *T*.
@@ -21,14 +21,14 @@ section of format *T*.
2121
n{:}\Bname & (\iff n = \text{metadata.code.T}) \\ &&&
2222
\Bvec(\Bcodemetadatafunc(\B{T})) \\
2323
\production{code metadata function} & \Bcodemetadatafunc(\B{T}) &::=&
24-
fidx{:}\Bfuncidx~\Bvec(\Bcodemetadataitem(\B{T})) \\
24+
x{:}\Bfuncidx~\Bvec(\Bcodemetadataitem(\B{T})) \\
2525
\production{code metadata item} & \Bcodemetadataitem(\B{T}) &::=&
26-
\X{instoff}{:}\Bu32 ~~ \X{size}{:}\Bu32 & (\iff \X{size} = ||\B{T}||) \\ &&&
26+
\X{off}{:}\Bu32 ~~ \X{size}{:}\Bu32 & (\iff \X{size} = ||\B{T}||) \\ &&&
2727
\X{data}{:}\B{T} \\
2828
\end{array}
2929
.. index:: ! code metadata section
3030

31-
Where *funcpos* is the byte offset of the annotation starting from the beginning of the function body, and *data* is a further payload, whose content depends on the format *T*.
31+
Where :math:`\X{off}` is the byte offset of the annotation starting from the beginning of the function body, and :math:`\X{data}` is a further payload, whose content depends on the format :math:`T`.
3232

3333
*code metadata function* entries must appear in order of increasing *function id*, and duplicate id values are not allowed. *code metadata item* entries must appear in order of increasing *instruction offset*, and duplicate offset values are not allowed.
3434

@@ -46,7 +46,11 @@ with name *'metadata.code.branch_hint'*.
4646
\production{branch hint section} & \Bbranchhintsec &::=&
4747
\Bcodemetadatasec(\Bbranchhint) \\
4848
\production{branch hint} & \Bbranchhint &::=&
49-
\hex{00} \\ &&|&
49+
\Bunlikely \\ &&|&
50+
\Blikely \\
51+
\production{unlikely} & \Bunlikely &::=&
52+
\hex{00} \\
53+
\production{likely} & \Blikely &::=&
5054
\hex{01} \\
5155
\end{array}
5256
.. index:: ! branch hint section

document/metadata/code/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
title = u'WebAssembly Code Metadata Specification'
6565
copyright = u'2024, WebAssembly Community Group'
6666
author = u'WebAssembly Community Group'
67-
editor = u'Andreas Rossberg (editor)'
67+
editor = u'Yuri Iozzelli (editor)'
6868
logo = 'static/webassembly.png'
6969

7070
# The name of the GitHub repository this resides in

document/metadata/code/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ WebAssembly Code Metadata
33

44
.. only:: html
55

6-
| Editor: Andreas Rossberg
6+
| Editor: Yuri Iozzelli
77
88
| Issue Tracker: |WasmIssues|
99

document/metadata/code/intro.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Introduction
66
This document defines a generic mechanism for attaching arbitrary metadata to WebAssembly instructions.
77
Additionally, it defines specific metadata formats using this mechanism.
88

9-
Such metadata do not contribute to, or otherwise affect, the WebAssembly semantics, and may be ignored by an implementation.
9+
Such metadata does not contribute to, or otherwise affect, the WebAssembly semantics, and may be ignored by an implementation.
1010

1111
However, it can provides useful information that implementations can make use of to improve user experience or take compilation hints.
1212

document/metadata/code/text.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ attached to the first instruction that follows them.
1919
\end{array}
2020
.. index:: ! code metadata annotation
2121

22-
Where `T` is the format of the item, and `data` is a byte string containing the same
22+
Where `T` is the format name of the item, and `data` is a byte string containing the same
2323
payload as in the binary format.
2424

document/metadata/code/util/macros.def

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@
2020

2121
.. Code Metadata, non-terminals
2222

23-
.. |Bcodemetadatasec| mathdef:: \xref{binary}{binary-codemetada}{\B{codemetadatasec}}
24-
.. |Bcodemetadata| mathdef:: \xref{binary}{binary-codemetada}{\B{codemetada}}
25-
.. |Bcodemetadatafunc| mathdef:: \xref{binary}{binary-codemetada}{\B{codemetadafunc}}
26-
.. |Bcodemetadataitem| mathdef:: \xref{binary}{binary-codemetada}{\B{codemetadataitem}}
23+
.. |Bcodemetadatasec| mathdef:: \xref{binary}{binary-codemetadata}{\B{codemetadatasec}}
24+
.. |Bcodemetadata| mathdef:: \xref{binary}{binary-codemetadata}{\B{codemetada}}
25+
.. |Bcodemetadatafunc| mathdef:: \xref{binary}{binary-codemetadata}{\B{codemetadafunc}}
26+
.. |Bcodemetadataitem| mathdef:: \xref{binary}{binary-codemetadata}{\B{codemetadataitem}}
2727

2828
.. Branch Hints, non-terminals
2929

3030
.. |Bbranchhintsec| mathdef:: \xref{binary}{binary-branchhints}{\B{branchhintsec}}
3131
.. |Bbranchhint| mathdef:: \xref{binary}{binary-branchhints}{\B{branchhint}}
32+
.. |Bunlikely| mathdef:: \xref{binary}{binary-branchhints}{\B{unlikely}}
33+
.. |Blikely| mathdef:: \xref{binary}{binary-branchhints}{\B{likely}}
3234

3335

3436
.. Text Format

0 commit comments

Comments
 (0)