# HG changeset patch # User Tom Rodriguez # Date 1402681026 25200 # Node ID 64d8c6c8a00cbca2d2cef969428b2834305145ce # Parent 99e2e006ade2a7f9e10da9d3381ac21000c3a6b4 derive native compiler thread name from Compiler::name diff -r 99e2e006ade2 -r 64d8c6c8a00c graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java Fri Jun 13 18:19:58 2014 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java Fri Jun 13 10:37:06 2014 -0700 @@ -67,6 +67,8 @@ */ protected int outgoingSize; + protected int freeSpill4 = -1; + /** * Determines if this frame has values on the stack for outgoing calls. */ @@ -295,8 +297,19 @@ } } int size = spillSlotSize(kind); - spillSize = NumUtil.roundUp(spillSize + size, size); - return allocateNewSpillSlot(kind, 0); + if (size == 4 && freeSpill4 != -1) { + int offset = spillSize - freeSpill4 - size; + freeSpill4 = -1; + return allocateNewSpillSlot(kind, offset); + } else { + int origSpillSize = spillSize; + spillSize = NumUtil.roundUp(spillSize + size, size); + int waste = (spillSize - origSpillSize) - size; + if (waste == 4 && freeSpill4 == -1) { + freeSpill4 = origSpillSize; + } + return allocateNewSpillSlot(kind, 0); + } } private Set freedSlots; diff -r 99e2e006ade2 -r 64d8c6c8a00c src/share/vm/compiler/compileBroker.cpp --- a/src/share/vm/compiler/compileBroker.cpp Fri Jun 13 18:19:58 2014 +0200 +++ b/src/share/vm/compiler/compileBroker.cpp Fri Jun 13 10:37:06 2014 -0700 @@ -1031,7 +1031,7 @@ char name_buffer[256]; for (int i = 0; i < c2_compiler_count; i++) { // Create a name for our thread. - sprintf(name_buffer, "C2 CompilerThread%d", i); + sprintf(name_buffer, "%s CompilerThread%d", _compilers[1]->name(), i); CompilerCounters* counters = new CompilerCounters("compilerThread", i, CHECK); // Shark and C2 CompilerThread* new_thread = make_compiler_thread(name_buffer, _c2_method_queue, counters, _compilers[1], CHECK);