# HG changeset patch # User Doug Simon # Date 1340026747 -7200 # Node ID 1cfa35d467de40c3092346d7c17cc82953225140 # Parent 731789427441496342f3d67098b6034aab724030 removed support for compiling allocation of instances of non-initialized classes diff -r 731789427441 -r 1cfa35d467de graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewInstanceSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewInstanceSnippets.java Mon Jun 18 10:07:33 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewInstanceSnippets.java Mon Jun 18 15:39:07 2012 +0200 @@ -61,21 +61,9 @@ public static Object newInstance( @Parameter("hub") Object hub, @ConstantParameter("size") int size, - @ConstantParameter("checkInit") boolean checkInit, @ConstantParameter("useTLAB") boolean useTLAB, @ConstantParameter("logType") String logType) { - if (checkInit) { - int klassState = load(hub, 0, klassStateOffset(), Kind.Int); - if (klassState != klassStateFullyInitialized()) { - if (logType != null) { - Log.print(logType); - Log.println(" - uninit alloc"); - } - return verifyOop(NewInstanceStubCall.call(hub)); - } - } - if (useTLAB) { Word thread = asWord(register(r15, wordKind())); Word top = loadWord(thread, threadTlabTopOffset()); @@ -135,16 +123,6 @@ } @Fold - private static int klassStateOffset() { - return HotSpotGraalRuntime.getInstance().getConfig().klassStateOffset; - } - - @Fold - private static int klassStateFullyInitialized() { - return HotSpotGraalRuntime.getInstance().getConfig().klassStateFullyInitialized; - } - - @Fold private static int threadTlabTopOffset() { return HotSpotGraalRuntime.getInstance().getConfig().threadTlabTopOffset; } @@ -186,7 +164,7 @@ this.cache = new Cache(runtime); this.useTLAB = useTLAB; try { - newInstance = runtime.getResolvedJavaMethod(NewInstanceSnippets.class.getDeclaredMethod("newInstance", Object.class, int.class, boolean.class, boolean.class, String.class)); + newInstance = runtime.getResolvedJavaMethod(NewInstanceSnippets.class.getDeclaredMethod("newInstance", Object.class, int.class, boolean.class, String.class)); } catch (NoSuchMethodException e) { throw new GraalInternalError(e); } @@ -203,7 +181,7 @@ int instanceSize = type.instanceSize(); assert (instanceSize % wordSize()) == 0; assert instanceSize >= 0; - Key key = new Key(newInstance).add("size", instanceSize).add("checkInit", !type.isInitialized()).add("useTLAB", useTLAB).add("logType", LOG_ALLOCATION ? type.name() : null); + Key key = new Key(newInstance).add("size", instanceSize).add("useTLAB", useTLAB).add("logType", LOG_ALLOCATION ? type.name() : null); Arguments arguments = arguments("hub", hub); SnippetTemplate template = cache.get(key); Debug.log("Lowering newInstance in %s: node=%s, template=%s, arguments=%s", graph, newInstanceNode, template, arguments); diff -r 731789427441 -r 1cfa35d467de graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Mon Jun 18 10:07:33 2012 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Mon Jun 18 15:39:07 2012 +0200 @@ -662,7 +662,7 @@ void genNewInstance(int cpi) { JavaType type = lookupType(cpi, NEW); - if (type instanceof ResolvedJavaType) { + if (type instanceof ResolvedJavaType && ((ResolvedJavaType) type).isInitialized()) { NewInstanceNode n = currentGraph.add(new NewInstanceNode((ResolvedJavaType) type)); frameState.apush(append(n)); } else {