This repository was archived by the owner on Apr 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,8 +174,9 @@ Occasionally, it is convenient to group operators together according to the foll | |
| .. index:: ! reference instruction, reference, null | ||
| pair: abstract syntax; instruction | ||
| .. _syntax-ref.null: | ||
| .. _syntax-ref.is_null: | ||
| .. _syntax-ref.func: | ||
| .. _syntax-ref.is_null: | ||
| .. _syntax-ref.as_non_null: | ||
| .. _syntax-instr-ref: | ||
|
|
||
| Reference Instructions | ||
|
|
@@ -188,11 +189,13 @@ Instructions in this group are concerned with accessing :ref:`references <syntax | |
| \production{instruction} & \instr &::=& | ||
| \dots \\&&|& | ||
| \REFNULL~\reftype \\&&|& | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||
| \REFFUNC~\funcidx \\&&|& | ||
| \REFISNULL \\&&|& | ||
| \REFFUNC~\funcidx \\ | ||
| \REFASNONNULL \\ | ||
| \end{array} | ||
|
|
||
| These instruction produce a null value, check for a null value, or produce a reference to a given function, respectively. | ||
| The first three of these instruction produce a :ref:`null <syntax-null>` value, produce a reference to a given function, or check for a null value, respectively. | ||
| The |REFASNONNULL| casts a :ref:`nullable <syntax-reftype>` to a non-null one, and :ref:`traps <trap>` if it encounters null. | ||
|
|
||
|
|
||
| .. index:: ! parametric instruction, value type | ||
|
|
@@ -389,8 +392,11 @@ Instructions in this group affect the flow of control. | |
| \BR~\labelidx \\&&|& | ||
| \BRIF~\labelidx \\&&|& | ||
| \BRTABLE~\vec(\labelidx)~\labelidx \\&&|& | ||
| \BRONNULL~\labelidx \\&&|& | ||
| \BRONNONNULL~\labelidx \\&&|& | ||
| \RETURN \\&&|& | ||
| \CALL~\funcidx \\&&|& | ||
| \CALLREF \\&&|& | ||
| \CALLINDIRECT~\tableidx~\typeidx \\ | ||
| \end{array} | ||
|
|
||
|
|
@@ -427,13 +433,15 @@ Branch instructions come in several flavors: | |
| |BR| performs an unconditional branch, | ||
| |BRIF| performs a conditional branch, | ||
| and |BRTABLE| performs an indirect branch through an operand indexing into the label vector that is an immediate to the instruction, or to a default target if the operand is out of bounds. | ||
| The |BRONNULL| and |BRONNONNULL| instructions check whether a reference operand is :ref:`null <syntax-null>` and branch if that is the case or not the case, respectively. | ||
| The |RETURN| instruction is a shortcut for an unconditional branch to the outermost block, which implicitly is the body of the current function. | ||
| Taking a branch *unwinds* the operand stack up to the height where the targeted structured control instruction was entered. | ||
| However, branches may additionally consume operands themselves, which they push back on the operand stack after unwinding. | ||
| Forward branches require operands according to the output of the targeted block's type, i.e., represent the values produced by the terminated block. | ||
| Backward branches require operands according to the input of the targeted block's type, i.e., represent the values consumed by the restarted block. | ||
|
|
||
| The |CALL| instruction invokes another :ref:`function <syntax-func>`, consuming the necessary arguments from the stack and returning the result values of the call. | ||
| The |CALLREF| instruction invokes a function indirectly through a :ref:`function reference <syntax-reftype>` operand. | ||
| The |CALLINDIRECT| instruction calls a function indirectly through an operand indexing into a :ref:`table <syntax-table>` that is denoted by a :ref:`table index <syntax-tableidx>` and must contain :ref:`function references <syntax-reftype>`. | ||
| Since it may contain functions of heterogeneous type, | ||
| the callee is dynamically checked against the :ref:`function type <syntax-functype>` indexed by the instruction's second immediate, and the call is aborted with a :ref:`trap <trap>` if it does not match. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason
br_on_nullisn't next tobr_on_non_nullin the index space?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D5 was already assigned to ref.eq at the time we added br_on_non_null.