changeset 10491:e98e021d1e7e

Forbid direct eden allocation when G1 is enabled
author Christos Kotselidis <christos.kotselidis@oracle.com>
date Fri, 21 Jun 2013 11:08:10 +0200
parents 89c15a40ef35
children 34444b095a51
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java	Thu Jun 20 17:30:39 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java	Fri Jun 21 11:08:10 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);
         }