Update liveness.go overview comment

This commit is contained in:
Nigel Tao committed 2019-09-21 12:48:18 +10:00
1 parent c93dcf0944
commit f61798c2a8
1 file changed
+10 -9
+10 -9
View File
@@ -14,13 +14,13 @@
package cgen package cgen
// This file deals with determining whether local variables need to be kept: // This file deals with liveness analysis, determining whether local variables
// saved / loaded when suspending / resuming a coroutine. For simplicity, this // need to be kept: saved / loaded when suspending / resuming a coroutine. For
// is a boolean property of each local variable. The analysis does not // simplicity, this is a boolean property of each local variable. The analysis
// determine that a local variable needs saving at some CSPs (coroutine // does not determine that a local variable needs saving at some CSPs
// suspension points) but not others. // (coroutine suspension points) but not others.
// //
// Fexample, in this code: // For example, in this code:
// //
// i = etc // i = etc
// yield foo // The first CSP. // yield foo // The first CSP.
@@ -29,7 +29,7 @@ package cgen
// a[j] = 42 // a[j] = 42
// j += 1 // j += 1
// } // }
// c = 100 + args.src.read_u8!??() // The second CSP. // c = args.src.read_u8?() // The second CSP.
// k = a[c] // k = a[c]
// //
// There are two CSPs. The i local variable will need to be kept, as it is // There are two CSPs. The i local variable will need to be kept, as it is
@@ -55,8 +55,9 @@ package cgen
// happens on a read, weak to none happens on a write, and none to weak happens // happens on a read, weak to none happens on a write, and none to weak happens
// on a CSP. When reconciling multiple code paths, the strongest wins, where // on a CSP. When reconciling multiple code paths, the strongest wins, where
// strong > weak and weak > none. Loops are repeated until the reconciliations // strong > weak and weak > none. Loops are repeated until the reconciliations
// between the N'th and N+1'th iteration are all no-ops. There can be multiple // between the N'th and N+1'th iteration are all no-ops: a steady state has
// reconciliations per iteration, due to break and continue statements. // been reached. There can be multiple reconciliations per iteration, due to
// break and continue statements.
// //
// Care is taken with a coroutine call in a statement or expression. Arguments // Care is taken with a coroutine call in a statement or expression. Arguments
// to the coroutine are 'inside' and are before the CSP. The rest of the // to the coroutine are 'inside' and are before the CSP. The rest of the