From 03919dffae51f81b21dc8c4d4939786aa16f644d Mon Sep 17 00:00:00 2001 From: "Bohao(Aaron) Wang" Date: Fri, 24 May 2019 15:27:42 -0400 Subject: [PATCH] Overload incRefCountForOpaquePseudoRegister in OpenJ9 This patch overloads J9::Z::CodeGenerator::incRefCountForOpaquePseudoRegister in OpenJ9 with less parameters. This is the 2/6 step to simpify this function. Issue: eclipse/omr#1855 Signed-off-by: Bohao(Aaron) Wang --- runtime/compiler/z/codegen/J9CodeGenerator.cpp | 18 ++++++++++++++++++ runtime/compiler/z/codegen/J9CodeGenerator.hpp | 2 ++ 2 files changed, 20 insertions(+) diff --git a/runtime/compiler/z/codegen/J9CodeGenerator.cpp b/runtime/compiler/z/codegen/J9CodeGenerator.cpp index f9a3541375f..74644d67a63 100644 --- a/runtime/compiler/z/codegen/J9CodeGenerator.cpp +++ b/runtime/compiler/z/codegen/J9CodeGenerator.cpp @@ -3528,6 +3528,24 @@ J9::Z::CodeGenerator::incRefCountForOpaquePseudoRegister(TR::Node * node, TR::Co } } +//AN OVERLOAD OF ABOVE FUNCTION; DOES EXACTLY THE SAME JOB +void +J9::Z::CodeGenerator::incRefCountForOpaquePseudoRegister(TR::Node * node) + { + if (node->getOpaquePseudoRegister()) + { + TR_OpaquePseudoRegister *reg = node->getOpaquePseudoRegister(); + TR_StorageReference *ref = reg->getStorageReference(); + if (ref && ref->isNodeBased() && ref->getNodeReferenceCount() > 0) + { + if (self()->traceBCDCodeGen()) + self()->comp()->getDebug()->trace("\tnode %s (%p) with storageRef #%d (%s): increment nodeRefCount %d->%d when artificially incrementing ref count\n", + node->getOpCode().getName(),node,ref->getReferenceNumber(),self()->comp()->getDebug()->getName(ref->getSymbol()),ref->getNodeReferenceCount(),ref->getNodeReferenceCount()+1); + ref->incrementNodeReferenceCount(); + } + } + } + TR::Instruction* J9::Z::CodeGenerator::generateVMCallHelperSnippet(TR::Instruction* cursor, TR::LabelSymbol* vmCallHelperSnippetLabel) { TR::Compilation* comp = self()->comp(); diff --git a/runtime/compiler/z/codegen/J9CodeGenerator.hpp b/runtime/compiler/z/codegen/J9CodeGenerator.hpp index 68b2c7188d8..2acf2c98956 100644 --- a/runtime/compiler/z/codegen/J9CodeGenerator.hpp +++ b/runtime/compiler/z/codegen/J9CodeGenerator.hpp @@ -260,6 +260,8 @@ class OMR_EXTENSIBLE CodeGenerator : public J9::CodeGenerator #endif void incRefCountForOpaquePseudoRegister(TR::Node * node, TR::CodeGenerator * cg, TR::Compilation * comp); + //OVERLOAD THE ABOVE FUNCTION + void incRefCountForOpaquePseudoRegister(TR::Node * node); /** \brief * Generates a VM call helper sequence along with the necessary metadata in the instruction stream which when