News for hackers. Stuff that matters.
Re:Java 10 – Specification for Value Types by naasking on Monday June 19, 2017 @12:27PM (#14588156)
> It also fundamentally can't solve the problem you want it to solve, because what happens if your value objects do escape? I really think the compiler is the wrong tool for the job here.

You'd need to generalize stacks to full-fledged region analysis to see any real benefits, but only MLKit has taken it this far IIRC.

Re:Java 10 – Specification for Value Types by PDoyle on Monday June 19, 2017 @12:52PM (#14588377)
Ok, so you analyze "regions". Then what? Modify the data structures to use some kind of efficient headerless representation? Then stop the world and rewrite the whole heap if a new class gets loaded that violates an assumption? Or if existing code tries to use reflection to look at these things?

Nothing's impossible I guess, but this kind of global datastructure reshaping is definitely far beyond the state of the art in Java JIT compilers.

Re:Java 10 – Specification for Value Types by naasking on Monday June 19, 2017 @02:00PM (#14588944)
Combining Region Inference and Garbage Collection, http://www.elsman.com/pdf/pldi2002.pdf
Re:Java 10 – Specification for Value Types by PDoyle on Monday June 19, 2017 @06:48PM (#14591014)
Cool, thanks for the link.

My mistake--I thought "regions" meant some sort of interprocedural "code regions".

I suspect the state of the art in GC has moved in the last 15 years since this paper was written, and they might have trouble beating modern techniques, but that's speculation.

Re:Java 10 – Specification for Value Types by naasking on Monday June 19, 2017 @11:39PM (#14592025)
It's hard to beat regions in time overhead, since every operation is constant time; space overhead is where they suffer, and that's where GC enters the picture.

Escape analysis is a degenerate region analysis, and many of the cases where it fails because it's not general enough would be handled quite well by regions.