runtime: Add lambda box/unbox object equality
A lambda that is boxed with box-lambda is now stored as a weak reference
in a global runtime table (lambda::BoxTable). Repeatedly boxing the same
lambda closure value will always return the same java.lang.Object back.
Since there is no way to observe the address of an object, a GC can
happen and clean up the table of any dead boxed lambdas, which can also
shrink the table to prevent the memory use from growing too much.
(Note that a lambda closure is immutable, so hashing over it is
guaranteed safe.)
Change-Id: I786c1323ff14eed937936b303d511875f9642524
diff --git a/runtime/base/allocator.h b/runtime/base/allocator.h
index 07daa7e..3422625 100644
--- a/runtime/base/allocator.h
+++ b/runtime/base/allocator.h
@@ -50,6 +50,7 @@
kAllocatorTagMonitorList,
kAllocatorTagClassTable,
kAllocatorTagInternTable,
+ kAllocatorTagLambdaBoxTable,
kAllocatorTagMaps,
kAllocatorTagLOS,
kAllocatorTagSafeMap,