You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/binaryen.js.Markdown
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -213,14 +213,15 @@ Unprefixed expressions:
213
213
*`block(label, children)`: Create a block (a list of instructions), with an optional label, and list of children.
214
214
*`if(condition, ifTrue, ifFalse`: Create an if or if-else, with a condition, code to execute if true, and optional code to execute if false.
215
215
*`loop(label, body)`: Create a loop, with an optional label, and body.
216
-
*`break(label, condition, value)`: Create a break, to a label, and with an optional condition, and optional value.
216
+
*`br(label, condition, value)`, `break(label, condition, value)`: Create a break, to a label, and with an optional condition, and optional value.
217
+
*`br_if(label, condition, value)`: Create a conditional break (similar to `br`, but the condition must exist).
217
218
*`switch(labels, defaultLabel, condition, value)`: Create a switch (aka br_table), with a list of labels, a default label, a condition, and an optional value.
218
219
*`call(name, operands, type)`: Create a call, to a function name, with operands, and having a specific return type (note that we must specify the return type here as we may not have created the function being called yet, and we may want to optimize this function before we do so, so the API requires that each function be independent of the others, which means that we can't depend on the definition of another function).
219
-
*`callImport(name, operands, type)`: Similar to `call`, but calls an imported function.
220
-
*`callIndirect(target, operands, type)`: Similar to `call`, but calls indirectly, i.e., via a function pointer, so an expression replaces the name as the called value.
221
-
*`getLocal(index, type)`: Create a get_local, for the local at the specified index, and having a specific type (the type is required for the same reasons as in `call`).
222
-
*`setLocal(index, value)`: Create a set_local, for the local at the specified index, and setting the specified value.
223
-
*`teeLocal(index, value)`: Create a tee_local, for the local at the specified index, and setting the specified value.
220
+
*`callImport(name, operands, type)`, `call_import(name, operands, type)`: Similar to `call`, but calls an imported function.
221
+
*`callIndirect(target, operands, type)`, `call_indirect(target, operands, type)`: Similar to `call`, but calls indirectly, i.e., via a function pointer, so an expression replaces the name as the called value.
222
+
*`getLocal(index, type)`, `get_local(index, type)`: Create a get_local, for the local at the specified index, and having a specific type (the type is required for the same reasons as in `call`).
223
+
*`setLocal(index, value)`, `set_local(index, value)`: Create a set_local, for the local at the specified index, and setting the specified value.
224
+
*`teeLocal(index, value)`, `tee_local(index, value)`: Create a tee_local, for the local at the specified index, and setting the specified value.
224
225
*`select(condition, ifTrue, ifFalse)`: Create a select operation, executing the condition, ifTrue, and ifFalse, and returning one of them based on the condition.
225
226
*`drop(value)`: Create a drop of a value.
226
227
*`return(value)`: Create a return with an optional value.
0 commit comments