From c428e746ff8031271ad5c170b88177f091138ef1 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Tue, 7 Jun 2016 15:20:58 +0200 Subject: LazyVals: do even more verbose debugging. --- src/dotty/runtime/LazyVals.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/dotty/runtime') diff --git a/src/dotty/runtime/LazyVals.scala b/src/dotty/runtime/LazyVals.scala index e42532ce0..4dea0d34d 100644 --- a/src/dotty/runtime/LazyVals.scala +++ b/src/dotty/runtime/LazyVals.scala @@ -63,7 +63,11 @@ object LazyVals { } @inline def compareAndSet(t: Object, off: Long, e: Long, v: Long) = unsafe.compareAndSwapLong(t, off, e, v) - @inline def get(t: Object, off: Long) = unsafe.getLongVolatile(t, off) + @inline def get(t: Object, off: Long) = { + if (debug) + println(s"get($t, $off)") + unsafe.getLongVolatile(t, off) + } val processors: Int = java.lang.Runtime.getRuntime.availableProcessors() val base: Int = 8 * processors * processors -- cgit v1.2.3