Skip to content

Commit 8d24dbf

Browse files
committed
branch hinting: reword the byte offset description
"function body" is unclear, and actually at odds with the definition in the core spec. The byte offset is relative to the start of the locals vector
1 parent 7158150 commit 8d24dbf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

document/metadata/code/binary.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ section of format *T*.
3232
\end{array}
3333
.. index:: ! code metadata section
3434

35-
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`.
35+
Where :math:`\X{off}` is the byte offset of the attached instruction, relative to the beginning of the |Bfunc| declaration, and :math:`\X{data}` is a further payload, whose content depends on the format :math:`T`.
3636

3737
|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.
3838

proposals/branch-hinting/Overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ and a function index can appear at most once.
100100

101101
Each *branch hint* structure consists of
102102

103-
* the |U32| byte offset of the hinted instruction from the beginning of the function body,
103+
* the |U32| byte offset of the hinted instruction, relative to the beginning of the function locals declaration,
104104
* A |U32| with value `1`,
105105
* a |U32| indicating the meaning of the hint:
106106

0 commit comments

Comments
 (0)