Mercurial > hg > graal-jvmci-8
changeset 5615:ff7961661b96
improved allocation tracing in NewInstanceSnippets
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 14 Jun 2012 17:03:22 +0200 |
parents | f8eb2cb76a2f |
children | 310ed6650682 |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewInstanceSnippets.java |
diffstat | 1 files changed, 12 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewInstanceSnippets.java Thu Jun 14 16:37:40 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewInstanceSnippets.java Thu Jun 14 17:03:22 2012 +0200 @@ -70,7 +70,7 @@ if (klassState != klassStateFullyInitialized()) { if (logType != null) { Log.print(logType); - Log.println(" - uninitialized"); + Log.println(" - uninit alloc"); } return NewInstanceStubCall.call(hub); } @@ -84,17 +84,21 @@ if (newTop.cmp(BE, end)) { Object instance = cast(top, Object.class); store(thread, 0, threadTlabTopOffset(), newTop); - return formatInstance(hub, size, instance, logType); - } else { + formatInstance(hub, size, instance); if (logType != null) { Log.print(logType); - Log.println(" - stub allocate"); + Log.print(" - fast alloc at "); + Log.printlnAddress(instance); } - return NewInstanceStubCall.call(hub); + return instance; } - } else { - return NewInstanceStubCall.call(hub); } + + if (logType != null) { + Log.print(logType); + Log.println(" - slow alloc"); + } + return NewInstanceStubCall.call(hub); } private static Word asWord(Object object) { @@ -108,7 +112,7 @@ /** * Formats the header of a created instance and zeroes out its body. */ - private static Object formatInstance(Object hub, int size, Object instance, String logType) { + private static void formatInstance(Object hub, int size, Object instance) { Word headerPrototype = cast(load(hub, 0, instanceHeaderPrototypeOffset(), wordKind()), Word.class); store(instance, 0, 0, headerPrototype); store(instance, 0, hubOffset(), hub); @@ -116,13 +120,6 @@ for (int offset = 2 * wordSize(); offset < size; offset += wordSize()) { store(instance, 0, offset, 0); } - if (logType != null) { - Log.print("allocated instance of "); - Log.print(logType); - Log.print(" at "); - Log.printlnAddress(instance); - } - return instance; } @Fold