Skip to content

Commit

Permalink
Add Identityless node flag
Browse files Browse the repository at this point in the history
This flag expresses that the identity of the resulting object of a node
is unobservable. Eventually, this flag will enable transformations that
take advantage of the lack of identity.

Signed-off-by: Leonardo Banderali <leonardo2718@protonmail.com>
  • Loading branch information
Leonardo2718 committed Jan 30, 2020
1 parent 6d5cab8 commit 936fc56
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
29 changes: 29 additions & 0 deletions compiler/il/OMRNode.cpp
Expand Up @@ -5751,6 +5751,35 @@ OMR::Node::printIsHeapificationAlloc()
}


bool
OMR::Node::isIdentityless()
{
TR_ASSERT(self()->getOpCode().isNew(), "Opcode must be isNew");
return _flags.testAny(Identityless);
}

void
OMR::Node::setIdentityless(bool v)
{
TR::Compilation * c = TR::comp();
TR_ASSERT(self()->getOpCode().isNew(), "Opcode must be isNew");
if (performNodeTransformation2(c,"O^O NODE FLAGS: Setting Identityless flag on node %p to %d\n", self(), v))
_flags.set(Identityless, v);
}

bool
OMR::Node::chkIdentityless()
{
return self()->getOpCode().isNew() && _flags.testAny(Identityless);
}

const char *
OMR::Node::printIsIdentityless()
{
return self()->chkIdentityless() ? "Identityless " : "";
}



bool
OMR::Node::isLiveMonitorInitStore()
Expand Down
9 changes: 8 additions & 1 deletion compiler/il/OMRNode.hpp
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corp. and others
* Copyright (c) 2000, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -1121,11 +1121,17 @@ class OMR_EXTENSIBLE Node
bool chkHeapificationStore();
const char * printIsHeapificationStore();

// Flags only used for isNew() opcodes
bool isHeapificationAlloc();
void setHeapificationAlloc(bool v);
bool chkHeapificationAlloc();
const char * printIsHeapificationAlloc();

bool isIdentityless();
void setIdentityless(bool v);
bool chkIdentityless();
const char * printIsIdentityless();

bool isLiveMonitorInitStore();
void setLiveMonitorInitStore(bool v);
bool chkLiveMonitorInitStore();
Expand Down Expand Up @@ -2086,6 +2092,7 @@ class OMR_EXTENSIBLE Node
// Flags only used for isNew() opcodes
//
HeapificationAlloc = 0x00001000,
Identityless = 0x00002000,

// Flag used by TR::newarray and TR::anewarray
//
Expand Down
3 changes: 2 additions & 1 deletion compiler/ras/Debug.cpp
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corp. and others
* Copyright (c) 2000, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -1095,6 +1095,7 @@ TR_Debug::nodePrintAllFlags(TR::Node *node, TR_PrettyPrinterString &output)
#endif
output.append(format, node->printIsHeapificationStore());
output.append(format, node->printIsHeapificationAlloc());
output.append(format, node->printIsIdentityless());
output.append(format, node->printIsLiveMonitorInitStore());
output.append(format, node->printIsMethodEnterExitGuard());
output.append(format, node->printReturnIsDummy());
Expand Down

0 comments on commit 936fc56

Please sign in to comment.