aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/backend
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-01-24 10:23:10 +0100
committerFelix Mulder <felix.mulder@gmail.com>2017-01-31 14:32:41 +0100
commit269c24b92a2cf15e90344430291b74ee30441d3a (patch)
tree7d1a2870aa25991adc4562180930a410b4e84575 /compiler/src/dotty/tools/backend
parentf56a8b3246adca23ed76beefb0eb5102e70f6d97 (diff)
downloaddotty-269c24b92a2cf15e90344430291b74ee30441d3a.tar.gz
dotty-269c24b92a2cf15e90344430291b74ee30441d3a.tar.bz2
dotty-269c24b92a2cf15e90344430291b74ee30441d3a.zip
Fix codeblocks in shortened markdown
Diffstat (limited to 'compiler/src/dotty/tools/backend')
-rw-r--r--compiler/src/dotty/tools/backend/jvm/LabelDefs.scala45
1 files changed, 24 insertions, 21 deletions
diff --git a/compiler/src/dotty/tools/backend/jvm/LabelDefs.scala b/compiler/src/dotty/tools/backend/jvm/LabelDefs.scala
index 371396e36..654507991 100644
--- a/compiler/src/dotty/tools/backend/jvm/LabelDefs.scala
+++ b/compiler/src/dotty/tools/backend/jvm/LabelDefs.scala
@@ -37,44 +37,47 @@ import StdNames.nme
/**
* Verifies that each Label DefDef has only a single address to jump back and
- * reorders them such that they are not nested and this address is a fall-through address for JVM
- *
- * ei such code
- *
+ * reorders them such that they are not nested and this address is a
+ * fall-through address for the JVM.
*
+ * ```scala
* <label> def foo(i: Int) = {
* <label> def bar = 0
* <label> def dough(i: Int) = if (i == 0) bar else foo(i-1)
* dough(i)
- * }
+ * }
*
* foo(100)
+ * ```
*
- * will get rewritten to
+ * will get rewritten to:
*
- * \
+ * ```scala
* <label> def foo(i: Int) = dough(i)
* <label> def dough(i: Int) = if (i == 0) bar else foo(i-1)
* <label> def bar = 2
* foo(100)
+ * ```
*
- * Proposed way to generate this pattern in backend is:
+ * Proposed way to generate this pattern in backend is:
*
- * foo(100)
- * <jump foo>
- * <label> def foo(i: Int) = dough(i)
- * // <jump a> // unreachable
- * <label> def dough(i: Int) = if (i == 0) bar else foo(i-1)
- * // <jump a> // unreachable
- * <label> def bar = 2
- * // <jump a> // unreachable
- * <asm point a>
+ * ```scala
+ * foo(100)
+ * <jump foo>
+ * <label> def foo(i: Int) = dough(i)
+ * // <jump a> // unreachable
+ * <label> def dough(i: Int) = if (i == 0) bar else foo(i-1)
+ * // <jump a> // unreachable
+ * <label> def bar = 2
+ * // <jump a> // unreachable
+ * <asm point a>
+ * ```
*
- * Unreachable jumps will be eliminated by local dead code analysis.
- * After JVM is smart enough to remove next-line jumps
+ * Unreachable jumps will be eliminated by local dead code analysis.
+ * After JVM is smart enough to remove next-line jumps
*
- * Note that Label DefDefs can be only nested in Block, otherwise no one would be able to call them
- * Other DefDefs are eliminated
+ * Note that Label DefDefs can be only nested in Block, otherwise no one would
+ * be able to call them Other DefDefs are eliminated
*/
class LabelDefs extends MiniPhaseTransform {
def phaseName: String = "labelDef"