Skip to content

Commit

Permalink
Add compilation local TR::Environment
Browse files Browse the repository at this point in the history
Signed-off-by: Irwin D'Souza <dsouzai.gh@gmail.com>
  • Loading branch information
dsouzai committed Dec 6, 2019
1 parent dc3b095 commit 9c8092e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/compile/OMRCompilation.cpp
Expand Up @@ -294,6 +294,7 @@ OMR::Compilation::Compilation(
_gpuPtxCount(0),
_bitVectorPool(self()),
_typeLayoutMap((LayoutComparator()), LayoutAllocator(self()->region())),
_target(TR::Compiler->target),
_tlsManager(*self())
{

Expand Down
12 changes: 12 additions & 0 deletions compiler/compile/OMRCompilation.hpp
Expand Up @@ -1071,6 +1071,16 @@ class OMR_EXTENSIBLE Compilation
*/
const TR::TypeLayout* typeLayout(TR_OpaqueClassBlock * clazz);

/**
* \brief
* Returns a copy of the target env singleton that has been specialized
* for the current compilation
*
* \return
* reference to the copy of the target env
*/
TR::Environment& target() { return _target; }

private:
void resetVisitCounts(vcount_t, TR::ResolvedMethodSymbol *);
int16_t restoreInlineDepthUntil(int32_t stopIndex, TR_ByteCodeInfo &currentInfo);
Expand Down Expand Up @@ -1287,6 +1297,8 @@ class OMR_EXTENSIBLE Compilation
typedef std::map<TR_OpaqueClassBlock *, const TR::TypeLayout *, LayoutComparator, LayoutAllocator> TypeLayoutMap;
TypeLayoutMap _typeLayoutMap;

TR::Environment _target;

/*
* This must be last
* NOTE: TLS for Compilation needs to be set before any object that may use it is initialized.
Expand Down

0 comments on commit 9c8092e

Please sign in to comment.