From 2e1ccb1887852c239148bc54b3d795db48bff119 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 23 Oct 2015 14:46:30 -0700 Subject: Flexible control-flow operators. This introduces `br`, `br_if`, and so on, while also preserving the high-level `if` and `if_else` operators. It also converts `switch` into `tableswitch` and generalizes it to support labels in enclosing scopes. --- Rationale.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Rationale.md') diff --git a/Rationale.md b/Rationale.md index 87bac8b..26ca199 100644 --- a/Rationale.md +++ b/Rationale.md @@ -114,7 +114,19 @@ developer. ## Control Flow -See [#299](https://github.com/WebAssembly/design/pull/299). +Structured control flow provides simple and size-efficient binary encoding and +compilation. Any control flow—even irreducible—can be transformed into structured +control flow with the +[Relooper](https://github.com/kripken/emscripten/raw/master/docs/paper.pdf) +[algorithm](http://dl.acm.org/citation.cfm?id=2048224&CFID=670868333&CFTOKEN=46181900), +with guaranteed low code size overhead, and typically minimal throughput +overhead (except for pathological cases of irreducible control +flow). Alternative approaches can generate reducible control flow via node +splitting, which can reduce throughput overhead, at the cost of increasing +code size (potentially very significantly in pathological cases). +Also, +[more expressive control flow constructs](FutureFeatures.md#more-expressive-control-flow) +may be added in the future. ## Locals -- cgit v1.2.3