# HG changeset patch # User Bernhard Urban # Date 1380024695 -7200 # Node ID 7c4595b7ef3ac457ae45833b2f4c81dcce239a40 # Parent 427cbe2bd61521d20bf40a3f5a9378751eb2f17a NewInstanceNode: use INIT_LOCATION; NewArrayNode: use INIT_LOCATION and ARRAY_LENGTH_LOCATION diff -r 427cbe2bd615 -r 7c4595b7ef3a graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Tue Sep 24 14:11:34 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Tue Sep 24 14:11:35 2013 +0200 @@ -289,7 +289,7 @@ registerForeignCall(VM_MESSAGE_C, c.vmMessageAddress, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, REEXECUTABLE, NO_LOCATIONS); link(new NewInstanceStub(this, r, target, registerStubCall(NEW_INSTANCE, REEXECUTABLE, NOT_LEAF, ANY_LOCATION))); - link(new NewArrayStub(this, r, target, registerStubCall(NEW_ARRAY, REEXECUTABLE, NOT_LEAF, ANY_LOCATION))); + link(new NewArrayStub(this, r, target, registerStubCall(NEW_ARRAY, REEXECUTABLE, NOT_LEAF, INIT_LOCATION))); link(new ExceptionHandlerStub(this, r, target, foreignCalls.get(EXCEPTION_HANDLER))); link(new UnwindExceptionToCallerStub(this, r, target, registerStubCall(UNWIND_EXCEPTION_TO_CALLER, NOT_REEXECUTABLE, NOT_LEAF, ANY_LOCATION))); link(new VerifyOopStub(this, r, target, registerStubCall(VERIFY_OOP, REEXECUTABLE, LEAF, NO_LOCATIONS))); diff -r 427cbe2bd615 -r 7c4595b7ef3a graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Tue Sep 24 14:11:34 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Tue Sep 24 14:11:35 2013 +0200 @@ -23,7 +23,6 @@ package com.oracle.graal.hotspot.replacements; import static com.oracle.graal.api.code.UnsignedMath.*; -import static com.oracle.graal.api.meta.LocationIdentity.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.nodes.PiArrayNode.*; import static com.oracle.graal.nodes.PiNode.*; @@ -58,6 +57,9 @@ */ public class NewObjectSnippets implements Snippets { + public static final LocationIdentity INIT_LOCATION = new NamedLocationIdentity("Initialization"); + public static final LocationIdentity ARRAY_LENGTH_LOCATION = new NamedLocationIdentity("ArrayLength"); + @Snippet public static Word allocate(int size) { Word thread = thread(); @@ -204,12 +206,12 @@ new_seqInit.inc(); explodeLoop(); for (int offset = instanceHeaderSize(); offset < size; offset += wordSize()) { - memory.writeWord(offset, Word.zero(), ANY_LOCATION); + memory.writeWord(offset, Word.zero(), INIT_LOCATION); } } else { new_loopInit.inc(); for (int offset = instanceHeaderSize(); offset < size; offset += wordSize()) { - memory.writeWord(offset, Word.zero(), ANY_LOCATION); + memory.writeWord(offset, Word.zero(), INIT_LOCATION); } } } @@ -220,7 +222,7 @@ * Formats some allocated memory with an object header and zeroes out the rest. */ public static Object formatArray(Word hub, int allocationSize, int length, int headerSize, Word memory, Word prototypeMarkWord, boolean fillContents) { - memory.writeInt(arrayLengthOffset(), length, ANY_LOCATION); + memory.writeInt(arrayLengthOffset(), length, ARRAY_LENGTH_LOCATION); /* * store hub last as the concurrent garbage collectors assume length is valid if hub field * is not null @@ -228,7 +230,7 @@ initializeObjectHeader(memory, prototypeMarkWord, hub); if (fillContents) { for (int offset = headerSize; offset < allocationSize; offset += wordSize()) { - memory.writeWord(offset, Word.zero(), ANY_LOCATION); + memory.writeWord(offset, Word.zero(), INIT_LOCATION); } } return memory.toObject();