mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
99bb7924b0
Previously, the stack frame mapping code (responsible for statically calculating the map of GC roots for a method's stack frame during JIT compilation) would assume that the map of GC roots on entry to an exception handler is the same as on entry to the "try" block which the handler is attached to. Technically, this is true, but the algorithm we use does not consider whether a local variable is still "live" (i.e. will be read later) when calculating the map - only whether we can expect to find a reference there via normal (non-exceptional) control flow. This can backfire if, within a "try" block, the stack location which held an object reference on entry to the block gets overwritten with a non-reference (i.e. a primitive). If an exception is later thrown from such a block, we might end up trying to treat that non-reference as a reference during GC, which will crash the VM. The ideal way to fix this is to calculate the true interval for which each value is live and use that to produce the stack frame maps. This would provide the added benefit of ensuring that the garbage collector does not visit references which, although still present on the stack, will not be used again. However, this commit uses the less invasive strategy of ANDing together the root maps at each GC point within a "try" block and using the result as the map on entry to the corresponding exception handler(s). This should give us safe, if not optimal, results. Later on, we can refine it as described above. |
||
---|---|---|
.. | ||
extra | ||
AllFloats.java | ||
Annotations.java | ||
Arrays.java | ||
BitsetTest.java | ||
Enums.java | ||
Exceptions.java | ||
Finalizers.java | ||
Floats.java | ||
GC.java | ||
Hello.java | ||
Integers.java | ||
List.java | ||
Logging.java | ||
Longs.java | ||
Misc.java | ||
NullPointer.java | ||
Proxies.java | ||
References.java | ||
Reflection.java | ||
Simple.java | ||
Strings.java | ||
Subroutine.java | ||
Switch.java | ||
test.sh | ||
Threads.java | ||
Tree.java | ||
Zip.java |