Skip to content

Commit 7158150

Browse files
committed
metadata/code: remove syntax section and integrate with the binary section
1 parent 1a2f8bf commit 7158150

File tree

3 files changed

+14
-25
lines changed

3 files changed

+14
-25
lines changed

document/metadata/code/binary.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Binary Format
88
Code Metadata
99
-------------
1010

11+
A Code Metadata item is a piece of information logically attached to an instruction.
12+
13+
An item is associated with a format, which defines the item's payload.
14+
1115
All code metadata items of a format named *T* are grouped under a custom section
1216
named *'metadata.code.T'*.
1317
The following parametrized grammar rules define the generic structure of a code metadata
@@ -30,14 +34,19 @@ section of format *T*.
3034

3135
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`.
3236

33-
*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.
37+
|Bcodemetadatafunc| entries must appear in order of increasing :math:`x`, and duplicate id values are not allowed. |Bcodemetadata| entries must appear in order of increasing :math:`\X{off}`, and duplicate offset values are not allowed.
3438

3539
.. _binary-branchhints:
3640

3741
Branch Hints
3842
~~~~~~~~~~~~
3943

40-
A Branch Hint is code metadata item with format *branch_hint*.
44+
A Branch Hint is a code metadata item with format *branch_hint*.
45+
46+
It can only be attached to |BRIF| and |IF| instructions.
47+
48+
Its payload indicates whether the branch is likely or unlikely to be taken.
49+
4150
All branch hints for a module are contained in a single code metadata section
4251
with name *'metadata.code.branch_hint'*.
4352

@@ -55,3 +64,6 @@ with name *'metadata.code.branch_hint'*.
5564
\end{array}
5665
.. index:: ! branch hint section
5766

67+
A value of |Blikely| means that the branch is likely to be taken, while a
68+
value of |Bunlikely| means the opposite. A branch with no hints is considered
69+
equally likely to be taken or not.

document/metadata/code/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ WebAssembly Code Metadata
1111
:maxdepth: 1
1212

1313
intro
14-
syntax
1514
binary
1615
text

document/metadata/code/syntax.rst

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)