AOT code, like C2 code, can reallocate objects during deoptimization, because of escape analysis. To support this, we need to set the "return_oop" flag on the scope correctly. https://bugs.openjdk.java.net/browse/JDK-8169938 http://cr.openjdk.java.net/~dlong/8169938/webrev/ dl