Skip to content

Commit 2f18046

Browse files
Store server stream in compilation object for out-of-process compilations
Signed-off-by: Alexey Khrabrov <khrabrov@cs.toronto.edu>
1 parent f73492a commit 2f18046

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

runtime/compiler/compile/J9Compilation.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ J9::Compilation::Compilation(int32_t id,
192192
_remoteCompilation(false),
193193
_serializedRuntimeAssumptions(getTypedAllocator<SerializedRuntimeAssumption *>(self()->allocator())),
194194
_clientData(NULL),
195+
_stream(NULL),
195196
_globalMemory(*::trPersistentMemory, heapMemoryRegion),
196197
_perClientMemory(_trMemory),
197198
_methodsRequiringTrampolines(getTypedAllocator<TR_OpaqueMethodBlock *>(self()->allocator())),

runtime/compiler/compile/J9Compilation.hpp

+14-11
Original file line numberDiff line numberDiff line change
@@ -327,21 +327,22 @@ class OMR_EXTENSIBLE Compilation : public OMR::CompilationConnector
327327
#if defined(J9VM_OPT_JITSERVER)
328328
static bool isOutOfProcessCompilation() { return _outOfProcessCompilation; } // server side
329329
static void setOutOfProcessCompilation() { _outOfProcessCompilation = true; }
330+
330331
bool isRemoteCompilation() const { return _remoteCompilation; } // client side
331332
void setRemoteCompilation() { _remoteCompilation = true; }
332-
TR::list<SerializedRuntimeAssumption*>& getSerializedRuntimeAssumptions() { return _serializedRuntimeAssumptions; }
333+
334+
TR::list<SerializedRuntimeAssumption *> &getSerializedRuntimeAssumptions() { return _serializedRuntimeAssumptions; }
335+
333336
ClientSessionData *getClientData() const { return _clientData; }
334337
void setClientData(ClientSessionData *clientData) { _clientData = clientData; }
335-
void switchToPerClientMemory()
336-
{
337-
_trMemory = _perClientMemory;
338-
}
339-
void switchToGlobalMemory()
340-
{
341-
_trMemory = &_globalMemory;
342-
}
343338

344-
TR::list<TR_OpaqueMethodBlock *>& getMethodsRequiringTrampolines() { return _methodsRequiringTrampolines; }
339+
JITServer::ServerStream *getStream() const { return _stream; }
340+
void setStream(JITServer::ServerStream *stream) { _stream = stream; }
341+
342+
void switchToPerClientMemory() { _trMemory = _perClientMemory; }
343+
void switchToGlobalMemory() { _trMemory = &_globalMemory; }
344+
345+
TR::list<TR_OpaqueMethodBlock *> &getMethodsRequiringTrampolines() { return _methodsRequiringTrampolines; }
345346

346347
bool isAOTCacheStore() const { return _aotCacheStore; }
347348
void setAOTCacheStore(bool store) { _aotCacheStore = store; }
@@ -439,7 +440,7 @@ class OMR_EXTENSIBLE Compilation : public OMR::CompilationConnector
439440
#if defined(J9VM_OPT_JITSERVER)
440441
// This list contains assumptions created during the compilation at the JITServer
441442
// It needs to be sent to the client at the end of compilation
442-
TR::list<SerializedRuntimeAssumption*> _serializedRuntimeAssumptions;
443+
TR::list<SerializedRuntimeAssumption *> _serializedRuntimeAssumptions;
443444
// The following flag is set when this compilation is performed in a
444445
// VM that does not have the runtime part (server side in JITServer)
445446
static bool _outOfProcessCompilation;
@@ -449,6 +450,8 @@ class OMR_EXTENSIBLE Compilation : public OMR::CompilationConnector
449450
// Client session data for the client that requested this out-of-process
450451
// compilation (at the JITServer); unused (always NULL) at the client side
451452
ClientSessionData *_clientData;
453+
// Server stream used by this out-of-process compilation; always NULL at the client
454+
JITServer::ServerStream *_stream;
452455

453456
TR_Memory *_perClientMemory;
454457
TR_Memory _globalMemory;

runtime/compiler/control/CompilationThread.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,7 @@ TR::CompilationInfo::CompilationInfo(J9JITConfig *jitConfig) :
11671167
_activationPolicy = JITServer::CompThreadActivationPolicy::AGGRESSIVE;
11681168
_sharedROMClassCache = NULL;
11691169
_JITServerAOTCacheMap = NULL;
1170+
_JITServerAOTDeserializer = NULL;
11701171
#endif /* defined(J9VM_OPT_JITSERVER) */
11711172
}
11721173

@@ -8567,6 +8568,7 @@ TR::CompilationInfoPerThreadBase::wrappedCompile(J9PortLibrary *portLib, void *
85678568
// Create the KOT by default at the server as long as it is not disabled at the client.
85688569
compiler->getOrCreateKnownObjectTable();
85698570
compiler->setClientData(that->getClientData());
8571+
compiler->setStream(that->_methodBeingCompiled->_stream);
85708572
}
85718573
#endif /* defined(J9VM_OPT_JITSERVER) */
85728574

0 commit comments

Comments
 (0)