Mercurial > hg > graal-compiler
changeset 8897:1a8a0375ba74
unsafeCast: anchor cast after initialization of an object
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Tue, 02 Apr 2013 12:14:15 +0200 |
parents | aa291d601ee8 |
children | 9f56bb503db4 |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Mon Apr 08 17:09:10 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Tue Apr 02 12:14:15 2013 +0200 @@ -91,7 +91,10 @@ } result = memory.toObject(); } - return unsafeCast(verifyOop(result), StampFactory.forNodeIntrinsic()); + /* make sure that the unsafeCast is anchored after initialization, + * see ReadAfterCheckCast and CheckCastSnippets */ + BeginNode anchorNode = BeginNode.anchor(StampFactory.forNodeIntrinsic()); + return unsafeCast(verifyOop(result), StampFactory.forNodeIntrinsic(), anchorNode); } @Snippet