Mercurial > hg > truffle
changeset 10493:a46c3180faed
Merge
author | Christos Kotselidis <christos.kotselidis@oracle.com> |
---|---|
date | Fri, 21 Jun 2013 11:41:34 +0200 |
parents | 34444b095a51 (diff) 6447890af1bf (current diff) |
children | 6f331db530f6 |
files | graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/WriteBarrierAdditionTest.java graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/WriteBarrierVerificationTest.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GenericArrayRangeWriteBarrier.java |
diffstat | 3 files changed, 16 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java Thu Jun 20 21:11:06 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java Fri Jun 21 11:41:34 2013 +0200 @@ -121,6 +121,11 @@ * operation was unsuccessful */ static Word refillAllocate(Word intArrayHub, int sizeInBytes, boolean log) { + // If G1 is enabled, the "eden" allocation space is not the same always + // and therefore we have to go to slowpath to allocate a new TLAB. + if (HotSpotReplacementsUtil.useG1GC()) { + return Word.zero(); + } if (!useTLAB()) { return edenAllocate(Word.unsigned(sizeInBytes), log); }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatableAccessNode.java Thu Jun 20 21:11:06 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatableAccessNode.java Fri Jun 21 11:41:34 2013 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.nodes.extended; +import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.type.*; @@ -43,4 +44,13 @@ } public abstract FloatingAccessNode asFloatingNode(ValueNode lastLocationAccess); + + /** + * AccessNodes can float only if their location identities are not ANY_LOCATION. Furthermore, in + * case G1 is enabled any access (read) to the java.lang.ref.Reference.referent field which has + * an attached write barrier with pre-semantics can not also float. + */ + public boolean canFloat() { + return location().getLocationIdentity() != LocationIdentity.ANY_LOCATION && getWriteBarrierType() == WriteBarrierType.NONE; + } }
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java Thu Jun 20 21:11:06 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java Fri Jun 21 11:41:34 2013 +0200 @@ -175,7 +175,7 @@ StructuredGraph graph = accessNode.graph(); assert accessNode.getNullCheck() == false; LocationIdentity locationIdentity = accessNode.location().getLocationIdentity(); - if (locationIdentity != ANY_LOCATION) { + if (accessNode.canFloat()) { ValueNode lastLocationAccess = state.getLastLocationAccess(locationIdentity); FloatingAccessNode floatingNode = accessNode.asFloatingNode(lastLocationAccess); floatingNode.setNullCheck(accessNode.getNullCheck());