Mercurial > hg > truffle
changeset 10623:13c6440ac750
Add nullcheck at G1 Pre Barrier
author | Christos Kotselidis <christos.kotselidis@oracle.com> |
---|---|
date | Sun, 07 Jul 2013 19:44:38 +0200 |
parents | 844be189150c |
children | cb2d97f002d4 |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java Sun Jul 07 19:09:31 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java Sun Jul 07 19:44:38 2013 +0200 @@ -90,7 +90,11 @@ } @Snippet - public static void g1PreWriteBarrier(Object object, Object expectedObject, Object location, @ConstantParameter boolean doLoad, @ConstantParameter boolean trace) { + public static void g1PreWriteBarrier(Object object, Object expectedObject, Object location, @ConstantParameter boolean doLoad, @ConstantParameter boolean nullCheck, + @ConstantParameter boolean trace) { + if (nullCheck && object == null) { + DeoptimizeNode.deopt(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.NullCheckException); + } Word thread = thread(); Object fixedObject = FixedValueAnchorNode.getObject(object); verifyOop(fixedObject); @@ -323,6 +327,7 @@ args.add("expectedObject", writeBarrierPre.getExpectedObject()); args.add("location", writeBarrierPre.getLocation()); args.addConst("doLoad", writeBarrierPre.doLoad()); + args.addConst("nullCheck", !writeBarrierPre.getObject().stamp().nonNull()); args.addConst("trace", traceBarrier()); template(args).instantiate(runtime, writeBarrierPre, DEFAULT_REPLACER, args); }