Skip to content

Commit

Permalink
Merge pull request #12823 from dsouzai/ordered_compiles
Browse files Browse the repository at this point in the history
Remove unused TR::CompilationTracingFacility
  • Loading branch information
mpirvu committed Jun 3, 2021
2 parents 3288ea2 + 3fae74e commit 6c17926
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 193 deletions.
48 changes: 0 additions & 48 deletions runtime/compiler/control/CompilationOperations.hpp

This file was deleted.

8 changes: 0 additions & 8 deletions runtime/compiler/control/CompilationRuntime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
#include "AtomicSupport.hpp"
#include "compile/CompilationTypes.hpp"
#include "control/CompilationPriority.hpp"
#include "control/CompilationOperations.hpp"
#include "control/CompilationTracingFacility.hpp"
#include "control/ClassHolder.hpp"
#include "env/CpuUtilization.hpp"
#include "env/Processors.hpp"
Expand Down Expand Up @@ -928,9 +926,6 @@ class CompilationInfo
int32_t getIprofilerMaxCount() const { return _iprofilerMaxCount; }
void setIprofilerMaxCount(int32_t n) { _iprofilerMaxCount = n; }

bool compTracingEnabled() const { return _compilationTracingFacility.isInitialized(); }
void addCompilationTraceEntry(J9VMThread * vmThread, TR_CompilationOperations op, uint32_t otherData=0);

TR_SharedCacheRelocationRuntime *reloRuntime() { return &_sharedCacheReloRuntime; }

int32_t incNumSeriousFailures() { return ++_numSeriousFailures; } // no atomicity guarantees for the increment
Expand Down Expand Up @@ -1084,8 +1079,6 @@ class CompilationInfo
static int32_t LARGE_QUEUE;
static int32_t VERY_LARGE_QUEUE;

static const char *OperationNames[];

struct CompilationStatistics _stats;
struct CompilationStatsPerInterval _intervalStats;
TR_PersistentArray<TR_SignatureCountPair *> *_persistedMethods;
Expand Down Expand Up @@ -1246,7 +1239,6 @@ class CompilationInfo
TR_LowPriorityCompQueue _lowPriorityCompilationScheduler;
TR_JProfilingQueue _JProfilingQueue;

TR::CompilationTracingFacility _compilationTracingFacility; // Must be initialized before using
TR_CpuEntitlement _cpuEntitlement;
TR_JitSampleInfo _jitSampleInfo;
TR_SharedCacheRelocationRuntime _sharedCacheReloRuntime;
Expand Down
42 changes: 2 additions & 40 deletions runtime/compiler/control/CompilationThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,6 @@ void
TR::CompilationInfoPerThread::setCompilationThreadState(CompilationThreadState v)
{
TR::CompilationInfoPerThreadBase::setCompilationThreadState(v);
getCompilationInfo()->addCompilationTraceEntry(_compilationThread, OP_StateChange, (uint8_t)v);
}

bool
Expand Down Expand Up @@ -1171,12 +1170,6 @@ TR::CompilationInfo::CompilationInfo(J9JITConfig *jitConfig) :
}
statCompErrors.init("CompilationErrors", compilationErrorNames, 0);

// Options might not exist at this point
//
static char *compTracing = feGetEnv("TR_CompTracing");
if (compTracing)
_compilationTracingFacility.initialize(256); // the size must be a power of two

setSamplerState(TR::CompilationInfo::SAMPLER_NOT_INITIALIZED);

setIsWarmSCC(TR_maybe);
Expand Down Expand Up @@ -1427,54 +1420,25 @@ void TR::CompilationInfo::rtlogRelease()
_rtlogMonitor->exit();
}

const char * TR::CompilationInfo::OperationNames[] =
{
"EMPTY",
"HasAcquiredCompilationMonitor",
"WillReleaseCompilationMonitor",
"WillNotifyCompilationMonitor",
"WillWaitOnCompilationMonitor",
"HasFinishedWaitingOnCompilationMonitor",
"Changed state",
"WillWaitOnSlotMonitorAfterCompMonRelease",
"CompileOnSeparateThreadEnter",
"INVALID"
};

void TR::CompilationInfo::addCompilationTraceEntry(J9VMThread * vmThread, TR_CompilationOperations op, uint32_t otherData)
{
if (compTracingEnabled())
{
_compilationTracingFacility.addNewEntry(vmThread, op, (uint32_t)otherData);
}
}


void TR::CompilationInfo::acquireCompMonitor(J9VMThread *vmThread) // used when we know we have a compilation monitor
{
getCompilationMonitor()->enter();
addCompilationTraceEntry(vmThread, OP_HasAcquiredCompilationMonitor);
}

void TR::CompilationInfo::releaseCompMonitor(J9VMThread *vmThread) // used when we know we have a compilation monitor
{
addCompilationTraceEntry(vmThread, OP_WillReleaseCompilationMonitor);
getCompilationMonitor()->exit();
}

void TR::CompilationInfo::waitOnCompMonitor(J9VMThread *vmThread)
{
addCompilationTraceEntry(vmThread, OP_WillWaitOnCompilationMonitor);
getCompilationMonitor()->wait();
addCompilationTraceEntry(vmThread, OP_HasFinishedWaitingOnCompilationMonitor);
}

intptr_t TR::CompilationInfo::waitOnCompMonitorTimed(J9VMThread *vmThread, int64_t millis, int32_t nanos)
{
intptr_t retCode;
addCompilationTraceEntry(vmThread, OP_WillWaitOnCompilationMonitor);
retCode = getCompilationMonitor()->wait_timed(millis, nanos);
addCompilationTraceEntry(vmThread, OP_HasFinishedWaitingOnCompilationMonitor);
return retCode;
}

Expand Down Expand Up @@ -3464,8 +3428,6 @@ void TR::CompilationInfo::stopCompilationThreads()
#endif
acquireCompMonitor(vmThread);

addCompilationTraceEntry(vmThread, OP_WillStopCompilationThreads);

// Cycle through all non-diagnostic threads and stop them
for (uint8_t i = 0; i < getNumTotalCompilationThreads(); i++)
{
Expand Down Expand Up @@ -5860,7 +5822,7 @@ void *TR::CompilationInfo::compileOnSeparateThread(J9VMThread * vmThread, TR::Il
debugPrint(vmThread, "\tapplication thread acquiring compilation monitor\n");
acquireCompMonitor(vmThread);
debugPrint(vmThread, "+CM\n");
addCompilationTraceEntry(vmThread, OP_CompileOnSeparateThreadEnter);

// Even before checking whether compilation threads are active, we need
// to check if a compilation for this body has already been performed

Expand Down Expand Up @@ -6316,7 +6278,7 @@ void *TR::CompilationInfo::compileOnSeparateThread(J9VMThread * vmThread, TR::Il
// Before releasing the compilation monitor, mark that we have one more thead waiting for this entry
//
entry->_numThreadsWaiting++;
addCompilationTraceEntry(vmThread, OP_WillWaitOnSlotMonitorAfterCompMonRelease);

// Release the compilation monitor
//
debugPrint(vmThread, "\tapplication thread releasing compilation monitor\n");
Expand Down
94 changes: 0 additions & 94 deletions runtime/compiler/control/CompilationTracingFacility.hpp

This file was deleted.

4 changes: 1 addition & 3 deletions runtime/compiler/control/MethodToBeCompiled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,13 @@ void TR_MethodToBeCompiled::acquireSlotMonitor(J9VMThread *vmThread)
{
getMonitor()->enter();
// Must have the compilationMonitor in hand to be able to call this method
//addCompilationTraceEntry(vmThread, OP_HasAcquiredCompilationMonitor);
//fprintf(stderr, "Thread %p has acquired slot monitor\n", vmThread);
}

void TR_MethodToBeCompiled::releaseSlotMonitor(J9VMThread *vmThread)
{
// Must have the compilationMonitor in hand to be able to call this method
//addCompilationTraceEntry(vmThread, OP_HasAcquiredCompilationMonitor);
//fprintf(stderr, "Thread %p will release slot monitor\n", vmThread);
//fprintf(stderr, "Thread %p will release slot monitor\n", vmThread);
getMonitor()->exit();
}

Expand Down

0 comments on commit 6c17926

Please sign in to comment.