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
Loading
Please sign in to comment