Skip to content

Commit faccf75

Browse files
committed
Add docs to code
1 parent 6b49b26 commit faccf75

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

compiler/src/dotty/tools/dotc/transform/init/Semantic.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,24 @@ object Semantic:
239239
private val queryTreeMapper: MutableTreeWrapper = new MutableTreeWrapper
240240

241241
class Cache:
242+
/** The cache for expression values from last iteration */
242243
private var last: ExprValueCache = Map.empty
244+
245+
/** The updated cache for expression values based on the cache values from the last iteration */
243246
private var current: ExprValueCache = Map.empty
247+
248+
/** Global cached values for expressions
249+
*
250+
* The values are only added when a fixed point is reached.
251+
*
252+
* It is intended to improve performance for computation related to warm values.
253+
*/
244254
private var stable: ExprValueCache = Map.empty
255+
256+
/** Whether the current heap is different from the last heap?
257+
*
258+
* `changed == true` implies that the fixed point has been reached.
259+
*/
245260
private var changed: Boolean = false
246261

247262
/** Abstract heap stores abstract objects

0 commit comments

Comments
 (0)